Esempio n. 1
0
 def on_playback_toggle_pause(self, event_type, player, track):
     """
         Starts or stops update timer
     """
     if player.is_playing():
         self.__enable_timer()
     elif player.is_paused():
         self.__disable_timer()
Esempio n. 2
0
 def __init__(self, player):
     Playlist.__init__( self, _('History') )
     
     # catch the history
     event.add_ui_callback( self.__on_playback_track_start, 'playback_track_start', player )
     
     if player.is_paused() or player.is_playing():
         self.__on_playback_track_start( 'playback_track_start', player, player.current )
Esempio n. 3
0
 def on_playback_toggle_pause(self, event_type, player, track):
     """
         Starts or stops update timer
     """
     if player.is_playing():
         self.__enable_timer()
     elif player.is_paused():
         self.__disable_timer()
Esempio n. 4
0
 def __init__(self, player):
     Playlist.__init__( self, _('History') )
     
     # catch the history
     event.add_ui_callback( self.__on_playback_track_start, 'playback_track_start', player )
     
     if player.is_paused() or player.is_playing():
         self.__on_playback_track_start( 'playback_track_start', player, player.current )
Esempio n. 5
0
 def factory(name, after, player):
     if player.is_playing():
         icon_name = 'media-playback-pause'
         label = _("_Pause")
     else:
         icon_name = 'media-playback-start'
         label = _("P_lay")
     return menu.simple_menu_item(name, after, label, icon_name,
         callback=lambda *args: playpause(player) )
Esempio n. 6
0
 def factory(name, after, player):
     if player.is_playing():
         icon_name = 'media-playback-pause'
         label = _("_Pause")
     else:
         icon_name = 'media-playback-start'
         label = _("P_lay")
     return menu.simple_menu_item(
         name, after, label, icon_name, callback=lambda *args: playpause(player)
     )
Esempio n. 7
0
    def factory(menu, parent, context):
        if player.is_playing():
            stock_id = gtk.STOCK_MEDIA_PAUSE
        else:
            stock_id = gtk.STOCK_MEDIA_PLAY

        item = gtk.ImageMenuItem(stock_id)
        item.connect('activate', lambda *args: playpause( player ), name, parent, context)

        return item
Esempio n. 8
0
    def on_playback_toggle_pause(self, e, player, track):
        """
            Shows the OSD after resuming playback
        """
        if not player.is_playing(): return

        glib.idle_add(self.show)

        try:
            glib.source_remove(self.get_data('hide-id'))
        except:
            pass

        if self.props.autohide:
            self.set_data('hide-id', glib.timeout_add_seconds(
                self.__options['display_duration'], self.hide))
Esempio n. 9
0
    def on_playback_toggle_pause(self, e, player, track):
        """
            Shows the OSD after resuming playback
        """
        if not player.is_playing(): return

        GLib.idle_add(self.show)

        try:
            GLib.source_remove(self.hide_id)
        except Exception:
            pass
        finally:
            self.hide_id = None

        if self.props.autohide:
            self.hide_id = GLib.timeout_add_seconds(
                self.__options['display_duration'], self.hide)
Esempio n. 10
0
    def on_playback_toggle_pause(self, e, player, track):
        """
            Shows the OSD after resuming playback
        """
        if not player.is_playing(): return

        GLib.idle_add(self.show)

        try:
            GLib.source_remove(self.hide_id)
        except Exception:
            pass
        finally:
            self.hide_id = None

        if self.props.autohide:
            self.hide_id = GLib.timeout_add_seconds(
                self.__options['display_duration'], self.hide)
Esempio n. 11
0
def on_pause_action(type, player, track):
    if player.is_playing():
        on_begin_action(type, player, track)
    else:
        on_stop_action(type, player, track)
Esempio n. 12
0
def on_pause_action(type, player, track):
    if player.is_playing():
        on_begin_action(type, player, track)
    else:
        on_stop_action(type, player, track)