Added sound notification (for Windows) if not all files are same in one room
This commit is contained in:
parent
59b0cd0b6a
commit
65f3fc87ef
@ -27,6 +27,7 @@ info = dict(
|
|||||||
'compressed': 1
|
'compressed': 1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
data_files = [("resources", ["resources/buzzer.wav",]), ("", ["resources/syncplayClientForceConfiguration.bat",])],
|
||||||
zipfile = "lib/libsync",
|
zipfile = "lib/libsync",
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|||||||
BIN
resources/buzzer.wav
Normal file
BIN
resources/buzzer.wav
Normal file
Binary file not shown.
1
resources/syncplayClientForceConfiguration.bat
Normal file
1
resources/syncplayClientForceConfiguration.bat
Normal file
@ -0,0 +1 @@
|
|||||||
|
Syncplay.exe -g
|
||||||
@ -6,6 +6,7 @@ from twisted.internet.protocol import ClientFactory
|
|||||||
from twisted.internet import reactor, task
|
from twisted.internet import reactor, task
|
||||||
from syncplay.protocols import SyncClientProtocol
|
from syncplay.protocols import SyncClientProtocol
|
||||||
from syncplay import utils, constants
|
from syncplay import utils, constants
|
||||||
|
from syncplay.ui import sound
|
||||||
from syncplay.messages import getMessage
|
from syncplay.messages import getMessage
|
||||||
|
|
||||||
class SyncClientFactory(ClientFactory):
|
class SyncClientFactory(ClientFactory):
|
||||||
@ -195,7 +196,8 @@ class SyncplayClient(object):
|
|||||||
if (paused == False and roomFilesDiffer):
|
if (paused == False and roomFilesDiffer):
|
||||||
self.userlist.roomCheckedForDifferentFiles()
|
self.userlist.roomCheckedForDifferentFiles()
|
||||||
self._player.displayMessage(getMessage("en", "room-files-not-same"), constants.DIFFERENT_FILE_MESSAGE_DURATION)
|
self._player.displayMessage(getMessage("en", "room-files-not-same"), constants.DIFFERENT_FILE_MESSAGE_DURATION)
|
||||||
|
sound.doBuzz()
|
||||||
|
|
||||||
def _changePlayerStateAccordingToGlobalState(self, position, paused, doSeek, setBy):
|
def _changePlayerStateAccordingToGlobalState(self, position, paused, doSeek, setBy):
|
||||||
madeChangeOnPlayer = False
|
madeChangeOnPlayer = False
|
||||||
pauseChanged = paused != self.getGlobalPaused()
|
pauseChanged = paused != self.getGlobalPaused()
|
||||||
|
|||||||
@ -2,7 +2,7 @@ from ConfigParser import SafeConfigParser
|
|||||||
import argparse
|
import argparse
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
from syncplay import constants
|
from syncplay import constants, utils
|
||||||
from syncplay.messages import getMessage
|
from syncplay.messages import getMessage
|
||||||
try:
|
try:
|
||||||
from syncplay.ui.GuiConfiguration import GuiConfiguration
|
from syncplay.ui.GuiConfiguration import GuiConfiguration
|
||||||
@ -131,18 +131,8 @@ class ConfigurationGetter(object):
|
|||||||
host, port = host.split(':', 1)
|
host, port = host.split(':', 1)
|
||||||
return host, int(port)
|
return host, int(port)
|
||||||
|
|
||||||
def _findWorkingDir(self):
|
|
||||||
frozen = getattr(sys, 'frozen', '')
|
|
||||||
if not frozen:
|
|
||||||
path = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
|
|
||||||
elif frozen in ('dll', 'console_exe', 'windows_exe'):
|
|
||||||
path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(__file__)))))
|
|
||||||
else:
|
|
||||||
path = ""
|
|
||||||
return path
|
|
||||||
|
|
||||||
def _checkForPortableFile(self):
|
def _checkForPortableFile(self):
|
||||||
path = self._findWorkingDir()
|
path = utils.findWorkingDir()
|
||||||
if(os.path.isfile(os.path.join(path, constants.DEFAULT_CONFIG_NAME))):
|
if(os.path.isfile(os.path.join(path, constants.DEFAULT_CONFIG_NAME))):
|
||||||
return os.path.join(path, constants.DEFAULT_CONFIG_NAME)
|
return os.path.join(path, constants.DEFAULT_CONFIG_NAME)
|
||||||
|
|
||||||
|
|||||||
11
syncplay/ui/sound.py
Normal file
11
syncplay/ui/sound.py
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
try:
|
||||||
|
import winsound
|
||||||
|
except ImportError:
|
||||||
|
winsound = None
|
||||||
|
from syncplay import utils
|
||||||
|
|
||||||
|
def doBuzz():
|
||||||
|
buzzPath = utils.findWorkingDir() + "\\resources\\buzzer.wav"
|
||||||
|
print buzzPath
|
||||||
|
if(winsound):
|
||||||
|
winsound.PlaySound(buzzPath, winsound.SND_FILENAME|winsound.SND_ASYNC)
|
||||||
@ -3,6 +3,8 @@ import re
|
|||||||
import datetime
|
import datetime
|
||||||
from syncplay import constants
|
from syncplay import constants
|
||||||
from syncplay.messages import getMessage
|
from syncplay.messages import getMessage
|
||||||
|
import sys
|
||||||
|
import os
|
||||||
|
|
||||||
def retry(ExceptionToCheck, tries=4, delay=3, backoff=2, logger=None):
|
def retry(ExceptionToCheck, tries=4, delay=3, backoff=2, logger=None):
|
||||||
"""Retry calling the decorated function using an exponential backoff.
|
"""Retry calling the decorated function using an exponential backoff.
|
||||||
@ -75,3 +77,14 @@ def formatTime(timeInSeconds):
|
|||||||
return '{0:02.0f}:{1:02.0f}:{2:02.0f}'.format(hours, minutes, seconds)
|
return '{0:02.0f}:{1:02.0f}:{2:02.0f}'.format(hours, minutes, seconds)
|
||||||
else:
|
else:
|
||||||
return '{0:02.0f}:{1:02.0f}'.format(minutes, seconds)
|
return '{0:02.0f}:{1:02.0f}'.format(minutes, seconds)
|
||||||
|
|
||||||
|
def findWorkingDir():
|
||||||
|
frozen = getattr(sys, 'frozen', '')
|
||||||
|
if not frozen:
|
||||||
|
path = os.path.dirname(os.path.dirname(__file__))
|
||||||
|
elif frozen in ('dll', 'console_exe', 'windows_exe'):
|
||||||
|
path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
|
||||||
|
else:
|
||||||
|
path = ""
|
||||||
|
return path
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user