summaryrefslogtreecommitdiff
path: root/src/gpu/effect.cc
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-08 19:10:11 +0100
committerskal <pascal.massimino@gmail.com>2026-02-08 19:10:11 +0100
commit6071c9f6bea2d3890024cb47083b92d9ddbf0447 (patch)
tree9c68b4c660cd2f33a7d0fde38876bc6725e17c02 /src/gpu/effect.cc
parentcd807732799904f6731f460cc0469143c410c2c9 (diff)
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 <noreply@anthropic.com>
Diffstat (limited to 'src/gpu/effect.cc')
-rw-r--r--src/gpu/effect.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gpu/effect.cc b/src/gpu/effect.cc
index a1b45f1..df8ef2d 100644
--- a/src/gpu/effect.cc
+++ b/src/gpu/effect.cc
@@ -2,6 +2,7 @@
// It implements the Sequence management logic.
#include "effect.h"
+#include "audio/tracker.h"
#include "gpu/demo_effects.h"
#include "gpu/gpu.h"
#include <algorithm>
@@ -383,8 +384,8 @@ void MainSequence::shutdown() {
}
#if !defined(STRIP_ALL)
-void MainSequence::simulate_until(float target_time, float step_rate) {
- const float bpm = 128.0f;
+void MainSequence::simulate_until(float target_time, float step_rate,
+ float bpm) {
const float aspect_ratio = 16.0f / 9.0f;
for (float t = 0.0f; t < target_time; t += step_rate) {
WGPUCommandEncoder encoder =