Started adding stuff for slide controller

bzr-revno: 302
This commit is contained in:
Martin Thompson 2009-02-10 20:47:16 +00:00
parent 74da30fbf0
commit f758850865
7 changed files with 133 additions and 49 deletions

View File

@ -0,0 +1,47 @@
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
"""
OpenLP - Open Source Lyrics Projection
Copyright (c) 2008 Raoul Snyman
Portions copyright (c) 2008 Martin Thompson, Tim Bentley
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
"""
class ImageServiceItem():
"""
The service item is a base class for the plugins to use to interact with
the service manager, the slide controller, and the renderer.
"""
def __init__(self):
"""
Init Method
"""
pass
def render(self):
"""
The render method is what the plugin uses to render its meda to the
screen.
"""
pass
def get_parent_node(self):
"""
This method returns a parent node to be inserted into the Service
Manager.
"""
pass

View File

@ -26,6 +26,7 @@ from event import Event
from xmlrootclass import XmlRootClass from xmlrootclass import XmlRootClass
from serviceitem import ServiceItem from serviceitem import ServiceItem
from eventreceiver import Receiver from eventreceiver import Receiver
from imageserviceitem import ImageServiceItem
__all__ = ['PluginConfig', 'Plugin', 'PluginUtils', 'SettingsTab', 'MediaManagerItem', 'Event', __all__ = ['PluginConfig', 'Plugin', 'PluginUtils', 'SettingsTab', 'MediaManagerItem', 'Event',
'XmlRootClass', 'ServiceItem', "Receiver"] 'XmlRootClass', 'ServiceItem', 'Receiver', 'ImageServiceItem']

View File

@ -21,9 +21,16 @@ Place, Suite 330, Boston, MA 02111-1307 USA
class ServiceItem(): class ServiceItem():
""" """
The service item is a base class for the plugins to use to interact with The service item is a base class for the plugins to use to interact with
the service manager, the slide controller, and the renderer. the service manager, the slide controller, and the projection screen
compositor.
""" """
def __init__(self):
"""
Init Method
"""
pass
def render(self): def render(self):
""" """
The render method is what the plugin uses to render it's meda to the The render method is what the plugin uses to render it's meda to the
@ -37,3 +44,22 @@ class ServiceItem():
Manager. Manager.
""" """
pass pass
def get_oos_repr(self):
"""
This method returns some text which can be saved into the OOS
file to represent this item
"""
pass
def set_from_oos(self, oostext):
"""
This method takes some oostext (passed from the ServiceManager)
and parses it into the data actually required
"""
pass
def set_from_plugin(self, data):
"""
Takes data from the plugin media chooser
"""

View File

@ -18,11 +18,11 @@ this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place, Suite 330, Boston, MA 02111-1307 USA Place, Suite 330, Boston, MA 02111-1307 USA
""" """
from slidecontroller import SlideController
from splashscreen import SplashScreen from splashscreen import SplashScreen
from about import AboutForm from about import AboutForm
from alertform import AlertForm from alertform import AlertForm
from settings import SettingsDialog from settings import SettingsDialog
from mainwindow import MainWindow from mainwindow import MainWindow
__all__ = ['SplashScreen', 'AboutForm', 'AlertForm', 'SettingsDialog', 'MainWindow', 'SlideController']
__all__ = ['SplashScreen', 'AboutForm', 'AlertForm', 'SettingsDialog', 'MainWindow']

View File

