serviceitem¶
The serviceitem
provides the service item functionality including the
type and capability of an item.
-
class
openlp.core.lib.serviceitem.
ItemCapabilities
[source]¶ Bases:
object
Provides an enumeration of a service item’s capabilities
CanPreview
- The capability to allow the ServiceManager to add to the preview tab when making the previous item live.
CanEdit
- The capability to allow the ServiceManager to allow the item to be edited
CanMaintain
- The capability to allow the ServiceManager to allow the item to be reordered.
RequiresMedia
- Determines is the service_item needs a Media Player
CanLoop
- The capability to allow the SlideController to allow the loop processing.
CanAppend
- The capability to allow the ServiceManager to add leaves to the item
NoLineBreaks
- The capability to remove lines breaks in the renderer
OnLoadUpdate
- The capability to update MediaManager when a service Item is loaded.
AddIfNewItem
- Not Used
ProvidesOwnDisplay
- The capability to tell the SlideController the service Item has a different display.
HasDetailedTitleDisplay
- Being Removed and decommissioned.
HasVariableStartTime
- The capability to tell the ServiceManager that a change to start time is possible.
CanSoftBreak
- The capability to tell the renderer that Soft Break is allowed
CanWordSplit
- The capability to tell the renderer that it can split words is allowed
HasBackgroundAudio
- That a audio file is present with the text.
CanAutoStartForLive
- The capability to ignore the do not play if display blank flag.
CanEditTitle
- The capability to edit the title of the item
IsOptical
- Determines is the service_item is based on an optical device
HasDisplayTitle
- The item contains ‘displaytitle’ on every frame which should be preferred over ‘title’ when displaying the item
HasNotes
- The item contains ‘notes’
HasThumbnails
- The item has related thumbnails available
-
AddIfNewItem
= 9¶
-
CanAppend
= 6¶
-
CanAutoStartForLive
= 16¶
-
CanEdit
= 2¶
-
CanEditTitle
= 17¶
-
CanLoop
= 5¶
-
CanMaintain
= 3¶
-
CanPreview
= 1¶
-
CanSoftBreak
= 13¶
-
CanWordSplit
= 14¶
-
HasBackgroundAudio
= 15¶
-
HasDisplayTitle
= 19¶
-
HasNotes
= 20¶
-
HasThumbnails
= 21¶
-
HasVariableStartTime
= 12¶
-
IsOptical
= 18¶
-
NoLineBreaks
= 7¶
-
OnLoadUpdate
= 8¶
-
ProvidesOwnDisplay
= 10¶
-
RequiresMedia
= 4¶
-
class
openlp.core.lib.serviceitem.
ServiceItem
(plugin=None)[source]¶ Bases:
openlp.core.common.registryproperties.RegistryProperties
The service item is a base class for the plugins to use to interact with the service manager, the slide controller, and the projection screen compositor.
-
add_capability
(capability)[source]¶ Add an ItemCapability to a ServiceItem
Parameters: capability – The capability to add
-
add_from_command
(path, file_name, image, display_title=None, notes=None)[source]¶ Add a slide from a command.
Parameters: - path – The title of the slide in the service item.
- file_name – The title of the slide in the service item.
- image – The command of/for the slide.
- display_title – Title to show in gui/webinterface, optional.
- notes – Notes to show in the webinteface, optional.
-
add_from_image
(path, title, background=None, thumbnail=None)[source]¶ Add an image slide to the service item.
Parameters: - path – The directory in which the image file is located.
- title – A title for the slide in the service item.
- background –
- thumbnail – Optional alternative thumbnail, used for remote thumbnails.
-
add_from_text
(raw_slide, verse_tag=None)[source]¶ Add a text slide to the service item.
Parameters: - raw_slide – The raw text of the slide.
- verse_tag –
-
add_icon
(icon)[source]¶ Add an icon to the service item. This is used when displaying the service item in the service manager.
Parameters: icon – A string to an icon in the resources or on disk.
-
get_rendered_frame
(row)[source]¶ Returns the correct frame for a given list and renders it if required.
Parameters: row – The service item slide to be returned
-
get_service_repr
(lite_save)[source]¶ This method returns some text which can be saved into the service file to represent this item.
-
is_capable
(capability)[source]¶ Tell the caller if a ServiceItem has a capability
Parameters: capability – The capability to test for
-
merge
(other)[source]¶ Updates the unique_identifier with the value from the original one The unique_identifier is unique for a given service item but this allows one to replace an original version.
Parameters: other – The service item to be merged with
-
remove_invalid_frames
(invalid_paths=None)[source]¶ Remove invalid frames, such as ones where the file no longer exists.
-
render
(provides_own_theme_data=False)[source]¶ The render method is what generates the frames for the screen and obtains the display information from the renderer. At this point all slides are built for the given display size.
Parameters: provides_own_theme_data – This switch disables the usage of the item’s theme. However, this is disabled by default. If this is used, it has to be taken care, that the renderer knows the correct theme data. However, this is needed for the theme manager.
-
set_from_service
(service_item, path=None)[source]¶ This method takes a service item from a saved service file (passed from the ServiceManager) and extracts the data actually required.
Parameters: - service_item – The item to extract data from.
- path – Defaults to None. This is the service manager path for things which have their files saved with them or None when the saved service is lite and the original file paths need to be preserved.
-
set_media_length
(length)[source]¶ Stores the media length of the item
Parameters: length – The length of the media item
-