From 56fcb8a7c0ed1ca50c9225a2d681d5afa6fb20fb Mon Sep 17 00:00:00 2001 From: Georg Krause Date: Mon, 2 Apr 2018 22:09:59 +0200 Subject: [PATCH] use calculation in class member --- src/controller/genericmidi.cxx | 3 +-- src/logic.cxx | 5 +++++ src/logic.hxx | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/controller/genericmidi.cxx b/src/controller/genericmidi.cxx index 78ca8b3..2126f1e 100644 --- a/src/controller/genericmidi.cxx +++ b/src/controller/genericmidi.cxx @@ -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 ); diff --git a/src/logic.cxx b/src/logic.cxx index af35962..6c5b547 100644 --- a/src/logic.cxx +++ b/src/logic.cxx @@ -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); diff --git a/src/logic.hxx b/src/logic.hxx index 1d2006e..8a16c9f 100644 --- a/src/logic.hxx +++ b/src/logic.hxx @@ -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);