From 29ca6bac4565d754a67414e503a215627d3aa566 Mon Sep 17 00:00:00 2001 From: Eddy Pedroni Date: Tue, 22 Jul 2025 22:55:24 +0200 Subject: Add router implementation, untested --- daemon/src/message.h | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) (limited to 'daemon/src/message.h') diff --git a/daemon/src/message.h b/daemon/src/message.h index 9339118..4668e0c 100644 --- a/daemon/src/message.h +++ b/daemon/src/message.h @@ -11,31 +11,14 @@ namespace midi_router struct Message { - enum class Type - { - NOTE_OFF = 0x8u, - NOTE_ON = 0x9u, - POLY_AT = 0xAu, - CONTROL_CHANGE = 0xBu, - PROGRAM_CHANGE = 0xCu, - CHANNEL_AT = 0xDu, - PITCH_WHEEL = 0xEu, - - CLOCK = 0xF8u, - MEAS_END = 0xF9u, - START = 0xFAu, - CONTINUE = 0xFBu, - STOP = 0xFCu, - }; - - Device_Id const & source_id; - std::array const bytes; + Device_Id const * source_id; + std::array bytes; - Type + Message_Type type() const { - if (bytes[0] & 0xF0 == 0xF0) return static_cast(bytes[0]); - else return static_cast(bytes[0] >> 4); + if (bytes[0] & 0xF0 == 0xF0) return static_cast(bytes[0]); + else return static_cast(bytes[0] >> 4); } }; -- cgit v1.2.3