--- linuxsampler/trunk/src/engines/gig/Engine.h 2004/10/08 20:51:39 271 +++ linuxsampler/trunk/src/engines/gig/Engine.h 2004/12/13 00:46:42 319 @@ -106,7 +106,7 @@ // abstract methods derived from interface class 'InstrumentConsumer' virtual void ResourceToBeUpdated(::gig::Instrument* pResource, void*& pUpdateArg); virtual void ResourceUpdated(::gig::Instrument* pOldResource, ::gig::Instrument* pNewResource, void* pUpdateArg); - protected: + //protected: struct midi_key_info_t { RTList* pActiveVoices; ///< Contains the active voices associated with the MIDI key. bool KeyPressed; ///< Is true if the respective MIDI key is currently pressed. @@ -158,15 +158,17 @@ int8_t ScaleTuning[12]; ///< contains optional detune factors (-64..+63 cents) for all 12 semitones of an octave 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. + int MaxFadeOutPos; ///< The last position in an audio fragment to allow a instant fade out (e.g. for voice stealing) without leading to clicks. 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); + Pool::Iterator LaunchVoice(Pool::Iterator& itNoteOnEvent, int iLayer, bool ReleaseTriggerVoice, bool VoiceStealing); + void StealVoice(Pool::Iterator& itNoteOnEvent); + void FreeVoice(Pool::Iterator& itVoice); + void FreeKey(midi_key_info_t* pKey); void ResetSynthesisParameters(Event::destination_t dst, float val); void ResetInternal();