From 99adbe1e7ca136f98ba542a86bfbd5907ac0fc09 Mon Sep 17 00:00:00 2001 From: ChrisK2 Date: Sun, 6 Oct 2013 23:44:46 +0200 Subject: osc: Add another scale option for forced windows. If the OSC is rendered on a forced window (by --force-window), the scale can be configured with scaleForcedWindow. --- mpvcore/lua/osc.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mpvcore/lua/osc.lua b/mpvcore/lua/osc.lua index 7b4069b87c..aa3bb44ea5 100644 --- a/mpvcore/lua/osc.lua +++ b/mpvcore/lua/osc.lua @@ -14,6 +14,7 @@ local user_opts = { showFullscreen = true, -- show OSC when fullscreen? scaleWindowed = 1, -- scaling of the controller when windowed scaleFullscreen = 1, -- scaling of the controller when fullscreen + scaleForcedWindow = 2, -- scaling of the controller when rendered on a forced (dummy) window vidscale = true, -- scale the controller with the video? valign = 0.8, -- vertical alignment, -1 (top) to 1 (bottom) halign = 0, -- horizontal alignment, -1 (left) to 1 (right) @@ -86,14 +87,14 @@ function typeconv(desttypeval, val) elseif val == "no" then val = false else - msg.error("Error: Can't convert " .. val .." to boolean!") + msg.error("Error: Can't convert " .. val .. " to boolean!") val = nil end elseif type(desttypeval) == "number" then if not (tonumber(val) == nil) then val = tonumber(val) else - msg.error("Error: Can't convert " .. val .." to number!") + msg.error("Error: Can't convert " .. val .. " to number!") val = nil end end @@ -645,7 +646,9 @@ function osc_init() local display_w, display_h, display_aspect = mp.get_screen_size() local scale = 1 - if (mp.property_get("fullscreen") == "yes") then + if (mp.property_get("video") == "no") then -- dummy/forced window + scale = user_opts.scaleForcedWindow + elseif (mp.property_get("fullscreen") == "yes") then scale = user_opts.scaleFullscreen else scale = user_opts.scaleWindowed -- cgit v1.2.3