def get_current_song(self):
     '''Returns the current song in the correct format'''
     if self.is_playing():
         song = self.iface.get_dbus_method(
             "GetMetadata", dbus_interface='org.freedesktop.MediaPlayer')()
         return songretriever.Song(song.get('artist', "?"),
                                   song.get('album', "?"),
                                   song.get('title', "?"))
    def get_current_song(self):
        '''Returns the current song in the correct format'''
        if self.is_playing():
            uri = self.iface.getPlayingUri()
            song = self.rbshell.getSongProperties(uri)

            return songretriever.Song(song['artist'], song['album'],
                                      song['title'])
예제 #3
0
 def get_current_song(self):
     '''Returns the current song in the correct format'''
     if self.is_playing():
         song_position = self.iface.Position()
         artist = self.iface.SongTuple(song_position, "artist")
         album = self.iface.SongTuple(song_position, "album")
         title = self.iface.SongTuple(song_position, "title")
         return songretriever.Song(artist, album, title)
예제 #4
0
    def get_current_song(self):
        '''returns the current song or None if no song is playing'''
        command = "mocp -Q '%artist;%album;%song;%file' 2>/dev/null"
        output = commands.getoutput(command).split(';')
        if not self.is_running() or not self.is_playing():
            return None

        return songretriever.Song(output[0], output[1], 
                                  output[2], output[3])
예제 #5
0
 def get_current_song(self):
     '''Returns the current song in the correct format'''
     if self.is_playing():
         metadata_dict = self.dbuspropiface.Get(
             "org.mpris.MediaPlayer2.Player", "Metadata")
         return songretriever.Song(
             metadata_dict.get(self.module.String(u'xesam:artist'))[0],
             metadata_dict.get(self.module.String(u'xesam:album')),
             metadata_dict.get(self.module.String(u'xesam:title')))
예제 #6
0
    def get_current_song(self):
        '''Returns the current song in the correct format'''
        if self.is_playing():
            info = self.iface.GetCurrentTrack()
            return songretriever.Song(info.get('artist', '?'),
                info.get('album', '?'),
                info.get('name', '?'))

        return None
예제 #7
0
 def get_current_song(self):
     '''Returns the current song in the correct format'''
     if self.is_playing():
         track = self.iface.GetCurrentTrack()
         song = self.iface.GetMetadata(track)
         return songretriever.Song(song['artist'],
                                   song['album'],
                                   song['title'],
                                   song['location'])
 def get_current_song(self):
     '''Returns the current song in the correct format'''
     if self.is_playing():
         getartist = """osascript -e 'tell application "iTunes" to artist of current track' 2>/dev/null"""
         artist = commands.getoutput(getartist)
         getalbum = """osascript -e 'tell application "iTunes" to album of current track' 2>/dev/null"""
         album = commands.getoutput(getalbum)
         gettitle = """osascript -e 'tell application "iTunes" to name of current track' 2>/dev/null"""
         title = commands.getoutput(gettitle)
         return songretriever.Song(artist, album, title)
예제 #9
0
    def get_current_song(self):
        '''returns the current song or None if no song is playing'''
        if not self.is_running() or not self.is_playing():
            return None

        info = self.client.currentsong()

        return songretriever.Song(info.get('artist', '?'),
                                  info.get('album',
                                           '?'), info.get('title', '?'),
                                  info.get('file', '?'))
예제 #10
0
 def get_current_song(self):
     '''Returns the current song in the correct format'''
     if self.is_playing():
         artist = self.iface.GetTrackAttr('artist')
         if artist == None:
             artist = ""
         album = self.iface.GetTrackAttr('album')
         if album == None:
             album = ""
         title = self.iface.GetTrackAttr('title')
         if title == None:
             title = ""
         return songretriever.Song(artist, album, title)
예제 #11
0
    def get_current_song(self):
        '''returns the current song or None if no song is playing'''
        if not self.is_running() or not self.is_playing():
            return None

        element = self.track.getElementsByTagName('artist')
        artist = element[0].childNodes[0].nodeValue
        element = self.track.getElementsByTagName('album')
        album = element[0].childNodes[0].nodeValue
        element = self.track.getElementsByTagName('name')
        title = element[0].childNodes[0].nodeValue

        return songretriever.Song(artist, album, title)
예제 #12
0
    def get_current_song(self):
        '''returns the current song or None if no song is playing'''
        if not self.is_running() or not self.is_playing():
            return None

        result = self.client.playback_current_id()
        result.wait()
        if result.iserror():
            return None
        id_song = result.value()

        result = self.client.medialib_get_info(id_song)
        result.wait()
        if result.iserror():
            return None
        info = result.value()

        return songretriever.Song(info["artist"], info["album"], info["title"])