Beispiel #1
0
 def emit_state_changed(self, type, player, object):
     """
         Called from main to emit signal
     """
     new_state = player.get_state()
     if self.cached_state != new_state:
         self.cached_state = new_state
         self.StateChanged()
Beispiel #2
0
 def emit_state_changed(self, type, player, object):
     """
         Called from main to emit signal
     """
     new_state = player.get_state()
     if self.cached_state != new_state:
         self.cached_state = new_state
         self.StateChanged()
Beispiel #3
0
 def PlayPause(self):
     player = xl.player.PLAYER
     state = player.get_state()
     if state in ('playing', 'paused'):
         player.toggle_pause()
     else:
         assert state == 'stopped'
         queue = xl.player.QUEUE
         queue.play(queue.get_current())
Beispiel #4
0
 def PlayPause(self):
     player = xl.player.PLAYER
     state = player.get_state()
     if state in ('playing', 'paused'):
         player.toggle_pause()
     else:
         assert state == 'stopped'
         queue = xl.player.QUEUE
         queue.play(queue.get_current())
Beispiel #5
0
 def Play(self):
     player = xl.player.PLAYER
     state = player.get_state()
     if state == 'paused':
         player.unpause()
     elif state == 'stopped':
         queue = xl.player.QUEUE
         queue.play(queue.get_current())
     else:
         assert state == 'playing'  # Don't need to do anything
Beispiel #6
0
 def Play(self):
     player = xl.player.PLAYER
     state = player.get_state()
     if state == 'paused':
         player.unpause()
     elif state == 'stopped':
         queue = xl.player.QUEUE
         queue.play(queue.get_current())
     else:
         assert state == 'playing'  # Don't need to do anything
Beispiel #7
0
def playpause(player):
    if player.get_state() in ('playing', 'paused'):
        player.toggle_pause()
    else:
        from xlgui import main
        page = main.get_selected_playlist()
        if page:
            pl = page.playlist
            if len(pl) == 0:
                return
            try:
                idx = page.view.get_selected_paths()[0][0]
            except IndexError:
                idx = 0
            player.queue.set_current_playlist(pl)
            pl.current_position = idx
            player.queue.play(track=pl.current)
Beispiel #8
0
def playpause(player):
    if player.get_state() in ('playing', 'paused'):
        player.toggle_pause()
    else:
        from xlgui import main
        page = main.get_selected_playlist()
        if page:
            pl = page.playlist
            if len(pl) == 0:
                return
            try:
                idx = page.view.get_selected_paths()[0][0]
            except IndexError:
                idx = 0
            player.queue.set_current_playlist(pl)
            pl.current_position = idx
            player.queue.play(track=pl.current)