pitivi r1285 - trunk/pitivi



Author: edwardrv
Date: Fri Sep 26 19:43:41 2008
New Revision: 1285
URL: http://svn.gnome.org/viewvc/pitivi?rev=1285&view=rev

Log:
Device : cleanups

Modified:
   trunk/pitivi/device.py
   trunk/pitivi/objectfactory.py

Modified: trunk/pitivi/device.py
==============================================================================
--- trunk/pitivi/device.py	(original)
+++ trunk/pitivi/device.py	Fri Sep 26 19:43:41 2008
@@ -156,7 +156,9 @@
         devobject = dbus.Interface(dev, 'org.freedesktop.Hal.Device')
         if devobject.QueryCapability("video4linux"):
             location = devobject.GetProperty("video4linux.device")
-            self.__sources[dev] = V4LSourceDeviceFactory(device=location)
+            info = devobject.GetProperty("info.product")
+            self.__sources[dev] = V4LSourceDeviceFactory(device=location,
+                                                         displayname=info)
         elif devobject.QueryCapability("alsa"):
             alsatype = devobject.GetProperty("alsa.type")
             if alsatype in ["capture", "playback"]:
@@ -205,7 +207,7 @@
 
     def __repr__(self):
         return "<%s: %s [hw:%s,%s]>" % (self.__class__.__name__,
-                                        self._displayname or self._name,
+                                        self.displayname or self.name,
                                         self._card, self._device)
 
 class AlsaSinkDeviceFactory(SinkDeviceFactory):
@@ -222,7 +224,7 @@
 
     def __repr__(self):
         return "<%s: %s [hw:%s,%s]>" % (self.__class__.__name__,
-                                        self._displayname or self._name,
+                                        self.displayname or self.name,
                                         self._card, self._device)
 
 

Modified: trunk/pitivi/objectfactory.py
==============================================================================
--- trunk/pitivi/objectfactory.py	(original)
+++ trunk/pitivi/objectfactory.py	Fri Sep 26 19:43:41 2008
@@ -71,10 +71,10 @@
     # pending UID (int) => objects (list of BrotherObjects and extra field)
     __waiting_for_pending_objects__ = {}
 
-    def __init__(self, **unused_kw):
+    def __init__(self, name="", displayname="", **unused_kw):
         gobject.GObject.__init__(self)
-        self.name = ""
-        self.displayname = ""
+        self.name = name
+        self.displayname = displayname
         self.is_audio = False
         self.is_video = False
         self.is_effect = False
@@ -123,7 +123,8 @@
         self.set_property("is-video", is_video)
 
     def __repr__(self):
-        return "<%s: %s>" % (self.__class__.__name__, self._displayname or self._name)
+        return "<%s: %s>" % (self.__class__.__name__, self.displayname or self.name)
+
     def addMediaTags(self, tags=[]):
         """ Add the given gst.Tag or gst.TagList to the factory """
         gst.debug("tags:%s" % tags)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]