diff options
Diffstat (limited to 'main.cpp')
-rw-r--r-- | main.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -1,3 +1,4 @@ +#include "Click.h" #include "ClickStream.h" #include "MIDI.h" #include "PCM.h" @@ -9,9 +10,10 @@ #include <chrono> #include <cmath> #include <cstdint> +#include <exception> #include <iostream> #include <limits> -#include <exception> +#include <memory> #include <stdexcept> #include <stdio.h> @@ -36,6 +38,15 @@ int main(void) log_cout.activate(); log_cout.log_lines(log_lines); + Config config; + + std::shared_ptr<ClockClick> clock_click = std::make_shared<ClockClick>(); + std::shared_ptr<NoteClick> note_click = std::make_shared<NoteClick>(config); + std::shared_ptr<InternalClick> internal_click = std::make_shared<InternalClick>(config); + + // Active Mode + std::shared_ptr<Click> click = note_click; + MIDI midi; ClickStream stream; PCM pcm{stream}; @@ -50,7 +61,8 @@ int main(void) boost::signals2::signal<void()> 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();}); |