diff --git a/syncplay/__init__.py b/syncplay/__init__.py index c10619e..08032d7 100755 --- a/syncplay/__init__.py +++ b/syncplay/__init__.py @@ -1,5 +1,5 @@ -version = '1.6.4' -revision = 'a' +version = '1.6.5' +revision = ' development' milestone = 'Yoitsu' -release_number = '79' +release_number = '80' projectURL = 'https://syncplay.pl/' diff --git a/syncplay/constants.py b/syncplay/constants.py index a444409..7f0fcf5 100755 --- a/syncplay/constants.py +++ b/syncplay/constants.py @@ -155,6 +155,8 @@ MPLAYER_PATHS = ["mplayer2", "mplayer"] MPV_PATHS = ["mpv", "/opt/mpv/mpv", r"c:\program files\mpv\mpv.exe", r"c:\program files\mpv-player\mpv.exe", r"c:\program Files (x86)\mpv\mpv.exe", r"c:\program Files (x86)\mpv-player\mpv.exe", "/Applications/mpv.app/Contents/MacOS/mpv"] +MPVNET_PATHS = [r"c:\program files\mpv.net\mpvnet.exe", r"c:\program files\mpv.net\mpvnet.exe", + r"c:\program Files (x86)\mpv.net\mpvnet.exe", r"c:\program Files (x86)\mpv.net\mpvnet.exe"] VLC_PATHS = [ r"c:\program files (x86)\videolan\vlc\vlc.exe", r"c:\program files\videolan\vlc\vlc.exe", @@ -169,6 +171,7 @@ VLC_PATHS = [ VLC_ICONPATH = "vlc.png" MPLAYER_ICONPATH = "mplayer.png" MPV_ICONPATH = "mpv.png" +MPVNET_ICONPATH = "mpvnet.ico" MPC_ICONPATH = "mpc-hc.png" MPC64_ICONPATH = "mpc-hc64.png" MPC_BE_ICONPATH = "mpc-be.png" diff --git a/syncplay/messages_de.py b/syncplay/messages_de.py index 070b7ca..4d1837f 100755 --- a/syncplay/messages_de.py +++ b/syncplay/messages_de.py @@ -108,7 +108,7 @@ de = { "mpc-be-version-insufficient-error": "MPC-Version nicht ausreichend, bitte nutze `mpc-be` >= `{}`", "mpv-version-error": "Syncplay ist nicht kompatibel mit dieser Version von mpv. Bitte benutze eine andere Version (z.B. Git HEAD).", "player-file-open-error": "Fehler beim Öffnen der Datei durch den Player", - "player-path-error": "Ungültiger Player-Pfad. Supported players are: mpv, VLC, MPC-HC, MPC-BE and mplayer2", # To do: Translate end + "player-path-error": "Ungültiger Player-Pfad. Supported players are: mpv, mpv.net, VLC, MPC-HC, MPC-BE and mplayer2", # To do: Translate end "hostname-empty-error": "Hostname darf nicht leer sein", "empty-error": "{} darf nicht leer sein", # Configuration "media-player-error": "Player-Fehler: \"{}\"", # Error line @@ -119,7 +119,7 @@ de = { "unable-to-start-client-error": "Client kann nicht gestartet werden", - "player-path-config-error": "Player-Pfad ist nicht ordnungsgemäß gesetzt. Supported players are: mpv, VLC, MPC-HC, MPC-BE and mplayer2.", # To do: Translate end + "player-path-config-error": "Player-Pfad ist nicht ordnungsgemäß gesetzt. Supported players are: mpv, mpv.net, VLC, MPC-HC, MPC-BE and mplayer2.", # To do: Translate end "no-file-path-config-error": "Es muss eine Datei ausgewählt werden, bevor der Player gestartet wird.", "no-hostname-config-error": "Hostname darf nicht leer sein", "invalid-port-config-error": "Port muss gültig sein", diff --git a/syncplay/messages_en.py b/syncplay/messages_en.py index 1f02846..b51ad1d 100755 --- a/syncplay/messages_en.py +++ b/syncplay/messages_en.py @@ -108,7 +108,7 @@ en = { "mpc-be-version-insufficient-error": "MPC version not sufficient, please use `mpc-be` >= `{}`", "mpv-version-error": "Syncplay is not compatible with this version of mpv. Please use a different version of mpv (e.g. Git HEAD).", "player-file-open-error": "Player failed opening file", - "player-path-error": "Player path is not set properly. Supported players are: mpv, VLC, MPC-HC, MPC-BE and mplayer2", + "player-path-error": "Player path is not set properly. Supported players are: mpv, mpv.net, VLC, MPC-HC, MPC-BE and mplayer2", "hostname-empty-error": "Hostname can't be empty", "empty-error": "{} can't be empty", # Configuration "media-player-error": "Media player error: \"{}\"", # Error line @@ -119,7 +119,7 @@ en = { "unable-to-start-client-error": "Unable to start client", - "player-path-config-error": "Player path is not set properly. Supported players are: mpv, VLC, MPC-HC, MPC-BE and mplayer2.", + "player-path-config-error": "Player path is not set properly. Supported players are: mpv, mpv.net, VLC, MPC-HC, MPC-BE and mplayer2.", "no-file-path-config-error": "File must be selected before starting your player", "no-hostname-config-error": "Hostname can't be empty", "invalid-port-config-error": "Port must be valid", diff --git a/syncplay/messages_es.py b/syncplay/messages_es.py index 0ebd4cd..932f68b 100644 --- a/syncplay/messages_es.py +++ b/syncplay/messages_es.py @@ -108,7 +108,7 @@ es = { "mpc-be-version-insufficient-error": "La versión de MPC no es suficiente, por favor utiliza `mpc-be` >= `{}`", "mpv-version-error": "Syncplay no es compatible con esta versión de mpv. Por favor utiliza una versión diferente de mpv (p.ej. Git HEAD).", "player-file-open-error": "El reproductor falló al abrir el archivo", - "player-path-error": "La ruta del reproductor no está definida correctamente. Los reproductores soportados son: mpv, VLC, MPC-HC, MPC-BE y mplayer2", + "player-path-error": "La ruta del reproductor no está definida correctamente. Los reproductores soportados son: mpv, mpv.net, VLC, MPC-HC, MPC-BE y mplayer2", "hostname-empty-error": "El nombre del host no puede ser vacío", "empty-error": "{} no puede ser vacío", # Configuration "media-player-error": "Error del reproductor multimedia: \"{}\"", # Error line @@ -119,7 +119,7 @@ es = { "unable-to-start-client-error": "No se logró iniciar el cliente", - "player-path-config-error": "La ruta del reproductor no está definida correctamente. Los reproductores soportados son: mpv, VLC, MPC-HC, MPC-BE y mplayer2.", + "player-path-config-error": "La ruta del reproductor no está definida correctamente. Los reproductores soportados son: mpv, mpv.net, VLC, MPC-HC, MPC-BE y mplayer2.", "no-file-path-config-error": "El archivo debe ser seleccionado antes de iniciar el reproductor", "no-hostname-config-error": "El nombre del host no puede ser vacío", "invalid-port-config-error": "El puerto debe ser válido", diff --git a/syncplay/messages_it.py b/syncplay/messages_it.py index 43809a9..df44bb9 100755 --- a/syncplay/messages_it.py +++ b/syncplay/messages_it.py @@ -108,7 +108,7 @@ it = { "mpc-be-version-insufficient-error": "La tua versione di MPC è troppo vecchia, per favore usa `mpc-be` >= `{}`", "mpv-version-error": "Syncplay non è compatibile con questa versione di mpv. Per favore usa un'altra versione di mpv (es. Git HEAD).", "player-file-open-error": "Il player non è riuscito ad aprire il file", - "player-path-error": "Il path del player non è configurato correttamente. I player supportati sono: mpv, VLC, MPC-HC, MPC-BE e mplayer2", + "player-path-error": "Il path del player non è configurato correttamente. I player supportati sono: mpv, mpv.net, VLC, MPC-HC, MPC-BE e mplayer2", "hostname-empty-error": "Il campo hostname non può essere vuoto", "empty-error": "Il campo {} non può esssere vuoto", # Configuration "media-player-error": "Errore media player: \"{}\"", # Error line @@ -119,7 +119,7 @@ it = { "unable-to-start-client-error": "Impossibile avviare il client", - "player-path-config-error": "Il percorso del player non è configurato correttamente. I player supportati sono: mpv, VLC, MPC-HC, MPC-BE e mplayer2.", + "player-path-config-error": "Il percorso del player non è configurato correttamente. I player supportati sono: mpv, mpv.net, VLC, MPC-HC, MPC-BE e mplayer2.", "no-file-path-config-error": "Deve essere selezionato un file prima di avviare il player", "no-hostname-config-error": "Il campo hostname non può essere vuoto", "invalid-port-config-error": "La porta deve essere valida", diff --git a/syncplay/messages_ru.py b/syncplay/messages_ru.py index 2d9be9c..26aadd1 100755 --- a/syncplay/messages_ru.py +++ b/syncplay/messages_ru.py @@ -108,7 +108,7 @@ ru = { "mpc-be-version-insufficient-error": "Версия MPC слишком старая, пожалуйста, используйте `mpc-be` >= `{}`", "mpv-version-error": "Syncplay не совместим с данной версией mpv. Пожалуйста, используйте другую версию mpv (лучше свежайшую).", "player-file-open-error": "Проигрыватель не может открыть файл.", - "player-path-error": "Путь к проигрывателю задан неверно. Supported players are: mpv, VLC, MPC-HC, MPC-BE and mplayer2.", # TODO: Translate last sentence + "player-path-error": "Путь к проигрывателю задан неверно. Supported players are: mpv, mpv.net, VLC, MPC-HC, MPC-BE and mplayer2.", # TODO: Translate last sentence "hostname-empty-error": "Имя пользователя не может быть пустым.", "empty-error": "{} не может быть пустым.", # Configuration "media-player-error": "Ошибка проигрывателя: \"{}\"", # Error line @@ -119,7 +119,7 @@ ru = { "unable-to-start-client-error": "Невозможно запустить клиент", - "player-path-config-error": "Путь к проигрывателю установлен неверно. Supported players are: mpv, VLC, MPC-HC, MPC-BE and mplayer2", # To do: Translate end + "player-path-config-error": "Путь к проигрывателю установлен неверно. Supported players are: mpv, mpv.net, VLC, MPC-HC, MPC-BE and mplayer2", # To do: Translate end "no-file-path-config-error": "Файл должен быть указан до включения проигрывателя", "no-hostname-config-error": "Имя сервера не может быть пустым", "invalid-port-config-error": "Неверный номер порта", diff --git a/syncplay/players/__init__.py b/syncplay/players/__init__.py index 9fb3563..8c812db 100755 --- a/syncplay/players/__init__.py +++ b/syncplay/players/__init__.py @@ -1,5 +1,6 @@ from syncplay.players.mplayer import MplayerPlayer from syncplay.players.mpv import MpvPlayer +from syncplay.players.mpvnet import MpvnetPlayer from syncplay.players.vlc import VlcPlayer try: from syncplay.players.mpc import MPCHCAPIPlayer @@ -14,4 +15,4 @@ except ImportError: def getAvailablePlayers(): - return [MPCHCAPIPlayer, MpvPlayer, VlcPlayer, MpcBePlayer, MplayerPlayer] + return [MPCHCAPIPlayer, MpvPlayer, MpvnetPlayer, VlcPlayer, MpcBePlayer, MplayerPlayer] diff --git a/syncplay/players/mpv.py b/syncplay/players/mpv.py index 776a9a3..622d296 100755 --- a/syncplay/players/mpv.py +++ b/syncplay/players/mpv.py @@ -55,7 +55,7 @@ class MpvPlayer(MplayerPlayer): @staticmethod def isValidPlayerPath(path): - if "mpv" in path and MpvPlayer.getExpandedPath(path): + if "mpv" in path and "mpvnet" not in path and MpvPlayer.getExpandedPath(path): return True return False diff --git a/syncplay/players/mpvnet.py b/syncplay/players/mpvnet.py new file mode 100644 index 0000000..5813e37 --- /dev/null +++ b/syncplay/players/mpvnet.py @@ -0,0 +1,51 @@ +import os +from syncplay import constants +from syncplay.players.mpv import NewMpvPlayer + +class MpvnetPlayer(NewMpvPlayer): + + + @staticmethod + def run(client, playerPath, filePath, args): + constants.MPV_NEW_VERSION = True + constants.MPV_OSC_VISIBILITY_CHANGE_VERSION = True + return MpvnetPlayer(client, MpvnetPlayer.getExpandedPath(playerPath), filePath, args) + + @staticmethod + def getDefaultPlayerPathsList(): + l = [] + for path in constants.MPVNET_PATHS: + p = MpvnetPlayer.getExpandedPath(path) + if p: + l.append(p) + return l + + + @staticmethod + def isValidPlayerPath(path): + if "mpvnet" in path and MpvnetPlayer.getExpandedPath(path): + return True + return False + + + @staticmethod + def getExpandedPath(playerPath): + if not os.path.isfile(playerPath): + if os.path.isfile(playerPath + "mpvnet.exe"): + playerPath += "mpvnet.exe" + return playerPath + elif os.path.isfile(playerPath + "\\mpvnet.exe"): + playerPath += "\\mpvnet.exe" + return playerPath + if os.access(playerPath, os.X_OK): + return playerPath + for path in os.environ['PATH'].split(':'): + path = os.path.join(os.path.realpath(path), playerPath) + if os.access(path, os.X_OK): + return path + + + @staticmethod + def getIconPath(path): + return constants.MPVNET_ICONPATH + diff --git a/syncplay/resources/mpvnet.ico b/syncplay/resources/mpvnet.ico new file mode 100644 index 0000000..a70ca15 Binary files /dev/null and b/syncplay/resources/mpvnet.ico differ