maindisplay

The maindisplay module provides the functionality to display screens and play multimedia within OpenLP.

Some of the code for this form is based on the examples at:

class openlp.core.ui.maindisplay.AudioPlayer(parent)[source]

Bases: openlp.core.common.openlpmixin.OpenLPMixin, PyQt5.QtCore.QObject

This Class will play audio only allowing components to work with a soundtrack independent of the user interface.

add_to_playlist(file_names)[source]

Add another file to the playlist.

Parameters:file_names – A list with files to be added to the playlist.
go_to(index)[source]

Go to a particular track in the list

Parameters:index – The track to go to
next()[source]

Skip forward to the next track in the list

pause()[source]

Pause the Audio

play()[source]

We want to play the file so start it

position_changed
reset()[source]

Reset the audio player, clearing the playlist and the queue.

set_volume(volume)[source]

Set the volume of the media player

Parameters:volume
set_volume_slider(slider)[source]

Connect the volume slider to the media player :param slider:

stop()[source]

Stop the Audio and clean up

class openlp.core.ui.maindisplay.Display(parent)[source]

Bases: PyQt5.QtWidgets.QGraphicsView

This is a general display screen class. Here the general display settings will done. It will be used as specialized classes by Main Display and Preview display.

is_web_loaded(field=None)[source]

Called by webView event to show display is fully loaded

resizeEvent(event)[source]

React to resizing of this display

Parameters:event – The event to be handled
setup()[source]

Set up and build the screen base

class openlp.core.ui.maindisplay.MainDisplay(parent)[source]

Bases: openlp.core.common.openlpmixin.OpenLPMixin, openlp.core.ui.maindisplay.Display, openlp.core.common.registryproperties.RegistryProperties

This is the display screen as a specialized class from the Display class

alert(text, location)[source]

Display an alert.

Parameters:
  • text – The text to be displayed.
  • location – Where on the screen is the text to be displayed
build_html(service_item, image_path='')[source]

Store the service_item and build the new HTML from it. Add the HTML to the display

Parameters:
  • service_item – The Service item to be used
  • image_path – Where the image resides.
change_window_level(window)[source]

Changes the display window level on Mac OS X so that the main window can be brought into focus but still allow the main display to be above the menu bar and dock when it in focus.

Parameters:window – Window from our application that focus changed to or None if outside our application
close()[source]

Remove registered function on close.

closeEvent(event)[source]

Catch the close event, and check that the close event is triggered by OpenLP closing the display. On Windows this event can be triggered by pressing ALT+F4, which we want to ignore.

Parameters:event – The triggered event
css_changed()[source]

We need to rebuild the CSS on the live display.

direct_image(path, background)[source]

API for replacement backgrounds so Images are added directly to cache.

Parameters:
  • path – Path to Image
  • background – The background color
display_image(image)[source]

Display an image, as is.

Parameters:image – The image to be displayed
footer(text)[source]

Display the Footer

Parameters:text – footer text to be displayed
hide_display(mode=3)[source]

Hide the display by making all layers transparent Store the images so they can be replaced when required

Parameters:mode – How the screen is to be hidden
image(path)[source]

Add an image as the background. The image has already been added to the cache.

Parameters:path – The path to the image to be displayed. Note, the path is only passed to identify the image. If the image has changed it has to be re-added to the image manager.
preview()[source]

Generates a preview of the image displayed.

reset_image()[source]

Reset the background image to the service item image. Used after the image plugin has changed the background.

retranslateUi()[source]

Setup the interface translation strings.

set_transparency(enabled)[source]

Set the transparency of the window

Parameters:enabled – Is transparency enabled
setup()[source]

Set up and build the output screen

shake_web_view()[source]

Resizes the web_view a bit to force an update. Workaround for bug #1531319, should not be needed with PyQt 5.6.

show_display()[source]

Show the stored layers so the screen reappears as it was originally. Make the stored images None to release memory.

text(slide, animate=True)[source]

Add the slide text from slideController

Parameters:
  • slide – The slide text to be displayed
  • animate – Perform transitions if applicable when setting the text