NOOP: spacing and indentation
[ardour.git] / libs / ardour / luabindings.cc
index 89d132015c43409ade1b526bae1942b8276182d9..6bacc9b7cacd8ec5fa6d83d06c85ee8e988ab9b7 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "timecode/bbt_time.h"
 #include "pbd/stateful_diff_command.h"
+#include "pbd/openuri.h"
 #include "evoral/Control.hpp"
 #include "evoral/ControlList.hpp"
 #include "evoral/Range.hpp"
@@ -35,6 +36,7 @@
 #include "ardour/chan_mapping.h"
 #include "ardour/dB.h"
 #include "ardour/dsp_filter.h"
+#include "ardour/fluid_synth.h"
 #include "ardour/interthread_info.h"
 #include "ardour/lua_api.h"
 #include "ardour/luabindings.h"
@@ -154,7 +156,7 @@ namespace Cairo {
 CLASSKEYS(Cairo::Context);
 CLASSKEYS(std::vector<double>);
 CLASSKEYS(std::list<ArdourMarker*>);
-CLASSKEYS(std::bitset<46ul>); // LuaSignal::LAST_SIGNAL
+CLASSKEYS(std::bitset<47ul>); // LuaSignal::LAST_SIGNAL
 CLASSKEYS(ArdourMarker*);
 CLASSKEYS(ARDOUR::RouteGroup);
 CLASSKEYS(ARDOUR::LuaProc);
@@ -166,17 +168,26 @@ CLASSKEYS(boost::shared_ptr<ARDOUR::AutomationList>);
 CLASSKEYS(boost::shared_ptr<Evoral::ControlList>);
 CLASSKEYS(ARDOUR::LuaOSC::Address);
 CLASSKEYS(ARDOUR::Session);
+CLASSKEYS(ARDOUR::PeakMeter);
 CLASSKEYS(ARDOUR::BufferSet);
 CLASSKEYS(ARDOUR::ChanMapping);
+CLASSKEYS(ARDOUR::FluidSynth);
 CLASSKEYS(ARDOUR::DSP::DspShm);
 CLASSKEYS(ARDOUR::LuaTableRef);
+CLASSKEYS(PBD::Configuration);
+CLASSKEYS(ARDOUR::PresentationInfo);
+CLASSKEYS(ARDOUR::SessionConfiguration);
 CLASSKEYS(PBD::ID);
 CLASSKEYS(ARDOUR::Location);
 CLASSKEYS(ARDOUR::PluginInfo);
+CLASSKEYS(ARDOUR::MonitorProcessor);
+CLASSKEYS(ARDOUR::Plugin::PresetRecord);
+CLASSKEYS(std::vector<ARDOUR::Plugin::PresetRecord>);
 CLASSKEYS(PBD::PropertyChange);
 CLASSKEYS(std::vector<std::string>);
 CLASSKEYS(std::list<boost::shared_ptr<ARDOUR::Route> >);
 CLASSKEYS(std::list<boost::shared_ptr<ARDOUR::Port> >);
+CLASSKEYS(std::vector<boost::shared_ptr<ARDOUR::Processor> >);
 CLASSKEYS(boost::shared_ptr<ARDOUR::PluginInfo>);
 CLASSKEYS(boost::shared_ptr<ARDOUR::Region>);
 CLASSKEYS(boost::weak_ptr<ARDOUR::Route>);
@@ -188,6 +199,7 @@ CLASSKEYS(ARDOUR::PortManager);
 CLASSKEYS(ARDOUR::AudioEngine);
 CLASSKEYS(void);
 CLASSKEYS(float);
+CLASSKEYS(unsigned char);
 
 #endif // end windows special case
 
@@ -245,6 +257,10 @@ LuaBindings::common (lua_State* L)
 {
        luabridge::getGlobalNamespace (L)
                .beginNamespace ("PBD")
+
+               .addFunction ("open_uri", (bool (*) (const std::string&))&PBD::open_uri)
+               .addFunction ("open_uri", &PBD::open_folder)
+
                .beginClass <PBD::ID> ("ID")
                .addConstructor <void (*) (std::string)> ()
                .addFunction ("to_s", &PBD::ID::to_s) // TODO special case LUA __tostring ?
@@ -271,6 +287,9 @@ LuaBindings::common (lua_State* L)
                .deriveClass <PBD::StatefulDestructible, PBD::Stateful> ("StatefulDestructible")
                .endClass ()
 
+               .deriveClass <PBD::Configuration, PBD::Stateful> ("Configuration")
+               .endClass()
+
                .deriveWSPtrClass <PBD::StatefulDestructible, PBD::Stateful> ("StatefulDestructiblePtr")
                .endClass ()
 
@@ -348,6 +367,21 @@ LuaBindings::common (lua_State* L)
                .beginClass <Timecode::BBT_Time> ("BBT_TIME")
                .addConstructor <void (*) (uint32_t, uint32_t, uint32_t)> ()
                .endClass ()
+
+               /* libtimecode enums */
+               .beginNamespace ("TimecodeFormat")
+               .addConst ("TC23976", Timecode::TimecodeFormat(Timecode::timecode_23976))
+               .addConst ("TC24", Timecode::TimecodeFormat(Timecode::timecode_24))
+               .addConst ("TC24976", Timecode::TimecodeFormat(Timecode::timecode_24976))
+               .addConst ("TC25", Timecode::TimecodeFormat(Timecode::timecode_25))
+               .addConst ("TC2997", Timecode::TimecodeFormat(Timecode::timecode_2997))
+               .addConst ("TC2997DF", Timecode::TimecodeFormat(Timecode::timecode_2997drop))
+               .addConst ("TC2997000", Timecode::TimecodeFormat(Timecode::timecode_2997000))
+               .addConst ("TC2997000DF", Timecode::TimecodeFormat(Timecode::timecode_2997000drop))
+               .addConst ("TC30", Timecode::TimecodeFormat(Timecode::timecode_30))
+               .addConst ("TC5994", Timecode::TimecodeFormat(Timecode::timecode_5994))
+               .addConst ("TC60", Timecode::TimecodeFormat(Timecode::timecode_60))
+               .endNamespace ()
                .endNamespace ();
 
        luabridge::getGlobalNamespace (L)
@@ -425,6 +459,16 @@ LuaBindings::common (lua_State* L)
 
                .beginWSPtrClass <PluginInfo> ("PluginInfo")
                .addVoidConstructor ()
+               .addData ("name", &PluginInfo::name, false)
+               .addData ("category", &PluginInfo::category, false)
+               .addData ("creator", &PluginInfo::creator, false)
+               .addData ("path", &PluginInfo::path, false)
+               .addData ("n_inputs", &PluginInfo::n_inputs, false)
+               .addData ("n_outputs", &PluginInfo::n_outputs, false)
+               .addData ("type", &PluginInfo::type, false)
+               .addData ("unique_id", &PluginInfo::unique_id, false)
+               .addFunction ("is_instrument", &PluginInfo::is_instrument)
+               .addFunction ("get_presets", &PluginInfo::get_presets)
                .endClass ()
 
                .beginNamespace ("Route")
@@ -484,8 +528,10 @@ LuaBindings::common (lua_State* L)
                .endClass ()
 
                .deriveClass <Location, PBD::StatefulDestructible> ("Location")
+               .addFunction ("name", &Location::name)
                .addFunction ("locked", &Location::locked)
                .addFunction ("lock", &Location::lock)
+               .addFunction ("unlock", &Location::unlock)
                .addFunction ("start", &Location::start)
                .addFunction ("_end", &Location::end) // XXX "end" is a lua reserved word
                .addFunction ("length", &Location::length)
@@ -493,15 +539,26 @@ LuaBindings::common (lua_State* L)
                .addFunction ("set_end", &Location::set_end)
                .addFunction ("set_length", &Location::set)
                .addFunction ("move_to", &Location::move_to)
+               .addFunction ("matches", &Location::matches)
+               .addFunction ("flags", &Location::flags)
+               .addFunction ("is_auto_punch", &Location::is_auto_punch)
+               .addFunction ("is_auto_loop", &Location::is_auto_loop)
+               .addFunction ("is_mark", &Location::is_mark)
+               .addFunction ("is_hidden", &Location::is_hidden)
+               .addFunction ("is_cd_marker", &Location::is_cd_marker)
+               .addFunction ("is_session_range", &Location::is_session_range)
+               .addFunction ("is_range_marker", &Location::is_range_marker)
                .endClass ()
 
                .deriveClass <Locations, PBD::StatefulDestructible> ("Locations")
+               .addFunction ("list", static_cast<Locations::LocationList (Locations::*)()>(&Locations::list))
                .addFunction ("auto_loop_location", &Locations::auto_loop_location)
                .addFunction ("auto_punch_location", &Locations::auto_punch_location)
                .addFunction ("session_range_location", &Locations::session_range_location)
                .addFunction ("first_mark_after", &Locations::first_mark_after)
                .addFunction ("first_mark_before", &Locations::first_mark_before)
                .addFunction ("first_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)
                .endClass ()
@@ -571,6 +628,12 @@ LuaBindings::common (lua_State* L)
                // stub RouteGroup* is needed for new_audio_track()
                .endClass ()
 
+               .deriveClass <PresentationInfo, PBD::Stateful> ("PresentationInfo")
+               .addFunction ("color", &PresentationInfo::color)
+               .addFunction ("set_color", &PresentationInfo::set_color)
+               .addFunction ("order", &PresentationInfo::order)
+               .endClass ()
+
                .deriveWSPtrClass <Stripable, SessionObject> ("Stripable")
                .addCast<Route> ("to_route")
                .addFunction ("is_auditioner", &Stripable::is_auditioner)
@@ -587,6 +650,35 @@ LuaBindings::common (lua_State* L)
                .addFunction ("trim_control", &Stripable::trim_control)
                .addFunction ("rec_enable_control", &Stripable::rec_enable_control)
                .addFunction ("rec_safe_control", &Stripable::rec_safe_control)
+               .addFunction ("pan_azimuth_control", &Stripable::pan_azimuth_control)
+               .addFunction ("pan_elevation_control", &Stripable::pan_elevation_control)
+               .addFunction ("pan_width_control", &Stripable::pan_width_control)
+               .addFunction ("pan_frontback_control", &Stripable::pan_frontback_control)
+               .addFunction ("pan_lfe_control", &Stripable::pan_lfe_control)
+               .addFunction ("send_level_control", &Stripable::send_level_controllable)
+               .addFunction ("send_enable_control", &Stripable::send_level_controllable)
+               .addFunction ("send_name", &Stripable::send_name)
+               .addFunction ("monitor_control", &Stripable::monitor_control)
+               .addFunction ("master_send_enable_control ", &Stripable::master_send_enable_controllable )
+               .addFunction ("comp_enable_control ", &Stripable::comp_enable_controllable )
+               .addFunction ("comp_threshold_control ", &Stripable::comp_threshold_controllable )
+               .addFunction ("comp_speed_control ", &Stripable::comp_speed_controllable )
+               .addFunction ("comp_mode_control ", &Stripable::comp_mode_controllable )
+               .addFunction ("comp_makeup_control ", &Stripable::comp_makeup_controllable )
+               .addFunction ("comp_redux_control ", &Stripable::comp_redux_controllable )
+               .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_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 ("set_presentation_order", &Stripable::set_presentation_order)
+               .addFunction ("presentation_info_ptr", &Stripable::presentation_info_ptr)
+
                .endClass ()
 
                .deriveWSPtrClass <Route, Stripable> ("Route")
@@ -615,6 +707,8 @@ LuaBindings::common (lua_State* L)
                .addFunction ("soloed", &Route::soloed)
                .addFunction ("amp", &Route::amp)
                .addFunction ("trim", &Route::trim)
+               .addFunction ("peak_meter", (boost::shared_ptr<PeakMeter> (Route::*)())&Route::peak_meter)
+               .addFunction ("set_meter_point", &Route::set_meter_point)
                .endClass ()
 
                .deriveWSPtrClass <Playlist, SessionObject> ("Playlist")
@@ -734,6 +828,8 @@ LuaBindings::common (lua_State* L)
                .addData ("valid", &Plugin::PresetRecord::valid, false)
                .endClass ()
 
+               .beginStdVector <Plugin::PresetRecord> ("PresetVector").endClass ()
+
                .deriveWSPtrClass <Automatable, Evoral::ControlSet> ("Automatable")
                .addFunction ("automation_control", (boost::shared_ptr<AutomationControl>(Automatable::*)(const Evoral::Parameter&, bool))&Automatable::automation_control)
                .endClass ()
@@ -742,8 +838,11 @@ LuaBindings::common (lua_State* L)
                .addVoidConstructor ()
                .addData ("label", &ParameterDescriptor::label)
                .addData ("logarithmic", &ParameterDescriptor::logarithmic)
+               .addStaticFunction ("midi_note_name", &ParameterDescriptor::midi_note_name)
                .endClass ()
 
+               .beginStdVector <boost::shared_ptr<ARDOUR::Processor> > ("ProcessorVector").endClass ()
+
                .deriveWSPtrClass <Processor, SessionObject> ("Processor")
                .addCast<Automatable> ("to_automatable")
                .addCast<PluginInsert> ("to_insert")
@@ -751,8 +850,9 @@ LuaBindings::common (lua_State* L)
                .addCast<IOProcessor> ("to_ioprocessor")
                .addCast<UnknownProcessor> ("to_unknownprocessor")
                .addCast<Amp> ("to_amp")
-#if 0 // those objects are not yet bound
+               .addCast<PeakMeter> ("to_peakmeter")
                .addCast<MonitorProcessor> ("to_monitorprocessor")
+#if 0 // those objects are not yet bound
                .addCast<CapturingProcessor> ("to_capturingprocessor")
                .addCast<DelayLine> ("to_delayline")
                .addCast<PeakMeter> ("to_meter")
@@ -787,6 +887,7 @@ LuaBindings::common (lua_State* L)
                .addFunction ("load_preset", &Plugin::load_preset)
                .addFunction ("parameter_is_input", &Plugin::parameter_is_input)
                .addFunction ("get_docs", &Plugin::get_docs)
+               .addFunction ("get_info", &Plugin::get_info)
                .addFunction ("get_parameter_docs", &Plugin::get_parameter_docs)
                .addRefFunction ("get_parameter_descriptor", &Plugin::get_parameter_descriptor)
                .endClass ()
@@ -860,6 +961,41 @@ LuaBindings::common (lua_State* L)
                .addFunction ("gain_control", (boost::shared_ptr<GainControl>(Amp::*)())&Amp::gain_control)
                .endClass ()
 
+               .deriveWSPtrClass <PeakMeter, Processor> ("PeakMeter")
+               .addFunction ("meter_level", &PeakMeter::meter_level)
+               .addFunction ("set_type", &PeakMeter::set_type)
+               .addFunction ("reset_max", &PeakMeter::reset_max)
+               .endClass ()
+
+               .deriveWSPtrClass <MonitorProcessor, Processor> ("MonitorProcessor")
+               .addFunction ("set_cut_all", &MonitorProcessor::set_cut_all)
+               .addFunction ("set_dim_all", &MonitorProcessor::set_dim_all)
+               .addFunction ("set_polarity", &MonitorProcessor::set_polarity)
+               .addFunction ("set_cut", &MonitorProcessor::set_cut)
+               .addFunction ("set_dim", &MonitorProcessor::set_dim)
+               .addFunction ("set_solo", &MonitorProcessor::set_solo)
+               .addFunction ("set_mono", &MonitorProcessor::set_mono)
+               .addFunction ("dim_level", &MonitorProcessor::dim_level)
+               .addFunction ("solo_boost_level", &MonitorProcessor::solo_boost_level)
+               .addFunction ("dimmed", &MonitorProcessor::dimmed)
+               .addFunction ("soloed", &MonitorProcessor::soloed)
+               .addFunction ("inverted", &MonitorProcessor::inverted)
+               .addFunction ("cut", &MonitorProcessor::cut)
+               .addFunction ("cut_all", &MonitorProcessor::cut_all)
+               .addFunction ("dim_all", &MonitorProcessor::dim_all)
+               .addFunction ("mono", &MonitorProcessor::mono)
+               .addFunction ("monitor_active", &MonitorProcessor::monitor_active)
+               .addFunction ("channel_cut_control", &MonitorProcessor::channel_cut_control)
+               .addFunction ("channel_dim_control", &MonitorProcessor::channel_dim_control)
+               .addFunction ("channel_polarity_control", &MonitorProcessor::channel_polarity_control)
+               .addFunction ("channel_solo_control", &MonitorProcessor::channel_solo_control)
+               .addFunction ("dim_control", &MonitorProcessor::dim_control)
+               .addFunction ("cut_control", &MonitorProcessor::cut_control)
+               .addFunction ("mono_control", &MonitorProcessor::mono_control)
+               .addFunction ("dim_level_control", &MonitorProcessor::dim_level_control)
+               .addFunction ("solo_boost_control", &MonitorProcessor::solo_boost_control)
+               .endClass ()
+
                .deriveWSPtrClass <UnknownProcessor, Processor> ("UnknownProcessor")
                .endClass ()
 
@@ -1038,6 +1174,31 @@ LuaBindings::common (lua_State* L)
                .addConst ("SrcBest", ARDOUR::SrcQuality(SrcBest))
                .endNamespace ()
 
+               .beginNamespace ("MeterType")
+               .addConst ("MeterMaxSignal", ARDOUR::MeterType(MeterMaxSignal))
+               .addConst ("MeterMaxPeak", ARDOUR::MeterType(MeterMaxPeak))
+               .addConst ("MeterPeak", ARDOUR::MeterType(MeterPeak))
+               .addConst ("MeterKrms", ARDOUR::MeterType(MeterKrms))
+               .addConst ("MeterK20", ARDOUR::MeterType(MeterK20))
+               .addConst ("MeterK14", ARDOUR::MeterType(MeterK14))
+               .addConst ("MeterIEC1DIN", ARDOUR::MeterType(MeterIEC1DIN))
+               .addConst ("MeterIEC1NOR", ARDOUR::MeterType(MeterIEC1NOR))
+               .addConst ("MeterIEC2BBC", ARDOUR::MeterType(MeterIEC2BBC))
+               .addConst ("MeterIEC2EBU", ARDOUR::MeterType(MeterIEC2EBU))
+               .addConst ("MeterVU", ARDOUR::MeterType(MeterVU))
+               .addConst ("MeterK12", ARDOUR::MeterType(MeterK12))
+               .addConst ("MeterPeak0dB", ARDOUR::MeterType(MeterPeak0dB))
+               .addConst ("MeterMCP", ARDOUR::MeterType(MeterMCP))
+               .endNamespace ()
+
+               .beginNamespace ("MeterPoint")
+               .addConst ("MeterInput", ARDOUR::MeterPoint(MeterInput))
+               .addConst ("MeterPreFader", ARDOUR::MeterPoint(MeterPreFader))
+               .addConst ("MeterPostFader", ARDOUR::MeterPoint(MeterPostFader))
+               .addConst ("MeterOutput", ARDOUR::MeterPoint(MeterOutput))
+               .addConst ("MeterCustom", ARDOUR::MeterPoint(MeterCustom))
+               .endNamespace ()
+
                .beginNamespace ("PortFlags")
                .addConst ("IsInput", ARDOUR::PortFlags(IsInput))
                .addConst ("IsOutput", ARDOUR::PortFlags(IsOutput))
@@ -1077,6 +1238,34 @@ LuaBindings::common (lua_State* L)
                .addConst ("NonLayered", ARDOUR::TrackMode(NonLayered))
                .addConst ("Destructive", ARDOUR::TrackMode(Destructive))
                .endNamespace ()
+
+               .beginNamespace ("SampleFormat")
+               .addConst ("Float", ARDOUR::SampleFormat(FormatFloat))
+               .addConst ("Int24", ARDOUR::SampleFormat(FormatInt24))
+               .addConst ("Int16", ARDOUR::SampleFormat(FormatInt16))
+               .endNamespace ()
+
+               .beginNamespace ("HeaderFormat")
+               .addConst ("BWF", ARDOUR::HeaderFormat(BWF))
+               .addConst ("WAVE", ARDOUR::HeaderFormat(WAVE))
+               .addConst ("WAVE64", ARDOUR::HeaderFormat(WAVE64))
+               .addConst ("CAF", ARDOUR::HeaderFormat(CAF))
+               .addConst ("AIFF", ARDOUR::HeaderFormat(AIFF))
+               .addConst ("iXML", ARDOUR::HeaderFormat(iXML))
+               .addConst ("RF64", ARDOUR::HeaderFormat(RF64))
+               .addConst ("RF64_WAV", ARDOUR::HeaderFormat(RF64_WAV))
+               .addConst ("MBWF", ARDOUR::HeaderFormat(MBWF))
+               .endNamespace ()
+
+               .beginNamespace ("InsertMergePolicy")
+               .addConst ("Reject", ARDOUR::InsertMergePolicy(InsertMergeReject))
+               .addConst ("Relax", ARDOUR::InsertMergePolicy(InsertMergeRelax))
+               .addConst ("Replace", ARDOUR::InsertMergePolicy(InsertMergeReplace))
+               .addConst ("TruncateExisting", ARDOUR::InsertMergePolicy(InsertMergeTruncateExisting))
+               .addConst ("TruncateAddition", ARDOUR::InsertMergePolicy(InsertMergeTruncateAddition))
+               .addConst ("Extend", ARDOUR::InsertMergePolicy(InsertMergeExtend))
+               .endNamespace ()
+
                .endNamespace (); // end ARDOUR
 
        luabridge::getGlobalNamespace (L)
@@ -1156,6 +1345,25 @@ LuaBindings::common (lua_State* L)
                .addFunction ("set_buffer_size", &AudioEngine::set_buffer_size)
                .addFunction ("get_last_backend_error", &AudioEngine::get_last_backend_error)
                .endClass()
+
+               .deriveClass <SessionConfiguration, PBD::Configuration> ("SessionConfiguration")
+#undef  CONFIG_VARIABLE
+#undef  CONFIG_VARIABLE_SPECIAL
+#define CONFIG_VARIABLE(Type,var,name,value) \
+               .addFunction ("get_" # var, &SessionConfiguration::get_##var) \
+               .addFunction ("set_" # var, &SessionConfiguration::set_##var) \
+               .addProperty (#var, &SessionConfiguration::get_##var, &SessionConfiguration::set_##var)
+
+#define CONFIG_VARIABLE_SPECIAL(Type,var,name,value,mutator) \
+               .addFunction ("get_" # var, &SessionConfiguration::get_##var) \
+               .addFunction ("set_" # var, &SessionConfiguration::set_##var) \
+               .addProperty (#var, &SessionConfiguration::get_##var, &SessionConfiguration::set_##var)
+
+#include "ardour/session_configuration_vars.h"
+
+#undef CONFIG_VARIABLE
+#undef CONFIG_VARIABLE_SPECIAL
+               .endClass()
                .endNamespace ();
 
        // basic representation of Session
@@ -1176,6 +1384,8 @@ LuaBindings::common (lua_State* L)
                .addFunction ("timecode_drop_frames", &Session::timecode_drop_frames)
                .addFunction ("request_locate", &Session::request_locate)
                .addFunction ("request_stop", &Session::request_stop)
+               .addFunction ("request_play_loop", &Session::request_play_loop)
+               .addFunction ("get_play_loop", &Session::get_play_loop)
                .addFunction ("last_transport_start", &Session::last_transport_start)
                .addFunction ("goto_start", &Session::goto_start)
                .addFunction ("goto_end", &Session::goto_end)
@@ -1191,6 +1401,8 @@ LuaBindings::common (lua_State* L)
                .addFunction ("name", &Session::name)
                .addFunction ("path", &Session::path)
                .addFunction ("record_status", &Session::record_status)
+               .addFunction ("maybe_enable_record", &Session::maybe_enable_record)
+               .addFunction ("disable_record", &Session::disable_record)
                .addFunction ("route_by_id", &Session::route_by_id)
                .addFunction ("route_by_name", &Session::route_by_name)
                .addFunction ("get_remote_nth_stripable", &Session::get_remote_nth_stripable)
@@ -1216,6 +1428,7 @@ LuaBindings::common (lua_State* L)
                .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 ("cfg", &Session::cfg)
                .endClass ()
 
                .beginClass <RegionFactory> ("RegionFactory")
@@ -1256,6 +1469,7 @@ LuaBindings::common (lua_State* L)
                .addCFunction ("plugin_automation", ARDOUR::LuaAPI::plugin_automation)
                .addCFunction ("hsla_to_rgba", ARDOUR::LuaAPI::hsla_to_rgba)
                .addFunction ("usleep", Glib::usleep)
+               .addCFunction ("build_filename", ARDOUR::LuaAPI::build_filename)
                .endNamespace () // end LuaAPI
                .endNamespace ();// end ARDOUR
 }
@@ -1278,6 +1492,10 @@ LuaBindings::dsp (lua_State* L)
                .beginClass <MidiBuffer> ("MidiBuffer")
                .addEqualCheck ()
                .addFunction ("silence", &MidiBuffer::silence)
+               .addFunction ("size", &MidiBuffer::size)
+               .addFunction ("empty", &MidiBuffer::empty)
+               .addFunction ("resize", &MidiBuffer::resize)
+               .addFunction ("copy", (void (MidiBuffer::*)(MidiBuffer const * const))&MidiBuffer::copy)
                .addFunction ("push_event", (bool (MidiBuffer::*)(const Evoral::MIDIEvent<framepos_t>&))&MidiBuffer::push_back)
                .addFunction ("push_back", (bool (MidiBuffer::*)(framepos_t, size_t, const uint8_t*))&MidiBuffer::push_back)
                // TODO iterators..
@@ -1299,6 +1517,7 @@ LuaBindings::dsp (lua_State* L)
                .addFunction ("size", &Evoral::Event<framepos_t>::size)
                .addFunction ("set_buffer", &Evoral::Event<framepos_t>::set_buffer)
                .addFunction ("buffer", (uint8_t*(Evoral::Event<framepos_t>::*)())&Evoral::Event<framepos_t>::buffer)
+               .addFunction ("time", (framepos_t (Evoral::Event<framepos_t>::*)())&Evoral::MIDIEvent<framepos_t>::time)
                .endClass ()
 
                .beginClass <Evoral::Beats> ("Beats")
@@ -1323,6 +1542,20 @@ LuaBindings::dsp (lua_State* L)
                .endClass ()
                .endNamespace ();
 
+       luabridge::getGlobalNamespace (L)
+               .beginNamespace ("ARDOUR")
+               .beginClass <FluidSynth> ("FluidSynth")
+               .addConstructor <void (*) (float, int)> ()
+               .addFunction ("load_sf2", &FluidSynth::load_sf2)
+               .addFunction ("synth", &FluidSynth::synth)
+               .addFunction ("midi_event", &FluidSynth::midi_event)
+               .addFunction ("panic", &FluidSynth::panic)
+               .addFunction ("select_program", &FluidSynth::select_program)
+               .addFunction ("program_count", &FluidSynth::program_count)
+               .addFunction ("program_name", &FluidSynth::program_name)
+               .endClass ()
+               .endNamespace ();
+
        luabridge::getGlobalNamespace (L)
                .beginNamespace ("ARDOUR")
                .beginNamespace ("DSP")
@@ -1339,6 +1572,7 @@ LuaBindings::dsp (lua_State* L)
                .addFunction ("mmult", &DSP::mmult)
                .addFunction ("log_meter", &DSP::log_meter)
                .addFunction ("log_meter_coeff", &DSP::log_meter_coeff)
+               .addFunction ("process_map", &DSP::process_map)
                .addRefFunction ("peaks", &DSP::peaks)
 
                .beginClass <DSP::LowPass> ("LowPass")
@@ -1408,7 +1642,7 @@ LuaBindings::session (lua_State* L)
                .addFunction ("set_dirty", &Session::set_dirty)
                .addFunction ("unknown_processors", &Session::unknown_processors)
 
-               .addFunction<RouteList (Session::*)(uint32_t, const std::string&, const std::string&, PlaylistDisposition)> ("new_route_from_template", &Session::new_route_from_template)
+               .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
                //.addFunction ("new_midi_track", &Session::new_midi_track)
                .endClass ()