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:
then i have a autoplay.py that looks like this
file = 'q:\\albums\\playlists\\playlist.m3u'
pls = xbmc.playlist(0)
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.
Playlist script with choices
Joined: May 2004
2005-01-25 19:44 Post: #1
Joined: May 2004
2005-01-28 06:17 Post: #2
bump. i have everything working except for the part where if there is no input the default choice is made automatically. here is what it looks like. someone, please, help me finish this baby off.
import os, xbmc, xbmcgui
try: emulating = xbmcgui.emulating
except: emulating = false
#get actioncodes from keymap.xml
action_previous_menu = 10
if emulating: xbmcgui.window.(self)
# make the list
self.list = xbmcgui.controllist(290, 300, 150, 150)
#define playlist directory here
path = 'c:\\albums\\playlists\\'
list = os.listdir(path)
intcount = len(list)
for a in list :
def onaction(self, action):
if action == action_previous_menu:
def oncontrol(self, control):
if control == self.list:
item = self.list.getselecteditem()
path1 = 'c:\\albums\\playlists\\'
mydisplay = myclass()