diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2016-01-09 14:45:38 -0500 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2016-01-09 14:45:38 -0500 |
commit | 36fb8c44c1b079451fbb4ffb197404fd6f3e3bb3 (patch) | |
tree | 56bcd2cfc9fbf421bce19ae9658fb1ec7a49ff5c | |
parent | 539d924691d163fda6c6b66e64683a4fe092228c (diff) |
add explanatory comment regarding coremidi data flow
-rw-r--r-- | libs/backends/coreaudio/coremidi_io.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/libs/backends/coreaudio/coremidi_io.cc b/libs/backends/coreaudio/coremidi_io.cc index a64fade8e3..caf80105b0 100644 --- a/libs/backends/coreaudio/coremidi_io.cc +++ b/libs/backends/coreaudio/coremidi_io.cc @@ -28,6 +28,26 @@ using namespace ARDOUR; static int _debug_mode = 0; #endif + +/** + * MIDI Data flow + * + * (A) INPUT (incoming from outside the application) + * + * - midiInputCallback (in its own thread, async WRT process callback): + * takes OS X MIDIPacket, copies into lock-free ringbuffer + * + * - processCallback (in its own thread): + * + * (1) loop on all input ports: + * 1A) call recv_event() to read from ringbuffer into stack buffer, also assign-timestamp, + * 1B) call parse_events() using stack buffer, when appropriate + * pushes CoreMidiEvent into std::vector<CoreMidiEvent> + * + * (2) in MidiPort::cycle_start() (also part of the process callback call tree), MidiPort::get_midi_buffer() + * calls CoreAudioBackend::midi_event_get () returns a pointer to the data of the specified CoreMidiEvent + */ + static void notifyProc (const MIDINotification *message, void *refCon) { CoreMidiIo *self = static_cast<CoreMidiIo*>(refCon); self->notify_proc(message); |