diff vixm/player.py @ 42:bc6db55448e1 pure

statistics engine
author Josef "Jeff" Sipek <jeffpc@josefsipek.net>
date Sun, 05 Nov 2006 19:25:30 -0500
parents 06b5a7db3d19
children d3ac3a46a294
line wrap: on
line diff
--- a/vixm/player.py	Sun Nov 05 02:43:57 2006 -0500
+++ b/vixm/player.py	Sun Nov 05 19:25:30 2006 -0500
@@ -3,7 +3,7 @@
 
 import mad, ao
 
-import playlist
+import playlist, stats
 
 class playerThread(Thread):
 	def __init__(self):
@@ -18,6 +18,8 @@
 		self.blksize  = 40960
 		self.dev      = ao.AudioDevice("oss")
 
+		self.stats    = stats.statsengine("stats")
+
 	def play_next(self, lists):
 		try:
 			# pop song off the PRIO queue
@@ -37,6 +39,7 @@
 
 		self.playing = True
 		self.current = s
+		self.stats.current = s
 
 	def run(self):
 		while not self.shutdown:
@@ -55,6 +58,7 @@
 				if self.end_current:
 					self.end_current = False
 				else:
+					self.stats.played()
 					self.playing = False
 			else:
 				# nothing to play, just sleep