From c8e3ee494cc5ca73f54d5ae24bbf03fc3e42d15d Mon Sep 17 00:00:00 2001 From: Ricardo Constantino Date: Sun, 23 Oct 2016 22:20:08 +0100 Subject: 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 --- player/lua/osc.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'player/lua') 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) -- cgit v1.2.3