From 77ddd4f3851a3b87e8fdf3d21284de9bd879cc37 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 13 Oct 2012 21:54:56 +0100 Subject: [PATCH] Fixes --- openlp/core/ui/media/mediacontroller.py | 34 ++++++++++++++++++++++++- openlp/plugins/media/lib/mediaitem.py | 12 +++------ 2 files changed, 37 insertions(+), 9 deletions(-) diff --git a/openlp/core/ui/media/mediacontroller.py b/openlp/core/ui/media/mediacontroller.py index 632766ed1..4d3f9bfe2 100644 --- a/openlp/core/ui/media/mediacontroller.py +++ b/openlp/core/ui/media/mediacontroller.py @@ -284,6 +284,9 @@ class MediaController(object): """ After a new display is configured, all media related widget will be created too + + ``display`` + Display on which the output is to be played """ # clean up possible running old media files self.finalise() @@ -298,6 +301,16 @@ class MediaController(object): player.setup(display) def set_controls_visible(self, controller, value): + """ + After a new display is configured, all media related widget will be + created too + + ``controller`` + The controller on which controls act. + + ``value`` + control name to be changed. + """ # Generic controls controller.mediabar.setVisible(value) if controller.isLive and controller.display: @@ -310,6 +323,12 @@ class MediaController(object): """ After Mainwindow changes or Splitter moved all related media widgets have to be resized + + ``display`` + The display on which output is playing. + + ``player`` + The player which is doing the playing. """ player.resize(display) @@ -317,6 +336,18 @@ class MediaController(object): hidden=False): """ Loads and starts a video to run with the option of sound + + ``serviceItem`` + The player which is doing the playing + + ``muted`` + The player which is doing the playing + + ``isBackground`` + The player which is doing the playing + + ``hidden`` + The player which is doing the playing """ log.debug(u'video') isValid = False @@ -327,7 +358,8 @@ class MediaController(object): controller.media_info.volume = 0 else: controller.media_info.volume = controller.volumeSlider.value() - controller.media_info.file_info = QtCore.QFileInfo(serviceItem.get_filename()) + controller.media_info.file_info = \ + QtCore.QFileInfo(serviceItem.get_filename()) controller.media_info.is_background = isBackground display = None #self.curDisplayMediaPlayer[u'current'] = serviceItem.name diff --git a/openlp/plugins/media/lib/mediaitem.py b/openlp/plugins/media/lib/mediaitem.py index ac3fc3fbb..64ec08d9d 100644 --- a/openlp/plugins/media/lib/mediaitem.py +++ b/openlp/plugins/media/lib/mediaitem.py @@ -44,9 +44,9 @@ from openlp.core.ui.media import get_media_players, set_media_players log = logging.getLogger(__name__) CLAPPERBOARD = u':/media/slidecontroller_multimedia.png' -VIDEO = QtGui.QImage(u':/media/media_video.png') -AUDIO = QtGui.QImage(u':/media/media_audio.png') -DVDICON = QtGui.QImage(u':/media/media_video.png') +VIDEO = build_icon(QtGui.QImage(u':/media/media_video.png')) +AUDIO = build_icon(QtGui.QImage(u':/media/media_audio.png')) +DVDICON = build_icon(QtGui.QImage(u':/media/media_video.png')) class MediaMediaItem(MediaManagerItem): @@ -215,8 +215,7 @@ class MediaMediaItem(MediaManagerItem): service_item.title = unicode(self.displayTypeComboBox.currentText()) service_item.shortname = service_item.title (path, name) = os.path.split(filename) - service_item.add_from_command(path, name, - u':/media/image_clapperboard.png') + service_item.add_from_command(path, name, CLAPPERBOARD) # Start media and obtain the length if not self.plugin.mediaController.media_length( self.mediaController, service_item): @@ -230,9 +229,6 @@ class MediaMediaItem(MediaManagerItem): service_item.will_auto_start = True # force a non-existent theme service_item.theme = -1 - frame = CLAPPERBOARD - (path, name) = os.path.split(filename) - service_item.add_from_command(path, name, frame) return True def initialise(self):