X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=_manual%2F24_lua-scripting%2F02_class_reference.html;h=0cde811307e3f3f5e2602011f8c4f3a2755ba1a8;hb=9bca305233a422a852d093538be53ce3ad50d308;hp=b3e99b3219052b5ea6619644a4b3b4d8e0487007;hpb=b42aa241c9832121e112d2255f5d141f340e05e1;p=ardour-manual
diff --git a/_manual/24_lua-scripting/02_class_reference.html b/_manual/24_lua-scripting/02_class_reference.html
index b3e99b3..0cde811 100644
--- a/_manual/24_lua-scripting/02_class_reference.html
+++ b/_manual/24_lua-scripting/02_class_reference.html
@@ -37,6 +37,12 @@ Operations are performed on objects. One gets a reference to an object and then
e.g obj = Session:route_by_name("Audio") obj:set_name("Guitar")
.
+Lua automatically follows C++ class inheritance. e.g one can directly call all SessionObject and Route methods on Track object. However lua does not automatically promote objects. A Route object which just happens to be a Track needs to be explicily cast to a Track. Methods for casts are provided with each class. Note that the cast may fail and return a nil reference. +
++Likewise multiple inheritance is a non-trivial issue in lua. To avoid performance penalties involved with lookups, explicit casts are required in this case. One example is ARDOUR:SessionObject which is-a StatefulDestructible which inhertis from both Stateful and Destructible. +
+Object lifetimes are managed by the Session. Most Objects cannot be directly created, but one asks the Session to create or destroy them. This is mainly due to realtime constrains: you cannot simply remove a track that is currently processing audio. There are various factory methods for object creation or removal.
@@ -138,11 +144,20 @@ Pointer Classes cannot be created in lua scripts. It always requires a call to CMethods | ||
---|---|---|
std::string | name () | |
Cast | ||
Stateful | to_stateful () | |
StatefulDestructible | to_statefuldestructible () |
C‡: boost::shared_ptr< ARDOUR::AudioBackend >, boost::weak_ptr< ARDOUR::AudioBackend >
@@ -313,6 +328,7 @@ Pointer Classes cannot be created in lua scripts. It always requires a call to Cthe signal processorat at end of the processing chain which produces output
Methods | ||
---|---|---|
std::string | name () | |
Cast | ||
Stateful | to_stateful () | |
StatefulDestructible | to_statefuldestructible () |
Methods | ||
---|---|---|
void | clear_changes () | |
Forget about any changes to this object's properties | ||
OwnedPropertyList | properties () |
C‡: std::list<boost::shared_ptr<ARDOUR::AudioTrack> >
@@ -383,7 +395,7 @@ Pointer Classes cannot be created in lua scripts. It always requires a call to CC‡: boost::shared_ptr< ARDOUR::AutomationControl >, boost::weak_ptr< ARDOUR::AutomationControl >
-is-a: Evoral:Control
+is-a: PBD:Controllable
Methods | ||
---|---|---|
Get and Set `internal' value All derived classes must implement this. Basic derived classes will ignore
| ||
void | start_touch (double) | |
void | stop_touch (bool, double) | |
Control | to_ctrl () | |
bool | writable () | |
Cast | ||
Control | to_ctrl () |
Methods | ||
---|---|---|
ControlList | list () | |
std::string | name () |
Methods | ||
---|---|---|
void | clear_changes () | |
Forget about any changes to this object's properties | ||
OwnedPropertyList | properties () |
C‡: boost::shared_ptr< ARDOUR::AutomationList >, boost::weak_ptr< ARDOUR::AutomationList >
@@ -414,13 +434,14 @@ Pointer Classes cannot be created in lua scripts. It always requires a call to CC‡: std::vector<ARDOUR::AudioBackendInfo const* >
@@ -514,7 +535,7 @@ Pointer Classes cannot be created in lua scripts. It always requires a call to Csetup filter, compute coefficients
setup filter, compute coefficients
reset filter state
Methods | ||
---|---|---|
std::string | name () | |
Cast | ||
Stateful | to_stateful () | |
StatefulDestructible | to_statefuldestructible () |
C‡: ARDOUR::AudioBackend::DeviceStatus
@@ -650,13 +680,21 @@ Pointer Classes cannot be created in lua scripts. It always requires a call to CGet and Set `internal' value
All derived classes must implement this.
Basic derived classes will ignore
Methods | ||
---|---|---|
ControlList | list () | |
std::string | name () |
Methods | ||
---|---|---|
void | clear_changes () | |
Forget about any changes to this object's properties | ||
OwnedPropertyList | properties () |
C‡: boost::shared_ptr< ARDOUR::IO >, boost::weak_ptr< ARDOUR::IO >
@@ -683,16 +721,10 @@ Pointer Classes cannot be created in lua scripts. It always requires a call to CMethods | ||
---|---|---|
std::string | name () | |
Cast | ||
Stateful | to_stateful () | |
StatefulDestructible | to_statefuldestructible () |
Methods | ||
---|---|---|
void | clear_changes () | |
Forget about any changes to this object's properties | ||
OwnedPropertyList | properties () |
C‡: boost::shared_ptr< ARDOUR::IOProcessor >, boost::weak_ptr< ARDOUR::IOProcessor >
is-a: ARDOUR:Processor
@@ -714,11 +746,20 @@ Pointer Classes cannot be created in lua scripts. It always requires a call to CMethods | ||
---|---|---|
std::string | name () | |
Cast | ||
Stateful | to_stateful () | |
StatefulDestructible | to_statefuldestructible () |
C‡: ARDOUR::InterThreadInfo
@@ -787,14 +828,14 @@ Pointer Classes cannot be created in lua scripts. It always requires a call to CA convenience function to get a Automation Lists and ParamaterDescriptor for a given plugin control.
This is equivalent to the following lua code
function (processor, param_id) - local plugininsert = processor:to_insert () - local plugin = plugininsert:plugin(0) + 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
Example usage: get 3rd input parameter of first plugin on the given route (Ardour starts counting at zero).
local al, cl, pd = ARDOUR.LuaAPI.plugin_automation (route:nth_plugin (0), 3)
Returns 3 parameters: AutomationList, ControlList, ParamaterDescriptor
Example usage: get the third input parameter of first plugin on the given route (Ardour starts counting at zero).
local al, cl, pd = ARDOUR.LuaAPI.plugin_automation (route:nth_plugin (0), 3)
Returns 3 parameters: AutomationList, ControlList, ParamaterDescriptor
set a plugin control-input parameter value
This is a wrapper around set_processor_param which looks up the Processor by plugin-insert.
Returns true on success, false on error or out-of-bounds value
the signal processorat at end of the processing chain which produces output
Methods | ||
---|---|---|
std::string | name () | |
Cast | ||
Stateful | to_stateful () | |
StatefulDestructible | to_statefuldestructible () |
Methods | ||
---|---|---|
void | clear_changes () | |
Forget about any changes to this object's properties | ||
OwnedPropertyList | properties () |
C‡: std::list<boost::shared_ptr<ARDOUR::MidiTrack> >
@@ -1014,16 +1052,10 @@ Pointer Classes cannot be created in lua scripts. It always requires a call to CMethods | ||
---|---|---|
std::string | name () | |
Cast | ||
Stateful | to_stateful () | |
StatefulDestructible | to_statefuldestructible () |
Methods | ||
---|---|---|
void | clear_changes () | |
Forget about any changes to this object's properties | ||
OwnedPropertyList | properties () |
C‡: boost::shared_ptr< ARDOUR::Plugin >, boost::weak_ptr< ARDOUR::Plugin >
is-a: PBD:StatefulDestructiblePtr
@@ -1074,13 +1106,21 @@ Pointer Classes cannot be created in lua scripts. It always requires a call to CGet and Set `internal' value
All derived classes must implement this.
Basic derived classes will ignore
Methods | ||
---|---|---|
ControlList | list () | |
std::string | name () |
Methods | ||
---|---|---|
void | clear_changes () | |
Forget about any changes to this object's properties | ||
OwnedPropertyList | properties () |
C‡: boost::shared_ptr< ARDOUR::PluginInfo >, boost::weak_ptr< ARDOUR::PluginInfo >
@@ -1114,11 +1154,20 @@ Pointer Classes cannot be created in lua scripts. It always requires a call to CMethods | ||
---|---|---|
std::string | name () | |
Cast | ||
Stateful | to_stateful () | |
StatefulDestructible | to_statefuldestructible () |
C‡: boost::shared_ptr< ARDOUR::Port >, boost::weak_ptr< ARDOUR::Port >
@@ -1171,7 +1220,7 @@ Pointer Classes cannot be created in lua scripts. It always requires a call to CC‡: boost::shared_ptr< ARDOUR::Processor >, boost::weak_ptr< ARDOUR::Processor >
-is-a: ARDOUR:Automatable
+is-a: ARDOUR:SessionObject
Methods | ||
---|---|---|
void | deactivate () | |
std::string | display_name () | |
bool | isnil () | |
Cast | ||
Automatable | to_automatable () | |
PluginInsert | to_insert () | |
IOProcessor | to_ioprocessor () | |
SessionObject | to_sessionobject () | |
SideChain | to_sidechain () |
Methods | ||
---|---|---|
std::string | name () | |
Cast | ||
Stateful | to_stateful () | |
StatefulDestructible | to_statefuldestructible () |
C‡: PBD::PropertyDescriptor<bool>
@@ -1281,16 +1339,10 @@ Pointer Classes cannot be created in lua scripts. It always requires a call to CMethods | ||
---|---|---|
std::string | name () | |
Cast | ||
Stateful | to_stateful () | |
StatefulDestructible | to_statefuldestructible () |
Methods | ||
---|---|---|
void | clear_changes () | |
Forget about any changes to this object's properties | ||
OwnedPropertyList | properties () |
C‡: ARDOUR::RegionFactory
@@ -1341,6 +1393,7 @@ Pointer Classes cannot be created in lua scripts. It always requires a call to Cthe signal processorat at end of the processing chain which produces output
Methods | ||
---|---|---|
std::string | name () | |
Cast | ||
Stateful | to_stateful () | |
StatefulDestructible | to_statefuldestructible () |
Methods | ||
---|---|---|
void | clear_changes () | |
Forget about any changes to this object's properties | ||
OwnedPropertyList | properties () |
C‡: ARDOUR::Route::ProcessorStreams
@@ -1437,6 +1485,7 @@ Pointer Classes cannot be created in lua scripts. It always requires a call to Ccreate a new track or bus from a template (XML path)
Returns list of newly created routes
"native" sample rate of session, regardless of current audioengine rate, pullup/down etc
save session
Returns zero on success
C‡: boost::shared_ptr< ARDOUR::SessionObject >, boost::weak_ptr< ARDOUR::SessionObject >
-is-a: PBD:StatefulDestructiblePtr
Methods | ||
---|---|---|
bool | isnil () | |
std::string | name () | |
Cast | ||
Stateful | to_stateful () | |
StatefulDestructible | to_statefuldestructible () |
Methods | ||
---|---|---|
void | clear_changes () | |
Forget about any changes to this object's properties | ||
OwnedPropertyList | properties () |
C‡: boost::shared_ptr< ARDOUR::SideChain >, boost::weak_ptr< ARDOUR::SideChain >
is-a: ARDOUR:IOProcessor
@@ -1507,11 +1549,20 @@ Pointer Classes cannot be created in lua scripts. It always requires a call to CMethods | ||
---|---|---|
std::string | name () | |
Cast | ||
Stateful | to_stateful () | |
StatefulDestructible | to_statefuldestructible () |
C‡: boost::shared_ptr< ARDOUR::Source >, boost::weak_ptr< ARDOUR::Source >
@@ -1559,6 +1610,7 @@ Pointer Classes cannot be created in lua scripts. It always requires a call to Cthe signal processorat at end of the processing chain which produces output
Methods | ||
---|---|---|
std::string | name () | |
Cast | ||
Stateful | to_stateful () | |
StatefulDestructible | to_statefuldestructible () |
Methods | ||
---|---|---|
void | clear_changes () | |
Forget about any changes to this object's properties | ||
OwnedPropertyList | properties () |
C‡: std::list<boost::weak_ptr<ARDOUR::AudioSource> >
@@ -1641,11 +1689,32 @@ Pointer Classes cannot be created in lua scripts. It always requires a call to CC‡: ArdourMarker
Location Marker
Editor ruler representation of a location marker or range on the timeline.
This class object is only used indirectly as return-value and function-parameter. It provides no methods by itself.
+Methods | ||
---|---|---|
std::string | name () | |
long | position () | |
Type | type () |
C‡: std::list<ArdourMarker* >
+ +Constructor | ||
---|---|---|
ℂ | ArdourUI.ArdourMarkerList () | |
Methods | ||
LuaTable | add (LuaTable {ArdourMarker* }) | |
bool | empty () | |
LuaIter | iter () | |
void | push_back (ArdourMarker) | |
void | reverse () | |
unsigned long | size () | |
LuaTable | table () | |
void | unique () |
C‡: PublicEditor
@@ -1743,6 +1812,25 @@ Pointer Classes cannot be created in lua scripts. It always requires a call to CUndo some transactions.
C‡: MarkerSelection
+is-a: ArdourUI:ArdourMarkerList
+ +This class object is only used indirectly as return-value and function-parameter. It provides no methods by itself.
+Constructor | ||
---|---|---|
ℂ | ArdourUI.ArdourMarkerList () | |
Methods | ||
LuaTable | add (LuaTable {ArdourMarker* }) | |
bool | empty () | |
LuaIter | iter () | |
void | push_back (ArdourMarker) | |
void | reverse () | |
unsigned long | size () | |
LuaTable | table () | |
void | unique () |
C‡: RegionSelection
@@ -1765,10 +1853,35 @@ Pointer Classes cannot be created in lua scripts. It always requires a call to CClear everything from the Selection
check if all selections are empty
Returns true if nothing is selected.
C‡: TimeSelection
+is-a: ARDOUR:AudioRangeList
+ +Methods | ||
---|---|---|
long | end_frame () | |
long | length () | |
long | start () |
Constructor | ||
---|---|---|
ℂ | ARDOUR.AudioRangeList () | |
Methods | ||
bool | empty () | |
LuaIter | iter () | |
void | reverse () | |
unsigned long | size () | |
LuaTable | table () |
C‡: TrackSelection
is-a: ArdourUI:TrackViewList
@@ -2091,6 +2204,7 @@ Pointer Classes cannot be created in lua scripts. It always requires a call to C