diff --git a/Makefile b/Makefile index 62fcc92..f646230 100644 --- a/Makefile +++ b/Makefile @@ -34,14 +34,11 @@ client: echo '#!/bin/sh\npython -OO $(LIB_PATH)/syncplay/syncplayClient.py "$$@"' > $(BIN_PATH)/syncplay chmod a+x $(BIN_PATH)/syncplay cp syncplayClient.py $(LIB_PATH)/syncplay/ - -mkdir -p $(LIB_PATH)/syncplay/resources - cp resources/buzzer.wav $(LIB_PATH)/syncplay/resources/ cp resources/syncplay.desktop $(APP_SHORTCUT_PATH)/ u-client: -rm $(BIN_PATH)/syncplay -rm $(LIB_PATH)/syncplay/syncplayClient.py - -rm -rf $(LIB_PATH)/syncplay/resources -rm $(APP_SHORTCUT_PATH)/syncplay.desktop server: diff --git a/resources/buzzer.wav b/resources/buzzer.wav deleted file mode 100644 index 9354475..0000000 Binary files a/resources/buzzer.wav and /dev/null differ diff --git a/setup.nsi b/setup.nsi index cbc0e55..fc88252 100644 --- a/setup.nsi +++ b/setup.nsi @@ -170,7 +170,6 @@ Delete "$INSTDIR\lib\API-MS-Win-Core-Profile-L1-1-0.dll" Delete "$INSTDIR\lib\winsound.pyd" Delete "$INSTDIR\resources\icon.ico" - Delete "$INSTDIR\resources\buzzer.wav" RMDir "$INSTDIR\lib" RMDir "$INSTDIR\pyt" RMDir "$INSTDIR\resources" @@ -285,7 +284,6 @@ SetOutPath $INSTDIR\resources File "${SYNCPLAY}\resources\icon.ico" - File "${SYNCPLAY}\resources\buzzer.wav" SectionEnd diff --git a/syncplay/client.py b/syncplay/client.py index 2928d93..70d8577 100644 --- a/syncplay/client.py +++ b/syncplay/client.py @@ -6,7 +6,6 @@ from twisted.internet.protocol import ClientFactory from twisted.internet import reactor, task from syncplay.protocols import SyncClientProtocol from syncplay import utils, constants -from syncplay.ui import sound from syncplay.messages import getMessage class SyncClientFactory(ClientFactory): @@ -196,8 +195,7 @@ class SyncplayClient(object): if (paused == False and roomFilesDiffer): self.userlist.roomCheckedForDifferentFiles() self._player.displayMessage(getMessage("en", "room-files-not-same"), constants.DIFFERENT_FILE_MESSAGE_DURATION) - sound.doBuzz() - + def _changePlayerStateAccordingToGlobalState(self, position, paused, doSeek, setBy): madeChangeOnPlayer = False pauseChanged = paused != self.getGlobalPaused() diff --git a/syncplay/ui/sound.py b/syncplay/ui/sound.py deleted file mode 100644 index 1cdc3cd..0000000 --- a/syncplay/ui/sound.py +++ /dev/null @@ -1,38 +0,0 @@ -try: - import winsound -except ImportError: - winsound = None -try: - import alsaaudio - import wave -except ImportError: - alsaaudio = None -from syncplay import utils - -def doBuzz(): - if(winsound): - buzzPath = utils.findWorkingDir() + "\\resources\\buzzer.wav" - winsound.PlaySound(buzzPath, winsound.SND_FILENAME|winsound.SND_ASYNC) - elif(alsaaudio): - buzzPath = utils.findWorkingDir() + "/resources/buzzer.wav" - print buzzPath - try: - buzz = wave.open(buzzPath, 'rb') - device = alsaaudio.PCM(0) - device.setchannels(buzz.getnchannels()) - device.setrate(buzz.getframerate()) - if buzz.getsampwidth() == 1: - device.setformat(alsaaudio.PCM_FORMAT_U8) - elif buzz.getsampwidth() == 2: - device.setformat(alsaaudio.PCM_FORMAT_S16_LE) - else: - raise ValueError('Unsupported buzzer format') - device.setperiodsize(640) - data = buzz.readframes(640) - while data: - device.write(data) - data = buzz.readframes(640) - buzz.close() - except IOError: - pass -