automatic playlist startup
#31
(scarecrow420 @ oct. 22 2004,20:56 Wrote:hey guys ive written a script for car setups that starts playing as soon as the xbox comes on, and it has resume support, ie it remembers what song you last played and will load it up again next time you turn on the xbox.

it also creates a playlist of all the other files in the same directory as the resumed song

and failing being able to do that it will load a specified default playlist.


what i need to do to finish it off is to automatically switch to visuals when the playing starts... but i just cant see a way to do it!  is there a way even to send keystrokes/button press messages to xbmc so i can send a display button command to it?

it's working very well in the car already, and this will just top it off if i can automate going to visuals too.

anyone have any ideas?
can i get a copy of your script also?
Reply
#32
is there a way to have this select a random web radio station if i give it a genre... such as "trance" and have it select a random trance station.
Reply
#33
hi guys, sorry i forgot all about this forum for a while there

i have this resume script almost complete... thanks for the tips on how to do visualisation screen darkie... i wasnt using any gui stuff in the script yet, but ill look at implementing that vis window and then ill release the script to everyone.  ive called it icxbmc (incar xbmc)

what im doing is, remembering the last song to play, and to start playing that automatically on startup... as well as creating a playlist of all other files in that song's directory, so there is something to continue playing once the "last song" finishes.  

ive also got it supporting a "last played file" across teh network, and creating the playlist in the same way as above, but by using the smb.py samba python module to get a directory listing of the file (since the builtin os.listdir() etc commands cant access the shares).  i then pass the samba qualified filename to xbmc to add to the playlist which it happily does.  the only thing is that to make the samba connection you appear to need the ip and hostname of the pc on your network, and you only get one of those from the filename of the playing file in xbmc.  so i need to somehow look up the other one.  or for the moment they are just variables that need to be set at the top of the script if you want that part to work

in all cases, if some error occurs, like a file not existing, then it will try to load a default playlist, specified in the script. it's working quite well in my mates car setup... the vis will be the icing on the cake!

anyway ill get working on showing the visualisation screen and then get back to you all Wink
pvr.wmc TV addon and ServerWMC Backend Development Team
http://bit.ly/ServerWMC
Reply
#34
pyske - to do that, you would need to be able to determine which ones are "trance" genre. either by reading the information in the /pls file for the shoutcast stream (if it's there), or even easier you could have all the trance stations in a "trance" folder which would make it much easier to code
pvr.wmc TV addon and ServerWMC Backend Development Team
http://bit.ly/ServerWMC
Reply
#35
well that didnt take long hehehehe... all of 30 minutes.  thanks darkie for showing how to make the visualisations start automatically!!!

ive completed the script to a point where i can release it for everyone else to use.  ive tested this on the latest 15/11 build and it works for me.


ive also tried to comment the code quite a lot, to help any budding scripters out there see what's being done.  i hope some people can take this as a base and modify it further

particularly i kind of just leave it looping at the end... would be nice to have it tidy itself up a bit more, although it doesnt seem to cause any problems, given a car setup is going on and off a fair bit anyway.


anyway without any further ado, you can get icxbmc version 0.9 here: http://members.iinet.net.au/~scarecrow420/icxbmc.zip

make sure you read the readme.txt for installation details and dont forget to set the variables in the top of the script for your setup
pvr.wmc TV addon and ServerWMC Backend Development Team
http://bit.ly/ServerWMC
Reply
#36
can any of you guys help me be a little more efficient.

currently i have autoexec1.py (for smb shared songs) and autoexec2.py (for local songs, for when away from network).
normally auto1 is just autoexec.py, and when i away from network i change them around.

can anyone make a script to attempt to load a smb, then if timeout then load the local playlist?

thanks guys.
Reply
#37
try this :
Quote:import xbmc

pls = xbmc.playlist(0)                                       ##0 should be music playlist and 2 should be video playlist... not tested
try:
   pls.load("smb://user:password@/idm/test.m3u")
except:
   pls.load("q:\\playlist\\test.m3u")   ## always put twice \ for each dirs

pls.shuffle()                                                   ## delete this line if you don't want random songs to be played from your given playlist
xbmc.player().play(pls)                                    ## play the playlist

don't forget to change the path of both of your playlists
Reply
#38
scarecrow's script is not working for me =(.  i've tried everything..here's a cut and paste of the autoexec.py.  it's located in /f:/apps/xbmc/scripts/


import xbmc

xbmc.executescript('q:\\scripts\\icxbmc\\icxbmc.py')

+++++++++++++++++
icxbmc.py  is located in /f:/apps/xbmc/scripts/icxbmc/

settings_file = "q:\\lastplayed.txt"

default_playlist = "f:\\music\\trance\\playlist.m3u"

i tried loading the script manually but it's still not working.  what am i doing wrong??please helppppppppp
Reply
#39
there's a fair oamount of debug output statements in it... you can check what the problem is by looking at the python script output. normally you press the white button from the scripts screen, but as of the latest build the white button doesnt work anymore! im not sure there is a way to get to the script output view until they fix it

or you could try a previous version of xbmc

the only thing im thinking is that in your xboxmediacentre.xml file if you havent already, set the <home> tag at the top to point to xbmc's location eg: <home>f:\apps\xbmc\</home>

this probably wouldnt fix it though... but maybe if there's a problem with it not knowing where q drive is or something. you could try changing the q:\ paths, to the fully qualified f:\ locations maybe

but until you can get to the white button screen, i cant help much!

sorry
pvr.wmc TV addon and ServerWMC Backend Development Team
http://bit.ly/ServerWMC
Reply
#40
(scarecrow420 @ nov. 26 2004,08:16 Wrote:there's a fair oamount of debug output statements in it... you can check what the problem is by looking at the python script output.  normally you press the white button from the scripts screen, but as of the latest build the white button doesnt work anymore!  im not sure there is a way to get to the script output view until they fix it

or you could try a previous version of xbmc

the only thing im thinking is that in your xboxmediacentre.xml file if you havent already, set the <home> tag at the top to point to xbmc's location eg: <home>f:\apps\xbmc\</home>

this probably wouldnt fix it though... but maybe if there's a problem with it not knowing where q drive is or something.  you could try changing the q:\ paths, to the fully qualified f:\ locations maybe

but until you can get to the white button screen, i cant help much!

sorry
i've changed the tag to "<home>f:\apps\xbmc\</home>"
and q:\ paths, to the fully qualified f:\ locations

still no lucky with the changes....i guess i'll have to try the previous versions of xbmc
Reply
#41
doh!!!.. i totally missed this thread while it was hot.. does anyone have scarecrow420's script that was linked above?... i can't seem to find it anywhere... tia
Reply
#42
i too, would very very much like a copy of scarecrow's script, it isn't online anymore
Reply

Logout Mark Read Team Forum Stats Members Help
automatic playlist startup0