def PlaybackStatus(self): if PLAYER.is_playing(): return 'Playing' elif PLAYER.is_paused(): return 'Paused' else: return 'Stopped'
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
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()
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()