13
0

expose SessionConfiguration as lua bindings

This commit is contained in:
Robin Gareus 2016-08-15 22:16:08 +02:00
parent 3b7dbdfeb8
commit 11da4a83e4
2 changed files with 28 additions and 0 deletions

View File

@ -1007,6 +1007,8 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
SessionConfiguration config;
SessionConfiguration* cfg () { return &config; }
bool exporting () const {
return _exporting;
}

View File

@ -171,6 +171,9 @@ CLASSKEYS(ARDOUR::BufferSet);
CLASSKEYS(ARDOUR::ChanMapping);
CLASSKEYS(ARDOUR::DSP::DspShm);
CLASSKEYS(ARDOUR::LuaTableRef);
CLASSKEYS(PBD::Configuration);
CLASSKEYS(ARDOUR::PresentationInfo);
CLASSKEYS(ARDOUR::SessionConfiguration);
CLASSKEYS(PBD::ID);
CLASSKEYS(ARDOUR::Location);
CLASSKEYS(ARDOUR::PluginInfo);
@ -276,6 +279,9 @@ LuaBindings::common (lua_State* L)
.deriveClass <PBD::StatefulDestructible, PBD::Stateful> ("StatefulDestructible")
.endClass ()
.deriveClass <PBD::Configuration, PBD::Stateful> ("Configuration")
.endClass()
.deriveWSPtrClass <PBD::StatefulDestructible, PBD::Stateful> ("StatefulDestructiblePtr")
.endClass ()
@ -1182,6 +1188,25 @@ LuaBindings::common (lua_State* L)
.addFunction ("set_buffer_size", &AudioEngine::set_buffer_size)
.addFunction ("get_last_backend_error", &AudioEngine::get_last_backend_error)
.endClass()
.deriveClass <SessionConfiguration, PBD::Configuration> ("SessionConfiguration")
#undef CONFIG_VARIABLE
#undef CONFIG_VARIABLE_SPECIAL
#define CONFIG_VARIABLE(Type,var,name,value) \
.addFunction ("get_" # var, &SessionConfiguration::get_##var) \
.addFunction ("set_" # var, &SessionConfiguration::set_##var) \
.addProperty (#var, &SessionConfiguration::get_##var, &SessionConfiguration::set_##var)
#define CONFIG_VARIABLE_SPECIAL(Type,var,name,value,mutator) \
.addFunction ("get_" # var, &SessionConfiguration::get_##var) \
.addFunction ("set_" # var, &SessionConfiguration::set_##var) \
.addProperty (#var, &SessionConfiguration::get_##var, &SessionConfiguration::set_##var)
#include "ardour/session_configuration_vars.h"
#undef CONFIG_VARIABLE
#undef CONFIG_VARIABLE_SPECIAL
.endClass()
.endNamespace ();
// basic representation of Session
@ -1242,6 +1267,7 @@ LuaBindings::common (lua_State* L)
.addFunction ("worst_input_latency", &Session::worst_input_latency)
.addFunction ("worst_track_latency", &Session::worst_track_latency)
.addFunction ("worst_playback_latency", &Session::worst_playback_latency)
.addFunction ("cfg", &Session::cfg)
.endClass ()
.beginClass <RegionFactory> ("RegionFactory")