示例#1
0
class MainPlayer:
    library = None
    player = None
    
    def __init__(self):        
        ' Set the frequency of the player '
        self.library = Library()
        self.library.scan()        
        ' Start the player '
        self.player = FMPlayer()
        
    def play(self):
        ' Check if there were any votes on the site... '
        if self.library.hasVotes():
            ' Play the next top voted song... '
            self.player.play(self.library.getTopVoted())
            self.play()            
        else:
            ' ... else just play some random song... '
            self.player.play(self.library.getRandomSong())
            self.play()
示例#2
0
class MainPlayer:
    library = None
    player = None

    def __init__(self):
        ' Set the frequency of the player '
        self.library = Library()
        self.library.scan()
        ' Start the player '
        self.player = FMPlayer()

    def play(self):
        ' Check if there were any votes on the site... '
        if self.library.hasVotes():
            ' Play the next top voted song... '
            self.player.play(self.library.getTopVoted())
            self.play()
        else:
            ' ... else just play some random song... '
            self.player.play(self.library.getRandomSong())
            self.play()
示例#3
0
 def __init__(self):        
     ' Set the frequency of the player '
     self.library = Library()
     self.library.scan()        
     ' Start the player '
     self.player = FMPlayer()
示例#4
0
 def __init__(self):
     ' Set the frequency of the player '
     self.library = Library()
     self.library.scan()
     ' Start the player '
     self.player = FMPlayer()