Fix range-separate for musically-locked MIDI regions
[ardour.git] / libs / ardour / luabindings.cc
index cef4bfc9a87e67f221cb70e8ae82bef520ac0c7e..112805f3e6a1ae9d53404f3df140d99353759cf2 100644 (file)
 #include "ardour/audio_track.h"
 #include "ardour/audioplaylist.h"
 #include "ardour/buffer_set.h"
+#include "ardour/beats_frames_converter.h"
 #include "ardour/chan_mapping.h"
 #include "ardour/dB.h"
 #include "ardour/dsp_filter.h"
+#include "ardour/file_source.h"
 #include "ardour/fluid_synth.h"
 #include "ardour/interthread_info.h"
 #include "ardour/lua_api.h"
@@ -56,6 +58,7 @@
 #include "ardour/plugin.h"
 #include "ardour/plugin_insert.h"
 #include "ardour/port_manager.h"
+#include "ardour/progress.h"
 #include "ardour/runtime_functions.h"
 #include "ardour/region.h"
 #include "ardour/region_factory.h"
@@ -68,6 +71,8 @@
 #include "ardour/stripable.h"
 #include "ardour/track.h"
 #include "ardour/tempo.h"
+#include "ardour/vca.h"
+#include "ardour/vca_manager.h"
 
 #include "LuaBridge/LuaBridge.h"
 
@@ -137,14 +142,22 @@ luabridge::getIdentityKey ()
        template void const* luabridge::ClassInfo< CLS >::getConstKey();
 
 CLASSINFO(ArdourMarker);
+CLASSINFO(AxisView);
 CLASSINFO(MarkerSelection);
 CLASSINFO(PublicEditor);
 CLASSINFO(RegionSelection);
+CLASSINFO(RegionView);
+CLASSINFO(RouteTimeAxisView);
+CLASSINFO(RouteUI);
+CLASSINFO(Selectable);
 CLASSINFO(Selection);
+CLASSINFO(TimeAxisView);
+CLASSINFO(TimeAxisViewItem);
 CLASSINFO(TimeSelection);
 CLASSINFO(TrackSelection);
 CLASSINFO(TrackViewList);
 
+
 CLASSKEYS(std::bitset<47ul>); // LuaSignal::LAST_SIGNAL
 
 CLASSKEYS(void);
@@ -152,8 +165,12 @@ CLASSKEYS(float);
 CLASSKEYS(unsigned char);
 
 CLASSKEYS(ArdourMarker*);
+CLASSKEYS(Selectable*);
+CLASSKEYS(std::list<Selectable*>);
 
 CLASSKEYS(ARDOUR::AudioEngine);
+CLASSKEYS(ARDOUR::BeatsFramesConverter);
+CLASSKEYS(ARDOUR::DoubleBeatsFramesConverter);
 CLASSKEYS(ARDOUR::BufferSet);
 CLASSKEYS(ARDOUR::ChanCount);
 CLASSKEYS(ARDOUR::ChanMapping);
@@ -178,6 +195,8 @@ CLASSKEYS(ARDOUR::PresentationInfo);
 CLASSKEYS(ARDOUR::Session);
 CLASSKEYS(ARDOUR::SessionConfiguration);
 CLASSKEYS(ARDOUR::Source);
+CLASSKEYS(ARDOUR::VCA);
+CLASSKEYS(ARDOUR::VCAManager);
 
 CLASSKEYS(PBD::ID);
 CLASSKEYS(PBD::Configuration);
@@ -186,28 +205,36 @@ CLASSKEYS(PBD::StatefulDestructible);
 
 CLASSKEYS(Evoral::Beats);
 CLASSKEYS(Evoral::Event<framepos_t>);
+CLASSKEYS(Evoral::ControlEvent);
 
 
 CLASSKEYS(std::vector<std::string>);
 CLASSKEYS(std::vector<float>);
 CLASSKEYS(std::vector<float*>);
 CLASSKEYS(std::vector<double>);
+CLASSKEYS(std::list<int64_t>);
+
+CLASSKEYS(std::list<Evoral::ControlEvent*>);
 
 CLASSKEYS(std::vector<ARDOUR::Plugin::PresetRecord>);
 CLASSKEYS(std::vector<boost::shared_ptr<ARDOUR::Processor> >);
 CLASSKEYS(std::vector<boost::shared_ptr<ARDOUR::Source> >);
 
 CLASSKEYS(std::list<ArdourMarker*>);
