34 |
#include "../../common/ConditionServer.h" |
#include "../../common/ConditionServer.h" |
35 |
#include "../common/Engine.h" |
#include "../common/Engine.h" |
36 |
#include "../common/Event.h" |
#include "../common/Event.h" |
37 |
|
#include "../common/BiquadFilter.h" |
38 |
#include "../../lib/fileloader/libgig/gig.h" |
#include "../../lib/fileloader/libgig/gig.h" |
39 |
#include "InstrumentResourceManager.h" |
#include "InstrumentResourceManager.h" |
40 |
#include "../../network/lscp.h" |
#include "../../network/lscp.h" |
41 |
|
|
42 |
#define PITCHBEND_SEMITONES 12 |
#define PITCHBEND_SEMITONES 12 |
43 |
#define MAX_AUDIO_VOICES 64 |
#define MAX_AUDIO_VOICES 128 |
44 |
|
|
45 |
namespace LinuxSampler { namespace gig { |
namespace LinuxSampler { namespace gig { |
46 |
|
|
69 |
virtual void SendControlChange(uint8_t Controller, uint8_t Value); |
virtual void SendControlChange(uint8_t Controller, uint8_t Value); |
70 |
virtual float Volume(); |
virtual float Volume(); |
71 |
virtual void Volume(float f); |
virtual void Volume(float f); |
72 |
|
virtual uint Channels(); |
73 |
virtual void Connect(AudioOutputDevice* pAudioOut); |
virtual void Connect(AudioOutputDevice* pAudioOut); |
74 |
virtual void DisconnectAudioOutputDevice(); |
virtual void DisconnectAudioOutputDevice(); |
75 |
|
virtual void SetOutputChannel(uint EngineAudioChannel, uint AudioDeviceChannel); |
76 |
|
virtual int OutputChannel(uint EngineAudioChannel); |
77 |
virtual int RenderAudio(uint Samples); |
virtual int RenderAudio(uint Samples); |
78 |
virtual uint VoiceCount(); |
virtual uint VoiceCount(); |
79 |
virtual uint VoiceCountMax(); |
virtual uint VoiceCountMax(); |
84 |
virtual String DiskStreamBufferFillPercentage(); |
virtual String DiskStreamBufferFillPercentage(); |
85 |
virtual String Description(); |
virtual String Description(); |
86 |
virtual String Version(); |
virtual String Version(); |
87 |
|
virtual String EngineName(); |
88 |
|
virtual String InstrumentFileName(); |
89 |
|
virtual int InstrumentIndex(); |
90 |
|
virtual int InstrumentStatus(); |
91 |
|
|
92 |
// abstract methods derived from interface class 'InstrumentConsumer' |
// abstract methods derived from interface class 'InstrumentConsumer' |
93 |
virtual void ResourceToBeUpdated(::gig::Instrument* pResource, void*& pUpdateArg); |
virtual void ResourceToBeUpdated(::gig::Instrument* pResource, void*& pUpdateArg); |
104 |
static InstrumentResourceManager Instruments; |
static InstrumentResourceManager Instruments; |
105 |
|
|
106 |
AudioOutputDevice* pAudioOutputDevice; |
AudioOutputDevice* pAudioOutputDevice; |
107 |
|
float* pOutputLeft; ///< Audio output channel buffer (left) |
108 |
|
float* pOutputRight; ///< Audio output channel buffer (right) |
109 |
|
int AudioDeviceChannelLeft; ///< audio device channel number to which the left channel is connected to |
110 |
|
int AudioDeviceChannelRight; ///< audio device channel number to which the right channel is connected to |
111 |
|
uint SampleRate; ///< Sample rate of the engines output audio signal (in Hz) |
112 |
|
uint MaxSamplesPerCycle; ///< Size of each audio output buffer |
113 |
DiskThread* pDiskThread; |
DiskThread* pDiskThread; |
114 |
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. |
115 |
RingBuffer<Event>* pEventQueue; ///< Input event queue. |
RingBuffer<Event>* pEventQueue; ///< Input event queue. |
122 |
RTEList<Event>* pCCEvents; ///< All control change events for the current audio fragment. |
RTEList<Event>* pCCEvents; ///< All control change events for the current audio fragment. |
123 |
RTEList<Event>* pSynthesisEvents[Event::destination_count]; ///< Events directly affecting synthesis parameter (like pitch, volume and filter). |
RTEList<Event>* pSynthesisEvents[Event::destination_count]; ///< Events directly affecting synthesis parameter (like pitch, volume and filter). |
124 |
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. |
125 |
|
biquad_param_t* pBasicFilterParameters; ///< Biquad parameters of the basic bandpass filter. |
126 |
|
biquad_param_t* pMainFilterParameters; ///< Main biquad parameters of the individual filter (lowpass / bandpass / highpass). |
127 |
RIFF::File* pRIFF; |
RIFF::File* pRIFF; |
128 |
::gig::File* pGig; |
::gig::File* pGig; |
129 |
::gig::Instrument* pInstrument; |
::gig::Instrument* pInstrument; |
134 |
int ActiveVoiceCountMax; ///< the maximum voice usage since application start |
int ActiveVoiceCountMax; ///< the maximum voice usage since application start |
135 |
bool SuspensionRequested; |
bool SuspensionRequested; |
136 |
ConditionServer EngineDisabled; |
ConditionServer EngineDisabled; |
137 |
|
String InstrumentFile; |
138 |
|
int InstrumentIdx; |
139 |
|
int InstrumentStat; |
140 |
|
|
141 |
void ProcessNoteOn(Event* pNoteOnEvent); |
void ProcessNoteOn(Event* pNoteOnEvent); |
142 |
void ProcessNoteOff(Event* pNoteOffEvent); |
void ProcessNoteOff(Event* pNoteOffEvent); |
154 |
friend class VCOManipulator; |
friend class VCOManipulator; |
155 |
friend class InstrumentResourceManager; |
friend class InstrumentResourceManager; |
156 |
private: |
private: |
|
//static void AllocateSynthesisParametersMatrix(); |
|
|
|
|
157 |
void DisableAndLock(); |
void DisableAndLock(); |
158 |
}; |
}; |
159 |
|
|