/[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 1041 by schoenebeck, Wed Feb 7 17:45:19 2007 UTC revision 1789 by iliev, Sat Nov 1 19:01:27 2008 UTC
# Line 1  Line 1 
1  /***************************************************************************  /***************************************************************************
2   *                                                                         *   *                                                                         *
3   *   Copyright (C) 2005 - 2007 Christian Schoenebeck                       *   *   Copyright (C) 2005 - 2008 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 "../common/atomic.h"
26  #include "../drivers/audio/AudioOutputDevice.h"  #include "../drivers/audio/AudioOutputDevice.h"
27  #include "../drivers/midi/midi.h"  #include "../drivers/midi/midi.h"
28  #include "../drivers/midi/MidiInputDevice.h"  #include "../drivers/midi/MidiInputDevice.h"
29  #include "../drivers/midi/MidiInputPort.h"  #include "../drivers/midi/MidiInputPort.h"
30    #include "../drivers/midi/VirtualMidiDevice.h"
31  #include "Engine.h"  #include "Engine.h"
32  #include "FxSend.h"  #include "FxSend.h"
33    
34  namespace LinuxSampler {  namespace LinuxSampler {
35    
36      // just symbol prototyping      // just symbol prototyping
37        class Sampler;
38        class SamplerChannel;
39      class AudioOutputDevice;      class AudioOutputDevice;
40      class MidiInputPort;      class MidiInputPort;
41      class FxSend;      class FxSend;
# Line 68  namespace LinuxSampler { Line 73  namespace LinuxSampler {
73              virtual bool    StatusChanged(bool bNewStatus = false) = 0;              virtual bool    StatusChanged(bool bNewStatus = false) = 0;
74              virtual float   Volume() = 0;              virtual float   Volume() = 0;
75              virtual void    Volume(float f) = 0;              virtual void    Volume(float f) = 0;
76                virtual float   Pan() = 0;
77                virtual void    Pan(float f) = 0;
78              virtual uint    Channels() = 0;              virtual uint    Channels() = 0;
79              virtual void    Connect(AudioOutputDevice* pAudioOut) = 0;              virtual void    Connect(AudioOutputDevice* pAudioOut) = 0;
80              virtual void    DisconnectAudioOutputDevice() = 0;              virtual void    DisconnectAudioOutputDevice() = 0;
# Line 88  namespace LinuxSampler { Line 95  namespace LinuxSampler {
95              virtual FxSend* GetFxSend(uint FxSendIndex) = 0;              virtual FxSend* GetFxSend(uint FxSendIndex) = 0;
96              virtual uint    GetFxSendCount() = 0;              virtual uint    GetFxSendCount() = 0;
97              virtual void    RemoveFxSend(FxSend* pFxSend) = 0;              virtual void    RemoveFxSend(FxSend* pFxSend) = 0;
98                virtual void    Connect(VirtualMidiDevice* pDevice) = 0;
99                virtual void    Disconnect(VirtualMidiDevice* pDevice) = 0;
100    
101    
102              /////////////////////////////////////////////////////////////////              /////////////////////////////////////////////////////////////////
# Line 238  namespace LinuxSampler { Line 247  namespace LinuxSampler {
247              void SetMidiRpnControllerLsb(uint8_t CtrlLSB);              void SetMidiRpnControllerLsb(uint8_t CtrlLSB);
248    
249              /**              /**
250                 * Reset to no RPN controller currently selected.
251                 */
252                void ResetMidiRpnController();
253                
254                 /**
255                 * Registers the specified listener to be notified when the number
256                 * of effect sends on this channel is changed.
257                 */
258                void AddFxSendCountListener(FxSendCountListener* l);
259    
260                /**
261                 * Removes the specified listener.
262                 */
263                void RemoveFxSendCountListener(FxSendCountListener* l);
264    
265                /**
266                 * Removes all listeners.
267                 */
268                void RemoveAllFxSendCountListeners();
269    
270                /**
271               * Get currently selected MIDI Registered Parameter Number               * Get currently selected MIDI Registered Parameter Number
272               * (RPN) Controller, this method will return the already merged               * (RPN) Controller, this method will return the already merged
273               * value (MSB and LSB value).               * value (MSB and LSB value).
274                 *
275                 * @e WARNING: you have to call @c ResetMidiRpnController()
276                 * after using this value, otherwise all subsequent MIDI CC #6
277                 * (Data) messages are interpreted as RPN controller value
278                 * messages.
279                 *
280                 * @returns currently selected RPN controller number, a negative
281                 *          value if no RPN controller currently selected
282               */               */
283              int GetMidiRpnController();              int GetMidiRpnController();
284    
285              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)              /**
286                 * Gets the current number of active voices.
287                 */
288                uint GetVoiceCount();
289    
290                /**
291                 * Sets the current number of active voices.
292                 */
293                void SetVoiceCount(uint Voices);
294    
295                /**
296                 * Gets the current number of active disk streams.
297                 */
298                uint GetDiskStreamCount();
299    
300                /**
301                 * Sets the current number of active disk streams.
302                 */
303                void SetDiskStreamCount(uint Streams);
304    
305                SamplerChannel* GetSamplerChannel();
306                
307                void SetSamplerChannel(SamplerChannel* pChannel);
308    
309                /** Returns the sampler to which this channel belongs */
310                Sampler* GetSampler();
311    
312          protected:          protected:
313              EngineChannel();              EngineChannel();
314              virtual ~EngineChannel() {}; // MUST only be destroyed by EngineChannelFactory              virtual ~EngineChannel() {}; // MUST only be destroyed by EngineChannelFactory
315    
316                /**
317                 * Notifies listeners that the number of effect sends
318                 * on a this channel is changed.
319                 * @param ChannelId The numerical ID of the sampler channel.
320                 * @param NewCount The new number of sampler channels.
321                 */
322                void fireFxSendCountChanged(int ChannelId, int NewCount);
323    
324              friend class EngineChannelFactory;              friend class EngineChannelFactory;
325    
326          private:          private:
# Line 262  namespace LinuxSampler { Line 334  namespace LinuxSampler {
334              bool    bMidiBankMsbReceived;              bool    bMidiBankMsbReceived;
335              bool    bMidiBankLsbReceived;              bool    bMidiBankLsbReceived;
336              bool    bProgramChangeReceived;              bool    bProgramChangeReceived;
337                bool    bMidiRpnReceived;
338              int     iMidiInstrumentMap;              int     iMidiInstrumentMap;
339                atomic_t voiceCount;
340                atomic_t diskStreamCount;
341                SamplerChannel* pSamplerChannel;
342                ListenerList<FxSendCountListener*> llFxSendCountListeners;
343      };      };
344    
345  } // namespace LinuxSampler  } // namespace LinuxSampler

Legend:
Removed from v.1041  
changed lines
  Added in v.1789

  ViewVC Help
Powered by ViewVC