From dfb1c521924b4e6a979d7b7508f92b348c8c4804 Mon Sep 17 00:00:00 2001 From: Nikolaus Gullotta Date: Thu, 2 Aug 2018 09:17:54 -0500 Subject: [PATCH] remove redundant checks in wake of 980de904e --- scripts/mixer_settings_recall.lua | 19 +++---------------- scripts/mixer_settings_store.lua | 8 -------- 2 files changed, 3 insertions(+), 24 deletions(-) diff --git a/scripts/mixer_settings_recall.lua b/scripts/mixer_settings_recall.lua index af07256b4c..25d8376862 100644 --- a/scripts/mixer_settings_recall.lua +++ b/scripts/mixer_settings_recall.lua @@ -47,19 +47,6 @@ function factory () return function () return exists(path.."/") end - function fetch_valid_settings_file(directory, fallback) - local i, t, popen = 0, {}, io.popen - local pfile = popen('ls "'..directory..'"') - for filename in pfile:lines() do - i = i + 1 - if string.find(filename, ".lua") then - return filename - end - end - pfile:close() - return fallback - end - function get_processor_by_name(track, name) local i = 0 local proc = track:nth_processor(i) @@ -379,7 +366,7 @@ function factory () return function () local recall_options = { { type = "label", col=0, colspan=10, align="left", title = "" }, - { type = "file", col=0, colspan=15, align="left", key = "file", title = "Select a Settings File:", path = ARDOUR.LuaAPI.build_filename(Session:path(), "export", "params.lua") }, + { type = "file", col=0, colspan=15, align="left", key = "file", title = "Select a Settings File", path = ARDOUR.LuaAPI.build_filename(Session:path(), "export", "params.lua") }, { type = "label", col=0, colspan=10, align="left", title = "" }, } @@ -390,7 +377,7 @@ function factory () return function () else if gvld['recall-dir'] == 1 then local global_ok = isdir(global_path) - local global_default_path = ARDOUR.LuaAPI.build_filename(global_path, fetch_valid_settings_file(global_path, string.format("FactoryDefault-%s.lua", whoami()))) + local global_default_path = ARDOUR.LuaAPI.build_filename(global_path, string.format("FactoryDefault-%s.lua", whoami())) print(global_default_path) if global_ok then recall_options[2]['path'] = global_default_path @@ -411,7 +398,7 @@ function factory () return function () if gvld['recall-dir'] == 2 then local local_ok = isdir(local_path) - local local_default_path = ARDOUR.LuaAPI.build_filename(local_path, fetch_valid_settings_file(local_path)) + local local_default_path = ARDOUR.LuaAPI.build_filename(local_path, 'asdf') print(local_default_path) if local_ok then recall_options[2]['path'] = local_default_path diff --git a/scripts/mixer_settings_store.lua b/scripts/mixer_settings_store.lua index 197fcd8ed7..5adaac5d7d 100644 --- a/scripts/mixer_settings_store.lua +++ b/scripts/mixer_settings_store.lua @@ -53,10 +53,6 @@ function factory () return function () if not(isdir(global_path)) then global_ok, _, _ = os.execute('mkdir '.. global_path) if global_ok == 0 then - local default_file = ARDOUR.LuaAPI.build_filename(global_path, 'FactoryDefault-'..whoami()..'.lua') - local file = io.open(default_file, "w") - file:write("") - file:close() global_ok = true end else @@ -65,10 +61,6 @@ function factory () return function () if not(isdir(local_path)) then local_ok, _, _ = os.execute('mkdir '.. local_path) if local_ok == 0 then - local stub_file = ARDOUR.LuaAPI.build_filename(local_path, 'stub') - local file = io.open(stub_file, "w") - file:write("") - file:close() local_ok = true end else -- 2.30.2