summaryrefslogtreecommitdiffstats
path: root/mpvcore
diff options
context:
space:
mode:
authorChrisK2 <spam@kalania.de>2013-09-27 20:12:13 +0200
committerChrisK2 <spam@kalania.de>2013-09-27 20:12:13 +0200
commit0e68ff4fad174d73c6e7ab82ead36f9209fb66a2 (patch)
tree47be5e17848c14303a95a0a46528f0daa63b277c /mpvcore
parent1b3fbfc1832d9a70363fbbf0578ba4241d47cbcb (diff)
downloadmpv-0e68ff4fad174d73c6e7ab82ead36f9209fb66a2.tar.bz2
mpv-0e68ff4fad174d73c6e7ab82ead36f9209fb66a2.tar.xz
osc: add options to show OSC only when FS/windowed
The boolean-options showWindowed and showFullscreen can now be set in plugin_osc.conf to control the behaviour. enhancement for #262
Diffstat (limited to 'mpvcore')
-rw-r--r--mpvcore/lua/osc.lua14
1 files changed, 12 insertions, 2 deletions
diff --git a/mpvcore/lua/osc.lua b/mpvcore/lua/osc.lua
index a18747aa74..7b4069b87c 100644
--- a/mpvcore/lua/osc.lua
+++ b/mpvcore/lua/osc.lua
@@ -10,6 +10,8 @@ local msg = require 'mp.msg'
-- default user option values
-- do not touch, change them in plugin_osc.conf
local user_opts = {
+ showWindowed = true, -- show OSC when windowed?
+ showFullscreen = true, -- show OSC when fullscreen?
scaleWindowed = 1, -- scaling of the controller when windowed
scaleFullscreen = 1, -- scaling of the controller when fullscreen
vidscale = true, -- scale the controller with the video?
@@ -35,7 +37,7 @@ local osc_param = {
local osc_styles = {
bigButtons = "{\\blur0\\bord0\\1c&HFFFFFF\\3c&HFFFFFF\\fs50\\fnmpv-osd-symbols}",
- smallButtonsL = "{\\3a&HFF&\\4a&HFF&\\blur0\\bord0\\1c&HFFFFFF\\3c&HFFFFFF\\fs20\\fnmpv-osd-symbols}",
+ smallButtonsL = "{\\blur0\\bord0\\1c&HFFFFFF\\3c&HFFFFFF\\fs20\\fnmpv-osd-symbols}",
smallButtonsLlabel = "{\\fs17\\fn" .. mp.property_get("options/osd-font") .. "}",
smallButtonsR = "{\\blur0\\bord0\\1c&HFFFFFF\\3c&HFFFFFF\\fs30\\fnmpv-osd-symbols}",
@@ -1149,9 +1151,17 @@ function process_event(source, what)
end
end
+function tick()
+ if (mp.property_get("fullscreen") == "yes" and user_opts.showFullscreen) or (mp.property_get("fullscreen") == "no" and user_opts.showWindowed) then
+ render()
+ else
+ mp.set_osd_ass(osc_param.playresy, osc_param.playresy, "")
+ end
+end
+
function mp_event(name, arg)
if name == "tick" then
- render()
+ tick()
elseif name == "start" or name == "track-layout" then
request_init()
elseif name == "end" then