forked from openlp/openlp
Text over video
This commit is contained in:
parent
387e281da0
commit
09da62f9cc
@ -137,6 +137,8 @@ class MainDisplay(DisplayWidget):
|
||||
QtCore.SIGNAL(u'maindisplay_hide'), self.hideDisplay)
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
QtCore.SIGNAL(u'maindisplay_show'), self.showDisplay)
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
QtCore.SIGNAL(u'videodisplay_background'), self.hideDisplayForVideo)
|
||||
|
||||
def setup(self):
|
||||
"""
|
||||
@ -351,6 +353,8 @@ class VideoDisplay(Phonon.VideoWidget):
|
||||
QtCore.SIGNAL(u'videodisplay_pause'), self.onMediaPause)
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
QtCore.SIGNAL(u'videodisplay_stop'), self.onMediaStop)
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
QtCore.SIGNAL(u'videodisplay_background'), self.onMediaBackground)
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
QtCore.SIGNAL(u'config_updated'), self.setup)
|
||||
self.setVisible(False)
|
||||
@ -382,6 +386,11 @@ class VideoDisplay(Phonon.VideoWidget):
|
||||
self.setVisible(False)
|
||||
self.primary = True
|
||||
|
||||
def onMediaBackground(self, message):
|
||||
log.debug(u'VideoDisplay Queue new media message %s' % message)
|
||||
source = self.mediaObject.setCurrentSource(Phonon.MediaSource(message))
|
||||
self._play()
|
||||
|
||||
def onMediaQueue(self, message):
|
||||
log.debug(u'VideoDisplay Queue new media message %s' % message)
|
||||
file = os.path.join(message[0].get_frame_path(),
|
||||
|
@ -29,7 +29,7 @@ import os
|
||||
from PyQt4 import QtCore, QtGui
|
||||
|
||||
from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \
|
||||
ItemCapabilities, SettingsManager
|
||||
ItemCapabilities, SettingsManager, contextMenuAction, Receiver
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@ -47,6 +47,7 @@ class MediaMediaItem(MediaManagerItem):
|
||||
def __init__(self, parent, icon, title):
|
||||
self.PluginNameShort = u'Media'
|
||||
self.IconPath = u'images/image'
|
||||
self.background = False
|
||||
# this next is a class, not an instance of a class - it will
|
||||
# be instanced by the base MediaManagerItem
|
||||
self.ListViewWithDnD_class = MediaListView
|
||||
@ -71,6 +72,48 @@ class MediaMediaItem(MediaManagerItem):
|
||||
self.hasNewIcon = False
|
||||
self.hasEditIcon = False
|
||||
|
||||
def addListViewToToolBar(self):
|
||||
MediaManagerItem.addListViewToToolBar(self)
|
||||
self.ListView.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu)
|
||||
self.ListView.addAction(
|
||||
contextMenuAction(
|
||||
self.ListView, u':/slides/slide_blank.png',
|
||||
self.trUtf8('Replace Live Background'),
|
||||
self.onReplaceClick))
|
||||
|
||||
def addEndHeaderBar(self):
|
||||
self.ImageWidget = QtGui.QWidget(self)
|
||||
sizePolicy = QtGui.QSizePolicy(
|
||||
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(
|
||||
self.ImageWidget.sizePolicy().hasHeightForWidth())
|
||||
self.ImageWidget.setSizePolicy(sizePolicy)
|
||||
self.ImageWidget.setObjectName(u'ImageWidget')
|
||||
self.blankButton = self.Toolbar.addToolbarButton(
|
||||
u'Replace Background', u':/slides/slide_blank.png',
|
||||
self.trUtf8('Replace Live Background'), self.onReplaceClick, False)
|
||||
# Add the song widget to the page layout
|
||||
self.PageLayout.addWidget(self.ImageWidget)
|
||||
|
||||
def onReplaceClick(self):
|
||||
if self.background:
|
||||
self.background = False
|
||||
Receiver.send_message(u'videodisplay_stop')
|
||||
else:
|
||||
self.background = True
|
||||
if not self.ListView.selectedIndexes():
|
||||
QtGui.QMessageBox.information(self,
|
||||
self.trUtf8('No item selected'),
|
||||
self.trUtf8('You must select one item'))
|
||||
items = self.ListView.selectedIndexes()
|
||||
for item in items:
|
||||
bitem = self.ListView.item(item.row())
|
||||
filename = unicode((bitem.data(QtCore.Qt.UserRole)).toString())
|
||||
Receiver.send_message(u'videodisplay_background', filename)
|
||||
|
||||
|
||||
def generateSlideData(self, service_item, item=None):
|
||||
if item is None:
|
||||
item = self.ListView.currentItem()
|
||||
|
@ -108,6 +108,7 @@ class PresentationMediaItem(MediaManagerItem):
|
||||
self.servicePath = os.path.join(
|
||||
AppLocation.get_section_data_path(self.settings_section),
|
||||
u'thumbnails')
|
||||
self.ListView.setIconSize(QtCore.QSize(88,50))
|
||||
if not os.path.exists(self.servicePath):
|
||||
os.mkdir(self.servicePath)
|
||||
list = SettingsManager.load_list(
|
||||
|
Loading…
Reference in New Issue
Block a user