[vlc-commits] add http commands to select title, chapter, subtitle track, audio track and video track
Rob Jonson
git at videolan.org
Sat Feb 11 15:32:44 CET 2012
vlc/vlc-2.0 | branch: master | Rob Jonson <rob at hobbyistsoftware.com> | Fri Feb 10 11:20:34 2012 +0000| [a8b274e7939f7d3838e2ac8c50ec1c6039464fae] | committer: Jean-Baptiste Kempf
add http commands to select title, chapter, subtitle track, audio track and video track
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
(cherry picked from commit e0092fc5cac0a52c15210ecf05e8f0f463a6f956)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=a8b274e7939f7d3838e2ac8c50ec1c6039464fae
---
share/lua/http/requests/README.txt | 19 +++++++++++++++++++
share/lua/intf/modules/httprequests.lua | 16 +++++++++++++++-
2 files changed, 34 insertions(+), 1 deletions(-)
diff --git a/share/lua/http/requests/README.txt b/share/lua/http/requests/README.txt
index 5cba1fd..95d1f4e 100644
--- a/share/lua/http/requests/README.txt
+++ b/share/lua/http/requests/README.txt
@@ -149,6 +149,25 @@ Band 0: 60 Hz, 1: 170 Hz, 2: 310 Hz, 3: 600 Hz, 4: 1 kHz,
<Display the list of presets available for the equalizer
+---
+Commands available from API version 2
+---
+
+> select the title
+ ?command=title&val=<val>
+
+> select the chapter
+ ?command=title&val=<val>
+
+> select the audio track (use the number from the stream)
+ ?command=audio_track&val=<val>
+
+> select the video track (use the number from the stream)
+ ?command=video_track&val=<val>
+
+> select the sibtitle track (use the number from the stream)
+ ?command=subtitle_track&val=<val>
+
playlist.xml or playlist.json:
=============
< get the full playlist tree
diff --git a/share/lua/intf/modules/httprequests.lua b/share/lua/intf/modules/httprequests.lua
index 56805ab..262f618 100644
--- a/share/lua/intf/modules/httprequests.lua
+++ b/share/lua/intf/modules/httprequests.lua
@@ -177,6 +177,16 @@ processcommands = function ()
if val == '0' then vlc.equalizer.enable(false) else vlc.equalizer.enable(true) end
elseif command == "setpreset" then
vlc.equalizer.setpreset(val)
+ elseif command == "title" then
+ vlc.var.set(vlc.object.input(), "title", val)
+ elseif command == "chapter" then
+ vlc.var.set(vlc.object.input(), "chapter", val)
+ elseif command == "audio_track" then
+ vlc.var.set(vlc.object.input(), "audio-es", val)
+ elseif command == "video_track" then
+ vlc.var.set(vlc.object.input(), "video-es", val)
+ elseif command == "subtitle_track" then
+ vlc.var.set(vlc.object.input(), "spu-es", val)
end
local input = nil
@@ -423,7 +433,7 @@ local aout = vlc.object.aout()
local s ={}
--update api version when new data/commands added
- s.apiversion=1
+ s.apiversion=2
s.version=vlc.misc.version()
s.volume=vlc.volume.get()
@@ -505,6 +515,10 @@ local aout = vlc.object.aout()
local tag = string.gsub(k,"_","")
s.stats[tag]=v
end
+
+ s.information.chapters=vlc.var.get_list(input, "chapter")
+ s.information.titles=vlc.var.get_list(input, "title")
+
end
return s
end
More information about the vlc-commits
mailing list