Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

FEAT_3767 Remove master slave

  • Loading branch information...
commit c5cc20ed7cd9d550c33b1f739b1ceeffc0f8938b 1 parent 2d26d46
@riksmith riksmith authored
Showing with 3,676 additions and 5,999 deletions.
  1. +78 −84 TvEngine3/TVLibrary/Plugins/PluginBase/PluginBase.cs
  2. +12 −0 TvEngine3/TVLibrary/SetupTv/62_upgrade_mysql_database.sql
  3. +19 −0 TvEngine3/TVLibrary/SetupTv/62_upgrade_sqlserver_database.sql
  4. +0 −135 TvEngine3/TVLibrary/SetupTv/Dialogs/FormEditIpAdress.Designer.cs
  5. +0 −86 TvEngine3/TVLibrary/SetupTv/Dialogs/FormEditIpAdress.cs
  6. +0 −120 TvEngine3/TVLibrary/SetupTv/Dialogs/FormEditIpAdress.resx
  7. +5 −18 TvEngine3/TVLibrary/SetupTv/Sections/ImportExport.cs
  8. +0 −204 TvEngine3/TVLibrary/SetupTv/Sections/Servers.Designer.cs
  9. +0 −172 TvEngine3/TVLibrary/SetupTv/Sections/Servers.cs
  10. +0 −142 TvEngine3/TVLibrary/SetupTv/Sections/Servers.resx
  11. +240 −244 TvEngine3/TVLibrary/SetupTv/Sections/StreamingServer.cs
  12. +327 −329 TvEngine3/TVLibrary/SetupTv/Sections/ThirdPartyChecks.cs
  13. +0 −24 TvEngine3/TVLibrary/SetupTv/Sections/TvRecording.cs
  14. +105 −214 TvEngine3/TVLibrary/SetupTv/SettingsForm.cs
  15. +2 −20 TvEngine3/TVLibrary/SetupTv/SetupTv.csproj
  16. +3 −28 TvEngine3/TVLibrary/TVDatabase/Card.cs
  17. +599 −623 TvEngine3/TVLibrary/TVDatabase/Recording.cs
  18. +0 −272 TvEngine3/TVLibrary/TVDatabase/Server.cs
  19. +0 −1  TvEngine3/TVLibrary/TVDatabase/TVDatabase.csproj
  20. +2 −3 TvEngine3/TVLibrary/TVDatabase/TvBusinessLayer/BusinessLayer.cs
  21. +83 −86 TvEngine3/TVLibrary/TVLibrary/Implementations/DVB/ConditionalAccess/KNC/KNCDeviceLookup.cs
  22. +419 −407 TvEngine3/TVLibrary/TVLibrary/Streaming/RtspStreaming.cs
  23. +0 −11 TvEngine3/TVLibrary/TvControl/Controller.cs
  24. +415 −415 TvEngine3/TVLibrary/TvControl/RemoteControl.cs
  25. +3 −22 TvEngine3/TVLibrary/TvPlugin/TvPlugin/TvSetup.cs
  26. +1 −2  TvEngine3/TVLibrary/TvService/CardManagement/CardAllocation/AdvancedCardAllocation.cs
  27. +114 −167 TvEngine3/TVLibrary/TvService/CardManagement/CardHandler/AudioStreams.cs
  28. +7 −80 TvEngine3/TVLibrary/TvService/CardManagement/CardHandler/CardTuner.cs
  29. +122 −170 TvEngine3/TVLibrary/TvService/CardManagement/CardHandler/ChannelScanning.cs
  30. +164 −213 TvEngine3/TVLibrary/TvService/CardManagement/CardHandler/DisEqcManagement.cs
  31. +161 −255 TvEngine3/TVLibrary/TvService/CardManagement/CardHandler/EpgGrabbing.cs
  32. +70 −71 TvEngine3/TVLibrary/TvService/CardManagement/CardHandler/ITvCardHandler.cs
  33. +328 −475 TvEngine3/TVLibrary/TvService/CardManagement/CardHandler/TeletextManagement.cs
  34. +0 −33 TvEngine3/TVLibrary/TvService/CardManagement/CardHandler/TimeShifter.cs
  35. +4 −270 TvEngine3/TVLibrary/TvService/CardManagement/CardHandler/TvCardHandler.cs
  36. +0 −43 TvEngine3/TVLibrary/TvService/CardManagement/CardHandler/UserManagement.cs
  37. +6 −6 TvEngine3/TVLibrary/TvService/Epg/EpgCard.cs
  38. +297 −311 TvEngine3/TVLibrary/TvService/Epg/EpgGrabber.cs
  39. +1 −2  TvEngine3/TVLibrary/TvService/Scheduler/Scheduler.cs
  40. +13 −16 TvEngine3/TVLibrary/TvService/Service1.cs
  41. +76 −225 TvEngine3/TVLibrary/TvService/TVController.cs
