-Tempo Tap button UI freeze now fixed #62

main
Harry van Haaren 2013-12-10 21:47:26 +00:00
parent 85cb9e9d8d
commit 7d350441cc
1 changed files with 3 additions and 3 deletions

View File

@ -105,14 +105,14 @@ void TimeManager::registerObserver(TimeObserver* o)
void TimeManager::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;
}
if ( tapTempoPos < 3 )
{
tapTempo[tapTempoPos] = frame;
tapTempo[tapTempoPos] = totalFrameCounter;
tapTempoPos++;
}
else
@ -120,7 +120,7 @@ void TimeManager::tap()
// calculate frames per tap
int tapFpb1 = tapTempo[1] - tapTempo[0];
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;