29 |
# warning Engine.h included |
# warning Engine.h included |
30 |
#endif // DEBUG_HEADERS |
#endif // DEBUG_HEADERS |
31 |
|
|
32 |
|
#include <map> |
33 |
|
|
34 |
#include "../../common/RingBuffer.h" |
#include "../../common/RingBuffer.h" |
35 |
#include "../../common/RTELMemoryPool.h" |
#include "../../common/RTELMemoryPool.h" |
36 |
#include "../../common/ConditionServer.h" |
#include "../../common/ConditionServer.h" |
46 |
|
|
47 |
namespace LinuxSampler { namespace gig { |
namespace LinuxSampler { namespace gig { |
48 |
|
|
49 |
|
using std::map; |
50 |
|
|
51 |
// just symbol prototyping |
// just symbol prototyping |
52 |
class Voice; |
class Voice; |
53 |
class DiskThread; |
class DiskThread; |
73 |
virtual void SendControlChange(uint8_t Controller, uint8_t Value); |
virtual void SendControlChange(uint8_t Controller, uint8_t Value); |
74 |
virtual float Volume(); |
virtual float Volume(); |
75 |
virtual void Volume(float f); |
virtual void Volume(float f); |
76 |
|
virtual uint Channels(); |
77 |
virtual void Connect(AudioOutputDevice* pAudioOut); |
virtual void Connect(AudioOutputDevice* pAudioOut); |
78 |
virtual void DisconnectAudioOutputDevice(); |
virtual void DisconnectAudioOutputDevice(); |
79 |
|
virtual void SetOutputChannel(uint EngineAudioChannel, uint AudioDeviceChannel); |
80 |
|
virtual int OutputChannel(uint EngineAudioChannel); |
81 |
virtual int RenderAudio(uint Samples); |
virtual int RenderAudio(uint Samples); |
82 |
virtual uint VoiceCount(); |
virtual uint VoiceCount(); |
83 |
virtual uint VoiceCountMax(); |
virtual uint VoiceCountMax(); |
91 |
virtual String EngineName(); |
virtual String EngineName(); |
92 |
virtual String InstrumentFileName(); |
virtual String InstrumentFileName(); |
93 |
virtual int InstrumentIndex(); |
virtual int InstrumentIndex(); |
94 |
|
virtual int InstrumentStatus(); |
95 |
|
|
96 |
// abstract methods derived from interface class 'InstrumentConsumer' |
// abstract methods derived from interface class 'InstrumentConsumer' |
97 |
virtual void ResourceToBeUpdated(::gig::Instrument* pResource, void*& pUpdateArg); |
virtual void ResourceToBeUpdated(::gig::Instrument* pResource, void*& pUpdateArg); |
108 |
static InstrumentResourceManager Instruments; |
static InstrumentResourceManager Instruments; |
109 |
|
|
110 |
AudioOutputDevice* pAudioOutputDevice; |
AudioOutputDevice* pAudioOutputDevice; |
111 |
|
float* pOutputLeft; ///< Audio output channel buffer (left) |
112 |
|
float* pOutputRight; ///< Audio output channel buffer (right) |
113 |
|
int AudioDeviceChannelLeft; ///< audio device channel number to which the left channel is connected to |
114 |
|
int AudioDeviceChannelRight; ///< audio device channel number to which the right channel is connected to |
115 |
|
uint SampleRate; ///< Sample rate of the engines output audio signal (in Hz) |
116 |
|
uint MaxSamplesPerCycle; ///< Size of each audio output buffer |
117 |
DiskThread* pDiskThread; |
DiskThread* pDiskThread; |
118 |
uint8_t ControllerTable[128]; ///< Reflects the current values (0-127) of all MIDI controllers for this engine / sampler channel. |
uint8_t ControllerTable[128]; ///< Reflects the current values (0-127) of all MIDI controllers for this engine / sampler channel. |
119 |
RingBuffer<Event>* pEventQueue; ///< Input event queue. |
RingBuffer<Event>* pEventQueue; ///< Input event queue. |
128 |
float* pSynthesisParameters[Event::destination_count]; ///< Matrix with final synthesis parameters for the current audio fragment which will be used in the main synthesis loop. |
float* pSynthesisParameters[Event::destination_count]; ///< Matrix with final synthesis parameters for the current audio fragment which will be used in the main synthesis loop. |
129 |
biquad_param_t* pBasicFilterParameters; ///< Biquad parameters of the basic bandpass filter. |
biquad_param_t* pBasicFilterParameters; ///< Biquad parameters of the basic bandpass filter. |
130 |
biquad_param_t* pMainFilterParameters; ///< Main biquad parameters of the individual filter (lowpass / bandpass / highpass). |
biquad_param_t* pMainFilterParameters; ///< Main biquad parameters of the individual filter (lowpass / bandpass / highpass). |
131 |
|
map<uint,uint*> ActiveKeyGroups; ///< Contains active keys (in case they belong to a key group) ordered by key group ID. |
132 |
RIFF::File* pRIFF; |
RIFF::File* pRIFF; |
133 |
::gig::File* pGig; |
::gig::File* pGig; |
134 |
::gig::Instrument* pInstrument; |
::gig::Instrument* pInstrument; |
141 |
ConditionServer EngineDisabled; |
ConditionServer EngineDisabled; |
142 |
String InstrumentFile; |
String InstrumentFile; |
143 |
int InstrumentIdx; |
int InstrumentIdx; |
144 |
|
int InstrumentStat; |
145 |
|
|
146 |
void ProcessNoteOn(Event* pNoteOnEvent); |
void ProcessNoteOn(Event* pNoteOnEvent); |
147 |
void ProcessNoteOff(Event* pNoteOffEvent); |
void ProcessNoteOff(Event* pNoteOffEvent); |
148 |
void ProcessPitchbend(Event* pPitchbendEvent); |
void ProcessPitchbend(Event* pPitchbendEvent); |
149 |
void ProcessControlChange(Event* pControlChangeEvent); |
void ProcessControlChange(Event* pControlChangeEvent); |
150 |
void KillVoice(Voice* pVoice); |
void LaunchVoice(Event* pNoteOnEvent, int iLayer = 0); |
151 |
|
void KillVoiceImmediately(Voice* pVoice); |
152 |
void ResetSynthesisParameters(Event::destination_t dst, float val); |
void ResetSynthesisParameters(Event::destination_t dst, float val); |
153 |
void ResetInternal(); |
void ResetInternal(); |
154 |
|
|