refactor: replace atomic_double with fixed-point BPM and remove circular dependency

Co-authored-by: aider (deepseek/deepseek-coder) <aider@aider.chat>
This commit is contained in:
Loic Coenen
2026-05-01 21:27:38 +00:00
parent 6d52e076dc
commit d9de05b1da
4 changed files with 30 additions and 36 deletions

View File

@@ -45,7 +45,8 @@ typedef struct {
atomic_uint bar_position_atomic;
atomic_uint sample_position_atomic;
atomic_int clock_source_atomic; // ClockSource
atomic_double bpm_atomic;
double bpm_atomic; // Direct read for audio thread
atomic_uint bpm_atomic_raw; // Fixed-point (BPM * 100) for frontend reads
// JACK ports for MIDI clock output (when master)
jack_port_t *midi_clock_out_port;
@@ -80,10 +81,6 @@ int transport_process(Transport *transport, jack_nframes_t nframes,
// Reset position
void transport_reset(Transport *transport);
// Get next quantization boundary (in frames from current position)
jack_nframes_t transport_get_next_quantize_frame(Transport *transport,
jack_nframes_t current_frame,
QuantizeMode mode);
// Utility
const char* transport_state_to_string(TransportState state);