From: <ro...@us...> - 2007-06-30 16:55:43
|
Revision: 657 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=657&view=rev Author: ronilse Date: 2007-06-30 09:55:40 -0700 (Sat, 30 Jun 2007) Log Message: ----------- Added updated(to recent MP SVN) Motorola Serial Cable Tuner original made by Michael Hansen Added Paths: ----------- trunk/plugins/MotorolaSerialCableTuner/ trunk/plugins/MotorolaSerialCableTuner/AssemblyInfo.cs trunk/plugins/MotorolaSerialCableTuner/FormSetup.cs trunk/plugins/MotorolaSerialCableTuner/FormSetup.resx trunk/plugins/MotorolaSerialCableTuner/MotorolaSerialCableTuner.csproj trunk/plugins/MotorolaSerialCableTuner/MotorolaSerialCableTuner.csproj.user trunk/plugins/MotorolaSerialCableTuner/MotorolaSerialCableTuner.sln trunk/plugins/MotorolaSerialCableTuner/SerialCableTuner.cs trunk/plugins/MotorolaSerialCableTuner/Settings.cs trunk/plugins/MotorolaSerialCableTuner/bin/ trunk/plugins/MotorolaSerialCableTuner/lib/ trunk/plugins/MotorolaSerialCableTuner/lib/SerialPort.dll trunk/plugins/MotorolaSerialCableTuner/obj/ Added: trunk/plugins/MotorolaSerialCableTuner/AssemblyInfo.cs =================================================================== --- trunk/plugins/MotorolaSerialCableTuner/AssemblyInfo.cs (rev 0) +++ trunk/plugins/MotorolaSerialCableTuner/AssemblyInfo.cs 2007-06-30 16:55:40 UTC (rev 657) @@ -0,0 +1,58 @@ +using System.Reflection; +using System.Runtime.CompilerServices; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly: AssemblyTitle("")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion("1.0.*")] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory which is +// %Project Directory%\obj\<configuration>. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("")] +[assembly: AssemblyKeyName("")] Added: trunk/plugins/MotorolaSerialCableTuner/FormSetup.cs =================================================================== --- trunk/plugins/MotorolaSerialCableTuner/FormSetup.cs (rev 0) +++ trunk/plugins/MotorolaSerialCableTuner/FormSetup.cs 2007-06-30 16:55:40 UTC (rev 657) @@ -0,0 +1,152 @@ +using System; +using System.Drawing; +using System.Collections; +using System.ComponentModel; +using System.Windows.Forms; + +namespace MotorolaSerialCableTuner +{ + /// <summary> + /// Summary description for FormSetup. + /// </summary> + public class FormSetup : System.Windows.Forms.Form + { + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Button buttonCancel; + private System.Windows.Forms.Button buttonOK; + private System.Windows.Forms.NumericUpDown numericUpDownComPort; + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.Container components = null; + + public int ComPort + { + get { return((int)numericUpDownComPort.Value); } + set { numericUpDownComPort.Value = value; } + } + + public FormSetup() + { + // + // Required for Windows Form Designer support + // + InitializeComponent(); + + // + // TODO: Add any constructor code after InitializeComponent call + // + } + + /// <summary> + /// Clean up any resources being used. + /// </summary> + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(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.label1 = new System.Windows.Forms.Label(); + this.numericUpDownComPort = new System.Windows.Forms.NumericUpDown(); + this.buttonCancel = new System.Windows.Forms.Button(); + this.buttonOK = new System.Windows.Forms.Button(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownComPort)).BeginInit(); + this.SuspendLayout(); + // + // label1 + // + this.label1.Location = new System.Drawing.Point(8, 8); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(224, 24); + this.label1.TabIndex = 0; + this.label1.Text = "Please select the COM port number to use"; + this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // numericUpDownComPort + // + this.numericUpDownComPort.Location = new System.Drawing.Point(240, 8); + this.numericUpDownComPort.Maximum = new System.Decimal(new int[] { + 4, + 0, + 0, + 0}); + this.numericUpDownComPort.Minimum = new System.Decimal(new int[] { + 1, + 0, + 0, + 0}); + this.numericUpDownComPort.Name = "numericUpDownComPort"; + this.numericUpDownComPort.Size = new System.Drawing.Size(56, 20); + this.numericUpDownComPort.TabIndex = 1; + this.numericUpDownComPort.Value = new System.Decimal(new int[] { + 1, + 0, + 0, + 0}); + // + // buttonCancel + // + this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.buttonCancel.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.buttonCancel.Location = new System.Drawing.Point(220, 48); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.TabIndex = 2; + this.buttonCancel.Text = "&Cancel"; + this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); + // + // buttonOK + // + this.buttonOK.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.buttonOK.Location = new System.Drawing.Point(128, 48); + this.buttonOK.Name = "buttonOK"; + this.buttonOK.TabIndex = 3; + this.buttonOK.Text = "&OK"; + this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); + // + // FormSetup + // + this.AcceptButton = this.buttonOK; + this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); + this.CancelButton = this.buttonCancel; + this.ClientSize = new System.Drawing.Size(306, 88); + this.Controls.Add(this.buttonOK); + this.Controls.Add(this.buttonCancel); + this.Controls.Add(this.numericUpDownComPort); + this.Controls.Add(this.label1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.MaximizeBox = false; + this.Name = "FormSetup"; + this.Text = "Motorola Serial Cable Tuner Setup"; + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownComPort)).EndInit(); + this.ResumeLayout(false); + + } + #endregion + + private void buttonOK_Click(object sender, System.EventArgs e) + { + this.DialogResult = DialogResult.OK; + this.Close(); + } + + private void buttonCancel_Click(object sender, System.EventArgs e) + { + this.DialogResult = DialogResult.Cancel; + this.Close(); + } + } +} Added: trunk/plugins/MotorolaSerialCableTuner/FormSetup.resx =================================================================== --- trunk/plugins/MotorolaSerialCableTuner/FormSetup.resx (rev 0) +++ trunk/plugins/MotorolaSerialCableTuner/FormSetup.resx 2007-06-30 16:55:40 UTC (rev 657) @@ -0,0 +1,166 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 1.3 + + 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">1.3</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1">this is my long string</data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + [base64 mime encoded serialized .NET Framework object] + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + [base64 mime encoded string representing a byte array form of the .NET Framework object] + </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 forserialized 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.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:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <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" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + </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>1.3</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <data name="label1.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </data> + <data name="label1.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="label1.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="numericUpDownComPort.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </data> + <data name="numericUpDownComPort.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="numericUpDownComPort.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="buttonCancel.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </data> + <data name="buttonCancel.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="buttonCancel.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="buttonOK.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </data> + <data name="buttonOK.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="buttonOK.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> + <data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </data> + <data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>(Default)</value> + </data> + <data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </data> + <data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </data> + <data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>8, 8</value> + </data> + <data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>True</value> + </data> + <data name="$this.Name"> + <value>FormSetup</value> + </data> + <data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>80</value> + </data> + <data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>True</value> + </data> + <data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>Private</value> + </data> +</root> \ No newline at end of file Added: trunk/plugins/MotorolaSerialCableTuner/MotorolaSerialCableTuner.csproj =================================================================== --- trunk/plugins/MotorolaSerialCableTuner/MotorolaSerialCableTuner.csproj (rev 0) +++ trunk/plugins/MotorolaSerialCableTuner/MotorolaSerialCableTuner.csproj 2007-06-30 16:55:40 UTC (rev 657) @@ -0,0 +1,129 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <ProjectType>Local</ProjectType> + <ProductVersion>8.0.50727</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{EB44A3DE-D853-44D6-94D1-FB652F865A96}</ProjectGuid> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ApplicationIcon> + </ApplicationIcon> + <AssemblyKeyContainerName> + </AssemblyKeyContainerName> + <AssemblyName>MotorolaSerialCableTuner</AssemblyName> + <AssemblyOriginatorKeyFile> + </AssemblyOriginatorKeyFile> + <DefaultClientScript>JScript</DefaultClientScript> + <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout> + <DefaultTargetSchema>IE50</DefaultTargetSchema> + <DelaySign>false</DelaySign> + <OutputType>Library</OutputType> + <RootNamespace>MotorolaSerialCableTuner</RootNamespace> + <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent> + <StartupObject> + </StartupObject> + <FileUpgradeFlags> + </FileUpgradeFlags> + <UpgradeBackupLocation> + </UpgradeBackupLocation> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <OutputPath>bin\Debug\</OutputPath> + <AllowUnsafeBlocks>false</AllowUnsafeBlocks> + <BaseAddress>285212672</BaseAddress> + <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow> + <ConfigurationOverrideFile> + </ConfigurationOverrideFile> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <DocumentationFile> + </DocumentationFile> + <DebugSymbols>true</DebugSymbols> + <FileAlignment>4096</FileAlignment> + <NoStdLib>false</NoStdLib> + <NoWarn> + </NoWarn> + <Optimize>false</Optimize> + <RegisterForComInterop>false</RegisterForComInterop> + <RemoveIntegerChecks>false</RemoveIntegerChecks> + <TreatWarningsAsErrors>false</TreatWarningsAsErrors> + <WarningLevel>4</WarningLevel> + <DebugType>full</DebugType> + <ErrorReport>prompt</ErrorReport> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <OutputPath>bin\Release\</OutputPath> + <AllowUnsafeBlocks>false</AllowUnsafeBlocks> + <BaseAddress>285212672</BaseAddress> + <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow> + <ConfigurationOverrideFile> + </ConfigurationOverrideFile> + <DefineConstants>TRACE</DefineConstants> + <DocumentationFile> + </DocumentationFile> + <DebugSymbols>false</DebugSymbols> + <FileAlignment>4096</FileAlignment> + <NoStdLib>false</NoStdLib> + <NoWarn> + </NoWarn> + <Optimize>true</Optimize> + <RegisterForComInterop>false</RegisterForComInterop> + <RemoveIntegerChecks>false</RemoveIntegerChecks> + <TreatWarningsAsErrors>false</TreatWarningsAsErrors> + <WarningLevel>4</WarningLevel> + <DebugType>none</DebugType> + <ErrorReport>prompt</ErrorReport> + </PropertyGroup> + <ItemGroup> + <Reference Include="Core, Version=0.2.2.9991, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\..\..\MP\trunk\mediaportal\xbmc\bin\Release\Core.dll</HintPath> + </Reference> + <Reference Include="SerialPort"> + <Name>SerialPort</Name> + <HintPath>lib\SerialPort.dll</HintPath> + </Reference> + <Reference Include="System"> + <Name>System</Name> + </Reference> + <Reference Include="System.Data"> + <Name>System.Data</Name> + </Reference> + <Reference Include="System.Drawing"> + <Name>System.Drawing</Name> + </Reference> + <Reference Include="System.Windows.Forms"> + <Name>System.Windows.Forms</Name> + </Reference> + <Reference Include="System.XML"> + <Name>System.XML</Name> + </Reference> + <Reference Include="Utils, Version=0.2.2.9991, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\..\..\MP\trunk\mediaportal\xbmc\bin\Release\Utils.dll</HintPath> + </Reference> + </ItemGroup> + <ItemGroup> + <Compile Include="AssemblyInfo.cs"> + <SubType>Code</SubType> + </Compile> + <Compile Include="FormSetup.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="SerialCableTuner.cs"> + <SubType>Code</SubType> + </Compile> + <Compile Include="Settings.cs"> + <SubType>Code</SubType> + </Compile> + <EmbeddedResource Include="FormSetup.resx"> + <DependentUpon>FormSetup.cs</DependentUpon> + </EmbeddedResource> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <PropertyGroup> + <PreBuildEvent> + </PreBuildEvent> + <PostBuildEvent> + </PostBuildEvent> + </PropertyGroup> +</Project> \ No newline at end of file Added: trunk/plugins/MotorolaSerialCableTuner/MotorolaSerialCableTuner.csproj.user =================================================================== --- trunk/plugins/MotorolaSerialCableTuner/MotorolaSerialCableTuner.csproj.user (rev 0) +++ trunk/plugins/MotorolaSerialCableTuner/MotorolaSerialCableTuner.csproj.user 2007-06-30 16:55:40 UTC (rev 657) @@ -0,0 +1,57 @@ +<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <LastOpenVersion>7.10.3077</LastOpenVersion> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ReferencePath>C:\Mike\Personal Projects\MediaPortal\mediaportal\Core\bin\Release\;C:\Mike\Personal Projects\MediaPortalPlugins\MotorolaSerialCableTuner\lib\</ReferencePath> + <CopyProjectDestinationFolder> + </CopyProjectDestinationFolder> + <CopyProjectUncPath> + </CopyProjectUncPath> + <CopyProjectOption>0</CopyProjectOption> + <ProjectView>ProjectFiles</ProjectView> + <ProjectTrust>0</ProjectTrust> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <EnableASPDebugging>false</EnableASPDebugging> + <EnableASPXDebugging>false</EnableASPXDebugging> + <EnableUnmanagedDebugging>false</EnableUnmanagedDebugging> + <EnableSQLServerDebugging>false</EnableSQLServerDebugging> + <RemoteDebugEnabled>false</RemoteDebugEnabled> + <RemoteDebugMachine> + </RemoteDebugMachine> + <StartAction>Project</StartAction> + <StartArguments> + </StartArguments> + <StartPage> + </StartPage> + <StartProgram> + </StartProgram> + <StartURL> + </StartURL> + <StartWorkingDirectory> + </StartWorkingDirectory> + <StartWithIE>true</StartWithIE> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <EnableASPDebugging>false</EnableASPDebugging> + <EnableASPXDebugging>false</EnableASPXDebugging> + <EnableUnmanagedDebugging>false</EnableUnmanagedDebugging> + <EnableSQLServerDebugging>false</EnableSQLServerDebugging> + <RemoteDebugEnabled>false</RemoteDebugEnabled> + <RemoteDebugMachine> + </RemoteDebugMachine> + <StartAction>Project</StartAction> + <StartArguments> + </StartArguments> + <StartPage> + </StartPage> + <StartProgram> + </StartProgram> + <StartURL> + </StartURL> + <StartWorkingDirectory> + </StartWorkingDirectory> + <StartWithIE>true</StartWithIE> + </PropertyGroup> +</Project> \ No newline at end of file Added: trunk/plugins/MotorolaSerialCableTuner/MotorolaSerialCableTuner.sln =================================================================== --- trunk/plugins/MotorolaSerialCableTuner/MotorolaSerialCableTuner.sln (rev 0) +++ trunk/plugins/MotorolaSerialCableTuner/MotorolaSerialCableTuner.sln 2007-06-30 16:55:40 UTC (rev 657) @@ -0,0 +1,19 @@ +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual C# Express 2005 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MotorolaSerialCableTuner", "MotorolaSerialCableTuner.csproj", "{EB44A3DE-D853-44D6-94D1-FB652F865A96}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {EB44A3DE-D853-44D6-94D1-FB652F865A96}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EB44A3DE-D853-44D6-94D1-FB652F865A96}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EB44A3DE-D853-44D6-94D1-FB652F865A96}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EB44A3DE-D853-44D6-94D1-FB652F865A96}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal Added: trunk/plugins/MotorolaSerialCableTuner/SerialCableTuner.cs =================================================================== --- trunk/plugins/MotorolaSerialCableTuner/SerialCableTuner.cs (rev 0) +++ trunk/plugins/MotorolaSerialCableTuner/SerialCableTuner.cs 2007-06-30 16:55:40 UTC (rev 657) @@ -0,0 +1,217 @@ +using System; +using System.Windows.Forms; +using System.Threading; +using System.Collections; + +//Serial Port library +using SerialPort; + +//Media Portal +using MediaPortal.GUI.Library; + +namespace MotorolaSerialCableTuner +{ + /// <summary> + /// Summary description for SerialCableTuner. + /// </summary> + public class SerialCableTuner : IPlugin, ISetupForm + { + public static int WindowID = 9274; + + private Rs232 port = new Rs232(); + private string version = "1.0"; + private Settings settings = new Settings(); + + private Hashtable channels = new Hashtable(); + private byte[] enter = new byte[] { 0x11, 0x36, 0xEC }; + private byte[] footer = new byte[] { 0x10, 0x03 }; + private byte[] header = new byte[] { 0x10, 0x70, 0x00, 0x02, 0x03, 0x40, 0xC8, 0x27, 0x10, + 0x03, 0x10, 0x78, 0x00, 0x03, 0x03, 0x40, 0x00, 0x68, 0x96, 0x10, 0x03, 0x10, + 0x78, 0x00, 0x04, 0x10, 0x40, 0x22 }; + + public SerialCableTuner() + { + //Do nothing + } + + #region IPlugin Members + + public void Start() + { + Log.Info("Starting Motorola Serial Cable Tuner version {0}", version); + + //Setup channel codes + channels[0] = new byte[] { 0x00, 0x37, 0xE4 }; + channels[1] = new byte[] { 0x01, 0x26, 0x6D }; + channels[2] = new byte[] { 0x02, 0x14, 0xF6 }; + channels[3] = new byte[] { 0x03, 0x05, 0x7F }; + channels[4] = new byte[] { 0x04, 0x71, 0xC0 }; + channels[5] = new byte[] { 0x05, 0x60, 0x49 }; + channels[6] = new byte[] { 0x06, 0x52, 0xD2 }; + channels[7] = new byte[] { 0x07, 0x43, 0x5B }; + channels[8] = new byte[] { 0x08, 0xBB, 0xAC }; + channels[9] = new byte[] { 0x09, 0xAA, 0x25 }; + + //Load settings and setup serial port + settings.Load(); + + try + { + port.Port = settings.ComPort; + port.BaudRate = 9600; + port.StopBit = Rs232.DataStopBit.StopBit_1; + port.Open(); + } + catch + { + Log.Error("Failed to initialize serial port {0}. The port may not be available at this time", settings.ComPort); + } + + //Attach event listener + GUIWindowManager.Receivers += new SendMessageHandler(OnThreadMessage); + } + + public void Stop() + { + try + { + port.Close(); + port = null; + } + catch + { + //Do nothing + } + + Log.Info("Stopping Motorola Serial Cable Tuner version {0}", version); + } + + #endregion + + #region ISetupForm Members + + public bool CanEnable() + { + return(true); + } + + public string Description() + { + return("Serial Cable Tuner for the Motorola Digital Cable Box"); + } + + public bool DefaultEnabled() + { + // TODO: Add SerialCableTuner.DefaultEnabled implementation + return false; + } + + public int GetWindowId() + { + return(SerialCableTuner.WindowID); + } + + public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) + { + // TODO: Add SerialCableTuner.GetHome implementation + strButtonText = null; + strButtonImage = null; + strButtonImageFocus = null; + strPictureImage = null; + return false; + } + + public string Author() + { + return("Michael Hansen"); + } + + public string PluginName() + { + return("Motorola Serial Cable Tuner"); + } + + public bool HasSetup() + { + return(true); + } + + public void ShowPlugin() + { + FormSetup setupForm = new FormSetup(); + setupForm.ComPort = settings.ComPort; + + if (setupForm.ShowDialog() == DialogResult.OK) + { + settings.ComPort = setupForm.ComPort; + settings.Save(); + } + } + + #endregion + + private void OnThreadMessage(GUIMessage message) + { + switch(message.Message) + { + case GUIMessage.MessageType.GUI_MSG_TUNE_EXTERNAL_CHANNEL: + int channelNum = int.Parse(message.Label); + ChangeChannel(channelNum); + break; + } + } + + #region Channel Changing Procedures + + private void ChangeChannel(int channelNum) + { + Log.Info("Changing channel to {0}", channelNum); + + if (port.IsOpen) + { + try + { //Extract channel digits + string digits = channelNum.ToString(); + + while(digits.Length != 3) + { + digits = "0" + digits; + } + + //Write each digit in turn + foreach(char digitChar in digits) + { + int digit = int.Parse(digitChar.ToString()); + WriteCode( (byte[])channels[digit] ); + } + + WriteCode(enter); + } + catch(Exception ex) + { + Log.Error("Failed to change the channel: {0}", ex.Message); + } + } + else + { + Log.Error("Serial port is not open"); + } + } + + private void WriteCode(byte[] buffer) + { + port.Write(header); + port.Write(buffer); + port.Write(footer); + + Delay(); + } + + private void Delay() + { + Thread.Sleep(500); + } + + #endregion + } +} Added: trunk/plugins/MotorolaSerialCableTuner/Settings.cs =================================================================== --- trunk/plugins/MotorolaSerialCableTuner/Settings.cs (rev 0) +++ trunk/plugins/MotorolaSerialCableTuner/Settings.cs 2007-06-30 16:55:40 UTC (rev 657) @@ -0,0 +1,42 @@ +using System; +using MediaPortal.GUI.Library; +using MediaPortal.Util; +using MediaPortal.Configuration; + +namespace MotorolaSerialCableTuner +{ + /// <summary> + /// Summary description for Settings. + /// </summary> + public class Settings + { + private int comPort = 1; + + public int ComPort + { + get { return(comPort); } + set { comPort = value; } + } + + public Settings() + { + //Do nothing + } + + public void Load() + { + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + { + int comPort = xmlreader.GetValueAsInt("MotorolaSerialCableTuner", "ComPort", 1); + } + } + + public void Save() + { + using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + { + xmlwriter.SetValue("MotorolaSerialCableTuner", "ComPort", comPort); + } + } + } +} Added: trunk/plugins/MotorolaSerialCableTuner/lib/SerialPort.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MotorolaSerialCableTuner/lib/SerialPort.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |