summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Georg <mail@jensge.org>2012-02-09 16:15:47 +0200
committerJens Georg <mail@jensge.org>2012-02-09 16:15:47 +0200
commit85691224004a2e0f770096dab6b5e8b606875c4b (patch)
treed3941db5f86795e556560ac9cf2136e41dcd2fa2
parent8001556de3a867b0f83604b1800ee4aa4cf562d7 (diff)
downloadrygel-85691224004a2e0f770096dab6b5e8b606875c4b.tar.gz
mpris: Allow to disable the whole module
-rw-r--r--doc/man/rygel.conf.xml1
-rw-r--r--src/plugins/mpris/rygel-mpris-plugin-factory.vala7
-rw-r--r--src/plugins/mpris/rygel-mpris-plugin.vala1
3 files changed, 9 insertions, 0 deletions
diff --git a/doc/man/rygel.conf.xml b/doc/man/rygel.conf.xml
index 5235dd0c..bc862ae2 100644
--- a/doc/man/rygel.conf.xml
+++ b/doc/man/rygel.conf.xml
@@ -494,6 +494,7 @@ enabled=false</programlisting>
<para><application>&dhpackage;</application> exposes media players that implement the provider side of this DBus specification as DLNA Digital Media Renderers (DMR) similar to the Playbin plugin. This means that you can easily turn your media player into a DMR by implementing this DBus specification.</para>
<para>Players that implement this spec and are known to work with <application>&dhpackage;</application> are <ulink url="http://banshee.fm">Banshee</ulink>, <ulink url="http://www.rhythmbox.org">Rhythmbox</ulink> and <ulink url="http://live.gnome.org/Totem">Totem</ulink>
</para>
+ <para>You can disable the whole functionality by setting <userinput>enabled=false</userinput> in the <userinput>[MRPIS]</userinput> section of the configuration file.</para>
<para>The configuration of this plugin is special. Plugin configuration is not done on the plugin but rather per peer that is found providing the MPRIS2 interface. See the following example to set the title for Banshee on MPRIS:</para>
<para><programlisting>[org.mpris.MediaPlayer2.banshee]
title=@REALNAME@&apos;s Banshee on @HOSTNAME@</programlisting></para>
diff --git a/src/plugins/mpris/rygel-mpris-plugin-factory.vala b/src/plugins/mpris/rygel-mpris-plugin-factory.vala
index 3c0a5a3c..4e3c695e 100644
--- a/src/plugins/mpris/rygel-mpris-plugin-factory.vala
+++ b/src/plugins/mpris/rygel-mpris-plugin-factory.vala
@@ -29,6 +29,13 @@ using FreeDesktop;
private MPRIS.PluginFactory plugin_factory;
public void module_init (PluginLoader loader) {
+ if (loader.plugin_disabled (MPRIS.Plugin.MODULE_NAME)) {
+ message ("Module '%s' disabled by user, igoring…",
+ MPRIS.Plugin.MODULE_NAME);
+
+ return;
+ }
+
try {
plugin_factory = new MPRIS.PluginFactory (loader);
} catch (IOError error) {
diff --git a/src/plugins/mpris/rygel-mpris-plugin.vala b/src/plugins/mpris/rygel-mpris-plugin.vala
index 03c425c3..587e0376 100644
--- a/src/plugins/mpris/rygel-mpris-plugin.vala
+++ b/src/plugins/mpris/rygel-mpris-plugin.vala
@@ -27,6 +27,7 @@ using Rygel.MPRIS.MediaPlayer;
using FreeDesktop;
public class Rygel.MPRIS.Plugin : Rygel.MediaRendererPlugin {
+ public const string MODULE_NAME = "MPRIS";
private const string MEDIA_PLAYER_PATH = "/org/mpris/MediaPlayer2";
public PlayerProxy actual_player;