Kodi Community Forum

Full Version: World's simplest script: start partymode and launch music vis/song info
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm trying write a script to put in autoexec.py to automatically start Party Mode, then launch the music visualization (the one you get when you hit X, so that I can use Left/Right to control tracks) then pull up that song info overlay (the one you get when you hit the White Button)

This is what I have so far, based on what I've been able to find in the wiki and elsewhere

Code:
import xbmc, xbmcgui
xbmc.executebuiltin("XBMC.PlayerControl(PartyMode)")
xbmc.executebuiltin("XBMC.ActivateWindow(visualisation)")
xbmc.executebuiltin("XBMC.ActivateWindow(musicoverlay)")

It doesn't seem to be going quite right, though, as the music plays, but then the music info overlay shows no info and the visualization doesn't play in the background. Where might I be going wrong?

Thanks for any help!
depends on what you mean by the visualisation doesn't play in the background. If you mean it doesn't show at all, try adding some sleeps between commands.

xbmc.sleep(300) experiment with the time in msec.
I'll play around with that. Aside from that, though, so you see anything odd in my script?
This is what seems to work. XBMC needs the whole second to get everything ready and not have the party mode window spawn on top of the visualization. The visualization still does not show, but I'll blame that on some Win32/VMWare environment quirkiness as everything else seems to work and now the song info overlay is populated with real info.

Thanks for your help!!

Code:
import xbmc, xbmcgui, time

xbmc.sleep(1000)
xbmc.executebuiltin("XBMC.PlayerControl(PartyMode)")
xbmc.sleep(1000)
xbmc.executebuiltin("XBMC.ActivateWindow(visualisation)")
xbmc.sleep(300)
xbmc.executebuiltin("XBMC.ActivateWindow(musicoverlay)")
It turns out I was incorrect about musicoverlay. That is not the window you need activated to show the song information you get when you hit the White button. That screen lies within MusicVisualization.xml (the window called by ActivateWindow(visualisation))

The thing is, the song info screen always fades out. How would one get it to star permanently? Can you simulate a button press in a script?
Pressing WHITE once will put it on for all time, and leave it on for all time.

Additionally, I think you can simulate a button press via the HTTP interface (accessible from python).