From 097327f6e3ad8d2d94f6d3feb624479215b6e935 Mon Sep 17 00:00:00 2001 From: nilsding Date: Thu, 14 Aug 2014 20:43:37 +0200 Subject: [PATCH 1/5] added support for several BSDs --- resources/lua/intf/syncplay.lua | 1 + syncplay/constants.py | 4 +++- syncplay/players/vlc.py | 5 +++++ syncplay/ui/GuiConfiguration.py | 2 ++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/resources/lua/intf/syncplay.lua b/resources/lua/intf/syncplay.lua index 79eaa48..c86c9a9 100644 --- a/resources/lua/intf/syncplay.lua +++ b/resources/lua/intf/syncplay.lua @@ -21,6 +21,7 @@ Place the syncplay.lua file in the main (all user) VLC /lua/intf/ sub-directory: * Window: %ProgramFiles%\VideoLAN\VLC\lua\intf\ * Linux: /usr/lib/vlc/lua/intf/ * 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. diff --git a/syncplay/constants.py b/syncplay/constants.py index 31613bf..01814c3 100644 --- a/syncplay/constants.py +++ b/syncplay/constants.py @@ -70,7 +70,9 @@ VLC_PATHS = [ r"C:\Program Files\VideoLAN\VLC\vlc.exe", "/usr/bin/vlc", "/usr/bin/vlc-wrapper", - "/Applications/VLC.app/Contents/MacOS/VLC" + "/Applications/VLC.app/Contents/MacOS/VLC", + "/usr/local/bin/vlc", + "/usr/local/bin/vlc-wrapper" ] VLC_ICONPATH = "vlc.png" diff --git a/syncplay/players/vlc.py b/syncplay/players/vlc.py index ba3145f..30d8bd0 100644 --- a/syncplay/players/vlc.py +++ b/syncplay/players/vlc.py @@ -256,6 +256,11 @@ class VlcPlayer(BasePlayer): elif sys.platform.startswith('darwin'): playerController.vlcIntfPath = "/Applications/VLC.app/Contents/MacOS/share/lua/intf/" playerController.vlcIntfUserPath = os.path.join(os.getenv('HOME', '.'), "Library/Application Support/org.videolan.vlc/lua/intf/") + elif 'bsd' in sys.platform or sys.platform.startswith('dragonfly'): + # *BSD ports/pkgs install to /usr/local by default. + # This should also work for all the other BSDs, such as OpenBSD or DragonFly. + playerController.vlcIntfPath = "/usr/local/lib/vlc/lua/intf/" + playerController.vlcIntfUserPath = os.path.join(os.getenv('HOME', '.'), ".local/share/vlc/lua/intf/") else: playerController.vlcIntfPath = os.path.dirname(playerPath).replace("\\", "/") + "/lua/intf/" playerController.vlcIntfUserPath = os.path.join(os.getenv('APPDATA', '.'), "VLC\\lua\\intf\\") diff --git a/syncplay/ui/GuiConfiguration.py b/syncplay/ui/GuiConfiguration.py index a10f506..5dc2960 100644 --- a/syncplay/ui/GuiConfiguration.py +++ b/syncplay/ui/GuiConfiguration.py @@ -131,6 +131,8 @@ class ConfigDialog(QtGui.QDialog): defaultdirectory = "/usr/bin" elif sys.platform.startswith('darwin'): defaultdirectory = "/Applications/" + elif "bsd" in sys.platform or sys.platform.startswith('dragonfly'): + defaultdirectory = "/usr/local/bin" fileName, filtr = QtGui.QFileDialog.getOpenFileName(self, "Browse for media player executable", From b414910a819f5a6513f4b29f6cb77f2a938f2be3 Mon Sep 17 00:00:00 2001 From: nilsding Date: Thu, 14 Aug 2014 20:51:39 +0200 Subject: [PATCH 2/5] renamed Makefile to GNUmakefile because it is specific to GNU Make --- GNUmakefile | 96 +++++++++++++++++++++++++++++++++++++++++++++++++ Makefile | 101 +++------------------------------------------------- 2 files changed, 101 insertions(+), 96 deletions(-) create mode 100644 GNUmakefile diff --git a/GNUmakefile b/GNUmakefile new file mode 100644 index 0000000..c7c57c3 --- /dev/null +++ b/GNUmakefile @@ -0,0 +1,96 @@ +SINGLE_USER = false + +ifndef VLC_SUPPORT + VLC_SUPPORT = true +endif + +ifeq ($(SINGLE_USER),false) + BASE_PATH = /usr + VLC_LIB_PATH = ${PREFIX}/usr/lib +else + BASE_PATH = ${HOME}/.local + VLC_LIB_PATH = ${HOME}/.local/share +endif + + BIN_PATH = ${PREFIX}$(BASE_PATH)/bin + LIB_PATH = ${PREFIX}$(BASE_PATH)/lib + APP_SHORTCUT_PATH = ${PREFIX}$(BASE_PATH)/share/applications + SHARE_PATH = ${PREFIX}$(BASE_PATH)/share + +common: + -mkdir -p $(LIB_PATH)/syncplay/resources/ + -mkdir -p $(LIB_PATH)/syncplay/resources/lua + -mkdir -p $(LIB_PATH)/syncplay/resources/lua/intf + -mkdir -p $(APP_SHORTCUT_PATH) + -mkdir -p $(SHARE_PATH)/app-install/icons + -mkdir -p $(SHARE_PATH)/pixmaps/ + cp -r syncplay $(LIB_PATH)/syncplay/ + chmod 755 $(LIB_PATH)/syncplay/ + cp -r resources/hicolor $(SHARE_PATH)/icons/ + cp -r resources/*.png $(LIB_PATH)/syncplay/resources/ + cp -r resources/lua/intf/*.lua $(LIB_PATH)/syncplay/resources/lua/intf/ + cp resources/hicolor/48x48/apps/syncplay.png $(SHARE_PATH)/app-install/icons/ + cp resources/hicolor/48x48/apps/syncplay.png $(SHARE_PATH)/pixmaps/ + +u-common: + -rm -rf $(LIB_PATH)/syncplay + -rm $(SHARE_PATH)/icons/hicolor/*/apps/syncplay.png + -rm $(SHARE_PATH)/app-install/icons/syncplay.png + -rm $(SHARE_PATH)/pixmaps/syncplay.png + +client: + -mkdir -p $(BIN_PATH) + cp syncplayClient.py $(BIN_PATH)/syncplay + sed -i -e 's%# libpath%site.addsitedir\("$(BASE_PATH)/lib/syncplay"\)%' $(BIN_PATH)/syncplay + chmod 755 $(BIN_PATH)/syncplay + cp syncplayClient.py $(LIB_PATH)/syncplay/ + cp resources/syncplay.desktop $(APP_SHORTCUT_PATH)/ + +ifeq ($(SINGLE_USER),false) + chmod 755 $(APP_SHORTCUT_PATH)/syncplay.desktop +endif + +ifeq ($(VLC_SUPPORT),true) + -mkdir -p $(VLC_LIB_PATH)/vlc/lua/intf/ + cp resources/lua/intf/syncplay.lua $(VLC_LIB_PATH)/vlc/lua/intf/ +endif + +u-client: + -rm $(BIN_PATH)/syncplay + -rm $(LIB_PATH)/syncplay/syncplayClient.py + -rm $(VLC_LIB_PATH)/vlc/lua/intf/syncplay.lua + -rm $(APP_SHORTCUT_PATH)/syncplay.desktop + +server: + -mkdir -p $(BIN_PATH) + cp syncplayServer.py $(BIN_PATH)/syncplay-server + sed -i -e 's%# libpath%site.addsitedir\("$(BASE_PATH)/lib/syncplay"\)%' $(BIN_PATH)/syncplay-server + chmod 755 $(BIN_PATH)/syncplay-server + cp syncplayServer.py $(LIB_PATH)/syncplay/ + cp resources/syncplay-server.desktop $(APP_SHORTCUT_PATH)/ + +ifeq ($(SINGLE_USER),false) + chmod 755 $(APP_SHORTCUT_PATH)/syncplay-server.desktop +endif + +u-server: + -rm $(BIN_PATH)/syncplay-server + -rm $(LIB_PATH)/syncplay/syncplayServer.py + -rm $(APP_SHORTCUT_PATH)/syncplay-server.desktop + +warnings: +ifeq ($(SINGLE_USER),true) + @echo -e "\n**********\n**********\n \nRemeber to add ${HOME}/.local/bin to your \$$PATH with 'echo \"export PATH=\$$PATH:${HOME}/.local/bin\" >> ${HOME}/.profile' \nThis will take effect after you logoff.\n \n**********\n**********\n" +endif + +install-client: common client warnings + +uninstall-client: u-client u-common + +install-server: common server warnings + +uninstall-server: u-server u-common + +install: common client server warnings + +uninstall: u-client u-server u-common diff --git a/Makefile b/Makefile index c7c57c3..ee87b94 100644 --- a/Makefile +++ b/Makefile @@ -1,96 +1,5 @@ -SINGLE_USER = false - -ifndef VLC_SUPPORT - VLC_SUPPORT = true -endif - -ifeq ($(SINGLE_USER),false) - BASE_PATH = /usr - VLC_LIB_PATH = ${PREFIX}/usr/lib -else - BASE_PATH = ${HOME}/.local - VLC_LIB_PATH = ${HOME}/.local/share -endif - - BIN_PATH = ${PREFIX}$(BASE_PATH)/bin - LIB_PATH = ${PREFIX}$(BASE_PATH)/lib - APP_SHORTCUT_PATH = ${PREFIX}$(BASE_PATH)/share/applications - SHARE_PATH = ${PREFIX}$(BASE_PATH)/share - -common: - -mkdir -p $(LIB_PATH)/syncplay/resources/ - -mkdir -p $(LIB_PATH)/syncplay/resources/lua - -mkdir -p $(LIB_PATH)/syncplay/resources/lua/intf - -mkdir -p $(APP_SHORTCUT_PATH) - -mkdir -p $(SHARE_PATH)/app-install/icons - -mkdir -p $(SHARE_PATH)/pixmaps/ - cp -r syncplay $(LIB_PATH)/syncplay/ - chmod 755 $(LIB_PATH)/syncplay/ - cp -r resources/hicolor $(SHARE_PATH)/icons/ - cp -r resources/*.png $(LIB_PATH)/syncplay/resources/ - cp -r resources/lua/intf/*.lua $(LIB_PATH)/syncplay/resources/lua/intf/ - cp resources/hicolor/48x48/apps/syncplay.png $(SHARE_PATH)/app-install/icons/ - cp resources/hicolor/48x48/apps/syncplay.png $(SHARE_PATH)/pixmaps/ - -u-common: - -rm -rf $(LIB_PATH)/syncplay - -rm $(SHARE_PATH)/icons/hicolor/*/apps/syncplay.png - -rm $(SHARE_PATH)/app-install/icons/syncplay.png - -rm $(SHARE_PATH)/pixmaps/syncplay.png - -client: - -mkdir -p $(BIN_PATH) - cp syncplayClient.py $(BIN_PATH)/syncplay - sed -i -e 's%# libpath%site.addsitedir\("$(BASE_PATH)/lib/syncplay"\)%' $(BIN_PATH)/syncplay - chmod 755 $(BIN_PATH)/syncplay - cp syncplayClient.py $(LIB_PATH)/syncplay/ - cp resources/syncplay.desktop $(APP_SHORTCUT_PATH)/ - -ifeq ($(SINGLE_USER),false) - chmod 755 $(APP_SHORTCUT_PATH)/syncplay.desktop -endif - -ifeq ($(VLC_SUPPORT),true) - -mkdir -p $(VLC_LIB_PATH)/vlc/lua/intf/ - cp resources/lua/intf/syncplay.lua $(VLC_LIB_PATH)/vlc/lua/intf/ -endif - -u-client: - -rm $(BIN_PATH)/syncplay - -rm $(LIB_PATH)/syncplay/syncplayClient.py - -rm $(VLC_LIB_PATH)/vlc/lua/intf/syncplay.lua - -rm $(APP_SHORTCUT_PATH)/syncplay.desktop - -server: - -mkdir -p $(BIN_PATH) - cp syncplayServer.py $(BIN_PATH)/syncplay-server - sed -i -e 's%# libpath%site.addsitedir\("$(BASE_PATH)/lib/syncplay"\)%' $(BIN_PATH)/syncplay-server - chmod 755 $(BIN_PATH)/syncplay-server - cp syncplayServer.py $(LIB_PATH)/syncplay/ - cp resources/syncplay-server.desktop $(APP_SHORTCUT_PATH)/ - -ifeq ($(SINGLE_USER),false) - chmod 755 $(APP_SHORTCUT_PATH)/syncplay-server.desktop -endif - -u-server: - -rm $(BIN_PATH)/syncplay-server - -rm $(LIB_PATH)/syncplay/syncplayServer.py - -rm $(APP_SHORTCUT_PATH)/syncplay-server.desktop - -warnings: -ifeq ($(SINGLE_USER),true) - @echo -e "\n**********\n**********\n \nRemeber to add ${HOME}/.local/bin to your \$$PATH with 'echo \"export PATH=\$$PATH:${HOME}/.local/bin\" >> ${HOME}/.profile' \nThis will take effect after you logoff.\n \n**********\n**********\n" -endif - -install-client: common client warnings - -uninstall-client: u-client u-common - -install-server: common server warnings - -uninstall-server: u-server u-common - -install: common client server warnings - -uninstall: u-client u-server u-common +GNU=gmake $* +all: + @$(GNU) +.DEFAULT: + @$(GNU) From c9d69c3990b625b89af8f666e73f5a3a46fbeb89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Wr=C3=B3bel?= Date: Fri, 12 Sep 2014 23:50:31 +0200 Subject: [PATCH 3/5] Little cleaning up in Makefile --- GNUmakefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index c7c57c3..7353c3a 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -18,8 +18,6 @@ endif SHARE_PATH = ${PREFIX}$(BASE_PATH)/share common: - -mkdir -p $(LIB_PATH)/syncplay/resources/ - -mkdir -p $(LIB_PATH)/syncplay/resources/lua -mkdir -p $(LIB_PATH)/syncplay/resources/lua/intf -mkdir -p $(APP_SHORTCUT_PATH) -mkdir -p $(SHARE_PATH)/app-install/icons From 27bd1b38d326af9732b7567cd6144c0ebb8555a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Wr=C3=B3bel?= Date: Fri, 12 Sep 2014 23:51:52 +0200 Subject: [PATCH 4/5] BSD support in Makefile --- GNUmakefile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/GNUmakefile b/GNUmakefile index 7353c3a..c52c09a 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -4,9 +4,27 @@ ifndef VLC_SUPPORT VLC_SUPPORT = true endif +ifeq ($(shell uname)),FreeBSD) + BSD = true +endif +ifeq ($(shell uname)),NetBSD) + BSD = true +endif +ifeq ($(shell uname)),OpenBSD) + BSD = true +endif +ifeq ($(shell uname)),DragonFly) + BSD = true +endif + ifeq ($(SINGLE_USER),false) +ifneq ($(BSD),true) BASE_PATH = /usr VLC_LIB_PATH = ${PREFIX}/usr/lib +else + BASE_PATH = /usr/local + VLC_LIB_PATH = ${PREFIX}/usr/local/lib +endif else BASE_PATH = ${HOME}/.local VLC_LIB_PATH = ${HOME}/.local/share From 655b638097ff5fa47b0f5b7ae737ac9b8af6d96b Mon Sep 17 00:00:00 2001 From: Etoh Date: Sat, 13 Sep 2014 01:25:08 +0100 Subject: [PATCH 5/5] Fix new mpv bug (premature info requests) --- syncplay/players/mplayer.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/syncplay/players/mplayer.py b/syncplay/players/mplayer.py index 36b7271..d836f4a 100644 --- a/syncplay/players/mplayer.py +++ b/syncplay/players/mplayer.py @@ -127,6 +127,15 @@ class MplayerPlayer(BasePlayer): def lineReceived(self, line): if "Error parsing option" in line: self.quitReason = getMessage("mpv-version-error") + + if "Failed to get value of property" in line: + if "filename" in line: + self._getFilename() + elif "length" in line: + self._getLength() + elif "path" in line: + self._getFilepath() + return match = self.RE_ANSWER.match(line) if not match: