Rygel won't just be a MediaServer anymore soon, hence the renaming.
[http://live.gnome.org/Rygel])
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE
-AC_CONFIG_SRCDIR([src/rygel/rygel-media-server.vala])
+AC_CONFIG_SRCDIR([src/rygel/rygel-root-device.vala])
AM_CONFIG_HEADER([config.h])
AC_CONFIG_MACRO_DIR([m4])
AM_MAINTAINER_MODE
BUILT_SOURCES = rygel-1.0.vapi \
rygel.h \
- rygel-media-server.c \
- rygel-media-server-factory.c \
+ rygel-root-device.c \
+ rygel-root-device-factory.c \
rygel-configuration.c \
rygel-main.c \
rygel-content-directory.c \
$(BUILT_SOURCES) : rygel.stamp
rygel_SOURCES = $(VAPI_SOURCE_FILES) \
- rygel-media-server.c \
- rygel-media-server.vala \
- rygel-media-server-factory.c \
- rygel-media-server-factory.vala \
+ rygel-root-device.c \
+ rygel-root-device.vala \
+ rygel-root-device-factory.c \
+ rygel-root-device-factory.vala \
rygel-main.c \
rygel-main.vala \
rygel-content-directory.c \
*/
using GUPnP;
-using GConf;
using CStuff;
using Gee;
public class Rygel.Main : Object {
private PluginLoader plugin_loader;
- private MediaServerFactory ms_factory;
- private ArrayList<MediaServer> media_servers;
+ private RootDeviceFactory device_factory;
+ private ArrayList<RootDevice> root_devices;
private MainLoop main_loop;
public Main () throws GLib.Error {
Environment.set_application_name (_(BuildConfig.PACKAGE_NAME));
- this.media_servers = new ArrayList<MediaServer> ();
+ this.root_devices = new ArrayList<RootDevice> ();
this.plugin_loader = new PluginLoader ();
- this.ms_factory = new MediaServerFactory ();
+ this.device_factory = new RootDeviceFactory ();
this.main_loop = new GLib.MainLoop (null, false);
this.exit_code = 0;
private void on_plugin_loaded (PluginLoader plugin_loader,
Plugin plugin) {
try {
- var server = this.ms_factory.create_media_server (plugin);
+ var device = this.device_factory.create_root_device (plugin);
- server.available = plugin.available;
+ device.available = plugin.available;
- media_servers.add (server);
+ root_devices.add (device);
plugin.notify["available"] += this.on_plugin_notify;
} catch (GLib.Error error) {
- warning ("Failed to create MediaServer for %s. Reason: %s\n",
+ warning ("Failed to create RootDevice for %s. Reason: %s\n",
plugin.name,
error.message);
}
private void on_plugin_notify (Plugin plugin,
ParamSpec spec) {
- foreach (var server in this.media_servers) {
- if (server.resource_factory == plugin) {
- server.available = plugin.available;
+ foreach (var device in this.root_devices) {
+ if (device.resource_factory == plugin) {
+ device.available = plugin.available;
}
}
}
using GUPnP;
using CStuff;
-using Rygel;
-public errordomain MediaServerFactoryError {
+public errordomain RootDeviceFactoryError {
XML_PARSE,
PLUGIN_DISABLED
}
/**
- * Factory for MediaServer objects. Give it a plugin and it will create a
- * MediaServer device for that.
+ * Factory for RootDevice objects. Give it a plugin and it will create a
+ * Root device for that.
*/
-public class Rygel.MediaServerFactory {
+public class Rygel.RootDeviceFactory {
public static const string DESC_DOC = "xml/description.xml";
public static const string DESC_PREFIX = "Rygel";
private Configuration config;
private GUPnP.Context context;
- public MediaServerFactory () throws GLib.Error {
+ public RootDeviceFactory () throws GLib.Error {
this.config = Configuration.get_default ();
/* Set up GUPnP context */
this.context = create_upnp_context ();
}
- public MediaServer create_media_server (Plugin plugin) throws GLib.Error {
+ public RootDevice create_root_device (Plugin plugin) throws GLib.Error {
if (!this.config.get_enabled (plugin.name)) {
- throw new MediaServerFactoryError.PLUGIN_DISABLED (
+ throw new RootDeviceFactoryError.PLUGIN_DISABLED (
"Plugin disabled in user configuration.");
}
/* Host our modified file */
this.context.host_path (desc_path, "/" + modified_desc);
- return new MediaServer (this.context,
+ return new RootDevice (this.context,
plugin,
doc,
modified_desc);
if (doc == null) {
string message = "Failed to parse %s".printf (path);
- throw new MediaServerFactoryError.XML_PARSE (message);
+ throw new RootDeviceFactoryError.XML_PARSE (message);
}
/* Modify description to include Plugin-specific stuff */
*/
using GUPnP;
-using GConf;
using CStuff;
using Gee;
/**
- * Represents a MediaServer device.
+ * Represents a Root device.
*/
-public class Rygel.MediaServer: RootDevice {
+public class Rygel.RootDevice: GUPnP.RootDevice {
private ArrayList<ServiceInfo> services; /* Services we implement */
- public MediaServer (GUPnP.Context context,
- Plugin plugin,
- Xml.Doc *description_doc,
- string relative_location) {
+ public RootDevice (GUPnP.Context context,
+ Plugin plugin,
+ Xml.Doc *description_doc,
+ string relative_location) {
this.resource_factory = plugin;
this.root_device = null;
this.context = context;
}
}
- private static void xml_doc_free (Xml.Doc* doc, MediaServer server) {
+ private static void xml_doc_free (Xml.Doc* doc,
+ Rygel.RootDevice device) {
delete doc;
}
}