+CLASSKEYS(std::list<TimeAxisView*>);
 CLASSKEYS(std::list<ARDOUR::AudioRange>);
 CLASSKEYS(std::list<boost::shared_ptr<ARDOUR::Port> >);
 CLASSKEYS(std::list<boost::shared_ptr<ARDOUR::Region> >);
 CLASSKEYS(std::list<boost::shared_ptr<ARDOUR::Route> >);
+CLASSKEYS(std::list<boost::shared_ptr<ARDOUR::Stripable> >);
+CLASSKEYS(boost::shared_ptr<std::list<boost::shared_ptr<ARDOUR::Route> > >);
 
 CLASSKEYS(boost::shared_ptr<ARDOUR::AudioRegion>);
 CLASSKEYS(boost::shared_ptr<ARDOUR::AudioSource>);
 CLASSKEYS(boost::shared_ptr<ARDOUR::Automatable>);
 CLASSKEYS(boost::shared_ptr<ARDOUR::AutomatableSequence<Evoral::Beats> >);
 CLASSKEYS(boost::shared_ptr<ARDOUR::AutomationList>);
+CLASSKEYS(boost::shared_ptr<ARDOUR::FileSource>);
 CLASSKEYS(boost::shared_ptr<ARDOUR::MidiModel>);
 CLASSKEYS(boost::shared_ptr<ARDOUR::MidiPlaylist>);
 CLASSKEYS(boost::shared_ptr<ARDOUR::MidiRegion>);
@@ -220,7 +247,11 @@ CLASSKEYS(boost::shared_ptr<Evoral::ControlList>);
 CLASSKEYS(boost::shared_ptr<Evoral::Note<Evoral::Beats> >);
 CLASSKEYS(boost::shared_ptr<Evoral::Sequence<Evoral::Beats> >);
 
+CLASSKEYS(boost::shared_ptr<ARDOUR::Playlist>);
+CLASSKEYS(boost::shared_ptr<ARDOUR::Route>);
+CLASSKEYS(boost::shared_ptr<ARDOUR::VCA>);
 CLASSKEYS(boost::weak_ptr<ARDOUR::Route>);
+CLASSKEYS(boost::weak_ptr<ARDOUR::VCA>);
 
 CLASSKEYS(Vamp::RealTime);
 CLASSKEYS(Vamp::PluginBase);
@@ -236,6 +267,12 @@ namespace LuaCairo {
        class ImageSurface;
        class PangoLayout;
 }
+
+namespace LuaDialog {
+       class Message;
+       class Dialog;
+}
+
 namespace Cairo {
        class Context;
 }
@@ -244,6 +281,9 @@ CLASSKEYS(Cairo::Context);
 CLASSKEYS(LuaCairo::ImageSurface);
 CLASSKEYS(LuaCairo::PangoLayout);
 
