aboutsummaryrefslogtreecommitdiffstats
path: root/daemon/src/main.cpp
blob: 008fd2ac9b03dd7eb52b8c6ef5b215feb16089ec (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
27
28
29
30
31
32
33
34
35
36
37
38
#include "connection_manager.h"
#include "types.h"
#include "routing.h"

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

using namespace midi_router;

int main()
{
    // LTG: move configuration to TOML file
    Device_Map const devices {
        { "Deluge MIDI 1", "deluge" },
        { "MPK mini Plus MIDI 1", "mpk" },
        { "Xjam MIDI 1", "xjam" },
        { "OP-1 MIDI 1", "op1" },
    };

    Router router {};
    Connection_Manager cm { devices, router };

    Route_Map const routes {
        { "mpk", 
            {
                { Message_Type::NOTE_ON, { cm.get_sender("deluge"), cm.get_sender("op1") } },
                { Message_Type::NOTE_OFF, { cm.get_sender("deluge"), cm.get_sender("op1")} },
            }
        },
    };

    while(true)
    {
        router.route(routes);
        //std::this_thread::sleep_for(std::chrono::milliseconds(500));
    }
}