summaryrefslogtreecommitdiff
path: root/libs/ardour/lua_api.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-09-16 22:35:27 +0200
committerRobin Gareus <robin@gareus.org>2016-09-16 22:35:27 +0200
commit140c4bb1158bab6b5fc1cfd894d5a17d87c34fd4 (patch)
tree5ad38f8ec110b0a97ae3a372c7b5505139e3bc62 /libs/ardour/lua_api.cc
parent2b8979647b7989b127e0004c2e75cc999d42166d (diff)
re-do previous commit
* do not include _by_name() API. Port names are locale dependent * proper whitespace (after comma, before bracket) and styleguide
Diffstat (limited to 'libs/ardour/lua_api.cc')
-rw-r--r--libs/ardour/lua_api.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/libs/ardour/lua_api.cc b/libs/ardour/lua_api.cc
index 1cf403b8b0..13de1df2ea 100644
--- a/libs/ardour/lua_api.cc
+++ b/libs/ardour/lua_api.cc
@@ -176,6 +176,17 @@ ARDOUR::LuaAPI::set_plugin_insert_param (boost::shared_ptr<PluginInsert> pi, uin
return true;
}
+float
+ARDOUR::LuaAPI::get_plugin_insert_param (boost::shared_ptr<PluginInsert> pi, uint32_t which, bool &ok)
+{
+ ok=false;
+ boost::shared_ptr<Plugin> plugin = pi->plugin();
+ if (!plugin) { return 0; }
+ uint32_t controlid = plugin->nth_parameter (which, ok);
+ if (!ok) { return 0; }
+ return plugin->get_parameter ( controlid );
+}
+
bool
ARDOUR::LuaAPI::set_processor_param (boost::shared_ptr<Processor> proc, uint32_t which, float val)
{
@@ -184,6 +195,15 @@ ARDOUR::LuaAPI::set_processor_param (boost::shared_ptr<Processor> proc, uint32_t
return set_plugin_insert_param (pi, which, val);
}
+float
+ARDOUR::LuaAPI::get_processor_param (boost::shared_ptr<Processor> proc, uint32_t which, bool &ok)
+{
+ ok=false;
+ boost::shared_ptr<PluginInsert> pi = boost::dynamic_pointer_cast<PluginInsert> (proc);
+ if (!pi) { return false; }
+ return get_plugin_insert_param (pi, which, ok);
+}
+
int
ARDOUR::LuaAPI::plugin_automation (lua_State *L)
{