add sanity check for bpm value

main
Georg Krause 2018-03-31 15:05:16 +02:00
parent fe1b68a069
commit ac6d1fc4cc
1 changed files with 5 additions and 2 deletions

View File

@ -173,8 +173,11 @@ static void gmastertrack_button_callback(Fl_Widget *w, void *data)
const char* answer = fl_input("Enter BPM value: ");
if(answer) {
int bpm = atoi(answer);
EventTimeBPM e = EventTimeBPM( bpm );
writeToDspRingbuffer( &e );
if ( bpm >= MIN_TEMPO && bpm <= MAX_TEMPO) {
EventTimeBPM e = EventTimeBPM( bpm );
writeToDspRingbuffer( &e );
}
}
} else {
EventTimeTempoTap e;