1 |
/*************************************************************************** |
/*************************************************************************** |
2 |
* * |
* * |
3 |
* Copyright (C) 2007 Christian Schoenebeck * |
* Copyright (C) 2007, 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 * |
203 |
*/ |
*/ |
204 |
void RemoveListener(InstrumentEditorListener* pListener); |
void RemoveListener(InstrumentEditorListener* pListener); |
205 |
|
|
206 |
|
|
207 |
|
/** |
208 |
|
* Informs the instrument editor that a @e note @e on event occured |
209 |
|
* (e.g. caused by a MIDI keyboard connected to the sampler). |
210 |
|
* Communication acts asynchronously, that is this method call doesn't |
211 |
|
* lock in any way and returns immediately. It is thus realtime safe. |
212 |
|
* |
213 |
|
* @e Note: this method is usually only called by the sampler. |
214 |
|
* |
215 |
|
* @see ActiveNotesChanged(), NoteIsActive() |
216 |
|
*/ |
217 |
|
void SendNoteOnToEditor(uint8_t Key, uint8_t Velocity); |
218 |
|
|
219 |
|
/** |
220 |
|
* Informs the instrument editor that a @e note @e off event occured |
221 |
|
* (e.g. caused by a MIDI keyboard connected to the sampler). |
222 |
|
* Communication acts asynchronously, that is this method call doesn't |
223 |
|
* lock in any way and returns immediately. It is thus realtime safe. |
224 |
|
* |
225 |
|
* @e Note: this method is usually only called by the sampler. |
226 |
|
* |
227 |
|
* @see ActiveNotesChanged(), NoteIsActive() |
228 |
|
*/ |
229 |
|
void SendNoteOffToEditor(uint8_t Key, uint8_t Velocity); |
230 |
|
|
231 |
|
/** |
232 |
|
* Can be called by the instrument editor to check whether a new note |
233 |
|
* on or note off MIDI event arrived to the sampler during the last |
234 |
|
* call to this method. So this is a asynchronously, "polling" based |
235 |
|
* communication mechanism, which works in conjunction with the |
236 |
|
* NoteIsActive() method call. |
237 |
|
*/ |
238 |
|
bool NotesChanged(); |
239 |
|
|
240 |
|
/** |
241 |
|
* Can be called by the instrument editor to check whether a new note |
242 |
|
* on or note off MIDI event arrived to the sampler for @a Key during |
243 |
|
* the last call to this method. So this is a asynchronously, |
244 |
|
* "polling" based communication mechanism, which works in |
245 |
|
* conjunction with the NoteIsActive() method call. |
246 |
|
*/ |
247 |
|
bool NoteChanged(uint8_t Key); |
248 |
|
|
249 |
|
/** |
250 |
|
* Can be called by the instrument editor to check which key / note |
251 |
|
* is currently active by the sampler, e.g. to highlight the |
252 |
|
* respective keys of a virtual keyboard in the instrument editor. |
253 |
|
* |
254 |
|
* @see NotesChanged(), NoteChanged() |
255 |
|
*/ |
256 |
|
bool NoteIsActive(uint8_t Key); |
257 |
|
|
258 |
/** |
/** |
259 |
* Constructor |
* Constructor |
260 |
*/ |
*/ |
261 |
InstrumentEditor(); |
InstrumentEditor(); |
262 |
|
|
263 |
|
/** |
264 |
|
* Destructor |
265 |
|
*/ |
266 |
|
virtual ~InstrumentEditor(); |
267 |
|
|
268 |
protected: |
protected: |
269 |
std::set<InstrumentEditorListener*> listeners; |
std::set<InstrumentEditorListener*> listeners; |
270 |
|
|
274 |
void* pInstrument; |
void* pInstrument; |
275 |
String sTypeName; |
String sTypeName; |
276 |
String sTypeVersion; |
String sTypeVersion; |
277 |
|
void* pNotesChanged; |
278 |
|
void* pNoteChanged; |
279 |
|
void* pNoteIsActive; |
280 |
}; |
}; |
281 |
|
|
282 |
/** @brief Instrument Editor Notifications |
/** @brief Instrument Editor Notifications |