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.
This commit is contained in:
ChrisK2 2013-10-06 23:44:46 +02:00
parent 55883943c5
commit 99adbe1e7c
1 changed files with 6 additions and 3 deletions

View File

@ -14,6 +14,7 @@ local user_opts = {
showFullscreen = true, -- show OSC when fullscreen? showFullscreen = true, -- show OSC when fullscreen?
scaleWindowed = 1, -- scaling of the controller when windowed scaleWindowed = 1, -- scaling of the controller when windowed
scaleFullscreen = 1, -- scaling of the controller when fullscreen 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? vidscale = true, -- scale the controller with the video?
valign = 0.8, -- vertical alignment, -1 (top) to 1 (bottom) valign = 0.8, -- vertical alignment, -1 (top) to 1 (bottom)
halign = 0, -- horizontal alignment, -1 (left) to 1 (right) halign = 0, -- horizontal alignment, -1 (left) to 1 (right)
@ -86,14 +87,14 @@ function typeconv(desttypeval, val)
elseif val == "no" then elseif val == "no" then
val = false val = false
else else
msg.error("Error: Can't convert " .. val .." to boolean!") msg.error("Error: Can't convert " .. val .. " to boolean!")
val = nil val = nil
end end
elseif type(desttypeval) == "number" then elseif type(desttypeval) == "number" then
if not (tonumber(val) == nil) then if not (tonumber(val) == nil) then
val = tonumber(val) val = tonumber(val)
else else
msg.error("Error: Can't convert " .. val .." to number!") msg.error("Error: Can't convert " .. val .. " to number!")
val = nil val = nil
end end
end end
@ -645,7 +646,9 @@ function osc_init()
local display_w, display_h, display_aspect = mp.get_screen_size() local display_w, display_h, display_aspect = mp.get_screen_size()
local scale = 1 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 scale = user_opts.scaleFullscreen
else else
scale = user_opts.scaleWindowed scale = user_opts.scaleWindowed