rygel r609 - in trunk: data/xml src/rygel



Author: zeeshanak
Date: Mon Feb 16 17:33:11 2009
New Revision: 609
URL: http://svn.gnome.org/viewvc/rygel?rev=609&view=rev

Log:
Basic skeleton for "ContainerUpdateIDs" state-variable.

Modified:
   trunk/data/xml/ContentDirectory.xml
   trunk/src/rygel/rygel-content-directory.vala

Modified: trunk/data/xml/ContentDirectory.xml
==============================================================================
--- trunk/data/xml/ContentDirectory.xml	(original)
+++ trunk/data/xml/ContentDirectory.xml	Mon Feb 16 17:33:11 2009
@@ -33,6 +33,13 @@
 		</stateVariable>
 
 		<stateVariable>
+			<Optional/>
+			<name>ContainerUpdateIDs</name>
+			<sendEventsAttribute>yes</sendEventsAttribute>
+			<dataType>string</dataType>
+		</stateVariable>
+
+		<stateVariable>
 			<name>FeatureList</name>
 			<sendEventsAttribute>no</sendEventsAttribute>
 			<dataType>string</dataType>
@@ -107,13 +114,6 @@
 
 		<stateVariable>
 			<Optional/>
-			<name>ContainerUpdateIDs</name>
-			<sendEventsAttribute>yes</sendEventsAttribute>
-			<dataType>string</dataType>
-		</stateVariable>
-
-		<stateVariable>
-			<Optional/>
 			<name>TransferIDs</name>
 			<sendEventsAttribute>yes</sendEventsAttribute>
 			<dataType>string</dataType>

Modified: trunk/src/rygel/rygel-content-directory.vala
==============================================================================
--- trunk/src/rygel/rygel-content-directory.vala	(original)
+++ trunk/src/rygel/rygel-content-directory.vala	Mon Feb 16 17:33:11 2009
@@ -51,6 +51,7 @@
     protected HTTPServer http_server;
 
     public MediaContainer root_container;
+    private ArrayList<MediaContainer> updated_containers;
 
     private ArrayList<Browse> browses;
     public uint32 system_update_id;
@@ -65,6 +66,7 @@
         this.http_server = new HTTPServer (this, this.get_type ().name ());
 
         this.browses = new ArrayList<Browse> ();
+        this.updated_containers =  new ArrayList<MediaContainer> ();
 
         this.feature_list =
             "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
@@ -82,6 +84,8 @@
         this.action_invoked["GetSystemUpdateID"] +=
                                                 this.get_system_update_id_cb;
         this.query_variable["SystemUpdateID"] += this.query_system_update_id;
+        this.query_variable["ContainerUpdateIDs"] +=
+                                                this.query_container_update_ids;
 
         /* Connect SearchCapabilities related signals */
         this.action_invoked["GetSearchCapabilities"] +=
@@ -133,6 +137,17 @@
         value.set_uint (this.system_update_id);
     }
 
+    /* Query ContainerUpdateIDs */
+    private void query_container_update_ids (ContentDirectory content_dir,
+                                             string           variable,
+                                             ref GLib.Value   value) {
+        var update_ids = this.create_container_update_ids ();
+
+        /* Set action return arguments */
+        value.init (typeof (string));
+        value.set_string (update_ids);
+    }
+
     /* action GetSearchCapabilities implementation */
     private void get_search_capabilities_cb (ContentDirectory    content_dir,
                                              owned ServiceAction action) {
@@ -190,5 +205,16 @@
     private void on_browse_completed (Browse browse) {
         this.browses.remove (browse);
     }
+
+    private string create_container_update_ids () {
+        var update_ids = "";
+
+        foreach (var container in this.updated_containers) {
+            update_ids += "," + container.id + "," +
+                          container.update_id.to_string ();
+        }
+
+        return update_ids;
+    }
 }
 



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