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 { |
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. |
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 |
*/ |
*/ |
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 |
/** |
/** |