fix: reorder passthrough setup before load command in WAV load test
Co-authored-by: aider (deepseek/deepseek-reasoner) <aider@aider.chat>
This commit is contained in:
@@ -909,20 +909,7 @@ static int test_wav_load(void) {
|
||||
unlink("loop.wav");
|
||||
return 1;
|
||||
}
|
||||
/* send control key + note 70 to trigger load */
|
||||
if (send_jack_note_on("looper:control", 64, 127) != 0) {
|
||||
jack_client_close(client);
|
||||
kill(pid, SIGTERM); waitpid(pid, NULL, 0);
|
||||
unlink("loop.wav"); return 1;
|
||||
}
|
||||
safe_usleep(200000);
|
||||
if (send_jack_note_on("looper:control", 70, 127) != 0) {
|
||||
jack_client_close(client);
|
||||
kill(pid, SIGTERM); waitpid(pid, NULL, 0);
|
||||
unlink("loop.wav"); return 1;
|
||||
}
|
||||
safe_usleep(1000000); /* give time for load to complete */
|
||||
/* listen for the loop */
|
||||
/* set up passthrough callback before sending load command */
|
||||
int sr = jack_get_sample_rate(client);
|
||||
continuous_sine = 0;
|
||||
beep_remaining = 0;
|
||||
@@ -944,7 +931,24 @@ static int test_wav_load(void) {
|
||||
unlink("loop.wav");
|
||||
return 1;
|
||||
}
|
||||
safe_usleep(6000000); /* 6 seconds to ensure loop is heard */
|
||||
/* send control key + note 70 to trigger load */
|
||||
if (send_jack_note_on("looper:control", 64, 127) != 0) {
|
||||
jack_deactivate(client);
|
||||
jack_client_close(client);
|
||||
kill(pid, SIGTERM); waitpid(pid, NULL, 0);
|
||||
unlink("loop.wav"); return 1;
|
||||
}
|
||||
safe_usleep(200000);
|
||||
if (send_jack_note_on("looper:control", 70, 127) != 0) {
|
||||
jack_deactivate(client);
|
||||
jack_client_close(client);
|
||||
kill(pid, SIGTERM); waitpid(pid, NULL, 0);
|
||||
unlink("loop.wav"); return 1;
|
||||
}
|
||||
/* wait for the loop to be fully loaded and playing */
|
||||
safe_usleep(2000000);
|
||||
/* continue listening for the rest of the time */
|
||||
safe_usleep(4000000); /* total 6 seconds after activation */
|
||||
jack_deactivate(client);
|
||||
jack_client_close(client);
|
||||
kill(pid, SIGTERM); waitpid(pid, NULL, 0);
|
||||
|
||||
Reference in New Issue
Block a user