Add custom button
#1
I am trying to add a button to load and play a playlist (similar to how Partymode works).

I have the button ready but can't seen to figure out how to load the playlist and activate (play) it.

The playlist is called 'chill and was made using the XBMC smartlist function.

Thanks
Reply
#2
Did you add this button by modifying the default skin or are you using one of the Confluence mods that support custom menu buttons? If it's the latter, you may want to ask on the thread dedicated to that particular mod.
Reply
#3
(2013-03-20, 18:22)artrafael Wrote: Did you add this button by modifying the default skin or are you using one of the Confluence mods that support custom menu buttons? If it's the latter, you may want to ask on the thread dedicated to that particular mod.

Default skin, and have been combing through other skins/mods/wikis looking for answer but at the moment it escapes me.
Thanks
Reply
#4
Show us your changes...
- - - Tribute to Metallica - - -
If I managed to help you, please click my reputation
Reply
#5
(2013-03-20, 18:48)mad-max Wrote: Show us your changes...

<onclick>ActivateWindow(musicplaylist, return)</onclick>

This will open empty playlist.
I need to define the playlist to use as "chill", and then start it playing, just like clicking on PartyMode but using Chill as playlist.

Not sure if/how to use

PlayMedia(chill)
or
ActvateWindow(musicplaylist
or
special://musicplayist
Reply
#6
<onclick>PlayMedia(special://profile/playlists/music/chill.xsp)</onclick> ?
Reply
#7
(2013-03-20, 22:10)toiva Wrote: <onclick>PlayMedia(special://profile/playlists/music/chill.xsp)</onclick> ?
BINGO!
Thanks Toiva

Maybe one last question, now that the music has started, how could you have it go straight into the visualization screen (ProjectM)?
Reply
#8
Where would I enter that line of code to do something similar?
Reply
#9
(2013-03-21, 05:50)Jmhthefirst Wrote: Where would I enter that line of code to do something similar?

I guess that would depend on where you want to do it. If it's on the home page (main menu), then it would be in Home.xml file for your skin.
Reply
#10
(2013-03-20, 22:35)JDizzy Wrote:
(2013-03-20, 22:10)toiva Wrote: <onclick>PlayMedia(special://profile/playlists/music/chill.xsp)</onclick> ?
BINGO!
Thanks Toiva

Maybe one last question, now that the music has started, how could you have it go straight into the visualization screen (ProjectM)?

I really have no idea if this will work but try adding a second onclick command right below the first

<onclick>PlayMedia(special://profile/playlists/music/chill.xsp)</onclick>
<onclick>ActivateWindow(visualisation)</onclick>
Reply
#11
If that doesn't work, you can try writing a simple Python script that executes the PlayMedia() and ActivateWindow() functions and then execute this script with <onclick>RunScript(path/to/your/script.py)</onclick>
Reply
#12
(2013-03-20, 22:10)toiva Wrote: I really have no idea if this will work but try adding a second onclick command right below the first

<onclick>PlayMedia(special://profile/playlists/music/chill.xsp)</onclick>
<onclick>ActivateWindow(visualisation)</onclick>

Tried it but it didn't work....
I know I read where you could stack multiple <onclick> commands... I'll play with it a bit.
Thanks
Reply
#13
I tested it just a moment ago and it worked fine.
Reply
#14
(2013-03-21, 21:10)toiva Wrote: I tested it just a moment ago and it worked fine.

Hmmm... for some reason it doesn't do it on my system.
No biggie... all I have to do is hit Escape and it starts.
Thanks for your help!
Reply
#15
Did you remember to restart XBMC after adding the second onlick action?
Reply

Logout Mark Read Team Forum Stats Members Help
Add custom button0