View
162 TvEngine3/TVLibrary/Plugins/PluginBase/PluginBase.cs
@@ -1,85 +1,79 @@
-#region Copyright (C) 2005-2011 Team MediaPortal
-
-// Copyright (C) 2005-2011 Team MediaPortal
-// http://www.team-mediaportal.com
-//
-// MediaPortal is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 2 of the License, or
-// (at your option) any later version.
-//
-// MediaPortal is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with MediaPortal. If not, see <http://www.gnu.org/licenses/>.
-
-#endregion
-
-using TvControl;
-
-namespace TvEngine
-{
- /// <summary>
- /// Interface for plugins that implement the StartedAll method.
- /// </summary>
- public interface ITvServerPluginStartedAll
- {
- /// <summary>
- /// Called when all plugins where started.
- /// </summary>
- void StartedAll();
- }
-
- /// <summary>
- /// base class for tv-server plugins
- /// </summary>
- public interface ITvServerPlugin
- {
- #region properties
-
- /// <summary>
- /// returns the name of the plugin
- /// </summary>
- string Name { get; }
-
- /// <summary>
- /// returns the version of the plugin
- /// </summary>
- string Version { get; }
-
- /// <summary>
- /// returns the author of the plugin
- /// </summary>
- string Author { get; }
-
- /// <summary>
- /// returns if the plugin should only run on the master server
- /// or also on slave servers
- /// </summary>
- bool MasterOnly { get; }
-
- #endregion
-
- #region methods
-
- /// <summary>
- /// Starts the plugin
- /// </summary>
- void Start(IController controller);
-
- /// <summary>
- /// Stops the plugin
- /// </summary>
- void Stop();
-
- /// <summary>
- /// returns the setup sections for display in SetupTv
- /// </summary>
- SetupTv.SectionSettings Setup { get; }
-
- #endregion
- }
+#region Copyright (C) 2005-2011 Team MediaPortal
+
+// Copyright (C) 2005-2011 Team MediaPortal
+// http://www.team-mediaportal.com
+//
+// MediaPortal is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 2 of the License, or
+// (at your option) any later version.
+//
+// MediaPortal is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with MediaPortal. If not, see <http://www.gnu.org/licenses/>.
+
+#endregion
+
+using TvControl;
+
+namespace TvEngine
+{
+ /// <summary>
+ /// Interface for plugins that implement the StartedAll method.
+ /// </summary>
+ public interface ITvServerPluginStartedAll
+ {
+ /// <summary>
+ /// Called when all plugins where started.
+ /// </summary>
+ void StartedAll();
+ }
+
+ /// <summary>
+ /// base class for tv-server plugins
+ /// </summary>
+ public interface ITvServerPlugin
+ {
+ #region properties
+
+ /// <summary>
+ /// returns the name of the plugin
+ /// </summary>
+ string Name { get; }
+
+ /// <summary>
+ /// returns the version of the plugin
+ /// </summary>
+ string Version { get; }
+
+ /// <summary>
+ /// returns the author of the plugin
+ /// </summary>
+ string Author { get; }
+
+ #endregion
+
+ #region methods
+
+ /// <summary>
+ /// Starts the plugin
+ /// </summary>
+ void Start(IController controller);
+
+ /// <summary>
+ /// Stops the plugin
+ /// </summary>
+ void Stop();
+
+ /// <summary>
+ /// returns the setup sections for display in SetupTv
+ /// </summary>
+ SetupTv.SectionSettings Setup { get; }
+
+ #endregion
+ }
}
View
12 TvEngine3/TVLibrary/SetupTv/62_upgrade_mysql_database.sql
@@ -0,0 +1,12 @@
+USE %TvLibrary%;
+
+INSERT INTO setting (tag, `value`) values ("hostName", (SELECT hostName FROM server LIMIT 1));
+INSERT INTO setting (tag, `value`) values ("rtspPort", (SELECT rtspPort FROM server LIMIT 1));
+
+ALTER TABLE recording DROP COLUMN idServer, DROP INDEX FK_Recording_Server;
+
+ALTER TABLE card DROP COLUMN idServer, DROP INDEX FK_Card_Server;
+
+DROP TABLE server;
+
+UPDATE Version SET versionNumber=62;
View
19 TvEngine3/TVLibrary/SetupTv/62_upgrade_sqlserver_database.sql
@@ -0,0 +1,19 @@
+USE %TvLibrary%;
+GO
+
+INSERT INTO setting (tag, `value`) values ("hostName", (SELECT TOP 1 hostName FROM server))
+GO
+
+INSERT INTO setting (tag, `value`) values ("rtspPort", (SELECT rtspPort FROM server LIMIT 1))
+GO
+
+ALTER TABLE recording DROP COLUMN idServer
+GO
+
+ALTER TABLE card DROP COLUMN idServer
+GO
+
+DROP TABLE server;
+
+UPDATE Version SET versionNumber=62
+GO
View
135 TvEngine3/TVLibrary/SetupTv/Dialogs/FormEditIpAdress.Designer.cs
@@ -1,135 +0,0 @@
-namespace SetupTv.Sections
-{
- partial class FormEditIpAdress
- {
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.IContainer components = null;
-
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Windows Form Designer generated code
-
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- this.mpLabel1 = new MediaPortal.UserInterface.Controls.MPLabel();
- this.mpButtonOK = new MediaPortal.UserInterface.Controls.MPButton();
- this.mpButtonCancel = new MediaPortal.UserInterface.Controls.MPButton();
- this.mpComboBox1 = new MediaPortal.UserInterface.Controls.MPComboBox();
- this.mpLabel2 = new MediaPortal.UserInterface.Controls.MPLabel();
- this.PortNoNumericTextBox = new MediaPortal.UserInterface.Controls.MPNumericTextBox();
- this.SuspendLayout();
- //
- // mpLabel1
- //
- this.mpLabel1.AutoSize = true;
- this.mpLabel1.BackColor = System.Drawing.SystemColors.Control;
- this.mpLabel1.Location = new System.Drawing.Point(12, 14);
- this.mpLabel1.Name = "mpLabel1";
- this.mpLabel1.Size = new System.Drawing.Size(329, 13);
- this.mpLabel1.TabIndex = 0;
- this.mpLabel1.Text = "Please select the IP address used by the server for RTSP streaming:";
- //
- // mpButtonOK
- //
- this.mpButtonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.mpButtonOK.Location = new System.Drawing.Point(189, 140);
- this.mpButtonOK.Name = "mpButtonOK";
- this.mpButtonOK.Size = new System.Drawing.Size(75, 23);
- this.mpButtonOK.TabIndex = 1;
- this.mpButtonOK.Text = "OK";
- this.mpButtonOK.UseVisualStyleBackColor = true;
- this.mpButtonOK.Click += new System.EventHandler(this.button1_Click);
- //
- // mpButtonCancel
- //
- this.mpButtonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.mpButtonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
- this.mpButtonCancel.Location = new System.Drawing.Point(270, 140);
- this.mpButtonCancel.Name = "mpButtonCancel";
- this.mpButtonCancel.Size = new System.Drawing.Size(75, 23);
- this.mpButtonCancel.TabIndex = 2;
- this.mpButtonCancel.Text = "Cancel";
- this.mpButtonCancel.UseVisualStyleBackColor = true;
- this.mpButtonCancel.Click += new System.EventHandler(this.button2_Click);
- //
- // mpComboBox1
- //
- this.mpComboBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.mpComboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.mpComboBox1.FormattingEnabled = true;
- this.mpComboBox1.Location = new System.Drawing.Point(15, 41);
- this.mpComboBox1.Name = "mpComboBox1";
- this.mpComboBox1.Size = new System.Drawing.Size(330, 21);
- this.mpComboBox1.TabIndex = 0;
- //
- // mpLabel2
- //
- this.mpLabel2.AutoSize = true;
- this.mpLabel2.Location = new System.Drawing.Point(12, 75);
- this.mpLabel2.Name = "mpLabel2";
- this.mpLabel2.Size = new System.Drawing.Size(269, 13);
- this.mpLabel2.TabIndex = 3;
- this.mpLabel2.Text = "Please select the port for RTSP streaming (default 554):";
- //
- // PortNoNumericTextBox
- //
- this.PortNoNumericTextBox.Location = new System.Drawing.Point(15, 101);
- this.PortNoNumericTextBox.Name = "PortNoNumericTextBox";
- this.PortNoNumericTextBox.Size = new System.Drawing.Size(100, 20);
- this.PortNoNumericTextBox.TabIndex = 5;
- this.PortNoNumericTextBox.Text = "554";
- this.PortNoNumericTextBox.Value = 554;
- //
- // FormEditIpAdress
- //
- this.AcceptButton = this.mpButtonOK;
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.CancelButton = this.mpButtonCancel;
- this.ClientSize = new System.Drawing.Size(365, 175);
- this.Controls.Add(this.PortNoNumericTextBox);
- this.Controls.Add(this.mpLabel2);
- this.Controls.Add(this.mpComboBox1);
- this.Controls.Add(this.mpButtonCancel);
- this.Controls.Add(this.mpButtonOK);
- this.Controls.Add(this.mpLabel1);
- this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
- this.Name = "FormEditIpAdress";
- this.ShowIcon = false;
- this.ShowInTaskbar = false;
- this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
- this.Text = "Assign network interface for streaming";
- this.Load += new System.EventHandler(this.FormEditIpAdress_Load);
- this.ResumeLayout(false);
- this.PerformLayout();
-
- }
-
- #endregion
-
- private MediaPortal.UserInterface.Controls.MPLabel mpLabel1;
- private MediaPortal.UserInterface.Controls.MPComboBox mpComboBox1;
- private MediaPortal.UserInterface.Controls.MPButton mpButtonOK;
- private MediaPortal.UserInterface.Controls.MPButton mpButtonCancel;
- private MediaPortal.UserInterface.Controls.MPLabel mpLabel2;
- private MediaPortal.UserInterface.Controls.MPNumericTextBox PortNoNumericTextBox;
- }
-}
View
86 TvEngine3/TVLibrary/SetupTv/Dialogs/FormEditIpAdress.cs
@@ -1,86 +0,0 @@
-#region Copyright (C) 2005-2011 Team MediaPortal
-
-// Copyright (C) 2005-2011 Team MediaPortal
-// http://www.team-mediaportal.com
-//
-// MediaPortal is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 2 of the License, or
-// (at your option) any later version.
-//
-// MediaPortal is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with MediaPortal. If not, see <http://www.gnu.org/licenses/>.
-
-#endregion
-
-using System;
-using System.Collections.Generic;
-using System.Windows.Forms;
-using TvControl;
-
-namespace SetupTv.Sections
-{
- public partial class FormEditIpAdress : Form
- {
- private string _hostName = "";
- private int _portNo = 554;
-
- public FormEditIpAdress()
- {
- InitializeComponent();
- }
-
- private void FormEditIpAdress_Load(object sender, EventArgs e)
- {
- List<string> ipAdresses = RemoteControl.Instance.ServerIpAdresses;
- mpComboBox1.Items.Clear();
- int selected = 0;
- int counter = 0;
- foreach (string ipAdress in ipAdresses)
- {
- mpComboBox1.Items.Add(ipAdress);
- if (String.Compare(ipAdress, HostName, true) == 0)
- {
- selected = counter;
- }
- counter++;
- }
- mpComboBox1.SelectedIndex = selected;
- PortNoNumericTextBox.Value = PortNo;
- }
-
- private void button2_Click(object sender, EventArgs e)
- {
- DialogResult = DialogResult.Cancel;
- Close();
- }
-
- private void button1_Click(object sender, EventArgs e)
- {
- if (mpComboBox1.SelectedIndex >= 0)
- {
- HostName = mpComboBox1.SelectedItem.ToString();
- PortNo = PortNoNumericTextBox.Value;
- }
- DialogResult = DialogResult.OK;
- Close();
- }
-
- public string HostName
- {
- get { return _hostName; }
- set { _hostName = value; }
- }
-
- public int PortNo
- {
- get { return _portNo; }
- set { _portNo = value; }
- }
- }
-}
View
120 TvEngine3/TVLibrary/SetupTv/Dialogs/FormEditIpAdress.resx
@@ -1,120 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
- <!--
- Microsoft ResX Schema
-
- Version 2.0
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
- associated with the data types.
-
- Example:
-
- ... ado.net/XML headers & schema ...
- <resheader name="resmimetype">text/microsoft-resx</resheader>
- <resheader name="version">2.0</resheader>
- <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
- <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
- <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
- <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
- <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
- <value>[base64 mime encoded serialized .NET Framework object]</value>
- </data>
- <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
- <comment>This is a comment</comment>
- </data>
-
- There are any number of "resheader" rows that contain simple
- name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
- mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
- extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
- read any of the formats listed below.
-
- mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
- : using a System.ComponentModel.TypeConverter
- : and then encoded with base64 encoding.
- -->
- <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
- <xsd:element name="root" msdata:IsDataSet="true">
- <xsd:complexType>
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="metadata">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="name" use="required" type="xsd:string" />
- <xsd:attribute name="type" type="xsd:string" />
- <xsd:attribute name="mimetype" type="xsd:string" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="assembly">
- <xsd:complexType>
- <xsd:attribute name="alias" type="xsd:string" />
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="data">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="resheader">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- <resheader name="resmimetype">
- <value>text/microsoft-resx</value>
- </resheader>
- <resheader name="version">
- <value>2.0</value>
- </resheader>
- <resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
-</root>
View
23 TvEngine3/TVLibrary/SetupTv/Sections/ImportExport.cs
@@ -91,19 +91,10 @@ private static void AddAttribute(XmlNode node, string tagName, bool tagValue)
XmlNode rootElement = xmlDoc.CreateElement("tvserver");
AddAttribute(rootElement, "version", "1.0");
- XmlNode nodeServers = xmlDoc.CreateElement("servers");
- IList<Server> servers = Server.ListAll();
- foreach (Server server in servers)
+ XmlNode nodeCards = xmlDoc.CreateElement("cards");
+ IList<Card> cards = Card.ListAll();
+ foreach (Card card in cards)
{
- XmlNode nodeServer = xmlDoc.CreateElement("server");
- AddAttribute(nodeServer, "HostName", server.HostName);
- AddAttribute(nodeServer, "IdServer", server.IdServer);
- AddAttribute(nodeServer, "IsMaster", server.IsMaster);
-
- XmlNode nodeCards = xmlDoc.CreateElement("cards");
- IList<Card> cards = Card.ListAll();
- foreach (Card card in cards)
- {
XmlNode nodeCard = xmlDoc.CreateElement("card");
AddAttribute(nodeCard, "IdCard", card.IdCard);
AddAttribute(nodeCard, "DevicePath", card.DevicePath);
@@ -121,12 +112,8 @@ private static void AddAttribute(XmlNode node, string tagName, bool tagValue)
AddAttribute(nodeCard, "CAM", card.CAM);
AddAttribute(nodeCard, "netProvider", card.netProvider);
AddAttribute(nodeCard, "StopGraph", card.StopGraph);
- nodeCards.AppendChild(nodeCard);
- }
- nodeServer.AppendChild(nodeCards);
- nodeServers.AppendChild(nodeServer);
}
- rootElement.AppendChild(nodeServers);
+ rootElement.AppendChild(nodeCards);
XmlNode nodechannels = xmlDoc.CreateElement("channels");
IList<Channel> channels = Channel.ListAll();
@@ -462,7 +449,7 @@ private void importButton_Click(object sender, EventArgs e)
{
int idCard = Int32.Parse(nodeMap.Attributes["IdCard"].Value);
XmlNode nodeCard =
- doc.SelectSingleNode(String.Format("/tvserver/servers/server/cards/card[@IdCard={0}]", idCard));
+ doc.SelectSingleNode(String.Format("/tvserver/cards/card[@IdCard={0}]", idCard));
Card dbCard = layer.GetCardByDevicePath(nodeCard.Attributes["DevicePath"].Value);
if (dbCard != null)
{
View
204 TvEngine3/TVLibrary/SetupTv/Sections/Servers.Designer.cs
@@ -1,204 +0,0 @@
-namespace SetupTv.Sections
-{
- partial class Servers
- {
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.IContainer components = null;
-
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Windows Form Designer generated code
-
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- this.components = new System.ComponentModel.Container();
- System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Servers));
- this.mpListView1 = new MediaPortal.UserInterface.Controls.MPListView();
- this.columnHeader1 = new System.Windows.Forms.ColumnHeader();
- this.columnHeader2 = new System.Windows.Forms.ColumnHeader();
- this.columnHeader3 = new System.Windows.Forms.ColumnHeader();
- this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
- this.chooseIPForStreamingToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
- this.imageList1 = new System.Windows.Forms.ImageList(this.components);
- this.buttonDelete = new System.Windows.Forms.Button();
- this.buttonMaster = new System.Windows.Forms.Button();
- this.buttonChooseIp = new System.Windows.Forms.Button();
- this.tabControl1 = new System.Windows.Forms.TabControl();
- this.tabPage1 = new System.Windows.Forms.TabPage();
- this.contextMenuStrip1.SuspendLayout();
- this.tabControl1.SuspendLayout();
- this.tabPage1.SuspendLayout();
- this.SuspendLayout();
- //
- // mpListView1
- //
- this.mpListView1.AllowDrop = true;
- this.mpListView1.AllowRowReorder = true;
- this.mpListView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.mpListView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
- this.columnHeader1,
- this.columnHeader2,
- this.columnHeader3});
- this.mpListView1.ContextMenuStrip = this.contextMenuStrip1;
- this.mpListView1.FullRowSelect = true;
- this.mpListView1.HideSelection = false;
- this.mpListView1.IsChannelListView = false;
- this.mpListView1.LargeImageList = this.imageList1;
- this.mpListView1.Location = new System.Drawing.Point(0, 0);
- this.mpListView1.MultiSelect = false;
- this.mpListView1.Name = "mpListView1";
- this.mpListView1.Size = new System.Drawing.Size(452, 203);
- this.mpListView1.SmallImageList = this.imageList1;
- this.mpListView1.TabIndex = 0;
- this.mpListView1.UseCompatibleStateImageBehavior = false;
- this.mpListView1.View = System.Windows.Forms.View.Details;
- this.mpListView1.SelectedIndexChanged += new System.EventHandler(this.mpListView1_SelectedIndexChanged);
- //
- // columnHeader1
- //
- this.columnHeader1.Text = "Server";
- this.columnHeader1.Width = 200;
- //
- // columnHeader2
- //
- this.columnHeader2.Text = "Type";
- //
- // columnHeader3
- //
- this.columnHeader3.Text = "RTSP Port";
- this.columnHeader3.Width = 75;
- //
- // contextMenuStrip1
- //
- this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.chooseIPForStreamingToolStripMenuItem});
- this.contextMenuStrip1.Name = "contextMenuStrip1";
- this.contextMenuStrip1.Size = new System.Drawing.Size(214, 26);
- this.contextMenuStrip1.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStrip1_Opening);
- //
- // chooseIPForStreamingToolStripMenuItem
- //
- this.chooseIPForStreamingToolStripMenuItem.Name = "chooseIPForStreamingToolStripMenuItem";
- this.chooseIPForStreamingToolStripMenuItem.Size = new System.Drawing.Size(213, 22);
- this.chooseIPForStreamingToolStripMenuItem.Text = "Change streaming settings";
- this.chooseIPForStreamingToolStripMenuItem.Click += new System.EventHandler(this.chooseIPForStreamingToolStripMenuItem_Click);
- //
- // imageList1
- //
- this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
- this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
- this.imageList1.Images.SetKeyName(0, "computer.gif");
- //
- // buttonDelete
- //
- this.buttonDelete.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.buttonDelete.Location = new System.Drawing.Point(377, 178);
- this.buttonDelete.Name = "buttonDelete";
- this.buttonDelete.Size = new System.Drawing.Size(75, 23);
- this.buttonDelete.TabIndex = 3;
- this.buttonDelete.Text = "Delete";
- this.buttonDelete.UseVisualStyleBackColor = true;
- this.buttonDelete.Visible = false;
- this.buttonDelete.Click += new System.EventHandler(this.buttonDelete_Click);
- //
- // buttonMaster
- //
- this.buttonMaster.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
- this.buttonMaster.Location = new System.Drawing.Point(167, 178);
- this.buttonMaster.Name = "buttonMaster";
- this.buttonMaster.Size = new System.Drawing.Size(135, 23);
- this.buttonMaster.TabIndex = 2;
- this.buttonMaster.Text = "Set as master server";
- this.buttonMaster.UseVisualStyleBackColor = true;
- this.buttonMaster.Visible = false;
- this.buttonMaster.Click += new System.EventHandler(this.buttonMaster_Click);
- //
- // buttonChooseIp
- //
- this.buttonChooseIp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
- this.buttonChooseIp.Enabled = false;
- this.buttonChooseIp.Location = new System.Drawing.Point(6, 178);
- this.buttonChooseIp.Name = "buttonChooseIp";
- this.buttonChooseIp.Size = new System.Drawing.Size(155, 23);
- this.buttonChooseIp.TabIndex = 1;
- this.buttonChooseIp.Text = "Change streaming settings";
- this.buttonChooseIp.UseVisualStyleBackColor = true;
- this.buttonChooseIp.Visible = false;
- this.buttonChooseIp.Click += new System.EventHandler(this.buttonChooseIp_Click);
- //
- // tabControl1
- //
- this.tabControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
- | System.Windows.Forms.AnchorStyles.Left)
- | System.Windows.Forms.AnchorStyles.Right)));
- this.tabControl1.Controls.Add(this.tabPage1);
- this.tabControl1.Location = new System.Drawing.Point(3, 3);
- this.tabControl1.Name = "tabControl1";
- this.tabControl1.SelectedIndex = 0;
- this.tabControl1.Size = new System.Drawing.Size(466, 232);
- this.tabControl1.TabIndex = 10;
- //
- // tabPage1
- //
- this.tabPage1.Controls.Add(this.mpListView1);
- this.tabPage1.Controls.Add(this.buttonMaster);
- this.tabPage1.Controls.Add(this.buttonDelete);
- this.tabPage1.Controls.Add(this.buttonChooseIp);
- this.tabPage1.Location = new System.Drawing.Point(4, 22);
- this.tabPage1.Name = "tabPage1";
- this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
- this.tabPage1.Size = new System.Drawing.Size(458, 206);
- this.tabPage1.TabIndex = 0;
- this.tabPage1.Text = "Servers";
- this.tabPage1.UseVisualStyleBackColor = true;
- //
- // Servers
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.Controls.Add(this.tabControl1);
- this.Name = "Servers";
- this.Size = new System.Drawing.Size(469, 240);
- this.Load += new System.EventHandler(this.Servers_Load);
- this.contextMenuStrip1.ResumeLayout(false);
- this.tabControl1.ResumeLayout(false);
- this.tabPage1.ResumeLayout(false);
- this.ResumeLayout(false);
-
- }
-
- #endregion
-
- private MediaPortal.UserInterface.Controls.MPListView mpListView1;
- private System.Windows.Forms.ColumnHeader columnHeader1;
- private System.Windows.Forms.Button buttonDelete;
- private System.Windows.Forms.ColumnHeader columnHeader2;
- private System.Windows.Forms.Button buttonMaster;
- private System.Windows.Forms.Button buttonChooseIp;
- private System.Windows.Forms.ImageList imageList1;
- private System.Windows.Forms.TabControl tabControl1;
- private System.Windows.Forms.TabPage tabPage1;
- private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
- private System.Windows.Forms.ToolStripMenuItem chooseIPForStreamingToolStripMenuItem;
- private System.Windows.Forms.ColumnHeader columnHeader3;
- }
-}
View
172 TvEngine3/TVLibrary/SetupTv/Sections/Servers.cs
@@ -1,172 +0,0 @@
-#region Copyright (C) 2005-2011 Team MediaPortal
-
-// Copyright (C) 2005-2011 Team MediaPortal
-// http://www.team-mediaportal.com
-//
-// MediaPortal is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 2 of the License, or
-// (at your option) any later version.
-//
-// MediaPortal is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with MediaPortal. If not, see <http://www.gnu.org/licenses/>.
-
-#endregion
-
-using System;
-using System.Collections.Generic;
-using System.Windows.Forms;
-using TvControl;
-using TvDatabase;
-
-namespace SetupTv.Sections
-{
- public partial class Servers : SectionSettings
- {
- public Servers()
- : this("TV Servers") {}
-
- public Servers(string name)
- : base(name)
- {
- InitializeComponent();
- }
-
- public override void OnSectionActivated()
- {
- IList<Server> servers = Server.ListAll();
- mpListView1.Items.Clear();
- foreach (Server server in servers)
- {
- ListViewItem item = mpListView1.Items.Add(server.HostName, 0);
- if (server.IsMaster)
- {
- item.SubItems.Add("Master");
- }
- else
- {
- item.SubItems.Add("Slave");
- }
- item.SubItems.Add(server.RtspPort.ToString());
- item.Tag = server;
- }
- mpListView1.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);
- }
-
- private void Servers_Load(object sender, EventArgs e) {}
-
- private void buttonDelete_Click(object sender, EventArgs e)
- {
- if (mpListView1.SelectedIndices.Count < 1)
- return;
- int index = mpListView1.SelectedIndices[0];
- ListViewItem item = mpListView1.Items[index];
- Server server = (Server)item.Tag;
- server.Delete();
- MessageBox.Show(this, "Changes made require TvService to restart. Please restart the tvservice");
- RemoteControl.Instance.Restart();
- OnSectionActivated();
- }
-
- private void buttonMaster_Click(object sender, EventArgs e)
- {
- if (mpListView1.SelectedIndices.Count < 1)
- return;
- int index = mpListView1.SelectedIndices[0];
- for (int i = 0; i < mpListView1.Items.Count; ++i)
- {
- ListViewItem item = mpListView1.Items[i];
- Server server = (Server)item.Tag;
- if (i != index)
- {
- item.SubItems[0].Text = "Slave";
- server.IsMaster = false;
- }
- else
- {
- item.SubItems[0].Text = "Master";
- server.IsMaster = true;
- RemoteControl.HostName = server.HostName;
- }
- server.Persist();
- }
- RemoteControl.Instance.Restart();
- MessageBox.Show(this, "Changes made require TvService to restart. Please restart the tvservice");
- }
-
- private void buttonChooseIp_Click(object sender, EventArgs e)
- {
- if (mpListView1.SelectedIndices.Count < 1)
- return;
- int index = mpListView1.SelectedIndices[0];
- ListViewItem item = mpListView1.Items[index];
- Server server = (Server)item.Tag;
-
- FormEditIpAdress dlg = new FormEditIpAdress();
- dlg.HostName = server.HostName;
- dlg.PortNo = server.RtspPort;
- if (dlg.ShowDialog(this) == DialogResult.OK)
- {
- if (dlg.HostName.Equals(server.HostName) == false || dlg.PortNo != server.RtspPort)
- {
- item.Text = dlg.HostName;
- item.SubItems[2].Text = dlg.PortNo.ToString();
- server.HostName = dlg.HostName;
- server.RtspPort = dlg.PortNo;
- server.Persist();
- ServiceNeedsToRestart();
- }
- }
- }
-
- private void ServiceNeedsToRestart()
- {
- if (
- MessageBox.Show(this, "Changes made require TvService to restart. Restart it now?", "TvService",
- MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
- {
- NotifyForm dlgNotify = new NotifyForm("Restart TvService...", "This can take some time\n\nPlease be patient...");
- dlgNotify.Show();
- dlgNotify.WaitForDisplay();
-
- RemoteControl.Instance.Restart();
-
- dlgNotify.Close();
- }
- }
-
- private void mpListView1_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (mpListView1.SelectedItems.Count == 0)
- {
- buttonChooseIp.Enabled = false;
- }
- else
- {
- buttonChooseIp.Enabled = true;
- }
- }
-
- private void contextMenuStrip1_Opening(object sender, System.ComponentModel.CancelEventArgs e)
- {
- if (mpListView1.SelectedItems.Count == 0)
- {
- chooseIPForStreamingToolStripMenuItem.Enabled = false;
- }
- else
- {
- chooseIPForStreamingToolStripMenuItem.Enabled = true;
- }
- }
-
- private void chooseIPForStreamingToolStripMenuItem_Click(object sender, EventArgs e)
- {
- buttonChooseIp_Click(null, null);
- }
- }
-}
View
142 TvEngine3/TVLibrary/SetupTv/Sections/Servers.resx
@@ -1,142 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
- <!--
- Microsoft ResX Schema
-
- Version 2.0
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
- associated with the data types.
-
- Example:
-
- ... ado.net/XML headers & schema ...
- <resheader name="resmimetype">text/microsoft-resx</resheader>
- <resheader name="version">2.0</resheader>
- <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
- <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
- <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
- <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
- <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
- <value>[base64 mime encoded serialized .NET Framework object]</value>
- </data>
- <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
- <comment>This is a comment</comment>
- </data>
-
- There are any number of "resheader" rows that contain simple
- name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
- mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
- extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
- read any of the formats listed below.
-
- mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
- : using a System.ComponentModel.TypeConverter
- : and then encoded with base64 encoding.
- -->
- <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
- <xsd:element name="root" msdata:IsDataSet="true">
- <xsd:complexType>
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="metadata">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="name" use="required" type="xsd:string" />
- <xsd:attribute name="type" type="xsd:string" />
- <xsd:attribute name="mimetype" type="xsd:string" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="assembly">
- <xsd:complexType>
- <xsd:attribute name="alias" type="xsd:string" />
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="data">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="resheader">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- <resheader name="resmimetype">
- <value>text/microsoft-resx</value>
- </resheader>
- <resheader name="version">
- <value>2.0</value>
- </resheader>
- <resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>122, 17</value>
- </metadata>
- <metadata name="imageList1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
- <value>17, 17</value>
- </metadata>
- <data name="imageList1.ImageStream" mimetype="application/x-microsoft.net.object.binary.base64">
- <value>
- AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w
- LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
- ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADy
- AQAAAk1TRnQBSQFMAwEBAAEEAQABBAEAARABAAEQAQAE/wEZAQAI/wFCAU0BNgcAATYDAAEoAwABQAMA
- ARADAAEBAQABGAYAAQwwAAOABsADgJYAA4Ab/wOABv8DwAOAlgAGgAP/AwADgAP/AwADgAP/AwAM/wOA
- lgAD/wPAA4AYwAP/A4ADwJYAA/8PwA+AA8ADgJkAJP8DgLoAA4ADwJwAA4AbwAaAnAADgAPAAYACAAGA
- AgABgAIAAYACAAGAAgABgAIAAYACAAPAA4CfAAOAA8AB/wIAAf8CAAH/AgAB/wIAAf8CAAH/AgABgAIA
- A8ADgJ8AA4ADwAH/AgAB/wIAAf8CAAH/AgAB/wIAAf8CAAGAAgADwAOAnwADgAPAAf8CAAH/AgAB/wIA
- Af8CAAH/AgAB/wIAAYACAAPAA4CfAAOAA8AB/wIAAf8CAAH/AgAB/wIAAf8CAAH/AgABgAIAA8ADgJ8A
- A4ADwBWAA8ADgKIAG/8DgKUAG4CWAAFCAU0BPgcAAT4DAAEoAwABQAMAARADAAEBAQABAQUAAYAXAAP/
- AQABgAEBDgABgAcAAcAHAAHABwABwAcAAeAHAAHgAQEGAAHgAQMGAAHgAQMGAAHgAQMGAAHgAQMGAAHg
- AQMGAAHgAQMGAAHwAQMGAAH4AQMGAAs=
-</value>
- </data>
-</root>
View
484 TvEngine3/TVLibrary/SetupTv/Sections/StreamingServer.cs
@@ -1,245 +1,241 @@
-#region Copyright (C) 2005-2011 Team MediaPortal
-
-// Copyright (C) 2005-2011 Team MediaPortal
-// http://www.team-mediaportal.com
-//
-// MediaPortal is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 2 of the License, or
-// (at your option) any later version.
-//
-// MediaPortal is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with MediaPortal. If not, see <http://www.gnu.org/licenses/>.
-
-#endregion
-
-using System;
-using System.Collections.Generic;
-using System.Windows.Forms;
-using TvControl;
-using TvDatabase;
-using TvLibrary.Interfaces;
-using TvLibrary.Streaming;
-using System.Net;
-using TvLibrary.Log;
-
-namespace SetupTv.Sections
-{
- public partial class StreamingServer : SectionSettings
- {
- private class IpAddressOption
- {
- public string DisplayString;
- public string HostName;
-
- public IpAddressOption(string displayString, string hostName)
- {
- DisplayString = displayString;
- HostName = hostName;
- }
-
- public override string ToString()
- {
- return DisplayString;
- }
- }
-
- private Server _ourServer;
-
- public StreamingServer()
- : this("Streaming Server") {}
-
- public StreamingServer(string name)
- : base(name)
- {
- InitializeComponent();
- }
-
- public override void OnSectionActivated()
- {
- timer1.Enabled = true;
-
- _ourServer = Server.Retrieve(RemoteControl.Instance.IdServer);
- string ourServerName = _ourServer.HostName;
- try
- {
- ourServerName = Dns.GetHostEntry(_ourServer.HostName).HostName;
- }
- catch (Exception ex)
- {
- Log.Error("Failed to get our server host name");
- Log.Write(ex);
- }
- List<string> ipAdresses = RemoteControl.Instance.ServerIpAdresses;
- IpAddressComboBox.Items.Clear();
- IpAddressComboBox.Items.Add(new IpAddressOption("(auto)", ourServerName));
- int selected = 0;
- int counter = 1;
- foreach (string ipAdress in ipAdresses)
- {
- IpAddressComboBox.Items.Add(new IpAddressOption(ipAdress, ipAdress));
- if (String.Compare(ipAdress, _ourServer.HostName, true) == 0)
- {
- selected = counter;
- }
- counter++;
- }
- IpAddressComboBox.SelectedIndex = selected;
- if (_ourServer.RtspPort >= PortNoNumericUpDown.Minimum && _ourServer.RtspPort <= PortNoNumericUpDown.Maximum)
- {
- PortNoNumericUpDown.Value = _ourServer.RtspPort;
- PortNoNumericUpDown.Text = _ourServer.RtspPort.ToString(); // in case value is the same but text is empty
- }
- }
-
- public override void OnSectionDeActivated()
- {
- timer1.Enabled = false;
- base.OnSectionDeActivated();
-
- ApplyStreamingSettings();
- }
-
- private void ApplyStreamingSettings()
- {
- if (_ourServer != null)
- {
- string newHostName = ((IpAddressOption)IpAddressComboBox.SelectedItem).HostName;
- int newRtspPort = (int)PortNoNumericUpDown.Value;
- bool needRestart = false;
- //int.TryParse(PortNoNumericUpDown.Text, out newRtspPort);
- if (_ourServer.HostName != newHostName ||
- _ourServer.RtspPort != newRtspPort)
- {
- _ourServer.HostName = newHostName;
- _ourServer.RtspPort = newRtspPort;
- needRestart = true;
- }
- if (_ourServer.IsChanged)
- {
- // _ourServer may have changed because RtspPort was 0 in DB and was automatically
- // changed to the default value (554), so we need to persist anyway
- _ourServer.Persist();
- }
- if (needRestart)
- {
- ServiceNeedsToRestart();
- }
- }
- }
-
- private void ServiceNeedsToRestart()
- {
- if (
- MessageBox.Show(this, "Changes made require TvService to restart. Restart it now?", "TvService",
- MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
- {
- NotifyForm dlgNotify = new NotifyForm("Restart TvService...", "This can take some time\n\nPlease be patient...");
- dlgNotify.Show();
- dlgNotify.WaitForDisplay();
-
- RemoteControl.Instance.Restart();
-
- dlgNotify.Close();
- }
- }
-
- private void timer1_Tick(object sender, EventArgs e)
- {
- List<RtspClient> clients = RemoteControl.Instance.StreamingClients;
- for (int i = 0; i < clients.Count; ++i)
- {
- RtspClient client = clients[i];
- if (i >= listView1.Items.Count)
- {
- ListViewItem item = new ListViewItem(client.StreamName);
- item.Tag = client;
- item.SubItems.Add(client.IpAdress);
- if (client.IsActive)
- item.SubItems.Add("yes");
- else
- item.SubItems.Add("no");
- item.SubItems.Add(client.DateTimeStarted.ToString("yyyy-MM-dd HH:mm:ss"));
- item.SubItems.Add(client.Description);
- item.ImageIndex = 0;
- listView1.Items.Add(item);
- }
- else
- {
- ListViewItem item = listView1.Items[i];
- item.Text = client.StreamName;
- item.SubItems[1].Text = client.IpAdress;
- item.SubItems[2].Text = client.IsActive ? "yes" : "no";
- item.SubItems[3].Text = client.DateTimeStarted.ToString("yyyy-MM-dd HH:mm:ss");
- item.SubItems[4].Text = client.Description;
- item.ImageIndex = 0;
- }
- }
- while (listView1.Items.Count > clients.Count)
- listView1.Items.RemoveAt(listView1.Items.Count - 1);
-
- listView1.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);
- }
-
- private void mpButtonKick_Click(object sender, EventArgs e)
- {
- foreach (ListViewItem item in listView1.SelectedItems)
- {
- RtspClient client = (RtspClient)item.Tag;
-
- IUser user = new User();
- user.Name = System.Net.Dns.GetHostEntry(client.IpAdress).HostName;
-
- IList<Card> dbsCards = Card.ListAll();
-
- foreach (Card card in dbsCards)
- {
- if (!card.Enabled)
- continue;
- if (!RemoteControl.Instance.CardPresent(card.IdCard))
- continue;
-
- IUser[] users = RemoteControl.Instance.GetUsersForCard(card.IdCard);
- foreach (IUser u in users)
- {
- if (u.Name == user.Name || u.Name == "setuptv")
- {
- Channel ch = Channel.Retrieve(u.IdChannel);
-
- if (ch.DisplayName == client.Description)
- {
- user.CardId = card.IdCard;
- break;
- }
- }
- }
- if (user.CardId > -1)
- break;
- }
-
- bool res = RemoteControl.Instance.StopTimeShifting(ref user, TvStoppedReason.KickedByAdmin);
-
- if (res)
- {
- listView1.Items.Remove(item);
- }
- }
- listView1.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);
- }
-
- private void deleteToolStripMenuItem_Click(object sender, EventArgs e)
- {
- mpButtonKick_Click(sender, e);
- }
-
- private void ApplyButton_Click(object sender, EventArgs e)
- {
- ApplyStreamingSettings();
- }
- }
+#region Copyright (C) 2005-2011 Team MediaPortal
+
+// Copyright (C) 2005-2011 Team MediaPortal
+// http://www.team-mediaportal.com
+//
+// MediaPortal is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 2 of the License, or
+// (at your option) any later version.
+//
+// MediaPortal is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with MediaPortal. If not, see <http://www.gnu.org/licenses/>.
+
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Windows.Forms;
+using TvControl;
+using TvDatabase;
+using TvLibrary.Interfaces;
+using TvLibrary.Streaming;
+using System.Net;
+using TvLibrary.Log;
+
+namespace SetupTv.Sections
+{
+ public partial class StreamingServer : SectionSettings
+ {
+ private class IpAddressOption
+ {
+ public string DisplayString;
+ public string HostName;
+
+ public IpAddressOption(string displayString, string hostName)
+ {
+ DisplayString = displayString;
+ HostName = hostName;
+ }
+
+ public override string ToString()
+ {
+ return DisplayString;
+ }
+ }
+
+ private string _hostName;
+
+ private int _rtspPort;
+
+ public StreamingServer()
+ : this("Streaming Server") {}
+
+ public StreamingServer(string name)
+ : base(name)
+ {
+ InitializeComponent();
+ }
+
+ public override void OnSectionActivated()
+ {
+ timer1.Enabled = true;
+ TvBusinessLayer layer = new TvBusinessLayer();
+ Setting hostNameSetting = layer.GetSetting("hostName");
+ _hostName = hostNameSetting.Value;
+ Setting rtspPortSetting = layer.GetSetting("rtspPort");
+ _rtspPort = Int32.Parse(rtspPortSetting.Value);
+
+ string ourServerName = _hostName;
+ try
+ {
+ ourServerName = Dns.GetHostEntry(_hostName).HostName;
+ }
+ catch (Exception ex)
+ {
+ Log.Error("Failed to get our server host name");
+ Log.Write(ex);
+ }
+ List<string> ipAdresses = RemoteControl.Instance.ServerIpAdresses;
+ IpAddressComboBox.Items.Clear();
+ IpAddressComboBox.Items.Add(new IpAddressOption("(auto)", ourServerName));
+ int selected = 0;
+ int counter = 1;
+ foreach (string ipAdress in ipAdresses)
+ {
+ IpAddressComboBox.Items.Add(new IpAddressOption(ipAdress, ipAdress));
+ if (String.Compare(ipAdress, _hostName, true) == 0)
+ {
+ selected = counter;
+ }
+ counter++;
+ }
+ IpAddressComboBox.SelectedIndex = selected;
+ if (_rtspPort >= PortNoNumericUpDown.Minimum && _rtspPort <= PortNoNumericUpDown.Maximum)
+ {
+ PortNoNumericUpDown.Value = _rtspPort;
+ PortNoNumericUpDown.Text = _rtspPort.ToString(); // in case value is the same but text is empty
+ }
+ }
+
+ public override void OnSectionDeActivated()
+ {
+ timer1.Enabled = false;
+ base.OnSectionDeActivated();
+
+ ApplyStreamingSettings();
+ }
+
+ private void ApplyStreamingSettings()
+ {
+ string newHostName = ((IpAddressOption) IpAddressComboBox.SelectedItem).HostName;
+ int newRtspPort = (int) PortNoNumericUpDown.Value;
+ if (_hostName != newHostName ||
+ _rtspPort != newRtspPort)
+ {
+ TvBusinessLayer layer = new TvBusinessLayer();
+ Setting hostNameSetting = layer.GetSetting("hostName");
+ hostNameSetting.Value = newHostName;
+ hostNameSetting.Persist();
+ Setting rtspPortSetting = layer.GetSetting("rtspPort");
+ rtspPortSetting.Value = "" + newRtspPort;
+ rtspPortSetting.Persist();
+ ServiceNeedsToRestart();
+ }
+ }
+
+ private void ServiceNeedsToRestart()
+ {
+ if (
+ MessageBox.Show(this, "Changes made require TvService to restart. Restart it now?", "TvService",
+ MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
+ {
+ NotifyForm dlgNotify = new NotifyForm("Restart TvService...", "This can take some time\n\nPlease be patient...");
+ dlgNotify.Show();
+ dlgNotify.WaitForDisplay();
+
+ RemoteControl.Instance.Restart();
+
+ dlgNotify.Close();
+ }
+ }
+
+ private void timer1_Tick(object sender, EventArgs e)
+ {
+ List<RtspClient> clients = RemoteControl.Instance.StreamingClients;
+ for (int i = 0; i < clients.Count; ++i)
+ {
+ RtspClient client = clients[i];
+ if (i >= listView1.Items.Count)
+ {
+ ListViewItem item = new ListViewItem(client.StreamName);
+ item.Tag = client;
+ item.SubItems.Add(client.IpAdress);
+ if (client.IsActive)
+ item.SubItems.Add("yes");
+ else
+ item.SubItems.Add("no");
+ item.SubItems.Add(client.DateTimeStarted.ToString("yyyy-MM-dd HH:mm:ss"));
+ item.SubItems.Add(client.Description);
+ item.ImageIndex = 0;
+ listView1.Items.Add(item);
+ }
+ else
+ {
+ ListViewItem item = listView1.Items[i];
+ item.Text = client.StreamName;
+ item.SubItems[1].Text = client.IpAdress;
+ item.SubItems[2].Text = client.IsActive ? "yes" : "no";
+ item.SubItems[3].Text = client.DateTimeStarted.ToString("yyyy-MM-dd HH:mm:ss");
+ item.SubItems[4].Text = client.Description;
+ item.ImageIndex = 0;
+ }
+ }
+ while (listView1.Items.Count > clients.Count)
+ listView1.Items.RemoveAt(listView1.Items.Count - 1);
+
+ listView1.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);
+ }
+
+ private void mpButtonKick_Click(object sender, EventArgs e)
+ {
+ foreach (ListViewItem item in listView1.SelectedItems)
+ {
+ RtspClient client = (RtspClient)item.Tag;
+
+ IUser user = new User();
+ user.Name = System.Net.Dns.GetHostEntry(client.IpAdress).HostName;
+
+ IList<Card> dbsCards = Card.ListAll();
+
+ foreach (Card card in dbsCards)
+ {
+ if (!card.Enabled)
+ continue;
+ if (!RemoteControl.Instance.CardPresent(card.IdCard))
+ continue;
+
+ IUser[] users = RemoteControl.Instance.GetUsersForCard(card.IdCard);
+ foreach (IUser u in users)
+ {
+ if (u.Name == user.Name || u.Name == "setuptv")
+ {
+ Channel ch = Channel.Retrieve(u.IdChannel);
+
+ if (ch.DisplayName == client.Description)
+ {
+ user.CardId = card.IdCard;
+ break;
+ }
+ }
+ }
+ if (user.CardId > -1)
+ break;
+ }
+
+ bool res = RemoteControl.Instance.StopTimeShifting(ref user, TvStoppedReason.KickedByAdmin);
+
+ if (res)
+ {
+ listView1.Items.Remove(item);
+ }
+ }
+ listView1.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);
+ }
+
+ private void deleteToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ mpButtonKick_Click(sender, e);
+ }
+
+ private void ApplyButton_Click(object sender, EventArgs e)
+ {
+ ApplyStreamingSettings();
+ }
+ }
}
View
656 TvEngine3/TVLibrary/SetupTv/Sections/ThirdPartyChecks.cs
@@ -1,330 +1,328 @@
-#region Copyright (C) 2005-2011 Team MediaPortal
-
-// Copyright (C) 2005-2011 Team MediaPortal
-// http://www.team-mediaportal.com
-//
-// MediaPortal is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 2 of the License, or
-// (at your option) any later version.
-//
-// MediaPortal is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with MediaPortal. If not, see <http://www.gnu.org/licenses/>.
-
-#endregion
-
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.IO;
-using System.Net;
-using System.Net.NetworkInformation;
-using System.ServiceProcess;
-using Microsoft.Win32;
-
-namespace SetupTv.Sections
-{
- public partial class ThirdPartyChecks : SectionSettings
- {
- private static int STREAMING_PORT;
-
- private static McsPolicyStatus _mcsServices;
- private static Version _dvbVersion;
- private static bool _isStreamingOk;
- private static WmpServiceStatus _wmpServices;
-
- public ThirdPartyChecks()
- : this("Additional 3rd party checks") {}
-
- public ThirdPartyChecks(string name)
- : base(name)
- {
- InitializeComponent();
- }
-
- public override void OnSectionActivated()
- {
- _mcsServices = McsPolicyCheck();
- _dvbVersion = GetDvbhotFixVersion();
- _isStreamingOk = IsStreamingPortAvailable();
- if (!_isStreamingOk)
- {
- CheckWindowsMediaSharingService();
- }
-
- RefreshForm();
- }
-
- private void RefreshForm()
- {
- switch (_mcsServices)
- {
- case McsPolicyStatus.PolicyInPlace:
- mpLabelStatusMCS.Text = "services disabled by policy";
- mpLabelStatusMCS.ForeColor = System.Drawing.Color.Green;
- mpButtonMCS.Text = "Re-enable services";
- mpButtonMCS.Visible = true;
- mpButtonMCS.Enabled = true;
- break;
- case McsPolicyStatus.ServicesStopped:
- mpLabelStatusMCS.Text = "services stopped";
- mpLabelStatusMCS.ForeColor = System.Drawing.Color.Green;
- mpButtonMCS.Text = "Enable policy to prevent services startup";
- mpButtonMCS.Visible = true;
- mpButtonMCS.Enabled = true;
- break;
- case McsPolicyStatus.NotAMceSystem:
- mpLabelStatusMCS.Text = "services not installed";
- mpLabelStatusMCS.ForeColor = System.Drawing.Color.Green;
- mpButtonMCS.Visible = false;
- mpButtonMCS.Enabled = false;
- break;
- default:
- mpLabelStatusMCS.Text = "services running";
- mpLabelStatusMCS.ForeColor = System.Drawing.Color.Red;
- mpButtonMCS.Text = "Enable policy to prevent services startup";
- mpButtonMCS.Visible = true;
- mpButtonMCS.Enabled = true;
- break;
- }
-
- if (_dvbVersion < new Version(6, 5, 2710, 2732))
- {
- mpLabelStatusDVBHotfix.Text = "not installed";
- mpLabelStatusDVBHotfix.ForeColor = System.Drawing.Color.Red;
- linkLabelDVBHotfix.Enabled = true;
- linkLabelDVBHotfix.Visible = true;
- }
- else
- {
- mpLabelStatusDVBHotfix.Text = OSInfo.OSInfo.VistaOrLater() ? "not needed on Vista and up" : "installed";
- mpLabelStatusDVBHotfix.ForeColor = System.Drawing.Color.Green;
- linkLabelDVBHotfix.Enabled = false;
- linkLabelDVBHotfix.Visible = false;
- }
-
- if (_isStreamingOk)
- {
- mpLabelStatusStreamingPort.Text = "port " + STREAMING_PORT + " is available";
- mpLabelStatusStreamingPort.ForeColor = System.Drawing.Color.Green;
- linkLabelStreamingPort.Enabled = false;
- linkLabelStreamingPort.Visible = false;
- mpLabelWindowsMediaSharingServiceStatus.Visible = false;
- mpLabelStatus4.Visible = false;
- }
- else
- {
- mpLabelStatusStreamingPort.Text = "port " + STREAMING_PORT + " is already bound";
- mpLabelStatusStreamingPort.ForeColor = System.Drawing.Color.Red;
- linkLabelStreamingPort.Enabled = true;
- linkLabelStreamingPort.Visible = true;
- mpLabelWindowsMediaSharingServiceStatus.Visible = true;
- mpLabelStatus4.Visible = true;
- switch (_wmpServices)
- {
- case WmpServiceStatus.StartupAutomatic:
- mpLabelWindowsMediaSharingServiceStatus.Text = "automatic";
- mpLabelWindowsMediaSharingServiceStatus.ForeColor = System.Drawing.Color.Red;
- break;
- case WmpServiceStatus.StartupManual:
- mpLabelWindowsMediaSharingServiceStatus.Text = "manual";
- mpLabelWindowsMediaSharingServiceStatus.ForeColor = System.Drawing.Color.Red;
- break;
- case WmpServiceStatus.StartupDisabled:
- mpLabelWindowsMediaSharingServiceStatus.Text = "disabled";
- mpLabelWindowsMediaSharingServiceStatus.ForeColor = System.Drawing.Color.Green;
- break;
- case WmpServiceStatus.NotInstalled:
- mpLabelWindowsMediaSharingServiceStatus.Text = "not installed";
- mpLabelWindowsMediaSharingServiceStatus.ForeColor = System.Drawing.Color.Green;
- break;
- }
- }
- }
-
- #region MCS Policy Check
-
- private static McsPolicyStatus McsPolicyCheck()
- {
- // Check for status of MCE services
- bool mceSystem = false;
- ServiceController[] services = ServiceController.GetServices();
- foreach (ServiceController srv in services)
- {
- if (srv.ServiceName == "ehRecvr" || srv.ServiceName == "ehSched")
- {
- mceSystem = true;
- if (srv.Status == ServiceControllerStatus.Running)
- {
- return McsPolicyStatus.ServicesRunning;
- }
- }
- }
-
- // If services are not found, then this is not a MCE system
- if (!mceSystem)
- {
- return McsPolicyStatus.NotAMceSystem;
- }
-
- // Check for policy registry key
- if (McsPolicyManipulation(true) == McsPolicyStatus.PolicyInPlace)
- {
- return McsPolicyStatus.PolicyInPlace;
- }
- // No MCE services running and no policy: services are stopped
- return McsPolicyStatus.ServicesStopped;
- }
-
- private static McsPolicyStatus McsPolicyManipulation(bool checkonly)
- {
- const string keyPath = "SOFTWARE\\Policies\\Microsoft\\WindowsMediaCenter";
-
- RegistryKey key = Registry.LocalMachine.OpenSubKey(keyPath, !checkonly);
-
- if (checkonly)
- {
- if (key != null)
- {
- object objValue = key.GetValue("MediaCenter");
- key.Close();
- if (objValue != null && objValue.ToString() == "1")
- {
- _mcsServices = McsPolicyStatus.PolicyInPlace;
- }
- }
- }
- else
- {
- if (_mcsServices == McsPolicyStatus.PolicyInPlace)
- {
- key.DeleteValue("MediaCenter");
- key.Close();
- _mcsServices = McsPolicyStatus.ServicesStopped;
- }
- else
- {
- if (key == null)
- {
- key = Registry.LocalMachine.CreateSubKey(keyPath);
- }
- key.SetValue("MediaCenter", "1", RegistryValueKind.DWord);
- key.Close();
- _mcsServices = McsPolicyStatus.PolicyInPlace;
- }
- }
- return _mcsServices;
- }
-
- private enum McsPolicyStatus
- {
- NotAMceSystem,
- ServicesRunning,
- ServicesStopped,
- PolicyInPlace
- }
-
- private void mpButtonMCS_Click(object sender, EventArgs e)
- {
- McsPolicyManipulation(false);
- RefreshForm();
- }
-
- #endregion
-
- #region DVB HotFix Check
-
- private static Version GetDvbhotFixVersion()
- {
- List<string> dllPaths = Utils.GetRegisteredAssemblyPaths("PsisDecd");
- var aParamVersion = new Version(0, 0, 0, 0);
- Version mostRecentVer = aParamVersion;
- foreach (string dllPath in dllPaths)
- {
- Utils.CheckFileVersion(dllPath, "6.5.2710.2732", out aParamVersion);
- if (File.Exists(dllPath) && aParamVersion > mostRecentVer)
- {
- mostRecentVer = aParamVersion;
- }
- }
- return mostRecentVer;
- }
-
- #endregion
-
- #region Streaming Port Check
-
- private static bool IsStreamingPortAvailable()
- {
- int RtspPort = TvControl.RemoteControl.Instance.StreamingPort;
- STREAMING_PORT = RtspPort;
- if (STREAMING_PORT == 0)
- {
- TvDatabase.Server ourServer = TvDatabase.Server.Retrieve(TvControl.RemoteControl.Instance.IdServer);
- STREAMING_PORT = ourServer.RtspPort;
- return false;
- }
-
- return true;
- }
-
- private static void CheckWindowsMediaSharingService()
- {
- const string keyPath = "SYSTEM\\CurrentControlSet\\Services\\WMPNetworkSvc";
- RegistryKey key = Registry.LocalMachine.OpenSubKey(keyPath);
-
- if (key != null)
- {
- string strUninstall = key.GetValue("Start").ToString();
- key.Close();
- switch (strUninstall)
- {
- case "1":
- _wmpServices = WmpServiceStatus.StartupAutomatic;
- break;
- case "2":
- _wmpServices = WmpServiceStatus.StartupManual;
- break;
- case "4":
- _wmpServices = WmpServiceStatus.StartupDisabled;
- break;
- }
- }
- else
- {
- _wmpServices = WmpServiceStatus.NotInstalled;
- }
- }
-
- private enum WmpServiceStatus
- {
- NotInstalled,
- StartupAutomatic,
- StartupManual,
- StartupDisabled
- }
-
- #endregion
-
- #region Link labels
-
- private void linkLabelDVBHotfix_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
- {
- // DVB hotfix download link
- Process.Start(@"http://wiki.team-mediaportal.com/GeneralRequirements");
- }
-
- private void linkLabelStreamingPort_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
- {
- // TCPView download link
- Process.Start(@"http://technet.microsoft.com/en-us/sysinternals/bb897437.aspx");
- }
-
- #endregion
- }
+#region Copyright (C) 2005-2011 Team MediaPortal
+
+// Copyright (C) 2005-2011 Team MediaPortal
+// http://www.team-mediaportal.com
+//
+// MediaPortal is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 2 of the License, or
+// (at your option) any later version.
+//
+// MediaPortal is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with MediaPortal. If not, see <http://www.gnu.org/licenses/>.
+
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.IO;
+using System.Net;
+using System.Net.NetworkInformation;
+using System.ServiceProcess;
+using Microsoft.Win32;
+
+namespace SetupTv.Sections
+{
+ public partial class ThirdPartyChecks : SectionSettings
+ {
+ private static int STREAMING_PORT;
+
+ private static McsPolicyStatus _mcsServices;
+ private static Version _dvbVersion;
+ private static bool _isStreamingOk;
+ private static WmpServiceStatus _wmpServices;
+
+ public ThirdPartyChecks()
+ : this("Additional 3rd party checks") {}
+
+ public ThirdPartyChecks(string name)
+ : base(name)
+ {
+ InitializeComponent();
+ }
+
+ public override void OnSectionActivated()
+ {
+ _mcsServices = McsPolicyCheck();
+ _dvbVersion = GetDvbhotFixVersion();
+ _isStreamingOk = IsStreamingPortAvailable();
+ if (!_isStreamingOk)
+ {
+ CheckWindowsMediaSharingService();
+ }
+
+ RefreshForm();
+ }
+
+ private void RefreshForm()
+ {
+ switch (_mcsServices)
+ {
+ case McsPolicyStatus.PolicyInPlace:
+ mpLabelStatusMCS.Text = "services disabled by policy";
+ mpLabelStatusMCS.ForeColor = System.Drawing.Color.Green;
+ mpButtonMCS.Text = "Re-enable services";
+ mpButtonMCS.Visible = true;
+ mpButtonMCS.Enabled = true;
+ break;
+ case McsPolicyStatus.ServicesStopped:
+ mpLabelStatusMCS.Text = "services stopped";
+ mpLabelStatusMCS.ForeColor = System.Drawing.Color.Green;
+ mpButtonMCS.Text = "Enable policy to prevent services startup";
+ mpButtonMCS.Visible = true;
+ mpButtonMCS.Enabled = true;
+ break;
+ case McsPolicyStatus.NotAMceSystem:
+ mpLabelStatusMCS.Text = "services not installed";
+ mpLabelStatusMCS.ForeColor = System.Drawing.Color.Green;
+ mpButtonMCS.Visible = false;
+ mpButtonMCS.Enabled = false;
+ break;
+ default:
+ mpLabelStatusMCS.Text = "services running";
+ mpLabelStatusMCS.ForeColor = System.Drawing.Color.Red;
+ mpButtonMCS.Text = "Enable policy to prevent services startup";
+ mpButtonMCS.Visible = true;
+ mpButtonMCS.Enabled = true;
+ break;
+ }
+
+ if (_dvbVersion < new Version(6, 5, 2710, 2732))
+ {
+ mpLabelStatusDVBHotfix.Text = "not installed";
+ mpLabelStatusDVBHotfix.ForeColor = System.Drawing.Color.Red;
+ linkLabelDVBHotfix.Enabled = true;
+ linkLabelDVBHotfix.Visible = true;
+ }
+ else
+ {
+ mpLabelStatusDVBHotfix.Text = OSInfo.OSInfo.VistaOrLater() ? "not needed on Vista and up" : "installed";
+ mpLabelStatusDVBHotfix.ForeColor = System.Drawing.Color.Green;
+ linkLabelDVBHotfix.Enabled = false;
+ linkLabelDVBHotfix.Visible = false;
+ }
+
+ if (_isStreamingOk)
+ {
+ mpLabelStatusStreamingPort.Text = "port " + STREAMING_PORT + " is available";
+ mpLabelStatusStreamingPort.ForeColor = System.Drawing.Color.Green;
+ linkLabelStreamingPort.Enabled = false;
+ linkLabelStreamingPort.Visible = false;
+ mpLabelWindowsMediaSharingServiceStatus.Visible = false;
+ mpLabelStatus4.Visible = false;
+ }
+ else
+ {
+ mpLabelStatusStreamingPort.Text = "port " + STREAMING_PORT + " is already bound";
+ mpLabelStatusStreamingPort.ForeColor = System.Drawing.Color.Red;
+ linkLabelStreamingPort.Enabled = true;
+ linkLabelStreamingPort.Visible = true;
+ mpLabelWindowsMediaSharingServiceStatus.Visible = true;
+ mpLabelStatus4.Visible = true;
+ switch (_wmpServices)
+ {
+ case WmpServiceStatus.StartupAutomatic:
+ mpLabelWindowsMediaSharingServiceStatus.Text = "automatic";
+ mpLabelWindowsMediaSharingServiceStatus.ForeColor = System.Drawing.Color.Red;
+ break;
+ case WmpServiceStatus.StartupManual:
+ mpLabelWindowsMediaSharingServiceStatus.Text = "manual";
+ mpLabelWindowsMediaSharingServiceStatus.ForeColor = System.Drawing.Color.Red;
+ break;
+ case WmpServiceStatus.StartupDisabled:
+ mpLabelWindowsMediaSharingServiceStatus.Text = "disabled";
+ mpLabelWindowsMediaSharingServiceStatus.ForeColor = System.Drawing.Color.Green;
+ break;
+ case WmpServiceStatus.NotInstalled:
+ mpLabelWindowsMediaSharingServiceStatus.Text = "not installed";
+ mpLabelWindowsMediaSharingServiceStatus.ForeColor = System.Drawing.Color.Green;
+ break;
+ }
+ }
+ }
+
+ #region MCS Policy Check
+
+ private static McsPolicyStatus McsPolicyCheck()
+ {
+ // Check for status of MCE services
+ bool mceSystem = false;
+ ServiceController[] services = ServiceController.GetServices();
+ foreach (ServiceController srv in services)
+ {
+ if (srv.ServiceName == "ehRecvr" || srv.ServiceName == "ehSched")
+ {
+ mceSystem = true;
+ if (srv.Status == ServiceControllerStatus.Running)
+ {
+ return McsPolicyStatus.ServicesRunning;
+ }
+ }
+ }
+
+ // If services are not found, then this is not a MCE system
+ if (!mceSystem)
+ {
+ return McsPolicyStatus.NotAMceSystem;
+ }
+
+ // Check for policy registry key
+ if (McsPolicyManipulation(true) == McsPolicyStatus.PolicyInPlace)
+ {
+ return McsPolicyStatus.PolicyInPlace;
+ }
+ // No MCE services running and no policy: services are stopped
+ return McsPolicyStatus.ServicesStopped;
+ }
+
+ private static McsPolicyStatus McsPolicyManipulation(bool checkonly)
+ {
+ const string keyPath = "SOFTWARE\\Policies\\Microsoft\\WindowsMediaCenter";
+
+ RegistryKey key = Registry.LocalMachine.OpenSubKey(keyPath, !checkonly);
+
+ if (checkonly)
+ {
+ if (key != null)
+ {
+ object objValue = key.GetValue("MediaCenter");
+ key.Close();
+ if (objValue != null && objValue.ToString() == "1")
+ {
+ _mcsServices = McsPolicyStatus.PolicyInPlace;
+ }
+ }
+ }
+ else
+ {
+ if (_mcsServices == McsPolicyStatus.PolicyInPlace)
+ {
+ key.DeleteValue("MediaCenter");
+ key.Close();
+ _mcsServices = McsPolicyStatus.ServicesStopped;
+ }
+ else
+ {
+ if (key == null)
+ {
+ key = Registry.LocalMachine.CreateSubKey(keyPath);
+ }
+ key.SetValue("MediaCenter", "1", RegistryValueKind.DWord);
+ key.Close();
+ _mcsServices = McsPolicyStatus.PolicyInPlace;
+ }
+ }
+ return _mcsServices;
+ }
+
+ private enum McsPolicyStatus
+ {
+ NotAMceSystem,
+ ServicesRunning,
+ ServicesStopped,
+ PolicyInPlace
+ }
+
+ private void mpButtonMCS_Click(object sender, EventArgs e)
+ {
+ McsPolicyManipulation(false);
+ RefreshForm();
+ }
+
+ #endregion
+
+ #region DVB HotFix Check
+
+ private static Version GetDvbhotFixVersion()
+ {
+ List<string> dllPaths = Utils.GetRegisteredAssemblyPaths("PsisDecd");
+ var aParamVersion = new Version(0, 0, 0, 0);
+ Version mostRecentVer = aParamVersion;
+ foreach (string dllPath in dllPaths)
+ {
+ Utils.CheckFileVersion(dllPath, "6.5.2710.2732", out aParamVersion);
+ if (File.Exists(dllPath) && aParamVersion > mostRecentVer)
+ {
+ mostRecentVer = aParamVersion;
+ }
+ }
+ return mostRecentVer;
+ }
+
+ #endregion
+
+ #region Streaming Port Check
+
+ private static bool IsStreamingPortAvailable()
+ {
+ int RtspPort = TvControl.RemoteControl.Instance.StreamingPort;
+ STREAMING_PORT = RtspPort;
+ if (STREAMING_PORT == 0)
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ private static void CheckWindowsMediaSharingService()
+ {
+ const string keyPath = "SYSTEM\\CurrentControlSet\\Services\\WMPNetworkSvc";
+ RegistryKey key = Registry.LocalMachine.OpenSubKey(keyPath);
+
+ if (key != null)
+ {
+ string strUninstall = key.GetValue("Start").ToString();
+ key.Close();
+ switch (strUninstall)
+ {
+ case "1":
+ _wmpServices = WmpServiceStatus.StartupAutomatic;
+ break;
+ case "2":
+ _wmpServices = WmpServiceStatus.StartupManual;
+ break;
+ case "4":
+ _wmpServices = WmpServiceStatus.StartupDisabled;
+ break;
+ }
+ }
+ else
+ {
+ _wmpServices = WmpServiceStatus.NotInstalled;
+ }
+ }
+
+ private enum WmpServiceStatus
+ {
+ NotInstalled,
+ StartupAutomatic,
+ StartupManual,
+ StartupDisabled
+ }
+
+ #endregion
+
+ #region Link labels
+
+ private void linkLabelDVBHotfix_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
+ {
+ // DVB hotfix download link
+ Process.Start(@"http://wiki.team-mediaportal.com/GeneralRequirements");
+ }
+
+ private void linkLabelStreamingPort_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
+ {
+ // TCPView download link
+ Process.Start(@"http://technet.microsoft.com/en-us/sysinternals/bb897437.aspx");
+ }
+
+ #endregion
+ }
}
View
24 TvEngine3/TVLibrary/SetupTv/Sections/TvRecording.cs
@@ -1083,7 +1083,6 @@ private static Recording BuildRecordingFromTag(string aFileName, MatroskaTagInfo
0,
SqlDateTime.MaxValue.Value,
0,
- GetServerId(),
aTag.episodeName,
aTag.seriesNum,
aTag.episodeNum,
@@ -1147,29 +1146,6 @@ private static string GetRecordingFilename(string aTagFilename)
return recordingFile;
}
- private static int GetServerId()
- {
- int serverId = 1;
- try
- {
- string localHost = System.Net.Dns.GetHostName();
- string localDomainName =
- System.Net.NetworkInformation.IPGlobalProperties.GetIPGlobalProperties().DomainName.ToLowerInvariant();
- IList<Server> dbsServers = Server.ListAll();
- foreach (Server computer in dbsServers)
- {
- if (computer.HostName.ToLowerInvariant() == localHost.ToLowerInvariant() ||
- computer.HostName.ToLowerInvariant() == localHost.ToLowerInvariant() + "." + localDomainName)
- serverId = computer.IdServer;
- }
- }
- catch (Exception ex)
- {
- MessageBox.Show(string.Format("Could not get ServerID for recording!\n{0}", ex.Message));
- }
- return serverId;
- }
-
private static int GetChannelIdByDisplayName(string aChannelName)
{
int channelId = -1;
View
319 TvEngine3/TVLibrary/SetupTv/SettingsForm.cs
@@ -42,7 +42,6 @@ public class SetupTvSettingsForm : SetupControls.SettingsForm
private readonly PluginLoader _pluginLoader = new PluginLoader();
private Plugins pluginsRoot;
private TvBusinessLayer layer;
- private Servers servers;
private TvCards cardPage;
private bool showAdvancedSettings;
@@ -94,217 +93,133 @@ private void Init()
Log.Write(ex);
}
- try
- {
- Server.ListAll();
- }
- catch (Exception ex)
- {
- MessageBox.Show("Failed to open database");
- Log.Error("Unable to get list of servers");
- Log.Write(ex);
- }
-
Project project = new Project();
AddSection(project);
+ cardPage = new TvCards();
+ cardPage.TvCardsChanged += OnTvCardsChanged;
+ AddSection(cardPage);
layer = new TvBusinessLayer();
- servers = new Servers();
- AddSection(servers);
- IList<Server> dbsServers = Server.ListAll();
-
- if (dbsServers != null)
- {
- foreach (Server server in dbsServers)
- {
- if (server.IsMaster)
- {
- bool connected = false;
- while (!connected)
- {
- RemoteControl.HostName = server.HostName;
-
- if (server.ReferringCard().Count > 0)
- {
- try
- {
- Card c = (Card)server.ReferringCard()[0];
- RemoteControl.Instance.Type(c.IdCard);
- connected = true;
- }
- catch (Exception ex)
- {
- string localHostname = Dns.GetHostName();
- if (localHostname != server.HostName)
- {
- DialogResult dlg = MessageBox.Show(String.Format("Unable to connect to <{0}>.\n" +
- "Do you want to try the current comupter name ({1}) instead?",
- server.HostName, localHostname),
- "Wrong config detected",
- MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation);
- if (dlg == DialogResult.Yes)
- {
- Log.Info("Controller: server {0} changed to {1}", server.HostName, localHostname);
- server.HostName = localHostname;
- server.Persist();
- RemoteControl.Clear();
- ServiceHelper.Restart();
- ServiceHelper.WaitInitialized();
- }
- else
- {
- MessageBox.Show("Setup will now close");
- Environment.Exit(-1);
- }
- }
- else
- {
- Log.Error("Cannot connect to server {0}", server.HostName);
- Log.Write(ex);
- DialogResult dlg = MessageBox.Show("Unable to connect to <" + server.HostName + ">.\n" +
- "Please check the TV Server logs for details.\n\n" +
- "Setup will now close.");
- Environment.Exit(-1);
- }
- }
- }
- }
- break;
- }
- }
-
- AddServerTvCards(servers, dbsServers, false);
-
- TvChannels tvChannels = new TvChannels();
- AddSection(tvChannels);
- AddChildSection(tvChannels, new TvCombinations("TV Combinations"));
- AddChildSection(tvChannels, new TvChannelMapping());
-
- RadioChannels radioChannels = new RadioChannels();
- AddSection(radioChannels);
- AddChildSection(radioChannels, new RadioCombinations("Radio Combinations"));
- AddChildSection(radioChannels, new RadioChannelMapping());
-
- Epg EpgSection = new Epg();
- AddSection(EpgSection);
- AddChildSection(EpgSection, new TvEpgGrabber());
- AddChildSection(EpgSection, new RadioEpgGrabber());
+ AddServerTvCards(false);
+
+ TvChannels tvChannels = new TvChannels();
+ AddSection(tvChannels);
+ AddChildSection(tvChannels, new TvCombinations("TV Combinations"));
+ AddChildSection(tvChannels, new TvChannelMapping());
+
+ RadioChannels radioChannels = new RadioChannels();
+ AddSection(radioChannels);
+ AddChildSection(radioChannels, new RadioCombinations("Radio Combinations"));
+ AddChildSection(radioChannels, new RadioChannelMapping());
+
+ Epg EpgSection = new Epg();
+ AddSection(EpgSection);
+ AddChildSection(EpgSection, new TvEpgGrabber());
+ AddChildSection(EpgSection, new RadioEpgGrabber());
+
+ AddSection(new ScanSettings());
+ AddSection(new TvRecording());
+ AddSection(new TvTimeshifting());
+ AddSection(new TvSchedules());
+ AddSection(new StreamingServer());
+
+ AddSection(new TestService("Manual Control"));
+ AddSection(new TestChannels("Test Channels"));
+
+ _pluginLoader.Load();
+ pluginsRoot = new Plugins("Plugins", _pluginLoader);
+ AddSection(pluginsRoot);
AddChildSection(EpgSection, new EpgGenreMap());
- AddSection(new ScanSettings());
- AddSection(new TvRecording());
- AddSection(new TvTimeshifting());
- AddSection(new TvSchedules());
- AddSection(new StreamingServer());
+ pluginsRoot.ChangedActivePlugins += SectChanged;
AddSection(new UserPriorities());
- AddSection(new TestService("Manual Control"));
- AddSection(new TestChannels("Test Channels"));
-
- _pluginLoader.Load();
- pluginsRoot = new Plugins("Plugins", _pluginLoader);
- AddSection(pluginsRoot);
-
- pluginsRoot.ChangedActivePlugins += SectChanged;
-
- foreach (ITvServerPlugin plugin in _pluginLoader.Plugins)
+ foreach (ITvServerPlugin plugin in _pluginLoader.Plugins)
+ {
+ SectionSettings settings = plugin.Setup;
+ if (settings != null)
{
- SectionSettings settings = plugin.Setup;
- if (settings != null)
+ Setting isActive = layer.GetSetting(String.Format("plugin{0}", plugin.Name), "false");
+ settings.Text = plugin.Name;
+ if (isActive.Value == "true")
{
- Setting isActive = layer.GetSetting(String.Format("plugin{0}", plugin.Name), "false");
- settings.Text = plugin.Name;
- if (isActive.Value == "true")
- {
- AddChildSection(pluginsRoot, settings);
- }
+ AddChildSection(pluginsRoot, settings);
}
}
- if (showAdvancedSettings)
- {
- AddSection(new DebugOptions());
- }
- AddSection(new ImportExport());
- AddSection(new ThirdPartyChecks());
-
- sectionTree.SelectedNode = sectionTree.Nodes[0];
- // make sure window is in front of mediaportal
}
+ if (showAdvancedSettings)
+ {
+ AddSection(new DebugOptions());
+ }
+ AddSection(new ImportExport());
+ AddSection(new ThirdPartyChecks());
+
+ sectionTree.SelectedNode = sectionTree.Nodes[0];
+ // make sure window is in front of mediaportal
+
BringToFront();
}
- private void AddServerTvCards(Servers servers, IList<Server> dbsServers, bool reloaded)
+ private void AddServerTvCards(bool reloaded)
{
- foreach (Server server in dbsServers)
+ foreach (Card dbsCard in Card.ListAll())
{
- bool isLocal = (server.HostName.ToLowerInvariant() == Dns.GetHostName().ToLowerInvariant() ||
- server.HostName.ToLowerInvariant() == Dns.GetHostName().ToLowerInvariant() + "."
- +
- System.Net.NetworkInformation.IPGlobalProperties.GetIPGlobalProperties().DomainName.
- ToLowerInvariant());
- cardPage = new TvCards(server.HostName);
- cardPage.TvCardsChanged += OnTvCardsChanged;
- AddChildSection(servers, cardPage, 0);
- foreach (Card dbsCard in server.ReferringCard())
+ if (dbsCard.Enabled == true && RemoteControl.Instance.CardPresent(dbsCard.IdCard))
{
- if (dbsCard.Enabled == true && RemoteControl.Instance.CardPresent(dbsCard.IdCard))
+ CardType type = RemoteControl.Instance.Type(dbsCard.IdCard);
+ string cardName = dbsCard.Name;
+ int cardNo = dbsCard.IdCard;
+ switch (type)
{
- CardType type = RemoteControl.Instance.Type(dbsCard.IdCard);
- int cardId = dbsCard.IdCard;
- string cardName = dbsCard.Name;
- switch (type)
- {
- case CardType.Analog:
- cardName = String.Format("{0} Analog {1}", cardId, cardName);
- AddChildSection(cardPage, new CardAnalog(cardName, dbsCard.IdCard), 1);
- break;
- case CardType.DvbT:
- cardName = String.Format("{0} DVB-T {1}", cardId, cardName);
- AddChildSection(cardPage, new CardDvbT(cardName, dbsCard.IdCard), 1);
- break;
- case CardType.DvbC:
- cardName = String.Format("{0} DVB-C {1}", cardId, cardName);
- AddChildSection(cardPage, new CardDvbC(cardName, dbsCard.IdCard), 1);
- break;
- case CardType.DvbS:
- cardName = String.Format("{0} DVB-S {1}", cardId, cardName);
- AddChildSection(cardPage, new CardDvbS(cardName, dbsCard.IdCard), 1);
- break;
- case CardType.Atsc:
- cardName = String.Format("{0} ATSC {1}", cardId, cardName);
- AddChildSection(cardPage, new CardAtsc(cardName, dbsCard.IdCard), 1);
- break;
- case CardType.DvbIP:
- cardName = String.Format("{0} DVB-IP {1}", cardId, cardName);
- AddChildSection(cardPage, new CardDvbIP(cardName, dbsCard.IdCard), 1);
- break;
- case CardType.RadioWebStream:
- cardName = String.Format("{0} {1}", cardId, cardName);
- InfoPage RadioWebStreamInfo = new InfoPage(cardName);
- RadioWebStreamInfo.InfoText =
- "The RadioWebStream card does not have any options.\n\n\nYou can add your favourite radio webstreams under:\n\n --> 'Radio Channels', 'Add', 'Web-Stream' or by importing a playlist.";
- AddChildSection(cardPage, RadioWebStreamInfo, 1);
- break;
- case CardType.Unknown:
- cardName = String.Format("{0} Unknown {1}", cardId, cardName);
- AddChildSection(cardPage, new CardAnalog(cardName, dbsCard.IdCard), 1);
- break;
- }
+ case CardType.Analog:
+ cardName = String.Format("{0} Analog {1}", cardNo, cardName);
+ AddChildSection(cardPage, new CardAnalog(cardName, dbsCard.IdCard));
+ break;
+ case CardType.DvbT:
+ cardName = String.Format("{0} DVB-T {1}", cardNo, cardName);
+ AddChildSection(cardPage, new CardDvbT(cardName, dbsCard.IdCard));
+ break;
+ case CardType.DvbC:
+ cardName = String.Format("{0} DVB-C {1}", cardNo, cardName);
+ AddChildSection(cardPage, new CardDvbC(cardName, dbsCard.IdCard));
+ break;
+ case CardType.DvbS:
+ cardName = String.Format("{0} DVB-S {1}", cardNo, cardName);
+ AddChildSection(cardPage, new CardDvbS(cardName, dbsCard.IdCard));
+ break;
+ case CardType.Atsc:
+ cardName = String.Format("{0} ATSC {1}", cardNo, cardName);
+ AddChildSection(cardPage, new CardAtsc(cardName, dbsCard.IdCard));
+ break;
+ case CardType.DvbIP:
+ cardName = String.Format("{0} DVB-IP {1}", cardNo, cardName);
+ AddChildSection(cardPage, new CardDvbIP(cardName, dbsCard.IdCard));
+ break;
+ case CardType.RadioWebStream:
+ cardName = String.Format("{0} {1}", cardNo, cardName);
+ InfoPage RadioWebStreamInfo = new InfoPage(cardName);
+ RadioWebStreamInfo.InfoText =
+ "The RadioWebStream card does not have any options.\n\n\nYou can add your favourite radio webstreams under:\n\n --> 'Radio Channels', 'Add', 'Web-Stream' or by importing a playlist.";
+ AddChildSection(cardPage, RadioWebStreamInfo);
+ break;
+ case CardType.Unknown:
+ cardName = String.Format("{0} Unknown {1}", cardNo, cardName);
+ AddChildSection(cardPage, new CardAnalog(cardName, dbsCard.IdCard));
+ break;
}
}
- if (isLocal)
+ }
+ Utils.CheckForDvbHotfix();
+
+ if (reloaded)
+ {
+ SectionTreeNode activeNode = (SectionTreeNode)settingSections[cardPage.Text];
+ if (activeNode != null)
{
- Utils.CheckForDvbHotfix();
- }
- if (reloaded)
- {
- SectionTreeNode activeNode = (SectionTreeNode)settingSections[server.HostName];
- if (activeNode != null)
- {
- activeNode.Expand();
- }
+ activeNode.Expand();
}
}
+
}
/// <summary>
@@ -331,11 +246,9 @@ public void OnTvCardsChanged(object sender, EventArgs e)
RemoteControl.Instance.Restart();
// remove all tv servers / cards, add current ones back later
- RemoveAllChildSections((SectionTreeNode)settingSections[servers.Text]);
+ RemoveAllChildSections((SectionTreeNode)settingSections[cardPage.Text]);
- // re-add tvservers and cards to tree
- IList<Server> dbsServers = Server.ListAll();
- AddServerTvCards(servers, dbsServers, true);
+ AddServerTvCards(true);
}
finally
{
@@ -362,29 +275,7 @@ public void RemoveAllChildSections(SectionTreeNode parentTreeNode)
//Remove the section from the hashtable in case we add it again
settingSections.Remove(childNode.Text);
}
- // first remove all children and sections, then nodes themself (otherwise collection changes during iterate)
- foreach (SectionTreeNode childNode in