mirror of
https://github.com/vale981/openAV-Luppp
synced 2025-03-05 09:01:39 -05:00
-Fixed metronome bar / beat different tick sounds
This commit is contained in:
parent
b1566046fc
commit
6f64f64abd
3 changed files with 8 additions and 6 deletions
|
@ -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++)
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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++;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue