aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/LV2/src/Acceleration
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/LV2/src/Acceleration')
-rw-r--r--plugins/LV2/src/Acceleration/Acceleration.cpp65
-rw-r--r--plugins/LV2/src/Acceleration/Acceleration.ttl49
-rw-r--r--plugins/LV2/src/Acceleration/manifest.ttl.in9
3 files changed, 123 insertions, 0 deletions
diff --git a/plugins/LV2/src/Acceleration/Acceleration.cpp b/plugins/LV2/src/Acceleration/Acceleration.cpp
new file mode 100644
index 0000000..cc0a6cd
--- /dev/null
+++ b/plugins/LV2/src/Acceleration/Acceleration.cpp
@@ -0,0 +1,65 @@
+#include "lv2/core/lv2.h"
+
+#include <iostream>
+
+const char * ACCELERATION_URI = "https://www.airwindows.com/acceleration";
+
+enum PortIndex {
+ ACCELERATION_LIMIT = 0,
+ ACCELERATION_DRYWET = 1,
+ ACCELERATION_IN = 2,
+ ACCELERATION_OUT = 3
+};
+
+struct acceleration {
+ const float * limit;
+ const float * drywet;
+ const float * in;
+ float * out;
+};
+
+static LV2_Handle instantiate(
+ const LV2_Descriptor * d,
+ double rate,
+ const char * path,
+ const LV2_Feature * const * features)
+{
+ return calloc(1, sizeof(acceleration));
+}
+
+static void connect_port(
+ LV2_Handle instance,
+ uint32_t port,
+ void * data)
+{
+ struct acceleration * accel = (struct acceleration *) instance;
+ switch (port) {
+ case ACCELERATION_LIMIT:
+ accel->limit = (const float *) data;
+ break;
+
+ case ACCELERATION_DRYWET:
+ accel->limit = (const float *) data;
+ break;
+
+ case ACCELERATION_IN:
+ accel->in = (const float *) data;
+ break;
+
+ case ACCELERATION_OUT:
+ accel->out = (float *) data;
+ break;
+
+ default:
+ std::cerr << "Invalid port " << port << ": ignoring." << std::endl;
+ }
+}
+
+static void activate(LV2_Handle instance)
+{
+}
+
+static void run(LV2_Handle instance, uint32_t num_samples)
+{
+ auto accel = (acceleration *) instance;
+}
diff --git a/plugins/LV2/src/Acceleration/Acceleration.ttl b/plugins/LV2/src/Acceleration/Acceleration.ttl
new file mode 100644
index 0000000..fec2952
--- /dev/null
+++ b/plugins/LV2/src/Acceleration/Acceleration.ttl
@@ -0,0 +1,49 @@
+# Airwindows Acceleration Limiter plugin description
+
+@prefix doap: <http://usefulinc.com/ns/doap#> .
+@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix units: <http://lv2plug.in/ns/extensions/units#> .
+
+<https://www.airwindows.com/acceleration>
+ a lv2:Plugin ,
+ lv2:LimiterPlugin ;
+ lv2:project <https://www.airwindows.com> ;
+ doap:name "Airwindows Acceleration Limiter" ;
+ doap:license <http://opensource.org/licenses/mit> ;
+
+ # Unsure what this does, and if the plugin conforms to it.
+ # Taken from the LV2 sample amp plugin, figure out later.
+ lv2optionalFeature lv2:hardRTCapable ;
+
+ # Define the ports for this plugin.
+ # Two control ports - limit and dry/wet
+ # One audio in and one audio out
+ lv2:port [
+ a lv2:InputPort , lv2:ControlPort ;
+ lv2:index 0 ;
+ lv2:symbol "A" ;
+ lv2:name "Limit" ;
+ lv2:default 0.32 ;
+ lv2:minimum 0.0 ;
+ lv2:maximum 1.0 ;
+ ] , [
+ a lv2:InputPort , lv2:ControlPort ;
+ lv2:index 1 ;
+ lv2:symbol "B" ;
+ lv2:name "Dry/Wet" ;
+ lv2:default 1.0 ;
+ lv2:minimum 0.0 ;
+ lc2:maximum 1.0 ;
+ ] , [
+ a lv2:InputPort , lv2:AudioPort ;
+ lv2:index 2 ;
+ lv2:symbol "in" ;
+ lv2:name "In" ;
+ ] , [
+ a lv2:OutputPort , lv2:AudioPort ;
+ lv2:index 3 ;
+ lv2:symbol "out" ;
+ lv2:name "Out" ;
+ ] .
diff --git a/plugins/LV2/src/Acceleration/manifest.ttl.in b/plugins/LV2/src/Acceleration/manifest.ttl.in
new file mode 100644
index 0000000..f4fcbc7
--- /dev/null
+++ b/plugins/LV2/src/Acceleration/manifest.ttl.in
@@ -0,0 +1,9 @@
+# LV2 Plugin manifest for airwindows Acceleration limiter plugin
+
+@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+
+<https://www.airwindows.com/acceleration>
+ a lv2:Plugin ;
+ lv2:binary <acceleration@LIB_EXT@> ;
+ rdfs:seeAlso <acceleration.ttl> .