Zrythm v2.0.0-alpha.1
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
hardware_midi_interface.h
1// SPDX-FileCopyrightText: © 2026 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
4#pragma once
5
6#include <functional>
7#include <map>
8
9#include "utils/utf8_string.h"
10
11namespace zrythm::dsp
12{
13
15
28{
29public:
30 using BufferMap =
31 std::map<utils::Utf8String, std::shared_ptr<dsp::MidiDeviceBuffer>>;
32 using DeviceChangeCallback = std::function<void ()>;
33
34 virtual ~IHardwareMidiInterface () = default;
35
46 virtual void
47 set_device_change_callback (std::optional<DeviceChangeCallback> cb) = 0;
48
56 virtual BufferMap device_buffers () const = 0;
57};
58
59}
Abstraction for hardware MIDI interface.
virtual BufferMap device_buffers() const =0
Returns the current map of device identifiers to buffers.
virtual void set_device_change_callback(std::optional< DeviceChangeCallback > cb)=0
Registers a notification-only device change callback.
Lock-free SPSC buffer for MIDI events between the MIDI device thread and the audio thread.