using FreeDesktop;
-public class Rygel.External.Plugin : Rygel.Plugin {
+public class Rygel.External.Plugin : Rygel.MediaServerPlugin {
public string service_name;
public string root_object;
bool searchable,
string root_object,
IconInfo? icon) {
- base.MediaServer (service_name,
- title,
- typeof (ContentDir),
- "Rygel External " + title);
+ base (service_name,
+ title,
+ typeof (ContentDir),
+ "Rygel External " + title);
this.service_name = service_name;
this.child_count = child_count;
using Gee;
public void module_init (PluginLoader loader) {
- var plugin = new Plugin.MediaServer ("GstLaunch",
- "Gst Launch",
- typeof (GstLaunch.ContentDir));
+ var plugin = new MediaServerPlugin ("GstLaunch",
+ "Gst Launch",
+ typeof (GstLaunch.ContentDir));
loader.add_plugin (plugin);
}
using Gee;
public void module_init (PluginLoader loader) {
- var plugin = new Plugin.MediaRenderer (
+ var plugin = new MediaRendererPlugin (
"GstRenderer",
_("GStreamer Renderer"),
typeof (GstRenderer.ConnectionManager),
*
*/
public void module_init (PluginLoader loader) {
- var plugin = new Plugin.MediaServer ("MediaExport",
- _("@REALNAME@'s media"),
- typeof (Rygel.MediaExport.ContentDir));
+ var plugin = new MediaServerPlugin ("MediaExport",
+ _("@REALNAME@'s media"),
+ typeof (Rygel.MediaExport.ContentDir));
loader.add_plugin (plugin);
}
using GUPnP;
public void module_init (PluginLoader loader) {
- var plugin = new Plugin.MediaServer ("ZDFMediathek",
- "ZDF Mediathek",
- typeof (Mediathek.ContentDir));
+ var plugin = new MediaServerPlugin ("ZDFMediathek",
+ "ZDF Mediathek",
+ typeof (Mediathek.ContentDir));
loader.add_plugin (plugin);
}
using Gee;
public void module_init (PluginLoader loader) {
- var plugin = new Plugin.MediaServer ("Test",
- "Test Streams",
- typeof (Rygel.Test.ContentDir));
+ var plugin = new MediaServerPlugin("Test",
+ "Test Streams",
+ typeof (Rygel.Test.ContentDir));
loader.add_plugin (plugin);
}
using Gee;
-public class Rygel.Tracker.Plugin : Rygel.Plugin {
+public class Rygel.Tracker.Plugin : Rygel.MediaServerPlugin {
// class-wide constants
private const string ICON = BuildConfig.DATA_DIR + // Path
"/icons/hicolor/48x48/apps/tracker.png";
public Plugin () {
- base.MediaServer ("Tracker",
- // @REALNAME@ is substituted for user's real name
- // and it doesn't need translation.
- _("@REALNAME@'s media"),
- typeof (Tracker.ContentDirectory));
+ base ("Tracker",
+ // @REALNAME@ is substituted for user's real name
+ // and it doesn't need translation.
+ _("@REALNAME@'s media"),
+ typeof (Tracker.ContentDirectory));
var icon_info = new IconInfo ("image/png");
rygel-resource-info.vala \
rygel-icon-info.vala \
rygel-plugin.vala \
+ rygel-media-server-plugin.vala \
+ rygel-media-renderer-plugin.vala \
rygel-plugin-loader.vala \
rygel-media-object.vala \
rygel-media-container.vala \
--- /dev/null
+/*
+ * Copyright (C) 2008,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.
+ */
+
+public class Rygel.MediaRendererPlugin : Rygel.Plugin {
+ private static const string MEDIA_RENDERER_DESC_PATH =
+ BuildConfig.DATA_DIR +
+ "/xml/MediaRenderer2.xml";
+
+ public MediaRendererPlugin (string name,
+ string? title,
+ Type connection_manager_type,
+ Type av_transport_type,
+ Type rendering_control_type,
+ string? description = null) {
+ base (MEDIA_RENDERER_DESC_PATH, name, title, description);
+
+ var resource = new ResourceInfo (ConnectionManager.UPNP_ID,
+ ConnectionManager.UPNP_TYPE,
+ ConnectionManager.DESCRIPTION_PATH,
+ connection_manager_type);
+ this.add_resource (resource);
+
+ resource = new ResourceInfo (Rygel.AVTransport.UPNP_ID,
+ Rygel.AVTransport.UPNP_TYPE,
+ Rygel.AVTransport.DESCRIPTION_PATH,
+ av_transport_type);
+ this.add_resource (resource);
+
+ resource = new ResourceInfo (RenderingControl.UPNP_ID,
+ RenderingControl.UPNP_TYPE,
+ RenderingControl.DESCRIPTION_PATH,
+ rendering_control_type);
+ this.add_resource (resource);
+ }
+}
+
--- /dev/null
+/*
+ * Copyright (C) 2008,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.
+ */
+
+public class Rygel.MediaServerPlugin : Rygel.Plugin {
+ private static const string MEDIA_SERVER_DESC_PATH =
+ BuildConfig.DATA_DIR + "/xml/MediaServer2.xml";
+
+ public MediaServerPlugin (string name,
+ string? title,
+ Type content_dir_type,
+ string? description = null) {
+ base (MEDIA_SERVER_DESC_PATH, name, title, description);
+
+ // MediaServer implementations must implement ContentDirectory service
+ var resource_info = new ResourceInfo (ContentDirectory.UPNP_ID,
+ ContentDirectory.UPNP_TYPE,
+ ContentDirectory.DESCRIPTION_PATH,
+ content_dir_type);
+ this.add_resource (resource_info);
+
+ // Register Rygel.ConnectionManager
+ resource_info = new ResourceInfo (ConnectionManager.UPNP_ID,
+ ConnectionManager.UPNP_TYPE,
+ ConnectionManager.DESCRIPTION_PATH,
+ typeof (SourceConnectionManager));
+
+ this.add_resource (resource_info);
+ resource_info = new ResourceInfo (
+ MediaReceiverRegistrar.UPNP_ID,
+ MediaReceiverRegistrar.UPNP_TYPE,
+ MediaReceiverRegistrar.DESCRIPTION_PATH,
+ typeof (MediaReceiverRegistrar));
+ this.add_resource (resource_info);
+ }
+}
+
* class or a subclass.
*/
public class Rygel.Plugin : GUPnP.ResourceFactory {
- private static const string MEDIA_SERVER_DESC_PATH =
- BuildConfig.DATA_DIR + "/xml/MediaServer2.xml";
- private static const string MEDIA_RENDERER_DESC_PATH =
- BuildConfig.DATA_DIR +
- "/xml/MediaRenderer2.xml";
-
private static const string ICON_BIG = "file://" +
BuildConfig.BIG_ICON_DIR +
"/rygel.png";
this.default_icons.add (icon);
}
- public Plugin.MediaServer (string name,
- string? title,
- Type content_dir_type,
- string? description = null) {
- this (MEDIA_SERVER_DESC_PATH, name, title, description);
-
- // MediaServer implementations must implement ContentDirectory service
- var resource_info = new ResourceInfo (ContentDirectory.UPNP_ID,
- ContentDirectory.UPNP_TYPE,
- ContentDirectory.DESCRIPTION_PATH,
- content_dir_type);
- this.add_resource (resource_info);
-
- // Register Rygel.ConnectionManager
- resource_info = new ResourceInfo (ConnectionManager.UPNP_ID,
- ConnectionManager.UPNP_TYPE,
- ConnectionManager.DESCRIPTION_PATH,
- typeof (SourceConnectionManager));
-
- this.add_resource (resource_info);
- resource_info = new ResourceInfo (
- MediaReceiverRegistrar.UPNP_ID,
- MediaReceiverRegistrar.UPNP_TYPE,
- MediaReceiverRegistrar.DESCRIPTION_PATH,
- typeof (MediaReceiverRegistrar));
- this.add_resource (resource_info);
- }
-
- public Plugin.MediaRenderer (string name,
- string? title,
- Type connection_manager_type,
- Type av_transport_type,
- Type rendering_control_type,
- string? description = null) {
- this (MEDIA_RENDERER_DESC_PATH, name, title, description);
-
- var resource = new ResourceInfo (ConnectionManager.UPNP_ID,
- ConnectionManager.UPNP_TYPE,
- ConnectionManager.DESCRIPTION_PATH,
- connection_manager_type);
- this.add_resource (resource);
-
- resource = new ResourceInfo (Rygel.AVTransport.UPNP_ID,
- Rygel.AVTransport.UPNP_TYPE,
- Rygel.AVTransport.DESCRIPTION_PATH,
- av_transport_type);
- this.add_resource (resource);
-
- resource = new ResourceInfo (RenderingControl.UPNP_ID,
- RenderingControl.UPNP_TYPE,
- RenderingControl.DESCRIPTION_PATH,
- rendering_control_type);
- this.add_resource (resource);
- }
-
public void add_resource (ResourceInfo resource_info) {
this.resource_infos.add (resource_info);
this.register_resource_type (resource_info.upnp_type,