Second round of Lua script API updates
This commit is contained in:
@@ -24,7 +24,6 @@ function factory (params) return function ()
|
||||
|
||||
-- prepare undo operation
|
||||
Session:begin_reversible_command ("Bounce+Replace Regions")
|
||||
local add_undo = false -- keep track if something has changed
|
||||
|
||||
-- Iterate over Regions part of the selection
|
||||
-- http://manual.ardour.org/lua-scripting/class_reference/#ArdourUI:RegionSelection
|
||||
@@ -48,17 +47,12 @@ function factory (params) return function ()
|
||||
|
||||
-- create a diff of the performed work, add it to the session's undo stack
|
||||
-- and check if it is not empty
|
||||
if not Session:add_stateful_diff_command (playlist:to_statefuldestructible ()):empty () then
|
||||
add_undo = true
|
||||
end
|
||||
Session:add_stateful_diff_command (playlist:to_statefuldestructible ())
|
||||
end
|
||||
|
||||
-- all done, commit the combined Undo Operation
|
||||
if add_undo then
|
||||
-- the 'nil' Command here mean to use the collected diffs added above
|
||||
if not Session:abort_empty_reversible_command () then
|
||||
Session:commit_reversible_command (nil)
|
||||
else
|
||||
Session:abort_reversible_command ()
|
||||
end
|
||||
|
||||
end end
|
||||
|
||||
Reference in New Issue
Block a user