summaryrefslogtreecommitdiff
path: root/libs/ardour
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-06-05 14:45:24 +0200
committerRobin Gareus <robin@gareus.org>2016-06-05 14:45:24 +0200
commit6e42d7b99e4c0472584d3787baddc357a4116038 (patch)
tree2731064677377b36f1cbd833defc0426badf8b71 /libs/ardour
parent37b90c2a9eecbb97e4bbe16634272849be6b4e9f (diff)
prepare for LV2 non-automatable control ports
Diffstat (limited to 'libs/ardour')
-rw-r--r--libs/ardour/ardour/lv2_plugin.h3
-rw-r--r--libs/ardour/lv2_plugin.cc20
2 files changed, 22 insertions, 1 deletions
diff --git a/libs/ardour/ardour/lv2_plugin.h b/libs/ardour/ardour/lv2_plugin.h
index 6552e40ac3..54a1611cb6 100644
--- a/libs/ardour/ardour/lv2_plugin.h
+++ b/libs/ardour/ardour/lv2_plugin.h
@@ -211,7 +211,8 @@ class LIBARDOUR_API LV2Plugin : public ARDOUR::Plugin, public ARDOUR::Workee
PORT_PATCHMSG = 1 << 8, ///< Event port supports patch:Message
PORT_AUTOCTRL = 1 << 9, ///< Event port supports auto:AutomationControl
PORT_CTRLED = 1 << 10, ///< Port prop auto:AutomationControlled (can be self controlled)
- PORT_CTRLER = 1 << 11 ///< Port prop auto:AutomationController (can be self set)
+ PORT_CTRLER = 1 << 11, ///< Port prop auto:AutomationController (can be self set)
+ PORT_NOAUTO = 1 << 12 ///< Port don't allow to automate
} PortFlag;
typedef unsigned PortFlags;
diff --git a/libs/ardour/lv2_plugin.cc b/libs/ardour/lv2_plugin.cc
index 1244d29366..fe69546e3a 100644
--- a/libs/ardour/lv2_plugin.cc
+++ b/libs/ardour/lv2_plugin.cc
@@ -126,6 +126,9 @@ public:
LilvNode* ev_EventPort;
LilvNode* ext_logarithmic;
LilvNode* ext_notOnGUI;
+ LilvNode* ext_expensive;
+ LilvNode* ext_causesArtifacts;
+ LilvNode* ext_notAutomatic;
LilvNode* lv2_AudioPort;
LilvNode* lv2_ControlPort;
LilvNode* lv2_InputPort;
@@ -634,6 +637,17 @@ LV2Plugin::init(const void* c_plugin, framecnt_t rate)
throw failed_constructor();
}
+ if ((flags & PORT_INPUT) && (flags & PORT_CONTROL)) {
+ if (lilv_port_has_property(_impl->plugin, port, _world.ext_causesArtifacts)) {
+ flags |= PORT_NOAUTO;
+ }
+ if (lilv_port_has_property(_impl->plugin, port, _world.ext_notAutomatic)) {
+ flags |= PORT_NOAUTO;
+ }
+ if (lilv_port_has_property(_impl->plugin, port, _world.ext_expensive)) {
+ flags |= PORT_NOAUTO;
+ }
+ }
#ifdef LV2_EXTENDED
if (lilv_port_has_property(_impl->plugin, port, _world.auto_automation_controlled)) {
if ((flags & PORT_INPUT) && (flags & PORT_CONTROL)) {
@@ -2800,6 +2814,9 @@ LV2World::LV2World()
ev_EventPort = lilv_new_uri(world, LILV_URI_EVENT_PORT);
ext_logarithmic = lilv_new_uri(world, LV2_PORT_PROPS__logarithmic);
ext_notOnGUI = lilv_new_uri(world, LV2_PORT_PROPS__notOnGUI);
+ ext_expensive = lilv_new_uri(world, LV2_PORT_PROPS__expensive);
+ ext_causesArtifacts= lilv_new_uri(world, LV2_PORT_PROPS__causesArtifacts);
+ ext_notAutomatic = lilv_new_uri(world, LV2_PORT_PROPS__notAutomatic);
lv2_AudioPort = lilv_new_uri(world, LILV_URI_AUDIO_PORT);
lv2_ControlPort = lilv_new_uri(world, LILV_URI_CONTROL_PORT);
lv2_InputPort = lilv_new_uri(world, LILV_URI_INPUT_PORT);
@@ -2891,6 +2908,9 @@ LV2World::~LV2World()
lilv_node_free(lv2_InputPort);
lilv_node_free(lv2_ControlPort);
lilv_node_free(lv2_AudioPort);
+ lilv_node_free(ext_notAutomatic);
+ lilv_node_free(ext_causesArtifacts);
+ lilv_node_free(ext_expensive);
lilv_node_free(ext_notOnGUI);
lilv_node_free(ext_logarithmic);
lilv_node_free(ev_EventPort);