presentationcontroller¶
-
class
openlp.plugins.presentations.lib.presentationcontroller.
PresentationController
(plugin=None, name='PresentationController', document_class=<class 'openlp.plugins.presentations.lib.presentationcontroller.PresentationDocument'>)[source]¶ Bases:
object
This class is used to control interactions with presentation applications by creating a runtime environment. This is a base class for presentation controllers to inherit from.
To create a new controller, take a copy of this file and name it so it ends with
controller.py
, i.e.foobarcontroller.py
. Make sure it inheritsPresentationController
, and then fill in the blanks. If possible try to make sure it loads on all platforms, usually by using :mod:os.name
checks, although__init__
,check_available
andpresentation_deleted
should always be implemented.See
ImpressController
,PowerpointController
orPptviewController
for examples.Basic Attributes
name
- The name that appears in the options and the media manager.
enabled
- The controller is enabled.
available
- The controller is available on this machine. Set by init via call to check_available.
plugin
- The presentationplugin object.
supports
- The primary native file types this application supports.
also_supports
- Other file types the application can import, although not necessarily the first choice due to potential incompatibilities.
Hook Functions
kill()
- Called at system exit to clean up any running presentations.
check_available()
- Returns True if presentation application is installed/can run on this machine.
presentation_deleted()
- Deletes presentation specific files, e.g. thumbnails.
-
class
openlp.plugins.presentations.lib.presentationcontroller.
PresentationDocument
(controller, name)[source]¶ Bases:
object
Base class for presentation documents to inherit from. Loads and closes the presentation as well as triggering the correct activities based on the users input
Hook Functions
load_presentation()
- Load a presentation file
close_presentation()
- Close presentation and clean up objects
presentation_loaded()
- Returns True if presentation is currently loaded
is_active()
- Returns True if a presentation is currently running
blank_screen()
- Blanks the screen, making it black.
unblank_screen()
- Unblanks the screen, restoring the output
is_blank
- Returns true if screen is blank
stop_presentation()
- Stops the presentation, removing it from the output display
start_presentation()
- Starts the presentation from the beginning
get_slide_number()
- Returns the current slide number, from 1
get_slide_count()
- Returns total number of slides
goto_slide(slide_no)
- Jumps directly to the requested slide.
next_step()
- Triggers the next effect of slide on the running presentation
previous_step()
- Triggers the previous slide on the running presentation
get_thumbnail_path(slide_no, check_exists)
- Returns a path to an image containing a preview for the requested slide
-
check_thumbnails
()[source]¶ Returns
True
if the thumbnail images exist and are more recent than the powerpoint file.
-
close_presentation
()[source]¶ Close presentation and clean up objects. Triggered by new object being added to SlideController
-
convert_thumbnail
(file, idx)[source]¶ Convert the slide image the application made to a scaled 360px height .png image.
-
get_slide_notes
(slide_no)[source]¶ Returns the text on the slide
Parameters: slide_no – The slide the text is required for, starting at 1
-
get_slide_text
(slide_no)[source]¶ Returns the text on the slide
Parameters: slide_no – The slide the text is required for, starting at 1
-
get_thumbnail_path
(slide_no, check_exists)[source]¶ Returns an image path containing a preview for the requested slide
Parameters: - slide_no – The slide an image is required for, starting at 1
- check_exists –
-
get_titles_and_notes
()[source]¶ Reads the titles from the titles file and the notes files and returns the content in two lists
-
goto_slide
(slide_no)[source]¶ Jumps directly to the requested slide.
Parameters: slide_no – The slide to jump to, starting at 1
-
load_presentation
()[source]¶ Called when a presentation is added to the SlideController. Loads the presentation and starts it.
Returns False if the file could not be opened
-
next_step
()[source]¶ Triggers the next effect of slide on the running presentation. This might be the next animation on the current slide, or the next slide
-
presentation_deleted
()[source]¶ Cleans up/deletes any controller specific files created for a file, e.g. thumbnails