From 62001b25498fb26d0f625cc76e759f026a056593 Mon Sep 17 00:00:00 2001 From: Antoine Cellerier Date: Sat, 13 Feb 2010 19:20:20 +0100 Subject: [PATCH] use vlc.input.item() where appropriate --- share/lua/extensions/imdb.lua | 6 ++++-- share/lua/http/requests/status.xml | 13 +++++++------ share/lua/intf/http.lua | 3 ++- share/lua/intf/rc.lua | 8 +++++--- 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/share/lua/extensions/imdb.lua b/share/lua/extensions/imdb.lua index 0520779d85..3b519c89c8 100644 --- a/share/lua/extensions/imdb.lua +++ b/share/lua/extensions/imdb.lua @@ -37,7 +37,8 @@ end -- Update title text field. Removes file extensions. function update_title() - local title = vlc.input.get_title() + local item = vlc.item() + local title = item and item:name() if title ~= nil then title = string.gsub(title, "(.*)(%.%w+)$", "%1") end @@ -50,7 +51,8 @@ function create_dialog() dlg = vlc.dialog("IMDb Search") dlg:add_label("The Internet Movie Database", 1, 1, 4, 1) dlg:add_label("Movie Title", 1, 2, 1, 1) - txt = dlg:add_text_input(vlc.input.get_title(), 2, 2, 1, 1) + local item = vlc.item() + txt = dlg:add_text_input(item and item:name() or "", 2, 2, 1, 1) dlg:add_button("Okay", "click_okay", 3, 2, 1, 1) dlg:add_button("*", "update_title", 4, 2, 1, 1) dlg:show() -- Show, if not already visible diff --git a/share/lua/http/requests/status.xml b/share/lua/http/requests/status.xml index f2d49db67c..6523c04e7a 100644 --- a/share/lua/http/requests/status.xml +++ b/share/lua/http/requests/status.xml @@ -102,6 +102,7 @@ local id = nil local val = nil local input = vlc.object.input() +local item = vlc.input.item() local playlist = vlc.object.playlist() local vout = input and vlc.object.find(input,'vout','child') ?> @@ -118,8 +119,8 @@ local vout = input and vlc.object.find(input,'vout','child') "..vlc.strings.convert_xml_special_chars(v).."") end @@ -127,8 +128,8 @@ local vout = input and vlc.object.find(input,'vout','child') ?> ") for k2, v2 in pairs(v) do @@ -141,8 +142,8 @@ local vout = input and vlc.object.find(input,'vout','child') "..tostring(v).."\n") diff --git a/share/lua/intf/http.lua b/share/lua/intf/http.lua index 0d478ae664..c48e6bda24 100644 --- a/share/lua/intf/http.lua +++ b/share/lua/intf/http.lua @@ -140,7 +140,8 @@ end -- FIXME: Experimental art support. Needs some cleaning up. function callback_art(data, request) local art = function(data, request) - local metas = vlc.input.metas() + local item = vlc.item() + local metas = item:metas() local filename = vlc.strings.decode_uri(string.gsub(metas["artwork_url"],"file://","")) local size = vlc.net.stat(filename).size local ext = string.match(filename,"%.([^%.]-)$") diff --git a/share/lua/intf/rc.lua b/share/lua/intf/rc.lua index 92cf3ec57f..fdd5ba9529 100644 --- a/share/lua/intf/rc.lua +++ b/share/lua/intf/rc.lua @@ -313,7 +313,8 @@ function help(name,client,arg) end function input_info(name,client) - local categories = vlc.input.info() + local item = vlc.item() + local categories = item:info() for cat, infos in pairs(categories) do client:append("+----[ "..cat.." ]") client:append("|") @@ -326,7 +327,8 @@ function input_info(name,client) end function stats(name,client) - local stats_tab = vlc.input.stats() + local item = vlc.item() + local stats_tab = item:stats() client:append("+----[ begin of statistical info") client:append("+-[Incoming]") @@ -506,7 +508,7 @@ commands_ordered = { { "stats"; { func = stats; help = "show statistical information" } }; { "get_time"; { func = get_time("time"); help = "seconds elapsed since stream's beginning" } }; { "is_playing"; { func = is_playing; help = "1 if a stream plays, 0 otherwise" } }; - { "get_title"; { func = ret_print(vlc.input.get_title); help = "the title of the current stream" } }; + { "get_title"; { func = ret_print(vlc.item():name()); help = "the title of the current stream" } }; { "get_length"; { func = get_time("length"); help = "the length of the current stream" } }; { "" }; { "volume"; { func = volume; args = "[X]"; help = "set/get audio volume" } }; -- 2.39.2