Commit 66bffcc5 authored by Antoine Cellerier's avatar Antoine Cellerier

Update lua intf scripts to new API (untested).

parent 009f2b02
...@@ -376,8 +376,8 @@ static const luaL_Reg vlclua_net_reg[] = { ...@@ -376,8 +376,8 @@ static const luaL_Reg vlclua_net_reg[] = {
{ "recv", vlclua_net_recv }, { "recv", vlclua_net_recv },
{ "select", vlclua_net_select }, { "select", vlclua_net_select },
{ "fd_set_new", vlclua_fd_set_new }, { "fd_set_new", vlclua_fd_set_new },
{ "fd_read", vlclua_fd_read }, { "read", vlclua_fd_read },
{ "fd_write", vlclua_fd_write }, { "write", vlclua_fd_write },
{ "stat", vlclua_stat }, /* Not really "net" */ { "stat", vlclua_stat }, /* Not really "net" */
{ "opendir", vlclua_opendir }, /* Not really "net" */ { "opendir", vlclua_opendir }, /* Not really "net" */
{ NULL, NULL } { NULL, NULL }
......
...@@ -22,4 +22,4 @@ function dialogs(...) ...@@ -22,4 +22,4 @@ function dialogs(...)
end end
_G.dialogs = dialogs _G.dialogs = dialogs
_G.vlm = vlc.vlm.new() _G.vlm = vlc.vlm()
...@@ -33,5 +33,5 @@ This dialog needs the following dialogs to be fully functional: <none> ...@@ -33,5 +33,5 @@ This dialog needs the following dialogs to be fully functional: <none>
<a href="/flash.html">Flash based remote playback</a> - <a href="/flash.html">Flash based remote playback</a> -
<a href="http://www.videolan.org">VideoLAN website</a> <a href="http://www.videolan.org">VideoLAN website</a>
<br /> <br />
<?vlc print(vlc.copyright()) ?> <?vlc print(vlc.misc.copyright()) ?>
</div> </div>
...@@ -29,15 +29,15 @@ vim:syntax=lua ...@@ -29,15 +29,15 @@ vim:syntax=lua
<?vlc <?vlc
local dir = _GET["dir"] local dir = _GET["dir"]
if dir then if dir then
if dir == "~" then dir = vlc.homedir() end if dir == "~" then dir = vlc.misc.homedir() end
dir = common.realpath(dir.."/") dir = common.realpath(dir.."/")
local d = vlc.fd.opendir(dir) local d = vlc.net.opendir(dir)
table.sort(d) table.sort(d)
for _,f in pairs(d) do for _,f in pairs(d) do
if f == ".." or not string.match(f,"^%.") then if f == ".." or not string.match(f,"^%.") then
local df = common.realpath(dir..f) local df = common.realpath(dir..f)
local s = vlc.fd.stat(df) local s = vlc.net.stat(df)
local path, name = vlc.convert_xml_special_chars( df, f ) local path, name = vlc.strings.convert_xml_special_chars( df, f )
print("<element type='"..s.type.."' size='"..s.size.."' path='"..path.."' name='"..name.."'/>\n") print("<element type='"..s.type.."' size='"..s.size.."' path='"..path.."' name='"..name.."'/>\n")
end end
end end
......
...@@ -30,14 +30,14 @@ vim:syntax=lua ...@@ -30,14 +30,14 @@ vim:syntax=lua
function print_playlist(item) function print_playlist(item)
if item.flags.disabled then return end if item.flags.disabled then return end
if item.children then if item.children then
local name = vlc.convert_xml_special_chars(item.name) local name = vlc.strings.convert_xml_special_chars(item.name)
print("<node id=\""..tostring(item.id).."\" name=\""..name.."\" ro=\""..(item.flags.ro and "ro" or "rw").."\">") print("<node id=\""..tostring(item.id).."\" name=\""..name.."\" ro=\""..(item.flags.ro and "ro" or "rw").."\">")
for _, c in ipairs(item.children) do for _, c in ipairs(item.children) do
print_playlist(c) print_playlist(c)
end end
print("</node>") print("</node>")
else else
local name, path = vlc.convert_xml_special_chars(item.name,item.path or "") local name, path = vlc.strings.convert_xml_special_chars(item.name,item.path or "")
print("<leaf id='"..tostring(item.id).."' uri='"..path.."' name='"..name.."' ro='"..(item.flags.ro and "ro" or "rw").."' duration='"..tostring(item.duration).."'/>") print("<leaf id='"..tostring(item.id).."' uri='"..path.."' name='"..name.."' ro='"..(item.flags.ro and "ro" or "rw").."' duration='"..tostring(item.duration).."'/>")
end end
end end
...@@ -64,7 +64,7 @@ if _GET["search"] then ...@@ -64,7 +64,7 @@ if _GET["search"] then
else else
_G.search_key = nil _G.search_key = nil
end end
local key = vlc.decode_uri(_GET["search"]) local key = vlc.strings.decode_uri(_GET["search"])
p = vlc.playlist.search(key) p = vlc.playlist.search(key)
else else
p = vlc.playlist.get() p = vlc.playlist.get()
......
...@@ -132,7 +132,7 @@ local vout = input and vlc.object.find(input,'vout','child') ...@@ -132,7 +132,7 @@ local vout = input and vlc.object.find(input,'vout','child')
<stats> <stats>
<?vlc <?vlc
if input then if input then
local stats = vlc.playlist.stats() local stats = vlc.input.stats()
for k,v in pairs(stats) do for k,v in pairs(stats) do
local tag = string.gsub(k,"_","") local tag = string.gsub(k,"_","")
print("<"..tag..">"..tostring(v).."</"..tag..">\n") print("<"..tag..">"..tostring(v).."</"..tag..">\n")
......
...@@ -149,7 +149,7 @@ local function print_msg(m) ...@@ -149,7 +149,7 @@ local function print_msg(m)
print("</"..m.name..">\n") print("</"..m.name..">\n")
end end
local msg = vlc.vlm.execute_command(vlm,"show") local msg = vlm:execute_command("show")
print_xml(msg) print_xml(msg)
--print_msg(msg) --print_msg(msg)
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
]]?> ]]?>
<vlm><error><?vlc <vlm><error><?vlc
if _GET["command"] then if _GET["command"] then
local msg = vlc.vlm.execute_command(vlm,_GET["command"]) local msg = vlm:execute_command(_GET["command"])
if msg.value then if msg.value then
print(msg.name,":",msg.value) print(msg.name,":",msg.value)
end end
......
...@@ -74,7 +74,7 @@ function action_trigger( action ) ...@@ -74,7 +74,7 @@ function action_trigger( action )
print("action_trigger:",tostring(action)) print("action_trigger:",tostring(action))
local a = actions[action] local a = actions[action]
if a then if a then
local date = vlc.mdate() local date = vlc.misc.mdate()
if a.delta and date > a.last + a.delta then if a.delta and date > a.last + a.delta then
a.times = 0 a.times = 0
else else
...@@ -82,9 +82,9 @@ function action_trigger( action ) ...@@ -82,9 +82,9 @@ function action_trigger( action )
end end
a.last = date a.last = date
table.insert(queue,action) table.insert(queue,action)
vlc.signal() vlc.misc.signal()
else else
vlc.msg_err("Key `"..key.."' points to unknown action `"..bindings[key].."'.") vlc.msg.err("Key `"..key.."' points to unknown action `"..bindings[key].."'.")
end end
end end
...@@ -94,7 +94,7 @@ function key_press( var, old, new, data ) ...@@ -94,7 +94,7 @@ function key_press( var, old, new, data )
if bindings[key] then if bindings[key] then
action_trigger(bindings[key]) action_trigger(bindings[key])
else else
vlc.msg_err("Key `"..key.."' isn't bound to any action.") vlc.msg.err("Key `"..key.."' isn't bound to any action.")
end end
end end
...@@ -110,7 +110,7 @@ while not die do ...@@ -110,7 +110,7 @@ while not die do
end end
table.remove(queue,1) table.remove(queue,1)
else else
die = vlc.lock_and_wait() die = vlc.misc.lock_and_wait()
end end
end end
......
...@@ -31,8 +31,6 @@ Configuration options: ...@@ -31,8 +31,6 @@ Configuration options:
--]==========================================================================] --]==========================================================================]
require "httpd"
require "acl"
require "common" require "common"
vlc.msg.info("Lua HTTP interface") vlc.msg.info("Lua HTTP interface")
...@@ -69,10 +67,10 @@ function process_raw(filename) ...@@ -69,10 +67,10 @@ function process_raw(filename)
return assert(loadstring(code,filename)) return assert(loadstring(code,filename))
end end
function process(filename) function process(filename)
local mtime = 0 -- vlc.fd.stat(filename).modification_time local mtime = 0 -- vlc.net.stat(filename).modification_time
local func = false -- process_raw(filename) local func = false -- process_raw(filename)
return function(...) return function(...)
local new_mtime = vlc.fd.stat(filename).modification_time local new_mtime = vlc.net.stat(filename).modification_time
if new_mtime ~= mtime then if new_mtime ~= mtime then
-- Re-read the file if it changed -- Re-read the file if it changed
if mtime == 0 then if mtime == 0 then
...@@ -122,7 +120,7 @@ function dirlisting(url,listing,acl_) ...@@ -122,7 +120,7 @@ function dirlisting(url,listing,acl_)
</body> </body>
</html>]] </html>]]
end end
return h:file_new(url,"text/html",nil,nil,acl_,callback,nil) return h:file(url,"text/html",nil,nil,acl_,callback,nil)
end end
function file(h,path,url,acl_,mime) function file(h,path,url,acl_,mime)
...@@ -151,15 +149,15 @@ function file(h,path,url,acl_,mime) ...@@ -151,15 +149,15 @@ function file(h,path,url,acl_,mime)
end end
return table.concat(page) return table.concat(page)
end end
return h:file_new(url or path,mime,nil,nil,acl_,callback,nil) return h:file(url or path,mime,nil,nil,acl_,callback,nil)
end end
function rawfile(h,path,url,acl_) function rawfile(h,path,url,acl_)
local filename = path local filename = path
local mtime = 0 -- vlc.fd.stat(filename).modification_time local mtime = 0 -- vlc.net.stat(filename).modification_time
local page = false -- io.open(filename):read("*a") local page = false -- io.open(filename):read("*a")
local callback = function(data,request) local callback = function(data,request)
local new_mtime = vlc.fd.stat(filename).modification_time local new_mtime = vlc.net.stat(filename).modification_time
if mtime ~= new_mtime then if mtime ~= new_mtime then
-- Re-read the file if it changed -- Re-read the file if it changed
if mtime == 0 then if mtime == 0 then
...@@ -172,15 +170,15 @@ function rawfile(h,path,url,acl_) ...@@ -172,15 +170,15 @@ function rawfile(h,path,url,acl_)
end end
return page return page
end end
return h:file_new(url or path,nil,nil,nil,acl_,callback,nil) return h:file(url or path,nil,nil,nil,acl_,callback,nil)
end end
function parse_url_request(request) function parse_url_request(request)
if not request then return {} end if not request then return {} end
t = {} t = {}
for k,v in string.gmatch(request,"([^=&]+)=?([^=&]*)") do for k,v in string.gmatch(request,"([^=&]+)=?([^=&]*)") do
local k_ = vlc.decode_uri(k) local k_ = vlc.strings.decode_uri(k)
local v_ = vlc.decode_uri(v) local v_ = vlc.strings.decode_uri(v)
if t[k_] ~= nil then if t[k_] ~= nil then
local t2 local t2
if type(t[k_]) ~= "table" then if type(t[k_]) ~= "table" then
...@@ -199,9 +197,9 @@ function parse_url_request(request) ...@@ -199,9 +197,9 @@ function parse_url_request(request)
end end
local function find_datadir(name) local function find_datadir(name)
local list = vlc.datadir_list(name) local list = vlc.misc.datadir_list(name)
for _, l in ipairs(list) do for _, l in ipairs(list) do
local s = vlc.fd.stat(l) local s = vlc.net.stat(l)
if s then if s then
return l return l
end end
...@@ -237,17 +235,17 @@ local function load_dir(dir,root,parent_acl) ...@@ -237,17 +235,17 @@ local function load_dir(dir,root,parent_acl)
local my_acl = parent_acl local my_acl = parent_acl
do do
local af = dir.."/.hosts" local af = dir.."/.hosts"
local s = vlc.fd.stat(af) local s = vlc.net.stat(af)
if s and s.type == "file" then if s and s.type == "file" then
-- We found an acl -- We found an acl
my_acl = acl.new(false) my_acl = vlc.acl(false)
my_acl:load_file(af) my_acl:load_file(af)
end end
end end
local d = vlc.fd.opendir(dir) local d = vlc.net.opendir(dir)
for _,f in ipairs(d) do for _,f in ipairs(d) do
if not string.match(f,"^%.") then if not string.match(f,"^%.") then
local s = vlc.fd.stat(dir.."/"..f) local s = vlc.net.stat(dir.."/"..f)
if s.type == "file" then if s.type == "file" then
local url local url
if f == "index.html" then if f == "index.html" then
...@@ -276,10 +274,10 @@ local function load_dir(dir,root,parent_acl) ...@@ -276,10 +274,10 @@ local function load_dir(dir,root,parent_acl)
end end
local u = vlc.net.url_parse( config.host or "localhost:8080" ) local u = vlc.net.url_parse( config.host or "localhost:8080" )
h = httpd.new(u.host,u.port) h = vlc.httpd(u.host,u.port)
load_dir( http_dir ) load_dir( http_dir )
while not die do die = vlc.lock_and_wait() end -- everything happens in callbacks while not die do die = vlc.misc.lock_and_wait() end -- everything happens in callbacks
-- FIXME: We shouldn't need to do this ourselves. -- FIXME: We shouldn't need to do this ourselves.
for i=1,#files do for i=1,#files do
......
...@@ -38,7 +38,7 @@ Example use: ...@@ -38,7 +38,7 @@ Example use:
--or h:listen( { "localhost:4212", "*console" } ) --or h:listen( { "localhost:4212", "*console" } )
-- The main loop -- The main loop
while not vlc.should_die() do while not vlc.misc.should_die() do
-- accept new connections -- accept new connections
h:accept() h:accept()
...@@ -75,24 +75,9 @@ function host() ...@@ -75,24 +75,9 @@ function host()
local listeners = {} local listeners = {}
local status_callbacks = {} local status_callbacks = {}
-- private methods
local function new_fd_set()
function foo_fds(foo)
return function(fd,...) return foo(fd.fds,...) end
end
return { -- data
fds = vlc.fd.new_fd_set(),
-- methods
zero = foo_fds( vlc.fd.fd_zero ),
set = foo_fds( vlc.fd.fd_set ),
isset = foo_fds( vlc.fd.fd_isset ),
clr = foo_fds( vlc.fd.fd_clr ),
}
end
-- private data -- private data
local fds_read = new_fd_set() local fds_read = vlc.net.fd_set_new()
local fds_write = new_fd_set() local fds_write = vlc.net.fd_set_new()
-- private methods -- private methods
local function client_accept( clients, listen ) local function client_accept( clients, listen )
...@@ -102,7 +87,7 @@ function host() ...@@ -102,7 +87,7 @@ function host()
else else
wait = 0 wait = 0
end end
return vlc.net.accept( listen, wait ) return listen:accept( wait )
end end
local function fd_client( client ) local function fd_client( client )
...@@ -130,14 +115,14 @@ function host() ...@@ -130,14 +115,14 @@ function host()
end end
local function write( client, data ) local function write( client, data )
return vlc.fd.write( client.wfd, data or client.buffer ) return vlc.net.write( client.wfd, data or client.buffer )
end end
local function read( client, len ) local function read( client, len )
if len then if len then
return vlc.fd.read( client.rfd, len ) return vlc.net.read( client.rfd, len )
else else
return vlc.fd.read( client.rfd ) return vlc.net.read( client.rfd )
end end
end end
...@@ -200,7 +185,7 @@ function host() ...@@ -200,7 +185,7 @@ function host()
switch_status = switch_status, switch_status = switch_status,
append = append, append = append,
} }
client:send( "VLC media player "..vlc.version().."\n" ) client:send( "VLC media player "..vlc.misc.version().."\n" )
table.insert(clients, client) table.insert(clients, client)
client:switch_status(status.password) client:switch_status(status.password)
end end
...@@ -274,7 +259,7 @@ function host() ...@@ -274,7 +259,7 @@ function host()
wait = 0 wait = 0
end end
for _, listener in pairs(listeners.tcp.list) do for _, listener in pairs(listeners.tcp.list) do
local fd = vlc.net.accept( listener, wait ) local fd = listener:accept( wait )
new_client( h, fd, fd, client_type.net ) new_client( h, fd, fd, client_type.net )
end end
end end
...@@ -283,7 +268,7 @@ function host() ...@@ -283,7 +268,7 @@ function host()
local function _select( h, timeout ) local function _select( h, timeout )
local nfds = math.max( filter_client( fds_read, status.read, status.password ), local nfds = math.max( filter_client( fds_read, status.read, status.password ),
filter_client( fds_write, status.write ) ) + 1 filter_client( fds_write, status.write ) ) + 1
local ret = vlc.net.select( nfds, fds_read.fds, fds_write.fds, local ret = vlc.net.select( nfds, fds_read, fds_write,
timeout or 0.5 ) timeout or 0.5 )
local wclients = {} local wclients = {}
local rclients = {} local rclients = {}
...@@ -311,12 +296,6 @@ function host() ...@@ -311,12 +296,6 @@ function host()
vlc.net.close(client.wfd) vlc.net.close(client.wfd)
end end
end end
if listeners.tcp then
for _, listener in pairs(listeners.tcp.list) do
vlc.net.listen_close( listener )
end
end
end end
local function _broadcast( h, msg ) local function _broadcast( h, msg )
......
...@@ -143,7 +143,7 @@ function shutdown(name,client) ...@@ -143,7 +143,7 @@ function shutdown(name,client)
client:append("Bye-bye!") client:append("Bye-bye!")
h:broadcast("Shutting down.") h:broadcast("Shutting down.")
vlc.msg.info("Requested shutdown.") vlc.msg.info("Requested shutdown.")
vlc.quit() vlc.misc.quit()
end end
function quit(name,client) function quit(name,client)
...@@ -323,7 +323,7 @@ function playlist_status(name,client) ...@@ -323,7 +323,7 @@ function playlist_status(name,client)
end end
function is_playing(name,client) function is_playing(name,client)
if vlc.is_playing() then client:append "1" else client:append "0" end if vlc.input.is_playing() then client:append "1" else client:append "0" end
end end
function ret_print(foo,start,stop) function ret_print(foo,start,stop)
...@@ -438,11 +438,11 @@ commands_ordered = { ...@@ -438,11 +438,11 @@ commands_ordered = {
{ "faster"; { func = rate; help = "faster playing of stream" } }; { "faster"; { func = rate; help = "faster playing of stream" } };
{ "slower"; { func = rate; help = "slower playing of stream" } }; { "slower"; { func = rate; help = "slower playing of stream" } };
{ "normal"; { func = rate; help = "normal playing of stream" } }; { "normal"; { func = rate; help = "normal playing of stream" } };
{ "fullscreen"; { func = skip2(vlc.fullscreen); args = "[on|off]"; help = "toggle fullscreen"; aliases = { "f", "F" } } }; { "fullscreen"; { func = skip2(vlc.video.fullscreen); args = "[on|off]"; help = "toggle fullscreen"; aliases = { "f", "F" } } };
{ "info"; { func = input_info; help = "information about the current stream" } }; { "info"; { func = input_info; help = "information about the current stream" } };
{ "get_time"; { func = get_time("time"); help = "seconds elapsed since stream's beginning" } }; { "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" } }; { "is_playing"; { func = is_playing; help = "1 if a stream plays, 0 otherwise" } };
{ "get_title"; { func = ret_print(vlc.get_title); help = "the title of the current stream" } }; { "get_title"; { func = ret_print(vlc.input.get_title); help = "the title of the current stream" } };
{ "get_length"; { func = get_time("length"); help = "the length 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" } }; { "volume"; { func = volume; args = "[X]"; help = "set/get audio volume" } };
...@@ -465,7 +465,7 @@ commands_ordered = { ...@@ -465,7 +465,7 @@ commands_ordered = {
{ "alias"; { func = skip(alias); args = "[cmd]"; help = "set/get command aliases"; adv = true } }; { "alias"; { func = skip(alias); args = "[cmd]"; help = "set/get command aliases"; adv = true } };
{ "eval"; { func = skip(eval); help = "eval some lua (*debug*)"; adv =true } }; -- FIXME: comment out if you're not debugging { "eval"; { func = skip(eval); help = "eval some lua (*debug*)"; adv =true } }; -- FIXME: comment out if you're not debugging
{ "description"; { func = print_text("Description",description); help = "describe this module" } }; { "description"; { func = print_text("Description",description); help = "describe this module" } };
{ "license"; { func = print_text("License message",vlc.license()); help = "print VLC's license message"; adv = true } }; { "license"; { func = print_text("License message",vlc.misc.license()); help = "print VLC's license message"; adv = true } };
{ "help"; { func = help; args = "[pattern]"; help = "a help message"; aliases = { "?" } } }; { "help"; { func = help; args = "[pattern]"; help = "a help message"; aliases = { "?" } } };
{ "longhelp"; { func = help; args = "[pattern]"; help = "a longer help message" } }; { "longhelp"; { func = help; args = "[pattern]"; help = "a longer help message" } };
{ "logout"; { func = logout; help = "exit (if in a socket connection)" } }; { "logout"; { func = logout; help = "exit (if in a socket connection)" } };
...@@ -542,7 +542,7 @@ function call_command(cmd,client,arg) ...@@ -542,7 +542,7 @@ function call_command(cmd,client,arg)
end end
function call_libvlc_command(cmd,client,arg) function call_libvlc_command(cmd,client,arg)
local ok, vlcerr, vlcmsg = pcall( vlc.libvlc_command, cmd, arg ) local ok, vlcerr, vlcmsg = pcall( vlc.var.libvlc_command, cmd, arg )
if not ok then if not ok then
local a = arg or "" local a = arg or ""
if a ~= "" then a = " " .. a end if a ~= "" then a = " " .. a end
...@@ -568,7 +568,7 @@ end ...@@ -568,7 +568,7 @@ end
h:listen( config.hosts or config.host or "*console" ) h:listen( config.hosts or config.host or "*console" )
--[[ The main loop ]] --[[ The main loop ]]
while not vlc.should_die() do while not vlc.misc.should_die() do
h:accept() h:accept()
local write, read = h:select(0.1) local write, read = h:select(0.1)
......
...@@ -101,13 +101,13 @@ h:listen( config.hosts or config.host or "localhost:4212" ) ...@@ -101,13 +101,13 @@ h:listen( config.hosts or config.host or "localhost:4212" )
password = config.password or "admin" password = config.password or "admin"
--[[ Launch vlm ]] --[[ Launch vlm ]]
vlm = vlc.vlm.new() vlm = vlc.vlm()
--[[ Commands ]] --[[ Commands ]]
function shutdown(client) function shutdown(client)
h:broadcast("Shutting down.\r\n") h:broadcast("Shutting down.\r\n")
vlc.msg.err("shutdown requested") vlc.msg.err("shutdown requested")
vlc.quit() vlc.misc.quit()
return true return true
end end
function logout(client) function logout(client)
...@@ -146,7 +146,7 @@ commands = { ...@@ -146,7 +146,7 @@ commands = {
["logout"] = { func = logout, help = "logout" }, ["logout"] = { func = logout, help = "logout" },
["lock"] = { func = lock, help = "lock the telnet prompt" }, ["lock"] = { func = lock, help = "lock the telnet prompt" },
["description"] = { func = print_text(description), help = "describe this module" }, ["description"] = { func = print_text(description), help = "describe this module" },
["license"] = { func = print_text(vlc.license()), help = "print VLC's license message" }, ["license"] = { func = print_text(vlc.misc.license()), help = "print VLC's license message" },
["help"] = { func = help, help = "show this help", dovlm = true }, ["help"] = { func = help, help = "show this help", dovlm = true },
} }
...@@ -155,7 +155,7 @@ function client_command( client ) ...@@ -155,7 +155,7 @@ function client_command( client )
client.buffer = "" client.buffer = ""
if not commands[cmd] or not commands[cmd].func or commands[cmd].dovlm then if not commands[cmd] or not commands[cmd].func or commands[cmd].dovlm then
-- if it's not an interface specific command, it has to be a VLM command -- if it's not an interface specific command, it has to be a VLM command
local message, vlc_err = vlc.vlm.execute_command( vlm, cmd ) local message, vlc_err = vlm:execute_command( cmd )
vlm_message_to_string( client, message ) vlm_message_to_string( client, message )
if not commands[cmd] or not commands[cmd].func and not commands[cmd].dovlm then if not commands[cmd] or not commands[cmd].func and not commands[cmd].dovlm then
if vlc_err ~= 0 then client:append( "Type `help' for help." ) end if vlc_err ~= 0 then client:append( "Type `help' for help." ) end
...@@ -171,7 +171,7 @@ function client_command( client ) ...@@ -171,7 +171,7 @@ function client_command( client )
end end
--[[ The main loop ]] --[[ The main loop ]]
while not vlc.should_die() do while not vlc.misc.should_die() do
h:accept() h:accept()
local w, r = h:select( 0.1 ) local w, r = h:select( 0.1 )
...@@ -219,4 +219,4 @@ while not vlc.should_die() do ...@@ -219,4 +219,4 @@ while not vlc.should_die() do
end end
--[[ Clean up ]] --[[ Clean up ]]
vlc.vlm.delete( vlm ) vlm = nil
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment