This commit is contained in:
Tim Bentley 2012-10-13 21:54:56 +01:00
parent c43cdea8b1
commit 77ddd4f385
2 changed files with 37 additions and 9 deletions

View File

@ -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

View File

@ -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):