--- linuxsampler/trunk/src/engines/gig/EngineChannel.h 2005/05/08 00:26:21 517 +++ linuxsampler/trunk/src/engines/gig/EngineChannel.h 2005/09/21 19:05:41 776 @@ -41,6 +41,11 @@ class midi_key_info_t; class Voice; + /** @brief Engine Channel of a gig::Engine + * + * Encapsulates a engine channel for the Gigasampler format capable + * sampler engine. + */ class EngineChannel : public LinuxSampler::EngineChannel, public InstrumentConsumer { public: EngineChannel(); @@ -49,10 +54,12 @@ // implementation of abstract methods derived from interface class 'LinuxSampler::EngineChannel' virtual void PrepareLoadInstrument(const char* FileName, uint Instrument); virtual void LoadInstrument(); + virtual void Reset(); virtual void SendNoteOn(uint8_t Key, uint8_t Velocity); virtual void SendNoteOff(uint8_t Key, uint8_t Velocity); virtual void SendPitchbend(int Pitch); virtual void SendControlChange(uint8_t Controller, uint8_t Value); + virtual bool StatusChanged(bool bNewStatus = false); virtual float Volume(); virtual void Volume(float f); virtual uint Channels(); @@ -60,6 +67,10 @@ virtual void DisconnectAudioOutputDevice(); virtual void SetOutputChannel(uint EngineAudioChannel, uint AudioDeviceChannel); virtual int OutputChannel(uint EngineAudioChannel); + virtual void Connect(MidiInputPort* pMidiPort, midi_chan_t MidiChannel); + virtual void DisconnectMidiInputPort(); + virtual MidiInputPort* GetMidiInputPort(); + virtual midi_chan_t MidiChannel(); virtual String InstrumentFileName(); virtual String InstrumentName(); virtual int InstrumentIndex(); @@ -78,16 +89,17 @@ 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 + MidiInputPort* pMidiInputPort; ///< Points to the connected MIDI input port or NULL if none assigned. + midi_chan_t midiChannel; ///< MIDI channel(s) on which this engine channel listens to. RingBuffer* pEventQueue; ///< Input event queue. RTList* pEvents; ///< All engine channel specific events for the current audio fragment. - RTList* pCCEvents; ///< All control change events for the current audio fragment on this engine channel. - RTList* pSynthesisEvents[Event::destination_count]; ///< Events directly affecting synthesis parameters (like pitch, volume and filter). uint8_t ControllerTable[128]; ///< Reflects the current values (0-127) of all MIDI controllers for this engine / sampler channel. midi_key_info_t* pMIDIKeyInfo; ///< Contains all active voices sorted by MIDI key number and other informations to the respective MIDI key Pool* pActiveKeys; ///< Holds all keys in it's allocation list with active voices. std::map ActiveKeyGroups; ///< Contains active keys (in case they belong to a key group) ordered by key group ID. ::gig::Instrument* pInstrument; bool SustainPedal; ///< true if sustain pedal is down + bool SostenutoPedal; ///< true if sostenuto pedal is down double GlobalVolume; ///< overall volume (a value < 1.0 means attenuation, a value > 1.0 means amplification) float GlobalPanLeft; float GlobalPanRight; @@ -98,6 +110,7 @@ String InstrumentIdxName; int InstrumentStat; int iEngineIndexSelf; ///< Reflects the index of this EngineChannel in the Engine's ArrayList. + bool bStatusChanged; ///< true in case an engine parameter has changed (e.g. new instrument, another volumet) void ResetControllers(); void ClearEventLists();