3 |
* LinuxSampler - modular, streaming capable sampler * |
* LinuxSampler - modular, streaming capable sampler * |
4 |
* * |
* * |
5 |
* Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * |
* Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * |
6 |
* Copyright (C) 2005 - 2008 Christian Schoenebeck * |
* Copyright (C) 2005 - 2009 Christian Schoenebeck * |
7 |
* * |
* * |
8 |
* This program is free software; you can redistribute it and/or modify * |
* This program is free software; you can redistribute it and/or modify * |
9 |
* it under the terms of the GNU General Public License as published by * |
* it under the terms of the GNU General Public License as published by * |
32 |
#include "../../common/ResourceManager.h" |
#include "../../common/ResourceManager.h" |
33 |
#include "../../drivers/audio/AudioOutputDevice.h" |
#include "../../drivers/audio/AudioOutputDevice.h" |
34 |
#include "../InstrumentManager.h" |
#include "../InstrumentManager.h" |
35 |
|
#include "../../common/ArrayList.h" |
36 |
|
|
37 |
//namespace libgig = gig; |
//namespace libgig = gig; |
38 |
|
|
76 |
virtual String GetInstrumentName(instrument_id_t ID); |
virtual String GetInstrumentName(instrument_id_t ID); |
77 |
virtual String GetInstrumentDataStructureName(instrument_id_t ID); |
virtual String GetInstrumentDataStructureName(instrument_id_t ID); |
78 |
virtual String GetInstrumentDataStructureVersion(instrument_id_t ID); |
virtual String GetInstrumentDataStructureVersion(instrument_id_t ID); |
79 |
virtual void LaunchInstrumentEditor(instrument_id_t ID) throw (InstrumentManagerException); |
virtual InstrumentEditor* LaunchInstrumentEditor(instrument_id_t ID) throw (InstrumentManagerException); |
80 |
virtual std::vector<instrument_id_t> GetInstrumentFileContent(String File) throw (InstrumentManagerException); |
virtual std::vector<instrument_id_t> GetInstrumentFileContent(String File) throw (InstrumentManagerException); |
81 |
virtual instrument_info_t GetInstrumentInfo(instrument_id_t ID) throw (InstrumentManagerException); |
virtual instrument_info_t GetInstrumentInfo(instrument_id_t ID) throw (InstrumentManagerException); |
82 |
|
|
92 |
RTList< ::gig::DimensionRegion*>* pDimRegionsInUse); |
RTList< ::gig::DimensionRegion*>* pDimRegionsInUse); |
93 |
void HandBackDimReg(::gig::DimensionRegion* pDimReg); |
void HandBackDimReg(::gig::DimensionRegion* pDimReg); |
94 |
|
|
95 |
|
#if 0 // currently unused : |
96 |
|
void TrySendNoteOnToEditors(uint8_t Key, uint8_t Velocity, ::gig::Instrument* pInstrument); |
97 |
|
void TrySendNoteOffToEditors(uint8_t Key, uint8_t Velocity, ::gig::Instrument* pInstrument); |
98 |
|
#endif // unused |
99 |
|
|
100 |
protected: |
protected: |
101 |
// implementation of derived abstract methods from 'ResourceManager' |
// implementation of derived abstract methods from 'ResourceManager' |
102 |
virtual ::gig::Instrument* Create(instrument_id_t Key, InstrumentConsumer* pConsumer, void*& pArg); |
virtual ::gig::Instrument* Create(instrument_id_t Key, InstrumentConsumer* pConsumer, void*& pArg); |
122 |
void CacheInitialSamples(::gig::Sample* pSample, gig::Engine* pEngine); |
void CacheInitialSamples(::gig::Sample* pSample, gig::Engine* pEngine); |
123 |
void UncacheInitialSamples(::gig::Sample* pSample); |
void UncacheInitialSamples(::gig::Sample* pSample); |
124 |
std::vector< ::gig::Instrument*> GetInstrumentsCurrentlyUsedOf(::gig::File* pFile, bool bLock); |
std::vector< ::gig::Instrument*> GetInstrumentsCurrentlyUsedOf(::gig::File* pFile, bool bLock); |
125 |
std::set<gig::Engine*> GetEnginesUsing(::gig::Instrument* pFile, bool bLock); |
std::set<gig::EngineChannel*> GetEngineChannelsUsing(::gig::Instrument* pInstrument, bool bLock); |
126 |
|
std::set<gig::Engine*> GetEnginesUsing(::gig::Instrument* pInstrument, bool bLock); |
127 |
std::set<gig::Engine*> GetEnginesUsing(::gig::File* pFile, bool bLock); |
std::set<gig::Engine*> GetEnginesUsing(::gig::File* pFile, bool bLock); |
128 |
bool SampleReferencedByInstrument(::gig::Sample* pSample, ::gig::Instrument* pInstrument); |
bool SampleReferencedByInstrument(::gig::Sample* pSample, ::gig::Instrument* pInstrument); |
129 |
void SuspendEnginesUsing(::gig::Instrument* pInstrument); |
void SuspendEnginesUsing(::gig::Instrument* pInstrument); |
140 |
std::map< ::gig::Sample*, int> SampleRefCount; ///< contains samples that are still in use but belong to a released instrument |
std::map< ::gig::Sample*, int> SampleRefCount; ///< contains samples that are still in use but belong to a released instrument |
141 |
|
|
142 |
Mutex InstrumentEditorProxiesMutex; ///< protects the 'InstrumentEditorProxies' map |
Mutex InstrumentEditorProxiesMutex; ///< protects the 'InstrumentEditorProxies' map |
143 |
std::map<InstrumentEditor*, InstrumentConsumer*> InstrumentEditorProxies; ///< here we store the objects that react on instrument specific notifications on behalf of the respective instrument editor |
ArrayList<InstrumentConsumer*> InstrumentEditorProxies; ///< here we store the objects that react on instrument specific notifications on behalf of the respective instrument editor |
144 |
std::set<Engine*> suspendedEngines; ///< all engines currently completely suspended |
std::set<Engine*> suspendedEngines; ///< all engines currently completely suspended |
145 |
Mutex suspendedEnginesMutex; ///< protects 'suspendedEngines' set |
Mutex suspendedEnginesMutex; ///< protects 'suspendedEngines' set |
146 |
}; |
}; |