#include "selection.h"
#include "script_selector.h"
#include "timers.h"
+#include "ui_config.h"
#include "utils_videotl.h"
#include "pbd/i18n.h"
* @param width The desired width in Pango units, or -1 to indicate that no
* wrapping or ellipsization should be performed.
*/
- void set_width (int width) {
+ void set_width (float width) {
_layout->set_width (width * PANGO_SCALE);
}
Mixer_UI::instance()->screenshot (fn);
}
+/** Access libardour global configuration */
+static UIConfiguration* _ui_config () {
+ return &UIConfiguration::instance();
+}
+
+
////////////////////////////////////////////////////////////////////////////////
static PBD::ScopedConnectionList _luaexecs;
*/
luabridge::getGlobalNamespace (L)
.beginNamespace ("C")
+ .registerArray <double> ("DoubleArray")
.beginStdVector <double> ("DoubleVector")
.endClass ()
.endNamespace ();
.addCFunction ("actionlist", &lua_actionlist)
+
+ .beginClass <UIConfiguration> ("UIConfiguration")
+#undef UI_CONFIG_VARIABLE
+#define UI_CONFIG_VARIABLE(Type,var,name,value) \
+ .addFunction ("get_" # var, &UIConfiguration::get_##var) \
+ .addFunction ("set_" # var, &UIConfiguration::set_##var) \
+ .addProperty (#var, &UIConfiguration::get_##var, &UIConfiguration::set_##var)
+
+#include "ui_config_vars.h"
+
+#undef UI_CONFIG_VARIABLE
+ .endClass()
+
+ .addFunction ("config", &_ui_config)
+
.endNamespace () // end ArdourUI
.beginNamespace ("os")
{
std::string uiscripts;
if (!find_file (ardour_config_search_path(), ui_scripts_file_name, uiscripts)) {
+ pre_seed_scripts ();
return -1;
}
XMLTree tree;
lua_State* L = lua.getState();
LuaBindings::set_session (L, _session);
- lua.do_command ("collectgarbage();");
+ lua.collect_garbage ();
}
void
return 0;
}
+void
+LuaInstance::pre_seed_scripts ()
+{
+ LuaScriptInfoPtr spi = LuaScripting::instance ().by_name ("Mixer Screenshot", LuaScriptInfo::EditorAction);
+ int id = 0;
+ if (spi) {
+ try {
+ std::string script = Glib::file_get_contents (spi->path);
+ LuaState ls;
+ register_classes (ls.getState ());
+ LuaScriptParamList lsp = LuaScriptParams::script_params (ls, spi->path, "action_params");
+ LuaScriptParamPtr lspp (new LuaScriptParam("x-script-origin", "", spi->path, false, true));
+ lsp.push_back (lspp);
+ set_lua_action (id++, "Mixer Screenshot", script, lsp);
+ } catch (...) { }
+ }
+}
+
bool
LuaInstance::interactive_add (LuaScriptInfo::ScriptType type, int id)
{