aboutsummaryrefslogtreecommitdiffstats
path: root/daemon/src/main.cpp
blob: dc724330e650387be0d3a392669fd63978e201d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include "connection_manager.h"
#include "configuration.h"
#include "routing.h"

#include <iostream>
#include <thread>
#include <chrono>

using namespace midi_router;

int main()
{
    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));
    }
}