forked from openlp/openlp
More fixes and new features
This commit is contained in:
parent
cee89eadcd
commit
bc4f31ef93
@ -47,6 +47,7 @@ class ItemCapabilities(object):
|
||||
AllowsEdit = 2
|
||||
AllowsMaintain = 3
|
||||
RequiresMedia = 4
|
||||
AllowsLoop = 5
|
||||
|
||||
|
||||
class ServiceItem(object):
|
||||
|
@ -276,7 +276,48 @@ class MainDisplay(DisplayWidget):
|
||||
self.display_alert.setPixmap(self.transparent)
|
||||
self.display_text.setPixmap(self.transparent)
|
||||
|
||||
class VideoDisplay(QtGui.QWidget):
|
||||
class VideoWidget(QtGui.QWidget):
|
||||
"""
|
||||
Customised version of QTableWidget which can respond to keyboard
|
||||
events.
|
||||
"""
|
||||
log.info(u'MainDisplay loaded')
|
||||
|
||||
def __init__(self, parent=None, name=None):
|
||||
QtGui.QWidget.__init__(self, None)
|
||||
self.parent = parent
|
||||
self.hotkey_map = {QtCore.Qt.Key_Return: 'servicemanager_next_item',
|
||||
QtCore.Qt.Key_Space: 'live_slidecontroller_next_noloop',
|
||||
QtCore.Qt.Key_Enter: 'live_slidecontroller_next_noloop',
|
||||
QtCore.Qt.Key_0: 'servicemanager_next_item',
|
||||
QtCore.Qt.Key_Backspace: 'live_slidecontroller_previous_noloop'}
|
||||
|
||||
def keyPressEvent(self, event):
|
||||
if type(event) == QtGui.QKeyEvent:
|
||||
#here accept the event and do something
|
||||
if event.key() == QtCore.Qt.Key_Up:
|
||||
Receiver.send_message(u'live_slidecontroller_previous')
|
||||
event.accept()
|
||||
elif event.key() == QtCore.Qt.Key_Down:
|
||||
Receiver.send_message(u'live_slidecontroller_next')
|
||||
event.accept()
|
||||
elif event.key() == QtCore.Qt.Key_PageUp:
|
||||
Receiver.send_message(u'live_slidecontroller_first')
|
||||
event.accept()
|
||||
elif event.key() == QtCore.Qt.Key_PageDown:
|
||||
Receiver.send_message(u'live_slidecontroller_last')
|
||||
event.accept()
|
||||
elif event.key() in self.hotkey_map:
|
||||
Receiver.send_message(self.hotkey_map[event.key()])
|
||||
event.accept()
|
||||
elif event.key() == QtCore.Qt.Key_Escape:
|
||||
self.resetDisplay()
|
||||
event.accept()
|
||||
event.ignore()
|
||||
else:
|
||||
event.ignore()
|
||||
|
||||
class VideoDisplay(VideoWidget):
|
||||
"""
|
||||
This is the form that is used to display videos on the projector.
|
||||
"""
|
||||
@ -293,7 +334,7 @@ class VideoDisplay(QtGui.QWidget):
|
||||
The list of screens.
|
||||
"""
|
||||
log.debug(u'VideoDisplay Initilisation started')
|
||||
QtGui.QWidget.__init__(self, None)
|
||||
VideoWidget.__init__(self, parent)
|
||||
self.setWindowTitle(u'OpenLP Video Display')
|
||||
self.parent = parent
|
||||
self.screens = screens
|
||||
@ -331,7 +372,7 @@ class VideoDisplay(QtGui.QWidget):
|
||||
log.debug(u'VideoDisplay Queue new media message %s' % message)
|
||||
file = os.path.join(message[1], message[2])
|
||||
if self.firstTime:
|
||||
self.mediaObject.setCurrentSource(Phonon.MediaSource(file))
|
||||
source = self.mediaObject.setCurrentSource(Phonon.MediaSource(file))
|
||||
self.firstTime = False
|
||||
else:
|
||||
self.mediaObject.enqueue(Phonon.MediaSource(file))
|
||||
|
@ -96,7 +96,7 @@ class SlideController(QtGui.QWidget):
|
||||
self.isLive = isLive
|
||||
self.parent = parent
|
||||
self.songsconfig = PluginConfig(u'Songs')
|
||||
self.image_list = [
|
||||
self.loop_list = [
|
||||
u'Start Loop',
|
||||
u'Stop Loop',
|
||||
u'Loop Separator',
|
||||
@ -233,6 +233,12 @@ class SlideController(QtGui.QWidget):
|
||||
self.Mediabar.addToolbarButton(
|
||||
u'Media Stop', u':/slides/media_playback_stop.png',
|
||||
self.trUtf8('Start playing media'), self.onMediaStop)
|
||||
if not self.isLive:
|
||||
self.seekSlider = Phonon.SeekSlider()
|
||||
self.seekSlider.setGeometry(QtCore.QRect(90, 260, 221, 24))
|
||||
self.seekSlider.setObjectName(u'seekSlider')
|
||||
self.Mediabar.addToolbarWidget(
|
||||
u'Seek Slider', self.seekSlider)
|
||||
self.volumeSlider = Phonon.VolumeSlider()
|
||||
self.volumeSlider.setGeometry(QtCore.QRect(90, 260, 221, 24))
|
||||
self.volumeSlider.setObjectName(u'volumeSlider')
|
||||
@ -299,7 +305,7 @@ class SlideController(QtGui.QWidget):
|
||||
QtCore.SIGNAL(u'update_spin_delay'), self.receiveSpinDelay)
|
||||
Receiver.send_message(u'request_spin_delay')
|
||||
if isLive:
|
||||
self.Toolbar.makeWidgetsInvisible(self.image_list)
|
||||
self.Toolbar.makeWidgetsInvisible(self.loop_list)
|
||||
else:
|
||||
self.Toolbar.makeWidgetsInvisible(self.song_edit_list)
|
||||
self.Mediabar.setVisible(False)
|
||||
@ -374,16 +380,16 @@ class SlideController(QtGui.QWidget):
|
||||
self.Toolbar.setVisible(True)
|
||||
self.Mediabar.setVisible(False)
|
||||
self.Toolbar.makeWidgetsInvisible([u'Song Menu'])
|
||||
self.Toolbar.makeWidgetsInvisible(self.image_list)
|
||||
self.Toolbar.makeWidgetsInvisible(self.loop_list)
|
||||
if item.is_text():
|
||||
self.Toolbar.makeWidgetsInvisible(self.image_list)
|
||||
self.Toolbar.makeWidgetsInvisible(self.loop_list)
|
||||
if str_to_bool(self.songsconfig.get_config(u'show songbar', True)) \
|
||||
and len(self.slideList) > 0:
|
||||
self.Toolbar.makeWidgetsVisible([u'Song Menu'])
|
||||
elif item.is_image():
|
||||
#Not sensible to allow loops with 1 frame
|
||||
if len(item.get_frames()) > 1:
|
||||
self.Toolbar.makeWidgetsVisible(self.image_list)
|
||||
self.Toolbar.makeWidgetsVisible(self.loop_list)
|
||||
elif item.is_media():
|
||||
self.Toolbar.setVisible(False)
|
||||
self.Mediabar.setVisible(True)
|
||||
@ -766,6 +772,8 @@ class SlideController(QtGui.QWidget):
|
||||
self.mediaObject.clearQueue()
|
||||
file = os.path.join(item.get_frame_path(), item.get_frame_title())
|
||||
self.mediaObject.setCurrentSource(Phonon.MediaSource(file))
|
||||
self.seekSlider.setMediaObject(self.mediaObject)
|
||||
self.seekSlider.show()
|
||||
self.onMediaPlay()
|
||||
|
||||
def onMediaPause(self):
|
||||
|
@ -82,6 +82,7 @@ class AlertsManager(QtCore.QObject):
|
||||
self.parent.maindisplay.parent.StatusBar.showMessage(u'')
|
||||
self.alertList.append(text)
|
||||
if self.timer_id != 0: # or self.parent.maindisplay.mediaLoaded:
|
||||
print self.timer_id, self.alertList, len(self.alertList)
|
||||
self.parent.maindisplay.parent.StatusBar.showMessage(\
|
||||
self.trUtf8(u'Alert message created and delayed'))
|
||||
return
|
||||
@ -91,7 +92,9 @@ class AlertsManager(QtCore.QObject):
|
||||
log.debug(u'Generate Alert called')
|
||||
if len(self.alertList) == 0:
|
||||
return
|
||||
print len(self.alertList)
|
||||
text = self.alertList.pop(0)
|
||||
print text
|
||||
alertTab = self.parent.alertsTab
|
||||
alertframe = \
|
||||
QtGui.QPixmap(self.screen[u'size'].width(), self.alertHeight)
|
||||
@ -113,6 +116,7 @@ class AlertsManager(QtCore.QObject):
|
||||
self.parent.maindisplay.addAlertImage(alertframe)
|
||||
# check to see if we have a timer running
|
||||
if self.timer_id == 0:
|
||||
print "timer tripped"
|
||||
self.timer_id = self.startTimer(int(alertTab.timeout) * 1000)
|
||||
|
||||
def timerEvent(self, event):
|
||||
|
Loading…
Reference in New Issue
Block a user