Browse the code

 

Differences between 234 and 235 on /.
Number of edited files: 1 (0 added, 0 deleted and 1 modified)
Revision 235

About 1 month and 1 day ago.

Fixed our basic MPRIS2.2 support
Added file(s) Deleted file(s) Modified file(s)

 

Old New Code
27
27
    from dbus.service import (Object as dbusobj, method as dbus_method,
28
28
                              signal as dbus_signal)
29
29
    from dbus.mainloop.glib import DBusGMainLoop
30
 
    from dbus.types import Int64 as dbus_int64, Dictionary as dbus_dict
 
30
    from dbus.types import (Int64 as dbus_int64, Dictionary as dbus_dict,
 
31
                            Array as dbus_array)
31
32
    import dbus.service as dbus_service
32
33

                                        
33
34
    OBJECT_NAME = 'org.mpris.MediaPlayer2.Bluemindo'
137
138
        def update_data(song):
138
139
            self.song = song
139
140
            self.playing = 'Playing'
140
 
            self.launch_dbus_signal(INTERFACE_P_NAME, ['PlaybackStatus',
141
 
                                                       'Metadata'])
 
141
            self.launch_dbus_signal(INTERFACE_P_NAME, {'PlaybackStatus':
 
142
                                                       self.playing,
 
143
                                                       'Metadata': 'Metadata'})
142
144

                                        
143
145
        def play_pressed():
144
146
            if self.playing == 'Playing':
148
150
            elif self.playing == 'Stopped':
149
151
                self.playing = 'Playing'
150
152

                                        
151
 
            self.launch_dbus_signal(INTERFACE_P_NAME, ['PlaybackStatus'])
 
153
            self.launch_dbus_signal(INTERFACE_P_NAME, {'PlaybackStatus':
 
154
                                                       self.playing})
152
155

                                        
153
156
        def stop_pressed():
154
157
            self.playing = 'Stopped'
155
158

                                        
156
 
            self.launch_dbus_signal(INTERFACE_P_NAME, ['PlaybackStatus'])
 
159
            self.launch_dbus_signal(INTERFACE_P_NAME, {'PlaybackStatus':
 
160
                                                       self.playing})
157
161

                                        
158
162
        def prevnext_pressed():
159
163
            self.playing = 'Playing'
160
164

                                        
161
 
            self.launch_dbus_signal(INTERFACE_P_NAME, ['PlaybackStatus'])
 
165
            self.launch_dbus_signal(INTERFACE_P_NAME, {'PlaybackStatus':
 
166
                                                       self.playing})
162
167

                                        
163
168
        def bluemindo_started(widgets):
164
169
            self.widgets = widgets
165
170

                                        
166
 
            self.launch_dbus_signal(INTERFACE_P_NAME, ['PlaybackStatus'])
 
171
            self.launch_dbus_signal(INTERFACE_P_NAME, {'PlaybackStatus':
 
172
                                                       self.playing})
167
173
            self.launch_dbus_signal(INTERFACE_NAME, ['CanQuit'])
168
174

                                        
169
175
        extensions.connect('HasStartedSong', update_data)
279
285
            metadata['mpris:artUrl'] = 'file://' + filename
280
286

                                        
281
287
            metadata['xesam:album'] = album
282
 
            metadata['xesam:artist'] = artist
 
288
            metadata['xesam:albumArtist'] = dbus_array([artist])
 
289
            metadata['xesam:artist'] = dbus_array([artist])
283
290
            metadata['xesam:title'] = title
284
291
            metadata['mpris:length'] = dbus_int64(length * (1/0.000001))
285
292
            metadata['xesam:trackNumber'] = tracknumber
286
293
            metadata['xesam:url'] = 'file://' + _file
 
294
            metadata['xesam:genre'] = self.song.genre
 
295
            metadata['xesam:discNumber'] = self.song.discnumber
 
296
            metadata['xesam:comment'] = self.song.comment
287
297

                                        
288
298
            return dbus_dict(metadata, signature='sv', variant_level=1)
289
299

                                        
290
300