-I$(top_srcdir)/src/rygel -DDATA_DIR='"$(shareddir)"' \
-include config.h
-librygel_external_la_SOURCES = rygel-external-content-dir.vala \
- rygel-external-container.vala \
+librygel_external_la_SOURCES = rygel-external-container.vala \
rygel-external-dummy-container.vala \
rygel-external-item-factory.vala \
rygel-external-thumbnail-factory.vala \
+++ /dev/null
-/*
- * Copyright (C) 2009 Zeeshan Ali (Khattak) <zeeshanak@gnome.org>.
- * Copyright (C) 2009,2010 Nokia Corporation.
- *
- * Author: Zeeshan Ali (Khattak) <zeeshanak@gnome.org>
- * <zeeshan.ali@nokia.com>
- *
- * This file is part of Rygel.
- *
- * Rygel is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * Rygel is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-using GUPnP;
-using DBus;
-using Gee;
-
-/**
- * Implementation of External ContentDirectory service.
- */
-public class Rygel.External.ContentDir : Rygel.ContentDirectory {
- // Pubic methods
- public override MediaContainer? create_root_container () {
- var plugin = (External.Plugin) this.root_device.resource_factory;
-
- return new Container ("0",
- plugin.title,
- plugin.child_count,
- plugin.searchable,
- plugin.service_name,
- plugin.root_object,
- this.context.host_ip,
- null);
- }
-}
-
IconInfo? icon) {
base (service_name,
title,
- typeof (ContentDir),
"Rygel External " + title);
this.service_name = service_name;
this.add_icon (icon);
}
}
+
+ public override MediaContainer? get_root_container (
+ ContentDirectory content_dir) {
+ return new Container ("0",
+ this.title,
+ this.child_count,
+ this.searchable,
+ this.service_name,
+ this.root_object,
+ content_dir.context.host_ip,
+ null);
+ }
}
librygel_gst_launch_la_SOURCES = rygel-gst-launch-plugin.vala \
rygel-gst-launch-root-container.vala \
- rygel-gst-launch-content-dir.vala \
rygel-gst-launch-item.vala
librygel_gst_launch_la_VALAFLAGS = --vapidir=$(top_srcdir)/src/rygel \
+++ /dev/null
-/*
- * Copyright (C) 2009 Thijs Vermeir <thijsvermeir@gmail.com>
- *
- * Author: Thijs Vermeir <thijsvermeir@gmail.com>
- *
- * This file is part of Rygel.
- *
- * Rygel is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * Rygel is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-using Rygel;
-using GUPnP;
-using Gee;
-
-public class Rygel.GstLaunch.ContentDir : ContentDirectory {
- /* Pubic methods */
- public override MediaContainer? create_root_container () {
- string friendly_name = this.root_device.get_friendly_name ();
- return new RootContainer (friendly_name);
- }
-}
-
using Gee;
public void module_init (PluginLoader loader) {
- var plugin = new MediaServerPlugin ("GstLaunch",
- "Gst Launch",
- typeof (GstLaunch.ContentDir));
+ var plugin = new GstLaunch.Plugin ();
+
loader.add_plugin (plugin);
}
+public class Rygel.GstLaunch.Plugin : Rygel.MediaServerPlugin {
+ public Plugin () {
+ base ("GstLaunch", "Gst Launch");
+ }
+
+ public override MediaContainer? get_root_container (
+ ContentDirectory content_dir) {
+ return new RootContainer (this.title);
+ }
+}
*
*/
public void module_init (PluginLoader loader) {
- var plugin = new MediaServerPlugin ("MediaExport",
- _("@REALNAME@'s media"),
- typeof (Rygel.MediaExport.ContentDir));
+ var plugin = new MediaExport.Plugin ();
+
loader.add_plugin (plugin);
}
-public class Rygel.MediaExport.ContentDir : ContentDirectory {
- public override MediaContainer? create_root_container () {
+public class Rygel.MediaExport.Plugin : Rygel.MediaServerPlugin {
+ public Plugin () {
+ base ("MediaExport", _("@REALNAME@'s media"));
+ }
+
+ public override MediaContainer? get_root_container (
+ ContentDirectory content_dir) {
return RootContainer.get_instance ();
}
}
using GUPnP;
public void module_init (PluginLoader loader) {
- var plugin = new MediaServerPlugin ("ZDFMediathek",
- "ZDF Mediathek",
- typeof (Mediathek.ContentDir));
+ var plugin = new Mediathek.Plugin ();
+
loader.add_plugin (plugin);
}
-public class Rygel.Mediathek.ContentDir : ContentDirectory {
- public override MediaContainer? create_root_container () {
+public class Rygel.Mediathek.Plugin : Rygel.MediaServerPlugin {
+ public Plugin () {
+ base ("ZDFMediathek", "ZDF Mediathek");
+ }
+
+ public override MediaContainer? get_root_container (
+ ContentDirectory content_dir) {
return RootContainer.get_instance ();
}
}
-
-I$(top_srcdir)/src/rygel -DDATA_DIR='"$(shareddir)"' \
-include config.h
-librygel_test_la_SOURCES = rygel-test-content-dir.vala \
- rygel-test-root-container.vala \
+librygel_test_la_SOURCES = rygel-test-root-container.vala \
rygel-test-item.vala \
rygel-test-audio-item.vala \
rygel-test-video-item.vala \
+++ /dev/null
-/*
- * Copyright (C) 2008 Zeeshan Ali (Khattak) <zeeshanak@gnome.org>.
- * Copyright (C) 2008 Nokia Corporation.
- *
- * Author: Zeeshan Ali (Khattak) <zeeshanak@gnome.org>
- * <zeeshan.ali@nokia.com>
- *
- * This file is part of Rygel.
- *
- * Rygel is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * Rygel is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-using GUPnP;
-using Gee;
-
-/**
- * Implementation of ContentDirectory service, meant for testing purposes only.
- */
-public class Rygel.Test.ContentDir : Rygel.ContentDirectory {
- /* Pubic methods */
- public override MediaContainer? create_root_container () {
- string friendly_name = this.root_device.get_friendly_name ();
- return new RootContainer (friendly_name);
- }
-}
-
using Gee;
public void module_init (PluginLoader loader) {
- var plugin = new MediaServerPlugin("Test",
- "Test Streams",
- typeof (Rygel.Test.ContentDir));
+ var plugin = new Rygel.Test.Plugin ();
+
loader.add_plugin (plugin);
}
+public class Rygel.Test.Plugin : Rygel.MediaServerPlugin {
+ public Plugin () {
+ base ("Test", "Test Streams");
+ }
+
+ public override MediaContainer? get_root_container (
+ ContentDirectory content_dir) {
+ return new RootContainer (this.title);
+ }
+}
-I$(top_srcdir)/src/rygel -DDATA_DIR='"$(datadir)"' \
-include config.h
-librygel_media_tracker_la_SOURCES = \
- rygel-tracker-content-directory.vala \
- rygel-tracker-root-container.vala \
+librygel_media_tracker_la_SOURCES = rygel-tracker-root-container.vala \
rygel-tracker-category-container.vala \
rygel-tracker-music.vala \
rygel-tracker-videos.vala \
+++ /dev/null
-/*
- * Copyright (C) 2008 Zeeshan Ali <zeenix@gmail.com>.
- * Copyright (C) 2008,2010 Nokia Corporation.
- *
- * Author: Zeeshan Ali <zeenix@gmail.com>
- *
- * This file is part of Rygel.
- *
- * Rygel is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * Rygel is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-using GUPnP;
-using DBus;
-using Gee;
-
-/**
- * Implementation of Tracker-based ContentDirectory service.
- */
-public class Rygel.Tracker.ContentDirectory : Rygel.ContentDirectory {
- /* Pubic methods */
- public override MediaContainer? create_root_container () {
- string friendly_name = this.root_device.get_friendly_name ();
- return new RootContainer (friendly_name);
- }
-}
-
base ("Tracker",
// @REALNAME@ is substituted for user's real name
// and it doesn't need translation.
- _("@REALNAME@'s media"),
- typeof (Tracker.ContentDirectory));
+ _("@REALNAME@'s media"));
var icon_info = new IconInfo ("image/png");
warning (_("Error creating URI from %s: %s"), ICON, err.message);
}
}
+
+ public override MediaContainer? get_root_container (
+ ContentDirectory content_dir) {
+ return new RootContainer (this.title);
+ }
}
public uint32 system_update_id;
- // Public abstract methods derived classes need to implement
- public virtual MediaContainer? create_root_container () {
- return null;
- }
-
public override void constructed () {
this.cancellable = new Cancellable ();
-
- this.root_container = this.create_root_container ();
+ this.root_container = this.get_root_container ();
try {
this.http_server = new HTTPServer (this, this.get_type ().name ());
this.http_server.run.begin ();
}
+ private MediaContainer get_root_container () {
+ var plugin = this.root_device.resource_factory as MediaServerPlugin;
+
+ return plugin.get_root_container (this);
+ }
+
~ContentDirectory () {
// Cancel all state machines
this.cancellable.cancel ();
public MediaServerPlugin (string name,
string? title,
- Type content_dir_type,
string? description = null) {
base (MEDIA_SERVER_DESC_PATH, name, title, description);
var resource_info = new ResourceInfo (ContentDirectory.UPNP_ID,
ContentDirectory.UPNP_TYPE,
ContentDirectory.DESCRIPTION_PATH,
- content_dir_type);
+ typeof (ContentDirectory));
this.add_resource (resource_info);
// Register Rygel.ConnectionManager
typeof (MediaReceiverRegistrar));
this.add_resource (resource_info);
}
+
+ public virtual MediaContainer? get_root_container (
+ ContentDirectory content_dir) {
+ return null;
+ }
}