X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fluabindings.cc;h=e77510921366fb31912688ce0383610340ac05f3;hb=baa00942a20856cf332f547086ed5ebd2ff9078e;hp=30beb085149114f4e7c2d498c7fe507fb0b07cac;hpb=30b087ab3d28f1585987fa3f6ae006562ae192e3;p=ardour.git diff --git a/libs/ardour/luabindings.cc b/libs/ardour/luabindings.cc index 30beb08514..e775109213 100644 --- a/libs/ardour/luabindings.cc +++ b/libs/ardour/luabindings.cc @@ -18,14 +18,17 @@ #include -#include "timecode/bbt_time.h" #include "pbd/stateful_diff_command.h" #include "pbd/openuri.h" + +#include "temporal/bbt_time.h" + #include "evoral/Control.hpp" #include "evoral/ControlList.hpp" #include "evoral/Range.hpp" #include "ardour/amp.h" +#include "ardour/async_midi_port.h" #include "ardour/audioengine.h" #include "ardour/audioregion.h" #include "ardour/audiosource.h" @@ -38,6 +41,9 @@ #include "ardour/beats_samples_converter.h" #include "ardour/chan_mapping.h" #include "ardour/dB.h" +#include "ardour/delayline.h" +#include "ardour/disk_reader.h" +#include "ardour/disk_writer.h" #include "ardour/dsp_filter.h" #include "ardour/file_source.h" #include "ardour/fluid_synth.h" @@ -57,12 +63,16 @@ #include "ardour/playlist.h" #include "ardour/plugin.h" #include "ardour/plugin_insert.h" +#include "ardour/polarity_processor.h" #include "ardour/port_manager.h" #include "ardour/progress.h" +#include "ardour/raw_midi_parser.h" #include "ardour/runtime_functions.h" #include "ardour/region.h" #include "ardour/region_factory.h" +#include "ardour/return.h" #include "ardour/route_group.h" +#include "ardour/send.h" #include "ardour/session.h" #include "ardour/session_object.h" #include "ardour/sidechain.h" @@ -206,7 +216,7 @@ CLASSKEYS(PBD::Configuration); CLASSKEYS(PBD::PropertyChange); CLASSKEYS(PBD::StatefulDestructible); -CLASSKEYS(Evoral::Beats); +CLASSKEYS(Temporal::Beats); CLASSKEYS(Evoral::Event); CLASSKEYS(Evoral::ControlEvent); @@ -222,6 +232,7 @@ CLASSKEYS(std::list); CLASSKEYS(std::vector); CLASSKEYS(std::vector >); CLASSKEYS(std::vector >); +CLASSKEYS(std::list >); // PluginInfoList CLASSKEYS(std::list); CLASSKEYS(std::list); @@ -235,7 +246,7 @@ CLASSKEYS(boost::shared_ptr > >); CLASSKEYS(boost::shared_ptr); CLASSKEYS(boost::shared_ptr); CLASSKEYS(boost::shared_ptr); -CLASSKEYS(boost::shared_ptr >); +CLASSKEYS(boost::shared_ptr >); CLASSKEYS(boost::shared_ptr); CLASSKEYS(boost::shared_ptr); CLASSKEYS(boost::shared_ptr); @@ -247,8 +258,8 @@ CLASSKEYS(boost::shared_ptr); CLASSKEYS(boost::shared_ptr); CLASSKEYS(boost::shared_ptr); CLASSKEYS(boost::shared_ptr); -CLASSKEYS(boost::shared_ptr >); -CLASSKEYS(boost::shared_ptr >); +CLASSKEYS(boost::shared_ptr >); +CLASSKEYS(boost::shared_ptr >); CLASSKEYS(boost::shared_ptr); CLASSKEYS(boost::shared_ptr); @@ -516,9 +527,9 @@ LuaBindings::common (lua_State* L) .addFunction ("time", (samplepos_t (Evoral::Event::*)())&Evoral::Event::time) .endClass () - .beginClass ("Beats") + .beginClass ("Beats") .addConstructor () - .addFunction ("to_double", &Evoral::Beats::to_double) + .addFunction ("to_double", &Temporal::Beats::to_double) .endClass () .beginClass ("Parameter") @@ -535,6 +546,7 @@ LuaBindings::common (lua_State* L) .beginWSPtrClass ("ControlList") .addFunction ("add", &Evoral::ControlList::add) + .addFunction ("editor_add", &Evoral::ControlList::editor_add) .addFunction ("thin", &Evoral::ControlList::thin) .addFunction ("eval", &Evoral::ControlList::eval) .addRefFunction ("rt_safe_eval", &Evoral::ControlList::rt_safe_eval) @@ -570,16 +582,16 @@ LuaBindings::common (lua_State* L) .addData ("to", &Evoral::Range::to) .endClass () - .deriveWSPtrClass , Evoral::ControlSet> ("Sequence") + .deriveWSPtrClass , Evoral::ControlSet> ("Sequence") .endClass () - .beginWSPtrClass > ("NotePtr") - .addFunction ("time", &Evoral::Note::time) - .addFunction ("note", &Evoral::Note::note) - .addFunction ("velocity", &Evoral::Note::velocity) - .addFunction ("off_velocity", &Evoral::Note::off_velocity) - .addFunction ("length", &Evoral::Note::length) - .addFunction ("channel", &Evoral::Note::channel) + .beginWSPtrClass > ("NotePtr") + .addFunction ("time", &Evoral::Note::time) + .addFunction ("note", &Evoral::Note::note) + .addFunction ("velocity", &Evoral::Note::velocity) + .addFunction ("off_velocity", &Evoral::Note::off_velocity) + .addFunction ("length", &Evoral::Note::length) + .addFunction ("channel", &Evoral::Note::channel) .endClass () /* libevoral enums */ @@ -819,6 +831,7 @@ LuaBindings::common (lua_State* L) .addFunction ("set_start", &Location::set_start) .addFunction ("set_end", &Location::set_end) .addFunction ("set_length", &Location::set) + .addFunction ("set_name", &Location::set_name) .addFunction ("move_to", &Location::move_to) .addFunction ("matches", &Location::matches) .addFunction ("flags", &Location::flags) @@ -839,6 +852,7 @@ LuaBindings::common (lua_State* L) .addFunction ("first_mark_after", &Locations::first_mark_after) .addFunction ("first_mark_before", &Locations::first_mark_before) .addFunction ("first_mark_at", &Locations::mark_at) + .addFunction ("mark_at", &Locations::mark_at) .addFunction ("remove", &Locations::remove) .addRefFunction ("marks_either_side", &Locations::marks_either_side) .addRefFunction ("find_all_between", &Locations::find_all_between) @@ -860,6 +874,7 @@ LuaBindings::common (lua_State* L) .beginWSPtrClass ("Port") .addCast ("to_midiport") + .addCast ("to_asyncmidiport") .addCast ("to_audioport") .addFunction ("name", &Port::name) .addFunction ("pretty_name", &Port::pretty_name) @@ -870,6 +885,10 @@ LuaBindings::common (lua_State* L) .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) + .addFunction ("physically_connected", &Port::physically_connected) + .addFunction ("private_latency_range", &Port::private_latency_range) + .addFunction ("public_latency_range", &Port::public_latency_range) + .addRefFunction ("get_connected_latency_range", &Port::get_connected_latency_range) //.addStaticFunction ("port_offset", &Port::port_offset) // static .endClass () @@ -877,11 +896,16 @@ LuaBindings::common (lua_State* L) .endClass () .deriveWSPtrClass ("MidiPort") + .addCast ("to_asyncmidiport") .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 () + .deriveWSPtrClass ("AsyncMIDIPort") + .addFunction ("write", &AsyncMIDIPort::write) + .endClass () + .beginWSPtrClass ("PortSet") .addFunction ("num_ports", (size_t (PortSet::*)(DataType)const)&PortSet::num_ports) .addFunction ("add", &PortSet::add) @@ -906,6 +930,8 @@ LuaBindings::common (lua_State* L) .addFunction ("midi", &IO::midi) .addFunction ("port_by_name", &IO::nth) .addFunction ("n_ports", &IO::n_ports) + .addFunction ("latency", &IO::latency) + .addFunction ("public_latency", &IO::latency) .endClass () .deriveWSPtrClass ("PannerShell") @@ -962,11 +988,15 @@ LuaBindings::common (lua_State* L) .beginWSPtrClass ("Slavable") .addFunction ("assign", &Slavable::assign) .addFunction ("unassign", &Slavable::unassign) + .addFunction ("masters", &Slavable::masters) + .addFunction ("assigned_to", &Slavable::assigned_to) .endClass () .deriveWSPtrClass ("Stripable") .addCast ("to_route") .addCast ("to_vca") + .addCast ("to_slavable") + .addCast ("to_automatable") .addFunction ("is_auditioner", &Stripable::is_auditioner) .addFunction ("is_private_route", &Stripable::is_private_route) .addFunction ("is_master", &Stripable::is_master) @@ -1021,12 +1051,12 @@ LuaBindings::common (lua_State* L) .addFunction ("gain_control", &VCA::gain_control) .addFunction ("solo_control", &VCA::solo_control) .addFunction ("mute_control", &VCA::mute_control) + .addFunction ("slaved_to", &VCA::slaved_to) + .addFunction ("slaved", &VCA::slaved) .endClass () .deriveWSPtrClass ("Route") .addCast ("to_track") - .addCast ("to_automatable") - .addCast ("to_slavable") .addFunction ("set_name", &Route::set_name) .addFunction ("comment", &Route::comment) .addFunction ("active", &Route::active) @@ -1059,6 +1089,8 @@ LuaBindings::common (lua_State* L) .addFunction ("trim", &Route::trim) .addFunction ("peak_meter", (boost::shared_ptr (Route::*)())&Route::peak_meter) .addFunction ("set_meter_point", &Route::set_meter_point) + .addFunction ("signal_latency", &Route::signal_latency) + .addFunction ("playback_latency", &Route::playback_latency) .endClass () .deriveWSPtrClass ("Playlist") @@ -1264,11 +1296,11 @@ LuaBindings::common (lua_State* L) //.addFunction ("what_can_be_automated", &Automatable::what_can_be_automated) .endClass () - .deriveWSPtrClass , Automatable> ("AutomatableSequence") - .addCast > ("to_sequence") + .deriveWSPtrClass , Automatable> ("AutomatableSequence") + .addCast > ("to_sequence") .endClass () - .deriveWSPtrClass > ("MidiModel") + .deriveWSPtrClass > ("MidiModel") .addFunction ("apply_command", (void (MidiModel::*)(Session*, Command*))&MidiModel::apply_command) .addFunction ("new_note_diff_command", &MidiModel::new_note_diff_command) .endClass () @@ -1293,6 +1325,7 @@ LuaBindings::common (lua_State* L) .endClass () .beginStdVector ("PresetVector").endClass () + .beginStdList > ("PluginInfoList").endClass () .deriveClass ("ParameterDescriptor") .addVoidConstructor () @@ -1310,11 +1343,16 @@ LuaBindings::common (lua_State* L) .addCast ("to_ioprocessor") .addCast ("to_unknownprocessor") .addCast ("to_amp") + .addCast ("to_diskioprocessor") + .addCast ("to_diskreader") + .addCast ("to_diskwriter") .addCast ("to_peakmeter") .addCast ("to_monitorprocessor") + .addCast ("to_send") + .addCast ("to_polarityprocessor") + .addCast ("to_delayline") #if 0 // those objects are not yet bound .addCast ("to_capturingprocessor") - .addCast ("to_delayline") #endif .addCast ("to_meter") .addFunction ("display_name", &Processor::display_name) @@ -1322,8 +1360,22 @@ 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) + .addFunction ("input_latency", &Processor::input_latency) + .addFunction ("output_latency", &Processor::output_latency) + .addFunction ("capture_offset", &Processor::capture_offset) + .addFunction ("playback_offset", &Processor::playback_offset) + .addFunction ("output_streams", &Processor::output_streams) + .addFunction ("input_streams", &Processor::input_streams) + .addFunction ("signal_latency", &Processor::signal_latency) + .endClass () + + .deriveWSPtrClass ("DiskIOProcessor") + .endClass () + + .deriveWSPtrClass ("DiskReader") + .endClass () + + .deriveWSPtrClass ("DiskWriter") .endClass () .deriveWSPtrClass ("IOProcessor") @@ -1340,6 +1392,20 @@ LuaBindings::common (lua_State* L) .addFunction ("panner_shell", &Route::panner_shell) .endClass () + .deriveWSPtrClass ("Send") + .addFunction ("get_delay_in", &Send::get_delay_in) + .addFunction ("get_delay_out", &Send::get_delay_out) + .endClass () + + .deriveWSPtrClass ("InternalSend") + .endClass () + + .deriveWSPtrClass ("Return") + .endClass () + + .deriveWSPtrClass ("InternalReturn") + .endClass () + .beginNamespace ("Plugin") .beginClass ("IOPortDescription") .addData ("name", &Plugin::IOPortDescription::name) @@ -1389,6 +1455,11 @@ LuaBindings::common (lua_State* L) .addFunction ("natural_output_streams", &PluginInsert::natural_output_streams) .addFunction ("natural_input_streams", &PluginInsert::natural_input_streams) .addFunction ("reset_parameters_to_default", &PluginInsert::reset_parameters_to_default) + .addFunction ("has_sidechain", &PluginInsert::has_sidechain) + .addFunction ("is_instrument", &PluginInsert::is_instrument) + .addFunction ("type", &PluginInsert::type) + .addFunction ("signal_latency", &PluginInsert::signal_latency) + .addFunction ("get_count", &PluginInsert::get_count) .endClass () .deriveWSPtrClass ("ReadOnlyControl") @@ -1491,9 +1562,24 @@ LuaBindings::common (lua_State* L) .deriveWSPtrClass ("UnknownProcessor") .endClass () + .deriveWSPtrClass ("PolarityProcessor") + .endClass () + + .deriveWSPtrClass ("DelayLine") + .addFunction ("delay", &DelayLine::delay) + .endClass () + .deriveWSPtrClass ("PluginControl") .endClass () + .beginClass ("RawMidiParser") + .addVoidConstructor () + .addFunction ("reset", &RawMidiParser::reset) + .addFunction ("process_byte", &RawMidiParser::process_byte) + .addFunction ("buffer_size", &RawMidiParser::buffer_size) + .addFunction ("midi_buffer", &RawMidiParser::midi_buffer) + .endClass () + .deriveWSPtrClass ("AudioSource") .addFunction ("readable_length", &AudioSource::readable_length) .addFunction ("n_channels", &AudioSource::n_channels) @@ -1519,6 +1605,10 @@ LuaBindings::common (lua_State* L) .beginConstStdList > ("VCAList") .endClass () + // VCAVector == std::vector > + .beginConstStdVector > ("VCAVector") + .endClass () + // boost::shared_ptr .beginPtrStdList > ("RouteListPtr") .addVoidPtrConstructor > > () @@ -1580,14 +1670,14 @@ LuaBindings::common (lua_State* L) .addVoidPtrConstructor > > () .endClass () - .beginStdList > > ("NotePtrList") + .beginStdList > > ("NotePtrList") .endClass () .beginConstStdList ("EventList") .endClass () #if 0 // depends on Evoal:: Note, Beats see note_fixer.h - // typedef Evoral::Note Note; + // typedef Evoral::Note Note; // std::set< boost::weak_ptr > .beginStdSet > ("WeakNoteSet") .endClass () @@ -2003,7 +2093,10 @@ LuaBindings::common (lua_State* L) .addFunction ("set_output_device_name", &AudioBackend::set_output_device_name) .endClass() - .beginClass ("PortEngine") + .beginClass ("LatencyRange") + .addVoidConstructor () + .addData ("min", &LatencyRange::min) + .addData ("max", &LatencyRange::max) .endClass() .beginClass ("PortManager") @@ -2099,7 +2192,7 @@ LuaBindings::common (lua_State* L) .addFunction ("scripts_changed", &Session::scripts_changed) // used internally .addFunction ("transport_rolling", &Session::transport_rolling) .addFunction ("request_transport_speed", &Session::request_transport_speed) - .addFunction ("transport_frame", &Session::transport_sample) + .addFunction ("transport_sample", &Session::transport_sample) .addFunction ("transport_speed", &Session::transport_speed) .addFunction ("sample_rate", &Session::sample_rate) .addFunction ("nominal_sample_rate", &Session::nominal_sample_rate) @@ -2136,6 +2229,7 @@ LuaBindings::common (lua_State* L) .addFunction ("disable_record", &Session::disable_record) .addFunction ("route_by_id", &Session::route_by_id) .addFunction ("route_by_name", &Session::route_by_name) + .addFunction ("stripable_by_id", &Session::stripable_by_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) @@ -2165,8 +2259,8 @@ LuaBindings::common (lua_State* L) .addFunction ("get_block_size", &Session::get_block_size) .addFunction ("worst_output_latency", &Session::worst_output_latency) .addFunction ("worst_input_latency", &Session::worst_input_latency) - .addFunction ("worst_track_latency", &Session::worst_track_latency) - .addFunction ("worst_playback_latency", &Session::worst_playback_latency) + .addFunction ("worst_route_latency", &Session::worst_route_latency) + .addFunction ("worst_latency_preroll", &Session::worst_latency_preroll) .addFunction ("cfg", &Session::cfg) .addFunction ("route_groups", &Session::route_groups) .addFunction ("new_route_group", &Session::new_route_group) @@ -2211,6 +2305,7 @@ LuaBindings::common (lua_State* L) .beginNamespace ("LuaAPI") .addFunction ("nil_proc", ARDOUR::LuaAPI::nil_processor) .addFunction ("new_luaproc", ARDOUR::LuaAPI::new_luaproc) + .addFunction ("list_plugins", ARDOUR::LuaAPI::list_plugins) .addFunction ("new_plugin_info", ARDOUR::LuaAPI::new_plugin_info) .addFunction ("new_plugin", ARDOUR::LuaAPI::new_plugin) .addFunction ("set_processor_param", ARDOUR::LuaAPI::set_processor_param) @@ -2284,6 +2379,11 @@ LuaBindings::common (lua_State* L) .addFunction ("power_at_bin", &DSP::FFTSpectrum::power_at_bin) .addFunction ("freq_at_bin", &DSP::FFTSpectrum::freq_at_bin) .endClass () + .beginClass ("Generator") + .addVoidConstructor () + .addFunction ("run", &DSP::Generator::run) + .addFunction ("set_type", &DSP::Generator::set_type) + .endClass () /* DSP enums */ .beginNamespace ("BiquadType") @@ -2298,6 +2398,12 @@ LuaBindings::common (lua_State* L) .addConst ("HighShelf", ARDOUR::DSP::Biquad::HighShelf) .endNamespace () + .beginNamespace ("NoiseType") + .addConst ("UniformWhiteNoise", ARDOUR::DSP::Generator::UniformWhiteNoise) + .addConst ("GaussianWhiteNoise", ARDOUR::DSP::Generator::GaussianWhiteNoise) + .addConst ("PinkNoise", ARDOUR::DSP::Generator::PinkNoise) + .endNamespace () + .beginClass ("DspShm") .addConstructor () .addFunction ("allocate", &DSP::DspShm::allocate)