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

Diff of /linuxsampler/trunk/src/engines/EngineChannel.h

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

revision 906 by schoenebeck, Sun Jul 23 16:44:08 2006 UTC revision 1001 by schoenebeck, Wed Dec 27 16:17:08 2006 UTC
# Line 26  Line 26 
26  #include "../drivers/midi/MidiInputDevice.h"  #include "../drivers/midi/MidiInputDevice.h"
27  #include "../drivers/midi/MidiInputPort.h"  #include "../drivers/midi/MidiInputPort.h"
28  #include "Engine.h"  #include "Engine.h"
29    #include "FxSend.h"
30    
31  namespace LinuxSampler {  namespace LinuxSampler {
32    
33      // just symbol prototyping      // just symbol prototyping
34      class AudioOutputDevice;      class AudioOutputDevice;
35      class MidiInputPort;      class MidiInputPort;
36        class FxSend;
37    
38    
39      /** @brief Channel Interface for LinuxSampler Sampler Engines      /** @brief Channel Interface for LinuxSampler Sampler Engines
40       *       *
# Line 68  namespace LinuxSampler { Line 71  namespace LinuxSampler {
71              virtual uint    Channels() = 0;              virtual uint    Channels() = 0;
72              virtual void    Connect(AudioOutputDevice* pAudioOut) = 0;              virtual void    Connect(AudioOutputDevice* pAudioOut) = 0;
73              virtual void    DisconnectAudioOutputDevice() = 0;              virtual void    DisconnectAudioOutputDevice() = 0;
74                virtual AudioOutputDevice* GetAudioOutputDevice() = 0;
75              virtual void    SetOutputChannel(uint EngineAudioChannel, uint AudioDeviceChannel) = 0;              virtual void    SetOutputChannel(uint EngineAudioChannel, uint AudioDeviceChannel) = 0;
76              virtual int     OutputChannel(uint EngineAudioChannel) = 0;              virtual int     OutputChannel(uint EngineAudioChannel) = 0;
77              virtual void    Connect(MidiInputPort* pMidiPort, midi_chan_t MidiChannel) = 0;              virtual void    Connect(MidiInputPort* pMidiPort, midi_chan_t MidiChannel) = 0;
# Line 80  namespace LinuxSampler { Line 84  namespace LinuxSampler {
84              virtual int     InstrumentStatus() = 0;              virtual int     InstrumentStatus() = 0;
85              virtual Engine* GetEngine() = 0;              virtual Engine* GetEngine() = 0;
86              virtual String  EngineName() = 0;              virtual String  EngineName() = 0;
87                virtual FxSend* AddFxSend(uint8_t MidiCtrl, String Name = "") throw (Exception) = 0;
88                virtual FxSend* GetFxSend(uint FxSendIndex) = 0;
89                virtual uint    GetFxSendCount() = 0;
90                virtual void    RemoveFxSend(FxSend* pFxSend) = 0;
91    
92    
93                /////////////////////////////////////////////////////////////////
94                // normal methods
95                //     (usually not to be overridden by descendant)
96    
97              /**              /**
98               * Sets the mute state of this channel.               * Sets the mute state of this channel.
# Line 113  namespace LinuxSampler { Line 126  namespace LinuxSampler {
126               */               */
127              bool GetSolo();              bool GetSolo();
128    
129                /**
130                 * Returns current MIDI program (change) number of this
131                 * EngineChannel.
132                 */
133                uint8_t GetMidiProgram();
134    
135                /**
136                 * Change EngineChannel's MIDI program.
137                 */
138                void SetMidiProgram(uint8_t Program);
139    
140                /**
141                 * Returns current MIDI bank MSB (coarse) number of this
142                 * EngineChannel.
143                 */
144                uint8_t GetMidiBankMsb();
145    
146                /**
147                 * Change current MIDI bank MSB (coarse) number of this
148                 * EngineChannel.
149                 */
150                void SetMidiBankMsb(uint8_t BankMSB);
151    
152                /**
153                 * Returns current MIDI bank LSB (fine) number of this
154                 * EngineChannel.
155                 */
156                uint8_t GetMidiBankLsb();
157    
158                /**
159                 * Change current MIDI bank LSB (fine) number of this
160                 * EngineChannel.
161                 */
162                void SetMidiBankLsb(uint8_t BankLSB);
163    
164                /**
165                 * Returns true if this EngineChannel is using no MIDI
166                 * instrument map at all, that is if it will ignore all MIDI
167                 * program change messages.
168                 *
169                 * @see UsesDefaultMidiInstrumentMap()
170                 * @see GetMidiInstrumentMap()
171                 */
172                bool UsesNoMidiInstrumentMap();
173    
174                /**
175                 * Returns true if this EngineChannel is using the default MIDI
176                 * instrument map for handling MIDI program changes.
177                 *
178                 * @see UsesNoMidiInstrumentMap()
179                 * @see GetMidiInstrumentMap()
180                 */
181                bool UsesDefaultMidiInstrumentMap();
182    
183                /**
184                 * Returns ID of the MIDI instrument map currently used by this
185                 * EngineChannel to handle MIDI program changes. You should
186                 * always call @c UsesNoMidiInstrumentMap() and
187                 * @c UsesDefaultMidiInstrumentMap() before calling this method
188                 * to check if this EngineChannel is probably using the default
189                 * map or no map at all, because in these two particular cases
190                 * this method would throw an exception!
191                 *
192                 * @throws Exception - if EngineChannel is set to no map at all
193                 *                     or is set to the default map
194                 * @see UsesNoMidiInstrumentMap()
195                 * @see UsesDefaultMidiInstrumentMap()
196                 */
197                int GetMidiInstrumentMap() throw (Exception);
198    
199                /**
200                 * Let this EngineChannel use no MIDI instrument map at all,
201                 * that is to let it ignore all MIDI program change messages.
202                 *
203                 * @see SetMidiInstrumentMapToDefault()
204                 * @see SetMidiInstrumentMap()
205                 */
206                void SetMidiInstrumentMapToNone();
207    
208                /**
209                 * Let this EngineChannel use the default MIDI instrument map to
210                 * handle MIDI program changes.
211                 *
212                 * @see SetMidiInstrumentMapToNone()
213                 * @see SetMidiInstrumentMap()
214                 */
215                void SetMidiInstrumentMapToDefault();
216    
217                /**
218                 * Set a specific MIDI instrument map this EngineChannel should
219                 * use to handle MIDI program changes.
220                 *
221                 * @see SetMidiInstrumentMapToNone()
222                 * @see SetMidiInstrumentMapToDefault()
223                 *
224                 * @throws Exception - in case given map does not exist
225                 */
226                void SetMidiInstrumentMap(int MidiMap) throw (Exception);
227    
228              int iSamplerChannelIndex; ///< FIXME: nasty hack, might be removed (should be 'virtual EngineChannel* EngineChannel() = 0;', but due to cyclic dependencies only a void* solution would be possible ATM)              int iSamplerChannelIndex; ///< FIXME: nasty hack, might be removed (should be 'virtual EngineChannel* EngineChannel() = 0;', but due to cyclic dependencies only a void* solution would be possible ATM)
229    
230          protected:          protected:
# Line 121  namespace LinuxSampler { Line 233  namespace LinuxSampler {
233              friend class EngineChannelFactory;              friend class EngineChannelFactory;
234    
235          private:          private:
236              int  iMute;              int     iMute;
237              bool bSolo;              bool    bSolo;
238                uint8_t uiMidiProgram;
239                uint8_t uiMidiBankMsb;
240                uint8_t uiMidiBankLsb;
241                bool    bMidiBankMsbReceived;
242                bool    bMidiBankLsbReceived;
243                bool    bProgramChangeReceived;
244                int     iMidiInstrumentMap;
245      };      };
246    
247  } // namespace LinuxSampler  } // namespace LinuxSampler

Legend:
Removed from v.906  
changed lines
  Added in v.1001

  ViewVC Help
Powered by ViewVC