mirror of
https://github.com/mpv-player/mpv
synced 2025-01-02 21:12:23 +00:00
osc: add script message handlers for chapter/track/playlists
These can be used in input.conf for pretty formatting of lists as with shift+clicking the OSC buttons. Ex: z script-message osc-playlist Z script-message osc-chapterlist x script-message osc-tracklist
This commit is contained in:
parent
363982c774
commit
c8e3ee494c
@ -260,3 +260,7 @@ to set auto mode (the default) with ``b``::
|
||||
a script-message osc-visibility never
|
||||
b script-message osc-visibility auto
|
||||
|
||||
``osc-playlist``, ``osc-chapterlist``, ``osc-tracklist``
|
||||
Shows a limited view of the respective type of list using the OSC. First
|
||||
argument is duration in seconds.
|
||||
|
||||
|
@ -2127,6 +2127,19 @@ mp.register_event("tracks-changed", request_init)
|
||||
mp.observe_property("playlist", nil, request_init)
|
||||
|
||||
mp.register_script_message("osc-message", show_message)
|
||||
mp.register_script_message("osc-chapterlist", function(dur)
|
||||
show_message(get_chapterlist(), dur)
|
||||
end)
|
||||
mp.register_script_message("osc-playlist", function(dur)
|
||||
show_message(get_playlist(), dur)
|
||||
end)
|
||||
mp.register_script_message("osc-tracklist", function(dur)
|
||||
local msg = {}
|
||||
for k,v in pairs(nicetypes) do
|
||||
table.insert(msg, get_tracklist(k))
|
||||
end
|
||||
show_message(table.concat(msg, '\n\n'), dur)
|
||||
end)
|
||||
|
||||
mp.observe_property("fullscreen", "bool",
|
||||
function(name, val)
|
||||
|
Loading…
Reference in New Issue
Block a user