diff options
author | Robin Gareus <robin@gareus.org> | 2015-03-07 04:15:02 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2015-03-07 14:35:32 +0100 |
commit | ce3adfd3d4c1a9e346ed9ecdc9e605346f483f98 (patch) | |
tree | 13d482217db123247046713aaed3d897a1790262 /libs/backends/coreaudio/coremidi_io.h | |
parent | e99599c7db97d6a02e4fb261b91b12eb88599057 (diff) |
Hard Core Audio
* allow to change buffersizes
* subscribe to buffersize & samplerate changes
* add support for half-duplex devices.
* aggregate Devices (not yet used) code from JACK2
* unify deprecated API wrappers
* properly keep track of MIDI ports
* disable MidiI/O during freewheeling
* various small fixes & cleanup
Diffstat (limited to 'libs/backends/coreaudio/coremidi_io.h')
-rw-r--r-- | libs/backends/coreaudio/coremidi_io.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/libs/backends/coreaudio/coremidi_io.h b/libs/backends/coreaudio/coremidi_io.h index 9edc77aa9d..de4f9be0bb 100644 --- a/libs/backends/coreaudio/coremidi_io.h +++ b/libs/backends/coreaudio/coremidi_io.h @@ -64,8 +64,9 @@ public: CoreMidiIo (void); ~CoreMidiIo (void); - // TODO explicit start/stop, add/remove devices as needed. - void discover (); + void start (); + void stop (); + void start_cycle (); int send_event (uint32_t, double, const uint8_t *, const size_t); @@ -73,15 +74,20 @@ public: uint32_t n_midi_inputs (void) const { return _n_midi_in; } uint32_t n_midi_outputs (void) const { return _n_midi_out; } + std::string port_name (uint32_t, bool input); void notify_proc (const MIDINotification *message); + void set_enabled (bool yn = true) { _enabled = yn; } + bool enabled (void) const { return _active && _enabled; } + void set_port_changed_callback (void (changed_callback (void*)), void *arg) { _changed_callback = changed_callback; _changed_arg = arg; } private: + void discover (); void cleanup (); MIDIClientRef _midi_client; @@ -97,8 +103,12 @@ private: uint32_t _n_midi_out; MIDITimeStamp _time_at_cycle_start; - bool _active; + bool _active; // internal deactivate during discovery etc + bool _enabled; // temporary disable, e.g. during freewheeli + bool _run; // general status void (* _changed_callback) (void*); void * _changed_arg; + + pthread_mutex_t _discovery_lock; }; |