Update syncplay.lua - Duration delay, instrs, tabs
This commit is contained in:
parent
d64d74eecf
commit
610feef750
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
Author: Etoh
|
Author: Etoh
|
||||||
Project: http://syncplay.pl/
|
Project: http://syncplay.pl/
|
||||||
Version: 0.0.5
|
Version: 0.0.7
|
||||||
|
|
||||||
--[==========================================================================[
|
--[==========================================================================[
|
||||||
|
|
||||||
@ -13,12 +13,14 @@
|
|||||||
Place the syncplay.lua file in one of the VLC /lua/intf/ sub-directories. By default this should be:
|
Place the syncplay.lua file in one of the VLC /lua/intf/ sub-directories. By default this should be:
|
||||||
* Windows (all users): %ProgramFiles%\VideoLAN\VLC\lua\intf\
|
* Windows (all users): %ProgramFiles%\VideoLAN\VLC\lua\intf\
|
||||||
* Windows (current user): %APPDATA%\VLC\lua\intf\
|
* Windows (current user): %APPDATA%\VLC\lua\intf\
|
||||||
* Linux (all users): /usr/share/vlc/lua/intf/
|
* Linux (all users): /usr/lib/vlc/lua/intf/
|
||||||
* Linux (current user): ~/.local/share/vlc/lua/intf/
|
* Linux (current user): ~/.local/share/vlc/lua/intf/
|
||||||
* Mac OS X (all users): /Applications/VLC.app/Contents/MacOS/share/lua/intf/
|
* Mac OS X (all users): /Applications/VLC.app/Contents/MacOS/share/lua/intf/
|
||||||
|
|
||||||
If a directory does not exist then you may have to create it.
|
If a directory does not exist then you may have to create it.
|
||||||
|
|
||||||
|
Note: You may have to copy the VLC 'modules' folder to make it a sub-directory of the 'intf' folder.
|
||||||
|
|
||||||
=== Commands and responses ===
|
=== Commands and responses ===
|
||||||
= Note: ? denotes optional responses; * denotes mandatory response; uses \n terminator.
|
= Note: ? denotes optional responses; * denotes mandatory response; uses \n terminator.
|
||||||
|
|
||||||
@ -34,13 +36,13 @@ If a directory does not exist then you may have to create it.
|
|||||||
|
|
||||||
get-interface-version
|
get-interface-version
|
||||||
* >> interface-version: [syncplay connector version]
|
* >> interface-version: [syncplay connector version]
|
||||||
|
|
||||||
get-duration
|
get-duration
|
||||||
* >> duration: [<duration/no-input>]
|
* >> duration: [<duration/no-input>]
|
||||||
|
|
||||||
get-filepath
|
get-filepath
|
||||||
* >> filepath: [<filepath/no-input>]
|
* >> filepath: [<filepath/no-input>]
|
||||||
|
|
||||||
get-filename
|
get-filename
|
||||||
* >> filepath: [<filename/no-input>]
|
* >> filepath: [<filename/no-input>]
|
||||||
|
|
||||||
@ -65,7 +67,9 @@ If a directory does not exist then you may have to create it.
|
|||||||
require "common"
|
require "common"
|
||||||
require "host"
|
require "host"
|
||||||
|
|
||||||
local connectorversion = "0.0.5"
|
local connectorversion = "0.0.7"
|
||||||
|
|
||||||
|
local durationdelay = 500000 -- Pause for get_duration command for increased reliability
|
||||||
|
|
||||||
local port
|
local port
|
||||||
|
|
||||||
@ -128,8 +132,8 @@ end
|
|||||||
|
|
||||||
function get_args (argument, argcount)
|
function get_args (argument, argcount)
|
||||||
-- Converts comma-space-seperated values into array of a given size, with last item absorbing all remaining data if needed.
|
-- Converts comma-space-seperated values into array of a given size, with last item absorbing all remaining data if needed.
|
||||||
-- [Used by the display-osd command]
|
-- [Used by the display-osd command]
|
||||||
|
|
||||||
local argarray = {}
|
local argarray = {}
|
||||||
local index
|
local index
|
||||||
local i
|
local i
|
||||||
@ -163,7 +167,7 @@ end
|
|||||||
|
|
||||||
function get_var( vartoget )
|
function get_var( vartoget )
|
||||||
-- [Used by the poll / '.' command to get time]
|
-- [Used by the poll / '.' command to get time]
|
||||||
|
|
||||||
local response
|
local response
|
||||||
local errormsg
|
local errormsg
|
||||||
local input = vlc.object.input()
|
local input = vlc.object.input()
|
||||||
@ -180,7 +184,7 @@ end
|
|||||||
|
|
||||||
function set_var(vartoset, varvalue)
|
function set_var(vartoset, varvalue)
|
||||||
-- [Used by the set-time and set-rate commands]
|
-- [Used by the set-time and set-rate commands]
|
||||||
|
|
||||||
local errormsg
|
local errormsg
|
||||||
local input = vlc.object.input()
|
local input = vlc.object.input()
|
||||||
|
|
||||||
@ -197,7 +201,7 @@ end
|
|||||||
|
|
||||||
function get_play_state()
|
function get_play_state()
|
||||||
-- [Used by the get-playstate command]
|
-- [Used by the get-playstate command]
|
||||||
|
|
||||||
local response
|
local response
|
||||||
local errormsg
|
local errormsg
|
||||||
local input = vlc.object.input()
|
local input = vlc.object.input()
|
||||||
@ -214,7 +218,7 @@ end
|
|||||||
|
|
||||||
function get_filepath ()
|
function get_filepath ()
|
||||||
-- [Used by get-filepath command]
|
-- [Used by get-filepath command]
|
||||||
|
|
||||||
local response
|
local response
|
||||||
local errormsg
|
local errormsg
|
||||||
local item
|
local item
|
||||||
@ -236,7 +240,7 @@ end
|
|||||||
|
|
||||||
function get_filename ()
|
function get_filename ()
|
||||||
-- [Used by get-filename command]
|
-- [Used by get-filename command]
|
||||||
|
|
||||||
local response
|
local response
|
||||||
local index
|
local index
|
||||||
local filename
|
local filename
|
||||||
@ -265,7 +269,13 @@ function get_duration ()
|
|||||||
if input then
|
if input then
|
||||||
local item = vlc.input.item()
|
local item = vlc.input.item()
|
||||||
if item then
|
if item then
|
||||||
response = vlc.input.item():duration()
|
-- Try to get duration, which might not be available straight away
|
||||||
|
local i = 0
|
||||||
|
repeat
|
||||||
|
vlc.misc.mwait(vlc.misc.mdate() + durationdelay)
|
||||||
|
response = vlc.input.item():duration()
|
||||||
|
i = i + 1
|
||||||
|
until response > 0 or i > 5
|
||||||
else
|
else
|
||||||
errormsg = noinput
|
errormsg = noinput
|
||||||
end
|
end
|
||||||
@ -296,7 +306,7 @@ end
|
|||||||
|
|
||||||
function do_command ( command, argument)
|
function do_command ( command, argument)
|
||||||
-- Processes all commands sent by Syncplay (see protocol, above).
|
-- Processes all commands sent by Syncplay (see protocol, above).
|
||||||
|
|
||||||
if command == "." then
|
if command == "." then
|
||||||
do return detectchanges() end
|
do return detectchanges() end
|
||||||
end
|
end
|
||||||
@ -327,8 +337,8 @@ end
|
|||||||
|
|
||||||
|
|
||||||
function errormerge(argument, errormsg)
|
function errormerge(argument, errormsg)
|
||||||
-- Used to integrate 'no-input' error messages into command responses.
|
-- Used to integrate 'no-input' error messages into command responses.
|
||||||
|
|
||||||
if (errormsg ~= nil) and (errormsg ~= "") then
|
if (errormsg ~= nil) and (errormsg ~= "") then
|
||||||
do return errormsg end
|
do return errormsg end
|
||||||
end
|
end
|
||||||
@ -338,7 +348,7 @@ end
|
|||||||
|
|
||||||
function set_playstate(argument)
|
function set_playstate(argument)
|
||||||
-- [Used by the set-playstate command]
|
-- [Used by the set-playstate command]
|
||||||
|
|
||||||
local errormsg
|
local errormsg
|
||||||
local input = vlc.object.input()
|
local input = vlc.object.input()
|
||||||
local playstate
|
local playstate
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user