mirror of
https://github.com/vale981/openAV-Luppp
synced 2025-03-05 09:01:39 -05:00
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.
This commit is contained in:
parent
e6ef26f33d
commit
1fedf486d7
1 changed files with 10 additions and 0 deletions
|
@ -126,12 +126,22 @@ void TimeManager::tap()
|
||||||
int tapFpb3 = totalFrameCounter - 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;
|
||||||
|
|
||||||
|
if( average < 13000 )
|
||||||
|
{
|
||||||
|
char buffer [50];
|
||||||
|
sprintf (buffer, "TM, tap() average too slow! quitting");
|
||||||
|
EventGuiPrint e( buffer );
|
||||||
|
writeToGuiRingbuffer( &e );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
char buffer [50];
|
char buffer [50];
|
||||||
sprintf (buffer, "TM, tap() average = %i", average );
|
sprintf (buffer, "TM, tap() average = %i", average );
|
||||||
EventGuiPrint e( buffer );
|
EventGuiPrint e( buffer );
|
||||||
writeToGuiRingbuffer( &e );
|
writeToGuiRingbuffer( &e );
|
||||||
|
|
||||||
|
|
||||||
setFpb(average);
|
setFpb(average);
|
||||||
|
|
||||||
// reset, so next 3 taps restart process
|
// reset, so next 3 taps restart process
|
||||||
|
|
Loading…
Add table
Reference in a new issue