summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2017-02-02 13:49:15 +0100
committerRobin Gareus <robin@gareus.org>2017-02-02 14:20:08 +0100
commitf2327835f93274a339dd5929dc752c68007d27df (patch)
treeb04a4dfef1a8bff38ce8089045e75922504f388b /scripts
parent2283e3b6ce3ebedf300bd94bb3625f506b1e3f32 (diff)
Lua script to save a snapshot after export
Diffstat (limited to 'scripts')
-rw-r--r--scripts/_post_export_save_hook.lua26
1 files changed, 26 insertions, 0 deletions
diff --git a/scripts/_post_export_save_hook.lua b/scripts/_post_export_save_hook.lua
new file mode 100644
index 0000000000..47b4861149
--- /dev/null
+++ b/scripts/_post_export_save_hook.lua
@@ -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