Zrythm v2.0.0-alpha.1
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
zrythm::test_helpers::MockHardwareMidiInterface Class Reference
Inheritance diagram for zrythm::test_helpers::MockHardwareMidiInterface:
Collaboration diagram for zrythm::test_helpers::MockHardwareMidiInterface:

Public Member Functions

void set_device_change_callback (std::optional< DeviceChangeCallback > cb) override
 Registers a notification-only device change callback.
BufferMap device_buffers () const override
 Returns the current map of device identifiers to buffers.
void simulate_device_change (BufferMap buffers)

Additional Inherited Members

Public Types inherited from zrythm::dsp::IHardwareMidiInterface
using BufferMap
using DeviceChangeCallback = std::function<void ()>

Detailed Description

Definition at line 11 of file mock_hardware_midi_interface.h.

Member Function Documentation

◆ device_buffers()

BufferMap zrythm::test_helpers::MockHardwareMidiInterface::device_buffers ( ) const
inlineoverridevirtual

Returns the current map of device identifiers to buffers.

The returned shared_ptrs remain valid as long as the caller holds them, even across device changes (buffers are only destroyed when no longer referenced).

Implements zrythm::dsp::IHardwareMidiInterface.

Definition at line 20 of file mock_hardware_midi_interface.h.

◆ set_device_change_callback()

void zrythm::test_helpers::MockHardwareMidiInterface::set_device_change_callback ( std::optional< DeviceChangeCallback > cb)
inlineoverridevirtual

Registers a notification-only device change callback.

The implementation must call cb on the main thread whenever the set of active MIDI devices changes. The callback carries no data — the listener should call device_buffers() to pull the current state.

Passing nullopt unregisters the callback. Only one callback is supported. Calling again replaces the previous one.

Implements zrythm::dsp::IHardwareMidiInterface.

Definition at line 15 of file mock_hardware_midi_interface.h.

◆ simulate_device_change()

void zrythm::test_helpers::MockHardwareMidiInterface::simulate_device_change ( BufferMap buffers)
inline

Definition at line 22 of file mock_hardware_midi_interface.h.


The documentation for this class was generated from the following file: