summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/lv2_plugin.h
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-03-13 23:20:45 +0100
committerRobin Gareus <robin@gareus.org>2016-03-14 00:17:14 +0100
commit58469214befaa714c856790b78da58c4593b2b54 (patch)
treeea1bde9d92a9ef964072d3801d4c16a555c3bd9a /libs/ardour/ardour/lv2_plugin.h
parent5fa4cf996bc9aad51d97a825f07cc23397437024 (diff)
prototype online self-automating LV2 plugin interface
goes along with https://github.com/x42/automate.lv2
Diffstat (limited to 'libs/ardour/ardour/lv2_plugin.h')
-rw-r--r--libs/ardour/ardour/lv2_plugin.h29
1 files changed, 28 insertions, 1 deletions
diff --git a/libs/ardour/ardour/lv2_plugin.h b/libs/ardour/ardour/lv2_plugin.h
index a4cdfcd036..aacef82e5b 100644
--- a/libs/ardour/ardour/lv2_plugin.h
+++ b/libs/ardour/ardour/lv2_plugin.h
@@ -30,6 +30,10 @@
#include "ardour/worker.h"
#include "pbd/ringbuffer.h"
+#ifdef LV2_EXTENDED // -> needs to eventually go upstream to lv2plug.in
+#include "ardour/lv2_extensions.h"
+#endif
+
#ifndef PATH_MAX
#define PATH_MAX 1024
#endif
@@ -91,6 +95,7 @@ class LIBARDOUR_API LV2Plugin : public ARDOUR::Plugin, public ARDOUR::Workee
const LV2_Feature* const* features () { return _features; }
std::set<Evoral::Parameter> automatable () const;
+ virtual void set_automation_control (uint32_t, boost::shared_ptr<AutomationControl>);
void activate ();
void deactivate ();
@@ -182,6 +187,7 @@ class LIBARDOUR_API LV2Plugin : public ARDOUR::Plugin, public ARDOUR::Workee
uint32_t _patch_port_out_index;
URIMap& _uri_map;
bool _no_sample_accurate_ctrl;
+ bool _can_write_automation;
friend const void* lv2plugin_get_port_value(const char* port_symbol,
void* user_data,
@@ -197,7 +203,9 @@ class LIBARDOUR_API LV2Plugin : public ARDOUR::Plugin, public ARDOUR::Workee
PORT_SEQUENCE = 1 << 5, ///< New atom API event port
PORT_MIDI = 1 << 6, ///< Event port understands MIDI
PORT_POSITION = 1 << 7, ///< Event port understands position
- PORT_PATCHMSG = 1 << 8 ///< Event port supports patch:Message
+ 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)
} PortFlag;
typedef unsigned PortFlags;
@@ -208,6 +216,25 @@ class LIBARDOUR_API LV2Plugin : public ARDOUR::Plugin, public ARDOUR::Workee
PropertyDescriptors _property_descriptors;
+ struct AutomationCtrl {
+ AutomationCtrl (const AutomationCtrl &other)
+ : ac (other.ac)
+ , guard (other.guard)
+ { }
+
+ AutomationCtrl (boost::shared_ptr<ARDOUR::AutomationControl> c)
+ : ac (c)
+ , guard (false)
+ { }
+ boost::shared_ptr<ARDOUR::AutomationControl> ac;
+ bool guard;
+ };
+
+ typedef boost::shared_ptr<AutomationCtrl> AutomationCtrlPtr;
+ typedef std::map<uint32_t, AutomationCtrlPtr> AutomationCtrlMap;
+ AutomationCtrlMap _ctrl_map;
+ AutomationCtrlPtr get_automation_control (uint32_t);
+
/// Message send to/from UI via ports
struct UIMessage {
uint32_t index;