[rygel] Attach the availability of MediaServer and Plugin
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: svn-commits-list gnome org
- Subject: [rygel] Attach the availability of MediaServer and Plugin
- Date: Mon, 11 May 2009 10:06:13 -0400 (EDT)
commit 4e5a233c7c6986b06ff7b35d7682848997faa423
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Sun May 10 04:12:27 2009 +0300
Attach the availability of MediaServer and Plugin
Attach the availability of the Plugin to it's associated MediaServer.
---
src/rygel/rygel-main.vala | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/rygel/rygel-main.vala b/src/rygel/rygel-main.vala
index ff453b9..70fbd08 100644
--- a/src/rygel/rygel-main.vala
+++ b/src/rygel/rygel-main.vala
@@ -72,10 +72,11 @@ public class Rygel.Main : Object {
try {
var server = this.ms_factory.create_media_server (plugin);
- /* Make our device available */
- server.available = true;
+ server.available = plugin.available;
media_servers.add (server);
+
+ plugin.notify["available"] += this.on_plugin_notify;
} catch (GLib.Error error) {
warning ("Failed to create MediaServer for %s. Reason: %s\n",
plugin.name,
@@ -83,6 +84,15 @@ public class Rygel.Main : Object {
}
}
+ 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;
+ }
+ }
+ }
+
public static int main (string[] args) {
Main main;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]