Merge pull request #220 from Syncplay/vlc-copy-intf to address #193

Auto copy/update syncplay.lua when running with VLC (addresses #193)
This commit is contained in:
Etoh 2019-02-10 12:44:00 +00:00 committed by GitHub
commit a0a06c61f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 102 additions and 218 deletions

View File

@ -29,7 +29,6 @@ install:
- for /F "tokens=2 delims='" %%a in ('findstr version syncplay\__init__.py') do @set ver=%%a - for /F "tokens=2 delims='" %%a in ('findstr version syncplay\__init__.py') do @set ver=%%a
- python buildPy2exe.py - python buildPy2exe.py
- type nul > syncplay_v%ver%\syncplay.ini - type nul > syncplay_v%ver%\syncplay.ini
- copy resources\win_lua_note.txt syncplay_v%ver%\"VLC LUA Script installation.txt"
# Not a project with an msbuild file, build done at install. # Not a project with an msbuild file, build done at install.
build: off build: off

View File

@ -1,5 +1,5 @@
language: objective-c language: objective-c
osx_image: xcode7.3 osx_image: xcode8.3
branches: branches:
only: only:
@ -10,18 +10,12 @@ script:
before_install: before_install:
- brew update - brew update
- cd $(brew --repo homebrew/core)
#- git fetch --depth=20000
- git checkout 80860911cd26d9df62f3cc30575ed2076019ed1a
- cd $TRAVIS_BUILD_DIR
- brew upgrade python - brew upgrade python
- which python3 - which python3
- python3 --version - python3 --version
- which pip3 - which pip3
- pip3 --version - pip3 --version
- brew install pyside - brew install pyside
- ln -s /usr/local/lib/python3.7/site-packages/PySide2/libpyside2.cpython-37m-darwin.5.11.dylib /usr/local/lib/
- ln -s /usr/local/lib/python3.7/site-packages/PySide2/libshiboken2.cpython-37m-darwin.5.11.dylib /usr/local/lib/
- python3 -c "from PySide2 import __version__; print(__version__)" - python3 -c "from PySide2 import __version__; print(__version__)"
- python3 -c "from PySide2.QtCore import __version__; print(__version__)" - python3 -c "from PySide2.QtCore import __version__; print(__version__)"
- pip3 install py2app - pip3 install py2app
@ -33,8 +27,6 @@ install:
before_deploy: before_deploy:
- pip3 install dmgbuild - pip3 install dmgbuild
- mkdir dist_dmg - mkdir dist_dmg
- mv resources/macos_vlc_install.command resources/.macos_vlc_install.command
- mv resources/lua/intf/syncplay.lua resources/lua/intf/.syncplay.lua
- mv resources/macOS_readme.pdf resources/.macOS_readme.pdf - mv resources/macOS_readme.pdf resources/.macOS_readme.pdf
- export VER="$(cat syncplay/__init__.py | awk '/version/ {gsub("\047", "", $3); print $NF}')" - export VER="$(cat syncplay/__init__.py | awk '/version/ {gsub("\047", "", $3); print $NF}')"
- dmgbuild -s appdmg.py "Syncplay" dist_dmg/Syncplay_${VER}.dmg - dmgbuild -s appdmg.py "Syncplay" dist_dmg/Syncplay_${VER}.dmg

View File

@ -1,9 +1,5 @@
SINGLE_USER = false SINGLE_USER = false
ifndef VLC_SUPPORT
VLC_SUPPORT = true
endif
ifeq ($(shell uname)),FreeBSD) ifeq ($(shell uname)),FreeBSD)
BSD = true BSD = true
endif endif
@ -69,13 +65,6 @@ client:
ifeq ($(SINGLE_USER),false) ifeq ($(SINGLE_USER),false)
chmod 755 $(APP_SHORTCUT_PATH)/syncplay.desktop chmod 755 $(APP_SHORTCUT_PATH)/syncplay.desktop
endif endif
ifeq ($(VLC_SUPPORT),true)
-mkdir -p ${DESTDIR}$(VLC_LIB_PATH)/vlc/lua/intf/
cp resources/lua/intf/syncplay.lua ${DESTDIR}$(VLC_LIB_PATH)/vlc/lua/intf/
-mkdir -p ${DESTDIR}$(VLC_LIB_PATH64)/vlc/lua/intf/
cp resources/lua/intf/syncplay.lua ${DESTDIR}$(VLC_LIB_PATH64)/vlc/lua/intf/
endif
u-client: u-client:
-rm $(BIN_PATH)/syncplay -rm $(BIN_PATH)/syncplay

View File

@ -31,15 +31,12 @@ size = defines.get('size', None)
# Files to include # Files to include
files = [ files = [
application, application,
'resources/lua/intf/.syncplay.lua',
'resources/.macos_vlc_install.command',
'resources/.macOS_readme.pdf' 'resources/.macOS_readme.pdf'
] ]
# Symlinks to create # Symlinks to create
symlinks = { symlinks = {
'Applications': '/Applications', 'Applications': '/Applications',
'Install for VLC': '.macos_vlc_install.command',
'Read Me': '.macOS_readme.pdf' 'Read Me': '.macOS_readme.pdf'
} }
@ -54,10 +51,9 @@ badge_icon = icon_from_app(application)
# Where to put the icons # Where to put the icons
icon_locations = { icon_locations = {
appname: (150, 110), appname: (90, 110),
'Applications': (450, 110), 'Applications': (410, 110),
'Read Me': (100, 285), 'Read Me': (250, 240),
'Install for VLC': (500, 285)
} }
# .. Window configuration ...................................................... # .. Window configuration ......................................................
@ -92,7 +88,7 @@ show_sidebar = False
sidebar_width = 180 sidebar_width = 180
# Window position in ((x, y), (w, h)) format # Window position in ((x, y), (w, h)) format
window_rect = ((100, 100), (600, 460)) window_rect = ((100, 100), (500, 400))
# Select the default view; must be one of # Select the default view; must be one of
# #

View File

