PDA

View Full Version : Calling playcontrol for partymode


arnova
2008-08-31, 17:11
I've been using a script for quite some time now to play a smartplaylist when XBMC starts. Now I'm wondering how I can accomplish getting the player to play the playlist in partymode. My current script looks like this:


import nt, xbmc

#Define (Smart XSP) Playlist here
file = 'Q:\\UserData\\playlists\\music\\xsp\\MP3 Selection.xsp'

xbmc.executebuiltin('XBMC.PlayMedia(' + file + ')')
xbmc.Player().play()


I guess I need to modify xbmc.Player().play() into something else, right? I hope someone can help me out.

rwparris2
2008-08-31, 17:29
use xbmc.PlayerControl(Partymode(music))

arnova
2008-08-31, 18:17
I just tried it with:


import nt, xbmc

#Define (Smart XSP) Playlist here
file = 'Q:\\UserData\\playlists\\music\\xsp\\MP3 Selection.xsp'

xbmc.executebuiltin('XBMC.PlayMedia(' + file + ')')
xbmc.PlayerControl(Partymode(music))


but it's failing, my log shows:

17:14:51 M: 39837696 INFO: xbmc.PlayerControl(Partymode(music))
17:14:51 M: 39817216 INFO: AttributeError
17:14:51 M: 39817216 INFO: :
17:14:51 M: 39837696 INFO: 'module' object has no attribute 'PlayerControl'
17:14:51 M: 39796736 INFO:
17:14:51 M: 39796736 ERROR: Scriptresult: Error
17:14:51 M: 39796736 INFO: Python script stopped


Am I doing something wrong?

Horscht
2008-08-31, 23:14
try:


import nt, xbmc

#Define (Smart XSP) Playlist here
file = 'Q:\\UserData\\playlists\\music\\xsp\\MP3 Selection.xsp'

xbmc.executebuiltin("XBMC.PlayerControl(PartyMode)")


I just tried it with:


import nt, xbmc

#Define (Smart XSP) Playlist here
file = 'Q:\\UserData\\playlists\\music\\xsp\\MP3 Selection.xsp'

xbmc.executebuiltin('XBMC.PlayMedia(' + file + ')')
xbmc.PlayerControl(Partymode(music))


but it's failing, my log shows:

17:14:51 M: 39837696 INFO: xbmc.PlayerControl(Partymode(music))
17:14:51 M: 39817216 INFO: AttributeError
17:14:51 M: 39817216 INFO: :
17:14:51 M: 39837696 INFO: 'module' object has no attribute 'PlayerControl'
17:14:51 M: 39796736 INFO:
17:14:51 M: 39796736 ERROR: Scriptresult: Error
17:14:51 M: 39796736 INFO: Python script stopped


Am I doing something wrong?

rwparris2
2008-09-01, 06:29
sorry, should have capitalized XBMC & mentioned it's a builtin.

arnova
2008-09-01, 17:54
try:


import nt, xbmc

#Define (Smart XSP) Playlist here
file = 'Q:\\UserData\\playlists\\music\\xsp\\MP3 Selection.xsp'

xbmc.executebuiltin("XBMC.PlayerControl(PartyMode)")


You mean:

import nt, xbmc

#Define (Smart XSP) Playlist here
file = 'Q:\\UserData\\playlists\\music\\xsp\\MP3 Selection.xsp'

xbmc.executebuiltin('XBMC.PlayMedia(' + file + ')')
xbmc.executebuiltin("XBMC.PlayerControl(PartyMode)")


Right?

arnova
2008-09-01, 18:01
Additional comment referring to my previous post: What I want to accomplish is to play a certain SmartPlayList(XSP) to be played in PartyMode. I have the idea that in the way proposed this is not working....?

arnova
2008-09-01, 18:08
Hmmm..... For a specific XSP smartplaylist you need something like:

file = 'Q:\\UserData\\playlists\\music\\xsp\\MP3 Selection.xsp'

xbmc.executebuiltin("XBMC.PlayerControl(PartyMode(file))")


But I still get an error saying:

17:05:38 M: 43270144 ERROR: Error loading Smart playlist file (failed to read file)


I guess I am still doing something wrong?

arnova
2008-09-01, 18:14
I've (already) fixed it, forgot the autocast:

xbmc.executebuiltin('XBMC.PlayerControl(PartyMode( ' + file + '))')


Thanks for all your help.