diff options
author | Roland Reichwein <mail@reichwein.it> | 2025-01-04 17:51:59 +0100 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2025-01-04 17:51:59 +0100 |
commit | 2e793141e5434043205763c70d3a597cf2d78eeb (patch) | |
tree | 8b6a14273fcc98ff7bf118cf63574257a637547f /NoteClick.cpp | |
parent | 624a69994d89c71b1ce59dd3b2117a235400be2f (diff) |
Separate clocks
Diffstat (limited to 'NoteClick.cpp')
-rw-r--r-- | NoteClick.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/NoteClick.cpp b/NoteClick.cpp new file mode 100644 index 0000000..657a893 --- /dev/null +++ b/NoteClick.cpp @@ -0,0 +1,20 @@ +#include "NoteClick.h" + +NoteClick::NoteClick(Config& config): + m_config(config), + m_detect(1) +{ + m_detect.signal_bpm.connect([&](int bpm){signal_bpm(bpm);}); +} + +// slots +void NoteClick::receive_note(int channel, int note, uint64_t timestamp) +{ + (void) timestamp; + + if (channel == m_config.get_midi_channel() && note == m_config.get_midi_note()) { + signal_click(); + m_detect.receive_event(); + } +} + |