@ -24,8 +24,9 @@ from PyQt4 import *
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.resources import * from openlp.core.resources import *
from openlp.core.ui import AboutForm, AlertForm, SettingsDialog from openlp.core.ui import AboutForm, AlertForm, SettingsDialog, SlideController
from openlp.core.lib import Plugin, MediaManagerItem, SettingsTab, Receiver from openlp.core.lib import Plugin, MediaManagerItem, SettingsTab, Receiver
from openlp.core import PluginManager from openlp.core import PluginManager
class MainWindow(object): class MainWindow(object):
@ -70,47 +71,8 @@ class MainWindow(object):
self.ControlSplitter = QtGui.QSplitter(self.MainContent) self.ControlSplitter = QtGui.QSplitter(self.MainContent)
self.ControlSplitter.setOrientation(QtCore.Qt.Horizontal) self.ControlSplitter.setOrientation(QtCore.Qt.Horizontal)
self.ControlSplitter.setObjectName("ControlSplitter") self.ControlSplitter.setObjectName("ControlSplitter")
self.PreviewPane = QtGui.QWidget(self.ControlSplitter) self.PreviewController = SlideController(self.ControlSplitter)
self.PreviewPane.setObjectName("PreviewPane") self.LiveController = SlideController(self.ControlSplitter)
self.PreviewPaneLayout = QtGui.QVBoxLayout(self.PreviewPane)
self.PreviewPaneLayout.setSpacing(0)
self.PreviewPaneLayout.setMargin(0)
self.PreviewPaneLayout.setObjectName("PreviewPaneLayout")
self.PreviewSplitter = QtGui.QSplitter(self.PreviewPane)
self.PreviewSplitter.setOrientation(QtCore.Qt.Vertical)
self.PreviewSplitter.setObjectName("PreviewSplitter")
self.PreviewController = QtGui.QScrollArea(self.PreviewSplitter)
self.PreviewController.setWidgetResizable(True)
self.PreviewController.setObjectName("PreviewController")
self.PreviewControllerContents = QtGui.QWidget(self.PreviewController)
self.PreviewControllerContents.setGeometry(QtCore.QRect(0, 0, 228, 536))
self.PreviewControllerContents.setObjectName("PreviewControllerContents")
self.PreviewController.setWidget(self.PreviewControllerContents)
self.PreviewScreen = QtGui.QGraphicsView(self.PreviewSplitter)
self.PreviewScreen.setMaximumSize(QtCore.QSize(16777215, 250))
self.PreviewScreen.setObjectName("PreviewScreen")
self.PreviewPaneLayout.addWidget(self.PreviewSplitter)
self.LivePane = QtGui.QWidget(self.ControlSplitter)
self.LivePane.setObjectName("LivePane")
self.LivePaneLayout = QtGui.QVBoxLayout(self.LivePane)
self.LivePaneLayout.setSpacing(0)
self.LivePaneLayout.setMargin(0)
self.LivePaneLayout.setObjectName("LivePaneLayout")
self.LiveSplitter = QtGui.QSplitter(self.LivePane)
self.LiveSplitter.setOrientation(QtCore.Qt.Vertical)
self.LiveSplitter.setObjectName("LiveSplitter")
self.LiveController = QtGui.QScrollArea(self.LiveSplitter)
self.LiveController.setWidgetResizable(True)
self.LiveController.setObjectName("LiveController")
self.LiveControllerContents = QtGui.QWidget(self.LiveController)
self.LiveControllerContents.setGeometry(QtCore.QRect(0, 0, 227, 536))
self.LiveControllerContents.setObjectName("LiveControllerContents")
self.LiveController.setWidget(self.LiveControllerContents)
self.LiveScreen = QtGui.QGraphicsView(self.LiveSplitter)
self.LiveScreen.setMaximumSize(QtCore.QSize(16777215, 250))
self.LiveScreen.setObjectName("LiveScreen")
self.LivePaneLayout.addWidget(self.LiveSplitter)
self.MainContentLayout.addWidget(self.ControlSplitter)
self.main_window.setCentralWidget(self.MainContent) self.main_window.setCentralWidget(self.MainContent)
self.MenuBar = QtGui.QMenuBar(self.main_window) self.MenuBar = QtGui.QMenuBar(self.main_window)
self.MenuBar.setGeometry(QtCore.QRect(0, 0, 1087, 27)) self.MenuBar.setGeometry(QtCore.QRect(0, 0, 1087, 27))
@ -398,7 +360,7 @@ class MainWindow(object):
QtCore.QObject.connect(self.ViewMediaManagerItem, QtCore.SIGNAL("triggered(bool)"), self.MediaManagerDock.setVisible) QtCore.QObject.connect(self.ViewMediaManagerItem, QtCore.SIGNAL("triggered(bool)"), self.MediaManagerDock.setVisible)
QtCore.QObject.connect(self.ViewServiceManagerItem, QtCore.SIGNAL("triggered(bool)"), self.ServiceManagerDock.setVisible) QtCore.QObject.connect(self.ViewServiceManagerItem, QtCore.SIGNAL("triggered(bool)"), self.ServiceManagerDock.setVisible)
QtCore.QObject.connect(self.ViewThemeManagerItem, QtCore.SIGNAL("triggered(bool)"), self.ThemeManagerDock.setVisible) QtCore.QObject.connect(self.ViewThemeManagerItem, QtCore.SIGNAL("triggered(bool)"), self.ThemeManagerDock.setVisible)
QtCore.QObject.connect(self.action_Preview_Pane, QtCore.SIGNAL("toggled(bool)"), self.PreviewPane.setVisible) QtCore.QObject.connect(self.action_Preview_Pane, QtCore.SIGNAL("toggled(bool)"), self.PreviewController.Pane.setVisible)
QtCore.QObject.connect(self.MediaManagerDock, QtCore.SIGNAL("visibilityChanged(bool)"), self.ViewMediaManagerItem.setChecked) QtCore.QObject.connect(self.MediaManagerDock, QtCore.SIGNAL("visibilityChanged(bool)"), self.ViewMediaManagerItem.setChecked)
QtCore.QObject.connect(self.ServiceManagerDock, QtCore.SIGNAL("visibilityChanged(bool)"), self.ViewServiceManagerItem.setChecked) QtCore.QObject.connect(self.ServiceManagerDock, QtCore.SIGNAL("visibilityChanged(bool)"), self.ViewServiceManagerItem.setChecked)
QtCore.QObject.connect(self.ThemeManagerDock, QtCore.SIGNAL("visibilityChanged(bool)"), self.ViewThemeManagerItem.setChecked) QtCore.QObject.connect(self.ThemeManagerDock, QtCore.SIGNAL("visibilityChanged(bool)"), self.ViewThemeManagerItem.setChecked)

