feat: add direct JACK port connection and VU meter support
This commit is contained in:
committed by
Loic Coenen (aider)
parent
1e62ec9310
commit
316320c294
@@ -1,11 +1,13 @@
|
||||
#include "client_cmd.h"
|
||||
#include "plugins.h"
|
||||
#include "carla_host.h"
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
static char from_port[256] = "";
|
||||
static char to_port[256] = "";
|
||||
char g_connect_error[512] = "";
|
||||
|
||||
const char* get_stored_from(void) { return from_port; }
|
||||
const char* get_stored_to(void) { return to_port; }
|
||||
@@ -34,18 +36,32 @@ int handle_client_command(const char *input, int *out_id) {
|
||||
if (strcmp(token, "from") == 0) {
|
||||
const char *port = strtok(NULL, " ");
|
||||
if (!port) return -1;
|
||||
strncpy(from_port, port, sizeof(from_port)-1);
|
||||
from_port[sizeof(from_port)-1] = '\0';
|
||||
return 0;
|
||||
int ret = carla_connect_direct(port, "looper:input");
|
||||
if (ret == 0) {
|
||||
strncpy(from_port, port, sizeof(from_port)-1);
|
||||
from_port[sizeof(from_port)-1] = '\0';
|
||||
g_connect_error[0] = '\0';
|
||||
} else {
|
||||
snprintf(g_connect_error, sizeof(g_connect_error),
|
||||
"Failed: %s -> looper:input (ret=%d)", port, ret);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
// --- to <port> ---
|
||||
if (strcmp(token, "to") == 0) {
|
||||
const char *port = strtok(NULL, " ");
|
||||
if (!port) return -1;
|
||||
strncpy(to_port, port, sizeof(to_port)-1);
|
||||
to_port[sizeof(to_port)-1] = '\0';
|
||||
return 0;
|
||||
int ret = carla_connect_direct("looper:output", port);
|
||||
if (ret == 0) {
|
||||
strncpy(to_port, port, sizeof(to_port)-1);
|
||||
to_port[sizeof(to_port)-1] = '\0';
|
||||
g_connect_error[0] = '\0';
|
||||
} else {
|
||||
snprintf(g_connect_error, sizeof(g_connect_error),
|
||||
"Failed: looper:output -> %s (ret=%d)", port, ret);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
// --- addplugin <path> ---
|
||||
|
||||
Reference in New Issue
Block a user