summaryrefslogtreecommitdiffstats
path: root/player/lua
diff options
context:
space:
mode:
Diffstat (limited to 'player/lua')
-rw-r--r--player/lua/osc.lua20
1 files changed, 16 insertions, 4 deletions
diff --git a/player/lua/osc.lua b/player/lua/osc.lua
index f42275f5e9..643f32faaf 100644
--- a/player/lua/osc.lua
+++ b/player/lua/osc.lua
@@ -32,7 +32,8 @@ local user_opts = {
-- internal track list management (and some
-- functions that depend on it)
layout = "bottombar",
- seekbarstyle = "bar", -- slider (diamond marker) or bar (fill)
+ seekbarstyle = "bar", -- slider (diamond marker), knob (circle
+ -- marker with guide), or bar (fill)
tooltipborder = 1, -- border of tooltip in bottom/topbar
timetotal = false, -- display total time instead of remaining time?
timems = false, -- display timecodes with milliseconds?
@@ -400,7 +401,8 @@ function prepare_elements()
local foV = slider_lo.border + slider_lo.gap
-- calculate positions of min and max points
- if (slider_lo.stype == "slider") then
+ if (slider_lo.stype == "slider") or
+ (slider_lo.stype == "knob") then
element.slider.min.ele_pos = elem_geo.h / 2
element.slider.max.ele_pos = elem_geo.w - (elem_geo.h / 2)
@@ -562,7 +564,8 @@ function render_elements(master_ass)
local foV = slider_lo.border + slider_lo.gap
local foH = 0
- if (slider_lo.stype == "slider") then
+ if (slider_lo.stype == "slider") or
+ (slider_lo.stype == "knob") then
foH = elem_geo.h / 2
elseif (slider_lo.stype == "bar") then
foV = foV + 1
@@ -581,6 +584,11 @@ function render_elements(master_ass)
elem_ass:line_to(xp+(innerH/2), (innerH/2)+foV)
elem_ass:line_to(xp, (innerH)+foV)
elem_ass:line_to(xp-(innerH/2), (innerH/2)+foV)
+ elseif (slider_lo.stype == "knob") then
+ elem_ass:rect_cw(xp, (9*innerH/20)+foV, elem_geo.w - foH, (11*innerH/20)+foV)
+ elem_ass:rect_cw(foH, (3*innerH/8)+foV, xp, (5*innerH/8)+foV)
+ elem_ass:round_rect_cw(xp - innerH/2, foV, xp + innerH/2,
+ foV + innerH, innerH/2.0)
end
end
@@ -1007,6 +1015,9 @@ layouts["box"] = function ()
lo.style = osc_styles.timecodes
lo.slider.tooltip_style = osc_styles.vidtitle
lo.slider.stype = user_opts["seekbarstyle"]
+ if lo.slider.stype == "knob" then
+ lo.slider.border = 0
+ end
--
-- Timecodes + Cache
@@ -1450,7 +1461,8 @@ function validate_user_opts()
end
if user_opts.seekbarstyle ~= "slider" and
- user_opts.seekbarstyle ~= "bar" then
+ user_opts.seekbarstyle ~= "bar" and
+ user_opts.seekbarstyle ~= "knob" then
msg.warn("Invalid setting \"" .. user_opts.seekbarstyle
.. "\" for seekbarstyle")
user_opts.seekbarstyle = "slider"