Merge pull request #216 from georgkrause/cleanup

Cleanup, thanks @georgkrause
main
Harry van Haaren 2018-04-05 21:07:28 +01:00 committed by GitHub
commit fb5174593c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 4 deletions

View File

@ -546,8 +546,7 @@ void GenericMIDI::midi(unsigned char* midi)
jack->getLogic()->tapTempo();
break;
case Event::TIME_BPM:
// FIXME: quick-fix for "ZeroOne" type value -> BPM range
jack->getLogic()->setBpm( value * (MAX_TEMPO - MIN_TEMPO) + MIN_TEMPO );
jack->getLogic()->setBpmZeroOne( value );
break;
case Event::METRONOME_ACTIVE:
jack->getLogic()->metronomeEnable( b->active );

View File

@ -41,6 +41,11 @@ void Logic::setBpm(float bpm)
jack->getTimeManager()->setBpm( bpm );
}
void Logic::setBpmZeroOne(float bpm)
{
jack->getTimeManager()->setBpmZeroOne( bpm );
}
void Logic::metronomeEnable(bool b)
{
jack->getMetronome()->setActive(b);

View File

@ -42,7 +42,8 @@ public:
Logic();
void tapTempo();
void setBpm(float bpm); /// 0-1 input
void setBpm(float bpm); // actual BPM input
void setBpmZeroOne( float bpm ); /// 0-1 input
void metronomeEnable(bool b);

View File

@ -82,7 +82,7 @@ void TimeManager::setBpm(float bpm)
void TimeManager::setBpmZeroOne(float b)
{
setBpm( b * (MAX_TEMPO - MIN_TEMPO) + MIN_TEMPO ); // 60 - 220
setBpm( b * (MAX_TEMPO - MIN_TEMPO) + MIN_TEMPO ); // MIN_TEMPO - MAX_TEMPO
}