PluginScreenSavers
From SqueezeboxWiki
Revision as of 08:30, 23 June 2010 by Soulkeeper (Talk | contribs)
You can turn any plugin into a custom screensaver by registering your plugin as a screensaver. The plugin should be used to give the user any settings options or to set the screensaver as active or reset to default. You can register the screensaver using the following subroutine:
sub screenSaver { Slim::Buttons::Common::addSaver( SCREENSAVER.saverModeName', getScreensaverFunctions(), \&setScreensaverMode, \&leaveScreensaverMode, string('PLUGIN_SCREENSAVER_NAME') ); }
- SCREENSAVER.saverModeName
Change this to provide a unique name for your screensaver. Using the prefix"SCREENSAVER" will indicate to the server that your mode is of the screensaverclass, and match the IR mappings from the [screensaver] section of Default.map
- getScreensaverFunctions()
This subroutine, just like getFunctions points to the function has for the screensaver mode.
subroutine just like setMode to initialize anything you need for the screensaver mode.
- leaveScreensaverMode
subroutine to execute before the mode exits
- string('SCREENSAVER_NAME')
SCREENSAVER_NAME should be change to a unique identifier for your pluginname. This can be the same as your plugin, or something different. This allowsfor future nationalisation for the other languages supported by SlimServer