~ubuntu-branches/ubuntu/oneiric/emesene/oneiric

« back to all changes in this revision

Viewing changes to emesene/plugins/music/handler_guayadeque.py

  • Committer: Bazaar Package Importer
  • Author(s): Devid Antonio Filoni
  • Date: 2011-03-19 13:47:22 UTC
  • mfrom: (1.1.10 upstream) (5.2.9 sid)
  • Revision ID: james.westby@ubuntu.com-20110319134722-5yjs8aa0xbcbze37
Tags: 2.0~git20110319+dfsg-1
* Set myself as maintainer.
* New upstream git revision, tarball generated removing non-free dlls dir.
* Remove debian/watch, debian/emesene.xpm, debian/install files.
* Update debian/README.source file.
* Remove 21_svn2451_fix_avatar and 20_dont_build_own_libmimic patches.
* debian/control: modify python to python (>= 2.5) in Build-Depends field.
* debian/control: remove python-libmimic from Recommends field.
* debian/control: modify python-gtk2 (>= 2.10) to python-gtk2 (>= 2.12) in
  Depends field.
* debian/control: add python-appindicator and python-xmpp to Recommends
  field.
* debian/control: add python-papyon (>= 0.5.4) and python-webkit to Depends
  field.
* debian/control: update Description field.
* debian/control: add python-setuptools to Build-Depends field.
* debian/control: move python-dbus and python-notify to Depends field.
* Update debian/copyright file.
* Update debian/links file.
* debian/menu: update description field.
* Bump Standards-Version to 3.9.1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
import songretriever
2
 
import DBusBase
3
 
 
4
 
class GuayadequeHandler(DBusBase.DBusBase):
5
 
    '''Handler for guayadeque'''
6
 
    NAME = 'Guayadeque'
7
 
    DESCRIPTION = 'Music handler for guayadeque'
8
 
    AUTHOR = 'Mariano Guerra'
9
 
    WEBSITE = 'www.emesene.org'
10
 
 
11
 
    def __init__(self, main_window = None,
12
 
                 iface_name = 'org.mpris.guayadeque',
13
 
                 iface_path = '/Player'):
14
 
        DBusBase.DBusBase.__init__(self, main_window, iface_name, iface_path)
15
 
 
16
 
    def is_playing(self):
17
 
        '''Returns True if a song is being played'''
18
 
        if self.is_running():
19
 
            status = self.iface.get_dbus_method("GetStatus", 
20
 
                dbus_interface='org.freedesktop.MediaPlayer')()
21
 
            return status[0] == 0
22
 
        return False
23
 
 
24
 
    def get_current_song(self):
25
 
        '''Returns the current song in the correct format'''
26
 
        if self.is_playing():
27
 
            song = self.iface.get_dbus_method("GetMetadata",
28
 
                dbus_interface='org.freedesktop.MediaPlayer')()
29
 
            return songretriever.Song(song['artist'],
30
 
                                      song['album'],
31
 
                                      song['title'])
32
 
 
33