@ -28,7 +28,7 @@ OPTIONS = {
'CFBundleName': 'Syncplay', 'CFBundleName': 'Syncplay',
'CFBundleShortVersionString': syncplay.version, 'CFBundleShortVersionString': syncplay.version,
'CFBundleIdentifier': 'pl.syncplay.Syncplay', 'CFBundleIdentifier': 'pl.syncplay.Syncplay',
'LSMinimumSystemVersion': '10.11.0', 'LSMinimumSystemVersion': '10.12.0',
'NSHumanReadableCopyright': 'Copyright © 2019 Syncplay All Rights Reserved' 'NSHumanReadableCopyright': 'Copyright © 2019 Syncplay All Rights Reserved'
} }
} }

View File

@ -95,8 +95,6 @@ NSIS_SCRIPT_TEMPLATE = r"""
LangString ^SyncplayLanguage $${LANG_ENGLISH} "en" LangString ^SyncplayLanguage $${LANG_ENGLISH} "en"
LangString ^Associate $${LANG_ENGLISH} "Associate Syncplay with multimedia files." LangString ^Associate $${LANG_ENGLISH} "Associate Syncplay with multimedia files."
LangString ^VLC $${LANG_ENGLISH} "Install Syncplay interface for VLC 2 and above"
LangString ^BrowseVLCBtn $${LANG_ENGLISH} "Select VLC folder"
LangString ^Shortcut $${LANG_ENGLISH} "Create Shortcuts in following locations:" LangString ^Shortcut $${LANG_ENGLISH} "Create Shortcuts in following locations:"
LangString ^StartMenu $${LANG_ENGLISH} "Start Menu" LangString ^StartMenu $${LANG_ENGLISH} "Start Menu"
LangString ^Desktop $${LANG_ENGLISH} "Desktop" LangString ^Desktop $${LANG_ENGLISH} "Desktop"
@ -106,8 +104,6 @@ NSIS_SCRIPT_TEMPLATE = r"""
LangString ^SyncplayLanguage $${LANG_POLISH} "pl" LangString ^SyncplayLanguage $${LANG_POLISH} "pl"
LangString ^Associate $${LANG_POLISH} "Skojarz Syncplaya z multimediami" LangString ^Associate $${LANG_POLISH} "Skojarz Syncplaya z multimediami"
LangString ^VLC $${LANG_POLISH} "Zainstaluj interface Syncplaya dla VLC 2+"
LangString ^BrowseVLCBtn $${LANG_POLISH} "Określ folder VLC"
LangString ^Shortcut $${LANG_POLISH} "Utworz skroty w nastepujacych miejscach:" LangString ^Shortcut $${LANG_POLISH} "Utworz skroty w nastepujacych miejscach:"
LangString ^StartMenu $${LANG_POLISH} "Menu Start" LangString ^StartMenu $${LANG_POLISH} "Menu Start"
LangString ^Desktop $${LANG_POLISH} "Pulpit" LangString ^Desktop $${LANG_POLISH} "Pulpit"
@ -116,8 +112,6 @@ NSIS_SCRIPT_TEMPLATE = r"""
LangString ^SyncplayLanguage $${LANG_RUSSIAN} "ru" LangString ^SyncplayLanguage $${LANG_RUSSIAN} "ru"
LangString ^Associate $${LANG_RUSSIAN} "Ассоциировать Syncplay с видеофайлами" LangString ^Associate $${LANG_RUSSIAN} "Ассоциировать Syncplay с видеофайлами"
LangString ^VLC $${LANG_RUSSIAN} "Установить интерфейс Syncplay для VLC 2+"
LangString ^BrowseVLCBtn $${LANG_RUSSIAN} "Укажите папку VLC"
LangString ^Shortcut $${LANG_RUSSIAN} "Создать ярлыки:" LangString ^Shortcut $${LANG_RUSSIAN} "Создать ярлыки:"
LangString ^StartMenu $${LANG_RUSSIAN} "в меню Пуск" LangString ^StartMenu $${LANG_RUSSIAN} "в меню Пуск"
LangString ^Desktop $${LANG_RUSSIAN} "на рабочем столе" LangString ^Desktop $${LANG_RUSSIAN} "на рабочем столе"
@ -127,9 +121,7 @@ NSIS_SCRIPT_TEMPLATE = r"""
LangString ^SyncplayLanguage $${LANG_GERMAN} "de" LangString ^SyncplayLanguage $${LANG_GERMAN} "de"
LangString ^Associate $${LANG_GERMAN} "Syncplay als Standardprogramm für Multimedia-Dateien verwenden." LangString ^Associate $${LANG_GERMAN} "Syncplay als Standardprogramm für Multimedia-Dateien verwenden."
LangString ^VLC $${LANG_GERMAN} "Syncplay-Interface für VLC installieren (ab VLC 2+)"
LangString ^Shortcut $${LANG_GERMAN} "Erstelle Verknüpfungen an folgenden Orten:" LangString ^Shortcut $${LANG_GERMAN} "Erstelle Verknüpfungen an folgenden Orten:"
LangString ^BrowseVLCBtn $${LANG_GERMAN} "VLC-Ordner wählen"
LangString ^StartMenu $${LANG_GERMAN} "Startmenü" LangString ^StartMenu $${LANG_GERMAN} "Startmenü"
LangString ^Desktop $${LANG_GERMAN} "Desktop" LangString ^Desktop $${LANG_GERMAN} "Desktop"
LangString ^QuickLaunchBar $${LANG_GERMAN} "Schnellstartleiste" LangString ^QuickLaunchBar $${LANG_GERMAN} "Schnellstartleiste"
@ -138,8 +130,6 @@ NSIS_SCRIPT_TEMPLATE = r"""
LangString ^SyncplayLanguage $${LANG_ITALIAN} "it" LangString ^SyncplayLanguage $${LANG_ITALIAN} "it"
LangString ^Associate $${LANG_ITALIAN} "Associa Syncplay con i file multimediali." LangString ^Associate $${LANG_ITALIAN} "Associa Syncplay con i file multimediali."
LangString ^VLC $${LANG_ITALIAN} "Installa l'interfaccia di Syncplay per VLC 2+"
LangString ^BrowseVLCBtn $${LANG_ITALIAN} "Cartella di VLC"
LangString ^Shortcut $${LANG_ITALIAN} "Crea i collegamenti nei percorsi seguenti:" LangString ^Shortcut $${LANG_ITALIAN} "Crea i collegamenti nei percorsi seguenti:"
LangString ^StartMenu $${LANG_ITALIAN} "Menu Start" LangString ^StartMenu $${LANG_ITALIAN} "Menu Start"
LangString ^Desktop $${LANG_ITALIAN} "Desktop" LangString ^Desktop $${LANG_ITALIAN} "Desktop"
@ -163,19 +153,16 @@ NSIS_SCRIPT_TEMPLATE = r"""
Var Icon_Syncplay Var Icon_Syncplay
Var Icon_Syncplay_Handle Var Icon_Syncplay_Handle
;Var CheckBox_Associate ;Var CheckBox_Associate
Var CheckBox_VLC
Var CheckBox_AutomaticUpdates Var CheckBox_AutomaticUpdates
Var CheckBox_StartMenuShortcut Var CheckBox_StartMenuShortcut
Var CheckBox_DesktopShortcut Var CheckBox_DesktopShortcut
Var CheckBox_QuickLaunchShortcut Var CheckBox_QuickLaunchShortcut
;Var CheckBox_Associate_State ;Var CheckBox_Associate_State
Var CheckBox_VLC_State
Var CheckBox_AutomaticUpdates_State Var CheckBox_AutomaticUpdates_State
Var CheckBox_StartMenuShortcut_State Var CheckBox_StartMenuShortcut_State
Var CheckBox_DesktopShortcut_State Var CheckBox_DesktopShortcut_State
Var CheckBox_QuickLaunchShortcut_State Var CheckBox_QuickLaunchShortcut_State
Var Button_Browse Var Button_Browse
Var Button_Browse_VLC
Var Directory Var Directory
Var GroupBox_DirSub Var GroupBox_DirSub
Var Label_Text Var Label_Text
@ -234,8 +221,6 @@ NSIS_SCRIPT_TEMPLATE = r"""
;StrCpy $$CheckBox_Associate_State $${BST_CHECKED} ;StrCpy $$CheckBox_Associate_State $${BST_CHECKED}
StrCpy $$CheckBox_StartMenuShortcut_State $${BST_CHECKED} StrCpy $$CheckBox_StartMenuShortcut_State $${BST_CHECKED}
Call GetVLCDir
Call UpdateVLCCheckbox
Call GetSize Call GetSize
Call DriveSpace Call DriveSpace
@ -297,38 +282,26 @@ NSIS_SCRIPT_TEMPLATE = r"""
;$${NSD_CreateCheckBox} 8u 59u 187u 10u "$$(^Associate)" ;$${NSD_CreateCheckBox} 8u 59u 187u 10u "$$(^Associate)"
;Pop $$CheckBox_Associate ;Pop $$CheckBox_Associate
$${NSD_CreateBrowseButton} 185u 70u 70u 14u "$$(^BrowseVLCBtn)" $${NSD_CreateCheckBox} 8u 72u 250u 10u "$$(^AutomaticUpdates)"
Pop $$Button_Browse_VLC
$${NSD_OnClick} $$Button_Browse_VLC DirectoryBrowseDialogVLC
$${NSD_CreateCheckBox} 8u 72u 250u 10u "$$(^VLC)"
Pop $$CheckBox_VLC
$${NSD_CreateCheckBox} 8u 85u 250u 10u "$$(^AutomaticUpdates)"
Pop $$CheckBox_AutomaticUpdates Pop $$CheckBox_AutomaticUpdates
$${NSD_Check} $$CheckBox_AutomaticUpdates $${NSD_Check} $$CheckBox_AutomaticUpdates
$${NSD_CreateLabel} 8u 98u 187u 10u "$$(^Shortcut)" $${NSD_CreateLabel} 8u 95u 187u 10u "$$(^Shortcut)"
Pop $$Label_Shortcut Pop $$Label_Shortcut
$${NSD_CreateCheckbox} 8u 111u 60u 10u "$$(^StartMenu)" $${NSD_CreateCheckbox} 8u 105u 60u 10u "$$(^StartMenu)"
Pop $$CheckBox_StartMenuShortcut Pop $$CheckBox_StartMenuShortcut
$${NSD_CreateCheckbox} 78u 111u 70u 10u "$$(^Desktop)" $${NSD_CreateCheckbox} 78u 105u 70u 10u "$$(^Desktop)"
Pop $$CheckBox_DesktopShortcut Pop $$CheckBox_DesktopShortcut
$${NSD_CreateCheckbox} 158u 111u 130u 10u "$$(^QuickLaunchBar)" $${NSD_CreateCheckbox} 158u 105u 130u 10u "$$(^QuickLaunchBar)"
Pop $$CheckBox_QuickLaunchShortcut Pop $$CheckBox_QuickLaunchShortcut
;$${If} $$CheckBox_Associate_State == $${BST_CHECKED} ;$${If} $$CheckBox_Associate_State == $${BST_CHECKED}
; $${NSD_Check} $$CheckBox_Associate ; $${NSD_Check} $$CheckBox_Associate
;$${EndIf} ;$${EndIf}
$${If} $$CheckBox_VLC_State == $${BST_CHECKED}
$${NSD_Check} $$CheckBox_VLC
$${EndIf}
Call UpdateVLCCheckbox
$${If} $$CheckBox_StartMenuShortcut_State == $${BST_CHECKED} $${If} $$CheckBox_StartMenuShortcut_State == $${BST_CHECKED}
$${NSD_Check} $$CheckBox_StartMenuShortcut $${NSD_Check} $$CheckBox_StartMenuShortcut
@ -355,7 +328,6 @@ NSIS_SCRIPT_TEMPLATE = r"""
Function DirectoryCustomLeave Function DirectoryCustomLeave
$${NSD_GetText} $$Text_Directory $$INSTDIR $${NSD_GetText} $$Text_Directory $$INSTDIR
;$${NSD_GetState} $$CheckBox_Associate $$CheckBox_Associate_State ;$${NSD_GetState} $$CheckBox_Associate $$CheckBox_Associate_State
$${NSD_GetState} $$CheckBox_VLC $$CheckBox_VLC_State
$${NSD_GetState} $$CheckBox_AutomaticUpdates $$CheckBox_AutomaticUpdates_State $${NSD_GetState} $$CheckBox_AutomaticUpdates $$CheckBox_AutomaticUpdates_State
$${NSD_GetState} $$CheckBox_StartMenuShortcut $$CheckBox_StartMenuShortcut_State $${NSD_GetState} $$CheckBox_StartMenuShortcut $$CheckBox_StartMenuShortcut_State
$${NSD_GetState} $$CheckBox_DesktopShortcut $$CheckBox_DesktopShortcut_State $${NSD_GetState} $$CheckBox_DesktopShortcut $$CheckBox_DesktopShortcut_State
@ -374,47 +346,6 @@ NSIS_SCRIPT_TEMPLATE = r"""
Abort Abort
FunctionEnd FunctionEnd
Function GetVLCDir
IfFileExists "$$VLC_Directory\vlc.exe" VLCFound 0
ReadRegStr $$VLC_Directory HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Syncplay" "VLCInstallLocation"
IfFileExists "$$VLC_Directory\vlc.exe" VLCFound 0
ReadRegStr $$VLC_Directory HKLM "Software\VideoLAN\VLC" "InstallDir"
IfFileExists "$$VLC_Directory\vlc.exe" VLCFound 0
StrCpy $$VLC_Directory "c:\program files (x86)\videolan\vlc"
IfFileExists "$$VLC_Directory\vlc.exe" VLCFound 0
StrCpy $$VLC_Directory "c:\program files\videolan\vlc"
IfFileExists "$$VLC_Directory\vlc.exe" VLCFound 0
StrCpy $$VLC_Directory ""
VLCFound:
FunctionEnd
Function UpdateVLCCheckbox
IfFileExists "$$VLC_Directory\vlc.exe" VLC_Enabled VLC_Disabled
VLC_Enabled:
EnableWindow $$CheckBox_VLC 1
StrCpy $$CheckBox_VLC_State $${BST_CHECKED}
$${NSD_SetState} $$CheckBox_VLC $$CheckBox_VLC_State
goto CheckboxUpdated
VLC_Disabled:
EnableWindow $$CheckBox_VLC 0
StrCpy $$CheckBox_VLC_State $${BST_UNCHECKED}
$${NSD_SetState} $$CheckBox_VLC $$CheckBox_VLC_State
CheckboxUpdated:
FunctionEnd
Function DirectoryBrowseDialogVLC
nsDialogs::SelectFolderDialog $$(^BrowseVLCBtn) $$VLC_Directory
Pop $$Directory
$${If} $$Directory != error
StrCpy $$VLC_Directory $$Directory
Call UpdateVLCCheckbox
$${EndIf}
Abort
FunctionEnd
Function GetSize Function GetSize
StrCpy $$Size "$totalSize" StrCpy $$Size "$totalSize"
IntOp $$Size $$Size / 1024 IntOp $$Size $$Size / 1024
@ -452,13 +383,6 @@ NSIS_SCRIPT_TEMPLATE = r"""
$${If} $$CheckBox_QuickLaunchShortcut_State == $${BST_CHECKED} $${If} $$CheckBox_QuickLaunchShortcut_State == $${BST_CHECKED}
CreateShortCut "$$QUICKLAUNCH\Syncplay.lnk" "$$INSTDIR\Syncplay.exe" "" CreateShortCut "$$QUICKLAUNCH\Syncplay.lnk" "$$INSTDIR\Syncplay.exe" ""
$${EndIf} $${EndIf}
$${If} $$CheckBox_VLC_State == $${BST_CHECKED}
IfFileExists "$$VLC_Directory\vlc.exe" 0 EndOfVLC
SetOutPath $$VLC_Directory\lua\intf
File resources\lua\intf\syncplay.lua
EndOfVLC:
$${EndIf}
FunctionEnd FunctionEnd
;Associates extensions with Syncplay ;Associates extensions with Syncplay
@ -494,7 +418,6 @@ NSIS_SCRIPT_TEMPLATE = r"""
WriteRegStr HKLM SOFTWARE\Syncplay "Install_Dir" "$$INSTDIR" WriteRegStr HKLM SOFTWARE\Syncplay "Install_Dir" "$$INSTDIR"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Syncplay" "DisplayName" "Syncplay" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Syncplay" "DisplayName" "Syncplay"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Syncplay" "InstallLocation" "$$INSTDIR" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Syncplay" "InstallLocation" "$$INSTDIR"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Syncplay" "VLCInstallLocation" "$$VLC_Directory"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Syncplay" "UninstallString" '"$$INSTDIR\uninstall.exe"' WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Syncplay" "UninstallString" '"$$INSTDIR\uninstall.exe"'
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Syncplay" "DisplayIcon" "$$INSTDIR\resources\icon.ico" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Syncplay" "DisplayIcon" "$$INSTDIR\resources\icon.ico"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Syncplay" "Publisher" "Syncplay" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Syncplay" "Publisher" "Syncplay"

