lrm_observer_hotplug_available method

bool lrm_observer_hotplug_available(
  1. Pointer<LrmObserver> observer
)

Whether this observer can actually deliver hotplug events right now.

Returns false for an observer created without a hotplug callback, and — on iOS/macOS — also when the CoreMIDI notification client could not be created (e.g. kMIDINoConnection when the MIDI server is unreachable). Port enumeration still works in that case, so the failure is otherwise invisible: the port list is correct and the initial setup_changed event still arrives, but no further hotplug notification ever will.

On iOS/macOS this is false until the observer's background initialisation has finished, so a caller asking immediately after creating the observer gets false. Check it again once the first setup_changed event has arrived: that event is emitted right after the notification client is set up, so by then the answer is final.

Implementation

bool lrm_observer_hotplug_available(ffi.Pointer<LrmObserver> observer) {
  return _lrm_observer_hotplug_available(observer);
}