From 6bf4770e950299da92952f2965cccf86a903fc9f Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Fri, 3 Jan 2025 20:17:26 +0100 Subject: Added config --- main.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'main.cpp') diff --git a/main.cpp b/main.cpp index 8fb4822..ca8ec91 100644 --- a/main.cpp +++ b/main.cpp @@ -1,3 +1,4 @@ +#include "Click.h" #include "ClickStream.h" #include "MIDI.h" #include "PCM.h" @@ -9,9 +10,10 @@ #include #include #include +#include #include #include -#include +#include #include #include @@ -36,6 +38,15 @@ int main(void) log_cout.activate(); log_cout.log_lines(log_lines); + Config config; + + std::shared_ptr clock_click = std::make_shared(); + std::shared_ptr note_click = std::make_shared(config); + std::shared_ptr internal_click = std::make_shared(config); + + // Active Mode + std::shared_ptr click = note_click; + MIDI midi; ClickStream stream; PCM pcm{stream}; @@ -50,7 +61,8 @@ int main(void) boost::signals2::signal signal_count_loops; // Signal-Slot Connections: - midi.signal_click.connect([&](){stream.click();}); + midi.signal_note.connect([&](int channel, int note){note_click->receive_note(channel, note);}); + note_click->signal_click.connect([&](){stream.click();}); timer_500ms.elapsed.connect([&](){ui.draw();}); signal_count_loops.connect([&](){ui.count_main_loops();}); -- cgit v1.2.3