VuoMidi implementation.
Definition in file VuoMidi.cc.
Go to the source code of this file.
Classes | |
struct | VuoMidiIn_internal |
Private data for a VuoMidiIn instance. More... | |
Macros | |
#define | setRealizedDevice(newDevice) |
Helper for VuoMidiInputDevice_realize. More... | |
Functions | |
VuoList_VuoMidiInputDevice | VuoMidi_getInputDevices (void) |
Returns a list of the available MIDI input devices. More... | |
VuoList_VuoMidiOutputDevice | VuoMidi_getOutputDevices (void) |
Returns a list of the available MIDI output devices. More... | |
static void | VuoMidi_reconfigurationCallback (const MIDINotification *message, void *refCon) |
Invoked by Core MIDI. More... | |
void | VuoMidi_use (void) |
Indicates that the caller needs to get notifications about MIDI devices. More... | |
void | VuoMidi_disuse (void) |
Indicates that the caller no longer needs notifications about MIDI devices. More... | |
void | VuoMidi_addDevicesChangedTriggers (VuoOutputTrigger(inputDevices, VuoList_VuoMidiInputDevice), VuoOutputTrigger(outputDevices, VuoList_VuoMidiOutputDevice)) |
Adds a trigger callback, to be invoked whenever the list of known MIDI devices changes. More... | |
void | VuoMidi_removeDevicesChangedTriggers (VuoOutputTrigger(inputDevices, VuoList_VuoMidiInputDevice), VuoOutputTrigger(outputDevices, VuoList_VuoMidiOutputDevice)) |
Removes a trigger callback previously added by VuoMidi_addDevicesChangedTriggers. More... | |
void | VuoMidiOut_destroy (VuoMidiOut mo) |
Destroys a MIDI output device manager. More... | |
VuoMidiOut | VuoMidiOut_make (VuoMidiOutputDevice md) |
Creates a reference-counted object to manage sending messages to a MIDI device. More... | |
void | VuoMidiOut_sendNote (VuoMidiOut mo, VuoMidiNote note) |
Outputs the specified note event through the specified MIDI output device mo . More... | |
void | VuoMidiOut_sendController (VuoMidiOut mo, VuoMidiController controller) |
Outputs the specified controller event through the specified MIDI output device mo . More... | |
void | VuoMidiOut_sendPitchBend (VuoMidiOut mo, VuoMidiPitchBend pitchBend) |
Outputs the specified pitchBend event through the specified MIDI output device mo . More... | |
void | VuoMidiIn_receivedEvent (double timeStamp, std::vector< unsigned char > *message, void *userData) |
RtMidi calls this function ("on a separate high-priority thread owned by CoreMIDI") every time it receives a MIDI event. More... | |
void | VuoMidiIn_destroy (VuoMidiIn mi) |
Destroys a MIDI input device manager. More... | |
VuoMidiIn | VuoMidiIn_make (VuoMidiInputDevice md) |
Creates a reference-counted object to manage receiving messages from a MIDI device. More... | |
void | VuoMidiIn_enableTriggers (VuoMidiIn mi, void(*receivedNote)(void *context, VuoMidiNote note), void(*receivedController)(void *context, VuoMidiController controller), void(*receivedPitchBend)(void *context, VuoMidiPitchBend pitchBend), void *context) |
Sets up the MIDI input device to call the trigger functions when it receives an event. More... | |
void | VuoMidiIn_disableTriggers (VuoMidiIn mi) |
Stops the MIDI input device from calling trigger functions when it receives an event. More... | |
bool | VuoMidiInputDevice_realize (VuoMidiInputDevice device, VuoMidiInputDevice *realizedDevice) |
If device 's ID or name is unknown: More... | |
bool | VuoMidiOutputDevice_realize (VuoMidiOutputDevice device, VuoMidiOutputDevice *realizedDevice) |
If device 's ID or name unknown: More... | |
Variables | |
static VuoTriggerSet< VuoList_VuoMidiInputDevice > | VuoMidi_inputDeviceCallbacks |
Trigger functions to call when the list of midi input devices changes. More... | |
static VuoTriggerSet< VuoList_VuoMidiOutputDevice > | VuoMidi_outputDeviceCallbacks |
Trigger functions to call when the list of midi output devices changes. More... | |
unsigned int | VuoMidi_useCount = 0 |
Process-wide count of callers (typically node instances) interested in notifications about midi devices. More... | |
MIDIClientRef | VuoMidi_client |
Core MIDI client, for device notifications. More... | |
#define setRealizedDevice | ( | newDevice | ) |
Helper for VuoMidiInputDevice_realize.
Definition at line 436 of file VuoMidi.cc.
void VuoMidi_addDevicesChangedTriggers | ( | VuoOutputTrigger(inputDevices, VuoList_VuoMidiInputDevice) | , |
VuoOutputTrigger(outputDevices, VuoList_VuoMidiOutputDevice) | |||
) |
Adds a trigger callback, to be invoked whenever the list of known MIDI devices changes.
Call VuoMidi_use()
before calling this.
This function may be called from any thread.
Definition at line 151 of file VuoMidi.cc.
void VuoMidi_disuse | ( | void | ) |
Indicates that the caller no longer needs notifications about MIDI devices.
This function may be called from any thread.
Definition at line 123 of file VuoMidi.cc.
VuoList_VuoMidiInputDevice VuoMidi_getInputDevices | ( | void | ) |
Returns a list of the available MIDI input devices.
Definition at line 52 of file VuoMidi.cc.
VuoList_VuoMidiOutputDevice VuoMidi_getOutputDevices | ( | void | ) |
Returns a list of the available MIDI output devices.
Definition at line 70 of file VuoMidi.cc.
|
static |
Invoked by Core MIDI.
Definition at line 88 of file VuoMidi.cc.
void VuoMidi_removeDevicesChangedTriggers | ( | VuoOutputTrigger(inputDevices, VuoList_VuoMidiInputDevice) | , |
VuoOutputTrigger(outputDevices, VuoList_VuoMidiOutputDevice) | |||
) |
Removes a trigger callback previously added by VuoMidi_addDevicesChangedTriggers.
This function may be called from any thread.
Definition at line 165 of file VuoMidi.cc.
void VuoMidi_use | ( | void | ) |
Indicates that the caller needs to get notifications about MIDI devices.
This function may be called from any thread.
Definition at line 103 of file VuoMidi.cc.
void VuoMidiIn_destroy | ( | VuoMidiIn | mi | ) |
Destroys a MIDI input device manager.
Definition at line 425 of file VuoMidi.cc.
void VuoMidiIn_disableTriggers | ( | VuoMidiIn | mi | ) |
Stops the MIDI input device from calling trigger functions when it receives an event.
This function may be called from any thread.
Definition at line 410 of file VuoMidi.cc.
void VuoMidiIn_enableTriggers | ( | VuoMidiIn | mi, |
void(*)(void *context, VuoMidiNote note) | receivedNote, | ||
void(*)(void *context, VuoMidiController controller) | receivedController, | ||
void(*)(void *context, VuoMidiPitchBend pitchBend) | receivedPitchBend, | ||
void * | context | ||
) |
Sets up the MIDI input device to call the trigger functions when it receives an event.
This function may be called from any thread.
Definition at line 385 of file VuoMidi.cc.
VuoMidiIn VuoMidiIn_make | ( | VuoMidiInputDevice | md | ) |
Creates a reference-counted object to manage receiving messages from a MIDI device.
Definition at line 342 of file VuoMidi.cc.
void VuoMidiIn_receivedEvent | ( | double | timeStamp, |
std::vector< unsigned char > * | message, | ||
void * | userData | ||
) |
RtMidi calls this function ("on a separate high-priority thread owned by CoreMIDI") every time it receives a MIDI event.
Definition at line 280 of file VuoMidi.cc.
bool VuoMidiInputDevice_realize | ( | VuoMidiInputDevice | device, |
VuoMidiInputDevice * | realizedDevice | ||
) |
If device
's ID or name is unknown:
realizedDevice
to that device, and returns true.realizedDevice
unset.If device
's ID and name are already known (presumably from the List MIDI Devices
node), sets realizedDevice
to a copy of device
, and returns true. (Doesn't bother checking whether the device is currently present.)
This function may be called from any thread.
Definition at line 452 of file VuoMidi.cc.
void VuoMidiOut_destroy | ( | VuoMidiOut | mo | ) |
Destroys a MIDI output device manager.
Definition at line 254 of file VuoMidi.cc.
VuoMidiOut VuoMidiOut_make | ( | VuoMidiOutputDevice | md | ) |
Creates a reference-counted object to manage sending messages to a MIDI device.
Definition at line 176 of file VuoMidi.cc.
void VuoMidiOut_sendController | ( | VuoMidiOut | mo, |
VuoMidiController | controller | ||
) |
Outputs the specified controller
event through the specified MIDI output device mo
.
Definition at line 222 of file VuoMidi.cc.
void VuoMidiOut_sendNote | ( | VuoMidiOut | mo, |
VuoMidiNote | note | ||
) |
Outputs the specified note
event through the specified MIDI output device mo
.
Definition at line 206 of file VuoMidi.cc.
void VuoMidiOut_sendPitchBend | ( | VuoMidiOut | mo, |
VuoMidiPitchBend | pitchBend | ||
) |
Outputs the specified pitchBend
event through the specified MIDI output device mo
.
Definition at line 238 of file VuoMidi.cc.
bool VuoMidiOutputDevice_realize | ( | VuoMidiOutputDevice | device, |
VuoMidiOutputDevice * | realizedDevice | ||
) |
If device
's ID or name unknown:
realizedDevice
to that device, and returns true.realizedDevice
unset.If device
's ID and name are already known (presumably from the List MIDI Devices
node), sets realizedDevice
to a copy of device
, and returns true. (Doesn't bother checking whether the device is currently present.)
This function may be called from any thread.
Definition at line 523 of file VuoMidi.cc.
MIDIClientRef VuoMidi_client |
Core MIDI client, for device notifications.
Definition at line 47 of file VuoMidi.cc.
|
static |
Trigger functions to call when the list of midi input devices changes.
Definition at line 44 of file VuoMidi.cc.
|
static |
Trigger functions to call when the list of midi output devices changes.
Definition at line 45 of file VuoMidi.cc.
unsigned int VuoMidi_useCount = 0 |
Process-wide count of callers (typically node instances) interested in notifications about midi devices.
Definition at line 46 of file VuoMidi.cc.