View File

@ -5,7 +5,7 @@
Principal author: Etoh Principal author: Etoh
Other contributors: DerGenaue, jb, Pilotat Other contributors: DerGenaue, jb, Pilotat
Project: https://syncplay.pl/ Project: https://syncplay.pl/
Version: 0.3.4 Version: 0.3.5
Note: Note:
* This interface module is intended to be used in conjunction with Syncplay. * This interface module is intended to be used in conjunction with Syncplay.
@ -17,13 +17,7 @@
=== Installation instructions === === Installation instructions ===
Place the syncplay.lua file in the main (all user) VLC /lua/intf/ sub-directory: Syncplay should install this automatically to your user folder.
* Window: %ProgramFiles%\VideoLAN\VLC\lua\intf\
* Linux: /usr/lib/vlc/lua/intf/ or /usr/lib64/vlc/lua/intf/ or /usr/lib/x86_64-linux-gnu/vlc/lua/intf on some systems (look for where the .luac files are)
* Mac OS X: /Applications/VLC.app/Contents/MacOS/share/lua/intf/
* FreeBSD, OpenBSD etc.: /usr/local/lib/vlc/lua/intf/
You may also need to re-copy the syncplay.lua file when you update VLC.
=== 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.
@ -84,7 +78,7 @@ You may also need to re-copy the syncplay.lua file when you update VLC.
--]==========================================================================] --]==========================================================================]
local connectorversion = "0.3.4" local connectorversion = "0.3.5"
local vlcversion = vlc.misc.version() local vlcversion = vlc.misc.version()
local vlcmajorversion = tonumber(vlcversion:sub(1,1)) -- get the major version of VLC local vlcmajorversion = tonumber(vlcversion:sub(1,1)) -- get the major version of VLC
local durationdelay = 500000 -- Pause for get_duration command etc for increased reliability (uses microseconds) local durationdelay = 500000 -- Pause for get_duration command etc for increased reliability (uses microseconds)

