49 |
|
|
50 |
// just symbol prototyping |
// just symbol prototyping |
51 |
class EngineChannel; |
class EngineChannel; |
52 |
|
class Engine; |
53 |
|
|
54 |
/** @brief Gig instrument manager |
/** @brief Gig instrument manager |
55 |
* |
* |
73 |
virtual InstrumentManager::mode_t GetMode(const instrument_id_t& ID); |
virtual InstrumentManager::mode_t GetMode(const instrument_id_t& ID); |
74 |
virtual void SetMode(const instrument_id_t& ID, InstrumentManager::mode_t Mode); |
virtual void SetMode(const instrument_id_t& ID, InstrumentManager::mode_t Mode); |
75 |
virtual String GetInstrumentName(instrument_id_t ID); |
virtual String GetInstrumentName(instrument_id_t ID); |
76 |
virtual String GetInstrumentTypeName(instrument_id_t ID); |
virtual String GetInstrumentDataStructureName(instrument_id_t ID); |
77 |
virtual String GetInstrumentTypeVersion(instrument_id_t ID); |
virtual String GetInstrumentDataStructureVersion(instrument_id_t ID); |
78 |
virtual void LaunchInstrumentEditor(instrument_id_t ID) throw (InstrumentManagerException); |
virtual void LaunchInstrumentEditor(instrument_id_t ID) throw (InstrumentManagerException); |
79 |
|
|
80 |
// implementation of derived abstract method from 'InstrumentEditorListener' |
// implementation of derived abstract methods from 'InstrumentEditorListener' |
81 |
virtual void OnInstrumentEditorQuit(InstrumentEditor* pSender); |
virtual void OnInstrumentEditorQuit(InstrumentEditor* pSender); |
82 |
|
virtual void OnSamplesToBeRemoved(std::set<void*> Samples, InstrumentEditor* pSender); |
83 |
|
virtual void OnSamplesRemoved(InstrumentEditor* pSender); |
84 |
|
virtual void OnDataStructureToBeChanged(void* pStruct, String sStructType, InstrumentEditor* pSender); |
85 |
|
virtual void OnDataStructureChanged(void* pStruct, String sStructType, InstrumentEditor* pSender); |
86 |
|
virtual void OnSampleReferenceChanged(void* pOldSample, void* pNewSample, InstrumentEditor* pSender); |
87 |
|
|
88 |
void HandBackInstrument(::gig::Instrument* pResource, InstrumentConsumer* pConsumer, |
void HandBackInstrument(::gig::Instrument* pResource, InstrumentConsumer* pConsumer, |
89 |
::gig::DimensionRegion** dimRegionsInUse); |
::gig::DimensionRegion** dimRegionsInUse); |
90 |
void HandBackDimReg(::gig::DimensionRegion* pDimReg); |
void HandBackDimReg(::gig::DimensionRegion* pDimReg); |
91 |
|
|
92 |
protected: |
protected: |
93 |
|
// implementation of derived abstract methods from 'ResourceManager' |
94 |
virtual ::gig::Instrument* Create(instrument_id_t Key, InstrumentConsumer* pConsumer, void*& pArg); |
virtual ::gig::Instrument* Create(instrument_id_t Key, InstrumentConsumer* pConsumer, void*& pArg); |
95 |
virtual void Destroy(::gig::Instrument* pResource, void* pArg); |
virtual void Destroy(::gig::Instrument* pResource, void* pArg); |
96 |
virtual void OnBorrow(::gig::Instrument* pResource, InstrumentConsumer* pConsumer, void*& pArg); |
virtual void OnBorrow(::gig::Instrument* pResource, InstrumentConsumer* pConsumer, void*& pArg); |
99 |
|
|
100 |
class GigResourceManager : public ResourceManager<String, ::gig::File> { |
class GigResourceManager : public ResourceManager<String, ::gig::File> { |
101 |
protected: |
protected: |
102 |
|
// implementation of derived abstract methods from 'ResourceManager' |
103 |
virtual ::gig::File* Create(String Key, GigConsumer* pConsumer, void*& pArg); |
virtual ::gig::File* Create(String Key, GigConsumer* pConsumer, void*& pArg); |
104 |
virtual void Destroy(::gig::File* pResource, void* pArg); |
virtual void Destroy(::gig::File* pResource, void* pArg); |
105 |
virtual void OnBorrow(::gig::File* pResource, GigConsumer* pConsumer, void*& pArg) {} // ignore |
virtual void OnBorrow(::gig::File* pResource, GigConsumer* pConsumer, void*& pArg) {} // ignore |
111 |
} Gigs; |
} Gigs; |
112 |
|
|
113 |
void CacheInitialSamples(::gig::Sample* pSample, gig::EngineChannel* pEngineChannel); |
void CacheInitialSamples(::gig::Sample* pSample, gig::EngineChannel* pEngineChannel); |
114 |
|
void CacheInitialSamples(::gig::Sample* pSample, gig::Engine* pEngine); |
115 |
|
void UncacheInitialSamples(::gig::Sample* pSample); |
116 |
|
std::vector< ::gig::Instrument*> GetInstrumentsCurrentlyUsedOf(::gig::File* pFile, bool bLock); |
117 |
|
std::set<gig::Engine*> GetEnginesUsing(::gig::Instrument* pFile, bool bLock); |
118 |
|
std::set<gig::Engine*> GetEnginesUsing(::gig::File* pFile, bool bLock); |
119 |
|
bool SampleReferencedByInstrument(::gig::Sample* pSample, ::gig::Instrument* pInstrument); |
120 |
|
void SuspendEnginesUsing(::gig::Instrument* pInstrument); |
121 |
|
void SuspendEnginesUsing(::gig::File* pFile); |
122 |
|
void ResumeAllEngines(); |
123 |
|
|
124 |
struct dimreg_info_t { |
struct dimreg_info_t { |
125 |
int refCount; |
int refCount; |
132 |
|
|
133 |
Mutex InstrumentEditorProxiesMutex; ///< protects the 'InstrumentEditorProxies' map |
Mutex InstrumentEditorProxiesMutex; ///< protects the 'InstrumentEditorProxies' map |
134 |
std::map<InstrumentEditor*, InstrumentConsumer*> InstrumentEditorProxies; ///< here we store the objects that react on instrument specific notifications on behalf of the respective instrument editor |
std::map<InstrumentEditor*, InstrumentConsumer*> InstrumentEditorProxies; ///< here we store the objects that react on instrument specific notifications on behalf of the respective instrument editor |
135 |
|
std::set<Engine*> suspendedEngines; ///< all engines currently completely suspended |
136 |
|
Mutex suspendedEnginesMutex; ///< protects 'suspendedEngines' set |
137 |
}; |
}; |
138 |
|
|
139 |
}} // namespace LinuxSampler::gig |
}} // namespace LinuxSampler::gig |