aboutsummaryrefslogtreecommitdiffstats
path: root/src/quantiser.c
diff options
context:
space:
mode:
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;
+ }
+}