Different file notification is displayed for correct amount of time now
This commit is contained in:
parent
25f0dc12eb
commit
6bd789a554
@ -82,8 +82,6 @@ class SyncplayClient(object):
|
|||||||
self._userOffset = 0.0
|
self._userOffset = 0.0
|
||||||
self._speedChanged = False
|
self._speedChanged = False
|
||||||
|
|
||||||
self._differentFileMessagesTimesShown = 0
|
|
||||||
|
|
||||||
def initProtocol(self, protocol):
|
def initProtocol(self, protocol):
|
||||||
self._protocol = protocol
|
self._protocol = protocol
|
||||||
|
|
||||||
@ -192,16 +190,11 @@ class SyncplayClient(object):
|
|||||||
madeChangeOnPlayer = True
|
madeChangeOnPlayer = True
|
||||||
return madeChangeOnPlayer
|
return madeChangeOnPlayer
|
||||||
|
|
||||||
|
|
||||||
def _checkRoomForSameFiles(self, paused):
|
def _checkRoomForSameFiles(self, paused):
|
||||||
roomFilesDiffer = not self.userlist.areAllFilesInRoomSameOnFirstUnpause()
|
roomFilesDiffer = not self.userlist.areAllFilesInRoomSameOnFirstUnpause()
|
||||||
messageShouldBeKept = self._differentFileMessagesTimesShown and self._differentFileMessagesTimesShown < 5
|
if (paused == False and roomFilesDiffer):
|
||||||
if ((paused == False and roomFilesDiffer) or messageShouldBeKept):
|
|
||||||
self.userlist.roomCheckedForDifferentFiles()
|
self.userlist.roomCheckedForDifferentFiles()
|
||||||
self._differentFileMessagesTimesShown += 1
|
self._player.displayMessage(getMessage("en", "room-files-not-same"), constants.DIFFERENT_FILE_MESSAGE_DURATION)
|
||||||
self.ui.showMessage(getMessage("en", "room-files-not-same"))
|
|
||||||
else:
|
|
||||||
self._differentFileMessagesTimesShown = 0
|
|
||||||
|
|
||||||
def _changePlayerStateAccordingToGlobalState(self, position, paused, doSeek, setBy):
|
def _changePlayerStateAccordingToGlobalState(self, position, paused, doSeek, setBy):
|
||||||
madeChangeOnPlayer = False
|
madeChangeOnPlayer = False
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
#You might want to change these
|
#You might want to change these
|
||||||
DEFAULT_PORT = 8999
|
DEFAULT_PORT = 8999
|
||||||
OSD_DURATION = 3000
|
OSD_DURATION = 3000
|
||||||
|
DIFFERENT_FILE_MESSAGE_DURATION = 15000
|
||||||
MPC_OSD_POSITION = 2 #Right corner, 1 for left
|
MPC_OSD_POSITION = 2 #Right corner, 1 for left
|
||||||
MPLAYER_OSD_LEVEL = 1
|
MPLAYER_OSD_LEVEL = 1
|
||||||
UI_TIME_FORMAT = "[%X] "
|
UI_TIME_FORMAT = "[%X] "
|
||||||
|
|||||||
@ -381,8 +381,8 @@ class MPCHCAPIPlayer(BasePlayer):
|
|||||||
if(filePath):
|
if(filePath):
|
||||||
self._mpcApi.openFile(filePath)
|
self._mpcApi.openFile(filePath)
|
||||||
|
|
||||||
def displayMessage(self, message):
|
def displayMessage(self, message, duration = constants.OSD_DURATION):
|
||||||
self._mpcApi.sendOsd(message)
|
self._mpcApi.sendOsd(message, constants.MPC_OSD_POSITION, duration)
|
||||||
|
|
||||||
@retry(MpcHcApi.PlayerNotReadyException, constants.MPC_MAX_RETRIES, constants.MPC_RETRY_WAIT_TIME, 1)
|
@retry(MpcHcApi.PlayerNotReadyException, constants.MPC_MAX_RETRIES, constants.MPC_RETRY_WAIT_TIME, 1)
|
||||||
def setPaused(self, value):
|
def setPaused(self, value):
|
||||||
|
|||||||
@ -72,8 +72,8 @@ class MplayerPlayer(BasePlayer):
|
|||||||
def _getProperty(self, property_):
|
def _getProperty(self, property_):
|
||||||
self._listener.sendLine("get_property {}".format(property_))
|
self._listener.sendLine("get_property {}".format(property_))
|
||||||
|
|
||||||
def displayMessage(self, message):
|
def displayMessage(self, message, duration = constants.OSD_DURATION):
|
||||||
self._listener.sendLine('osd_show_text "{!s}" {} {}'.format(message, constants.OSD_DURATION, constants.MPLAYER_OSD_LEVEL))
|
self._listener.sendLine('osd_show_text "{!s}" {} {}'.format(message, duration, constants.MPLAYER_OSD_LEVEL))
|
||||||
|
|
||||||
def setSpeed(self, value):
|
def setSpeed(self, value):
|
||||||
self._setProperty('speed', "{:.2f}".format(value))
|
self._setProperty('speed', "{:.2f}".format(value))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user