mirror of
https://github.com/Syncplay/syncplay
synced 2025-01-23 23:32:48 +00:00
Update syncplay.lua - Duration delay, instrs, tabs
This commit is contained in:
parent
d64d74eecf
commit
610feef750
@ -4,7 +4,7 @@
|
||||
|
||||
Author: Etoh
|
||||
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:
|
||||
* Windows (all users): %ProgramFiles%\VideoLAN\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/
|
||||
* 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.
|
||||
|
||||
Note: You may have to copy the VLC 'modules' folder to make it a sub-directory of the 'intf' folder.
|
||||
|
||||
=== Commands and responses ===
|
||||
= 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 "host"
|
||||
|
||||
local connectorversion = "0.0.5"
|
||||
local connectorversion = "0.0.7"
|
||||
|
||||
local durationdelay = 500000 -- Pause for get_duration command for increased reliability
|
||||
|
||||
local port
|
||||
|
||||
@ -265,7 +269,13 @@ function get_duration ()
|
||||
if input then
|
||||
local item = vlc.input.item()
|
||||
if item then
|
||||
-- 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
|
||||
errormsg = noinput
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user