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 "pbd/stateful_diff_command.h"
22 #include "pbd/openuri.h"
24 #include "temporal/bbt_time.h"
26 #include "evoral/Control.hpp"
27 #include "evoral/ControlList.hpp"
28 #include "evoral/Range.hpp"
30 #include "ardour/amp.h"
31 #include "ardour/audioengine.h"
32 #include "ardour/audioregion.h"
33 #include "ardour/audiosource.h"
34 #include "ardour/audio_backend.h"
35 #include "ardour/audio_buffer.h"
36 #include "ardour/audio_port.h"
37 #include "ardour/audio_track.h"
38 #include "ardour/audioplaylist.h"
39 #include "ardour/buffer_set.h"
40 #include "ardour/beats_samples_converter.h"
41 #include "ardour/chan_mapping.h"
42 #include "ardour/dB.h"
43 #include "ardour/delayline.h"
44 #include "ardour/disk_reader.h"
45 #include "ardour/disk_writer.h"
46 #include "ardour/dsp_filter.h"
47 #include "ardour/file_source.h"
48 #include "ardour/fluid_synth.h"
49 #include "ardour/interthread_info.h"
50 #include "ardour/lua_api.h"
51 #include "ardour/luabindings.h"
52 #include "ardour/luaproc.h"
53 #include "ardour/meter.h"
54 #include "ardour/midi_model.h"
55 #include "ardour/midi_track.h"
56 #include "ardour/midi_playlist.h"
57 #include "ardour/midi_port.h"
58 #include "ardour/midi_region.h"
59 #include "ardour/midi_source.h"
60 #include "ardour/panner_shell.h"
61 #include "ardour/phase_control.h"
62 #include "ardour/playlist.h"
63 #include "ardour/plugin.h"
64 #include "ardour/plugin_insert.h"
65 #include "ardour/polarity_processor.h"
66 #include "ardour/port_manager.h"
67 #include "ardour/progress.h"
68 #include "ardour/runtime_functions.h"
69 #include "ardour/region.h"
70 #include "ardour/region_factory.h"
71 #include "ardour/return.h"
72 #include "ardour/route_group.h"
73 #include "ardour/send.h"
74 #include "ardour/session.h"
75 #include "ardour/session_object.h"
76 #include "ardour/sidechain.h"
77 #include "ardour/solo_isolate_control.h"
78 #include "ardour/solo_safe_control.h"
79 #include "ardour/stripable.h"
80 #include "ardour/track.h"
81 #include "ardour/tempo.h"
82 #include "ardour/vca.h"
83 #include "ardour/vca_manager.h"
85 #include "LuaBridge/LuaBridge.h"
87 #ifdef PLATFORM_WINDOWS
88 /* luabridge uses addresses of static functions/variables to identify classes.
90 * Static symbols on windows (even identical symbols) are not
91 * mapped to the same address when mixing .dll + .exe.
92 * So we need a single point to define those static functions.
93 * (normally they're header-only in libs/lua/LuaBridge/detail/ClassInfo.h)
95 * Really!! A static function with a static variable in a library header
96 * should never ever be replicated, even if it is a template.
97 * But then again this is windows... what else can go wrong ?!
102 luabridge::ClassInfo<T>::getStaticKey ()
110 luabridge::ClassInfo<T>::getClassKey ()
118 luabridge::ClassInfo<T>::getConstKey ()
125 luabridge::getIdentityKey ()
131 /* ...and this is the ugly part of it.
133 * We need to foward declare classes from gtk2_ardour
134 * AND explicily list classes which are used by gtk2_ardour's bindings.
136 * This is required because some of the GUI classes use objects from libardour
137 * as function parameters or return values and the .exe would re-create
138 * symbols for libardour objects.
141 #define CLASSKEYS(CLS) \
142 template void const* luabridge::ClassInfo< CLS >::getStaticKey(); \
143 template void const* luabridge::ClassInfo< CLS >::getClassKey(); \
144 template void const* luabridge::ClassInfo< CLS >::getConstKey();
146 #define CLASSINFO(CLS) \
148 template void const* luabridge::ClassInfo< CLS >::getStaticKey(); \
149 template void const* luabridge::ClassInfo< CLS >::getClassKey(); \
150 template void const* luabridge::ClassInfo< CLS >::getConstKey();
152 CLASSINFO(ArdourMarker);
154 CLASSINFO(MarkerSelection);
155 CLASSINFO(PublicEditor);
156 CLASSINFO(RegionSelection);
157 CLASSINFO(RegionView);
158 CLASSINFO(StripableTimeAxisView);
159 CLASSINFO(RouteTimeAxisView);
161 CLASSINFO(Selectable);
162 CLASSINFO(Selection);
163 CLASSINFO(TimeAxisView);
164 CLASSINFO(TimeAxisViewItem);
165 CLASSINFO(TimeSelection);
166 CLASSINFO(TrackSelection);
167 CLASSINFO(TrackViewList);
170 CLASSKEYS(std::bitset<48ul>); // LuaSignal::LAST_SIGNAL
174 CLASSKEYS(unsigned char);
176 CLASSKEYS(ArdourMarker*);
177 CLASSKEYS(Selectable*);
178 CLASSKEYS(std::list<Selectable*>);
180 CLASSKEYS(ARDOUR::AudioEngine);
181 CLASSKEYS(ARDOUR::BeatsSamplesConverter);
182 CLASSKEYS(ARDOUR::DoubleBeatsSamplesConverter);
183 CLASSKEYS(ARDOUR::BufferSet);
184 CLASSKEYS(ARDOUR::ChanCount);
185 CLASSKEYS(ARDOUR::ChanMapping);
186 CLASSKEYS(ARDOUR::DSP::DspShm);
187 CLASSKEYS(ARDOUR::DataType);
188 CLASSKEYS(ARDOUR::FluidSynth);
189 CLASSKEYS(ARDOUR::Location);
190 CLASSKEYS(ARDOUR::LuaAPI::Vamp);
191 CLASSKEYS(ARDOUR::LuaOSC::Address);
192 CLASSKEYS(ARDOUR::LuaProc);
193 CLASSKEYS(ARDOUR::LuaTableRef);
194 CLASSKEYS(ARDOUR::MidiModel::NoteDiffCommand);
195 CLASSKEYS(ARDOUR::MonitorProcessor);
196 CLASSKEYS(ARDOUR::RouteGroup);
197 CLASSKEYS(ARDOUR::ParameterDescriptor);
198 CLASSKEYS(ARDOUR::PeakMeter);
199 CLASSKEYS(ARDOUR::PluginInfo);
200 CLASSKEYS(ARDOUR::Plugin::PresetRecord);
201 CLASSKEYS(ARDOUR::PortEngine);
202 CLASSKEYS(ARDOUR::PortManager);
203 CLASSKEYS(ARDOUR::PresentationInfo);
204 CLASSKEYS(ARDOUR::RCConfiguration);
205 CLASSKEYS(ARDOUR::Session);
206 CLASSKEYS(ARDOUR::SessionConfiguration);
207 CLASSKEYS(ARDOUR::Slavable);
208 CLASSKEYS(ARDOUR::Source);
209 CLASSKEYS(ARDOUR::VCA);
210 CLASSKEYS(ARDOUR::VCAManager);
213 CLASSKEYS(PBD::Configuration);
214 CLASSKEYS(PBD::PropertyChange);
215 CLASSKEYS(PBD::StatefulDestructible);
217 CLASSKEYS(Temporal::Beats);
218 CLASSKEYS(Evoral::Event<samplepos_t>);
219 CLASSKEYS(Evoral::ControlEvent);
222 CLASSKEYS(std::vector<std::string>);
223 CLASSKEYS(std::vector<float>);
224 CLASSKEYS(std::vector<float*>);
225 CLASSKEYS(std::vector<double>);
226 CLASSKEYS(std::list<int64_t>);
228 CLASSKEYS(std::list<Evoral::ControlEvent*>);
230 CLASSKEYS(std::vector<ARDOUR::Plugin::PresetRecord>);
231 CLASSKEYS(std::vector<boost::shared_ptr<ARDOUR::Processor> >);
232 CLASSKEYS(std::vector<boost::shared_ptr<ARDOUR::Source> >);
234 CLASSKEYS(std::list<ArdourMarker*>);
235 CLASSKEYS(std::list<TimeAxisView*>);
236 CLASSKEYS(std::list<ARDOUR::AudioRange>);
237 CLASSKEYS(std::list<boost::shared_ptr<ARDOUR::Port> >);
238 CLASSKEYS(std::list<boost::shared_ptr<ARDOUR::Region> >);
239 CLASSKEYS(std::list<boost::shared_ptr<ARDOUR::Route> >);
240 CLASSKEYS(std::list<boost::shared_ptr<ARDOUR::Stripable> >);
241 CLASSKEYS(boost::shared_ptr<std::list<boost::shared_ptr<ARDOUR::Route> > >);
243 CLASSKEYS(boost::shared_ptr<ARDOUR::AudioRegion>);
244 CLASSKEYS(boost::shared_ptr<ARDOUR::AudioSource>);
245 CLASSKEYS(boost::shared_ptr<ARDOUR::Automatable>);
246 CLASSKEYS(boost::shared_ptr<ARDOUR::AutomatableSequence<Temporal::Beats> >);
247 CLASSKEYS(boost::shared_ptr<ARDOUR::AutomationList>);
248 CLASSKEYS(boost::shared_ptr<ARDOUR::FileSource>);
249 CLASSKEYS(boost::shared_ptr<ARDOUR::MidiModel>);
250 CLASSKEYS(boost::shared_ptr<ARDOUR::MidiPlaylist>);
251 CLASSKEYS(boost::shared_ptr<ARDOUR::MidiRegion>);
252 CLASSKEYS(boost::shared_ptr<ARDOUR::MidiSource>);
253 CLASSKEYS(boost::shared_ptr<ARDOUR::PluginInfo>);
254 CLASSKEYS(boost::shared_ptr<ARDOUR::Processor>);
255 CLASSKEYS(boost::shared_ptr<ARDOUR::Readable>);
256 CLASSKEYS(boost::shared_ptr<ARDOUR::Region>);
257 CLASSKEYS(boost::shared_ptr<Evoral::ControlList>);
258 CLASSKEYS(boost::shared_ptr<Evoral::Note<Temporal::Beats> >);
259 CLASSKEYS(boost::shared_ptr<Evoral::Sequence<Temporal::Beats> >);
261 CLASSKEYS(boost::shared_ptr<ARDOUR::Playlist>);
262 CLASSKEYS(boost::shared_ptr<ARDOUR::Route>);
263 CLASSKEYS(boost::shared_ptr<ARDOUR::VCA>);
264 CLASSKEYS(boost::weak_ptr<ARDOUR::Route>);
265 CLASSKEYS(boost::weak_ptr<ARDOUR::VCA>);
267 CLASSKEYS(Vamp::RealTime);
268 CLASSKEYS(Vamp::PluginBase);
269 CLASSKEYS(Vamp::PluginBase::ParameterDescriptor);
270 CLASSKEYS(Vamp::Plugin);
271 CLASSKEYS(Vamp::Plugin::OutputDescriptor);
272 CLASSKEYS(Vamp::Plugin::Feature);
273 CLASSKEYS(Vamp::Plugin::OutputList);
274 CLASSKEYS(Vamp::Plugin::FeatureList);
275 CLASSKEYS(Vamp::Plugin::FeatureSet);
282 namespace LuaDialog {
291 CLASSKEYS(Cairo::Context);
292 CLASSKEYS(LuaCairo::ImageSurface);
293 CLASSKEYS(LuaCairo::PangoLayout);
295 CLASSKEYS(LuaDialog::Message);
296 CLASSKEYS(LuaDialog::Dialog);
298 #endif // end windows special case
300 /* Some notes on Lua bindings for libardour and friends
302 * - Prefer factory methods over Contructors whenever possible.
303 * Don't expose the constructor method unless required.
305 * e.g. Don't allow the script to construct a "Track" Object directly
306 * but do allow to create a "BBT_TIME" object.
308 * - Do not dereference Shared or Weak Pointers. Pass the pointer to Lua.
309 * - Define Objects as boost:shared_ptr Object whenever possible.
311 * Storing a boost::shared_ptr in a Lua-variable keeps the reference
312 * until that variable is set to 'nil'.
313 * (if the script were to keep a direct pointer to the object instance, the
314 * behaviour is undefined if the actual object goes away)
316 * Methods of the actual class are indirectly exposed,
317 * boost::*_ptr get() and ::lock() is implicit when the class is exported
318 * as LuaBridge's "WSPtrClass".
321 using namespace ARDOUR;
323 /** Access libardour global configuration */
324 static RCConfiguration* _libardour_config () {
325 return ARDOUR::Config;
329 LuaBindings::stddef (lua_State* L)
331 // std::list<std::string>
332 luabridge::getGlobalNamespace (L)
333 .beginNamespace ("C")
334 .beginStdList <std::string> ("StringList")
337 // std::vector<std::string>
338 .beginStdVector <std::string> ("StringVector")
341 // std::vector<float>
342 .beginStdVector <float> ("FloatVector")
345 // register float array (uint8_t*)
346 .registerArray <uint8_t> ("ByteArray")
348 // register float array (float*)
349 .registerArray <float> ("FloatArray")
351 // register float array (int32_t*)
352 .registerArray <int32_t> ("IntArray")
354 // std::vector<float*>
355 .beginStdVector <float*> ("FloatArrayVector")
358 // samplepos_t, sampleoffset_t lists e.g. AnalysisFeatureList
359 .beginStdList <int64_t> ("Int64List")
367 LuaBindings::common (lua_State* L)
369 luabridge::getGlobalNamespace (L)
370 .beginNamespace ("PBD")
372 .addFunction ("open_uri", (bool (*) (const std::string&))&PBD::open_uri)
373 .addFunction ("open_uri", &PBD::open_folder)
375 .beginClass <PBD::ID> ("ID")
376 .addConstructor <void (*) (std::string)> ()
377 .addFunction ("to_s", &PBD::ID::to_s) // TODO special case LUA __tostring ?
380 .beginStdVector <PBD::ID> ("IdVector").endClass ()
382 .beginClass <XMLNode> ("XMLNode")
383 .addFunction ("name", &XMLNode::name)
386 .beginClass <PBD::Stateful> ("Stateful")
387 .addFunction ("id", &PBD::Stateful::id)
388 .addFunction ("properties", &PBD::Stateful::properties)
389 .addFunction ("clear_changes", &PBD::Stateful::clear_changes)
392 .beginWSPtrClass <PBD::Stateful> ("StatefulPtr")
393 .addFunction ("id", &PBD::Stateful::id)
394 .addFunction ("properties", &PBD::Stateful::properties)
395 .addFunction ("clear_changes", &PBD::Stateful::clear_changes)
398 .deriveClass <PBD::StatefulDestructible, PBD::Stateful> ("StatefulDestructible")
401 .deriveClass <PBD::Configuration, PBD::Stateful> ("Configuration")
404 .deriveWSPtrClass <PBD::StatefulDestructible, PBD::Stateful> ("StatefulDestructiblePtr")
407 .deriveClass <Command, PBD::StatefulDestructible> ("Command")
408 .addFunction ("set_name", &Command::set_name)
409 .addFunction ("name", &Command::name)
412 /* UndoTransaction::add_command() subscribes to DropReferences()
413 * and deletes the object.
415 * This object cannot be constructed by lua because lua would manage lifetime
416 * and delete the object leading to a double free.
418 * use Session::add_stateful_diff_command()
419 * and Session::abort_reversible_command()
421 .deriveClass <PBD::StatefulDiffCommand, Command> ("StatefulDiffCommand")
422 .addFunction ("undo", &PBD::StatefulDiffCommand::undo)
423 .addFunction ("empty", &PBD::StatefulDiffCommand::empty)
426 .deriveWSPtrClass <PBD::Controllable, PBD::StatefulDestructible> ("Controllable")
427 .addFunction ("name", &PBD::Controllable::name)
428 .addFunction ("get_value", &PBD::Controllable::get_value)
431 .beginClass <PBD::RingBufferNPT <uint8_t> > ("RingBuffer8")
432 .addConstructor <void (*) (size_t)> ()
433 .addFunction ("reset", &PBD::RingBufferNPT<uint8_t>::reset)
434 .addFunction ("read", &PBD::RingBufferNPT<uint8_t>::read)
435 .addFunction ("write", &PBD::RingBufferNPT<uint8_t>::write)
436 .addFunction ("write_one", &PBD::RingBufferNPT<uint8_t>::write_one)
437 .addFunction ("write_space", &PBD::RingBufferNPT<uint8_t>::write_space)
438 .addFunction ("read_space", &PBD::RingBufferNPT<uint8_t>::read_space)
439 .addFunction ("increment_read_ptr", &PBD::RingBufferNPT<uint8_t>::increment_read_ptr)
440 .addFunction ("increment_write_ptr", &PBD::RingBufferNPT<uint8_t>::increment_write_ptr)
443 .beginClass <PBD::RingBufferNPT <float> > ("RingBufferF")
444 .addConstructor <void (*) (size_t)> ()
445 .addFunction ("reset", &PBD::RingBufferNPT<float>::reset)
446 .addFunction ("read", &PBD::RingBufferNPT<float>::read)
447 .addFunction ("write", &PBD::RingBufferNPT<float>::write)
448 .addFunction ("write_one", &PBD::RingBufferNPT<float>::write_one)
449 .addFunction ("write_space", &PBD::RingBufferNPT<float>::write_space)
450 .addFunction ("read_space", &PBD::RingBufferNPT<float>::read_space)
451 .addFunction ("increment_read_ptr", &PBD::RingBufferNPT<float>::increment_read_ptr)
452 .addFunction ("increment_write_ptr", &PBD::RingBufferNPT<float>::increment_write_ptr)
455 .beginClass <PBD::RingBufferNPT <int> > ("RingBufferI")
456 .addConstructor <void (*) (size_t)> ()
457 .addFunction ("reset", &PBD::RingBufferNPT<int>::reset)
458 .addFunction ("read", &PBD::RingBufferNPT<int>::read)
459 .addFunction ("write", &PBD::RingBufferNPT<int>::write)
460 .addFunction ("write_one", &PBD::RingBufferNPT<int>::write_one)
461 .addFunction ("write_space", &PBD::RingBufferNPT<int>::write_space)
462 .addFunction ("read_space", &PBD::RingBufferNPT<int>::read_space)
463 .addFunction ("increment_read_ptr", &PBD::RingBufferNPT<int>::increment_read_ptr)
464 .addFunction ("increment_write_ptr", &PBD::RingBufferNPT<int>::increment_write_ptr)
468 .beginNamespace ("GroupControlDisposition")
469 .addConst ("InverseGroup", PBD::Controllable::GroupControlDisposition(PBD::Controllable::InverseGroup))
470 .addConst ("NoGroup", PBD::Controllable::GroupControlDisposition(PBD::Controllable::NoGroup))
471 .addConst ("UseGroup", PBD::Controllable::GroupControlDisposition(PBD::Controllable::UseGroup))
474 .endNamespace (); // PBD
476 luabridge::getGlobalNamespace (L)
477 .beginNamespace ("Timecode")
478 .beginClass <Timecode::BBT_Time> ("BBT_TIME")
479 .addConstructor <void (*) (uint32_t, uint32_t, uint32_t)> ()
480 .addData ("bars", &Timecode::BBT_Time::bars)
481 .addData ("beats", &Timecode::BBT_Time::beats)
482 .addData ("ticks", &Timecode::BBT_Time::ticks)
483 //.addStaticData ("ticks_per_beat", &Timecode::BBT_Time::ticks_per_beat, false)
486 .beginClass <Timecode::Time> ("Time")
487 .addConstructor <void (*) (double)> ()
488 .addData ("negative", &Timecode::Time::negative)
489 .addData ("hours", &Timecode::Time::hours)
490 .addData ("minutes", &Timecode::Time::minutes)
491 .addData ("seconds", &Timecode::Time::seconds)
492 .addData ("frames", &Timecode::Time::frames)
493 .addData ("subframes", &Timecode::Time::subframes)
494 .addData ("rate", &Timecode::Time::rate)
495 .addData ("drop", &Timecode::Time::drop)
498 // TODO add increment, decrement; push it into the class
500 /* libtimecode enums */
501 .beginNamespace ("TimecodeFormat")
502 .addConst ("TC23976", Timecode::TimecodeFormat(Timecode::timecode_23976))
503 .addConst ("TC24", Timecode::TimecodeFormat(Timecode::timecode_24))
504 .addConst ("TC24976", Timecode::TimecodeFormat(Timecode::timecode_24976))
505 .addConst ("TC25", Timecode::TimecodeFormat(Timecode::timecode_25))
506 .addConst ("TC2997", Timecode::TimecodeFormat(Timecode::timecode_2997))
507 .addConst ("TC2997DF", Timecode::TimecodeFormat(Timecode::timecode_2997drop))
508 .addConst ("TC2997000", Timecode::TimecodeFormat(Timecode::timecode_2997000))
509 .addConst ("TC2997000DF", Timecode::TimecodeFormat(Timecode::timecode_2997000drop))
510 .addConst ("TC30", Timecode::TimecodeFormat(Timecode::timecode_30))
511 .addConst ("TC5994", Timecode::TimecodeFormat(Timecode::timecode_5994))
512 .addConst ("TC60", Timecode::TimecodeFormat(Timecode::timecode_60))
516 luabridge::getGlobalNamespace (L)
518 .beginNamespace ("Evoral")
519 .beginClass <Evoral::Event<samplepos_t> > ("Event")
520 .addFunction ("clear", &Evoral::Event<samplepos_t>::clear)
521 .addFunction ("size", &Evoral::Event<samplepos_t>::size)
522 .addFunction ("set_buffer", &Evoral::Event<samplepos_t>::set_buffer)
523 .addFunction ("buffer", (uint8_t*(Evoral::Event<samplepos_t>::*)())&Evoral::Event<samplepos_t>::buffer)
524 .addFunction ("time", (samplepos_t (Evoral::Event<samplepos_t>::*)())&Evoral::Event<samplepos_t>::time)
527 .beginClass <Temporal::Beats> ("Beats")
528 .addConstructor <void (*) (double)> ()
529 .addFunction ("to_double", &Temporal::Beats::to_double)
532 .beginClass <Evoral::Parameter> ("Parameter")
533 .addConstructor <void (*) (uint32_t, uint8_t, uint32_t)> ()
534 .addFunction ("type", &Evoral::Parameter::type)
535 .addFunction ("channel", &Evoral::Parameter::channel)
536 .addFunction ("id", &Evoral::Parameter::id)
539 .beginClass <Evoral::ControlEvent> ("ControlEvent")
540 .addData ("when", &Evoral::ControlEvent::when)
541 .addData ("value", &Evoral::ControlEvent::value)
544 .beginWSPtrClass <Evoral::ControlList> ("ControlList")
545 .addFunction ("add", &Evoral::ControlList::add)
546 .addFunction ("thin", &Evoral::ControlList::thin)
547 .addFunction ("eval", &Evoral::ControlList::eval)
548 .addRefFunction ("rt_safe_eval", &Evoral::ControlList::rt_safe_eval)
549 .addFunction ("interpolation", &Evoral::ControlList::interpolation)
550 .addFunction ("set_interpolation", &Evoral::ControlList::set_interpolation)
551 .addFunction ("truncate_end", &Evoral::ControlList::truncate_end)
552 .addFunction ("truncate_start", &Evoral::ControlList::truncate_start)
553 .addFunction ("clear", (void (Evoral::ControlList::*)(double, double))&Evoral::ControlList::clear)
554 .addFunction ("clear_list", (void (Evoral::ControlList::*)())&Evoral::ControlList::clear)
555 .addFunction ("in_write_pass", &Evoral::ControlList::in_write_pass)
556 .addFunction ("events", &Evoral::ControlList::events)
559 .beginWSPtrClass <Evoral::ControlSet> ("ControlSet")
562 .beginWSPtrClass <Evoral::Control> ("Control")
563 .addFunction ("list", (boost::shared_ptr<Evoral::ControlList>(Evoral::Control::*)())&Evoral::Control::list)
566 .beginClass <Evoral::ParameterDescriptor> ("ParameterDescriptor")
567 .addVoidConstructor ()
568 .addData ("lower", &Evoral::ParameterDescriptor::lower)
569 .addData ("upper", &Evoral::ParameterDescriptor::upper)
570 .addData ("normal", &Evoral::ParameterDescriptor::normal)
571 .addData ("toggled", &Evoral::ParameterDescriptor::toggled)
572 .addData ("logarithmic", &Evoral::ParameterDescriptor::logarithmic)
575 .beginClass <Evoral::Range<samplepos_t> > ("Range")
576 .addConstructor <void (*) (samplepos_t, samplepos_t)> ()
577 .addData ("from", &Evoral::Range<samplepos_t>::from)
578 .addData ("to", &Evoral::Range<samplepos_t>::to)
581 .deriveWSPtrClass <Evoral::Sequence<Temporal::Beats>, Evoral::ControlSet> ("Sequence")
584 .beginWSPtrClass <Evoral::Note<Temporal::Beats> > ("NotePtr")
585 .addFunction ("time", &Evoral::Note<Temporal::Beats>::time)
586 .addFunction ("note", &Evoral::Note<Temporal::Beats>::note)
587 .addFunction ("velocity", &Evoral::Note<Temporal::Beats>::velocity)
588 .addFunction ("off_velocity", &Evoral::Note<Temporal::Beats>::off_velocity)
589 .addFunction ("length", &Evoral::Note<Temporal::Beats>::length)
590 .addFunction ("channel", &Evoral::Note<Temporal::Beats>::channel)
593 /* libevoral enums */
594 .beginNamespace ("InterpolationStyle")
595 .addConst ("Discrete", Evoral::ControlList::InterpolationStyle(Evoral::ControlList::Discrete))
596 .addConst ("Linear", Evoral::ControlList::InterpolationStyle(Evoral::ControlList::Linear))
597 .addConst ("Curved", Evoral::ControlList::InterpolationStyle(Evoral::ControlList::Curved))
600 .endNamespace (); // Evoral
602 luabridge::getGlobalNamespace (L)
603 .beginNamespace ("Vamp")
605 .beginClass<Vamp::RealTime> ("RealTime")
606 .addConstructor <void (*) (int, int)> ()
607 .addData ("sec", &Vamp::RealTime::sec, false)
608 .addData ("nsec", &Vamp::RealTime::nsec, false)
609 .addFunction ("usec", &Vamp::RealTime::usec)
610 .addFunction ("msec", &Vamp::RealTime::msec)
611 .addFunction ("toString", &Vamp::RealTime::toString)
612 .addStaticFunction ("realTime2Frame", &Vamp::RealTime::realTime2Frame)
613 .addStaticFunction ("frame2RealTime", &Vamp::RealTime::frame2RealTime)
616 .beginClass<Vamp::PluginBase> ("PluginBase")
617 .addFunction ("getIdentifier", &Vamp::PluginBase::getIdentifier)
618 .addFunction ("getName", &Vamp::PluginBase::getName)
619 .addFunction ("getDescription", &Vamp::PluginBase::getDescription)
620 .addFunction ("getMaker", &Vamp::PluginBase::getMaker)
621 .addFunction ("getCopyright", &Vamp::PluginBase::getCopyright)
622 .addFunction ("getPluginVersion", &Vamp::PluginBase::getPluginVersion)
623 .addFunction ("getParameterDescriptors", &Vamp::PluginBase::getParameterDescriptors)
624 .addFunction ("getParameter", &Vamp::PluginBase::getParameter)
625 .addFunction ("setParameter", &Vamp::PluginBase::setParameter)
626 .addFunction ("getPrograms", &Vamp::PluginBase::getPrograms)
627 .addFunction ("getCurrentProgram", &Vamp::PluginBase::getCurrentProgram)
628 .addFunction ("selectProgram", &Vamp::PluginBase::selectProgram)
629 .addFunction ("getType", &Vamp::PluginBase::getType)
632 .beginNamespace ("PluginBase")
633 .beginClass<Vamp::PluginBase::ParameterDescriptor> ("ParameterDescriptor")
634 .addData ("identifier", &Vamp::PluginBase::ParameterDescriptor::identifier)
635 .addData ("name", &Vamp::PluginBase::ParameterDescriptor::name)
636 .addData ("description", &Vamp::PluginBase::ParameterDescriptor::description)
637 .addData ("unit", &Vamp::PluginBase::ParameterDescriptor::unit)
638 .addData ("minValue", &Vamp::PluginBase::ParameterDescriptor::minValue)
639 .addData ("maxValue", &Vamp::PluginBase::ParameterDescriptor::maxValue)
640 .addData ("defaultValue", &Vamp::PluginBase::ParameterDescriptor::defaultValue)
641 .addData ("isQuantized", &Vamp::PluginBase::ParameterDescriptor::isQuantized)
642 .addData ("quantizeStep", &Vamp::PluginBase::ParameterDescriptor::quantizeStep)
643 .addData ("valueNames", &Vamp::PluginBase::ParameterDescriptor::valueNames)
646 .beginStdVector <Vamp::PluginBase::ParameterDescriptor> ("ParameterList")
648 .endNamespace () // Vamp::PluginBase
650 .deriveClass<Vamp::Plugin, Vamp::PluginBase> ("Plugin")
651 //.addFunction ("process", &Vamp::Plugin::process) // unusable due to float*const* -> LuaAPI::Vamp::process
652 .addFunction ("initialise", &Vamp::Plugin::initialise)
653 .addFunction ("reset", &Vamp::Plugin::reset)
654 .addFunction ("getInputDomain", &Vamp::Plugin::getInputDomain)
655 .addFunction ("getPreferredBlockSize", &Vamp::Plugin::getPreferredBlockSize)
656 .addFunction ("getPreferredStepSize", &Vamp::Plugin::getPreferredStepSize)
657 .addFunction ("getMinChannelCount", &Vamp::Plugin::getMinChannelCount)
658 .addFunction ("getMaxChannelCount", &Vamp::Plugin::getMaxChannelCount)
659 .addFunction ("getOutputDescriptors", &Vamp::Plugin::getOutputDescriptors)
660 .addFunction ("getRemainingFeatures", &Vamp::Plugin::getRemainingFeatures)
661 .addFunction ("getType", &Vamp::Plugin::getType)
664 .beginNamespace ("Plugin")
665 .beginClass<Vamp::Plugin::OutputDescriptor> ("OutputDescriptor")
666 .addData ("identifier", &Vamp::Plugin::OutputDescriptor::identifier)
667 .addData ("description", &Vamp::Plugin::OutputDescriptor::description)
668 .addData ("unit", &Vamp::Plugin::OutputDescriptor::unit)
669 .addData ("hasFixedBinCount", &Vamp::Plugin::OutputDescriptor::hasFixedBinCount)
670 .addData ("binCount", &Vamp::Plugin::OutputDescriptor::binCount)
671 .addData ("binNames", &Vamp::Plugin::OutputDescriptor::binNames)
672 .addData ("hasKnownExtents", &Vamp::Plugin::OutputDescriptor::hasKnownExtents)
673 .addData ("minValue", &Vamp::Plugin::OutputDescriptor::minValue)
674 .addData ("maxValue", &Vamp::Plugin::OutputDescriptor::maxValue)
675 .addData ("isQuantized", &Vamp::Plugin::OutputDescriptor::isQuantized)
676 .addData ("quantizeStep", &Vamp::Plugin::OutputDescriptor::quantizeStep)
677 .addData ("sampleType", &Vamp::Plugin::OutputDescriptor::sampleType)
678 .addData ("sampleRate", &Vamp::Plugin::OutputDescriptor::sampleRate)
679 .addData ("hasDuration", &Vamp::Plugin::OutputDescriptor::hasDuration)
682 /* Vamp::Plugin enums */
683 .beginNamespace ("InputDomain")
684 .addConst ("TimeDomain", Vamp::Plugin::InputDomain(Vamp::Plugin::TimeDomain))
685 .addConst ("FrequencyDomain", Vamp::Plugin::InputDomain(Vamp::Plugin::FrequencyDomain))
688 /* Vamp::Plugin::OutputDescriptor enum */
689 .beginNamespace ("OutputDescriptor")
690 .beginNamespace ("SampleType")
691 .addConst ("OneSamplePerStep", Vamp::Plugin::OutputDescriptor::SampleType(Vamp::Plugin::OutputDescriptor::OneSamplePerStep))
692 .addConst ("FixedSampleRate", Vamp::Plugin::OutputDescriptor::SampleType(Vamp::Plugin::OutputDescriptor::FixedSampleRate))
693 .addConst ("VariableSampleRate", Vamp::Plugin::OutputDescriptor::SampleType(Vamp::Plugin::OutputDescriptor::VariableSampleRate))
695 .endNamespace () /* Vamp::Plugin::OutputDescriptor */
697 .beginClass<Vamp::Plugin::Feature> ("Feature")
698 .addData ("hasTimestamp", &Vamp::Plugin::Feature::hasTimestamp, false)
699 .addData ("timestamp", &Vamp::Plugin::Feature::timestamp, false)
700 .addData ("hasDuration", &Vamp::Plugin::Feature::hasDuration, false)
701 .addData ("duration", &Vamp::Plugin::Feature::duration, false)
702 .addData ("values", &Vamp::Plugin::Feature::values, false)
703 .addData ("label", &Vamp::Plugin::Feature::label, false)
706 .beginStdVector <Vamp::Plugin::OutputDescriptor> ("OutputList")
709 .beginStdVector <Vamp::Plugin::Feature> ("FeatureList")
712 .beginStdMap <int, Vamp::Plugin::FeatureList> ("FeatureSet")
715 .endNamespace () // Vamp::Plugin
716 .endNamespace ();// Vamp
718 luabridge::getGlobalNamespace (L)
719 .beginNamespace ("ARDOUR")
721 .beginClass <InterThreadInfo> ("InterThreadInfo")
722 .addVoidConstructor ()
723 .addData ("done", const_cast<bool InterThreadInfo::*>(&InterThreadInfo::done))
724 #if 0 // currently unused, lua is single-threaded, no custom UIs.
725 .addData ("cancel", (bool InterThreadInfo::*)&InterThreadInfo::cancel)
727 .addData ("progress", const_cast<float InterThreadInfo::*>(&InterThreadInfo::progress))
730 .beginClass <Progress> ("Progress")
733 .beginClass <MusicSample> ("MusicSample")
734 .addConstructor <void (*) (samplepos_t, int32_t)> ()
735 .addFunction ("set", &MusicSample::set)
736 .addData ("frame", &MusicSample::sample)
737 .addData ("division", &MusicSample::division)
740 .beginClass <AudioRange> ("AudioRange")
741 .addConstructor <void (*) (samplepos_t, samplepos_t, uint32_t)> ()
742 .addFunction ("length", &AudioRange::length)
743 .addFunction ("equal", &AudioRange::equal)
744 .addData ("start", &AudioRange::start)
745 .addData ("_end", &AudioRange::end) // XXX "end" is a lua reserved word
746 .addData ("id", &AudioRange::id)
749 .beginWSPtrClass <PluginInfo> ("PluginInfo")
750 .addNilPtrConstructor ()
751 .addData ("name", &PluginInfo::name, false)
752 .addData ("category", &PluginInfo::category, false)
753 .addData ("creator", &PluginInfo::creator, false)
754 .addData ("path", &PluginInfo::path, false)
755 .addData ("n_inputs", &PluginInfo::n_inputs, false)
756 .addData ("n_outputs", &PluginInfo::n_outputs, false)
757 .addData ("type", &PluginInfo::type, false)
758 .addData ("unique_id", &PluginInfo::unique_id, false)
759 .addFunction ("is_instrument", &PluginInfo::is_instrument)
760 .addFunction ("get_presets", &PluginInfo::get_presets)
763 .beginNamespace ("Route")
764 .beginClass <Route::ProcessorStreams> ("ProcessorStreams")
765 .addVoidConstructor ()
769 .beginClass <ChanMapping> ("ChanMapping")
770 .addVoidConstructor ()
771 .addFunction ("get", static_cast<uint32_t(ChanMapping::*)(DataType, uint32_t) const>(&ChanMapping::get))
772 .addFunction ("set", &ChanMapping::set)
773 .addFunction ("count", &ChanMapping::count)
774 .addFunction ("n_total", &ChanMapping::n_total)
775 .addFunction ("is_monotonic", &ChanMapping::is_monotonic)
776 .addConst ("Invalid", 4294967295U) // UINT32_MAX
779 .beginNamespace ("Properties")
780 // templated class definitions
781 .beginClass <PBD::PropertyDescriptor<bool> > ("BoolProperty").endClass ()
782 .beginClass <PBD::PropertyDescriptor<float> > ("FloatProperty").endClass ()
783 .beginClass <PBD::PropertyDescriptor<samplepos_t> > ("FrameposProperty").endClass ()
784 // actual references (TODO: also expose GQuark for std::set)
786 .addConst ("Start", &ARDOUR::Properties::start)
787 .addConst ("Length", &ARDOUR::Properties::length)
788 .addConst ("Position", &ARDOUR::Properties::position)
791 .beginClass <PBD::PropertyChange> ("PropertyChange")
792 // TODO add special handling (std::set<PropertyID>), PropertyID is a GQuark.
793 // -> direct map to lua table beginStdSet()A
795 // expand templated PropertyDescriptor<T>
796 .addFunction ("containsBool", &PBD::PropertyChange::contains<bool>)
797 .addFunction ("containsFloat", &PBD::PropertyChange::contains<float>)
798 .addFunction ("containsFramePos", &PBD::PropertyChange::contains<samplepos_t>)
801 .beginClass <PBD::PropertyList> ("PropertyList")
802 // is-a std::map<PropertyID, PropertyBase*>
805 .deriveClass <PBD::OwnedPropertyList, PBD::PropertyList> ("OwnedPropertyList")
808 .deriveWSPtrClass <AutomationList, Evoral::ControlList> ("AutomationList")
809 .addCast<PBD::Stateful> ("to_stateful")
810 .addCast<PBD::StatefulDestructible> ("to_statefuldestructible")
811 .addCast<Evoral::ControlList> ("list") // deprecated
812 .addFunction ("get_state", &AutomationList::get_state)
813 .addFunction ("memento_command", &AutomationList::memento_command)
814 .addFunction ("touching", &AutomationList::touching)
815 .addFunction ("writing", &AutomationList::writing)
816 .addFunction ("touch_enabled", &AutomationList::touch_enabled)
819 .deriveClass <Location, PBD::StatefulDestructible> ("Location")
820 .addFunction ("name", &Location::name)
821 .addFunction ("locked", &Location::locked)
822 .addFunction ("lock", &Location::lock)
823 .addFunction ("unlock", &Location::unlock)
824 .addFunction ("start", &Location::start)
825 .addFunction ("_end", &Location::end) // XXX "end" is a lua reserved word
826 .addFunction ("length", &Location::length)
827 .addFunction ("set_start", &Location::set_start)
828 .addFunction ("set_end", &Location::set_end)
829 .addFunction ("set_length", &Location::set)
830 .addFunction ("move_to", &Location::move_to)
831 .addFunction ("matches", &Location::matches)
832 .addFunction ("flags", &Location::flags)
833 .addFunction ("is_auto_punch", &Location::is_auto_punch)
834 .addFunction ("is_auto_loop", &Location::is_auto_loop)
835 .addFunction ("is_mark", &Location::is_mark)
836 .addFunction ("is_hidden", &Location::is_hidden)
837 .addFunction ("is_cd_marker", &Location::is_cd_marker)
838 .addFunction ("is_session_range", &Location::is_session_range)
839 .addFunction ("is_range_marker", &Location::is_range_marker)
842 .deriveClass <Locations, PBD::StatefulDestructible> ("Locations")
843 .addFunction ("list", static_cast<Locations::LocationList (Locations::*)()>(&Locations::list))
844 .addFunction ("auto_loop_location", &Locations::auto_loop_location)
845 .addFunction ("auto_punch_location", &Locations::auto_punch_location)
846 .addFunction ("session_range_location", &Locations::session_range_location)
847 .addFunction ("first_mark_after", &Locations::first_mark_after)
848 .addFunction ("first_mark_before", &Locations::first_mark_before)
849 .addFunction ("first_mark_at", &Locations::mark_at)
850 .addFunction ("mark_at", &Locations::mark_at)
851 .addFunction ("remove", &Locations::remove)
852 .addRefFunction ("marks_either_side", &Locations::marks_either_side)
853 .addRefFunction ("find_all_between", &Locations::find_all_between)
856 .beginWSPtrClass <SessionObject> ("SessionObjectPtr")
857 /* SessionObject is-a PBD::StatefulDestructible,
858 * but multiple inheritance is not covered by luabridge,
859 * we need explicit casts */
860 .addCast<PBD::Stateful> ("to_stateful")
861 .addCast<PBD::StatefulDestructible> ("to_statefuldestructible")
862 .addFunction ("name", &SessionObject::name)
865 .beginClass <SessionObject> ("SessionObject")
866 .addFunction ("name", &SessionObject::name)
867 .addCast<PBD::Stateful> ("to_stateful")
870 .beginWSPtrClass <Port> ("Port")
871 .addCast<MidiPort> ("to_midiport")
872 .addCast<AudioPort> ("to_audioport")
873 .addFunction ("name", &Port::name)
874 .addFunction ("pretty_name", &Port::pretty_name)
875 .addFunction ("receives_input", &Port::receives_input)
876 .addFunction ("sends_output", &Port::sends_output)
877 .addFunction ("connected", &Port::connected)
878 .addFunction ("disconnect_all", &Port::disconnect_all)
879 .addFunction ("connected_to", (bool (Port::*)(std::string const &)const)&Port::connected_to)
880 .addFunction ("connect", (int (Port::*)(std::string const &))&Port::connect)
881 .addFunction ("disconnect", (int (Port::*)(std::string const &))&Port::disconnect)
882 .addFunction ("physically_connected", &Port::physically_connected)
883 .addFunction ("private_latency_range", &Port::private_latency_range)
884 .addFunction ("public_latency_range", &Port::public_latency_range)
885 .addRefFunction ("get_connected_latency_range", &Port::get_connected_latency_range)
886 //.addStaticFunction ("port_offset", &Port::port_offset) // static
889 .deriveWSPtrClass <AudioPort, Port> ("AudioPort")
892 .deriveWSPtrClass <MidiPort, Port> ("MidiPort")
893 .addFunction ("input_active", &MidiPort::input_active)
894 .addFunction ("set_input_active", &MidiPort::set_input_active)
895 .addFunction ("get_midi_buffer", &MidiPort::get_midi_buffer) // DSP only
898 .beginWSPtrClass <PortSet> ("PortSet")
899 .addFunction ("num_ports", (size_t (PortSet::*)(DataType)const)&PortSet::num_ports)
900 .addFunction ("add", &PortSet::add)
901 .addFunction ("remove", &PortSet::remove)
902 .addFunction ("port", (boost::shared_ptr<Port> (PortSet::*)(DataType, size_t)const)&PortSet::port)
903 .addFunction ("contains", &PortSet::contains)
904 .addFunction ("clear", &PortSet::clear)
905 .addFunction ("empty", &PortSet::empty)
908 .deriveWSPtrClass <IO, SessionObject> ("IO")
909 .addFunction ("active", &IO::active)
910 .addFunction ("add_port", &IO::add_port)
911 .addFunction ("remove_port", &IO::remove_port)
912 .addFunction ("connect", &IO::connect)
913 .addFunction ("disconnect", (int (IO::*)(boost::shared_ptr<Port>, std::string, void *))&IO::disconnect)
914 .addFunction ("disconnect_all", (int (IO::*)(void *))&IO::disconnect)
915 .addFunction ("physically_connected", &IO::physically_connected)
916 .addFunction ("has_port", &IO::has_port)
917 .addFunction ("nth", &IO::nth)
918 .addFunction ("audio", &IO::audio)
919 .addFunction ("midi", &IO::midi)
920 .addFunction ("port_by_name", &IO::nth)
921 .addFunction ("n_ports", &IO::n_ports)
922 .addFunction ("latency", &IO::latency)
923 .addFunction ("public_latency", &IO::latency)
926 .deriveWSPtrClass <PannerShell, SessionObject> ("PannerShell")
927 .addFunction ("bypassed", &PannerShell::bypassed)
928 .addFunction ("set_bypassed", &PannerShell::set_bypassed)
931 .deriveClass <RouteGroup, SessionObject> ("RouteGroup")
932 .addFunction ("is_active", &RouteGroup::is_active)
933 .addFunction ("is_relative", &RouteGroup::is_relative)
934 .addFunction ("is_hidden", &RouteGroup::is_hidden)
935 .addFunction ("is_gain", &RouteGroup::is_gain)
936 .addFunction ("is_mute", &RouteGroup::is_mute)
937 .addFunction ("is_solo", &RouteGroup::is_solo)
938 .addFunction ("is_recenable", &RouteGroup::is_recenable)
939 .addFunction ("is_select", &RouteGroup::is_select)
940 .addFunction ("is_route_active", &RouteGroup::is_route_active)
941 .addFunction ("is_color", &RouteGroup::is_color)
942 .addFunction ("is_monitoring", &RouteGroup::is_monitoring)
943 .addFunction ("group_master_number", &RouteGroup::group_master_number)
944 .addFunction ("empty", &RouteGroup::empty)
945 .addFunction ("size", &RouteGroup::size)
946 .addFunction ("set_active", &RouteGroup::set_active)
947 .addFunction ("set_relative", &RouteGroup::set_relative)
948 .addFunction ("set_hidden", &RouteGroup::set_hidden)
949 .addFunction ("set_gain", &RouteGroup::set_gain)
950 .addFunction ("set_mute", &RouteGroup::set_mute)
951 .addFunction ("set_solo", &RouteGroup::set_solo)
952 .addFunction ("set_recenable", &RouteGroup::set_recenable)
953 .addFunction ("set_select", &RouteGroup::set_select)
954 .addFunction ("set_route_active", &RouteGroup::set_route_active)
955 .addFunction ("set_color", &RouteGroup::set_color)
956 .addFunction ("set_monitoring", &RouteGroup::set_monitoring)
957 .addFunction ("add", &RouteGroup::add)
958 .addFunction ("remove", &RouteGroup::remove)
959 .addFunction ("clear", &RouteGroup::clear)
960 .addFunction ("set_rgba", &RouteGroup::set_rgba)
961 .addFunction ("rgba", &RouteGroup::rgba)
962 .addFunction ("has_subgroup", &RouteGroup::has_subgroup)
963 .addFunction ("make_subgroup", &RouteGroup::make_subgroup)
964 .addFunction ("destroy_subgroup", &RouteGroup::destroy_subgroup)
965 .addFunction ("route_list", &RouteGroup::route_list)
968 .deriveClass <PresentationInfo, PBD::Stateful> ("PresentationInfo")
969 .addFunction ("color", &PresentationInfo::color)
970 .addFunction ("set_color", &PresentationInfo::set_color)
971 .addFunction ("order", &PresentationInfo::order)
972 .addFunction ("special", &PresentationInfo::special)
973 .addFunction ("flags", &PresentationInfo::flags)
974 .addConst ("max_order", ARDOUR::PresentationInfo::max_order)
977 .beginWSPtrClass <Slavable> ("Slavable")
978 .addFunction ("assign", &Slavable::assign)
979 .addFunction ("unassign", &Slavable::unassign)
980 .addFunction ("masters", &Slavable::masters)
981 .addFunction ("assigned_to", &Slavable::assigned_to)
984 .deriveWSPtrClass <Stripable, SessionObject> ("Stripable")
985 .addCast<Route> ("to_route")
986 .addCast<VCA> ("to_vca")
987 .addCast<Slavable> ("to_slavable")
988 .addCast<Automatable> ("to_automatable")
989 .addFunction ("is_auditioner", &Stripable::is_auditioner)
990 .addFunction ("is_private_route", &Stripable::is_private_route)
991 .addFunction ("is_master", &Stripable::is_master)
992 .addFunction ("is_monitor", &Stripable::is_monitor)
993 .addFunction ("is_hidden", &Stripable::is_hidden)
994 .addFunction ("is_selected", &Stripable::is_selected)
995 .addFunction ("gain_control", &Stripable::gain_control)
996 .addFunction ("solo_control", &Stripable::solo_control)
997 .addFunction ("solo_isolate_control", &Stripable::solo_isolate_control)
998 .addFunction ("solo_safe_control", &Stripable::solo_safe_control)
999 .addFunction ("mute_control", &Stripable::mute_control)
1000 .addFunction ("phase_control", &Stripable::phase_control)
1001 .addFunction ("trim_control", &Stripable::trim_control)
1002 .addFunction ("rec_enable_control", &Stripable::rec_enable_control)
1003 .addFunction ("rec_safe_control", &Stripable::rec_safe_control)
1004 .addFunction ("pan_azimuth_control", &Stripable::pan_azimuth_control)
1005 .addFunction ("pan_elevation_control", &Stripable::pan_elevation_control)
1006 .addFunction ("pan_width_control", &Stripable::pan_width_control)
1007 .addFunction ("pan_frontback_control", &Stripable::pan_frontback_control)
1008 .addFunction ("pan_lfe_control", &Stripable::pan_lfe_control)
1009 .addFunction ("send_level_control", &Stripable::send_level_controllable)
1010 .addFunction ("send_enable_control", &Stripable::send_level_controllable)
1011 .addFunction ("send_name", &Stripable::send_name)
1012 .addFunction ("monitor_control", &Stripable::monitor_control)
1013 .addFunction ("master_send_enable_control ", &Stripable::master_send_enable_controllable )
1014 .addFunction ("comp_enable_control ", &Stripable::comp_enable_controllable )
1015 .addFunction ("comp_threshold_control ", &Stripable::comp_threshold_controllable )
1016 .addFunction ("comp_speed_control ", &Stripable::comp_speed_controllable )
1017 .addFunction ("comp_mode_control ", &Stripable::comp_mode_controllable )
1018 .addFunction ("comp_makeup_control ", &Stripable::comp_makeup_controllable )
1019 .addFunction ("comp_redux_control ", &Stripable::comp_redux_controllable )
1020 .addFunction ("comp_mode_name", &Stripable::comp_mode_name)
1021 .addFunction ("comp_speed_name", &Stripable::comp_speed_name)
1022 .addFunction ("eq_band_cnt ", &Stripable::eq_band_cnt)
1023 .addFunction ("eq_enable_control ", &Stripable::eq_enable_controllable )
1024 .addFunction ("eq_band_name", &Stripable::eq_band_name)
1025 .addFunction ("eq_gain_control", &Stripable::eq_gain_controllable)
1026 .addFunction ("eq_freq_control ", &Stripable::eq_freq_controllable )
1027 .addFunction ("eq_q_control ", &Stripable::eq_q_controllable )
1028 .addFunction ("eq_shape_control ", &Stripable::eq_shape_controllable )
1029 .addFunction ("filter_freq_controllable ", &Stripable::filter_freq_controllable )
1030 .addFunction ("filter_slope_controllable ", &Stripable::filter_slope_controllable )
1031 .addFunction ("filter_enable_controllable ", &Stripable::filter_enable_controllable )
1032 .addFunction ("set_presentation_order", &Stripable::set_presentation_order)
1033 .addFunction ("presentation_info_ptr", &Stripable::presentation_info_ptr)
1037 .deriveWSPtrClass <VCA, Stripable> ("VCA")
1038 .addFunction ("full_name", &VCA::full_name)
1039 .addFunction ("number", &VCA::number)
1040 .addFunction ("gain_control", &VCA::gain_control)
1041 .addFunction ("solo_control", &VCA::solo_control)
1042 .addFunction ("mute_control", &VCA::mute_control)
1043 .addFunction ("slaved_to", &VCA::slaved_to)
1044 .addFunction ("slaved", &VCA::slaved)
1047 .deriveWSPtrClass <Route, Stripable> ("Route")
1048 .addCast<Track> ("to_track")
1049 .addFunction ("set_name", &Route::set_name)
1050 .addFunction ("comment", &Route::comment)
1051 .addFunction ("active", &Route::active)
1052 .addFunction ("set_active", &Route::set_active)
1053 .addFunction ("nth_plugin", &Route::nth_plugin)
1054 .addFunction ("nth_processor", &Route::nth_processor)
1055 .addFunction ("nth_send", &Route::nth_send)
1056 .addFunction ("add_processor_by_index", &Route::add_processor_by_index)
1057 .addFunction ("remove_processor", &Route::remove_processor)
1058 .addFunction ("remove_processors", &Route::remove_processors)
1059 .addFunction ("replace_processor", &Route::replace_processor)
1060 .addFunction ("reorder_processors", &Route::reorder_processors)
1061 .addFunction ("the_instrument", &Route::the_instrument)
1062 .addFunction ("n_inputs", &Route::n_inputs)
1063 .addFunction ("n_outputs", &Route::n_outputs)
1064 .addFunction ("input", &Route::input)
1065 .addFunction ("output", &Route::output)
1066 .addFunction ("panner_shell", &Route::panner_shell)
1067 .addFunction ("set_comment", &Route::set_comment)
1068 .addFunction ("strict_io", &Route::strict_io)
1069 .addFunction ("set_strict_io", &Route::set_strict_io)
1070 .addFunction ("reset_plugin_insert", &Route::reset_plugin_insert)
1071 .addFunction ("customize_plugin_insert", &Route::customize_plugin_insert)
1072 .addFunction ("add_sidechain", &Route::add_sidechain)
1073 .addFunction ("remove_sidechain", &Route::remove_sidechain)
1074 .addFunction ("main_outs", &Route::main_outs)
1075 .addFunction ("muted", &Route::muted)
1076 .addFunction ("soloed", &Route::soloed)
1077 .addFunction ("amp", &Route::amp)
1078 .addFunction ("trim", &Route::trim)
1079 .addFunction ("peak_meter", (boost::shared_ptr<PeakMeter> (Route::*)())&Route::peak_meter)
1080 .addFunction ("set_meter_point", &Route::set_meter_point)
1081 .addFunction ("signal_latency", &Route::signal_latency)
1082 .addFunction ("playback_latency", &Route::playback_latency)
1085 .deriveWSPtrClass <Playlist, SessionObject> ("Playlist")
1086 .addCast<AudioPlaylist> ("to_audioplaylist")
1087 .addCast<MidiPlaylist> ("to_midiplaylist")
1088 .addFunction ("region_by_id", &Playlist::region_by_id)
1089 .addFunction ("data_type", &Playlist::data_type)
1090 .addFunction ("n_regions", &Playlist::n_regions)
1091 //.addFunction ("get_extent", &Playlist::get_extent) // pair<samplepos_t, samplepos_t>
1092 .addFunction ("region_list", &Playlist::region_list)
1093 .addFunction ("add_region", &Playlist::add_region)
1094 .addFunction ("remove_region", &Playlist::remove_region)
1095 .addFunction ("regions_at", &Playlist::regions_at)
1096 .addFunction ("top_region_at", &Playlist::top_region_at)
1097 .addFunction ("top_unmuted_region_at", &Playlist::top_unmuted_region_at)
1098 .addFunction ("find_next_transient", &Playlist::find_next_transient)
1099 .addFunction ("find_next_region", &Playlist::find_next_region)
1100 .addFunction ("find_next_region_boundary", &Playlist::find_next_region_boundary)
1101 .addFunction ("count_regions_at", &Playlist::count_regions_at)
1102 .addFunction ("regions_touched", &Playlist::regions_touched)
1103 .addFunction ("regions_with_start_within", &Playlist::regions_with_start_within)
1104 .addFunction ("regions_with_end_within", &Playlist::regions_with_end_within)
1105 .addFunction ("raise_region", &Playlist::raise_region)
1106 .addFunction ("lower_region", &Playlist::lower_region)
1107 .addFunction ("raise_region_to_top", &Playlist::raise_region_to_top)
1108 .addFunction ("lower_region_to_bottom", &Playlist::lower_region_to_bottom)
1109 .addFunction ("duplicate", (void (Playlist::*)(boost::shared_ptr<Region>, samplepos_t, samplecnt_t, float))&Playlist::duplicate)
1110 .addFunction ("duplicate_until", &Playlist::duplicate_until)
1111 .addFunction ("duplicate_range", &Playlist::duplicate_range)
1112 .addFunction ("combine", &Playlist::combine)
1113 .addFunction ("uncombine", &Playlist::uncombine)
1114 .addFunction ("split_region", &Playlist::split_region)
1115 .addFunction ("split", (void (Playlist::*)(samplepos_t))&Playlist::split)
1116 .addFunction ("cut", (boost::shared_ptr<Playlist> (Playlist::*)(std::list<AudioRange>&, bool))&Playlist::cut)
1118 .addFunction ("copy", &Playlist::copy)
1119 .addFunction ("paste", &Playlist::paste)
1123 .deriveWSPtrClass <AudioPlaylist, Playlist> ("AudioPlaylist")
1124 .addFunction ("read", &AudioPlaylist::read)
1127 .deriveWSPtrClass <MidiPlaylist, Playlist> ("MidiPlaylist")
1128 .addFunction ("set_note_mode", &MidiPlaylist::set_note_mode)
1131 .deriveWSPtrClass <Track, Route> ("Track")
1132 .addCast<AudioTrack> ("to_audio_track")
1133 .addCast<MidiTrack> ("to_midi_track")
1134 .addFunction ("set_name", &Track::set_name)
1135 .addFunction ("can_record", &Track::can_record)
1136 .addFunction ("bounceable", &Track::bounceable)
1137 .addFunction ("bounce", &Track::bounce)
1138 .addFunction ("bounce_range", &Track::bounce_range)
1139 .addFunction ("playlist", &Track::playlist)
1142 .deriveWSPtrClass <AudioTrack, Track> ("AudioTrack")
1145 .deriveWSPtrClass <MidiTrack, Track> ("MidiTrack")
1148 .beginWSPtrClass <Readable> ("Readable")
1149 .addFunction ("read", &Readable::read)
1150 .addFunction ("readable_length", &Readable::readable_length)
1151 .addFunction ("n_channels", &Readable::n_channels)
1154 .deriveWSPtrClass <Region, SessionObject> ("Region")
1155 .addCast<Readable> ("to_readable")
1156 .addCast<MidiRegion> ("to_midiregion")
1157 .addCast<AudioRegion> ("to_audioregion")
1159 .addFunction ("position", &Region::position)
1160 .addFunction ("start", &Region::start)
1161 .addFunction ("length", &Region::length)
1162 .addFunction ("layer", &Region::layer)
1163 .addFunction ("data_type", &Region::data_type)
1164 .addFunction ("stretch", &Region::stretch)
1165 .addFunction ("shift", &Region::shift)
1166 .addRefFunction ("sync_offset", &Region::sync_offset)
1167 .addFunction ("sync_position", &Region::sync_position)
1168 .addFunction ("hidden", &Region::hidden)
1169 .addFunction ("muted", &Region::muted)
1170 .addFunction ("opaque", &Region::opaque)
1171 .addFunction ("locked", &Region::locked)
1172 .addFunction ("position_locked", &Region::position_locked)
1173 .addFunction ("video_locked", &Region::video_locked)
1174 .addFunction ("automatic", &Region::automatic)
1175 .addFunction ("whole_file", &Region::whole_file)
1176 .addFunction ("captured", &Region::captured)
1177 .addFunction ("can_move", &Region::can_move)
1178 .addFunction ("sync_marked", &Region::sync_marked)
1179 .addFunction ("external", &Region::external)
1180 .addFunction ("import", &Region::import)
1181 .addFunction ("covers", &Region::covers)
1182 .addFunction ("at_natural_position", &Region::at_natural_position)
1183 .addFunction ("is_compound", &Region::is_compound)
1185 .addFunction ("has_transients", &Region::has_transients)
1186 .addFunction ("transients", (AnalysisFeatureList (Region::*)())&Region::transients)
1188 /* editing operations */
1189 .addFunction ("set_length", &Region::set_length)
1190 .addFunction ("set_start", &Region::set_start)
1191 .addFunction ("set_position", &Region::set_position)
1192 .addFunction ("set_initial_position", &Region::set_initial_position)
1193 .addFunction ("nudge_position", &Region::nudge_position)
1194 .addFunction ("move_to_natural_position", &Region::move_to_natural_position)
1195 .addFunction ("move_start", &Region::move_start)
1196 .addFunction ("master_sources", &Region::master_sources)
1197 .addFunction ("master_source_names", &Region::master_source_names)
1198 .addFunction ("n_channels", &Region::n_channels)
1199 .addFunction ("trim_front", &Region::trim_front)
1200 .addFunction ("trim_end", &Region::trim_end)
1201 .addFunction ("trim_to", &Region::trim_to)
1202 .addFunction ("cut_front", &Region::cut_front)
1203 .addFunction ("cut_end", &Region::cut_end)
1204 .addFunction ("raise", &Region::raise)
1205 .addFunction ("lower", &Region::lower)
1206 .addFunction ("raise_to_top", &Region::raise_to_top)
1207 .addFunction ("lower_to_bottom", &Region::lower_to_bottom)
1208 .addFunction ("set_sync_position", &Region::set_sync_position)
1209 .addFunction ("clear_sync_position", &Region::clear_sync_position)
1210 .addFunction ("quarter_note", &Region::quarter_note)
1211 .addFunction ("set_hidden", &Region::set_hidden)
1212 .addFunction ("set_muted", &Region::set_muted)
1213 .addFunction ("set_opaque", &Region::set_opaque)
1214 .addFunction ("set_locked", &Region::set_locked)
1215 .addFunction ("set_video_locked", &Region::set_video_locked)
1216 .addFunction ("set_position_locked", &Region::set_position_locked)
1217 .addFunction ("source", &Region::source)
1218 .addFunction ("control", static_cast<boost::shared_ptr<Evoral::Control>(Region::*)(const Evoral::Parameter&, bool)>(&Region::control))
1221 .deriveWSPtrClass <MidiRegion, Region> ("MidiRegion")
1222 .addFunction ("do_export", &MidiRegion::do_export)
1223 .addFunction ("midi_source", &MidiRegion::midi_source)
1224 .addFunction ("model", (boost::shared_ptr<MidiModel> (MidiRegion::*)())&MidiRegion::model)
1225 .addFunction ("start_beats", &MidiRegion::start_beats)
1226 .addFunction ("length_beats", &MidiRegion::length_beats)
1229 .deriveWSPtrClass <AudioRegion, Region> ("AudioRegion")
1230 .addFunction ("audio_source", &AudioRegion::audio_source)
1231 .addFunction ("set_scale_amplitude", &AudioRegion::set_scale_amplitude)
1232 .addFunction ("scale_amplitude", &AudioRegion::scale_amplitude)
1233 .addFunction ("maximum_amplitude", &AudioRegion::maximum_amplitude)
1234 .addFunction ("rms", &AudioRegion::rms)
1235 .addRefFunction ("separate_by_channel", &AudioRegion::separate_by_channel)
1238 .deriveWSPtrClass <Source, SessionObject> ("Source")
1239 .addCast<AudioSource> ("to_audiosource")
1240 .addCast<MidiSource> ("to_midisource")
1241 .addCast<FileSource> ("to_filesource")
1242 .addFunction ("timestamp", &Source::timestamp)
1243 .addFunction ("empty", &Source::empty)
1244 .addFunction ("length", &Source::length)
1245 .addFunction ("natural_position", &Source::natural_position)
1246 .addFunction ("destructive", &Source::destructive)
1247 .addFunction ("writable", &Source::writable)
1248 .addFunction ("has_been_analysed", &Source::has_been_analysed)
1249 .addFunction ("can_be_analysed", &Source::can_be_analysed)
1250 .addFunction ("timeline_position", &Source::timeline_position)
1251 .addFunction ("use_count", &Source::use_count)
1252 .addFunction ("used", &Source::used)
1253 .addFunction ("ancestor_name", &Source::ancestor_name)
1256 .deriveWSPtrClass <FileSource, Source> ("FileSource")
1257 .addFunction ("path", &FileSource::path)
1258 .addFunction ("within_session", &FileSource::within_session)
1259 .addFunction ("channel", &FileSource::channel)
1260 .addFunction ("origin", &FileSource::origin)
1261 .addFunction ("take_id", &FileSource::take_id)
1262 .addFunction ("gain", &FileSource::gain)
1265 .deriveWSPtrClass <MidiSource, Source> ("MidiSource")
1266 .addFunction ("empty", &MidiSource::empty)
1267 .addFunction ("length", &MidiSource::length)
1268 .addFunction ("model", &MidiSource::model)
1271 .deriveWSPtrClass <AudioSource, Source> ("AudioSource")
1272 .addCast<Readable> ("to_readable")
1273 .addFunction ("readable_length", &AudioSource::readable_length)
1274 .addFunction ("n_channels", &AudioSource::n_channels)
1275 .addFunction ("empty", &Source::empty)
1276 .addFunction ("length", &Source::length)
1277 .addFunction ("read", &AudioSource::read)
1278 .addFunction ("sample_rate", &AudioSource::sample_rate)
1279 .addFunction ("captured_for", &AudioSource::captured_for)
1282 .deriveWSPtrClass <Automatable, Evoral::ControlSet> ("Automatable")
1283 .addCast<Slavable> ("to_slavable")
1284 .addFunction ("automation_control", (boost::shared_ptr<AutomationControl>(Automatable::*)(const Evoral::Parameter&, bool))&Automatable::automation_control)
1285 //.addFunction ("what_can_be_automated", &Automatable::what_can_be_automated)
1288 .deriveWSPtrClass <AutomatableSequence<Temporal::Beats>, Automatable> ("AutomatableSequence")
1289 .addCast<Evoral::Sequence<Temporal::Beats> > ("to_sequence")
1292 .deriveWSPtrClass <MidiModel, AutomatableSequence<Temporal::Beats> > ("MidiModel")
1293 .addFunction ("apply_command", (void (MidiModel::*)(Session*, Command*))&MidiModel::apply_command)
1294 .addFunction ("new_note_diff_command", &MidiModel::new_note_diff_command)
1297 .beginNamespace ("MidiModel")
1298 .deriveClass<ARDOUR::MidiModel::DiffCommand, Command> ("DiffCommand")
1301 .deriveClass<ARDOUR::MidiModel::NoteDiffCommand, ARDOUR::MidiModel::DiffCommand> ("NoteDiffCommand")
1302 .addFunction ("add", &ARDOUR::MidiModel::NoteDiffCommand::add)
1303 .addFunction ("remove", &ARDOUR::MidiModel::NoteDiffCommand::remove)
1306 .endNamespace () /* ARDOUR::MidiModel */
1308 .beginClass <Plugin::PresetRecord> ("PresetRecord")
1309 .addVoidConstructor ()
1310 .addData ("uri", &Plugin::PresetRecord::uri, false)
1311 .addData ("label", &Plugin::PresetRecord::label, false)
1312 .addData ("user", &Plugin::PresetRecord::user, false)
1313 .addData ("valid", &Plugin::PresetRecord::valid, false)
1316 .beginStdVector <Plugin::PresetRecord> ("PresetVector").endClass ()
1318 .deriveClass <ParameterDescriptor, Evoral::ParameterDescriptor> ("ParameterDescriptor")
1319 .addVoidConstructor ()
1320 .addData ("label", &ParameterDescriptor::label)
1321 .addStaticFunction ("midi_note_name", &ParameterDescriptor::midi_note_name)
1324 .beginStdVector <boost::shared_ptr<ARDOUR::Processor> > ("ProcessorVector").endClass ()
1326 .deriveWSPtrClass <Processor, SessionObject> ("Processor")
1327 .addCast<Automatable> ("to_automatable")
1328 .addCast<PluginInsert> ("to_insert") // deprecated
1329 .addCast<PluginInsert> ("to_plugininsert")
1330 .addCast<SideChain> ("to_sidechain")
1331 .addCast<IOProcessor> ("to_ioprocessor")
1332 .addCast<UnknownProcessor> ("to_unknownprocessor")
1333 .addCast<Amp> ("to_amp")
1334 .addCast<DiskIOProcessor> ("to_diskioprocessor")
1335 .addCast<DiskReader> ("to_diskreader")
1336 .addCast<DiskWriter> ("to_diskwriter")
1337 .addCast<PeakMeter> ("to_peakmeter")
1338 .addCast<MonitorProcessor> ("to_monitorprocessor")
1339 .addCast<Send> ("to_send")
1340 .addCast<PolarityProcessor> ("to_polarityprocessor")
1341 .addCast<DelayLine> ("to_delayline")
1342 #if 0 // those objects are not yet bound
1343 .addCast<CapturingProcessor> ("to_capturingprocessor")
1345 .addCast<PeakMeter> ("to_meter")
1346 .addFunction ("display_name", &Processor::display_name)
1347 .addFunction ("display_to_user", &Processor::display_to_user)
1348 .addFunction ("active", &Processor::active)
1349 .addFunction ("activate", &Processor::activate)
1350 .addFunction ("deactivate", &Processor::deactivate)
1351 .addFunction ("input_latency", &Processor::input_latency)
1352 .addFunction ("output_latency", &Processor::output_latency)
1353 .addFunction ("capture_offset", &Processor::capture_offset)
1354 .addFunction ("playback_offset", &Processor::playback_offset)
1355 .addFunction ("output_streams", &Processor::output_streams)
1356 .addFunction ("input_streams", &Processor::input_streams)
1357 .addFunction ("signal_latency", &Processor::signal_latency)
1360 .deriveWSPtrClass <DiskIOProcessor, Processor> ("DiskIOProcessor")
1363 .deriveWSPtrClass <DiskReader, DiskIOProcessor> ("DiskReader")
1366 .deriveWSPtrClass <DiskWriter, DiskIOProcessor> ("DiskWriter")
1369 .deriveWSPtrClass <IOProcessor, Processor> ("IOProcessor")
1370 .addFunction ("natural_input_streams", &IOProcessor::natural_input_streams)
1371 .addFunction ("natural_output_streams", &IOProcessor::natural_output_streams)
1372 .addFunction ("input", (boost::shared_ptr<IO>(IOProcessor::*)())&IOProcessor::input)
1373 .addFunction ("output", (boost::shared_ptr<IO>(IOProcessor::*)())&IOProcessor::output)
1376 .deriveWSPtrClass <SideChain, IOProcessor> ("SideChain")
1379 .deriveWSPtrClass <Delivery, IOProcessor> ("Delivery")
1380 .addFunction ("panner_shell", &Route::panner_shell)
1383 .deriveWSPtrClass <Send, Delivery> ("Send")
1384 .addFunction ("get_delay_in", &Send::get_delay_in)
1385 .addFunction ("get_delay_out", &Send::get_delay_out)
1388 .deriveWSPtrClass <InternalSend, Send> ("InternalSend")
1391 .deriveWSPtrClass <Return, IOProcessor> ("Return")
1394 .deriveWSPtrClass <InternalReturn, Return> ("InternalReturn")
1397 .beginNamespace ("Plugin")
1398 .beginClass <Plugin::IOPortDescription> ("IOPortDescription")
1399 .addData ("name", &Plugin::IOPortDescription::name)
1400 .addData ("is_sidechain", &Plugin::IOPortDescription::is_sidechain)
1401 .addData ("group_name", &Plugin::IOPortDescription::group_name)
1402 .addData ("group_channel", &Plugin::IOPortDescription::group_channel)
1406 .deriveWSPtrClass <Plugin, PBD::StatefulDestructible> ("Plugin")
1407 .addCast<LuaProc> ("to_luaproc")
1408 .addFunction ("unique_id", &Plugin::unique_id)
1409 .addFunction ("label", &Plugin::label)
1410 .addFunction ("name", &Plugin::name)
1411 .addFunction ("maker", &Plugin::maker)
1412 .addFunction ("parameter_count", &Plugin::parameter_count)
1413 .addFunction ("parameter_label", &Plugin::parameter_label)
1414 .addRefFunction ("nth_parameter", &Plugin::nth_parameter)
1415 .addFunction ("preset_by_label", &Plugin::preset_by_label)
1416 .addFunction ("preset_by_uri", &Plugin::preset_by_uri)
1417 .addFunction ("load_preset", &Plugin::load_preset)
1418 .addFunction ("parameter_is_input", &Plugin::parameter_is_input)
1419 .addFunction ("parameter_is_output", &Plugin::parameter_is_output)
1420 .addFunction ("parameter_is_control", &Plugin::parameter_is_control)
1421 .addFunction ("parameter_is_audio", &Plugin::parameter_is_audio)
1422 .addFunction ("get_docs", &Plugin::get_docs)
1423 .addFunction ("get_info", &Plugin::get_info)
1424 .addFunction ("get_parameter_docs", &Plugin::get_parameter_docs)
1425 .addFunction ("describe_io_port", &Plugin::describe_io_port)
1426 .addRefFunction ("get_parameter_descriptor", &Plugin::get_parameter_descriptor)
1429 .deriveWSPtrClass <LuaProc, Plugin> ("LuaProc")
1430 .addFunction ("shmem", &LuaProc::instance_shm)
1431 .addFunction ("table", &LuaProc::instance_ref)
1434 .deriveWSPtrClass <PluginInsert, Processor> ("PluginInsert")
1435 .addFunction ("plugin", &PluginInsert::plugin)
1436 .addFunction ("activate", &PluginInsert::activate)
1437 .addFunction ("deactivate", &PluginInsert::deactivate)
1438 .addFunction ("strict_io_configured", &PluginInsert::strict_io_configured)
1439 .addFunction ("input_map", (ARDOUR::ChanMapping (PluginInsert::*)(uint32_t) const)&PluginInsert::input_map)
1440 .addFunction ("output_map", (ARDOUR::ChanMapping (PluginInsert::*)(uint32_t) const)&PluginInsert::output_map)
1441 .addFunction ("set_input_map", &PluginInsert::set_input_map)
1442 .addFunction ("set_output_map", &PluginInsert::set_output_map)
1443 .addFunction ("natural_output_streams", &PluginInsert::natural_output_streams)
1444 .addFunction ("natural_input_streams", &PluginInsert::natural_input_streams)
1445 .addFunction ("reset_parameters_to_default", &PluginInsert::reset_parameters_to_default)
1448 .deriveWSPtrClass <ReadOnlyControl, PBD::StatefulDestructible> ("ReadOnlyControl")
1449 .addFunction ("get_parameter", &ReadOnlyControl::get_parameter)
1450 .addFunction ("describe_parameter", &ReadOnlyControl::describe_parameter)
1451 .addFunction ("desc", &ReadOnlyControl::desc)
1454 .deriveWSPtrClass <AutomationControl, PBD::Controllable> ("AutomationControl")
1455 .addCast<Evoral::Control> ("to_ctrl")
1456 .addCast<SlavableAutomationControl> ("to_slavable")
1457 .addFunction ("automation_state", &AutomationControl::automation_state)
1458 .addFunction ("set_automation_state", &AutomationControl::set_automation_state)
1459 .addFunction ("start_touch", &AutomationControl::start_touch)
1460 .addFunction ("stop_touch", &AutomationControl::stop_touch)
1461 .addFunction ("get_value", &AutomationControl::get_value)
1462 .addFunction ("set_value", &AutomationControl::set_value)
1463 .addFunction ("writable", &AutomationControl::writable)
1464 .addFunction ("alist", &AutomationControl::alist)
1467 .deriveWSPtrClass <SlavableAutomationControl, AutomationControl> ("SlavableAutomationControl")
1468 .addFunction ("add_master", &SlavableAutomationControl::add_master)
1469 .addFunction ("remove_master", &SlavableAutomationControl::remove_master)
1470 .addFunction ("clear_masters", &SlavableAutomationControl::clear_masters)
1471 .addFunction ("slaved_to", &SlavableAutomationControl::slaved_to)
1472 .addFunction ("slaved", &SlavableAutomationControl::slaved)
1473 .addFunction ("get_masters_value", &SlavableAutomationControl::get_masters_value)
1474 .addFunction ("get_boolean_masters", &SlavableAutomationControl::get_boolean_masters)
1475 //.addFunction ("masters", &SlavableAutomationControl::masters) // not implemented
1478 .deriveWSPtrClass <PhaseControl, AutomationControl> ("PhaseControl")
1479 .addFunction ("set_phase_invert", (void(PhaseControl::*)(uint32_t, bool))&PhaseControl::set_phase_invert)
1480 .addFunction ("inverted", &PhaseControl::inverted)
1483 .deriveWSPtrClass <GainControl, SlavableAutomationControl> ("GainControl")
1486 .deriveWSPtrClass <SoloControl, SlavableAutomationControl> ("SoloControl")
1487 .addFunction ("can_solo", &SoloControl::can_solo)
1488 .addFunction ("soloed", &SoloControl::soloed)
1489 .addFunction ("self_soloed", &SoloControl::self_soloed)
1492 .deriveWSPtrClass <MuteControl, SlavableAutomationControl> ("MuteControl")
1493 .addFunction ("muted", &MuteControl::muted)
1494 .addFunction ("muted_by_self", &MuteControl::muted_by_self)
1497 .deriveWSPtrClass <SoloIsolateControl, SlavableAutomationControl> ("SoloIsolateControl")
1498 .addFunction ("solo_isolated", &SoloIsolateControl::solo_isolated)
1499 .addFunction ("self_solo_isolated", &SoloIsolateControl::self_solo_isolated)
1502 .deriveWSPtrClass <SoloSafeControl, SlavableAutomationControl> ("SoloSafeControl")
1503 .addFunction ("solo_safe", &SoloSafeControl::solo_safe)
1506 .deriveWSPtrClass <Amp, Processor> ("Amp")
1507 .addFunction ("gain_control", (boost::shared_ptr<GainControl>(Amp::*)())&Amp::gain_control)
1510 .deriveWSPtrClass <PeakMeter, Processor> ("PeakMeter")
1511 .addFunction ("meter_level", &PeakMeter::meter_level)
1512 .addFunction ("set_type", &PeakMeter::set_type)
1513 .addFunction ("reset_max", &PeakMeter::reset_max)
1516 .deriveWSPtrClass <MonitorProcessor, Processor> ("MonitorProcessor")
1517 .addFunction ("set_cut_all", &MonitorProcessor::set_cut_all)
1518 .addFunction ("set_dim_all", &MonitorProcessor::set_dim_all)
1519 .addFunction ("set_polarity", &MonitorProcessor::set_polarity)
1520 .addFunction ("set_cut", &MonitorProcessor::set_cut)
1521 .addFunction ("set_dim", &MonitorProcessor::set_dim)
1522 .addFunction ("set_solo", &MonitorProcessor::set_solo)
1523 .addFunction ("set_mono", &MonitorProcessor::set_mono)
1524 .addFunction ("dim_level", &MonitorProcessor::dim_level)
1525 .addFunction ("solo_boost_level", &MonitorProcessor::solo_boost_level)
1526 .addFunction ("dimmed", &MonitorProcessor::dimmed)
1527 .addFunction ("soloed", &MonitorProcessor::soloed)
1528 .addFunction ("inverted", &MonitorProcessor::inverted)
1529 .addFunction ("cut", &MonitorProcessor::cut)
1530 .addFunction ("cut_all", &MonitorProcessor::cut_all)
1531 .addFunction ("dim_all", &MonitorProcessor::dim_all)
1532 .addFunction ("mono", &MonitorProcessor::mono)
1533 .addFunction ("monitor_active", &MonitorProcessor::monitor_active)
1534 .addFunction ("channel_cut_control", &MonitorProcessor::channel_cut_control)
1535 .addFunction ("channel_dim_control", &MonitorProcessor::channel_dim_control)
1536 .addFunction ("channel_polarity_control", &MonitorProcessor::channel_polarity_control)
1537 .addFunction ("channel_solo_control", &MonitorProcessor::channel_solo_control)
1538 .addFunction ("dim_control", &MonitorProcessor::dim_control)
1539 .addFunction ("cut_control", &MonitorProcessor::cut_control)
1540 .addFunction ("mono_control", &MonitorProcessor::mono_control)
1541 .addFunction ("dim_level_control", &MonitorProcessor::dim_level_control)
1542 .addFunction ("solo_boost_control", &MonitorProcessor::solo_boost_control)
1545 .deriveWSPtrClass <UnknownProcessor, Processor> ("UnknownProcessor")
1548 .deriveWSPtrClass <PolarityProcessor, Processor> ("PolarityProcessor")
1551 .deriveWSPtrClass <DelayLine, Processor> ("DelayLine")
1552 .addFunction ("delay", &DelayLine::delay)
1555 .deriveWSPtrClass <PluginInsert::PluginControl, AutomationControl> ("PluginControl")
1558 .deriveWSPtrClass <AudioSource, Source> ("AudioSource")
1559 .addFunction ("readable_length", &AudioSource::readable_length)
1560 .addFunction ("n_channels", &AudioSource::n_channels)
1563 // <std::list<boost::shared_ptr <AudioTrack> >
1564 .beginStdList <boost::shared_ptr<AudioTrack> > ("AudioTrackList")
1567 // std::list<boost::shared_ptr <MidiTrack> >
1568 .beginStdList <boost::shared_ptr<MidiTrack> > ("MidiTrackList")
1571 // RouteList == std::list<boost::shared_ptr<Route> >
1572 .beginConstStdList <boost::shared_ptr<Route> > ("RouteList")
1575 // StripableList == std::list<boost::shared_ptr<Stripable> >
1576 .beginConstStdList <boost::shared_ptr<Stripable> > ("StripableList")
1579 // VCAList == std::list<boost::shared_ptr<VCA> >
1580 .beginConstStdList <boost::shared_ptr<VCA> > ("VCAList")
1583 // VCAVector == std::vector<boost::shared_ptr<VCA> >
1584 .beginConstStdVector <boost::shared_ptr<VCA> > ("VCAVector")
1587 // boost::shared_ptr<RouteList>
1588 .beginPtrStdList <boost::shared_ptr<Route> > ("RouteListPtr")
1589 .addVoidPtrConstructor<std::list<boost::shared_ptr <Route> > > ()
1592 // typedef std::list<boost::weak_ptr <Route> > WeakRouteList
1593 .beginConstStdList <boost::weak_ptr<Route> > ("WeakRouteList")
1596 // RouteGroupList == std::list<RouteGroup*>
1597 .beginConstStdCPtrList <RouteGroup> ("RouteGroupList")
1600 // typedef std::vector<boost::shared_ptr<Source> > Region::SourceList
1601 .beginStdVector <boost::shared_ptr<Source> > ("SourceList")
1604 // std::list< boost::weak_ptr <AudioSource> >
1605 .beginConstStdList <boost::weak_ptr<AudioSource> > ("WeakAudioSourceList")
1608 // typedef std::vector<boost::shared_ptr<Region> > RegionVector
1609 .beginStdVector <boost::shared_ptr<Region> > ("RegionVector")
1612 // typedef std::list<boost::shared_ptr<Region> > RegionList
1613 .beginConstStdList <boost::shared_ptr<Region> > ("RegionList")
1616 // boost::shared_ptr <std::list<boost::shared_ptr<Region> > >
1617 .beginPtrStdList <boost::shared_ptr<Region> > ("RegionListPtr")
1618 .addVoidPtrConstructor<std::list<boost::shared_ptr <Region> > > ()
1621 // RegionFactory::RegionMap
1622 .beginStdMap <PBD::ID,boost::shared_ptr<Region> > ("RegionMap")
1625 // typedef std::list<boost::shared_ptr<Processor> > ProcessorList;
1626 .beginStdList <boost::shared_ptr<Processor> > ("ProcessorList")
1629 //std::list<boost::shared_ptr<Port> > PortList;
1630 .beginConstStdList <boost::shared_ptr<Port> > ("PortList")
1633 // used by Playlist::cut/copy
1634 .beginConstStdList <AudioRange> ("AudioRangeList")
1637 .beginConstStdList <Location*> ("LocationList")
1640 // std::list<boost::shared_ptr<AutomationControl> > ControlList;
1641 .beginStdList <boost::shared_ptr<AutomationControl> > ("ControlList")
1644 .beginPtrStdList <boost::shared_ptr<AutomationControl> > ("ControlListPtr")
1645 .addVoidPtrConstructor<std::list<boost::shared_ptr <AutomationControl> > > ()
1648 .beginStdList <boost::shared_ptr<Evoral::Note<Temporal::Beats> > > ("NotePtrList")
1651 .beginConstStdList <Evoral::ControlEvent*> ("EventList")
1654 #if 0 // depends on Evoal:: Note, Beats see note_fixer.h
1655 // typedef Evoral::Note<Temporal::Beats> Note;
1656 // std::set< boost::weak_ptr<Note> >
1657 .beginStdSet <boost::weak_ptr<Note> > ("WeakNoteSet")
1661 // std::list<boost::weak_ptr<Source> >
1662 .beginConstStdList <boost::weak_ptr<Source> > ("WeakSourceList")
1665 .beginClass <Tempo> ("Tempo")
1666 .addConstructor <void (*) (double, double, double)> ()
1667 .addFunction ("note_type", &Tempo::note_type)
1668 .addFunction ("note_types_per_minute", (double (Tempo::*)() const)&Tempo::note_types_per_minute)
1669 .addFunction ("quarter_notes_per_minute", &Tempo::quarter_notes_per_minute)
1670 .addFunction ("samples_per_quarter_note", &Tempo::samples_per_quarter_note)
1671 .addFunction ("samples_per_note_type", &Tempo::samples_per_note_type)
1674 .beginClass <Meter> ("Meter")
1675 .addConstructor <void (*) (double, double)> ()
1676 .addFunction ("divisions_per_bar", &Meter::divisions_per_bar)
1677 .addFunction ("note_divisor", &Meter::note_divisor)
1678 .addFunction ("samples_per_bar", &Meter::samples_per_bar)
1679 .addFunction ("samples_per_grid", &Meter::samples_per_grid)
1682 .beginClass <BeatsSamplesConverter> ("BeatsSamplesConverter")
1683 .addConstructor <void (*) (const TempoMap&, samplepos_t)> ()
1684 .addFunction ("to", &BeatsSamplesConverter::to)
1685 .addFunction ("from", &BeatsSamplesConverter::from)
1688 .beginClass <DoubleBeatsSamplesConverter> ("DoubleBeatsSamplesConverter")
1689 .addConstructor <void (*) (const TempoMap&, samplepos_t)> ()
1690 .addFunction ("to", &DoubleBeatsSamplesConverter::to)
1691 .addFunction ("from", &DoubleBeatsSamplesConverter::from)
1694 .beginClass <TempoMap> ("TempoMap")
1695 .addFunction ("add_tempo", &TempoMap::add_tempo)
1696 .addFunction ("add_meter", &TempoMap::add_meter)
1697 .addFunction ("tempo_section_at_frame", (TempoSection& (TempoMap::*)(samplepos_t))&TempoMap::tempo_section_at_sample)
1698 .addFunction ("tempo_section_at_frame", (const TempoSection& (TempoMap::*)(samplepos_t) const)&TempoMap::tempo_section_at_sample)
1699 .addFunction ("meter_section_at_frame", &TempoMap::meter_section_at_sample)
1700 .addFunction ("meter_section_at_beat", &TempoMap::meter_section_at_beat)
1701 .addFunction ("bbt_at_frame", &TempoMap::bbt_at_sample)
1702 .addFunction ("exact_beat_at_frame", &TempoMap::exact_beat_at_sample)
1703 .addFunction ("exact_qn_at_frame", &TempoMap::exact_qn_at_sample)
1704 .addFunction ("samplepos_plus_qn", &TempoMap::samplepos_plus_qn)
1705 .addFunction ("framewalk_to_qn", &TempoMap::framewalk_to_qn)
1708 .beginClass <MetricSection> ("MetricSection")
1709 .addFunction ("pulse", &MetricSection::pulse)
1710 .addFunction ("set_pulse", &MetricSection::set_pulse)
1713 .deriveClass <TempoSection, MetricSection> ("TempoSection")
1714 .addFunction ("c", (double(TempoSection::*)()const)&TempoSection::c)
1717 .deriveClass <MeterSection, MetricSection> ("MeterSection")
1718 .addCast<Meter> ("to_meter")
1719 .addFunction ("set_pulse", &MeterSection::set_pulse)
1720 .addFunction ("set_beat", (void(MeterSection::*)(double))&MeterSection::set_beat)
1723 .beginClass <ChanCount> ("ChanCount")
1724 .addConstructor <void (*) (DataType, uint32_t)> ()
1725 .addFunction ("get", &ChanCount::get)
1726 .addFunction ("set", &ChanCount::set)
1727 .addFunction ("n_audio", &ChanCount::n_audio)
1728 .addFunction ("n_midi", &ChanCount::n_midi)
1729 .addFunction ("n_total", &ChanCount::n_total)
1730 .addFunction ("reset", &ChanCount::reset)
1733 .beginClass <DataType> ("DataType")
1734 .addConstructor <void (*) (std::string)> ()
1735 .addStaticCFunction ("null", &LuaAPI::datatype_ctor_null) // "nil" is a lua reseved word
1736 .addStaticCFunction ("audio", &LuaAPI::datatype_ctor_audio)
1737 .addStaticCFunction ("midi", &LuaAPI::datatype_ctor_midi)
1738 .addFunction ("to_string", &DataType::to_string) // TODO Lua __tostring
1739 // TODO add uint32_t cast, add operator== !=
1742 /* libardour enums */
1743 .beginNamespace ("PluginType")
1744 .addConst ("AudioUnit", ARDOUR::PluginType(AudioUnit))
1745 .addConst ("LADSPA", ARDOUR::PluginType(LADSPA))
1746 .addConst ("LV2", ARDOUR::PluginType(LV2))
1747 .addConst ("Windows_VST", ARDOUR::PluginType(Windows_VST))
1748 .addConst ("LXVST", ARDOUR::PluginType(LXVST))
1749 .addConst ("Lua", ARDOUR::PluginType(Lua))
1752 .beginNamespace ("PresentationInfo")
1753 .beginNamespace ("Flag")
1754 .addConst ("AudioTrack", ARDOUR::PresentationInfo::Flag(PresentationInfo::AudioTrack))
1755 .addConst ("MidiTrack", ARDOUR::PresentationInfo::Flag(PresentationInfo::MidiTrack))
1756 .addConst ("AudioBus", ARDOUR::PresentationInfo::Flag(PresentationInfo::AudioBus))
1757 .addConst ("MidiBus", ARDOUR::PresentationInfo::Flag(PresentationInfo::MidiBus))
1758 .addConst ("VCA", ARDOUR::PresentationInfo::Flag(PresentationInfo::VCA))
1759 .addConst ("MasterOut", ARDOUR::PresentationInfo::Flag(PresentationInfo::MasterOut))
1760 .addConst ("MonitorOut", ARDOUR::PresentationInfo::Flag(PresentationInfo::MonitorOut))
1761 .addConst ("Auditioner", ARDOUR::PresentationInfo::Flag(PresentationInfo::Auditioner))
1762 .addConst ("Hidden", ARDOUR::PresentationInfo::Flag(PresentationInfo::Hidden))
1763 .addConst ("GroupOrderSet", ARDOUR::PresentationInfo::Flag(PresentationInfo::OrderSet))
1764 .addConst ("StatusMask", ARDOUR::PresentationInfo::Flag(PresentationInfo::StatusMask))
1768 .beginNamespace ("AutoState")
1769 .addConst ("Off", ARDOUR::AutoState(Off))
1770 .addConst ("Write", ARDOUR::AutoState(Write))
1771 .addConst ("Touch", ARDOUR::AutoState(Touch))
1772 .addConst ("Play", ARDOUR::AutoState(Play))
1773 .addConst ("Latch", ARDOUR::AutoState(Latch))
1776 .beginNamespace ("AutomationType")
1777 .addConst ("GainAutomation", ARDOUR::AutomationType(GainAutomation))
1778 .addConst ("PluginAutomation", ARDOUR::AutomationType(PluginAutomation))
1779 .addConst ("SoloAutomation", ARDOUR::AutomationType(SoloAutomation))
1780 .addConst ("SoloIsolateAutomation", ARDOUR::AutomationType(SoloIsolateAutomation))
1781 .addConst ("SoloSafeAutomation", ARDOUR::AutomationType(SoloSafeAutomation))
1782 .addConst ("MuteAutomation", ARDOUR::AutomationType(MuteAutomation))
1783 .addConst ("RecEnableAutomation", ARDOUR::AutomationType(RecEnableAutomation))
1784 .addConst ("RecSafeAutomation", ARDOUR::AutomationType(RecSafeAutomation))
1785 .addConst ("TrimAutomation", ARDOUR::AutomationType(TrimAutomation))
1786 .addConst ("PhaseAutomation", ARDOUR::AutomationType(PhaseAutomation))
1787 .addConst ("MidiCCAutomation", ARDOUR::AutomationType(MidiCCAutomation))
1788 .addConst ("MidiPgmChangeAutomation", ARDOUR::AutomationType(MidiPgmChangeAutomation))
1789 .addConst ("MidiPitchBenderAutomation", ARDOUR::AutomationType(MidiPitchBenderAutomation))
1790 .addConst ("MidiChannelPressureAutomation", ARDOUR::AutomationType(MidiChannelPressureAutomation))
1791 .addConst ("MidiNotePressureAutomation", ARDOUR::AutomationType(MidiNotePressureAutomation))
1792 .addConst ("MidiSystemExclusiveAutomation", ARDOUR::AutomationType(MidiSystemExclusiveAutomation))
1795 .beginNamespace ("SrcQuality")
1796 .addConst ("SrcBest", ARDOUR::SrcQuality(SrcBest))
1799 .beginNamespace ("MeterType")
1800 .addConst ("MeterMaxSignal", ARDOUR::MeterType(MeterMaxSignal))
1801 .addConst ("MeterMaxPeak", ARDOUR::MeterType(MeterMaxPeak))
1802 .addConst ("MeterPeak", ARDOUR::MeterType(MeterPeak))
1803 .addConst ("MeterKrms", ARDOUR::MeterType(MeterKrms))
1804 .addConst ("MeterK20", ARDOUR::MeterType(MeterK20))
1805 .addConst ("MeterK14", ARDOUR::MeterType(MeterK14))
1806 .addConst ("MeterIEC1DIN", ARDOUR::MeterType(MeterIEC1DIN))
1807 .addConst ("MeterIEC1NOR", ARDOUR::MeterType(MeterIEC1NOR))
1808 .addConst ("MeterIEC2BBC", ARDOUR::MeterType(MeterIEC2BBC))
1809 .addConst ("MeterIEC2EBU", ARDOUR::MeterType(MeterIEC2EBU))
1810 .addConst ("MeterVU", ARDOUR::MeterType(MeterVU))
1811 .addConst ("MeterK12", ARDOUR::MeterType(MeterK12))
1812 .addConst ("MeterPeak0dB", ARDOUR::MeterType(MeterPeak0dB))
1813 .addConst ("MeterMCP", ARDOUR::MeterType(MeterMCP))
1816 .beginNamespace ("MeterPoint")
1817 .addConst ("MeterInput", ARDOUR::MeterPoint(MeterInput))
1818 .addConst ("MeterPreFader", ARDOUR::MeterPoint(MeterPreFader))
1819 .addConst ("MeterPostFader", ARDOUR::MeterPoint(MeterPostFader))
1820 .addConst ("MeterOutput", ARDOUR::MeterPoint(MeterOutput))
1821 .addConst ("MeterCustom", ARDOUR::MeterPoint(MeterCustom))
1824 .beginNamespace ("Placement")
1825 .addConst ("PreFader", ARDOUR::Placement(PreFader))
1826 .addConst ("PostFader", ARDOUR::Placement(PostFader))
1829 .beginNamespace ("MonitorChoice")
1830 .addConst ("MonitorAuto", ARDOUR::MonitorChoice(MonitorAuto))
1831 .addConst ("MonitorInput", ARDOUR::MonitorChoice(MonitorInput))
1832 .addConst ("MonitorDisk", ARDOUR::MonitorChoice(MonitorDisk))
1833 .addConst ("MonitorCue", ARDOUR::MonitorChoice(MonitorCue))
1836 .beginNamespace ("NoteMode")
1837 .addConst ("Sustained", ARDOUR::NoteMode(Sustained))
1838 .addConst ("Percussive", ARDOUR::NoteMode(Percussive))
1841 .beginNamespace ("PortFlags")
1842 .addConst ("IsInput", ARDOUR::PortFlags(IsInput))
1843 .addConst ("IsOutput", ARDOUR::PortFlags(IsOutput))
1844 .addConst ("IsPhysical", ARDOUR::PortFlags(IsPhysical))
1845 .addConst ("CanMonitor", ARDOUR::PortFlags(CanMonitor))
1846 .addConst ("IsTerminal", ARDOUR::PortFlags(IsTerminal))
1849 .beginNamespace ("MidiPortFlags")
1850 .addConst ("MidiPortMusic", ARDOUR::MidiPortFlags(MidiPortMusic))
1851 .addConst ("MidiPortControl", ARDOUR::MidiPortFlags(MidiPortControl))
1852 .addConst ("MidiPortSelection", ARDOUR::MidiPortFlags(MidiPortSelection))
1853 .addConst ("MidiPortVirtual", ARDOUR::MidiPortFlags(MidiPortVirtual))
1856 .beginNamespace ("PlaylistDisposition")
1857 .addConst ("CopyPlaylist", ARDOUR::PlaylistDisposition(CopyPlaylist))
1858 .addConst ("NewPlaylist", ARDOUR::PlaylistDisposition(NewPlaylist))
1859 .addConst ("SharePlaylist", ARDOUR::PlaylistDisposition(SharePlaylist))
1862 .beginNamespace ("MidiTrackNameSource")
1863 .addConst ("SMFTrackNumber", ARDOUR::MidiTrackNameSource(SMFTrackNumber))
1864 .addConst ("SMFTrackName", ARDOUR::MidiTrackNameSource(SMFTrackName))
1865 .addConst ("SMFInstrumentName", ARDOUR::MidiTrackNameSource(SMFInstrumentName))
1868 .beginNamespace ("MidiTempoMapDisposition")
1869 .addConst ("SMFTempoIgnore", ARDOUR::MidiTempoMapDisposition(SMFTempoIgnore))
1870 .addConst ("SMFTempoUse", ARDOUR::MidiTempoMapDisposition(SMFTempoUse))
1873 .beginNamespace ("RegionPoint")
1874 .addConst ("Start", ARDOUR::RegionPoint(Start))
1875 .addConst ("End", ARDOUR::RegionPoint(End))
1876 .addConst ("SyncPoint", ARDOUR::RegionPoint(SyncPoint))
1879 .beginNamespace ("TempoSection")
1880 .beginNamespace ("PositionLockStyle")
1881 .addConst ("AudioTime", ARDOUR::PositionLockStyle(AudioTime))
1882 .addConst ("MusicTime", ARDOUR::PositionLockStyle(MusicTime))
1886 .beginNamespace ("TempoSection")
1887 .beginNamespace ("Type")
1888 .addConst ("Ramp", ARDOUR::TempoSection::Type(TempoSection::Ramp))
1889 .addConst ("Constant", ARDOUR::TempoSection::Type(TempoSection::Constant))
1893 .beginNamespace ("TrackMode")
1894 .addConst ("Normal", ARDOUR::TrackMode(Start))
1895 .addConst ("NonLayered", ARDOUR::TrackMode(NonLayered))
1896 .addConst ("Destructive", ARDOUR::TrackMode(Destructive))
1899 .beginNamespace ("SampleFormat")
1900 .addConst ("Float", ARDOUR::SampleFormat(FormatFloat))
1901 .addConst ("Int24", ARDOUR::SampleFormat(FormatInt24))
1902 .addConst ("Int16", ARDOUR::SampleFormat(FormatInt16))
1905 .beginNamespace ("HeaderFormat")
1906 .addConst ("BWF", ARDOUR::HeaderFormat(BWF))
1907 .addConst ("WAVE", ARDOUR::HeaderFormat(WAVE))
1908 .addConst ("WAVE64", ARDOUR::HeaderFormat(WAVE64))
1909 .addConst ("CAF", ARDOUR::HeaderFormat(CAF))
1910 .addConst ("AIFF", ARDOUR::HeaderFormat(AIFF))
1911 .addConst ("iXML", ARDOUR::HeaderFormat(iXML))
1912 .addConst ("RF64", ARDOUR::HeaderFormat(RF64))
1913 .addConst ("RF64_WAV", ARDOUR::HeaderFormat(RF64_WAV))
1914 .addConst ("MBWF", ARDOUR::HeaderFormat(MBWF))
1917 .beginNamespace ("InsertMergePolicy")
1918 .addConst ("Reject", ARDOUR::InsertMergePolicy(InsertMergeReject))
1919 .addConst ("Relax", ARDOUR::InsertMergePolicy(InsertMergeRelax))
1920 .addConst ("Replace", ARDOUR::InsertMergePolicy(InsertMergeReplace))
1921 .addConst ("TruncateExisting", ARDOUR::InsertMergePolicy(InsertMergeTruncateExisting))
1922 .addConst ("TruncateAddition", ARDOUR::InsertMergePolicy(InsertMergeTruncateAddition))
1923 .addConst ("Extend", ARDOUR::InsertMergePolicy(InsertMergeExtend))
1926 .beginNamespace ("AFLPosition")
1927 .addConst ("AFLFromBeforeProcessors", ARDOUR::AFLPosition(AFLFromBeforeProcessors))
1928 .addConst ("AFLFromAfterProcessors", ARDOUR::AFLPosition(AFLFromAfterProcessors))
1931 .beginNamespace ("PFLPosition")
1932 .addConst ("PFLFromBeforeProcessors", ARDOUR::PFLPosition(PFLFromBeforeProcessors))
1933 .addConst ("PFLFromAfterProcessors", ARDOUR::PFLPosition(PFLFromAfterProcessors))
1936 .beginNamespace ("AutoReturnTarget")
1937 .addConst ("LastLocate", ARDOUR::AutoReturnTarget(LastLocate))
1938 .addConst ("RangeSelectionStart", ARDOUR::AutoReturnTarget(RangeSelectionStart))
1939 .addConst ("Loop", ARDOUR::AutoReturnTarget(Loop))
1940 .addConst ("RegionSelectionStart", ARDOUR::AutoReturnTarget(RegionSelectionStart))
1943 .beginNamespace ("FadeShape")
1944 .addConst ("FadeLinear", ARDOUR::FadeShape(FadeLinear))
1945 .addConst ("FadeFast", ARDOUR::FadeShape(FadeFast))
1946 .addConst ("FadeSlow", ARDOUR::FadeShape(FadeSlow))
1947 .addConst ("FadeConstantPower", ARDOUR::FadeShape(FadeConstantPower))
1948 .addConst ("FadeSymmetric", ARDOUR::FadeShape(FadeSymmetric))
1951 .beginNamespace ("DenormalModel")
1952 .addConst ("DenormalNone", ARDOUR::DenormalModel(DenormalNone))
1953 .addConst ("DenormalFTZ", ARDOUR::DenormalModel(DenormalFTZ))
1954 .addConst ("DenormalDAZ", ARDOUR::DenormalModel(DenormalDAZ))
1955 .addConst ("DenormalFTZDAZ", ARDOUR::DenormalModel(DenormalFTZDAZ))
1958 .beginNamespace ("BufferingPreset")
1959 .addConst ("Small", ARDOUR::BufferingPreset(Small))
1960 .addConst ("Medium", ARDOUR::BufferingPreset(Medium))
1961 .addConst ("Large", ARDOUR::BufferingPreset(Large))
1962 .addConst ("Custom", ARDOUR::BufferingPreset(Custom))
1965 .beginNamespace ("EditMode")
1966 .addConst ("Slide", ARDOUR::EditMode(Slide))
1967 .addConst ("Splice", ARDOUR::EditMode(Splice))
1968 .addConst ("Ripple", ARDOUR::EditMode(Ripple))
1969 .addConst ("Lock", ARDOUR::EditMode(Lock))
1972 .beginNamespace ("AutoConnectOption")
1973 .addConst ("ManualConnect", ARDOUR::AutoConnectOption(ManualConnect))
1974 .addConst ("AutoConnectPhysical", ARDOUR::AutoConnectOption(AutoConnectPhysical))
1975 .addConst ("AutoConnectMaster", ARDOUR::AutoConnectOption(AutoConnectMaster))
1978 .beginNamespace ("LayerModel")
1979 .addConst ("LaterHigher", ARDOUR::LayerModel(LaterHigher))
1980 .addConst ("Manual", ARDOUR::LayerModel(Manual))
1983 .beginNamespace ("ListenPosition")
1984 .addConst ("AfterFaderListen", ARDOUR::ListenPosition(AfterFaderListen))
1985 .addConst ("PreFaderListen", ARDOUR::ListenPosition(PreFaderListen))
1988 .beginNamespace ("MonitorModel")
1989 .addConst ("HardwareMonitoring", ARDOUR::MonitorModel(HardwareMonitoring))
1990 .addConst ("SoftwareMonitoring", ARDOUR::MonitorModel(SoftwareMonitoring))
1991 .addConst ("ExternalMonitoring", ARDOUR::MonitorModel(ExternalMonitoring))
1994 .beginNamespace ("RegionSelectionAfterSplit")
1995 .addConst ("None", ARDOUR::RegionSelectionAfterSplit(None))
1996 .addConst ("NewlyCreatedLeft", ARDOUR::RegionSelectionAfterSplit(NewlyCreatedLeft))
1997 .addConst ("NewlyCreatedRight", ARDOUR::RegionSelectionAfterSplit(NewlyCreatedRight))
1998 .addConst ("NewlyCreatedBoth", ARDOUR::RegionSelectionAfterSplit(NewlyCreatedBoth))
1999 .addConst ("Existing", ARDOUR::RegionSelectionAfterSplit(Existing))
2000 .addConst ("ExistingNewlyCreatedLeft", ARDOUR::RegionSelectionAfterSplit(ExistingNewlyCreatedLeft))
2001 .addConst ("ExistingNewlyCreatedRight", ARDOUR::RegionSelectionAfterSplit(ExistingNewlyCreatedRight))
2002 .addConst ("ExistingNewlyCreatedBoth", ARDOUR::RegionSelectionAfterSplit(ExistingNewlyCreatedBoth))
2005 .beginNamespace ("ShuttleBehaviour")
2006 .addConst ("Sprung", ARDOUR::ShuttleBehaviour(Sprung))
2007 .addConst ("Wheel", ARDOUR::ShuttleBehaviour(Wheel))
2010 .beginNamespace ("ShuttleUnits")
2011 .addConst ("Percentage", ARDOUR::ShuttleUnits(Percentage))
2012 .addConst ("Semitones", ARDOUR::ShuttleUnits(Semitones))
2015 .beginNamespace ("SyncSource")
2016 .addConst ("Engine", ARDOUR::SyncSource(Engine))
2017 .addConst ("MTC", ARDOUR::SyncSource(MTC))
2018 .addConst ("MIDIClock", ARDOUR::SyncSource(MIDIClock))
2019 .addConst ("LTC", ARDOUR::SyncSource(LTC))
2022 .beginNamespace ("TracksAutoNamingRule")
2023 .addConst ("UseDefaultNames", ARDOUR::TracksAutoNamingRule(UseDefaultNames))
2024 .addConst ("NameAfterDriver", ARDOUR::TracksAutoNamingRule(NameAfterDriver))
2027 .endNamespace (); // end ARDOUR
2029 luabridge::getGlobalNamespace (L)
2030 .beginNamespace ("ARDOUR")
2031 .beginClass <AudioBackendInfo> ("AudioBackendInfo")
2032 .addData ("name", &AudioBackendInfo::name)
2034 .beginConstStdVector <const AudioBackendInfo*> ("BackendVector").endClass ()
2036 .beginClass <AudioBackend::DeviceStatus> ("DeviceStatus")
2037 .addData ("name", &AudioBackend::DeviceStatus::name)
2038 .addData ("available", &AudioBackend::DeviceStatus::available)
2040 .beginStdVector <AudioBackend::DeviceStatus> ("DeviceStatusVector").endClass ()
2042 .beginWSPtrClass <AudioBackend> ("AudioBackend")
2043 .addFunction ("info", &AudioBackend::info)
2044 .addFunction ("sample_rate", &AudioBackend::sample_rate)
2045 .addFunction ("buffer_size", &AudioBackend::buffer_size)
2046 .addFunction ("period_size", &AudioBackend::period_size)
2047 .addFunction ("input_channels", &AudioBackend::input_channels)
2048 .addFunction ("output_channels", &AudioBackend::output_channels)
2049 .addFunction ("dsp_load", &AudioBackend::dsp_load)
2051 .addFunction ("set_sample_rate", &AudioBackend::set_sample_rate)
2052 .addFunction ("set_buffer_size", &AudioBackend::set_buffer_size)
2053 .addFunction ("set_peridod_size", &AudioBackend::set_peridod_size)
2055 .addFunction ("enumerate_drivers", &AudioBackend::enumerate_drivers)
2056 .addFunction ("driver_name", &AudioBackend::driver_name)
2057 .addFunction ("set_driver", &AudioBackend::set_driver)
2059 .addFunction ("use_separate_input_and_output_devices", &AudioBackend::use_separate_input_and_output_devices)
2060 .addFunction ("enumerate_devices", &AudioBackend::enumerate_devices)
2061 .addFunction ("enumerate_input_devices", &AudioBackend::enumerate_input_devices)
2062 .addFunction ("enumerate_output_devices", &AudioBackend::enumerate_output_devices)
2063 .addFunction ("device_name", &AudioBackend::device_name)
2064 .addFunction ("input_device_name", &AudioBackend::input_device_name)
2065 .addFunction ("output_device_name", &AudioBackend::output_device_name)
2066 .addFunction ("set_device_name", &AudioBackend::set_device_name)
2067 .addFunction ("set_input_device_name", &AudioBackend::set_input_device_name)
2068 .addFunction ("set_output_device_name", &AudioBackend::set_output_device_name)
2071 .beginClass <LatencyRange> ("LatencyRange")
2072 .addVoidConstructor ()
2073 .addData ("min", &LatencyRange::min)
2074 .addData ("max", &LatencyRange::max)
2077 .beginClass <PortManager> ("PortManager")
2078 .addFunction ("port_engine", &PortManager::port_engine)
2079 .addFunction ("connected", &PortManager::connected)
2080 .addFunction ("connect", &PortManager::connect)
2081 .addFunction ("physically_connected", &PortManager::physically_connected)
2082 .addFunction ("disconnect", (int (PortManager::*)(const std::string&, const std::string&))&PortManager::disconnect)
2083 .addFunction ("disconnect_port", (int (PortManager::*)(boost::shared_ptr<Port>))&PortManager::disconnect)
2084 .addFunction ("get_port_by_name", &PortManager::get_port_by_name)
2085 .addFunction ("get_pretty_name_by_name", &PortManager::get_pretty_name_by_name)
2086 .addFunction ("port_is_physical", &PortManager::port_is_physical)
2087 .addFunction ("get_physical_outputs", &PortManager::get_physical_outputs)
2088 .addFunction ("get_physical_inputs", &PortManager::get_physical_inputs)
2089 .addFunction ("n_physical_outputs", &PortManager::n_physical_outputs)
2090 .addFunction ("n_physical_inputs", &PortManager::n_physical_inputs)
2091 .addRefFunction ("get_connections", &PortManager::get_connections)
2092 .addRefFunction ("get_ports", (int (PortManager::*)(DataType, PortManager::PortList&))&PortManager::get_ports)
2093 .addRefFunction ("get_backend_ports", (int (PortManager::*)(const std::string&, DataType, PortFlags, std::vector<std::string>&))&PortManager::get_ports)
2096 .deriveClass <AudioEngine, PortManager> ("AudioEngine")
2097 .addFunction ("available_backends", &AudioEngine::available_backends)
2098 .addFunction ("current_backend_name", &AudioEngine::current_backend_name)
2099 .addFunction ("set_backend", &AudioEngine::set_backend)
2100 .addFunction ("setup_required", &AudioEngine::setup_required)
2101 .addFunction ("start", &AudioEngine::start)
2102 .addFunction ("stop", &AudioEngine::stop)
2103 .addFunction ("get_dsp_load", &AudioEngine::get_dsp_load)
2104 .addFunction ("set_device_name", &AudioEngine::set_device_name)
2105 .addFunction ("set_sample_rate", &AudioEngine::set_sample_rate)
2106 .addFunction ("set_buffer_size", &AudioEngine::set_buffer_size)
2107 .addFunction ("get_last_backend_error", &AudioEngine::get_last_backend_error)
2110 .deriveClass <VCAManager, PBD::StatefulDestructible> ("VCAManager")
2111 .addFunction ("create_vca", &VCAManager::create_vca)
2112 .addFunction ("remove_vca", &VCAManager::remove_vca)
2113 .addFunction ("vca_by_number", &VCAManager::vca_by_number)
2114 .addFunction ("vca_by_name", &VCAManager::vca_by_name)
2115 .addFunction ("vcas", &VCAManager::vcas)
2116 .addFunction ("n_vcas", &VCAManager::n_vcas)
2119 .deriveClass <RCConfiguration, PBD::Configuration> ("RCConfiguration")
2120 #undef CONFIG_VARIABLE
2121 #undef CONFIG_VARIABLE_SPECIAL
2122 #define CONFIG_VARIABLE(Type,var,name,value) \
2123 .addFunction ("get_" # var, &RCConfiguration::get_##var) \
2124 .addFunction ("set_" # var, &RCConfiguration::set_##var) \
2125 .addProperty (#var, &RCConfiguration::get_##var, &RCConfiguration::set_##var)
2127 #define CONFIG_VARIABLE_SPECIAL(Type,var,name,value,mutator) \
2128 .addFunction ("get_" # var, &RCConfiguration::get_##var) \
2129 .addFunction ("set_" # var, &RCConfiguration::set_##var) \
2130 .addProperty (#var, &RCConfiguration::get_##var, &RCConfiguration::set_##var)
2132 #include "ardour/rc_configuration_vars.h"
2134 #undef CONFIG_VARIABLE
2135 #undef CONFIG_VARIABLE_SPECIAL
2138 .deriveClass <SessionConfiguration, PBD::Configuration> ("SessionConfiguration")
2139 #undef CONFIG_VARIABLE
2140 #undef CONFIG_VARIABLE_SPECIAL
2141 #define CONFIG_VARIABLE(Type,var,name,value) \
2142 .addFunction ("get_" # var, &SessionConfiguration::get_##var) \
2143 .addFunction ("set_" # var, &SessionConfiguration::set_##var) \
2144 .addProperty (#var, &SessionConfiguration::get_##var, &SessionConfiguration::set_##var)
2146 #define CONFIG_VARIABLE_SPECIAL(Type,var,name,value,mutator) \
2147 .addFunction ("get_" # var, &SessionConfiguration::get_##var) \
2148 .addFunction ("set_" # var, &SessionConfiguration::set_##var) \
2149 .addProperty (#var, &SessionConfiguration::get_##var, &SessionConfiguration::set_##var)
2151 #include "ardour/session_configuration_vars.h"
2153 #undef CONFIG_VARIABLE
2154 #undef CONFIG_VARIABLE_SPECIAL
2157 // we could use addProperty ()
2158 .addFunction ("config", &_libardour_config)
2162 // basic representation of Session
2163 // functions which can be used from realtime and non-realtime contexts
2164 luabridge::getGlobalNamespace (L)
2165 .beginNamespace ("ARDOUR")
2166 .beginClass <Session> ("Session")
2167 .addFunction ("scripts_changed", &Session::scripts_changed) // used internally
2168 .addFunction ("transport_rolling", &Session::transport_rolling)
2169 .addFunction ("request_transport_speed", &Session::request_transport_speed)
2170 .addFunction ("transport_sample", &Session::transport_sample)
2171 .addFunction ("transport_speed", &Session::transport_speed)
2172 .addFunction ("sample_rate", &Session::sample_rate)
2173 .addFunction ("nominal_sample_rate", &Session::nominal_sample_rate)
2174 .addFunction ("samples_per_timecode_frame", &Session::samples_per_timecode_frame)
2175 .addFunction ("timecode_frames_per_hour", &Session::timecode_frames_per_hour)
2176 .addFunction ("timecode_frames_per_second", &Session::timecode_frames_per_second)
2177 .addFunction ("timecode_drop_frames", &Session::timecode_drop_frames)
2178 .addFunction ("request_locate", &Session::request_locate)
2179 .addFunction ("request_stop", &Session::request_stop)
2180 .addFunction ("request_play_loop", &Session::request_play_loop)
2181 .addFunction ("get_play_loop", &Session::get_play_loop)
2182 .addFunction ("last_transport_start", &Session::last_transport_start)
2183 .addFunction ("goto_start", &Session::goto_start)
2184 .addFunction ("goto_end", &Session::goto_end)
2185 .addFunction ("current_start_frame", &Session::current_start_sample)
2186 .addFunction ("current_end_frame", &Session::current_end_sample)
2187 .addFunction ("actively_recording", &Session::actively_recording)
2188 .addFunction ("new_audio_track", &Session::new_audio_track)
2189 .addFunction ("new_audio_route", &Session::new_audio_route)
2190 .addFunction ("new_midi_track", &Session::new_midi_track)
2191 .addFunction ("new_midi_route", &Session::new_midi_route)
2193 .addFunction ("add_master_bus", &Session::add_master_bus)
2194 .addFunction ("add_monitor_section", &Session::add_monitor_section)
2195 .addFunction ("remove_monitor_section", &Session::remove_monitor_section)
2197 .addFunction ("get_routes", &Session::get_routes)
2198 .addFunction ("get_tracks", &Session::get_tracks)
2199 .addFunction ("get_stripables", (StripableList (Session::*)() const)&Session::get_stripables)
2200 .addFunction ("name", &Session::name)
2201 .addFunction ("path", &Session::path)
2202 .addFunction ("record_status", &Session::record_status)
2203 .addFunction ("maybe_enable_record", &Session::maybe_enable_record)
2204 .addFunction ("disable_record", &Session::disable_record)
2205 .addFunction ("route_by_id", &Session::route_by_id)
2206 .addFunction ("route_by_name", &Session::route_by_name)
2207 .addFunction ("stripable_by_id", &Session::stripable_by_id)
2208 .addFunction ("get_remote_nth_stripable", &Session::get_remote_nth_stripable)
2209 .addFunction ("get_remote_nth_route", &Session::get_remote_nth_route)
2210 .addFunction ("route_by_selected_count", &Session::route_by_selected_count)
2211 .addFunction ("source_by_id", &Session::source_by_id)
2212 .addFunction ("controllable_by_id", &Session::controllable_by_id)
2213 .addFunction ("processor_by_id", &Session::processor_by_id)
2214 .addFunction ("snap_name", &Session::snap_name)
2215 .addFunction ("monitor_out", &Session::monitor_out)
2216 .addFunction ("master_out", &Session::master_out)
2217 .addFunction ("add_internal_sends", &Session::add_internal_sends)
2218 .addFunction ("tempo_map", (TempoMap& (Session::*)())&Session::tempo_map)
2219 .addFunction ("locations", &Session::locations)
2220 .addFunction ("soloing", &Session::soloing)
2221 .addFunction ("listening", &Session::listening)
2222 .addFunction ("solo_isolated", &Session::solo_isolated)
2223 .addFunction ("cancel_all_solo", &Session::cancel_all_solo)
2224 .addFunction ("clear_all_solo_state", &Session::clear_all_solo_state)
2225 .addFunction ("set_controls", &Session::set_controls)
2226 .addFunction ("set_control", &Session::set_control)
2227 .addFunction ("set_exclusive_input_active", &Session::set_exclusive_input_active)
2228 .addFunction ("begin_reversible_command", (void (Session::*)(const std::string&))&Session::begin_reversible_command)
2229 .addFunction ("commit_reversible_command", &Session::commit_reversible_command)
2230 .addFunction ("abort_reversible_command", &Session::abort_reversible_command)
2231 .addFunction ("add_command", &Session::add_command)
2232 .addFunction ("add_stateful_diff_command", &Session::add_stateful_diff_command)
2233 .addFunction ("engine", (AudioEngine& (Session::*)())&Session::engine)
2234 .addFunction ("get_block_size", &Session::get_block_size)
2235 .addFunction ("worst_output_latency", &Session::worst_output_latency)
2236 .addFunction ("worst_input_latency", &Session::worst_input_latency)
2237 .addFunction ("worst_route_latency", &Session::worst_route_latency)
2238 .addFunction ("worst_latency_preroll", &Session::worst_latency_preroll)
2239 .addFunction ("cfg", &Session::cfg)
2240 .addFunction ("route_groups", &Session::route_groups)
2241 .addFunction ("new_route_group", &Session::new_route_group)
2242 .addFunction ("end_is_free", &Session::end_is_free)
2243 .addFunction ("set_end_is_free", &Session::set_end_is_free)
2244 .addFunction ("remove_route_group", (void (Session::*)(RouteGroup*))&Session::remove_route_group)
2245 .addFunction ("vca_manager", &Session::vca_manager_ptr)
2246 .addExtCFunction ("timecode_to_sample_lua", ARDOUR::LuaAPI::timecode_to_sample_lua)
2247 .addExtCFunction ("sample_to_timecode_lua", ARDOUR::LuaAPI::sample_to_timecode_lua)
2250 .beginClass <RegionFactory> ("RegionFactory")
2251 .addStaticFunction ("region_by_id", &RegionFactory::region_by_id)
2252 .addStaticFunction ("regions", &RegionFactory::regions)
2253 .addStaticFunction ("clone_region", static_cast<boost::shared_ptr<Region> (*)(boost::shared_ptr<Region>, bool, bool)>(&RegionFactory::create))
2256 /* session enums (rt-safe, common) */
2257 .beginNamespace ("Session")
2259 .beginNamespace ("RecordState")
2260 .addConst ("Disabled", ARDOUR::Session::RecordState(Session::Disabled))
2261 .addConst ("Enabled", ARDOUR::Session::RecordState(Session::Enabled))
2262 .addConst ("Recording", ARDOUR::Session::RecordState(Session::Recording))
2265 .endNamespace () // end Session enums
2267 /* ardour enums (rt-safe, common) */
2268 .beginNamespace ("LocationFlags")
2269 .addConst ("IsMark", ARDOUR::Location::Flags(Location::IsMark))
2270 .addConst ("IsAutoPunch", ARDOUR::Location::Flags(Location::IsAutoPunch))
2271 .addConst ("IsAutoLoop", ARDOUR::Location::Flags(Location::IsAutoLoop))
2272 .addConst ("IsHidden", ARDOUR::Location::Flags(Location::IsHidden))
2273 .addConst ("IsCDMarker", ARDOUR::Location::Flags(Location::IsCDMarker))
2274 .addConst ("IsRangeMarker", ARDOUR::Location::Flags(Location::IsRangeMarker))
2275 .addConst ("IsSessionRange", ARDOUR::Location::Flags(Location::IsSessionRange))
2276 .addConst ("IsSkip", ARDOUR::Location::Flags(Location::IsSkip))
2277 .addConst ("IsSkipping", ARDOUR::Location::Flags(Location::IsSkipping))
2280 .beginNamespace ("LuaAPI")
2281 .addFunction ("nil_proc", ARDOUR::LuaAPI::nil_processor)
2282 .addFunction ("new_luaproc", ARDOUR::LuaAPI::new_luaproc)
2283 .addFunction ("new_plugin_info", ARDOUR::LuaAPI::new_plugin_info)
2284 .addFunction ("new_plugin", ARDOUR::LuaAPI::new_plugin)
2285 .addFunction ("set_processor_param", ARDOUR::LuaAPI::set_processor_param)
2286 .addFunction ("set_plugin_insert_param", ARDOUR::LuaAPI::set_plugin_insert_param)
2287 .addFunction ("reset_processor_to_default", ARDOUR::LuaAPI::reset_processor_to_default)
2288 .addRefFunction ("get_processor_param", ARDOUR::LuaAPI::get_processor_param)
2289 .addRefFunction ("get_plugin_insert_param", ARDOUR::LuaAPI::get_plugin_insert_param)
2290 .addCFunction ("plugin_automation", ARDOUR::LuaAPI::plugin_automation)
2291 .addCFunction ("hsla_to_rgba", ARDOUR::LuaAPI::hsla_to_rgba)
2292 .addCFunction ("color_to_rgba", ARDOUR::LuaAPI::color_to_rgba)
2293 .addFunction ("usleep", Glib::usleep)
2294 .addFunction ("monotonic_time", ::g_get_monotonic_time)
2295 .addCFunction ("build_filename", ARDOUR::LuaAPI::build_filename)
2296 .addFunction ("new_noteptr", ARDOUR::LuaAPI::new_noteptr)
2297 .addFunction ("note_list", ARDOUR::LuaAPI::note_list)
2298 .addCFunction ("sample_to_timecode", ARDOUR::LuaAPI::sample_to_timecode)
2299 .addCFunction ("timecode_to_sample", ARDOUR::LuaAPI::timecode_to_sample)
2301 .beginClass <ARDOUR::LuaAPI::Vamp> ("Vamp")
2302 .addConstructor <void (*) (const std::string&, float)> ()
2303 .addStaticFunction ("list_plugins", &ARDOUR::LuaAPI::Vamp::list_plugins)
2304 .addFunction ("plugin", &ARDOUR::LuaAPI::Vamp::plugin)
2305 .addFunction ("analyze", &ARDOUR::LuaAPI::Vamp::analyze)
2306 .addFunction ("reset", &ARDOUR::LuaAPI::Vamp::reset)
2307 .addFunction ("initialize", &ARDOUR::LuaAPI::Vamp::initialize)
2308 .addFunction ("process", &ARDOUR::LuaAPI::Vamp::process)
2311 .endNamespace () // end LuaAPI
2312 .endNamespace ();// end ARDOUR
2315 luabridge::getGlobalNamespace (L)
2316 .beginNamespace ("ARDOUR")
2317 .beginNamespace ("DSP")
2318 .addFunction ("compute_peak", ARDOUR::compute_peak)
2319 .addFunction ("find_peaks", ARDOUR::find_peaks)
2320 .addFunction ("apply_gain_to_buffer", ARDOUR::apply_gain_to_buffer)
2321 .addFunction ("mix_buffers_no_gain", ARDOUR::mix_buffers_no_gain)
2322 .addFunction ("mix_buffers_with_gain", ARDOUR::mix_buffers_with_gain)
2323 .addFunction ("copy_vector", ARDOUR::copy_vector)
2324 .addFunction ("dB_to_coefficient", &dB_to_coefficient)
2325 .addFunction ("fast_coefficient_to_dB", &fast_coefficient_to_dB)
2326 .addFunction ("accurate_coefficient_to_dB", &accurate_coefficient_to_dB)
2327 .addFunction ("memset", &DSP::memset)
2328 .addFunction ("mmult", &DSP::mmult)
2329 .addFunction ("log_meter", &DSP::log_meter)
2330 .addFunction ("log_meter_coeff", &DSP::log_meter_coeff)
2331 .addFunction ("process_map", &DSP::process_map)
2332 .addRefFunction ("peaks", &DSP::peaks)
2334 .beginClass <DSP::LowPass> ("LowPass")
2335 .addConstructor <void (*) (double, float)> ()
2336 .addFunction ("proc", &DSP::LowPass::proc)
2337 .addFunction ("ctrl", &DSP::LowPass::ctrl)
2338 .addFunction ("set_cutoff", &DSP::LowPass::set_cutoff)
2339 .addFunction ("reset", &DSP::LowPass::reset)
2341 .beginClass <DSP::Biquad> ("Biquad")
2342 .addConstructor <void (*) (double)> ()
2343 .addFunction ("run", &DSP::Biquad::run)
2344 .addFunction ("compute", &DSP::Biquad::compute)
2345 .addFunction ("configure", &DSP::Biquad::configure)
2346 .addFunction ("reset", &DSP::Biquad::reset)
2347 .addFunction ("dB_at_freq", &DSP::Biquad::dB_at_freq)
2349 .beginClass <DSP::FFTSpectrum> ("FFTSpectrum")
2350 .addConstructor <void (*) (uint32_t, double)> ()
2351 .addFunction ("set_data_hann", &DSP::FFTSpectrum::set_data_hann)
2352 .addFunction ("execute", &DSP::FFTSpectrum::execute)
2353 .addFunction ("power_at_bin", &DSP::FFTSpectrum::power_at_bin)
2354 .addFunction ("freq_at_bin", &DSP::FFTSpectrum::freq_at_bin)
2358 .beginNamespace ("BiquadType")
2359 .addConst ("LowPass", ARDOUR::DSP::Biquad::LowPass)
2360 .addConst ("HighPass", ARDOUR::DSP::Biquad::HighPass)
2361 .addConst ("BandPassSkirt", ARDOUR::DSP::Biquad::BandPassSkirt)
2362 .addConst ("BandPass0dB", ARDOUR::DSP::Biquad::BandPass0dB)
2363 .addConst ("Notch", ARDOUR::DSP::Biquad::Notch)
2364 .addConst ("AllPass", ARDOUR::DSP::Biquad::AllPass)
2365 .addConst ("Peaking", ARDOUR::DSP::Biquad::Peaking)
2366 .addConst ("LowShelf", ARDOUR::DSP::Biquad::LowShelf)
2367 .addConst ("HighShelf", ARDOUR::DSP::Biquad::HighShelf)
2370 .beginClass <DSP::DspShm> ("DspShm")
2371 .addConstructor<void (*) (size_t)> ()
2372 .addFunction ("allocate", &DSP::DspShm::allocate)
2373 .addFunction ("clear", &DSP::DspShm::clear)
2374 .addFunction ("to_float", &DSP::DspShm::to_float)
2375 .addFunction ("to_int", &DSP::DspShm::to_int)
2376 .addFunction ("atomic_set_int", &DSP::DspShm::atomic_set_int)
2377 .addFunction ("atomic_get_int", &DSP::DspShm::atomic_get_int)
2380 .endNamespace () // DSP
2381 .endNamespace ();// end ARDOUR
2385 LuaBindings::dsp (lua_State* L)
2387 luabridge::getGlobalNamespace (L)
2388 .beginNamespace ("ARDOUR")
2390 .beginClass <AudioBuffer> ("AudioBuffer")
2392 .addFunction ("data", (Sample*(AudioBuffer::*)(samplecnt_t))&AudioBuffer::data)
2393 .addFunction ("silence", &AudioBuffer::silence)
2394 .addFunction ("apply_gain", &AudioBuffer::apply_gain)
2395 .addFunction ("check_silence", &AudioBuffer::check_silence)
2396 .addFunction ("read_from", (void (AudioBuffer::*)(const Sample*, samplecnt_t, samplecnt_t, samplecnt_t))&AudioBuffer::check_silence)
2399 .beginClass <MidiBuffer> ("MidiBuffer")
2401 .addFunction ("silence", &MidiBuffer::silence)
2402 .addFunction ("size", &MidiBuffer::size)
2403 .addFunction ("empty", &MidiBuffer::empty)
2404 .addFunction ("resize", &MidiBuffer::resize)
2405 .addFunction ("copy", (void (MidiBuffer::*)(MidiBuffer const * const))&MidiBuffer::copy)
2406 .addFunction ("push_event", (bool (MidiBuffer::*)(const Evoral::Event<samplepos_t>&))&MidiBuffer::push_back)
2407 .addFunction ("push_back", (bool (MidiBuffer::*)(samplepos_t, size_t, const uint8_t*))&MidiBuffer::push_back)
2409 .addExtCFunction ("table", &luabridge::CFunc::listToTable<const Evoral::Event<samplepos_t>, MidiBuffer>)
2412 .beginClass <BufferSet> ("BufferSet")
2414 .addFunction ("get_audio", static_cast<AudioBuffer&(BufferSet::*)(size_t)>(&BufferSet::get_audio))
2415 .addFunction ("get_midi", static_cast<MidiBuffer&(BufferSet::*)(size_t)>(&BufferSet::get_midi))
2416 .addFunction ("count", static_cast<const ChanCount&(BufferSet::*)()const>(&BufferSet::count))
2420 luabridge::getGlobalNamespace (L)
2421 .beginNamespace ("Evoral")
2422 .deriveClass <Evoral::Event<samplepos_t>, Evoral::Event<samplepos_t> > ("Event")
2424 .addFunction ("type", &Evoral::Event<samplepos_t>::type)
2425 .addFunction ("channel", &Evoral::Event<samplepos_t>::channel)
2426 .addFunction ("set_type", &Evoral::Event<samplepos_t>::set_type)
2427 .addFunction ("set_channel", &Evoral::Event<samplepos_t>::set_channel)
2431 // dsp releated session functions
2432 luabridge::getGlobalNamespace (L)
2433 .beginNamespace ("ARDOUR")
2434 .beginClass <Session> ("Session")
2435 .addFunction ("get_scratch_buffers", &Session::get_scratch_buffers)
2436 .addFunction ("get_silent_buffers", &Session::get_silent_buffers)
2440 luabridge::getGlobalNamespace (L)
2441 .beginNamespace ("ARDOUR")
2442 .beginClass <FluidSynth> ("FluidSynth")
2443 .addConstructor <void (*) (float, int)> ()
2444 .addFunction ("load_sf2", &FluidSynth::load_sf2)
2445 .addFunction ("synth", &FluidSynth::synth)
2446 .addFunction ("midi_event", &FluidSynth::midi_event)
2447 .addFunction ("panic", &FluidSynth::panic)
2448 .addFunction ("select_program", &FluidSynth::select_program)
2449 .addFunction ("program_count", &FluidSynth::program_count)
2450 .addFunction ("program_name", &FluidSynth::program_name)
2454 luabridge::getGlobalNamespace (L)
2455 .beginNamespace ("ARDOUR")
2457 .beginClass <LuaTableRef> ("LuaTableRef")
2458 .addCFunction ("get", &LuaTableRef::get)
2459 .addCFunction ("set", &LuaTableRef::set)
2462 .endNamespace (); // ARDOUR
2466 LuaBindings::session (lua_State* L)
2468 // non-realtime session functions
2469 luabridge::getGlobalNamespace (L)
2470 .beginNamespace ("ARDOUR")
2471 .beginClass <Session> ("Session")
2472 .addFunction ("save_state", &Session::save_state)
2473 .addFunction ("set_dirty", &Session::set_dirty)
2474 .addFunction ("unknown_processors", &Session::unknown_processors)
2475 .addFunction ("export_track_state", &Session::export_track_state)
2477 .addFunction<RouteList (Session::*)(uint32_t, PresentationInfo::order_t, const std::string&, const std::string&, PlaylistDisposition)> ("new_route_from_template", &Session::new_route_from_template)
2478 // TODO session_add_audio_track session_add_midi_track session_add_mixed_track
2479 //.addFunction ("new_midi_track", &Session::new_midi_track)
2482 .endNamespace (); // ARDOUR
2486 LuaBindings::osc (lua_State* L)
2488 luabridge::getGlobalNamespace (L)
2489 .beginNamespace ("ARDOUR")
2490 .beginNamespace ("LuaOSC")
2491 .beginClass<LuaOSC::Address> ("Address")
2492 .addConstructor<void (*) (std::string)> ()
2493 .addCFunction ("send", &LuaOSC::Address::send)
2500 LuaBindings::set_session (lua_State* L, Session *s)
2502 /* LuaBridge uses unique keys to identify classes/c-types.
2504 * Those keys are "generated" by using the memory-address of a static
2505 * variable, templated for every Class.
2506 * (see libs/lua/LuaBridge/detail/ClassInfo.h)
2508 * When linking the final executable there must be exactly one static
2509 * function (static variable) for every templated class.
2510 * This works fine on OSX and Linux...
2512 * Windows (mingw and MSVC) however expand the template differently for libardour
2513 * AND gtk2_ardour. We end up with two identical static functions
2514 * at different addresses!!
2516 * The Solution: have gtk2_ardour never include LuaBridge headers directly
2517 * and always go via libardour function calls for classes that are registered
2518 * in libardour. (calling lua itself is fine, calling c-functions in the GUI
2519 * which expand the template is not)
2521 * (the actual cause: even static symbols in a .dll have no fixed address
2522 * and are mapped when loading the dll. static functions in .exe do have a fixed
2526 * 0000000000000000 I __imp__ZZN9luabridge9ClassInfoIN6ARDOUR7SessionEE11getClassKeyEvE5value
2527 * 0000000000000000 I __nm__ZZN9luabridge9ClassInfoIN6ARDOUR7SessionEE11getClassKeyEvE5value
2528 * 0000000000000000 T _ZN9luabridge9ClassInfoIN6ARDOUR7SessionEE11getClassKeyEv
2531 * 000000000104f560 d .data$_ZZN9luabridge9ClassInfoIN6ARDOUR7SessionEE11getClassKeyEvE5value
2532 * 000000000104f560 D _ZZN9luabridge9ClassInfoIN6ARDOUR7SessionEE11getClassKeyEvE5value
2533 * 0000000000e9baf0 T _ZN9luabridge9ClassInfoIN6ARDOUR7SessionEE11getClassKeyEv
2537 luabridge::push <Session *> (L, s);
2538 lua_setglobal (L, "Session");
2541 // call lua function.
2542 luabridge::LuaRef cb_ses = luabridge::getGlobal (L, "new_session");
2543 if (cb_ses.type() == LUA_TFUNCTION) { cb_ses(s->name()); } // TODO args