+CLASSKEYS(LuaDialog::Message);
+CLASSKEYS(LuaDialog::Dialog);
+
 #endif // end windows special case
 
 /* Some notes on Lua bindings for libardour and friends
@@ -299,6 +339,10 @@ LuaBindings::stddef (lua_State* L)
                .beginStdVector <float*> ("FloatArrayVector")
                .endClass ()
 
+               // framepos_t, frameoffset_t lists e.g. AnalysisFeatureList
+               .beginStdList <int64_t> ("Int64List")
+               .endClass ()
+
        // TODO std::set
                .endNamespace ();
 }
@@ -476,6 +520,11 @@ LuaBindings::common (lua_State* L)
                .addFunction ("id", &Evoral::Parameter::id)
                .endClass ()
 
+               .beginClass <Evoral::ControlEvent> ("ControlEvent")
+               .addData ("when", &Evoral::ControlEvent::when)
+               .addData ("value", &Evoral::ControlEvent::value)
+               .endClass ()
+
                .beginWSPtrClass <Evoral::ControlList> ("ControlList")
                .addFunction ("add", &Evoral::ControlList::add)
                .addFunction ("thin", &Evoral::ControlList::thin)
@@ -486,7 +535,9 @@ LuaBindings::common (lua_State* L)
                .addFunction ("truncate_end", &Evoral::ControlList::truncate_end)
                .addFunction ("truncate_start", &Evoral::ControlList::truncate_start)
                .addFunction ("clear", (void (Evoral::ControlList::*)(double, double))&Evoral::ControlList::clear)
+               .addFunction ("clear_list", (void (Evoral::ControlList::*)())&Evoral::ControlList::clear)
                .addFunction ("in_write_pass", &Evoral::ControlList::in_write_pass)
+               .addFunction ("events", &Evoral::ControlList::events)
                .endClass ()
 
                .beginWSPtrClass <Evoral::ControlSet> ("ControlSet")
@@ -662,6 +713,13 @@ LuaBindings::common (lua_State* L)
                .beginClass <Progress> ("Progress")
                .endClass ()
 
+               .beginClass <MusicFrame> ("MusicFrame")
+               .addConstructor <void (*) (framepos_t, int32_t)> ()
+               .addFunction ("set", &MusicFrame::set)
+               .addData ("frame", &MusicFrame::frame)
+               .addData ("division", &MusicFrame::division)
+               .endClass ()
+
                .beginClass <AudioRange> ("AudioRange")
                .addConstructor <void (*) (framepos_t, framepos_t, uint32_t)> ()
                .addFunction ("length", &AudioRange::length)
@@ -672,7 +730,7 @@ LuaBindings::common (lua_State* L)
                .endClass ()
 
                .beginWSPtrClass <PluginInfo> ("PluginInfo")
-               .addVoidConstructor ()
+               .addNilPtrConstructor ()
                .addData ("name", &PluginInfo::name, false)
                .addData ("category", &PluginInfo::category, false)
                .addData ("creator", &PluginInfo::creator, false)
@@ -730,10 +788,10 @@ LuaBindings::common (lua_State* L)
                .deriveClass <PBD::OwnedPropertyList, PBD::PropertyList> ("OwnedPropertyList")
                .endClass ()
 
-               .beginWSPtrClass <AutomationList> ("AutomationList")
+               .deriveWSPtrClass <AutomationList, Evoral::ControlList> ("AutomationList")
                .addCast<PBD::Stateful> ("to_stateful")
                .addCast<PBD::StatefulDestructible> ("to_statefuldestructible")
-               .addCast<Evoral::ControlList> ("list")
+               .addCast<Evoral::ControlList> ("list") // deprecated
                .addFunction ("get_state", &AutomationList::get_state)
                .addFunction ("memento_command", &AutomationList::memento_command)
                .addFunction ("touching", &AutomationList::touching)
@@ -777,7 +835,7 @@ LuaBindings::common (lua_State* L)
                .addRefFunction ("find_all_between", &Locations::find_all_between)
                .endClass ()
 
-               .beginWSPtrClass <SessionObject> ("SessionObject")
+               .beginWSPtrClass <SessionObject> ("SessionObjectPtr")
                /* SessionObject is-a PBD::StatefulDestructible,
                 * but multiple inheritance is not covered by luabridge,
                 * we need explicit casts */
@@ -786,6 +844,11 @@ LuaBindings::common (lua_State* L)
                .addFunction ("name", &SessionObject::name)
                .endClass ()
 
+               .beginClass <SessionObject> ("SessionObject")
+               .addFunction ("name", &SessionObject::name)
+               .addCast<PBD::Stateful> ("to_stateful")
+               .endClass ()
+
                .beginWSPtrClass <Port> ("Port")
                .addCast<MidiPort> ("to_midiport")
                .addCast<AudioPort> ("to_audioport")
@@ -841,7 +904,7 @@ LuaBindings::common (lua_State* L)
                .addFunction ("set_bypassed", &PannerShell::set_bypassed)
                .endClass ()
 
-               .beginClass <RouteGroup> ("RouteGroup")
+               .deriveClass <RouteGroup, SessionObject> ("RouteGroup")
                .addFunction ("is_active", &RouteGroup::is_active)
                .addFunction ("is_relative", &RouteGroup::is_relative)
                .addFunction ("is_hidden", &RouteGroup::is_hidden)
@@ -870,6 +933,8 @@ LuaBindings::common (lua_State* L)
                .addFunction ("add", &RouteGroup::add)
                .addFunction ("remove", &RouteGroup::remove)
                .addFunction ("clear", &RouteGroup::clear)
+               .addFunction ("set_rgba", &RouteGroup::set_rgba)
+               .addFunction ("rgba", &RouteGroup::rgba)
                .addFunction ("has_subgroup", &RouteGroup::has_subgroup)
                .addFunction ("make_subgroup", &RouteGroup::make_subgroup)
                .addFunction ("destroy_subgroup", &RouteGroup::destroy_subgroup)
@@ -885,6 +950,7 @@ LuaBindings::common (lua_State* L)
 
                .deriveWSPtrClass <Stripable, SessionObject> ("Stripable")
                .addCast<Route> ("to_route")
+               .addCast<VCA> ("to_vca")
                .addFunction ("is_auditioner", &Stripable::is_auditioner)
                .addFunction ("is_master", &Stripable::is_master)
                .addFunction ("is_monitor", &Stripable::is_monitor)
