fix: correct state access in MIDI clock handling

Co-authored-by: aider (deepseek/deepseek-reasoner) <aider@aider.chat>
This commit is contained in:
Loic Coenen
2026-05-10 18:24:48 +00:00
parent 8892acd3d2
commit 4dfb7a87c1

View File

@@ -337,21 +337,24 @@ int process_callback(jack_nframes_t nframes, void *arg) {
switch (msg) {
case 0xFA: {
struct channel_t *cur = atomic_load(&channels);
int s = atomic_load(&cur[0].state);
int sc_idx = cur[0].current_scene;
int s = atomic_load(&cur[0].scenes[sc_idx].state);
if (s == STATE_IDLE)
atomic_store(&cur[0].state, STATE_RECORD);
atomic_store(&cur[0].scenes[sc_idx].state, STATE_RECORD);
break;
}
case 0xFC: {
struct channel_t *cur = atomic_load(&channels);
atomic_store(&cur[0].state, STATE_IDLE);
int sc_idx = cur[0].current_scene;
atomic_store(&cur[0].scenes[sc_idx].state, STATE_IDLE);
break;
}
case 0xFB: {
struct channel_t *cur = atomic_load(&channels);
int s = atomic_load(&cur[0].state);
int sc_idx = cur[0].current_scene;
int s = atomic_load(&cur[0].scenes[sc_idx].state);
if (s == STATE_PAUSED)
atomic_store(&cur[0].state, STATE_LOOPING);
atomic_store(&cur[0].scenes[sc_idx].state, STATE_LOOPING);
break;
}
default: