feat: implement grid-of-grids with 8 separate 8x8 clip grids and zoom mode
Co-authored-by: aider (deepseek/deepseek-coder) <aider@aider.chat>
This commit is contained in:
13
dispatcher.c
13
dispatcher.c
@@ -168,12 +168,12 @@ static AppState clip_trigger(AppState state, int clip_index) {
|
||||
}
|
||||
|
||||
static AppState scene_trigger(AppState state, int scene_index) {
|
||||
if (scene_index < 0 || scene_index >= MAX_SCENES) return state;
|
||||
if (scene_index < 0 || scene_index >= MAX_SCENES * 8) return state; // 8 grids
|
||||
|
||||
// Save undo info for all clips in the scene as a batch
|
||||
int batch_start = state.undo.undo_index;
|
||||
for (int ch = 0; ch < MAX_CHANNELS; ch++) {
|
||||
int clip_idx = CLIP_INDEX(scene_index, ch);
|
||||
int clip_idx = scene_index * MAX_CHANNELS + ch;
|
||||
save_undo_state(&state, clip_idx);
|
||||
}
|
||||
// Mark all entries in this batch with the batch size
|
||||
@@ -185,7 +185,7 @@ static AppState scene_trigger(AppState state, int scene_index) {
|
||||
|
||||
// Now apply the changes
|
||||
for (int ch = 0; ch < MAX_CHANNELS; ch++) {
|
||||
int clip_idx = CLIP_INDEX(scene_index, ch);
|
||||
int clip_idx = scene_index * MAX_CHANNELS + ch;
|
||||
state = clip_trigger(state, clip_idx);
|
||||
}
|
||||
|
||||
@@ -395,6 +395,7 @@ AppState reducer(AppState state, Action action) {
|
||||
|
||||
case ACTION_MIDI_NOTE_ON: {
|
||||
int clip_index = action.data.midi_note_on.note % MAX_CLIPS;
|
||||
save_undo_state(&state, clip_index);
|
||||
return clip_trigger(state, clip_index);
|
||||
}
|
||||
|
||||
@@ -466,7 +467,11 @@ AppState reducer(AppState state, Action action) {
|
||||
clip->buffer_size = 0;
|
||||
clip->write_position = 0;
|
||||
clip->read_position = 0;
|
||||
if (clip->buffer) memset(clip->buffer, 0, MAX_BUFFER_SIZE * sizeof(float));
|
||||
if (clip->buffer) {
|
||||
memset(clip->buffer, 0, MAX_BUFFER_SIZE * sizeof(float));
|
||||
} else {
|
||||
clip->buffer = (float *)calloc(MAX_BUFFER_SIZE, sizeof(float));
|
||||
}
|
||||
}
|
||||
|
||||
// Reset Carla host
|
||||
|
||||
Reference in New Issue
Block a user