diff options
Diffstat (limited to 'lvz/wrapper.cpp')
-rw-r--r-- | lvz/wrapper.cpp | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/lvz/wrapper.cpp b/lvz/wrapper.cpp index 7fafffd..0ac2edd 100644 --- a/lvz/wrapper.cpp +++ b/lvz/wrapper.cpp @@ -46,14 +46,12 @@ typedef struct { float** outputs; } LVZPlugin; - static void lvz_cleanup(LV2_Handle instance) { free(instance); } - static void lvz_connect_port(LV2_Handle instance, uint32_t port, void* data) { @@ -73,14 +71,12 @@ lvz_connect_port(LV2_Handle instance, uint32_t port, void* data) } } - static int master_callback(int, int ver, int, int, int, int) { return 0; } - static LV2_Handle lvz_instantiate(const LV2_Descriptor* descriptor, double rate, @@ -91,37 +87,39 @@ lvz_instantiate(const LV2_Descriptor* descriptor, effect->setURI(URI_PREFIX PLUGIN_URI_SUFFIX); effect->setSampleRate(rate); - uint32_t num_params = effect->getNumParameters(); - uint32_t num_inputs = effect->getNumInputs(); + uint32_t num_params = effect->getNumParameters(); + uint32_t num_inputs = effect->getNumInputs(); uint32_t num_outputs = effect->getNumOutputs(); LVZPlugin* plugin = (LVZPlugin*)malloc(sizeof(LVZPlugin)); plugin->effect = effect; if (num_params > 0) { - plugin->controls = (float*)malloc(sizeof(float) * num_params); + plugin->controls = (float*)malloc(sizeof(float) * num_params); plugin->control_buffers = (float**)malloc(sizeof(float*) * num_params); for (uint32_t i = 0; i < num_params; ++i) { plugin->controls[i] = effect->getParameter(i); plugin->control_buffers[i] = NULL; } } else { - plugin->controls = NULL; + plugin->controls = NULL; plugin->control_buffers = NULL; } if (num_inputs > 0) { plugin->inputs = (float**)malloc(sizeof(float*) * num_inputs); - for (uint32_t i = 0; i < num_inputs; ++i) + for (uint32_t i = 0; i < num_inputs; ++i) { plugin->inputs[i] = NULL; + } } else { plugin->inputs = NULL; } if (num_outputs > 0) { plugin->outputs = (float**)malloc(sizeof(float*) * num_outputs); - for (uint32_t i = 0; i < num_outputs; ++i) + for (uint32_t i = 0; i < num_outputs; ++i) { plugin->outputs[i] = NULL; + } } else { plugin->outputs = NULL; } @@ -129,7 +127,6 @@ lvz_instantiate(const LV2_Descriptor* descriptor, return (LV2_Handle)plugin; } - static void lvz_run(LV2_Handle instance, uint32_t sample_count) { @@ -146,7 +143,6 @@ lvz_run(LV2_Handle instance, uint32_t sample_count) plugin->effect->processReplacing(plugin->inputs, plugin->outputs, sample_count); } - static const AudioEffectX* lvz_get_audioeffectx(LV2_Handle instance) { @@ -154,14 +150,12 @@ lvz_get_audioeffectx(LV2_Handle instance) return plugin->effect; } - static const void* lvz_extension_data(const char* uri) { return NULL; } - static void lvz_deactivate(LV2_Handle instance) { @@ -169,7 +163,6 @@ lvz_deactivate(LV2_Handle instance) plugin->effect->suspend(); } - /* Library */ static LV2_Descriptor descriptor; @@ -199,7 +192,7 @@ lv2_descriptor(uint32_t index) } } - +/** Entry point for LVZ gendata */ LV2_SYMBOL_EXPORT AudioEffectX* lvz_new_audioeffectx() @@ -209,6 +202,4 @@ lvz_new_audioeffectx() return effect; } - } // extern "C" - |