Binary file not shown.

Binary file not shown.

View File

@ -1,5 +0,0 @@
#!/bin/sh
mkdir -p $HOME/Library/Application\ Support/org.videolan.vlc/lua/intf/
cp /Volumes/Syncplay/.syncplay.lua $HOME/Library/Application\ Support/org.videolan.vlc/lua/intf/syncplay.lua

View File

@ -1,6 +0,0 @@
You must follow the following instructions to use Syncplay with VLC:
Place the syncplay.lua file from /resources/lua/intf/ into the main (all user) VLC /lua/intf/ sub-directory:
* Window: %ProgramFiles%\VideoLAN\VLC\lua\intf\
Note: A version of these instructions is also available from http://syncplay.pl/LUA

View File

@ -102,7 +102,7 @@ COMMANDS_TOGGLE = ['t', 'toggle']
MPC_MIN_VER = "1.6.4" MPC_MIN_VER = "1.6.4"
MPC_BE_MIN_VER = "1.5.2.3123" MPC_BE_MIN_VER = "1.5.2.3123"
VLC_MIN_VERSION = "2.2.1" VLC_MIN_VERSION = "2.2.1"
VLC_INTERFACE_MIN_VERSION = "0.3.4" VLC_INTERFACE_VERSION = "0.3.5"
VLC_LATENCY_ERROR_THRESHOLD = 2.0 VLC_LATENCY_ERROR_THRESHOLD = 2.0
MPV_UNRESPONSIVE_THRESHOLD = 60.0 MPV_UNRESPONSIVE_THRESHOLD = 60.0
CONTROLLED_ROOMS_MIN_VERSION = "1.3.0" CONTROLLED_ROOMS_MIN_VERSION = "1.3.0"

