fix: correct state access in MIDI clock handling
Co-authored-by: aider (deepseek/deepseek-reasoner) <aider@aider.chat>
This commit is contained in:
13
src/looper.c
13
src/looper.c
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user