[rygel] core: Add create_classes list to MediaContainer
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] core: Add create_classes list to MediaContainer
- Date: Wed, 23 Jun 2010 13:44:44 +0000 (UTC)
commit ef3953add039286a547a1143c20822fef47f2706
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Tue Feb 23 14:25:59 2010 +0200
core: Add create_classes list to MediaContainer
MediaContainer keeps a list of (UPnP) classes that an object in it could
be created of. Also expose create_classes to clients.
src/rygel/rygel-didl-lite-writer.vala | 9 +++++++++
src/rygel/rygel-media-container.vala | 5 +++++
2 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/src/rygel/rygel-didl-lite-writer.vala b/src/rygel/rygel-didl-lite-writer.vala
index 31b51e2..12a1071 100644
--- a/src/rygel/rygel-didl-lite-writer.vala
+++ b/src/rygel/rygel-didl-lite-writer.vala
@@ -113,5 +113,14 @@ internal class Rygel.DIDLLiteWriter : GUPnP.DIDLLiteWriter {
didl_container.upnp_class = container.upnp_class;
didl_container.restricted = container.uris.size <= 0;
didl_container.searchable = true;
+
+ if (!didl_container.restricted) {
+ weak Xml.Node node = (Xml.Node) didl_container.xml_node;
+ weak Xml.Ns ns = (Xml.Ns) didl_container.upnp_namespace;
+
+ foreach (var create_class in container.create_classes) {
+ node.new_child (ns, "CreateClass", create_class);
+ }
+ }
}
}
diff --git a/src/rygel/rygel-media-container.vala b/src/rygel/rygel-media-container.vala
index 2a69726..3bb9c0d 100644
--- a/src/rygel/rygel-media-container.vala
+++ b/src/rygel/rygel-media-container.vala
@@ -40,6 +40,9 @@ public abstract class Rygel.MediaContainer : MediaObject {
public int child_count;
public uint32 update_id;
+ // List of classes that an object in this container could be created of
+ public ArrayList<string> create_classes;
+
public MediaContainer (string id,
MediaContainer? parent,
string title,
@@ -52,6 +55,8 @@ public abstract class Rygel.MediaContainer : MediaObject {
this.upnp_class = "object.container.storageFolder";
this.container_updated.connect (on_container_updated);
+
+ this.create_classes = new ArrayList<string> ();
}
public MediaContainer.root (string title,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]