feat: add logging system, orchestrator, and documentation

This commit is contained in:
Loic Coenen
2026-05-19 08:26:36 +00:00
parent f776b8a361
commit e79c2ac116
27 changed files with 612 additions and 13 deletions

View File

@@ -85,7 +85,7 @@ static int global_sample_rate = 0;
/* execute a single command (called from looper_process_commands) */
static void exec_command(command_t cmd, jack_client_t *client) {
int ch = cmd.channel;
if (ch < 0)
if (ch < 0 || ch >= MAX_CHANNELS)
ch = 0;
switch (cmd.type) {
@@ -569,8 +569,10 @@ void looper_process_commands(jack_client_t *client) {
wav_write("save.wav", data, (unsigned)lc, sr);
free(data);
}
/* Reactivate channel */
/* Reactivate channel use a shorter sleep to reduce xrun risk */
if (was_active) {
struct timespec req = {.tv_sec = 0, .tv_nsec = 200000000}; /* 200 ms */
nanosleep(&req, NULL);
atomic_store(&channels[0].active, 1);
}
}