rearrange inheritance so that Automatable IS-A Slavable
[ardour.git] / libs / ardour / ardour / lua_api.h
index d93b73373dae3e4861550f01e96ab0eaea53544c..e3cf7bb30f545ed6d1d92863f8dc293dad7110e5 100644 (file)
 
 namespace ARDOUR { namespace LuaAPI {
 
-       /** convenience contructor for DataType::NIL
+       /** convenience constructor for DataType::NIL with managed lifetime
         * @returns DataType::NIL
         */
        int datatype_ctor_null (lua_State *lua);
-       /** convenience contructor for DataType::AUDIO
+       /** convenience constructor for DataType::AUDIO with managed lifetime
         * @returns DataType::AUDIO
         */
        int datatype_ctor_audio (lua_State *L);
-       /** convenience contructor for DataType::MIDI
+       /** convenience constructor for DataType::MIDI with managed lifetime
         * @returns DataType::MIDI
         */
        int datatype_ctor_midi (lua_State *L);
@@ -93,6 +93,31 @@ namespace ARDOUR { namespace LuaAPI {
         */
        bool set_plugin_insert_param (boost::shared_ptr<ARDOUR::PluginInsert> pi, uint32_t which, float val);
 
+       /**
+        * A convenience function to get a Automation Lists and ParamaterDescriptor
+        * for a given plugin control.
+        *
+        * This is equivalent to the following lua code
+        * @code
+        * function (processor, param_id)
+        *  local plugininsert = processor:to_insert ()
+        *  local plugin = plugininsert:plugin(0)
+        *  local _, t = plugin:get_parameter_descriptor(param_id, ARDOUR.ParameterDescriptor ())
+        *  local ctrl = Evoral.Parameter (ARDOUR.AutomationType.PluginAutomation, 0, param_id)
+        *  local ac = pi:automation_control (ctrl, false)
+        *  local acl = ac:alist()
+        *  return ac:alist(), ac:to_ctrl():list(), t[2]
+        * end
+        * @endcode
+        *
+        * Example usage: get the third input parameter of first plugin on the given route
+        * (Ardour starts counting at zero).
+        * @code
+        * local al, cl, pd = ARDOUR.LuaAPI.plugin_automation (route:nth_plugin (0), 3)
+        * @endcode
+        * @returns 3 parameters: AutomationList, ControlList, ParamaterDescriptor
+        */
+       int plugin_automation (lua_State *lua);
 } } /* namespace */
 
 namespace ARDOUR { namespace LuaOSC {