X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fluabindings.cc;h=d316c855c0a6514ff961a111ff4241a202b3a315;hb=935fd3b32f600d6f20c134fa2ccae78aa4781de5;hp=6f34b57f06b9dae9c0a3a62c65ea0049efa4898e;hpb=11da4a83e499db74e75d5b59973b0e52b0c1277a;p=ardour.git diff --git a/libs/ardour/luabindings.cc b/libs/ardour/luabindings.cc index 6f34b57f06..d316c855c0 100644 --- a/libs/ardour/luabindings.cc +++ b/libs/ardour/luabindings.cc @@ -36,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" @@ -169,6 +170,7 @@ CLASSKEYS(ARDOUR::LuaOSC::Address); CLASSKEYS(ARDOUR::Session); CLASSKEYS(ARDOUR::BufferSet); CLASSKEYS(ARDOUR::ChanMapping); +CLASSKEYS(ARDOUR::FluidSynth); CLASSKEYS(ARDOUR::DSP::DspShm); CLASSKEYS(ARDOUR::LuaTableRef); CLASSKEYS(PBD::Configuration); @@ -177,10 +179,14 @@ CLASSKEYS(ARDOUR::SessionConfiguration); CLASSKEYS(PBD::ID); CLASSKEYS(ARDOUR::Location); CLASSKEYS(ARDOUR::PluginInfo); +CLASSKEYS(ARDOUR::MonitorProcessor); +CLASSKEYS(ARDOUR::Plugin::PresetRecord); +CLASSKEYS(std::vector); CLASSKEYS(PBD::PropertyChange); CLASSKEYS(std::vector); CLASSKEYS(std::list >); CLASSKEYS(std::list >); +CLASSKEYS(std::vector >); CLASSKEYS(boost::shared_ptr); CLASSKEYS(boost::shared_ptr); CLASSKEYS(boost::weak_ptr); @@ -192,6 +198,7 @@ CLASSKEYS(ARDOUR::PortManager); CLASSKEYS(ARDOUR::AudioEngine); CLASSKEYS(void); CLASSKEYS(float); +CLASSKEYS(unsigned char); #endif // end windows special case @@ -359,6 +366,21 @@ LuaBindings::common (lua_State* L) .beginClass ("BBT_TIME") .addConstructor () .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) @@ -436,6 +458,16 @@ LuaBindings::common (lua_State* L) .beginWSPtrClass ("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") @@ -615,6 +647,32 @@ 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) @@ -765,6 +823,8 @@ LuaBindings::common (lua_State* L) .addData ("valid", &Plugin::PresetRecord::valid, false) .endClass () + .beginStdVector ("PresetVector").endClass () + .deriveWSPtrClass ("Automatable") .addFunction ("automation_control", (boost::shared_ptr(Automatable::*)(const Evoral::Parameter&, bool))&Automatable::automation_control) .endClass () @@ -776,6 +836,8 @@ LuaBindings::common (lua_State* L) .addStaticFunction ("midi_note_name", &ParameterDescriptor::midi_note_name) .endClass () + .beginStdVector > ("ProcessorVector").endClass () + .deriveWSPtrClass ("Processor") .addCast ("to_automatable") .addCast ("to_insert") @@ -783,8 +845,8 @@ LuaBindings::common (lua_State* L) .addCast ("to_ioprocessor") .addCast ("to_unknownprocessor") .addCast ("to_amp") -#if 0 // those objects are not yet bound .addCast ("to_monitorprocessor") +#if 0 // those objects are not yet bound .addCast ("to_capturingprocessor") .addCast ("to_delayline") .addCast ("to_meter") @@ -819,6 +881,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 () @@ -892,6 +955,35 @@ LuaBindings::common (lua_State* L) .addFunction ("gain_control", (boost::shared_ptr(Amp::*)())&Amp::gain_control) .endClass () + .deriveWSPtrClass ("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") .endClass () @@ -1109,6 +1201,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) @@ -1380,6 +1500,20 @@ LuaBindings::dsp (lua_State* L) .endClass () .endNamespace (); + luabridge::getGlobalNamespace (L) + .beginNamespace ("ARDOUR") + .beginClass ("FluidSynth") + .addConstructor () + .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") @@ -1466,7 +1600,7 @@ LuaBindings::session (lua_State* L) .addFunction ("set_dirty", &Session::set_dirty) .addFunction ("unknown_processors", &Session::unknown_processors) - .addFunction ("new_route_from_template", &Session::new_route_from_template) + .addFunction ("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 ()