Fix VLC title bug(?) etc
This commit is contained in:
parent
69c03bdaa5
commit
69a67acf34
@ -142,8 +142,9 @@ function detectchanges()
|
|||||||
notificationbuffer = notificationbuffer .. "filepath-change"..notificationmarker..msgterminator
|
notificationbuffer = notificationbuffer .. "filepath-change"..notificationmarker..msgterminator
|
||||||
end
|
end
|
||||||
|
|
||||||
newtitle = get_var("title")
|
local titleerror
|
||||||
if newtitle ~= oldtitle and get_var("time") > 1 then
|
newtitle, titleerror = get_var("title", 0)
|
||||||
|
if newtitle ~= oldtitle and get_var("time", 0) > 1 then
|
||||||
vlc.misc.mwait(vlc.misc.mdate() + durationdelay) -- Don't give new title with old time
|
vlc.misc.mwait(vlc.misc.mdate() + durationdelay) -- Don't give new title with old time
|
||||||
end
|
end
|
||||||
oldtitle = newtitle
|
oldtitle = newtitle
|
||||||
@ -198,7 +199,7 @@ function get_args (argument, argcount)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function get_var( vartoget )
|
function get_var( vartoget, fallbackvar )
|
||||||
-- [Used by the poll / '.' command to get time]
|
-- [Used by the poll / '.' command to get time]
|
||||||
|
|
||||||
local response
|
local response
|
||||||
@ -208,6 +209,7 @@ function get_var( vartoget )
|
|||||||
if input then
|
if input then
|
||||||
response = vlc.var.get(input,tostring(vartoget))
|
response = vlc.var.get(input,tostring(vartoget))
|
||||||
else
|
else
|
||||||
|
response = fallbackvar
|
||||||
errormsg = noinput
|
errormsg = noinput
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -231,17 +233,18 @@ function set_var(vartoset, varvalue)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function get_time()
|
function get_time()
|
||||||
local realtime, errormsg, longtime
|
local realtime, errormsg, longtime, title, titletime
|
||||||
realtime, errormsg = get_var("time") -- Seconds
|
realtime, errormsg = get_var("time", 0) -- Seconds
|
||||||
if errormsg ~= nil and errormsg ~= "" then
|
if errormsg ~= nil and errormsg ~= "" then
|
||||||
return errormsg
|
return errormsg
|
||||||
end
|
end
|
||||||
|
|
||||||
titletime, errormsg = get_var("title") * titlemultiplier -- Weeks
|
title = get_var("title", 0)
|
||||||
|
|
||||||
if errormsg ~= nil and errormsg ~= "" then
|
if errormsg ~= nil and errormsg ~= "" then
|
||||||
return realtime
|
return realtime
|
||||||
end
|
end
|
||||||
|
titletime = title * titlemultiplier -- weeks
|
||||||
longtime = titletime + realtime
|
longtime = titletime + realtime
|
||||||
return longtime
|
return longtime
|
||||||
end
|
end
|
||||||
@ -251,7 +254,7 @@ function set_time ( timetoset)
|
|||||||
if input then
|
if input then
|
||||||
local response, errormsg, realtime, titletrack
|
local response, errormsg, realtime, titletrack
|
||||||
realtime = timetoset % titlemultiplier
|
realtime = timetoset % titlemultiplier
|
||||||
oldtitle = tonumber(get_var("title"))
|
oldtitle = tonumber(get_var("title", 0))
|
||||||
newtitle = (timetoset - realtime) / titlemultiplier
|
newtitle = (timetoset - realtime) / titlemultiplier
|
||||||
if oldtitle ~= newtitle and newtitle > -1 then
|
if oldtitle ~= newtitle and newtitle > -1 then
|
||||||
set_var("title", tonumber(newtitle))
|
set_var("title", tonumber(newtitle))
|
||||||
@ -263,8 +266,6 @@ function set_time ( timetoset)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
get_var("time")
|
|
||||||
|
|
||||||
function get_play_state()
|
function get_play_state()
|
||||||
-- [Used by the get-playstate command]
|
-- [Used by the get-playstate command]
|
||||||
|
|
||||||
@ -421,7 +422,7 @@ function do_command ( command, argument)
|
|||||||
elseif command == "get-duration" then response = "duration"..msgseperator..errormerge(get_duration())..msgterminator
|
elseif command == "get-duration" then response = "duration"..msgseperator..errormerge(get_duration())..msgterminator
|
||||||
elseif command == "get-filepath" then response = "filepath"..msgseperator..errormerge(get_filepath())..msgterminator
|
elseif command == "get-filepath" then response = "filepath"..msgseperator..errormerge(get_filepath())..msgterminator
|
||||||
elseif command == "get-filename" then response = "filename"..msgseperator..errormerge(get_filename())..msgterminator
|
elseif command == "get-filename" then response = "filename"..msgseperator..errormerge(get_filename())..msgterminator
|
||||||
elseif command == "get-title" then response = "title"..msgseperator..errormerge(get_var("title"))..msgterminator
|
elseif command == "get-title" then response = "title"..msgseperator..errormerge(get_var("title", 0))..msgterminator
|
||||||
elseif command == "set-position" then errormsg = set_time(tonumber(argument))
|
elseif command == "set-position" then errormsg = set_time(tonumber(argument))
|
||||||
elseif command == "seek-within-title" then errormsg = set_var("time", tonumber(argument))
|
elseif command == "seek-within-title" then errormsg = set_var("time", tonumber(argument))
|
||||||
elseif command == "set-playstate" then errormsg = set_playstate(argument)
|
elseif command == "set-playstate" then errormsg = set_playstate(argument)
|
||||||
@ -480,7 +481,7 @@ end
|
|||||||
while running == true do
|
while running == true do
|
||||||
--accept new connections and select active clients
|
--accept new connections and select active clients
|
||||||
local fd = l:accept()
|
local fd = l:accept()
|
||||||
local buffer = ""
|
local buffer, inputbuffer, responsebuffer = ""
|
||||||
while fd >= 0 and running == true do
|
while fd >= 0 and running == true do
|
||||||
|
|
||||||
-- handle read mode
|
-- handle read mode
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user