xbmc/xbmc — pull request #856 by amet (2012-04-06 08:39:20+00:00)
Title: Callback function for xbmc module (xbmc.Monitor)

Something has gone wrong on #834 so here is a new one, sry about that

monitors for:
- onSettingsChanged
- onScreensaverDeactivated
- onScreensaverActivated
- onDatabaseUpdated, will return the database that has been updated (video/music)

xbmc.Monitor will monitor for ScreenSaver activation/deactivation, Settings changing and database update.

settings changing are quite useful on service addons to allow users to change the settings without deactivating/Activating addon to reload them. only changed addon will get notified.

cptspiff has gone over it but looks like the comments have been lost as I have squashed it down.

as ususal, this is a c/p monster from xbmc.Player callback , if anything needs changing I am all ears

Cheers,
amet

``` Python
class MyMonitor( xbmc.Monitor ):
def __init__( self, *args, **kwargs ):
xbmc.Monitor.__init__( self )

def onSettingsChanged( self ):
print "settings changed, fetch new settings"

def onScreensaverDeactivated( self ):
print "screensaver Deactivated"

def onScreensaverActivated( self ):
print "screensaver Activated"

def onDatabaseUpdated( self, database ):
print "%s database updated" % database

monitor = MyMonitor()

```