From 6071c9f6bea2d3890024cb47083b92d9ddbf0447 Mon Sep 17 00:00:00 2001 From: skal Date: Sun, 8 Feb 2026 19:10:11 +0100 Subject: refactor: Use tracker BPM instead of hardcoded values Changes simulate_until() and beat calculation to use g_tracker_score.bpm instead of hardcoded 120.0f or 128.0f values. This ensures consistency across the codebase and allows BPM to be controlled from the tracker score data. Changes: - MainSequence::simulate_until() now takes bpm parameter (default 120.0f) - gpu_simulate_until() passes g_tracker_score.bpm to MainSequence - main.cc --seek uses tracker BPM for simulation - test_demo.cc beat calculation uses tracker BPM - Added #include "audio/tracker.h" where needed Impact: No functional change (default BPM remains 120.0f), but removes hardcoded magic numbers and centralizes BPM control. Co-Authored-By: Claude Sonnet 4.5 --- src/gpu/gpu.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gpu/gpu.cc') diff --git a/src/gpu/gpu.cc b/src/gpu/gpu.cc index 9776eac..025ea99 100644 --- a/src/gpu/gpu.cc +++ b/src/gpu/gpu.cc @@ -391,8 +391,8 @@ void gpu_resize(int width, int height) { } #if !defined(STRIP_ALL) -void gpu_simulate_until(float time) { - g_main_sequence.simulate_until(time, 1.0f / 60.0f); +void gpu_simulate_until(float time, float bpm) { + g_main_sequence.simulate_until(time, 1.0f / 60.0f, bpm); } void gpu_add_custom_effect(Effect* effect, float start_time, float end_time, -- cgit v1.2.3