2 Copyright (C) 2016 Robin Gareus <robin@gareus.org>
4 This program is free software; you can redistribute it and/or modify it
5 under the terms of the GNU General Public License as published by the Free
6 Software Foundation; either version 2 of the License, or (at your option)
9 This program is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 You should have received a copy of the GNU General Public License along
15 with this program; if not, write to the Free Software Foundation, Inc.,
16 675 Mass Ave, Cambridge, MA 02139, USA.
21 #include "timecode/bbt_time.h"
22 #include "pbd/stateful_diff_command.h"
23 #include "pbd/openuri.h"
24 #include "evoral/Control.hpp"
25 #include "evoral/ControlList.hpp"
26 #include "evoral/Range.hpp"
28 #include "ardour/amp.h"
29 #include "ardour/audioengine.h"
30 #include "ardour/audioregion.h"
31 #include "ardour/audiosource.h"
32 #include "ardour/audio_backend.h"
33 #include "ardour/audio_buffer.h"
34 #include "ardour/audio_port.h"
35 #include "ardour/audio_track.h"
36 #include "ardour/audioplaylist.h"
37 #include "ardour/buffer_set.h"
38 #include "ardour/beats_samples_converter.h"
39 #include "ardour/chan_mapping.h"
40 #include "ardour/dB.h"
41 #include "ardour/dsp_filter.h"
42 #include "ardour/file_source.h"
43 #include "ardour/fluid_synth.h"
44 #include "ardour/interthread_info.h"
45 #include "ardour/lua_api.h"
46 #include "ardour/luabindings.h"
47 #include "ardour/luaproc.h"
48 #include "ardour/meter.h"
49 #include "ardour/midi_model.h"
50 #include "ardour/midi_track.h"
51 #include "ardour/midi_playlist.h"
52 #include "ardour/midi_port.h"
53 #include "ardour/midi_region.h"
54 #include "ardour/midi_source.h"
55 #include "ardour/panner_shell.h"
56 #include "ardour/phase_control.h"
57 #include "ardour/playlist.h"
58 #include "ardour/plugin.h"
59 #include "ardour/plugin_insert.h"
60 #include "ardour/port_manager.h"
61 #include "ardour/progress.h"
62 #include "ardour/runtime_functions.h"
63 #include "ardour/region.h"
64 #include "ardour/region_factory.h"
65 #include "ardour/route_group.h"
66 #include "ardour/session.h"
67 #include "ardour/session_object.h"
68 #include "ardour/sidechain.h"
69 #include "ardour/solo_isolate_control.h"
70 #include "ardour/solo_safe_control.h"
71 #include "ardour/stripable.h"
72 #include "ardour/track.h"
73 #include "ardour/tempo.h"
74 #include "ardour/vca.h"
75 #include "ardour/vca_manager.h"
77 #include "LuaBridge/LuaBridge.h"
79 #ifdef PLATFORM_WINDOWS
80 /* luabridge uses addresses of static functions/variables to identify classes.
82 * Static symbols on windows (even identical symbols) are not
83 * mapped to the same address when mixing .dll + .exe.
84 * So we need a single point to define those static functions.
85 * (normally they're header-only in libs/lua/LuaBridge/detail/ClassInfo.h)
87 * Really!! A static function with a static variable in a library header
88 * should never ever be replicated, even if it is a template.
89 * But then again this is windows... what else can go wrong ?!
94 luabridge::ClassInfo<T>::getStaticKey ()
102 luabridge::ClassInfo<T>::getClassKey ()
110 luabridge::ClassInfo<T>::getConstKey ()
117 luabridge::getIdentityKey ()
123 /* ...and this is the ugly part of it.
125 * We need to foward declare classes from gtk2_ardour
126 * AND explicily list classes which are used by gtk2_ardour's bindings.
128 * This is required because some of the GUI classes use objects from libardour
129 * as function parameters or return values and the .exe would re-create
130 * symbols for libardour objects.
133 #define CLASSKEYS(CLS) \
134 template void const* luabridge::ClassInfo< CLS >::getStaticKey(); \
135 template void const* luabridge::ClassInfo< CLS >::getClassKey(); \
136 template void const* luabridge::ClassInfo< CLS >::getConstKey();
138 #define CLASSINFO(CLS) \
140 template void const* luabridge::ClassInfo< CLS >::getStaticKey(); \
141 template void const* luabridge::ClassInfo< CLS >::getClassKey(); \
142 template void const* luabridge::ClassInfo< CLS >::getConstKey();
144 CLASSINFO(ArdourMarker);
146 CLASSINFO(MarkerSelection);
147 CLASSINFO(PublicEditor);
148 CLASSINFO(RegionSelection);
149 CLASSINFO(RegionView);
150 CLASSINFO(StripableTimeAxisView);
151 CLASSINFO(RouteTimeAxisView);
153 CLASSINFO(Selectable);
154 CLASSINFO(Selection);
155 CLASSINFO(TimeAxisView);
156 CLASSINFO(TimeAxisViewItem);
157 CLASSINFO(TimeSelection);
158 CLASSINFO(TrackSelection);
159 CLASSINFO(TrackViewList);
162 CLASSKEYS(std::bitset<48ul>); // LuaSignal::LAST_SIGNAL
166 CLASSKEYS(unsigned char);
168 CLASSKEYS(ArdourMarker*);
169 CLASSKEYS(Selectable*);
170 CLASSKEYS(std::list<Selectable*>);
172 CLASSKEYS(ARDOUR::AudioEngine);
173 CLASSKEYS(ARDOUR::BeatsSamplesConverter);
174 CLASSKEYS(ARDOUR::DoubleBeatsSamplesConverter);
175 CLASSKEYS(ARDOUR::BufferSet);
176 CLASSKEYS(ARDOUR::ChanCount);
177 CLASSKEYS(ARDOUR::ChanMapping);
178 CLASSKEYS(ARDOUR::DSP::DspShm);
179 CLASSKEYS(ARDOUR::DataType);
180 CLASSKEYS(ARDOUR::FluidSynth);
181 CLASSKEYS(ARDOUR::Location);
182 CLASSKEYS(ARDOUR::LuaAPI::Vamp);
183 CLASSKEYS(ARDOUR::LuaOSC::Address);
184 CLASSKEYS(ARDOUR::LuaProc);
185 CLASSKEYS(ARDOUR::LuaTableRef);
186 CLASSKEYS(ARDOUR::MidiModel::NoteDiffCommand);
187 CLASSKEYS(ARDOUR::MonitorProcessor);
188 CLASSKEYS(ARDOUR::RouteGroup);
189 CLASSKEYS(ARDOUR::ParameterDescriptor);
190 CLASSKEYS(ARDOUR::PeakMeter);
191 CLASSKEYS(ARDOUR::PluginInfo);
192 CLASSKEYS(ARDOUR::Plugin::PresetRecord);
193 CLASSKEYS(ARDOUR::PortEngine);
194 CLASSKEYS(ARDOUR::PortManager);
195 CLASSKEYS(ARDOUR::PresentationInfo);
196 CLASSKEYS(ARDOUR::RCConfiguration);
197 CLASSKEYS(ARDOUR::Session);
198 CLASSKEYS(ARDOUR::SessionConfiguration);
199 CLASSKEYS(ARDOUR::Slavable);
200 CLASSKEYS(ARDOUR::Source);
201 CLASSKEYS(ARDOUR::VCA);
202 CLASSKEYS(ARDOUR::VCAManager);
205 CLASSKEYS(PBD::Configuration);
206 CLASSKEYS(PBD::PropertyChange);
207 CLASSKEYS(PBD::StatefulDestructible);
209 CLASSKEYS(Evoral::Beats);
210 CLASSKEYS(Evoral::Event<samplepos_t>);
211 CLASSKEYS(Evoral::ControlEvent);
214 CLASSKEYS(std::vector<std::string>);
215 CLASSKEYS(std::vector<float>);
216 CLASSKEYS(std::vector<float*>);
217 CLASSKEYS(std::vector<double>);
218 CLASSKEYS(std::list<int64_t>);
220 CLASSKEYS(std::list<Evoral::ControlEvent*>);
222 CLASSKEYS(std::vector<ARDOUR::Plugin::PresetRecord>);
223 CLASSKEYS(std::vector<boost::shared_ptr<ARDOUR::Processor> >);
224 CLASSKEYS(std::vector<boost::shared_ptr<ARDOUR::Source> >);
226 CLASSKEYS(std::list<ArdourMarker*>);
227 CLASSKEYS(std::list<TimeAxisView*>);
228 CLASSKEYS(std::list<ARDOUR::AudioRange>);
229 CLASSKEYS(std::list<boost::shared_ptr<ARDOUR::Port> >);
230 CLASSKEYS(std::list<boost::shared_ptr<ARDOUR::Region> >);
231 CLASSKEYS(std::list<boost::shared_ptr<ARDOUR::Route> >);
232 CLASSKEYS(std::list<boost::shared_ptr<ARDOUR::Stripable> >);
233 CLASSKEYS(boost::shared_ptr<std::list<boost::shared_ptr<ARDOUR::Route> > >);
235 CLASSKEYS(boost::shared_ptr<ARDOUR::AudioRegion>);
236 CLASSKEYS(boost::shared_ptr<ARDOUR::AudioSource>);
237 CLASSKEYS(boost::shared_ptr<ARDOUR::Automatable>);
238 CLASSKEYS(boost::shared_ptr<ARDOUR::AutomatableSequence<Evoral::Beats> >);
239 CLASSKEYS(boost::shared_ptr<ARDOUR::AutomationList>);
240 CLASSKEYS(boost::shared_ptr<ARDOUR::FileSource>);
241 CLASSKEYS(boost::shared_ptr<ARDOUR::MidiModel>);
242 CLASSKEYS(boost::shared_ptr<ARDOUR::MidiPlaylist>);
243 CLASSKEYS(boost::shared_ptr<ARDOUR::MidiRegion>);
244 CLASSKEYS(boost::shared_ptr<ARDOUR::MidiSource>);
245 CLASSKEYS(boost::shared_ptr<ARDOUR::PluginInfo>);
246 CLASSKEYS(boost::shared_ptr<ARDOUR::Processor>);
247 CLASSKEYS(boost::shared_ptr<ARDOUR::Readable>);
248 CLASSKEYS(boost::shared_ptr<ARDOUR::Region>);
249 CLASSKEYS(boost::shared_ptr<Evoral::ControlList>);
250 CLASSKEYS(boost::shared_ptr<Evoral::Note<Evoral::Beats> >);
251 CLASSKEYS(boost::shared_ptr<Evoral::Sequence<Evoral::Beats> >);
253 CLASSKEYS(boost::shared_ptr<ARDOUR::Playlist>);
254 CLASSKEYS(boost::shared_ptr<ARDOUR::Route>);
255 CLASSKEYS(boost::shared_ptr<ARDOUR::VCA>);
256 CLASSKEYS(boost::weak_ptr<ARDOUR::Route>);
257 CLASSKEYS(boost::weak_ptr<ARDOUR::VCA>);
259 CLASSKEYS(Vamp::RealTime);
260 CLASSKEYS(Vamp::PluginBase);
261 CLASSKEYS(Vamp::PluginBase::ParameterDescriptor);
262 CLASSKEYS(Vamp::Plugin);
263 CLASSKEYS(Vamp::Plugin::OutputDescriptor);
264 CLASSKEYS(Vamp::Plugin::Feature);
265 CLASSKEYS(Vamp::Plugin::OutputList);
266 CLASSKEYS(Vamp::Plugin::FeatureList);
267 CLASSKEYS(Vamp::Plugin::FeatureSet);
274 namespace LuaDialog {
283 CLASSKEYS(Cairo::Context);
284 CLASSKEYS(LuaCairo::ImageSurface);
285 CLASSKEYS(LuaCairo::PangoLayout);
287 CLASSKEYS(LuaDialog::Message);
288 CLASSKEYS(LuaDialog::Dialog);
290 #endif // end windows special case
292 /* Some notes on Lua bindings for libardour and friends
294 * - Prefer factory methods over Contructors whenever possible.
295 * Don't expose the constructor method unless required.
297 * e.g. Don't allow the script to construct a "Track" Object directly
298 * but do allow to create a "BBT_TIME" object.
300 * - Do not dereference Shared or Weak Pointers. Pass the pointer to Lua.
301 * - Define Objects as boost:shared_ptr Object whenever possible.
303 * Storing a boost::shared_ptr in a Lua-variable keeps the reference
304 * until that variable is set to 'nil'.
305 * (if the script were to keep a direct pointer to the object instance, the
306 * behaviour is undefined if the actual object goes away)
308 * Methods of the actual class are indirectly exposed,
309 * boost::*_ptr get() and ::lock() is implicit when the class is exported
310 * as LuaBridge's "WSPtrClass".
313 using namespace ARDOUR;
315 /** Access libardour global configuration */
316 static RCConfiguration* _libardour_config () {
317 return ARDOUR::Config;
321 LuaBindings::stddef (lua_State* L)
323 // std::list<std::string>
324 luabridge::getGlobalNamespace (L)
325 .beginNamespace ("C")
326 .beginStdList <std::string> ("StringList")
329 // std::vector<std::string>
330 .beginStdVector <std::string> ("StringVector")
333 // std::vector<float>
334 .beginStdVector <float> ("FloatVector")
337 // register float array (uint8_t*)
338 .registerArray <uint8_t> ("ByteArray")
340 // register float array (float*)
341 .registerArray <float> ("FloatArray")
343 // register float array (int32_t*)
344 .registerArray <int32_t> ("IntArray")
346 // std::vector<float*>
347 .beginStdVector <float*> ("FloatArrayVector")
350 // samplepos_t, sampleoffset_t lists e.g. AnalysisFeatureList
351 .beginStdList <int64_t> ("Int64List")
359 LuaBindings::common (lua_State* L)
361 luabridge::getGlobalNamespace (L)
362 .beginNamespace ("PBD")
364 .addFunction ("open_uri", (bool (*) (const std::string&))&PBD::open_uri)
365 .addFunction ("open_uri", &PBD::open_folder)
367 .beginClass <PBD::ID> ("ID")
368 .addConstructor <void (*) (std::string)> ()
369 .addFunction ("to_s", &PBD::ID::to_s) // TODO special case LUA __tostring ?
372 .beginStdVector <PBD::ID> ("IdVector").endClass ()
374 .beginClass <XMLNode> ("XMLNode")
375 .addFunction ("name", &XMLNode::name)
378 .beginClass <PBD::Stateful> ("Stateful")
379 .addFunction ("id", &PBD::Stateful::id)
380 .addFunction ("properties", &PBD::Stateful::properties)
381 .addFunction ("clear_changes", &PBD::Stateful::clear_changes)
384 .beginWSPtrClass <PBD::Stateful> ("StatefulPtr")
385 .addFunction ("id", &PBD::Stateful::id)
386 .addFunction ("properties", &PBD::Stateful::properties)
387 .addFunction ("clear_changes", &PBD::Stateful::clear_changes)
390 .deriveClass <PBD::StatefulDestructible, PBD::Stateful> ("StatefulDestructible")
393 .deriveClass <PBD::Configuration, PBD::Stateful> ("Configuration")
396 .deriveWSPtrClass <PBD::StatefulDestructible, PBD::Stateful> ("StatefulDestructiblePtr")
399 .deriveClass <Command, PBD::StatefulDestructible> ("Command")
400 .addFunction ("set_name", &Command::set_name)
401 .addFunction ("name", &Command::name)
404 /* UndoTransaction::add_command() subscribes to DropReferences()
405 * and deletes the object.
407 * This object cannot be constructed by lua because lua would manage lifetime
408 * and delete the object leading to a double free.
410 * use Session::add_stateful_diff_command()
411 * and Session::abort_reversible_command()
413 .deriveClass <PBD::StatefulDiffCommand, Command> ("StatefulDiffCommand")
414 .addFunction ("undo", &PBD::StatefulDiffCommand::undo)
415 .addFunction ("empty", &PBD::StatefulDiffCommand::empty)
418 .deriveWSPtrClass <PBD::Controllable, PBD::StatefulDestructible> ("Controllable")
419 .addFunction ("name", &PBD::Controllable::name)
420 .addFunction ("get_value", &PBD::Controllable::get_value)
423 .beginClass <PBD::RingBufferNPT <uint8_t> > ("RingBuffer8")
424 .addConstructor <void (*) (size_t)> ()
425 .addFunction ("reset", &PBD::RingBufferNPT<uint8_t>::reset)
426 .addFunction ("read", &PBD::RingBufferNPT<uint8_t>::read)
427 .addFunction ("write", &PBD::RingBufferNPT<uint8_t>::write)
428 .addFunction ("write_one", &PBD::RingBufferNPT<uint8_t>::write_one)
429 .addFunction ("write_space", &PBD::RingBufferNPT<uint8_t>::write_space)
430 .addFunction ("read_space", &PBD::RingBufferNPT<uint8_t>::read_space)
431 .addFunction ("increment_read_ptr", &PBD::RingBufferNPT<uint8_t>::increment_read_ptr)
432 .addFunction ("increment_write_ptr", &PBD::RingBufferNPT<uint8_t>::increment_write_ptr)
435 .beginClass <PBD::RingBufferNPT <float> > ("RingBufferF")
436 .addConstructor <void (*) (size_t)> ()
437 .addFunction ("reset", &PBD::RingBufferNPT<float>::reset)
438 .addFunction ("read", &PBD::RingBufferNPT<float>::read)
439 .addFunction ("write", &PBD::RingBufferNPT<float>::write)
440 .addFunction ("write_one", &PBD::RingBufferNPT<float>::write_one)
441 .addFunction ("write_space", &PBD::RingBufferNPT<float>::write_space)
442 .addFunction ("read_space", &PBD::RingBufferNPT<float>::read_space)
443 .addFunction ("increment_read_ptr", &PBD::RingBufferNPT<float>::increment_read_ptr)
444 .addFunction ("increment_write_ptr", &PBD::RingBufferNPT<float>::increment_write_ptr)
447 .beginClass <PBD::RingBufferNPT <int> > ("RingBufferI")
448 .addConstructor <void (*) (size_t)> ()
449 .addFunction ("reset", &PBD::RingBufferNPT<int>::reset)
450 .addFunction ("read", &PBD::RingBufferNPT<int>::read)
451 .addFunction ("write", &PBD::RingBufferNPT<int>::write)
452 .addFunction ("write_one", &PBD::RingBufferNPT<int>::write_one)
453 .addFunction ("write_space", &PBD::RingBufferNPT<int>::write_space)
454 .addFunction ("read_space", &PBD::RingBufferNPT<int>::read_space)
455 .addFunction ("increment_read_ptr", &PBD::RingBufferNPT<int>::increment_read_ptr)
456 .addFunction ("increment_write_ptr", &PBD::RingBufferNPT<int>::increment_write_ptr)
460 .beginNamespace ("GroupControlDisposition")
461 .addConst ("InverseGroup", PBD::Controllable::GroupControlDisposition(PBD::Controllable::InverseGroup))
462 .addConst ("NoGroup", PBD::Controllable::GroupControlDisposition(PBD::Controllable::NoGroup))
463 .addConst ("UseGroup", PBD::Controllable::GroupControlDisposition(PBD::Controllable::UseGroup))
466 .endNamespace (); // PBD
468 luabridge::getGlobalNamespace (L)
469 .beginNamespace ("Timecode")
470 .beginClass <Timecode::BBT_Time> ("BBT_TIME")
471 .addConstructor <void (*) (uint32_t, uint32_t, uint32_t)> ()
472 .addData ("bars", &Timecode::BBT_Time::bars)
473 .addData ("beats", &Timecode::BBT_Time::beats)
474 .addData ("ticks", &Timecode::BBT_Time::ticks)
475 //.addStaticData ("ticks_per_beat", &Timecode::BBT_Time::ticks_per_beat, false)
478 .beginClass <Timecode::Time> ("Time")
479 .addConstructor <void (*) (double)> ()
480 .addData ("negative", &Timecode::Time::negative)
481 .addData ("hours", &Timecode::Time::hours)
482 .addData ("minutes", &Timecode::Time::minutes)
483 .addData ("seconds", &Timecode::Time::seconds)
484 .addData ("frames", &Timecode::Time::frames)
485 .addData ("subframes", &Timecode::Time::subframes)
486 .addData ("rate", &Timecode::Time::rate)
487 .addData ("drop", &Timecode::Time::drop)
490 // TODO add increment, decrement; push it into the class
492 /* libtimecode enums */
493 .beginNamespace ("TimecodeFormat")
494 .addConst ("TC23976", Timecode::TimecodeFormat(Timecode::timecode_23976))
495 .addConst ("TC24", Timecode::TimecodeFormat(Timecode::timecode_24))
496 .addConst ("TC24976", Timecode::TimecodeFormat(Timecode::timecode_24976))
497 .addConst ("TC25", Timecode::TimecodeFormat(Timecode::timecode_25))
498 .addConst ("TC2997", Timecode::TimecodeFormat(Timecode::timecode_2997))
499 .addConst ("TC2997DF", Timecode::TimecodeFormat(Timecode::timecode_2997drop))
500 .addConst ("TC2997000", Timecode::TimecodeFormat(Timecode::timecode_2997000))
501 .addConst ("TC2997000DF", Timecode::TimecodeFormat(Timecode::timecode_2997000drop))
502 .addConst ("TC30", Timecode::TimecodeFormat(Timecode::timecode_30))
503 .addConst ("TC5994", Timecode::TimecodeFormat(Timecode::timecode_5994))
504 .addConst ("TC60", Timecode::TimecodeFormat(Timecode::timecode_60))
508 luabridge::getGlobalNamespace (L)
510 .beginNamespace ("Evoral")
511 .beginClass <Evoral::Event<samplepos_t> > ("Event")
512 .addFunction ("clear", &Evoral::Event<samplepos_t>::clear)
513 .addFunction ("size", &Evoral::Event<samplepos_t>::size)
514 .addFunction ("set_buffer", &Evoral::Event<samplepos_t>::set_buffer)
515 .addFunction ("buffer", (uint8_t*(Evoral::Event<samplepos_t>::*)())&Evoral::Event<samplepos_t>::buffer)
516 .addFunction ("time", (samplepos_t (Evoral::Event<samplepos_t>::*)())&Evoral::Event<samplepos_t>::time)
519 .beginClass <Evoral::Beats> ("Beats")
520 .addConstructor <void (*) (double)> ()
521 .addFunction ("to_double", &Evoral::Beats::to_double)
524 .beginClass <Evoral::Parameter> ("Parameter")
525 .addConstructor <void (*) (uint32_t, uint8_t, uint32_t)> ()
526 .addFunction ("type", &Evoral::Parameter::type)
527 .addFunction ("channel", &Evoral::Parameter::channel)
528 .addFunction ("id", &Evoral::Parameter::id)
531 .beginClass <Evoral::ControlEvent> ("ControlEvent")
532 .addData ("when", &Evoral::ControlEvent::when)
533 .addData ("value", &Evoral::ControlEvent::value)
536 .beginWSPtrClass <Evoral::ControlList> ("ControlList")
537 .addFunction ("add", &Evoral::ControlList::add)
538 .addFunction ("thin", &Evoral::ControlList::thin)
539 .addFunction ("eval", &Evoral::ControlList::eval)
540 .addRefFunction ("rt_safe_eval", &Evoral::ControlList::rt_safe_eval)
541 .addFunction ("interpolation", &Evoral::ControlList::interpolation)
542 .addFunction ("set_interpolation", &Evoral::ControlList::set_interpolation)
543 .addFunction ("truncate_end", &Evoral::ControlList::truncate_end)
544 .addFunction ("truncate_start", &Evoral::ControlList::truncate_start)
545 .addFunction ("clear", (void (Evoral::ControlList::*)(double, double))&Evoral::ControlList::clear)
546 .addFunction ("clear_list", (void (Evoral::ControlList::*)())&Evoral::ControlList::clear)
547 .addFunction ("in_write_pass", &Evoral::ControlList::in_write_pass)
548 .addFunction ("events", &Evoral::ControlList::events)
551 .beginWSPtrClass <Evoral::ControlSet> ("ControlSet")
554 .beginWSPtrClass <Evoral::Control> ("Control")
555 .addFunction ("list", (boost::shared_ptr<Evoral::ControlList>(Evoral::Control::*)())&Evoral::Control::list)
558 .beginClass <Evoral::ParameterDescriptor> ("ParameterDescriptor")
559 .addVoidConstructor ()
560 .addData ("lower", &Evoral::ParameterDescriptor::lower)
561 .addData ("upper", &Evoral::ParameterDescriptor::upper)
562 .addData ("normal", &Evoral::ParameterDescriptor::normal)
563 .addData ("toggled", &Evoral::ParameterDescriptor::toggled)
564 .addData ("logarithmic", &Evoral::ParameterDescriptor::logarithmic)
567 .beginClass <Evoral::Range<samplepos_t> > ("Range")
568 .addConstructor <void (*) (samplepos_t, samplepos_t)> ()
569 .addData ("from", &Evoral::Range<samplepos_t>::from)
570 .addData ("to", &Evoral::Range<samplepos_t>::to)
573 .deriveWSPtrClass <Evoral::Sequence<Evoral::Beats>, Evoral::ControlSet> ("Sequence")
576 .beginWSPtrClass <Evoral::Note<Evoral::Beats> > ("NotePtr")
577 .addFunction ("time", &Evoral::Note<Evoral::Beats>::time)
578 .addFunction ("note", &Evoral::Note<Evoral::Beats>::note)
579 .addFunction ("velocity", &Evoral::Note<Evoral::Beats>::velocity)
580 .addFunction ("off_velocity", &Evoral::Note<Evoral::Beats>::off_velocity)
581 .addFunction ("length", &Evoral::Note<Evoral::Beats>::length)
582 .addFunction ("channel", &Evoral::Note<Evoral::Beats>::channel)
585 /* libevoral enums */
586 .beginNamespace ("InterpolationStyle")
587 .addConst ("Discrete", Evoral::ControlList::InterpolationStyle(Evoral::ControlList::Discrete))
588 .addConst ("Linear", Evoral::ControlList::InterpolationStyle(Evoral::ControlList::Linear))
589 .addConst ("Curved", Evoral::ControlList::InterpolationStyle(Evoral::ControlList::Curved))
592 .endNamespace (); // Evoral
594 luabridge::getGlobalNamespace (L)
595 .beginNamespace ("Vamp")
597 .beginClass<Vamp::RealTime> ("RealTime")
598 .addConstructor <void (*) (int, int)> ()
599 .addData ("sec", &Vamp::RealTime::sec, false)
600 .addData ("nsec", &Vamp::RealTime::nsec, false)
601 .addFunction ("usec", &Vamp::RealTime::usec)
602 .addFunction ("msec", &Vamp::RealTime::msec)
603 .addFunction ("toString", &Vamp::RealTime::toString)
604 .addStaticFunction ("realTime2Frame", &Vamp::RealTime::realTime2Frame)
605 .addStaticFunction ("frame2RealTime", &Vamp::RealTime::frame2RealTime)
608 .beginClass<Vamp::PluginBase> ("PluginBase")
609 .addFunction ("getIdentifier", &Vamp::PluginBase::getIdentifier)
610 .addFunction ("getName", &Vamp::PluginBase::getName)
611 .addFunction ("getDescription", &Vamp::PluginBase::getDescription)
612 .addFunction ("getMaker", &Vamp::PluginBase::getMaker)
613 .addFunction ("getCopyright", &Vamp::PluginBase::getCopyright)
614 .addFunction ("getPluginVersion", &Vamp::PluginBase::getPluginVersion)
615 .addFunction ("getParameterDescriptors", &Vamp::PluginBase::getParameterDescriptors)
616 .addFunction ("getParameter", &Vamp::PluginBase::getParameter)
617 .addFunction ("setParameter", &Vamp::PluginBase::setParameter)
618 .addFunction ("getPrograms", &Vamp::PluginBase::getPrograms)
619 .addFunction ("getCurrentProgram", &Vamp::PluginBase::getCurrentProgram)
620 .addFunction ("selectProgram", &Vamp::PluginBase::selectProgram)
621 .addFunction ("getType", &Vamp::PluginBase::getType)
624 .beginNamespace ("PluginBase")
625 .beginClass<Vamp::PluginBase::ParameterDescriptor> ("ParameterDescriptor")
626 .addData ("identifier", &Vamp::PluginBase::ParameterDescriptor::identifier)
627 .addData ("name", &Vamp::PluginBase::ParameterDescriptor::name)
628 .addData ("description", &Vamp::PluginBase::ParameterDescriptor::description)
629 .addData ("unit", &Vamp::PluginBase::ParameterDescriptor::unit)
630 .addData ("minValue", &Vamp::PluginBase::ParameterDescriptor::minValue)
631 .addData ("maxValue", &Vamp::PluginBase::ParameterDescriptor::maxValue)
632 .addData ("defaultValue", &Vamp::PluginBase::ParameterDescriptor::defaultValue)
633 .addData ("isQuantized", &Vamp::PluginBase::ParameterDescriptor::isQuantized)
634 .addData ("quantizeStep", &Vamp::PluginBase::ParameterDescriptor::quantizeStep)
635 .addData ("valueNames", &Vamp::PluginBase::ParameterDescriptor::valueNames)
638 .beginStdVector <Vamp::PluginBase::ParameterDescriptor> ("ParameterList")
640 .endNamespace () // Vamp::PluginBase
642 .deriveClass<Vamp::Plugin, Vamp::PluginBase> ("Plugin")
643 //.addFunction ("process", &Vamp::Plugin::process) // unusable due to float*const* -> LuaAPI::Vamp::process
644 .addFunction ("initialise", &Vamp::Plugin::initialise)
645 .addFunction ("reset", &Vamp::Plugin::reset)
646 .addFunction ("getInputDomain", &Vamp::Plugin::getInputDomain)
647 .addFunction ("getPreferredBlockSize", &Vamp::Plugin::getPreferredBlockSize)
648 .addFunction ("getPreferredStepSize", &Vamp::Plugin::getPreferredStepSize)
649 .addFunction ("getMinChannelCount", &Vamp::Plugin::getMinChannelCount)
650 .addFunction ("getMaxChannelCount", &Vamp::Plugin::getMaxChannelCount)
651 .addFunction ("getOutputDescriptors", &Vamp::Plugin::getOutputDescriptors)
652 .addFunction ("getRemainingFeatures", &Vamp::Plugin::getRemainingFeatures)
653 .addFunction ("getType", &Vamp::Plugin::getType)
656 .beginNamespace ("Plugin")
657 .beginClass<Vamp::Plugin::OutputDescriptor> ("OutputDescriptor")
658 .addData ("identifier", &Vamp::Plugin::OutputDescriptor::identifier)
659 .addData ("description", &Vamp::Plugin::OutputDescriptor::description)
660 .addData ("unit", &Vamp::Plugin::OutputDescriptor::unit)
661 .addData ("hasFixedBinCount", &Vamp::Plugin::OutputDescriptor::hasFixedBinCount)
662 .addData ("binCount", &Vamp::Plugin::OutputDescriptor::binCount)
663 .addData ("binNames", &Vamp::Plugin::OutputDescriptor::binNames)
664 .addData ("hasKnownExtents", &Vamp::Plugin::OutputDescriptor::hasKnownExtents)
665 .addData ("minValue", &Vamp::Plugin::OutputDescriptor::minValue)
666 .addData ("maxValue", &Vamp::Plugin::OutputDescriptor::maxValue)
667 .addData ("isQuantized", &Vamp::Plugin::OutputDescriptor::isQuantized)
668 .addData ("quantizeStep", &Vamp::Plugin::OutputDescriptor::quantizeStep)
669 .addData ("sampleType", &Vamp::Plugin::OutputDescriptor::sampleType)
670 .addData ("sampleRate", &Vamp::Plugin::OutputDescriptor::sampleRate)
671 .addData ("hasDuration", &Vamp::Plugin::OutputDescriptor::hasDuration)
674 /* Vamp::Plugin enums */
675 .beginNamespace ("InputDomain")
676 .addConst ("TimeDomain", Vamp::Plugin::InputDomain(Vamp::Plugin::TimeDomain))
677 .addConst ("FrequencyDomain", Vamp::Plugin::InputDomain(Vamp::Plugin::FrequencyDomain))
680 /* Vamp::Plugin::OutputDescriptor enum */
681 .beginNamespace ("OutputDescriptor")
682 .beginNamespace ("SampleType")
683 .addConst ("OneSamplePerStep", Vamp::Plugin::OutputDescriptor::SampleType(Vamp::Plugin::OutputDescriptor::OneSamplePerStep))
684 .addConst ("FixedSampleRate", Vamp::Plugin::OutputDescriptor::SampleType(Vamp::Plugin::OutputDescriptor::FixedSampleRate))
685 .addConst ("VariableSampleRate", Vamp::Plugin::OutputDescriptor::SampleType(Vamp::Plugin::OutputDescriptor::VariableSampleRate))
687 .endNamespace () /* Vamp::Plugin::OutputDescriptor */
689 .beginClass<Vamp::Plugin::Feature> ("Feature")
690 .addData ("hasTimestamp", &Vamp::Plugin::Feature::hasTimestamp, false)
691 .addData ("timestamp", &Vamp::Plugin::Feature::timestamp, false)
692 .addData ("hasDuration", &Vamp::Plugin::Feature::hasDuration, false)
693 .addData ("duration", &Vamp::Plugin::Feature::duration, false)
694 .addData ("values", &Vamp::Plugin::Feature::values, false)
695 .addData ("label", &Vamp::Plugin::Feature::label, false)
698 .beginStdVector <Vamp::Plugin::OutputDescriptor> ("OutputList")
701 .beginStdVector <Vamp::Plugin::Feature> ("FeatureList")
704 .beginStdMap <int, Vamp::Plugin::FeatureList> ("FeatureSet")
707 .endNamespace () // Vamp::Plugin
708 .endNamespace ();// Vamp
710 luabridge::getGlobalNamespace (L)
711 .beginNamespace ("ARDOUR")
713 .beginClass <InterThreadInfo> ("InterThreadInfo")
714 .addVoidConstructor ()
715 .addData ("done", const_cast<bool InterThreadInfo::*>(&InterThreadInfo::done))
716 #if 0 // currently unused, lua is single-threaded, no custom UIs.
717 .addData ("cancel", (bool InterThreadInfo::*)&InterThreadInfo::cancel)
719 .addData ("progress", const_cast<float InterThreadInfo::*>(&InterThreadInfo::progress))
722 .beginClass <Progress> ("Progress")
725 .beginClass <MusicSample> ("MusicSample")
726 .addConstructor <void (*) (samplepos_t, int32_t)> ()
727 .addFunction ("set", &MusicSample::set)
728 .addData ("frame", &MusicSample::sample)
729 .addData ("division", &MusicSample::division)
732 .beginClass <AudioRange> ("AudioRange")
733 .addConstructor <void (*) (samplepos_t, samplepos_t, uint32_t)> ()
734 .addFunction ("length", &AudioRange::length)
735 .addFunction ("equal", &AudioRange::equal)
736 .addData ("start", &AudioRange::start)
737 .addData ("_end", &AudioRange::end) // XXX "end" is a lua reserved word
738 .addData ("id", &AudioRange::id)
741 .beginWSPtrClass <PluginInfo> ("PluginInfo")
742 .addNilPtrConstructor ()
743 .addData ("name", &PluginInfo::name, false)
744 .addData ("category", &PluginInfo::category, false)
745 .addData ("creator", &PluginInfo::creator, false)
746 .addData ("path", &PluginInfo::path, false)
747 .addData ("n_inputs", &PluginInfo::n_inputs, false)
748 .addData ("n_outputs", &PluginInfo::n_outputs, false)
749 .addData ("type", &PluginInfo::type, false)
750 .addData ("unique_id", &PluginInfo::unique_id, false)
751 .addFunction ("is_instrument", &PluginInfo::is_instrument)
752 .addFunction ("get_presets", &PluginInfo::get_presets)
755 .beginNamespace ("Route")
756 .beginClass <Route::ProcessorStreams> ("ProcessorStreams")
757 .addVoidConstructor ()
761 .beginClass <ChanMapping> ("ChanMapping")
762 .addVoidConstructor ()
763 .addFunction ("get", static_cast<uint32_t(ChanMapping::*)(DataType, uint32_t) const>(&ChanMapping::get))
764 .addFunction ("set", &ChanMapping::set)
765 .addFunction ("count", &ChanMapping::count)
766 .addFunction ("n_total", &ChanMapping::n_total)
767 .addFunction ("is_monotonic", &ChanMapping::is_monotonic)
768 .addConst ("Invalid", 4294967295U) // UINT32_MAX
771 .beginNamespace ("Properties")
772 // templated class definitions
773 .beginClass <PBD::PropertyDescriptor<bool> > ("BoolProperty").endClass ()
774 .beginClass <PBD::PropertyDescriptor<float> > ("FloatProperty").endClass ()
775 .beginClass <PBD::PropertyDescriptor<samplepos_t> > ("FrameposProperty").endClass ()
776 // actual references (TODO: also expose GQuark for std::set)
778 .addConst ("Start", &ARDOUR::Properties::start)
779 .addConst ("Length", &ARDOUR::Properties::length)
780 .addConst ("Position", &ARDOUR::Properties::position)
783 .beginClass <PBD::PropertyChange> ("PropertyChange")
784 // TODO add special handling (std::set<PropertyID>), PropertyID is a GQuark.
785 // -> direct map to lua table beginStdSet()A
787 // expand templated PropertyDescriptor<T>
788 .addFunction ("containsBool", &PBD::PropertyChange::contains<bool>)
789 .addFunction ("containsFloat", &PBD::PropertyChange::contains<float>)
790 .addFunction ("containsFramePos", &PBD::PropertyChange::contains<samplepos_t>)
793 .beginClass <PBD::PropertyList> ("PropertyList")
794 // is-a std::map<PropertyID, PropertyBase*>
797 .deriveClass <PBD::OwnedPropertyList, PBD::PropertyList> ("OwnedPropertyList")
800 .deriveWSPtrClass <AutomationList, Evoral::ControlList> ("AutomationList")
801 .addCast<PBD::Stateful> ("to_stateful")
802 .addCast<PBD::StatefulDestructible> ("to_statefuldestructible")
803 .addCast<Evoral::ControlList> ("list") // deprecated
804 .addFunction ("get_state", &AutomationList::get_state)
805 .addFunction ("memento_command", &AutomationList::memento_command)
806 .addFunction ("touching", &AutomationList::touching)
807 .addFunction ("writing", &AutomationList::writing)
808 .addFunction ("touch_enabled", &AutomationList::touch_enabled)
811 .deriveClass <Location, PBD::StatefulDestructible> ("Location")
812 .addFunction ("name", &Location::name)
813 .addFunction ("locked", &Location::locked)
814 .addFunction ("lock", &Location::lock)
815 .addFunction ("unlock", &Location::unlock)
816 .addFunction ("start", &Location::start)
817 .addFunction ("_end", &Location::end) // XXX "end" is a lua reserved word
818 .addFunction ("length", &Location::length)
819 .addFunction ("set_start", &Location::set_start)
820 .addFunction ("set_end", &Location::set_end)
821 .addFunction ("set_length", &Location::set)
822 .addFunction ("move_to", &Location::move_to)
823 .addFunction ("matches", &Location::matches)
824 .addFunction ("flags", &Location::flags)
825 .addFunction ("is_auto_punch", &Location::is_auto_punch)
826 .addFunction ("is_auto_loop", &Location::is_auto_loop)
827 .addFunction ("is_mark", &Location::is_mark)
828 .addFunction ("is_hidden", &Location::is_hidden)
829 .addFunction ("is_cd_marker", &Location::is_cd_marker)
830 .addFunction ("is_session_range", &Location::is_session_range)
831 .addFunction ("is_range_marker", &Location::is_range_marker)
834 .deriveClass <Locations, PBD::StatefulDestructible> ("Locations")
835 .addFunction ("list", static_cast<Locations::LocationList (Locations::*)()>(&Locations::list))
836 .addFunction ("auto_loop_location", &Locations::auto_loop_location)
837 .addFunction ("auto_punch_location", &Locations::auto_punch_location)
838 .addFunction ("session_range_location", &Locations::session_range_location)
839 .addFunction ("first_mark_after", &Locations::first_mark_after)
840 .addFunction ("first_mark_before", &Locations::first_mark_before)
841 .addFunction ("first_mark_at", &Locations::mark_at)
842 .addFunction ("remove", &Locations::remove)
843 .addRefFunction ("marks_either_side", &Locations::marks_either_side)
844 .addRefFunction ("find_all_between", &Locations::find_all_between)
847 .beginWSPtrClass <SessionObject> ("SessionObjectPtr")
848 /* SessionObject is-a PBD::StatefulDestructible,
849 * but multiple inheritance is not covered by luabridge,
850 * we need explicit casts */
851 .addCast<PBD::Stateful> ("to_stateful")
852 .addCast<PBD::StatefulDestructible> ("to_statefuldestructible")
853 .addFunction ("name", &SessionObject::name)
856 .beginClass <SessionObject> ("SessionObject")
857 .addFunction ("name", &SessionObject::name)
858 .addCast<PBD::Stateful> ("to_stateful")
861 .beginWSPtrClass <Port> ("Port")
862 .addCast<MidiPort> ("to_midiport")
863 .addCast<AudioPort> ("to_audioport")
864 .addFunction ("name", &Port::name)
865 .addFunction ("pretty_name", &Port::pretty_name)
866 .addFunction ("receives_input", &Port::receives_input)
867 .addFunction ("sends_output", &Port::sends_output)
868 .addFunction ("connected", &Port::connected)
869 .addFunction ("disconnect_all", &Port::disconnect_all)
870 .addFunction ("connected_to", (bool (Port::*)(std::string const &)const)&Port::connected_to)
871 .addFunction ("connect", (int (Port::*)(std::string const &))&Port::connect)
872 .addFunction ("disconnect", (int (Port::*)(std::string const &))&Port::disconnect)
873 //.addStaticFunction ("port_offset", &Port::port_offset) // static
876 .deriveWSPtrClass <AudioPort, Port> ("AudioPort")
879 .deriveWSPtrClass <MidiPort, Port> ("MidiPort")
880 .addFunction ("input_active", &MidiPort::input_active)
881 .addFunction ("set_input_active", &MidiPort::set_input_active)
882 .addFunction ("get_midi_buffer", &MidiPort::get_midi_buffer) // DSP only
885 .beginWSPtrClass <PortSet> ("PortSet")
886 .addFunction ("num_ports", (size_t (PortSet::*)(DataType)const)&PortSet::num_ports)
887 .addFunction ("add", &PortSet::add)
888 .addFunction ("remove", &PortSet::remove)
889 .addFunction ("port", (boost::shared_ptr<Port> (PortSet::*)(DataType, size_t)const)&PortSet::port)
890 .addFunction ("contains", &PortSet::contains)
891 .addFunction ("clear", &PortSet::clear)
892 .addFunction ("empty", &PortSet::empty)
895 .deriveWSPtrClass <IO, SessionObject> ("IO")
896 .addFunction ("active", &IO::active)
897 .addFunction ("add_port", &IO::add_port)
898 .addFunction ("remove_port", &IO::remove_port)
899 .addFunction ("connect", &IO::connect)
900 .addFunction ("disconnect", (int (IO::*)(boost::shared_ptr<Port>, std::string, void *))&IO::disconnect)
901 .addFunction ("disconnect_all", (int (IO::*)(void *))&IO::disconnect)
902 .addFunction ("physically_connected", &IO::physically_connected)
903 .addFunction ("has_port", &IO::has_port)
904 .addFunction ("nth", &IO::nth)
905 .addFunction ("audio", &IO::audio)
906 .addFunction ("midi", &IO::midi)
907 .addFunction ("port_by_name", &IO::nth)
908 .addFunction ("n_ports", &IO::n_ports)
909 .addFunction ("latency", &IO::latency)
912 .deriveWSPtrClass <PannerShell, SessionObject> ("PannerShell")
913 .addFunction ("bypassed", &PannerShell::bypassed)
914 .addFunction ("set_bypassed", &PannerShell::set_bypassed)
917 .deriveClass <RouteGroup, SessionObject> ("RouteGroup")
918 .addFunction ("is_active", &RouteGroup::is_active)
919 .addFunction ("is_relative", &RouteGroup::is_relative)
920 .addFunction ("is_hidden", &RouteGroup::is_hidden)
921 .addFunction ("is_gain", &RouteGroup::is_gain)
922 .addFunction ("is_mute", &RouteGroup::is_mute)
923 .addFunction ("is_solo", &RouteGroup::is_solo)
924 .addFunction ("is_recenable", &RouteGroup::is_recenable)
925 .addFunction ("is_select", &RouteGroup::is_select)
926 .addFunction ("is_route_active", &RouteGroup::is_route_active)
927 .addFunction ("is_color", &RouteGroup::is_color)
928 .addFunction ("is_monitoring", &RouteGroup::is_monitoring)
929 .addFunction ("group_master_number", &RouteGroup::group_master_number)
930 .addFunction ("empty", &RouteGroup::empty)
931 .addFunction ("size", &RouteGroup::size)
932 .addFunction ("set_active", &RouteGroup::set_active)
933 .addFunction ("set_relative", &RouteGroup::set_relative)
934 .addFunction ("set_hidden", &RouteGroup::set_hidden)
935 .addFunction ("set_gain", &RouteGroup::set_gain)
936 .addFunction ("set_mute", &RouteGroup::set_mute)
937 .addFunction ("set_solo", &RouteGroup::set_solo)
938 .addFunction ("set_recenable", &RouteGroup::set_recenable)
939 .addFunction ("set_select", &RouteGroup::set_select)
940 .addFunction ("set_route_active", &RouteGroup::set_route_active)
941 .addFunction ("set_color", &RouteGroup::set_color)
942 .addFunction ("set_monitoring", &RouteGroup::set_monitoring)
943 .addFunction ("add", &RouteGroup::add)
944 .addFunction ("remove", &RouteGroup::remove)
945 .addFunction ("clear", &RouteGroup::clear)
946 .addFunction ("set_rgba", &RouteGroup::set_rgba)
947 .addFunction ("rgba", &RouteGroup::rgba)
948 .addFunction ("has_subgroup", &RouteGroup::has_subgroup)
949 .addFunction ("make_subgroup", &RouteGroup::make_subgroup)
950 .addFunction ("destroy_subgroup", &RouteGroup::destroy_subgroup)
951 .addFunction ("route_list", &RouteGroup::route_list)
954 .deriveClass <PresentationInfo, PBD::Stateful> ("PresentationInfo")
955 .addFunction ("color", &PresentationInfo::color)
956 .addFunction ("set_color", &PresentationInfo::set_color)
957 .addFunction ("order", &PresentationInfo::order)
958 .addFunction ("special", &PresentationInfo::special)
959 .addFunction ("flags", &PresentationInfo::flags)
960 .addConst ("max_order", ARDOUR::PresentationInfo::max_order)
963 .beginWSPtrClass <Slavable> ("Slavable")
964 .addFunction ("assign", &Slavable::assign)
965 .addFunction ("unassign", &Slavable::unassign)
968 .deriveWSPtrClass <Stripable, SessionObject> ("Stripable")
969 .addCast<Route> ("to_route")
970 .addCast<VCA> ("to_vca")
971 .addFunction ("is_auditioner", &Stripable::is_auditioner)
972 .addFunction ("is_private_route", &Stripable::is_private_route)
973 .addFunction ("is_master", &Stripable::is_master)
974 .addFunction ("is_monitor", &Stripable::is_monitor)
975 .addFunction ("is_hidden", &Stripable::is_hidden)
976 .addFunction ("is_selected", &Stripable::is_selected)
977 .addFunction ("gain_control", &Stripable::gain_control)
978 .addFunction ("solo_control", &Stripable::solo_control)
979 .addFunction ("solo_isolate_control", &Stripable::solo_isolate_control)
980 .addFunction ("solo_safe_control", &Stripable::solo_safe_control)
981 .addFunction ("mute_control", &Stripable::mute_control)
982 .addFunction ("phase_control", &Stripable::phase_control)
983 .addFunction ("trim_control", &Stripable::trim_control)
984 .addFunction ("rec_enable_control", &Stripable::rec_enable_control)
985 .addFunction ("rec_safe_control", &Stripable::rec_safe_control)
986 .addFunction ("pan_azimuth_control", &Stripable::pan_azimuth_control)
987 .addFunction ("pan_elevation_control", &Stripable::pan_elevation_control)
988 .addFunction ("pan_width_control", &Stripable::pan_width_control)
989 .addFunction ("pan_frontback_control", &Stripable::pan_frontback_control)
990 .addFunction ("pan_lfe_control", &Stripable::pan_lfe_control)
991 .addFunction ("send_level_control", &Stripable::send_level_controllable)
992 .addFunction ("send_enable_control", &Stripable::send_level_controllable)
993 .addFunction ("send_name", &Stripable::send_name)
994 .addFunction ("monitor_control", &Stripable::monitor_control)
995 .addFunction ("master_send_enable_control ", &Stripable::master_send_enable_controllable )
996 .addFunction ("comp_enable_control ", &Stripable::comp_enable_controllable )
997 .addFunction ("comp_threshold_control ", &Stripable::comp_threshold_controllable )
998 .addFunction ("comp_speed_control ", &Stripable::comp_speed_controllable )
999 .addFunction ("comp_mode_control ", &Stripable::comp_mode_controllable )
1000 .addFunction ("comp_makeup_control ", &Stripable::comp_makeup_controllable )
1001 .addFunction ("comp_redux_control ", &Stripable::comp_redux_controllable )
1002 .addFunction ("comp_mode_name", &Stripable::comp_mode_name)
1003 .addFunction ("comp_speed_name", &Stripable::comp_speed_name)
1004 .addFunction ("eq_band_cnt ", &Stripable::eq_band_cnt)
1005 .addFunction ("eq_enable_control ", &Stripable::eq_enable_controllable )
1006 .addFunction ("eq_band_name", &Stripable::eq_band_name)
1007 .addFunction ("eq_gain_control", &Stripable::eq_gain_controllable)
1008 .addFunction ("eq_freq_control ", &Stripable::eq_freq_controllable )
1009 .addFunction ("eq_q_control ", &Stripable::eq_q_controllable )
1010 .addFunction ("eq_shape_control ", &Stripable::eq_shape_controllable )
1011 .addFunction ("filter_freq_controllable ", &Stripable::filter_freq_controllable )
1012 .addFunction ("filter_slope_controllable ", &Stripable::filter_slope_controllable )
1013 .addFunction ("filter_enable_controllable ", &Stripable::filter_enable_controllable )
1014 .addFunction ("set_presentation_order", &Stripable::set_presentation_order)
1015 .addFunction ("presentation_info_ptr", &Stripable::presentation_info_ptr)
1019 .deriveWSPtrClass <VCA, Stripable> ("VCA")
1020 .addFunction ("full_name", &VCA::full_name)
1021 .addFunction ("number", &VCA::number)
1022 .addFunction ("gain_control", &VCA::gain_control)
1023 .addFunction ("solo_control", &VCA::solo_control)
1024 .addFunction ("mute_control", &VCA::mute_control)
1027 .deriveWSPtrClass <Route, Stripable> ("Route")
1028 .addCast<Track> ("to_track")
1029 .addCast<Automatable> ("to_automatable")
1030 .addCast<Slavable> ("to_slavable")
1031 .addFunction ("set_name", &Route::set_name)
1032 .addFunction ("comment", &Route::comment)
1033 .addFunction ("active", &Route::active)
1034 .addFunction ("set_active", &Route::set_active)
1035 .addFunction ("nth_plugin", &Route::nth_plugin)
1036 .addFunction ("nth_processor", &Route::nth_processor)
1037 .addFunction ("nth_send", &Route::nth_send)
1038 .addFunction ("add_processor_by_index", &Route::add_processor_by_index)
1039 .addFunction ("remove_processor", &Route::remove_processor)
1040 .addFunction ("remove_processors", &Route::remove_processors)
1041 .addFunction ("replace_processor", &Route::replace_processor)
1042 .addFunction ("reorder_processors", &Route::reorder_processors)
1043 .addFunction ("the_instrument", &Route::the_instrument)
1044 .addFunction ("n_inputs", &Route::n_inputs)
1045 .addFunction ("n_outputs", &Route::n_outputs)
1046 .addFunction ("input", &Route::input)
1047 .addFunction ("output", &Route::output)
1048 .addFunction ("panner_shell", &Route::panner_shell)
1049 .addFunction ("set_comment", &Route::set_comment)
1050 .addFunction ("strict_io", &Route::strict_io)
1051 .addFunction ("set_strict_io", &Route::set_strict_io)
1052 .addFunction ("reset_plugin_insert", &Route::reset_plugin_insert)
1053 .addFunction ("customize_plugin_insert", &Route::customize_plugin_insert)
1054 .addFunction ("add_sidechain", &Route::add_sidechain)
1055 .addFunction ("remove_sidechain", &Route::remove_sidechain)
1056 .addFunction ("main_outs", &Route::main_outs)
1057 .addFunction ("muted", &Route::muted)
1058 .addFunction ("soloed", &Route::soloed)
1059 .addFunction ("amp", &Route::amp)
1060 .addFunction ("trim", &Route::trim)
1061 .addFunction ("peak_meter", (boost::shared_ptr<PeakMeter> (Route::*)())&Route::peak_meter)
1062 .addFunction ("set_meter_point", &Route::set_meter_point)
1063 .addFunction ("initial_delay", &Route::initial_delay)
1064 .addFunction ("signal_latency", &Route::signal_latency)
1067 .deriveWSPtrClass <Playlist, SessionObject> ("Playlist")
1068 .addCast<AudioPlaylist> ("to_audioplaylist")
1069 .addCast<MidiPlaylist> ("to_midiplaylist")
1070 .addFunction ("region_by_id", &Playlist::region_by_id)
1071 .addFunction ("data_type", &Playlist::data_type)
1072 .addFunction ("n_regions", &Playlist::n_regions)
1073 //.addFunction ("get_extent", &Playlist::get_extent) // pair<samplepos_t, samplepos_t>
1074 .addFunction ("region_list", &Playlist::region_list)
1075 .addFunction ("add_region", &Playlist::add_region)
1076 .addFunction ("remove_region", &Playlist::remove_region)
1077 .addFunction ("regions_at", &Playlist::regions_at)
1078 .addFunction ("top_region_at", &Playlist::top_region_at)
1079 .addFunction ("top_unmuted_region_at", &Playlist::top_unmuted_region_at)
1080 .addFunction ("find_next_transient", &Playlist::find_next_transient)
1081 .addFunction ("find_next_region", &Playlist::find_next_region)
1082 .addFunction ("find_next_region_boundary", &Playlist::find_next_region_boundary)
1083 .addFunction ("count_regions_at", &Playlist::count_regions_at)
1084 .addFunction ("regions_touched", &Playlist::regions_touched)
1085 .addFunction ("regions_with_start_within", &Playlist::regions_with_start_within)
1086 .addFunction ("regions_with_end_within", &Playlist::regions_with_end_within)
1087 .addFunction ("raise_region", &Playlist::raise_region)
1088 .addFunction ("lower_region", &Playlist::lower_region)
1089 .addFunction ("raise_region_to_top", &Playlist::raise_region_to_top)
1090 .addFunction ("lower_region_to_bottom", &Playlist::lower_region_to_bottom)
1091 .addFunction ("duplicate", (void (Playlist::*)(boost::shared_ptr<Region>, samplepos_t, samplecnt_t, float))&Playlist::duplicate)
1092 .addFunction ("duplicate_until", &Playlist::duplicate_until)
1093 .addFunction ("duplicate_range", &Playlist::duplicate_range)
1094 .addFunction ("combine", &Playlist::combine)
1095 .addFunction ("uncombine", &Playlist::uncombine)
1096 .addFunction ("split_region", &Playlist::split_region)
1097 .addFunction ("split", (void (Playlist::*)(samplepos_t))&Playlist::split)
1098 .addFunction ("cut", (boost::shared_ptr<Playlist> (Playlist::*)(std::list<AudioRange>&, bool))&Playlist::cut)
1100 .addFunction ("copy", &Playlist::copy)
1101 .addFunction ("paste", &Playlist::paste)
1105 .deriveWSPtrClass <AudioPlaylist, Playlist> ("AudioPlaylist")
1106 .addFunction ("read", &AudioPlaylist::read)
1109 .deriveWSPtrClass <MidiPlaylist, Playlist> ("MidiPlaylist")
1110 .addFunction ("set_note_mode", &MidiPlaylist::set_note_mode)
1113 .deriveWSPtrClass <Track, Route> ("Track")
1114 .addCast<AudioTrack> ("to_audio_track")
1115 .addCast<MidiTrack> ("to_midi_track")
1116 .addFunction ("set_name", &Track::set_name)
1117 .addFunction ("can_record", &Track::can_record)
1118 .addFunction ("bounceable", &Track::bounceable)
1119 .addFunction ("bounce", &Track::bounce)
1120 .addFunction ("bounce_range", &Track::bounce_range)
1121 .addFunction ("playlist", &Track::playlist)
1124 .deriveWSPtrClass <AudioTrack, Track> ("AudioTrack")
1127 .deriveWSPtrClass <MidiTrack, Track> ("MidiTrack")
1130 .beginWSPtrClass <Readable> ("Readable")
1131 .addFunction ("read", &Readable::read)
1132 .addFunction ("readable_length", &Readable::readable_length)
1133 .addFunction ("n_channels", &Readable::n_channels)
1136 .deriveWSPtrClass <Region, SessionObject> ("Region")
1137 .addCast<Readable> ("to_readable")
1138 .addCast<MidiRegion> ("to_midiregion")
1139 .addCast<AudioRegion> ("to_audioregion")
1141 .addFunction ("position", &Region::position)
1142 .addFunction ("start", &Region::start)
1143 .addFunction ("length", &Region::length)
1144 .addFunction ("layer", &Region::layer)
1145 .addFunction ("data_type", &Region::data_type)
1146 .addFunction ("stretch", &Region::stretch)
1147 .addFunction ("shift", &Region::shift)
1148 .addRefFunction ("sync_offset", &Region::sync_offset)
1149 .addFunction ("sync_position", &Region::sync_position)
1150 .addFunction ("hidden", &Region::hidden)
1151 .addFunction ("muted", &Region::muted)
1152 .addFunction ("opaque", &Region::opaque)
1153 .addFunction ("locked", &Region::locked)
1154 .addFunction ("position_locked", &Region::position_locked)
1155 .addFunction ("video_locked", &Region::video_locked)
1156 .addFunction ("automatic", &Region::automatic)
1157 .addFunction ("whole_file", &Region::whole_file)
1158 .addFunction ("captured", &Region::captured)
1159 .addFunction ("can_move", &Region::can_move)
1160 .addFunction ("sync_marked", &Region::sync_marked)
1161 .addFunction ("external", &Region::external)
1162 .addFunction ("import", &Region::import)
1163 .addFunction ("covers", &Region::covers)
1164 .addFunction ("at_natural_position", &Region::at_natural_position)
1165 .addFunction ("is_compound", &Region::is_compound)
1167 .addFunction ("has_transients", &Region::has_transients)
1168 .addFunction ("transients", (AnalysisFeatureList (Region::*)())&Region::transients)
1170 /* editing operations */
1171 .addFunction ("set_length", &Region::set_length)
1172 .addFunction ("set_start", &Region::set_start)
1173 .addFunction ("set_position", &Region::set_position)
1174 .addFunction ("set_initial_position", &Region::set_initial_position)
1175 .addFunction ("nudge_position", &Region::nudge_position)
1176 .addFunction ("move_to_natural_position", &Region::move_to_natural_position)
1177 .addFunction ("move_start", &Region::move_start)
1178 .addFunction ("master_sources", &Region::master_sources)
1179 .addFunction ("master_source_names", &Region::master_source_names)
1180 .addFunction ("n_channels", &Region::n_channels)
1181 .addFunction ("trim_front", &Region::trim_front)
1182 .addFunction ("trim_end", &Region::trim_end)
1183 .addFunction ("trim_to", &Region::trim_to)
1184 .addFunction ("cut_front", &Region::cut_front)
1185 .addFunction ("cut_end", &Region::cut_end)
1186 .addFunction ("raise", &Region::raise)
1187 .addFunction ("lower", &Region::lower)
1188 .addFunction ("raise_to_top", &Region::raise_to_top)
1189 .addFunction ("lower_to_bottom", &Region::lower_to_bottom)
1190 .addFunction ("set_sync_position", &Region::set_sync_position)
1191 .addFunction ("clear_sync_position", &Region::clear_sync_position)
1192 .addFunction ("quarter_note", &Region::quarter_note)
1193 .addFunction ("set_hidden", &Region::set_hidden)
1194 .addFunction ("set_muted", &Region::set_muted)
1195 .addFunction ("set_opaque", &Region::set_opaque)
1196 .addFunction ("set_locked", &Region::set_locked)
1197 .addFunction ("set_video_locked", &Region::set_video_locked)
1198 .addFunction ("set_position_locked", &Region::set_position_locked)
1199 .addFunction ("source", &Region::source)
1200 .addFunction ("control", static_cast<boost::shared_ptr<Evoral::Control>(Region::*)(const Evoral::Parameter&, bool)>(&Region::control))
1203 .deriveWSPtrClass <MidiRegion, Region> ("MidiRegion")
1204 .addFunction ("do_export", &MidiRegion::do_export)
1205 .addFunction ("midi_source", &MidiRegion::midi_source)
1206 .addFunction ("model", (boost::shared_ptr<MidiModel> (MidiRegion::*)())&MidiRegion::model)
1207 .addFunction ("start_beats", &MidiRegion::start_beats)
1208 .addFunction ("length_beats", &MidiRegion::length_beats)
1211 .deriveWSPtrClass <AudioRegion, Region> ("AudioRegion")
1212 .addFunction ("audio_source", &AudioRegion::audio_source)
1213 .addFunction ("set_scale_amplitude", &AudioRegion::set_scale_amplitude)
1214 .addFunction ("scale_amplitude", &AudioRegion::scale_amplitude)
1215 .addFunction ("maximum_amplitude", &AudioRegion::maximum_amplitude)
1216 .addFunction ("rms", &AudioRegion::rms)
1217 .addRefFunction ("separate_by_channel", &AudioRegion::separate_by_channel)
1220 .deriveWSPtrClass <Source, SessionObject> ("Source")
1221 .addCast<AudioSource> ("to_audiosource")
1222 .addCast<MidiSource> ("to_midisource")
1223 .addCast<FileSource> ("to_filesource")
1224 .addFunction ("timestamp", &Source::timestamp)
1225 .addFunction ("empty", &Source::empty)
1226 .addFunction ("length", &Source::length)
1227 .addFunction ("natural_position", &Source::natural_position)
1228 .addFunction ("destructive", &Source::destructive)
1229 .addFunction ("writable", &Source::writable)
1230 .addFunction ("has_been_analysed", &Source::has_been_analysed)
1231 .addFunction ("can_be_analysed", &Source::can_be_analysed)
1232 .addFunction ("timeline_position", &Source::timeline_position)
1233 .addFunction ("use_count", &Source::use_count)
1234 .addFunction ("used", &Source::used)
1235 .addFunction ("ancestor_name", &Source::ancestor_name)
1238 .deriveWSPtrClass <FileSource, Source> ("FileSource")
1239 .addFunction ("path", &FileSource::path)
1240 .addFunction ("within_session", &FileSource::within_session)
1241 .addFunction ("channel", &FileSource::channel)
1242 .addFunction ("origin", &FileSource::origin)
1243 .addFunction ("take_id", &FileSource::take_id)
1244 .addFunction ("gain", &FileSource::gain)
1247 .deriveWSPtrClass <MidiSource, Source> ("MidiSource")
1248 .addFunction ("empty", &MidiSource::empty)
1249 .addFunction ("length", &MidiSource::length)
1250 .addFunction ("model", &MidiSource::model)
1253 .deriveWSPtrClass <AudioSource, Source> ("AudioSource")
1254 .addCast<Readable> ("to_readable")
1255 .addFunction ("readable_length", &AudioSource::readable_length)
1256 .addFunction ("n_channels", &AudioSource::n_channels)
1257 .addFunction ("empty", &Source::empty)
1258 .addFunction ("length", &Source::length)
1259 .addFunction ("read", &AudioSource::read)
1260 .addFunction ("sample_rate", &AudioSource::sample_rate)
1261 .addFunction ("captured_for", &AudioSource::captured_for)
1264 .deriveWSPtrClass <Automatable, Evoral::ControlSet> ("Automatable")
1265 .addCast<Slavable> ("to_slavable")
1266 .addFunction ("automation_control", (boost::shared_ptr<AutomationControl>(Automatable::*)(const Evoral::Parameter&, bool))&Automatable::automation_control)
1267 //.addFunction ("what_can_be_automated", &Automatable::what_can_be_automated)
1270 .deriveWSPtrClass <AutomatableSequence<Evoral::Beats>, Automatable> ("AutomatableSequence")
1271 .addCast<Evoral::Sequence<Evoral::Beats> > ("to_sequence")
1274 .deriveWSPtrClass <MidiModel, AutomatableSequence<Evoral::Beats> > ("MidiModel")
1275 .addFunction ("apply_command", (void (MidiModel::*)(Session*, Command*))&MidiModel::apply_command)
1276 .addFunction ("new_note_diff_command", &MidiModel::new_note_diff_command)
1279 .beginNamespace ("MidiModel")
1280 .deriveClass<ARDOUR::MidiModel::DiffCommand, Command> ("DiffCommand")
1283 .deriveClass<ARDOUR::MidiModel::NoteDiffCommand, ARDOUR::MidiModel::DiffCommand> ("NoteDiffCommand")
1284 .addFunction ("add", &ARDOUR::MidiModel::NoteDiffCommand::add)
1285 .addFunction ("remove", &ARDOUR::MidiModel::NoteDiffCommand::remove)
1288 .endNamespace () /* ARDOUR::MidiModel */
1290 .beginClass <Plugin::PresetRecord> ("PresetRecord")
1291 .addVoidConstructor ()
1292 .addData ("uri", &Plugin::PresetRecord::uri, false)
1293 .addData ("label", &Plugin::PresetRecord::label, false)
1294 .addData ("user", &Plugin::PresetRecord::user, false)
1295 .addData ("valid", &Plugin::PresetRecord::valid, false)
1298 .beginStdVector <Plugin::PresetRecord> ("PresetVector").endClass ()
1300 .deriveClass <ParameterDescriptor, Evoral::ParameterDescriptor> ("ParameterDescriptor")
1301 .addVoidConstructor ()
1302 .addData ("label", &ParameterDescriptor::label)
1303 .addStaticFunction ("midi_note_name", &ParameterDescriptor::midi_note_name)
1306 .beginStdVector <boost::shared_ptr<ARDOUR::Processor> > ("ProcessorVector").endClass ()
1308 .deriveWSPtrClass <Processor, SessionObject> ("Processor")
1309 .addCast<Automatable> ("to_automatable")
1310 .addCast<PluginInsert> ("to_insert") // deprecated
1311 .addCast<PluginInsert> ("to_plugininsert")
1312 .addCast<SideChain> ("to_sidechain")
1313 .addCast<IOProcessor> ("to_ioprocessor")
1314 .addCast<UnknownProcessor> ("to_unknownprocessor")
1315 .addCast<Amp> ("to_amp")
1316 .addCast<PeakMeter> ("to_peakmeter")
1317 .addCast<MonitorProcessor> ("to_monitorprocessor")
1318 #if 0 // those objects are not yet bound
1319 .addCast<CapturingProcessor> ("to_capturingprocessor")
1320 .addCast<DelayLine> ("to_delayline")
1322 .addCast<PeakMeter> ("to_meter")
1323 .addFunction ("display_name", &Processor::display_name)
1324 .addFunction ("display_to_user", &Processor::display_to_user)
1325 .addFunction ("active", &Processor::active)
1326 .addFunction ("activate", &Processor::activate)
1327 .addFunction ("deactivate", &Processor::deactivate)
1328 .addFunction ("output_streams", &PluginInsert::output_streams)
1329 .addFunction ("input_streams", &PluginInsert::input_streams)
1332 .deriveWSPtrClass <IOProcessor, Processor> ("IOProcessor")
1333 .addFunction ("natural_input_streams", &IOProcessor::natural_input_streams)
1334 .addFunction ("natural_output_streams", &IOProcessor::natural_output_streams)
1335 .addFunction ("input", (boost::shared_ptr<IO>(IOProcessor::*)())&IOProcessor::input)
1336 .addFunction ("output", (boost::shared_ptr<IO>(IOProcessor::*)())&IOProcessor::output)
1339 .deriveWSPtrClass <SideChain, IOProcessor> ("SideChain")
1342 .deriveWSPtrClass <Delivery, IOProcessor> ("Delivery")
1343 .addFunction ("panner_shell", &Route::panner_shell)
1346 .beginNamespace ("Plugin")
1347 .beginClass <Plugin::IOPortDescription> ("IOPortDescription")
1348 .addData ("name", &Plugin::IOPortDescription::name)
1349 .addData ("is_sidechain", &Plugin::IOPortDescription::is_sidechain)
1350 .addData ("group_name", &Plugin::IOPortDescription::group_name)
1351 .addData ("group_channel", &Plugin::IOPortDescription::group_channel)
1355 .deriveWSPtrClass <Plugin, PBD::StatefulDestructible> ("Plugin")
1356 .addCast<LuaProc> ("to_luaproc")
1357 .addFunction ("unique_id", &Plugin::unique_id)
1358 .addFunction ("label", &Plugin::label)
1359 .addFunction ("name", &Plugin::name)
1360 .addFunction ("maker", &Plugin::maker)
1361 .addFunction ("parameter_count", &Plugin::parameter_count)
1362 .addFunction ("parameter_label", &Plugin::parameter_label)
1363 .addRefFunction ("nth_parameter", &Plugin::nth_parameter)
1364 .addFunction ("preset_by_label", &Plugin::preset_by_label)
1365 .addFunction ("preset_by_uri", &Plugin::preset_by_uri)
1366 .addFunction ("load_preset", &Plugin::load_preset)
1367 .addFunction ("parameter_is_input", &Plugin::parameter_is_input)
1368 .addFunction ("parameter_is_output", &Plugin::parameter_is_output)
1369 .addFunction ("parameter_is_control", &Plugin::parameter_is_control)
1370 .addFunction ("parameter_is_audio", &Plugin::parameter_is_audio)
1371 .addFunction ("get_docs", &Plugin::get_docs)
1372 .addFunction ("get_info", &Plugin::get_info)
1373 .addFunction ("get_parameter_docs", &Plugin::get_parameter_docs)
1374 .addFunction ("describe_io_port", &Plugin::describe_io_port)
1375 .addRefFunction ("get_parameter_descriptor", &Plugin::get_parameter_descriptor)
1378 .deriveWSPtrClass <LuaProc, Plugin> ("LuaProc")
1379 .addFunction ("shmem", &LuaProc::instance_shm)
1380 .addFunction ("table", &LuaProc::instance_ref)
1383 .deriveWSPtrClass <PluginInsert, Processor> ("PluginInsert")
1384 .addFunction ("plugin", &PluginInsert::plugin)
1385 .addFunction ("activate", &PluginInsert::activate)
1386 .addFunction ("deactivate", &PluginInsert::deactivate)
1387 .addFunction ("strict_io_configured", &PluginInsert::strict_io_configured)
1388 .addFunction ("input_map", (ARDOUR::ChanMapping (PluginInsert::*)(uint32_t) const)&PluginInsert::input_map)
1389 .addFunction ("output_map", (ARDOUR::ChanMapping (PluginInsert::*)(uint32_t) const)&PluginInsert::output_map)
1390 .addFunction ("set_input_map", &PluginInsert::set_input_map)
1391 .addFunction ("set_output_map", &PluginInsert::set_output_map)
1392 .addFunction ("natural_output_streams", &PluginInsert::natural_output_streams)
1393 .addFunction ("natural_input_streams", &PluginInsert::natural_input_streams)
1394 .addFunction ("reset_parameters_to_default", &PluginInsert::reset_parameters_to_default)
1397 .deriveWSPtrClass <ReadOnlyControl, PBD::StatefulDestructible> ("ReadOnlyControl")
1398 .addFunction ("get_parameter", &ReadOnlyControl::get_parameter)
1399 .addFunction ("describe_parameter", &ReadOnlyControl::describe_parameter)
1400 .addFunction ("desc", &ReadOnlyControl::desc)
1403 .deriveWSPtrClass <AutomationControl, PBD::Controllable> ("AutomationControl")
1404 .addCast<Evoral::Control> ("to_ctrl")
1405 .addCast<SlavableAutomationControl> ("to_slavable")
1406 .addFunction ("automation_state", &AutomationControl::automation_state)
1407 .addFunction ("set_automation_state", &AutomationControl::set_automation_state)
1408 .addFunction ("start_touch", &AutomationControl::start_touch)
1409 .addFunction ("stop_touch", &AutomationControl::stop_touch)
1410 .addFunction ("get_value", &AutomationControl::get_value)
1411 .addFunction ("set_value", &AutomationControl::set_value)
1412 .addFunction ("writable", &AutomationControl::writable)
1413 .addFunction ("alist", &AutomationControl::alist)
1416 .deriveWSPtrClass <SlavableAutomationControl, AutomationControl> ("SlavableAutomationControl")
1417 .addFunction ("add_master", &SlavableAutomationControl::add_master)
1418 .addFunction ("remove_master", &SlavableAutomationControl::remove_master)
1419 .addFunction ("clear_masters", &SlavableAutomationControl::clear_masters)
1420 .addFunction ("slaved_to", &SlavableAutomationControl::slaved_to)
1421 .addFunction ("slaved", &SlavableAutomationControl::slaved)
1422 .addFunction ("get_masters_value", &SlavableAutomationControl::get_masters_value)
1423 .addFunction ("get_boolean_masters", &SlavableAutomationControl::get_boolean_masters)
1424 //.addFunction ("masters", &SlavableAutomationControl::masters) // not implemented
1427 .deriveWSPtrClass <PhaseControl, AutomationControl> ("PhaseControl")
1428 .addFunction ("set_phase_invert", (void(PhaseControl::*)(uint32_t, bool))&PhaseControl::set_phase_invert)
1429 .addFunction ("inverted", &PhaseControl::inverted)
1432 .deriveWSPtrClass <GainControl, SlavableAutomationControl> ("GainControl")
1435 .deriveWSPtrClass <SoloControl, SlavableAutomationControl> ("SoloControl")
1436 .addFunction ("can_solo", &SoloControl::can_solo)
1437 .addFunction ("soloed", &SoloControl::soloed)
1438 .addFunction ("self_soloed", &SoloControl::self_soloed)
1441 .deriveWSPtrClass <MuteControl, SlavableAutomationControl> ("MuteControl")
1442 .addFunction ("muted", &MuteControl::muted)
1443 .addFunction ("muted_by_self", &MuteControl::muted_by_self)
1446 .deriveWSPtrClass <SoloIsolateControl, SlavableAutomationControl> ("SoloIsolateControl")
1447 .addFunction ("solo_isolated", &SoloIsolateControl::solo_isolated)
1448 .addFunction ("self_solo_isolated", &SoloIsolateControl::self_solo_isolated)
1451 .deriveWSPtrClass <SoloSafeControl, SlavableAutomationControl> ("SoloSafeControl")
1452 .addFunction ("solo_safe", &SoloSafeControl::solo_safe)
1455 .deriveWSPtrClass <Amp, Processor> ("Amp")
1456 .addFunction ("gain_control", (boost::shared_ptr<GainControl>(Amp::*)())&Amp::gain_control)
1459 .deriveWSPtrClass <PeakMeter, Processor> ("PeakMeter")
1460 .addFunction ("meter_level", &PeakMeter::meter_level)
1461 .addFunction ("set_type", &PeakMeter::set_type)
1462 .addFunction ("reset_max", &PeakMeter::reset_max)
1465 .deriveWSPtrClass <MonitorProcessor, Processor> ("MonitorProcessor")
1466 .addFunction ("set_cut_all", &MonitorProcessor::set_cut_all)
1467 .addFunction ("set_dim_all", &MonitorProcessor::set_dim_all)
1468 .addFunction ("set_polarity", &MonitorProcessor::set_polarity)
1469 .addFunction ("set_cut", &MonitorProcessor::set_cut)
1470 .addFunction ("set_dim", &MonitorProcessor::set_dim)
1471 .addFunction ("set_solo", &MonitorProcessor::set_solo)
1472 .addFunction ("set_mono", &MonitorProcessor::set_mono)
1473 .addFunction ("dim_level", &MonitorProcessor::dim_level)
1474 .addFunction ("solo_boost_level", &MonitorProcessor::solo_boost_level)
1475 .addFunction ("dimmed", &MonitorProcessor::dimmed)
1476 .addFunction ("soloed", &MonitorProcessor::soloed)
1477 .addFunction ("inverted", &MonitorProcessor::inverted)
1478 .addFunction ("cut", &MonitorProcessor::cut)
1479 .addFunction ("cut_all", &MonitorProcessor::cut_all)
1480 .addFunction ("dim_all", &MonitorProcessor::dim_all)
1481 .addFunction ("mono", &MonitorProcessor::mono)
1482 .addFunction ("monitor_active", &MonitorProcessor::monitor_active)
1483 .addFunction ("channel_cut_control", &MonitorProcessor::channel_cut_control)
1484 .addFunction ("channel_dim_control", &MonitorProcessor::channel_dim_control)
1485 .addFunction ("channel_polarity_control", &MonitorProcessor::channel_polarity_control)
1486 .addFunction ("channel_solo_control", &MonitorProcessor::channel_solo_control)
1487 .addFunction ("dim_control", &MonitorProcessor::dim_control)
1488 .addFunction ("cut_control", &MonitorProcessor::cut_control)
1489 .addFunction ("mono_control", &MonitorProcessor::mono_control)
1490 .addFunction ("dim_level_control", &MonitorProcessor::dim_level_control)
1491 .addFunction ("solo_boost_control", &MonitorProcessor::solo_boost_control)
1494 .deriveWSPtrClass <UnknownProcessor, Processor> ("UnknownProcessor")
1497 .deriveWSPtrClass <PluginInsert::PluginControl, AutomationControl> ("PluginControl")
1500 .deriveWSPtrClass <AudioSource, Source> ("AudioSource")
1501 .addFunction ("readable_length", &AudioSource::readable_length)
1502 .addFunction ("n_channels", &AudioSource::n_channels)
1505 // <std::list<boost::shared_ptr <AudioTrack> >
1506 .beginStdList <boost::shared_ptr<AudioTrack> > ("AudioTrackList")
1509 // std::list<boost::shared_ptr <MidiTrack> >
1510 .beginStdList <boost::shared_ptr<MidiTrack> > ("MidiTrackList")
1513 // RouteList == std::list<boost::shared_ptr<Route> >
1514 .beginConstStdList <boost::shared_ptr<Route> > ("RouteList")
1517 // StripableList == std::list<boost::shared_ptr<Stripable> >
1518 .beginConstStdList <boost::shared_ptr<Stripable> > ("StripableList")
1521 // VCAList == std::list<boost::shared_ptr<VCA> >
1522 .beginConstStdList <boost::shared_ptr<VCA> > ("VCAList")
1525 // boost::shared_ptr<RouteList>
1526 .beginPtrStdList <boost::shared_ptr<Route> > ("RouteListPtr")
1527 .addVoidPtrConstructor<std::list<boost::shared_ptr <Route> > > ()
1530 // typedef std::list<boost::weak_ptr <Route> > WeakRouteList
1531 .beginConstStdList <boost::weak_ptr<Route> > ("WeakRouteList")
1534 // RouteGroupList == std::list<RouteGroup*>
1535 .beginConstStdCPtrList <RouteGroup> ("RouteGroupList")
1538 // typedef std::vector<boost::shared_ptr<Source> > Region::SourceList
1539 .beginStdVector <boost::shared_ptr<Source> > ("SourceList")
1542 // std::list< boost::weak_ptr <AudioSource> >
1543 .beginConstStdList <boost::weak_ptr<AudioSource> > ("WeakAudioSourceList")
1546 // typedef std::vector<boost::shared_ptr<Region> > RegionVector
1547 .beginStdVector <boost::shared_ptr<Region> > ("RegionVector")
1550 // typedef std::list<boost::shared_ptr<Region> > RegionList
1551 .beginConstStdList <boost::shared_ptr<Region> > ("RegionList")
1554 // boost::shared_ptr <std::list<boost::shared_ptr<Region> > >
1555 .beginPtrStdList <boost::shared_ptr<Region> > ("RegionListPtr")
1556 .addVoidPtrConstructor<std::list<boost::shared_ptr <Region> > > ()
1559 // RegionFactory::RegionMap
1560 .beginStdMap <PBD::ID,boost::shared_ptr<Region> > ("RegionMap")
1563 // typedef std::list<boost::shared_ptr<Processor> > ProcessorList;
1564 .beginStdList <boost::shared_ptr<Processor> > ("ProcessorList")
1567 //std::list<boost::shared_ptr<Port> > PortList;
1568 .beginConstStdList <boost::shared_ptr<Port> > ("PortList")
1571 // used by Playlist::cut/copy
1572 .beginConstStdList <AudioRange> ("AudioRangeList")
1575 .beginConstStdList <Location*> ("LocationList")
1578 // std::list<boost::shared_ptr<AutomationControl> > ControlList;
1579 .beginStdList <boost::shared_ptr<AutomationControl> > ("ControlList")
1582 .beginPtrStdList <boost::shared_ptr<AutomationControl> > ("ControlListPtr")
1583 .addVoidPtrConstructor<std::list<boost::shared_ptr <AutomationControl> > > ()
1586 .beginStdList <boost::shared_ptr<Evoral::Note<Evoral::Beats> > > ("NotePtrList")
1589 .beginConstStdList <Evoral::ControlEvent*> ("EventList")
1592 #if 0 // depends on Evoal:: Note, Beats see note_fixer.h
1593 // typedef Evoral::Note<Evoral::Beats> Note;
1594 // std::set< boost::weak_ptr<Note> >
1595 .beginStdSet <boost::weak_ptr<Note> > ("WeakNoteSet")
1599 // std::list<boost::weak_ptr<Source> >
1600 .beginConstStdList <boost::weak_ptr<Source> > ("WeakSourceList")
1603 .beginClass <Tempo> ("Tempo")
1604 .addConstructor <void (*) (double, double, double)> ()
1605 .addFunction ("note_type", &Tempo::note_type)
1606 .addFunction ("note_types_per_minute", (double (Tempo::*)() const)&Tempo::note_types_per_minute)
1607 .addFunction ("quarter_notes_per_minute", &Tempo::quarter_notes_per_minute)
1608 .addFunction ("samples_per_quarter_note", &Tempo::samples_per_quarter_note)
1609 .addFunction ("samples_per_note_type", &Tempo::samples_per_note_type)
1612 .beginClass <Meter> ("Meter")
1613 .addConstructor <void (*) (double, double)> ()
1614 .addFunction ("divisions_per_bar", &Meter::divisions_per_bar)
1615 .addFunction ("note_divisor", &Meter::note_divisor)
1616 .addFunction ("samples_per_bar", &Meter::samples_per_bar)
1617 .addFunction ("samples_per_grid", &Meter::samples_per_grid)
1620 .beginClass <BeatsSamplesConverter> ("BeatsSamplesConverter")
1621 .addConstructor <void (*) (const TempoMap&, samplepos_t)> ()
1622 .addFunction ("to", &BeatsSamplesConverter::to)
1623 .addFunction ("from", &BeatsSamplesConverter::from)
1626 .beginClass <DoubleBeatsSamplesConverter> ("DoubleBeatsSamplesConverter")
1627 .addConstructor <void (*) (const TempoMap&, samplepos_t)> ()
1628 .addFunction ("to", &DoubleBeatsSamplesConverter::to)
1629 .addFunction ("from", &DoubleBeatsSamplesConverter::from)
1632 .beginClass <TempoMap> ("TempoMap")
1633 .addFunction ("add_tempo", &TempoMap::add_tempo)
1634 .addFunction ("add_meter", &TempoMap::add_meter)
1635 .addFunction ("tempo_section_at_frame", (TempoSection& (TempoMap::*)(samplepos_t))&TempoMap::tempo_section_at_sample)
1636 .addFunction ("tempo_section_at_frame", (const TempoSection& (TempoMap::*)(samplepos_t) const)&TempoMap::tempo_section_at_sample)
1637 .addFunction ("meter_section_at_frame", &TempoMap::meter_section_at_sample)
1638 .addFunction ("meter_section_at_beat", &TempoMap::meter_section_at_beat)
1639 .addFunction ("bbt_at_frame", &TempoMap::bbt_at_sample)
1640 .addFunction ("exact_beat_at_frame", &TempoMap::exact_beat_at_sample)
1641 .addFunction ("exact_qn_at_frame", &TempoMap::exact_qn_at_sample)
1642 .addFunction ("samplepos_plus_qn", &TempoMap::samplepos_plus_qn)
1643 .addFunction ("framewalk_to_qn", &TempoMap::framewalk_to_qn)
1646 .beginClass <MetricSection> ("MetricSection")
1647 .addFunction ("pulse", &MetricSection::pulse)
1648 .addFunction ("set_pulse", &MetricSection::set_pulse)
1651 .deriveClass <TempoSection, MetricSection> ("TempoSection")
1652 .addFunction ("c", (double(TempoSection::*)()const)&TempoSection::c)
1655 .deriveClass <MeterSection, MetricSection> ("MeterSection")
1656 .addCast<Meter> ("to_meter")
1657 .addFunction ("set_pulse", &MeterSection::set_pulse)
1658 .addFunction ("set_beat", (void(MeterSection::*)(double))&MeterSection::set_beat)
1661 .beginClass <ChanCount> ("ChanCount")
1662 .addConstructor <void (*) (DataType, uint32_t)> ()
1663 .addFunction ("get", &ChanCount::get)
1664 .addFunction ("set", &ChanCount::set)
1665 .addFunction ("n_audio", &ChanCount::n_audio)
1666 .addFunction ("n_midi", &ChanCount::n_midi)
1667 .addFunction ("n_total", &ChanCount::n_total)
1668 .addFunction ("reset", &ChanCount::reset)
1671 .beginClass <DataType> ("DataType")
1672 .addConstructor <void (*) (std::string)> ()
1673 .addStaticCFunction ("null", &LuaAPI::datatype_ctor_null) // "nil" is a lua reseved word
1674 .addStaticCFunction ("audio", &LuaAPI::datatype_ctor_audio)
1675 .addStaticCFunction ("midi", &LuaAPI::datatype_ctor_midi)
1676 .addFunction ("to_string", &DataType::to_string) // TODO Lua __tostring
1677 // TODO add uint32_t cast, add operator== !=
1680 /* libardour enums */
1681 .beginNamespace ("PluginType")
1682 .addConst ("AudioUnit", ARDOUR::PluginType(AudioUnit))
1683 .addConst ("LADSPA", ARDOUR::PluginType(LADSPA))
1684 .addConst ("LV2", ARDOUR::PluginType(LV2))
1685 .addConst ("Windows_VST", ARDOUR::PluginType(Windows_VST))
1686 .addConst ("LXVST", ARDOUR::PluginType(LXVST))
1687 .addConst ("Lua", ARDOUR::PluginType(Lua))
1690 .beginNamespace ("PresentationInfo")
1691 .beginNamespace ("Flag")
1692 .addConst ("AudioTrack", ARDOUR::PresentationInfo::Flag(PresentationInfo::AudioTrack))
1693 .addConst ("MidiTrack", ARDOUR::PresentationInfo::Flag(PresentationInfo::MidiTrack))
1694 .addConst ("AudioBus", ARDOUR::PresentationInfo::Flag(PresentationInfo::AudioBus))
1695 .addConst ("MidiBus", ARDOUR::PresentationInfo::Flag(PresentationInfo::MidiBus))
1696 .addConst ("VCA", ARDOUR::PresentationInfo::Flag(PresentationInfo::VCA))
1697 .addConst ("MasterOut", ARDOUR::PresentationInfo::Flag(PresentationInfo::MasterOut))
1698 .addConst ("MonitorOut", ARDOUR::PresentationInfo::Flag(PresentationInfo::MonitorOut))
1699 .addConst ("Auditioner", ARDOUR::PresentationInfo::Flag(PresentationInfo::Auditioner))
1700 .addConst ("Hidden", ARDOUR::PresentationInfo::Flag(PresentationInfo::Hidden))
1701 .addConst ("GroupOrderSet", ARDOUR::PresentationInfo::Flag(PresentationInfo::OrderSet))
1702 .addConst ("StatusMask", ARDOUR::PresentationInfo::Flag(PresentationInfo::StatusMask))
1706 .beginNamespace ("AutoState")
1707 .addConst ("Off", ARDOUR::AutoState(Off))
1708 .addConst ("Write", ARDOUR::AutoState(Write))
1709 .addConst ("Touch", ARDOUR::AutoState(Touch))
1710 .addConst ("Play", ARDOUR::AutoState(Play))
1711 .addConst ("Latch", ARDOUR::AutoState(Latch))
1714 .beginNamespace ("AutomationType")
1715 .addConst ("GainAutomation", ARDOUR::AutomationType(GainAutomation))
1716 .addConst ("PluginAutomation", ARDOUR::AutomationType(PluginAutomation))
1717 .addConst ("SoloAutomation", ARDOUR::AutomationType(SoloAutomation))
1718 .addConst ("SoloIsolateAutomation", ARDOUR::AutomationType(SoloIsolateAutomation))
1719 .addConst ("SoloSafeAutomation", ARDOUR::AutomationType(SoloSafeAutomation))
1720 .addConst ("MuteAutomation", ARDOUR::AutomationType(MuteAutomation))
1721 .addConst ("RecEnableAutomation", ARDOUR::AutomationType(RecEnableAutomation))
1722 .addConst ("RecSafeAutomation", ARDOUR::AutomationType(RecSafeAutomation))
1723 .addConst ("TrimAutomation", ARDOUR::AutomationType(TrimAutomation))
1724 .addConst ("PhaseAutomation", ARDOUR::AutomationType(PhaseAutomation))
1725 .addConst ("MidiCCAutomation", ARDOUR::AutomationType(MidiCCAutomation))
1726 .addConst ("MidiPgmChangeAutomation", ARDOUR::AutomationType(MidiPgmChangeAutomation))
1727 .addConst ("MidiPitchBenderAutomation", ARDOUR::AutomationType(MidiPitchBenderAutomation))
1728 .addConst ("MidiChannelPressureAutomation", ARDOUR::AutomationType(MidiChannelPressureAutomation))
1729 .addConst ("MidiNotePressureAutomation", ARDOUR::AutomationType(MidiNotePressureAutomation))
1730 .addConst ("MidiSystemExclusiveAutomation", ARDOUR::AutomationType(MidiSystemExclusiveAutomation))
1733 .beginNamespace ("SrcQuality")
1734 .addConst ("SrcBest", ARDOUR::SrcQuality(SrcBest))
1737 .beginNamespace ("MeterType")
1738 .addConst ("MeterMaxSignal", ARDOUR::MeterType(MeterMaxSignal))
1739 .addConst ("MeterMaxPeak", ARDOUR::MeterType(MeterMaxPeak))
1740 .addConst ("MeterPeak", ARDOUR::MeterType(MeterPeak))
1741 .addConst ("MeterKrms", ARDOUR::MeterType(MeterKrms))
1742 .addConst ("MeterK20", ARDOUR::MeterType(MeterK20))
1743 .addConst ("MeterK14", ARDOUR::MeterType(MeterK14))
1744 .addConst ("MeterIEC1DIN", ARDOUR::MeterType(MeterIEC1DIN))
1745 .addConst ("MeterIEC1NOR", ARDOUR::MeterType(MeterIEC1NOR))
1746 .addConst ("MeterIEC2BBC", ARDOUR::MeterType(MeterIEC2BBC))
1747 .addConst ("MeterIEC2EBU", ARDOUR::MeterType(MeterIEC2EBU))
1748 .addConst ("MeterVU", ARDOUR::MeterType(MeterVU))
1749 .addConst ("MeterK12", ARDOUR::MeterType(MeterK12))
1750 .addConst ("MeterPeak0dB", ARDOUR::MeterType(MeterPeak0dB))
1751 .addConst ("MeterMCP", ARDOUR::MeterType(MeterMCP))
1754 .beginNamespace ("MeterPoint")
1755 .addConst ("MeterInput", ARDOUR::MeterPoint(MeterInput))
1756 .addConst ("MeterPreFader", ARDOUR::MeterPoint(MeterPreFader))
1757 .addConst ("MeterPostFader", ARDOUR::MeterPoint(MeterPostFader))
1758 .addConst ("MeterOutput", ARDOUR::MeterPoint(MeterOutput))
1759 .addConst ("MeterCustom", ARDOUR::MeterPoint(MeterCustom))
1762 .beginNamespace ("Placement")
1763 .addConst ("PreFader", ARDOUR::Placement(PreFader))
1764 .addConst ("PostFader", ARDOUR::Placement(PostFader))
1767 .beginNamespace ("MonitorChoice")
1768 .addConst ("MonitorAuto", ARDOUR::MonitorChoice(MonitorAuto))
1769 .addConst ("MonitorInput", ARDOUR::MonitorChoice(MonitorInput))
1770 .addConst ("MonitorDisk", ARDOUR::MonitorChoice(MonitorDisk))
1771 .addConst ("MonitorCue", ARDOUR::MonitorChoice(MonitorCue))
1774 .beginNamespace ("NoteMode")
1775 .addConst ("Sustained", ARDOUR::NoteMode(Sustained))
1776 .addConst ("Percussive", ARDOUR::NoteMode(Percussive))
1779 .beginNamespace ("PortFlags")
1780 .addConst ("IsInput", ARDOUR::PortFlags(IsInput))
1781 .addConst ("IsOutput", ARDOUR::PortFlags(IsOutput))
1782 .addConst ("IsPhysical", ARDOUR::PortFlags(IsPhysical))
1783 .addConst ("CanMonitor", ARDOUR::PortFlags(CanMonitor))
1784 .addConst ("IsTerminal", ARDOUR::PortFlags(IsTerminal))
1787 .beginNamespace ("MidiPortFlags")
1788 .addConst ("MidiPortMusic", ARDOUR::MidiPortFlags(MidiPortMusic))
1789 .addConst ("MidiPortControl", ARDOUR::MidiPortFlags(MidiPortControl))
1790 .addConst ("MidiPortSelection", ARDOUR::MidiPortFlags(MidiPortSelection))
1791 .addConst ("MidiPortVirtual", ARDOUR::MidiPortFlags(MidiPortVirtual))
1794 .beginNamespace ("PlaylistDisposition")
1795 .addConst ("CopyPlaylist", ARDOUR::PlaylistDisposition(CopyPlaylist))
1796 .addConst ("NewPlaylist", ARDOUR::PlaylistDisposition(NewPlaylist))
1797 .addConst ("SharePlaylist", ARDOUR::PlaylistDisposition(SharePlaylist))
1800 .beginNamespace ("MidiTrackNameSource")
1801 .addConst ("SMFTrackNumber", ARDOUR::MidiTrackNameSource(SMFTrackNumber))
1802 .addConst ("SMFTrackName", ARDOUR::MidiTrackNameSource(SMFTrackName))
1803 .addConst ("SMFInstrumentName", ARDOUR::MidiTrackNameSource(SMFInstrumentName))
1806 .beginNamespace ("MidiTempoMapDisposition")
1807 .addConst ("SMFTempoIgnore", ARDOUR::MidiTempoMapDisposition(SMFTempoIgnore))
1808 .addConst ("SMFTempoUse", ARDOUR::MidiTempoMapDisposition(SMFTempoUse))
1811 .beginNamespace ("RegionPoint")
1812 .addConst ("Start", ARDOUR::RegionPoint(Start))
1813 .addConst ("End", ARDOUR::RegionPoint(End))
1814 .addConst ("SyncPoint", ARDOUR::RegionPoint(SyncPoint))
1817 .beginNamespace ("TempoSection")
1818 .beginNamespace ("PositionLockStyle")
1819 .addConst ("AudioTime", ARDOUR::PositionLockStyle(AudioTime))
1820 .addConst ("MusicTime", ARDOUR::PositionLockStyle(MusicTime))
1824 .beginNamespace ("TempoSection")
1825 .beginNamespace ("Type")
1826 .addConst ("Ramp", ARDOUR::TempoSection::Type(TempoSection::Ramp))
1827 .addConst ("Constant", ARDOUR::TempoSection::Type(TempoSection::Constant))
1831 .beginNamespace ("TrackMode")
1832 .addConst ("Normal", ARDOUR::TrackMode(Start))
1833 .addConst ("NonLayered", ARDOUR::TrackMode(NonLayered))
1834 .addConst ("Destructive", ARDOUR::TrackMode(Destructive))
1837 .beginNamespace ("SampleFormat")
1838 .addConst ("Float", ARDOUR::SampleFormat(FormatFloat))
1839 .addConst ("Int24", ARDOUR::SampleFormat(FormatInt24))
1840 .addConst ("Int16", ARDOUR::SampleFormat(FormatInt16))
1843 .beginNamespace ("HeaderFormat")
1844 .addConst ("BWF", ARDOUR::HeaderFormat(BWF))
1845 .addConst ("WAVE", ARDOUR::HeaderFormat(WAVE))
1846 .addConst ("WAVE64", ARDOUR::HeaderFormat(WAVE64))
1847 .addConst ("CAF", ARDOUR::HeaderFormat(CAF))
1848 .addConst ("AIFF", ARDOUR::HeaderFormat(AIFF))
1849 .addConst ("iXML", ARDOUR::HeaderFormat(iXML))
1850 .addConst ("RF64", ARDOUR::HeaderFormat(RF64))
1851 .addConst ("RF64_WAV", ARDOUR::HeaderFormat(RF64_WAV))
1852 .addConst ("MBWF", ARDOUR::HeaderFormat(MBWF))
1855 .beginNamespace ("InsertMergePolicy")
1856 .addConst ("Reject", ARDOUR::InsertMergePolicy(InsertMergeReject))
1857 .addConst ("Relax", ARDOUR::InsertMergePolicy(InsertMergeRelax))
1858 .addConst ("Replace", ARDOUR::InsertMergePolicy(InsertMergeReplace))
1859 .addConst ("TruncateExisting", ARDOUR::InsertMergePolicy(InsertMergeTruncateExisting))
1860 .addConst ("TruncateAddition", ARDOUR::InsertMergePolicy(InsertMergeTruncateAddition))
1861 .addConst ("Extend", ARDOUR::InsertMergePolicy(InsertMergeExtend))
1864 .beginNamespace ("AFLPosition")
1865 .addConst ("AFLFromBeforeProcessors", ARDOUR::AFLPosition(AFLFromBeforeProcessors))
1866 .addConst ("AFLFromAfterProcessors", ARDOUR::AFLPosition(AFLFromAfterProcessors))
1869 .beginNamespace ("PFLPosition")
1870 .addConst ("PFLFromBeforeProcessors", ARDOUR::PFLPosition(PFLFromBeforeProcessors))
1871 .addConst ("PFLFromAfterProcessors", ARDOUR::PFLPosition(PFLFromAfterProcessors))
1874 .beginNamespace ("AutoReturnTarget")
1875 .addConst ("LastLocate", ARDOUR::AutoReturnTarget(LastLocate))
1876 .addConst ("RangeSelectionStart", ARDOUR::AutoReturnTarget(RangeSelectionStart))
1877 .addConst ("Loop", ARDOUR::AutoReturnTarget(Loop))
1878 .addConst ("RegionSelectionStart", ARDOUR::AutoReturnTarget(RegionSelectionStart))
1881 .beginNamespace ("FadeShape")
1882 .addConst ("FadeLinear", ARDOUR::FadeShape(FadeLinear))
1883 .addConst ("FadeFast", ARDOUR::FadeShape(FadeFast))
1884 .addConst ("FadeSlow", ARDOUR::FadeShape(FadeSlow))
1885 .addConst ("FadeConstantPower", ARDOUR::FadeShape(FadeConstantPower))
1886 .addConst ("FadeSymmetric", ARDOUR::FadeShape(FadeSymmetric))
1889 .beginNamespace ("DenormalModel")
1890 .addConst ("DenormalNone", ARDOUR::DenormalModel(DenormalNone))
1891 .addConst ("DenormalFTZ", ARDOUR::DenormalModel(DenormalFTZ))
1892 .addConst ("DenormalDAZ", ARDOUR::DenormalModel(DenormalDAZ))
1893 .addConst ("DenormalFTZDAZ", ARDOUR::DenormalModel(DenormalFTZDAZ))
1896 .beginNamespace ("BufferingPreset")
1897 .addConst ("Small", ARDOUR::BufferingPreset(Small))
1898 .addConst ("Medium", ARDOUR::BufferingPreset(Medium))
1899 .addConst ("Large", ARDOUR::BufferingPreset(Large))
1900 .addConst ("Custom", ARDOUR::BufferingPreset(Custom))
1903 .beginNamespace ("EditMode")
1904 .addConst ("Slide", ARDOUR::EditMode(Slide))
1905 .addConst ("Splice", ARDOUR::EditMode(Splice))
1906 .addConst ("Ripple", ARDOUR::EditMode(Ripple))
1907 .addConst ("Lock", ARDOUR::EditMode(Lock))
1910 .beginNamespace ("AutoConnectOption")
1911 .addConst ("ManualConnect", ARDOUR::AutoConnectOption(ManualConnect))
1912 .addConst ("AutoConnectPhysical", ARDOUR::AutoConnectOption(AutoConnectPhysical))
1913 .addConst ("AutoConnectMaster", ARDOUR::AutoConnectOption(AutoConnectMaster))
1916 .beginNamespace ("LayerModel")
1917 .addConst ("LaterHigher", ARDOUR::LayerModel(LaterHigher))
1918 .addConst ("Manual", ARDOUR::LayerModel(Manual))
1921 .beginNamespace ("ListenPosition")
1922 .addConst ("AfterFaderListen", ARDOUR::ListenPosition(AfterFaderListen))
1923 .addConst ("PreFaderListen", ARDOUR::ListenPosition(PreFaderListen))
1926 .beginNamespace ("MonitorModel")
1927 .addConst ("HardwareMonitoring", ARDOUR::MonitorModel(HardwareMonitoring))
1928 .addConst ("SoftwareMonitoring", ARDOUR::MonitorModel(SoftwareMonitoring))
1929 .addConst ("ExternalMonitoring", ARDOUR::MonitorModel(ExternalMonitoring))
1932 .beginNamespace ("RegionSelectionAfterSplit")
1933 .addConst ("None", ARDOUR::RegionSelectionAfterSplit(None))
1934 .addConst ("NewlyCreatedLeft", ARDOUR::RegionSelectionAfterSplit(NewlyCreatedLeft))
1935 .addConst ("NewlyCreatedRight", ARDOUR::RegionSelectionAfterSplit(NewlyCreatedRight))
1936 .addConst ("NewlyCreatedBoth", ARDOUR::RegionSelectionAfterSplit(NewlyCreatedBoth))
1937 .addConst ("Existing", ARDOUR::RegionSelectionAfterSplit(Existing))
1938 .addConst ("ExistingNewlyCreatedLeft", ARDOUR::RegionSelectionAfterSplit(ExistingNewlyCreatedLeft))
1939 .addConst ("ExistingNewlyCreatedRight", ARDOUR::RegionSelectionAfterSplit(ExistingNewlyCreatedRight))
1940 .addConst ("ExistingNewlyCreatedBoth", ARDOUR::RegionSelectionAfterSplit(ExistingNewlyCreatedBoth))
1943 .beginNamespace ("ShuttleBehaviour")
1944 .addConst ("Sprung", ARDOUR::ShuttleBehaviour(Sprung))
1945 .addConst ("Wheel", ARDOUR::ShuttleBehaviour(Wheel))
1948 .beginNamespace ("ShuttleUnits")
1949 .addConst ("Percentage", ARDOUR::ShuttleUnits(Percentage))
1950 .addConst ("Semitones", ARDOUR::ShuttleUnits(Semitones))
1953 .beginNamespace ("SyncSource")
1954 .addConst ("Engine", ARDOUR::SyncSource(Engine))
1955 .addConst ("MTC", ARDOUR::SyncSource(MTC))
1956 .addConst ("MIDIClock", ARDOUR::SyncSource(MIDIClock))
1957 .addConst ("LTC", ARDOUR::SyncSource(LTC))
1960 .beginNamespace ("TracksAutoNamingRule")
1961 .addConst ("UseDefaultNames", ARDOUR::TracksAutoNamingRule(UseDefaultNames))
1962 .addConst ("NameAfterDriver", ARDOUR::TracksAutoNamingRule(NameAfterDriver))
1965 .endNamespace (); // end ARDOUR
1967 luabridge::getGlobalNamespace (L)
1968 .beginNamespace ("ARDOUR")
1969 .beginClass <AudioBackendInfo> ("AudioBackendInfo")
1970 .addData ("name", &AudioBackendInfo::name)
1972 .beginConstStdVector <const AudioBackendInfo*> ("BackendVector").endClass ()
1974 .beginClass <AudioBackend::DeviceStatus> ("DeviceStatus")
1975 .addData ("name", &AudioBackend::DeviceStatus::name)
1976 .addData ("available", &AudioBackend::DeviceStatus::available)
1978 .beginStdVector <AudioBackend::DeviceStatus> ("DeviceStatusVector").endClass ()
1980 .beginWSPtrClass <AudioBackend> ("AudioBackend")
1981 .addFunction ("info", &AudioBackend::info)
1982 .addFunction ("sample_rate", &AudioBackend::sample_rate)
1983 .addFunction ("buffer_size", &AudioBackend::buffer_size)
1984 .addFunction ("period_size", &AudioBackend::period_size)
1985 .addFunction ("input_channels", &AudioBackend::input_channels)
1986 .addFunction ("output_channels", &AudioBackend::output_channels)
1987 .addFunction ("dsp_load", &AudioBackend::dsp_load)
1989 .addFunction ("set_sample_rate", &AudioBackend::set_sample_rate)
1990 .addFunction ("set_buffer_size", &AudioBackend::set_buffer_size)
1991 .addFunction ("set_peridod_size", &AudioBackend::set_peridod_size)
1993 .addFunction ("enumerate_drivers", &AudioBackend::enumerate_drivers)
1994 .addFunction ("driver_name", &AudioBackend::driver_name)
1995 .addFunction ("set_driver", &AudioBackend::set_driver)
1997 .addFunction ("use_separate_input_and_output_devices", &AudioBackend::use_separate_input_and_output_devices)
1998 .addFunction ("enumerate_devices", &AudioBackend::enumerate_devices)
1999 .addFunction ("enumerate_input_devices", &AudioBackend::enumerate_input_devices)
2000 .addFunction ("enumerate_output_devices", &AudioBackend::enumerate_output_devices)
2001 .addFunction ("device_name", &AudioBackend::device_name)
2002 .addFunction ("input_device_name", &AudioBackend::input_device_name)
2003 .addFunction ("output_device_name", &AudioBackend::output_device_name)
2004 .addFunction ("set_device_name", &AudioBackend::set_device_name)
2005 .addFunction ("set_input_device_name", &AudioBackend::set_input_device_name)
2006 .addFunction ("set_output_device_name", &AudioBackend::set_output_device_name)
2009 .beginClass <PortEngine> ("PortEngine")
2012 .beginClass <PortManager> ("PortManager")
2013 .addFunction ("port_engine", &PortManager::port_engine)
2014 .addFunction ("connected", &PortManager::connected)
2015 .addFunction ("connect", &PortManager::connect)
2016 .addFunction ("physically_connected", &PortManager::physically_connected)
2017 .addFunction ("disconnect", (int (PortManager::*)(const std::string&, const std::string&))&PortManager::disconnect)
2018 .addFunction ("disconnect_port", (int (PortManager::*)(boost::shared_ptr<Port>))&PortManager::disconnect)
2019 .addFunction ("get_port_by_name", &PortManager::get_port_by_name)
2020 .addFunction ("get_pretty_name_by_name", &PortManager::get_pretty_name_by_name)
2021 .addFunction ("port_is_physical", &PortManager::port_is_physical)
2022 .addFunction ("get_physical_outputs", &PortManager::get_physical_outputs)
2023 .addFunction ("get_physical_inputs", &PortManager::get_physical_inputs)
2024 .addFunction ("n_physical_outputs", &PortManager::n_physical_outputs)
2025 .addFunction ("n_physical_inputs", &PortManager::n_physical_inputs)
2026 .addRefFunction ("get_connections", &PortManager::get_connections)
2027 .addRefFunction ("get_ports", (int (PortManager::*)(DataType, PortManager::PortList&))&PortManager::get_ports)
2028 .addRefFunction ("get_backend_ports", (int (PortManager::*)(const std::string&, DataType, PortFlags, std::vector<std::string>&))&PortManager::get_ports)
2031 .deriveClass <AudioEngine, PortManager> ("AudioEngine")
2032 .addFunction ("available_backends", &AudioEngine::available_backends)
2033 .addFunction ("current_backend_name", &AudioEngine::current_backend_name)
2034 .addFunction ("set_backend", &AudioEngine::set_backend)
2035 .addFunction ("setup_required", &AudioEngine::setup_required)
2036 .addFunction ("start", &AudioEngine::start)
2037 .addFunction ("stop", &AudioEngine::stop)
2038 .addFunction ("get_dsp_load", &AudioEngine::get_dsp_load)
2039 .addFunction ("set_device_name", &AudioEngine::set_device_name)
2040 .addFunction ("set_sample_rate", &AudioEngine::set_sample_rate)
2041 .addFunction ("set_buffer_size", &AudioEngine::set_buffer_size)
2042 .addFunction ("get_last_backend_error", &AudioEngine::get_last_backend_error)
2045 .deriveClass <VCAManager, PBD::StatefulDestructible> ("VCAManager")
2046 .addFunction ("create_vca", &VCAManager::create_vca)
2047 .addFunction ("remove_vca", &VCAManager::remove_vca)
2048 .addFunction ("vca_by_number", &VCAManager::vca_by_number)
2049 .addFunction ("vca_by_name", &VCAManager::vca_by_name)
2050 .addFunction ("vcas", &VCAManager::vcas)
2051 .addFunction ("n_vcas", &VCAManager::n_vcas)
2054 .deriveClass <RCConfiguration, PBD::Configuration> ("RCConfiguration")
2055 #undef CONFIG_VARIABLE
2056 #undef CONFIG_VARIABLE_SPECIAL
2057 #define CONFIG_VARIABLE(Type,var,name,value) \
2058 .addFunction ("get_" # var, &RCConfiguration::get_##var) \
2059 .addFunction ("set_" # var, &RCConfiguration::set_##var) \
2060 .addProperty (#var, &RCConfiguration::get_##var, &RCConfiguration::set_##var)
2062 #define CONFIG_VARIABLE_SPECIAL(Type,var,name,value,mutator) \
2063 .addFunction ("get_" # var, &RCConfiguration::get_##var) \
2064 .addFunction ("set_" # var, &RCConfiguration::set_##var) \
2065 .addProperty (#var, &RCConfiguration::get_##var, &RCConfiguration::set_##var)
2067 #include "ardour/rc_configuration_vars.h"
2069 #undef CONFIG_VARIABLE
2070 #undef CONFIG_VARIABLE_SPECIAL
2073 .deriveClass <SessionConfiguration, PBD::Configuration> ("SessionConfiguration")
2074 #undef CONFIG_VARIABLE
2075 #undef CONFIG_VARIABLE_SPECIAL
2076 #define CONFIG_VARIABLE(Type,var,name,value) \
2077 .addFunction ("get_" # var, &SessionConfiguration::get_##var) \
2078 .addFunction ("set_" # var, &SessionConfiguration::set_##var) \
2079 .addProperty (#var, &SessionConfiguration::get_##var, &SessionConfiguration::set_##var)
2081 #define CONFIG_VARIABLE_SPECIAL(Type,var,name,value,mutator) \
2082 .addFunction ("get_" # var, &SessionConfiguration::get_##var) \
2083 .addFunction ("set_" # var, &SessionConfiguration::set_##var) \
2084 .addProperty (#var, &SessionConfiguration::get_##var, &SessionConfiguration::set_##var)
2086 #include "ardour/session_configuration_vars.h"
2088 #undef CONFIG_VARIABLE
2089 #undef CONFIG_VARIABLE_SPECIAL
2092 // we could use addProperty ()
2093 .addFunction ("config", &_libardour_config)
2097 // basic representation of Session
2098 // functions which can be used from realtime and non-realtime contexts
2099 luabridge::getGlobalNamespace (L)
2100 .beginNamespace ("ARDOUR")
2101 .beginClass <Session> ("Session")
2102 .addFunction ("scripts_changed", &Session::scripts_changed) // used internally
2103 .addFunction ("transport_rolling", &Session::transport_rolling)
2104 .addFunction ("request_transport_speed", &Session::request_transport_speed)
2105 .addFunction ("transport_frame", &Session::transport_sample)
2106 .addFunction ("transport_speed", &Session::transport_speed)
2107 .addFunction ("sample_rate", &Session::sample_rate)
2108 .addFunction ("nominal_sample_rate", &Session::nominal_sample_rate)
2109 .addFunction ("samples_per_timecode_frame", &Session::samples_per_timecode_frame)
2110 .addFunction ("timecode_frames_per_hour", &Session::timecode_frames_per_hour)
2111 .addFunction ("timecode_frames_per_second", &Session::timecode_frames_per_second)
2112 .addFunction ("timecode_drop_frames", &Session::timecode_drop_frames)
2113 .addFunction ("request_locate", &Session::request_locate)
2114 .addFunction ("request_stop", &Session::request_stop)
2115 .addFunction ("request_play_loop", &Session::request_play_loop)
2116 .addFunction ("get_play_loop", &Session::get_play_loop)
2117 .addFunction ("last_transport_start", &Session::last_transport_start)
2118 .addFunction ("goto_start", &Session::goto_start)
2119 .addFunction ("goto_end", &Session::goto_end)
2120 .addFunction ("current_start_frame", &Session::current_start_sample)
2121 .addFunction ("current_end_frame", &Session::current_end_sample)
2122 .addFunction ("actively_recording", &Session::actively_recording)
2123 .addFunction ("new_audio_track", &Session::new_audio_track)
2124 .addFunction ("new_audio_route", &Session::new_audio_route)
2125 .addFunction ("new_midi_track", &Session::new_midi_track)
2126 .addFunction ("new_midi_route", &Session::new_midi_route)
2128 .addFunction ("add_master_bus", &Session::add_master_bus)
2129 .addFunction ("add_monitor_section", &Session::add_monitor_section)
2130 .addFunction ("remove_monitor_section", &Session::remove_monitor_section)
2132 .addFunction ("get_routes", &Session::get_routes)
2133 .addFunction ("get_tracks", &Session::get_tracks)
2134 .addFunction ("get_stripables", (StripableList (Session::*)() const)&Session::get_stripables)
2135 .addFunction ("name", &Session::name)
2136 .addFunction ("path", &Session::path)
2137 .addFunction ("record_status", &Session::record_status)
2138 .addFunction ("maybe_enable_record", &Session::maybe_enable_record)
2139 .addFunction ("disable_record", &Session::disable_record)
2140 .addFunction ("route_by_id", &Session::route_by_id)
2141 .addFunction ("route_by_name", &Session::route_by_name)
2142 .addFunction ("get_remote_nth_stripable", &Session::get_remote_nth_stripable)
2143 .addFunction ("get_remote_nth_route", &Session::get_remote_nth_route)
2144 .addFunction ("route_by_selected_count", &Session::route_by_selected_count)
2145 .addFunction ("source_by_id", &Session::source_by_id)
2146 .addFunction ("controllable_by_id", &Session::controllable_by_id)
2147 .addFunction ("processor_by_id", &Session::processor_by_id)
2148 .addFunction ("snap_name", &Session::snap_name)
2149 .addFunction ("monitor_out", &Session::monitor_out)
2150 .addFunction ("master_out", &Session::master_out)
2151 .addFunction ("add_internal_sends", &Session::add_internal_sends)
2152 .addFunction ("tempo_map", (TempoMap& (Session::*)())&Session::tempo_map)
2153 .addFunction ("locations", &Session::locations)
2154 .addFunction ("soloing", &Session::soloing)
2155 .addFunction ("listening", &Session::listening)
2156 .addFunction ("solo_isolated", &Session::solo_isolated)
2157 .addFunction ("cancel_all_solo", &Session::cancel_all_solo)
2158 .addFunction ("clear_all_solo_state", &Session::clear_all_solo_state)
2159 .addFunction ("set_controls", &Session::set_controls)
2160 .addFunction ("set_control", &Session::set_control)
2161 .addFunction ("set_exclusive_input_active", &Session::set_exclusive_input_active)
2162 .addFunction ("begin_reversible_command", (void (Session::*)(const std::string&))&Session::begin_reversible_command)
2163 .addFunction ("commit_reversible_command", &Session::commit_reversible_command)
2164 .addFunction ("abort_reversible_command", &Session::abort_reversible_command)
2165 .addFunction ("add_command", &Session::add_command)
2166 .addFunction ("add_stateful_diff_command", &Session::add_stateful_diff_command)
2167 .addFunction ("engine", (AudioEngine& (Session::*)())&Session::engine)
2168 .addFunction ("get_block_size", &Session::get_block_size)
2169 .addFunction ("worst_output_latency", &Session::worst_output_latency)
2170 .addFunction ("worst_input_latency", &Session::worst_input_latency)
2171 .addFunction ("worst_track_latency", &Session::worst_track_latency)
2172 .addFunction ("worst_track_roll_delay", &Session::worst_track_roll_delay)
2173 .addFunction ("worst_track_out_latency", &Session::worst_track_out_latency)
2174 .addFunction ("worst_playback_latency", &Session::worst_playback_latency)
2175 .addFunction ("cfg", &Session::cfg)
2176 .addFunction ("route_groups", &Session::route_groups)
2177 .addFunction ("new_route_group", &Session::new_route_group)
2178 .addFunction ("end_is_free", &Session::end_is_free)
2179 .addFunction ("set_end_is_free", &Session::set_end_is_free)
2180 .addFunction ("remove_route_group", (void (Session::*)(RouteGroup*))&Session::remove_route_group)
2181 .addFunction ("vca_manager", &Session::vca_manager_ptr)
2182 .addExtCFunction ("timecode_to_sample_lua", ARDOUR::LuaAPI::timecode_to_sample_lua)
2183 .addExtCFunction ("sample_to_timecode_lua", ARDOUR::LuaAPI::sample_to_timecode_lua)
2186 .beginClass <RegionFactory> ("RegionFactory")
2187 .addStaticFunction ("region_by_id", &RegionFactory::region_by_id)
2188 .addStaticFunction ("regions", &RegionFactory::regions)
2189 .addStaticFunction ("clone_region", static_cast<boost::shared_ptr<Region> (*)(boost::shared_ptr<Region>, bool, bool)>(&RegionFactory::create))
2192 /* session enums (rt-safe, common) */
2193 .beginNamespace ("Session")
2195 .beginNamespace ("RecordState")
2196 .addConst ("Disabled", ARDOUR::Session::RecordState(Session::Disabled))
2197 .addConst ("Enabled", ARDOUR::Session::RecordState(Session::Enabled))
2198 .addConst ("Recording", ARDOUR::Session::RecordState(Session::Recording))
2201 .endNamespace () // end Session enums
2203 /* ardour enums (rt-safe, common) */
2204 .beginNamespace ("LocationFlags")
2205 .addConst ("IsMark", ARDOUR::Location::Flags(Location::IsMark))
2206 .addConst ("IsAutoPunch", ARDOUR::Location::Flags(Location::IsAutoPunch))
2207 .addConst ("IsAutoLoop", ARDOUR::Location::Flags(Location::IsAutoLoop))
2208 .addConst ("IsHidden", ARDOUR::Location::Flags(Location::IsHidden))
2209 .addConst ("IsCDMarker", ARDOUR::Location::Flags(Location::IsCDMarker))
2210 .addConst ("IsRangeMarker", ARDOUR::Location::Flags(Location::IsRangeMarker))
2211 .addConst ("IsSessionRange", ARDOUR::Location::Flags(Location::IsSessionRange))
2212 .addConst ("IsSkip", ARDOUR::Location::Flags(Location::IsSkip))
2213 .addConst ("IsSkipping", ARDOUR::Location::Flags(Location::IsSkipping))
2216 .beginNamespace ("LuaAPI")
2217 .addFunction ("nil_proc", ARDOUR::LuaAPI::nil_processor)
2218 .addFunction ("new_luaproc", ARDOUR::LuaAPI::new_luaproc)
2219 .addFunction ("new_plugin_info", ARDOUR::LuaAPI::new_plugin_info)
2220 .addFunction ("new_plugin", ARDOUR::LuaAPI::new_plugin)
2221 .addFunction ("set_processor_param", ARDOUR::LuaAPI::set_processor_param)
2222 .addFunction ("set_plugin_insert_param", ARDOUR::LuaAPI::set_plugin_insert_param)
2223 .addFunction ("reset_processor_to_default", ARDOUR::LuaAPI::reset_processor_to_default)
2224 .addRefFunction ("get_processor_param", ARDOUR::LuaAPI::get_processor_param)
2225 .addRefFunction ("get_plugin_insert_param", ARDOUR::LuaAPI::get_plugin_insert_param)
2226 .addCFunction ("plugin_automation", ARDOUR::LuaAPI::plugin_automation)
2227 .addCFunction ("hsla_to_rgba", ARDOUR::LuaAPI::hsla_to_rgba)
2228 .addCFunction ("color_to_rgba", ARDOUR::LuaAPI::color_to_rgba)
2229 .addFunction ("usleep", Glib::usleep)
2230 .addFunction ("monotonic_time", ::g_get_monotonic_time)
2231 .addCFunction ("build_filename", ARDOUR::LuaAPI::build_filename)
2232 .addFunction ("new_noteptr", ARDOUR::LuaAPI::new_noteptr)
2233 .addFunction ("note_list", ARDOUR::LuaAPI::note_list)
2234 .addCFunction ("sample_to_timecode", ARDOUR::LuaAPI::sample_to_timecode)
2235 .addCFunction ("timecode_to_sample", ARDOUR::LuaAPI::timecode_to_sample)
2237 .beginClass <ARDOUR::LuaAPI::Vamp> ("Vamp")
2238 .addConstructor <void (*) (const std::string&, float)> ()
2239 .addStaticFunction ("list_plugins", &ARDOUR::LuaAPI::Vamp::list_plugins)
2240 .addFunction ("plugin", &ARDOUR::LuaAPI::Vamp::plugin)
2241 .addFunction ("analyze", &ARDOUR::LuaAPI::Vamp::analyze)
2242 .addFunction ("reset", &ARDOUR::LuaAPI::Vamp::reset)
2243 .addFunction ("initialize", &ARDOUR::LuaAPI::Vamp::initialize)
2244 .addFunction ("process", &ARDOUR::LuaAPI::Vamp::process)
2247 .endNamespace () // end LuaAPI
2248 .endNamespace ();// end ARDOUR
2251 luabridge::getGlobalNamespace (L)
2252 .beginNamespace ("ARDOUR")
2253 .beginNamespace ("DSP")
2254 .addFunction ("compute_peak", ARDOUR::compute_peak)
2255 .addFunction ("find_peaks", ARDOUR::find_peaks)
2256 .addFunction ("apply_gain_to_buffer", ARDOUR::apply_gain_to_buffer)
2257 .addFunction ("mix_buffers_no_gain", ARDOUR::mix_buffers_no_gain)
2258 .addFunction ("mix_buffers_with_gain", ARDOUR::mix_buffers_with_gain)
2259 .addFunction ("copy_vector", ARDOUR::copy_vector)
2260 .addFunction ("dB_to_coefficient", &dB_to_coefficient)
2261 .addFunction ("fast_coefficient_to_dB", &fast_coefficient_to_dB)
2262 .addFunction ("accurate_coefficient_to_dB", &accurate_coefficient_to_dB)
2263 .addFunction ("memset", &DSP::memset)
2264 .addFunction ("mmult", &DSP::mmult)
2265 .addFunction ("log_meter", &DSP::log_meter)
2266 .addFunction ("log_meter_coeff", &DSP::log_meter_coeff)
2267 .addFunction ("process_map", &DSP::process_map)
2268 .addRefFunction ("peaks", &DSP::peaks)
2270 .beginClass <DSP::LowPass> ("LowPass")
2271 .addConstructor <void (*) (double, float)> ()
2272 .addFunction ("proc", &DSP::LowPass::proc)
2273 .addFunction ("ctrl", &DSP::LowPass::ctrl)
2274 .addFunction ("set_cutoff", &DSP::LowPass::set_cutoff)
2275 .addFunction ("reset", &DSP::LowPass::reset)
2277 .beginClass <DSP::Biquad> ("Biquad")
2278 .addConstructor <void (*) (double)> ()
2279 .addFunction ("run", &DSP::Biquad::run)
2280 .addFunction ("compute", &DSP::Biquad::compute)
2281 .addFunction ("configure", &DSP::Biquad::configure)
2282 .addFunction ("reset", &DSP::Biquad::reset)
2283 .addFunction ("dB_at_freq", &DSP::Biquad::dB_at_freq)
2285 .beginClass <DSP::FFTSpectrum> ("FFTSpectrum")
2286 .addConstructor <void (*) (uint32_t, double)> ()
2287 .addFunction ("set_data_hann", &DSP::FFTSpectrum::set_data_hann)
2288 .addFunction ("execute", &DSP::FFTSpectrum::execute)
2289 .addFunction ("power_at_bin", &DSP::FFTSpectrum::power_at_bin)
2290 .addFunction ("freq_at_bin", &DSP::FFTSpectrum::freq_at_bin)
2294 .beginNamespace ("BiquadType")
2295 .addConst ("LowPass", ARDOUR::DSP::Biquad::LowPass)
2296 .addConst ("HighPass", ARDOUR::DSP::Biquad::HighPass)
2297 .addConst ("BandPassSkirt", ARDOUR::DSP::Biquad::BandPassSkirt)
2298 .addConst ("BandPass0dB", ARDOUR::DSP::Biquad::BandPass0dB)
2299 .addConst ("Notch", ARDOUR::DSP::Biquad::Notch)
2300 .addConst ("AllPass", ARDOUR::DSP::Biquad::AllPass)
2301 .addConst ("Peaking", ARDOUR::DSP::Biquad::Peaking)
2302 .addConst ("LowShelf", ARDOUR::DSP::Biquad::LowShelf)
2303 .addConst ("HighShelf", ARDOUR::DSP::Biquad::HighShelf)
2306 .beginClass <DSP::DspShm> ("DspShm")
2307 .addConstructor<void (*) (size_t)> ()
2308 .addFunction ("allocate", &DSP::DspShm::allocate)
2309 .addFunction ("clear", &DSP::DspShm::clear)
2310 .addFunction ("to_float", &DSP::DspShm::to_float)
2311 .addFunction ("to_int", &DSP::DspShm::to_int)
2312 .addFunction ("atomic_set_int", &DSP::DspShm::atomic_set_int)
2313 .addFunction ("atomic_get_int", &DSP::DspShm::atomic_get_int)
2316 .endNamespace () // DSP
2317 .endNamespace ();// end ARDOUR
2321 LuaBindings::dsp (lua_State* L)
2323 luabridge::getGlobalNamespace (L)
2324 .beginNamespace ("ARDOUR")
2326 .beginClass <AudioBuffer> ("AudioBuffer")
2328 .addFunction ("data", (Sample*(AudioBuffer::*)(samplecnt_t))&AudioBuffer::data)
2329 .addFunction ("silence", &AudioBuffer::silence)
2330 .addFunction ("apply_gain", &AudioBuffer::apply_gain)
2331 .addFunction ("check_silence", &AudioBuffer::check_silence)
2332 .addFunction ("read_from", (void (AudioBuffer::*)(const Sample*, samplecnt_t, samplecnt_t, samplecnt_t))&AudioBuffer::check_silence)
2335 .beginClass <MidiBuffer> ("MidiBuffer")
2337 .addFunction ("silence", &MidiBuffer::silence)
2338 .addFunction ("size", &MidiBuffer::size)
2339 .addFunction ("empty", &MidiBuffer::empty)
2340 .addFunction ("resize", &MidiBuffer::resize)
2341 .addFunction ("copy", (void (MidiBuffer::*)(MidiBuffer const * const))&MidiBuffer::copy)
2342 .addFunction ("push_event", (bool (MidiBuffer::*)(const Evoral::Event<samplepos_t>&))&MidiBuffer::push_back)
2343 .addFunction ("push_back", (bool (MidiBuffer::*)(samplepos_t, size_t, const uint8_t*))&MidiBuffer::push_back)
2345 .addExtCFunction ("table", &luabridge::CFunc::listToTable<const Evoral::Event<samplepos_t>, MidiBuffer>)
2348 .beginClass <BufferSet> ("BufferSet")
2350 .addFunction ("get_audio", static_cast<AudioBuffer&(BufferSet::*)(size_t)>(&BufferSet::get_audio))
2351 .addFunction ("get_midi", static_cast<MidiBuffer&(BufferSet::*)(size_t)>(&BufferSet::get_midi))
2352 .addFunction ("count", static_cast<const ChanCount&(BufferSet::*)()const>(&BufferSet::count))
2356 luabridge::getGlobalNamespace (L)
2357 .beginNamespace ("Evoral")
2358 .deriveClass <Evoral::Event<samplepos_t>, Evoral::Event<samplepos_t> > ("Event")
2360 .addFunction ("type", &Evoral::Event<samplepos_t>::type)
2361 .addFunction ("channel", &Evoral::Event<samplepos_t>::channel)
2362 .addFunction ("set_type", &Evoral::Event<samplepos_t>::set_type)
2363 .addFunction ("set_channel", &Evoral::Event<samplepos_t>::set_channel)
2367 // dsp releated session functions
2368 luabridge::getGlobalNamespace (L)
2369 .beginNamespace ("ARDOUR")
2370 .beginClass <Session> ("Session")
2371 .addFunction ("get_scratch_buffers", &Session::get_scratch_buffers)
2372 .addFunction ("get_silent_buffers", &Session::get_silent_buffers)
2376 luabridge::getGlobalNamespace (L)
2377 .beginNamespace ("ARDOUR")
2378 .beginClass <FluidSynth> ("FluidSynth")
2379 .addConstructor <void (*) (float, int)> ()
2380 .addFunction ("load_sf2", &FluidSynth::load_sf2)
2381 .addFunction ("synth", &FluidSynth::synth)
2382 .addFunction ("midi_event", &FluidSynth::midi_event)
2383 .addFunction ("panic", &FluidSynth::panic)
2384 .addFunction ("select_program", &FluidSynth::select_program)
2385 .addFunction ("program_count", &FluidSynth::program_count)
2386 .addFunction ("program_name", &FluidSynth::program_name)
2390 luabridge::getGlobalNamespace (L)
2391 .beginNamespace ("ARDOUR")
2393 .beginClass <LuaTableRef> ("LuaTableRef")
2394 .addCFunction ("get", &LuaTableRef::get)
2395 .addCFunction ("set", &LuaTableRef::set)
2398 .endNamespace (); // ARDOUR
2402 LuaBindings::session (lua_State* L)
2404 // non-realtime session functions
2405 luabridge::getGlobalNamespace (L)
2406 .beginNamespace ("ARDOUR")
2407 .beginClass <Session> ("Session")
2408 .addFunction ("save_state", &Session::save_state)
2409 .addFunction ("set_dirty", &Session::set_dirty)
2410 .addFunction ("unknown_processors", &Session::unknown_processors)
2411 .addFunction ("export_track_state", &Session::export_track_state)
2413 .addFunction<RouteList (Session::*)(uint32_t, PresentationInfo::order_t, const std::string&, const std::string&, PlaylistDisposition)> ("new_route_from_template", &Session::new_route_from_template)
2414 // TODO session_add_audio_track session_add_midi_track session_add_mixed_track
2415 //.addFunction ("new_midi_track", &Session::new_midi_track)
2418 .endNamespace (); // ARDOUR
2422 LuaBindings::osc (lua_State* L)
2424 luabridge::getGlobalNamespace (L)
2425 .beginNamespace ("ARDOUR")
2426 .beginNamespace ("LuaOSC")
2427 .beginClass<LuaOSC::Address> ("Address")
2428 .addConstructor<void (*) (std::string)> ()
2429 .addCFunction ("send", &LuaOSC::Address::send)
2436 LuaBindings::set_session (lua_State* L, Session *s)
2438 /* LuaBridge uses unique keys to identify classes/c-types.
2440 * Those keys are "generated" by using the memory-address of a static
2441 * variable, templated for every Class.
2442 * (see libs/lua/LuaBridge/detail/ClassInfo.h)
2444 * When linking the final executable there must be exactly one static
2445 * function (static variable) for every templated class.
2446 * This works fine on OSX and Linux...
2448 * Windows (mingw and MSVC) however expand the template differently for libardour
2449 * AND gtk2_ardour. We end up with two identical static functions
2450 * at different addresses!!
2452 * The Solution: have gtk2_ardour never include LuaBridge headers directly
2453 * and always go via libardour function calls for classes that are registered
2454 * in libardour. (calling lua itself is fine, calling c-functions in the GUI
2455 * which expand the template is not)
2457 * (the actual cause: even static symbols in a .dll have no fixed address
2458 * and are mapped when loading the dll. static functions in .exe do have a fixed
2462 * 0000000000000000 I __imp__ZZN9luabridge9ClassInfoIN6ARDOUR7SessionEE11getClassKeyEvE5value
2463 * 0000000000000000 I __nm__ZZN9luabridge9ClassInfoIN6ARDOUR7SessionEE11getClassKeyEvE5value
2464 * 0000000000000000 T _ZN9luabridge9ClassInfoIN6ARDOUR7SessionEE11getClassKeyEv
2467 * 000000000104f560 d .data$_ZZN9luabridge9ClassInfoIN6ARDOUR7SessionEE11getClassKeyEvE5value
2468 * 000000000104f560 D _ZZN9luabridge9ClassInfoIN6ARDOUR7SessionEE11getClassKeyEvE5value
2469 * 0000000000e9baf0 T _ZN9luabridge9ClassInfoIN6ARDOUR7SessionEE11getClassKeyEv
2473 luabridge::push <Session *> (L, s);
2474 lua_setglobal (L, "Session");
2477 // call lua function.
2478 luabridge::LuaRef cb_ses = luabridge::getGlobal (L, "new_session");
2479 if (cb_ses.type() == LUA_TFUNCTION) { cb_ses(s->name()); } // TODO args