#include <mock_midi_system.hpp>
|
| using | PortChangeCallback = std::function<void()> |
| | Register a callback for MIDI port changes (device plug/unplug).
|
◆ PortChangeCallback
Register a callback for MIDI port changes (device plug/unplug).
The callback may fire on an OS thread. Pass nullptr to unregister.
◆ add_port()
| void pulp::midi::MockMidiSystem::add_port |
( |
const std::string & | id, |
|
|
const std::string & | name, |
|
|
bool | is_input = true ) |
|
inline |
Add (or replace) a port and notify the port-change callback.
◆ create_input()
| std::unique_ptr< MidiInput > pulp::midi::MockMidiSystem::create_input |
( |
| ) |
|
|
inlineoverridevirtual |
◆ create_output()
| std::unique_ptr< MidiOutput > pulp::midi::MockMidiSystem::create_output |
( |
| ) |
|
|
inlineoverridevirtual |
◆ drop_connections()
| void pulp::midi::MockMidiSystem::drop_connections |
( |
const std::string & | id | ) |
|
|
inline |
Sever the connection of every open input on id while the port stays listed, as when an OS replaces an endpoint behind a still-present name (a device that vanished and returned across a sleep).
The inputs then report is_open() == false.
◆ enumerate_inputs()
| std::vector< MidiPortInfo > pulp::midi::MockMidiSystem::enumerate_inputs |
( |
| ) |
|
|
inlineoverridevirtual |
◆ enumerate_outputs()
| std::vector< MidiPortInfo > pulp::midi::MockMidiSystem::enumerate_outputs |
( |
| ) |
|
|
inlineoverridevirtual |
◆ fail_next_opens()
| void pulp::midi::MockMidiSystem::fail_next_opens |
( |
int | count | ) |
|
|
inline |
Make the next count open attempts fail, to model a busy device.
◆ inject()
| int pulp::midi::MockMidiSystem::inject |
( |
const std::string & | id, |
|
|
const MidiEvent & | event ) |
|
inline |
Deliver event to every open input on id. Returns how many received it.
◆ notify()
| void pulp::midi::MockMidiSystem::notify |
( |
| ) |
|
|
inline |
◆ open_input_count()
| int pulp::midi::MockMidiSystem::open_input_count |
( |
const std::string & | id | ) |
const |
|
inline |
Number of currently open inputs on id.
◆ remove_port()
| void pulp::midi::MockMidiSystem::remove_port |
( |
const std::string & | id, |
|
|
bool | is_input = true ) |
|
inline |
Remove a port and notify the port-change callback.
◆ set_port_change_callback()
◆ set_ports_silently()
| void pulp::midi::MockMidiSystem::set_ports_silently |
( |
std::vector< MidiPortInfo > | ports | ) |
|
|
inline |
Change the port list without notifying, to model a notification that never arrived.
Call notify() or refresh the consumer afterwards.
◆ total_opens()
| int pulp::midi::MockMidiSystem::total_opens |
( |
| ) |
const |
|
inline |
Total successful input opens since construction.
The documentation for this class was generated from the following file: