[rygel] mpris: Pass plugin to player constructor
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] mpris: Pass plugin to player constructor
- Date: Wed, 9 Feb 2011 22:40:41 +0000 (UTC)
commit 149f2edacb3dc18843e32c5923d8e638d70c7d75
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Wed Feb 9 16:31:45 2011 +0200
mpris: Pass plugin to player constructor
Instead of passing all the fields of plugin, better just pass the plugin
instance itself and player constructor can just take everything it needs
from it.
src/plugins/mpris/rygel-mpris-player.vala | 10 ++++------
src/plugins/mpris/rygel-mpris-plugin.vala | 10 ++++------
2 files changed, 8 insertions(+), 12 deletions(-)
---
diff --git a/src/plugins/mpris/rygel-mpris-player.vala b/src/plugins/mpris/rygel-mpris-player.vala
index 44bcef5..abbe7be 100644
--- a/src/plugins/mpris/rygel-mpris-player.vala
+++ b/src/plugins/mpris/rygel-mpris-player.vala
@@ -112,12 +112,10 @@ public class Rygel.MPRIS.Player : GLib.Object, Rygel.MediaPlayer {
}
}
- public Player (PlayerProxy actual_player,
- string[] mime_types,
- string[] protocols) {
- this.actual_player = actual_player;
- this.mime_types = mime_types;
- this.protocols = protocols;
+ public Player (Plugin plugin) {
+ this.actual_player = plugin.actual_player;
+ this.mime_types = plugin.mime_types;
+ this.protocols = plugin.protocols;
actual_player.g_properties_changed.connect (this.on_properties_changed);
}
diff --git a/src/plugins/mpris/rygel-mpris-plugin.vala b/src/plugins/mpris/rygel-mpris-plugin.vala
index 142c518..03c425c 100644
--- a/src/plugins/mpris/rygel-mpris-plugin.vala
+++ b/src/plugins/mpris/rygel-mpris-plugin.vala
@@ -29,10 +29,10 @@ using FreeDesktop;
public class Rygel.MPRIS.Plugin : Rygel.MediaRendererPlugin {
private const string MEDIA_PLAYER_PATH = "/org/mpris/MediaPlayer2";
- private PlayerProxy actual_player;
+ public PlayerProxy actual_player;
- private string[] mime_types;
- private string[] protocols;
+ public string[] mime_types;
+ public string[] protocols;
public Plugin (string service_name,
PlayerProxy actual_player) {
@@ -50,9 +50,7 @@ public class Rygel.MPRIS.Plugin : Rygel.MediaRendererPlugin {
}
public override Rygel.MediaPlayer? get_player () {
- return new MPRIS.Player (this.actual_player,
- this.mime_types,
- this.protocols);
+ return new MPRIS.Player (this);
}
private string[] schemes_to_protocols (string[] schemes) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]