View File

@ -0,0 +1,45 @@
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
"""
OpenLP - Open Source Lyrics Projection
Copyright (c) 2008 Raoul Snyman
Portions copyright (c) 2008 Martin Thompson, Tim Bentley,
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
"""
import os
from time import sleep
from PyQt4 import QtCore, QtGui
class SlideController(object):
def __init__(self, control_splitter):
self.Pane = QtGui.QWidget(control_splitter)
# self.Pane.setObjectName("Pane")
self.PaneLayout = QtGui.QVBoxLayout(self.Pane)
self.PaneLayout.setSpacing(0)
self.PaneLayout.setMargin(0)
# self.PaneLayout.setObjectName("PaneLayout")
self.Splitter = QtGui.QSplitter(self.Pane)
self.Splitter.setOrientation(QtCore.Qt.Vertical)
# self.Splitter.setObjectName("Splitter")
self.Controller = QtGui.QScrollArea(self.Splitter)
self.Controller.setWidgetResizable(True)
# self.Controller.setObjectName("Controller")
self.ControllerContents = QtGui.QWidget(self.Controller)
self.ControllerContents.setGeometry(QtCore.QRect(0, 0, 228, 536))
# self.ControllerContents.setObjectName("ControllerContents")
self.Controller.setWidget(self.ControllerContents)
self.Screen = QtGui.QGraphicsView(self.Splitter)
self.Screen.setMaximumSize(QtCore.QSize(16777215, 250))
# self.Screen.setObjectName("Screen")
self.PaneLayout.addWidget(self.Splitter)

View File

@ -20,7 +20,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
import os import os
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.resources import * from openlp.core.resources import *
from openlp.core.lib import Plugin, PluginUtils, MediaManagerItem from openlp.core.lib import Plugin, PluginUtils, MediaManagerItem, ImageServiceItem
#from forms import EditSongForm #from forms import EditSongForm
class ImagePlugin(Plugin, PluginUtils): class ImagePlugin(Plugin, PluginUtils):
@ -33,6 +33,8 @@ class ImagePlugin(Plugin, PluginUtils):
self.icon.addPixmap(QtGui.QPixmap(':/media/media_image.png'), self.icon.addPixmap(QtGui.QPixmap(':/media/media_image.png'),
QtGui.QIcon.Normal, QtGui.QIcon.Off) QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.preview_service_item=ImageServiceItem()
self.live_service_item=ImageServiceItem()
def get_media_manager_item(self): def get_media_manager_item(self):
# Create the MediaManagerItem object # Create the MediaManagerItem object
@ -114,7 +116,8 @@ class ImagePlugin(Plugin, PluginUtils):
self._save_display_list(self.ImageListView) self._save_display_list(self.ImageListView)
def onImagePreviewClick(self): def onImagePreviewClick(self):
pass self.preview_service_item.set_from_plugin(self.ImageListView.pathtofile)
self.preview_service_item.render()
def onImageLiveClick(self): def onImageLiveClick(self):
pass pass