Have per-player OSD message separators, so mpv can use newlines
This commit is contained in:
parent
0763479d1b
commit
9a81bd9c52
@ -631,12 +631,14 @@ class SyncplayClient(object):
|
|||||||
self._displayReadySameWarning()
|
self._displayReadySameWarning()
|
||||||
|
|
||||||
def _displayReadySameWarning(self):
|
def _displayReadySameWarning(self):
|
||||||
|
if not self._client._player:
|
||||||
|
return
|
||||||
if not self._userlist.areAllFilesInRoomSame():
|
if not self._userlist.areAllFilesInRoomSame():
|
||||||
if self._userlist.currentUser.canControl():
|
if self._userlist.currentUser.canControl():
|
||||||
if self._userlist.areAllUsersInRoomReady():
|
if self._userlist.areAllUsersInRoomReady():
|
||||||
osdMessage = u"{}; {}".format(getMessage("room-files-not-same"), getMessage("all-users-ready"))
|
osdMessage = u"{}{}{}".format(getMessage("room-files-not-same"), self._client._player.osdMessageSeparator, getMessage("all-users-ready"))
|
||||||
else:
|
else:
|
||||||
osdMessage = u"{}; {}".format(getMessage("room-files-not-same"), getMessage("not-all-ready").format(self._userlist.usersInRoomNotReady()))
|
osdMessage = u"{}{}{}".format(getMessage("room-files-not-same"), self._client._player.osdMessageSeparator, getMessage("not-all-ready").format(self._userlist.usersInRoomNotReady()))
|
||||||
else:
|
else:
|
||||||
osdMessage = getMessage("room-files-not-same")
|
osdMessage = getMessage("room-files-not-same")
|
||||||
elif self._userlist.areAllUsersInRoomReady():
|
elif self._userlist.areAllUsersInRoomReady():
|
||||||
@ -944,6 +946,8 @@ class UiManager(object):
|
|||||||
def showOSDMessage(self, message, duration=constants.OSD_DURATION, secondaryOSD=False):
|
def showOSDMessage(self, message, duration=constants.OSD_DURATION, secondaryOSD=False):
|
||||||
if secondaryOSD and not constants.SHOW_OSD_WARNINGS:
|
if secondaryOSD and not constants.SHOW_OSD_WARNINGS:
|
||||||
return
|
return
|
||||||
|
if not self._client._player:
|
||||||
|
return
|
||||||
if constants.SHOW_OSD and self._client and self._client._player:
|
if constants.SHOW_OSD and self._client and self._client._player:
|
||||||
if not self._client._player.secondaryOSDSupported:
|
if not self._client._player.secondaryOSDSupported:
|
||||||
if secondaryOSD:
|
if secondaryOSD:
|
||||||
@ -951,12 +955,12 @@ class UiManager(object):
|
|||||||
self.lastSecondaryOSDMessage = message
|
self.lastSecondaryOSDMessage = message
|
||||||
self.lastSecondaryOSDEndTime = time.time() + constants.NO_SECONDARY_OSD_WARNING_DURATION
|
self.lastSecondaryOSDEndTime = time.time() + constants.NO_SECONDARY_OSD_WARNING_DURATION
|
||||||
if self.lastPrimaryOSDEndTime and time.time() < self.lastPrimaryOSDEndTime:
|
if self.lastPrimaryOSDEndTime and time.time() < self.lastPrimaryOSDEndTime:
|
||||||
message = u"{}; {}".format(message, self.lastPrimaryOSDMessage)
|
message = u"{}{}{}".format(message, self._client._player.osdMessageSeparator, self.lastPrimaryOSDMessage)
|
||||||
else:
|
else:
|
||||||
self.lastPrimaryOSDMessage = message
|
self.lastPrimaryOSDMessage = message
|
||||||
self.lastPrimaryOSDEndTime = time.time() + constants.OSD_DURATION
|
self.lastPrimaryOSDEndTime = time.time() + constants.OSD_DURATION
|
||||||
if self.lastSecondaryOSDEndTime and time.time() < self.lastSecondaryOSDEndTime:
|
if self.lastSecondaryOSDEndTime and time.time() < self.lastSecondaryOSDEndTime:
|
||||||
message = u"{}; {}".format(self.lastSecondaryOSDMessage, message)
|
message = u"{}{}{}".format(self.lastSecondaryOSDMessage, self._client._player.osdMessageSeparator, message)
|
||||||
self._client._player.displayMessage(message, duration * 1000, secondaryOSD)
|
self._client._player.displayMessage(message, duration * 1000, secondaryOSD)
|
||||||
|
|
||||||
def setControllerStatus(self, username, isController):
|
def setControllerStatus(self, username, isController):
|
||||||
|
|||||||
@ -308,6 +308,7 @@ class MPCHCAPIPlayer(BasePlayer):
|
|||||||
speedSupported = False
|
speedSupported = False
|
||||||
secondaryOSDSupported = False
|
secondaryOSDSupported = False
|
||||||
customOpenDialog = False
|
customOpenDialog = False
|
||||||
|
osdMessageSeparator = "; "
|
||||||
|
|
||||||
def __init__(self, client):
|
def __init__(self, client):
|
||||||
from twisted.internet import reactor
|
from twisted.internet import reactor
|
||||||
|
|||||||
@ -11,6 +11,7 @@ class MplayerPlayer(BasePlayer):
|
|||||||
speedSupported = True
|
speedSupported = True
|
||||||
customOpenDialog = False
|
customOpenDialog = False
|
||||||
secondaryOSDSupported = False
|
secondaryOSDSupported = False
|
||||||
|
osdMessageSeparator = "\\n"
|
||||||
|
|
||||||
RE_ANSWER = re.compile(constants.MPLAYER_ANSWER_REGEX)
|
RE_ANSWER = re.compile(constants.MPLAYER_ANSWER_REGEX)
|
||||||
POSITION_QUERY = 'time_pos'
|
POSITION_QUERY = 'time_pos'
|
||||||
|
|||||||
@ -15,6 +15,7 @@ class VlcPlayer(BasePlayer):
|
|||||||
speedSupported = True
|
speedSupported = True
|
||||||
customOpenDialog = False
|
customOpenDialog = False
|
||||||
secondaryOSDSupported = True
|
secondaryOSDSupported = True
|
||||||
|
osdMessageSeparator = "; "
|
||||||
|
|
||||||
RE_ANSWER = re.compile(constants.VLC_ANSWER_REGEX)
|
RE_ANSWER = re.compile(constants.VLC_ANSWER_REGEX)
|
||||||
SLAVE_ARGS = constants.VLC_SLAVE_ARGS
|
SLAVE_ARGS = constants.VLC_SLAVE_ARGS
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user