aboutsummaryrefslogtreecommitdiffstats
path: root/src/quantiser.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-05-31 06:23:57 +0000
committerDavid Robillard <d@drobilla.net>2012-05-31 06:23:57 +0000
commit7b20413c84b14d2c2bc1037bb08134dcdf152ddb (patch)
treec7c339d6c4d0d26b01e654163e7a8a203f62baf4 /src/quantiser.c
parent46caaf6b96f185a4a25d1d12fc85720a03220e97 (diff)
downloadblop.lv2-7b20413c84b14d2c2bc1037bb08134dcdf152ddb.tar.gz
blop.lv2-7b20413c84b14d2c2bc1037bb08134dcdf152ddb.tar.bz2
blop.lv2-7b20413c84b14d2c2bc1037bb08134dcdf152ddb.zip
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
Diffstat (limited to 'src/quantiser.c')
-rw-r--r--src/quantiser.c66
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;
+ }
+}