Maemo: Support MediaBox as player (Maemo bug 10827)

This commit is contained in:
Thomas Perl 2010-08-06 15:59:28 +02:00
parent 8c6f8f866a
commit ce36910539
3 changed files with 26 additions and 0 deletions

View file

@ -51,11 +51,13 @@ class gPodderPreferences(BuilderWidget):
AUDIO_PLAYERS = (
('default', _('Media Player')),
('panucci', _('Panucci')),
('MediaBox', _('MediaBox')),
)
VIDEO_PLAYERS = (
('default', _('Media Player')),
('mplayer', _('MPlayer')),
('MediaBox', _('MediaBox')),
)
def new(self):

View file

@ -35,10 +35,12 @@ class gPodderPreferences(BuilderWidget):
audio_players = [
('default', 'Media Player'),
('panucci', 'Panucci'),
('MediaBox', _('MediaBox')),
]
video_players = [
('default', 'Media Player'),
('mplayer', 'MPlayer'),
('MediaBox', _('MediaBox')),
]
def new(self):

View file

@ -2142,6 +2142,28 @@ class gPodder(BuilderWidget, dbus.service.Object):
continue # This file was handled by the D-Bus call
except Exception, e:
log('Error calling Panucci using D-Bus', sender=self, traceback=True)
elif player == 'MediaBox' and gpodder.ui.maemo:
try:
MEDIABOX_NAME = 'de.pycage.mediabox'
MEDIABOX_PATH = '/de/pycage/mediabox/control'
MEDIABOX_INTF = 'de.pycage.mediabox.control'
session_bus = dbus.SessionBus(mainloop=dbus.glib.DBusGMainLoop())
o = session_bus.get_object(MEDIABOX_NAME, MEDIABOX_PATH)
i = dbus.Interface(o, MEDIABOX_INTF)
def on_reply(*args):
pass
def on_error(err):
log('Exception in D-Bus call: %s', str(err), \
sender=self)
i.load(filename, '%s/x-unknown' % file_type, \
reply_handler=on_reply, error_handler=on_error)
continue # This file was handled by the D-Bus call
except Exception, e:
log('Error calling MediaBox using D-Bus', sender=self, traceback=True)
groups[player].append(filename)