rygel r506 - in trunk/src: plugins/dvb plugins/test plugins/tracker rygel



Author: zeeshanak
Date: Wed Jan 28 12:34:01 2009
New Revision: 506
URL: http://svn.gnome.org/viewvc/rygel?rev=506&view=rev

Log:
Root container is now created by ContentDir implementations.

Modified:
   trunk/src/plugins/dvb/rygel-dvb-content-dir.vala
   trunk/src/plugins/test/rygel-test-content-dir.vala
   trunk/src/plugins/tracker/rygel-media-tracker.vala
   trunk/src/rygel/rygel-content-directory.vala

Modified: trunk/src/plugins/dvb/rygel-dvb-content-dir.vala
==============================================================================
--- trunk/src/plugins/dvb/rygel-dvb-content-dir.vala	(original)
+++ trunk/src/plugins/dvb/rygel-dvb-content-dir.vala	Wed Jan 28 12:34:01 2009
@@ -161,6 +161,11 @@
         return children;
     }
 
+    public override MediaContainer? create_root_container () {
+        string friendly_name = this.root_device.get_friendly_name ();
+        return new MediaContainer.root (friendly_name, 0);
+    }
+
     // Private methods
     private DVBChannelGroup? find_group_by_id (string id) {
         DVBChannelGroup group = null;

Modified: trunk/src/plugins/test/rygel-test-content-dir.vala
==============================================================================
--- trunk/src/plugins/test/rygel-test-content-dir.vala	(original)
+++ trunk/src/plugins/test/rygel-test-content-dir.vala	Wed Jan 28 12:34:01 2009
@@ -98,6 +98,11 @@
         return item;
     }
 
+    public override MediaContainer? create_root_container () {
+        string friendly_name = this.root_device.get_friendly_name ();
+        return new MediaContainer.root (friendly_name, 0);
+    }
+
     /* Private methods */
     private void on_need_stream_source (HTTPServer  http_server,
                                         MediaItem   item,

Modified: trunk/src/plugins/tracker/rygel-media-tracker.vala
==============================================================================
--- trunk/src/plugins/tracker/rygel-media-tracker.vala	(original)
+++ trunk/src/plugins/tracker/rygel-media-tracker.vala	Wed Jan 28 12:34:01 2009
@@ -130,6 +130,11 @@
         return children;
     }
 
+    public override MediaContainer? create_root_container () {
+        string friendly_name = this.root_device.get_friendly_name ();
+        return new MediaContainer.root (friendly_name, 0);
+    }
+
     /* Private methods */
     private TrackerContainer? find_container_by_id (string container_id) {
         TrackerContainer container;

Modified: trunk/src/rygel/rygel-content-directory.vala
==============================================================================
--- trunk/src/rygel/rygel-content-directory.vala	(original)
+++ trunk/src/rygel/rygel-content-directory.vala	Wed Jan 28 12:34:01 2009
@@ -95,9 +95,13 @@
         throw new ServerError.NOT_IMPLEMENTED ("Not Implemented\n");
     }
 
+    public virtual MediaContainer? create_root_container () {
+       return null;
+    }
+
     public override void constructed () {
         this.didl_writer = new DIDLLiteWriter ();
-        this.setup_root_container ();
+        this.root_container = this.create_root_container ();
         this.http_server = new HTTPServer (context, this.get_type ().name ());
 
         this.http_server.item_requested += this.on_item_requested;
@@ -251,11 +255,6 @@
         value.set_string (this.feature_list);
     }
 
-    private void setup_root_container () {
-        string friendly_name = this.root_device.get_friendly_name ();
-        this.root_container = new MediaContainer.root (friendly_name, 0);
-    }
-
     private void browse_metadata (BrowseArgs args) throws Error {
         if (args.object_id == this.root_container.id) {
             this.root_container.serialize (didl_writer);



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