[Player-dev] CR: Hard code RealPlayer for MID to only use helix-dbus-server

[Player-dev] CR: Hard code RealPlayer for MID to only use helix-dbus-server

Rusty Lynch rusty.lynch at intel.com
Wed Mar 19 15:33:54 PDT 2008


Description
----------------------------------
The original design of this application allowed for connecting into
multiple media infrastructures, where the DBus object name and path
for each media infrastructure was specified via a config file in the
/usr/share/media-services directory.

This change will simplify the GUI by hard coding the media service to
only connect to the helix-dbus-server.

Files Modified
----------------------------------
player/mid/src/app.py
player/mid/src/constant.py
player/mid/src/media_service.py

Branches
---------------------------------
HEAD only (for now)

Index: src/app.py
===================================================================
RCS file: /cvsroot/player/mid/src/app.py,v
retrieving revision 1.2
diff -u -w -r1.2 app.py
--- src/app.py	18 Mar 2008 00:04:02 -0000	1.2
+++ src/app.py	19 Mar 2008 22:35:44 -0000
@@ -347,7 +347,7 @@
         # init plugins
         self.plugins = media_plugin.MediaPlugin()
 
-        self.service = MediaService(constant.MediaConfigsDir)
+        self.service = MediaService()
         self.service.connect_to_signal("StatusChange",
self.on_status_changed)
         self.service.connect_to_signal("UpdateMediaInfo",
self.on_update_media_info)
         self.service.connect_to_signal("UpdatePos", self.on_update_pos)
Index: src/constant.py
===================================================================
RCS file: /cvsroot/player/mid/src/constant.py,v
retrieving revision 1.3
diff -u -w -r1.3 constant.py
--- src/constant.py	18 Mar 2008 19:23:47 -0000	1.3
+++ src/constant.py	19 Mar 2008 22:35:44 -0000
@@ -35,7 +35,6 @@
 
 _ = gettext.lgettext
 
-MediaConfigsDir         = '/usr/share/media-services'
 MediaContentPath        = os.path.expanduser('~/media')
 
 # Gconf related constants
Index: src/media_service.py
===================================================================
RCS file: /cvsroot/player/mid/src/media_service.py,v
retrieving revision 1.2
diff -u -w -r1.2 media_service.py
--- src/media_service.py	18 Mar 2008 00:04:02 -0000	1.2
+++ src/media_service.py	19 Mar 2008 22:35:44 -0000
@@ -52,38 +52,17 @@
     __metaclass__ = classinit.ClassInitMeta
     __classinit__ = classinit.build_properties
 
-    def __init__(self, config_dir):
-        """Sample config file that would be in the config_dir:
-        [Engine]
-        enabled=yes
-        name=helix
-        DBusName=org.helixcommunity.MobileMediaService
-        DBusPath=/org.helixcommunity/MobileMediaService"""
-        self.__config_dir = config_dir
+    def __init__(self):
+        self.__dbus_name = "org.helixcommunity.HelixDbusServer"
+        self.__dbus_path = "/org/helixcommunity/HelixDbusServer/Player"
         self.__connected = False
         self.__callbacks = {}
         self.__private_callbacks = {}        
         self.__service_name = ''
-        self.__dbus_name = ''
-        self.__dbus_path = ''
         self.__xid = None
         self.__width = None
         self.__height = None
         self.__uri = None
-        for f in os.listdir(self.__config_dir):
-            try:
-                cf = ConfigParser.ConfigParser()
-                cf.read(os.path.join(self.__config_dir, f))
-                if cf.get('Engine','enabled').lower() == 'yes':
-                    self.__service_name = cf.get('Engine','name')
-                    self.__dbus_name = cf.get('Engine','DBusName')
-                    self.__dbus_path = cf.get('Engine','DBusPath')
-                    break
-            except:
-                # Skip over any problematic configuration files
-                pass
-        if not self.__dbus_path:
-            raise MediaServiceError('No valid media services found')
 
     def __connect_service(self):
         self.__bus = dbus.SessionBus()




More information about the Player-dev mailing list
 

Site Map   |   Terms of Use   |   Privacy Policy   |   Contact Us

Copyright © 1995-2007 RealNetworks, Inc. All rights reserved. RealNetworks and Helix are trademarks of RealNetworks.
All other trademarks or registered trademarks are the property of their respective holders.