/[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 56 by schoenebeck, Tue Apr 27 09:21:58 2004 UTC revision 242 by schoenebeck, Wed Sep 15 13:59:08 2004 UTC
# Line 29  Line 29 
29  # warning Engine.h included  # warning Engine.h included
30  #endif // DEBUG_HEADERS  #endif // DEBUG_HEADERS
31    
32    #include <map>
33    
34  #include "../../common/RingBuffer.h"  #include "../../common/RingBuffer.h"
35  #include "../../common/RTELMemoryPool.h"  #include "../../common/RTELMemoryPool.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"
39    #include "../common/BiquadFilter.h"
40  #include "../../lib/fileloader/libgig/gig.h"  #include "../../lib/fileloader/libgig/gig.h"
41  #include "InstrumentResourceManager.h"  #include "InstrumentResourceManager.h"
42  #include "../../network/lscp.h"  #include "../../network/lscp.h"
43    
44  #define PITCHBEND_SEMITONES             12  #define PITCHBEND_SEMITONES             12
45  #define MAX_AUDIO_VOICES                64  #define MAX_AUDIO_VOICES                128
46    
47  namespace LinuxSampler { namespace gig {  namespace LinuxSampler { namespace gig {
48    
49        using std::map;
50    
51      // just symbol prototyping      // just symbol prototyping
52      class Voice;      class Voice;
53      class DiskThread;      class DiskThread;
# Line 68  namespace LinuxSampler { namespace gig { Line 73  namespace LinuxSampler { namespace gig {
73              virtual void   SendControlChange(uint8_t Controller, uint8_t Value);              virtual void   SendControlChange(uint8_t Controller, uint8_t Value);
74              virtual float  Volume();              virtual float  Volume();
75              virtual void   Volume(float f);              virtual void   Volume(float f);
76                virtual uint   Channels();
77              virtual void   Connect(AudioOutputDevice* pAudioOut);              virtual void   Connect(AudioOutputDevice* pAudioOut);
78              virtual void   DisconnectAudioOutputDevice();              virtual void   DisconnectAudioOutputDevice();
79                virtual void   SetOutputChannel(uint EngineAudioChannel, uint AudioDeviceChannel);
80                virtual int    OutputChannel(uint EngineAudioChannel);
81              virtual int    RenderAudio(uint Samples);              virtual int    RenderAudio(uint Samples);
82              virtual uint   VoiceCount();              virtual uint   VoiceCount();
83              virtual uint   VoiceCountMax();              virtual uint   VoiceCountMax();
# Line 80  namespace LinuxSampler { namespace gig { Line 88  namespace LinuxSampler { namespace gig {
88              virtual String DiskStreamBufferFillPercentage();              virtual String DiskStreamBufferFillPercentage();
89              virtual String Description();              virtual String Description();
90              virtual String Version();              virtual String Version();
91                virtual String EngineName();
92                virtual String InstrumentFileName();
93                virtual int    InstrumentIndex();
94                virtual int    InstrumentStatus();
95    
96              // abstract methods derived from interface class 'InstrumentConsumer'              // abstract methods derived from interface class 'InstrumentConsumer'
97              virtual void ResourceToBeUpdated(::gig::Instrument* pResource, void*& pUpdateArg);              virtual void ResourceToBeUpdated(::gig::Instrument* pResource, void*& pUpdateArg);
98              virtual void ResourceUpdated(::gig::Instrument* pOldResource, ::gig::Instrument* pNewResource, void* pUpdateArg);              virtual void ResourceUpdated(::gig::Instrument* pOldResource, ::gig::Instrument* pNewResource, void* pUpdateArg);
99          protected:          protected:
100              struct midi_key_info_t {              struct midi_key_info_t {
101                  RTEList<Voice>* pActiveVoices; ///< Contains the active voices associated with the MIDI key.                  RTEList<Voice>* pActiveVoices;  ///< Contains the active voices associated with the MIDI key.
102                  bool            KeyPressed;    ///< Is true if the respective MIDI key is currently pressed.                  bool            KeyPressed;     ///< Is true if the respective MIDI key is currently pressed.
103                  bool            Active;        ///< If the key contains active voices.                  bool            Active;         ///< If the key contains active voices.
104                  uint*           pSelf;         ///< hack to allow fast deallocation of the key from the list of active keys                  bool            ReleaseTrigger; ///< If we have to launch release triggered voice(s) when the key is released
105                  RTEList<Event>* pEvents;       ///< Key specific events (only Note-on, Note-off and sustain pedal currently)                  uint*           pSelf;          ///< hack to allow fast deallocation of the key from the list of active keys
106                    RTEList<Event>* pEvents;        ///< Key specific events (only Note-on, Note-off and sustain pedal currently)
107              };              };
108    
109              static InstrumentResourceManager Instruments;              static InstrumentResourceManager Instruments;
110    
111              AudioOutputDevice*      pAudioOutputDevice;              AudioOutputDevice*      pAudioOutputDevice;
112                float*                  pOutputLeft;           ///< Audio output channel buffer (left)
113                float*                  pOutputRight;          ///< Audio output channel buffer (right)
114                int                     AudioDeviceChannelLeft;  ///< audio device channel number to which the left channel is connected to
115                int                     AudioDeviceChannelRight; ///< audio device channel number to which the right channel is connected to
116                uint                    SampleRate;            ///< Sample rate of the engines output audio signal (in Hz)
117                uint                    MaxSamplesPerCycle;    ///< Size of each audio output buffer
118              DiskThread*             pDiskThread;              DiskThread*             pDiskThread;
119              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.
120              RingBuffer<Event>*      pEventQueue;           ///< Input event queue.              RingBuffer<Event>*      pEventQueue;           ///< Input event queue.
# Line 108  namespace LinuxSampler { namespace gig { Line 127  namespace LinuxSampler { namespace gig {
127              RTEList<Event>*         pCCEvents;             ///< All control change events for the current audio fragment.              RTEList<Event>*         pCCEvents;             ///< All control change events for the current audio fragment.
128              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).
129              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.
130                biquad_param_t*         pBasicFilterParameters; ///< Biquad parameters of the basic bandpass filter.
131                biquad_param_t*         pMainFilterParameters;  ///< Main biquad parameters of the individual filter (lowpass / bandpass / highpass).
132                map<uint,uint*>         ActiveKeyGroups;        ///< Contains active keys (in case they belong to a key group) ordered by key group ID.
133              RIFF::File*             pRIFF;              RIFF::File*             pRIFF;
134              ::gig::File*            pGig;              ::gig::File*            pGig;
135              ::gig::Instrument*      pInstrument;              ::gig::Instrument*      pInstrument;
# Line 118  namespace LinuxSampler { namespace gig { Line 140  namespace LinuxSampler { namespace gig {
140              int                     ActiveVoiceCountMax;   ///< the maximum voice usage since application start              int                     ActiveVoiceCountMax;   ///< the maximum voice usage since application start
141              bool                    SuspensionRequested;              bool                    SuspensionRequested;
142              ConditionServer         EngineDisabled;              ConditionServer         EngineDisabled;
143                String                  InstrumentFile;
144                int                     InstrumentIdx;
145                int                     InstrumentStat;
146    
147              void ProcessNoteOn(Event* pNoteOnEvent);              void ProcessNoteOn(Event* pNoteOnEvent);
148              void ProcessNoteOff(Event* pNoteOffEvent);              void ProcessNoteOff(Event* pNoteOffEvent);
149              void ProcessPitchbend(Event* pPitchbendEvent);              void ProcessPitchbend(Event* pPitchbendEvent);
150              void ProcessControlChange(Event* pControlChangeEvent);              void ProcessControlChange(Event* pControlChangeEvent);
151              void KillVoice(Voice* pVoice);              void LaunchVoice(Event* pNoteOnEvent, int iLayer = 0, bool ReleaseTriggerVoice = false);
152                void KillVoiceImmediately(Voice* pVoice);
153              void ResetSynthesisParameters(Event::destination_t dst, float val);              void ResetSynthesisParameters(Event::destination_t dst, float val);
154              void ResetInternal();              void ResetInternal();
155    
# Line 135  namespace LinuxSampler { namespace gig { Line 161  namespace LinuxSampler { namespace gig {
161              friend class VCOManipulator;              friend class VCOManipulator;
162              friend class InstrumentResourceManager;              friend class InstrumentResourceManager;
163          private:          private:
             //static void AllocateSynthesisParametersMatrix();  
   
164              void DisableAndLock();              void DisableAndLock();
165      };      };
166    

Legend:
Removed from v.56  
changed lines
  Added in v.242

  ViewVC Help
Powered by ViewVC