@@ -918,18 +984,28 @@ LuaBindings::common (lua_State* L)
                .addFunction ("comp_mode_name", &Stripable::comp_mode_name)
                .addFunction ("comp_speed_name", &Stripable::comp_speed_name)
                .addFunction ("eq_band_cnt ", &Stripable::eq_band_cnt)
+               .addFunction ("eq_enable_control ", &Stripable::eq_enable_controllable )
                .addFunction ("eq_band_name", &Stripable::eq_band_name)
                .addFunction ("eq_gain_control", &Stripable::eq_gain_controllable)
                .addFunction ("eq_freq_control ", &Stripable::eq_freq_controllable )
                .addFunction ("eq_q_control ", &Stripable::eq_q_controllable )
                .addFunction ("eq_shape_control ", &Stripable::eq_shape_controllable )
-               .addFunction ("eq_enable_control ", &Stripable::eq_enable_controllable )
-               .addFunction ("eq_hpf_control ", &Stripable::eq_hpf_controllable )
+               .addFunction ("filter_freq_controllable ", &Stripable::filter_freq_controllable )
+               .addFunction ("filter_slope_controllable ", &Stripable::filter_slope_controllable )
+               .addFunction ("filter_enable_controllable ", &Stripable::filter_enable_controllable )
                .addFunction ("set_presentation_order", &Stripable::set_presentation_order)
                .addFunction ("presentation_info_ptr", &Stripable::presentation_info_ptr)
 
                .endClass ()
 
+               .deriveWSPtrClass <VCA, Stripable> ("VCA")
+               .addFunction ("full_name", &VCA::full_name)
+               .addFunction ("number", &VCA::number)
+               .addFunction ("gain_control", &VCA::gain_control)
+               .addFunction ("solo_control", &VCA::solo_control)
+               .addFunction ("mute_control", &VCA::mute_control)
+               .endClass ()
+
                .deriveWSPtrClass <Route, Stripable> ("Route")
                .addCast<Track> ("to_track")
                .addCast<Automatable> ("to_automatable")
@@ -942,7 +1018,9 @@ LuaBindings::common (lua_State* L)
                .addFunction ("nth_send", &Route::nth_send)
                .addFunction ("add_processor_by_index", &Route::add_processor_by_index)
                .addFunction ("remove_processor", &Route::remove_processor)
+               .addFunction ("remove_processors", &Route::remove_processors)
                .addFunction ("replace_processor", &Route::replace_processor)
+               .addFunction ("reorder_processors", &Route::reorder_processors)
                .addFunction ("the_instrument", &Route::the_instrument)
                .addFunction ("n_inputs", &Route::n_inputs)
                .addFunction ("n_outputs", &Route::n_outputs)
@@ -978,6 +1056,7 @@ LuaBindings::common (lua_State* L)
                .addFunction ("regions_at", &Playlist::regions_at)
                .addFunction ("top_region_at", &Playlist::top_region_at)
                .addFunction ("top_unmuted_region_at", &Playlist::top_unmuted_region_at)
+               .addFunction ("find_next_transient", &Playlist::find_next_transient)
                .addFunction ("find_next_region", &Playlist::find_next_region)
                .addFunction ("find_next_region_boundary", &Playlist::find_next_region_boundary)
                .addFunction ("count_regions_at", &Playlist::count_regions_at)
@@ -1063,6 +1142,10 @@ LuaBindings::common (lua_State* L)
                .addFunction ("covers", &Region::covers)
                .addFunction ("at_natural_position", &Region::at_natural_position)
                .addFunction ("is_compound", &Region::is_compound)
+
+               .addFunction ("has_transients", &Region::has_transients)
+               .addFunction ("transients", (AnalysisFeatureList (Region::*)())&Region::transients)
+
                /* editing operations */
                .addFunction ("set_length", &Region::set_length)
                .addFunction ("set_start", &Region::set_start)
@@ -1093,12 +1176,13 @@ LuaBindings::common (lua_State* L)
                .addFunction ("set_video_locked", &Region::set_video_locked)
                .addFunction ("set_position_locked", &Region::set_position_locked)
                .addFunction ("source", &Region::source)
+               .addFunction ("control", static_cast<boost::shared_ptr<Evoral::Control>(Region::*)(const Evoral::Parameter&, bool)>(&Region::control))
                .endClass ()
 
                .deriveWSPtrClass <MidiRegion, Region> ("MidiRegion")
                .addFunction ("do_export", &MidiRegion::do_export)
                .addFunction ("midi_source", &MidiRegion::midi_source)
