4-implement-scene-switching-engine #4
13
src/looper.c
13
src/looper.c
@@ -337,21 +337,24 @@ int process_callback(jack_nframes_t nframes, void *arg) {
|
|||||||
switch (msg) {
|
switch (msg) {
|
||||||
case 0xFA: {
|
case 0xFA: {
|
||||||
struct channel_t *cur = atomic_load(&channels);
|
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)
|
if (s == STATE_IDLE)
|
||||||
atomic_store(&cur[0].state, STATE_RECORD);
|
atomic_store(&cur[0].scenes[sc_idx].state, STATE_RECORD);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 0xFC: {
|
case 0xFC: {
|
||||||
struct channel_t *cur = atomic_load(&channels);
|
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;
|
break;
|
||||||
}
|
}
|
||||||
case 0xFB: {
|
case 0xFB: {
|
||||||
struct channel_t *cur = atomic_load(&channels);
|
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)
|
if (s == STATE_PAUSED)
|
||||||
atomic_store(&cur[0].state, STATE_LOOPING);
|
atomic_store(&cur[0].scenes[sc_idx].state, STATE_LOOPING);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
|||||||
Reference in New Issue
Block a user