mirror of
https://github.com/Syncplay/syncplay
synced 2025-02-03 04:31:36 +00:00
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.
|
||||||
|
|
||||||
@ -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,7 +132,7 @@ 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
|
||||||
@ -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
|
||||||
@ -327,7 +337,7 @@ 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
|
||||||
|
Loading…
Reference in New Issue
Block a user