コード例 #1
0
 def play_index(self, index):
     """
     Play the track with the specified playlist index
     """
     Sound.stop()
     self.playlist.current = index
     self.play_pause()
コード例 #2
0
ファイル: controller.py プロジェクト: visued/kivybits
 def play_index(self, index):
     """
     Play the track with the specified playlist index
     """
     Sound.stop()
     self.playlist.current = index
     self.play_pause()
コード例 #3
0
 def play_pause(self):
     """ Play or pause the currently playing track """
     self.advance = True
     if Sound.state == "playing":
         self.pos, x = Sound.get_pos_length()
         Sound.stop()
     else:
         audio_file = self.get_current_file()
         if audio_file:
             Sound.play(audio_file, self.volume)
             if self.pos > 0:
                 def set_pos(dt):
                     Sound.seek(self.pos)
                     self.pos = 0
                 Clock.schedule_once(set_pos, 0.1)
コード例 #4
0
ファイル: controller.py プロジェクト: visued/kivybits
    def play_pause(self):
        """ Play or pause the currently playing track """
        self.advance = True
        if Sound.state == "playing":
            self.pos, x = Sound.get_pos_length()
            Sound.stop()
        else:
            audio_file = self.get_current_file()
            if audio_file:
                Sound.play(audio_file, self.volume)
                if self.pos > 0:

                    def set_pos(dt):
                        Sound.seek(self.pos)
                        self.pos = 0

                    Clock.schedule_once(set_pos, 0.1)
コード例 #5
0
 def stop(self):
     """ Stop any playing audio """
     self.advance = False
     Sound.stop()
コード例 #6
0
 def play_previous(self):
     """ Play the previous track in the playlist. """
     Sound.stop()
     self.playlist.move_previous()
     self.play_pause()
コード例 #7
0
    def play_next(self):
        """ Play the next track in the playlist. """

        Sound.stop()
        self.playlist.move_next()
        self.play_pause()
コード例 #8
0
ファイル: controller.py プロジェクト: visued/kivybits
 def stop(self):
     """ Stop any playing audio """
     self.advance = False
     Sound.stop()
コード例 #9
0
ファイル: controller.py プロジェクト: visued/kivybits
 def play_previous(self):
     """ Play the previous track in the playlist. """
     Sound.stop()
     self.playlist.move_previous()
     self.play_pause()
コード例 #10
0
ファイル: controller.py プロジェクト: visued/kivybits
    def play_next(self):
        """ Play the next track in the playlist. """

        Sound.stop()
        self.playlist.move_next()
        self.play_pause()