/[svn]/linuxsampler/trunk/src/engines/gig/Engine.h
ViewVC logotype

Diff of /linuxsampler/trunk/src/engines/gig/Engine.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 270 by capela, Thu Oct 7 22:20:20 2004 UTC revision 271 by schoenebeck, Fri Oct 8 20:51:39 2004 UTC
# Line 32  Line 32 
32  #include <map>  #include <map>
33    
34  #include "../../common/RingBuffer.h"  #include "../../common/RingBuffer.h"
35  #include "../../common/RTELMemoryPool.h"  #include "../../common/Pool.h"
36  #include "../../common/ConditionServer.h"  #include "../../common/ConditionServer.h"
37  #include "../common/Engine.h"  #include "../common/Engine.h"
38  #include "../common/Event.h"  #include "../common/Event.h"
# Line 108  namespace LinuxSampler { namespace gig { Line 108  namespace LinuxSampler { namespace gig {
108              virtual void ResourceUpdated(::gig::Instrument* pOldResource, ::gig::Instrument* pNewResource, void* pUpdateArg);              virtual void ResourceUpdated(::gig::Instrument* pOldResource, ::gig::Instrument* pNewResource, void* pUpdateArg);
109          protected:          protected:
110              struct midi_key_info_t {              struct midi_key_info_t {
111                  RTEList<Voice>* pActiveVoices;  ///< Contains the active voices associated with the MIDI key.                  RTList<Voice>*  pActiveVoices;  ///< Contains the active voices associated with the MIDI key.
112                  bool            KeyPressed;     ///< Is true if the respective MIDI key is currently pressed.                  bool            KeyPressed;     ///< Is true if the respective MIDI key is currently pressed.
113                  bool            Active;         ///< If the key contains active voices.                  bool            Active;         ///< If the key contains active voices.
114                  bool            ReleaseTrigger; ///< If we have to launch release triggered voice(s) when the key is released                  bool            ReleaseTrigger; ///< If we have to launch release triggered voice(s) when the key is released
115                  uint*           pSelf;          ///< hack to allow fast deallocation of the key from the list of active keys                  Pool<uint>::Iterator itSelf;         ///< hack to allow fast deallocation of the key from the list of active keys
116                  RTEList<Event>* pEvents;        ///< Key specific events (only Note-on, Note-off and sustain pedal currently)                  RTList<Event>*  pEvents;        ///< Key specific events (only Note-on, Note-off and sustain pedal currently)
117              };              };
118    
119              static InstrumentResourceManager Instruments;              static InstrumentResourceManager Instruments;
# Line 130  namespace LinuxSampler { namespace gig { Line 130  namespace LinuxSampler { namespace gig {
130              RingBuffer<Event>*      pEventQueue;           ///< Input event queue.              RingBuffer<Event>*      pEventQueue;           ///< Input event queue.
131              RingBuffer<uint8_t>*    pSysexBuffer;          ///< Input buffer for MIDI system exclusive messages.              RingBuffer<uint8_t>*    pSysexBuffer;          ///< Input buffer for MIDI system exclusive messages.
132              midi_key_info_t         pMIDIKeyInfo[128];     ///< Contains all active voices sorted by MIDI key number and other informations to the respective MIDI key              midi_key_info_t         pMIDIKeyInfo[128];     ///< Contains all active voices sorted by MIDI key number and other informations to the respective MIDI key
133              RTELMemoryPool<Voice>*  pVoicePool;            ///< Contains all voices that can be activated.              Pool<Voice>*            pVoicePool;            ///< Contains all voices that can be activated.
134              RTELMemoryPool<uint>*   pActiveKeys;           ///< Holds all keys in it's allocation list with active voices.              Pool<uint>*             pActiveKeys;           ///< Holds all keys in it's allocation list with active voices.
135              RTELMemoryPool<Event>*  pEventPool;            ///< Contains all Event objects that can be used.              Pool<Event>*            pEventPool;            ///< Contains all Event objects that can be used.
136              EventGenerator*         pEventGenerator;              EventGenerator*         pEventGenerator;
137              RTEList<Event>*         pVoiceStealingQueue;   ///< All voice-launching events which had to be postponed due to free voice shortage.              RTList<Event>*          pVoiceStealingQueue;   ///< All voice-launching events which had to be postponed due to free voice shortage.
138              RTEList<Event>*         pEvents;               ///< All events for the current audio fragment.              RTList<Event>*          pEvents;               ///< All events for the current audio fragment.
139              RTEList<Event>*         pCCEvents;             ///< All control change events for the current audio fragment.              RTList<Event>*          pCCEvents;             ///< All control change events for the current audio fragment.
140              RTEList<Event>*         pSynthesisEvents[Event::destination_count];     ///< Events directly affecting synthesis parameter (like pitch, volume and filter).              RTList<Event>*          pSynthesisEvents[Event::destination_count];     ///< Events directly affecting synthesis parameter (like pitch, volume and filter).
141              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.
142              biquad_param_t*         pBasicFilterParameters; ///< Biquad parameters of the basic bandpass filter.              biquad_param_t*         pBasicFilterParameters; ///< Biquad parameters of the basic bandpass filter.
143              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).
# Line 156  namespace LinuxSampler { namespace gig { Line 156  namespace LinuxSampler { namespace gig {
156              int                     InstrumentIdx;              int                     InstrumentIdx;
157              int                     InstrumentStat;              int                     InstrumentStat;
158              int8_t                  ScaleTuning[12];       ///< contains optional detune factors (-64..+63 cents) for all 12 semitones of an octave              int8_t                  ScaleTuning[12];       ///< contains optional detune factors (-64..+63 cents) for all 12 semitones of an octave
159              Voice*                  pLastStolenVoice;      ///< Only for voice stealing: points to the last voice which was theft in current audio fragment, NULL otherwise.              RTList<Voice>::Iterator itLastStolenVoice;      ///< Only for voice stealing: points to the last voice which was theft in current audio fragment, NULL otherwise.
160              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<uint>::Iterator  iuiLastStolenKey;      ///< Only for voice stealing: key number of last key on which the last voice was theft in current audio fragment, NULL otherwise.
161    
162              void ProcessNoteOn(Event* pNoteOnEvent);              void ProcessNoteOn(Pool<Event>::Iterator& itNoteOnEvent);
163              void ProcessNoteOff(Event* pNoteOffEvent);              void ProcessNoteOff(Pool<Event>::Iterator& itNoteOffEvent);
164              void ProcessPitchbend(Event* pPitchbendEvent);              void ProcessPitchbend(Pool<Event>::Iterator& itPitchbendEvent);
165              void ProcessControlChange(Event* pControlChangeEvent);              void ProcessControlChange(Pool<Event>::Iterator& itControlChangeEvent);
166              void ProcessSysex(Event* pSysexEvent);              void ProcessSysex(Pool<Event>::Iterator& itSysexEvent);
167              Voice* LaunchVoice(Event* pNoteOnEvent, int iLayer = 0, bool ReleaseTriggerVoice = false, bool VoiceStealing = true);              Pool<Voice>::Iterator LaunchVoice(Pool<Event>::Iterator& itNoteOnEvent, int iLayer = 0, bool ReleaseTriggerVoice = false, bool VoiceStealing = true);
168              void StealVoice(Event* pNoteOnEvent, int iLayer, bool ReleaseTriggerVoice);              void StealVoice(Pool<Event>::Iterator& itNoteOnEvent, int iLayer, bool ReleaseTriggerVoice);
169              void KillVoiceImmediately(Voice* pVoice);              void KillVoiceImmediately(Pool<Voice>::Iterator& itVoice);
170              void ResetSynthesisParameters(Event::destination_t dst, float val);              void ResetSynthesisParameters(Event::destination_t dst, float val);
171              void ResetInternal();              void ResetInternal();
172    

Legend:
Removed from v.270  
changed lines
  Added in v.271

  ViewVC Help
Powered by ViewVC