diff options
author | David Robillard <d@drobilla.net> | 2012-05-31 06:03:45 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-05-31 06:03:45 +0000 |
commit | 8b46fd1ff51b29cded517c9c2d166611e8c453fc (patch) | |
tree | 14a338294d302e663818570796bb5311297a9748 /src/quantiser.c | |
parent | 9529f203c09d6dc8f4c2f12c3add9ec906f4bdba (diff) | |
download | blop.lv2-8b46fd1ff51b29cded517c9c2d166611e8c453fc.tar.gz blop.lv2-8b46fd1ff51b29cded517c9c2d166611e8c453fc.tar.bz2 blop.lv2-8b46fd1ff51b29cded517c9c2d166611e8c453fc.zip |
Blip => Blop. I give up trying to give ports new names.
git-svn-id: http://svn.drobilla.net/lad/trunk/plugins/blop.lv2@4484 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/quantiser.c')
-rw-r--r-- | src/quantiser.c | 66 |
1 files changed, 24 insertions, 42 deletions
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; + } +} |