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



Author: zeeshanak
Date: Mon Feb  9 22:27:44 2009
New Revision: 539
URL: http://svn.gnome.org/viewvc/rygel?rev=539&view=rev

Log:
MediaItem don't need http_server field anymore.

This also simplifies plugins's code since they don't need to pass around
the http_server ref everywhere anymore.

Modified:
   trunk/src/plugins/dvb/rygel-dvb-channel-group.vala
   trunk/src/plugins/dvb/rygel-dvb-channel.vala
   trunk/src/plugins/dvb/rygel-dvb-content-dir.vala
   trunk/src/plugins/dvb/rygel-dvb-root-container.vala
   trunk/src/plugins/test/rygel-test-audio-item.vala
   trunk/src/plugins/test/rygel-test-content-dir.vala
   trunk/src/plugins/test/rygel-test-item.vala
   trunk/src/plugins/test/rygel-test-root-container.vala
   trunk/src/plugins/test/rygel-test-video-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/plugins/tracker/rygel-tracker-root-container.vala
   trunk/src/rygel/rygel-media-item.vala

Modified: trunk/src/plugins/dvb/rygel-dvb-channel-group.vala
==============================================================================
--- trunk/src/plugins/dvb/rygel-dvb-channel-group.vala	(original)
+++ trunk/src/plugins/dvb/rygel-dvb-channel-group.vala	Mon Feb  9 22:27:44 2009
@@ -41,15 +41,12 @@
     /* List of channels */
     private ArrayList<DVBChannel> channels;
 
-    public HTTPServer http_server;
-
     private uint gid; /* The DVB Daemon Device Group ID */
 
     public DVBChannelGroup (uint                gid,
                             string              title,
                             string              parent_id,
-                            dynamic DBus.Object channel_list,
-                            HTTPServer          http_server) {
+                            dynamic DBus.Object channel_list) {
         base (GID_PREFIX + gid.to_string (), // UPnP ID
               parent_id,
               title,
@@ -57,7 +54,6 @@
         this.gid = gid;
         //this.upnp_class = "object.container.channelGroup";
         this.channel_list = channel_list;
-        this.http_server = http_server;
 
         this.fetch_channels ();
     }
@@ -110,8 +106,7 @@
             try {
                 var channel = new DVBChannel (channel_id,
                                               this.id,
-                                              channel_list,
-                                              http_server);
+                                              channel_list);
                 this.channels.add (channel);
             } catch (GLib.Error error) {
                 critical ("Failed to create DVB Channel object: %s",

Modified: trunk/src/plugins/dvb/rygel-dvb-channel.vala
==============================================================================
--- trunk/src/plugins/dvb/rygel-dvb-channel.vala	(original)
+++ trunk/src/plugins/dvb/rygel-dvb-channel.vala	Mon Feb  9 22:27:44 2009
@@ -36,15 +36,13 @@
 
     public DVBChannel (uint                cid,
                        string              parent_id,
-                       dynamic DBus.Object channel_list,
-                       HTTPServer          http_server) throws GLib.Error {
+                       dynamic DBus.Object channel_list) throws GLib.Error {
         string id = parent_id + ":" + cid.to_string (); /* UPnP ID */
 
         base (id,
               parent_id,
               "Unknown",        /* Title Unknown at this point */
-              "Unknown",        /* UPnP Class Unknown at this point */
-              http_server);
+              "Unknown");       /* UPnP Class Unknown at this point */
 
         this.cid = cid;
         this.channel_list = channel_list;

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	Mon Feb  9 22:27:44 2009
@@ -34,7 +34,7 @@
     // Pubic methods
     public override MediaContainer? create_root_container () {
         string friendly_name = this.root_device.get_friendly_name ();
-        return new DVBRootContainer (friendly_name, this.http_server);
+        return new DVBRootContainer (friendly_name);
     }
 }
 

Modified: trunk/src/plugins/dvb/rygel-dvb-root-container.vala
==============================================================================
--- trunk/src/plugins/dvb/rygel-dvb-root-container.vala	(original)
+++ trunk/src/plugins/dvb/rygel-dvb-root-container.vala	Mon Feb  9 22:27:44 2009
@@ -41,8 +41,7 @@
 
     private ArrayList<DVBChannelGroup> groups;
 
-    public DVBRootContainer (string     title,
-                             HTTPServer http_server) {
+    public DVBRootContainer (string title) {
         base.root (title, 0);
 
         DBus.Connection connection;
@@ -93,8 +92,7 @@
             this.groups.add (new DVBChannelGroup (group_id,
                                                   group_name,
                                                   this.id,
-                                                  channel_list,
-                                                  http_server));
+                                                  channel_list));
         }
 
         this.child_count = this.groups.size;

