forked from openlp/openlp
volume fixes
This commit is contained in:
parent
5a4a33b9b8
commit
68ce73544a
@ -77,7 +77,7 @@ class MediaController(object):
|
|||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'seekSlider'), self.media_seek)
|
QtCore.SIGNAL(u'seekSlider'), self.media_seek)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'volumeSlider'), self.media_volume)
|
QtCore.SIGNAL(u'volumeSlider'), self.media_volume_msg)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'media_hide'), self.media_hide)
|
QtCore.SIGNAL(u'media_hide'), self.media_hide)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
@ -289,9 +289,6 @@ class MediaController(object):
|
|||||||
controller.volumeSlider.setGeometry(QtCore.QRect(90, 160, 221, 24))
|
controller.volumeSlider.setGeometry(QtCore.QRect(90, 160, 221, 24))
|
||||||
controller.volumeSlider.setObjectName(u'volumeSlider')
|
controller.volumeSlider.setObjectName(u'volumeSlider')
|
||||||
controller.mediabar.addToolbarWidget(controller.volumeSlider)
|
controller.mediabar.addToolbarWidget(controller.volumeSlider)
|
||||||
controller.volumeButton = QtGui.QToolButton()
|
|
||||||
controller.volumeButton.setAutoRaise(True)
|
|
||||||
controller.mediabar.addToolbarWidget(controller.volumeButton)
|
|
||||||
controller.controllerLayout.addWidget(controller.mediabar)
|
controller.controllerLayout.addWidget(controller.mediabar)
|
||||||
controller.mediabar.setVisible(False)
|
controller.mediabar.setVisible(False)
|
||||||
# Signals
|
# Signals
|
||||||
@ -379,12 +376,8 @@ class MediaController(object):
|
|||||||
# stop running videos
|
# stop running videos
|
||||||
self.media_reset(controller)
|
self.media_reset(controller)
|
||||||
controller.media_info = MediaInfo()
|
controller.media_info = MediaInfo()
|
||||||
if videoBehindText:
|
controller.media_info.volume = controller.volumeSlider.value()
|
||||||
controller.media_info.volume = 0
|
controller.media_info.is_background = videoBehindText
|
||||||
controller.media_info.is_background = True
|
|
||||||
else:
|
|
||||||
controller.media_info.volume = controller.volumeSlider.value()
|
|
||||||
controller.media_info.is_background = False
|
|
||||||
controller.media_info.file_info = \
|
controller.media_info.file_info = \
|
||||||
QtCore.QFileInfo(serviceItem.get_frame_path())
|
QtCore.QFileInfo(serviceItem.get_frame_path())
|
||||||
display = self._define_display(controller)
|
display = self._define_display(controller)
|
||||||
@ -542,6 +535,10 @@ class MediaController(object):
|
|||||||
display = self._define_display(controller)
|
display = self._define_display(controller)
|
||||||
if not self.currentMediaPlayer[controller.controllerType].play(display):
|
if not self.currentMediaPlayer[controller.controllerType].play(display):
|
||||||
return False
|
return False
|
||||||
|
if controller.media_info.is_background:
|
||||||
|
self.media_volume(controller, 0)
|
||||||
|
else:
|
||||||
|
self.media_volume(controller, controller.media_info.volume)
|
||||||
if status:
|
if status:
|
||||||
display.frame.evaluateJavaScript(u'show_blank("desktop");')
|
display.frame.evaluateJavaScript(u'show_blank("desktop");')
|
||||||
self.currentMediaPlayer[controller.controllerType]\
|
self.currentMediaPlayer[controller.controllerType]\
|
||||||
@ -615,7 +612,7 @@ class MediaController(object):
|
|||||||
controller.mediabar.actions[u'playbackStop'].setVisible(False)
|
controller.mediabar.actions[u'playbackStop'].setVisible(False)
|
||||||
controller.mediabar.actions[u'playbackPause'].setVisible(False)
|
controller.mediabar.actions[u'playbackPause'].setVisible(False)
|
||||||
|
|
||||||
def media_volume(self, msg):
|
def media_volume_msg(self, msg):
|
||||||
"""
|
"""
|
||||||
Changes the volume of a running video
|
Changes the volume of a running video
|
||||||
|
|
||||||
@ -624,9 +621,20 @@ class MediaController(object):
|
|||||||
"""
|
"""
|
||||||
controller = msg[0]
|
controller = msg[0]
|
||||||
vol = msg[1][0]
|
vol = msg[1][0]
|
||||||
log.debug(u'media_volume %d' % vol)
|
self.media_volume(controller, vol)
|
||||||
|
|
||||||
|
def media_volume(self, controller, volume):
|
||||||
|
"""
|
||||||
|
Changes the volume of a running video
|
||||||
|
|
||||||
|
``msg``
|
||||||
|
First element is the controller which should be used
|
||||||
|
"""
|
||||||
|
|
||||||
|
log.debug(u'media_volume %d' % volume)
|
||||||
display = self._define_display(controller)
|
display = self._define_display(controller)
|
||||||
self.currentMediaPlayer[controller.controllerType].volume(display, vol)
|
self.currentMediaPlayer[controller.controllerType].volume(display, volume)
|
||||||
|
controller.volumeSlider.setValue(volume)
|
||||||
|
|
||||||
def media_seek(self, msg):
|
def media_seek(self, msg):
|
||||||
"""
|
"""
|
||||||
|
@ -193,6 +193,7 @@ class VlcPlayer(MediaPlayer):
|
|||||||
display.vlcMediaPlayer.play()
|
display.vlcMediaPlayer.play()
|
||||||
if not self.media_state_wait(display, vlc.State.Playing):
|
if not self.media_state_wait(display, vlc.State.Playing):
|
||||||
return False
|
return False
|
||||||
|
self.volume(display, controller.media_info.volume)
|
||||||
if start_time > 0:
|
if start_time > 0:
|
||||||
self.seek(display, controller.media_info.start_time * 1000)
|
self.seek(display, controller.media_info.start_time * 1000)
|
||||||
controller.media_info.length = \
|
controller.media_info.length = \
|
||||||
|
@ -152,7 +152,7 @@ class MediaMediaItem(MediaManagerItem):
|
|||||||
filename = unicode(item.data(QtCore.Qt.UserRole).toString())
|
filename = unicode(item.data(QtCore.Qt.UserRole).toString())
|
||||||
if os.path.exists(filename):
|
if os.path.exists(filename):
|
||||||
service_item = ServiceItem()
|
service_item = ServiceItem()
|
||||||
service_item.title = u'Automatic'
|
service_item.title = u'webkit'
|
||||||
service_item.shortname = service_item.title
|
service_item.shortname = service_item.title
|
||||||
(path, name) = os.path.split(filename)
|
(path, name) = os.path.split(filename)
|
||||||
service_item.add_from_command(path, name,CLAPPERBOARD)
|
service_item.add_from_command(path, name,CLAPPERBOARD)
|
||||||
|
Loading…
Reference in New Issue
Block a user