remove redundant checks in wake of 980de904e
authorNikolaus Gullotta <nikolaus.gullotta@gmail.com>
Thu, 2 Aug 2018 14:17:54 +0000 (09:17 -0500)
committerNikolaus Gullotta <nikolaus.gullotta@gmail.com>
Thu, 2 Aug 2018 14:17:54 +0000 (09:17 -0500)
scripts/mixer_settings_recall.lua
scripts/mixer_settings_store.lua

index af07256b4cde5b4d2097ddaf35cdecebaea8db1c..25d83768623da28e8f46b716f3da37cf991832b8 100644 (file)
@@ -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
index 197fcd8ed740ef650bb4d7df6509064464740618..5adaac5d7d32ef314522afeafd6195746735a28f 100644 (file)
@@ -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