diff options
author | Ricardo Constantino <wiiaboo@gmail.com> | 2016-10-23 22:20:08 +0100 |
---|---|---|
committer | Ricardo Constantino <wiiaboo@gmail.com> | 2016-10-24 19:03:07 +0100 |
commit | c8e3ee494cc5ca73f54d5ae24bbf03fc3e42d15d (patch) | |
tree | a035a18fb6b98b73bd959fa5478edd8de669fd9d /player | |
parent | 363982c77445e02a169d4fcbd013e2814bab90d6 (diff) | |
download | mpv-c8e3ee494cc5ca73f54d5ae24bbf03fc3e42d15d.tar.bz2 mpv-c8e3ee494cc5ca73f54d5ae24bbf03fc3e42d15d.tar.xz |
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
Diffstat (limited to 'player')
-rw-r--r-- | player/lua/osc.lua | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/player/lua/osc.lua b/player/lua/osc.lua index fec1eb07cb..7c88c9ca4c 100644 --- a/player/lua/osc.lua +++ b/player/lua/osc.lua @@ -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) |