Start a slideshow from an image plugin, possible?
#1
I've made a simple lastfm image plugin, and was wondering if it's possible to start a slideshow on a directory from a plugin.

What I really would like to accomplish is something like:

onPlaybackStarted
getNowPlayingArtist
startSlideShow

Would this be possible with a plugin or even a script?
Reply
#2
You can use the builtins :
http://wiki.xbmc.org/?title=List_of_Built_In_Functions Wrote:SlideShow(dir [,recursive, [not]random]) Starts a slideshow of pictures in the folder dir. Optional parameters are "recursive", and "random" or "notrandom" parameters. The "recursive" parameter starts a recursive slideshow, adding images from sub-folders. The "random" and "notrandom" parameters override the Randomize setting found in the pictures media window.
When you have pictures in many different folders, I used this code but it uses httpapi which will be deprecated (and I need to find out a new solution) :
Code:
pDialog = xbmcgui.DialogProgress()
            ret = pDialog.create(__language__(30000), 'Preparing SlideShow :','')
            from urllib import urlopen
            HTTP_API_url = "http://%s/xbmcCmds/xbmcHttp?command="%xbmc.getIPAddress()
            html = urlopen(HTTP_API_url + "ClearSlideshow" )
            c=0
            for path,filename in filelist:
                c=c+1
                pDialog.update(int(100*(float(c)/len(filelist))) , "Adding pictures to the slideshow",filename)
                if pDialog.iscanceled():break
                html = urlopen(HTTP_API_url + "AddToSlideshow(%s)" % quote_plus(join(path,filename)))
            #html = urlopen(HTTP_API_url + "ExecBuiltIn(ActivateWindow(12007))" )
            if not pDialog.iscanceled(): xbmc.executebuiltin( "SlideShow(,,notrandom)" )
            pDialog.close()

Hope it helps !
Reply
#3
@solexalex, Thanks for that. It gives me inspiration.

On a side note, does anyone know how or if I can get the last.fm username without having to bug the user to add it. Assuming they already have it in music settings.
Reply
#4
hum.. Not very sure but you may find this info in the built-ins or maybe in the labels (both are to find in the wiki)
Reply

Logout Mark Read Team Forum Stats Members Help
Start a slideshow from an image plugin, possible?0