Service Management
From OpenLP
Contents |
Diagram
Definitions of Objects
ServiceItem
A ServiceItem contains the data for an item in the Service, be it images, text or anything else. It also contains the instructions necessary to render said data on a drawing surface.
Service
The Service is a class that holds a list of ServiceItems which can be saved to or loaded from disk.
ServiceManager
The ServiceManager manages the list of items in the Service. The ServiceManager is used to save and load Services from disk, and passes the current ServiceItem to the SlideController for controlling and displaying. The ServiceManager works closely with the ServiceView, to show the user what ServiceItems are in the Service.
ServiceView
The ServiceView displays all the ServiceItems in a Service, via the ServiceManager.
Service Manager (subsystem)
The Service Manager is a group of components which deal with managing a service.
Plugin
The Plugin creates a descendant class of ServiceItem, such as SongServiceItem. This ServiceItem descendant re-implements a number of core methods/properties so that other components can retrieve information from the ServiceItem. The plugin gives the ServiceManager an instance of the ServiceItem descendant when you drag and drop the media item in the plugin into the ServiceView.
SlideController
The SlideController controls which slide is being displayed at any current moment. It receives a ServiceItem from the ServiceManager and uses the slide information in the ServiceItem to draw its list of slides, and then it uses the render() function of the ServiceItem to draw a slide onto a drawing object, and then passes this drawing object into the render() signal, to be processed by a slot.
Service Management Process
This is the two-part process that takes place when a user drags and drops an item into the Service Manager, and then double-clicks on the item to make it appear on the live screen.
Part 1: Adding an Item to the Service
User Action
The user drags an item (or group of items) from a plugin across to the service manager and drops it.
Program Action
- A new ServiceItem descendant object is created.
- The item or group of items which was dropped on the service manager is added to this new ServiceItem.
- The ServiceItem is added to the ServiceManager object.
- The ServiceManager adds the ServiceItem to the currently active Service object.
- The ServiceManager sends an updated list of ServiceItems to the ServiceView object.
- The ServiceView redraws itself according to the information in the list of ServiceItem objects.
- The ServiceManager sets the Service state to "modified."
Part 2: Sending an Item to Live
User Action
The user double-clicks on an item in the service manager, and it appears in the Live controller.
Program Action
- The ServiceManager object notes which ServiceItem was double-clicked, and which slide was double-clicked.
- The ServiceManager passes the ServiceItem object, plus the slide number, to the SlideController object.
- The SlideController loads the ServiceItem, displaying the slides.
- The SlideController calls the ServiceItem's
render()method. - The SlideController fires the
render()signal, passing the rendered output to the slot. - openlp.org decides if, where, and how to display the rendered output.
