diff options
Diffstat (limited to 'libs/ardour/lua_api.cc')
-rw-r--r-- | libs/ardour/lua_api.cc | 20 |
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) { |