Class: kodi::addon::CInstanceScreensaver
A screensaver is a Kodi addon that fills the screen with moving images or patterns when the computer is not in use. Initially designed to prevent phosphor burn-in on CRT and plasma computer monitors (hence the name), screensavers are now used primarily for entertainment, security or to display system status information.
Include the header #include <kodi/addon-instance/ScreenSaver.h> to use this class.
This interface allows the creating of screensavers for Kodi, based upon DirectX or/and OpenGL rendering with C++
code.
The interface is small and easy usable. It has three functions:
Start()
- Called on creationRender()
- Called at render timeStop()
- Called when the screensaver has no workAdditionally, there are several other functions available in which the child class can ask about the current hardware, including the device, display and several other parts.
Here is an example of what the addon.xml.in
would look like for an screensaver addon:
Description to screensaver related addon.xml values:
Name | Description |
---|---|
point | Addon type specification At all addon types and for this kind always "xbmc.ui.screensaver". |
library_@PLATFORM@ | Sets the used library name, which is automatically set by cmake at addon build. |
addon.xml
, see also https://kodi.wiki/view/Addon.xml.Here is an example of the minimum required code to start a screensaver:
Here is another example where the screensaver is used together with other instance types:
The destruction of the example class CMyScreenSaver
is called from Kodi's header. Manually deleting the add-on instance is not required.
Topics | |
Information functions | |
To get info about the device, display and several other parts | |
|
inline |
Screensaver class constructor.
Used by an add-on that only supports screensavers.
|
inlineexplicit |
Screensaver class constructor used to support multiple instance types.
[in] | instance | The instance value given to kodi::addon::CAddonBase::CreateInstance(...) . |
[in] | kodiVersion | [opt] Version used in Kodi for this instance, to allow compatibility to older Kodi versions. |
kodiVersion
.Here's example about the use of this:
|
overridedefault |
Destructor.
|
inlinevirtual |
Used to notify the screensaver that it has been started.
|
inlinevirtual |
Used to inform the screensaver that the rendering control was stopped.
|
inlinevirtual |
Used to indicate when the add-on should render.