exit LibCecTray when we detect that XBMC was started
[deb_libcec.git] / src / LibCecTray / controller / applications / internal / XBMCController.cs
index 5ab82833d8079e17a3d071e803aacba0347f0cce..fe15fd25edc18d3b62c2442ab9d3ce17b2433d4d 100644 (file)
@@ -56,6 +56,17 @@ namespace LibCECTray.controller.applications.@internal
       ControlApplication.Value = false;
 
       LoadXMLConfiguration();
+
+      ApplicationRunningChanged += RunningChanged;
+    }
+
+         static void RunningChanged(bool running)
+    {
+      if (running)
+      {
+        // XBMC is running, close the application, or we'll block communication
+        Application.Exit();
+      }
     }
 
     public override ApplicationAction DefaultValue(CecKeypress key)
@@ -281,8 +292,7 @@ namespace LibCECTray.controller.applications.@internal
 
         // only supported by 1.5.1+ clients
         output.AppendLine("<!-- the following lines are only supported by v1.5.1+ clients -->");
-        //TODO
-        //output.AppendLine("<setting id=\"send_inactive_source\" value=\"" + (config.SendInactiveSource ? 1 : 0) + "\" />");
+        output.AppendLine("<setting id=\"send_inactive_source\" value=\"" + (SendInactiveSource.Value ? 1 : 0) + "\" />");
 
         output.AppendLine("</settings>");
         writer.Write(output.ToString());