mirror of
https://github.com/vale981/openAV-Luppp
synced 2025-03-05 09:01:39 -05:00
-Tempo Tap button UI freeze now fixed #62
This commit is contained in:
parent
85cb9e9d8d
commit
7d350441cc
1 changed files with 3 additions and 3 deletions
|
@ -105,14 +105,14 @@ void TimeManager::registerObserver(TimeObserver* o)
|
||||||
void TimeManager::tap()
|
void TimeManager::tap()
|
||||||
{
|
{
|
||||||
// reset tap tempo to "first tap" if more than 5 secs elapsed since last tap
|
// reset tap tempo to "first tap" if more than 5 secs elapsed since last tap
|
||||||
if ( tapTempo[0] < frame - samplerate * 5 )
|
if ( tapTempo[0] < totalFrameCounter - samplerate * 5 )
|
||||||
{
|
{
|
||||||
tapTempoPos = 0;
|
tapTempoPos = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( tapTempoPos < 3 )
|
if ( tapTempoPos < 3 )
|
||||||
{
|
{
|
||||||
tapTempo[tapTempoPos] = frame;
|
tapTempo[tapTempoPos] = totalFrameCounter;
|
||||||
tapTempoPos++;
|
tapTempoPos++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -120,7 +120,7 @@ void TimeManager::tap()
|
||||||
// calculate frames per tap
|
// calculate frames per tap
|
||||||
int tapFpb1 = tapTempo[1] - tapTempo[0];
|
int tapFpb1 = tapTempo[1] - tapTempo[0];
|
||||||
int tapFpb2 = tapTempo[2] - tapTempo[1];
|
int tapFpb2 = tapTempo[2] - tapTempo[1];
|
||||||
int tapFpb3 = frame - tapTempo[2]; // last tap, until now
|
int tapFpb3 = totalFrameCounter - tapTempo[2]; // last tap, until now
|
||||||
|
|
||||||
int average = (tapFpb1 + tapFpb2 + tapFpb3) / 3;
|
int average = (tapFpb1 + tapFpb2 + tapFpb3) / 3;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue