diff options
Diffstat (limited to 'src/audio/audio_engine.cc')
| -rw-r--r-- | src/audio/audio_engine.cc | 34 |
1 files changed, 5 insertions, 29 deletions
diff --git a/src/audio/audio_engine.cc b/src/audio/audio_engine.cc index d11303c..8e47eac 100644 --- a/src/audio/audio_engine.cc +++ b/src/audio/audio_engine.cc @@ -3,7 +3,6 @@ #include "audio_engine.h" #include "util/debug.h" -#include <algorithm> #include <cstring> void AudioEngine::init() { @@ -49,7 +48,7 @@ void AudioEngine::reset() { } synth_init(); // Re-init synth (clears all state) - tracker_reset(); + ::tracker_init(); // Re-register all spectrograms (synth slots now clean) resource_mgr_.reset(); // Clear sample-to-synth mapping @@ -171,23 +170,18 @@ void AudioEngine::seek(float target_time) { // 1. Reset synth state (clear all active voices) synth_init(); - // 2. Reset tracker state - tracker_reset(); + // 2. Re-init tracker: re-registers all spectrograms with now-clean synth slots + ::tracker_init(); // 3. Clear sample-to-synth mapping (will be re-registered on demand) for (int i = 0; i < MAX_SPECTROGRAM_RESOURCES; ++i) { sample_to_synth_id_[i] = -1; } - // 4. Pre-warm samples for target time range - const float prewarm_start = std::max(0.0f, target_time - 1.0f); - const float prewarm_end = target_time + 2.0f; - prewarm_for_time_range(prewarm_start, prewarm_end); - - // 5. Simulate tracker up to target time (without audio) + // 4. Simulate tracker up to target time (without audio) const float dt = 0.1f; for (float t = 0.0f; t < target_time; t += dt) { - update_silent(t); + tracker_update(t, 0.0f); } // 6. Final update at exact target time @@ -200,22 +194,4 @@ void AudioEngine::seek(float target_time) { #endif } -void AudioEngine::prewarm_for_time_range(float start_time, float end_time) { - // TODO: Scan tracker score for patterns in this time range - // and pre-load their samples. For now, this is a placeholder. - // The proper implementation requires access to g_tracker_score - // and pattern data to determine which samples will be needed. - -#if defined(DEBUG_LOG_AUDIO) - DEBUG_AUDIO("[AudioEngine] Pre-warming samples for t=%.2f-%.2f\n", start_time, - end_time); -#endif -} - -void AudioEngine::update_silent(float music_time) { - // Update tracker without triggering audio (for fast-forward/seeking) - // This is a placeholder - proper implementation requires tracker support - // for silent updates. For now, we just update normally. - tracker_update(music_time, 0.0f); -} #endif /* !defined(STRIP_ALL) */ |