-               .addFunction ("model", (boost::shared_ptr<MidiModel> (MidiRegion::*)())&MidiRegion::midi_source)
+               .addFunction ("model", (boost::shared_ptr<MidiModel> (MidiRegion::*)())&MidiRegion::model)
                .addFunction ("start_beats", &MidiRegion::start_beats)
                .addFunction ("length_beats", &MidiRegion::length_beats)
                .endClass ()
@@ -1114,6 +1198,7 @@ LuaBindings::common (lua_State* L)
                .deriveWSPtrClass <Source, SessionObject> ("Source")
                .addCast<AudioSource> ("to_audiosource")
                .addCast<MidiSource> ("to_midisource")
+               .addCast<FileSource> ("to_filesource")
                .addFunction ("timestamp", &Source::timestamp)
                .addFunction ("empty", &Source::empty)
                .addFunction ("length", &Source::length)
@@ -1128,6 +1213,15 @@ LuaBindings::common (lua_State* L)
                .addFunction ("ancestor_name", &Source::ancestor_name)
                .endClass ()
 
+               .deriveWSPtrClass <FileSource, Source> ("FileSource")
+               .addFunction ("path", &FileSource::path)
+               .addFunction ("within_session", &FileSource::within_session)
+               .addFunction ("channel", &FileSource::channel)
+               .addFunction ("origin", &FileSource::origin)
+               .addFunction ("take_id", &FileSource::take_id)
+               .addFunction ("gain", &FileSource::gain)
+               .endClass ()
+
                .deriveWSPtrClass <MidiSource, Source> ("MidiSource")
                .addFunction ("empty", &MidiSource::empty)
                .addFunction ("length", &MidiSource::length)
@@ -1147,6 +1241,7 @@ LuaBindings::common (lua_State* L)
 
                .deriveWSPtrClass <Automatable, Evoral::ControlSet> ("Automatable")
                .addFunction ("automation_control", (boost::shared_ptr<AutomationControl>(Automatable::*)(const Evoral::Parameter&, bool))&Automatable::automation_control)
+               //.addFunction ("what_can_be_automated", &Automatable::what_can_be_automated)
                .endClass ()
 
                .deriveWSPtrClass <AutomatableSequence<Evoral::Beats>, Automatable> ("AutomatableSequence")
@@ -1190,7 +1285,8 @@ LuaBindings::common (lua_State* L)
 
                .deriveWSPtrClass <Processor, SessionObject> ("Processor")
                .addCast<Automatable> ("to_automatable")
-               .addCast<PluginInsert> ("to_insert")
+               .addCast<PluginInsert> ("to_insert") // deprecated
+               .addCast<PluginInsert> ("to_plugininsert")
                .addCast<SideChain> ("to_sidechain")
                .addCast<IOProcessor> ("to_ioprocessor")
                .addCast<UnknownProcessor> ("to_unknownprocessor")
@@ -1203,6 +1299,7 @@ LuaBindings::common (lua_State* L)
 #endif
                .addCast<PeakMeter> ("to_meter")
                .addFunction ("display_name", &Processor::display_name)
+               .addFunction ("display_to_user", &Processor::display_to_user)
                .addFunction ("active", &Processor::active)
                .addFunction ("activate", &Processor::activate)
                .addFunction ("deactivate", &Processor::deactivate)
@@ -1240,11 +1337,15 @@ LuaBindings::common (lua_State* L)
                .addFunction ("name", &Plugin::name)
                .addFunction ("maker", &Plugin::maker)
                .addFunction ("parameter_count", &Plugin::parameter_count)
+               .addFunction ("parameter_label", &Plugin::parameter_label)
                .addRefFunction ("nth_parameter", &Plugin::nth_parameter)
                .addFunction ("preset_by_label", &Plugin::preset_by_label)
                .addFunction ("preset_by_uri", &Plugin::preset_by_uri)
                .addFunction ("load_preset", &Plugin::load_preset)
                .addFunction ("parameter_is_input", &Plugin::parameter_is_input)
+               .addFunction ("parameter_is_output", &Plugin::parameter_is_output)
+               .addFunction ("parameter_is_control", &Plugin::parameter_is_control)
+               .addFunction ("parameter_is_audio", &Plugin::parameter_is_audio)
                .addFunction ("get_docs", &Plugin::get_docs)
                .addFunction ("get_info", &Plugin::get_info)
                .addFunction ("get_parameter_docs", &Plugin::get_parameter_docs)
@@ -1273,6 +1374,7 @@ LuaBindings::common (lua_State* L)
 
                .deriveWSPtrClass <AutomationControl, PBD::Controllable> ("AutomationControl")
                .addCast<Evoral::Control> ("to_ctrl")
