view vixm/ @ 46:2d570448aba5 pure

Abstract out the stats code a little bit more This is in preparation for moving the stats code completely out of player code
author Josef "Jeff" Sipek <>
date Mon, 06 Nov 2006 05:19:23 -0500
parents 2bf81d95246a
children 1ae315a49009
line wrap: on
line source

import time

import playlist, song, player
import ui as uimod

def run(listfn, statsfn):
	""" this is where we start execution """

	# first, let's create the two playlists
	print "Creating playlists..."
	lists = {}
	lists[playlist.LIST_PRIO]	= playlist.playlist()
	lists[playlist.LIST_DEFAULT]	= playlist.playlist(allowrandom=True)

	# read in the info for all the songs in XMMS's playlist
	print "Loading songs from XMMS's playlist..."
	songs = []
	idx = 0
	for l in open(listfn, "r").readlines():
		if l[0] == "#":

		s =[:-1], idx)

		idx += 1
	print "Instanciating player thread..."
	play = player.playerThread()

	print "Instanciating ui thread..."
	ui = uimod.uiThread(play, lists)

	while not play.shutdown:
		# check which song we are playing now
		if not play.playing:

		# sleep