Skip to content

Commit

Permalink
Fix last commit
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <falktx@falktx.com>
  • Loading branch information
falkTX committed Aug 29, 2023
1 parent 681228d commit 1b5f7e9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion source/backend/plugin/CarlaPluginCLAP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2058,11 +2058,12 @@ class CarlaPluginCLAP : public CarlaPlugin,
CARLA_SAFE_ASSERT_INT(timeInfo.bbt.bar > 0, timeInfo.bbt.bar);
CARLA_SAFE_ASSERT_INT(timeInfo.bbt.beat > 0, timeInfo.bbt.beat);

const double barStart = static_cast<double>(timeInfo.bbt.beatsPerBar) * (timeInfo.bbt.bar - 1);
const double positionBeats = static_cast<double>(timeInfo.frame)
/ (sampleRate * 60 / timeInfo.bbt.beatsPerMinute);

// Bar/Beats
clapTransport.bar_start = static_cast<double>(timeInfo.bbt.beatsPerBar) * (timeInfo.bbt.bar - 1);
clapTransport.bar_start = std::round(CLAP_BEATTIME_FACTOR * barStart);
clapTransport.bar_number = timeInfo.bbt.bar - 1;
clapTransport.song_pos_beats = std::round(CLAP_BEATTIME_FACTOR * positionBeats);
clapTransport.flags |= CLAP_TRANSPORT_HAS_BEATS_TIMELINE;
Expand Down

0 comments on commit 1b5f7e9

Please sign in to comment.