Removed sound support
This commit is contained in:
parent
af8ee57cd2
commit
405d3baf50
3
Makefile
3
Makefile
@ -34,14 +34,11 @@ client:
|
|||||||
echo '#!/bin/sh\npython -OO $(LIB_PATH)/syncplay/syncplayClient.py "$$@"' > $(BIN_PATH)/syncplay
|
echo '#!/bin/sh\npython -OO $(LIB_PATH)/syncplay/syncplayClient.py "$$@"' > $(BIN_PATH)/syncplay
|
||||||
chmod a+x $(BIN_PATH)/syncplay
|
chmod a+x $(BIN_PATH)/syncplay
|
||||||
cp syncplayClient.py $(LIB_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)/
|
cp resources/syncplay.desktop $(APP_SHORTCUT_PATH)/
|
||||||
|
|
||||||
u-client:
|
u-client:
|
||||||
-rm $(BIN_PATH)/syncplay
|
-rm $(BIN_PATH)/syncplay
|
||||||
-rm $(LIB_PATH)/syncplay/syncplayClient.py
|
-rm $(LIB_PATH)/syncplay/syncplayClient.py
|
||||||
-rm -rf $(LIB_PATH)/syncplay/resources
|
|
||||||
-rm $(APP_SHORTCUT_PATH)/syncplay.desktop
|
-rm $(APP_SHORTCUT_PATH)/syncplay.desktop
|
||||||
|
|
||||||
server:
|
server:
|
||||||
|
|||||||
Binary file not shown.
@ -170,7 +170,6 @@
|
|||||||
Delete "$INSTDIR\lib\API-MS-Win-Core-Profile-L1-1-0.dll"
|
Delete "$INSTDIR\lib\API-MS-Win-Core-Profile-L1-1-0.dll"
|
||||||
Delete "$INSTDIR\lib\winsound.pyd"
|
Delete "$INSTDIR\lib\winsound.pyd"
|
||||||
Delete "$INSTDIR\resources\icon.ico"
|
Delete "$INSTDIR\resources\icon.ico"
|
||||||
Delete "$INSTDIR\resources\buzzer.wav"
|
|
||||||
RMDir "$INSTDIR\lib"
|
RMDir "$INSTDIR\lib"
|
||||||
RMDir "$INSTDIR\pyt"
|
RMDir "$INSTDIR\pyt"
|
||||||
RMDir "$INSTDIR\resources"
|
RMDir "$INSTDIR\resources"
|
||||||
@ -285,7 +284,6 @@
|
|||||||
SetOutPath $INSTDIR\resources
|
SetOutPath $INSTDIR\resources
|
||||||
|
|
||||||
File "${SYNCPLAY}\resources\icon.ico"
|
File "${SYNCPLAY}\resources\icon.ico"
|
||||||
File "${SYNCPLAY}\resources\buzzer.wav"
|
|
||||||
|
|
||||||
SectionEnd
|
SectionEnd
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,6 @@ 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):
|
||||||
@ -196,7 +195,6 @@ 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
|
||||||
|
|||||||
@ -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
|
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user