/[svn]/linuxsampler/trunk/src/EventListeners.h
ViewVC logotype

Diff of /linuxsampler/trunk/src/EventListeners.h

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

revision 1686 by schoenebeck, Thu Feb 14 14:58:50 2008 UTC revision 2012 by iliev, Fri Oct 23 17:53:17 2009 UTC
# Line 28  namespace LinuxSampler { Line 28  namespace LinuxSampler {
28    
29      // just symbol prototyping      // just symbol prototyping
30      class SamplerChannel;      class SamplerChannel;
31        class MidiInputDevice;
32        class MidiInputPort;
33    
34      template<class L>      template<class L>
35      class ListenerList {      class ListenerList {
# Line 79  namespace LinuxSampler { Line 81  namespace LinuxSampler {
81              std::vector<L> vListenerList;              std::vector<L> vListenerList;
82      };      };
83    
84    #define REGISTER_FIRE_EVENT_METHOD(method) virtual void method() \
85        { for(int i = 0; i < GetListenerCount(); i++) GetListener(i)->method(); }
86    
87    #define REGISTER_FIRE_EVENT_METHOD_ARG1(method, T1) virtual void method(T1 _evt_arg1_) \
88        { for(int i = 0; i < GetListenerCount(); i++) GetListener(i)->method(_evt_arg1_); }
89    
90    #define REGISTER_FIRE_EVENT_METHOD_ARG2(method, T1, T2) virtual void method(T1 _evt_arg1_, T2 _evt_arg2_) \
91        { for(int i = 0; i < GetListenerCount(); i++) GetListener(i)->method(_evt_arg1_, _evt_arg2_); }
92    
93      /**      /**
94       * This class is used as a listener, which is notified       * This class is used as a listener, which is notified
95       * when the number of sampler channels is changed.       * when the number of sampler channels is changed.
# Line 95  namespace LinuxSampler { Line 106  namespace LinuxSampler {
106      };      };
107    
108      /**      /**
109         * This class exists as convenience for creating listener objects.
110         * The methods in this class are empty.
111         */
112        class ChannelCountAdapter : public ChannelCountListener {
113            public:
114                virtual void ChannelCountChanged(int NewCount) { };
115                virtual void ChannelAdded(SamplerChannel* pChannel) { };
116                virtual void ChannelToBeRemoved(SamplerChannel* pChannel) { };
117        };
118    
119        /**
120       * This class is used as a listener, which is notified       * This class is used as a listener, which is notified
121       * when the number of audio output devices is changed.       * when the number of audio output devices is changed.
122       */       */
# Line 118  namespace LinuxSampler { Line 140  namespace LinuxSampler {
140               * @param NewCount The new number of MIDI input devices.               * @param NewCount The new number of MIDI input devices.
141               */               */
142              virtual void MidiDeviceCountChanged(int NewCount) = 0;              virtual void MidiDeviceCountChanged(int NewCount) = 0;
143    
144                /**
145                 * Invoked right before the supplied MIDI input device is going
146                 * to be destroyed.
147                 * @param pDevice MidiInputDevice to be deleted
148                 */
149                virtual void MidiDeviceToBeDestroyed(MidiInputDevice* pDevice) = 0;
150    
151                /**
152                 * Invoked to inform that a new MidiInputDevice has just been
153                 * created.
154                 * @param pDevice newly created MidiInputDevice
155                 */
156                virtual void MidiDeviceCreated(MidiInputDevice* pDevice) = 0;
157        };
158    
159        /**
160         * This class is used as a listener, which is notified
161         * when the number of MIDI input ports is changed.
162         */
163        class MidiPortCountListener {
164            public:
165                /**
166                 * Invoked when the number of MIDI input ports has changed.
167                 * @param NewCount The new number of MIDI input ports.
168                 */
169                virtual void MidiPortCountChanged(int NewCount) = 0;
170    
171                /**
172                 * Invoked right before the supplied MIDI input port is going
173                 * to be destroyed.
174                 * @param pPort MidiInputPort to be deleted
175                 */
176                virtual void MidiPortToBeRemoved(MidiInputPort* pPort) = 0;
177    
178                /**
179                 * Invoked to inform that a new MidiInputPort has just been
180                 * added.
181                 * @param pPort newly created MidiInputPort
182                 */
183                virtual void MidiPortAdded(MidiInputPort* pPort) = 0;
184      };      };
185    
186      /**      /**

Legend:
Removed from v.1686  
changed lines
  Added in v.2012

  ViewVC Help
Powered by ViewVC