summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Mitchell <kevmitch@gmail.com>2014-04-26 18:07:46 -0700
committerwm4 <wm4@nowhere>2014-04-27 15:34:53 +0200
commit4e973c059a859103fc3fef08b023f9b581246815 (patch)
treea312e1c61f15ce5a6ba18d24f9c94e8af5ffd9a6
parent7ef045555dd1c6f1fc368d9d18d014a579885d6e (diff)
downloadmpv-4e973c059a859103fc3fef08b023f9b581246815.tar.bz2
mpv-4e973c059a859103fc3fef08b023f9b581246815.tar.xz
TOOLS: indent lua scripts by 4 spaces instead of 3
-rw-r--r--TOOLS/lua/autocrop.lua12
-rw-r--r--TOOLS/lua/drc-control.lua98
2 files changed, 55 insertions, 55 deletions
diff --git a/TOOLS/lua/autocrop.lua b/TOOLS/lua/autocrop.lua
index e5292eee18..bf608dc050 100644
--- a/TOOLS/lua/autocrop.lua
+++ b/TOOLS/lua/autocrop.lua
@@ -1,11 +1,11 @@
mp.command('vf add @autocrop.cropdetect:lavfi=graph="cropdetect=limit=24:round=2:reset=0"')
function update_crop_handler()
- cropdetect_metadata=mp.get_property_native("vf-metadata/autocrop.cropdetect")
- mp.command(string.format('vf add @autocrop.crop:crop=%s:%s:%s:%s',
- cropdetect_metadata['lavfi.cropdetect.w'],
- cropdetect_metadata['lavfi.cropdetect.h'],
- cropdetect_metadata['lavfi.cropdetect.x'],
- cropdetect_metadata['lavfi.cropdetect.y']))
+ cropdetect_metadata=mp.get_property_native("vf-metadata/autocrop.cropdetect")
+ mp.command(string.format('vf add @autocrop.crop:crop=%s:%s:%s:%s',
+ cropdetect_metadata['lavfi.cropdetect.w'],
+ cropdetect_metadata['lavfi.cropdetect.h'],
+ cropdetect_metadata['lavfi.cropdetect.x'],
+ cropdetect_metadata['lavfi.cropdetect.y']))
end
mp.add_key_binding("C","update_crop",update_crop_handler)
diff --git a/TOOLS/lua/drc-control.lua b/TOOLS/lua/drc-control.lua
index 32ba76eb86..71755d4dfb 100644
--- a/TOOLS/lua/drc-control.lua
+++ b/TOOLS/lua/drc-control.lua
@@ -1,76 +1,76 @@
script_name=mp.get_script_name():gsub("lua/","",1)
function print_state(params)
- if params then
- mp.osd_message(script_name..':\n'
- .."method = "..params['method'].."\n"
- .."target = "..params['target'])
- else
- mp.osd_message(script_name..':\noff')
- end
+ if params then
+ mp.osd_message(script_name..':\n'
+ .."method = "..params['method'].."\n"
+ .."target = "..params['target'])
+ else
+ 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
- end
+ for i,af in pairs(afs) do
+ 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"
- }
- }
- print_state(afs[#afs]['params'])
+ 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)
- if not i then
- append_drc(afs)
- else
- fun(afs,i)
- end
- mp.set_property_native('af',afs)
+ afs=mp.get_property_native('af')
+ i=get_index_of_drc(afs)
+ if not i then
+ append_drc(afs)
+ else
+ 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
- )
+ 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
+ )
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
- )
+ modify_or_create_af(
+ function (afs)
+ afs[i]['params']['target']=tostring(afs[i]['params']['target']*factor)
+ print_state(afs[i]['params'])
+ end
+ )
end
function drc_louder_handler()
- drc_scale_target(2.0)
+ drc_scale_target(2.0)
end
function drc_quieter_handler()
- drc_scale_target(0.5)
+ drc_scale_target(0.5)
end
-- toggle between off, method 1 and method 2