diff options
author | Eddy Pedroni <epedroni@pm.me> | 2025-07-22 22:55:24 +0200 |
---|---|---|
committer | Eddy Pedroni <epedroni@pm.me> | 2025-07-22 22:55:24 +0200 |
commit | 29ca6bac4565d754a67414e503a215627d3aa566 (patch) | |
tree | ae86ca581f6aae6e2d2a870b963a8fe3b05da625 /daemon/src/message.h | |
parent | 6da14e1590935710055ebc81ba55017b457ca1ad (diff) |
Add router implementation, untested
Diffstat (limited to 'daemon/src/message.h')
-rw-r--r-- | daemon/src/message.h | 27 |
1 files changed, 5 insertions, 22 deletions
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<std::uint8_t, 3> const bytes; + Device_Id const * source_id; + std::array<std::uint8_t, 3> bytes; - Type + Message_Type type() const { - if (bytes[0] & 0xF0 == 0xF0) return static_cast<Type>(bytes[0]); - else return static_cast<Type>(bytes[0] >> 4); + if (bytes[0] & 0xF0 == 0xF0) return static_cast<Message_Type>(bytes[0]); + else return static_cast<Message_Type>(bytes[0] >> 4); } }; |