diff options
author | Eddy Pedroni <epedroni@pm.me> | 2025-07-22 22:00:00 +0200 |
---|---|---|
committer | Eddy Pedroni <epedroni@pm.me> | 2025-07-22 22:00:00 +0200 |
commit | 6da14e1590935710055ebc81ba55017b457ca1ad (patch) | |
tree | 799daf6f75331183ea48ece00d62ec92f0fc7a51 /daemon/src/main.cpp | |
parent | f0835be9ffcae8e5c74c8fc6a0da2f7bc49343ac (diff) |
Initial daemon implementation, no routing yet
Diffstat (limited to 'daemon/src/main.cpp')
-rw-r--r-- | daemon/src/main.cpp | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/daemon/src/main.cpp b/daemon/src/main.cpp index 68d0a96..dc72433 100644 --- a/daemon/src/main.cpp +++ b/daemon/src/main.cpp @@ -1,8 +1,26 @@ +#include "connection_manager.h" +#include "configuration.h" +#include "routing.h" + #include <iostream> -#include <rtmidi/RtMidi.h> -#include "concurrentqueue/blockingconcurrentqueue.h" +#include <thread> +#include <chrono> + +using namespace midi_router; int main() { - std::cout << "Hello, world\n"; + Configuration const config {{ + {"Deluge MIDI 1", "deluge"}, + {"MPK mini Plus MIDI 1", "mpk"}, + }}; + + Router router {}; + Connection_Manager cm { config.devices, [&](Message const & m){ router.submit(m); } }; // works + //Connection_Manager cm { config.devices, std::bind(&Router::submit, &router, std::placeholders::_1) }; // why doesn't this work? + + while(true) + { + std::this_thread::sleep_for(std::chrono::seconds(1)); + } } |