--- linuxsampler/trunk/src/engines/gig/Engine.h 2004/10/08 20:30:25 270 +++ linuxsampler/trunk/src/engines/gig/Engine.h 2004/10/08 20:51:39 271 @@ -32,7 +32,7 @@ #include #include "../../common/RingBuffer.h" -#include "../../common/RTELMemoryPool.h" +#include "../../common/Pool.h" #include "../../common/ConditionServer.h" #include "../common/Engine.h" #include "../common/Event.h" @@ -108,12 +108,12 @@ virtual void ResourceUpdated(::gig::Instrument* pOldResource, ::gig::Instrument* pNewResource, void* pUpdateArg); protected: struct midi_key_info_t { - RTEList* pActiveVoices; ///< Contains the active voices associated with the MIDI key. + RTList* pActiveVoices; ///< Contains the active voices associated with the MIDI key. bool KeyPressed; ///< Is true if the respective MIDI key is currently pressed. bool Active; ///< If the key contains active voices. bool ReleaseTrigger; ///< If we have to launch release triggered voice(s) when the key is released - uint* pSelf; ///< hack to allow fast deallocation of the key from the list of active keys - RTEList* pEvents; ///< Key specific events (only Note-on, Note-off and sustain pedal currently) + Pool::Iterator itSelf; ///< hack to allow fast deallocation of the key from the list of active keys + RTList* pEvents; ///< Key specific events (only Note-on, Note-off and sustain pedal currently) }; static InstrumentResourceManager Instruments; @@ -130,14 +130,14 @@ RingBuffer* pEventQueue; ///< Input event queue. RingBuffer* pSysexBuffer; ///< Input buffer for MIDI system exclusive messages. midi_key_info_t pMIDIKeyInfo[128]; ///< Contains all active voices sorted by MIDI key number and other informations to the respective MIDI key - RTELMemoryPool* pVoicePool; ///< Contains all voices that can be activated. - RTELMemoryPool* pActiveKeys; ///< Holds all keys in it's allocation list with active voices. - RTELMemoryPool* pEventPool; ///< Contains all Event objects that can be used. + Pool* pVoicePool; ///< Contains all voices that can be activated. + Pool* pActiveKeys; ///< Holds all keys in it's allocation list with active voices. + Pool* pEventPool; ///< Contains all Event objects that can be used. EventGenerator* pEventGenerator; - RTEList* pVoiceStealingQueue; ///< All voice-launching events which had to be postponed due to free voice shortage. - RTEList* pEvents; ///< All events for the current audio fragment. - RTEList* pCCEvents; ///< All control change events for the current audio fragment. - RTEList* pSynthesisEvents[Event::destination_count]; ///< Events directly affecting synthesis parameter (like pitch, volume and filter). + RTList* pVoiceStealingQueue; ///< All voice-launching events which had to be postponed due to free voice shortage. + RTList* pEvents; ///< All events for the current audio fragment. + RTList* pCCEvents; ///< All control change events for the current audio fragment. + RTList* pSynthesisEvents[Event::destination_count]; ///< Events directly affecting synthesis parameter (like pitch, volume and filter). 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). @@ -156,17 +156,17 @@ int InstrumentIdx; int InstrumentStat; int8_t ScaleTuning[12]; ///< contains optional detune factors (-64..+63 cents) for all 12 semitones of an octave - Voice* pLastStolenVoice; ///< Only for voice stealing: points to the last voice which was theft in current audio fragment, NULL otherwise. - uint* puiLastStolenKey; ///< Only for voice stealing: key number of last key on which the last voice was theft in current audio fragment, NULL otherwise. + RTList::Iterator itLastStolenVoice; ///< Only for voice stealing: points to the last voice which was theft in current audio fragment, NULL otherwise. + RTList::Iterator iuiLastStolenKey; ///< Only for voice stealing: key number of last key on which the last voice was theft in current audio fragment, NULL otherwise. - void ProcessNoteOn(Event* pNoteOnEvent); - void ProcessNoteOff(Event* pNoteOffEvent); - void ProcessPitchbend(Event* pPitchbendEvent); - void ProcessControlChange(Event* pControlChangeEvent); - void ProcessSysex(Event* pSysexEvent); - Voice* LaunchVoice(Event* pNoteOnEvent, int iLayer = 0, bool ReleaseTriggerVoice = false, bool VoiceStealing = true); - void StealVoice(Event* pNoteOnEvent, int iLayer, bool ReleaseTriggerVoice); - void KillVoiceImmediately(Voice* pVoice); + void ProcessNoteOn(Pool::Iterator& itNoteOnEvent); + void ProcessNoteOff(Pool::Iterator& itNoteOffEvent); + void ProcessPitchbend(Pool::Iterator& itPitchbendEvent); + void ProcessControlChange(Pool::Iterator& itControlChangeEvent); + void ProcessSysex(Pool::Iterator& itSysexEvent); + Pool::Iterator LaunchVoice(Pool::Iterator& itNoteOnEvent, int iLayer = 0, bool ReleaseTriggerVoice = false, bool VoiceStealing = true); + void StealVoice(Pool::Iterator& itNoteOnEvent, int iLayer, bool ReleaseTriggerVoice); + void KillVoiceImmediately(Pool::Iterator& itVoice); void ResetSynthesisParameters(Event::destination_t dst, float val); void ResetInternal();