style: reformat code and reorder includes in looper.c and main.c
This commit is contained in:
committed by
Loic Coenen (aider)
parent
e8d679c1af
commit
1db9735e1b
79
src/main.c
79
src/main.c
@@ -1,50 +1,49 @@
|
||||
#include "looper.h"
|
||||
#include <jack/jack.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <jack/jack.h>
|
||||
#include "looper.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
const char *client_name = "looper";
|
||||
jack_options_t options = JackNullOption;
|
||||
jack_status_t status;
|
||||
int main(int argc, char *argv[]) {
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
const char *client_name = "looper";
|
||||
jack_options_t options = JackNullOption;
|
||||
jack_status_t status;
|
||||
|
||||
jack_client_t *client = jack_client_open(client_name, options, &status);
|
||||
if (client == NULL) {
|
||||
fprintf(stderr, "jack_client_open() failed, status = 0x%2.0x\n", status);
|
||||
if (status & JackServerFailed)
|
||||
fprintf(stderr, "Unable to connect to JACK server\n");
|
||||
return 1;
|
||||
}
|
||||
jack_client_t *client = jack_client_open(client_name, options, &status);
|
||||
if (client == NULL) {
|
||||
fprintf(stderr, "jack_client_open() failed, status = 0x%2.0x\n", status);
|
||||
if (status & JackServerFailed)
|
||||
fprintf(stderr, "Unable to connect to JACK server\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (status & JackNameNotUnique)
|
||||
client_name = jack_get_client_name(client);
|
||||
if (status & JackNameNotUnique)
|
||||
client_name = jack_get_client_name(client);
|
||||
|
||||
jack_set_process_callback(client, process_callback, NULL);
|
||||
jack_on_shutdown(client, jack_shutdown_cb, NULL);
|
||||
|
||||
if (looper_init(client) != 0) {
|
||||
fprintf(stderr, "looper initialisation failed\n");
|
||||
jack_client_close(client);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (jack_activate(client)) {
|
||||
fprintf(stderr, "Cannot activate client\n");
|
||||
jack_client_close(client);
|
||||
return 1;
|
||||
}
|
||||
|
||||
fprintf(stderr, "looper running (client name '%s')\n", client_name);
|
||||
|
||||
while (1) {
|
||||
looper_process_commands(client);
|
||||
usleep(50000); /* check commands every 50 ms */
|
||||
}
|
||||
jack_set_process_callback(client, process_callback, NULL);
|
||||
jack_on_shutdown(client, jack_shutdown_cb, NULL);
|
||||
|
||||
if (looper_init(client) != 0) {
|
||||
fprintf(stderr, "looper initialisation failed\n");
|
||||
jack_client_close(client);
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (jack_activate(client)) {
|
||||
fprintf(stderr, "Cannot activate client\n");
|
||||
jack_client_close(client);
|
||||
return 1;
|
||||
}
|
||||
|
||||
fprintf(stderr, "looper running (client name '%s')\n", client_name);
|
||||
|
||||
while (1) {
|
||||
looper_process_commands(client);
|
||||
usleep(50000); /* check commands every 50 ms */
|
||||
}
|
||||
|
||||
jack_client_close(client);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user