mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 15:54:57 +01:00
Also move Lua scripts to share subfolder
This commit is contained in:
parent
bf649cd68a
commit
180843f9bd
129 changed files with 2 additions and 2 deletions
32
share/scripts/_session_load_hook.lua
Normal file
32
share/scripts/_session_load_hook.lua
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
ardour {
|
||||
["type"] = "EditorHook",
|
||||
name = "Load Session Hook Example",
|
||||
author = "Ardour Lua Task Force",
|
||||
description = "Display some dialogs during session load and execute actions",
|
||||
}
|
||||
|
||||
-- subscribe to signals
|
||||
-- http://manual.ardour.org/lua-scripting/class_reference/#LuaSignal.LuaSignal
|
||||
function signals ()
|
||||
s = LuaSignal.Set()
|
||||
s:add ({[LuaSignal.SetSession] = true})
|
||||
return s
|
||||
end
|
||||
|
||||
-- create callback functions
|
||||
function factory () return function (signal, ...)
|
||||
assert (signal == LuaSignal.SetSession)
|
||||
local md = LuaDialog.Message ("Set Session", "Loading Session:" .. Session:name(), LuaDialog.MessageType.Info, LuaDialog.ButtonType.Close)
|
||||
md:run()
|
||||
|
||||
local dialog_options = {
|
||||
{ type = "checkbox", key = "tempo", default = true, title = "Show Tempo Ruler" },
|
||||
{ type = "checkbox", key = "meter", default = true, title = "Show Meter Ruler" },
|
||||
}
|
||||
local dlg = LuaDialog.Dialog ("Tweak Rulers", dialog_options)
|
||||
local rv = dlg:run()
|
||||
if (rv) then
|
||||
Editor:set_toggleaction ("Rulers", "toggle-tempo-ruler", rv['tempo'])
|
||||
Editor:set_toggleaction ("Rulers", "toggle-meter-ruler", rv['meter'])
|
||||
end
|
||||
end end
|
||||
Loading…
Add table
Add a link
Reference in a new issue