forked from openlp/openlp
bugfixing
This commit is contained in:
parent
2c62a819b3
commit
9dfb50951f
@ -67,15 +67,6 @@ body {
|
||||
z-index:2;
|
||||
}
|
||||
%s
|
||||
#video1 {
|
||||
z-index:3;
|
||||
}
|
||||
#video2 {
|
||||
z-index:3;
|
||||
}
|
||||
#flash {
|
||||
z-index:4;
|
||||
}
|
||||
#alert {
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
@ -288,9 +279,9 @@ def build_html(item, screen, alert, islive, background, plugins=None, image=None
|
||||
plugin_html = u''
|
||||
if plugins:
|
||||
for plugin in plugins:
|
||||
plugin_css += plugin.display_css()
|
||||
plugin_js += plugin.display_javascript()
|
||||
plugin_html += plugin.display_html()
|
||||
plugin_css += plugin.getDisplayCss()
|
||||
plugin_js += plugin.getDisplayJavascript()
|
||||
plugin_html += plugin.getDisplayHtml()
|
||||
html = HTMLSRC % (build_background_css(item, width, height),
|
||||
width, height,
|
||||
plugin_css,
|
||||
|
@ -375,20 +375,20 @@ class Plugin(QtCore.QObject):
|
||||
"""
|
||||
self.textStrings[name] = {u'title': title, u'tooltip': tooltip}
|
||||
|
||||
def display_css(self):
|
||||
def getDisplayCss(self):
|
||||
"""
|
||||
Add css style sheets to htmlbuilder
|
||||
"""
|
||||
return u''
|
||||
|
||||
def display_javascript(self):
|
||||
def getDisplayJavascript(self):
|
||||
"""
|
||||
Add javascript functions to htmlbuilder
|
||||
"""
|
||||
return u''
|
||||
|
||||
def display_html(self):
|
||||
def getDisplayHtml(self):
|
||||
"""
|
||||
Add html code to htmlbuilder
|
||||
"""
|
||||
return u''
|
||||
return u''
|
@ -56,8 +56,6 @@ class Display(QtGui.QGraphicsView):
|
||||
"""
|
||||
Set up and build the preview screen
|
||||
"""
|
||||
# self.setGeometry(0, 0,
|
||||
# self.parent().width(), self.parent().height())
|
||||
self.webView = QtWebKit.QWebView(self)
|
||||
self.webView.setGeometry(0, 0,
|
||||
self.parent().width(), self.parent().height())
|
||||
@ -71,7 +69,6 @@ class Display(QtGui.QGraphicsView):
|
||||
self.webView.setHtml(build_html(serviceItem, screen,
|
||||
None, None, None, self.controller.parent().pluginManager.plugins))
|
||||
self.webView.hide()
|
||||
#self.hide()
|
||||
|
||||
class MainDisplay(QtGui.QGraphicsView):
|
||||
"""
|
||||
@ -88,7 +85,7 @@ class MainDisplay(QtGui.QGraphicsView):
|
||||
self.videoHide = False
|
||||
self.override = {}
|
||||
self.retranslateUi()
|
||||
#self.mediaObject = None
|
||||
self.mediaObject = None
|
||||
self.firstTime = True
|
||||
self.setStyleSheet(u'border: 0px; margin: 0px; padding: 0px;')
|
||||
self.setWindowFlags(QtCore.Qt.FramelessWindowHint | QtCore.Qt.Tool |
|
||||
@ -118,7 +115,8 @@ class MainDisplay(QtGui.QGraphicsView):
|
||||
self.webView = QtWebKit.QWebView(self)
|
||||
self.webView.setGeometry(0, 0,
|
||||
self.screen[u'size'].width(), self.screen[u'size'].height())
|
||||
self.webView.settings().setAttribute(QtWebKit.QWebSettings.PluginsEnabled, True)
|
||||
self.webView.settings().setAttribute( \
|
||||
QtWebKit.QWebSettings.PluginsEnabled, True)
|
||||
self.page = self.webView.page()
|
||||
self.frame = self.page.mainFrame()
|
||||
QtCore.QObject.connect(self.webView,
|
||||
@ -356,7 +354,8 @@ class MainDisplay(QtGui.QGraphicsView):
|
||||
else:
|
||||
image_bytes = None
|
||||
html = build_html(self.serviceItem, self.screen, self.alertTab,
|
||||
self.isLive, background, self.controller.parent().pluginManager.plugins, image_bytes)
|
||||
self.isLive, background,
|
||||
self.controller.parent().pluginManager.plugins, image_bytes)
|
||||
log.debug(u'buildHtml - pre setHtml')
|
||||
self.webView.setHtml(html)
|
||||
log.debug(u'buildHtml - post setHtml')
|
||||
|
@ -396,7 +396,7 @@ class SlideController(QtGui.QWidget):
|
||||
# rebuild display as screen size changed
|
||||
if self.display:
|
||||
self.display.close()
|
||||
self.display = MainDisplay(self, self, self.image_manager, self.isLive)
|
||||
self.display = MainDisplay(self, self, self.imageManager, self.isLive)
|
||||
self.display.alertTab = self.alertTab
|
||||
self.display.setup()
|
||||
if self.isLive:
|
||||
@ -488,7 +488,6 @@ class SlideController(QtGui.QWidget):
|
||||
len(item.get_frames()) > 1:
|
||||
self.toolbar.makeWidgetsVisible(self.loopList)
|
||||
if item.is_media():
|
||||
#self.toolbar.setVisible(False)
|
||||
self.mediabar.setVisible(True)
|
||||
|
||||
def enablePreviewToolBar(self, item):
|
||||
|
@ -25,14 +25,6 @@
|
||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||
###############################################################################
|
||||
|
||||
class MediaAPI(object):
|
||||
"""
|
||||
An enumeration for possible APIs.
|
||||
"""
|
||||
Webkit = 0
|
||||
Phonon = 1
|
||||
Vlc = 2
|
||||
|
||||
class MediaState(object):
|
||||
"""
|
||||
An enumeration for possible States of the Media Player
|
||||
@ -65,136 +57,9 @@ class MediaInfo(object):
|
||||
end_time = 0
|
||||
media_type = MediaType()
|
||||
|
||||
|
||||
class MediaAPI(object):
|
||||
"""
|
||||
Specialiced Media API class
|
||||
to reflect Features of the related API
|
||||
"""
|
||||
def __init__(self, parent, name=u'MediaApi'):
|
||||
self.parent = parent
|
||||
self.name = name
|
||||
self.available = self.check_available()
|
||||
self.isActive = False
|
||||
self.canBackground = False
|
||||
self.state = MediaState.Off
|
||||
self.hasOwnWidget = False
|
||||
self.audio_extensions_list = []
|
||||
self.video_extensions_list = []
|
||||
|
||||
def check_available(self):
|
||||
"""
|
||||
API is available on this machine
|
||||
"""
|
||||
return False
|
||||
|
||||
|
||||
def setup(self, display):
|
||||
"""
|
||||
Create the related widgets for the current display
|
||||
"""
|
||||
pass
|
||||
|
||||
def load(self, display):
|
||||
"""
|
||||
Load a new media file and check if it is valid
|
||||
"""
|
||||
return True
|
||||
|
||||
def resize(self, display):
|
||||
"""
|
||||
If the main display size or position is changed,
|
||||
the media widgets should also resized
|
||||
"""
|
||||
pass
|
||||
|
||||
def play(self, display):
|
||||
"""
|
||||
Starts playing of current Media File
|
||||
"""
|
||||
pass
|
||||
|
||||
def pause(self, display):
|
||||
"""
|
||||
Pause of current Media File
|
||||
"""
|
||||
pass
|
||||
|
||||
def stop(self, display):
|
||||
"""
|
||||
Stop playing of current Media File
|
||||
"""
|
||||
pass
|
||||
|
||||
def volume(self, display, vol):
|
||||
"""
|
||||
Change volume of current Media File
|
||||
"""
|
||||
pass
|
||||
|
||||
def seek(self, display, seekVal):
|
||||
"""
|
||||
Change playing position of current Media File
|
||||
"""
|
||||
pass
|
||||
|
||||
def reset(self, display):
|
||||
"""
|
||||
Remove the current loaded video
|
||||
"""
|
||||
pass
|
||||
|
||||
def set_visible(self, display, status):
|
||||
"""
|
||||
Show/Hide the media widgets
|
||||
"""
|
||||
pass
|
||||
|
||||
def update_ui(self, display):
|
||||
"""
|
||||
Do some ui related stuff
|
||||
(e.g. update the seek slider)
|
||||
"""
|
||||
pass
|
||||
|
||||
@staticmethod
|
||||
def is_available():
|
||||
"""
|
||||
Check availability of the related API
|
||||
"""
|
||||
return False
|
||||
|
||||
def get_supported_file_types(self):
|
||||
"""
|
||||
Returns the supported file types for
|
||||
Audio
|
||||
Video
|
||||
Locations
|
||||
"""
|
||||
pass
|
||||
|
||||
def display_css(self):
|
||||
"""
|
||||
Add css style sheets to htmlbuilder
|
||||
"""
|
||||
return u''
|
||||
|
||||
|
||||
def display_javascript(self):
|
||||
"""
|
||||
Add javascript functions to htmlbuilder
|
||||
"""
|
||||
return u''
|
||||
|
||||
|
||||
def display_html(self):
|
||||
"""
|
||||
Add html code to htmlbuilder
|
||||
"""
|
||||
return u''
|
||||
|
||||
from mediaitem import MediaMediaItem
|
||||
from mediatab import MediaTab
|
||||
from mediaapi import MediaAPI
|
||||
from mediamanager import MediaManager
|
||||
|
||||
__all__ = ['MediaMediaItem']
|
||||
|
139
openlp/plugins/media/lib/mediaapi.py
Normal file
139
openlp/plugins/media/lib/mediaapi.py
Normal file
@ -0,0 +1,139 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
||||
|
||||
###############################################################################
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Michael Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, #
|
||||
# Armin Köhler, Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias #
|
||||
# Põldaru, Christian Richter, Philip Ridout, Simon Scudder, Jeffrey Smith, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, Frode Woldsund #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# This program is free software; you can redistribute it and/or modify it #
|
||||
# under the terms of the GNU General Public License as published by the Free #
|
||||
# Software Foundation; version 2 of the License. #
|
||||
# #
|
||||
# This program is distributed in the hope that it will be useful, but WITHOUT #
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
|
||||
# more details. #
|
||||
# #
|
||||
# You should have received a copy of the GNU General Public License along #
|
||||
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
|
||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||
###############################################################################
|
||||
|
||||
from openlp.plugins.media.lib import MediaState
|
||||
|
||||
class MediaAPI(object):
|
||||
"""
|
||||
Specialiced Media API class
|
||||
to reflect Features of the related API
|
||||
"""
|
||||
def __init__(self, parent, name=u'MediaApi'):
|
||||
self.parent = parent
|
||||
self.name = name
|
||||
self.available = self.check_available()
|
||||
self.isActive = False
|
||||
self.canBackground = False
|
||||
self.state = MediaState.Off
|
||||
self.hasOwnWidget = False
|
||||
self.audio_extensions_list = []
|
||||
self.video_extensions_list = []
|
||||
|
||||
def check_available(self):
|
||||
"""
|
||||
API is available on this machine
|
||||
"""
|
||||
return False
|
||||
|
||||
|
||||
def setup(self, display):
|
||||
"""
|
||||
Create the related widgets for the current display
|
||||
"""
|
||||
pass
|
||||
|
||||
def load(self, display):
|
||||
"""
|
||||
Load a new media file and check if it is valid
|
||||
"""
|
||||
return True
|
||||
|
||||
def resize(self, display):
|
||||
"""
|
||||
If the main display size or position is changed,
|
||||
the media widgets should also resized
|
||||
"""
|
||||
pass
|
||||
|
||||
def play(self, display):
|
||||
"""
|
||||
Starts playing of current Media File
|
||||
"""
|
||||
pass
|
||||
|
||||
def pause(self, display):
|
||||
"""
|
||||
Pause of current Media File
|
||||
"""
|
||||
pass
|
||||
|
||||
def stop(self, display):
|
||||
"""
|
||||
Stop playing of current Media File
|
||||
"""
|
||||
pass
|
||||
|
||||
def volume(self, display, vol):
|
||||
"""
|
||||
Change volume of current Media File
|
||||
"""
|
||||
pass
|
||||
|
||||
def seek(self, display, seekVal):
|
||||
"""
|
||||
Change playing position of current Media File
|
||||
"""
|
||||
pass
|
||||
|
||||
def reset(self, display):
|
||||
"""
|
||||
Remove the current loaded video
|
||||
"""
|
||||
pass
|
||||
|
||||
def set_visible(self, display, status):
|
||||
"""
|
||||
Show/Hide the media widgets
|
||||
"""
|
||||
pass
|
||||
|
||||
def update_ui(self, display):
|
||||
"""
|
||||
Do some ui related stuff
|
||||
(e.g. update the seek slider)
|
||||
"""
|
||||
pass
|
||||
|
||||
def getDisplayCss(self):
|
||||
"""
|
||||
Add css style sheets to htmlbuilder
|
||||
"""
|
||||
return u''
|
||||
|
||||
|
||||
def getDisplayJavascript(self):
|
||||
"""
|
||||
Add javascript functions to htmlbuilder
|
||||
"""
|
||||
return u''
|
||||
|
||||
|
||||
def getDisplayHtml(self):
|
||||
"""
|
||||
Add html code to htmlbuilder
|
||||
"""
|
||||
return u''
|
@ -139,6 +139,7 @@ class MediaMediaItem(MediaManagerItem):
|
||||
ItemCapabilities.AllowsVariableStartTime)
|
||||
service_item.title = unicode(self.plugin.nameStrings[u'singular'])
|
||||
service_item.add_capability(ItemCapabilities.RequiresMedia)
|
||||
# TODO
|
||||
#Receiver.send_message(u'media_video', [self.plugin.liveController, filename, False])
|
||||
# force a non-existent theme
|
||||
service_item.theme = -1
|
||||
|
@ -1,4 +1,3 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
||||
|
||||
@ -6,9 +5,10 @@
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Michael Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, #
|
||||
# Armin Köhler, Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias #
|
||||
# Põldaru, Christian Richter, Philip Ridout, Simon Scudder, Jeffrey Smith, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, Frode Woldsund #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# This program is free software; you can redistribute it and/or modify it #
|
||||
@ -33,9 +33,6 @@ from PyQt4 import QtCore, QtGui, QtWebKit
|
||||
from openlp.core.lib import OpenLPToolbar, Receiver, translate
|
||||
from openlp.core.lib.ui import UiStrings, critical_error_message_box
|
||||
from openlp.plugins.media.lib import MediaAPI, MediaState, MediaInfo
|
||||
from webkitapi import WebkitAPI
|
||||
from phononapi import PhononAPI
|
||||
from vlcapi import VlcAPI
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@ -110,31 +107,31 @@ class MediaManager(object):
|
||||
if not isAnyonePlaying:
|
||||
self.Timer.stop()
|
||||
|
||||
def display_css(self):
|
||||
def getDisplayCss(self):
|
||||
"""
|
||||
Add css style sheets to htmlbuilder
|
||||
"""
|
||||
css = u'';
|
||||
for api in self.APIs.values():
|
||||
css+= api.display_css()
|
||||
css += api.getDisplayCss()
|
||||
return css
|
||||
|
||||
def display_javascript(self):
|
||||
def getDisplayJavascript(self):
|
||||
"""
|
||||
Add javascript functions to htmlbuilder
|
||||
"""
|
||||
js = u''
|
||||
for api in self.APIs.values():
|
||||
js+= api.display_javascript()
|
||||
js += api.getDisplayJavascript()
|
||||
return js
|
||||
|
||||
def display_html(self):
|
||||
def getDisplayHtml(self):
|
||||
"""
|
||||
Add html code to htmlbuilder
|
||||
"""
|
||||
html = u''
|
||||
for api in self.APIs.values():
|
||||
html+= api.display_html()
|
||||
html += api.getDisplayHtml()
|
||||
return html
|
||||
|
||||
def addControllerItems(self, controller, control_panel):
|
||||
@ -194,6 +191,7 @@ class MediaManager(object):
|
||||
return
|
||||
if display == self.parent.previewController.previewDisplay or \
|
||||
display == self.parent.liveController.previewDisplay:
|
||||
display.resize(display.controller.slidePreview.size())
|
||||
display.hasAudio = False
|
||||
for api in self.APIs.values():
|
||||
api.setup(display)
|
||||
@ -202,6 +200,7 @@ class MediaManager(object):
|
||||
# Generic controls
|
||||
controller.mediabar.setVisible(value)
|
||||
# Special controls
|
||||
# TODO
|
||||
# for api in self.APIs.values():
|
||||
# api.setup_controls(controller, control_panel)
|
||||
|
||||
@ -250,6 +249,8 @@ class MediaManager(object):
|
||||
self.video_seek([controller, [0]])
|
||||
self.video_play([controller])
|
||||
self.set_controls_visible(controller, True)
|
||||
log.debug(u'use %s controller' % self.curDisplayMediaAPI[display])
|
||||
print u'use %s controller' % self.curDisplayMediaAPI[display].name
|
||||
|
||||
def check_file_type(self, controller, display):
|
||||
"""
|
||||
|
@ -78,7 +78,8 @@ class MediaTab(SettingsTab):
|
||||
self.apiOrderLayout.addWidget(self.apiOrderlistWidget)
|
||||
self.orderingButtonsWidget = QtGui.QWidget(self.apiOrderGroupBox)
|
||||
self.orderingButtonsWidget.setObjectName(u'orderingButtonsWidget')
|
||||
self.orderingButtonLayout = QtGui.QHBoxLayout(self.orderingButtonsWidget)
|
||||
self.orderingButtonLayout = QtGui.QHBoxLayout( \
|
||||
self.orderingButtonsWidget)
|
||||
self.orderingButtonLayout.setObjectName(u'orderingButtonLayout')
|
||||
self.orderingDownButton = QtGui.QPushButton(self.orderingButtonsWidget)
|
||||
self.orderingDownButton.setObjectName(u'orderingDownButton')
|
||||
@ -96,7 +97,6 @@ class MediaTab(SettingsTab):
|
||||
QtCore.QObject.connect(checkbox,
|
||||
QtCore.SIGNAL(u'stateChanged(int)'),
|
||||
self.onApiCheckBoxChanged)
|
||||
|
||||
QtCore.QObject.connect(self.orderingUpButton,
|
||||
QtCore.SIGNAL(u'pressed()'), self.onOrderingUpButtonPressed)
|
||||
QtCore.QObject.connect(self.orderingDownButton,
|
||||
@ -133,23 +133,24 @@ class MediaTab(SettingsTab):
|
||||
def updateApiList(self):
|
||||
self.apiOrderlistWidget.clear()
|
||||
for api in self.usedAPIs:
|
||||
self.apiOrderlistWidget.addItem(api)
|
||||
if api in self.ApiCheckBoxes.keys():
|
||||
self.apiOrderlistWidget.addItem(api)
|
||||
|
||||
def onOrderingUpButtonPressed(self):
|
||||
currentRow = self.apiOrderlistWidget.currentRow()
|
||||
if currentRow > 0:
|
||||
item = self.apiOrderlistWidget.takeItem(currentRow)
|
||||
self.apiOrderlistWidget.insertItem(currentRow-1, item)
|
||||
self.apiOrderlistWidget.setCurrentRow(currentRow-1)
|
||||
self.usedAPIs.move(currentRow, currentRow-1)
|
||||
self.apiOrderlistWidget.insertItem(currentRow - 1, item)
|
||||
self.apiOrderlistWidget.setCurrentRow(currentRow - 1)
|
||||
self.usedAPIs.move(currentRow, currentRow - 1)
|
||||
|
||||
def onOrderingDownButtonPressed(self):
|
||||
currentRow = self.apiOrderlistWidget.currentRow()
|
||||
if currentRow < self.apiOrderlistWidget.count()-1:
|
||||
if currentRow < self.apiOrderlistWidget.count() - 1:
|
||||
item = self.apiOrderlistWidget.takeItem(currentRow)
|
||||
self.apiOrderlistWidget.insertItem(currentRow+1, item)
|
||||
self.apiOrderlistWidget.setCurrentRow(currentRow+1)
|
||||
self.usedAPIs.move(currentRow, currentRow+1)
|
||||
self.apiOrderlistWidget.insertItem(currentRow + 1, item)
|
||||
self.apiOrderlistWidget.setCurrentRow(currentRow + 1)
|
||||
self.usedAPIs.move(currentRow, currentRow + 1)
|
||||
|
||||
def load(self):
|
||||
self.usedAPIs = QtCore.QSettings().value(
|
||||
|
@ -1,4 +1,3 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
||||
|
||||
@ -6,9 +5,10 @@
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Michael Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, #
|
||||
# Armin Köhler, Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias #
|
||||
# Põldaru, Christian Richter, Philip Ridout, Simon Scudder, Jeffrey Smith, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, Frode Woldsund #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# This program is free software; you can redistribute it and/or modify it #
|
||||
@ -135,10 +135,7 @@ class PhononAPI(MediaAPI):
|
||||
display.mediaObject.setCurrentSource(Phonon.MediaSource(path))
|
||||
if not self.mediaStateWait(display, Phonon.StoppedState):
|
||||
return False
|
||||
vol = float(volume) / float(10)
|
||||
display.audio.setVolume(vol)
|
||||
#self.info.start_time = 10000
|
||||
#self.info.end_time = 20000
|
||||
self.volume(display, volume)
|
||||
return True
|
||||
|
||||
def mediaStateWait(self, display, mediaState):
|
||||
@ -177,8 +174,9 @@ class PhononAPI(MediaAPI):
|
||||
|
||||
def volume(self, display, vol):
|
||||
# 1.0 is the highest value
|
||||
vol = float(vol) / float(100)
|
||||
display.audio.setVolume(vol)
|
||||
if display.hasAudio:
|
||||
vol = float(vol) / float(100)
|
||||
display.audio.setVolume(vol)
|
||||
|
||||
def seek(self, display, seekVal):
|
||||
display.mediaObject.seek(seekVal)
|
||||
@ -190,7 +188,6 @@ class PhononAPI(MediaAPI):
|
||||
self.state = MediaState.Off
|
||||
|
||||
def set_visible(self, display, status):
|
||||
print display, status
|
||||
if self.hasOwnWidget:
|
||||
display.phononWidget.setVisible(status)
|
||||
|
||||
@ -210,6 +207,3 @@ class PhononAPI(MediaAPI):
|
||||
if not controller.seekSlider.isSliderDown():
|
||||
controller.seekSlider.setSliderPosition( \
|
||||
display.mediaObject.currentTime())
|
||||
|
||||
def get_supported_file_types(self):
|
||||
pass
|
||||
|
@ -1,4 +1,3 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
||||
|
||||
@ -6,9 +5,10 @@
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Michael Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, #
|
||||
# Armin Köhler, Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias #
|
||||
# Põldaru, Christian Richter, Philip Ridout, Simon Scudder, Jeffrey Smith, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, Frode Woldsund #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# This program is free software; you can redistribute it and/or modify it #
|
||||
@ -104,23 +104,6 @@ class VlcAPI(MediaAPI):
|
||||
def check_available(self):
|
||||
return vlc_available
|
||||
|
||||
def get_supported_file_types(self):
|
||||
self.supported_file_types = ['avi']
|
||||
self.additional_extensions = {
|
||||
u'audio/ac3': [u'.ac3'],
|
||||
u'audio/flac': [u'.flac'],
|
||||
u'audio/x-m4a': [u'.m4a'],
|
||||
u'audio/midi': [u'.mid', u'.midi'],
|
||||
u'audio/x-mp3': [u'.mp3'],
|
||||
u'audio/mpeg': [u'.mp3', u'.mp2', u'.mpga', u'.mpega', u'.m4a'],
|
||||
u'audio/qcelp': [u'.qcp'],
|
||||
u'audio/x-wma': [u'.wma'],
|
||||
u'audio/x-ms-wma': [u'.wma'],
|
||||
u'video/x-flv': [u'.flv'],
|
||||
u'video/x-matroska': [u'.mpv', u'.mkv'],
|
||||
u'video/x-wmv': [u'.wmv'],
|
||||
u'video/x-ms-wmv': [u'.wmv']}
|
||||
|
||||
def load(self, display):
|
||||
log.debug(u'load vid in Vlc Controller')
|
||||
controller = display.controller
|
||||
@ -134,6 +117,7 @@ class VlcAPI(MediaAPI):
|
||||
display.vlcMediaPlayer.set_media(display.vlcMedia)
|
||||
# parse the metadata of the file
|
||||
display.vlcMedia.parse()
|
||||
self.volume(display, volume)
|
||||
return True
|
||||
|
||||
def mediaStateWait(self, display, mediaState):
|
||||
@ -169,7 +153,8 @@ class VlcAPI(MediaAPI):
|
||||
self.state = MediaState.Stopped
|
||||
|
||||
def volume(self, display, vol):
|
||||
display.vlcMediaPlayer.audio_set_volume(vol)
|
||||
if display.hasAudio:
|
||||
display.vlcMediaPlayer.audio_set_volume(vol)
|
||||
|
||||
def seek(self, display, seekVal):
|
||||
if display.vlcMediaPlayer.is_seekable():
|
||||
@ -190,6 +175,3 @@ class VlcAPI(MediaAPI):
|
||||
if not controller.seekSlider.isSliderDown():
|
||||
currentPos = display.vlcMediaPlayer.get_position() * 1000
|
||||
controller.seekSlider.setSliderPosition(currentPos)
|
||||
|
||||
def get_supported_file_types(self):
|
||||
pass
|
||||
|
@ -1,4 +1,3 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
||||
|
||||
@ -6,9 +5,10 @@
|
||||
# OpenLP - Open Source Lyrics Projection #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# Copyright (c) 2008-2011 Raoul Snyman #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Jonathan Corwin, Michael #
|
||||
# Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, Armin Köhler, #
|
||||
# Andreas Preikschat, Mattias Põldaru, Christian Richter, Philip Ridout, #
|
||||
# Portions copyright (c) 2008-2011 Tim Bentley, Gerald Britton, Jonathan #
|
||||
# Corwin, Michael Gorven, Scott Guerrieri, Matthias Hub, Meinert Jordan, #
|
||||
# Armin Köhler, Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias #
|
||||
# Põldaru, Christian Richter, Philip Ridout, Simon Scudder, Jeffrey Smith, #
|
||||
# Maikel Stuivenberg, Martin Thompson, Jon Tibble, Frode Woldsund #
|
||||
# --------------------------------------------------------------------------- #
|
||||
# This program is free software; you can redistribute it and/or modify it #
|
||||
@ -73,16 +73,25 @@ class WebkitAPI(MediaAPI):
|
||||
# no special controls
|
||||
pass
|
||||
|
||||
def display_css(self):
|
||||
def getDisplayCss(self):
|
||||
"""
|
||||
Add css style sheets to htmlbuilder
|
||||
"""
|
||||
css = u'''
|
||||
#video1 {
|
||||
z-index:3;
|
||||
}
|
||||
#video2 {
|
||||
z-index:3;
|
||||
}
|
||||
#flash {
|
||||
z-index:4;
|
||||
}
|
||||
'''
|
||||
return css
|
||||
|
||||
|
||||
def display_javascript(self):
|
||||
def getDisplayJavascript(self):
|
||||
"""
|
||||
Add javascript functions to htmlbuilder
|
||||
"""
|
||||
@ -241,7 +250,7 @@ class WebkitAPI(MediaAPI):
|
||||
return js
|
||||
|
||||
|
||||
def display_html(self):
|
||||
def getDisplayHtml(self):
|
||||
"""
|
||||
Add html code to htmlbuilder
|
||||
"""
|
||||
@ -263,9 +272,6 @@ class WebkitAPI(MediaAPI):
|
||||
def check_available(self):
|
||||
return True
|
||||
|
||||
def get_supported_file_types(self):
|
||||
pass
|
||||
|
||||
def load(self, display):
|
||||
log.debug(u'load vid in Webkit Controller')
|
||||
controller = display.controller
|
||||
@ -289,14 +295,10 @@ class WebkitAPI(MediaAPI):
|
||||
|
||||
def resize(self, display):
|
||||
controller = display.controller
|
||||
# if display == controller.previewDisplay:
|
||||
# display.webView.resize(display.size())
|
||||
display.webView.resize(display.size())
|
||||
|
||||
def play(self, display):
|
||||
controller = display.controller
|
||||
#display.override[u'theme'] = u''
|
||||
#display.override[u'video'] = True
|
||||
display.webLoaded = True
|
||||
self.set_visible(display, True)
|
||||
if controller.media_info.isFlash:
|
||||
@ -324,10 +326,11 @@ class WebkitAPI(MediaAPI):
|
||||
def volume(self, display, vol):
|
||||
controller = display.controller
|
||||
# 1.0 is the highest value
|
||||
vol = float(vol) / float(100)
|
||||
if not controller.media_info.isFlash:
|
||||
display.frame.evaluateJavaScript(u'show_video(null, null, %s);' %
|
||||
str(vol))
|
||||
if display.hasVolume:
|
||||
vol = float(vol) / float(100)
|
||||
if not controller.media_info.isFlash:
|
||||
display.frame.evaluateJavaScript(
|
||||
u'show_video(null, null, %s);' % str(vol))
|
||||
|
||||
def seek(self, display, seekVal):
|
||||
controller = display.controller
|
||||
@ -374,6 +377,3 @@ class WebkitAPI(MediaAPI):
|
||||
controller.seekSlider.setMaximum(length)
|
||||
if not controller.seekSlider.isSliderDown():
|
||||
controller.seekSlider.setSliderPosition(currentTime)
|
||||
|
||||
def get_supported_file_types(self):
|
||||
pass
|
||||
|
@ -110,7 +110,6 @@ class MediaPlugin(Plugin):
|
||||
store for later use
|
||||
"""
|
||||
self.mediaManager.APIs[controller.name] = controller
|
||||
#self.controllers[controller.name] = controller
|
||||
|
||||
def checkPreConditions(self):
|
||||
"""
|
||||
@ -143,20 +142,20 @@ class MediaPlugin(Plugin):
|
||||
else:
|
||||
return False
|
||||
|
||||
def display_css(self):
|
||||
def getDisplayCss(self):
|
||||
"""
|
||||
Add css style sheets to htmlbuilder
|
||||
"""
|
||||
return self.mediaManager.display_css()
|
||||
return self.mediaManager.getDisplayCss()
|
||||
|
||||
def display_javascript(self):
|
||||
def getDisplayJavascript(self):
|
||||
"""
|
||||
Add javascript functions to htmlbuilder
|
||||
"""
|
||||
return self.mediaManager.display_javascript()
|
||||
return self.mediaManager.getDisplayJavascript()
|
||||
|
||||
def display_html(self):
|
||||
def getDisplayHtml(self):
|
||||
"""
|
||||
Add html code to htmlbuilder
|
||||
"""
|
||||
return self.mediaManager.display_html()
|
||||
return self.mediaManager.getDisplayHtml()
|
Loading…
Reference in New Issue
Block a user