+               .addCast<SlavableAutomationControl> ("to_slavable")
                .addFunction ("automation_state", &AutomationControl::automation_state)
                .addFunction ("automation_style", &AutomationControl::automation_style)
                .addFunction ("set_automation_state", &AutomationControl::set_automation_state)
@@ -1386,16 +1488,25 @@ LuaBindings::common (lua_State* L)
                .beginConstStdList <boost::shared_ptr<Route> > ("RouteList")
                .endClass ()
 
+               // StripableList == std::list<boost::shared_ptr<Stripable> >
+               .beginConstStdList <boost::shared_ptr<Stripable> > ("StripableList")
+               .endClass ()
+
+               // VCAList == std::list<boost::shared_ptr<VCA> >
+               .beginConstStdList <boost::shared_ptr<VCA> > ("VCAList")
+               .endClass ()
+
                // boost::shared_ptr<RouteList>
                .beginPtrStdList <boost::shared_ptr<Route> > ("RouteListPtr")
+               .addVoidPtrConstructor<std::list<boost::shared_ptr <Route> > > ()
                .endClass ()
 
                // typedef std::list<boost::weak_ptr <Route> > WeakRouteList
                .beginConstStdList <boost::weak_ptr<Route> > ("WeakRouteList")
                .endClass ()
 
-               // RouteList == std::list<boost::shared_ptr<Route> >
-               .beginConstStdList <RouteGroup*> ("RouteGroupList")
+               // RouteGroupList == std::list<RouteGroup*>
+               .beginConstStdCPtrList <RouteGroup> ("RouteGroupList")
                .endClass ()
 
                // typedef std::vector<boost::shared_ptr<Source> > Region::SourceList
@@ -1412,6 +1523,11 @@ LuaBindings::common (lua_State* L)
 
                // boost::shared_ptr <std::list<boost::shared_ptr<Region> > >
                .beginPtrStdList <boost::shared_ptr<Region> > ("RegionListPtr")
+               .addVoidPtrConstructor<std::list<boost::shared_ptr <Region> > > ()
+               .endClass ()
+
+               // typedef std::list<boost::shared_ptr<Processor> > ProcessorList;
+               .beginStdList <boost::shared_ptr<Processor> > ("ProcessorList")
                .endClass ()
 
                //std::list<boost::shared_ptr<Port> > PortList;
@@ -1425,6 +1541,20 @@ LuaBindings::common (lua_State* L)
                .beginConstStdList <Location*> ("LocationList")
                .endClass ()
 
+               // std::list<boost::shared_ptr<AutomationControl> > ControlList;
+               .beginStdList <boost::shared_ptr<AutomationControl> > ("ControlList")
+               .endClass ()
+
+               .beginPtrStdList <boost::shared_ptr<AutomationControl> > ("ControlListPtr")
+               .addVoidPtrConstructor<std::list<boost::shared_ptr <AutomationControl> > > ()
+               .endClass ()
+
+               .beginStdList <boost::shared_ptr<Evoral::Note<Evoral::Beats> > > ("NotePtrList")
+               .endClass ()
+
+               .beginConstStdList <Evoral::ControlEvent*> ("EventList")
+               .endClass ()
+
 #if 0  // depends on Evoal:: Note, Beats see note_fixer.h
        // typedef Evoral::Note<Evoral::Beats> Note;
        // std::set< boost::weak_ptr<Note> >
@@ -1437,7 +1567,7 @@ LuaBindings::common (lua_State* L)
                .endClass ()
 
                .beginClass <Tempo> ("Tempo")
-               .addConstructor <void (*) (double, double)> ()
+               .addConstructor <void (*) (double, double, double)> ()
                .addFunction ("note_type", &Tempo::note_type)
                .addFunction ("note_types_per_minute",  (double (Tempo::*)() const)&Tempo::note_types_per_minute)
                .addFunction ("quarter_notes_per_minute", &Tempo::quarter_notes_per_minute)
@@ -1453,6 +1583,18 @@ LuaBindings::common (lua_State* L)
                .addFunction ("frames_per_grid", &Meter::frames_per_grid)
                .endClass ()
 
