/[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 973 by schoenebeck, Fri Dec 15 21:40:27 2006 UTC revision 1297 by iliev, Thu Aug 16 15:55:21 2007 UTC
# Line 1  Line 1 
1  /***************************************************************************  /***************************************************************************
2   *                                                                         *   *                                                                         *
3   *   Copyright (C) 2005, 2006 Christian Schoenebeck                        *   *   Copyright (C) 2005 - 2007 Christian Schoenebeck                       *
4   *                                                                         *   *                                                                         *
5   *   This program is free software; you can redistribute it and/or modify  *   *   This program is free software; you can redistribute it and/or modify  *
6   *   it under the terms of the GNU General Public License as published by  *   *   it under the terms of the GNU General Public License as published by  *
# Line 21  Line 21 
21  #ifndef __LS_ENGINECHANNEL_H__  #ifndef __LS_ENGINECHANNEL_H__
22  #define __LS_ENGINECHANNEL_H__  #define __LS_ENGINECHANNEL_H__
23    
24    #include "../EventListeners.h"
25  #include "../drivers/audio/AudioOutputDevice.h"  #include "../drivers/audio/AudioOutputDevice.h"
26  #include "../drivers/midi/midi.h"  #include "../drivers/midi/midi.h"
27  #include "../drivers/midi/MidiInputDevice.h"  #include "../drivers/midi/MidiInputDevice.h"
28  #include "../drivers/midi/MidiInputPort.h"  #include "../drivers/midi/MidiInputPort.h"
29  #include "Engine.h"  #include "Engine.h"
30    #include "FxSend.h"
31    
32  namespace LinuxSampler {  namespace LinuxSampler {
33    
34      // just symbol prototyping      // just symbol prototyping
35      class AudioOutputDevice;      class AudioOutputDevice;
36      class MidiInputPort;      class MidiInputPort;
37        class FxSend;
38    
39    
40      /** @brief Channel Interface for LinuxSampler Sampler Engines      /** @brief Channel Interface for LinuxSampler Sampler Engines
41       *       *
# Line 68  namespace LinuxSampler { Line 72  namespace LinuxSampler {
72              virtual uint    Channels() = 0;              virtual uint    Channels() = 0;
73              virtual void    Connect(AudioOutputDevice* pAudioOut) = 0;              virtual void    Connect(AudioOutputDevice* pAudioOut) = 0;
74              virtual void    DisconnectAudioOutputDevice() = 0;              virtual void    DisconnectAudioOutputDevice() = 0;
75                virtual AudioOutputDevice* GetAudioOutputDevice() = 0;
76              virtual void    SetOutputChannel(uint EngineAudioChannel, uint AudioDeviceChannel) = 0;              virtual void    SetOutputChannel(uint EngineAudioChannel, uint AudioDeviceChannel) = 0;
77              virtual int     OutputChannel(uint EngineAudioChannel) = 0;              virtual int     OutputChannel(uint EngineAudioChannel) = 0;
78              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 85  namespace LinuxSampler {
85              virtual int     InstrumentStatus() = 0;              virtual int     InstrumentStatus() = 0;
86              virtual Engine* GetEngine() = 0;              virtual Engine* GetEngine() = 0;
87              virtual String  EngineName() = 0;              virtual String  EngineName() = 0;
88                virtual FxSend* AddFxSend(uint8_t MidiCtrl, String Name = "") throw (Exception) = 0;
89                virtual FxSend* GetFxSend(uint FxSendIndex) = 0;
90                virtual uint    GetFxSendCount() = 0;
91                virtual void    RemoveFxSend(FxSend* pFxSend) = 0;
92    
93    
94                /////////////////////////////////////////////////////////////////
95                // normal methods
96                //     (usually not to be overridden by descendant)
97    
98              /**              /**
99               * Sets the mute state of this channel.               * Sets the mute state of this channel.
# Line 212  namespace LinuxSampler { Line 226  namespace LinuxSampler {
226               */               */
227              void SetMidiInstrumentMap(int MidiMap) throw (Exception);              void SetMidiInstrumentMap(int MidiMap) throw (Exception);
228    
229                /**
230                 * Set MIDI Registered Parameter Number (RPN) Controller
231                 * (upper 8 bits / coarse).
232                 */
233                void SetMidiRpnControllerMsb(uint8_t CtrlMSB);
234    
235                /**
236                 * Set MIDI Registered Parameter Number (RPN) Controller
237                 * (lower 8 bits / fine).
238                 */
239                void SetMidiRpnControllerLsb(uint8_t CtrlLSB);
240    
241                /**
242                 * Reset to no RPN controller currently selected.
243                 */
244                void ResetMidiRpnController();
245                
246                 /**
247                 * Registers the specified listener to be notified when the number
248                 * of effect sends on this channel is changed.
249                 */
250                void AddFxSendCountListener(FxSendCountListener* l);
251    
252                /**
253                 * Removes the specified listener.
254                 */
255                void RemoveFxSendCountListener(FxSendCountListener* l);
256    
257                /**
258                 * Removes all listeners.
259                 */
260                void RemoveAllFxSendCountListeners();
261    
262                /**
263                 * Get currently selected MIDI Registered Parameter Number
264                 * (RPN) Controller, this method will return the already merged
265                 * value (MSB and LSB value).
266                 *
267                 * @e WARNING: you have to call @c ResetMidiRpnController()
268                 * after using this value, otherwise all subsequent MIDI CC #6
269                 * (Data) messages are interpreted as RPN controller value
270                 * messages.
271                 *
272                 * @returns currently selected RPN controller number, a negative
273                 *          value if no RPN controller currently selected
274                 */
275                int GetMidiRpnController();
276    
277                /**
278                 * Gets the current number of active voices.
279                 */
280                uint GetVoiceCount();
281    
282                /**
283                 * Sets the current number of active voices.
284                 */
285                void SetVoiceCount(uint Voices);
286    
287                /**
288                 * Gets the current number of active disk streams.
289                 */
290                uint GetDiskStreamCount();
291    
292                /**
293                 * Sets the current number of active disk streams.
294                 */
295                void SetDiskStreamCount(uint Streams);
296    
297              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)
298    
299          protected:          protected:
300              EngineChannel();              EngineChannel();
301              virtual ~EngineChannel() {}; // MUST only be destroyed by EngineChannelFactory              virtual ~EngineChannel() {}; // MUST only be destroyed by EngineChannelFactory
302    
303                /**
304                 * Notifies listeners that the number of effect sends
305                 * on a this channel is changed.
306                 * @param ChannelId The numerical ID of the sampler channel.
307                 * @param NewCount The new number of sampler channels.
308                 */
309                void fireFxSendCountChanged(int ChannelId, int NewCount);
310    
311              friend class EngineChannelFactory;              friend class EngineChannelFactory;
312    
313          private:          private:
# Line 225  namespace LinuxSampler { Line 316  namespace LinuxSampler {
316              uint8_t uiMidiProgram;              uint8_t uiMidiProgram;
317              uint8_t uiMidiBankMsb;              uint8_t uiMidiBankMsb;
318              uint8_t uiMidiBankLsb;              uint8_t uiMidiBankLsb;
319                uint8_t uiMidiRpnMsb; ///< MIDI Registered Parameter Number (upper 8 bits / coarse)
320                uint8_t uiMidiRpnLsb; ///< MIDI Registered Parameter Number (lower 8 bits / fine)
321              bool    bMidiBankMsbReceived;              bool    bMidiBankMsbReceived;
322              bool    bMidiBankLsbReceived;              bool    bMidiBankLsbReceived;
323              bool    bProgramChangeReceived;              bool    bProgramChangeReceived;
324                bool    bMidiRpnReceived;
325              int     iMidiInstrumentMap;              int     iMidiInstrumentMap;
326                uint    uiVoiceCount;
327                uint    uiDiskStreamCount;
328                ListenerList<FxSendCountListener*> llFxSendCountListeners;
329      };      };
330    
331  } // namespace LinuxSampler  } // namespace LinuxSampler

Legend:
Removed from v.973  
changed lines
  Added in v.1297

  ViewVC Help
Powered by ViewVC