--- linuxsampler/trunk/src/engines/gig/Engine.h 2004/06/06 20:57:28 112 +++ linuxsampler/trunk/src/engines/gig/Engine.h 2004/09/12 14:48:19 239 @@ -29,6 +29,8 @@ # warning Engine.h included #endif // DEBUG_HEADERS +#include + #include "../../common/RingBuffer.h" #include "../../common/RTELMemoryPool.h" #include "../../common/ConditionServer.h" @@ -44,6 +46,8 @@ namespace LinuxSampler { namespace gig { + using std::map; + // just symbol prototyping class Voice; class DiskThread; @@ -69,8 +73,11 @@ virtual void SendControlChange(uint8_t Controller, uint8_t Value); virtual float Volume(); virtual void Volume(float f); + virtual uint Channels(); virtual void Connect(AudioOutputDevice* pAudioOut); virtual void DisconnectAudioOutputDevice(); + virtual void SetOutputChannel(uint EngineAudioChannel, uint AudioDeviceChannel); + virtual int OutputChannel(uint EngineAudioChannel); virtual int RenderAudio(uint Samples); virtual uint VoiceCount(); virtual uint VoiceCountMax(); @@ -84,6 +91,7 @@ virtual String EngineName(); virtual String InstrumentFileName(); virtual int InstrumentIndex(); + virtual int InstrumentStatus(); // abstract methods derived from interface class 'InstrumentConsumer' virtual void ResourceToBeUpdated(::gig::Instrument* pResource, void*& pUpdateArg); @@ -100,6 +108,12 @@ static InstrumentResourceManager Instruments; AudioOutputDevice* pAudioOutputDevice; + float* pOutputLeft; ///< Audio output channel buffer (left) + float* pOutputRight; ///< Audio output channel buffer (right) + int AudioDeviceChannelLeft; ///< audio device channel number to which the left channel is connected to + int AudioDeviceChannelRight; ///< audio device channel number to which the right channel is connected to + uint SampleRate; ///< Sample rate of the engines output audio signal (in Hz) + uint MaxSamplesPerCycle; ///< Size of each audio output buffer DiskThread* pDiskThread; uint8_t ControllerTable[128]; ///< Reflects the current values (0-127) of all MIDI controllers for this engine / sampler channel. RingBuffer* pEventQueue; ///< Input event queue. @@ -114,6 +128,7 @@ float* pSynthesisParameters[Event::destination_count]; ///< Matrix with final synthesis parameters for the current audio fragment which will be used in the main synthesis loop. biquad_param_t* pBasicFilterParameters; ///< Biquad parameters of the basic bandpass filter. biquad_param_t* pMainFilterParameters; ///< Main biquad parameters of the individual filter (lowpass / bandpass / highpass). + map ActiveKeyGroups; ///< Contains active keys (in case they belong to a key group) ordered by key group ID. RIFF::File* pRIFF; ::gig::File* pGig; ::gig::Instrument* pInstrument; @@ -126,12 +141,14 @@ ConditionServer EngineDisabled; String InstrumentFile; int InstrumentIdx; + int InstrumentStat; void ProcessNoteOn(Event* pNoteOnEvent); void ProcessNoteOff(Event* pNoteOffEvent); void ProcessPitchbend(Event* pPitchbendEvent); void ProcessControlChange(Event* pControlChangeEvent); - void KillVoice(Voice* pVoice); + void LaunchVoice(Event* pNoteOnEvent, int iLayer = 0); + void KillVoiceImmediately(Voice* pVoice); void ResetSynthesisParameters(Event::destination_t dst, float val); void ResetInternal();