aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bin/CMakeLists.txt1
-rw-r--r--bin/synthpod_alsa.c2
-rw-r--r--bin/synthpod_jack.c2
-rw-r--r--bundle/CMakeLists.txt13
-rw-r--r--bundle/synthpod_audio_sink.c98
-rw-r--r--bundle/synthpod_audio_source.c98
-rw-r--r--bundle/synthpod_bundle.c147
-rw-r--r--bundle/synthpod_bundle.h15
-rw-r--r--bundle/synthpod_bundle.ttl94
-rw-r--r--bundle/synthpod_cv_sink.c98
-rw-r--r--bundle/synthpod_cv_source.c98
-rw-r--r--bundle/synthpod_midi_sink.c98
-rw-r--r--bundle/synthpod_midi_source.c98
-rw-r--r--bundle/synthpod_osc_sink.c98
-rw-r--r--bundle/synthpod_osc_source.c98
-rw-r--r--bundle/synthpod_sink.c141
-rw-r--r--bundle/synthpod_source.c141
-rw-r--r--lib/CMakeLists.txt1
-rw-r--r--lib/synthpod_app.c34
-rw-r--r--lib/synthpod_app.h18
-rw-r--r--lib/synthpod_private.h21
-rw-r--r--plugins/CMakeLists.txt1
-rw-r--r--system_port.lv2/system_port.h59
23 files changed, 276 insertions, 1198 deletions
diff --git a/bin/CMakeLists.txt b/bin/CMakeLists.txt
index 4daffaf3..fc45cc05 100644
--- a/bin/CMakeLists.txt
+++ b/bin/CMakeLists.txt
@@ -1,7 +1,6 @@
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${PROJECT_SOURCE_DIR}/libosc) # osc.h
include_directories(${PROJECT_SOURCE_DIR}/varchunk)
-include_directories(${PROJECT_SOURCE_DIR}/system_port.lv2)
include_directories(${PROJECT_SOURCE_DIR}/osc.lv2)
include_directories(${PROJECT_SOURCE_DIR}/lib) # synthpod_app.h, synthpod_ui.h
diff --git a/bin/synthpod_alsa.c b/bin/synthpod_alsa.c
index 00b1ee27..bee3856f 100644
--- a/bin/synthpod_alsa.c
+++ b/bin/synthpod_alsa.c
@@ -400,7 +400,7 @@ _rt_thread(void *data, Eina_Thread thread)
}
static void *
-_system_port_add(void *data, System_Port_Type type, const char *short_name,
+_system_port_add(void *data, system_port_t type, const char *short_name,
const char *pretty_name, int input)
{
bin_t *bin = data;
diff --git a/bin/synthpod_jack.c b/bin/synthpod_jack.c
index fa6fced4..68d6b0bd 100644
--- a/bin/synthpod_jack.c
+++ b/bin/synthpod_jack.c
@@ -749,7 +749,7 @@ _ui_saved(void *data, int status)
}
static void *
-_system_port_add(void *data, System_Port_Type type, const char *short_name,
+_system_port_add(void *data, system_port_t type, const char *short_name,
const char *pretty_name, int input)
{
bin_t *bin = data;
diff --git a/bundle/CMakeLists.txt b/bundle/CMakeLists.txt
index d2038246..227149ff 100644
--- a/bundle/CMakeLists.txt
+++ b/bundle/CMakeLists.txt
@@ -1,5 +1,4 @@
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
-include_directories(${CMAKE_SOURCE_DIR}/system_port.lv2)
if(WIN32)
set(LIB_EXT ".dll")
@@ -11,17 +10,7 @@ endif()
# synthpod
add_library(synthpod_bundle.lv2 MODULE
- synthpod_bundle.c
- synthpod_sink.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)
+ synthpod_bundle.c)
set_target_properties(synthpod_bundle.lv2 PROPERTIES PREFIX "" OUTPUT_NAME "synthpod_bundle")
install(TARGETS synthpod_bundle.lv2 DESTINATION ${SYNTHPOD_BUNDLE_DIR})
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/synthpod_bundle.ttl DESTINATION ${SYNTHPOD_BUNDLE_DIR})
diff --git a/bundle/synthpod_audio_sink.c b/bundle/synthpod_audio_sink.c
deleted file mode 100644
index 1a9fc876..00000000
--- a/bundle/synthpod_audio_sink.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * 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 [4];
-};
-
-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;
-
- if(port < 4)
- handle->audio_in[port] = (float *)data;
-}
-
-static System_Port_Type
-query(LV2_Handle instance, uint32_t port)
-{
- if(port < 4)
- return SYSTEM_PORT_AUDIO;
-
- return SYSTEM_PORT_NONE;
-}
-
-static void
-run(LV2_Handle instance, uint32_t nsamples)
-{
- // 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 = NULL,
- .run = run,
- .deactivate = NULL,
- .cleanup = cleanup,
- .extension_data = extension_data
-};
diff --git a/bundle/synthpod_audio_source.c b/bundle/synthpod_audio_source.c
deleted file mode 100644
index a3daeb19..00000000
--- a/bundle/synthpod_audio_source.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * 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 [4];
-};
-
-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;
-
- if(port < 4)
- handle->audio_out[port] = (const float *)data;
-}
-
-static System_Port_Type
-query(LV2_Handle instance, uint32_t port)
-{
- if(port < 4)
- return SYSTEM_PORT_AUDIO;
-
- return SYSTEM_PORT_NONE;
-}
-
-static void
-run(LV2_Handle instance, uint32_t nsamples)
-{
- // 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 = NULL,
- .run = run,
- .deactivate = NULL,
- .cleanup = cleanup,
- .extension_data = extension_data
-};
diff --git a/bundle/synthpod_bundle.c b/bundle/synthpod_bundle.c
index b7bdda65..e33f25fe 100644
--- a/bundle/synthpod_bundle.c
+++ b/bundle/synthpod_bundle.c
@@ -19,6 +19,153 @@
#include <synthpod_bundle.h>
+typedef struct _plughandle_t plughandle_t;
+
+struct _plughandle_t {
+ int dummy;
+};
+
+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)
+{
+ // nothing
+}
+
+static void
+run(LV2_Handle instance, uint32_t nsamples)
+{
+ // nothing
+}
+
+static void
+cleanup(LV2_Handle instance)
+{
+ plughandle_t *handle = instance;
+
+ free(handle);
+}
+
+static const LV2_Descriptor synthpod_audio_sink = {
+ .URI = SYNTHPOD_AUDIO_SINK_URI,
+ .instantiate = instantiate,
+ .connect_port = connect_port,
+ .activate = NULL,
+ .run = run,
+ .deactivate = NULL,
+ .cleanup = cleanup,
+ .extension_data = NULL
+};
+
+static const LV2_Descriptor synthpod_audio_source = {
+ .URI = SYNTHPOD_AUDIO_SOURCE_URI,
+ .instantiate = instantiate,
+ .connect_port = connect_port,
+ .activate = NULL,
+ .run = run,
+ .deactivate = NULL,
+ .cleanup = cleanup,
+ .extension_data = NULL
+};
+
+static const LV2_Descriptor synthpod_cv_sink = {
+ .URI = SYNTHPOD_CV_SINK_URI,
+ .instantiate = instantiate,
+ .connect_port = connect_port,
+ .activate = NULL,
+ .run = run,
+ .deactivate = NULL,
+ .cleanup = cleanup,
+ .extension_data = NULL
+};
+
+static const LV2_Descriptor synthpod_cv_source = {
+ .URI = SYNTHPOD_CV_SOURCE_URI,
+ .instantiate = instantiate,
+ .connect_port = connect_port,
+ .activate = NULL,
+ .run = run,
+ .deactivate = NULL,
+ .cleanup = cleanup,
+ .extension_data = NULL
+};
+
+static const LV2_Descriptor synthpod_midi_sink = {
+ .URI = SYNTHPOD_MIDI_SINK_URI,
+ .instantiate = instantiate,
+ .connect_port = connect_port,
+ .activate = NULL,
+ .run = run,
+ .deactivate = NULL,
+ .cleanup = cleanup,
+ .extension_data = NULL
+};
+
+static const LV2_Descriptor synthpod_midi_source = {
+ .URI = SYNTHPOD_MIDI_SOURCE_URI,
+ .instantiate = instantiate,
+ .connect_port = connect_port,
+ .activate = NULL,
+ .run = run,
+ .deactivate = NULL,
+ .cleanup = cleanup,
+ .extension_data = NULL
+};
+
+static const LV2_Descriptor synthpod_osc_sink = {
+ .URI = SYNTHPOD_OSC_SINK_URI,
+ .instantiate = instantiate,
+ .connect_port = connect_port,
+ .activate = NULL,
+ .run = run,
+ .deactivate = NULL,
+ .cleanup = cleanup,
+ .extension_data = NULL
+};
+
+static const LV2_Descriptor synthpod_osc_source = {
+ .URI = SYNTHPOD_OSC_SOURCE_URI,
+ .instantiate = instantiate,
+ .connect_port = connect_port,
+ .activate = NULL,
+ .run = run,
+ .deactivate = NULL,
+ .cleanup = cleanup,
+ .extension_data = NULL
+};
+
+static const LV2_Descriptor synthpod_sink = {
+ .URI = SYNTHPOD_SINK_URI,
+ .instantiate = instantiate,
+ .connect_port = connect_port,
+ .activate = NULL,
+ .run = run,
+ .deactivate = NULL,
+ .cleanup = cleanup,
+ .extension_data = NULL
+};
+
+static const LV2_Descriptor synthpod_source = {
+ .URI = SYNTHPOD_SOURCE_URI,
+ .instantiate = instantiate,
+ .connect_port = connect_port,
+ .activate = NULL,
+ .run = run,
+ .deactivate = NULL,
+ .cleanup = cleanup,
+ .extension_data = NULL
+};
+
#ifdef _WIN32
__declspec(dllexport)
#else
diff --git a/bundle/synthpod_bundle.h b/bundle/synthpod_bundle.h
index 26608bf0..5748dc08 100644
--- a/bundle/synthpod_bundle.h
+++ b/bundle/synthpod_bundle.h
@@ -39,19 +39,4 @@
#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 3c39dc72..20e59672 100644
--- a/bundle/synthpod_bundle.ttl
+++ b/bundle/synthpod_bundle.ttl
@@ -15,6 +15,7 @@
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix lv2: <http://lv2plug.in/ns/lv2core#> .
@prefix atom: <http://lv2plug.in/ns/ext/atom#> .
@prefix time: <http://lv2plug.in/ns/ext/time#> .
@@ -22,7 +23,6 @@
@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#> .
@@ -30,11 +30,29 @@
@prefix synthpod: <http://open-music-kontrollers.ch/lv2/synthpod#> .
# system-port definitions
-sys:interface
- a lv2:ExtensionData .
-sys:dynamicPorts
+synthpod:systemPorts
a lv2:Feature .
+synthpod:ControlPort
+ a rdfs:Class ;
+ rdfs:subClassOf lv2:Port .
+
+synthpod:AudioPort
+ a rdfs:Class ;
+ rdfs:subClassOf lv2:Port .
+
+synthpod:CVPort
+ a rdfs:Class ;
+ rdfs:subClassOf lv2:Port .
+
+synthpod:MIDIPort
+ a rdfs:Class ;
+ rdfs:subClassOf lv2:Port .
+
+synthpod:OSCPort
+ a rdfs:Class ;
+ rdfs:subClassOf lv2:Port .
+
# Maintainer
omk:me
a foaf:Person ;
@@ -68,13 +86,13 @@ synthpod:sink
doap:name "Synthpod System Sink" ;
doap:license lic:Artistic-2.0 ;
lv2:project proj:synthpod ;
- lv2:requiredFeature bufsz:boundedBlockLength ;
+ lv2:requiredFeature bufsz:boundedBlockLength, synthpod:systemPorts ;
lv2:optionalFeature lv2:isLive, lv2:hardRTCapable ;
- lv2:extensionData sys:interface ;
lv2:port [
# event in
a lv2:InputPort ,
+ synthpod:MIDIPort ,
atom:AtomPort ;
atom:bufferType atom:Sequence ;
atom:supports midi:MidiEvent ;
@@ -89,6 +107,7 @@ synthpod:sink
] , [
# audio in 1
a lv2:InputPort ,
+ synthpod:AudioPort ,
lv2:AudioPort ;
lv2:index 1 ;
lv2:symbol "audio_sink_1" ;
@@ -98,6 +117,7 @@ synthpod:sink
] , [
# audio in 2
a lv2:InputPort ,
+ synthpod:AudioPort ,
lv2:AudioPort ;
lv2:index 2 ;
lv2:symbol "audio_sink_2" ;
@@ -107,6 +127,7 @@ synthpod:sink
] , [
# control in
a lv2:InputPort ,
+ synthpod:ControlPort ,
lv2:ControlPort ;
lv2:index 3 ;
lv2:symbol "control_sink_1" ;
@@ -114,6 +135,7 @@ synthpod:sink
pg:group synthpod:group_sink ;
] , [
a lv2:InputPort ,
+ synthpod:ControlPort ,
lv2:ControlPort ;
lv2:index 4 ;
lv2:symbol "control_sink_2" ;
@@ -121,6 +143,7 @@ synthpod:sink
pg:group synthpod:group_sink ;
] , [
a lv2:InputPort ,
+ synthpod:ControlPort ,
lv2:ControlPort ;
lv2:index 5 ;
lv2:symbol "control_sink_3" ;
@@ -128,6 +151,7 @@ synthpod:sink
pg:group synthpod:group_sink ;
] , [
a lv2:InputPort ,
+ synthpod:ControlPort ,
lv2:ControlPort ;
lv2:index 6 ;
lv2:symbol "control_sink_4" ;
@@ -142,13 +166,13 @@ synthpod:source
doap:name "Synthpod System Source" ;
doap:license lic:Artistic-2.0 ;
lv2:project proj:synthpod ;
- lv2:requiredFeature bufsz:boundedBlockLength ;
+ lv2:requiredFeature bufsz:boundedBlockLength, synthpod:systemPorts ;
lv2:optionalFeature lv2:isLive, lv2:hardRTCapable ;
- lv2:extensionData sys:interface ;
lv2:port [
# event in
a lv2:OutputPort ,
+ synthpod:MIDIPort ,
atom:AtomPort ;
atom:bufferType atom:Sequence ;
atom:supports midi:MidiEvent ;
@@ -163,6 +187,7 @@ synthpod:source
] , [
# audio in 1
a lv2:OutputPort ,
+ synthpod:AudioPort ,
lv2:AudioPort ;
lv2:index 1 ;
lv2:symbol "audio_source_1" ;
@@ -172,6 +197,7 @@ synthpod:source
] , [
# audio in 2
a lv2:OutputPort ,
+ synthpod:AudioPort ,
lv2:AudioPort ;
lv2:index 2 ;
lv2:symbol "audio_source_2" ;
@@ -181,6 +207,7 @@ synthpod:source
] , [
# control in
a lv2:OutputPort ,
+ synthpod:ControlPort ,
lv2:ControlPort ;
lv2:index 3 ;
lv2:symbol "control_source_1" ;
@@ -188,6 +215,7 @@ synthpod:source
pg:group synthpod:group_source ;
] , [
a lv2:OutputPort ,
+ synthpod:ControlPort ,
lv2:ControlPort ;
lv2:index 4 ;
lv2:symbol "control_source_2" ;
@@ -195,6 +223,7 @@ synthpod:source
pg:group synthpod:group_source ;
] , [
a lv2:OutputPort ,
+ synthpod:ControlPort ,
lv2:ControlPort ;
lv2:index 5 ;
lv2:symbol "control_source_3" ;
@@ -202,6 +231,7 @@ synthpod:source
pg:group synthpod:group_source ;
] , [
a lv2:OutputPort ,
+ synthpod:ControlPort ,
lv2:ControlPort ;
lv2:index 6 ;
lv2:symbol "control_source_4" ;
@@ -216,12 +246,12 @@ synthpod:midi_sink
doap:name "Synthpod MIDI Sink" ;
doap:license lic:Artistic-2.0 ;
lv2:project proj:synthpod ;
- lv2:requiredFeature bufsz:boundedBlockLength, sys:dynamicPorts ;
+ lv2:requiredFeature bufsz:boundedBlockLength, synthpod:systemPorts ;
lv2:optionalFeature lv2:isLive, lv2:hardRTCapable ;
- lv2:extensionData sys:interface ;
lv2:port [
a lv2:InputPort ,
+ synthpod:MIDIPort ,
atom:AtomPort ;
atom:bufferType atom:Sequence ;
atom:supports midi:MidiEvent ;
@@ -231,6 +261,7 @@ synthpod:midi_sink
lv2:designation lv2:control ;
pg:group synthpod:group_sink ;
] .
+
# MIDI Source Plugin
synthpod:midi_source
a lv2:Plugin ,
@@ -238,12 +269,12 @@ synthpod:midi_source
doap:name "Synthpod MIDI Source" ;
doap:license lic:Artistic-2.0 ;
lv2:project proj:synthpod ;
- lv2:requiredFeature bufsz:boundedBlockLength, sys:dynamicPorts ;
+ lv2:requiredFeature bufsz:boundedBlockLength, synthpod:systemPorts ;
lv2:optionalFeature lv2:isLive, lv2:hardRTCapable ;
- lv2:extensionData sys:interface ;
lv2:port [
a lv2:OutputPort ,
+ synthpod:MIDIPort ,
atom:AtomPort ;
atom:bufferType atom:Sequence ;
atom:supports midi:MidiEvent ;
@@ -261,12 +292,12 @@ synthpod:osc_sink
doap:name "Synthpod OSC Sink" ;
doap:license lic:Artistic-2.0 ;
lv2:project proj:synthpod ;
- lv2:requiredFeature bufsz:boundedBlockLength, sys:dynamicPorts ;
+ lv2:requiredFeature bufsz:boundedBlockLength, synthpod:systemPorts ;
lv2:optionalFeature lv2:isLive, lv2:hardRTCapable ;
- lv2:extensionData sys:interface ;
lv2:port [
a lv2:InputPort ,
+ synthpod:OSCPort ,
atom:AtomPort ;
atom:bufferType atom:Sequence ;
atom:supports atom:Object ;
@@ -276,6 +307,7 @@ synthpod:osc_sink
lv2:designation lv2:control ;
pg:group synthpod:group_sink ;
] .
+
# OSC Source Plugin
synthpod:osc_source
a lv2:Plugin ,
@@ -283,12 +315,12 @@ synthpod:osc_source
doap:name "Synthpod OSC Source" ;
doap:license lic:Artistic-2.0 ;
lv2:project proj:synthpod ;
- lv2:requiredFeature bufsz:boundedBlockLength, sys:dynamicPorts ;
+ lv2:requiredFeature bufsz:boundedBlockLength, synthpod:systemPorts ;
lv2:optionalFeature lv2:isLive, lv2:hardRTCapable ;
- lv2:extensionData sys:interface ;
lv2:port [
a lv2:OutputPort ,
+ synthpod:OSCPort ,
atom:AtomPort ;
atom:bufferType atom:Sequence ;
atom:supports atom:Object ;
@@ -306,12 +338,12 @@ synthpod:cv_sink
doap:name "Synthpod CV Sink" ;
doap:license lic:Artistic-2.0 ;
lv2:project proj:synthpod ;
- lv2:requiredFeature bufsz:boundedBlockLength, sys:dynamicPorts ;
+ lv2:requiredFeature bufsz:boundedBlockLength, synthpod:systemPorts ;
lv2:optionalFeature lv2:isLive, lv2:hardRTCapable ;
- lv2:extensionData sys:interface ;
lv2:port [
a lv2:InputPort ,
+ synthpod:CVPort ,
lv2:CVPort ;
lv2:index 0 ;
lv2:symbol "cv_sink_1" ;
@@ -319,6 +351,7 @@ synthpod:cv_sink
pg:group synthpod:group_sink ;
] , [
a lv2:InputPort ,
+ synthpod:CVPort ,
lv2:CVPort ;
lv2:index 1 ;
lv2:symbol "cv_sink_2" ;
@@ -326,6 +359,7 @@ synthpod:cv_sink
pg:group synthpod:group_sink ;
] , [
a lv2:InputPort ,
+ synthpod:CVPort ,
lv2:CVPort ;
lv2:index 2 ;
lv2:symbol "cv_sink_3" ;
@@ -333,12 +367,14 @@ synthpod:cv_sink
pg:group synthpod:group_sink ;
] , [
a lv2:InputPort ,
+ synthpod:CVPort ,
lv2:CVPort ;
lv2:index 3 ;
lv2:symbol "cv_sink_4" ;
lv2:name "CV Sink 4" ;
pg:group synthpod:group_sink ;
] .
+
# CV Source Plugin
synthpod:cv_source
a lv2:Plugin ,
@@ -346,12 +382,12 @@ synthpod:cv_source
doap:name "Synthpod CV Source" ;
doap:license lic:Artistic-2.0 ;
lv2:project proj:synthpod ;
- lv2:requiredFeature bufsz:boundedBlockLength, sys:dynamicPorts ;
+ lv2:requiredFeature bufsz:boundedBlockLength, synthpod:systemPorts ;
lv2:optionalFeature lv2:isLive, lv2:hardRTCapable ;
- lv2:extensionData sys:interface ;
lv2:port [
a lv2:OutputPort ,
+ synthpod:CVPort ,
lv2:CVPort ;
lv2:index 0 ;
lv2:symbol "cv_source_1" ;
@@ -359,6 +395,7 @@ synthpod:cv_source
pg:group synthpod:group_source ;
] , [
a lv2:OutputPort ,
+ synthpod:CVPort ,
lv2:CVPort ;
lv2:index 1 ;
lv2:symbol "cv_source_2" ;
@@ -366,6 +403,7 @@ synthpod:cv_source
pg:group synthpod:group_source ;
] , [
a lv2:OutputPort ,
+ synthpod:CVPort ,
lv2:CVPort ;
lv2:index 2 ;
lv2:symbol "cv_source_3" ;
@@ -373,6 +411,7 @@ synthpod:cv_source
pg:group synthpod:group_source ;
] , [
a lv2:OutputPort ,
+ synthpod:CVPort ,
lv2:CVPort ;
lv2:index 3 ;
lv2:symbol "cv_source_4" ;
@@ -387,12 +426,12 @@ synthpod:audio_sink
doap:name "Synthpod Audio Sink" ;
doap:license lic:Artistic-2.0 ;
lv2:project proj:synthpod ;
- lv2:requiredFeature bufsz:boundedBlockLength, sys:dynamicPorts ;
+ lv2:requiredFeature bufsz:boundedBlockLength, synthpod:systemPorts ;
lv2:optionalFeature lv2:isLive, lv2:hardRTCapable ;
- lv2:extensionData sys:interface ;
lv2:port [
a lv2:InputPort ,
+ synthpod:AudioPort ,
lv2:AudioPort ;
lv2:index 0 ;
lv2:symbol "audio_sink_1" ;
@@ -400,6 +439,7 @@ synthpod:audio_sink
pg:group synthpod:group_sink ;
] , [
a lv2:InputPort ,
+ synthpod:AudioPort ,
lv2:AudioPort ;
lv2:index 1 ;
lv2:symbol "audio_sink_2" ;
@@ -407,6 +447,7 @@ synthpod:audio_sink
pg:group synthpod:group_sink ;
] , [
a lv2:InputPort ,
+ synthpod:AudioPort ,
lv2:AudioPort ;
lv2:index 2 ;
lv2:symbol "audio_sink_3" ;
@@ -414,12 +455,14 @@ synthpod:audio_sink
pg:group synthpod:group_sink ;
] , [
a lv2:InputPort ,
+ synthpod:AudioPort ,
lv2:AudioPort ;
lv2:index 3 ;
lv2:symbol "audio_sink_4" ;
lv2:name "Audio Sink 4" ;
pg:group synthpod:group_sink ;
] .
+
# AudioSource Plugin
synthpod:audio_source
a lv2:Plugin ,
@@ -427,12 +470,12 @@ synthpod:audio_source
doap:name "Synthpod Audio Source" ;
doap:license lic:Artistic-2.0 ;
lv2:project proj:synthpod ;
- lv2:requiredFeature bufsz:boundedBlockLength, sys:dynamicPorts ;
+ lv2:requiredFeature bufsz:boundedBlockLength, synthpod:systemPorts ;
lv2:optionalFeature lv2:isLive, lv2:hardRTCapable ;
- lv2:extensionData sys:interface ;
lv2:port [
a lv2:OutputPort ,
+ synthpod:AudioPort ,
lv2:AudioPort ;
lv2:index 0 ;
lv2:symbol "audio_source_1" ;
@@ -440,6 +483,7 @@ synthpod:audio_source
pg:group synthpod:group_source ;
] , [
a lv2:OutputPort ,
+ synthpod:AudioPort ,
lv2:AudioPort ;
lv2:index 1 ;
lv2:symbol "audio_source_2" ;
@@ -447,6 +491,7 @@ synthpod:audio_source
pg:group synthpod:group_source ;
] , [
a lv2:OutputPort ,
+ synthpod:AudioPort ,
lv2:AudioPort ;
lv2:index 2 ;
lv2:symbol "audio_source_3" ;
@@ -454,6 +499,7 @@ synthpod:audio_source
pg:group synthpod:group_source ;
] , [
a lv2:OutputPort ,
+ synthpod:AudioPort ,
lv2:AudioPort ;
lv2:index 3 ;
lv2:symbol "audio_source_4" ;
diff --git a/bundle/synthpod_cv_sink.c b/bundle/synthpod_cv_sink.c
deleted file mode 100644
index ad5b0c66..00000000
--- a/bundle/synthpod_cv_sink.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * 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 [4];
-};
-
-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;
-
- if(port < 4)
- handle->cv_in[port] = (float *)data;
-}
-
-static System_Port_Type
-query(LV2_Handle instance, uint32_t port)
-{
- if(port < 4)
- return SYSTEM_PORT_CV;
-
- return SYSTEM_PORT_NONE;
-}
-
-static void
-run(LV2_Handle instance, uint32_t nsamples)
-{
- // 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 = NULL,
- .run = run,
- .deactivate = NULL,
- .cleanup = cleanup,
- .extension_data = extension_data
-};
diff --git a/bundle/synthpod_cv_source.c b/bundle/synthpod_cv_source.c
deleted file mode 100644
index 7360ad36..00000000
--- a/bundle/synthpod_cv_source.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * 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 [4];
-};
-
-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;
-
- if(port < 4)
- handle->cv_out[port] = (const float *)data;
-}
-
-static System_Port_Type
-query(LV2_Handle instance, uint32_t port)
-{
- if(port < 4)
- return SYSTEM_PORT_CV;
-
- return SYSTEM_PORT_NONE;
-}
-
-static void
-run(LV2_Handle instance, uint32_t nsamples)
-{
- // 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 = NULL,
- .run = run,
- .deactivate = NULL,
- .cleanup = cleanup,
- .extension_data = extension_data
-};
diff --git a/bundle/synthpod_midi_sink.c b/bundle/synthpod_midi_sink.c
deleted file mode 100644
index d85a0727..00000000
--- a/bundle/synthpod_midi_sink.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * 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 [1];
-};
-
-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;
-
- if(port < 1)
- handle->event_in[port] = (LV2_Atom_Sequence *)data;
-}
-
-static System_Port_Type
-query(LV2_Handle instance, uint32_t port)
-{
- if(port < 1)
- return SYSTEM_PORT_MIDI;
-
- return SYSTEM_PORT_NONE;
-}
-
-static void
-run(LV2_Handle instance, uint32_t nsamples)
-{
- // 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 = NULL,
- .run = run,
- .deactivate = NULL,
- .cleanup = cleanup,
- .extension_data = extension_data
-};
diff --git a/bundle/synthpod_midi_source.c b/bundle/synthpod_midi_source.c
deleted file mode 100644
index b4ead45b..00000000
--- a/bundle/synthpod_midi_source.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * 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 [1];
-};
-
-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;
-
- if(port < 1)
- handle->event_out[port] = (const LV2_Atom_Sequence *)data;
-}
-
-static System_Port_Type
-query(LV2_Handle instance, uint32_t port)
-{
- if(port < 1)
- return SYSTEM_PORT_MIDI;
-
- return SYSTEM_PORT_NONE;
-}
-
-static void
-run(LV2_Handle instance, uint32_t nsamples)
-{
- // 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 = NULL,
- .run = run,
- .deactivate = NULL,
- .cleanup = cleanup,
- .extension_data = extension_data
-};
diff --git a/bundle/synthpod_osc_sink.c b/bundle/synthpod_osc_sink.c
deleted file mode 100644
index 80b38c3e..00000000
--- a/bundle/synthpod_osc_sink.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * 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 [1];
-};
-
-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;
-
- if(port < 1)
- handle->event_in[port] = (LV2_Atom_Sequence *)data;
-}
-
-static System_Port_Type
-query(LV2_Handle instance, uint32_t port)
-{
- if(port < 1)
- return SYSTEM_PORT_OSC;
-
- return SYSTEM_PORT_NONE;
-}
-
-static void
-run(LV2_Handle instance, uint32_t nsamples)
-{
- // 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 = NULL,
- .run = run,
- .deactivate = NULL,
- .cleanup = cleanup,
- .extension_data = extension_data
-};
diff --git a/bundle/synthpod_osc_source.c b/bundle/synthpod_osc_source.c
deleted file mode 100644
index 7cfea15d..00000000
--- a/bundle/synthpod_osc_source.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * 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 [1];
-};
-
-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;
-
- if(port < 1)
- handle->event_out[port] = (const LV2_Atom_Sequence *)data;
-}
-
-static System_Port_Type
-query(LV2_Handle instance, uint32_t port)
-{
- if(port < 1)
- return SYSTEM_PORT_OSC;
-
- return SYSTEM_PORT_NONE;
-}
-
-static void
-run(LV2_Handle instance, uint32_t nsamples)
-{
- // 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 = NULL,
- .run = run,
- .deactivate = NULL,
- .cleanup = cleanup,
- .extension_data = extension_data
-};
diff --git a/bundle/synthpod_sink.c b/bundle/synthpod_sink.c
deleted file mode 100644
index 9766674a..00000000
--- a/bundle/synthpod_sink.c
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * 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;
- float *audio_in[2];
- float *input[4];
-};
-
-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;
-
- case 1:
- handle->audio_in[0] = (float *)data;
- break;
- case 2:
- handle->audio_in[1] = (float *)data;
- break;
-
- case 3:
- handle->input[0] = (float *)data;
- break;
- case 4:
- handle->input[1] = (float *)data;
- break;
- case 5:
- handle->input[2] = (float *)data;
- break;
- case 6:
- handle->input[3] = (float *)data;
- break;
-
- default:
- break;
- }
-}
-
-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
-run(LV2_Handle instance, uint32_t nsamples)
-{
- // 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_sink = {
- .URI = SYNTHPOD_SINK_URI,
- .instantiate = instantiate,
- .connect_port = connect_port,
- .activate = NULL,
- .run = run,
- .deactivate = NULL,
- .cleanup = cleanup,
- .extension_data = extension_data
-};
diff --git a/bundle/synthpod_source.c b/bundle/synthpod_source.c
deleted file mode 100644
index b9a6db54..00000000
--- a/bundle/synthpod_source.c
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * 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;
- const float *audio_out[2];
- const float *output[4];
-};
-
-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;
-
- case 1:
- handle->audio_out[0] = (const float *)data;
- break;
- case 2:
- handle->audio_out[1] = (const float *)data;
- break;
-
- case 3:
- handle->output[0] = (const float *)data;
- break;
- case 4:
- handle->output[1] = (const float *)data;
- break;
- case 5:
- handle->output[2] = (const float *)data;
- break;
- case 6:
- handle->output[3] = (const float *)data;
- break;
-
- default:
- break;
- }
-}
-
-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
-run(LV2_Handle instance, uint32_t nsamples)
-{
- // 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_source = {
- .URI = SYNTHPOD_SOURCE_URI,
- .instantiate = instantiate,
- .connect_port = connect_port,
- .activate = NULL,
- .run = run,
- .deactivate = NULL,
- .cleanup = cleanup,
- .extension_data = extension_data
-};
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index 5b0084e3..2ff38424 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -2,7 +2,6 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${PROJECT_SOURCE_DIR}/eo_ui.lv2)
include_directories(${PROJECT_SOURCE_DIR}/zero_worker.lv2)
include_directories(${PROJECT_SOURCE_DIR}/zero_writer.lv2)
-include_directories(${PROJECT_SOURCE_DIR}/system_port.lv2)
include_directories(${PROJECT_SOURCE_DIR}/osc.lv2)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/cjson)
diff --git a/lib/synthpod_app.c b/lib/synthpod_app.c
index 21b09ae3..94b86d45 100644
--- a/lib/synthpod_app.c
+++ b/lib/synthpod_app.c
@@ -116,9 +116,7 @@ struct _mod_t {
} zero;
// system_port
- struct {
- const System_Port_Interface *iface;
- } sys;
+ bool system_ports;
// log
LV2_Log_Log log;
@@ -196,7 +194,7 @@ struct _port_t {
// system_port iface
struct {
- System_Port_Type type;
+ system_port_t type;
void *data;
} sys;
};
@@ -365,7 +363,7 @@ _sp_app_update_system_sources(sp_app_t *app)
{
mod_t *mod = app->mods[m];
- if(!mod->sys.iface) // has system ports?
+ if(!mod->system_ports) // has system ports?
continue; // skip
for(unsigned p=0; p<mod->num_ports; p++)
@@ -401,7 +399,7 @@ _sp_app_update_system_sinks(sp_app_t *app)
{
mod_t *mod = app->mods[m];
- if(!mod->sys.iface) // has system ports?
+ if(!mod->system_ports) // has system ports?
continue;
for(unsigned p=0; p<mod->num_ports; p++)
@@ -717,7 +715,7 @@ _sp_app_mod_add(sp_app_t *app, const char *uri, u_id_t uid)
if(app->driver->system_port_add && app->driver->system_port_del)
{
- mod->feature_list[nfeatures].URI = SYSTEM_PORT__dynamicPorts;
+ mod->feature_list[nfeatures].URI = SYNTHPOD_PREFIX"systemPorts";
mod->feature_list[nfeatures++].data = NULL;
}
@@ -781,8 +779,7 @@ _sp_app_mod_add(sp_app_t *app, const char *uri, u_id_t uid)
ZERO_WORKER__interface);
mod->opts.iface = lilv_instance_get_extension_data(mod->inst,
LV2_OPTIONS__interface);
- mod->sys.iface = lilv_instance_get_extension_data(mod->inst,
- SYSTEM_PORT__interface);
+ mod->system_ports = lilv_plugin_has_feature(plug, app->regs.synthpod.system_ports.node);
// clear pool sizes
for(port_type_t pool=0; pool<PORT_TYPE_NUM; pool++)
@@ -805,9 +802,20 @@ _sp_app_mod_add(sp_app_t *app, const char *uri, u_id_t uid)
: PORT_DIRECTION_OUTPUT;
// register system ports
- if(mod->sys.iface)
- {
- tar->sys.type = mod->sys.iface->query(mod->inst, i);
+ if(mod->system_ports)
+ {
+ if(lilv_port_is_a(plug, port, app->regs.synthpod.control_port.node))
+ tar->sys.type = SYSTEM_PORT_CONTROL;
+ else if(lilv_port_is_a(plug, port, app->regs.synthpod.audio_port.node))
+ tar->sys.type = SYSTEM_PORT_AUDIO;
+ else if(lilv_port_is_a(plug, port, app->regs.synthpod.cv_port.node))
+ tar->sys.type = SYSTEM_PORT_CV;
+ else if(lilv_port_is_a(plug, port, app->regs.synthpod.midi_port.node))
+ tar->sys.type = SYSTEM_PORT_MIDI;
+ else if(lilv_port_is_a(plug, port, app->regs.synthpod.osc_port.node))
+ tar->sys.type = SYSTEM_PORT_OSC;
+ else
+ tar->sys.type = SYSTEM_PORT_NONE;
if(app->driver->system_port_add)
{
@@ -2620,7 +2628,7 @@ sp_app_run_post(sp_app_t *app, uint32_t nsamples)
if( (port->type == PORT_TYPE_ATOM)
&& (port->buffer_type == PORT_BUFFER_TYPE_SEQUENCE)
&& (port->direction == PORT_DIRECTION_OUTPUT)
- && (!mod->sys.iface) ) // don't overwrite source buffer events
+ && (!mod->system_ports) ) // don't overwrite source buffer events
{
LV2_Atom_Sequence *seq = PORT_BUF_ALIGNED(port);
seq->atom.type = app->regs.port.sequence.urid;
diff --git a/lib/synthpod_app.h b/lib/synthpod_app.h
index 2f5e1696..afd09124 100644
--- a/lib/synthpod_app.h
+++ b/lib/synthpod_app.h
@@ -31,9 +31,10 @@
#include <lilv/lilv.h>
#include <synthpod_common.h>
-#include <system_port.h>
#include <lv2_osc.h>
+typedef enum _system_port_t system_port_t;
+
typedef struct _sp_app_t sp_app_t;
typedef struct _sp_app_system_source_t sp_app_system_source_t;
typedef struct _sp_app_system_sink_t sp_app_system_sink_t;
@@ -45,18 +46,27 @@ typedef void (*sp_to_advance_t)(size_t size, void *data);
typedef int (*sp_printf)(void *data, LV2_URID type, const char *fmt, ...);
typedef int (*sp_vprintf)(void *data, LV2_URID type, const char *fmt, va_list args);
-typedef void *(*sp_system_port_add)(void *data, System_Port_Type type,
+typedef void *(*sp_system_port_add)(void *data, system_port_t type,
const char *short_name, const char *pretty_name, int input);
typedef void (*sp_system_port_del)(void *data, void *sys_port);
+enum _system_port_t {
+ SYSTEM_PORT_NONE = 0,
+ SYSTEM_PORT_CONTROL,
+ SYSTEM_PORT_AUDIO,
+ SYSTEM_PORT_CV,
+ SYSTEM_PORT_MIDI,
+ SYSTEM_PORT_OSC
+};
+
struct _sp_app_system_source_t {
- System_Port_Type type;
+ system_port_t type;
void *sys_port;
void *buf;
};
struct _sp_app_system_sink_t {
- System_Port_Type type;
+ system_port_t type;
void *sys_port;
const void *buf;
};
diff --git a/lib/synthpod_private.h b/lib/synthpod_private.h
index 43233aa1..824f18ef 100644
--- a/lib/synthpod_private.h
+++ b/lib/synthpod_private.h
@@ -252,6 +252,13 @@ struct _reg_t {
reg_item_t port_selected;
reg_item_t bundle_load;
reg_item_t bundle_save;
+
+ reg_item_t system_ports;
+ reg_item_t control_port;
+ reg_item_t audio_port;
+ reg_item_t cv_port;
+ reg_item_t midi_port;
+ reg_item_t osc_port;
} synthpod;
};
@@ -394,6 +401,13 @@ sp_regs_init(reg_t *regs, LilvWorld *world, LV2_URID_Map *map)
_register(&regs->synthpod.port_selected, world, map, SYNTHPOD_PREFIX"portSelect");
_register(&regs->synthpod.bundle_load, world, map, SYNTHPOD_PREFIX"bundleLoad");
_register(&regs->synthpod.bundle_save, world, map, SYNTHPOD_PREFIX"bundleSave");
+
+ _register(&regs->synthpod.system_ports, world, map, SYNTHPOD_PREFIX"systemPorts");
+ _register(&regs->synthpod.control_port, world, map, SYNTHPOD_PREFIX"ControlPort");
+ _register(&regs->synthpod.audio_port, world, map, SYNTHPOD_PREFIX"AudioPort");
+ _register(&regs->synthpod.cv_port, world, map, SYNTHPOD_PREFIX"CVPort");
+ _register(&regs->synthpod.midi_port, world, map, SYNTHPOD_PREFIX"MIDIPort");
+ _register(&regs->synthpod.osc_port, world, map, SYNTHPOD_PREFIX"OSCPort");
}
static inline void
@@ -521,6 +535,13 @@ sp_regs_deinit(reg_t *regs)
_unregister(&regs->synthpod.port_selected);
_unregister(&regs->synthpod.bundle_load);
_unregister(&regs->synthpod.bundle_save);
+
+ _unregister(&regs->synthpod.system_ports);
+ _unregister(&regs->synthpod.control_port);
+ _unregister(&regs->synthpod.audio_port);
+ _unregister(&regs->synthpod.cv_port);
+ _unregister(&regs->synthpod.midi_port);
+ _unregister(&regs->synthpod.osc_port);
}
#define _ATOM_ALIGNED __attribute__((aligned(8)))
diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt
index 8734ac38..9ba08160 100644
--- a/plugins/CMakeLists.txt
+++ b/plugins/CMakeLists.txt
@@ -3,7 +3,6 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../bin)
include_directories(${PROJECT_SOURCE_DIR}/eo_ui.lv2)
include_directories(${PROJECT_SOURCE_DIR}/zero_worker.lv2)
include_directories(${PROJECT_SOURCE_DIR}/zero_writer.lv2)
-include_directories(${PROJECT_SOURCE_DIR}/system_port.lv2)
include_directories(${PROJECT_SOURCE_DIR}/osc.lv2)
include_directories(${PROJECT_SOURCE_DIR}/lib) # synthpod_app.h, synthpod_ui.h
diff --git a/system_port.lv2/system_port.h b/system_port.lv2/system_port.h
deleted file mode 100644
index 191c1c4a..00000000
--- a/system_port.lv2/system_port.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef SYSTEM_PORT_H
-#define SYSTEM_PORT_H
-
-#include <stdint.h>
-
-#include "lv2/lv2plug.in/ns/lv2core/lv2.h"
-
-#define SYSTEM_PORT_URI "http://open-music-kontrollers.ch/lv2/system-port"
-#define SYSTEM_PORT_PREFIX SYSTEM_PORT_URI "#"
-
-#define SYSTEM_PORT__interface SYSTEM_PORT_PREFIX "interface"
-#define SYSTEM_PORT__dynamicPorts SYSTEM_PORT_PREFIX "dynamicPorts"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef enum _System_Port_Type {
- SYSTEM_PORT_NONE,
-
- SYSTEM_PORT_CONTROL,
-
- SYSTEM_PORT_AUDIO,
- SYSTEM_PORT_CV,
-
- SYSTEM_PORT_MIDI,
- SYSTEM_PORT_OSC
-} System_Port_Type;
-
-// instantiation thread
-typedef System_Port_Type
-(*System_Port_Query_Function)(LV2_Handle instance, uint32_t port);
-
-typedef struct _System_Port_Interface {
- System_Port_Query_Function query;
-} System_Port_Interface;
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#endif /* SYSTEM_PORT_H */