Ejemplo n.º 1
0
 def PlaybackStatus(self):
     if PLAYER.is_playing():
         return 'Playing'
     elif PLAYER.is_paused():
         return 'Paused'
     else:
         return 'Stopped'
Ejemplo n.º 2
0
def _delete_event(window, event, exaile):
    """ window behavior on closing, according to sound menu spec:
        https://wiki.ubuntu.com/SoundMenu
        """
    if PLAYER.is_playing():
        window.hide()
    else:
        exaile.gui.main.quit()
    return True
Ejemplo n.º 3
0
    def __init__(self):
        self.inhibited = False
        self.lock = _thread.allocate_lock()

        # Initialize parent object
        super().__init__(PLAYER)

        # Inhibit if player currently playing
        if PLAYER.is_playing():
            self.inhibit()
Ejemplo n.º 4
0
    def __init__(self, bus_name, object_path, interface):
        try:
            bus = dbus.SessionBus()
            obj =  bus.get_object(bus_name, object_path)
            self.iface = dbus.Interface(obj, interface)
            logger.info('Suspend Bus Acquired')
        except dbus.DBusException:
            raise EnvironmentError(bus_name + ' bus not available')

        self.inhibited = False
        self.lock = _thread.allocate_lock()

        # Initialize parent object
        adapters.PlaybackAdapter.__init__(self, PLAYER)

        # Inhibit if player currently playing
        if PLAYER.is_playing():
            self.inhibit()
Ejemplo n.º 5
0
    def __init__(self, bus_name, object_path, interface):
        try:
            bus = dbus.SessionBus()
            obj = bus.get_object(bus_name, object_path)
            self.iface = dbus.Interface(obj, interface)
            logger.info('Suspend Bus Acquired')
        except dbus.DBusException:
            raise EnvironmentError(bus_name + ' bus not available')

        self.inhibited = False
        self.lock = _thread.allocate_lock()

        # Initialize parent object
        adapters.PlaybackAdapter.__init__(self, PLAYER)

        # Inhibit if player currently playing
        if PLAYER.is_playing():
            self.inhibit()