summaryrefslogtreecommitdiffstats
path: root/TOOLS
diff options
context:
space:
mode:
authorKevin Mitchell <kevmitch@gmail.com>2014-05-06 09:59:59 -0700
committerKevin Mitchell <kevmitch@gmail.com>2014-05-06 09:59:59 -0700
commit6e62779e98b3071330446df5ac074ff5b5aa3edf (patch)
tree0b89c3f66a86635235d0d496f42054d1c24d7f2f /TOOLS
parent088031f6918a9a1bc95616f79612440f0bd2e7f5 (diff)
downloadmpv-6e62779e98b3071330446df5ac074ff5b5aa3edf.tar.bz2
mpv-6e62779e98b3071330446df5ac074ff5b5aa3edf.tar.xz
TOOLS/lua: conform to whitespace coding-style
Diffstat (limited to 'TOOLS')
-rw-r--r--TOOLS/lua/autocrop.lua8
-rw-r--r--TOOLS/lua/drc-control.lua40
2 files changed, 24 insertions, 24 deletions
diff --git a/TOOLS/lua/autocrop.lua b/TOOLS/lua/autocrop.lua
index 2523dd99de..bf598e8b05 100644
--- a/TOOLS/lua/autocrop.lua
+++ b/TOOLS/lua/autocrop.lua
@@ -27,9 +27,9 @@
-- time to collect data.
require "mp.msg"
-script_name=mp.get_script_name()
-cropdetect_label=string.format("%s-cropdetect",script_name)
-crop_label=string.format("%s-crop",script_name)
+script_name = mp.get_script_name()
+cropdetect_label = string.format("%s-cropdetect", script_name)
+crop_label = string.format("%s-crop", script_name)
-- number of seconds to gather cropdetect data
detect_seconds = tonumber(mp.get_opt(string.format("%s.detect_seconds", script_name)))
@@ -110,4 +110,4 @@ function do_crop()
timer=nil
end
-mp.add_key_binding("C","auto_crop",autocrop_start)
+mp.add_key_binding("C", "auto_crop", autocrop_start)
diff --git a/TOOLS/lua/drc-control.lua b/TOOLS/lua/drc-control.lua
index 4e1ff396e5..bb3d00b928 100644
--- a/TOOLS/lua/drc-control.lua
+++ b/TOOLS/lua/drc-control.lua
@@ -17,7 +17,7 @@
-- OSD feedback of the current filter state is displayed on pressing
-- each bound key.
-script_name=mp.get_script_name()
+script_name = mp.get_script_name()
function print_state(params)
if params then
@@ -31,44 +31,44 @@ end
function get_index_of_drc(afs)
for i,af in pairs(afs) do
- if af["label"]==script_name then
+ 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"
+ afs[#afs+1] = {
+ name = "drc",
+ label = script_name,
+ params = {
+ method = "1",
+ target = "0.25"
}
}
print_state(afs[#afs]["params"])
end
function modify_or_create_af(fun)
- afs=mp.get_property_native("af")
- i=get_index_of_drc(afs)
+ afs = mp.get_property_native("af")
+ i = get_index_of_drc(afs)
if not i then
append_drc(afs)
else
- fun(afs,i)
+ fun(afs, i)
end
- mp.set_property_native("af",afs)
+ mp.set_property_native("af", afs)
end
function drc_toggle_method_handler()
modify_or_create_af(
- function (afs,i)
+ function (afs, i)
new_method=(afs[i]["params"]["method"]+1)%3
- if new_method==0 then
- table.remove(afs,i)
+ if new_method == 0 then
+ table.remove(afs, i)
print_state(nil)
else
- afs[i]["params"]["method"]=tostring((afs[i]["params"]["method"])%2+1)
+ afs[i]["params"]["method"] = tostring((afs[i]["params"]["method"])%2+1)
print_state(afs[i]["params"])
end
end
@@ -78,7 +78,7 @@ end
function drc_scale_target(factor)
modify_or_create_af(
function (afs)
- afs[i]["params"]["target"]=tostring(afs[i]["params"]["target"]*factor)
+ afs[i]["params"]["target"] = tostring(afs[i]["params"]["target"]*factor)
print_state(afs[i]["params"])
end
)
@@ -93,7 +93,7 @@ function drc_quieter_handler()
end
-- toggle between off, method 1 and method 2
-mp.add_key_binding("\\","drc_toggle_method",drc_toggle_method_handler)
+mp.add_key_binding("\\", "drc_toggle_method", drc_toggle_method_handler)
-- increase or decrease target volume
-mp.add_key_binding("ctrl+9","drc_quieter",drc_quieter_handler)
-mp.add_key_binding("ctrl+0","drc_louder",drc_louder_handler)
+mp.add_key_binding("ctrl+9", "drc_quieter", drc_quieter_handler)
+mp.add_key_binding("ctrl+0", "drc_louder", drc_louder_handler)