X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fluabindings.cc;h=3c7dd670e003815123bd9fa71def2861d6e59ead;hb=d58cb3daa3f0e091a11e3846b28e83bcf0f93587;hp=8d46d9e762e444690bd0e2a4be772431cdd0a459;hpb=2d3d7a53556a0b724c91db0dbf991e3d7a78b4fe;p=ardour.git diff --git a/libs/ardour/luabindings.cc b/libs/ardour/luabindings.cc index 8d46d9e762..3c7dd670e0 100644 --- a/libs/ardour/luabindings.cc +++ b/libs/ardour/luabindings.cc @@ -42,6 +42,7 @@ #include "ardour/meter.h" #include "ardour/midi_track.h" #include "ardour/midi_port.h" +#include "ardour/phase_control.h" #include "ardour/playlist.h" #include "ardour/plugin.h" #include "ardour/plugin_insert.h" @@ -53,6 +54,9 @@ #include "ardour/session.h" #include "ardour/session_object.h" #include "ardour/sidechain.h" +#include "ardour/solo_isolate_control.h" +#include "ardour/solo_safe_control.h" +#include "ardour/stripable.h" #include "ardour/track.h" #include "ardour/tempo.h" @@ -143,7 +147,7 @@ namespace Cairo { CLASSKEYS(Cairo::Context); CLASSKEYS(std::vector); CLASSKEYS(std::list); -CLASSKEYS(std::bitset<47ul>); // LuaSignal::LAST_SIGNAL +CLASSKEYS(std::bitset<46ul>); // LuaSignal::LAST_SIGNAL CLASSKEYS(ArdourMarker*); CLASSKEYS(ARDOUR::RouteGroup); CLASSKEYS(ARDOUR::LuaProc); @@ -171,6 +175,7 @@ CLASSKEYS(boost::weak_ptr); CLASSKEYS(std::list >); CLASSKEYS(std::list); CLASSKEYS(Evoral::Beats); +CLASSKEYS(ARDOUR::PortEngine); CLASSKEYS(ARDOUR::PortManager); CLASSKEYS(ARDOUR::AudioEngine); CLASSKEYS(void); @@ -234,6 +239,8 @@ LuaBindings::common (lua_State* L) .addFunction ("to_s", &PBD::ID::to_s) // TODO special case LUA __tostring ? .endClass () + .beginStdVector ("IdVector").endClass () + .beginClass ("XMLNode") .addFunction ("name", &XMLNode::name) .endClass () @@ -459,6 +466,8 @@ LuaBindings::common (lua_State* L) .endClass () .beginWSPtrClass ("Port") + .addCast ("to_midiport") + .addCast ("to_audioport") .addFunction ("name", &Port::name) .addFunction ("pretty_name", &Port::pretty_name) .addFunction ("receives_input", &Port::receives_input) @@ -471,6 +480,7 @@ LuaBindings::common (lua_State* L) .addFunction ("connected_to", (bool (Port::*)(Port*)const)&Port::connected_to) .addFunction ("connect", (int (Port::*)(Port*))&Port::connect) .addFunction ("disconnect", (int (Port::*)(Port*))&Port::disconnect) + //.addStaticFunction ("port_offset", &Port::port_offset) // static .endClass () .deriveWSPtrClass ("AudioPort") @@ -479,6 +489,7 @@ LuaBindings::common (lua_State* L) .deriveWSPtrClass ("MidiPort") .addFunction ("input_active", &MidiPort::input_active) .addFunction ("set_input_active", &MidiPort::set_input_active) + .addFunction ("get_midi_buffer", &MidiPort::get_midi_buffer) // DSP only .endClass () .beginWSPtrClass ("PortSet") @@ -510,7 +521,25 @@ LuaBindings::common (lua_State* L) // stub RouteGroup* is needed for new_audio_track() .endClass () - .deriveWSPtrClass ("Route") + .deriveWSPtrClass ("Stripable") + .addCast ("to_route") + .addFunction ("is_auditioner", &Stripable::is_auditioner) + .addFunction ("is_master", &Stripable::is_master) + .addFunction ("is_monitor", &Stripable::is_monitor) + .addFunction ("is_hidden", &Stripable::is_hidden) + .addFunction ("is_selected", &Stripable::is_selected) + .addFunction ("gain_control", &Stripable::gain_control) + .addFunction ("solo_control", &Stripable::solo_control) + .addFunction ("solo_isolate_control", &Stripable::solo_isolate_control) + .addFunction ("solo_safe_control", &Stripable::solo_safe_control) + .addFunction ("mute_control", &Stripable::mute_control) + .addFunction ("phase_control", &Stripable::phase_control) + .addFunction ("trim_control", &Stripable::trim_control) + .addFunction ("rec_enable_control", &Stripable::rec_enable_control) + .addFunction ("rec_safe_control", &Stripable::rec_safe_control) + .endClass () + + .deriveWSPtrClass ("Route") .addCast ("to_track") .addFunction ("set_name", &Route::set_name) .addFunction ("comment", &Route::comment) @@ -578,10 +607,6 @@ LuaBindings::common (lua_State* L) .addCast ("to_midi_track") .addFunction ("set_name", &Track::set_name) .addFunction ("can_record", &Track::can_record) - .addFunction ("record_enabled", &Track::record_enabled) - .addFunction ("record_safe", &Track::record_safe) - .addFunction ("set_record_enabled", &Track::set_record_enabled) - .addFunction ("set_record_safe", &Track::set_record_safe) .addFunction ("bounceable", &Track::bounceable) .addFunction ("bounce", &Track::bounce) .addFunction ("bounce_range", &Track::bounce_range) @@ -686,8 +711,6 @@ LuaBindings::common (lua_State* L) .addFunction ("active", &Processor::active) .addFunction ("activate", &Processor::activate) .addFunction ("deactivate", &Processor::deactivate) - .addFunction ("control", (boost::shared_ptr(Evoral::ControlSet::*)(const Evoral::Parameter&, bool))&Evoral::ControlSet::control) - .addFunction ("automation_control", (boost::shared_ptr(Automatable::*)(const Evoral::Parameter&, bool))&Automatable::automation_control) .endClass () .deriveWSPtrClass ("IOProcessor") @@ -744,7 +767,43 @@ LuaBindings::common (lua_State* L) .addFunction ("alist", &AutomationControl::alist) .endClass () - .deriveWSPtrClass ("GainControl") + .deriveWSPtrClass ("SlavableAutomationControl,") + .addFunction ("add_master", &SlavableAutomationControl::add_master) + .addFunction ("remove_master", &SlavableAutomationControl::remove_master) + .addFunction ("clear_masters", &SlavableAutomationControl::clear_masters) + .addFunction ("slaved_to", &SlavableAutomationControl::slaved_to) + .addFunction ("slaved", &SlavableAutomationControl::slaved) + .addFunction ("get_masters_value", &SlavableAutomationControl::get_masters_value) + .addFunction ("get_boolean_masters", &SlavableAutomationControl::get_boolean_masters) + //.addFunction ("masters", &SlavableAutomationControl::masters) // not implemented + .endClass () + + .deriveWSPtrClass ("PhaseControl") + .addFunction ("set_phase_invert", (void(PhaseControl::*)(uint32_t, bool))&PhaseControl::set_phase_invert) + .addFunction ("inverted", &PhaseControl::inverted) + .endClass () + + .deriveWSPtrClass ("GainControl") + .endClass () + + .deriveWSPtrClass ("SoloControl") + .addFunction ("can_solo", &SoloControl::can_solo) + .addFunction ("soloed", &SoloControl::soloed) + .addFunction ("self_soloed", &SoloControl::self_soloed) + .endClass () + + .deriveWSPtrClass ("MuteControl") + .addFunction ("muted", &MuteControl::muted) + .addFunction ("muted_by_self", &MuteControl::muted_by_self) + .endClass () + + .deriveWSPtrClass ("SoloIsolateControl") + .addFunction ("solo_isolated", &SoloIsolateControl::solo_isolated) + .addFunction ("self_solo_isolated", &SoloIsolateControl::self_solo_isolated) + .endClass () + + .deriveWSPtrClass ("SoloSafeControl") + .addFunction ("solo_safe", &SoloSafeControl::solo_safe) .endClass () .deriveWSPtrClass ("Amp") @@ -832,10 +891,26 @@ LuaBindings::common (lua_State* L) .endClass () .beginClass ("TempoMap") - .addFunction ("add_tempo_pulse", &TempoMap::add_tempo_pulse) - .addFunction ("add_tempo_frame", &TempoMap::add_tempo_frame) - .addFunction ("add_meter_beat", &TempoMap::add_meter_beat) - .addFunction ("add_meter_frame", &TempoMap::add_meter_frame) + .addFunction ("add_tempo", &TempoMap::add_tempo) + .addFunction ("add_meter", &TempoMap::add_meter) + .addFunction ("tempo_section_at_frame", &TempoMap::tempo_section_at_frame) + .addFunction ("meter_section_at_frame", &TempoMap::meter_section_at_frame) + .addFunction ("meter_section_at_beat", &TempoMap::meter_section_at_beat) + .endClass () + + .beginClass ("MetricSection") + .addFunction ("pulse", &MetricSection::pulse) + .addFunction ("set_pulse", &MetricSection::set_pulse) + .endClass () + + .deriveClass ("TempoSection") + .addFunction ("c_func", (double(TempoSection::*)()const)&TempoSection::c_func) + .endClass () + + .deriveClass ("MeterSection") + .addCast ("to_meter") + .addFunction ("set_pulse", &MeterSection::set_pulse) + .addFunction ("set_beat", (void(MeterSection::*)(double))&MeterSection::set_beat) .endClass () .beginClass ("ChanCount") @@ -867,6 +942,23 @@ LuaBindings::common (lua_State* L) .addConst ("Lua", ARDOUR::PluginType(Lua)) .endNamespace () + .beginNamespace ("PresentationInfo") + .beginNamespace ("Flag") + .addConst ("AudioTrack", ARDOUR::PresentationInfo::Flag(PresentationInfo::AudioTrack)) + .addConst ("MidiTrack", ARDOUR::PresentationInfo::Flag(PresentationInfo::MidiTrack)) + .addConst ("AudioBus", ARDOUR::PresentationInfo::Flag(PresentationInfo::AudioBus)) + .addConst ("MidiBus", ARDOUR::PresentationInfo::Flag(PresentationInfo::MidiBus)) + .addConst ("VCA", ARDOUR::PresentationInfo::Flag(PresentationInfo::VCA)) + .addConst ("MasterOut", ARDOUR::PresentationInfo::Flag(PresentationInfo::MasterOut)) + .addConst ("MonitorOut", ARDOUR::PresentationInfo::Flag(PresentationInfo::MonitorOut)) + .addConst ("Auditioner", ARDOUR::PresentationInfo::Flag(PresentationInfo::Auditioner)) + .addConst ("Selected", ARDOUR::PresentationInfo::Flag(PresentationInfo::Selected)) + .addConst ("Hidden", ARDOUR::PresentationInfo::Flag(PresentationInfo::Hidden)) + .addConst ("GroupOrderSet", ARDOUR::PresentationInfo::Flag(PresentationInfo::OrderSet)) + .addConst ("StatusMask", ARDOUR::PresentationInfo::Flag(PresentationInfo::StatusMask)) + .endNamespace () + .endNamespace () + .beginNamespace ("AutoStyle") .addConst ("Absolute", ARDOUR::AutoStyle(Absolute)) .addConst ("Trim", ARDOUR::AutoStyle(Trim)) @@ -880,9 +972,16 @@ LuaBindings::common (lua_State* L) .endNamespace () .beginNamespace ("AutomationType") + .addConst ("GainAutomation", ARDOUR::AutomationType(GainAutomation)) .addConst ("PluginAutomation", ARDOUR::AutomationType(PluginAutomation)) - .addConst ("PluginAutomation", ARDOUR::AutomationType(GainAutomation)) - .addConst ("PluginAutomation", ARDOUR::AutomationType(TrimAutomation)) + .addConst ("SoloAutomation", ARDOUR::AutomationType(SoloAutomation)) + .addConst ("SoloIsolateAutomation", ARDOUR::AutomationType(SoloIsolateAutomation)) + .addConst ("SoloSafeAutomation", ARDOUR::AutomationType(SoloSafeAutomation)) + .addConst ("MuteAutomation", ARDOUR::AutomationType(MuteAutomation)) + .addConst ("RecEnableAutomation", ARDOUR::AutomationType(RecEnableAutomation)) + .addConst ("RecSafeAutomation", ARDOUR::AutomationType(RecSafeAutomation)) + .addConst ("TrimAutomation", ARDOUR::AutomationType(TrimAutomation)) + .addConst ("PhaseAutomation", ARDOUR::AutomationType(PhaseAutomation)) .endNamespace () .beginNamespace ("SrcQuality") @@ -909,6 +1008,20 @@ LuaBindings::common (lua_State* L) .addConst ("SyncPoint", ARDOUR::RegionPoint(SyncPoint)) .endNamespace () + .beginNamespace ("TempoSection") + .beginNamespace ("PositionLockStyle") + .addConst ("AudioTime", ARDOUR::PositionLockStyle(AudioTime)) + .addConst ("MusicTime", ARDOUR::PositionLockStyle(MusicTime)) + .endNamespace () + .endNamespace () + + .beginNamespace ("TempoSection") + .beginNamespace ("Type") + .addConst ("Ramp", ARDOUR::TempoSection::Type(TempoSection::Ramp)) + .addConst ("Constant", ARDOUR::TempoSection::Type(TempoSection::Constant)) + .endNamespace () + .endNamespace () + .beginNamespace ("TrackMode") .addConst ("Normal", ARDOUR::TrackMode(Start)) .addConst ("NonLayered", ARDOUR::TrackMode(NonLayered)) @@ -958,6 +1071,9 @@ LuaBindings::common (lua_State* L) .addFunction ("set_output_device_name", &AudioBackend::set_output_device_name) .endClass() + .beginClass ("PortEngine") + .endClass() + .beginClass ("PortManager") .addFunction ("port_engine", &PortManager::port_engine) .addFunction ("connected", &PortManager::connected) @@ -1027,7 +1143,9 @@ LuaBindings::common (lua_State* L) .addFunction ("record_status", &Session::record_status) .addFunction ("route_by_id", &Session::route_by_id) .addFunction ("route_by_name", &Session::route_by_name) - .addFunction ("route_by_remote_id", &Session::route_by_remote_id) + .addFunction ("get_remote_nth_stripable", &Session::get_remote_nth_stripable) + .addFunction ("get_remote_nth_route", &Session::get_remote_nth_route) + .addFunction ("route_by_selected_count", &Session::route_by_selected_count) .addFunction ("track_by_diskstream_id", &Session::track_by_diskstream_id) .addFunction ("source_by_id", &Session::source_by_id) .addFunction ("controllable_by_id", &Session::controllable_by_id) @@ -1109,8 +1227,10 @@ LuaBindings::dsp (lua_State* L) .beginClass ("MidiBuffer") .addEqualCheck () .addFunction ("silence", &MidiBuffer::silence) - .addFunction ("empty", &MidiBuffer::empty) + .addFunction ("push_event", (bool (MidiBuffer::*)(const Evoral::MIDIEvent&))&MidiBuffer::push_back) + .addFunction ("push_back", (bool (MidiBuffer::*)(framepos_t, size_t, const uint8_t*))&MidiBuffer::push_back) // TODO iterators.. + .addExtCFunction ("table", &luabridge::CFunc::listToTable, MidiBuffer>) .endClass() .beginClass ("BufferSet") @@ -1137,8 +1257,8 @@ LuaBindings::dsp (lua_State* L) // add Ctor? .addFunction ("type", &Evoral::MIDIEvent::type) .addFunction ("channel", &Evoral::MIDIEvent::channel) - .addFunction ("set_type", &Evoral::MIDIEvent::type) - .addFunction ("set_channel", &Evoral::MIDIEvent::channel) + .addFunction ("set_type", &Evoral::MIDIEvent::set_type) + .addFunction ("set_channel", &Evoral::MIDIEvent::set_channel) .endClass () .endNamespace ();