13
0

Grow luabindings

* expose Route IOs, Panner and Instrument
* add plugin + processor ChanCount
* bind IOPortDescription
* remove Port::**(Port*) API because there's no Port* but only
boost::shared_ptr<Port>
This commit is contained in:
Robin Gareus 2016-11-10 01:28:21 +01:00
parent ef3fa314f0
commit da937cf1a4

View File

@ -49,6 +49,7 @@
#include "ardour/midi_port.h"
#include "ardour/midi_region.h"
#include "ardour/midi_source.h"
#include "ardour/panner_shell.h"
#include "ardour/phase_control.h"
#include "ardour/playlist.h"
#include "ardour/plugin.h"
@ -771,12 +772,9 @@ LuaBindings::common (lua_State* L)
.addFunction ("sends_output", &Port::sends_output)
.addFunction ("connected", &Port::connected)
.addFunction ("disconnect_all", &Port::disconnect_all)
.addFunction ("connected_to_name", (bool (Port::*)(std::string const &)const)&Port::connected_to)
.addFunction ("connect_by_name", (int (Port::*)(std::string const &))&Port::connect)
.addFunction ("disconnect_by_name", (int (Port::*)(std::string const &))&Port::disconnect)
.addFunction ("connected_to", (bool (Port::*)(Port*)const)&Port::connected_to)
.addFunction ("connect", (int (Port::*)(Port*))&Port::connect)
.addFunction ("disconnect", (int (Port::*)(Port*))&Port::disconnect)
.addFunction ("connected_to", (bool (Port::*)(std::string const &)const)&Port::connected_to)
.addFunction ("connect", (int (Port::*)(std::string const &))&Port::connect)
.addFunction ("disconnect", (int (Port::*)(std::string const &))&Port::disconnect)
//.addStaticFunction ("port_offset", &Port::port_offset) // static
.endClass ()
@ -805,6 +803,7 @@ LuaBindings::common (lua_State* L)
.addFunction ("remove_port", &IO::remove_port)
.addFunction ("connect", &IO::connect)
.addFunction ("disconnect", (int (IO::*)(boost::shared_ptr<Port>, std::string, void *))&IO::disconnect)
.addFunction ("disconnect_all", (int (IO::*)(void *))&IO::disconnect)
.addFunction ("physically_connected", &IO::physically_connected)
.addFunction ("has_port", &IO::has_port)
.addFunction ("nth", &IO::nth)
@ -814,6 +813,11 @@ LuaBindings::common (lua_State* L)
.addFunction ("n_ports", &IO::n_ports)
.endClass ()
.deriveWSPtrClass <PannerShell, SessionObject> ("PannerShell")
.addFunction ("bypassed", &PannerShell::bypassed)
.addFunction ("set_bypassed", &PannerShell::set_bypassed)
.endClass ()
.beginClass <RouteGroup> ("RouteGroup")
// stub RouteGroup* is needed for new_audio_track()
.endClass ()
@ -822,6 +826,7 @@ LuaBindings::common (lua_State* L)
.addFunction ("color", &PresentationInfo::color)
.addFunction ("set_color", &PresentationInfo::set_color)
.addFunction ("order", &PresentationInfo::order)
.addConst ("max_order", ARDOUR::PresentationInfo::max_order)
.endClass ()
.deriveWSPtrClass <Stripable, SessionObject> ("Stripable")
@ -883,8 +888,12 @@ LuaBindings::common (lua_State* L)
.addFunction ("add_processor_by_index", &Route::add_processor_by_index)
.addFunction ("remove_processor", &Route::remove_processor)
.addFunction ("replace_processor", &Route::replace_processor)
.addFunction ("the_instrument", &Route::the_instrument)
.addFunction ("n_inputs", &Route::n_inputs)
.addFunction ("n_outputs", &Route::n_outputs)
.addFunction ("input", &Route::input)
.addFunction ("output", &Route::output)
.addFunction ("panner_shell", &Route::panner_shell)
.addFunction ("set_comment", &Route::set_comment)
.addFunction ("strict_io", &Route::strict_io)
.addFunction ("set_strict_io", &Route::set_strict_io)
@ -1133,6 +1142,8 @@ LuaBindings::common (lua_State* L)
.addFunction ("active", &Processor::active)
.addFunction ("activate", &Processor::activate)
.addFunction ("deactivate", &Processor::deactivate)
.addFunction ("output_streams", &PluginInsert::output_streams)
.addFunction ("input_streams", &PluginInsert::input_streams)
.endClass ()
.deriveWSPtrClass <IOProcessor, Processor> ("IOProcessor")
@ -1146,8 +1157,18 @@ LuaBindings::common (lua_State* L)
.endClass ()
.deriveWSPtrClass <Delivery, IOProcessor> ("Delivery")
.addFunction ("panner_shell", &Route::panner_shell)
.endClass ()
.beginNamespace ("Plugin")
.beginClass <Plugin::IOPortDescription> ("IOPortDescription")
.addData ("name", &Plugin::IOPortDescription::name)
.addData ("is_sidechain", &Plugin::IOPortDescription::is_sidechain)
.addData ("group_name", &Plugin::IOPortDescription::group_name)
.addData ("group_channel", &Plugin::IOPortDescription::group_channel)
.endClass ()
.endNamespace ()
.deriveWSPtrClass <Plugin, PBD::StatefulDestructible> ("Plugin")
.addCast<LuaProc> ("to_luaproc")
.addFunction ("unique_id", &Plugin::unique_id)
@ -1163,6 +1184,7 @@ LuaBindings::common (lua_State* L)
.addFunction ("get_docs", &Plugin::get_docs)
.addFunction ("get_info", &Plugin::get_info)
.addFunction ("get_parameter_docs", &Plugin::get_parameter_docs)
.addFunction ("describe_io_port", &Plugin::describe_io_port)
.addRefFunction ("get_parameter_descriptor", &Plugin::get_parameter_descriptor)
.endClass ()
@ -1180,7 +1202,8 @@ LuaBindings::common (lua_State* L)
.addFunction ("output_map", (ARDOUR::ChanMapping (PluginInsert::*)(uint32_t) const)&PluginInsert::output_map)
.addFunction ("set_input_map", &PluginInsert::set_input_map)
.addFunction ("set_output_map", &PluginInsert::set_output_map)
.addFunction ("sidechain_input", &PluginInsert::sidechain_input)
.addFunction ("natural_output_streams", &PluginInsert::natural_output_streams)
.addFunction ("natural_input_streams", &PluginInsert::natural_input_streams)
.endClass ()
.deriveWSPtrClass <AutomationControl, PBD::Controllable> ("AutomationControl")