diff --git a/.gitignore b/.gitignore index 0dee4a9..3bed2de 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ build/ .vscode/ -*.flac \ No newline at end of file +*.flac +*.html \ No newline at end of file diff --git a/src/easy.c b/src/easy.c index c536440..042d788 100644 --- a/src/easy.c +++ b/src/easy.c @@ -26,6 +26,13 @@ const LilvPlugin* easy_load_plugin(LilvWorld* world, const char* uri) { lilv_node_free(defNode); printf("Port %d: %s = %f\n", i, name, defaultValue); + + LilvNodes *classes = lilv_port_get_classes(plugin, port); + LILV_FOREACH(nodes, i, classes) { + LilvNode *n = lilv_nodes_get(classes, i); + printf(" %s\n", lilv_node_as_uri(n)); + } + } } diff --git a/src/main.c b/src/main.c index 07e9164..6d0d9d8 100644 --- a/src/main.c +++ b/src/main.c @@ -3,11 +3,12 @@ #include #include #include +#include #include "easy.h" #include "audiofile.h" -#define BUFFER_SIZE 256 // this is per channel +#define BUFFER_SIZE 8192 // this is per channel /* http://lsp-plug.in/plugins/lv2/comp_delay_x2_stereo @@ -25,7 +26,7 @@ int main(int argc, char *argv[]) { char *output_filename; if (argc < 3) { - output_filename = malloc((strlen(input_filename) + 4) * sizeof(char)); + output_filename = malloc((strlen(input_filename) + 5) * sizeof(char)); strcpy(output_filename, "out-"); strcat(output_filename, input_filename); } else { @@ -50,7 +51,19 @@ int main(int argc, char *argv[]) { audiofile_copy_metadata(in_sndfile, out_sndfile); - // load lilv plugin + // prepare lilv instance + + float input_left[BUFFER_SIZE]; + float input_right[BUFFER_SIZE]; + float output_left[BUFFER_SIZE]; + float output_right[BUFFER_SIZE]; + + const int instancesCount = 10; + LilvInstance **instances = malloc(instancesCount * sizeof(LilvInstance*)); + if (instances == NULL) { + fprintf(stderr, "mallocing instances failed: %s\n", strerror(errno)); + return 1; + } const LilvPlugin* plugin = easy_load_plugin(world, "http://lsp-plug.in/plugins/lv2/comp_delay_x2_stereo"); if (plugin == NULL) { @@ -58,34 +71,38 @@ int main(int argc, char *argv[]) { return 1; } - // prepare lilv instance + float *knob_enabled = malloc(instancesCount * sizeof(float)); + for (int i=0; i