Permalink
Browse files

mixer recall script will now remember the last used recall settings

  • Loading branch information...
Nikolaus Gullotta
Nikolaus Gullotta committed Jan 4, 2019
1 parent b05cabe commit 78c32dc2fc9fdf1c5353e1698f83491e4850b0db
Showing with 24 additions and 3 deletions.
  1. +24 −3 scripts/mixer_settings_recall.lua
@@ -13,7 +13,11 @@ ardour {
]]
}

function factory () return function ()
function factory ()

local acoraida_monicas_last_used_recall_file

return function ()

local user_cfg = ARDOUR.user_config_directory(-1)
local local_path = ARDOUR.LuaAPI.build_filename(Session:path(), 'mixer_settings')
@@ -362,9 +366,9 @@ function factory () return function ()
{
type = "radio", col=0, colspan=20, align="left", key = "recall-dir", title = "", values =
{
['Pick from Global Settings'] = 1, ['Pick from Local Settings'] = 2
['Pick from Global Settings'] = 1, ['Pick from Local Settings'] = 2, ['Last Used Recall File'] = 3,
},
default = 'Pick from Local Settings'
default = 'Last Used Recall File'
},
{ type = "label", col=0, colspan=20, align="left", title = ""},
}
@@ -390,6 +394,7 @@ function factory () return function ()
if not(rv) then return end
local dry_return = LuaDialog.Dialog("Recall Mixer Settings:", dry_run(false, rv['file'])):run()
if dry_return then
acoraida_monicas_last_used_recall_file = rv['file']
recall(false, rv['file'], dry_return)
else
return
@@ -411,6 +416,7 @@ function factory () return function ()
if not(rv) then return end
local dry_return = LuaDialog.Dialog("Recall Mixer Settings:", dry_run(false, rv['file'])):run()
if dry_return then
acoraida_monicas_last_used_recall_file = rv['file']
recall(true, rv['file'], dry_return)
else
return
@@ -421,6 +427,21 @@ function factory () return function ()
LuaDialog.MessageType.Info, LuaDialog.ButtonType.Close):run()
end
end

if gvld['recall-dir'] == 3 then
if acoraida_monicas_last_used_recall_file then
local dry_return = LuaDialog.Dialog("Recall Mixer Settings:", dry_run(false, acoraida_monicas_last_used_recall_file)):run()
if dry_return then
recall(true, acoraida_monicas_last_used_recall_file, dry_return)
else
return
end
else
LuaDialog.Message ("Script has no record of last used file:",
'Please pick a recall file and then this option will be available',
LuaDialog.MessageType.Info, LuaDialog.ButtonType.Close):run()
end
end
end

end end

0 comments on commit 78c32dc

Please sign in to comment.