Пример #1
0
def music_player():  #function defination
    mi.init()
    mu.set_volume(0.7)
    mu.load(random.choice(songs))
    print(
        "*******************************************************************")
    print("\t\tWELCOME TO MY MUSIC_PLAYER")
    print(
        "*******************************************************************")
    print("press 'a' to PLAY | press 'r' to RESUME | press 'n' for next song")
    print("press 's' to STOP | press 'p' to PAUSE")
    print(
        "--------------------------------------------------------------------\n"
    )
    while True:
        query = input("")
        if query == 'a':
            mu.play()
            print("Player Start!")
        elif query == 'r':
            mu.unpause()
            print("Song resume")
        elif query == 'p':
            print("song pause!")
            mu.pause()
        elif query == 'n':
            print("Listen next song!")
            mu.stop()
            time.sleep(1)
            mu.load(random.choice(songs))
            mu.play()
        elif query == 's':
            mu.stop()
            break
    print("Player get quit !")
Пример #2
0
 def play(self):
     if self.is_file_get:
         if self.song_ptr == -1:
             self.next_song()
         elif self.playing:
             mx.pause()
             self.playing = False
         elif not self.playing:
             mx.unpause()
             self.playing = True
     else:
         showinfo(title="Directory not found",
                  message='Directory is not set')
Пример #3
0
    def togglePlayPause(self, *args):

        if self.pauseBtn.isVisible():
            self.pauseBtn.setVisible(False)
            self.pauseBtn.setEnabled(False)
            self.contBtn.setVisible(True)
            self.contBtn.setEnabled(True)
            self.playSong.pauseTimeline()
            # self.playSong.runTime.connect(self.updateTimeline)
            print "Entered Pause"
            _mixer.pause()

        elif self.contBtn.isVisible():
            self.contBtn.setVisible(False)
            self.contBtn.setEnabled(False)
            self.pauseBtn.setVisible(True)
            self.pauseBtn.setEnabled(True)
            self.playSong.dePauseTimeline()
            # self.playSong.runTime.connect(self.updateTimeline)
            print "Entered Playing"
            _mixer.unpause()
Пример #4
0
def unpauseMusic():
    player.unpause()
Пример #5
0
 def unpause(self):
     mixer_music.unpause()