automatic playlist startup

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
MrT Offline
Junior Member
Posts: 45
Joined: Jan 2004
Reputation: 0
Location: Norway
Post: #21
does this work with the 1006 build?
i can't get it to work whatsooever.

iv copied the script from this tread (and modified it a bit). i put it in /f:/apps/xbmc/scripts/
and then run it manually.

the script looks like: (iv x'ed out the user/pw bit):

import xbmc
pls = xbmc.playlist(0)
pls.load("smb://xxx:xxx@10.0.0.2/mp3/test.m3u")
pls.shuffle()
xbmc.player().play(pls)

this does not work. noting happens when i start the script.

iv also tried :
pls.load("f://apps/xbmc/albums/playlists/test.m3u")
and
pls.load("q:\\albums\\playlists\\test.m3u")

(yes, i copied the .m3u file to those locations).
still nothing. is there a logfile i can check to see what goes wrong? or does anyone see the error?

I donated $40 to the XBMC project, and so should you.
find quote
MrT Offline
Junior Member
Posts: 45
Joined: Jan 2004
Reputation: 0
Location: Norway
Post: #22
forget the question above. i fucked around with the scripts and fixed it Smile

I donated $40 to the XBMC project, and so should you.
find quote
jmarshall Offline
Team-XBMC Developer
Posts: 24,523
Joined: Oct 2003
Reputation: 138
Post: #23
looks like whatever editor you're using is screwing the file up.

it just needs to be a plain text file. use notepad.

then rename it to .py and ftp across to your xbox.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
scarecrow420 Offline
Junior Member
Posts: 8
Joined: Oct 2004
Reputation: 0
Post: #24
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?
find quote
Threepwood Offline
Junior Member
Posts: 1
Joined: Oct 2004
Reputation: 0
Post: #25
i can't really help you with figuring out how to get it to startup visualizations, but would love a copy of your script. been preping to do a car install and have been looking for a script to start up where it last left off.
find quote
darkie Offline
Team-XBMC Developer
Posts: 529
Joined: Sep 2003
Reputation: 0
Post: #26
Quote: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?
search for the file key.h in xbmc cvs. in there you will find a window id for the visualization screen (for example 10345)
now in your script you have to create a new window that uses the visualization screen

Quote:viswindow = xbmcgui.window(10345)
now you have access to that specific window and you will be able to show / close it with
Quote:viswindow.show()

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
Dogo Offline
Junior Member
Posts: 34
Joined: Jun 2004
Reputation: 0
Post: #27
yes can you please post your script, even if not 100% complete and tested.
find quote
joe2000 Offline
Junior Member
Posts: 5
Joined: Dec 2003
Reputation: 0
Post: #28
thats exactly what i need for my car ! can yo post your script ? that would be great !
find quote
metalcoat Offline
Junior Member
Posts: 10
Joined: Nov 2004
Reputation: 0
Post: #29
i tried learning python but i think it may be a bit too complicated since all i want is to know if its possible to make a script play a random mp3 file instead of a playlist from a network share or the hd
find quote
XbcSharpShooter Offline
Junior Member
Posts: 19
Joined: Nov 2004
Reputation: 0
Post: #30
(xsintill @ mar. 21 2004,10:02 Wrote:or you can create the files yourself.. they are normal textfiles but with a .py extension. they should be put in the scripts directory in xbmc's 'home' directory.

one file should be named autoexec.py
and have the following code in it:
Quote:import xbmc

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

and the other one should be named autoplay.py
and have the following code in it:
Quote:
import xbmc

pls = xbmc.playlist(0)                                       ##0 should be music playlist and 2 should be video playlist... not tested      
pls.load("smb://user:password@/idm/test.m3u")   ## load non xbmc playlist into xbmc's playlist  m3u and pls work
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
i did that exact thing, with the 11-16 build, and nothing happens. i looked in log and nothing. i go to scripts folder, and click on it in xbmc, and it flashes running for a second, nothing happens.
find quote