summaryrefslogtreecommitdiff
path: root/src/audio/tracker.cc
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-03 18:44:41 +0100
committerskal <pascal.massimino@gmail.com>2026-02-03 18:44:41 +0100
commitbf46e44e1cb6027a072819a2a3aa3be32651f6e1 (patch)
tree21267e7ef52fd91e7b99271ed87e275e91b3de3c /src/audio/tracker.cc
parent815c428dea14a6a1ea5c421c400985d0c14d473d (diff)
refactor: Task #20 - Platform & Code Hygiene
- Consolidated all WebGPU shims and platform-specific logic into src/platform.h. - Refactored platform_init to return PlatformState by value and platform_poll to automatically refresh time and aspect_ratio. - Removed STL dependencies (std::map, std::vector, std::string) from AssetManager and Procedural subsystems. - Fixed Windows cross-compilation by adjusting include paths and linker flags in CMakeLists.txt and updating build_win.sh. - Removed redundant direct inclusions of GLFW/glfw3.h and WebGPU headers across the project. - Applied clang-format and updated documentation. handoff(Gemini): Completed Task #20 and 20.1. Platform abstraction is now unified, and core paths are STL-free. Windows build is stable.
Diffstat (limited to 'src/audio/tracker.cc')
-rw-r--r--src/audio/tracker.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/audio/tracker.cc b/src/audio/tracker.cc
index 470123a..8f3da38 100644
--- a/src/audio/tracker.cc
+++ b/src/audio/tracker.cc
@@ -69,8 +69,10 @@ void tracker_update(float time_sec) {
if (data && size >= sizeof(SpecHeader)) {
const SpecHeader* header = (const SpecHeader*)data;
note_frames = header->num_frames;
- const float* src_spectral_data = (const float*)(data + sizeof(SpecHeader));
- note_data.assign(src_spectral_data, src_spectral_data + (size_t)note_frames * DCT_SIZE);
+ const float* src_spectral_data =
+ (const float*)(data + sizeof(SpecHeader));
+ note_data.assign(src_spectral_data,
+ src_spectral_data + (size_t)note_frames * DCT_SIZE);
}
} else {
const NoteParams& params = g_tracker_samples[event.sample_id];
@@ -78,9 +80,10 @@ void tracker_update(float time_sec) {
}
if (note_frames > 0) {
- int frame_offset = (int)(event.beat * beat_to_sec * 32000.0f / DCT_SIZE);
- paste_spectrogram(pattern_data, &dest_num_frames, note_data, note_frames,
- frame_offset);
+ int frame_offset =
+ (int)(event.beat * beat_to_sec * 32000.0f / DCT_SIZE);
+ paste_spectrogram(pattern_data, &dest_num_frames, note_data,
+ note_frames, frame_offset);
}
}