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