metro: fixed bug of using tapif Time isn't running

This quick-fix ensures that when the tap-average is
really slow, that the TimeManager doesn't try to
set it as a BPM value. When Transport is stopped,
the average FPB could be 0, causing nasty things.
main
Harry van Haaren 2015-12-11 19:48:09 +00:00
parent e6ef26f33d
commit 1fedf486d7
1 changed files with 10 additions and 0 deletions

View File

@ -126,12 +126,22 @@ void TimeManager::tap()
int tapFpb3 = totalFrameCounter - tapTempo[2]; // last tap, until now
int average = (tapFpb1 + tapFpb2 + tapFpb3) / 3;
if( average < 13000 )
{
char buffer [50];
sprintf (buffer, "TM, tap() average too slow! quitting");
EventGuiPrint e( buffer );
writeToGuiRingbuffer( &e );
return;
}
char buffer [50];
sprintf (buffer, "TM, tap() average = %i", average );
EventGuiPrint e( buffer );
writeToGuiRingbuffer( &e );
setFpb(average);
// reset, so next 3 taps restart process