From 7b20413c84b14d2c2bc1037bb08134dcdf152ddb Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 31 May 2012 06:23:57 +0000 Subject: Umm... commit pretty much all the work of the past few days. Again. git-svn-id: http://svn.drobilla.net/lad/trunk/plugins/blop.lv2@4488 a436a847-0d15-0410-975c-d299462d15a1 --- src/quantiser.c | 66 +++++++++++++++++++++------------------------------------ 1 file changed, 24 insertions(+), 42 deletions(-) (limited to 'src/quantiser.c') diff --git a/src/quantiser.c b/src/quantiser.c index 793da32..419467f 100644 --- a/src/quantiser.c +++ b/src/quantiser.c @@ -205,54 +205,16 @@ instantiate(const LV2_Descriptor* descriptor, } static void -runQuantiser_audio(LV2_Handle instance, - uint32_t sample_count) +run(LV2_Handle instance, + uint32_t sample_count) { Quantiser* plugin = (Quantiser*)instance; /* Range Min (float value) */ - const float min = *(plugin->min); + float min = *(plugin->min); /* Range Max (float value) */ - const float max = *(plugin->max); - - /* Match Range (float value) */ - const float match_range = *(plugin->match_range); - - /* Mode (float value) */ - const float mode = *(plugin->mode); - - /* Count (float value) */ - const float count = *(plugin->count); - - /* Input (array of float of length sample_count) */ - const float* input = plugin->input; - - /* Values */ - float* values[QUANTISER_MAX_INPUTS]; - - /* Output (array of float of length sample_count) */ - float* output = plugin->output; - - /* Output Changed (array of float of length sample_count) */ - float* output_changed = plugin->output_changed; - - for (uint32_t s = 0; s < sample_count; s++) { - output[s] = input[s]; - } -} - -static void -runQuantiser_control(LV2_Handle instance, - uint32_t sample_count) -{ - Quantiser* plugin = (Quantiser*)instance; - - /* Range Min (float value) */ - const float min = *(plugin->min); - - /* Range Max (float value) */ - const float max = *(plugin->max); + float max = *(plugin->max); /* Match Range (float value) */ const float match_range = FABSF(*(plugin->match_range)); @@ -469,3 +431,23 @@ runQuantiser_control(LV2_Handle instance, } plugin->last_found = last_found; } + +static const LV2_Descriptor descriptor = { + QUANTISER_URI, + instantiate, + connect_port, + NULL, + run, + NULL, + cleanup, + NULL +}; + +LV2_SYMBOL_EXPORT const LV2_Descriptor* +lv2_descriptor(uint32_t index) +{ + switch (index) { + case 0: return &descriptor; + default: return NULL; + } +} -- cgit v1.2.1