rygel r361 - in trunk/src: plugins/test plugins/tracker rygel



Author: zeeshanak
Date: Thu Dec 25 11:58:59 2008
New Revision: 361
URL: http://svn.gnome.org/viewvc/rygel?rev=361&view=rev

Log:
MediaItem now just use Streamer instead of GUPnP.Context.

Modified:
   trunk/src/plugins/test/rygel-test-item.vala
   trunk/src/plugins/tracker/rygel-media-tracker.vala
   trunk/src/plugins/tracker/rygel-tracker-container.vala
   trunk/src/plugins/tracker/rygel-tracker-item.vala
   trunk/src/rygel/rygel-media-item.vala

Modified: trunk/src/plugins/test/rygel-test-item.vala
==============================================================================
--- trunk/src/plugins/test/rygel-test-item.vala	(original)
+++ trunk/src/plugins/test/rygel-test-item.vala	Thu Dec 25 11:58:59 2008
@@ -36,8 +36,6 @@
 
     public string path;
 
-    private Streamer streamer;
-
     public TestItem (string   id,
                      string   parent_id,
                      string   title,
@@ -45,9 +43,8 @@
                      string   upnp_class,
                      Streamer streamer,
                      string   path) {
-        base (id, parent_id, title, upnp_class);
+        base (id, parent_id, title, upnp_class, streamer);
         this.mime = mime;
-        this.streamer = streamer;
         this.author = TEST_AUTHOR;
         this.path= path;
 

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	Thu Dec 25 11:58:59 2008
@@ -43,6 +43,8 @@
         // Chain-up to base first
         base.constructed ();
 
+        Streamer streamer = new Streamer (this.context, "Tracker");
+
         this.containers = new List<TrackerContainer> ();
         this.containers.append
                         (new TrackerContainer ("16",
@@ -50,31 +52,26 @@
                                                "All Images",
                                                "Images",
                                                MediaItem.IMAGE_CLASS,
-                                               context));
+                                               streamer));
         this.containers.append
                         (new TrackerContainer ("14",
                                                this.root_container.id,
                                                "All Music",
                                                "Music",
                                                MediaItem.MUSIC_CLASS,
-                                               context));
+                                               streamer));
         this.containers.append
                         (new TrackerContainer ("15",
                                                this.root_container.id,
                                                "All Videos",
                                                "Videos",
                                                MediaItem.VIDEO_CLASS,
-                                               context));
+                                               streamer));
 
         // Now we know how many top-level containers we have
         this.root_container.child_count = this.containers.length ();
 
         this.search_parser = new SearchCriteriaParser ();
-
-        weak string home_dir = Environment.get_home_dir ();
-
-        /* Host the home dir of the user */
-        this.context.host_path (home_dir, home_dir);
     }
 
     public override void add_children_metadata (DIDLLiteWriter didl_writer,

Modified: trunk/src/plugins/tracker/rygel-tracker-container.vala
==============================================================================
--- trunk/src/plugins/tracker/rygel-tracker-container.vala	(original)
+++ trunk/src/plugins/tracker/rygel-tracker-container.vala	Thu Dec 25 11:58:59 2008
@@ -44,7 +44,7 @@
     public static dynamic DBus.Object files;
     public static dynamic DBus.Object tracker;
 
-    public Context context;
+    public Streamer streamer;
     public string category;
 
     /* UPnP class of items under this container */
@@ -79,13 +79,12 @@
                              string  title,
                              string  category,
                              string  child_class,
-                             Context context) {
-        this.id = id;
-        this.parent_id = parent_id;
-        this.title = title;
+                             Streamer streamer) {
+        base (id, parent_id, title, 0);
+
         this.category = category;
         this.child_class = child_class;
-        this.context = context;
+        this.streamer = streamer;
     }
 
     public override void serialize (DIDLLiteWriter didl_writer)

Modified: trunk/src/plugins/tracker/rygel-tracker-item.vala
==============================================================================
--- trunk/src/plugins/tracker/rygel-tracker-item.vala	(original)
+++ trunk/src/plugins/tracker/rygel-tracker-item.vala	Thu Dec 25 11:58:59 2008
@@ -39,11 +39,10 @@
     public TrackerItem (string           id,
                         string           path,
                         TrackerContainer parent) {
-        this.id = id;
+        base (id, parent.id, "", parent.child_class, parent.streamer);
+
         this.path = path;
         this.parent = parent;
-        this.parent_id = parent.id;
-        this.upnp_class = parent.child_class;
     }
 
     protected string seconds_to_iso8601 (string seconds) {
@@ -64,11 +63,7 @@
     }
 
     protected string uri_from_path (string path) {
-        string escaped_path = Uri.escape_string (path, "/", true);
-
-        return "http://%s:%u%s".printf (this.parent.context.host_ip,
-                                        this.parent.context.port,
-                                        escaped_path);
+        return "file://%s".printf (path);
     }
 }
 

Modified: trunk/src/rygel/rygel-media-item.vala
==============================================================================
--- trunk/src/rygel/rygel-media-item.vala	(original)
+++ trunk/src/rygel/rygel-media-item.vala	Thu Dec 25 11:58:59 2008
@@ -49,14 +49,18 @@
     public int height = -1;
     public int track_number = -1;
 
-    public MediaItem (string id,
-                      string parent_id,
-                      string title,
-                      string upnp_class) {
+    protected Rygel.Streamer streamer;
+
+    public MediaItem (string   id,
+                      string   parent_id,
+                      string   title,
+                      string   upnp_class,
+                      Streamer streamer) {
         this.id = id;
         this.parent_id = parent_id;
         this.title = title;
         this.upnp_class = upnp_class;
+        this.streamer = streamer;
     }
 
     public override void serialize (DIDLLiteWriter didl_writer) throws Error {



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