Modified: trunk/src/plugins/test/rygel-test-audio-item.vala
==============================================================================
--- trunk/src/plugins/test/rygel-test-audio-item.vala	(original)
+++ trunk/src/plugins/test/rygel-test-audio-item.vala	Mon Feb  9 22:27:44 2009
@@ -33,16 +33,14 @@
 public class Rygel.TestAudioItem : Rygel.TestItem {
     const string TEST_MIMETYPE = "audio/x-wav";
 
-    public TestAudioItem (string     id,
-                          string     parent_id,
-                          string     title,
-                          HTTPServer http_server) {
+    public TestAudioItem (string id,
+                          string parent_id,
+                          string title) {
         base (id,
               parent_id,
               title,
               TEST_MIMETYPE,
-              MediaItem.AUDIO_CLASS,
-              http_server);
+              MediaItem.AUDIO_CLASS);
     }
 
     public override Element? create_stream_source () {

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	Mon Feb  9 22:27:44 2009
@@ -33,7 +33,7 @@
     /* Pubic methods */
     public override MediaContainer? create_root_container () {
         string friendly_name = this.root_device.get_friendly_name ();
-        return new TestRootContainer (friendly_name, this.http_server);
+        return new TestRootContainer (friendly_name);
     }
 }
 

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	Mon Feb  9 22:27:44 2009
@@ -32,13 +32,12 @@
 public abstract class Rygel.TestItem : Rygel.MediaItem {
     const string TEST_AUTHOR = "Zeeshan Ali (Khattak)";
 
-    public TestItem (string     id,
-                     string     parent_id,
-                     string     title,
-                     string     mime,
-                     string     upnp_class,
-                     HTTPServer http_server) {
-        base (id, parent_id, title, upnp_class, http_server);
+    public TestItem (string id,
+                     string parent_id,
+                     string title,
+                     string mime,
+                     string upnp_class) {
+        base (id, parent_id, title, upnp_class);
 
         this.mime_type = mime;
         this.author = TEST_AUTHOR;

Modified: trunk/src/plugins/test/rygel-test-root-container.vala
==============================================================================
--- trunk/src/plugins/test/rygel-test-root-container.vala	(original)
+++ trunk/src/plugins/test/rygel-test-root-container.vala	Mon Feb  9 22:27:44 2009
@@ -33,23 +33,16 @@
 public class Rygel.TestRootContainer : MediaContainer {
     private ArrayList<MediaItem> items;
 
-    private HTTPServer http_server;
-
-    public TestRootContainer (string     title,
-                             HTTPServer http_server) {
+    public TestRootContainer (string title) {
         base.root (title, 0);
 
-        this.http_server = http_server;
-
         this.items = new ArrayList<MediaItem> ();
         this.items.add (new TestAudioItem ("sinewave",
                                            this.id,
-                                           "Sine Wave",
-                                           this.http_server));
+                                           "Sine Wave"));
         this.items.add (new TestVideoItem ("smtpe",
                                            this.id,
-                                           "SMTPE",
-                                           this.http_server));
+                                           "SMTPE"));
 
         // Now we know how many top-level items we have
         this.child_count = this.items.size;

Modified: trunk/src/plugins/test/rygel-test-video-item.vala
==============================================================================
--- trunk/src/plugins/test/rygel-test-video-item.vala	(original)
+++ trunk/src/plugins/test/rygel-test-video-item.vala	Mon Feb  9 22:27:44 2009
@@ -33,16 +33,14 @@
 public class Rygel.TestVideoItem : Rygel.TestItem {
     const string TEST_MIMETYPE = "video/mpeg";
 
-    public TestVideoItem (string     id,
-                          string     parent_id,
-                          string     title,
-                          HTTPServer http_server) {
+    public TestVideoItem (string id,
+                          string parent_id,
+                          string title) {
         base (id,
               parent_id,
               title,
               TEST_MIMETYPE,
-              MediaItem.VIDEO_CLASS,
-              http_server);
+              MediaItem.VIDEO_CLASS);
     }
 
     public override Element? create_stream_source () {

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	Mon Feb  9 22:27:44 2009
@@ -33,7 +33,7 @@
     /* Pubic methods */
     public override MediaContainer? create_root_container () {
         string friendly_name = this.root_device.get_friendly_name ();
-        return new TrackerRootContainer (friendly_name, this.http_server);
+        return new TrackerRootContainer (friendly_name);
     }
 }
 

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	Mon Feb  9 22:27:44 2009
@@ -43,7 +43,6 @@
     public static dynamic DBus.Object files;
     public static dynamic DBus.Object tracker;
 
-    public HTTPServer http_server;
     public string category;
 
     /* UPnP class of items under this container */
@@ -73,17 +72,15 @@
                                            TrackerContainer.TRACKER_IFACE);
     }
 
-    public TrackerContainer (string     id,
-                             string     parent_id,
-                             string     title,
-                             string     category,
-                             string     child_class,
-                             HTTPServer http_server) {
+    public TrackerContainer (string id,
+                             string parent_id,
+                             string title,
+                             string category,
+                             string child_class) {
         base (id, parent_id, title, 0);
 
         this.category = category;
         this.child_class = child_class;
-        this.http_server = http_server;
 
         /* FIXME: We need to hook to some tracker signals to keep
          *        this field up2date at all times

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	Mon Feb  9 22:27:44 2009
@@ -35,7 +35,7 @@
     public TrackerItem (string           id,
                         string           path,
                         TrackerContainer parent) throws GLib.Error {
-        base (id, parent.id, "", parent.child_class, parent.http_server);
+        base (id, parent.id, "", parent.child_class);
 
         this.path = path;
         this.parent = parent;

Modified: trunk/src/plugins/tracker/rygel-tracker-root-container.vala
==============================================================================
--- trunk/src/plugins/tracker/rygel-tracker-root-container.vala	(original)
+++ trunk/src/plugins/tracker/rygel-tracker-root-container.vala	Mon Feb  9 22:27:44 2009
@@ -34,7 +34,7 @@
     /* FIXME: Make this a static if you know how to initize it */
     private ArrayList<TrackerContainer> containers;
 
-    public TrackerRootContainer (string title, HTTPServer http_server) {
+    public TrackerRootContainer (string title) {
         base.root (title, 0);
 
         this.containers = new ArrayList<TrackerContainer> ();
@@ -43,22 +43,19 @@
                                                this.id,
                                                "All Images",
                                                "Images",
-                                               MediaItem.IMAGE_CLASS,
-                                               http_server));
+                                               MediaItem.IMAGE_CLASS));
         this.containers.add
                         (new TrackerContainer ("14",
                                                this.id,
                                                "All Music",
                                                "Music",
-                                               MediaItem.MUSIC_CLASS,
-                                               http_server));
+                                               MediaItem.MUSIC_CLASS));
         this.containers.add
                         (new TrackerContainer ("15",
                                                this.id,
                                                "All Videos",
                                                "Videos",
-                                               MediaItem.VIDEO_CLASS,
-                                               http_server));
+                                               MediaItem.VIDEO_CLASS));
 
         // Now we know how many top-level containers we have
         this.child_count = this.containers.size;

Modified: trunk/src/rygel/rygel-media-item.vala
==============================================================================
--- trunk/src/rygel/rygel-media-item.vala	(original)
+++ trunk/src/rygel/rygel-media-item.vala	Mon Feb  9 22:27:44 2009
@@ -55,18 +55,14 @@
     public int height = -1;
     public int color_depth = -1;
 
-    protected Rygel.HTTPServer http_server;
-
-    public MediaItem (string     id,
-                      string     parent_id,
-                      string     title,
-                      string     upnp_class,
-                      HTTPServer http_server) {
+    public MediaItem (string id,
+                      string parent_id,
+                      string title,
+                      string upnp_class) {
         this.id = id;
         this.parent_id = parent_id;
         this.title = title;
         this.upnp_class = upnp_class;
-        this.http_server = http_server;
     }
 
     // Live media items need to provide a nice working implementation of this



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