optional video fading when displaying playlist

This commit is contained in:
wood 2020-01-15 15:13:07 +03:00
parent ed408fb7e9
commit 0acc03fe66

View File

@ -9,6 +9,11 @@ local keybinds = {
local osd_time=10 local osd_time=10
--show only specified number of playlist entries --show only specified number of playlist entries
local window=7 local window=7
--fade video when showing playlist
local fade=false
--if fade=true; -100 — black, 0 — normal
local plsbrightness=-50
-- END OF CONFIGURABLE VARIABLES
local timer local timer
-- pls — список элементов плейлиста -- pls — список элементов плейлиста
@ -23,6 +28,7 @@ local cursor
local pattern="" local pattern=""
local is_active local is_active
local is_playlist_loaded local is_playlist_loaded
local saved_brtns
-- UTF-8 lower/upper conversion -- UTF-8 lower/upper conversion
local utf8_lc_uc = { local utf8_lc_uc = {
@ -229,6 +235,10 @@ function activate()
return return
else else
is_active=true is_active=true
if fade then
saved_brtns = mp.get_property("brightness")
mp.set_property("brightness", plsbrightness)
end
showplaylist() showplaylist()
add_bindings() add_bindings()
if not timer then if not timer then
@ -376,11 +386,13 @@ function showplaylist()
end end
function shutdown() function shutdown()
local c local c
remove_bindings() if fade then
mp.set_property("brightness", saved_brtns)
is_active=false end
mp.osd_message("", 1) remove_bindings()
is_active=false
mp.osd_message("", 1)
end end
function down() function down()