From 275a37ff3926ab21d7248f09cdd20aefd01a3553 Mon Sep 17 00:00:00 2001 From: Thomas Brand Date: Sun, 8 Nov 2020 22:30:21 +0100 Subject: [PATCH] Fix Tom's Loop -There's no 'printf' (!) -New: Use LuaDialog to tell error cases instead of printing help to the log window. --- share/scripts/tomsloop.lua | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/share/scripts/tomsloop.lua b/share/scripts/tomsloop.lua index 5f83221695..b762e27db6 100644 --- a/share/scripts/tomsloop.lua +++ b/share/scripts/tomsloop.lua @@ -9,8 +9,6 @@ function factory (params) return function () -- when this script is called as an action, the output will be printed to the ardour log window function print_help() - printf("See source for help.") ----[[ print("") print("---------------------------------------------------------------------") print("") @@ -157,7 +155,6 @@ function factory (params) return function () print("See also: Lua Action Bounce+Replace Regions") print("") print("") ---]] end -- print_help() local n_paste = 1 @@ -171,14 +168,16 @@ function factory (params) return function () -- make sure we have a loop, and the playhead (edit point) is after it if not loop then - print_help(); +-- print_help(); print ("Error: A Loop range must be set.") + LuaDialog.Message ("Tom's Loop", "Error: A Loop range must be set.", LuaDialog.MessageType.Error, LuaDialog.ButtonType.Close):run () goto errorout end assert (loop:start () < loop:_end ()) if loop:_end () > playhead then - print_help(); +-- print_help(); print ("Error: The Playhead (paste point) needs to be after the loop.") + LuaDialog.Message ("Tom's Loop", "Error: The Playhead (paste point) needs to be after the loop.", LuaDialog.MessageType.Error, LuaDialog.ButtonType.Close):run () goto errorout end