View File

@ -94,9 +94,6 @@ de = {
"language-changed-msgbox-label": "Die Sprache wird geändert, wenn du Syncplay neu startest.", "language-changed-msgbox-label": "Die Sprache wird geändert, wenn du Syncplay neu startest.",
"promptforupdate-label": "Soll Syncplay regelmäßig nach Updates suchen?", "promptforupdate-label": "Soll Syncplay regelmäßig nach Updates suchen?",
"vlc-interface-version-mismatch": "Du nutzt Version {} des VLC-Syncplay Interface-Moduls, Syncplay benötigt aber mindestens Version {}. In der Syncplay-Anleitung unter https://syncplay.pl/guide/ [Englisch] findest du Details zur Installation des syncplay.lua-Skripts.", # VLC interface version, VLC interface min version
"vlc-interface-oldversion-warning": "Warnung: Es ist eine alte Version des Syncplay Interface-Moduls für VLC im VLC-Verzeichnis installiert. In der Syncplay-Anleitung unter https://syncplay.pl/guide/ [Englisch] findest du Details zur Installation des syncplay.lua-Skripts.",
"vlc-interface-not-installed": "Warnung: Es wurde kein Syncplay Interface-Modul für VLC im VLC-Verzeichnis gefunden. Daher wird, wenn du VLC 2.0 nutzt, die syncplay.lua die mit Syncplay mitgeliefert wurde, verwendet. Dies bedeutet allerdings, dass keine anderen Interface-Skripts und Erweiterungen geladen werden. In der Syncplay-Anleitung unter https://syncplay.pl/guide/ [Englisch] findest du Details zur Installation des syncplay.lua-Skripts.",
"media-player-latency-warning": "Warnung: Der Mediaplayer brauchte {} Sekunden zum Antworten. Wenn Probleme bei der Synchronisation auftreten, schließe bitte andere Anwendungen, um Ressourcen freizugeben. Sollte das nicht funktionieren, versuche es mit einem anderen Media-Player.", # Seconds to respond "media-player-latency-warning": "Warnung: Der Mediaplayer brauchte {} Sekunden zum Antworten. Wenn Probleme bei der Synchronisation auftreten, schließe bitte andere Anwendungen, um Ressourcen freizugeben. Sollte das nicht funktionieren, versuche es mit einem anderen Media-Player.", # Seconds to respond
"mpv-unresponsive-error": "MPV hat für {} Sekunden nicht geantwortet und scheint abgestürzt zu sein. Bitte starte Syncplay neu.", # Seconds to respond "mpv-unresponsive-error": "MPV hat für {} Sekunden nicht geantwortet und scheint abgestürzt zu sein. Bitte starte Syncplay neu.", # Seconds to respond

View File

@ -94,9 +94,6 @@ en = {
"language-changed-msgbox-label": "Language will be changed when you run Syncplay.", "language-changed-msgbox-label": "Language will be changed when you run Syncplay.",
"promptforupdate-label": "Is it okay for Syncplay to automatically check for updates from time to time?", "promptforupdate-label": "Is it okay for Syncplay to automatically check for updates from time to time?",
"vlc-interface-version-mismatch": "You are running version {} of the Syncplay interface module for VLC, but Syncplay is designed to run with version {} and above. Please refer to the Syncplay User Guide at https://syncplay.pl/guide/ for instructions on how to install syncplay.lua.", # VLC interface version, VLC interface min version
"vlc-interface-oldversion-warning": "Warning: Syncplay detected that an old version version of the Syncplay interface module for VLC was installed in the VLC directory. Please refer to the Syncplay User Guide at https://syncplay.pl/guide/ for instructions on how to install syncplay.lua.",
"vlc-interface-not-installed": "Warning: The Syncplay interface module for VLC was not found in the VLC directory. As such, if you are running VLC 2.0 then VLC will use the syncplay.lua module contained within the Syncplay directory, but this will mean that other custom interface scripts and extensions will not work. Please refer to the Syncplay User Guide at https://syncplay.pl/guide/ for instructions on how to install syncplay.lua.",
"media-player-latency-warning": "Warning: The media player took {} seconds to respond. If you experience syncing issues then close applications to free up system resources, and if that doesn't work then try a different media player.", # Seconds to respond "media-player-latency-warning": "Warning: The media player took {} seconds to respond. If you experience syncing issues then close applications to free up system resources, and if that doesn't work then try a different media player.", # Seconds to respond
"mpv-unresponsive-error": "mpv has not responded for {} seconds so appears to have malfunctioned. Please restart Syncplay.", # Seconds to respond "mpv-unresponsive-error": "mpv has not responded for {} seconds so appears to have malfunctioned. Please restart Syncplay.", # Seconds to respond

View File

@ -94,10 +94,7 @@ it = {
"language-changed-msgbox-label": "La lingua sarà cambiata quando avvierai Syncplay.", "language-changed-msgbox-label": "La lingua sarà cambiata quando avvierai Syncplay.",
"promptforupdate-label": "Ti piacerebbe che, di tanto in tanto, Syncplay controllasse automaticamente la presenza di aggiornamenti?", "promptforupdate-label": "Ti piacerebbe che, di tanto in tanto, Syncplay controllasse automaticamente la presenza di aggiornamenti?",
"vlc-interface-version-mismatch": "Stai eseguendo la versione {} del modulo di interfaccia per VLC di Syncplay, ma Syncplay è progettato per essere utilizzato con la versione {} o superiore. Per favore, fai riferimento alla User Guide di Syncplay presso https://syncplay.pl/guide/ per istruzioni su come installare syncplay.lua.", # VLC interface version, VLC interface min version
"vlc-interface-oldversion-warning": "Attenzione: Syncplay ha rilevato una vecchia versione del modulo di interfaccia per VLC di Syncplay installata nella cartella di VLC. Per favore, fai riferimento alla User Guide di Syncplay presso https://syncplay.pl/guide/ per istruzioni su come installare syncplay.lua.",
"media-player-latency-warning": "Attenzione: il media player ha impiegato {} secondi per rispondere. Se stai avendo problemi di sincronizzazione, chiudi delle applicazioni per liberare le risorse di sistema e, se ciò non dovesse avere alcun effetto, prova un altro media player.", # Seconds to respond "media-player-latency-warning": "Attenzione: il media player ha impiegato {} secondi per rispondere. Se stai avendo problemi di sincronizzazione, chiudi delle applicazioni per liberare le risorse di sistema e, se ciò non dovesse avere alcun effetto, prova un altro media player.", # Seconds to respond
"vlc-interface-not-installed": "Attenzione: il modulo di interfaccia per VLC di Syncplay non è stato trovato nella cartella di VLC. Se stai utilizzando VLC 2.0, VLC userà il modulo syncplay.lua contenuto nella cartella di Syncplay, ma ciò significa che altri custom script di interfaccia ed estensioni non funzioneranno. Per favore, fai riferimento alla User Guide di Syncplay presso https://syncplay.pl/guide/ per istruzioni su come installare syncplay.lua.",
"mpv-unresponsive-error": "mpv non ha risposto per {} secondi, quindi sembra non funzionare correttamente. Per favore, riavvia Syncplay.", # Seconds to respond "mpv-unresponsive-error": "mpv non ha risposto per {} secondi, quindi sembra non funzionare correttamente. Per favore, riavvia Syncplay.", # Seconds to respond
# Client prompts # Client prompts

View File

@ -94,9 +94,6 @@ ru = {
"language-changed-msgbox-label": "Язык переключится при следующем запуске Syncplay.", "language-changed-msgbox-label": "Язык переключится при следующем запуске Syncplay.",
"promptforupdate-label": "Вы не против, если Syncplay будет автоматически изредка проверять наличие обновлений?", "promptforupdate-label": "Вы не против, если Syncplay будет автоматически изредка проверять наличие обновлений?",
"vlc-interface-version-mismatch": "Вы используете модуль интерфейса Syncplay устаревшей версии {} для VLC. К сожалению, Syncplay способен работать с версией {} и выше. Пожалуйста, обратитесь к Руководству Пользователя Syncplay (https://syncplay.pl/guide/) за инструкциями о том, как установить syncplay.lua.", # VLC interface version, VLC interface min version
"vlc-interface-oldversion-warning": "Внимание: Syncplay обнаружил, что старая версия модуля интерфейса Syncplay для VLC уже установлена в директорию VLC. Пожалуйста, обратитесь к Руководству Пользователя Syncplay (https://syncplay.pl/guide/) за инструкциями о том, как установить syncplay.lua.",
"vlc-interface-not-installed": "Внимание: Модуль интерфейса Syncplay для VLC не обнаружен в директории VLC. По существу, если Вы используете VLC 2.0, то VLC будет использовать модуль syncplay.lua из директории Syncplay, но в таком случае другие пользовательские скрипты и расширения интерфейса не будут работать. Пожалуйста, обратитесь к Руководству Пользователя Syncplay (https://syncplay.pl/guide/) за инструкциями о том, как установить syncplay.lua.",
"media-player-latency-warning": "Внимание: У Вашего проигрывателя слишком большой отклик ({} секунд). Если Вы замечаете проблемы с синхронизацией, то закройте ресурсоемкие приложения. Если это не помогло - попробуйте другой проигрыватель.", # Seconds to respond "media-player-latency-warning": "Внимание: У Вашего проигрывателя слишком большой отклик ({} секунд). Если Вы замечаете проблемы с синхронизацией, то закройте ресурсоемкие приложения. Если это не помогло - попробуйте другой проигрыватель.", # Seconds to respond
"mpv-unresponsive-error": "mpv не отвечает {} секунд, по-видимому, произошел сбой. Пожалуйста, перезапустите Syncplay.", # Seconds to respond "mpv-unresponsive-error": "mpv не отвечает {} секунд, по-видимому, произошел сбой. Пожалуйста, перезапустите Syncplay.", # Seconds to respond

View File

@ -341,23 +341,6 @@ class VlcPlayer(BasePlayer):
call.append(filePath) call.append(filePath)
else: else:
call.append(self.__playerController.getMRL(filePath)) call.append(self.__playerController.getMRL(filePath))
def _usevlcintf(vlcIntfPath, vlcIntfUserPath):
vlcSyncplayInterfacePath = vlcIntfPath + "syncplay.lua"
if not os.path.isfile(vlcSyncplayInterfacePath):
vlcSyncplayInterfacePath = vlcIntfUserPath + "syncplay.lua"
if os.path.isfile(vlcSyncplayInterfacePath):
with open(vlcSyncplayInterfacePath, 'rU') as interfacefile:
for line in interfacefile:
if "local connectorversion" in line:
interface_version = line[26:31]
if utils.meetsMinVersion(interface_version, constants.VLC_INTERFACE_MIN_VERSION):
return True
else:
self.oldIntfVersion = line[26:31]
return False
playerController._client.ui.showErrorMessage(getMessage("vlc-interface-not-installed"))
return False
if isLinux(): if isLinux():
playerController.vlcIntfPath = "/usr/lib/vlc/lua/intf/" playerController.vlcIntfPath = "/usr/lib/vlc/lua/intf/"
playerController.vlcIntfUserPath = os.path.join(os.getenv('HOME', '.'), ".local/share/vlc/lua/intf/") playerController.vlcIntfUserPath = os.path.join(os.getenv('HOME', '.'), ".local/share/vlc/lua/intf/")
@ -374,18 +357,55 @@ class VlcPlayer(BasePlayer):
playerController.vlcIntfPath = os.path.dirname(playerPath).replace("\\", "/") + "/lua/intf/" playerController.vlcIntfPath = os.path.dirname(playerPath).replace("\\", "/") + "/lua/intf/"
playerController.vlcIntfUserPath = os.path.join(os.getenv('APPDATA', '.'), "VLC\\lua\\intf\\") playerController.vlcIntfUserPath = os.path.join(os.getenv('APPDATA', '.'), "VLC\\lua\\intf\\")
playerController.vlcModulePath = playerController.vlcIntfPath + "modules/?.luac" playerController.vlcModulePath = playerController.vlcIntfPath + "modules/?.luac"
if _usevlcintf(playerController.vlcIntfPath, playerController.vlcIntfUserPath): def _createIntfFolder(vlcSyncplayInterfaceDir):
playerController.SLAVE_ARGS.append( self.__playerController._client.ui.showDebugMessage("Checking if syncplay.lua intf directory exists")
'--lua-config=syncplay={{port=\"{}\"}}'.format(str(playerController.vlcport))) from pathlib import Path
else: if os.path.exists(vlcSyncplayInterfaceDir):
if isLinux(): self.__playerController._client.ui.showDebugMessage("Found syncplay.lua intf directory:'{}'".format(vlcSyncplayInterfaceDir))
playerController.vlcDataPath = "/usr/lib/syncplay/resources"
else: else:
playerController.vlcDataPath = utils.findWorkingDir() + "\\resources" self.__playerController._client.ui.showDebugMessage("syncplay.lua intf directory not found, so creating directory '{}'".format(vlcSyncplayInterfaceDir))
playerController.SLAVE_ARGS.append('--data-path={}'.format(playerController.vlcDataPath)) Path(vlcSyncplayInterfaceDir).mkdir(mode=0o755, parents=True, exist_ok=True)
playerController.SLAVE_ARGS.append( def _intfNeedsUpdating(vlcSyncplayInterfacePath):
'--lua-config=syncplay={{modulepath=\"{}\",port=\"{}\"}}'.format( self.__playerController._client.ui.showDebugMessage("Checking if '{}' exists and if it is the expected version".format(vlcSyncplayInterfacePath))
playerController.vlcModulePath, str(playerController.vlcport))) if not os.path.isfile(vlcSyncplayInterfacePath):
self.__playerController._client.ui.showDebugMessage("syncplay.lua not found, so file needs copying")
return True
if os.path.isfile(vlcSyncplayInterfacePath):
with open(vlcSyncplayInterfacePath, 'rU') as interfacefile:
for line in interfacefile:
if "local connectorversion" in line:
interface_version = line[26:31]
if interface_version == constants.VLC_INTERFACE_VERSION:
self.__playerController._client.ui.showDebugMessage("syncplay.lua exists and is expected version, so no file needs copying")
return False
else:
self.oldIntfVersion = line[26:31]
self.__playerController._client.ui.showDebugMessage("syncplay.lua is {} but expected version is {} so file needs to be copied".format(interface_version, constants.VLC_INTERFACE_VERSION))
return True
self.__playerController._client.ui.showDebugMessage("Up-to-dateness checks failed, so copy the file.")
return True
if _intfNeedsUpdating(os.path.join(playerController.vlcIntfUserPath, "syncplay.lua")):
try:
_createIntfFolder(playerController.vlcIntfUserPath)
copyForm = utils.findResourcePath("syncplay.lua")
copyTo = os.path.join(playerController.vlcIntfUserPath, "syncplay.lua")
self.__playerController._client.ui.showDebugMessage("Copying VLC Lua Interface from '{}' to '{}'".format(copyForm, copyTo))
import shutil
if os.path.exists(copyTo):
os.chmod(copyTo, 0o755)
shutil.copyfile(copyForm, copyTo)
os.chmod(copyTo, 0o755)
except Exception as e:
playerController._client.ui.showErrorMessage(e)
return
if isLinux():
playerController.vlcDataPath = "/usr/lib/syncplay/resources"
else:
playerController.vlcDataPath = utils.findWorkingDir() + "\\resources"
playerController.SLAVE_ARGS.append('--data-path={}'.format(playerController.vlcDataPath))
playerController.SLAVE_ARGS.append(
'--lua-config=syncplay={{modulepath=\"{}\",port=\"{}\"}}'.format(
playerController.vlcModulePath, str(playerController.vlcport)))
call.extend(playerController.SLAVE_ARGS) call.extend(playerController.SLAVE_ARGS)
if args: if args:
@ -395,49 +415,43 @@ class VlcPlayer(BasePlayer):
self._vlcclosed = vlcClosed self._vlcclosed = vlcClosed
self._vlcVersion = None self._vlcVersion = None
if self.oldIntfVersion: if isWindows() and getattr(sys, 'frozen', '') and getattr(sys, '_MEIPASS', '') is not None: # Needed for pyinstaller --onefile bundle
self.__playerController.drop( self.__process = subprocess.Popen(
getMessage("vlc-interface-version-mismatch").format( call, stdin=subprocess.PIPE, stderr=subprocess.PIPE, stdout=subprocess.PIPE,
self.oldIntfVersion, constants.VLC_INTERFACE_MIN_VERSION)) shell=False, creationflags=0x08000000)
else: else:
if isWindows() and getattr(sys, 'frozen', '') and getattr(sys, '_MEIPASS', '') is not None: # Needed for pyinstaller --onefile bundle self.__process = subprocess.Popen(call, stderr=subprocess.PIPE, stdout=subprocess.PIPE)
self.__process = subprocess.Popen( self.timeVLCLaunched = time.time()
call, stdin=subprocess.PIPE, stderr=subprocess.PIPE, stdout=subprocess.PIPE, if self._shouldListenForSTDOUT():
shell=False, creationflags=0x08000000) for line in iter(self.__process.stderr.readline, ''):
else: line = line.decode('utf-8')
self.__process = subprocess.Popen(call, stderr=subprocess.PIPE, stdout=subprocess.PIPE) self.vlcHasResponded = True
self.timeVLCLaunched = time.time() self.timeVLCLaunched = None
if self._shouldListenForSTDOUT(): if "[syncplay]" in line:
for line in iter(self.__process.stderr.readline, ''): if "Listening on host" in line:
line = line.decode('utf-8') break
self.vlcHasResponded = True if "Hosting Syncplay" in line:
self.timeVLCLaunched = None break
if "[syncplay]" in line: elif "Couldn't find lua interface" in line:
if "Listening on host" in line: playerController._client.ui.showErrorMessage(
break getMessage("vlc-failed-noscript").format(line), True)
if "Hosting Syncplay" in line: break
break elif "lua interface error" in line:
elif "Couldn't find lua interface" in line: playerController._client.ui.showErrorMessage(
playerController._client.ui.showErrorMessage( getMessage("media-player-error").format(line), True)
getMessage("vlc-failed-noscript").format(line), True) break
break if not isMacOS():
elif "lua interface error" in line: self.__process.stderr = None
playerController._client.ui.showErrorMessage( else:
getMessage("media-player-error").format(line), True) vlcoutputthread = threading.Thread(target=self.handle_vlcoutput, args=())
break vlcoutputthread.setDaemon(True)
if not isMacOS(): vlcoutputthread.start()
self.__process.stderr = None threading.Thread.__init__(self, name="VLC Listener")
else: asynchat.async_chat.__init__(self)
vlcoutputthread = threading.Thread(target=self.handle_vlcoutput, args=()) self.set_terminator(b'\n')
vlcoutputthread.setDaemon(True) self._ibuffer = []
vlcoutputthread.start() self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
threading.Thread.__init__(self, name="VLC Listener") self._sendingData = threading.Lock()
asynchat.async_chat.__init__(self)
self.set_terminator(b'\n')
self._ibuffer = []
self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
self._sendingData = threading.Lock()
def _shouldListenForSTDOUT(self): def _shouldListenForSTDOUT(self):
return not isWindows() return not isWindows()

View File

@ -1109,8 +1109,8 @@ class ConfigDialog(QtWidgets.QDialog):
if lang == self.config['language']: if lang == self.config['language']:
self.languageCombobox.setCurrentIndex(self.languageCombobox.count()-1) self.languageCombobox.setCurrentIndex(self.languageCombobox.count()-1)
self.languageCombobox.currentIndexChanged.connect(self.languageChanged) self.languageCombobox.currentIndexChanged.connect(self.languageChanged)
self.languageLayout.addWidget(self.languageLabel, 1, 0) self.languageLayout.addWidget(self.languageLabel, 1, Qt.AlignLeft)
self.languageLayout.addWidget(self.languageCombobox, 1, 1) self.languageLayout.addWidget(self.languageCombobox, 1, Qt.AlignLeft)
self.displaySettingsLayout.addWidget(self.languageFrame) self.displaySettingsLayout.addWidget(self.languageFrame)
self.languageLabel.setObjectName("language") self.languageLabel.setObjectName("language")

View File

@ -147,7 +147,7 @@ def isASCII(s):
def findResourcePath(resourceName): def findResourcePath(resourceName):
if resourceName == "syncplay.lua": if resourceName == "syncplay.lua":
resourcePath = os.path.join(findWorkingDir(), "lua", "intf", "resources", resourceName) resourcePath = os.path.join(findWorkingDir(),"resources", "lua", "intf", resourceName)
else: else:
resourcePath = os.path.join(findWorkingDir(), "resources", resourceName) resourcePath = os.path.join(findWorkingDir(), "resources", resourceName)
return resourcePath return resourcePath