56 |
* Sampler engine for the Gigasampler format. |
* Sampler engine for the Gigasampler format. |
57 |
*/ |
*/ |
58 |
class Engine : public LinuxSampler::Engine { |
class Engine : public LinuxSampler::Engine { |
59 |
public: |
public: |
60 |
// methods |
// methods |
61 |
Engine(); |
Engine(); |
62 |
~Engine(); |
~Engine(); |
78 |
virtual String Description(); |
virtual String Description(); |
79 |
virtual String Version(); |
virtual String Version(); |
80 |
virtual String EngineName(); |
virtual String EngineName(); |
81 |
|
|
82 |
//protected: |
//protected: |
83 |
static InstrumentResourceManager instruments; |
static InstrumentResourceManager instruments; |
84 |
|
|
85 |
AudioOutputDevice* pAudioOutputDevice; |
AudioOutputDevice* pAudioOutputDevice; |
86 |
uint SampleRate; ///< Sample rate of the engines output audio signal (in Hz) |
uint SampleRate; ///< Sample rate of the engines output audio signal (in Hz) |
87 |
uint MaxSamplesPerCycle; ///< Size of each audio output buffer |
uint MaxSamplesPerCycle; ///< Size of each audio output buffer |
88 |
DiskThread* pDiskThread; |
DiskThread* pDiskThread; |
89 |
RingBuffer<Event>* pEventQueue; ///< Input event queue for engine global events (e.g. SysEx messages). |
RingBuffer<Event>* pEventQueue; ///< Input event queue for engine global events (e.g. SysEx messages). |
90 |
Pool<Voice>* pVoicePool; ///< Contains all voices that can be activated. |
Pool<Voice>* pVoicePool; ///< Contains all voices that can be activated. |
91 |
EventGenerator* pEventGenerator; |
EventGenerator* pEventGenerator; |
92 |
RTList<Event>* pVoiceStealingQueue; ///< All voice-launching events which had to be postponed due to free voice shortage. |
RTList<Event>* pVoiceStealingQueue; ///< All voice-launching events which had to be postponed due to free voice shortage. |
93 |
RTList<Event>* pEvents; ///< All events for the current audio fragment. |
RTList<Event>* pEvents; ///< All events for the current audio fragment. |
94 |
Pool<Event>* pEventPool; ///< Contains all Event objects that can be used. |
Pool<Event>* pEventPool; ///< Contains all Event objects that can be used. |
103 |
int ActiveVoiceCountMax; ///< the maximum voice usage since application start |
int ActiveVoiceCountMax; ///< the maximum voice usage since application start |
104 |
bool SuspensionRequested; |
bool SuspensionRequested; |
105 |
ConditionServer EngineDisabled; |
ConditionServer EngineDisabled; |
106 |
int8_t ScaleTuning[12]; ///< contains optional detune factors (-64..+63 cents) for all 12 semitones of an octave |
int8_t ScaleTuning[12]; ///< contains optional detune factors (-64..+63 cents) for all 12 semitones of an octave |
107 |
int MaxFadeOutPos; ///< The last position in an audio fragment to allow an instant fade out (e.g. for voice stealing) without leading to clicks. |
int MaxFadeOutPos; ///< The last position in an audio fragment to allow an instant fade out (e.g. for voice stealing) without leading to clicks. |
108 |
|
uint32_t RandomSeed; ///< State of the random number generator used by the random dimension. |
109 |
|
|
110 |
void RenderAudio(EngineChannel* pEngineChannel, uint Samples); |
void RenderAudio(EngineChannel* pEngineChannel, uint Samples); |
111 |
void ClearEventLists(); |
void ClearEventLists(); |
112 |
void ImportEvents(RingBuffer<Event>* pEventQueue, uint Samples); |
void ImportEvents(RingBuffer<Event>* pEventQueue, uint Samples); |
113 |
void ProcessNoteOn(EngineChannel* pEngineChannel, Pool<Event>::Iterator& itNoteOnEvent); |
void ProcessNoteOn(EngineChannel* pEngineChannel, Pool<Event>::Iterator& itNoteOnEvent); |
114 |
void ProcessNoteOff(EngineChannel* pEngineChannel, Pool<Event>::Iterator& itNoteOffEvent); |
void ProcessNoteOff(EngineChannel* pEngineChannel, Pool<Event>::Iterator& itNoteOffEvent); |
132 |
friend class EGDecay; |
friend class EGDecay; |
133 |
friend class VCAManipulator; |
friend class VCAManipulator; |
134 |
friend class VCFCManipulator; |
friend class VCFCManipulator; |
135 |
friend class VCOManipulator; |
friend class VCOManipulator; |
136 |
private: |
private: |
137 |
std::list<EngineChannel*> engineChannels; ///< All engine channels of a gig::Engine instance. |
std::list<EngineChannel*> engineChannels; ///< All engine channels of a gig::Engine instance. |
138 |
|
|
139 |
static std::map<AudioOutputDevice*,Engine*> engines; ///< All instances of gig::Engine. |
static std::map<AudioOutputDevice*,Engine*> engines; ///< All instances of gig::Engine. |
140 |
|
|
141 |
uint8_t GSCheckSum(const RingBuffer<uint8_t>::NonVolatileReader AddrReader, uint DataSize); |
uint8_t GSCheckSum(const RingBuffer<uint8_t>::NonVolatileReader AddrReader, uint DataSize); |
142 |
void AdjustScale(int8_t ScaleTunes[12]); |
void AdjustScale(int8_t ScaleTunes[12]); |
143 |
}; |
}; |