+               .beginClass <BeatsFramesConverter> ("BeatsFramesConverter")
+               .addConstructor <void (*) (const TempoMap&, framepos_t)> ()
+               .addFunction ("to", &BeatsFramesConverter::to)
+               .addFunction ("from", &BeatsFramesConverter::from)
+               .endClass ()
+
+               .beginClass <DoubleBeatsFramesConverter> ("DoubleBeatsFramesConverter")
+               .addConstructor <void (*) (const TempoMap&, framepos_t)> ()
+               .addFunction ("to", &DoubleBeatsFramesConverter::to)
+               .addFunction ("from", &DoubleBeatsFramesConverter::from)
+               .endClass ()
+
                .beginClass <TempoMap> ("TempoMap")
                .addFunction ("add_tempo", &TempoMap::add_tempo)
                .addFunction ("add_meter", &TempoMap::add_meter)
@@ -1463,6 +1605,8 @@ LuaBindings::common (lua_State* L)
                .addFunction ("bbt_at_frame", &TempoMap::bbt_at_frame)
                .addFunction ("exact_beat_at_frame", &TempoMap::exact_beat_at_frame)
                .addFunction ("exact_qn_at_frame", &TempoMap::exact_qn_at_frame)
+               .addFunction ("framepos_plus_qn", &TempoMap::framepos_plus_qn)
+               .addFunction ("framewalk_to_qn", &TempoMap::framewalk_to_qn)
                .endClass ()
 
                .beginClass <MetricSection> ("MetricSection")
@@ -1519,7 +1663,6 @@ LuaBindings::common (lua_State* L)
                .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))
@@ -1591,6 +1734,13 @@ LuaBindings::common (lua_State* L)
                .addConst ("PostFader", ARDOUR::Placement(PostFader))
                .endNamespace ()
 
+               .beginNamespace ("MonitorChoice")
+               .addConst ("MonitorAuto", ARDOUR::MonitorChoice(MonitorAuto))
+               .addConst ("MonitorInput", ARDOUR::MonitorChoice(MonitorInput))
+               .addConst ("MonitorDisk", ARDOUR::MonitorChoice(MonitorDisk))
+               .addConst ("MonitorCue", ARDOUR::MonitorChoice(MonitorCue))
+               .endNamespace ()
+
                .beginNamespace ("NoteMode")
                .addConst ("Sustained", ARDOUR::NoteMode(Sustained))
                .addConst ("Percussive", ARDOUR::NoteMode(Percussive))
@@ -1617,6 +1767,17 @@ LuaBindings::common (lua_State* L)
                .addConst ("SharePlaylist", ARDOUR::PlaylistDisposition(SharePlaylist))
                .endNamespace ()
 
+               .beginNamespace ("MidiTrackNameSource")
+               .addConst ("SMFTrackNumber", ARDOUR::MidiTrackNameSource(SMFTrackNumber))
+               .addConst ("SMFTrackName", ARDOUR::MidiTrackNameSource(SMFTrackName))
+               .addConst ("SMFInstrumentName", ARDOUR::MidiTrackNameSource(SMFInstrumentName))
+               .endNamespace ()
+
+               .beginNamespace ("MidiTempoMapDisposition")
+               .addConst ("SMFTempoIgnore", ARDOUR::MidiTrackNameSource(SMFTempoIgnore))
+               .addConst ("SMFTempoUse", ARDOUR::MidiTrackNameSource(SMFTempoUse))
+               .endNamespace ()
+
                .beginNamespace ("RegionPoint")
                .addConst ("Start", ARDOUR::RegionPoint(Start))
                .addConst ("End", ARDOUR::RegionPoint(End))
@@ -1677,7 +1838,7 @@ LuaBindings::common (lua_State* L)
                .beginClass <AudioBackendInfo> ("AudioBackendInfo")
                .addData ("name", &AudioBackendInfo::name)
                .endClass()
-               .beginStdVector <const AudioBackendInfo*> ("BackendVector").endClass ()
+               .beginConstStdVector <const AudioBackendInfo*> ("BackendVector").endClass ()
 
                .beginClass <AudioBackend::DeviceStatus> ("DeviceStatus")
                .addData ("name", &AudioBackend::DeviceStatus::name)
@@ -1750,6 +1911,15 @@ LuaBindings::common (lua_State* L)
                .addFunction ("get_last_backend_error", &AudioEngine::get_last_backend_error)
                .endClass()
 
+               .deriveClass <VCAManager, PBD::StatefulDestructible> ("VCAManager")
+#if 0 // needs non-const VCAManager reference
+               .addFunction ("create_vca", &VCAManager::create_vca)
+               .addFunction ("remove_vca", &VCAManager::remove_vca)
+#endif
+               .addFunction ("vca_by_number", &VCAManager::vca_by_number)
+               .addFunction ("vcas", &VCAManager::vcas)
+               .endClass()
+
                .deriveClass <SessionConfiguration, PBD::Configuration> ("SessionConfiguration")
 #undef  CONFIG_VARIABLE
 #undef  CONFIG_VARIABLE_SPECIAL
