summaryrefslogtreecommitdiff
path: root/src/app
diff options
context:
space:
mode:
Diffstat (limited to 'src/app')
-rw-r--r--src/app/main.cc17
-rw-r--r--src/app/test_demo.cc31
2 files changed, 27 insertions, 21 deletions
diff --git a/src/app/main.cc b/src/app/main.cc
index 5d699ce..27d6312 100644
--- a/src/app/main.cc
+++ b/src/app/main.cc
@@ -225,8 +225,8 @@ int main(int argc, char** argv) {
if ((int)physical_time % 5 == 0 &&
physical_time - update_dt < (int)physical_time) {
- printf(" Progress: %.1fs / %.1fs (music: %.1fs)\r",
- physical_time, headless_duration, g_music_time);
+ printf(" Progress: %.1fs / %.1fs (music: %.1fs)\r", physical_time,
+ headless_duration, g_music_time);
fflush(stdout);
}
}
@@ -349,9 +349,11 @@ int main(int argc, char** argv) {
const float visual_peak = fminf(raw_peak * 8.0f, 1.0f);
// Beat calculation: convert audio time to musical beats
- const float absolute_beat_time = current_audio_time * g_tracker_score.bpm / 60.0f;
+ const float absolute_beat_time =
+ current_audio_time * g_tracker_score.bpm / 60.0f;
const int beat_number = (int)absolute_beat_time;
- const float beat_phase = fmodf(absolute_beat_time, 1.0f); // Fractional part (0.0 to 1.0)
+ const float beat_phase =
+ fmodf(absolute_beat_time, 1.0f); // Fractional part (0.0 to 1.0)
// Print beat/time info periodically for identifying sync points
// Use graphics time for the print interval to avoid excessive output if
@@ -366,9 +368,10 @@ int main(int argc, char** argv) {
current_physical_time, current_audio_time, g_music_time,
beat_number, beat_phase, visual_peak, g_tempo_scale);
} else {
- printf("[GraphicsT=%.2f, AudioT=%.2f, Beat=%d, Phase=%.2f, Peak=%.2f]\n",
- current_physical_time, current_audio_time, beat_number, beat_phase,
- visual_peak);
+ printf(
+ "[GraphicsT=%.2f, AudioT=%.2f, Beat=%d, Phase=%.2f, Peak=%.2f]\n",
+ current_physical_time, current_audio_time, beat_number, beat_phase,
+ visual_peak);
}
last_graphics_print_time = current_physical_time;
}
diff --git a/src/app/test_demo.cc b/src/app/test_demo.cc
index 2a91d37..39dbcba 100644
--- a/src/app/test_demo.cc
+++ b/src/app/test_demo.cc
@@ -20,10 +20,10 @@ extern float GetDemoDuration();
extern void LoadTimeline(MainSequence& main_seq, const GpuContext& ctx);
// Inline peak meter effect for debugging audio-visual sync
-#include "gpu/post_process_helper.h"
-#include "gpu/shader_composer.h"
#include "effects/cnn_effect.h"
#include "effects/cnn_v2_effect.h"
+#include "gpu/post_process_helper.h"
+#include "gpu/shader_composer.h"
class PeakMeterEffect : public PostProcessEffect {
public:
@@ -81,11 +81,11 @@ class PeakMeterEffect : public PostProcessEffect {
)";
// Compose shader with common_uniforms to get CommonUniforms definition
- std::string shader_code = ShaderComposer::Get().Compose(
- {"common_uniforms"}, shader_main);
+ std::string shader_code =
+ ShaderComposer::Get().Compose({"common_uniforms"}, shader_main);
- pipeline_ =
- create_post_process_pipeline(ctx_.device, ctx_.format, shader_code.c_str());
+ pipeline_ = create_post_process_pipeline(ctx_.device, ctx_.format,
+ shader_code.c_str());
}
void update_bind_group(WGPUTextureView input_view) override {
@@ -100,7 +100,7 @@ class PeakMeterEffect : public PostProcessEffect {
}
};
-static int g_cnn_version = 2; // Default to v2
+static int g_cnn_version = 2; // Default to v2
#if !defined(STRIP_ALL)
static void print_usage(const char* prog_name) {
@@ -368,9 +368,11 @@ int main(int argc, char** argv) {
const float visual_peak = fminf(raw_peak * 8.0f, 1.0f);
// Beat calculation: convert audio time to musical beats
- const float absolute_beat_time = current_audio_time * g_tracker_score.bpm / 60.0f;
+ const float absolute_beat_time =
+ current_audio_time * g_tracker_score.bpm / 60.0f;
const int beat_number = (int)absolute_beat_time;
- const float beat_phase = fmodf(absolute_beat_time, 1.0f); // Fractional part (0.0 to 1.0)
+ const float beat_phase =
+ fmodf(absolute_beat_time, 1.0f); // Fractional part (0.0 to 1.0)
#if !defined(STRIP_ALL)
// Log peak (either per-frame or per-beat)
@@ -401,9 +403,10 @@ int main(int argc, char** argv) {
current_physical_time, current_audio_time, g_music_time,
beat_number, beat_phase, visual_peak, g_tempo_scale);
} else {
- printf("[GraphicsT=%.2f, AudioT=%.2f, Beat=%d, Phase=%.2f, Peak=%.2f]\n",
- current_physical_time, current_audio_time, beat_number, beat_phase,
- visual_peak);
+ printf(
+ "[GraphicsT=%.2f, AudioT=%.2f, Beat=%d, Phase=%.2f, Peak=%.2f]\n",
+ current_physical_time, current_audio_time, beat_number, beat_phase,
+ visual_peak);
}
last_graphics_print_time = current_physical_time;
}
@@ -411,8 +414,8 @@ int main(int argc, char** argv) {
// Draw graphics using physical time and musical beat time
const float graphics_frame_time = (float)current_physical_time;
- gpu_draw(visual_peak, aspect_ratio, graphics_frame_time,
- absolute_beat_time, beat_phase);
+ gpu_draw(visual_peak, aspect_ratio, graphics_frame_time, absolute_beat_time,
+ beat_phase);
// Update audio systems (tracker, synth, etc.) based on audio time
// progression