Cross-platform BLE MIDI central. More...
#include <ble_midi.hpp>
Public Member Functions | |
| virtual | ~BleMidiCentral ()=default |
| virtual bool | is_available () const =0 |
| True if the running platform has a BLE MIDI backend compiled in AND the user/system has granted Bluetooth permission. | |
| virtual bool | start_scan (BleMidiScanCallback callback)=0 |
| Start scanning. | |
| virtual void | stop_scan ()=0 |
| virtual bool | is_scanning () const =0 |
| virtual std::vector< BleMidiPeripheral > | known_peripherals () const =0 |
| Snapshot of peripherals currently known to the central. | |
| virtual bool | connect (const std::string &peripheral_id)=0 |
| Begin a connection. | |
| virtual void | disconnect (const std::string &peripheral_id)=0 |
| virtual void | set_state_callback (BleMidiStateCallback callback)=0 |
| virtual std::string | midi_input_port_for (const std::string &peripheral_id) const =0 |
| MIDI port-id that MidiSystem::enumerate_inputs() returns once the peripheral is Connected. | |
| virtual std::string | midi_output_port_for (const std::string &peripheral_id) const =0 |
Cross-platform BLE MIDI central.
Owns the scan + connect surface. The actual MIDI byte stream, once connected, is delivered through the regular MidiInput interface acquired via create_input(id) so existing callers consume BLE MIDI events identically to USB MIDI.
|
virtualdefault |
|
pure virtual |
Begin a connection.
Connection progress arrives on the state callback. Once state == Connected the peripheral is registered with CoreMIDI / ALSA / WinRT and surfaces as a regular MIDI port the host can open through MidiSystem::create_input().
|
pure virtual |
|
pure virtual |
True if the running platform has a BLE MIDI backend compiled in AND the user/system has granted Bluetooth permission.
On platforms with only a scaffold backend, returns false.
|
pure virtual |
|
pure virtual |
Snapshot of peripherals currently known to the central.
Includes previously paired peripherals returned by the OS even when the scanner has not yet seen an advertisement in the current scan cycle (Apple retrievePeripherals semantics).
|
pure virtual |
MIDI port-id that MidiSystem::enumerate_inputs() returns once the peripheral is Connected.
Returns empty string if the peripheral is not connected (or the backend doesn't expose the mapping). Lets the UI pre-select the BLE port in a port- picker without polling enumerate_inputs() until it appears.
|
pure virtual |
|
pure virtual |
|
pure virtual |
Start scanning.
The callback fires once per peripheral observation (the backend deduplicates by id and refreshes the last_seen timestamp). Calling start_scan() while already scanning is a no-op. Backends MUST honor the OS-level scan duty-cycle limits; consumers should still call stop_scan() when the UI is dismissed.
|
pure virtual |