aboutsummaryrefslogtreecommitdiff
path: root/bundle
diff options
context:
space:
mode:
authorGravatar Hanspeter Portner <dev@open-music-kontrollers.ch>2015-06-29 20:44:24 +0200
committerGravatar Hanspeter Portner <dev@open-music-kontrollers.ch>2015-06-29 20:44:24 +0200
commita04e30593bc0a3f8ce2c1bd0a19781bedcb84a68 (patch)
tree369f9a8c9fef3e8efbe522a669932d990816d38e /bundle
parenta9179147a66d2913165f81a60b2c93fe946ab02f (diff)
downloadsynthpod-a04e30593bc0a3f8ce2c1bd0a19781bedcb84a68.zip
synthpod-a04e30593bc0a3f8ce2c1bd0a19781bedcb84a68.tar.gz
synthpod-a04e30593bc0a3f8ce2c1bd0a19781bedcb84a68.tar.bz2
synthpod-a04e30593bc0a3f8ce2c1bd0a19781bedcb84a68.tar.xz
support dynamic system ports.
Diffstat (limited to 'bundle')
-rw-r--r--bundle/CMakeLists.txt11
-rw-r--r--bundle/manifest.ttl.in65
-rw-r--r--bundle/synthpod_audio_sink.c127
-rw-r--r--bundle/synthpod_audio_source.c127
-rw-r--r--bundle/synthpod_bundle.c20
-rw-r--r--bundle/synthpod_bundle.h24
-rw-r--r--bundle/synthpod_bundle.ttl277
-rw-r--r--bundle/synthpod_cv_sink.c127
-rw-r--r--bundle/synthpod_cv_source.c127
-rw-r--r--bundle/synthpod_midi_sink.c127
-rw-r--r--bundle/synthpod_midi_source.c127
-rw-r--r--bundle/synthpod_osc_sink.c127
-rw-r--r--bundle/synthpod_osc_source.c127
-rw-r--r--bundle/synthpod_sink.c31
-rw-r--r--bundle/synthpod_source.c31
15 files changed, 1421 insertions, 54 deletions
diff --git a/bundle/CMakeLists.txt b/bundle/CMakeLists.txt
index 00512cd..263a523 100644
--- a/bundle/CMakeLists.txt
+++ b/bundle/CMakeLists.txt
@@ -1,4 +1,5 @@
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
+include_directories(${CMAKE_SOURCE_DIR}/system_port.lv2)
if(WIN32)
set(LIB_EXT ".dll")
@@ -12,7 +13,15 @@ endif()
add_library(synthpod_bundle.lv2 MODULE
synthpod_bundle.c
synthpod_sink.c
- synthpod_source.c)
+ synthpod_source.c
+ synthpod_osc_sink.c
+ synthpod_osc_source.c
+ synthpod_cv_sink.c
+ synthpod_cv_source.c
+ synthpod_audio_sink.c
+ synthpod_audio_source.c
+ synthpod_midi_sink.c
+ synthpod_midi_source.c)
target_link_libraries(synthpod_bundle.lv2 synthpod.lib)
set_target_properties(synthpod_bundle.lv2 PROPERTIES PREFIX "" OUTPUT_NAME "synthpod_bundle")
install(TARGETS synthpod_bundle.lv2 DESTINATION ${SYNTHPOD_BUNDLE_DIR})
diff --git a/bundle/manifest.ttl.in b/bundle/manifest.ttl.in
index bc5dfad..30f0875 100644
--- a/bundle/manifest.ttl.in
+++ b/bundle/manifest.ttl.in
@@ -18,18 +18,77 @@
@prefix synthpod: <http://open-music-kontrollers.ch/lv2/synthpod#> .
-# Synthpod Source
+# Synthpod System Source
synthpod:source
a lv2:Plugin ;
lv2:minorVersion @SYNTHPOD_MINOR_VERSION@ ;
lv2:microVersion @SYNTHPOD_MICRO_VERSION@ ;
lv2:binary <synthpod_bundle@LIB_EXT@> ;
rdfs:seeAlso <synthpod_bundle.ttl> .
-
-# Synthpod Sink
+# Synthpod System Sink
synthpod:sink
a lv2:Plugin ;
lv2:minorVersion @SYNTHPOD_MINOR_VERSION@ ;
lv2:microVersion @SYNTHPOD_MICRO_VERSION@ ;
lv2:binary <synthpod_bundle@LIB_EXT@> ;
rdfs:seeAlso <synthpod_bundle.ttl> .
+
+# Synthpod OSC Source
+synthpod:osc_source
+ a lv2:Plugin ;
+ lv2:minorVersion @SYNTHPOD_MINOR_VERSION@ ;
+ lv2:microVersion @SYNTHPOD_MICRO_VERSION@ ;
+ lv2:binary <synthpod_bundle@LIB_EXT@> ;
+ rdfs:seeAlso <synthpod_bundle.ttl> .
+# Synthpod OSC Sink
+synthpod:osc_sink
+ a lv2:Plugin ;
+ lv2:minorVersion @SYNTHPOD_MINOR_VERSION@ ;
+ lv2:microVersion @SYNTHPOD_MICRO_VERSION@ ;
+ lv2:binary <synthpod_bundle@LIB_EXT@> ;
+ rdfs:seeAlso <synthpod_bundle.ttl> .
+
+# Synthpod MIDI Source
+synthpod:midi_source
+ a lv2:Plugin ;
+ lv2:minorVersion @SYNTHPOD_MINOR_VERSION@ ;
+ lv2:microVersion @SYNTHPOD_MICRO_VERSION@ ;
+ lv2:binary <synthpod_bundle@LIB_EXT@> ;
+ rdfs:seeAlso <synthpod_bundle.ttl> .
+# Synthpod MIDI Sink
+synthpod:midi_sink
+ a lv2:Plugin ;
+ lv2:minorVersion @SYNTHPOD_MINOR_VERSION@ ;
+ lv2:microVersion @SYNTHPOD_MICRO_VERSION@ ;
+ lv2:binary <synthpod_bundle@LIB_EXT@> ;
+ rdfs:seeAlso <synthpod_bundle.ttl> .
+
+# Synthpod Audio Source
+synthpod:audio_source
+ a lv2:Plugin ;
+ lv2:minorVersion @SYNTHPOD_MINOR_VERSION@ ;
+ lv2:microVersion @SYNTHPOD_MICRO_VERSION@ ;
+ lv2:binary <synthpod_bundle@LIB_EXT@> ;
+ rdfs:seeAlso <synthpod_bundle.ttl> .
+# Synthpod Audio Sink
+synthpod:audio_sink
+ a lv2:Plugin ;
+ lv2:minorVersion @SYNTHPOD_MINOR_VERSION@ ;
+ lv2:microVersion @SYNTHPOD_MICRO_VERSION@ ;
+ lv2:binary <synthpod_bundle@LIB_EXT@> ;
+ rdfs:seeAlso <synthpod_bundle.ttl> .
+
+# Synthpod CV Source
+synthpod:cv_source
+ a lv2:Plugin ;
+ lv2:minorVersion @SYNTHPOD_MINOR_VERSION@ ;
+ lv2:microVersion @SYNTHPOD_MICRO_VERSION@ ;
+ lv2:binary <synthpod_bundle@LIB_EXT@> ;
+ rdfs:seeAlso <synthpod_bundle.ttl> .
+# Synthpod CV Sink
+synthpod:cv_sink
+ a lv2:Plugin ;
+ lv2:minorVersion @SYNTHPOD_MINOR_VERSION@ ;
+ lv2:microVersion @SYNTHPOD_MICRO_VERSION@ ;
+ lv2:binary <synthpod_bundle@LIB_EXT@> ;
+ rdfs:seeAlso <synthpod_bundle.ttl> .
diff --git a/bundle/synthpod_audio_sink.c b/bundle/synthpod_audio_sink.c
new file mode 100644
index 0000000..6773d3d
--- /dev/null
+++ b/bundle/synthpod_audio_sink.c
@@ -0,0 +1,127 @@
+/*
+ * Copyright (c) 2015 Hanspeter Portner (dev@open-music-kontrollers.ch)
+ *
+ * This is free software: you can redistribute it and/or modify
+ * it under the terms of the Artistic License 2.0 as published by
+ * The Perl Foundation.
+ *
+ * This source is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Artistic License 2.0 for more details.
+ *
+ * You should have received a copy of the Artistic License 2.0
+ * along the source as a COPYING file. If not, obtain it from
+ * http://www.perlfoundation.org/artistic_license_2_0.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <synthpod_bundle.h>
+#include <system_port.h>
+
+#include <lv2/lv2plug.in/ns/ext/atom/atom.h>
+
+typedef struct _plughandle_t plughandle_t;
+
+struct _plughandle_t {
+ float *audio_in;
+};
+
+static LV2_Handle
+instantiate(const LV2_Descriptor* descriptor, double rate,
+ const char *bundle_path, const LV2_Feature *const *features)
+{
+ plughandle_t *handle = calloc(1, sizeof(plughandle_t));
+ if(!handle)
+ return NULL;
+
+ return handle;
+}
+
+static void
+connect_port(LV2_Handle instance, uint32_t port, void *data)
+{
+ plughandle_t *handle = instance;
+
+ switch(port)
+ {
+ case 0:
+ handle->audio_in = (float *)data;
+ break;
+
+ default:
+ break;
+ }
+}
+
+static System_Port_Type
+query(LV2_Handle instance, uint32_t port)
+{
+ switch(port)
+ {
+ case 0:
+ return SYSTEM_PORT_AUDIO;
+
+ default:
+ return SYSTEM_PORT_NONE;
+ }
+}
+
+static void
+activate(LV2_Handle instance)
+{
+ //plughandle_t *handle = instance;
+
+ // nothing
+}
+
+static void
+run(LV2_Handle instance, uint32_t nsamples)
+{
+ plughandle_t *handle = instance;
+
+ // nothing
+}
+
+static void
+deactivate(LV2_Handle instance)
+{
+ plughandle_t *handle = instance;
+
+ // nothing
+}
+
+static void
+cleanup(LV2_Handle instance)
+{
+ plughandle_t *handle = instance;
+
+ free(handle);
+}
+
+static const System_Port_Interface sys = {
+ .query = query
+};
+
+static const void*
+extension_data(const char* uri)
+{
+ if(!strcmp(uri, SYSTEM_PORT__interface))
+ return &sys;
+
+ return NULL;
+}
+
+const LV2_Descriptor synthpod_audio_sink = {
+ .URI = SYNTHPOD_AUDIO_SINK_URI,
+ .instantiate = instantiate,
+ .connect_port = connect_port,
+ .activate = activate,
+ .run = run,
+ .deactivate = deactivate,
+ .cleanup = cleanup,
+ .extension_data = extension_data
+};
diff --git a/bundle/synthpod_audio_source.c b/bundle/synthpod_audio_source.c
new file mode 100644
index 0000000..398bd64
--- /dev/null
+++ b/bundle/synthpod_audio_source.c
@@ -0,0 +1,127 @@
+/*
+ * Copyright (c) 2015 Hanspeter Portner (dev@open-music-kontrollers.ch)
+ *
+ * This is free software: you can redistribute it and/or modify
+ * it under the terms of the Artistic License 2.0 as published by
+ * The Perl Foundation.
+ *
+ * This source is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Artistic License 2.0 for more details.
+ *
+ * You should have received a copy of the Artistic License 2.0
+ * along the source as a COPYING file. If not, obtain it from
+ * http://www.perlfoundation.org/artistic_license_2_0.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <synthpod_bundle.h>
+#include <system_port.h>
+
+#include <lv2/lv2plug.in/ns/ext/atom/atom.h>
+
+typedef struct _plughandle_t plughandle_t;
+
+struct _plughandle_t {
+ const float *audio_out;
+};
+
+static LV2_Handle
+instantiate(const LV2_Descriptor* descriptor, double rate,
+ const char *bundle_path, const LV2_Feature *const *features)
+{
+ plughandle_t *handle = calloc(1, sizeof(plughandle_t));
+ if(!handle)
+ return NULL;
+
+ return handle;
+}
+
+static void
+connect_port(LV2_Handle instance, uint32_t port, void *data)
+{
+ plughandle_t *handle = instance;
+
+ switch(port)
+ {
+ case 0:
+ handle->audio_out = (const float *)data;
+ break;
+
+ default:
+ break;
+ }
+}
+
+static System_Port_Type
+query(LV2_Handle instance, uint32_t port)
+{
+ switch(port)
+ {
+ case 0:
+ return SYSTEM_PORT_AUDIO;
+
+ default:
+ return SYSTEM_PORT_NONE;
+ }
+}
+
+static void
+activate(LV2_Handle instance)
+{
+ //plughandle_t *handle = instance;
+
+ // nothing
+}
+
+static void
+run(LV2_Handle instance, uint32_t nsamples)
+{
+ plughandle_t *handle = instance;
+
+ // nothing
+}
+
+static void
+deactivate(LV2_Handle instance)
+{
+ plughandle_t *handle = instance;
+
+ // nothing
+}
+
+static void
+cleanup(LV2_Handle instance)
+{
+ plughandle_t *handle = instance;
+
+ free(handle);
+}
+
+static const System_Port_Interface sys = {
+ .query = query
+};
+
+static const void*
+extension_data(const char* uri)
+{
+ if(!strcmp(uri, SYSTEM_PORT__interface))
+ return &sys;
+
+ return NULL;
+}
+
+const LV2_Descriptor synthpod_audio_source = {
+ .URI = SYNTHPOD_AUDIO_SOURCE_URI,
+ .instantiate = instantiate,
+ .connect_port = connect_port,
+ .activate = activate,
+ .run = run,
+ .deactivate = deactivate,
+ .cleanup = cleanup,
+ .extension_data = extension_data
+};
diff --git a/bundle/synthpod_bundle.c b/bundle/synthpod_bundle.c
index fbcf6fb..05b5c7c 100644
--- a/bundle/synthpod_bundle.c
+++ b/bundle/synthpod_bundle.c
@@ -29,6 +29,26 @@ lv2_descriptor(uint32_t index)
case 1:
return &synthpod_sink;
+ case 2:
+ return &synthpod_osc_source;
+ case 3:
+ return &synthpod_osc_sink;
+
+ case 4:
+ return &synthpod_cv_source;
+ case 5:
+ return &synthpod_cv_sink;
+
+ case 6:
+ return &synthpod_audio_source;
+ case 7:
+ return &synthpod_audio_sink;
+
+ case 8:
+ return &synthpod_midi_source;
+ case 9:
+ return &synthpod_midi_sink;
+
default:
return NULL;
}
diff --git a/bundle/synthpod_bundle.h b/bundle/synthpod_bundle.h
index d3a21f0..26608bf 100644
--- a/bundle/synthpod_bundle.h
+++ b/bundle/synthpod_bundle.h
@@ -27,7 +27,31 @@
#define SYNTHPOD_SOURCE_URI SYNTHPOD_URI"#source"
#define SYNTHPOD_SINK_URI SYNTHPOD_URI"#sink"
+#define SYNTHPOD_OSC_SOURCE_URI SYNTHPOD_URI"#osc_source"
+#define SYNTHPOD_OSC_SINK_URI SYNTHPOD_URI"#osc_sink"
+
+#define SYNTHPOD_CV_SOURCE_URI SYNTHPOD_URI"#cv_source"
+#define SYNTHPOD_CV_SINK_URI SYNTHPOD_URI"#cv_sink"
+
+#define SYNTHPOD_AUDIO_SOURCE_URI SYNTHPOD_URI"#audio_source"
+#define SYNTHPOD_AUDIO_SINK_URI SYNTHPOD_URI"#audio_sink"
+
+#define SYNTHPOD_MIDI_SOURCE_URI SYNTHPOD_URI"#midi_source"
+#define SYNTHPOD_MIDI_SINK_URI SYNTHPOD_URI"#midi_sink"
+
extern const LV2_Descriptor synthpod_source;
extern const LV2_Descriptor synthpod_sink;
+extern const LV2_Descriptor synthpod_osc_source;
+extern const LV2_Descriptor synthpod_osc_sink;
+
+extern const LV2_Descriptor synthpod_cv_source;
+extern const LV2_Descriptor synthpod_cv_sink;
+
+extern const LV2_Descriptor synthpod_audio_source;
+extern const LV2_Descriptor synthpod_audio_sink;
+
+extern const LV2_Descriptor synthpod_midi_source;
+extern const LV2_Descriptor synthpod_midi_sink;
+
#endif // _SYNTHPOD_LV2_H
diff --git a/bundle/synthpod_bundle.ttl b/bundle/synthpod_bundle.ttl
index 87c4eea..6a954ea 100644
--- a/bundle/synthpod_bundle.ttl
+++ b/bundle/synthpod_bundle.ttl
@@ -22,12 +22,19 @@
@prefix bufsz: <http://lv2plug.in/ns/ext/buf-size#> .
@prefix pg: <http://lv2plug.in/ns/ext/port-groups#> .
@prefix patch: <http://lv2plug.in/ns/ext/patch#> .
+@prefix sys: <http://open-music-kontrollers.ch/lv2/system-port#> .
@prefix lic: <http://opensource.org/licenses/> .
@prefix omk: <http://open-music-kontrollers.ch/ventosus#> .
@prefix proj: <http://open-music-kontrollers.ch/lv2/> .
@prefix synthpod: <http://open-music-kontrollers.ch/lv2/synthpod#> .
+# system-port definitions
+sys:interface
+ a lv2:ExtensionData .
+sys:dynamicPorts
+ a lv2:Feature .
+
# Maintainer
omk:me
a foaf:Person ;
@@ -42,17 +49,17 @@ proj:synthpod
doap:name "Synthpod Bundle" .
# Audio groups
-synthpod:group_in
+synthpod:group_sink
a pg:InputGroup ,
pg:StereoGroup ;
- lv2:name "Input" ;
- lv2:symbol "in" .
+ lv2:name "Sink" ;
+ lv2:symbol "sink" .
-synthpod:group_out
+synthpod:group_source
a pg:OutputGroup ,
pg:StereoGroup ;
- lv2:name "Output" ;
- lv2:symbol "out" .
+ lv2:name "Source" ;
+ lv2:symbol "source" .
# Sink Plugin
synthpod:sink
@@ -62,7 +69,8 @@ synthpod:sink
doap:license lic:Artistic-2.0 ;
lv2:project proj:synthpod ;
lv2:requiredFeature bufsz:boundedBlockLength ;
- lv2:optionalFeature lv2:isLive , lv2:hardRTCapable ;
+ lv2:optionalFeature lv2:isLive, lv2:hardRTCapable ;
+ lv2:extensionData sys:interface ;
lv2:port [
# event in
@@ -74,57 +82,57 @@ synthpod:sink
atom:supports time:Position ;
atom:supports patch:Message ;
lv2:index 0 ;
- lv2:symbol "event_in" ;
- lv2:name "Event In" ;
+ lv2:symbol "event_sink" ;
+ lv2:name "Event Sink" ;
lv2:designation lv2:control ;
- pg:group synthpod:group_in ;
+ pg:group synthpod:group_sink ;
] , [
# audio in 1
a lv2:InputPort ,
lv2:AudioPort ;
lv2:index 1 ;
- lv2:symbol "audio_in_1" ;
- lv2:name "Audio In 1" ;
+ lv2:symbol "audio_sink_1" ;
+ lv2:name "Audio Sink 1" ;
lv2:designation pg:left ;
- pg:group synthpod:group_in ;
+ pg:group synthpod:group_sink ;
] , [
# audio in 2
a lv2:InputPort ,
lv2:AudioPort ;
lv2:index 2 ;
- lv2:symbol "audio_in_2" ;
- lv2:name "Audio In 2" ;
+ lv2:symbol "audio_sink_2" ;
+ lv2:name "Audio Sink 2" ;
lv2:designation pg:right ;
- pg:group synthpod:group_in ;
+ pg:group synthpod:group_sink ;
] , [
# control in
a lv2:InputPort ,
lv2:ControlPort ;
lv2:index 3 ;
- lv2:symbol "control_in_1" ;
- lv2:name "Input 1" ;
- pg:group synthpod:group_in ;
+ lv2:symbol "control_sink_1" ;
+ lv2:name "Control Sink 1" ;
+ pg:group synthpod:group_sink ;
] , [
a lv2:InputPort ,
lv2:ControlPort ;
lv2:index 4 ;
- lv2:symbol "control_in_2" ;
- lv2:name "Input 2" ;
- pg:group synthpod:group_in ;
+ lv2:symbol "control_sink_2" ;
+ lv2:name "Control Sink 2" ;
+ pg:group synthpod:group_sink ;
] , [
a lv2:InputPort ,
lv2:ControlPort ;
lv2:index 5 ;
- lv2:symbol "control_in_3" ;
- lv2:name "Input 3" ;
- pg:group synthpod:group_in ;
+ lv2:symbol "control_sink_3" ;
+ lv2:name "Control Sink 3" ;
+ pg:group synthpod:group_sink ;
] , [
a lv2:InputPort ,
lv2:ControlPort ;
lv2:index 6 ;
- lv2:symbol "control_in_4" ;
- lv2:name "Input 4" ;
- pg:group synthpod:group_in ;
+ lv2:symbol "control_sink_4" ;
+ lv2:name "Control Sink 4" ;
+ pg:group synthpod:group_sink ;
] .
# Source Plugin
@@ -135,7 +143,8 @@ synthpod:source
doap:license lic:Artistic-2.0 ;
lv2:project proj:synthpod ;
lv2:requiredFeature bufsz:boundedBlockLength ;
- lv2:optionalFeature lv2:isLive , lv2:hardRTCapable ;
+ lv2:optionalFeature lv2:isLive, lv2:hardRTCapable ;
+ lv2:extensionData sys:interface ;
lv2:port [
# event in
@@ -147,55 +156,223 @@ synthpod:source
atom:supports time:Position ;
atom:supports patch:Message ;
lv2:index 0 ;
- lv2:symbol "event_out" ;
- lv2:name "Event Out" ;
+ lv2:symbol "event_source" ;
+ lv2:name "Event Source" ;
lv2:designation lv2:control ;
- pg:group synthpod:group_out ;
+ pg:group synthpod:group_source ;
] , [
# audio in 1
a lv2:OutputPort ,
lv2:AudioPort ;
lv2:index 1 ;
- lv2:symbol "audio_out_1" ;
- lv2:name "Audio Out 1" ;
+ lv2:symbol "audio_source_1" ;
+ lv2:name "Audio Source 1" ;
lv2:designation pg:left ;
- pg:group synthpod:group_out ;
+ pg:group synthpod:group_source ;
] , [
# audio in 2
a lv2:OutputPort ,
lv2:AudioPort ;
lv2:index 2 ;
- lv2:symbol "audio_out_2" ;
- lv2:name "Audio Out 2" ;
+ lv2:symbol "audio_source_2" ;
+ lv2:name "Audio Source 2" ;
lv2:designation pg:right ;
- pg:group synthpod:group_out ;
+ pg:group synthpod:group_source ;
] , [
# control in
a lv2:OutputPort ,
lv2:ControlPort ;
lv2:index 3 ;
- lv2:symbol "control_out_1" ;
- lv2:name "Output 1" ;
- pg:group synthpod:group_out ;
+ lv2:symbol "control_source_1" ;
+ lv2:name "Control Source 1" ;
+ pg:group synthpod:group_source ;
] , [
a lv2:OutputPort ,
lv2:ControlPort ;
lv2:index 4 ;
- lv2:symbol "control_out_2" ;
- lv2:name "Output 2" ;
- pg:group synthpod:group_out ;
+ lv2:symbol "control_source_2" ;
+ lv2:name "Control Source 2" ;
+ pg:group synthpod:group_source ;
] , [
a lv2:OutputPort ,
lv2:ControlPort ;
lv2:index 5 ;
- lv2:symbol "control_out_3" ;
- lv2:name "Output 3" ;
- pg:group synthpod:group_out ;
+ lv2:symbol "control_source_3" ;
+ lv2:name "Control Source 3" ;
+ pg:group synthpod:group_source ;
] , [
a lv2:OutputPort ,
lv2:ControlPort ;
lv2:index 6 ;
- lv2:symbol "control_out_4" ;
- lv2:name "Output 4" ;
- pg:group synthpod:group_out ;
+ lv2:symbol "control_source_4" ;
+ lv2:name "Control Source 4" ;
+ pg:group synthpod:group_source ;
+ ] .
+
+# MIDI Sink Plugin
+synthpod:midi_sink
+ a lv2:Plugin ,
+ lv2:InstrumentPlugin ;
+ doap:name "Synthpod MIDI Sink" ;
+ doap:license lic:Artistic-2.0 ;
+ lv2:project proj:synthpod ;
+ lv2:requiredFeature bufsz:boundedBlockLength, sys:dynamicPorts ;
+ lv2:optionalFeature lv2:isLive, lv2:hardRTCapable ;
+ lv2:extensionData sys:interface ;
+
+ lv2:port [
+ a lv2:InputPort ,
+ atom:AtomPort ;
+ atom:bufferType atom:Sequence ;
+ atom:supports midi:MidiEvent ;
+ lv2:index 0 ;
+ lv2:symbol "midi_sink" ;
+ lv2:name "MIDI Sink" ;
+ lv2:designation lv2:control ;
+ pg:group synthpod:group_sink ;
+ ] .
+# MIDI Source Plugin
+synthpod:midi_source
+ a lv2:Plugin ,
+ lv2:InstrumentPlugin ;
+ doap:name "Synthpod MIDI Source" ;
+ doap:license lic:Artistic-2.0 ;
+ lv2:project proj:synthpod ;
+ lv2:requiredFeature bufsz:boundedBlockLength, sys:dynamicPorts ;
+ lv2:optionalFeature lv2:isLive, lv2:hardRTCapable ;
+ lv2:extensionData sys:interface ;
+
+ lv2:port [
+ a lv2:OutputPort ,
+ atom:AtomPort ;
+ atom:bufferType atom:Sequence ;
+ atom:supports midi:MidiEvent ;
+ lv2:index 0 ;
+ lv2:symbol "midi_source" ;
+ lv2:name "MIDI Source" ;
+ lv2:designation lv2:control ;
+ pg:group synthpod:group_source ;
+ ] .
+
+# OSC Sink Plugin
+synthpod:osc_sink
+ a lv2:Plugin ,
+ lv2:InstrumentPlugin ;
+ doap:name "Synthpod OSC Sink" ;
+ doap:license lic:Artistic-2.0 ;
+ lv2:project proj:synthpod ;
+ lv2:requiredFeature bufsz:boundedBlockLength, sys:dynamicPorts ;
+ lv2:optionalFeature lv2:isLive, lv2:hardRTCapable ;
+ lv2:extensionData sys:interface ;
+
+ lv2:port [
+ a lv2:InputPort ,
+ atom:AtomPort ;
+ atom:bufferType atom:Sequence ;
+ atom:supports atom:Object ;
+ lv2:index 0 ;
+ lv2:symbol "osc_sink" ;
+ lv2:name "OSC Sink" ;
+ lv2:designation lv2:control ;
+ pg:group synthpod:group_sink ;
+ ] .
+# OSC Source Plugin
+synthpod:osc_source
+ a lv2:Plugin ,
+ lv2:InstrumentPlugin ;
+ doap:name "Synthpod OSC Source" ;
+ doap:license lic:Artistic-2.0 ;
+ lv2:project proj:synthpod ;
+ lv2:requiredFeature bufsz:boundedBlockLength, sys:dynamicPorts ;
+ lv2:optionalFeature lv2:isLive, lv2:hardRTCapable ;
+ lv2:extensionData sys:interface ;
+
+ lv2:port [
+ a lv2:OutputPort ,
+ atom:AtomPort ;
+ atom:bufferType atom:Sequence ;
+ atom:supports atom:Object ;
+ lv2:index 0 ;
+ lv2:symbol "osc_source" ;
+ lv2:name "OSC Source" ;
+ lv2:designation lv2:control ;
+ pg:group synthpod:group_source ;
+ ] .
+
+# CV Sink Plugin
+synthpod:cv_sink
+ a lv2:Plugin ,
+ lv2:InstrumentPlugin ;
+ doap:name "Synthpod CV Sink" ;
+ doap:license lic:Artistic-2.0 ;
+ lv2:project proj:synthpod ;
+ lv2:requiredFeature bufsz:boundedBlockLength, sys:dynamicPorts ;
+ lv2:optionalFeature lv2:isLive, lv2:hardRTCapable ;
+ lv2:extensionData sys:interface ;
+
+ lv2:port [
+ a lv2:InputPort ,
+ lv2:CVPort ;
+ lv2:index 0 ;
+ lv2:symbol "cv_sink" ;
+ lv2:name "CV Sink" ;
+ pg:group synthpod:group_sink ;
+ ] .
+# CV Source Plugin
+synthpod:cv_source
+ a lv2:Plugin ,
+ lv2:InstrumentPlugin ;
+ doap:name "Synthpod CV Source" ;
+ doap:license lic:Artistic-2.0 ;
+ lv2:project proj:synthpod ;
+ lv2:requiredFeature bufsz:boundedBlockLength, sys:dynamicPorts ;
+ lv2:optionalFeature lv2:isLive, lv2:hardRTCapable ;
+ lv2:extensionData sys:interface ;
+
+ lv2:port [
+ a lv2:OutputPort ,
+ lv2:CVPort ;
+ lv2:index 0 ;
+ lv2:symbol "cv_source" ;
+ lv2:name "CV Source" ;
+ pg:group synthpod:group_source ;
+ ] .
+
+# Audio Sink Plugin
+synthpod:audio_sink
+ a lv2:Plugin ,
+ lv2:InstrumentPlugin ;
+ doap:name "Synthpod Audio Sink" ;
+ doap:license lic:Artistic-2.0 ;
+ lv2:project proj:synthpod ;
+ lv2:requiredFeature bufsz:boundedBlockLength, sys:dynamicPorts ;
+ lv2:optionalFeature lv2:isLive, lv2:hardRTCapable ;
+ lv2:extensionData sys:interface ;
+
+ lv2:port [
+ a lv2:InputPort ,
+ lv2:AudioPort ;
+ lv2:index 0 ;
+ lv2:symbol "audio_sink" ;
+ lv2:name "Audio Sink" ;
+ pg:group synthpod:group_sink ;
+ ] .
+# AudioSource Plugin
+synthpod:audio_source
+ a lv2:Plugin ,
+ lv2:InstrumentPlugin ;
+ doap:name "Synthpod Audio Source" ;
+ doap:license lic:Artistic-2.0 ;
+ lv2:project proj:synthpod ;
+ lv2:requiredFeature bufsz:boundedBlockLength, sys:dynamicPorts ;
+ lv2:optionalFeature lv2:isLive, lv2:hardRTCapable ;
+ lv2:extensionData sys:interface ;
+
+ lv2:port [
+ a lv2:OutputPort ,
+ lv2:AudioPort ;
+ lv2:index 0 ;
+ lv2:symbol "audio_source" ;
+ lv2:name "Audio Source" ;
+ pg:group synthpod:group_source ;
] .
diff --git a/bundle/synthpod_cv_sink.c b/bundle/synthpod_cv_sink.c
new file mode 100644
index 0000000..0c50e12
--- /dev/null
+++ b/bundle/synthpod_cv_sink.c
@@ -0,0 +1,127 @@
+/*
+ * Copyright (c) 2015 Hanspeter Portner (dev@open-music-kontrollers.ch)
+ *
+ * This is free software: you can redistribute it and/or modify
+ * it under the terms of the Artistic License 2.0 as published by
+ * The Perl Foundation.
+ *
+ * This source is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Artistic License 2.0 for more details.
+ *
+ * You should have received a copy of the Artistic License 2.0
+ * along the source as a COPYING file. If not, obtain it from
+ * http://www.perlfoundation.org/artistic_license_2_0.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <synthpod_bundle.h>
+#include <system_port.h>
+
+#include <lv2/lv2plug.in/ns/ext/atom/atom.h>
+
+typedef struct _plughandle_t plughandle_t;
+
+struct _plughandle_t {
+ float *cv_in;
+};
+
+static LV2_Handle
+instantiate(const LV2_Descriptor* descriptor, double rate,
+ const char *bundle_path, const LV2_Feature *const *features)
+{
+ plughandle_t *handle = calloc(1, sizeof(plughandle_t));
+ if(!handle)
+ return NULL;
+
+ return handle;
+}
+
+static void
+connect_port(LV2_Handle instance, uint32_t port, void *data)
+{
+ plughandle_t *handle = instance;
+
+ switch(port)
+ {
+ case 0:
+ handle->cv_in = (float *)data;
+ break;
+
+ default:
+ break;
+ }
+}
+
+static System_Port_Type
+query(LV2_Handle instance, uint32_t port)
+{
+ switch(port)
+ {
+ case 0:
+ return SYSTEM_PORT_CV;
+
+ default:
+ return SYSTEM_PORT_NONE;
+ }
+}
+
+static void
+activate(LV2_Handle instance)
+{
+ //plughandle_t *handle = instance;
+
+ // nothing
+}
+
+static void
+run(LV2_Handle instance, uint32_t nsamples)
+{
+ plughandle_t *handle = instance;
+
+ // nothing
+}
+
+static void
+deactivate(LV2_Handle instance)
+{
+ plughandle_t *handle = instance;
+
+ // nothing
+}
+
+static void
+cleanup(LV2_Handle instance)
+{
+ plughandle_t *handle = instance;
+
+ free(handle);
+}
+
+static const System_Port_Interface sys = {
+ .query = query
+};
+
+static const void*
+extension_data(const char* uri)
+{
+ if(!strcmp(uri, SYSTEM_PORT__interface))
+ return &sys;
+
+ return NULL;
+}
+
+const LV2_Descriptor synthpod_cv_sink = {
+ .URI = SYNTHPOD_CV_SINK_URI,
+ .instantiate = instantiate,
+ .connect_port = connect_port,
+ .activate = activate,
+ .run = run,
+ .deactivate = deactivate,
+ .cleanup = cleanup,
+ .extension_data = extension_data
+};
diff --git a/bundle/synthpod_cv_source.c b/bundle/synthpod_cv_source.c
new file mode 100644
index 0000000..6a3468c
--- /dev/null
+++ b/bundle/synthpod_cv_source.c
@@ -0,0 +1,127 @@
+/*
+ * Copyright (c) 2015 Hanspeter Portner (dev@open-music-kontrollers.ch)
+ *
+ * This is free software: you can redistribute it and/or modify
+ * it under the terms of the Artistic License 2.0 as published by
+ * The Perl Foundation.
+ *
+ * This source is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Artistic License 2.0 for more details.
+ *
+ * You should have received a copy of the Artistic License 2.0
+ * along the source as a COPYING file. If not, obtain it from
+ * http://www.perlfoundation.org/artistic_license_2_0.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <synthpod_bundle.h>
+#include <system_port.h>
+
+#include <lv2/lv2plug.in/ns/ext/atom/atom.h>
+
+typedef struct _plughandle_t plughandle_t;
+
+struct _plughandle_t {
+ const float *cv_out;
+};
+
+static LV2_Handle
+instantiate(const LV2_Descriptor* descriptor, double rate,
+ const char *bundle_path, const LV2_Feature *const *features)
+{
+ plughandle_t *handle = calloc(1, sizeof(plughandle_t));
+ if(!handle)
+ return NULL;
+
+ return handle;
+}
+
+static void
+connect_port(LV2_Handle instance, uint32_t port, void *data)
+{
+ plughandle_t *handle = instance;
+
+ switch(port)
+ {
+ case 0:
+ handle->cv_out = (const float *)data;
+ break;
+
+ default:
+ break;
+ }
+}
+
+static System_Port_Type
+query(LV2_Handle instance, uint32_t port)
+{
+ switch(port)
+ {
+ case 0:
+ return SYSTEM_PORT_CV;
+
+ default:
+ return SYSTEM_PORT_NONE;
+ }
+}
+
+static void
+activate(LV2_Handle instance)
+{
+ //plughandle_t *handle = instance;
+
+ // nothing
+}
+
+static void
+run(LV2_Handle instance, uint32_t nsamples)
+{
+ plughandle_t *handle = instance;
+
+ // nothing
+}
+
+static void
+deactivate(LV2_Handle instance)
+{
+ plughandle_t *handle = instance;
+
+ // nothing
+}
+
+static void
+cleanup(LV2_Handle instance)
+{
+ plughandle_t *handle = instance;
+
+ free(handle);
+}
+
+static const System_Port_Interface sys = {
+ .query = query
+};
+
+static const void*
+extension_data(const char* uri)
+{
+ if(!strcmp(uri, SYSTEM_PORT__interface))
+ return &sys;
+
+ return NULL;
+}
+
+const LV2_Descriptor synthpod_cv_source = {
+ .URI = SYNTHPOD_CV_SOURCE_URI,
+ .instantiate = instantiate,
+ .connect_port = connect_port,
+ .activate = activate,
+ .run = run,
+ .deactivate = deactivate,
+ .cleanup = cleanup,
+ .extension_data = extension_data
+};
diff --git a/bundle/synthpod_midi_sink.c b/bundle/synthpod_midi_sink.c
new file mode 100644
index 0000000..f2191f6
--- /dev/null
+++ b/bundle/synthpod_midi_sink.c
@@ -0,0 +1,127 @@
+/*
+ * Copyright (c) 2015 Hanspeter Portner (dev@open-music-kontrollers.ch)
+ *
+ * This is free software: you can redistribute it and/or modify
+ * it under the terms of the Artistic License 2.0 as published by
+ * The Perl Foundation.
+ *
+ * This source is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Artistic License 2.0 for more details.
+ *
+ * You should have received a copy of the Artistic License 2.0
+ * along the source as a COPYING file. If not, obtain it from
+ * http://www.perlfoundation.org/artistic_license_2_0.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <synthpod_bundle.h>
+#include <system_port.h>
+
+#include <lv2/lv2plug.in/ns/ext/atom/atom.h>
+
+typedef struct _plughandle_t plughandle_t;
+
+struct _plughandle_t {
+ LV2_Atom_Sequence *event_in;
+};
+
+static LV2_Handle
+instantiate(const LV2_Descriptor* descriptor, double rate,
+ const char *bundle_path, const LV2_Feature *const *features)
+{
+ plughandle_t *handle = calloc(1, sizeof(plughandle_t));
+ if(!handle)
+ return NULL;
+
+ return handle;
+}
+
+static void
+connect_port(LV2_Handle instance, uint32_t port, void *data)
+{
+ plughandle_t *handle = instance;
+
+ switch(port)
+ {
+ case 0:
+ handle->event_in = (LV2_Atom_Sequence *)data;
+ break;
+
+ default:
+ break;
+ }
+}
+
+static System_Port_Type
+query(LV2_Handle instance, uint32_t port)
+{
+ switch(port)
+ {
+ case 0:
+ return SYSTEM_PORT_MIDI;
+
+ default:
+ return SYSTEM_PORT_NONE;
+ }
+}
+
+static void
+activate(LV2_Handle instance)
+{
+ //plughandle_t *handle = instance;
+
+ // nothing
+}
+
+static void
+run(LV2_Handle instance, uint32_t nsamples)
+{
+ plughandle_t *handle = instance;
+
+ // nothing
+}
+
+static void
+deactivate(LV2_Handle instance)
+{
+ plughandle_t *handle = instance;
+
+ // nothing
+}
+
+static void
+cleanup(LV2_Handle instance)
+{
+ plughandle_t *handle = instance;
+
+ free(handle);
+}
+
+static const System_Port_Interface sys = {
+ .query = query
+};
+
+static const void*
+extension_data(const char* uri)
+{
+ if(!strcmp(uri, SYSTEM_PORT__interface))
+ return &sys;
+
+ return NULL;
+}
+
+const LV2_Descriptor synthpod_midi_sink = {
+ .URI = SYNTHPOD_MIDI_SINK_URI,
+ .instantiate = instantiate,
+ .connect_port = connect_port,
+ .activate = activate,
+ .run = run,
+ .deactivate = deactivate,
+ .cleanup = cleanup,
+ .extension_data = extension_data
+};
diff --git a/bundle/synthpod_midi_source.c b/bundle/synthpod_midi_source.c
new file mode 100644
index 0000000..85330cd
--- /dev/null
+++ b/bundle/synthpod_midi_source.c
@@ -0,0 +1,127 @@
+/*
+ * Copyright (c) 2015 Hanspeter Portner (dev@open-music-kontrollers.ch)
+ *
+ * This is free software: you can redistribute it and/or modify
+ * it under the terms of the Artistic License 2.0 as published by
+ * The Perl Foundation.
+ *
+ * This source is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Artistic License 2.0 for more details.
+ *
+ * You should have received a copy of the Artistic License 2.0
+ * along the source as a COPYING file. If not, obtain it from
+ * http://www.perlfoundation.org/artistic_license_2_0.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <synthpod_bundle.h>
+#include <system_port.h>
+
+#include <lv2/lv2plug.in/ns/ext/atom/atom.h>
+
+typedef struct _plughandle_t plughandle_t;
+
+struct _plughandle_t {
+ const LV2_Atom_Sequence *event_out;
+};
+
+static LV2_Handle
+instantiate(const LV2_Descriptor* descriptor, double rate,
+ const char *bundle_path, const LV2_Feature *const *features)
+{
+ plughandle_t *handle = calloc(1, sizeof(plughandle_t));
+ if(!handle)
+ return NULL;
+
+ return handle;
+}
+
+static void
+connect_port(LV2_Handle instance, uint32_t port, void *data)
+{
+ plughandle_t *handle = instance;
+
+ switch(port)
+ {
+ case 0:
+ handle->event_out = (const LV2_Atom_Sequence *)data;
+ break;
+
+ default:
+ break;
+ }
+}
+
+static System_Port_Type
+query(LV2_Handle instance, uint32_t port)
+{
+ switch(port)
+ {
+ case 0:
+ return SYSTEM_PORT_MIDI;
+
+ default:
+ return SYSTEM_PORT_NONE;
+ }
+}
+
+static void
+activate(LV2_Handle instance)
+{
+ //plughandle_t *handle = instance;
+
+ // nothing
+}
+
+static void
+run(LV2_Handle instance, uint32_t nsamples)
+{
+ plughandle_t *handle = instance;
+
+ // nothing
+}
+
+static void
+deactivate(LV2_Handle instance)
+{
+ plughandle_t *handle = instance;
+
+ // nothing
+}
+
+static void
+cleanup(LV2_Handle instance)
+{
+ plughandle_t *handle = instance;
+
+ free(handle);
+}
+
+static const System_Port_Interface sys = {
+ .query = query
+};
+
+static const void*
+extension_data(const char* uri)
+{
+ if(!strcmp(uri, SYSTEM_PORT__interface))
+ return &sys;
+
+ return NULL;
+}
+
+const LV2_Descriptor synthpod_midi_source = {
+ .URI = SYNTHPOD_MIDI_SOURCE_URI,
+ .instantiate = instantiate,
+ .connect_port = connect_port,
+ .activate = activate,
+ .run = run,
+ .deactivate = deactivate,
+ .cleanup = cleanup,
+ .extension_data = extension_data
+};
diff --git a/bundle/synthpod_osc_sink.c b/bundle/synthpod_osc_sink.c
new file mode 100644
index 0000000..84dba43
--- /dev/null
+++ b/bundle/synthpod_osc_sink.c
@@ -0,0 +1,127 @@
+/*
+ * Copyright (c) 2015 Hanspeter Portner (dev@open-music-kontrollers.ch)
+ *
+ * This is free software: you can redistribute it and/or modify
+ * it under the terms of the Artistic License 2.0 as published by
+ * The Perl Foundation.
+ *
+ * This source is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Artistic License 2.0 for more details.
+ *
+ * You should have received a copy of the Artistic License 2.0
+ * along the source as a COPYING file. If not, obtain it from
+ * http://www.perlfoundation.org/artistic_license_2_0.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <synthpod_bundle.h>
+#include <system_port.h>
+
+#include <lv2/lv2plug.in/ns/ext/atom/atom.h>
+
+typedef struct _plughandle_t plughandle_t;
+
+struct _plughandle_t {
+ LV2_Atom_Sequence *event_in;
+};
+
+static LV2_Handle
+instantiate(const LV2_Descriptor* descriptor, double rate,
+ const char *bundle_path, const LV2_Feature *const *features)
+{
+ plughandle_t *handle = calloc(1, sizeof(plughandle_t));
+ if(!handle)
+ return NULL;
+
+ return handle;
+}
+
+static void
+connect_port(LV2_Handle instance, uint32_t port, void *data)
+{
+ plughandle_t *handle = instance;
+
+ switch(port)
+ {
+ case 0:
+ handle->event_in = (LV2_Atom_Sequence *)data;
+ break;
+
+ default:
+ break;
+ }
+}
+
+static System_Port_Type
+query(LV2_Handle instance, uint32_t port)
+{
+ switch(port)
+ {
+ case 0:
+ return SYSTEM_PORT_OSC;
+
+ default:
+ return SYSTEM_PORT_NONE;
+ }
+}
+
+static void
+activate(LV2_Handle instance)
+{
+ //plughandle_t *handle = instance;
+
+ // nothing
+}
+
+static void
+run(LV2_Handle instance, uint32_t nsamples)
+{
+ plughandle_t *handle = instance;
+
+ // nothing
+}
+
+static void
+deactivate(LV2_Handle instance)
+{
+ plughandle_t *handle = instance;
+
+ // nothing
+}
+
+static void
+cleanup(LV2_Handle instance)
+{
+ plughandle_t *handle = instance;
+
+ free(handle);
+}
+
+static const System_Port_Interface sys = {
+ .query = query
+};
+
+static const void*
+extension_data(const char* uri)
+{
+ if(!strcmp(uri, SYSTEM_PORT__interface))
+ return &sys;
+
+ return NULL;
+}
+
+const LV2_Descriptor synthpod_osc_sink = {
+ .URI = SYNTHPOD_OSC_SINK_URI,
+ .instantiate = instantiate,
+ .connect_port = connect_port,
+ .activate = activate,
+ .run = run,
+ .deactivate = deactivate,
+ .cleanup = cleanup,
+ .extension_data = extension_data
+};
diff --git a/bundle/synthpod_osc_source.c b/bundle/synthpod_osc_source.c
new file mode 100644
index 0000000..19e290e
--- /dev/null
+++ b/bundle/synthpod_osc_source.c
@@ -0,0 +1,127 @@
+/*
+ * Copyright (c) 2015 Hanspeter Portner (dev@open-music-kontrollers.ch)
+ *
+ * This is free software: you can redistribute it and/or modify
+ * it under the terms of the Artistic License 2.0 as published by
+ * The Perl Foundation.
+ *
+ * This source is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Artistic License 2.0 for more details.
+ *
+ * You should have received a copy of the Artistic License 2.0
+ * along the source as a COPYING file. If not, obtain it from
+ * http://www.perlfoundation.org/artistic_license_2_0.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <synthpod_bundle.h>
+#include <system_port.h>
+
+#include <lv2/lv2plug.in/ns/ext/atom/atom.h>
+
+typedef struct _plughandle_t plughandle_t;
+
+struct _plughandle_t {
+ const LV2_Atom_Sequence *event_out;
+};
+
+static LV2_Handle
+instantiate(const LV2_Descriptor* descriptor, double rate,
+ const char *bundle_path, const LV2_Feature *const *features)
+{
+ plughandle_t *handle = calloc(1, sizeof(plughandle_t));
+ if(!handle)
+ return NULL;
+
+ return handle;
+}
+
+static void
+connect_port(LV2_Handle instance, uint32_t port, void *data)
+{
+ plughandle_t *handle = instance;
+
+ switch(port)
+ {
+ case 0:
+ handle->event_out = (const LV2_Atom_Sequence *)data;
+ break;
+
+ default:
+ break;
+ }
+}
+
+static System_Port_Type
+query(LV2_Handle instance, uint32_t port)
+{
+ switch(port)
+ {
+ case 0:
+ return SYSTEM_PORT_OSC;
+
+ default:
+ return SYSTEM_PORT_NONE;
+ }
+}
+
+static void
+activate(LV2_Handle instance)
+{
+ //plughandle_t *handle = instance;
+
+ // nothing
+}
+
+static void
+run(LV2_Handle instance, uint32_t nsamples)
+{
+ plughandle_t *handle = instance;
+
+ // nothing
+}
+
+static void
+deactivate(LV2_Handle instance)
+{
+ plughandle_t *handle = instance;
+
+ // nothing
+}
+
+static void
+cleanup(LV2_Handle instance)
+{
+ plughandle_t *handle = instance;
+
+ free(handle);
+}
+
+static const System_Port_Interface sys = {
+ .query = query
+};
+
+static const void*
+extension_data(const char* uri)
+{
+ if(!strcmp(uri, SYSTEM_PORT__interface))
+ return &sys;
+
+ return NULL;
+}
+
+const LV2_Descriptor synthpod_osc_source = {
+ .URI = SYNTHPOD_OSC_SOURCE_URI,
+ .instantiate = instantiate,
+ .connect_port = connect_port,
+ .activate = activate,
+ .run = run,
+ .deactivate = deactivate,
+ .cleanup = cleanup,
+ .extension_data = extension_data
+};
diff --git a/bundle/synthpod_sink.c b/bundle/synthpod_sink.c
index 10dc0db..6658b3b 100644
--- a/bundle/synthpod_sink.c
+++ b/bundle/synthpod_sink.c
@@ -20,6 +20,7 @@
#include <string.h>
#include <synthpod_bundle.h>
+#include <system_port.h>
#include <lv2/lv2plug.in/ns/ext/atom/atom.h>
@@ -78,6 +79,29 @@ connect_port(LV2_Handle instance, uint32_t port, void *data)
}
}
+static System_Port_Type
+query(LV2_Handle instance, uint32_t port)
+{
+ switch(port)
+ {
+ case 0:
+ return SYSTEM_PORT_MIDI;
+
+ case 1:
+ case 2:
+ return SYSTEM_PORT_AUDIO;
+
+ case 3:
+ case 4:
+ case 5:
+ case 6:
+ return SYSTEM_PORT_CONTROL;
+
+ default:
+ return SYSTEM_PORT_NONE;
+ }
+}
+
static void
activate(LV2_Handle instance)
{
@@ -110,9 +134,16 @@ cleanup(LV2_Handle instance)
free(handle);
}
+static const System_Port_Interface sys = {
+ .query = query
+};
+
static const void*
extension_data(const char* uri)
{
+ if(!strcmp(uri, SYSTEM_PORT__interface))
+ return &sys;
+
return NULL;
}
diff --git a/bundle/synthpod_source.c b/bundle/synthpod_source.c
index 2b532d6..ea68ed6 100644
--- a/bundle/synthpod_source.c
+++ b/bundle/synthpod_source.c
@@ -20,6 +20,7 @@
#include <string.h>
#include <synthpod_bundle.h>
+#include <system_port.h>
#include <lv2/lv2plug.in/ns/ext/atom/atom.h>
@@ -78,6 +79,29 @@ connect_port(LV2_Handle instance, uint32_t port, void *data)
}
}
+static System_Port_Type
+query(LV2_Handle instance, uint32_t port)
+{
+ switch(port)
+ {
+ case 0:
+ return SYSTEM_PORT_MIDI;
+
+ case 1:
+ case 2:
+ return SYSTEM_PORT_AUDIO;
+
+ case 3:
+ case 4:
+ case 5:
+ case 6:
+ return SYSTEM_PORT_CONTROL;
+
+ default:
+ return SYSTEM_PORT_NONE;
+ }
+}
+
static void
activate(LV2_Handle instance)
{
@@ -110,9 +134,16 @@ cleanup(LV2_Handle instance)
free(handle);
}
+static const System_Port_Interface sys = {
+ .query = query
+};
+
static const void*
extension_data(const char* uri)
{
+ if(!strcmp(uri, SYSTEM_PORT__interface))
+ return &sys;
+
return NULL;
}