automatic playlist startup

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
NizZ8
Unregistered

Post: #11
q for you guys, what would be the best way to impliment the following:

1) play a startup intro song
2) when that file is done playing -> load playlist
--
3) shuffle playlist
4) play a song from the playlist

so parts 3-4 are taken care of already using this script.. i wasn't sure how to impliment steps 1 and 2..

i tried the wait() function for the lenght of the startup file, but couldn't get it to work.

any ideas?

thanks!
-n8
quote
NizZ8
Unregistered

Post: #12
i figured it out.. i flipped around the code and now it works great!

Quote:import xbmc

# by alx5962
# version 1.0

pls = xbmc.playlist(0)                                      ##0 should be music playlist and 2 should be video playlist... not tested      
pls.load("q:\\albums\\playlists\\startup.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
file = 'q:\\scripts\\startup.mp3'
xbmc.player().play(file)

so now my truck on startup:
1) plays the startup.mp3 file
2) loads the playlist
3) shuffles
4) plays a song

cool beans!
quote
Kudos Offline
Junior Member
Posts: 4
Joined: May 2004
Reputation: 0
Post: #13
i was trying to mod the original script also, glad to see you pulled it off, saves me some time Big Grin

/kudos
find quote
kazor Offline
Junior Member
Posts: 1
Joined: Jun 2004
Reputation: 0
Smile    Post: #14
make your xbox auto-powerup !

regarding the auto startup scripts i have put the same
scripts in my xbox with the purpose to startup & start
playing mp3's in my car. (stuff screwin with the menus
everytime you start the car)

thanks guys for the script tips, mine now works great
too now i worked out the python code.

i run my xbox on a 300w peak pure sine wave inverter
(it draws about 6amps at 12v). its from jaycar in
australia and has no fan so it's sealed , quiet and doesn't
seem to get warm either although put it in a place that
the heatsink can get some sort of convection.

but to get to the main point regarding the auto-poweron, if
you connect a 33uf electrolytic capacitor across the power
button on the front of the xbox the characteristic of the
capacitor simulates a power button push nicely.

just make sure you check the polarity on the button
with a multi meter even though it's unlikely to damage the
capacitor at 3.3 odd volts, it'll save you having future
problems scredded paper style...Tongue.

if you then put a push button in parallel with the capacitor
as well (assuming you run a wire to the an accessable
location in the car) you can also re-power should the xbox
crash.

hope this helps, thanks guys for xbmc - awesome effort !

cheers kazor
find quote
NizZ8
Unregistered

Post: #15
(kudos @ may 25 2004,16:06 Wrote:i was trying to mod the original script also, glad to see you pulled it off, saves me some time Big Grin

/kudos
happy to help out!

kazor:
cool stuff! i currently just power my xbox on using the xir kit (dvd remote) that greengiant sells. i pull my xbox out of my truck on a regular basis, and wanted to keep the connections between my xbox-> truck (video/power/controllers etc..) to a minimum.
quote
j0ly Offline
Junior Member
Posts: 5
Joined: Jan 2004
Reputation: 0
Post: #16
awesome, this works great for the needs i have in my nightclub, but now i want to do something a little differnt, basically heres what im looking for:

i have a network within the club, with a server in my office that serves 1 xbox videos for display on the tv, now my dj's dont show up to begin playing music till around 9:30pm at night, and the club opens at 7.

i have a ton of mp3s that we did from taking all of our music and encoding (our club has actually been checked numerous times for legal music (not burned), so to be legit we encoded all our music) what i want to do is simplify everything, so im going to put another xbox in the dj both and run the audio ports into my mixer, basically i want it this xbox to do is check the system date, and play a playlist according to that.

so lemme give you an example:

its wednessday night, our hiphop urban night, i come in, turn everything on, turn on the xbox and the system boots in to mediacenter, runs a autoexec script, that run another script that checks the system time, if day = wednessday it loads wednessday.plu, randomizes it, begins playing it and switches to visuals.

thursday, friday and saturday would be the same, but obviously the script would reconize a different day of the week and switch to load a different script (thursday: rock, friday: country and top40, saturday: everything)

possible?
find quote
Alexpoet Offline
Skilled Python Coder
Posts: 172
Joined: Jun 2004
Reputation: 0
Location: Oklahoma City, OK
Post: #17
j0ly, i'm pretty sure this will do basically what you need. it could take some degree of modification, but it should get the first three letters of the day of the week from the xbox, and then play a playlist by the name of those three letters (like "wed.m3u" on wednesday).

Quote:import time, xbmc

day = time.ctime()[:3] # all values are the first three letters of the day: sun, mon, tue, wed, thu, fri, sat
pls = xbmc.playlist(0) ## 0 should be music playlist and 2 should be video playlist... not tested      

pls.load(day + ".m3u") ## load non xbmc playlist into xbmc's playlist  m3u and pls work
# remember to add a path as necessary; it can be local: pls.load("q:/music/" + day + ".m3u"),
# or smb network share: pls.load("smb://user:password@/" + day + ".m3u")

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

obviously, it's a modification of the same sort of playlist code earlier in this post. you would use the exact same autoexec script.

i don't have access to an xbox right now, so i can't guarantee time.ctime() will return the same information reliably on the xbox, but it should. i'll double-check that as soon as i get home.

For scripts, script development tools, and documentation, visit my website:
http://www.maskedfox.com/xbmc/
find quote
pluto Offline
Junior Member
Posts: 2
Joined: Jul 2004
Reputation: 0
Post: #18
someone knows after run the script how switches to visuals, or hide the information bar from home
find quote
mich24 Offline
Junior Member
Posts: 7
Joined: Jul 2004
Reputation: 0
Post: #19
hi!

does someone know how to randomly pick one of the playlists, without writing all of them
(i have a few hundreds, one for each album, so using the dic={1:"playlist1.m3u",2:"playlist2.pls",3:"playlist3.m3u"} is not possible)

thanks for any idea!

(actually the best (for me) would be to automaticly open a folder randomly choosen and read all the mp3 inside)
find quote
jcee Offline
Member
Posts: 61
Joined: Oct 2003
Reputation: 0
Post: #20
hi everybody.

want to share my experience and i do have a question in the end ;-)

auto-powerup:

i placed my xbox in the trunk of my car, replaced one controller port with a usb port and the installed the controller port in the dashboard. there i plugged-in the dvd-remote-ir-thing. the connection from trunk to dashboard is donw via a common usb extension cable :-)

i utilized a 150w 12/230 inverter which normally has got a switch to swich on/offf. i replaced this switch with a relay which is driven by the "remote signal" of the headunit. means when the headunit is switched on, the inverter starts working.

then the following mechanical arc / spring on the front power button of the xbox and sticked it with some glue.

-----------bbbbb -------------
xxx zzz xxx
x zzz x
xxxxxxxxxx
this spring (z) pushes the power button (b) all the time. actually this means when the inverters powers on the xbox starts working. if decide to power-off and repower the xbox i can just pull against the spring for a moment, so the power button is released.


works perfectly for about 7 month. :-)

after reading all this about the auto startup script i wonder if it possible to have resume and restart option.
i have not looked at the forum for a while. something new on this?
i do not have playlists.. :-(
find quote