diff options
author | Roland Reichwein <mail@reichwein.it> | 2025-01-03 20:17:26 +0100 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2025-01-03 20:17:26 +0100 |
commit | 6bf4770e950299da92952f2965cccf86a903fc9f (patch) | |
tree | 9854c706f0fc8104f1f85fe0f6ff58b56661a5a6 /main.cpp | |
parent | 81ef3f08215a62d469c49762ccd492cb806150c4 (diff) |
Added config
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();}); |