Add Image layer and rename text layer

This commit is contained in:
Tim Bentley 2010-01-25 20:34:47 +00:00
parent dd18a4da76
commit 9beb6c7db5

View File

@ -96,8 +96,10 @@ class MainDisplay(DisplayWidget):
self.audio = Phonon.AudioOutput(Phonon.VideoCategory, self.mediaObject) self.audio = Phonon.AudioOutput(Phonon.VideoCategory, self.mediaObject)
Phonon.createPath(self.mediaObject, self.video) Phonon.createPath(self.mediaObject, self.video)
Phonon.createPath(self.mediaObject, self.audio) Phonon.createPath(self.mediaObject, self.audio)
self.display = QtGui.QLabel(self) self.display_image = QtGui.QLabel(self)
self.display.setScaledContents(True) self.display_image.setScaledContents(True)
self.display_text = QtGui.QLabel(self)
self.display_text.setScaledContents(True)
self.alertDisplay = QtGui.QLabel(self) self.alertDisplay = QtGui.QLabel(self)
self.alertDisplay.setScaledContents(True) self.alertDisplay.setScaledContents(True)
self.primary = True self.primary = True
@ -123,7 +125,7 @@ class MainDisplay(DisplayWidget):
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'media_play'), self.onMediaPlay) QtCore.SIGNAL(u'media_play'), self.onMediaPlay)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'media_pause'), self.onMediaPaws) QtCore.SIGNAL(u'media_pause'), self.onMediaPause)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'media_stop'), self.onMediaStop) QtCore.SIGNAL(u'media_stop'), self.onMediaStop)
@ -143,7 +145,9 @@ class MainDisplay(DisplayWidget):
QtCore.QRect(0, self.alertScreenPosition, QtCore.QRect(0, self.alertScreenPosition,
self.screen[u'size'].width(),self.alertHeight)) self.screen[u'size'].width(),self.alertHeight))
self.video.setGeometry(self.screen[u'size']) self.video.setGeometry(self.screen[u'size'])
self.display.resize(self.screen[u'size'].width(), self.display_image.resize(self.screen[u'size'].width(),
self.screen[u'size'].height())
self.display_text.resize(self.screen[u'size'].width(),
self.screen[u'size'].height()) self.screen[u'size'].height())
#Build a custom splash screen #Build a custom splash screen
self.InitialFrame = QtGui.QImage( self.InitialFrame = QtGui.QImage(
@ -200,18 +204,18 @@ class MainDisplay(DisplayWidget):
if not self.displayBlank: if not self.displayBlank:
if transition: if transition:
if self.frame is not None: if self.frame is not None:
self.display.setPixmap(QtGui.QPixmap.fromImage(self.frame)) self.display_text.setPixmap(QtGui.QPixmap.fromImage(self.frame))
self.repaint() self.repaint()
self.frame = None self.frame = None
if frame[u'trans'] is not None: if frame[u'trans'] is not None:
self.display.setPixmap(QtGui.QPixmap.fromImage(frame[u'trans'])) self.display_text.setPixmap(QtGui.QPixmap.fromImage(frame[u'trans']))
self.repaint() self.repaint()
self.frame = frame[u'trans'] self.frame = frame[u'trans']
self.display.setPixmap(QtGui.QPixmap.fromImage(frame[u'main'])) self.display_text.setPixmap(QtGui.QPixmap.fromImage(frame[u'main']))
self.display_frame = frame[u'main'] self.display_frame = frame[u'main']
self.repaint() self.repaint()
else: else:
self.display.setPixmap(QtGui.QPixmap.fromImage(frame)) self.display_text.setPixmap(QtGui.QPixmap.fromImage(frame))
self.display_frame = frame self.display_frame = frame
if not self.isVisible(): if not self.isVisible():
self.setVisible(True) self.setVisible(True)
@ -220,10 +224,10 @@ class MainDisplay(DisplayWidget):
def blankDisplay(self, blanked=True): def blankDisplay(self, blanked=True):
if blanked: if blanked:
self.displayBlank = True self.displayBlank = True
self.display.setPixmap(QtGui.QPixmap.fromImage(self.blankFrame)) self.display_text.setPixmap(QtGui.QPixmap.fromImage(self.blankFrame))
else: else:
self.displayBlank = False self.displayBlank = False
if self.display_frame: if self.display_text_frame:
self.frameView(self.display_frame) self.frameView(self.display_frame)
# if blanked != self.parent.LiveController.blankButton.isChecked(): # if blanked != self.parent.LiveController.blankButton.isChecked():
# self.parent.LiveController.blankButton.setChecked(self.displayBlank) # self.parent.LiveController.blankButton.setChecked(self.displayBlank)
@ -285,7 +289,7 @@ class MainDisplay(DisplayWidget):
def onMediaQueue(self, message): def onMediaQueue(self, message):
log.debug(u'Queue new media message %s' % message) log.debug(u'Queue new media message %s' % message)
self.display.close() self.display_text.close()
file = os.path.join(message[1], message[2]) file = os.path.join(message[1], message[2])
if self.firstTime: if self.firstTime:
self.mediaObject.setCurrentSource(Phonon.MediaSource(file)) self.mediaObject.setCurrentSource(Phonon.MediaSource(file))
@ -301,7 +305,8 @@ class MainDisplay(DisplayWidget):
self.display_frame = self.blankFrame self.display_frame = self.blankFrame
self.firstTime = True self.firstTime = True
self.mediaLoaded = True self.mediaLoaded = True
self.display.hide() self.display_image.hide()
self.display_text.hide()
self.alertDisplay.hide() self.alertDisplay.hide()
self.video.setFullScreen(True) self.video.setFullScreen(True)
self.video.setVisible(True) self.video.setVisible(True)
@ -309,7 +314,7 @@ class MainDisplay(DisplayWidget):
if self.primary: if self.primary:
self.setVisible(True) self.setVisible(True)
def onMediaPaws(self): def onMediaPause(self):
log.debug(u'Media paused by user') log.debug(u'Media paused by user')
self.mediaObject.pause() self.mediaObject.pause()
@ -326,5 +331,5 @@ class MainDisplay(DisplayWidget):
self.mediaObject.clearQueue() self.mediaObject.clearQueue()
self.mediaLoaded = False self.mediaLoaded = False
self.video.setVisible(False) self.video.setVisible(False)
self.display.show() self.display_text.show()
self.blankDisplay(False) self.blankDisplay(False)