mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-11 00:56:33 +01:00
Lua script to save a snapshot after export
This commit is contained in:
parent
2283e3b6ce
commit
f2327835f9
1 changed files with 26 additions and 0 deletions
26
scripts/_post_export_save_hook.lua
Normal file
26
scripts/_post_export_save_hook.lua
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
ardour {
|
||||||
|
["type"] = "EditorHook",
|
||||||
|
name = "Save Snapshot after Export",
|
||||||
|
author = "Ardour Lua Task Force",
|
||||||
|
description = "Snapshot after Export",
|
||||||
|
}
|
||||||
|
|
||||||
|
-- subscribe to signals
|
||||||
|
-- http://manual.ardour.org/lua-scripting/class_reference/#LuaSignal.LuaSignal
|
||||||
|
function signals ()
|
||||||
|
s = LuaSignal.Set()
|
||||||
|
s:add ({[LuaSignal.Exported] = true})
|
||||||
|
return s
|
||||||
|
end
|
||||||
|
|
||||||
|
-- create callback functions
|
||||||
|
function factory ()
|
||||||
|
-- callback function which invoked when signal is emitted
|
||||||
|
return function (signal, ref, ...)
|
||||||
|
-- 'Exported' passes 2 strings: current time-span name, path to exported file
|
||||||
|
-- (see C++ libs/ardour/export_handler.cc Session::Exported )
|
||||||
|
local timespan_name, file_path = ...
|
||||||
|
-- save session -- http://manual.ardour.org/lua-scripting/class_reference/#ARDOUR:Session
|
||||||
|
Session:save_state ("export-" .. timespan_name, false, false, false)
|
||||||
|
end
|
||||||
|
end
|
||||||
Loading…
Add table
Add a link
Reference in a new issue