From 6f64f64abd41e34384145cfddd7cbf3c244e956e Mon Sep 17 00:00:00 2001 From: Harry van Haaren Date: Sat, 2 Nov 2013 13:49:47 +0000 Subject: [PATCH] -Fixed metronome bar / beat different tick sounds --- src/metronome.cxx | 8 ++++++-- src/metronome.hxx | 3 +-- src/timemanager.cxx | 3 +-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/metronome.cxx b/src/metronome.cxx index 729adad..8eb8e2e 100644 --- a/src/metronome.cxx +++ b/src/metronome.cxx @@ -40,7 +40,7 @@ void Metronome::setActive(bool a) playPoint = endPoint + 1; } -void Metronome::bar(int) +void Metronome::bar() { playPoint = 0; playBar = true; @@ -49,6 +49,7 @@ void Metronome::bar(int) void Metronome::beat() { playPoint = 0; + playBar = false; } void Metronome::setFpb(int f) @@ -68,7 +69,10 @@ void Metronome::process(int nframes, Buffers* buffers) float* outR = buffers->audio[Buffers::MASTER_OUT_R]; float* sample = &beatSample[0]; - if( playBar ) { sample = &barSample[0]; playBar = false; } + if( playBar ) + { + sample = &barSample[0]; + } for(int i = 0; i < nframes; i++) { diff --git a/src/metronome.hxx b/src/metronome.hxx index 5c28815..1e53f7f 100644 --- a/src/metronome.hxx +++ b/src/metronome.hxx @@ -19,8 +19,7 @@ class Metronome : public TimeObserver void setActive(bool a); - void bar(){}; // dummy override - void bar(int); + void bar(); void beat(); void setFpb(int f); diff --git a/src/timemanager.cxx b/src/timemanager.cxx index 4e62770..b4fc595 100644 --- a/src/timemanager.cxx +++ b/src/timemanager.cxx @@ -158,14 +158,13 @@ void TimeManager::process(Buffers* buffers) } // FIXME: 4 == beats in time sig - if ( beat % (int) 4 == 0 ) + if ( beat % 4 == 0 ) { // inform observers of new bar SECOND for(uint i = 0; i < observers.size(); i++) { observers.at(i)->bar(); } - //buffers->transportPosition->bar++; }