2 Copyright (C) 2016 Robin Gareus <robin@gareus.org>
4 This program is free software; you can redistribute it and/or modify it
5 under the terms of the GNU General Public License as published by the Free
6 Software Foundation; either version 2 of the License, or (at your option)
9 This program is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 You should have received a copy of the GNU General Public License along
15 with this program; if not, write to the Free Software Foundation, Inc.,
16 675 Mass Ave, Cambridge, MA 02139, USA.
21 #include "timecode/bbt_time.h"
22 #include "pbd/stateful_diff_command.h"
23 #include "evoral/Control.hpp"
24 #include "evoral/ControlList.hpp"
25 #include "evoral/Range.hpp"
27 #include "ardour/amp.h"
28 #include "ardour/audioengine.h"
29 #include "ardour/audiosource.h"
30 #include "ardour/audio_backend.h"
31 #include "ardour/audio_buffer.h"
32 #include "ardour/audio_port.h"
33 #include "ardour/audio_track.h"
34 #include "ardour/buffer_set.h"
35 #include "ardour/chan_mapping.h"
36 #include "ardour/dB.h"
37 #include "ardour/dsp_filter.h"
38 #include "ardour/interthread_info.h"
39 #include "ardour/lua_api.h"
40 #include "ardour/luabindings.h"
41 #include "ardour/luaproc.h"
42 #include "ardour/meter.h"
43 #include "ardour/midi_track.h"
44 #include "ardour/midi_port.h"
45 #include "ardour/phase_control.h"
46 #include "ardour/playlist.h"
47 #include "ardour/plugin.h"
48 #include "ardour/plugin_insert.h"
49 #include "ardour/port_manager.h"
50 #include "ardour/runtime_functions.h"
51 #include "ardour/region.h"
52 #include "ardour/region_factory.h"
53 #include "ardour/route_group.h"
54 #include "ardour/session.h"
55 #include "ardour/session_object.h"
56 #include "ardour/sidechain.h"
57 #include "ardour/solo_isolate_control.h"
58 #include "ardour/solo_safe_control.h"
59 #include "ardour/stripable.h"
60 #include "ardour/track.h"
61 #include "ardour/tempo.h"
63 #include "LuaBridge/LuaBridge.h"
65 #ifdef PLATFORM_WINDOWS
66 /* luabridge uses addresses of static functions/variables to identify classes.
68 * Static symbols on windows (even identical symbols) are not
69 * mapped to the same address when mixing .dll + .exe.
70 * So we need a single point to define those static functions.
71 * (normally they're header-only in libs/lua/LuaBridge/detail/ClassInfo.h)
73 * Really!! A static function with a static variable in a library header
74 * should never ever be replicated, even if it is a template.
75 * But then again this is windows... what else can go wrong.
80 luabridge::ClassInfo<T>::getStaticKey ()
88 luabridge::ClassInfo<T>::getClassKey ()
96 luabridge::ClassInfo<T>::getConstKey ()
103 luabridge::getIdentityKey ()
109 /* ...and this is the ugly part of it.
111 * We need to foward declare classes from gtk2_ardour
112 * end explicily list classes which are used by gtk2_ardour's bindings.
114 * This is needed because some of the GUI classes use objects from libardour
115 * as function parameters and the .exe would re-create symbols for libardour
118 * Classes which don't use libardour symbols could be moved to
119 * gtk2_ardour/luainstance.cc, but keeping this here reduces code
120 * duplication and does not give the compiler a chance to even think
121 * about replicating the symbols.
124 #define CLASSKEYS(CLS) \
125 template void const* luabridge::ClassInfo< CLS >::getStaticKey(); \
126 template void const* luabridge::ClassInfo< CLS >::getClassKey(); \
127 template void const* luabridge::ClassInfo< CLS >::getConstKey();
129 #define CLASSINFO(CLS) \
131 template void const* luabridge::ClassInfo< CLS >::getStaticKey(); \
132 template void const* luabridge::ClassInfo< CLS >::getClassKey(); \
133 template void const* luabridge::ClassInfo< CLS >::getConstKey();
135 CLASSINFO(MarkerSelection);
136 CLASSINFO(TrackSelection);
137 CLASSINFO(TrackViewList);
138 CLASSINFO(TimeSelection);
139 CLASSINFO(RegionSelection);
140 CLASSINFO(PublicEditor);
141 CLASSINFO(Selection);
142 CLASSINFO(ArdourMarker);
148 CLASSKEYS(LuaCairo::ImageSurface);
149 CLASSKEYS(LuaCairo::PangoLayout);
154 CLASSKEYS(Cairo::Context);
155 CLASSKEYS(std::vector<double>);
156 CLASSKEYS(std::list<ArdourMarker*>);
157 CLASSKEYS(std::bitset<46ul>); // LuaSignal::LAST_SIGNAL
158 CLASSKEYS(ArdourMarker*);
159 CLASSKEYS(ARDOUR::RouteGroup);
160 CLASSKEYS(ARDOUR::LuaProc);
161 CLASSKEYS(ARDOUR::DataType);
162 CLASSKEYS(ARDOUR::ChanCount);
163 CLASSKEYS(boost::shared_ptr<ARDOUR::Processor>);
164 CLASSKEYS(ARDOUR::ParameterDescriptor);
165 CLASSKEYS(boost::shared_ptr<ARDOUR::AutomationList>);
166 CLASSKEYS(boost::shared_ptr<Evoral::ControlList>);
167 CLASSKEYS(ARDOUR::LuaOSC::Address);
168 CLASSKEYS(ARDOUR::Session);
169 CLASSKEYS(ARDOUR::BufferSet);
170 CLASSKEYS(ARDOUR::ChanMapping);
171 CLASSKEYS(ARDOUR::DSP::DspShm);
172 CLASSKEYS(ARDOUR::LuaTableRef);
174 CLASSKEYS(ARDOUR::Location);
175 CLASSKEYS(ARDOUR::PluginInfo);
176 CLASSKEYS(PBD::PropertyChange);
177 CLASSKEYS(std::vector<std::string>);
178 CLASSKEYS(std::list<boost::shared_ptr<ARDOUR::Route> >);
179 CLASSKEYS(std::list<boost::shared_ptr<ARDOUR::Port> >);
180 CLASSKEYS(boost::shared_ptr<ARDOUR::PluginInfo>);
181 CLASSKEYS(boost::shared_ptr<ARDOUR::Region>);
182 CLASSKEYS(boost::weak_ptr<ARDOUR::Route>);
183 CLASSKEYS(std::list<boost::shared_ptr<ARDOUR::Region> >);
184 CLASSKEYS(std::list<ARDOUR::AudioRange>);
185 CLASSKEYS(Evoral::Beats);
186 CLASSKEYS(ARDOUR::PortEngine);
187 CLASSKEYS(ARDOUR::PortManager);
188 CLASSKEYS(ARDOUR::AudioEngine);
192 #endif // end windows special case
194 /* Some notes on Lua bindings for libardour and friends
196 * - Prefer factory methods over Contructors whenever possible.
197 * Don't expose the constructor method unless required.
199 * e.g. Don't allow the script to construct a "Track" Object directly
200 * but do allow to create a "BBT_TIME" object.
202 * - Do not dereference Shared or Weak Pointers. Pass the pointer to Lua.
203 * - Define Objects as boost:shared_ptr Object whenever possible.
205 * Storing a boost::shared_ptr in a Lua-variable keeps the reference
206 * until that variable is set to 'nil'.
207 * (if the script were to keep a direct pointer to the object instance, the
208 * behaviour is undefined if the actual object goes away)
210 * Methods of the actual class are indirectly exposed,
211 * boost::*_ptr get() and ::lock() is implicit when the class is exported
212 * as LuaBridge's "WSPtrClass".
215 using namespace ARDOUR;
218 LuaBindings::stddef (lua_State* L)
220 // std::list<std::string>
221 luabridge::getGlobalNamespace (L)
222 .beginNamespace ("C")
223 .beginStdList <std::string> ("StringList")
226 // std::vector<std::string>
227 .beginStdVector <std::string> ("StringVector")
230 // register float array (uint8_t*)
231 .registerArray <uint8_t> ("ByteArray")
233 // register float array (float*)
234 .registerArray <float> ("FloatArray")
236 // register float array (int32_t*)
237 .registerArray <int32_t> ("IntArray")
244 LuaBindings::common (lua_State* L)
246 luabridge::getGlobalNamespace (L)
247 .beginNamespace ("PBD")
248 .beginClass <PBD::ID> ("ID")
249 .addConstructor <void (*) (std::string)> ()
250 .addFunction ("to_s", &PBD::ID::to_s) // TODO special case LUA __tostring ?
253 .beginStdVector <PBD::ID> ("IdVector").endClass ()
255 .beginClass <XMLNode> ("XMLNode")
256 .addFunction ("name", &XMLNode::name)
259 .beginClass <PBD::Stateful> ("Stateful")
260 .addFunction ("id", &PBD::Stateful::id)
261 .addFunction ("properties", &PBD::Stateful::properties)
262 .addFunction ("clear_changes", &PBD::Stateful::clear_changes)
265 .beginWSPtrClass <PBD::Stateful> ("StatefulPtr")
266 .addFunction ("id", &PBD::Stateful::id)
267 .addFunction ("properties", &PBD::Stateful::properties)
268 .addFunction ("clear_changes", &PBD::Stateful::clear_changes)
271 .deriveClass <PBD::StatefulDestructible, PBD::Stateful> ("StatefulDestructible")
274 .deriveWSPtrClass <PBD::StatefulDestructible, PBD::Stateful> ("StatefulDestructiblePtr")
277 .deriveClass <Command, PBD::StatefulDestructible> ("Command")
278 .addFunction ("set_name", &Command::set_name)
279 .addFunction ("name", &Command::name)
282 /* UndoTransaction::add_command() subscribes to DropReferences()
283 * and deletes the object.
285 * This object cannot be constructed by lua because lua would manage lifetime
286 * and delete the object leading to a double free.
288 * use Session::add_stateful_diff_command()
289 * and Session::abort_reversible_command()
291 .deriveClass <PBD::StatefulDiffCommand, Command> ("StatefulDiffCommand")
292 .addFunction ("undo", &PBD::StatefulDiffCommand::undo)
293 .addFunction ("empty", &PBD::StatefulDiffCommand::empty)
296 .deriveWSPtrClass <PBD::Controllable, PBD::StatefulDestructible> ("Controllable")
297 .addFunction ("name", &PBD::Controllable::name)
298 .addFunction ("get_value", &PBD::Controllable::get_value)
301 .beginClass <PBD::RingBufferNPT <uint8_t> > ("RingBuffer8")
302 .addConstructor <void (*) (size_t)> ()
303 .addFunction ("reset", &PBD::RingBufferNPT<uint8_t>::reset)
304 .addFunction ("read", &PBD::RingBufferNPT<uint8_t>::read)
305 .addFunction ("write", &PBD::RingBufferNPT<uint8_t>::write)
306 .addFunction ("write_one", &PBD::RingBufferNPT<uint8_t>::write_one)
307 .addFunction ("write_space", &PBD::RingBufferNPT<uint8_t>::write_space)
308 .addFunction ("read_space", &PBD::RingBufferNPT<uint8_t>::read_space)
309 .addFunction ("increment_read_ptr", &PBD::RingBufferNPT<uint8_t>::increment_read_ptr)
310 .addFunction ("increment_write_ptr", &PBD::RingBufferNPT<uint8_t>::increment_write_ptr)
313 .beginClass <PBD::RingBufferNPT <float> > ("RingBufferF")
314 .addConstructor <void (*) (size_t)> ()
315 .addFunction ("reset", &PBD::RingBufferNPT<float>::reset)
316 .addFunction ("read", &PBD::RingBufferNPT<float>::read)
317 .addFunction ("write", &PBD::RingBufferNPT<float>::write)
318 .addFunction ("write_one", &PBD::RingBufferNPT<float>::write_one)
319 .addFunction ("write_space", &PBD::RingBufferNPT<float>::write_space)
320 .addFunction ("read_space", &PBD::RingBufferNPT<float>::read_space)
321 .addFunction ("increment_read_ptr", &PBD::RingBufferNPT<float>::increment_read_ptr)
322 .addFunction ("increment_write_ptr", &PBD::RingBufferNPT<float>::increment_write_ptr)
325 .beginClass <PBD::RingBufferNPT <int> > ("RingBufferI")
326 .addConstructor <void (*) (size_t)> ()
327 .addFunction ("reset", &PBD::RingBufferNPT<int>::reset)
328 .addFunction ("read", &PBD::RingBufferNPT<int>::read)
329 .addFunction ("write", &PBD::RingBufferNPT<int>::write)
330 .addFunction ("write_one", &PBD::RingBufferNPT<int>::write_one)
331 .addFunction ("write_space", &PBD::RingBufferNPT<int>::write_space)
332 .addFunction ("read_space", &PBD::RingBufferNPT<int>::read_space)
333 .addFunction ("increment_read_ptr", &PBD::RingBufferNPT<int>::increment_read_ptr)
334 .addFunction ("increment_write_ptr", &PBD::RingBufferNPT<int>::increment_write_ptr)
338 .beginNamespace ("GroupControlDisposition")
339 .addConst ("InverseGroup", PBD::Controllable::GroupControlDisposition(PBD::Controllable::InverseGroup))
340 .addConst ("NoGroup", PBD::Controllable::GroupControlDisposition(PBD::Controllable::NoGroup))
341 .addConst ("UseGroup", PBD::Controllable::GroupControlDisposition(PBD::Controllable::UseGroup))
344 .endNamespace (); // PBD
346 luabridge::getGlobalNamespace (L)
347 .beginNamespace ("Timecode")
348 .beginClass <Timecode::BBT_Time> ("BBT_TIME")
349 .addConstructor <void (*) (uint32_t, uint32_t, uint32_t)> ()
353 luabridge::getGlobalNamespace (L)
355 .beginNamespace ("Evoral")
356 .beginClass <Evoral::Parameter> ("Parameter")
357 .addConstructor <void (*) (uint32_t, uint8_t, uint32_t)> ()
358 .addFunction ("type", &Evoral::Parameter::type)
359 .addFunction ("channel", &Evoral::Parameter::channel)
360 .addFunction ("id", &Evoral::Parameter::id)
363 .beginWSPtrClass <Evoral::ControlList> ("ControlList")
364 .addFunction ("add", &Evoral::ControlList::add)
365 .addFunction ("thin", &Evoral::ControlList::thin)
366 .addFunction ("eval", &Evoral::ControlList::eval)
367 .addRefFunction ("rt_safe_eval", &Evoral::ControlList::rt_safe_eval)
368 .addFunction ("interpolation", &Evoral::ControlList::interpolation)
369 .addFunction ("set_interpolation", &Evoral::ControlList::set_interpolation)
370 .addFunction ("truncate_end", &Evoral::ControlList::truncate_end)
371 .addFunction ("truncate_start", &Evoral::ControlList::truncate_start)
372 .addFunction ("clear", (void (Evoral::ControlList::*)(double, double))&Evoral::ControlList::clear)
373 .addFunction ("in_write_pass", &Evoral::ControlList::in_write_pass)
376 .beginWSPtrClass <Evoral::ControlSet> ("ControlSet")
379 .beginWSPtrClass <Evoral::Control> ("Control")
380 .addFunction ("list", (boost::shared_ptr<Evoral::ControlList>(Evoral::Control::*)())&Evoral::Control::list)
383 .beginClass <Evoral::ParameterDescriptor> ("ParameterDescriptor")
384 .addVoidConstructor ()
385 .addData ("lower", &Evoral::ParameterDescriptor::lower)
386 .addData ("upper", &Evoral::ParameterDescriptor::upper)
387 .addData ("normal", &Evoral::ParameterDescriptor::normal)
388 .addData ("toggled", &Evoral::ParameterDescriptor::toggled)
391 .beginClass <Evoral::Range<framepos_t> > ("Range")
392 .addConstructor <void (*) (framepos_t, framepos_t)> ()
393 .addData ("from", &Evoral::Range<framepos_t>::from)
394 .addData ("to", &Evoral::Range<framepos_t>::to)
397 /* libevoral enums */
398 .beginNamespace ("InterpolationStyle")
399 .addConst ("Discrete", Evoral::ControlList::InterpolationStyle(Evoral::ControlList::Discrete))
400 .addConst ("Linear", Evoral::ControlList::InterpolationStyle(Evoral::ControlList::Linear))
401 .addConst ("Curved", Evoral::ControlList::InterpolationStyle(Evoral::ControlList::Curved))
404 .endNamespace () // Evoral
406 .beginNamespace ("ARDOUR")
408 .beginClass <InterThreadInfo> ("InterThreadInfo")
409 .addVoidConstructor ()
410 .addData ("done", const_cast<bool InterThreadInfo::*>(&InterThreadInfo::done))
411 #if 0 // currently unused, lua is single-threaded, no custom UIs.
412 .addData ("cancel", (bool InterThreadInfo::*)&InterThreadInfo::cancel)
414 .addData ("progress", const_cast<float InterThreadInfo::*>(&InterThreadInfo::progress))
417 .beginClass <AudioRange> ("AudioRange")
418 .addConstructor <void (*) (framepos_t, framepos_t, uint32_t)> ()
419 .addFunction ("length", &AudioRange::length)
420 .addFunction ("equal", &AudioRange::equal)
421 .addData ("start", &AudioRange::start)
422 .addData ("_end", &AudioRange::end) // XXX "end" is a lua reserved word
423 .addData ("id", &AudioRange::id)
426 .beginWSPtrClass <PluginInfo> ("PluginInfo")
427 .addVoidConstructor ()
430 .beginNamespace ("Route")
431 .beginClass <Route::ProcessorStreams> ("ProcessorStreams")
432 .addVoidConstructor ()
436 .beginClass <ChanMapping> ("ChanMapping")
437 .addVoidConstructor ()
438 .addFunction ("get", static_cast<uint32_t(ChanMapping::*)(DataType, uint32_t) const>(&ChanMapping::get))
439 .addFunction ("set", &ChanMapping::set)
440 .addFunction ("count", &ChanMapping::count)
441 .addFunction ("n_total", &ChanMapping::n_total)
442 .addFunction ("is_monotonic", &ChanMapping::is_monotonic)
443 .addConst ("Invalid", 4294967295U) // UINT32_MAX
446 .beginNamespace ("Properties")
447 // templated class definitions
448 .beginClass <PBD::PropertyDescriptor<bool> > ("BoolProperty").endClass ()
449 .beginClass <PBD::PropertyDescriptor<float> > ("FloatProperty").endClass ()
450 .beginClass <PBD::PropertyDescriptor<framepos_t> > ("FrameposProperty").endClass ()
451 // actual references (TODO: also expose GQuark for std::set)
453 .addConst ("Start", &ARDOUR::Properties::start)
454 .addConst ("Length", &ARDOUR::Properties::length)
455 .addConst ("Position", &ARDOUR::Properties::position)
458 .beginClass <PBD::PropertyChange> ("PropertyChange")
459 // TODO add special handling (std::set<PropertyID>), PropertyID is a GQuark.
460 // -> direct map to lua table beginStdSet()A
462 // expand templated PropertyDescriptor<T>
463 .addFunction ("containsBool", &PBD::PropertyChange::contains<bool>)
464 .addFunction ("containsFloat", &PBD::PropertyChange::contains<float>)
465 .addFunction ("containsFramePos", &PBD::PropertyChange::contains<framepos_t>)
468 .beginClass <PBD::PropertyList> ("PropertyList")
469 // is-a std::map<PropertyID, PropertyBase*>
472 .deriveClass <PBD::OwnedPropertyList, PBD::PropertyList> ("OwnedPropertyList")
475 .beginWSPtrClass <AutomationList> ("AutomationList")
476 .addCast<PBD::Stateful> ("to_stateful")
477 .addCast<PBD::StatefulDestructible> ("to_statefuldestructible")
478 .addCast<Evoral::ControlList> ("list")
479 .addFunction ("get_state", &AutomationList::get_state)
480 .addFunction ("memento_command", &AutomationList::memento_command)
481 .addFunction ("touching", &AutomationList::touching)
482 .addFunction ("writing", &AutomationList::writing)
483 .addFunction ("touch_enabled", &AutomationList::touch_enabled)
486 .deriveClass <Location, PBD::StatefulDestructible> ("Location")
487 .addFunction ("locked", &Location::locked)
488 .addFunction ("lock", &Location::lock)
489 .addFunction ("start", &Location::start)
490 .addFunction ("_end", &Location::end) // XXX "end" is a lua reserved word
491 .addFunction ("length", &Location::length)
492 .addFunction ("set_start", &Location::set_start)
493 .addFunction ("set_end", &Location::set_end)
494 .addFunction ("set_length", &Location::set)
495 .addFunction ("move_to", &Location::move_to)
498 .deriveClass <Locations, PBD::StatefulDestructible> ("Locations")
499 .addFunction ("auto_loop_location", &Locations::auto_loop_location)
500 .addFunction ("auto_punch_location", &Locations::auto_punch_location)
501 .addFunction ("session_range_location", &Locations::session_range_location)
502 .addFunction ("first_mark_after", &Locations::first_mark_after)
503 .addFunction ("first_mark_before", &Locations::first_mark_before)
504 .addFunction ("first_mark_at", &Locations::mark_at)
505 .addRefFunction ("marks_either_side", &Locations::marks_either_side)
506 .addRefFunction ("find_all_between", &Locations::find_all_between)
509 .beginWSPtrClass <SessionObject> ("SessionObject")
510 /* SessionObject is-a PBD::StatefulDestructible,
511 * but multiple inheritance is not covered by luabridge,
512 * we need explicit casts */
513 .addCast<PBD::Stateful> ("to_stateful")
514 .addCast<PBD::StatefulDestructible> ("to_statefuldestructible")
515 .addFunction ("name", &SessionObject::name)
518 .beginWSPtrClass <Port> ("Port")
519 .addCast<MidiPort> ("to_midiport")
520 .addCast<AudioPort> ("to_audioport")
521 .addFunction ("name", &Port::name)
522 .addFunction ("pretty_name", &Port::pretty_name)
523 .addFunction ("receives_input", &Port::receives_input)
524 .addFunction ("sends_output", &Port::sends_output)
525 .addFunction ("connected", &Port::connected)
526 .addFunction ("disconnect_all", &Port::disconnect_all)
527 .addFunction ("connected_to_name", (bool (Port::*)(std::string const &)const)&Port::connected_to)
528 .addFunction ("connect_by_name", (int (Port::*)(std::string const &))&Port::connect)
529 .addFunction ("disconnect_by_name", (int (Port::*)(std::string const &))&Port::disconnect)
530 .addFunction ("connected_to", (bool (Port::*)(Port*)const)&Port::connected_to)
531 .addFunction ("connect", (int (Port::*)(Port*))&Port::connect)
532 .addFunction ("disconnect", (int (Port::*)(Port*))&Port::disconnect)
533 //.addStaticFunction ("port_offset", &Port::port_offset) // static
536 .deriveWSPtrClass <AudioPort, Port> ("AudioPort")
539 .deriveWSPtrClass <MidiPort, Port> ("MidiPort")
540 .addFunction ("input_active", &MidiPort::input_active)
541 .addFunction ("set_input_active", &MidiPort::set_input_active)
542 .addFunction ("get_midi_buffer", &MidiPort::get_midi_buffer) // DSP only
545 .beginWSPtrClass <PortSet> ("PortSet")
546 .addFunction ("num_ports", (size_t (PortSet::*)(DataType)const)&PortSet::num_ports)
547 .addFunction ("add", &PortSet::add)
548 .addFunction ("remove", &PortSet::remove)
549 .addFunction ("port", (boost::shared_ptr<Port> (PortSet::*)(DataType, size_t)const)&PortSet::port)
550 .addFunction ("contains", &PortSet::contains)
551 .addFunction ("clear", &PortSet::clear)
552 .addFunction ("empty", &PortSet::empty)
555 .deriveWSPtrClass <IO, SessionObject> ("IO")
556 .addFunction ("active", &IO::active)
557 .addFunction ("add_port", &IO::add_port)
558 .addFunction ("remove_port", &IO::remove_port)
559 .addFunction ("connect", &IO::connect)
560 .addFunction ("disconnect", (int (IO::*)(boost::shared_ptr<Port>, std::string, void *))&IO::disconnect)
561 .addFunction ("physically_connected", &IO::physically_connected)
562 .addFunction ("has_port", &IO::has_port)
563 .addFunction ("nth", &IO::nth)
564 .addFunction ("audio", &IO::audio)
565 .addFunction ("midi", &IO::midi)
566 .addFunction ("port_by_name", &IO::nth)
567 .addFunction ("n_ports", &IO::n_ports)
570 .beginClass <RouteGroup> ("RouteGroup")
571 // stub RouteGroup* is needed for new_audio_track()
574 .deriveWSPtrClass <Stripable, SessionObject> ("Stripable")
575 .addCast<Route> ("to_route")
576 .addFunction ("is_auditioner", &Stripable::is_auditioner)
577 .addFunction ("is_master", &Stripable::is_master)
578 .addFunction ("is_monitor", &Stripable::is_monitor)
579 .addFunction ("is_hidden", &Stripable::is_hidden)
580 .addFunction ("is_selected", &Stripable::is_selected)
581 .addFunction ("gain_control", &Stripable::gain_control)
582 .addFunction ("solo_control", &Stripable::solo_control)
583 .addFunction ("solo_isolate_control", &Stripable::solo_isolate_control)
584 .addFunction ("solo_safe_control", &Stripable::solo_safe_control)
585 .addFunction ("mute_control", &Stripable::mute_control)
586 .addFunction ("phase_control", &Stripable::phase_control)
587 .addFunction ("trim_control", &Stripable::trim_control)
588 .addFunction ("rec_enable_control", &Stripable::rec_enable_control)
589 .addFunction ("rec_safe_control", &Stripable::rec_safe_control)
592 .deriveWSPtrClass <Route, Stripable> ("Route")
593 .addCast<Track> ("to_track")
594 .addFunction ("set_name", &Route::set_name)
595 .addFunction ("comment", &Route::comment)
596 .addFunction ("active", &Route::active)
597 .addFunction ("set_active", &Route::set_active)
598 .addFunction ("nth_plugin", &Route::nth_plugin)
599 .addFunction ("nth_processor", &Route::nth_processor)
600 .addFunction ("nth_send", &Route::nth_send)
601 .addFunction ("add_processor_by_index", &Route::add_processor_by_index)
602 .addFunction ("remove_processor", &Route::remove_processor)
603 .addFunction ("replace_processor", &Route::replace_processor)
604 .addFunction ("n_inputs", &Route::n_inputs)
605 .addFunction ("n_outputs", &Route::n_outputs)
606 .addFunction ("set_comment", &Route::set_comment)
607 .addFunction ("strict_io", &Route::strict_io)
608 .addFunction ("set_strict_io", &Route::set_strict_io)
609 .addFunction ("reset_plugin_insert", &Route::reset_plugin_insert)
610 .addFunction ("customize_plugin_insert", &Route::customize_plugin_insert)
611 .addFunction ("add_sidechain", &Route::add_sidechain)
612 .addFunction ("remove_sidechain", &Route::remove_sidechain)
613 .addFunction ("main_outs", &Route::main_outs)
614 .addFunction ("muted", &Route::muted)
615 .addFunction ("soloed", &Route::soloed)
616 .addFunction ("amp", &Route::amp)
617 .addFunction ("trim", &Route::trim)
620 .deriveWSPtrClass <Playlist, SessionObject> ("Playlist")
621 .addFunction ("region_by_id", &Playlist::region_by_id)
622 .addFunction ("data_type", &Playlist::data_type)
623 .addFunction ("n_regions", &Playlist::n_regions)
624 //.addFunction ("get_extent", &Playlist::get_extent) // pair<framepos_t, framepos_t>
625 .addFunction ("region_list", &Playlist::region_list)
626 .addFunction ("add_region", &Playlist::add_region)
627 .addFunction ("remove_region", &Playlist::remove_region)
628 .addFunction ("regions_at", &Playlist::regions_at)
629 .addFunction ("top_region_at", &Playlist::top_region_at)
630 .addFunction ("top_unmuted_region_at", &Playlist::top_unmuted_region_at)
631 .addFunction ("find_next_region", &Playlist::find_next_region)
632 .addFunction ("find_next_region_boundary", &Playlist::find_next_region_boundary)
633 .addFunction ("count_regions_at", &Playlist::count_regions_at)
634 .addFunction ("regions_touched", &Playlist::regions_touched)
635 .addFunction ("regions_with_start_within", &Playlist::regions_with_start_within)
636 .addFunction ("regions_with_end_within", &Playlist::regions_with_end_within)
637 .addFunction ("raise_region", &Playlist::raise_region)
638 .addFunction ("lower_region", &Playlist::lower_region)
639 .addFunction ("raise_region_to_top", &Playlist::raise_region_to_top)
640 .addFunction ("lower_region_to_bottom", &Playlist::lower_region_to_bottom)
641 .addFunction ("duplicate", (void (Playlist::*)(boost::shared_ptr<Region>, framepos_t, framecnt_t, float))&Playlist::duplicate)
642 .addFunction ("duplicate_until", &Playlist::duplicate_until)
643 .addFunction ("duplicate_range", &Playlist::duplicate_range)
644 .addFunction ("combine", &Playlist::combine)
645 .addFunction ("uncombine", &Playlist::uncombine)
646 .addFunction ("split_region", &Playlist::split_region)
647 .addFunction ("split", (void (Playlist::*)(framepos_t))&Playlist::split)
648 .addFunction ("cut", (boost::shared_ptr<Playlist> (Playlist::*)(std::list<AudioRange>&, bool))&Playlist::cut)
650 .addFunction ("copy", &Playlist::copy)
651 .addFunction ("paste", &Playlist::paste)
655 .deriveWSPtrClass <Track, Route> ("Track")
656 .addCast<AudioTrack> ("to_audio_track")
657 .addCast<MidiTrack> ("to_midi_track")
658 .addFunction ("set_name", &Track::set_name)
659 .addFunction ("can_record", &Track::can_record)
660 .addFunction ("bounceable", &Track::bounceable)
661 .addFunction ("bounce", &Track::bounce)
662 .addFunction ("bounce_range", &Track::bounce_range)
663 .addFunction ("playlist", &Track::playlist)
666 .deriveWSPtrClass <AudioTrack, Track> ("AudioTrack")
669 .deriveWSPtrClass <MidiTrack, Track> ("MidiTrack")
672 .deriveWSPtrClass <Region, SessionObject> ("Region")
674 .addFunction ("position", &Region::position)
675 .addFunction ("start", &Region::start)
676 .addFunction ("length", &Region::length)
677 .addFunction ("layer", &Region::layer)
678 .addFunction ("data_type", &Region::data_type)
679 .addFunction ("stretch", &Region::stretch)
680 .addFunction ("shift", &Region::shift)
681 .addRefFunction ("sync_offset", &Region::sync_offset)
682 .addFunction ("sync_position", &Region::sync_position)
683 .addFunction ("hidden", &Region::hidden)
684 .addFunction ("muted", &Region::muted)
685 .addFunction ("opaque", &Region::opaque)
686 .addFunction ("locked", &Region::locked)
687 .addFunction ("position_locked", &Region::position_locked)
688 .addFunction ("video_locked", &Region::video_locked)
689 .addFunction ("automatic", &Region::automatic)
690 .addFunction ("whole_file", &Region::whole_file)
691 .addFunction ("captured", &Region::captured)
692 .addFunction ("can_move", &Region::can_move)
693 .addFunction ("sync_marked", &Region::sync_marked)
694 .addFunction ("external", &Region::external)
695 .addFunction ("import", &Region::import)
696 .addFunction ("covers", &Region::covers)
697 .addFunction ("at_natural_position", &Region::at_natural_position)
698 .addFunction ("is_compound", &Region::is_compound)
699 /* editing operations */
700 .addFunction ("set_length", &Region::set_length)
701 .addFunction ("set_start", &Region::set_start)
702 .addFunction ("set_position", &Region::set_position)
703 .addFunction ("set_initial_position", &Region::set_initial_position)
704 .addFunction ("nudge_position", &Region::nudge_position)
705 .addFunction ("move_to_natural_position", &Region::move_to_natural_position)
706 .addFunction ("move_start", &Region::move_start)
707 .addFunction ("trim_front", &Region::trim_front)
708 .addFunction ("trim_end", &Region::trim_end)
709 .addFunction ("trim_to", &Region::trim_to)
710 .addFunction ("cut_front", &Region::cut_front)
711 .addFunction ("cut_end", &Region::cut_end)
712 .addFunction ("raise", &Region::raise)
713 .addFunction ("lower", &Region::lower)
714 .addFunction ("raise_to_top", &Region::raise_to_top)
715 .addFunction ("lower_to_bottom", &Region::lower_to_bottom)
716 .addFunction ("set_sync_position", &Region::set_sync_position)
717 .addFunction ("clear_sync_position", &Region::clear_sync_position)
718 .addFunction ("set_hidden", &Region::set_hidden)
719 .addFunction ("set_muted", &Region::set_muted)
720 .addFunction ("set_opaque", &Region::set_opaque)
721 .addFunction ("set_locked", &Region::set_locked)
722 .addFunction ("set_video_locked", &Region::set_video_locked)
723 .addFunction ("set_position_locked", &Region::set_position_locked)
726 .beginWSPtrClass <Source> ("Source")
729 .beginClass <Plugin::PresetRecord> ("PresetRecord")
730 .addVoidConstructor ()
731 .addData ("uri", &Plugin::PresetRecord::uri, false)
732 .addData ("label", &Plugin::PresetRecord::label, false)
733 .addData ("user", &Plugin::PresetRecord::user, false)
734 .addData ("valid", &Plugin::PresetRecord::valid, false)
737 .deriveWSPtrClass <Automatable, Evoral::ControlSet> ("Automatable")
738 .addFunction ("automation_control", (boost::shared_ptr<AutomationControl>(Automatable::*)(const Evoral::Parameter&, bool))&Automatable::automation_control)
741 .deriveClass <ParameterDescriptor, Evoral::ParameterDescriptor> ("ParameterDescriptor")
742 .addVoidConstructor ()
743 .addData ("label", &ParameterDescriptor::label)
744 .addData ("logarithmic", &ParameterDescriptor::logarithmic)
747 .deriveWSPtrClass <Processor, SessionObject> ("Processor")
748 .addCast<Automatable> ("to_automatable")
749 .addCast<PluginInsert> ("to_insert")
750 .addCast<SideChain> ("to_sidechain")
751 .addCast<IOProcessor> ("to_ioprocessor")
752 .addCast<UnknownProcessor> ("to_unknownprocessor")
753 .addCast<Amp> ("to_amp")
754 #if 0 // those objects are not yet bound
755 .addCast<MonitorProcessor> ("to_monitorprocessor")
756 .addCast<CapturingProcessor> ("to_capturingprocessor")
757 .addCast<DelayLine> ("to_delayline")
758 .addCast<PeakMeter> ("to_meter")
760 .addFunction ("display_name", &Processor::display_name)
761 .addFunction ("active", &Processor::active)
762 .addFunction ("activate", &Processor::activate)
763 .addFunction ("deactivate", &Processor::deactivate)
766 .deriveWSPtrClass <IOProcessor, Processor> ("IOProcessor")
767 .addFunction ("natural_input_streams", &IOProcessor::natural_input_streams)
768 .addFunction ("natural_output_streams", &IOProcessor::natural_output_streams)
769 .addFunction ("input", (boost::shared_ptr<IO>(IOProcessor::*)())&IOProcessor::input)
770 .addFunction ("output", (boost::shared_ptr<IO>(IOProcessor::*)())&IOProcessor::output)
773 .deriveWSPtrClass <SideChain, IOProcessor> ("SideChain")
776 .deriveWSPtrClass <Delivery, IOProcessor> ("Delivery")
779 .deriveWSPtrClass <Plugin, PBD::StatefulDestructible> ("Plugin")
780 .addFunction ("label", &Plugin::label)
781 .addFunction ("name", &Plugin::name)
782 .addFunction ("maker", &Plugin::maker)
783 .addFunction ("parameter_count", &Plugin::parameter_count)
784 .addRefFunction ("nth_parameter", &Plugin::nth_parameter)
785 .addFunction ("preset_by_label", &Plugin::preset_by_label)
786 .addFunction ("preset_by_uri", &Plugin::preset_by_uri)
787 .addFunction ("load_preset", &Plugin::load_preset)
788 .addFunction ("parameter_is_input", &Plugin::parameter_is_input)
789 .addFunction ("get_docs", &Plugin::get_docs)
790 .addFunction ("get_parameter_docs", &Plugin::get_parameter_docs)
791 .addRefFunction ("get_parameter_descriptor", &Plugin::get_parameter_descriptor)
794 .deriveWSPtrClass <PluginInsert, Processor> ("PluginInsert")
795 .addFunction ("plugin", &PluginInsert::plugin)
796 .addFunction ("activate", &PluginInsert::activate)
797 .addFunction ("deactivate", &PluginInsert::deactivate)
798 .addFunction ("strict_io_configured", &PluginInsert::strict_io_configured)
799 .addFunction ("input_map", (ARDOUR::ChanMapping (PluginInsert::*)(uint32_t) const)&PluginInsert::input_map)
800 .addFunction ("output_map", (ARDOUR::ChanMapping (PluginInsert::*)(uint32_t) const)&PluginInsert::output_map)
801 .addFunction ("set_input_map", &PluginInsert::set_input_map)
802 .addFunction ("set_output_map", &PluginInsert::set_output_map)
803 .addFunction ("sidechain_input", &PluginInsert::sidechain_input)
806 .deriveWSPtrClass <AutomationControl, PBD::Controllable> ("AutomationControl")
807 .addCast<Evoral::Control> ("to_ctrl")
808 .addFunction ("automation_state", &AutomationControl::automation_state)
809 .addFunction ("automation_style", &AutomationControl::automation_style)
810 .addFunction ("set_automation_state", &AutomationControl::set_automation_state)
811 .addFunction ("set_automation_style", &AutomationControl::set_automation_style)
812 .addFunction ("start_touch", &AutomationControl::start_touch)
813 .addFunction ("stop_touch", &AutomationControl::stop_touch)
814 .addFunction ("get_value", &AutomationControl::get_value)
815 .addFunction ("set_value", &AutomationControl::set_value)
816 .addFunction ("writable", &AutomationControl::writable)
817 .addFunction ("alist", &AutomationControl::alist)
820 .deriveWSPtrClass <SlavableAutomationControl, AutomationControl> ("SlavableAutomationControl,")
821 .addFunction ("add_master", &SlavableAutomationControl::add_master)
822 .addFunction ("remove_master", &SlavableAutomationControl::remove_master)
823 .addFunction ("clear_masters", &SlavableAutomationControl::clear_masters)
824 .addFunction ("slaved_to", &SlavableAutomationControl::slaved_to)
825 .addFunction ("slaved", &SlavableAutomationControl::slaved)
826 .addFunction ("get_masters_value", &SlavableAutomationControl::get_masters_value)
827 .addFunction ("get_boolean_masters", &SlavableAutomationControl::get_boolean_masters)
828 //.addFunction ("masters", &SlavableAutomationControl::masters) // not implemented
831 .deriveWSPtrClass <PhaseControl, AutomationControl> ("PhaseControl")
832 .addFunction ("set_phase_invert", (void(PhaseControl::*)(uint32_t, bool))&PhaseControl::set_phase_invert)
833 .addFunction ("inverted", &PhaseControl::inverted)
836 .deriveWSPtrClass <GainControl, SlavableAutomationControl> ("GainControl")
839 .deriveWSPtrClass <SoloControl, SlavableAutomationControl> ("SoloControl")
840 .addFunction ("can_solo", &SoloControl::can_solo)
841 .addFunction ("soloed", &SoloControl::soloed)
842 .addFunction ("self_soloed", &SoloControl::self_soloed)
845 .deriveWSPtrClass <MuteControl, SlavableAutomationControl> ("MuteControl")
846 .addFunction ("muted", &MuteControl::muted)
847 .addFunction ("muted_by_self", &MuteControl::muted_by_self)
850 .deriveWSPtrClass <SoloIsolateControl, SlavableAutomationControl> ("SoloIsolateControl")
851 .addFunction ("solo_isolated", &SoloIsolateControl::solo_isolated)
852 .addFunction ("self_solo_isolated", &SoloIsolateControl::self_solo_isolated)
855 .deriveWSPtrClass <SoloSafeControl, SlavableAutomationControl> ("SoloSafeControl")
856 .addFunction ("solo_safe", &SoloSafeControl::solo_safe)
859 .deriveWSPtrClass <Amp, Processor> ("Amp")
860 .addFunction ("gain_control", (boost::shared_ptr<GainControl>(Amp::*)())&Amp::gain_control)
863 .deriveWSPtrClass <UnknownProcessor, Processor> ("UnknownProcessor")
866 .deriveWSPtrClass <PluginInsert::PluginControl, AutomationControl> ("PluginControl")
869 .deriveWSPtrClass <AudioSource, Source> ("AudioSource")
870 .addFunction ("readable_length", &AudioSource::readable_length)
871 .addFunction ("n_channels", &AudioSource::n_channels)
874 // <std::list<boost::shared_ptr <AudioTrack> >
875 .beginStdList <boost::shared_ptr<AudioTrack> > ("AudioTrackList")
878 // std::list<boost::shared_ptr <MidiTrack> >
879 .beginStdList <boost::shared_ptr<MidiTrack> > ("MidiTrackList")
882 // RouteList == std::list<boost::shared_ptr<Route> >
883 .beginConstStdList <boost::shared_ptr<Route> > ("RouteList")
886 // boost::shared_ptr<RouteList>
887 .beginPtrStdList <boost::shared_ptr<Route> > ("RouteListPtr")
890 // typedef std::list<boost::weak_ptr <Route> > WeakRouteList
891 .beginConstStdList <boost::weak_ptr<Route> > ("WeakRouteList")
894 // std::list< boost::weak_ptr <AudioSource> >
895 .beginConstStdList <boost::weak_ptr<AudioSource> > ("WeakAudioSourceList")
898 // typedef std::list<boost::shared_ptr<Region> > RegionList
899 .beginConstStdList <boost::shared_ptr<Region> > ("RegionList")
902 // boost::shared_ptr <std::list<boost::shared_ptr<Region> > >
903 .beginPtrStdList <boost::shared_ptr<Region> > ("RegionListPtr")
906 //std::list<boost::shared_ptr<Port> > PortList;
907 .beginConstStdList <boost::shared_ptr<Port> > ("PortList")
910 // used by Playlist::cut/copy
911 .beginConstStdList <AudioRange> ("AudioRangeList")
914 .beginConstStdList <Location*> ("LocationList")
917 #if 0 // depends on Evoal:: Note, Beats see note_fixer.h
918 // typedef Evoral::Note<Evoral::Beats> Note;
919 // std::set< boost::weak_ptr<Note> >
920 .beginStdSet <boost::weak_ptr<Note> > ("WeakNoteSet")
924 // std::list<boost::weak_ptr<Source> >
925 .beginConstStdList <boost::weak_ptr<Source> > ("WeakSourceList")
928 .beginClass <Tempo> ("Tempo")
929 .addConstructor <void (*) (double, double)> ()
930 .addFunction ("note_type", &Tempo::note_type)
931 .addFunction ("beats_per_minute", &Tempo::beats_per_minute)
932 .addFunction ("frames_per_beat", &Tempo::frames_per_beat)
935 .beginClass <Meter> ("Meter")
936 .addConstructor <void (*) (double, double)> ()
937 .addFunction ("divisions_per_bar", &Meter::divisions_per_bar)
938 .addFunction ("note_divisor", &Meter::note_divisor)
939 .addFunction ("frames_per_bar", &Meter::frames_per_bar)
940 .addFunction ("frames_per_grid", &Meter::frames_per_grid)
943 .beginClass <TempoMap> ("TempoMap")
944 .addFunction ("add_tempo", &TempoMap::add_tempo)
945 .addFunction ("add_meter", &TempoMap::add_meter)
946 .addFunction ("tempo_section_at_frame", &TempoMap::tempo_section_at_frame)
947 .addFunction ("meter_section_at_frame", &TempoMap::meter_section_at_frame)
948 .addFunction ("meter_section_at_beat", &TempoMap::meter_section_at_beat)
951 .beginClass <MetricSection> ("MetricSection")
952 .addFunction ("pulse", &MetricSection::pulse)
953 .addFunction ("set_pulse", &MetricSection::set_pulse)
956 .deriveClass <TempoSection, MetricSection> ("TempoSection")
957 .addFunction ("c_func", (double(TempoSection::*)()const)&TempoSection::c_func)
960 .deriveClass <MeterSection, MetricSection> ("MeterSection")
961 .addCast<Meter> ("to_meter")
962 .addFunction ("set_pulse", &MeterSection::set_pulse)
963 .addFunction ("set_beat", (void(MeterSection::*)(double))&MeterSection::set_beat)
966 .beginClass <ChanCount> ("ChanCount")
967 .addConstructor <void (*) (DataType, uint32_t)> ()
968 .addFunction ("get", &ChanCount::get)
969 .addFunction ("set", &ChanCount::set)
970 .addFunction ("n_audio", &ChanCount::n_audio)
971 .addFunction ("n_midi", &ChanCount::n_midi)
972 .addFunction ("n_total", &ChanCount::n_total)
973 .addFunction ("reset", &ChanCount::reset)
976 .beginClass <DataType> ("DataType")
977 .addConstructor <void (*) (std::string)> ()
978 .addStaticCFunction ("null", &LuaAPI::datatype_ctor_null) // "nil" is a lua reseved word
979 .addStaticCFunction ("audio", &LuaAPI::datatype_ctor_audio)
980 .addStaticCFunction ("midi", &LuaAPI::datatype_ctor_midi)
981 .addFunction ("to_string", &DataType::to_string) // TODO Lua __tostring
982 // TODO add uint32_t cast, add operator== !=
985 /* libardour enums */
986 .beginNamespace ("PluginType")
987 .addConst ("AudioUnit", ARDOUR::PluginType(AudioUnit))
988 .addConst ("LADSPA", ARDOUR::PluginType(LADSPA))
989 .addConst ("LV2", ARDOUR::PluginType(LV2))
990 .addConst ("Windows_VST", ARDOUR::PluginType(Windows_VST))
991 .addConst ("LXVST", ARDOUR::PluginType(LXVST))
992 .addConst ("Lua", ARDOUR::PluginType(Lua))
995 .beginNamespace ("PresentationInfo")
996 .beginNamespace ("Flag")
997 .addConst ("AudioTrack", ARDOUR::PresentationInfo::Flag(PresentationInfo::AudioTrack))
998 .addConst ("MidiTrack", ARDOUR::PresentationInfo::Flag(PresentationInfo::MidiTrack))
999 .addConst ("AudioBus", ARDOUR::PresentationInfo::Flag(PresentationInfo::AudioBus))
1000 .addConst ("MidiBus", ARDOUR::PresentationInfo::Flag(PresentationInfo::MidiBus))
1001 .addConst ("VCA", ARDOUR::PresentationInfo::Flag(PresentationInfo::VCA))
1002 .addConst ("MasterOut", ARDOUR::PresentationInfo::Flag(PresentationInfo::MasterOut))
1003 .addConst ("MonitorOut", ARDOUR::PresentationInfo::Flag(PresentationInfo::MonitorOut))
1004 .addConst ("Auditioner", ARDOUR::PresentationInfo::Flag(PresentationInfo::Auditioner))
1005 .addConst ("Selected", ARDOUR::PresentationInfo::Flag(PresentationInfo::Selected))
1006 .addConst ("Hidden", ARDOUR::PresentationInfo::Flag(PresentationInfo::Hidden))
1007 .addConst ("GroupOrderSet", ARDOUR::PresentationInfo::Flag(PresentationInfo::OrderSet))
1008 .addConst ("StatusMask", ARDOUR::PresentationInfo::Flag(PresentationInfo::StatusMask))
1012 .beginNamespace ("AutoStyle")
1013 .addConst ("Absolute", ARDOUR::AutoStyle(Absolute))
1014 .addConst ("Trim", ARDOUR::AutoStyle(Trim))
1017 .beginNamespace ("AutoState")
1018 .addConst ("Off", ARDOUR::AutoState(Off))
1019 .addConst ("Write", ARDOUR::AutoState(Write))
1020 .addConst ("Touch", ARDOUR::AutoState(Touch))
1021 .addConst ("Play", ARDOUR::AutoState(Play))
1024 .beginNamespace ("AutomationType")
1025 .addConst ("GainAutomation", ARDOUR::AutomationType(GainAutomation))
1026 .addConst ("PluginAutomation", ARDOUR::AutomationType(PluginAutomation))
1027 .addConst ("SoloAutomation", ARDOUR::AutomationType(SoloAutomation))
1028 .addConst ("SoloIsolateAutomation", ARDOUR::AutomationType(SoloIsolateAutomation))
1029 .addConst ("SoloSafeAutomation", ARDOUR::AutomationType(SoloSafeAutomation))
1030 .addConst ("MuteAutomation", ARDOUR::AutomationType(MuteAutomation))
1031 .addConst ("RecEnableAutomation", ARDOUR::AutomationType(RecEnableAutomation))
1032 .addConst ("RecSafeAutomation", ARDOUR::AutomationType(RecSafeAutomation))
1033 .addConst ("TrimAutomation", ARDOUR::AutomationType(TrimAutomation))
1034 .addConst ("PhaseAutomation", ARDOUR::AutomationType(PhaseAutomation))
1037 .beginNamespace ("SrcQuality")
1038 .addConst ("SrcBest", ARDOUR::SrcQuality(SrcBest))
1041 .beginNamespace ("PortFlags")
1042 .addConst ("IsInput", ARDOUR::PortFlags(IsInput))
1043 .addConst ("IsOutput", ARDOUR::PortFlags(IsOutput))
1044 .addConst ("IsPhysical", ARDOUR::PortFlags(IsPhysical))
1045 .addConst ("CanMonitor", ARDOUR::PortFlags(CanMonitor))
1046 .addConst ("IsTerminal", ARDOUR::PortFlags(IsTerminal))
1049 .beginNamespace ("PlaylistDisposition")
1050 .addConst ("CopyPlaylist", ARDOUR::PlaylistDisposition(CopyPlaylist))
1051 .addConst ("NewPlaylist", ARDOUR::PlaylistDisposition(NewPlaylist))
1052 .addConst ("SharePlaylist", ARDOUR::PlaylistDisposition(SharePlaylist))
1055 .beginNamespace ("RegionPoint")
1056 .addConst ("Start", ARDOUR::RegionPoint(Start))
1057 .addConst ("End", ARDOUR::RegionPoint(End))
1058 .addConst ("SyncPoint", ARDOUR::RegionPoint(SyncPoint))
1061 .beginNamespace ("TempoSection")
1062 .beginNamespace ("PositionLockStyle")
1063 .addConst ("AudioTime", ARDOUR::PositionLockStyle(AudioTime))
1064 .addConst ("MusicTime", ARDOUR::PositionLockStyle(MusicTime))
1068 .beginNamespace ("TempoSection")
1069 .beginNamespace ("Type")
1070 .addConst ("Ramp", ARDOUR::TempoSection::Type(TempoSection::Ramp))
1071 .addConst ("Constant", ARDOUR::TempoSection::Type(TempoSection::Constant))
1075 .beginNamespace ("TrackMode")
1076 .addConst ("Normal", ARDOUR::TrackMode(Start))
1077 .addConst ("NonLayered", ARDOUR::TrackMode(NonLayered))
1078 .addConst ("Destructive", ARDOUR::TrackMode(Destructive))
1080 .endNamespace (); // end ARDOUR
1082 luabridge::getGlobalNamespace (L)
1083 .beginNamespace ("ARDOUR")
1084 .beginClass <AudioBackendInfo> ("AudioBackendInfo")
1085 .addData ("name", &AudioBackendInfo::name)
1087 .beginStdVector <const AudioBackendInfo*> ("BackendVector").endClass ()
1089 .beginClass <AudioBackend::DeviceStatus> ("DeviceStatus")
1090 .addData ("name", &AudioBackend::DeviceStatus::name)
1091 .addData ("available", &AudioBackend::DeviceStatus::available)
1093 .beginStdVector <AudioBackend::DeviceStatus> ("DeviceStatusVector").endClass ()
1095 .beginWSPtrClass <AudioBackend> ("AudioBackend")
1096 .addFunction ("info", &AudioBackend::info)
1097 .addFunction ("sample_rate", &AudioBackend::sample_rate)
1098 .addFunction ("buffer_size", &AudioBackend::buffer_size)
1099 .addFunction ("period_size", &AudioBackend::period_size)
1100 .addFunction ("input_channels", &AudioBackend::input_channels)
1101 .addFunction ("output_channels", &AudioBackend::output_channels)
1102 .addFunction ("dsp_load", &AudioBackend::dsp_load)
1104 .addFunction ("set_sample_rate", &AudioBackend::set_sample_rate)
1105 .addFunction ("set_buffer_size", &AudioBackend::set_buffer_size)
1106 .addFunction ("set_peridod_size", &AudioBackend::set_peridod_size)
1108 .addFunction ("enumerate_drivers", &AudioBackend::enumerate_drivers)
1109 .addFunction ("driver_name", &AudioBackend::driver_name)
1110 .addFunction ("set_driver", &AudioBackend::set_driver)
1112 .addFunction ("use_separate_input_and_output_devices", &AudioBackend::use_separate_input_and_output_devices)
1113 .addFunction ("enumerate_devices", &AudioBackend::enumerate_devices)
1114 .addFunction ("enumerate_input_devices", &AudioBackend::enumerate_input_devices)
1115 .addFunction ("enumerate_output_devices", &AudioBackend::enumerate_output_devices)
1116 .addFunction ("device_name", &AudioBackend::device_name)
1117 .addFunction ("input_device_name", &AudioBackend::input_device_name)
1118 .addFunction ("output_device_name", &AudioBackend::output_device_name)
1119 .addFunction ("set_device_name", &AudioBackend::set_device_name)
1120 .addFunction ("set_input_device_name", &AudioBackend::set_input_device_name)
1121 .addFunction ("set_output_device_name", &AudioBackend::set_output_device_name)
1124 .beginClass <PortEngine> ("PortEngine")
1127 .beginClass <PortManager> ("PortManager")
1128 .addFunction ("port_engine", &PortManager::port_engine)
1129 .addFunction ("connected", &PortManager::connected)
1130 .addFunction ("connect", &PortManager::connect)
1131 .addFunction ("physically_connected", &PortManager::physically_connected)
1132 .addFunction ("disconnect", (int (PortManager::*)(const std::string&, const std::string&))&PortManager::disconnect)
1133 .addFunction ("disconnect_port", (int (PortManager::*)(boost::shared_ptr<Port>))&PortManager::disconnect)
1134 .addFunction ("get_port_by_name", &PortManager::get_port_by_name)
1135 .addFunction ("get_pretty_name_by_name", &PortManager::get_pretty_name_by_name)
1136 .addFunction ("port_is_physical", &PortManager::port_is_physical)
1137 .addFunction ("get_physical_outputs", &PortManager::get_physical_outputs)
1138 .addFunction ("get_physical_inputs", &PortManager::get_physical_inputs)
1139 .addFunction ("n_physical_outputs", &PortManager::n_physical_outputs)
1140 .addFunction ("n_physical_inputs", &PortManager::n_physical_inputs)
1141 .addRefFunction ("get_connections", &PortManager::get_connections)
1142 .addRefFunction ("get_ports", (int (PortManager::*)(DataType, PortManager::PortList&))&PortManager::get_ports)
1143 .addRefFunction ("get_backend_ports", (int (PortManager::*)(const std::string&, DataType, PortFlags, std::vector<std::string>&))&PortManager::get_ports)
1146 .deriveClass <AudioEngine, PortManager> ("AudioEngine")
1147 .addFunction ("available_backends", &AudioEngine::available_backends)
1148 .addFunction ("current_backend_name", &AudioEngine::current_backend_name)
1149 .addFunction ("set_backend", &AudioEngine::set_backend)
1150 .addFunction ("setup_required", &AudioEngine::setup_required)
1151 .addFunction ("start", &AudioEngine::start)
1152 .addFunction ("stop", &AudioEngine::stop)
1153 .addFunction ("get_dsp_load", &AudioEngine::get_dsp_load)
1154 .addFunction ("set_device_name", &AudioEngine::set_device_name)
1155 .addFunction ("set_sample_rate", &AudioEngine::set_sample_rate)
1156 .addFunction ("set_buffer_size", &AudioEngine::set_buffer_size)
1157 .addFunction ("get_last_backend_error", &AudioEngine::get_last_backend_error)
1161 // basic representation of Session
1162 // functions which can be used from realtime and non-realtime contexts
1163 luabridge::getGlobalNamespace (L)
1164 .beginNamespace ("ARDOUR")
1165 .beginClass <Session> ("Session")
1166 .addFunction ("scripts_changed", &Session::scripts_changed) // used internally
1167 .addFunction ("transport_rolling", &Session::transport_rolling)
1168 .addFunction ("request_transport_speed", &Session::request_transport_speed)
1169 .addFunction ("transport_frame", &Session::transport_frame)
1170 .addFunction ("transport_speed", &Session::transport_speed)
1171 .addFunction ("frame_rate", &Session::frame_rate)
1172 .addFunction ("nominal_frame_rate", &Session::nominal_frame_rate)
1173 .addFunction ("frames_per_timecode_frame", &Session::frames_per_timecode_frame)
1174 .addFunction ("timecode_frames_per_hour", &Session::timecode_frames_per_hour)
1175 .addFunction ("timecode_frames_per_second", &Session::timecode_frames_per_second)
1176 .addFunction ("timecode_drop_frames", &Session::timecode_drop_frames)
1177 .addFunction ("request_locate", &Session::request_locate)
1178 .addFunction ("request_stop", &Session::request_stop)
1179 .addFunction ("last_transport_start", &Session::last_transport_start)
1180 .addFunction ("goto_start", &Session::goto_start)
1181 .addFunction ("goto_end", &Session::goto_end)
1182 .addFunction ("current_start_frame", &Session::current_start_frame)
1183 .addFunction ("current_end_frame", &Session::current_end_frame)
1184 .addFunction ("actively_recording", &Session::actively_recording)
1185 .addFunction ("new_audio_track", &Session::new_audio_track)
1186 .addFunction ("new_audio_route", &Session::new_audio_route)
1187 .addFunction ("new_midi_track", &Session::new_midi_track)
1188 .addFunction ("new_midi_route", &Session::new_midi_route)
1189 .addFunction ("get_routes", &Session::get_routes)
1190 .addFunction ("get_tracks", &Session::get_tracks)
1191 .addFunction ("name", &Session::name)
1192 .addFunction ("path", &Session::path)
1193 .addFunction ("record_status", &Session::record_status)
1194 .addFunction ("route_by_id", &Session::route_by_id)
1195 .addFunction ("route_by_name", &Session::route_by_name)
1196 .addFunction ("get_remote_nth_stripable", &Session::get_remote_nth_stripable)
1197 .addFunction ("get_remote_nth_route", &Session::get_remote_nth_route)
1198 .addFunction ("route_by_selected_count", &Session::route_by_selected_count)
1199 .addFunction ("track_by_diskstream_id", &Session::track_by_diskstream_id)
1200 .addFunction ("source_by_id", &Session::source_by_id)
1201 .addFunction ("controllable_by_id", &Session::controllable_by_id)
1202 .addFunction ("processor_by_id", &Session::processor_by_id)
1203 .addFunction ("snap_name", &Session::snap_name)
1204 .addFunction ("monitor_out", &Session::monitor_out)
1205 .addFunction ("master_out", &Session::master_out)
1206 .addFunction ("tempo_map", (TempoMap& (Session::*)())&Session::tempo_map)
1207 .addFunction ("locations", &Session::locations)
1208 .addFunction ("begin_reversible_command", (void (Session::*)(const std::string&))&Session::begin_reversible_command)
1209 .addFunction ("commit_reversible_command", &Session::commit_reversible_command)
1210 .addFunction ("abort_reversible_command", &Session::abort_reversible_command)
1211 .addFunction ("add_command", &Session::add_command)
1212 .addFunction ("add_stateful_diff_command", &Session::add_stateful_diff_command)
1213 .addFunction ("engine", (AudioEngine& (Session::*)())&Session::engine)
1214 .addFunction ("get_block_size", &Session::get_block_size)
1215 .addFunction ("worst_output_latency", &Session::worst_output_latency)
1216 .addFunction ("worst_input_latency", &Session::worst_input_latency)
1217 .addFunction ("worst_track_latency", &Session::worst_track_latency)
1218 .addFunction ("worst_playback_latency", &Session::worst_playback_latency)
1221 .beginClass <RegionFactory> ("RegionFactory")
1222 .addStaticFunction ("region_by_id", &RegionFactory::region_by_id)
1225 /* session enums (rt-safe, common) */
1226 .beginNamespace ("Session")
1228 .beginNamespace ("RecordState")
1229 .addConst ("Disabled", ARDOUR::Session::RecordState(Session::Disabled))
1230 .addConst ("Enabled", ARDOUR::Session::RecordState(Session::Enabled))
1231 .addConst ("Recording", ARDOUR::Session::RecordState(Session::Recording))
1234 .endNamespace () // end Session enums
1236 /* ardour enums (rt-safe, common) */
1237 .beginNamespace ("LocationFlags")
1238 .addConst ("IsMark", ARDOUR::Location::Flags(Location::IsMark))
1239 .addConst ("IsAutoPunch", ARDOUR::Location::Flags(Location::IsAutoPunch))
1240 .addConst ("IsAutoLoop", ARDOUR::Location::Flags(Location::IsAutoLoop))
1241 .addConst ("IsHidden", ARDOUR::Location::Flags(Location::IsHidden))
1242 .addConst ("IsCDMarker", ARDOUR::Location::Flags(Location::IsCDMarker))
1243 .addConst ("IsRangeMarker", ARDOUR::Location::Flags(Location::IsRangeMarker))
1244 .addConst ("IsSessionRange", ARDOUR::Location::Flags(Location::IsSessionRange))
1245 .addConst ("IsSkip", ARDOUR::Location::Flags(Location::IsSkip))
1246 .addConst ("IsSkipping", ARDOUR::Location::Flags(Location::IsSkipping))
1249 .beginNamespace ("LuaAPI")
1250 .addFunction ("nil_proc", ARDOUR::LuaAPI::nil_processor)
1251 .addFunction ("new_luaproc", ARDOUR::LuaAPI::new_luaproc)
1252 .addFunction ("new_plugin_info", ARDOUR::LuaAPI::new_plugin_info)
1253 .addFunction ("new_plugin", ARDOUR::LuaAPI::new_plugin)
1254 .addFunction ("set_processor_param", ARDOUR::LuaAPI::set_processor_param)
1255 .addFunction ("set_plugin_insert_param", ARDOUR::LuaAPI::set_plugin_insert_param)
1256 .addCFunction ("plugin_automation", ARDOUR::LuaAPI::plugin_automation)
1257 .addCFunction ("hsla_to_rgba", ARDOUR::LuaAPI::hsla_to_rgba)
1258 .addFunction ("usleep", Glib::usleep)
1259 .endNamespace () // end LuaAPI
1260 .endNamespace ();// end ARDOUR
1264 LuaBindings::dsp (lua_State* L)
1266 luabridge::getGlobalNamespace (L)
1267 .beginNamespace ("ARDOUR")
1269 .beginClass <AudioBuffer> ("AudioBuffer")
1271 .addFunction ("data", (Sample*(AudioBuffer::*)(framecnt_t))&AudioBuffer::data)
1272 .addFunction ("silence", &AudioBuffer::silence)
1273 .addFunction ("apply_gain", &AudioBuffer::apply_gain)
1274 .addFunction ("check_silence", &AudioBuffer::check_silence)
1275 .addFunction ("read_from", (void (AudioBuffer::*)(const Sample*, framecnt_t, framecnt_t, framecnt_t))&AudioBuffer::check_silence)
1278 .beginClass <MidiBuffer> ("MidiBuffer")
1280 .addFunction ("silence", &MidiBuffer::silence)
1281 .addFunction ("size", &MidiBuffer::size)
1282 .addFunction ("empty", &MidiBuffer::empty)
1283 .addFunction ("resize", &MidiBuffer::resize)
1284 .addFunction ("copy", (void (MidiBuffer::*)(MidiBuffer const * const))&MidiBuffer::copy)
1285 .addFunction ("push_event", (bool (MidiBuffer::*)(const Evoral::MIDIEvent<framepos_t>&))&MidiBuffer::push_back)
1286 .addFunction ("push_back", (bool (MidiBuffer::*)(framepos_t, size_t, const uint8_t*))&MidiBuffer::push_back)
1288 .addExtCFunction ("table", &luabridge::CFunc::listToTable<const Evoral::MIDIEvent<framepos_t>, MidiBuffer>)
1291 .beginClass <BufferSet> ("BufferSet")
1293 .addFunction ("get_audio", static_cast<AudioBuffer&(BufferSet::*)(size_t)>(&BufferSet::get_audio))
1294 .addFunction ("get_midi", static_cast<MidiBuffer&(BufferSet::*)(size_t)>(&BufferSet::get_midi))
1295 .addFunction ("count", static_cast<const ChanCount&(BufferSet::*)()const>(&BufferSet::count))
1299 luabridge::getGlobalNamespace (L)
1300 .beginNamespace ("Evoral")
1301 .beginClass <Evoral::Event<framepos_t> > ("Event")
1302 .addFunction ("clear", &Evoral::Event<framepos_t>::clear)
1303 .addFunction ("size", &Evoral::Event<framepos_t>::size)
1304 .addFunction ("set_buffer", &Evoral::Event<framepos_t>::set_buffer)
1305 .addFunction ("buffer", (uint8_t*(Evoral::Event<framepos_t>::*)())&Evoral::Event<framepos_t>::buffer)
1308 .beginClass <Evoral::Beats> ("Beats")
1309 .addFunction ("to_double", &Evoral::Beats::to_double)
1312 .deriveClass <Evoral::MIDIEvent<framepos_t>, Evoral::Event<framepos_t> > ("MidiEvent")
1314 .addFunction ("type", &Evoral::MIDIEvent<framepos_t>::type)
1315 .addFunction ("channel", &Evoral::MIDIEvent<framepos_t>::channel)
1316 .addFunction ("set_type", &Evoral::MIDIEvent<framepos_t>::set_type)
1317 .addFunction ("set_channel", &Evoral::MIDIEvent<framepos_t>::set_channel)
1321 // dsp releated session functions
1322 luabridge::getGlobalNamespace (L)
1323 .beginNamespace ("ARDOUR")
1324 .beginClass <Session> ("Session")
1325 .addFunction ("get_scratch_buffers", &Session::get_scratch_buffers)
1326 .addFunction ("get_silent_buffers", &Session::get_silent_buffers)
1330 luabridge::getGlobalNamespace (L)
1331 .beginNamespace ("ARDOUR")
1332 .beginNamespace ("DSP")
1333 .addFunction ("compute_peak", ARDOUR::compute_peak)
1334 .addFunction ("find_peaks", ARDOUR::find_peaks)
1335 .addFunction ("apply_gain_to_buffer", ARDOUR::apply_gain_to_buffer)
1336 .addFunction ("mix_buffers_no_gain", ARDOUR::mix_buffers_no_gain)
1337 .addFunction ("mix_buffers_with_gain", ARDOUR::mix_buffers_with_gain)
1338 .addFunction ("copy_vector", ARDOUR::copy_vector)
1339 .addFunction ("dB_to_coefficient", &dB_to_coefficient)
1340 .addFunction ("fast_coefficient_to_dB", &fast_coefficient_to_dB)
1341 .addFunction ("accurate_coefficient_to_dB", &accurate_coefficient_to_dB)
1342 .addFunction ("memset", &DSP::memset)
1343 .addFunction ("mmult", &DSP::mmult)
1344 .addFunction ("log_meter", &DSP::log_meter)
1345 .addFunction ("log_meter_coeff", &DSP::log_meter_coeff)
1346 .addRefFunction ("peaks", &DSP::peaks)
1348 .beginClass <DSP::LowPass> ("LowPass")
1349 .addConstructor <void (*) (double, float)> ()
1350 .addFunction ("proc", &DSP::LowPass::proc)
1351 .addFunction ("ctrl", &DSP::LowPass::ctrl)
1352 .addFunction ("set_cutoff", &DSP::LowPass::set_cutoff)
1353 .addFunction ("reset", &DSP::LowPass::reset)
1355 .beginClass <DSP::Biquad> ("Biquad")
1356 .addConstructor <void (*) (double)> ()
1357 .addFunction ("run", &DSP::Biquad::run)
1358 .addFunction ("compute", &DSP::Biquad::compute)
1359 .addFunction ("configure", &DSP::Biquad::configure)
1360 .addFunction ("reset", &DSP::Biquad::reset)
1361 .addFunction ("dB_at_freq", &DSP::Biquad::dB_at_freq)
1363 .beginClass <DSP::FFTSpectrum> ("FFTSpectrum")
1364 .addConstructor <void (*) (uint32_t, double)> ()
1365 .addFunction ("set_data_hann", &DSP::FFTSpectrum::set_data_hann)
1366 .addFunction ("execute", &DSP::FFTSpectrum::execute)
1367 .addFunction ("power_at_bin", &DSP::FFTSpectrum::power_at_bin)
1368 .addFunction ("freq_at_bin", &DSP::FFTSpectrum::freq_at_bin)
1372 .beginNamespace ("BiquadType")
1373 .addConst ("LowPass", ARDOUR::DSP::Biquad::LowPass)
1374 .addConst ("HighPass", ARDOUR::DSP::Biquad::HighPass)
1375 .addConst ("BandPassSkirt", ARDOUR::DSP::Biquad::BandPassSkirt)
1376 .addConst ("BandPass0dB", ARDOUR::DSP::Biquad::BandPass0dB)
1377 .addConst ("Notch", ARDOUR::DSP::Biquad::Notch)
1378 .addConst ("AllPass", ARDOUR::DSP::Biquad::AllPass)
1379 .addConst ("Peaking", ARDOUR::DSP::Biquad::Peaking)
1380 .addConst ("LowShelf", ARDOUR::DSP::Biquad::LowShelf)
1381 .addConst ("HighShelf", ARDOUR::DSP::Biquad::HighShelf)
1384 .beginClass <DSP::DspShm> ("DspShm")
1385 .addConstructor<void (*) (size_t)> ()
1386 .addFunction ("allocate", &DSP::DspShm::allocate)
1387 .addFunction ("clear", &DSP::DspShm::clear)
1388 .addFunction ("to_float", &DSP::DspShm::to_float)
1389 .addFunction ("to_int", &DSP::DspShm::to_int)
1390 .addFunction ("atomic_set_int", &DSP::DspShm::atomic_set_int)
1391 .addFunction ("atomic_get_int", &DSP::DspShm::atomic_get_int)
1394 .endNamespace () // DSP
1396 .beginClass <LuaTableRef> ("LuaTableRef")
1397 .addCFunction ("get", &LuaTableRef::get)
1398 .addCFunction ("set", &LuaTableRef::set)
1401 .endNamespace (); // ARDOUR
1405 LuaBindings::session (lua_State* L)
1407 // non-realtime session functions
1408 luabridge::getGlobalNamespace (L)
1409 .beginNamespace ("ARDOUR")
1410 .beginClass <Session> ("Session")
1411 .addFunction ("save_state", &Session::save_state)
1412 .addFunction ("set_dirty", &Session::set_dirty)
1413 .addFunction ("unknown_processors", &Session::unknown_processors)
1415 .addFunction<RouteList (Session::*)(uint32_t, const std::string&, const std::string&, PlaylistDisposition)> ("new_route_from_template", &Session::new_route_from_template)
1416 // TODO session_add_audio_track session_add_midi_track session_add_mixed_track
1417 //.addFunction ("new_midi_track", &Session::new_midi_track)
1420 .endNamespace (); // ARDOUR
1424 LuaBindings::osc (lua_State* L)
1426 luabridge::getGlobalNamespace (L)
1427 .beginNamespace ("ARDOUR")
1428 .beginNamespace ("LuaOSC")
1429 .beginClass<LuaOSC::Address> ("Address")
1430 .addConstructor<void (*) (std::string)> ()
1431 .addCFunction ("send", &LuaOSC::Address::send)
1438 LuaBindings::set_session (lua_State* L, Session *s)
1440 /* LuaBridge uses unique keys to identify classes/c-types.
1442 * Those keys are "generated" by using the memory-address of a static
1443 * variable, templated for every Class.
1444 * (see libs/lua/LuaBridge/detail/ClassInfo.h)
1446 * When linking the final executable there must be exactly one static
1447 * function (static variable) for every templated class.
1448 * This works fine on OSX and Linux...
1450 * Windows (mingw and MSVC) however expand the template differently for libardour
1451 * AND gtk2_ardour. We end up with two identical static functions
1452 * at different addresses!!
1454 * The Solution: have gtk2_ardour never include LuaBridge headers directly
1455 * and always go via libardour function calls for classes that are registered
1456 * in libardour. (calling lua itself is fine, calling c-functions in the GUI
1457 * which expand the template is not)
1459 * (the actual cause: even static symbols in a .dll have no fixed address
1460 * and are mapped when loading the dll. static functions in .exe do have a fixed
1464 * 0000000000000000 I __imp__ZZN9luabridge9ClassInfoIN6ARDOUR7SessionEE11getClassKeyEvE5value
1465 * 0000000000000000 I __nm__ZZN9luabridge9ClassInfoIN6ARDOUR7SessionEE11getClassKeyEvE5value
1466 * 0000000000000000 T _ZN9luabridge9ClassInfoIN6ARDOUR7SessionEE11getClassKeyEv
1469 * 000000000104f560 d .data$_ZZN9luabridge9ClassInfoIN6ARDOUR7SessionEE11getClassKeyEvE5value
1470 * 000000000104f560 D _ZZN9luabridge9ClassInfoIN6ARDOUR7SessionEE11getClassKeyEvE5value
1471 * 0000000000e9baf0 T _ZN9luabridge9ClassInfoIN6ARDOUR7SessionEE11getClassKeyEv
1475 luabridge::push <Session *> (L, s);
1476 lua_setglobal (L, "Session");
1479 // call lua function.
1480 luabridge::LuaRef cb_ses = luabridge::getGlobal (L, "new_session");
1481 if (cb_ses.type() == LUA_TFUNCTION) { cb_ses(s->name()); } // TODO args