aud_midi_core 0.1.0
aud_midi_core: ^0.1.0 copied to clipboard
Runtime contracts for aud_midi: backend interfaces, fake backend, scheduler, port registry, diagnostics
aud_midi_core #
Runtime contracts of the aud_midi family: backend interfaces, a fake backend, the software scheduler, the port registry and diagnostics.
Part of the aud_midi family, see aud_midi.
Goals #
- MidiBackend, advertiser and BLE transport interfaces
- FakeMidiBackend for tests
- Software scheduler with the send contract
- Port registry and diagnostics bus
- No dart:io, dart:ffi or dart:isolate
State #
Implemented; every file is covered 100 % by its own tests on the Dart VM, and the pure-Dart tests also pass in Chrome (dart test -p chrome test/clock test/engine test/fake test/backend test/ble test/error).
- Contracts:
MidiBackendwith virtual port, Bluetooth and network sub-APIs,MidiBackendHost,MidiServiceAdvertiser,MidiBleTransport,MidiException. - Clock:
MidiSystemClock(Timeline.nowon the VM,performance.now()in the browser),MidiClockMapper, andMidiFakeClockwithMidiFakeTimersfor tests. MidiEnginehosts one backend in the current isolate: per input a MIDI 1.0 parser or UMP decoder, JR timestamps as sender time, optional translation, bounded queues with overflow diagnostics; per output translation to the port's protocol, encoding, scheduling by the operating system or the software scheduler (with a lookahead for ports that cannot discard),cancelPendingand panic; port registry with re-plug candidates and devices; diagnostics bus; a fixed shutdown order.MidiCompositeBackendcombines backends,MidiBleBluetoothBackendruns BLE-MIDI over a GATT client.FakeMidiBackendwith loopback, hotplug, failures and in-memory virtual ports, BLE and network sessions. The contract tests run against it: they prove the Dart abstraction, not a native binding.
See the plan in aud_midi_pm.
Installation #
dart pub add aud_midi_core