aboutsummaryrefslogtreecommitdiffstats
path: root/daemon/src/routing.cpp
diff options
context:
space:
mode:
authorEddy Pedroni <epedroni@pm.me>2025-07-23 22:33:05 +0200
committerEddy Pedroni <epedroni@pm.me>2025-07-23 22:33:05 +0200
commitc5c195ff5318f00d544c0fbceb133abcc4ba7a5a (patch)
tree1c7a3e646f6eb72d748dd606fe9e8e12175b39bd /daemon/src/routing.cpp
parent41f95375a65a3f67a75258680d6d8b03bb4d678b (diff)
MVP
Diffstat (limited to 'daemon/src/routing.cpp')
-rw-r--r--daemon/src/routing.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/daemon/src/routing.cpp b/daemon/src/routing.cpp
index ac15eff..8dce695 100644
--- a/daemon/src/routing.cpp
+++ b/daemon/src/routing.cpp
@@ -7,7 +7,7 @@ namespace midi_router
{
void
-Router::route(Route_Map const & config)
+Router::route(Route_Table const & config, bool verbose)
{
Message m;
if (m_queue.wait_dequeue_timed(m, std::chrono::milliseconds(500)))
@@ -20,6 +20,12 @@ Router::route(Route_Map const & config)
// LTG: at least one of these map accesses can be avoided
for (auto const & target: config.at(*m.source_id).at(m.type()))
{
+ if (verbose)
+ {
+ std::cout << "[" << type2string.at(m.type()) << "] " << *m.source_id << " -> " << target.get().get_id() << " | ";
+ for (auto byte : m.bytes) std::cout << static_cast<unsigned>(byte) << " ";
+ std::cout << ")\n";
+ }
target.get().send(m.bytes);
}
}