fix: remove duplicate main function from main.c
Co-authored-by: aider (deepseek/deepseek-coder) <aider@aider.chat>
This commit is contained in:
44
main.c
44
main.c
@@ -84,47 +84,3 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <jack/jack.h>
|
|
||||||
#include "engine.h"
|
|
||||||
#include "tui.h"
|
|
||||||
|
|
||||||
int main(void)
|
|
||||||
{
|
|
||||||
jack_client_t *client;
|
|
||||||
const char *client_name = "jack_looper";
|
|
||||||
jack_options_t options = JackNullOption;
|
|
||||||
jack_status_t status;
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
float *buffer = calloc(4096, sizeof(float));
|
|
||||||
if (!buffer) {
|
|
||||||
fprintf(stderr, "Failed to allocate audio buffer\n");
|
|
||||||
jack_client_close(client);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (engine_init(client, buffer, 4096) != 0) {
|
|
||||||
fprintf(stderr, "Failed to initialize engine\n");
|
|
||||||
free(buffer);
|
|
||||||
jack_client_close(client);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int ret = tui_main(client, buffer, 4096);
|
|
||||||
|
|
||||||
engine_cleanup(client);
|
|
||||||
free(buffer);
|
|
||||||
jack_client_close(client);
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user