2004-07-05, 06:42
i'm trying to play a playlist and start the visualizer automatically at startup. (my 2-year-old and the dog both like to fiddle with/chew on controllers, so i need to avoid bringing them out if possible.) i'm using autoexec.py to execute two sub-scripts.
problem is, the scripts seem to execute about half the time. sometimes the playlist starts, sometimes it won't. if i wait a minute and go to the scripts menu, i can start the playlist player and show visualizer scripts individually, and then autoexec.py usually works, but it rarely does at startup.
the files in the playlist are on a samba share. could that be part of the problem?
here's the listing for autoexec.py:
play_playlist.py:
show_visualizer.py:
i'm using the 06-29-04 xbmc release (v 1.0).
suggestions? i'll be able to use xbmc twice as often if all i have to do is hit the power switch.
problem is, the scripts seem to execute about half the time. sometimes the playlist starts, sometimes it won't. if i wait a minute and go to the scripts menu, i can start the playlist player and show visualizer scripts individually, and then autoexec.py usually works, but it rarely does at startup.
the files in the playlist are on a samba share. could that be part of the problem?
here's the listing for autoexec.py:
Quote:#execute targeted script at startup.
import xbmc
xbmc.executescript('e:\\applications\\xbmc\\scripts\\play_playlist.py')
xbmc.executescript('e:\\applications\\xbmc\\scripts\\show_visualizer.py')
play_playlist.py:
Quote:import xbmc, xbmcgui
#load playlist from file.
playlist = xbmc.playlist(0)
playlist.load('e:\\applications\\xbmc\\albums\\playlists\\5 star electronic music.m3u')
#shuffle playlist.
playlist.shuffle()
#play playlist.
xbmc.player().play(playlist)
show_visualizer.py:
Quote:import xbmc, xbmcgui
#window ids are from key.h in xbmc source.
window_invalid = 9999
window_home = 10000
#snip
window_visualisation = 12006
#snip
window = xbmcgui.window(window_visualisation)
window.show()
i'm using the 06-29-04 xbmc release (v 1.0).
suggestions? i'll be able to use xbmc twice as often if all i have to do is hit the power switch.