xboxscene.org forums

Author Topic: Python Script Request - Playlist Choices  (Read 589 times)

Zeosstud

  • Archived User
  • Newbie
  • *
  • Posts: 42
Python Script Request - Playlist Choices
« on: January 25, 2005, 10:48:00 AM »

Thought this might be pretty easy for someone with alittle python skill.

Was hoping someone could write a script that would look out on the albums\playlists directory and get a list of .m3u files then offer me the chance to pick which one I want to listen to.  After its selected, the list would be shuffled and played.  It would be super if a default playlist would automatically run in case a key was not pressed, say within 5 seconds.

I have gotten scripts to run for me when xbmc starts up using an autoexec.py file that looks like this:

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

Then I have a autoplay.py that looks like this

file = 'q:\\albums\\playlists\\playlist.m3u'
pls = xbmc.PlayList(0)
pls.load(file)
pls.shuffle()
xbmc.Player().play(pls)

This is working perfectly on the 1-15-05 CVS build.  I guess I am just trying to get alittle fancy now.  The xbox that this will run on is in my car so making changes to my existing playlist is just alittle inconvient.  If a window would pop up with my list of playlists and let me choose one if I wanted to or just play whichever one is highlighted if I dont make a selection it would be awesome.

Zeosstud
Logged

j_guzzler

  • Archived User
  • Full Member
  • *
  • Posts: 191
Python Script Request - Playlist Choices
« Reply #1 on: January 25, 2005, 11:24:00 AM »

Just a simple question, why couldnt you just choose the playlist from the playlist section of My music?  Same thing you are asking for (if I am not mistaken) just one extra step, if you have .m3u's XBMC recognizes them and puts them into the playlist folder and you can access these by viewing playlist.
Logged

Zeosstud

  • Archived User
  • Newbie
  • *
  • Posts: 42
Python Script Request - Playlist Choices
« Reply #2 on: January 25, 2005, 09:55:00 PM »

Totally legit question.  The whole idea is to make it painfully easy for my wife actually.  The xbox is in the car hooked up to a couple of rear seat headrest monitor to keep the rug rats happy on trips of more than 5 minutes.  My wife however could also be using it to listen to her favorite music while trying to drown out the kids in the back seat.  She has a monitor built into the rearview mirror so she can make sure things are working for the kids, she could certainly grab the controller and goto my music, playlists, then pick one.  She would however have to actually DO something for that.  Believe it or not I am trying to make it so all she has to do is hit the power button, then she can drive, period.  I actually have that working well with the script thats installed now.  When I get in the car however, I dont really want to listen to country music, all the time.  A simply little menu that runs automatically would just be handy.

Zeosstud
Logged

ylsf

  • Archived User
  • Newbie
  • *
  • Posts: 42
Python Script Request - Playlist Choices
« Reply #3 on: January 26, 2005, 04:59:00 PM »

OT : Zeostud... Do you have any pictures of your setup?  Sounds interesting....
Logged