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/types.h | |
parent | 6da14e1590935710055ebc81ba55017b457ca1ad (diff) |
Add router implementation, untested
Diffstat (limited to 'daemon/src/types.h')
-rw-r--r-- | daemon/src/types.h | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/daemon/src/types.h b/daemon/src/types.h index f09fb88..2942c0b 100644 --- a/daemon/src/types.h +++ b/daemon/src/types.h @@ -1,15 +1,37 @@ #pragma once +#include <cstdint> +#include <array> #include <string> #include <map> #include <vector> +#include <functional> namespace midi_router { +enum class Message_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, +}; + using Device_Id = std::string; using Device_Map = std::map<std::string, Device_Id>; -using Target_List = std::vector<Device_Id>; -using Route_Map = std::map<Device_Id, Target_List>; + +using Send_Callback = std::function<void(std::array<std::uint8_t, 3> const & payload)>; +using Target_List = std::vector<Send_Callback>; +using Route_Map = std::map<Device_Id, std::map<Message_Type, Target_List>>; } // namespace midi_router |