Package MeatEngine :: Package MoodMusic :: Module libraryPyGame
[hide private]
[frames] | no frames]

Source Code for Module MeatEngine.MoodMusic.libraryPyGame

 1  import pygame 
 2   
 3  RAPID_SPEED=15 
 4   
5 -class LibraryPyGame:
6 - def __init__(self):
7 self.rapid=True
8
9 - def isPlaying(self):
10 if not pygame.mixer.music.get_busy(): 11 return False 12 if self.rapid and pygame.mixer.music.get_pos()> 1000*RAPID_SPEED: 13 return False 14 return True
15
16 - def play(self, trackName):
17 pygame.mixer.music.load(trackName) 18 pygame.mixer.music.play()
19