@@ -1819,8 +1989,17 @@ LuaBindings::common (lua_State* L)
                .addFunction ("snap_name", &Session::snap_name)
                .addFunction ("monitor_out", &Session::monitor_out)
                .addFunction ("master_out", &Session::master_out)
+               .addFunction ("add_internal_sends", &Session::add_internal_sends)
                .addFunction ("tempo_map", (TempoMap& (Session::*)())&Session::tempo_map)
                .addFunction ("locations", &Session::locations)
+               .addFunction ("soloing", &Session::soloing)
+               .addFunction ("listening", &Session::listening)
+               .addFunction ("solo_isolated", &Session::solo_isolated)
+               .addFunction ("cancel_all_solo", &Session::cancel_all_solo)
+               .addFunction ("clear_all_solo_state", &Session::clear_all_solo_state)
+               .addFunction ("set_controls", &Session::set_controls)
+               .addFunction ("set_control", &Session::set_control)
+               .addFunction ("set_exclusive_input_active", &Session::set_exclusive_input_active)
                .addFunction ("begin_reversible_command", (void (Session::*)(const std::string&))&Session::begin_reversible_command)
                .addFunction ("commit_reversible_command", &Session::commit_reversible_command)
                .addFunction ("abort_reversible_command", &Session::abort_reversible_command)
@@ -1835,7 +2014,10 @@ LuaBindings::common (lua_State* L)
                .addFunction ("cfg", &Session::cfg)
                .addFunction ("route_groups", &Session::route_groups)
                .addFunction ("new_route_group", &Session::new_route_group)
+               .addFunction ("end_is_free", &Session::end_is_free)
+               .addFunction ("set_end_is_free", &Session::set_end_is_free)
                .addFunction ("remove_route_group", (void (Session::*)(RouteGroup*))&Session::remove_route_group)
+               .addFunction ("vca_manager", &Session::vca_manager)
                .addExtCFunction ("timecode_to_sample_lua", ARDOUR::LuaAPI::timecode_to_sample_lua)
                .addExtCFunction ("sample_to_timecode_lua", ARDOUR::LuaAPI::sample_to_timecode_lua)
                .endClass ()
@@ -1875,13 +2057,17 @@ LuaBindings::common (lua_State* L)
                .addFunction ("new_plugin", ARDOUR::LuaAPI::new_plugin)
                .addFunction ("set_processor_param", ARDOUR::LuaAPI::set_processor_param)
                .addFunction ("set_plugin_insert_param", ARDOUR::LuaAPI::set_plugin_insert_param)
+               .addFunction ("reset_processor_to_default", ARDOUR::LuaAPI::reset_processor_to_default)
                .addRefFunction ("get_processor_param", ARDOUR::LuaAPI::get_processor_param)
                .addRefFunction ("get_plugin_insert_param", ARDOUR::LuaAPI::get_plugin_insert_param)
                .addCFunction ("plugin_automation", ARDOUR::LuaAPI::plugin_automation)
                .addCFunction ("hsla_to_rgba", ARDOUR::LuaAPI::hsla_to_rgba)
+               .addCFunction ("color_to_rgba", ARDOUR::LuaAPI::color_to_rgba)
                .addFunction ("usleep", Glib::usleep)
+               .addFunction ("monotonic_time", ::g_get_monotonic_time)
                .addCFunction ("build_filename", ARDOUR::LuaAPI::build_filename)
                .addFunction ("new_noteptr", ARDOUR::LuaAPI::new_noteptr)
+               .addFunction ("note_list", ARDOUR::LuaAPI::note_list)
                .addCFunction ("sample_to_timecode", ARDOUR::LuaAPI::sample_to_timecode)
                .addCFunction ("timecode_to_sample", ARDOUR::LuaAPI::timecode_to_sample)
 
@@ -2059,6 +2245,7 @@ LuaBindings::session (lua_State* L)
                .addFunction ("save_state", &Session::save_state)
                .addFunction ("set_dirty", &Session::set_dirty)
                .addFunction ("unknown_processors", &Session::unknown_processors)
+               .addFunction ("export_track_state", &Session::export_track_state)
 
                .addFunction<RouteList (Session::*)(uint32_t, PresentationInfo::order_t, const std::string&, const std::string&, PlaylistDisposition)> ("new_route_from_template", &Session::new_route_from_template)
                // TODO  session_add_audio_track  session_add_midi_track  session_add_mixed_track