1
# This file is part of emesene.
3
# Emesene is free software; you can redistribute it and/or modify
4
# it under the terms of the GNU General Public License as published by
5
# the Free Software Foundation; either version 2 of the License, or
6
# (at your option) any later version.
8
# emesene is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
# GNU General Public License for more details.
13
# You should have received a copy of the GNU General Public License
14
# along with emesene; if not, write to the Free Software
15
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17
# Original version by Quentin Sculo
18
# http://squentin.free.fr/gmusicbrowser/dokuwiki/doku.php?id=third_party_apps:emesene
21
IFACE_NAME = 'org.gmusicbrowser'
22
IFACE_PATH = '/org/gmusicbrowser'
26
class Gmusicbrowser ( CurrentSong.DbusBase ):
27
'''Gmusicbrowser Interface'''
30
CurrentSong.DbusBase.__init__( self, IFACE_NAME, self.setInterface )
33
except: self.iface = None
35
def setInterface( self ):
36
self.iface = self.bus.get_object( IFACE_NAME, IFACE_PATH )
40
return bool( self.iface.Playing() )
44
if not self.isRunning():
47
info = { 'title':'', 'album':'', 'artist':'' }
50
info = dict(self.iface.CurrentSong())
52
if info['title'] != self.title or info['album'] != self.album or info['artist'] != self.artist:
53
self.title = info['title']
54
self.album = info['album']
55
self.artist = info['artist']
59
def getCoverPath( self ):
60
if self.isRunning() and len(self.album) > 0:
61
return self.iface.GetAlbumCover(self.album)