fix: add missing stdarg.h include and jack_midi_send availability check

Co-authored-by: aider (deepseek/deepseek-reasoner) <aider@aider.chat>
This commit is contained in:
Loic Coenen
2026-05-07 20:35:52 +00:00
parent 484e0cad36
commit 2d4f4ec18e

View File

@@ -4,6 +4,7 @@
#include <signal.h>
#include <sys/wait.h>
#include <string.h>
#include <stdarg.h>
/*
* Integration test for the JACK looper.
@@ -52,6 +53,14 @@ int main(void) {
printf("Waiting for looper (pid %d) to register ports...\n", (int)pid);
sleep(3); /* generous, JACK ports must be visible */
/* check jack_midi_send availability */
if (system("which jack_midi_send >/dev/null 2>&1") != 0) {
fprintf(stderr, "FATAL: jack_midi_send not available (install jacktools)\n");
kill(pid, SIGTERM);
waitpid(pid, NULL, 0);
return 1;
}
/* 3. send noteon messages (toggle state machine) */
printf("Sending first noteon → IDLE → RECORD\n");
run_cmd("jack_midi_send -c looper:control -m '90 01 7f' 2>/dev/null || echo 'jack_midi_send not available'");