Posts: 6,339
Joined: Jul 2010
Reputation:
116
artrafael
Team-XBMC Forum Moderator
Posts: 6,339
2013-04-04, 18:51
(This post was last modified: 2013-04-05, 05:17 by artrafael.)
If your default.py is invoked by your autoexec.py, then specify the path (location) of the former in the latter.
Posts: 226
Joined: Apr 2011
Reputation:
0
pan2
Senior Member
Posts: 226
2013-04-04, 23:57
(This post was last modified: 2013-04-04, 23:58 by pan2.)
Do you mean for example:
#execute targeted script at startup.
import xbmc
xbmc.executescript C:\Users\Pan2\AppData\Roaming\XBMC\userdata\default.py
or is my syntax incorrect?
Posts: 226
Joined: Apr 2011
Reputation:
0
pan2
Senior Member
Posts: 226
2013-04-05, 05:25
(This post was last modified: 2013-04-05, 05:26 by pan2.)
Will do. Still nothing, I looked at the log and there was no reference to the default.py. There seems to be only one thing you can do to the default.py and that is the address of the media. Maybe that's where I'm stuffing up. Here is the top part of the default.py:
media="C:\Users\Pan2\AppData\Roaming\XBMC\userdata\playlists\music\playlist.m3u"
# This can be a playlist, music, or video file or an Url.
playercontrol1="RandomOn"
playercontrol2=""
# "RandomOn", "RandomOff", "RepeatOne", "RepeatAll", "Partymode(music)", "Partymode(path to .xsp file)"
sfx=False
# True or False | Note that there are no quotes around True or False
# media needs to be a path to a .wav file if this is true
randomplaylist=True
# Set randomplaylist to True and playercontrol1 to RandomOn to start the playlist
# on the second (random) song. Otherwise set this to False.
volume="40"
# This is a percent between 0 and 100. 0 is mute and 100 is max volume.
I tested the m3u with vlc player and it works fine
Posts: 6,339
Joined: Jul 2010
Reputation:
116
artrafael
Team-XBMC Forum Moderator
Posts: 6,339
That snippet of your script doesn't really do anything other than define some variables. Is there more to it? What's it supposed to do?
Posts: 226
Joined: Apr 2011
Reputation:
0
pan2
Senior Member
Posts: 226
It's supposed to randomly choose a track from a playlist and play it until an action such as a movie starts or you play some music etc. Once that action has ceased, it's supposed to start up again.
Here is my complete default.py script:
media="C:\Users\Pan2\AppData\Roaming\XBMC\userdata\playlists\music\playlist.m3u"
# This can be a playlist, music, or video file or an Url.
playercontrol1="RandomOn"
playercontrol2=""
# "RandomOn", "RandomOff", "RepeatOne", "RepeatAll", "Partymode(music)", "Partymode(path to .xsp file)"
sfx=False
# True or False | Note that there are no quotes around True or False
# media needs to be a path to a .wav file if this is true
randomplaylist=True
# Set randomplaylist to True and playercontrol1 to RandomOn to start the playlist
# on the second (random) song. Otherwise set this to False.
volume="40"
# This is a percent between 0 and 100. 0 is mute and 100 is max volume.
####################################
#Don't mess with anything down here#
#unless you know what you're doing #
####################################
import nt,xbmc,xbmcgui
from os import path
xbmc.executehttpapi('SetResponseFormat¶meter=WebHeader;False;WebFooter;False')
# if (media!="" and not path.isfile(media)):
# xbmcgui.Dialog().ok('Invalid Path','Path to media not found')
y=1
while y==1:
rawResponse=xbmc.executehttpapi('getcurrentlyplaying')
if rawResponse=='<li>Filename:[Nothing Playing]':
xbmc.executebuiltin('SetVolume('+volume+')')
if(media==""):
if (playercontrol1=="Partymode(music)" or playercontrol2=="Partymode(music)"):
xbmc.executebuiltin('XBMC.PlayerControl(Partymode(music))')
xbmc.sleep(5000)
elif(sfx==True):
try:
xbmc.playSFX(media)
except:
xbmc.log('playSFX failed')
else:
xbmc.executebuiltin('XBMC.PlayMedia('+media+')')
if playercontrol1!="":
xbmc.executebuiltin('XBMC.PlayerControl('+playercontrol1+')')
if playercontrol2!="":
xbmc.executebuiltin('XBMC.PlayerControl('+playercontrol2+')')
if randomplaylist==True:
xbmc.executebuiltin('XBMC.PlayerControl(Next)')
xbmc.sleep(5000)
else:
xbmc.sleep(2000)
Look if this (me) is becoming too much of a distraction for you just say and I'll quit trying to do this. You most likely have far better things to do with your time. The only way I can see this getting resolved is if someone else goes through the process of creating a small playlist and trying to do it; then writing down all the steps they went through
Posts: 6,339
Joined: Jul 2010
Reputation:
116
artrafael
Team-XBMC Forum Moderator
Posts: 6,339
Are you sure your playlist path (location) is correct and that the playlist itself is valid? Music > Playlists > playlist.m3u > do you see songs listed and can you play them (with sound)?
Posts: 226
Joined: Apr 2011
Reputation:
0
pan2
Senior Member
Posts: 226
2013-04-05, 12:15
(This post was last modified: 2013-04-05, 12:20 by pan2.)
Yep, checked the playlist.m3u with VLC Player, also checked it's path. Then rechecked the autoexe.py as per your script which was just a copy and paste.
Then made sure of the location of the autoexe.py script:
C:\Users\Pan2\AppData\Roaming\XBMC\userdata