23 |
|
|
24 |
#include "../common/global.h" |
#include "../common/global.h" |
25 |
#include "../common/Thread.h" |
#include "../common/Thread.h" |
26 |
|
#include "../drivers/midi/VirtualMidiDevice.h" |
27 |
|
|
28 |
#include <set> |
#include <set> |
29 |
|
|
47 |
* launch a matching registered editor, by calling the respective |
* launch a matching registered editor, by calling the respective |
48 |
* plugin's @c Main() method. |
* plugin's @c Main() method. |
49 |
*/ |
*/ |
50 |
class InstrumentEditor : protected Thread { |
class InstrumentEditor : public VirtualMidiDevice, protected Thread { |
51 |
public: |
public: |
52 |
|
|
53 |
///////////////////////////////////////////////////////////////// |
///////////////////////////////////////////////////////////////// |
204 |
*/ |
*/ |
205 |
void RemoveListener(InstrumentEditorListener* pListener); |
void RemoveListener(InstrumentEditorListener* pListener); |
206 |
|
|
|
|
|
|
/** |
|
|
* Informs the instrument editor that a @e note @e on event occured |
|
|
* (e.g. caused by a MIDI keyboard connected to the sampler). |
|
|
* Communication acts asynchronously, that is this method call doesn't |
|
|
* lock in any way and returns immediately. It is thus realtime safe. |
|
|
* |
|
|
* @e Note: this method is usually only called by the sampler. |
|
|
* |
|
|
* @see ActiveNotesChanged(), NoteIsActive() |
|
|
*/ |
|
|
void SendNoteOnToEditor(uint8_t Key, uint8_t Velocity); |
|
|
|
|
|
/** |
|
|
* Informs the instrument editor that a @e note @e off event occured |
|
|
* (e.g. caused by a MIDI keyboard connected to the sampler). |
|
|
* Communication acts asynchronously, that is this method call doesn't |
|
|
* lock in any way and returns immediately. It is thus realtime safe. |
|
|
* |
|
|
* @e Note: this method is usually only called by the sampler. |
|
|
* |
|
|
* @see ActiveNotesChanged(), NoteIsActive() |
|
|
*/ |
|
|
void SendNoteOffToEditor(uint8_t Key, uint8_t Velocity); |
|
|
|
|
|
/** |
|
|
* Can be called by the instrument editor to check whether a new note |
|
|
* on or note off MIDI event arrived to the sampler during the last |
|
|
* call to this method. So this is a asynchronously, "polling" based |
|
|
* communication mechanism, which works in conjunction with the |
|
|
* NoteIsActive() method call. |
|
|
*/ |
|
|
bool NotesChanged(); |
|
|
|
|
|
/** |
|
|
* Can be called by the instrument editor to check whether a new note |
|
|
* on or note off MIDI event arrived to the sampler for @a Key during |
|
|
* the last call to this method. So this is a asynchronously, |
|
|
* "polling" based communication mechanism, which works in |
|
|
* conjunction with the NoteIsActive() method call. |
|
|
*/ |
|
|
bool NoteChanged(uint8_t Key); |
|
|
|
|
|
/** |
|
|
* Can be called by the instrument editor to check which key / note |
|
|
* is currently active by the sampler, e.g. to highlight the |
|
|
* respective keys of a virtual keyboard in the instrument editor. |
|
|
* |
|
|
* @see NotesChanged(), NoteChanged() |
|
|
*/ |
|
|
bool NoteIsActive(uint8_t Key); |
|
|
|
|
207 |
/** |
/** |
208 |
* Constructor |
* Constructor |
209 |
*/ |
*/ |
223 |
void* pInstrument; |
void* pInstrument; |
224 |
String sTypeName; |
String sTypeName; |
225 |
String sTypeVersion; |
String sTypeVersion; |
|
void* pPrivateData; |
|
226 |
}; |
}; |
227 |
|
|
228 |
/** @brief Instrument Editor Notifications |
/** @brief Instrument Editor Notifications |