From 3617399a46b59cc115c6c124f8a198a12ff3f972 Mon Sep 17 00:00:00 2001 From: Kevin Mitchell Date: Sun, 19 Oct 2014 23:12:34 -0700 Subject: TOOLS/lua: remove tabs from some lua scripts --- TOOLS/lua/autocrop.lua | 36 ++++++++++----------- TOOLS/lua/cycle-deinterlace-pullup.lua | 6 ++-- TOOLS/lua/drc-control.lua | 58 +++++++++++++++++----------------- 3 files changed, 50 insertions(+), 50 deletions(-) (limited to 'TOOLS') diff --git a/TOOLS/lua/autocrop.lua b/TOOLS/lua/autocrop.lua index bf598e8b05..cbc4c252ff 100644 --- a/TOOLS/lua/autocrop.lua +++ b/TOOLS/lua/autocrop.lua @@ -42,11 +42,11 @@ function del_filter_if_present(label) -- error if the filter doesn't exist local vfs = mp.get_property_native("vf") for i,vf in pairs(vfs) do - if vf["label"] == label then - table.remove(vfs, i) - mp.set_property_native("vf", vfs) - return true - end + if vf["label"] == label then + table.remove(vfs, i) + mp.set_property_native("vf", vfs) + return true + end end return false end @@ -65,10 +65,10 @@ function autocrop_start() -- insert the cropdetect filter ret=mp.command( - string.format( - 'vf add @%s:lavfi=graph="cropdetect=limit=24:round=2:reset=0"', - cropdetect_label - ) + string.format( + 'vf add @%s:lavfi=graph="cropdetect=limit=24:round=2:reset=0"', + cropdetect_label + ) ) -- wait to gather data timer=mp.add_timeout(detect_seconds, do_crop) @@ -77,15 +77,15 @@ end function do_crop() -- get the metadata local cropdetect_metadata = mp.get_property_native( - string.format("vf-metadata/%s", cropdetect_label) + string.format("vf-metadata/%s", cropdetect_label) ) -- use it to crop if its valid if cropdetect_metadata then - if cropdetect_metadata["lavfi.cropdetect.w"] - and cropdetect_metadata["lavfi.cropdetect.h"] - and cropdetect_metadata["lavfi.cropdetect.x"] - and cropdetect_metadata["lavfi.cropdetect.y"] - then + if cropdetect_metadata["lavfi.cropdetect.w"] + and cropdetect_metadata["lavfi.cropdetect.h"] + and cropdetect_metadata["lavfi.cropdetect.x"] + and cropdetect_metadata["lavfi.cropdetect.y"] + then mp.command(string.format("vf add @%s:crop=%s:%s:%s:%s", crop_label, cropdetect_metadata["lavfi.cropdetect.w"], @@ -94,9 +94,9 @@ function do_crop() cropdetect_metadata["lavfi.cropdetect.y"])) else mp.msg.error( - "Got empty crop data. You might need to increase detect_seconds." - ) - end + "Got empty crop data. You might need to increase detect_seconds." + ) + end else mp.msg.error( "No crop data. Was the cropdetect filter successfully inserted?" diff --git a/TOOLS/lua/cycle-deinterlace-pullup.lua b/TOOLS/lua/cycle-deinterlace-pullup.lua index f8095af4cd..2902e40dae 100644 --- a/TOOLS/lua/cycle-deinterlace-pullup.lua +++ b/TOOLS/lua/cycle-deinterlace-pullup.lua @@ -20,9 +20,9 @@ pullup_label = string.format("%s-pullup", script_name) function pullup_on() for i,vf in pairs(mp.get_property_native('vf')) do - if vf['label'] == pullup_label then - return "yes" - end + if vf['label'] == pullup_label then + return "yes" + end end return "no" end diff --git a/TOOLS/lua/drc-control.lua b/TOOLS/lua/drc-control.lua index bb3d00b928..1771d099a1 100644 --- a/TOOLS/lua/drc-control.lua +++ b/TOOLS/lua/drc-control.lua @@ -21,30 +21,30 @@ script_name = mp.get_script_name() function print_state(params) if params then - mp.osd_message(script_name..":\n" - .."method = "..params["method"].."\n" - .."target = "..params["target"]) + mp.osd_message(script_name..":\n" + .."method = "..params["method"].."\n" + .."target = "..params["target"]) else - mp.osd_message(script_name..":\noff") + mp.osd_message(script_name..":\noff") end end function get_index_of_drc(afs) for i,af in pairs(afs) do - if af["label"] == script_name then - return i - end + if af["label"] == script_name then + return i + end end end function append_drc(afs) afs[#afs+1] = { - name = "drc", - label = script_name, - params = { - method = "1", - target = "0.25" - } + name = "drc", + label = script_name, + params = { + method = "1", + target = "0.25" + } } print_state(afs[#afs]["params"]) end @@ -53,34 +53,34 @@ function modify_or_create_af(fun) afs = mp.get_property_native("af") i = get_index_of_drc(afs) if not i then - append_drc(afs) + append_drc(afs) else - fun(afs, i) + fun(afs, i) end mp.set_property_native("af", afs) end function drc_toggle_method_handler() modify_or_create_af( - function (afs, i) - new_method=(afs[i]["params"]["method"]+1)%3 - if new_method == 0 then - table.remove(afs, i) - print_state(nil) - else - afs[i]["params"]["method"] = tostring((afs[i]["params"]["method"])%2+1) - print_state(afs[i]["params"]) - end - end + function (afs, i) + new_method=(afs[i]["params"]["method"]+1)%3 + if new_method == 0 then + table.remove(afs, i) + print_state(nil) + else + afs[i]["params"]["method"] = tostring((afs[i]["params"]["method"])%2+1) + print_state(afs[i]["params"]) + end + end ) end function drc_scale_target(factor) modify_or_create_af( - function (afs) - afs[i]["params"]["target"] = tostring(afs[i]["params"]["target"]*factor) - print_state(afs[i]["params"]) - end + function (afs) + afs[i]["params"]["target"] = tostring(afs[i]["params"]["target"]*factor) + print_state(afs[i]["params"]) + end ) end -- cgit v1.2.3