diff --git a/templates/android/src/jni.cpp b/templates/android/src/jni.cpp index dce5b70..f935597 100644 --- a/templates/android/src/jni.cpp +++ b/templates/android/src/jni.cpp @@ -21,6 +21,13 @@ #include #include +typedef struct { + void * handle; + const char * format; + const char * (*get_bindir)(void *handle); + const char * (*get_datadir)(void *handle); +} plugin_callbacks; + #include "data.h" #include "plugin.h" @@ -225,7 +232,13 @@ JNI_FUNC(nativeAudioStart)(JNIEnv* env, jobject thiz) { if (ma_device_init(NULL, &deviceConfig, &device) != MA_SUCCESS) return false; - plugin_init(&instance); + plugin_callbacks cbs = { + /* .handle = */ NULL, + /* .format = */ "android", + /* .get_bindir = */ NULL, + /* .get_datadir = */ NULL + }; + plugin_init(&instance, &cbs); #if PARAMETERS_N > 0 for (size_t i = 0; i < PARAMETERS_N; i++) { diff --git a/templates/cmd/src/main.c b/templates/cmd/src/main.c index f814e0b..97a9ed1 100644 --- a/templates/cmd/src/main.c +++ b/templates/cmd/src/main.c @@ -21,6 +21,13 @@ #include #include +typedef struct { + void * handle; + const char * format; + const char * (*get_bindir)(void *handle); + const char * (*get_datadir)(void *handle); +} plugin_callbacks; + #include "data.h" #include "plugin.h" @@ -352,7 +359,13 @@ int main(int argc, char * argv[]) { printf(" %s: %g\n", param_data[i].id, param_values[i]); #endif - plugin_init(&instance); + plugin_callbacks cbs = { + /* .handle = */ NULL, + /* .format = */ "cmd", + /* .get_bindir = */ NULL, + /* .get_datadir = */ NULL + }; + plugin_init(&instance, &cbs); #if PARAMETERS_N > 0 for (size_t i = 0; i < PARAMETERS_N; i++) diff --git a/templates/daisy-seed/src/main.cpp b/templates/daisy-seed/src/main.cpp index 5f792da..7e218a7 100644 --- a/templates/daisy-seed/src/main.cpp +++ b/templates/daisy-seed/src/main.cpp @@ -21,6 +21,13 @@ #include #include +typedef struct { + void * handle; + const char * format; + const char * (*get_bindir)(void *handle); + const char * (*get_datadir)(void *handle); +} plugin_callbacks; + #include "data.h" #include "plugin.h" @@ -168,7 +175,13 @@ int main() { hardware.SetAudioBlockSize(BLOCK_SIZE); float sample_rate = hardware.AudioSampleRate(); - plugin_init(&instance); + plugin_callbacks cbs = { + /* .handle = */ NULL, + /* .format = */ "daisy-seed", + /* .get_bindir = */ NULL, + /* .get_datadir = */ NULL + }; + plugin_init(&instance, &cbs); plugin_set_sample_rate(&instance, sample_rate); if (plugin_mem_req(&instance) != 0) diff --git a/templates/ios/src/native.mm b/templates/ios/src/native.mm index 779b058..509328f 100644 --- a/templates/ios/src/native.mm +++ b/templates/ios/src/native.mm @@ -21,6 +21,13 @@ #include #include +typedef struct { + void * handle; + const char * format; + const char * (*get_bindir)(void *handle); + const char * (*get_datadir)(void *handle); +} plugin_callbacks; + #include "data.h" #include "plugin.h" #if PARAMETERS_N > 0 @@ -251,9 +258,15 @@ char audioStart() { } } #endif - - plugin_init(&instance); - + + plugin_callbacks cbs = { + /* .handle = */ NULL, + /* .format = */ "ios", + /* .get_bindir = */ NULL, + /* .get_datadir = */ NULL + }; + plugin_init(&instance, &cbs); + #if PARAMETERS_N > 0 for (size_t i = 0; i < PARAMETERS_N; i++) { if (!param_data[i].out) @@ -356,7 +369,7 @@ void audioPause() { extern "C" void audioResume() { - // TODO: couldn't this could fail?... + // TODO: could this fail?... if (device_inited) { ma_device_init(NULL, &deviceConfig, &device); ma_device_start(&device); diff --git a/templates/vst3-make/Makefile b/templates/vst3-make/Makefile index 0dfbcc9..535a247 100644 --- a/templates/vst3-make/Makefile +++ b/templates/vst3-make/Makefile @@ -70,6 +70,7 @@ endif ifeq ($(UNAME_S), Linux) CFLAGS_ALL := $(CFLAGS_ALL) -D_GNU_SOURCE +LDFLAGS_ALL := $(LDFLAGS_ALL) -ldl ifeq ($(HAS_UI), yes) CFLAGS_ALL := $(CFLAGS_ALL) $(shell pkg-config --cflags x11) LDFLAGS_ALL := $(LDFLAGS_ALL) $(shell pkg-config --libs x11) diff --git a/templates/web/src/processor.c b/templates/web/src/processor.c index c1be991..e658695 100644 --- a/templates/web/src/processor.c +++ b/templates/web/src/processor.c @@ -21,6 +21,13 @@ #include #include +typedef struct { + void * handle; + const char * format; + const char * (*get_bindir)(void *handle); + const char * (*get_datadir)(void *handle); +} plugin_callbacks; + #include "data.h" #include "plugin.h" @@ -49,7 +56,13 @@ instance * processor_new(float sample_rate) { if (i == NULL) return NULL; - plugin_init(&i->p); + plugin_callbacks cbs = { + /* .handle = */ NULL, + /* .format = */ "web", + /* .get_bindir = */ NULL, + /* .get_datadir = */ NULL + }; + plugin_init(&i->p, &cbs); #if DATA_PRODUCT_PARAMETERS_N > 0 for (size_t j = 0; j < DATA_PRODUCT_PARAMETERS_N; j++)