forked from openlp/openlp
Replace phonon code, add framework for transitions
This commit is contained in:
parent
ab5b0ee0d5
commit
23d945a454
@ -261,7 +261,7 @@ class Renderer(object):
|
||||
bbox = self._render_lines_unaligned(footer_lines, True,
|
||||
(self._rect_footer.left(), self._rect_footer.top()), True)
|
||||
log.debug(u'generate_frame_from_lines - Finish')
|
||||
return self._frame
|
||||
return {u'main':self._frame, u'trans':None}
|
||||
|
||||
def _generate_background_frame(self):
|
||||
"""
|
||||
|
@ -26,7 +26,7 @@ import logging
|
||||
import os
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
#from PyQt4.phonon import Phonon
|
||||
from PyQt4.phonon import Phonon
|
||||
|
||||
from openlp.core.lib import Receiver
|
||||
|
||||
@ -92,13 +92,13 @@ class MainDisplay(DisplayWidget):
|
||||
self.layout.setSpacing(0)
|
||||
self.layout.setMargin(0)
|
||||
self.layout.setObjectName(u'layout')
|
||||
#self.mediaObject = Phonon.MediaObject(self)
|
||||
#self.video = Phonon.VideoWidget()
|
||||
#self.video.setVisible(False)
|
||||
#self.audio = Phonon.AudioOutput(Phonon.VideoCategory, self.mediaObject)
|
||||
#Phonon.createPath(self.mediaObject, self.video)
|
||||
#Phonon.createPath(self.mediaObject, self.audio)
|
||||
#self.layout.insertWidget(0, self.video)
|
||||
self.mediaObject = Phonon.MediaObject(self)
|
||||
self.video = Phonon.VideoWidget()
|
||||
self.video.setVisible(False)
|
||||
self.audio = Phonon.AudioOutput(Phonon.VideoCategory, self.mediaObject)
|
||||
Phonon.createPath(self.mediaObject, self.video)
|
||||
Phonon.createPath(self.mediaObject, self.audio)
|
||||
self.layout.insertWidget(0, self.video)
|
||||
self.display = QtGui.QLabel(self)
|
||||
self.display.setScaledContents(True)
|
||||
self.layout.insertWidget(0, self.display)
|
||||
@ -116,16 +116,16 @@ class MainDisplay(DisplayWidget):
|
||||
QtCore.SIGNAL(u'live_slide_hide'), self.hideDisplay)
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
QtCore.SIGNAL(u'live_slide_show'), self.showDisplay)
|
||||
# QtCore.QObject.connect(self.mediaObject,
|
||||
# QtCore.SIGNAL(u'finished()'), self.onMediaFinish)
|
||||
# QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
# QtCore.SIGNAL(u'media_start'), self.onMediaQueue)
|
||||
# QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
# QtCore.SIGNAL(u'media_play'), self.onMediaPlay)
|
||||
# QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
# QtCore.SIGNAL(u'media_pause'), self.onMediaPaws)
|
||||
# QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
# QtCore.SIGNAL(u'media_stop'), self.onMediaStop)
|
||||
QtCore.QObject.connect(self.mediaObject,
|
||||
QtCore.SIGNAL(u'finished()'), self.onMediaFinish)
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
QtCore.SIGNAL(u'media_start'), self.onMediaQueue)
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
QtCore.SIGNAL(u'media_play'), self.onMediaPlay)
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
QtCore.SIGNAL(u'media_pause'), self.onMediaPaws)
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
QtCore.SIGNAL(u'media_stop'), self.onMediaStop)
|
||||
|
||||
def setup(self, screenNumber):
|
||||
"""
|
||||
@ -183,27 +183,25 @@ class MainDisplay(DisplayWidget):
|
||||
if not self.primary:
|
||||
self.setVisible(True)
|
||||
|
||||
def frameView(self, frame):
|
||||
def frameView(self, frame, transition=False):
|
||||
"""
|
||||
Called from a slide controller to display a frame
|
||||
if the alert is in progress the alert is added on top
|
||||
``frame``
|
||||
Image frame to be rendered
|
||||
"""
|
||||
self.frame = frame
|
||||
if self.timer_id != 0 :
|
||||
self.displayAlert()
|
||||
elif not self.displayBlank:
|
||||
# self.setWindowOpacity(0.5)
|
||||
# self.show()
|
||||
self.display.setPixmap(QtGui.QPixmap.fromImage(frame))
|
||||
if transition:
|
||||
self.display.setPixmap(QtGui.QPixmap.fromImage(frame[u'main']))
|
||||
else:
|
||||
self.display.setPixmap(QtGui.QPixmap.fromImage(frame))
|
||||
# QtCore.QTimer.singleShot(500, self.aa )
|
||||
if not self.isVisible():
|
||||
self.setVisible(True)
|
||||
self.showFullScreen()
|
||||
#
|
||||
# def aa(self):
|
||||
# self.setWindowOpacity(1)
|
||||
self.frame = frame
|
||||
|
||||
def blankDisplay(self, blanked=True):
|
||||
if blanked:
|
||||
|
@ -26,7 +26,7 @@ import time
|
||||
import os
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
#from PyQt4.phonon import Phonon
|
||||
from PyQt4.phonon import Phonon
|
||||
|
||||
from openlp.core.lib import OpenLPToolbar, Receiver, str_to_bool, PluginConfig
|
||||
|
||||
@ -197,11 +197,11 @@ class SlideController(QtGui.QWidget):
|
||||
self.Mediabar.addToolbarButton(
|
||||
u'Media Stop', u':/slides/media_playback_stop.png',
|
||||
self.trUtf8(u'Start playing media'), self.onMediaStop)
|
||||
#self.volumeSlider = Phonon.VolumeSlider()
|
||||
#self.volumeSlider.setGeometry(QtCore.QRect(90, 260, 221, 24))
|
||||
#self.volumeSlider.setObjectName(u'volumeSlider')
|
||||
#self.Mediabar.addToolbarWidget(
|
||||
# u'Audio Volume', self.volumeSlider)
|
||||
self.volumeSlider = Phonon.VolumeSlider()
|
||||
self.volumeSlider.setGeometry(QtCore.QRect(90, 260, 221, 24))
|
||||
self.volumeSlider.setObjectName(u'volumeSlider')
|
||||
self.Mediabar.addToolbarWidget(
|
||||
u'Audio Volume', self.volumeSlider)
|
||||
self.ControllerLayout.addWidget(self.Mediabar)
|
||||
# Build the Song Toolbar
|
||||
if isLive:
|
||||
@ -236,13 +236,13 @@ class SlideController(QtGui.QWidget):
|
||||
self.SlideLayout.setSpacing(0)
|
||||
self.SlideLayout.setMargin(0)
|
||||
self.SlideLayout.setObjectName(u'SlideLayout')
|
||||
# self.mediaObject = Phonon.MediaObject(self)
|
||||
#self.video = Phonon.VideoWidget()
|
||||
#self.video.setVisible(False)
|
||||
#self.audio = Phonon.AudioOutput(Phonon.VideoCategory, self.mediaObject)
|
||||
#Phonon.createPath(self.mediaObject, self.video)
|
||||
#Phonon.createPath(self.mediaObject, self.audio)
|
||||
#self.SlideLayout.insertWidget(0, self.video)
|
||||
self.mediaObject = Phonon.MediaObject(self)
|
||||
self.video = Phonon.VideoWidget()
|
||||
self.video.setVisible(False)
|
||||
self.audio = Phonon.AudioOutput(Phonon.VideoCategory, self.mediaObject)
|
||||
Phonon.createPath(self.mediaObject, self.video)
|
||||
Phonon.createPath(self.mediaObject, self.audio)
|
||||
self.SlideLayout.insertWidget(0, self.video)
|
||||
# Actual preview screen
|
||||
self.SlidePreview = QtGui.QLabel(self)
|
||||
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed,
|
||||
@ -517,10 +517,10 @@ class SlideController(QtGui.QWidget):
|
||||
else:
|
||||
before = time.time()
|
||||
frame = self.serviceItem.get_rendered_frame(row)
|
||||
self.SlidePreview.setPixmap(QtGui.QPixmap.fromImage(frame))
|
||||
self.SlidePreview.setPixmap(QtGui.QPixmap.fromImage(frame[u'main']))
|
||||
log.log(15, u'Slide Rendering took %4s' % (time.time() - before))
|
||||
if self.isLive:
|
||||
self.parent.mainDisplay.frameView(frame)
|
||||
self.parent.mainDisplay.frameView(frame, True)
|
||||
self.selectedRow = row
|
||||
|
||||
def onSlideChange(self, row):
|
||||
|
@ -325,7 +325,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
||||
self.verse_form.setVerse(tempText, True, verseId)
|
||||
self.verse_form.exec_()
|
||||
afterText, verse, subVerse = self.verse_form.getVerse()
|
||||
data = u'%s:%s' %(verse , subVerse)
|
||||
data = u'%s:%s' %(verse, subVerse)
|
||||
item.setData(QtCore.Qt.UserRole, QtCore.QVariant(data))
|
||||
item.setText(afterText)
|
||||
#number of lines has change
|
||||
|
Loading…
Reference in New Issue
Block a user