forked from openlp/openlp
Merged HEAD
This commit is contained in:
commit
29a2138deb
@ -81,6 +81,8 @@ class OpenLP(QtGui.QApplication):
|
||||
bits = unicode(line).split(u'-')
|
||||
applicationVersion = {u'Full':unicode(line).rstrip(),
|
||||
u'version':bits[0], u'build':bits[1]}
|
||||
log.info(u'Openlp version %s build %s' %
|
||||
(applicationVersion[u'version'],applicationVersion[u'build'] ))
|
||||
except:
|
||||
applicationVersion = {u'Full':u'1.9.0-000',
|
||||
u'version':u'1.9.0', u'build':u'000'}
|
||||
@ -147,6 +149,7 @@ def main():
|
||||
logfile.setFormatter(logging.Formatter(
|
||||
u'%(asctime)s %(name)-15s %(levelname)-8s %(message)s'))
|
||||
log.addHandler(logfile)
|
||||
logging.addLevelName(15, u'Timer')
|
||||
# Parse command line options and deal with them.
|
||||
(options, args) = parser.parse_args()
|
||||
qt_args = []
|
||||
|
@ -38,7 +38,6 @@ class ServiceItemType(object):
|
||||
Text = 1
|
||||
Image = 2
|
||||
Command = 3
|
||||
Video = 4
|
||||
|
||||
class ServiceItem(object):
|
||||
"""
|
||||
@ -156,12 +155,6 @@ class ServiceItem(object):
|
||||
self.service_frames.append(
|
||||
{u'title': frame_title, u'text': None, u'image': image})
|
||||
|
||||
def add_from_media(self, path, frame_title, image):
|
||||
self.service_item_type = ServiceItemType.Video
|
||||
self.service_item_path = path
|
||||
self.service_frames.append(
|
||||
{u'title': frame_title, u'text': None, u'image': image})
|
||||
|
||||
def add_from_text(self, frame_title, raw_slide):
|
||||
"""
|
||||
Add a text slide to the service item.
|
||||
@ -216,10 +209,7 @@ class ServiceItem(object):
|
||||
service_data.append(slide[u'title'])
|
||||
elif self.service_item_type == ServiceItemType.Command:
|
||||
for slide in self.service_frames:
|
||||
service_data.append(slide[u'title'])
|
||||
elif self.service_item_type == ServiceItemType.Video:
|
||||
for slide in self.service_frames:
|
||||
service_data.append(slide[u'title'])
|
||||
service_data.append({u'title':slide[u'title'], u'image':slide[u'image']})
|
||||
return {u'header': service_header, u'data': service_data}
|
||||
|
||||
def set_from_service(self, serviceitem, path=None):
|
||||
@ -252,10 +242,8 @@ class ServiceItem(object):
|
||||
self.add_from_image(path, text_image, real_image)
|
||||
elif self.service_item_type == ServiceItemType.Command:
|
||||
for text_image in serviceitem[u'serviceitem'][u'data']:
|
||||
filename = os.path.join(path, text_image)
|
||||
self.add_from_command(path, text_image)
|
||||
elif self.service_item_type == ServiceItemType.Video:
|
||||
pass
|
||||
filename = os.path.join(path, text_image[u'title'])
|
||||
self.add_from_command(path, text_image[u'title'], text_image[u'image'] )
|
||||
|
||||
def merge(self, other):
|
||||
"""
|
||||
@ -279,3 +267,17 @@ class ServiceItem(object):
|
||||
"""
|
||||
return self.uuid != other.uuid
|
||||
|
||||
def isSong(self):
|
||||
return self.name == u'Songs'
|
||||
|
||||
def isMedia(self):
|
||||
return self.name.lower() == u'media'
|
||||
|
||||
def isCommand(self):
|
||||
return self.service_item_type == ServiceItemType.Command
|
||||
|
||||
def isImage(self):
|
||||
return self.service_item_type == ServiceItemType.Image
|
||||
|
||||
def isText(self):
|
||||
return self.service_item_type == ServiceItemType.Text
|
||||
|
@ -134,7 +134,8 @@ class SongXMLParser(object):
|
||||
The XML of the song to be parsed.
|
||||
"""
|
||||
try:
|
||||
self.song_xml = ElementTree(element=XML(xml))
|
||||
self.song_xml = ElementTree(
|
||||
element=XML(unicode(xml).encode('unicode-escape')))
|
||||
except:
|
||||
log.exception(u'Invalid xml %s', xml)
|
||||
|
||||
@ -147,7 +148,8 @@ class SongXMLParser(object):
|
||||
verse_list = []
|
||||
for element in iter:
|
||||
if element.tag == u'verse':
|
||||
verse_list.append([element.attrib, element.text])
|
||||
verse_list.append([element.attrib,
|
||||
unicode(element.text).decode('unicode-escape')])
|
||||
return verse_list
|
||||
|
||||
def dump_xml(self):
|
||||
|
@ -30,7 +30,7 @@ from xml.etree.ElementTree import ElementTree, XML
|
||||
from openlp.core.lib import str_to_bool
|
||||
|
||||
blankthemexml=\
|
||||
'''<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
'''<?xml version="1.0" encoding="utf-8"?>
|
||||
<theme version="1.0">
|
||||
<name>BlankStyle</name>
|
||||
<background mode="transparent"/>
|
||||
@ -348,6 +348,7 @@ class ThemeXML(object):
|
||||
iter = theme_xml.getiterator()
|
||||
master = u''
|
||||
for element in iter:
|
||||
element.text = unicode(element.text).decode('unicode-escape')
|
||||
if len(element.getchildren()) > 0:
|
||||
master = element.tag + u'_'
|
||||
else:
|
||||
|
@ -126,7 +126,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
|
||||
def accept(self):
|
||||
new_theme = ThemeXML()
|
||||
theme_name = unicode(self.ThemeNameEdit.displayText())
|
||||
new_theme.new_document(theme_name)
|
||||
new_theme.new_document(theme_name.encode('unicode-escape'))
|
||||
save_from = None
|
||||
save_to = None
|
||||
if self.theme.background_mode == u'transparent':
|
||||
@ -144,7 +144,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
|
||||
(path, filename) = \
|
||||
os.path.split(unicode(self.theme.background_filename))
|
||||
new_theme.add_background_image(filename)
|
||||
save_to= os.path.join(self.path, theme_name, filename )
|
||||
save_to = os.path.join(self.path, theme_name, filename)
|
||||
save_from = self.theme.background_filename
|
||||
|
||||
new_theme.add_font(unicode(self.theme.font_main_name),
|
||||
|
@ -24,11 +24,12 @@
|
||||
|
||||
import logging
|
||||
import os
|
||||
import time
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
from PyQt4.phonon import Phonon
|
||||
|
||||
from openlp.core.lib import Receiver, str_to_bool
|
||||
from openlp.core.lib import Receiver
|
||||
|
||||
class DisplayWidget(QtGui.QWidget):
|
||||
"""
|
||||
@ -107,7 +108,6 @@ class MainDisplay(DisplayWidget):
|
||||
self.blankFrame = None
|
||||
self.frame = None
|
||||
self.alertactive = False
|
||||
self.alertTab = None
|
||||
self.timer_id = 0
|
||||
self.firstTime = True
|
||||
self.mediaLoaded = False
|
||||
@ -130,7 +130,6 @@ class MainDisplay(DisplayWidget):
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
QtCore.SIGNAL(u'media_stop'), self.onMediaStop)
|
||||
|
||||
|
||||
def setup(self, screenNumber):
|
||||
"""
|
||||
Sets up the screen on a particular screen.
|
||||
@ -198,10 +197,16 @@ class MainDisplay(DisplayWidget):
|
||||
if self.timer_id != 0 :
|
||||
self.displayAlert()
|
||||
elif not self.displayBlank:
|
||||
# self.setWindowOpacity(0.5)
|
||||
# self.show()
|
||||
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)
|
||||
|
||||
def blankDisplay(self):
|
||||
if not self.displayBlank:
|
||||
@ -267,7 +272,7 @@ class MainDisplay(DisplayWidget):
|
||||
self.onMediaPlay()
|
||||
|
||||
def onMediaPlay(self):
|
||||
log.debug(u'Play the new media')
|
||||
log.debug(u'Play the new media, Live ')
|
||||
if not self.mediaLoaded and not self.displayBlank:
|
||||
self.blankDisplay()
|
||||
self.firstTime = True
|
||||
|
@ -536,6 +536,9 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||
self.settingsForm.postSetUp()
|
||||
|
||||
def versionCheck(self):
|
||||
"""
|
||||
Checks the version of the Application called from openlp.pyw
|
||||
"""
|
||||
applicationVersion = self.applicationVersion[u'Full']
|
||||
version = check_latest_version(self.generalConfig, applicationVersion)
|
||||
if applicationVersion != version:
|
||||
@ -676,7 +679,8 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||
self.setWindowTitle(title)
|
||||
|
||||
def defaultThemeChanged(self, theme):
|
||||
self.DefaultThemeLabel.setText(self.defaultThemeText + theme)
|
||||
self.DefaultThemeLabel.setText(
|
||||
u'%s %s' % (self.defaultThemeText, theme))
|
||||
|
||||
def toggleMediaManager(self, visible):
|
||||
if self.MediaManagerDock.isVisible() != visible:
|
||||
|
@ -56,7 +56,6 @@ class ServiceManagerList(QtGui.QTreeWidget):
|
||||
# else:
|
||||
# event.ignore()
|
||||
|
||||
|
||||
def keyPressEvent(self, event):
|
||||
if type(event) == QtGui.QKeyEvent:
|
||||
#here accept the event and do something
|
||||
@ -99,7 +98,6 @@ class ServiceManagerList(QtGui.QTreeWidget):
|
||||
mimeData.setText(u'ServiceManager')
|
||||
dropAction = drag.start(QtCore.Qt.CopyAction)
|
||||
|
||||
|
||||
class ServiceManager(QtGui.QWidget):
|
||||
"""
|
||||
Manages the services. This involves taking text strings from plugins and
|
||||
|
@ -1,6 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
||||
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
@ -24,8 +23,11 @@
|
||||
|
||||
import logging
|
||||
import time
|
||||
import os
|
||||
|
||||
from PyQt4 import QtCore, QtGui
|
||||
from PyQt4.phonon import Phonon
|
||||
|
||||
from openlp.core.lib import OpenLPToolbar, Receiver, ServiceItemType, \
|
||||
str_to_bool, PluginConfig
|
||||
|
||||
@ -80,20 +82,9 @@ class SlideController(QtGui.QWidget):
|
||||
u'Loop Separator',
|
||||
u'Image SpinBox'
|
||||
]
|
||||
self.media_list = [
|
||||
u'Media Start',
|
||||
u'Media Stop',
|
||||
u'Media Pause'
|
||||
]
|
||||
self.song_edit_list = [
|
||||
u'Edit Song',
|
||||
]
|
||||
self.song_list = [
|
||||
u'First Slide',
|
||||
u'Previous Slide',
|
||||
u'Next Slide',
|
||||
u'Last Slide',
|
||||
]
|
||||
self.timer_id = 0
|
||||
self.commandItem = None
|
||||
self.songEdit = False
|
||||
@ -109,10 +100,12 @@ class SlideController(QtGui.QWidget):
|
||||
self.TypeLabel.setText(u'<strong>%s</strong>' %
|
||||
self.trUtf8(u'Live'))
|
||||
self.split = 1
|
||||
prefix = u'live_slidecontroller'
|
||||
else:
|
||||
self.TypeLabel.setText(u'<strong>%s</strong>' %
|
||||
self.trUtf8(u'Preview'))
|
||||
self.split = 0
|
||||
prefix = u'preview_slidecontroller'
|
||||
self.TypeLabel.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.PanelLayout.addWidget(self.TypeLabel)
|
||||
# Splitter
|
||||
@ -190,16 +183,24 @@ class SlideController(QtGui.QWidget):
|
||||
u'Image SpinBox', self.DelaySpinBox)
|
||||
self.DelaySpinBox.setSuffix(self.trUtf8(u's'))
|
||||
self.DelaySpinBox.setToolTip(self.trUtf8(u'Delay between slides in seconds'))
|
||||
self.Toolbar.addToolbarButton(
|
||||
u'Media Start', u':/slides/media_playback_start.png',
|
||||
self.trUtf8(u'Start playing media'), self.onMediaPlay)
|
||||
self.Toolbar.addToolbarButton(
|
||||
u'Media Pause', u':/slides/media_playback_pause.png',
|
||||
self.trUtf8(u'Start playing media'), self.onMediaPause)
|
||||
self.Toolbar.addToolbarButton(
|
||||
u'Media Stop', u':/slides/media_playback_stop.png',
|
||||
self.trUtf8(u'Start playing media'), self.onMediaStop)
|
||||
self.ControllerLayout.addWidget(self.Toolbar)
|
||||
#Build a Media ToolBar
|
||||
self.Mediabar = OpenLPToolbar(self)
|
||||
self.Mediabar.addToolbarButton(
|
||||
u'Media Start', u':/slides/media_playback_start.png',
|
||||
self.trUtf8(u'Start playing media'), self.onMediaPlay)
|
||||
self.Mediabar.addToolbarButton(
|
||||
u'Media Pause', u':/slides/media_playback_pause.png',
|
||||
self.trUtf8(u'Start playing media'), self.onMediaPause)
|
||||
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("volumeSlider")
|
||||
self.Mediabar.addToolbarWidget(
|
||||
u'Audio Volume', self.volumeSlider)
|
||||
self.ControllerLayout.addWidget(self.Mediabar)
|
||||
# Build the Song Toolbar
|
||||
if isLive:
|
||||
self.Songbar = OpenLPToolbar(self)
|
||||
@ -229,8 +230,19 @@ class SlideController(QtGui.QWidget):
|
||||
self.grid = QtGui.QGridLayout(self.PreviewFrame)
|
||||
self.grid.setMargin(8)
|
||||
self.grid.setObjectName(u'grid')
|
||||
self.SlideLayout = QtGui.QVBoxLayout()
|
||||
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)
|
||||
# Actual preview screen
|
||||
self.SlidePreview = QtGui.QLabel(self.parent)
|
||||
self.SlidePreview = QtGui.QLabel(self)
|
||||
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed,
|
||||
QtGui.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
@ -245,7 +257,8 @@ class SlideController(QtGui.QWidget):
|
||||
self.SlidePreview.setLineWidth(1)
|
||||
self.SlidePreview.setScaledContents(True)
|
||||
self.SlidePreview.setObjectName(u'SlidePreview')
|
||||
self.grid.addWidget(self.SlidePreview, 0, 0, 1, 1)
|
||||
self.SlideLayout.insertWidget(0, self.SlidePreview)
|
||||
self.grid.addLayout(self.SlideLayout, 0, 0, 1, 1)
|
||||
# Signals
|
||||
QtCore.QObject.connect(self.PreviewListWidget,
|
||||
QtCore.SIGNAL(u'clicked(QModelIndex)'), self.onSlideSelected)
|
||||
@ -259,13 +272,9 @@ class SlideController(QtGui.QWidget):
|
||||
Receiver().send_message(u'request_spin_delay')
|
||||
if isLive:
|
||||
self.Toolbar.makeWidgetsInvisible(self.image_list)
|
||||
self.Toolbar.makeWidgetsInvisible(self.media_list)
|
||||
else:
|
||||
self.Toolbar.makeWidgetsInvisible(self.song_edit_list)
|
||||
if isLive:
|
||||
prefix = u'live_slidecontroller'
|
||||
else:
|
||||
prefix = u'preview_slidecontroller'
|
||||
self.Mediabar.setVisible(False)
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
QtCore.SIGNAL(u'%s_first' % prefix), self.onSlideSelectedFirst)
|
||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
@ -291,10 +300,9 @@ class SlideController(QtGui.QWidget):
|
||||
self.PreviewListWidget.setColumnWidth(0, width)
|
||||
for framenumber, frame in enumerate(self.commandItem.frames):
|
||||
if frame[u'text']:
|
||||
break
|
||||
return
|
||||
self.PreviewListWidget.setRowHeight(framenumber, height)
|
||||
|
||||
|
||||
def trackSplitter(self, tab, pos):
|
||||
"""
|
||||
Splitter between the slide list and the preview panel
|
||||
@ -333,13 +341,13 @@ class SlideController(QtGui.QWidget):
|
||||
"""
|
||||
Allows the live toolbar to be customised
|
||||
"""
|
||||
self.Toolbar.setVisible(True)
|
||||
self.Songbar.setVisible(False)
|
||||
self.Mediabar.setVisible(False)
|
||||
self.Toolbar.makeWidgetsInvisible(self.image_list)
|
||||
self.Toolbar.makeWidgetsInvisible(self.media_list)
|
||||
self.Toolbar.makeWidgetsVisible(self.song_list)
|
||||
if item.service_item_type == ServiceItemType.Text:
|
||||
if item.isText():
|
||||
self.Toolbar.makeWidgetsInvisible(self.image_list)
|
||||
if item.name == u'Songs' and \
|
||||
if item.isSong() and \
|
||||
str_to_bool(self.songsconfig.get_config(u'display songbar', True)):
|
||||
for action in self.Songbar.actions:
|
||||
self.Songbar.actions[action].setVisible(False)
|
||||
@ -354,23 +362,28 @@ class SlideController(QtGui.QWidget):
|
||||
#More than 20 verses hard luck
|
||||
pass
|
||||
self.Songbar.setVisible(True)
|
||||
elif item.service_item_type == ServiceItemType.Image:
|
||||
elif item.isImage():
|
||||
#Not sensible to allow loops with 1 frame
|
||||
if len(item.frames) > 1:
|
||||
self.Toolbar.makeWidgetsVisible(self.image_list)
|
||||
elif item.service_item_type == ServiceItemType.Command and \
|
||||
item.name == u'Media':
|
||||
self.Toolbar.makeWidgetsInvisible(self.song_list)
|
||||
self.Toolbar.makeWidgetsVisible(self.media_list)
|
||||
elif item.isMedia():
|
||||
self.Toolbar.setVisible(False)
|
||||
self.Mediabar.setVisible(True)
|
||||
self.volumeSlider.setAudioOutput(self.parent.mainDisplay.audio)
|
||||
|
||||
def enablePreviewToolBar(self, item):
|
||||
"""
|
||||
Allows the Preview toolbar to be customised
|
||||
"""
|
||||
if (item.name == u'Songs' or item.name == u'Custom') and item.fromPlugin:
|
||||
self.Toolbar.setVisible(True)
|
||||
self.Mediabar.setVisible(False)
|
||||
self.Toolbar.makeWidgetsInvisible(self.song_edit_list)
|
||||
if item.editEnabled and item.fromPlugin:
|
||||
self.Toolbar.makeWidgetsVisible(self.song_edit_list)
|
||||
else:
|
||||
self.Toolbar.makeWidgetsInvisible(self.song_edit_list)
|
||||
elif item.isMedia():
|
||||
self.Toolbar.setVisible(False)
|
||||
self.Mediabar.setVisible(True)
|
||||
self.volumeSlider.setAudioOutput(self.audio)
|
||||
|
||||
def addServiceItem(self, item):
|
||||
"""
|
||||
@ -380,18 +393,21 @@ class SlideController(QtGui.QWidget):
|
||||
"""
|
||||
log.debug(u'addServiceItem')
|
||||
#If old item was a command tell it to stop
|
||||
if self.commandItem and \
|
||||
self.commandItem.service_item_type == ServiceItemType.Command:
|
||||
Receiver().send_message(u'%s_stop'% self.commandItem.name.lower())
|
||||
if self.commandItem and self.commandItem.isCommand():
|
||||
self.onMediaStop()
|
||||
self.commandItem = item
|
||||
before = time.time()
|
||||
item.render()
|
||||
log.info(u'Rendering took %4s' % (time.time() - before))
|
||||
log.log(15, u'Rendering took %4s' % (time.time() - before))
|
||||
self.enableToolBar(item)
|
||||
if item.service_item_type == ServiceItemType.Command:
|
||||
Receiver().send_message(u'%s_start' % item.name.lower(), \
|
||||
[item.shortname, item.service_item_path,
|
||||
item.service_frames[0][u'title'], self.isLive])
|
||||
if item.isCommand():
|
||||
if self.isLive:
|
||||
Receiver().send_message(u'%s_start' % item.name.lower(), \
|
||||
[item.shortname, item.service_item_path,
|
||||
item.service_frames[0][u'title'], self.isLive])
|
||||
else:
|
||||
if item.isMedia():
|
||||
self.onMediaStart(item)
|
||||
slideno = 0
|
||||
if self.songEdit:
|
||||
slideno = self.row
|
||||
@ -413,15 +429,18 @@ class SlideController(QtGui.QWidget):
|
||||
"""
|
||||
log.debug(u'addServiceManagerItem')
|
||||
#If old item was a command tell it to stop
|
||||
if self.commandItem and \
|
||||
self.commandItem.service_item_type == ServiceItemType.Command:
|
||||
Receiver().send_message(u'%s_stop'% self.commandItem.name.lower())
|
||||
if self.commandItem and self.commandItem.isCommand():
|
||||
self.onMediaStop()
|
||||
self.commandItem = item
|
||||
self.enableToolBar(item)
|
||||
if item.service_item_type == ServiceItemType.Command:
|
||||
Receiver().send_message(u'%s_start' % item.name.lower(), \
|
||||
[item.shortname, item.service_item_path,
|
||||
item.service_frames[0][u'title'], slideno, self.isLive])
|
||||
if item.isCommand():
|
||||
if self.isLive:
|
||||
Receiver().send_message(u'%s_start' % item.name.lower(), \
|
||||
[item.shortname, item.service_item_path,
|
||||
item.service_frames[0][u'title'], slideno, self.isLive])
|
||||
else:
|
||||
if item.isMedia():
|
||||
self.onMediaStart(item)
|
||||
self.displayServiceManagerItems(item, slideno)
|
||||
|
||||
def displayServiceManagerItems(self, serviceitem, slideno):
|
||||
@ -467,7 +486,7 @@ class SlideController(QtGui.QWidget):
|
||||
self.PreviewListWidget.selectRow(slideno)
|
||||
self.onSlideSelected()
|
||||
self.PreviewListWidget.setFocus()
|
||||
log.info(u'Display Rendering took %4s' % (time.time() - before))
|
||||
log.log(15, u'Display Rendering took %4s' % (time.time() - before))
|
||||
if self.serviceitem.audit and self.isLive:
|
||||
Receiver().send_message(u'songusage_live', self.serviceitem.audit)
|
||||
log.debug(u'displayServiceManagerItems End')
|
||||
@ -477,8 +496,7 @@ class SlideController(QtGui.QWidget):
|
||||
"""
|
||||
Go to the first slide.
|
||||
"""
|
||||
if self.commandItem and \
|
||||
self.commandItem.service_item_type == ServiceItemType.Command:
|
||||
if self.commandItem and self.commandItem.isCommand():
|
||||
Receiver().send_message(u'%s_first'% self.commandItem.name.lower())
|
||||
self.updatePreview()
|
||||
else:
|
||||
@ -489,8 +507,7 @@ class SlideController(QtGui.QWidget):
|
||||
"""
|
||||
Blank the screen.
|
||||
"""
|
||||
if self.commandItem and \
|
||||
self.commandItem.service_item_type == ServiceItemType.Command:
|
||||
if self.commandItem and self.commandItem.isCommand():
|
||||
if blanked:
|
||||
Receiver().send_message(u'%s_blank'% self.commandItem.name.lower())
|
||||
else:
|
||||
@ -506,7 +523,7 @@ class SlideController(QtGui.QWidget):
|
||||
row = self.PreviewListWidget.currentRow()
|
||||
self.row = 0
|
||||
if row > -1 and row < self.PreviewListWidget.rowCount():
|
||||
if self.commandItem.service_item_type == ServiceItemType.Command:
|
||||
if self.commandItem.isCommand():
|
||||
Receiver().send_message(u'%s_slide'% self.commandItem.name.lower(), [row])
|
||||
if self.isLive:
|
||||
self.updatePreview()
|
||||
@ -516,7 +533,7 @@ class SlideController(QtGui.QWidget):
|
||||
if frame is None:
|
||||
frame = self.serviceitem.render_individual(row)
|
||||
self.SlidePreview.setPixmap(QtGui.QPixmap.fromImage(frame))
|
||||
log.info(u'Slide Rendering took %4s' % (time.time() - before))
|
||||
log.log(15, u'Slide Rendering took %4s' % (time.time() - before))
|
||||
if self.isLive:
|
||||
self.parent.mainDisplay.frameView(frame)
|
||||
self.row = row
|
||||
@ -535,22 +552,23 @@ class SlideController(QtGui.QWidget):
|
||||
QtCore.QTimer.singleShot(0.5, self.grabMainDisplay)
|
||||
QtCore.QTimer.singleShot(2.5, self.grabMainDisplay)
|
||||
else:
|
||||
label = self.PreviewListWidget.cellWidget(self.PreviewListWidget.currentRow(), 0)
|
||||
label = self.PreviewListWidget.cellWidget(
|
||||
self.PreviewListWidget.currentRow(), 0)
|
||||
self.SlidePreview.setPixmap(label.pixmap())
|
||||
|
||||
def grabMainDisplay(self):
|
||||
rm = self.parent.RenderManager
|
||||
winid = QtGui.QApplication.desktop().winId()
|
||||
rect = rm.screen_list[rm.current_display][u'size']
|
||||
winimg = QtGui.QPixmap.grabWindow(winid, rect.x(), rect.y(), rect.width(), rect.height())
|
||||
winimg = QtGui.QPixmap.grabWindow(winid, rect.x(),
|
||||
rect.y(), rect.width(), rect.height())
|
||||
self.SlidePreview.setPixmap(winimg)
|
||||
|
||||
def onSlideSelectedNext(self):
|
||||
"""
|
||||
Go to the next slide.
|
||||
"""
|
||||
if self.commandItem and \
|
||||
self.commandItem.service_item_type == ServiceItemType.Command:
|
||||
if self.commandItem and self.commandItem.isCommand():
|
||||
Receiver().send_message(u'%s_next'% self.commandItem.name.lower())
|
||||
self.updatePreview()
|
||||
else:
|
||||
@ -564,8 +582,7 @@ class SlideController(QtGui.QWidget):
|
||||
"""
|
||||
Go to the previous slide.
|
||||
"""
|
||||
if self.commandItem and \
|
||||
self.commandItem.service_item_type == ServiceItemType.Command:
|
||||
if self.commandItem and self.commandItem.isCommand():
|
||||
Receiver().send_message(
|
||||
u'%s_previous'% self.commandItem.name.lower())
|
||||
self.updatePreview()
|
||||
@ -580,8 +597,7 @@ class SlideController(QtGui.QWidget):
|
||||
"""
|
||||
Go to the last slide.
|
||||
"""
|
||||
if self.commandItem and \
|
||||
self.commandItem.service_item_type == ServiceItemType.Command:
|
||||
if self.commandItem and self.commandItem.isCommand():
|
||||
Receiver().send_message(u'%s_last'% self.commandItem.name.lower())
|
||||
self.updatePreview()
|
||||
else:
|
||||
@ -623,11 +639,32 @@ class SlideController(QtGui.QWidget):
|
||||
self.parent.LiveController.addServiceManagerItem(
|
||||
self.commandItem, row)
|
||||
|
||||
def onMediaStart(self, item):
|
||||
self.mediaObject.stop()
|
||||
self.mediaObject.clearQueue()
|
||||
file = os.path.join(item.service_item_path, item.service_frames[0][u'title'])
|
||||
self.mediaObject.setCurrentSource(Phonon.MediaSource(file))
|
||||
self.onMediaPlay()
|
||||
|
||||
def onMediaPause(self):
|
||||
Receiver().send_message(u'%s_pause'% self.commandItem.name.lower())
|
||||
if self.isLive:
|
||||
Receiver().send_message(u'%s_pause'% self.commandItem.name.lower())
|
||||
else:
|
||||
self.mediaObject.pause()
|
||||
|
||||
def onMediaPlay(self):
|
||||
Receiver().send_message(u'%s_play'% self.commandItem.name.lower())
|
||||
if self.isLive:
|
||||
Receiver().send_message(u'%s_play'% self.commandItem.name.lower(), self.isLive)
|
||||
else:
|
||||
self.SlidePreview.hide()
|
||||
self.video.show()
|
||||
self.mediaObject.play()
|
||||
|
||||
def onMediaStop(self):
|
||||
Receiver().send_message(u'%s_stop'% self.commandItem.name.lower())
|
||||
if self.isLive:
|
||||
Receiver().send_message(u'%s_stop'% self.commandItem.name.lower())
|
||||
else:
|
||||
self.mediaObject.stop()
|
||||
self.video.hide()
|
||||
self.SlidePreview.clear()
|
||||
self.SlidePreview.show()
|
||||
|
@ -79,7 +79,7 @@ class MediaMediaItem(MediaManagerItem):
|
||||
items = self.ListView.selectedIndexes()
|
||||
if len(items) > 1:
|
||||
return False
|
||||
service_item.title = self.trUtf8(u'Media')
|
||||
service_item.title = unicode(self.trUtf8(u'Media'))
|
||||
for item in items:
|
||||
bitem = self.ListView.item(item.row())
|
||||
filename = unicode((bitem.data(QtCore.Qt.UserRole)).toString())
|
||||
|
@ -291,7 +291,7 @@ class SongMediaItem(MediaManagerItem):
|
||||
service_item.editId = item_id
|
||||
service_item.verse_order = song.verse_order
|
||||
if song.lyrics.startswith(u'<?xml version='):
|
||||
songXML=SongXMLParser(song.lyrics)
|
||||
songXML = SongXMLParser(song.lyrics)
|
||||
verseList = songXML.get_verses()
|
||||
for verse in verseList:
|
||||
if verse[1]:
|
||||
|
@ -1 +1 @@
|
||||
1.9.0-665
|
||||
1.9.0-669
|
||||
|
Loading…
Reference in New Issue
Block a user