summaryrefslogtreecommitdiffstats
path: root/player/lua/osc.lua
diff options
context:
space:
mode:
Diffstat (limited to 'player/lua/osc.lua')
-rw-r--r--player/lua/osc.lua44
1 files changed, 22 insertions, 22 deletions
diff --git a/player/lua/osc.lua b/player/lua/osc.lua
index 643f32faaf..4ad6929800 100644
--- a/player/lua/osc.lua
+++ b/player/lua/osc.lua
@@ -1356,17 +1356,17 @@ layouts["topbar"] = function()
w = buttonW, h = 36 - padY*2 }
lo = add_layout("playpause")
lo.geometry = geo
- lo.style = osc_styles.smallButtonsL
+ lo.style = osc_styles.smallButtonsBar
geo = { x = geo.x + geo.w + padX, y = geo.y, an = geo.an, w = geo.w, h = geo.h }
lo = add_layout("ch_prev")
lo.geometry = geo
- lo.style = osc_styles.smallButtonsL
+ lo.style = osc_styles.smallButtonsBar
geo = { x = geo.x + geo.w + padX, y = geo.y, an = geo.an, w = geo.w, h = geo.h }
lo = add_layout("ch_next")
lo.geometry = geo
- lo.style = osc_styles.smallButtonsL
+ lo.style = osc_styles.smallButtonsBar
-- Left timecode
@@ -1374,7 +1374,7 @@ layouts["topbar"] = function()
w = tcW, h = geo.h }
lo = add_layout("tc_left")
lo.geometry = geo
- lo.style = osc_styles.timecodes
+ lo.style = osc_styles.timecodesBar
local sb_l = geo.x + padX
@@ -1384,12 +1384,12 @@ layouts["topbar"] = function()
w = tsW, h = geo.h }
lo = add_layout("cy_sub")
lo.geometry = geo
- lo.style = osc_styles.smallButtonsL
+ lo.style = osc_styles.smallButtonsBar
geo = { x = geo.x - geo.w - padX, y = geo.y, an = geo.an, w = geo.w, h = geo.h }
lo = add_layout("cy_audio")
lo.geometry = geo
- lo.style = osc_styles.smallButtonsL
+ lo.style = osc_styles.smallButtonsBar
-- Right timecode
@@ -1397,7 +1397,7 @@ layouts["topbar"] = function()
w = tcW, h = geo.h }
lo = add_layout("tc_right")
lo.geometry = geo
- lo.style = osc_styles.timecodes
+ lo.style = osc_styles.timecodesBar
local sb_r = geo.x - padX
@@ -1409,13 +1409,13 @@ layouts["topbar"] = function()
lo.geometry = geo
lo.layer = 15
- lo.style = osc_styles.timecodes
+ lo.style = osc_styles.timecodesBar
lo.alpha[1] =
math.min(255, user_opts.boxalpha + (255 - user_opts.boxalpha)*0.8)
lo = add_layout("seekbar")
lo.geometry = geo
- lo.style = osc_styles.timecodes
+ lo.style = osc_styles.timecodesBar
lo.slider.border = 0
lo.slider.tooltip_style = osc_styles.timePosBar
lo.slider.stype = user_opts["seekbarstyle"]
@@ -1426,12 +1426,12 @@ layouts["topbar"] = function()
geo = { x = osc_geo.x + padX, y = line2, an = 4, w = 18, h = 18 - padY }
lo = add_layout("pl_prev")
lo.geometry = geo
- lo.style = osc_styles.topButtons
+ lo.style = osc_styles.topButtonsBar
geo = { x = geo.x + geo.w + padX, y = geo.y, an = geo.an, w = geo.w, h = geo.h }
lo = add_layout("pl_next")
lo.geometry = geo
- lo.style = osc_styles.topButtons
+ lo.style = osc_styles.topButtonsBar
local t_l = geo.x + geo.w + padX
@@ -1440,7 +1440,7 @@ layouts["topbar"] = function()
an = 6, w = 150, h = geo.h }
lo = add_layout("cache")
lo.geometry = geo
- lo.style = osc_styles.vidtitle
+ lo.style = osc_styles.vidtitleBar
local t_r = geo.x - geo.w - padX*2
@@ -1449,7 +1449,7 @@ layouts["topbar"] = function()
w = t_r - t_l, h = geo.h }
lo = add_layout("title")
lo.geometry = geo
- lo.style = osc_styles.vidtitle
+ lo.style = osc_styles.vidtitleBar
lo.button.maxchars = math.floor(geo.w/7)
end
@@ -1502,8 +1502,9 @@ function osc_init()
elements = {}
-- some often needed stuff
- local pl_count = mp.get_property_number("playlist-count")
+ local pl_count = mp.get_property_number("playlist-count", 0)
local have_pl = (pl_count > 1)
+ local pl_pos = mp.get_property_number("playlist-pos", 0) + 1
local have_ch = (mp.get_property_number("chapters", 0) > 0)
local ne
@@ -1523,8 +1524,8 @@ function osc_init()
ne.eventresponder["mouse_btn0_up"] = function ()
local title = mp.get_property_osd("media-title")
if (have_pl) then
- local pl_pos = countone(mp.get_property_number("playlist-pos"))
- title = "[" .. pl_pos .. "/" .. pl_count .. "] " .. title
+ title = string.format("[%d/%d] %s", countone(pl_pos - 1),
+ pl_count, title)
end
show_message(title)
end
@@ -1538,7 +1539,7 @@ function osc_init()
ne = new_element("pl_prev", "button")
ne.content = "\238\132\144"
- ne.visible = have_pl
+ ne.enabled = (pl_pos > 1)
ne.eventresponder["mouse_btn0_up"] =
function ()
mp.commandv("playlist-prev", "weak")
@@ -1553,7 +1554,7 @@ function osc_init()
ne = new_element("pl_next", "button")
ne.content = "\238\132\129"
- ne.visible = have_pl
+ ne.enabled = (have_pl) and (pl_pos < pl_count)
ne.eventresponder["mouse_btn0_up"] =
function ()
mp.commandv("playlist-next", "weak")
@@ -1755,8 +1756,7 @@ function osc_init()
-- tc_right (total/remaining time)
ne = new_element("tc_right", "button")
- ne.visible = (not (mp.get_property("duration") == nil))
- and (mp.get_property_number("duration") > 0)
+ ne.visible = (mp.get_property_number("duration", 0) > 0)
ne.content = function ()
if (state.rightTC_trem) then
if state.tc_ms then
@@ -1766,7 +1766,7 @@ function osc_init()
end
else
if state.tc_ms then
- return (mp.get_property_osd("length/full"))
+ return (mp.get_property_osd("duration/full"))
else
return (mp.get_property_osd("duration"))
end
@@ -2214,7 +2214,7 @@ mp.observe_property("fullscreen", "bool",
request_init()
end
)
-mp.observe_property("idle", "bool",
+mp.observe_property("idle-active", "bool",
function(name, val)
state.idle = val
tick()