fix: allocate MIDI events and update engine to use new dispatcher API
Co-authored-by: aider (deepseek/deepseek-coder) <aider@aider.chat>
This commit is contained in:
12
main.c
12
main.c
@@ -104,6 +104,18 @@ int main(int argc, char *argv[]) {
|
||||
initial_state->midi_clips[i].state = CLIP_EMPTY;
|
||||
initial_state->midi_clips[i].event_count = 0;
|
||||
initial_state->midi_clips[i].read_index = 0;
|
||||
initial_state->midi_clips[i].events = (MidiEvent *)calloc(MAX_MIDI_EVENTS, sizeof(MidiEvent));
|
||||
if (!initial_state->midi_clips[i].events) {
|
||||
fprintf(stderr, "Failed to allocate MIDI events for clip %d\n", i);
|
||||
// Cleanup previously allocated buffers and events
|
||||
for (int j = 0; j < i; j++) {
|
||||
free(initial_state->clips[j].buffer);
|
||||
free(initial_state->midi_clips[j].events);
|
||||
}
|
||||
free(initial_state);
|
||||
return 1;
|
||||
}
|
||||
initial_state->midi_clips[i].max_events = MAX_MIDI_EVENTS;
|
||||
}
|
||||
|
||||
// Initialize channel names
|
||||
|
||||
Reference in New Issue
Block a user