From: <an...@us...> - 2008-04-06 14:58:27
|
Revision: 1610 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1610&view=rev Author: and-81 Date: 2008-04-06 07:58:21 -0700 (Sun, 06 Apr 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/setup/setup.nsi trunk/plugins/TelnetInterface/TelnetInterface.cs Added Paths: ----------- trunk/plugins/TelnetCommand/ trunk/plugins/TelnetCommand/Program.cs trunk/plugins/TelnetCommand/Properties/ trunk/plugins/TelnetCommand/Properties/AssemblyInfo.cs trunk/plugins/TelnetCommand/TelnetCommand.csproj Modified: trunk/plugins/IR Server Suite/setup/setup.nsi =================================================================== --- trunk/plugins/IR Server Suite/setup/setup.nsi 2008-04-06 14:38:26 UTC (rev 1609) +++ trunk/plugins/IR Server Suite/setup/setup.nsi 2008-04-06 14:58:21 UTC (rev 1610) @@ -290,6 +290,7 @@ ExecWait '"taskkill" /F /IM IRFileTool.exe' ExecWait '"taskkill" /F /IM DebugClient.exe' ExecWait '"taskkill" /F /IM KeyboardInputRelay.exe' + ExecWait '"taskkill" /F /IM "Input Service Configuration.exe"' IfFileExists "$DIR_INSTALL\Input Service\Input Service.exe" StopInputService SkipStopInputService Property changes on: trunk/plugins/TelnetCommand ___________________________________________________________________ Name: svn:ignore + bin obj Added: trunk/plugins/TelnetCommand/Program.cs =================================================================== --- trunk/plugins/TelnetCommand/Program.cs (rev 0) +++ trunk/plugins/TelnetCommand/Program.cs 2008-04-06 14:58:21 UTC (rev 1610) @@ -0,0 +1,114 @@ +using System; +using System.Collections.Generic; +using System.Net; +using System.Net.Sockets; +using System.Text; + +namespace TelnetCommand +{ + + class Program + { + + const int ServerPort = 2381; + + static void Main(string[] args) + { + if (args.Length == 0 || args.Length == 1) + { + ShowHelp(); + return; + } + else + { + try + { + string hostAddress = args[0]; + + StringBuilder commandString = new StringBuilder(); + for (int index = 1; index < args.Length; index++) + { + commandString.Append(args[index]); + if (index < args.Length - 1) + commandString.Append(' '); + } + + string command = commandString.ToString() + '\r'; + + IPAddress serverIP = GetIPFromName(hostAddress); + IPEndPoint endPoint = new IPEndPoint(serverIP, ServerPort); + + Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); + socket.Connect(endPoint); + + byte[] textBytes = Encoding.ASCII.GetBytes(command); + socket.Send(textBytes); + + byte[] received = new byte[4096]; + + socket.ReceiveTimeout = 500; + + try + { + while (true) + { + int bytesRead = socket.Receive(received); + if (bytesRead == 0) + break; + + string reply = Encoding.ASCII.GetString(received, 0, bytesRead); + + Console.Write(reply); + } + } + catch (SocketException) { } + + socket.Close(); + } + catch (Exception ex) + { + Console.WriteLine(ex.ToString()); + } + } + } + + static void ShowHelp() + { + Console.WriteLine(); + Console.WriteLine("MediaPortal Telnet Interface Command Line Tool"); + Console.WriteLine("by and-81"); + Console.WriteLine(); + Console.WriteLine("Usage:"); + Console.WriteLine(); + Console.WriteLine("TelnetCommand.exe <host address> <command> [command parameters]"); + Console.WriteLine(); + Console.WriteLine("Available Commands:"); + Console.WriteLine(""); + Console.WriteLine("GET ACTIONS, GET SCREENS, GOTO <Screen>, PLAY <File>, ACTION <Action>, EXIT, BYE"); + Console.WriteLine(); + Console.WriteLine("GET ACTIONS - Returns a list of MediaPortal actions the ACTION command can trigger"); + Console.WriteLine("GET SCREENS - Returns a list of MediaPortal screens the GOTO command can use"); + Console.WriteLine("GOTO <Screen> - Make MediaPortal move to another screen, can be the screen name from the GET SCREENS command, or the screen ID from it's XML file"); + Console.WriteLine("PLAY <File> - Play the music/video file specified"); + Console.WriteLine("ACTION <Action> - Trigger a MediaPortal action, this must be one of the actions from the GET ACTIONS command"); + Console.WriteLine("EXIT - Quit MediaPortal"); + Console.WriteLine(); + } + + static IPAddress GetIPFromName(string name) + { + // Automatically convert localhost to loopback address, avoiding lookup calls for systems that aren't on a network. + if (name.Equals("localhost", StringComparison.OrdinalIgnoreCase)) + return IPAddress.Loopback; + + IPAddress[] addresses = Dns.GetHostAddresses(name); + foreach (IPAddress address in addresses) + if (address.AddressFamily == AddressFamily.InterNetwork) + return address; + + return null; + } + + } + +} Added: trunk/plugins/TelnetCommand/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/TelnetCommand/Properties/AssemblyInfo.cs (rev 0) +++ trunk/plugins/TelnetCommand/Properties/AssemblyInfo.cs 2008-04-06 14:58:21 UTC (rev 1610) @@ -0,0 +1,33 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 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("TelnetCommand")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("TelnetCommand")] +[assembly: AssemblyCopyright("Copyright © 2008")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("9f4d1069-258a-421d-980e-b0149e21b410")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("1.4.2.0")] +[assembly: AssemblyFileVersion("1.4.2.0")] Added: trunk/plugins/TelnetCommand/TelnetCommand.csproj =================================================================== --- trunk/plugins/TelnetCommand/TelnetCommand.csproj (rev 0) +++ trunk/plugins/TelnetCommand/TelnetCommand.csproj 2008-04-06 14:58:21 UTC (rev 1610) @@ -0,0 +1,52 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>8.0.50727</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{906BCFAC-8475-412E-951C-588BB9FC8DCD}</ProjectGuid> + <OutputType>Exe</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>TelnetCommand</RootNamespace> + <AssemblyName>TelnetCommand</AssemblyName> + <StartupObject>TelnetCommand.Program</StartupObject> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + <DocumentationFile> + </DocumentationFile> + <UseVSHostingProcess>false</UseVSHostingProcess> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Program.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> \ No newline at end of file Modified: trunk/plugins/TelnetInterface/TelnetInterface.cs =================================================================== --- trunk/plugins/TelnetInterface/TelnetInterface.cs 2008-04-06 14:38:26 UTC (rev 1609) +++ trunk/plugins/TelnetInterface/TelnetInterface.cs 2008-04-06 14:58:21 UTC (rev 1610) @@ -21,6 +21,7 @@ #region Constant const int SocketBacklog = 10; + const int ServerPort = 2381; #endregion Constant @@ -46,7 +47,7 @@ /// </summary> public void Start() { - _serverPort = 2381; + _serverPort = ServerPort; _processConnectionThread = true; GUIWindowManager.Receivers += new SendMessageHandler(GUIWindowManager_Receivers); @@ -94,7 +95,6 @@ foreach (Socket socket in _activeSockets) socket.Close(); - if (_serverSocket != null) _serverSocket.Close(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2008-04-12 11:10:16
|
Revision: 1632 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1632&view=rev Author: and-81 Date: 2008-04-12 04:10:13 -0700 (Sat, 12 Apr 2008) Log Message: ----------- Added PlayOnStart plugin Added Paths: ----------- trunk/plugins/PlayOnStart/ trunk/plugins/PlayOnStart/AssemblyInfo.cs trunk/plugins/PlayOnStart/PlayOnStart Plugin.csproj trunk/plugins/PlayOnStart/PlayOnStart.cs trunk/plugins/PlayOnStart/SetupForm.cs trunk/plugins/PlayOnStart/SetupForm.resx Added: trunk/plugins/PlayOnStart/AssemblyInfo.cs =================================================================== --- trunk/plugins/PlayOnStart/AssemblyInfo.cs (rev 0) +++ trunk/plugins/PlayOnStart/AssemblyInfo.cs 2008-04-12 11:10:13 UTC (rev 1632) @@ -0,0 +1,63 @@ +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Security.Permissions; + +// +// 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("PlayOnStart Plugin")] +[assembly: AssemblyDescription("Supports Playing a file when MediaPortal starts")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("and-81")] +[assembly: AssemblyProduct("MediaPortal")] +[assembly: AssemblyCopyright("Aaron Dinnage")] +[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.4.2.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\<setupForm>. 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("")] +[assembly: ComVisibleAttribute(false)] +[assembly: AssemblyFileVersionAttribute("1.4.2.0")] Added: trunk/plugins/PlayOnStart/PlayOnStart Plugin.csproj =================================================================== --- trunk/plugins/PlayOnStart/PlayOnStart Plugin.csproj (rev 0) +++ trunk/plugins/PlayOnStart/PlayOnStart Plugin.csproj 2008-04-12 11:10:13 UTC (rev 1632) @@ -0,0 +1,78 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>8.0.50727</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{88520E4C-5C49-478A-8AFA-959B45075922}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>MediaPortal.Plugins</RootNamespace> + <AssemblyName>PlayOnStart</AssemblyName> + <StartupObject> + </StartupObject> + <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>false</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + <UseVSHostingProcess>false</UseVSHostingProcess> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>none</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants> + </DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + <UseVSHostingProcess>false</UseVSHostingProcess> + </PropertyGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> + <ItemGroup> + <Compile Include="AssemblyInfo.cs" /> + <Compile Include="PlayOnStart.cs" /> + <Compile Include="SetupForm.cs"> + <SubType>Form</SubType> + </Compile> + </ItemGroup> + <ItemGroup> + <Reference Include="Core, Version=0.2.3.0, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\MediaPortal\xbmc\bin\Release\Core.dll</HintPath> + <Private>False</Private> + </Reference> + <Reference Include="System" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml" /> + <Reference Include="Utils, Version=2.2.4.0, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\MediaPortal\xbmc\bin\Release\Utils.dll</HintPath> + <Private>False</Private> + </Reference> + </ItemGroup> + <PropertyGroup> + </PropertyGroup> + <ItemGroup> + <EmbeddedResource Include="SetupForm.resx"> + <DependentUpon>SetupForm.cs</DependentUpon> + <SubType>Designer</SubType> + </EmbeddedResource> + </ItemGroup> +</Project> \ No newline at end of file Added: trunk/plugins/PlayOnStart/PlayOnStart.cs =================================================================== --- trunk/plugins/PlayOnStart/PlayOnStart.cs (rev 0) +++ trunk/plugins/PlayOnStart/PlayOnStart.cs 2008-04-12 11:10:13 UTC (rev 1632) @@ -0,0 +1,169 @@ +using System; +using System.Windows.Forms; + +using MediaPortal.Player; +using MediaPortal.Profile; +using MediaPortal.GUI.Library; +using MediaPortal.Util; +using MediaPortal.Configuration; + +namespace MediaPortal.Plugins +{ + + /// <summary> + /// Play a file when MediaPortal starts. + /// </summary> + public class PlayOnStart : IPlugin, ISetupForm + { + + #region Variables + + string _playFile; + + #endregion Variables + + #region IPlugin Members + + public void Start() + { + LoadSettings(); + + if (String.IsNullOrEmpty(_playFile)) + Log.Warn("PlayOnStart: No file selected to play"); + else + PlayFile(_playFile); + } + + public void Stop() + { + + } + + #endregion IPlugin Members + + #region ISetupForm methods + + /// <summary> + /// Determines whether this plugin can be enabled. + /// </summary> + /// <returns> + /// <c>true</c> if this plugin can be enabled; otherwise, <c>false</c>. + /// </returns> + public bool CanEnable() { return true; } + /// <summary> + /// Determines whether this plugin has setup. + /// </summary> + /// <returns> + /// <c>true</c> if this plugin has setup; otherwise, <c>false</c>. + /// </returns> + public bool HasSetup() { return true; } + /// <summary> + /// Gets the plugin name. + /// </summary> + /// <returns>The plugin name.</returns> + public string PluginName() { return "Play On Start"; } + /// <summary> + /// Defaults enabled. + /// </summary> + /// <returns>true if this plugin is enabled by default, otherwise false.</returns> + public bool DefaultEnabled() { return true; } + /// <summary> + /// Gets the window id. + /// </summary> + /// <returns>The window id.</returns> + public int GetWindowId() { return 0; } + /// <summary> + /// Gets the plugin author. + /// </summary> + /// <returns>The plugin author.</returns> + public string Author() { return "and-81"; } + /// <summary> + /// Gets the description of the plugin. + /// </summary> + /// <returns>The plugin description.</returns> + public string Description() { return "Play a file when MediaPortal starts"; } + + /// <summary> + /// Shows the plugin configuration. + /// </summary> + public void ShowPlugin() + { + try + { + LoadSettings(); + + SetupForm setupForm = new SetupForm(); + setupForm.PlayFile = _playFile; + + if (setupForm.ShowDialog() == DialogResult.OK) + { + _playFile = setupForm.PlayFile; + SaveSettings(); + } + } + catch (Exception ex) + { + Log.Error(ex); + } + } + + /// <summary> + /// Gets the home screen details for the plugin. + /// </summary> + /// <param name="strButtonText">The button text.</param> + /// <param name="strButtonImage">The button image.</param> + /// <param name="strButtonImageFocus">The button image focus.</param> + /// <param name="strPictureImage">The picture image.</param> + /// <returns>true if the plugin can be seen, otherwise false.</returns> + public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) + { + strButtonText = strButtonImage = strButtonImageFocus = strPictureImage = String.Empty; + return false; + } + + #endregion ISetupForm methods + + #region Implementation + + void LoadSettings() + { + using (Settings xmlreader = new Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + { + _playFile = xmlreader.GetValueAsString("PlayOnStart", "FileName", String.Empty); + } + } + void SaveSettings() + { + using (Settings xmlwriter = new Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + { + xmlwriter.SetValue("PlayOnStart", "FileName", _playFile); + } + } + + void PlayFile(string fileName) + { + Log.Info("PlayOnStart: Play {0}", fileName); + + // Would this be better? + //g_Player.Play(fileName); + + GUIMessage message = new GUIMessage(GUIMessage.MessageType.GUI_MSG_PLAY_FILE, 0, 0, 0, 0, 0, null); + message.Label = fileName; + + GUIGraphicsContext.ResetLastActivity(); + GUIWindowManager.SendThreadMessage(message); + + // If it's in My Videos go fullscreen ... + if (GUIWindowManager.ActiveWindowEx == (int)GUIWindow.Window.WINDOW_VIDEOS) + { + message = new GUIMessage(GUIMessage.MessageType.GUI_MSG_GOTO_WINDOW, 0, 0, 0, (int)GUIWindow.Window.WINDOW_FULLSCREEN_VIDEO, 0, null); + GUIGraphicsContext.ResetLastActivity(); + GUIWindowManager.SendThreadMessage(message); + } + } + + #endregion Implementation + + } + +} Added: trunk/plugins/PlayOnStart/SetupForm.cs =================================================================== --- trunk/plugins/PlayOnStart/SetupForm.cs (rev 0) +++ trunk/plugins/PlayOnStart/SetupForm.cs 2008-04-12 11:10:13 UTC (rev 1632) @@ -0,0 +1,173 @@ +using System; +using System.Drawing; +using System.Collections; +using System.ComponentModel; +using System.Windows.Forms; + +namespace MediaPortal.Plugins +{ + + /// <summary> + /// Summary description for SetupForm. + /// </summary> + public class SetupForm : Form + { + + private GroupBox groupBoxFile; + private TextBox textBoxFile; + private Button buttonSelect; + private Button buttonOK; + private Button buttonCancel; + private OpenFileDialog openFileDialog; + private Container components = null; + + /// <summary> + /// Gets or sets the file to play. + /// </summary> + /// <value>The file to play.</value> + public string PlayFile + { + get { return textBoxFile.Text; } + set { textBoxFile.Text = value; } + } + + public SetupForm() + { + // + // 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.groupBoxFile = new System.Windows.Forms.GroupBox(); + this.buttonOK = new System.Windows.Forms.Button(); + this.buttonCancel = new System.Windows.Forms.Button(); + this.buttonSelect = new System.Windows.Forms.Button(); + this.textBoxFile = new System.Windows.Forms.TextBox(); + this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); + this.groupBoxFile.SuspendLayout(); + this.SuspendLayout(); + // + // groupBoxFile + // + this.groupBoxFile.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.groupBoxFile.Controls.Add(this.textBoxFile); + this.groupBoxFile.Controls.Add(this.buttonSelect); + this.groupBoxFile.Location = new System.Drawing.Point(8, 8); + this.groupBoxFile.Name = "groupBoxFile"; + this.groupBoxFile.Size = new System.Drawing.Size(296, 44); + this.groupBoxFile.TabIndex = 0; + this.groupBoxFile.TabStop = false; + this.groupBoxFile.Text = "File to play"; + // + // buttonOK + // + this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonOK.Location = new System.Drawing.Point(168, 64); + this.buttonOK.Name = "buttonOK"; + this.buttonOK.Size = new System.Drawing.Size(64, 24); + this.buttonOK.TabIndex = 1; + this.buttonOK.Text = "OK"; + this.buttonOK.UseVisualStyleBackColor = true; + // + // buttonCancel + // + this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.buttonCancel.Location = new System.Drawing.Point(240, 64); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.Size = new System.Drawing.Size(64, 24); + this.buttonCancel.TabIndex = 2; + this.buttonCancel.Text = "Cancel"; + this.buttonCancel.UseVisualStyleBackColor = true; + // + // buttonSelect + // + this.buttonSelect.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.buttonSelect.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.buttonSelect.Location = new System.Drawing.Point(264, 16); + this.buttonSelect.Name = "buttonSelect"; + this.buttonSelect.Size = new System.Drawing.Size(24, 20); + this.buttonSelect.TabIndex = 3; + this.buttonSelect.Text = "..."; + this.buttonSelect.UseVisualStyleBackColor = true; + this.buttonSelect.Click += new System.EventHandler(this.buttonSelect_Click); + // + // textBoxFile + // + this.textBoxFile.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBoxFile.Location = new System.Drawing.Point(8, 16); + this.textBoxFile.Name = "textBoxFile"; + this.textBoxFile.Size = new System.Drawing.Size(248, 20); + this.textBoxFile.TabIndex = 4; + // + // openFileDialog + // + this.openFileDialog.Filter = "All files|*.*"; + this.openFileDialog.Title = "Select file to play ..."; + // + // SetupForm + // + this.AcceptButton = this.buttonOK; + this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); + this.CancelButton = this.buttonCancel; + this.ClientSize = new System.Drawing.Size(314, 94); + this.Controls.Add(this.buttonCancel); + this.Controls.Add(this.buttonOK); + this.Controls.Add(this.groupBoxFile); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "SetupForm"; + this.ShowIcon = false; + this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Play On Start - Setup"; + this.groupBoxFile.ResumeLayout(false); + this.groupBoxFile.PerformLayout(); + this.ResumeLayout(false); + + } + #endregion + + private void buttonSelect_Click(object sender, EventArgs e) + { + if (!String.IsNullOrEmpty(textBoxFile.Text)) + openFileDialog.FileName = textBoxFile.Text; + + if (openFileDialog.ShowDialog() == DialogResult.OK) + textBoxFile.Text = openFileDialog.FileName; + } + + } + +} Added: trunk/plugins/PlayOnStart/SetupForm.resx =================================================================== --- trunk/plugins/PlayOnStart/SetupForm.resx (rev 0) +++ trunk/plugins/PlayOnStart/SetupForm.resx 2008-04-12 11:10:13 UTC (rev 1632) @@ -0,0 +1,123 @@ +<?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="openFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>17, 17</value> + </metadata> +</root> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2008-04-12 11:43:56
|
Revision: 1635 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1635&view=rev Author: and-81 Date: 2008-04-12 04:43:48 -0700 (Sat, 12 Apr 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/Translator/CopyDataWM.cs trunk/plugins/IR Server Suite/Applications/Web Remote/Setup.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Win32.cs trunk/plugins/IR Server Suite/Documentation/new.html trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs trunk/plugins/PlayOnStart/PlayOnStart.cs Modified: trunk/plugins/IR Server Suite/Applications/Translator/CopyDataWM.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/CopyDataWM.cs 2008-04-12 11:24:22 UTC (rev 1634) +++ trunk/plugins/IR Server Suite/Applications/Translator/CopyDataWM.cs 2008-04-12 11:43:48 UTC (rev 1635) @@ -9,6 +9,9 @@ namespace Translator { + /// <summary> + /// Used for sending and receiving Copy Data Windows Messages. + /// </summary> class CopyDataWM : NativeWindow, IDisposable { @@ -79,6 +82,10 @@ #region Methods + /// <summary> + /// Starts this instance. + /// </summary> + /// <returns></returns> public bool Start() { if (Handle != IntPtr.Zero) @@ -94,6 +101,9 @@ return (Handle != IntPtr.Zero); } + /// <summary> + /// Stops this instance. + /// </summary> public void Stop() { if (Handle != IntPtr.Zero) @@ -104,6 +114,10 @@ #region Overrides + /// <summary> + /// Invokes the default window procedure associated with this window. + /// </summary> + /// <param name="m">A <see cref="T:System.Windows.Forms.Message"></see> that is associated with the current Windows message.</param> protected override void WndProc(ref Message m) { if (m.Msg == (int)Win32.WindowsMessage.WM_COPYDATA) @@ -121,9 +135,8 @@ } byte[] dataBytes = new byte[dataStructure.cbData]; - IntPtr lpData = new IntPtr(dataStructure.lpData); - Marshal.Copy(lpData, dataBytes, 0, dataStructure.cbData); - string strData = Encoding.Default.GetString(dataBytes); + Marshal.Copy(dataStructure.lpData, dataBytes, 0, dataStructure.cbData); + string strData = Encoding.ASCII.GetString(dataBytes); Program.ProcessCommand(strData, false); } @@ -146,10 +159,10 @@ { Win32.COPYDATASTRUCT copyData; - byte[] dataBytes = Encoding.Default.GetBytes(data); + byte[] dataBytes = Encoding.ASCII.GetBytes(data); copyData.dwData = CopyDataID; - copyData.lpData = Win32.VarPtr(dataBytes).ToInt32(); + copyData.lpData = Win32.VarPtr(dataBytes); copyData.cbData = dataBytes.Length; IntPtr windowHandle = Win32.FindWindowByTitle(CopyDataTarget); Modified: trunk/plugins/IR Server Suite/Applications/Web Remote/Setup.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Web Remote/Setup.cs 2008-04-12 11:24:22 UTC (rev 1634) +++ trunk/plugins/IR Server Suite/Applications/Web Remote/Setup.cs 2008-04-12 11:43:48 UTC (rev 1635) @@ -61,7 +61,7 @@ string text = textBoxPassword.Text; MD5 md5 = new MD5CryptoServiceProvider(); - byte[] hash = md5.ComputeHash(Encoding.Default.GetBytes(text)); + byte[] hash = md5.ComputeHash(Encoding.ASCII.GetBytes(text)); return BitConverter.ToString(hash); } Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/Win32.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/Win32.cs 2008-04-12 11:24:22 UTC (rev 1634) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/Win32.cs 2008-04-12 11:43:48 UTC (rev 1635) @@ -1690,7 +1690,7 @@ /// <summary> /// Data. /// </summary> - public int lpData; + public IntPtr lpData; } /// <summary> @@ -1723,12 +1723,14 @@ public string szTypeName; }; + [StructLayout(LayoutKind.Sequential)] struct POINTAPI { public int x; public int y; } + [StructLayout(LayoutKind.Sequential)] struct RECT { public int left; @@ -1737,6 +1739,7 @@ public int bottom; } + [StructLayout(LayoutKind.Sequential)] struct WINDOWPLACEMENT { public int length; Modified: trunk/plugins/IR Server Suite/Documentation/new.html =================================================================== --- trunk/plugins/IR Server Suite/Documentation/new.html 2008-04-12 11:24:22 UTC (rev 1634) +++ trunk/plugins/IR Server Suite/Documentation/new.html 2008-04-12 11:43:48 UTC (rev 1635) @@ -73,6 +73,9 @@ <LI>Imon input plugin: Improved Imon plugin, now supports MCE and Imon PAD remote hardware.</LI> <LI>Tray Launcher: Now uses the Common program launching code (includes new focus forcing code).</LI> <LI>Translator: Fixed a bug with the tray icon not re-appearing correctly after being hidden.</LI> +<LI>Installer: Fixed an x64 bug.</LI> +<LI>Translator: Fixed an x64 bug.</LI> + </UL></P> <BR> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs 2008-04-12 11:24:22 UTC (rev 1634) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs 2008-04-12 11:43:48 UTC (rev 1635) @@ -635,7 +635,8 @@ if (_ignoreAutomaticButtons && codeType == IrProtocol.RC6_MCE) { // Always ignore these buttones ... - if (keyCode == 0x7bdc || // Back + if ( + //keyCode == 0x7bdc || // Back (removed 12-April-2008) keyCode == 0x7bdd || // OK keyCode == 0x7bde || // Right keyCode == 0x7bdf || // Left Modified: trunk/plugins/PlayOnStart/PlayOnStart.cs =================================================================== --- trunk/plugins/PlayOnStart/PlayOnStart.cs 2008-04-12 11:24:22 UTC (rev 1634) +++ trunk/plugins/PlayOnStart/PlayOnStart.cs 2008-04-12 11:43:48 UTC (rev 1635) @@ -148,19 +148,19 @@ { Log.Info("PlayOnStart: Play {0}", fileName); - // Would this be better? - //g_Player.Play(fileName); + g_Player.Play(fileName); + /* GUIMessage message = new GUIMessage(GUIMessage.MessageType.GUI_MSG_PLAY_FILE, 0, 0, 0, 0, 0, null); message.Label = fileName; GUIGraphicsContext.ResetLastActivity(); GUIWindowManager.SendThreadMessage(message); + */ - // If it's in My Videos go fullscreen ... - if (GUIWindowManager.ActiveWindowEx == (int)GUIWindow.Window.WINDOW_VIDEOS) + if (g_Player.IsVideo) { - message = new GUIMessage(GUIMessage.MessageType.GUI_MSG_GOTO_WINDOW, 0, 0, 0, (int)GUIWindow.Window.WINDOW_FULLSCREEN_VIDEO, 0, null); + GUIMessage message = new GUIMessage(GUIMessage.MessageType.GUI_MSG_GOTO_WINDOW, 0, 0, 0, (int)GUIWindow.Window.WINDOW_FULLSCREEN_VIDEO, 0, null); GUIGraphicsContext.ResetLastActivity(); GUIWindowManager.SendThreadMessage(message); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <j_b...@us...> - 2008-04-19 01:46:57
|
Revision: 1667 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1667&view=rev Author: j_burnette Date: 2008-04-18 18:46:55 -0700 (Fri, 18 Apr 2008) Log Message: ----------- initial import Added Paths: ----------- trunk/plugins/myusenet/ trunk/plugins/myusenet/changes.txt trunk/plugins/myusenet/myusenet.sln trunk/plugins/myusenet/myusenet.suo trunk/plugins/myusenet/myusenet.suo.r3 trunk/plugins/myusenet/myusenet.suo.r4 trunk/plugins/myusenet/nfodoc.png trunk/plugins/myusenet/testing/ trunk/plugins/myusenet/testing/My Project/ trunk/plugins/myusenet/testing/My Project/Application.Designer.vb trunk/plugins/myusenet/testing/My Project/Application.myapp trunk/plugins/myusenet/testing/My Project/AssemblyInfo.vb trunk/plugins/myusenet/testing/My Project/Resources.Designer.vb trunk/plugins/myusenet/testing/My Project/Resources.resx trunk/plugins/myusenet/testing/My Project/Settings.Designer.vb trunk/plugins/myusenet/testing/My Project/Settings.settings trunk/plugins/myusenet/testing/Resources/ trunk/plugins/myusenet/testing/SABapi.vb trunk/plugins/myusenet/testing/bin/ trunk/plugins/myusenet/testing/bin/Debug/ trunk/plugins/myusenet/testing/bin/Debug/AxInterop.WMPLib.dll trunk/plugins/myusenet/testing/bin/Debug/Bass.Net.dll trunk/plugins/myusenet/testing/bin/Debug/BassRegistration.dll trunk/plugins/myusenet/testing/bin/Debug/CSScriptLibrary.dll trunk/plugins/myusenet/testing/bin/Debug/Core.DLL trunk/plugins/myusenet/testing/bin/Debug/Databases.DLL trunk/plugins/myusenet/testing/bin/Debug/Dialogs.DLL trunk/plugins/myusenet/testing/bin/Debug/DirectShowLib.dll trunk/plugins/myusenet/testing/bin/Debug/ICSharpCode.SharpZipLib.DLL trunk/plugins/myusenet/testing/bin/Debug/Interop.WMPLib.dll trunk/plugins/myusenet/testing/bin/Debug/MediaPortal.Support.dll trunk/plugins/myusenet/testing/bin/Debug/Utils.dll trunk/plugins/myusenet/testing/bin/Debug/edtftpnet-1.2.2.dll trunk/plugins/myusenet/testing/bin/Debug/myusenet.dll trunk/plugins/myusenet/testing/bin/Debug/myusenet.pdb trunk/plugins/myusenet/testing/bin/Debug/myusenet.xml trunk/plugins/myusenet/testing/bin/Debug/taglib-sharp.dll trunk/plugins/myusenet/testing/bin/Debug/testing.dll trunk/plugins/myusenet/testing/bin/Debug/testing.pdb trunk/plugins/myusenet/testing/bin/Debug/testing.xml trunk/plugins/myusenet/testing/bin/Release/ trunk/plugins/myusenet/testing/bin/Release/#/ trunk/plugins/myusenet/testing/bin/Release/AxInterop.WMPLib.dll trunk/plugins/myusenet/testing/bin/Release/Bass.Net.dll trunk/plugins/myusenet/testing/bin/Release/BassRegistration.dll trunk/plugins/myusenet/testing/bin/Release/CSScriptLibrary.dll trunk/plugins/myusenet/testing/bin/Release/Core.DLL trunk/plugins/myusenet/testing/bin/Release/Databases.DLL trunk/plugins/myusenet/testing/bin/Release/Dialogs.DLL trunk/plugins/myusenet/testing/bin/Release/DirectShowLib.dll trunk/plugins/myusenet/testing/bin/Release/ICSharpCode.SharpZipLib.DLL trunk/plugins/myusenet/testing/bin/Release/Interop.WMPLib.dll trunk/plugins/myusenet/testing/bin/Release/MediaPortal.Support.dll trunk/plugins/myusenet/testing/bin/Release/New Folder/ trunk/plugins/myusenet/testing/bin/Release/Utils.dll trunk/plugins/myusenet/testing/bin/Release/edtftpnet-1.2.2.dll trunk/plugins/myusenet/testing/bin/Release/myusenet/ trunk/plugins/myusenet/testing/bin/Release/myusenet/release/ trunk/plugins/myusenet/testing/bin/Release/myusenet/release/Skin/ trunk/plugins/myusenet/testing/bin/Release/myusenet/release/Skin/BlueTwo/ trunk/plugins/myusenet/testing/bin/Release/myusenet/release/Skin/BlueTwo/Media/ trunk/plugins/myusenet/testing/bin/Release/myusenet/release/Skin/BlueTwo/Media/usenet.png trunk/plugins/myusenet/testing/bin/Release/myusenet/release/Skin/BlueTwo wide/ trunk/plugins/myusenet/testing/bin/Release/myusenet/release/Skin/BlueTwo wide/media/ trunk/plugins/myusenet/testing/bin/Release/myusenet/release/Skin/BlueTwo wide/media/usenet.png trunk/plugins/myusenet/testing/bin/Release/myusenet/source/ trunk/plugins/myusenet/testing/bin/Release/myusenet-beta.fixed.rar trunk/plugins/myusenet/testing/bin/Release/myusenet.dll trunk/plugins/myusenet/testing/bin/Release/myusenet.otherfix.rar trunk/plugins/myusenet/testing/bin/Release/myusenet.pdb trunk/plugins/myusenet/testing/bin/Release/myusenet.xml trunk/plugins/myusenet/testing/bin/Release/myusenet0.2.rar trunk/plugins/myusenet/testing/bin/Release/taglib-sharp.dll trunk/plugins/myusenet/testing/config/ trunk/plugins/myusenet/testing/config/binsearchgroups.Designer.vb trunk/plugins/myusenet/testing/config/binsearchgroups.resx trunk/plugins/myusenet/testing/config/binsearchgroups.vb trunk/plugins/myusenet/testing/config/config2.Designer.vb trunk/plugins/myusenet/testing/config/config2.resx trunk/plugins/myusenet/testing/config/config2.vb trunk/plugins/myusenet/testing/config/custom.Designer.vb trunk/plugins/myusenet/testing/config/custom.resx trunk/plugins/myusenet/testing/config/custom.vb trunk/plugins/myusenet/testing/config/importer.vb trunk/plugins/myusenet/testing/config/newzbin-importer.Designer.vb trunk/plugins/myusenet/testing/config/newzbin-importer.resx trunk/plugins/myusenet/testing/config/newzbin-importer.vb trunk/plugins/myusenet/testing/directnzb.vb trunk/plugins/myusenet/testing/myusenet.vb trunk/plugins/myusenet/testing/myusenet.vbproj trunk/plugins/myusenet/testing/myusenet.vbproj.user trunk/plugins/myusenet/testing/ninanutils.vb trunk/plugins/myusenet/testing/obj/ trunk/plugins/myusenet/testing/obj/Debug/ trunk/plugins/myusenet/testing/obj/Debug/ResolveAssemblyReference.cache trunk/plugins/myusenet/testing/obj/Debug/TempPE/ trunk/plugins/myusenet/testing/obj/Debug/TempPE/My Project.Resources.Designer.vb.dll trunk/plugins/myusenet/testing/obj/Debug/myusenet.Resources.resources trunk/plugins/myusenet/testing/obj/Debug/myusenet.binsearchgroups.resources trunk/plugins/myusenet/testing/obj/Debug/myusenet.config2.resources trunk/plugins/myusenet/testing/obj/Debug/myusenet.custom.resources trunk/plugins/myusenet/testing/obj/Debug/myusenet.dll trunk/plugins/myusenet/testing/obj/Debug/myusenet.newzbin_importer.resources trunk/plugins/myusenet/testing/obj/Debug/myusenet.pdb trunk/plugins/myusenet/testing/obj/Debug/myusenet.vbproj.GenerateResource.Cache trunk/plugins/myusenet/testing/obj/Debug/myusenet.xml trunk/plugins/myusenet/testing/obj/Debug/testing.dll trunk/plugins/myusenet/testing/obj/Debug/testing.pdb trunk/plugins/myusenet/testing/obj/Debug/testing.vbproj.GenerateResource.Cache trunk/plugins/myusenet/testing/obj/Debug/testing.xml trunk/plugins/myusenet/testing/obj/Release/ trunk/plugins/myusenet/testing/obj/Release/ClassLibrary1.Resources.resources trunk/plugins/myusenet/testing/obj/Release/ClassLibrary1.binsearchgroups.resources trunk/plugins/myusenet/testing/obj/Release/ClassLibrary1.config2.resources trunk/plugins/myusenet/testing/obj/Release/ClassLibrary1.custom.resources trunk/plugins/myusenet/testing/obj/Release/ClassLibrary1.newzbin_importer.resources trunk/plugins/myusenet/testing/obj/Release/ResolveAssemblyReference.cache trunk/plugins/myusenet/testing/obj/Release/TempPE/ trunk/plugins/myusenet/testing/obj/Release/TempPE/My Project.Resources.Designer.vb.dll trunk/plugins/myusenet/testing/obj/Release/build.force trunk/plugins/myusenet/testing/obj/Release/myusenet.Resources.resources trunk/plugins/myusenet/testing/obj/Release/myusenet.binsearchgroups.resources trunk/plugins/myusenet/testing/obj/Release/myusenet.config2.resources trunk/plugins/myusenet/testing/obj/Release/myusenet.custom.resources trunk/plugins/myusenet/testing/obj/Release/myusenet.dll trunk/plugins/myusenet/testing/obj/Release/myusenet.newzbin_importer.resources trunk/plugins/myusenet/testing/obj/Release/myusenet.pdb trunk/plugins/myusenet/testing/obj/Release/myusenet.vbproj.GenerateResource.Cache trunk/plugins/myusenet/testing/obj/Release/myusenet.vbproj.ResolveComReference.cache trunk/plugins/myusenet/testing/obj/Release/myusenet.xml trunk/plugins/myusenet/testing/obj/Release/testing.vbproj.GenerateResource.Cache trunk/plugins/myusenet/testing/obj/myusenet.vbproj.FileList.txt trunk/plugins/myusenet/testing/obj/myusenet.vbproj.FileListAbsolute.txt trunk/plugins/myusenet/testing/obj/testing.vbproj.FileList.txt trunk/plugins/myusenet/testing/sabutils.vb trunk/plugins/myusenet/testing/utils.vb trunk/plugins/myusenet/tvseries.myusenet.mod.zip Added: trunk/plugins/myusenet/changes.txt =================================================================== --- trunk/plugins/myusenet/changes.txt (rev 0) +++ trunk/plugins/myusenet/changes.txt 2008-04-19 01:46:55 UTC (rev 1667) @@ -0,0 +1,21 @@ +Added support for Binsearch.info +Enabled very beta NFO viewer for Newzbin (limited by, I think, MediaPortal's textbox control) +Switched SAB access to the new API. Speeds things up a bit and fixes most connection errors caused by the server not responding in time. Also adds a bit of information to the status overview. +Fixed NZBMatrix page numbering. +Added support for Ninan 1.1.4 (http://www.ninan.org/modules/wfdownloads/viewcat.php?cid=1). +Added ability to add/use custom feeds for Newzbin and NZBMatrix. +Added importer for Newzbin to import your Saved Searches and Grouplists as custom feeds. +Added Notifier for completed downloads when using SABnzbd/Ninan. +Newzbin/NZBMatrix cookies will be automatically refreshed if they are invalid. +Added ability to set a default job type when using Newzbin with SABnzbd. This setting is changeable on the fly from the context menu. +Fixed slight discrepency between NZBMatrix feeds in plugin and on website. +Various bugfixes which were fixed in versions scattered through this thread. +Tweaked regex file name suggestions for Binsearch/Yabse (If anyone can tweak it to work better that would be much appreciated. Regex ain't my thing and it's currently pretty nasty and pointless in most cases.) + +todo: + +Ninan not liking some nzb files +Problems with binsearch not showing attributes because of really long titles in listbox (this has to be a problem with Mediaportal's rendering of the GUI) + +15,996 +16,016 - 5 min later \ No newline at end of file Added: trunk/plugins/myusenet/myusenet.sln =================================================================== --- trunk/plugins/myusenet/myusenet.sln (rev 0) +++ trunk/plugins/myusenet/myusenet.sln 2008-04-19 01:46:55 UTC (rev 1667) @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Basic Express 2005 +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "myusenet", "testing\myusenet.vbproj", "{2C22E84C-13AE-4F90-B09E-87CF6ED83178}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {2C22E84C-13AE-4F90-B09E-87CF6ED83178}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2C22E84C-13AE-4F90-B09E-87CF6ED83178}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2C22E84C-13AE-4F90-B09E-87CF6ED83178}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2C22E84C-13AE-4F90-B09E-87CF6ED83178}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal Added: trunk/plugins/myusenet/myusenet.suo =================================================================== (Binary files differ) Property changes on: trunk/plugins/myusenet/myusenet.suo ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/myusenet/myusenet.suo.r3 =================================================================== (Binary files differ) Property changes on: trunk/plugins/myusenet/myusenet.suo.r3 ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/myusenet/myusenet.suo.r4 =================================================================== (Binary files differ) Property changes on: trunk/plugins/myusenet/myusenet.suo.r4 ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/myusenet/nfodoc.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/myusenet/nfodoc.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/myusenet/testing/My Project/Application.Designer.vb =================================================================== --- trunk/plugins/myusenet/testing/My Project/Application.Designer.vb (rev 0) +++ trunk/plugins/myusenet/testing/My Project/Application.Designer.vb 2008-04-19 01:46:55 UTC (rev 1667) @@ -0,0 +1,13 @@ +'------------------------------------------------------------------------------ +' <auto-generated> +' This code was generated by a tool. +' Runtime Version:2.0.50727.312 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' </auto-generated> +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + Added: trunk/plugins/myusenet/testing/My Project/Application.myapp =================================================================== --- trunk/plugins/myusenet/testing/My Project/Application.myapp (rev 0) +++ trunk/plugins/myusenet/testing/My Project/Application.myapp 2008-04-19 01:46:55 UTC (rev 1667) @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8"?> +<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <MySubMain>false</MySubMain> + <SingleInstance>false</SingleInstance> + <ShutdownMode>0</ShutdownMode> + <EnableVisualStyles>true</EnableVisualStyles> + <AuthenticationMode>0</AuthenticationMode> + <ApplicationType>1</ApplicationType> + <SaveMySettingsOnExit>true</SaveMySettingsOnExit> +</MyApplicationData> Added: trunk/plugins/myusenet/testing/My Project/AssemblyInfo.vb =================================================================== --- trunk/plugins/myusenet/testing/My Project/AssemblyInfo.vb (rev 0) +++ trunk/plugins/myusenet/testing/My Project/AssemblyInfo.vb 2008-04-19 01:46:55 UTC (rev 1667) @@ -0,0 +1,35 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' 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. + +' Review the values of the assembly attributes + +<Assembly: AssemblyTitle("ClassLibrary1")> +<Assembly: AssemblyDescription("")> +<Assembly: AssemblyCompany("")> +<Assembly: AssemblyProduct("ClassLibrary1")> +<Assembly: AssemblyCopyright("Copyright © 2007")> +<Assembly: AssemblyTrademark("")> + +<Assembly: ComVisible(False)> + +'The following GUID is for the ID of the typelib if this project is exposed to COM +<Assembly: Guid("b6b3b639-e8ed-4802-afcf-fceb045d0201")> + +' 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 Build and Revision Numbers +' by using the '*' as shown below: +' <Assembly: AssemblyVersion("1.0.*")> + +<Assembly: AssemblyVersion("1.0.0.0")> +<Assembly: AssemblyFileVersion("1.0.0.0")> Added: trunk/plugins/myusenet/testing/My Project/Resources.Designer.vb =================================================================== --- trunk/plugins/myusenet/testing/My Project/Resources.Designer.vb (rev 0) +++ trunk/plugins/myusenet/testing/My Project/Resources.Designer.vb 2008-04-19 01:46:55 UTC (rev 1667) @@ -0,0 +1,63 @@ +'------------------------------------------------------------------------------ +' <auto-generated> +' This code was generated by a tool. +' Runtime Version:2.0.50727.312 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' </auto-generated> +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + +Imports System + +Namespace My.Resources + + 'This class was auto-generated by the StronglyTypedResourceBuilder + 'class via a tool like ResGen or Visual Studio. + 'To add or remove a member, edit your .ResX file then rerun ResGen + 'with the /str option, or rebuild your VS project. + '''<summary> + ''' A strongly-typed resource class, for looking up localized strings, etc. + '''</summary> + <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0"), _ + Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ + Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ + Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + '''<summary> + ''' Returns the cached ResourceManager instance used by this class. + '''</summary> + <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("myusenet.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + '''<summary> + ''' Overrides the current thread's CurrentUICulture property for all + ''' resource lookups using this strongly typed resource class. + '''</summary> + <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set + resourceCulture = value + End Set + End Property + End Module +End Namespace Added: trunk/plugins/myusenet/testing/My Project/Resources.resx =================================================================== --- trunk/plugins/myusenet/testing/My Project/Resources.resx (rev 0) +++ trunk/plugins/myusenet/testing/My Project/Resources.resx 2008-04-19 01:46:55 UTC (rev 1667) @@ -0,0 +1,121 @@ +<?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> + <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> + </root> \ No newline at end of file Added: trunk/plugins/myusenet/testing/My Project/Settings.Designer.vb =================================================================== --- trunk/plugins/myusenet/testing/My Project/Settings.Designer.vb (rev 0) +++ trunk/plugins/myusenet/testing/My Project/Settings.Designer.vb 2008-04-19 01:46:55 UTC (rev 1667) @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' <auto-generated> +' This code was generated by a tool. +' Runtime Version:2.0.50727.312 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' </auto-generated> +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ + Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0"), _ + Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings),MySettings) + +#Region "My.Settings Auto-Save Functionality" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _ + Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ + Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _ + Friend Module MySettingsProperty + + <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _ + Friend ReadOnly Property Settings() As Global.myusenet.My.MySettings + Get + Return Global.myusenet.My.MySettings.Default + End Get + End Property + End Module +End Namespace Added: trunk/plugins/myusenet/testing/My Project/Settings.settings =================================================================== --- trunk/plugins/myusenet/testing/My Project/Settings.settings (rev 0) +++ trunk/plugins/myusenet/testing/My Project/Settings.settings 2008-04-19 01:46:55 UTC (rev 1667) @@ -0,0 +1,7 @@ +<?xml version='1.0' encoding='utf-8'?> +<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true"> + <Profiles> + <Profile Name="(Default)" /> + </Profiles> + <Settings /> +</SettingsFile> Added: trunk/plugins/myusenet/testing/SABapi.vb =================================================================== --- trunk/plugins/myusenet/testing/SABapi.vb (rev 0) +++ trunk/plugins/myusenet/testing/SABapi.vb 2008-04-19 01:46:55 UTC (rev 1667) @@ -0,0 +1,168 @@ +Imports System.Net +Imports MediaPortal.Dialogs +Imports MediaPortal.GUI.Library + + + +Public Class SABapi + + Public oldname As String = "Nothing" + Public myusenet As myusenet + + Public Function apiMainStatus(ByVal address As Uri) + + Dim bldr As New UriBuilder(address) + bldr.Path = "/sabnzbd/api" + bldr.Query = "mode=qstatus&output=xml" + MediaPortal.ServiceImplementations.Log.Debug(bldr.Uri.ToString) + Dim httpclient As System.Net.HttpWebRequest = HttpWebRequest.Create(bldr.Uri) + + If myusenet.gotservercookie = True Then + httpclient.CookieContainer = New CookieContainer + httpclient.CookieContainer.Add(myusenet.servercookie) + End If + Dim httpresponse As System.Net.HttpWebResponse = httpclient.GetResponse + Dim sr As New System.IO.StreamReader(httpresponse.GetResponseStream) + + Dim speed As String + Dim mbleft As String = "0" + Dim name As String = "Nothing" + Dim desc As String + Dim remainingqueue As String + Dim queuesize As String + Dim eta As String + + Dim xmldoc As New System.Xml.XmlDocument + xmldoc.LoadXml(sr.ReadToEnd) + + Dim jobnodelist As System.Xml.XmlNodeList + Dim mainnodelist As System.Xml.XmlNodeList + + mainnodelist = xmldoc.GetElementsByTagName("kbpersec") + If xmldoc.GetElementsByTagName("job").Count <> 0 Then + jobnodelist = xmldoc.GetElementsByTagName("job") + name = jobnodelist.Item(0).ChildNodes.Item(1).InnerText.ToString + MediaPortal.ServiceImplementations.Log.Debug("name " + name) + mbleft = jobnodelist.Item(0).ChildNodes.Item(2).InnerText.ToString + MediaPortal.ServiceImplementations.Log.Debug("mbleft " + mbleft) + End If + + speed = mainnodelist.Item(0).InnerText + MediaPortal.ServiceImplementations.Log.Debug("speed " + speed) + + Dim rawspeed As String = speed + If rawspeed > 1024 Then + rawspeed = System.Math.Round(rawspeed / 1024, 2).ToString + " MB/s" + ElseIf rawspeed < 1024 Then + rawspeed = System.Math.Round(CType(rawspeed, Double), 2).ToString + " KB/s" + End If + + speed = speed / 1024 + eta = mbleft / speed + + If mbleft > 0 Then + If eta > 3600 Then eta = System.Math.Round(CType(eta / 3600, Double), 1).ToString + " hours" Else eta = System.Math.Round(CType(eta / 60, Double), 1).ToString + " minute(s)" + Else + eta = "0 Minute(s)" + End If + + MediaPortal.ServiceImplementations.Log.Debug(name + " | " + rawspeed + " | ETA: " + eta) + + mainnodelist = xmldoc.GetElementsByTagName("mbleft") + queuesize = mainnodelist.Item(0).InnerText + remainingqueue = queuesize / speed + + If mbleft > 0 Then + If remainingqueue > 3600 Then remainingqueue = System.Math.Round(CType(remainingqueue / 3600, Double), 1).ToString + " hours" Else remainingqueue = System.Math.Round(CType(remainingqueue / 60, Double), 1).ToString + " minute(s)" + Else + remainingqueue = "0 Minute(s)" + End If + + If queuesize > 1024 Then queuesize = System.Math.Round(queuesize / 1024, 2).ToString + " GB" Else queuesize = System.Math.Round(CType(queuesize, Double), 2).ToString + " MB" + + Dim freespace As String + mainnodelist = xmldoc.GetElementsByTagName("diskspace2") + + freespace = mainnodelist.Item(0).InnerText + freespace = System.Math.Round(CType(freespace, Double), 2).ToString + " GB" + + mainnodelist = xmldoc.GetElementsByTagName("paused") + myusenet.checkpause = mainnodelist.Item(0).InnerText + + If oldname <> "Nothing" And oldname <> name And oldname.Contains("fetching") = False Then + + sabNotify() + + End If + oldname = name + desc = "Downloading: " + name + " | Speed: " + rawspeed + " | ETA: " + eta + " | Queued: " + queuesize + " | Queue ETA: " + remainingqueue + " | Free Space: " + freespace + httpresponse.Close() + Return desc + + + End Function + + Public Function apiAddID(ByVal id As String, ByVal address As Uri, ByVal joboption As String) + Dim bldr As New UriBuilder(address) + bldr.Path = "/sabnzbd/api" + bldr.Query = "mode=addid&name=" + id + "&pp=" + joboption + MediaPortal.ServiceImplementations.Log.Debug(bldr.Uri.ToString) + Dim httpclient As System.Net.HttpWebRequest = HttpWebRequest.Create(bldr.Uri) + + If myusenet.gotservercookie = True Then + httpclient.CookieContainer = New CookieContainer + httpclient.CookieContainer.Add(myusenet.servercookie) + End If + Dim httpresponse As System.Net.HttpWebResponse = httpclient.GetResponse + Dim sr As New System.IO.StreamReader(httpresponse.GetResponseStream) + Dim response As String + response = sr.ReadToEnd + httpresponse.Close() + + Return response + + End Function + + Public Function apiPauseResume(ByVal pause As Boolean, ByVal address As Uri) + + Dim bldr As New UriBuilder(address) + bldr.Path = "/sabnzbd/api" + + If pause = True Then + bldr.Query = "mode=pause" + Else + bldr.Query = "mode=resume" + End If + + MediaPortal.ServiceImplementations.Log.Debug(bldr.Uri.ToString) + Dim httpclient As System.Net.HttpWebRequest = HttpWebRequest.Create(bldr.Uri) + + If myusenet.gotservercookie = True Then + httpclient.CookieContainer = New CookieContainer + httpclient.CookieContainer.Add(myusenet.servercookie) + End If + + Dim httpresponse As System.Net.HttpWebResponse = httpclient.GetResponse + Dim sr As New System.IO.StreamReader(httpresponse.GetResponseStream) + Dim response As String + response = sr.ReadToEnd + httpresponse.Close() + + + Return response + + End Function + + Private Sub sabNotify() + myusenet.updatetimer.Stop() + Dim completenotify As GUIDialogNotify = GUIWindowManager.GetWindow(GUIWindow.Window.WINDOW_DIALOG_NOTIFY) + completenotify.Reset() + completenotify.SetHeading("My Usenet") + completenotify.TimeOut = 10 + completenotify.SetImage(GUIGraphicsContext.Skin + "\Media\hover_myusenet.png") + Log.Debug("Added image to notify " + GUIGraphicsContext.Skin + "\Media\hover_myusenet.png") + completenotify.SetText("Download: " + oldname + " completed.") + completenotify.DoModal(GUIWindowManager.ActiveWindow) + myusenet.updatetimer.Start() + End Sub +End Class Added: trunk/plugins/myusenet/testing/bin/Debug/AxInterop.WMPLib.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/myusenet/testing/bin/Debug/AxInterop.WMPLib.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/myusenet/testing/bin/Debug/Bass.Net.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/myusenet/testing/bin/Debug/Bass.Net.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/myusenet/testing/bin/Debug/BassRegistration.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/myusenet/testing/bin/Debug/BassRegistration.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/myusenet/testing/bin/Debug/CSScriptLibrary.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/myusenet/testing/bin/Debug/CSScriptLibrary.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/myusenet/testing/bin/Debug/Core.DLL =================================================================== (Binary files differ) Property changes on: trunk/plugins/myusenet/testing/bin/Debug/Core.DLL ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/myusenet/testing/bin/Debug/Databases.DLL =================================================================== (Binary files differ) Property changes on: trunk/plugins/myusenet/testing/bin/Debug/Databases.DLL ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/myusenet/testing/bin/Debug/Dialogs.DLL =================================================================== (Binary files differ) Property changes on: trunk/plugins/myusenet/testing/bin/Debug/Dialogs.DLL ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/myusenet/testing/bin/Debug/DirectShowLib.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/myusenet/testing/bin/Debug/DirectShowLib.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/myusenet/testing/bin/Debug/ICSharpCode.SharpZipLib.DLL =================================================================== (Binary files differ) Property changes on: trunk/plugins/myusenet/testing/bin/Debug/ICSharpCode.SharpZipLib.DLL ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/myusenet/testing/bin/Debug/Interop.WMPLib.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/myusenet/testing/bin/Debug/Interop.WMPLib.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/myusenet/testing/bin/Debug/MediaPortal.Support.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/myusenet/testing/bin/Debug/MediaPortal.Support.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/myusenet/testing/bin/Debug/Utils.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/myusenet/testing/bin/Debug/Utils.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/myusenet/testing/bin/Debug/edtftpnet-1.2.2.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/myusenet/testing/bin/Debug/edtftpnet-1.2.2.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/myusenet/testing/bin/Debug/myusenet.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/myusenet/testing/bin/Debug/myusenet.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/myusenet/testing/bin/Debug/myusenet.pdb =================================================================== (Binary files differ) Property changes on: trunk/plugins/myusenet/testing/bin/Debug/myusenet.pdb ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/myusenet/testing/bin/Debug/myusenet.xml =================================================================== --- trunk/plugins/myusenet/testing/bin/Debug/myusenet.xml (rev 0) +++ trunk/plugins/myusenet/testing/bin/Debug/myusenet.xml 2008-04-19 01:46:55 UTC (rev 1667) @@ -0,0 +1,24 @@ +<?xml version="1.0"?> +<doc> +<assembly> +<name> +myusenet +</name> +</assembly> +<members> +<member name="P:myusenet.My.Resources.Resources.ResourceManager"> + <summary> + Returns the cached ResourceManager instance used by this class. +</summary> +</member><member name="P:myusenet.My.Resources.Resources.Culture"> + <summary> + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. +</summary> +</member><member name="T:myusenet.My.Resources.Resources"> + <summary> + A strongly-typed resource class, for looking up localized strings, etc. +</summary> +</member> +</members> +</doc> \ No newline at end of file Added: trunk/plugins/myusenet/testing/bin/Debug/taglib-sharp.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/myusenet/testing/bin/Debug/taglib-sharp.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/myusenet/testing/bin/Debug/testing.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/myusenet/testing/bin/Debug/testing.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/myusenet/testing/bin/Debug/testing.pdb =================================================================== (Binary files differ) Property changes on: trunk/plugins/myusenet/testing/bin/Debug/testing.pdb ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/myusenet/testing/bin/Debug/testing.xml =================================================================== --- trunk/plugins/myusenet/testing/bin/Debug/testing.xml (rev 0) +++ trunk/plugins/myusenet/testing/bin/Debug/testing.xml 2008-04-19 01:46:55 UTC (rev 1667) @@ -0,0 +1,11 @@ +<?xml version="1.0"?> +<doc> +<assembly> +<name> +testing +</name> +</assembly> +<members> + +</members> +</doc> \ No newline at end of file Added: trunk/plugins/myusenet/testing/bin/Release/AxInterop.WMPLib.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/myusenet/testing/bin/Release/AxInterop.WMPLib.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/myusenet/testing/bin/Release/Bass.Net.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/myusenet/testing/bin/Release/Bass.Net.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/myusenet/testing/bin/Release/BassRegistration.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/myusenet/testing/bin/Release/BassRegistration.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/myusenet/testing/bin/Release/CSScriptLibrary.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/myusenet/testing/bin/Release/CSScriptLibrary.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/myusenet/testing/bin/Release/Core.DLL =================================================================== (Binary files differ) Property changes on: trunk/plugins/myusenet/testing/bin/Release/Core.DLL ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/myusenet/testing/bin/Release/Databases.DLL =================================================================== (Binary files differ) Property changes on: trunk/plugins/myusenet/testing/bin/Release/Databases.DLL ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/myusenet/testing/bin/Release/Dialogs.DLL =================================================================== (Binary files differ) Property changes on: trunk/plugins/myusenet/testing/bin/Release/Dialogs.DLL ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/myusenet/testing/bin/Release/DirectShowLib.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/myusenet/testing/bin/Release/DirectShowLib.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/myusenet/testing/bin/Release/ICSharpCode.SharpZipLib.DLL =================================================================== (Binary files differ) Property changes on: trunk/plugins/myusenet/testing/bin/Release/ICSharpCode.SharpZipLib.DLL ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/myusenet/testing/bin/Release/Interop.WMPLib.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/myusenet/testing/bin/Release/Interop.WMPLib.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/myusenet/testing/bin/Release/MediaPortal.Support.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/myusenet/testing/bin/Release/MediaPortal.Support.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/myusenet/testing/bin/Release/Utils.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/myusenet/testing/bin/Release/Utils.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/myusenet/testing/bin/Release/edtftpnet-1.2.2.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/myusenet/testing/bin/Release/edtftpnet-1.2.2.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/myusenet/testing/bin/Release/myusenet/release/Skin/BlueTwo/Media/usenet.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/myusenet/testing/bin/Release/myusenet/release/Skin/BlueTwo/Media/usenet.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/myusenet/testing/bin/Release/myusenet/release/Skin/BlueTwo wide/media/usenet.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/myusenet/testing/bin/Release/myusenet/release/Skin/BlueTwo wide/media/usenet.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/myusenet/testing/bin/Release/myusenet-beta.fixed.rar =================================================================== (Binary files differ) Property changes on: trunk/plugins/myusenet/testing/bin/Release/myusenet-beta.fixed.rar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/myusenet/testing/bin/Release/myusenet.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/myusenet/testing/bin/Release/myusenet.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/myusenet/testing/bin/Release/myusenet.otherfix.rar =================================================================== (Binary files differ) Property changes on: trunk/plugins/myusenet/testing/bin/Release/myusenet.otherfix.rar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/myusenet/testing/bin/Release/myusenet.pdb =================================================================== (Binary files differ) Property changes on: trunk/plugins/myusenet/testing/bin/Release/myusenet.pdb ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/myusenet/testing/bin/Release/myusenet.xml =================================================================== --- trunk/plugins/myusenet/testing/bin/Release/myusenet.xml (rev 0) +++ trunk/plugins/myusenet/testing/bin/Release/myusenet.xml 2008-04-19 01:46:55 UTC (rev 1667) @@ -0,0 +1,24 @@ +<?xml version="1.0"?> +<doc> +<assembly> +<name> +myusenet +</name> +</assembly> +<members> +<member name="P:myusenet.My.Resources.Resources.ResourceManager"> + <summary> + Returns the cached ResourceManager instance used by this class. +</summary> +</member><member name="P:myusenet.My.Resources.Resources.Culture"> + <summary> + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. +</summary> +</member><member name="T:myusenet.My.Resources.Resources"> + <summary> + A strongly-typed resource class, for looking up localized strings, etc. +</summary> +</member> +</members> +</doc> \ No newline at end of file Added: trunk/plugins/myusenet/testing/bin/Release/myusenet0.2.rar =================================================================== (Binary files differ) Property changes on: trunk/plugins/myusenet/testing/bin/Release/myusenet0.2.rar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/myusenet/testing/bin/Release/taglib-sharp.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/myusenet/testing/bin/Release/taglib-sharp.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/myusenet/testing/config/binsearchgroups.Designer.vb =================================================================== --- trunk/plugins/myusenet/testing/config/binsearchgroups.Designer.vb (rev 0) +++ trunk/plugins/myusenet/testing/config/binsearchgroups.Designer.vb 2008-04-19 01:46:55 UTC (rev 1667) @@ -0,0 +1,123 @@ +<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ +Partial Class binsearchgroups + Inherits System.Windows.Forms.Form + + 'Form overrides dispose to clean up the component list. + <System.Diagnostics.DebuggerNonUserCode()> _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + <System.Diagnostics.DebuggerStepThrough()> _ + Private Sub InitializeComponent() + Me.TableLayoutPanel1 = New System.Windows.Forms.TableLayoutPanel + Me.OK_Button = New System.Windows.Forms.Button + Me.Cancel_Button = New System.Windows.Forms.Button + Me.CheckedListBox1 = New System.Windows.Forms.CheckedListBox + Me.Button1 = New System.Windows.Forms.Button + Me.Button2 = New System.Windows.Forms.Button + Me.TableLayoutPanel1.SuspendLayout() + Me.SuspendLayout() + ' + 'TableLayoutPanel1 + ' + Me.TableLayoutPanel1.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.TableLayoutPanel1.ColumnCount = 2 + Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50.0!)) + Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50.0!)) + Me.TableLayoutPanel1.Controls.Add(Me.OK_Button, 0, 0) + Me.TableLayoutPanel1.Controls.Add(Me.Cancel_Button, 1, 0) + Me.TableLayoutPanel1.Location = New System.Drawing.Point(275, 274) + Me.TableLayoutPanel1.Name = "TableLayoutPanel1" + Me.TableLayoutPanel1.RowCount = 1 + Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50.0!)) + Me.TableLayoutPanel1.Size = New System.Drawing.Size(146, 29) + Me.TableLayoutPanel1.TabIndex = 0 + ' + 'OK_Button + ' + Me.OK_Button.Anchor = System.Windows.Forms.AnchorStyles.None + Me.OK_Button.Location = New System.Drawing.Point(3, 3) + Me.OK_Button.Name = "OK_Button" + Me.OK_Button.Size = New System.Drawing.Size(67, 23) + Me.OK_Button.TabIndex = 0 + Me.OK_Button.Text = "OK" + ' + 'Cancel_Button + ' + Me.Cancel_Button.Anchor = System.Windows.Forms.AnchorStyles.None + Me.Cancel_Button.DialogResult = System.Windows.Forms.DialogResult.Cancel + Me.Cancel_Button.Location = New System.Drawing.Point(76, 3) + Me.Cancel_Button.Name = "Cancel_Button" + Me.Cancel_Button.Size = New System.Drawing.Size(67, 23) + Me.Cancel_Button.TabIndex = 1 + Me.Cancel_Button.Text = "Cancel" + ' + 'CheckedListBox1 + ' + Me.CheckedListBox1.FormattingEnabled = True + Me.CheckedListBox1.Location = New System.Drawing.Point(12, 38) + Me.CheckedListBox1.Name = "CheckedListBox1" + Me.CheckedListBox1.Size = New System.Drawing.Size(407, 214) + Me.CheckedListBox1.TabIndex = 1 + ' + 'Button1 + ' + Me.Button1.Location = New System.Drawing.Point(337, 12) + Me.Button1.Name = "Button1" + Me.Button1.Size = New System.Drawing.Size(33, 20) + Me.Button1.TabIndex = 2 + Me.Button1.Text = "All" + Me.Button1.UseVisualStyleBackColor = True + ' + 'Button2 + ' + Me.Button2.Location = New System.Drawing.Point(376, 12) + Me.Button2.Name = "Button2" + Me.Button2.Size = New System.Drawing.Size(42, 20) + Me.Button2.TabIndex = 3 + Me.Button2.Text = "None" + Me.Button2.UseVisualStyleBackColor = True + ' + 'binsearchgroups + ' + Me.AcceptButton = Me.OK_Button + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.CancelButton = Me.Cancel_Button + Me.ClientSize = New System.Drawing.Size(433, 315) + Me.Controls.Add(Me.Button2) + Me.Controls.Add(Me.Button1) + Me.Controls.Add(Me.CheckedListBox1) + Me.Controls.Add(Me.TableLayoutPanel1) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "binsearchgroups" + Me.ShowInTaskbar = False + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent + Me.Text = "binsearchgroups" + Me.TableLayoutPanel1.ResumeLayout(False) + Me.ResumeLayout(False) + + End Sub + Friend WithEvents TableLayoutPanel1 As System.Windows.Forms.TableLayoutPanel + Friend WithEvents OK_Button As System.Windows.Forms.Button + Friend WithEvents Cancel_Button As System.Windows.Forms.Button + Friend WithEvents CheckedListBox1 As System.Windows.Forms.CheckedListBox + Friend WithEvents Button1 As System.Windows.Forms.Button + Friend WithEvents Button2 As System.Windows.Forms.Button + +End Class Added: trunk/plugins/myusenet/testing/config/binsearchgroups.resx =================================================================== --- trunk/plugins/myusenet/testing/config/binsearchgroups.resx (rev 0) +++ trunk/plugins/myusenet/testing/config/binsearchgroups.resx 2008-04-19 01:46:55 UTC (rev 1667) @@ -0,0 +1,120 @@ +<?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.Drawin... [truncated message content] |
From: <j_b...@us...> - 2008-04-19 01:54:00
|
Revision: 1668 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1668&view=rev Author: j_burnette Date: 2008-04-18 18:53:59 -0700 (Fri, 18 Apr 2008) Log Message: ----------- Added Paths: ----------- trunk/plugins/musictrivia/ trunk/plugins/musictrivia/MusicTrivia/ trunk/plugins/musictrivia/MusicTrivia/Class1.vb trunk/plugins/musictrivia/MusicTrivia/MusicTrivia.vbproj trunk/plugins/musictrivia/MusicTrivia/MusicTrivia.vbproj.user trunk/plugins/musictrivia/MusicTrivia/My Project/ trunk/plugins/musictrivia/MusicTrivia/My Project/Application.Designer.vb trunk/plugins/musictrivia/MusicTrivia/My Project/Application.myapp trunk/plugins/musictrivia/MusicTrivia/My Project/AssemblyInfo.vb trunk/plugins/musictrivia/MusicTrivia/My Project/Resources.Designer.vb trunk/plugins/musictrivia/MusicTrivia/My Project/Resources.resx trunk/plugins/musictrivia/MusicTrivia/My Project/Settings.Designer.vb trunk/plugins/musictrivia/MusicTrivia/My Project/Settings.settings trunk/plugins/musictrivia/MusicTrivia/bin/ trunk/plugins/musictrivia/MusicTrivia/bin/Debug/ trunk/plugins/musictrivia/MusicTrivia/bin/Release/ trunk/plugins/musictrivia/MusicTrivia/obj/ trunk/plugins/musictrivia/MusicTrivia/obj/Debug/ trunk/plugins/musictrivia/MusicTrivia/obj/Debug/TempPE/ trunk/plugins/musictrivia/MusicTrivia/obj/Debug/TempPE/My Project.Resources.Designer.vb.dll trunk/plugins/musictrivia/MusicTrivia/obj/MusicTrivia.vbproj.FileList.txt trunk/plugins/musictrivia/MusicTrivia/obj/Release/ trunk/plugins/musictrivia/MusicTrivia/obj/Release/MusicTrivia.Resources.resources trunk/plugins/musictrivia/MusicTrivia/obj/Release/MusicTrivia.dll trunk/plugins/musictrivia/MusicTrivia/obj/Release/MusicTrivia.pdb trunk/plugins/musictrivia/MusicTrivia/obj/Release/MusicTrivia.vbproj.GenerateResource.Cache trunk/plugins/musictrivia/MusicTrivia/obj/Release/MusicTrivia.xml trunk/plugins/musictrivia/MusicTrivia/obj/Release/ResolveAssemblyReference.cache trunk/plugins/musictrivia/MusicTrivia/obj/Release/TempPE/ trunk/plugins/musictrivia/MusicTrivia/obj/Release/TempPE/My Project.Resources.Designer.vb.dll trunk/plugins/musictrivia/MusicTrivia.sln trunk/plugins/musictrivia/MusicTrivia.suo trunk/plugins/musictrivia/musictrivia.xml Added: trunk/plugins/musictrivia/MusicTrivia/Class1.vb =================================================================== --- trunk/plugins/musictrivia/MusicTrivia/Class1.vb (rev 0) +++ trunk/plugins/musictrivia/MusicTrivia/Class1.vb 2008-04-19 01:53:59 UTC (rev 1668) @@ -0,0 +1,713 @@ +Imports MediaPortal.GUI.library +Imports System.Windows.Forms +Imports System.Xml +Imports System.IO +Imports System.Timers.Timer +Imports System.text +Imports System.Net +Imports System.Threading +Imports MediaPortal.Core +Imports System.Text.RegularExpressions +Imports MediaPortal.Dialogs +Imports MediaPortal.Player +Imports MediaPortal.Playlists +Imports System.math + + +Public Class Class1 + Inherits GUIWindow + + Implements ISetupForm + + <SkinControl(110)> Dim startbtn As GUIButtonControl + <SkinControl(2)> Dim stopbtn As GUIButtonControl + <SkinControl(3)> Dim timerbtn As GUIButtonControl + <SkinControl(4)> Dim triesbtn As GUIButtonControl + <SkinControl(10)> Dim timerlabel As GUILabelControl + <SkinControl(12)> Dim currpointlabel As GUILabelControl + 'the text labels are fixed text like correct: or wrong: + <SkinControl(13)> Dim correcttextlabel As GUILabelControl + <SkinControl(14)> Dim correctlabel As GUILabelControl + <SkinControl(15)> Dim wrongtextlabel As GUILabelControl + <SkinControl(16)> Dim wronglabel As GUILabelControl + <SkinControl(17)> Dim scoretextlabel As GUILabelControl + <SkinControl(18)> Dim scorelabel As GUILabelControl + <SkinControl(9)> Dim listbox As GUIListControl + + <SkinControl(100)> Dim player1label As GUILabelControl + <SkinControl(20)> Dim p2label As GUILabelControl + + <SkinControl(23)> Dim p2correcttextlabel As GUILabelControl + <SkinControl(24)> Dim p2correctlabel As GUILabelControl + <SkinControl(25)> Dim p2wrongtextlabel As GUILabelControl + <SkinControl(26)> Dim p2wronglabel As GUILabelControl + <SkinControl(27)> Dim p2scoretextlabel As GUILabelControl + <SkinControl(28)> Dim p2scorelabel As GUILabelControl + + Public randomplaying As MediaPortal.Music.Database.Song + Public score As Integer = 0 + Public p2score As Integer = 0 + Public countdowntimer As New System.Windows.Forms.Timer + Protected updatethread As System.Threading.Thread + Public timerdelay As Integer + Public tries As Integer + Public settingschanged As Boolean = False + Public actionselectitem As MediaPortal.GUI.Library.Action.ActionType = MediaPortal.GUI.Library.Action.ActionType.ACTION_SELECT_ITEM + Public gametype As String + 'gametypes: 1p (1 player), 2pa (alternating), 2ps (simultaneous) + Public currplayer As Integer = 1 + 'players are 1 and 2 + Public currgenre As String = "ALL" + Public genresongs As New List(Of MediaPortal.Music.Database.Song) + Public answers As Integer + + Public Sub New() + + + + GetID = 6622 + + End Sub + + Public Function Author1() As String Implements MediaPortal.GUI.Library.ISetupForm.Author + Author1 = "jburnette" + End Function + + Public Function CanEnable1() As Boolean Implements MediaPortal.GUI.Library.ISetupForm.CanEnable + CanEnable1 = True + End Function + + Public Function DefaultEnabled1() As Boolean Implements MediaPortal.GUI.Library.ISetupForm.DefaultEnabled + DefaultEnabled1 = True + End Function + + Public Function Description1() As String Implements MediaPortal.GUI.Library.ISetupForm.Description + Description1 = "Music Trivia" + End Function + + Public Function GetHome1(ByRef strButtonText As String, ByRef strButtonImage As String, ByRef strButtonImageFocus As String, ByRef strPictureImage As String) As Boolean Implements MediaPortal.GUI.Library.ISetupForm.GetHome + + strButtonText = "Music Trivia" + strButtonImage = "hover_musictrivia.png" + strButtonImageFocus = "hover_musictrivia.png" + strPictureImage = "hover_musictrivia.png" + GetHome1 = True + + End Function + + Public Function GetWindowId() As Integer Implements MediaPortal.GUI.Library.ISetupForm.GetWindowId + GetWindowId = 6622 + + End Function + + Public Function HasSetup1() As Boolean Implements MediaPortal.GUI.Library.ISetupForm.HasSetup + HasSetup1 = False + End Function + + Public Function PluginName1() As String Implements MediaPortal.GUI.Library.ISetupForm.PluginName + PluginName1 = "Music Trivia" + End Function + + Public Sub ShowPlugin1() Implements MediaPortal.GUI.Library.ISetupForm.ShowPlugin + + + + End Sub + + Public Overrides Function init() As Boolean + + Return Load(GUIGraphicsContext.Skin + "\musictrivia.xml") + + + End Function + + Protected Overrides Sub OnPageDestroy(ByVal new_windowId As Integer) + + MyBase.OnPageDestroy(new_windowId) + countdowntimer.Stop() + RemoveHandler countdowntimer.Tick, AddressOf docountdowntimer + g_Player.Stop() + startbtn.Disabled = False + stopbtn.Disabled = True + timerbtn.Disabled = False + updatethread.Abort() + + + End Sub + + Protected Overrides Sub OnPageLoad() + MyBase.OnPageLoad() + gametype = "1p" + listbox.Disabled = True + timerdelay = 15 + tries = 2 + stopbtn.Disabled = True + AddHandler countdowntimer.Tick, AddressOf docountdowntimer + scorelabel.Label = "0" + p2scorelabel.Label = "0" + timerlabel.Label = ":00" + currpointlabel.Label = "0" + timerbtn.Label = "Time: 15" + correctlabel.Label = "0" + wronglabel.Label = "0" + p2correctlabel.Label = "0" + p2wronglabel.Label = "0" + Try + Dim t As MediaPortal.Profile.Settings = New MediaPortal.Profile.Settings(MediaPortal.Configuration.Config.GetFile(MediaPortal.Configuration.Config.Dir.Config, "MediaPortal.xml")) + tries = t.GetValue("MusicTrivia", "tries") + timerdelay = t.GetValue("MusicTrivia", "timer") + timerbtn.Label = "Time: " + timerdelay.ToString + triesbtn.Label = "Tries: " + tries.ToString + gametype = t.GetValue("MusicTrivia", "gametype") + currgenre = t.GetValue("MusicTrivia", "genre") + If currgenre <> "ALL" Then + genresongs.Clear() + MediaPortal.Music.Database.MusicDatabase.Instance.GetSongsByGenre(currgenre, genresongs) + End If + t.Dispose() + MediaPortal.GUI.Library.Log.Info("MusicTrivia: Loaded values as gametype {0} / {1} tries / {2} seconds", gametype, tries, timerdelay) + Catch ex As Exception + MediaPortal.GUI.Library.Log.Error("MusicTrivia: Error loading values, defaulting to 1 Player/2 Tries/15 Seconds") + End Try + If currgenre = "" Then + currgenre = "ALL" + End If + setuptext() + + End Sub + + Public Overrides Sub OnAction(ByVal action As MediaPortal.GUI.Library.Action) + MyBase.OnAction(action) + + + If action.wID = MediaPortal.GUI.Library.Action.ActionType.REMOTE_1 And g_Player.Playing = True Then + If currplayer = 1 Or gametype = "2ps" Then + checkanswer(listbox.Item(0).Label, 0, 1) + End If + End If + + If action.wID = MediaPortal.GUI.Library.Action.ActionType.REMOTE_2 And g_Player.Playing = True Then + If currplayer = 1 Or gametype = "2ps" Then + checkanswer(listbox.Item(1).Label, 1, 1) + End If + End If + + If action.wID = MediaPortal.GUI.Library.Action.ActionType.REMOTE_3 And g_Player.Playing = True And listbox.Count >= 3 Then + If currplayer = 1 Or gametype = "2ps" Then + checkanswer(listbox.Item(2).Label, 2, 1) + End If + End If + + If action.wID = MediaPortal.GUI.Library.Action.ActionType.REMOTE_4 And g_Player.Playing = True And listbox.Count = 4 Then + If currplayer = 1 Or gametype = "2ps" Then + checkanswer(listbox.Item(3).Label, 3, 1) + End If + End If + + + + If action.wID = MediaPortal.GUI.Library.Action.ActionType.REMOTE_6 And g_Player.Playing = True Then + If currplayer = 2 Or gametype = "2ps" Then + checkanswer(listbox.Item(0).Label, 0, 2) + End If + End If + + If action.wID = MediaPortal.GUI.Library.Action.ActionType.REMOTE_7 And g_Player.Playing = True Then + If currplayer = 2 Or gametype = "2ps" Then + checkanswer(listbox.Item(1).Label, 1, 2) + End If + + End If + + If action.wID = MediaPortal.GUI.Library.Action.ActionType.REMOTE_8 And g_Player.Playing = True And listbox.Count >= 3 Then + If currplayer = 2 Or gametype = "2ps" Then + checkanswer(listbox.Item(2).Label, 2, 2) + End If + End If + + If action.wID = MediaPortal.GUI.Library.Action.ActionType.REMOTE_9 And g_Player.Playing = True And listbox.Count = 4 Then + If currplayer = 2 Or gametype = "2ps" Then + checkanswer(listbox.Item(3).Label, 3, 2) + End If + End If + + + If action.wID = MediaPortal.GUI.Library.Action.ActionType.ACTION_CONTEXT_MENU And countdowntimer.Enabled = False Then + Dim contextmenu As GUIDialogSelect2 = GUIWindowManager.GetWindow(GUIWindow.Window.WINDOW_DIALOG_SELECT2) + contextmenu.Reset() + settingschanged = True + contextmenu.SetHeading("Game Setup") + contextmenu.Add("Restrict Genre to: " + currgenre) + contextmenu.Add("Change Game Type") + contextmenu.DoModal(GUIWindowManager.ActiveWindow) + Select Case contextmenu.SelectedLabel + Case 0 + setupgenre() + Case 1 + playerchoice() + End Select + currplayer = 1 + setuptext() + End If + + + End Sub + + Private Sub setupgenre() + Dim genrechoice As GUIDialogMenu = GUIWindowManager.GetWindow(GUIWindow.Window.WINDOW_DIALOG_MENU) + genrechoice.Reset() + Dim genrelist As New ArrayList + MediaPortal.Music.Database.MusicDatabase.Instance.GetGenres(genrelist) + + Dim i As Integer + genrechoice.SetHeading("Choose Genre") + genrechoice.Add("ALL") + For i = 0 To genrelist.Count - 1 + genrechoice.Add(genrelist.Item(i).ToString) + Next + genrechoice.DoModal(GUIWindowManager.ActiveWindow) + currgenre = genrechoice.SelectedLabelText + + If currgenre <> "ALL" Then + genresongs.Clear() + MediaPortal.Music.Database.MusicDatabase.Instance.GetSongsByGenre(currgenre, genresongs) + End If + MediaPortal.GUI.Library.Log.Info("Found {0} for {1}", genresongs.Count, currgenre) + + + End Sub + + Private Sub playerchoice() + Dim playerchoice As GUIDialogSelect2 = GUIWindowManager.GetWindow(GUIWindow.Window.WINDOW_DIALOG_SELECT2) + playerchoice.Reset() + settingschanged = True + playerchoice.SetHeading("Choose Number of Players") + playerchoice.Add("1 Player") + playerchoice.Add("2 Player Simultaneous") + playerchoice.Add("2 Player Alternating") + playerchoice.DoModal(GUIWindowManager.ActiveWindow) + Select Case playerchoice.SelectedLabelText + Case "1 Player" + gametype = "1p" + Case "2 Player Simultaneous" + gametype = "2ps" + Case "2 Player Alternating" + gametype = "2pa" + End Select + currplayer = 1 + setuptext() + End Sub + + Protected Overrides Sub OnClicked(ByVal controlId As Integer, ByVal control As MediaPortal.GUI.Library.GUIControl, ByVal actionType As MediaPortal.GUI.Library.Action.ActionType) + MyBase.OnClicked(controlId, control, actionType) + + If control Is startbtn Then + + If g_Player.Playing = True Then + g_Player.Stop() + End If + If settingschanged = True Then + savesettings() + End If + listbox.Disabled = False + settingschanged = False + triesbtn.Disabled = True + timerbtn.Disabled = True + startbtn.Disabled = True + stopbtn.Disabled = False + listbox.Selected = True + dostart() + + End If + + If control Is listbox And actionType = Action.ActionType.ACTION_SELECT_ITEM Then + checkanswer(listbox.SelectedListItem.Label, listbox.SelectedListItemIndex, currplayer) + End If + + If control Is stopbtn Then + triesbtn.Disabled = False + startbtn.Disabled = False + stopbtn.Disabled = True + timerbtn.Disabled = False + dostop() + End If + + If control Is timerbtn Then + settingschanged = True + Select Case timerdelay + Case 60 + timerdelay = 10 + timerbtn.Label = "Time: 10" + Case 30 + timerdelay = 60 + timerbtn.Label = "Time: 60" + Case 15 + timerdelay = 30 + timerbtn.Label = "Time: 30" + Case 10 + timerdelay = 15 + timerbtn.Label = "Time: 15" + End Select + End If + + If control Is triesbtn Then + settingschanged = True + Select Case tries + Case 1 + tries = 2 + triesbtn.Label = "Tries: 2" + Case 2 + tries = 3 + triesbtn.Label = "Tries: 3" + Case 3 + tries = 1 + triesbtn.Label = "Tries: 1" + End Select + End If + End Sub + + Private Sub setuptext(Optional ByVal playing As Boolean = False) + If playing = True Then + Select Case currplayer + Case "1" + player1label.TextColor = System.Drawing.Color.White.ToArgb + correcttextlabel.TextColor = System.Drawing.Color.White.ToArgb + correctlabel.TextColor = System.Drawing.Color.White.ToArgb + wrongtextlabel.TextColor = System.Drawing.Color.White.ToArgb + wronglabel.TextColor = System.Drawing.Color.White.ToArgb + scorelabel.TextColor = System.Drawing.Color.White.ToArgb + scoretextlabel.TextColor = System.Drawing.Color.White.ToArgb + + p2label.TextColor = System.Drawing.Color.Gray.ToArgb + p2correcttextlabel.TextColor = System.Drawing.Color.Gray.ToArgb + p2correctlabel.TextColor = System.Drawing.Color.Gray.ToArgb + p2wrongtextlabel.TextColor = System.Drawing.Color.Gray.ToArgb + p2wronglabel.TextColor = System.Drawing.Color.Gray.ToArgb + p2scorelabel.TextColor = System.Drawing.Color.Gray.ToArgb + p2scoretextlabel.TextColor = System.Drawing.Color.Gray.ToArgb + + Case "2" + p2label.TextColor = System.Drawing.Color.White.ToArgb + p2correcttextlabel.TextColor = System.Drawing.Color.White.ToArgb + p2correctlabel.TextColor = System.Drawing.Color.White.ToArgb + p2wrongtextlabel.TextColor = System.Drawing.Color.White.ToArgb + p2wronglabel.TextColor = System.Drawing.Color.White.ToArgb + p2scorelabel.TextColor = System.Drawing.Color.White.ToArgb + p2scoretextlabel.TextColor = System.Drawing.Color.White.ToArgb + + + player1label.TextColor = System.Drawing.Color.Gray.ToArgb + correcttextlabel.TextColor = System.Drawing.Color.Gray.ToArgb + correctlabel.TextColor = System.Drawing.Color.Gray.ToArgb + wrongtextlabel.TextColor = System.Drawing.Color.Gray.ToArgb + wronglabel.TextColor = System.Drawing.Color.Gray.ToArgb + scorelabel.TextColor = System.Drawing.Color.Gray.ToArgb + scoretextlabel.TextColor = System.Drawing.Color.Gray.ToArgb + End Select + Else + + Select Case gametype + Case "1p" + player1label.Visible = False + p2label.Visible = False + p2correcttextlabel.Visible = False + p2correctlabel.Visible = False + p2wrongtextlabel.Visible = False + p2wronglabel.Visible = False + p2scoretextlabel.Visible = False + p2scorelabel.Visible = False + Case "2ps" + player1label.Visible = True + p2label.Visible = True + p2correcttextlabel.Visible = True + p2correctlabel.Visible = True + p2wrongtextlabel.Visible = True + p2wronglabel.Visible = True + p2scoretextlabel.Visible = True + p2scorelabel.Visible = True + Case "2pa" + player1label.Visible = True + p2label.Visible = True + p2correcttextlabel.Visible = True + p2correctlabel.Visible = True + p2wrongtextlabel.Visible = True + p2wronglabel.Visible = True + p2scoretextlabel.Visible = True + p2scorelabel.Visible = True + End Select + player1label.TextColor = System.Drawing.Color.White.ToArgb + correcttextlabel.TextColor = System.Drawing.Color.White.ToArgb + correctlabel.TextColor = System.Drawing.Color.White.ToArgb + wrongtextlabel.TextColor = System.Drawing.Color.White.ToArgb + wronglabel.TextColor = System.Drawing.Color.White.ToArgb + scorelabel.TextColor = System.Drawing.Color.White.ToArgb + scoretextlabel.TextColor = System.Drawing.Color.White.ToArgb + p2label.TextColor = System.Drawing.Color.White.ToArgb + p2correcttextlabel.TextColor = System.Drawing.Color.White.ToArgb + p2correctlabel.TextColor = System.Drawing.Color.White.ToArgb + p2wrongtextlabel.TextColor = System.Drawing.Color.White.ToArgb + p2wronglabel.TextColor = System.Drawing.Color.White.ToArgb + p2scorelabel.TextColor = System.Drawing.Color.White.ToArgb + p2scoretextlabel.TextColor = System.Drawing.Color.White.ToArgb + End If + + End Sub + + Private Sub savesettings() + Dim t As MediaPortal.Profile.Settings = New MediaPortal.Profile.Settings(MediaPortal.Configuration.Config.GetFile(MediaPortal.Configuration.Config.Dir.Config, "MediaPortal.xml")) + t.SetValue("MusicTrivia", "tries", tries) + t.SetValue("MusicTrivia", "timer", timerdelay) + t.SetValue("MusicTrivia", "gametype", gametype) + t.SetValue("MusicTrivia", "genre", currgenre) + t.Dispose() + End Sub + + Private Sub docountdowntimer(ByVal source As Object, ByVal e As EventArgs) + countdowntimer.Stop() + g_Player.Stop() + 'wronglabel.Label = (wronglabel.Label + 1).ToString + Dim incorrectbox As GUIDialogNotify = GUIWindowManager.GetWindow(GUIWindow.Window.WINDOW_DIALOG_NOTIFY) + incorrectbox.SetHeading("Time's Up!") + incorrectbox.TimeOut = 3.5 + incorrectbox.SetImage(MediaPortal.Util.Utils.GetFolderThumb(randomplaying.FileName)) + incorrectbox.SetText("The correct answer was " + randomplaying.Title + " by " + randomplaying.Artist) + incorrectbox.DoModal(GUIWindowManager.ActiveWindow) + If gametype = "2pa" Then + Select Case currplayer + Case 1 + wronglabel.Label = (wronglabel.Label + 1).ToString + currplayer = 2 + Case 2 + p2wronglabel.Label = (p2wronglabel.Label + 1).ToString + currplayer = 1 + End Select + End If + + If gametype = "2ps" Then + wronglabel.Label = (wronglabel.Label + 1).ToString + p2wronglabel.Label = (p2wronglabel.Label + 1).ToString + End If + If gametype = "1p" Then + wronglabel.Label = (wronglabel.Label + 1).ToString + End If + dostart() + + End Sub + + Private Sub checkanswer(ByVal itemlabel1 As String, ByVal itemnum As Integer, ByVal player As Integer) + 'listbox.SelectedListItem.Label + + If itemlabel1 = randomplaying.Title And countdowntimer.Enabled = True Then + countdowntimer.Stop() + g_Player.Stop() + Select Case player + Case 1 + score = score + currpointlabel.Label + scorelabel.Label = score.ToString + correctlabel.Label = (correctlabel.Label + 1).ToString + Case 2 + p2score = p2score + currpointlabel.Label + p2scorelabel.Label = p2score.ToString + p2correctlabel.Label = (p2correctlabel.Label + 1).ToString + End Select + + Dim correctbox As GUIDialogNotify = GUIWindowManager.GetWindow(GUIWindow.Window.WINDOW_DIALOG_NOTIFY) + correctbox.SetHeading("Correct!") + If gametype = "2pa" Then + correctbox.TimeOut = 3.5 + Else + correctbox.TimeOut = 1.5 + End If + + correctbox.SetImage(MediaPortal.Util.Utils.GetFolderThumb(randomplaying.FileName)) + If gametype <> "1p" Then + Select Case player + Case 1 + correctbox.SetText("Player 1 earned " + currpointlabel.Label + " points.") + Case 2 + correctbox.SetText("Player 2 earned " + currpointlabel.Label + " points.") + End Select + Else + correctbox.SetText("You've earned " + currpointlabel.Label + " points.") + End If + + correctbox.DoModal(GUIWindowManager.ActiveWindow) + If gametype = "2pa" Then + Select Case currplayer + Case 1 + currplayer = 2 + Case 2 + currplayer = 1 + End Select + End If + + dostart() + 'End If + ElseIf itemlabel1 <> "" Then + 'listbox.RemoveItem(itemnum) + listbox.Item(itemnum).Label = "" + listbox.Item(itemnum).Label2 = "" + listbox.Item(itemnum).Label3 = "" + listbox.Item(itemnum).IconImage = "" + answers = answers - 1 + + If answers = 4 - tries Then + countdowntimer.Stop() + g_Player.Stop() + Select Case player + Case 1 + wronglabel.Label = (wronglabel.Label + 1).ToString + Case 2 + p2wronglabel.Label = (p2wronglabel.Label + 1).ToString + End Select + + Dim incorrectbox As GUIDialogNotify = GUIWindowManager.GetWindow(GUIWindow.Window.WINDOW_DIALOG_NOTIFY) + incorrectbox.SetHeading("Incorrect!") + incorrectbox.TimeOut = 3.5 + incorrectbox.SetImage(MediaPortal.Util.Utils.GetFolderThumb(randomplaying.FileName)) + incorrectbox.SetText("The correct answer was " + randomplaying.Title + " by " + randomplaying.Artist) + incorrectbox.DoModal(GUIWindowManager.ActiveWindow) + listbox.Clear() + If gametype = "2pa" Then + Select Case currplayer + Case 1 + currplayer = 2 + Case 2 + currplayer = 1 + End Select + End If + + dostart() + End If + End If + + End Sub + + Private Sub dostop() + countdowntimer.Stop() + g_Player.Stop() + listbox.Disabled = True + End Sub + + + Private Sub dostart() + answers = 4 + If gametype = "2pa" Then + setuptext(True) + End If + + Dim randomnum As New Random + randomplaying = New MediaPortal.Music.Database.Song + + Dim randomwrong1 As New MediaPortal.Music.Database.Song + Dim randomwrong2 As New MediaPortal.Music.Database.Song + Dim randomwrong3 As New MediaPortal.Music.Database.Song + + If currgenre = "ALL" Then + MediaPortal.Music.Database.MusicDatabase.Instance.GetRandomSong(randomplaying) + While randomplaying.Duration < 120 + MediaPortal.Music.Database.MusicDatabase.Instance.GetRandomSong(randomplaying) + End While + + MediaPortal.Music.Database.MusicDatabase.Instance.GetRandomSong(randomwrong1) + MediaPortal.Music.Database.MusicDatabase.Instance.GetRandomSong(randomwrong2) + MediaPortal.Music.Database.MusicDatabase.Instance.GetRandomSong(randomwrong3) + Else + randomplaying = genresongs.Item(randomnum.Next(0, genresongs.Count - 1)) + While randomplaying.Duration < 120 + randomplaying = genresongs.Item(randomnum.Next(0, genresongs.Count - 1)) + End While + randomwrong1 = genresongs.Item(randomnum.Next(0, genresongs.Count - 1)) + randomwrong2 = genresongs.Item(randomnum.Next(0, genresongs.Count - 1)) + randomwrong3 = genresongs.Item(randomnum.Next(0, genresongs.Count - 1)) + End If + + Dim choices As New ArrayList + choices.Add(randomplaying) + choices.Add(randomwrong1) + choices.Add(randomwrong2) + choices.Add(randomwrong3) + Dim randomnumbers As New ArrayList + Dim i As Integer + While randomnumbers.Count < 4 + i = randomnum.Next(0, 4) + If randomnumbers.Contains(i) Then + Else + randomnumbers.Add(i) + End If + End While + listbox.Clear() + + Dim choice1 As New GUIListItem + choice1.Label = choices.Item(randomnumbers.Item(0)).title + choice1.Label3 = choices.Item(randomnumbers.Item(0)).artist + vbNewLine + choices.Item(randomnumbers.Item(0)).album + choice1.IconImage = MediaPortal.Util.Utils.GetFolderThumb(choices.Item(randomnumbers.Item(0)).filename) + ' choice1.ItemId = 0 + Dim choice2 As New GUIListItem + choice2.Label = choices.Item(randomnumbers.Item(1)).title + choice2.Label3 = choices.Item(randomnumbers.Item(1)).artist + vbNewLine + choices.Item(randomnumbers.Item(1)).album + choice2.IconImage = MediaPortal.Util.Utils.GetFolderThumb(choices.Item(randomnumbers.Item(1)).filename) + 'choice2.ItemId = 1 + Dim choice3 As New GUIListItem + choice3.Label = choices.Item(randomnumbers.Item(2)).title + choice3.Label3 = choices.Item(randomnumbers.Item(2)).artist + vbNewLine + choices.Item(randomnumbers.Item(2)).album + choice3.IconImage = MediaPortal.Util.Utils.GetFolderThumb(choices.Item(randomnumbers.Item(2)).filename) + ' choice3.ItemId = 2 + Dim choice4 As New GUIListItem + choice4.Label = choices.Item(randomnumbers.Item(3)).title + choice4.Label3 = choices.Item(randomnumbers.Item(3)).artist + vbNewLine + choices.Item(randomnumbers.Item(3)).album + choice4.IconImage = MediaPortal.Util.Utils.GetFolderThumb(choices.Item(randomnumbers.Item(3)).filename) + ' choice4.ItemId = 3 + listbox.Add(choice1) + listbox.Add(choice2) + listbox.Add(choice3) + listbox.Add(choice4) + + countdowntimer.Interval = timerdelay * 1000 + + Try + g_Player.Play(randomplaying.FileName) + Catch ex As Exception + dostart() + MediaPortal.GUI.Library.Log.Error(ex) + End Try + + g_Player.SeekAsolutePercentage(randomnum.Next(10, 49)) + countdowntimer.Start() + updatethread = New System.Threading.Thread(New System.Threading.ThreadStart(AddressOf updateclock)) + + updatethread.Start() + + + End Sub + + Private Sub updateclock() + Dim intpos As Integer = timerdelay + Dim formatted As String + currpointlabel.Label = "5" + + Dim fivepoints As Integer + fivepoints = (timerdelay * 1000) / 3 + While g_Player.Playing = True And intpos >= 0 + If intpos.ToString.Length = 1 Then + formatted = ":0" + intpos.ToString + Else + formatted = ":" + intpos.ToString + End If + If intpos = Round(((timerdelay / 3) * 2), 0) Then + currpointlabel.Label = "3" + End If + If intpos = Round(((timerdelay / 3) * 1), 0) Then + currpointlabel.Label = "1" + End If + timerlabel.Label = formatted + Threading.Thread.Sleep(1000) + intpos = intpos - 1 + End While + If timerlabel.Label = ":00" Then + currpointlabel.Label = "0" + + End If + End Sub + +End Class Added: trunk/plugins/musictrivia/MusicTrivia/MusicTrivia.vbproj =================================================================== --- trunk/plugins/musictrivia/MusicTrivia/MusicTrivia.vbproj (rev 0) +++ trunk/plugins/musictrivia/MusicTrivia/MusicTrivia.vbproj 2008-04-19 01:53:59 UTC (rev 1668) @@ -0,0 +1,108 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>8.0.50727</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{2E4BBB91-43F7-4DE7-9F04-0F2014F6A31D}</ProjectGuid> + <OutputType>Library</OutputType> + <RootNamespace>MusicTrivia</RootNamespace> + <AssemblyName>MusicTrivia</AssemblyName> + <MyType>Windows</MyType> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <DefineDebug>true</DefineDebug> + <DefineTrace>true</DefineTrace> + <OutputPath>bin\Debug\</OutputPath> + <DocumentationFile>MusicTrivia.xml</DocumentationFile> + <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <DefineDebug>false</DefineDebug> + <DefineTrace>true</DefineTrace> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DocumentationFile>MusicTrivia.xml</DocumentationFile> + <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn> + </PropertyGroup> + <ItemGroup> + <Reference Include="Core, Version=0.2.2.9991, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>C:\Program Files\Team MediaPortal\MediaPortal\Core.DLL</HintPath> + </Reference> + <Reference Include="Databases, Version=0.2.2.9991, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\..\Program Files\Team MediaPortal\MediaPortal\Databases.dll</HintPath> + </Reference> + <Reference Include="Dialogs, Version=0.2.2.9991, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>C:\Program Files\Team MediaPortal\MediaPortal\Plugins\Windows\Dialogs.DLL</HintPath> + </Reference> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml" /> + <Reference Include="Utils, Version=2.2.2.0, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>C:\Program Files\Team MediaPortal\MediaPortal\Utils.DLL</HintPath> + </Reference> + </ItemGroup> + <ItemGroup> + <Import Include="Microsoft.VisualBasic" /> + <Import Include="System" /> + <Import Include="System.Collections" /> + <Import Include="System.Collections.Generic" /> + <Import Include="System.Data" /> + <Import Include="System.Diagnostics" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Class1.vb" /> + <Compile Include="My Project\AssemblyInfo.vb" /> + <Compile Include="My Project\Application.Designer.vb"> + <AutoGen>True</AutoGen> + <DependentUpon>Application.myapp</DependentUpon> + </Compile> + <Compile Include="My Project\Resources.Designer.vb"> + <AutoGen>True</AutoGen> + <DesignTime>True</DesignTime> + <DependentUpon>Resources.resx</DependentUpon> + </Compile> + <Compile Include="My Project\Settings.Designer.vb"> + <AutoGen>True</AutoGen> + <DependentUpon>Settings.settings</DependentUpon> + <DesignTimeSharedInput>True</DesignTimeSharedInput> + </Compile> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="My Project\Resources.resx"> + <Generator>VbMyResourcesResXFileCodeGenerator</Generator> + <LastGenOutput>Resources.Designer.vb</LastGenOutput> + <CustomToolNamespace>My.Resources</CustomToolNamespace> + <SubType>Designer</SubType> + </EmbeddedResource> + </ItemGroup> + <ItemGroup> + <None Include="My Project\Application.myapp"> + <Generator>MyApplicationCodeGenerator</Generator> + <LastGenOutput>Application.Designer.vb</LastGenOutput> + </None> + <None Include="My Project\Settings.settings"> + <Generator>SettingsSingleFileGenerator</Generator> + <CustomToolNamespace>My</CustomToolNamespace> + <LastGenOutput>Settings.Designer.vb</LastGenOutput> + </None> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.VisualBasic.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> \ No newline at end of file Added: trunk/plugins/musictrivia/MusicTrivia/MusicTrivia.vbproj.user =================================================================== --- trunk/plugins/musictrivia/MusicTrivia/MusicTrivia.vbproj.user (rev 0) +++ trunk/plugins/musictrivia/MusicTrivia/MusicTrivia.vbproj.user 2008-04-19 01:53:59 UTC (rev 1668) @@ -0,0 +1,5 @@ +<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <ProjectView>ShowAllFiles</ProjectView> + </PropertyGroup> +</Project> \ No newline at end of file Added: trunk/plugins/musictrivia/MusicTrivia/My Project/Application.Designer.vb =================================================================== --- trunk/plugins/musictrivia/MusicTrivia/My Project/Application.Designer.vb (rev 0) +++ trunk/plugins/musictrivia/MusicTrivia/My Project/Application.Designer.vb 2008-04-19 01:53:59 UTC (rev 1668) @@ -0,0 +1,13 @@ +'------------------------------------------------------------------------------ +' <auto-generated> +' This code was generated by a tool. +' Runtime Version:2.0.50727.312 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' </auto-generated> +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + Added: trunk/plugins/musictrivia/MusicTrivia/My Project/Application.myapp =================================================================== --- trunk/plugins/musictrivia/MusicTrivia/My Project/Application.myapp (rev 0) +++ trunk/plugins/musictrivia/MusicTrivia/My Project/Application.myapp 2008-04-19 01:53:59 UTC (rev 1668) @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8"?> +<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <MySubMain>false</MySubMain> + <SingleInstance>false</SingleInstance> + <ShutdownMode>0</ShutdownMode> + <EnableVisualStyles>true</EnableVisualStyles> + <AuthenticationMode>0</AuthenticationMode> + <ApplicationType>1</ApplicationType> + <SaveMySettingsOnExit>true</SaveMySettingsOnExit> +</MyApplicationData> Added: trunk/plugins/musictrivia/MusicTrivia/My Project/AssemblyInfo.vb =================================================================== --- trunk/plugins/musictrivia/MusicTrivia/My Project/AssemblyInfo.vb (rev 0) +++ trunk/plugins/musictrivia/MusicTrivia/My Project/AssemblyInfo.vb 2008-04-19 01:53:59 UTC (rev 1668) @@ -0,0 +1,35 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' 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. + +' Review the values of the assembly attributes + +<Assembly: AssemblyTitle("ClassLibrary1")> +<Assembly: AssemblyDescription("")> +<Assembly: AssemblyCompany("")> +<Assembly: AssemblyProduct("ClassLibrary1")> +<Assembly: AssemblyCopyright("Copyright © 2007")> +<Assembly: AssemblyTrademark("")> + +<Assembly: ComVisible(False)> + +'The following GUID is for the ID of the typelib if this project is exposed to COM +<Assembly: Guid("af914cb2-bf3c-4269-aace-368593ade0df")> + +' 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 Build and Revision Numbers +' by using the '*' as shown below: +' <Assembly: AssemblyVersion("1.0.*")> + +<Assembly: AssemblyVersion("1.0.0.0")> +<Assembly: AssemblyFileVersion("1.0.0.0")> Added: trunk/plugins/musictrivia/MusicTrivia/My Project/Resources.Designer.vb =================================================================== --- trunk/plugins/musictrivia/MusicTrivia/My Project/Resources.Designer.vb (rev 0) +++ trunk/plugins/musictrivia/MusicTrivia/My Project/Resources.Designer.vb 2008-04-19 01:53:59 UTC (rev 1668) @@ -0,0 +1,63 @@ +'------------------------------------------------------------------------------ +' <auto-generated> +' This code was generated by a tool. +' Runtime Version:2.0.50727.312 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' </auto-generated> +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + +Imports System + +Namespace My.Resources + + 'This class was auto-generated by the StronglyTypedResourceBuilder + 'class via a tool like ResGen or Visual Studio. + 'To add or remove a member, edit your .ResX file then rerun ResGen + 'with the /str option, or rebuild your VS project. + '''<summary> + ''' A strongly-typed resource class, for looking up localized strings, etc. + '''</summary> + <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0"), _ + Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ + Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ + Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + '''<summary> + ''' Returns the cached ResourceManager instance used by this class. + '''</summary> + <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("MusicTrivia.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + '''<summary> + ''' Overrides the current thread's CurrentUICulture property for all + ''' resource lookups using this strongly typed resource class. + '''</summary> + <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set + resourceCulture = value + End Set + End Property + End Module +End Namespace Added: trunk/plugins/musictrivia/MusicTrivia/My Project/Resources.resx =================================================================== --- trunk/plugins/musictrivia/MusicTrivia/My Project/Resources.resx (rev 0) +++ trunk/plugins/musictrivia/MusicTrivia/My Project/Resources.resx 2008-04-19 01:53:59 UTC (rev 1668) @@ -0,0 +1,117 @@ +<?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.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="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + </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" 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>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> \ No newline at end of file Added: trunk/plugins/musictrivia/MusicTrivia/My Project/Settings.Designer.vb =================================================================== --- trunk/plugins/musictrivia/MusicTrivia/My Project/Settings.Designer.vb (rev 0) +++ trunk/plugins/musictrivia/MusicTrivia/My Project/Settings.Designer.vb 2008-04-19 01:53:59 UTC (rev 1668) @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' <auto-generated> +' This code was generated by a tool. +' Runtime Version:2.0.50727.312 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' </auto-generated> +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ + Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0"), _ + Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings),MySettings) + +#Region "My.Settings Auto-Save Functionality" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _ + Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ + Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _ + Friend Module MySettingsProperty + + <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _ + Friend ReadOnly Property Settings() As Global.MusicTrivia.My.MySettings + Get + Return Global.MusicTrivia.My.MySettings.Default + End Get + End Property + End Module +End Namespace Added: trunk/plugins/musictrivia/MusicTrivia/My Project/Settings.settings =================================================================== --- trunk/plugins/musictrivia/MusicTrivia/My Project/Settings.settings (rev 0) +++ trunk/plugins/musictrivia/MusicTrivia/My Project/Settings.settings 2008-04-19 01:53:59 UTC (rev 1668) @@ -0,0 +1,7 @@ +<?xml version='1.0' encoding='utf-8'?> +<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true"> + <Profiles> + <Profile Name="(Default)" /> + </Profiles> + <Settings /> +</SettingsFile> Added: trunk/plugins/musictrivia/MusicTrivia/obj/Debug/TempPE/My Project.Resources.Designer.vb.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/musictrivia/MusicTrivia/obj/Debug/TempPE/My Project.Resources.Designer.vb.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/musictrivia/MusicTrivia/obj/MusicTrivia.vbproj.FileList.txt =================================================================== --- trunk/plugins/musictrivia/MusicTrivia/obj/MusicTrivia.vbproj.FileList.txt (rev 0) +++ trunk/plugins/musictrivia/MusicTrivia/obj/MusicTrivia.vbproj.FileList.txt 2008-04-19 01:53:59 UTC (rev 1668) @@ -0,0 +1,23 @@ +bin\Release\MusicTrivia.dll +bin\Release\MusicTrivia.pdb +bin\Release\MusicTrivia.xml +bin\Release\Core.DLL +bin\Release\Databases.DLL +bin\Release\DirectShowLib.dll +bin\Release\Utils.dll +bin\Release\edtftpnet-1.2.2.dll +bin\Release\Interop.WMPLib.dll +bin\Release\MediaPortal.Support.dll +bin\Release\BassRegistration.dll +bin\Release\Bass.Net.dll +bin\Release\CSScriptLibrary.dll +bin\Release\AxInterop.WMPLib.dll +obj\Release\ResolveAssemblyReference.cache +obj\Release\MusicTrivia.vbproj.GenerateResource.Cache +obj\Release\MusicTrivia.dll +obj\Release\MusicTrivia.xml +obj\Release\MusicTrivia.pdb +bin\Release\Dialogs.DLL +obj\Release\MusicTrivia.Resources.resources +bin\Release\taglib-sharp.dll +bin\Release\ICSharpCode.SharpZipLib.dll Added: trunk/plugins/musictrivia/MusicTrivia/obj/Release/MusicTrivia.Resources.resources =================================================================== (Binary files differ) Property changes on: trunk/plugins/musictrivia/MusicTrivia/obj/Release/MusicTrivia.Resources.resources ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/musictrivia/MusicTrivia/obj/Release/MusicTrivia.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/musictrivia/MusicTrivia/obj/Release/MusicTrivia.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/musictrivia/MusicTrivia/obj/Release/MusicTrivia.pdb =================================================================== (Binary files differ) Property changes on: trunk/plugins/musictrivia/MusicTrivia/obj/Release/MusicTrivia.pdb ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/musictrivia/MusicTrivia/obj/Release/MusicTrivia.vbproj.GenerateResource.Cache =================================================================== (Binary files differ) Property changes on: trunk/plugins/musictrivia/MusicTrivia/obj/Release/MusicTrivia.vbproj.GenerateResource.Cache ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/musictrivia/MusicTrivia/obj/Release/MusicTrivia.xml =================================================================== --- trunk/plugins/musictrivia/MusicTrivia/obj/Release/MusicTrivia.xml (rev 0) +++ trunk/plugins/musictrivia/MusicTrivia/obj/Release/MusicTrivia.xml 2008-04-19 01:53:59 UTC (rev 1668) @@ -0,0 +1,24 @@ +<?xml version="1.0"?> +<doc> +<assembly> +<name> +MusicTrivia +</name> +</assembly> +<members> +<member name="P:MusicTrivia.My.Resources.Resources.ResourceManager"> + <summary> + Returns the cached ResourceManager instance used by this class. +</summary> +</member><member name="P:MusicTrivia.My.Resources.Resources.Culture"> + <summary> + Overrides the current thread's CurrentUICulture property for all + resource lookups using this strongly typed resource class. +</summary> +</member><member name="T:MusicTrivia.My.Resources.Resources"> + <summary> + A strongly-typed resource class, for looking up localized strings, etc. +</summary> +</member> +</members> +</doc> \ No newline at end of file Added: trunk/plugins/musictrivia/MusicTrivia/obj/Release/ResolveAssemblyReference.cache =================================================================== (Binary files differ) Property changes on: trunk/plugins/musictrivia/MusicTrivia/obj/Release/ResolveAssemblyReference.cache ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/musictrivia/MusicTrivia/obj/Release/TempPE/My Project.Resources.Designer.vb.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/musictrivia/MusicTrivia/obj/Release/TempPE/My Project.Resources.Designer.vb.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/musictrivia/MusicTrivia.sln =================================================================== --- trunk/plugins/musictrivia/MusicTrivia.sln (rev 0) +++ trunk/plugins/musictrivia/MusicTrivia.sln 2008-04-19 01:53:59 UTC (rev 1668) @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Basic Express 2005 +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "MusicTrivia", "MusicTrivia\MusicTrivia.vbproj", "{2E4BBB91-43F7-4DE7-9F04-0F2014F6A31D}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {2E4BBB91-43F7-4DE7-9F04-0F2014F6A31D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2E4BBB91-43F7-4DE7-9F04-0F2014F6A31D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2E4BBB91-43F7-4DE7-9F04-0F2014F6A31D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2E4BBB91-43F7-4DE7-9F04-0F2014F6A31D}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal Added: trunk/plugins/musictrivia/MusicTrivia.suo =================================================================== (Binary files differ) Property changes on: trunk/plugins/musictrivia/MusicTrivia.suo ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/musictrivia/musictrivia.xml ==... [truncated message content] |
From: <che...@us...> - 2008-04-21 23:01:35
|
Revision: 1690 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1690&view=rev Author: chef_koch Date: 2008-04-21 16:01:33 -0700 (Mon, 21 Apr 2008) Log Message: ----------- added GUIScript from mp svn Added Paths: ----------- trunk/plugins/GUIScript/ trunk/plugins/GUIScript/!!! DO NOT CHANGE ANY FILES HERE - PLEASE UPDATE THE FILES IN MP-PLUGINS SVN !!! trunk/plugins/GUIScript/ExpressionEval.cs trunk/plugins/GUIScript/FunctionEval.cs trunk/plugins/GUIScript/GUIScript.cs trunk/plugins/GUIScript/MPScript.cs trunk/plugins/GUIScript/RegexObjects.cs trunk/plugins/GUIScript/ScriptHandler.cs trunk/plugins/GUIScript/SetupForm.cs trunk/plugins/GUIScript/SetupForm.resx trunk/plugins/GUIScript/script plugin.txt Added: trunk/plugins/GUIScript/!!! DO NOT CHANGE ANY FILES HERE - PLEASE UPDATE THE FILES IN MP-PLUGINS SVN !!! =================================================================== Added: trunk/plugins/GUIScript/ExpressionEval.cs =================================================================== --- trunk/plugins/GUIScript/ExpressionEval.cs (rev 0) +++ trunk/plugins/GUIScript/ExpressionEval.cs 2008-04-21 23:01:33 UTC (rev 1690) @@ -0,0 +1,439 @@ +#region Copyright (C) 2005-2008 Team MediaPortal + +/* + * Copyright (C) 2005-2008 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program 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, or (at your option) + * any later version. + * + * This Program 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 GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +// Code based on source from "The Code Project" +// by railerb + +using System; +using System.Collections; +using System.Text; +using System.Text.RegularExpressions; + +namespace MediaPortal.GUI.GUIScript +{ + public class ExpressionEval + { + + internal class BinaryOp + { + private string _strOp; + private int _nPrecedence; + + public string Op { get { return _strOp; } } + public int Precedence { get { return _nPrecedence; } } + + public BinaryOp(string strOp) + { _strOp = strOp; _nPrecedence = ExpressionEval.OperatorPrecedence(strOp); } + + public override string ToString() + { return Op; } + } + + internal class BinaryOpQueue + { + private ArrayList _oplist = new ArrayList(); + + public BinaryOpQueue(ArrayList expressionlist) + { + foreach (object item in expressionlist) + if (item is BinaryOp) + Enqueue((BinaryOp)item); + } + + public void Enqueue(BinaryOp op) + { + bool bQueued = false; + for (int x = 0; x < _oplist.Count && !bQueued; x++) + { + if (((BinaryOp)_oplist[x]).Precedence > op.Precedence) + { + _oplist.Insert(x, op); + bQueued = true; + } + } + if (!bQueued) + _oplist.Add(op); + } + + public BinaryOp Dequeue() + { + if (_oplist.Count == 0) + return null; + BinaryOp ret = (BinaryOp)_oplist[0]; + _oplist.RemoveAt(0); + return ret; + } + } + + internal class UnaryOp + { + private string _strOp; + + public string Op { get { return _strOp; } } + + public UnaryOp(string strOp) + { _strOp = strOp; } + + public override string ToString() + { return Op; } + + } + + ArrayList _expressionlist = new ArrayList(); + string _strExpression = ""; + bool _bParsed = false; + + public ExpressionEval() {} + + /// <summary> + /// Constructor with string + /// </summary> + public ExpressionEval(string strExpression) + { Expression = strExpression; } + + /// <summary> + /// Gets or sets the expression to be evaluated. + /// </summary> + public string Expression + { + get { return _strExpression; } + set + { + _strExpression = value.Trim(); + _bParsed = false; + _expressionlist.Clear(); + } + } + + /// <summary> + /// Evaluates the expression + /// </summary> + public object Evaluate() + { + if (Expression == null || Expression == "") + return 0; + + return ExecuteEvaluation(); + } + + public bool EvaluateBool() + { return Convert.ToBoolean(Evaluate()); } + + public int EvaluateInt() + { return Convert.ToInt32(Evaluate()); } + + public double EvaluateDouble() + { return Convert.ToDouble(Evaluate()); } + + public long EvaluateLong() + { return Convert.ToInt64(Evaluate()); } + + public static object Evaluate(string strExpression) + { + ExpressionEval expr = new ExpressionEval(strExpression); + return expr.Evaluate(); + } + + public static object Evaluate(string strExpression, FunctionHandler handler) + { + ExpressionEval expr = new ExpressionEval(strExpression); + expr.FunctionHandler += handler; + return expr.Evaluate(); + } + + private object ExecuteEvaluation() + { + //Break Expression Apart into List + if (!_bParsed) + for (int x = 0; x < Expression.Length; x = NextToken(x)); + _bParsed = true; + + //Perform Operations + return EvaluateList(); + } + + private int NextToken(int nIdx) + { + Match mRet = null; + int nRet = nIdx + 1; + object val = null; + Match m = DefinedRegex.Parenthesis.Match(Expression, nIdx); + if (m.Success) + { mRet = m; } + + m = DefinedRegex.Function.Match(Expression, nIdx); + if (m.Success && (mRet == null || m.Index < mRet.Index)) + { mRet = m; } + + m = DefinedRegex.UnaryOp.Match(Expression, nIdx); + if (m.Success && (mRet == null || m.Index < mRet.Index)) + { mRet = m; val = new UnaryOp(m.Value); } + + m = DefinedRegex.Hexadecimal.Match(Expression, nIdx); + if (m.Success && (mRet == null || m.Index < mRet.Index)) + { mRet = m; val = Convert.ToInt32(m.Value, 16); } + + m = DefinedRegex.Boolean.Match(Expression, nIdx); + if (m.Success && (mRet == null || m.Index < mRet.Index)) + { mRet = m; val = bool.Parse(m.Value); } + + m = DefinedRegex.Numeric.Match(Expression, nIdx); + if (m.Success && (mRet == null || m.Index < mRet.Index)) + { + while (m.Success && m.Value == "") + m = m.NextMatch(); + if (m.Success) + { + mRet = m; + val = double.Parse(m.Value); + } + } + + m = DefinedRegex.String.Match(Expression, nIdx); + if (m.Success && (mRet == null || m.Index < mRet.Index)) + { mRet = m; val = m.Groups["String"].Value.Replace("\\\"", "\""); } + + m = DefinedRegex.BinaryOp.Match(Expression, nIdx); + if (m.Success && (mRet == null || m.Index < mRet.Index)) + { mRet = m; val = new BinaryOp(m.Value); } + + if (mRet.Value == "(" || mRet.Value.StartsWith("$")) + { + nRet = (mRet.Value == "(") ? nRet+1 : mRet.Index + mRet.Length; + int nDepth = 1; + bool bInQuotes = false; + while (nDepth > 0) + { + if (nRet >= Expression.Length) + throw new Exception("Missing " + (bInQuotes ? "\"" : ")") + " in Expression"); + if (!bInQuotes && Expression[nRet] == ')') + nDepth--; + if (!bInQuotes && Expression[nRet] == '(') + nDepth++; + + if (Expression[nRet] == '"' && (nRet == 0 || Expression[nRet - 1] != '\\')) + bInQuotes = !bInQuotes; + + nRet++; + } + if (mRet.Value == "(") + { + ExpressionEval expr = new ExpressionEval( + Expression.Substring(mRet.Index + 1, nRet - mRet.Index - 2) + ); + if (this.FunctionHandler != null) + expr.FunctionHandler += this.FunctionHandler; + _expressionlist.Add(expr); + } + else + { + FunctionEval func = new FunctionEval( + Expression.Substring(mRet.Index, (nRet) - mRet.Index) + ); + if (this.FunctionHandler != null) + func.FunctionHandler += this.FunctionHandler; + _expressionlist.Add(func); + } + } + else + { + nRet = mRet.Index + mRet.Length; + _expressionlist.Add(val); + } + + return nRet; + } + + private object EvaluateList() + { + ArrayList list = (ArrayList)_expressionlist.Clone(); + + //Do the unary operators first + for (int x = 0; x < list.Count; x++) + { + if (list[x] is UnaryOp) + { + list[x] = PerformUnaryOp( + (UnaryOp)list[x], + list[x + 1] + ); + list.RemoveAt(x + 1); + } + } + + //Do the queued binary operations + BinaryOpQueue opqueue = new BinaryOpQueue(list); + BinaryOp op = opqueue.Dequeue(); + while (op != null) + { + int nIdx = list.IndexOf(op); + list[nIdx - 1] = PerformBinaryOp( + (BinaryOp)list[nIdx], + list[nIdx - 1], + list[nIdx + 1] + ); + list.RemoveAt(nIdx); + list.RemoveAt(nIdx); + op = opqueue.Dequeue(); + } + + object ret = null; + if (list[0] is ExpressionEval) + ret = ((ExpressionEval)list[0]).Evaluate(); + else if (list[0] is FunctionEval) + ret = ((FunctionEval)list[0]).Evaluate(); + else + ret = list[0]; + + return ret; + } + + private static int OperatorPrecedence(string strOp) + { + switch (strOp) + { + case "*": + case "/": + case "%": return 0; + case "+": + case "-": return 1; + case "<": + case "<=": + case ">": + case ">=": return 2; + case "==": + case "!=": return 3; + case "&": return 4; + case "^": return 5; + case "|": return 6; + case "&&": return 7; + case "||": return 8; + } + throw new Exception("Operator " + strOp + "not defined."); + } + + private static object PerformBinaryOp(BinaryOp op, object v1, object v2) + { + if (v1 is ExpressionEval) + v1 = ((ExpressionEval)v1).Evaluate(); + else if (v1 is FunctionEval) + v1 = ((FunctionEval)v1).Evaluate(); + if (v2 is ExpressionEval) + v2 = ((ExpressionEval)v2).Evaluate(); + else if (v2 is FunctionEval) + v2 = ((FunctionEval)v2).Evaluate(); + + switch (op.Op) + { + case "*": return (Convert.ToDouble(v1) * Convert.ToDouble(v2)); + case "/": return (Convert.ToDouble(v1) / Convert.ToDouble(v2)); + case "%": return (Convert.ToInt64(v1) % Convert.ToInt64(v2)); + case "+": + case "-": + case "<": + case "<=": + case ">": + case ">=": + case "==": + case "!=": return DoSpecialOperator(op, v1, v2); + case "&": return (Convert.ToUInt64(v1) & Convert.ToUInt64(v2)); + case "^": return (Convert.ToUInt64(v1) ^ Convert.ToUInt64(v2)); + case "|": return (Convert.ToUInt64(v1) | Convert.ToUInt64(v2)); + case "&&": return (Convert.ToBoolean(v1) && Convert.ToBoolean(v2)); + case "||": return (Convert.ToBoolean(v1) || Convert.ToBoolean(v2)); + } + throw new Exception("Binary Operator " + op.Op + "not defined."); + } + + private static object DoSpecialOperator(BinaryOp op, object v1, object v2) + { + if (v1 is string || v2 is string) + { + string str1 = "" + v1, + str2 = "" + v2; + + switch (op.Op) + { + case "+": return str1 + str2; + case "-": throw new Exception("operator '-' invalid for strings"); + case "<": return str1.CompareTo(str2) < 0; + case "<=": return str1.CompareTo(str2) < 0 || str1 == str2; + case ">": return str1.CompareTo(str2) > 0; + case ">=": return str1.CompareTo(str2) > 0 || str1 == str2;; + case "==": return str1 == str2; + case "!=": return str1 != str2; + } + } + if (v1 is DateTime || v2 is DateTime) + { + DateTime d1 = (DateTime)v1, d2 = Convert.ToDateTime(v2); + switch (op.Op) + { + case "+": throw new Exception("operator '+' invalid for dates"); + case "-": return d1 - d2; + case "<": return d1 < d2; + case "<=": return d1 <= d2; + case ">": return d1 > d2; + case ">=": return d1 >= d2; + case "==": return d1 == d2; + case "!=": return d1 != d2; + } + } + + double f1 = Convert.ToDouble(v1), f2 = Convert.ToDouble(v2); + switch (op.Op) + { + case "+": return f1 + f2; + case "-": return f1 - f2; + case "<": return f1 < f2; + case "<=": return f1 <= f2; + case ">": return f1 > f2; + case ">=": return f1 >= f2; + case "==": return f1 == f2; + case "!=": return f1 != f2; + } + + throw new Exception("operator '" + op.Op + "' not specified"); + } + + private static object PerformUnaryOp(UnaryOp op, object v) + { + if (v is ExpressionEval) + v = ((ExpressionEval)v).Evaluate(); + else if (v is FunctionEval) + v = ((FunctionEval)v).Evaluate(); + + switch (op.Op) + { + case "+": return (Convert.ToDouble(v)); + case "-": return (-Convert.ToDouble(v)); + } + throw new Exception("Unary Operator " + op.Op + "not defined."); + } + + public event FunctionHandler FunctionHandler; + + } +} Added: trunk/plugins/GUIScript/FunctionEval.cs =================================================================== --- trunk/plugins/GUIScript/FunctionEval.cs (rev 0) +++ trunk/plugins/GUIScript/FunctionEval.cs 2008-04-21 23:01:33 UTC (rev 1690) @@ -0,0 +1,261 @@ +#region Copyright (C) 2005-2008 Team MediaPortal + +/* + * Copyright (C) 2005-2008 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program 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, or (at your option) + * any later version. + * + * This Program 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 GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +// Code based on source from "The Code Project" +// by railerb + +using System; +using System.Collections; +using System.Text; +using System.Text.RegularExpressions; + +namespace MediaPortal.GUI.GUIScript +{ + + public delegate object FunctionHandler(string strName, object[] a_params); + public class FunctionEval + { + private string _strExpression = ""; + private string _strFunc = ""; + private bool _bParsed = false; + private object [] _params = null; + + public string Expression + { + get { return _strExpression; } + set + { + _strExpression = value.Trim(); + _strFunc = ""; + _bParsed = false; + _params = null; + } + } + + public FunctionEval() {} + + public FunctionEval(string strExpression) + { Expression = strExpression; } + + public object Evaluate() + { + object ret = null; + if (!_bParsed) + { + StringBuilder strbRet = new StringBuilder(Expression); + string strNext = strbRet.ToString(); + Match m = DefinedRegex.Function.Match(strNext); + + if (m.Success) + { + _params = GetParameters(m); + _strFunc = m.Groups["Function"].Value; + } + _bParsed = true; + } + ret = ExecuteFunction(_strFunc, _params); + return ret; + } + + /// <summary> + /// Evaluates a string expression of a function + /// </summary> + public static object Evaluate(string strExpression) + { + FunctionEval expr = new FunctionEval(strExpression); + return expr.Evaluate(); + } + + + public static string Replace(string strInput, FunctionHandler handler) + { + FunctionEval expr = new FunctionEval(strInput); + if (handler != null) + expr.FunctionHandler += handler; + return expr.Replace(); + } + + public static object Evaluate(string strExpression, FunctionHandler handler) + { + FunctionEval expr = new FunctionEval(strExpression); + if (handler != null) + expr.FunctionHandler += handler; + return expr.Evaluate(); + } + + public static string Replace(string strInput) + { + FunctionEval expr = new FunctionEval(strInput); + return expr.Replace(); + } + + public string Replace() + { + StringBuilder strbRet = new StringBuilder(Expression); + Match m = DefinedRegex.Function.Match(Expression); + + while (m.Success) + { + int nDepth = 1; + int nIdx = m.Index + m.Length; + //Get the parameter string + while (nDepth > 0) + { + if (nIdx >= strbRet.Length) + throw new Exception("Missing ')' in Expression"); + if (strbRet[nIdx] == ')') + nDepth--; + if (strbRet[nIdx] == '(') + nDepth++; + nIdx++; + } + string strExpression = strbRet.ToString(m.Index, nIdx - m.Index); + strbRet.Replace(strExpression, "" + Evaluate(strExpression, FunctionHandler)); + m = DefinedRegex.Function.Match(strbRet.ToString()); + } + return strbRet.ToString(); + } + + private object [] GetParameters(Match m) + { + string strParams = ""; + int nIdx = m.Index + m.Length; + int nDepth = 1; + int nLast = 0; + bool bInQuotes = false; + ArrayList ret = new ArrayList(); + + //Get the parameter string + while (nDepth > 0) + { + if (nIdx >= Expression.Length) + throw new Exception("Missing ')' in Expression"); + + if (!bInQuotes && Expression[nIdx] == ')') + nDepth--; + if (!bInQuotes && Expression[nIdx] == '(') + nDepth++; + + if (Expression[nIdx] == '"' && (nIdx == 0 || Expression[nIdx-1] != '\\')) + bInQuotes = !bInQuotes; + + if (nDepth > 0) + nIdx++; + } + strParams = Expression.Substring(m.Index + m.Length, nIdx - (m.Index + m.Length)); + + if (strParams == "") + return null; + + bInQuotes = false; + for (nIdx = 0; nIdx < strParams.Length; nIdx++) + { + if (!bInQuotes && strParams[nIdx] == ')') + nDepth--; + if (!bInQuotes && strParams[nIdx] == '(') + nDepth++; + + if (strParams[nIdx] == '"' && (nIdx == 0 || strParams[nIdx - 1] != '\\')) + bInQuotes = !bInQuotes; + + if (!bInQuotes && nDepth == 0 && strParams[nIdx] == ',') + { + ret.Add(strParams.Substring(nLast, nIdx - nLast)); + nIdx++; + nLast = nIdx; + } + } + ret.Add(strParams.Substring(nLast, nIdx - nLast)); + + for (nIdx = 0; nIdx < ret.Count; nIdx++) + try { ret[nIdx] = new ExpressionEval(ret[nIdx].ToString()); } + catch { ret[nIdx] = ((string)ret[nIdx]).Trim(); } + + return ret.ToArray(); + } + + /// <summary> + /// executes functions + /// </summary> + private object ExecuteFunction(string strName, object[] p) + { + object[] a_params = null; + if (p != null) + { + a_params = (object[])p.Clone(); + for (int x = 0; x < a_params.Length; x++) + if (a_params[x] is ExpressionEval) + a_params[x] = ((ExpressionEval)a_params[x]).Evaluate(); + } + switch (strName.ToLower()) + { + // Math functions + case "sin": return Math.Sin(Convert.ToDouble(a_params[0])); + case "cos": return Math.Cos(Convert.ToDouble(a_params[0])); + case "tan": return Math.Tan(Convert.ToDouble(a_params[0])); + case "asin": return Math.Asin(Convert.ToDouble(a_params[0])); + case "acos": return Math.Acos(Convert.ToDouble(a_params[0])); + case "atan": return Math.Atan(Convert.ToDouble(a_params[0])); + case "sinh": return Math.Sinh(Convert.ToDouble(a_params[0])); + case "cosh": return Math.Cosh(Convert.ToDouble(a_params[0])); + case "tanh": return Math.Tanh(Convert.ToDouble(a_params[0])); + case "abs": return Math.Abs(Convert.ToDouble(a_params[0])); + case "sqrt": return Math.Sqrt(Convert.ToDouble(a_params[0])); + case "log": return (a_params.Length > 1) ? + Math.Log(Convert.ToDouble(a_params[0]), Convert.ToDouble(a_params[1])) : + Math.Log(Convert.ToDouble(a_params[0])); + case "log10": return Math.Log10(Convert.ToDouble(a_params[0])); + case "ciel": return Math.Ceiling(Convert.ToDouble(a_params[0])); + case "floor": return Math.Floor(Convert.ToDouble(a_params[0])); + case "exp": return Math.Exp(Convert.ToDouble(a_params[0])); + case "max": return Math.Max(Convert.ToDouble(a_params[0]), Convert.ToDouble(a_params[1])); + case "min": return Math.Min(Convert.ToDouble(a_params[0]), Convert.ToDouble(a_params[1])); + case "pow": return Math.Pow(Convert.ToDouble(a_params[0]), Convert.ToDouble(a_params[1])); + case "round": return (a_params.Length > 1) ? + Math.Round(Convert.ToDouble(a_params[0]), Convert.ToInt32(a_params[1])) : + Math.Round(Convert.ToDouble(a_params[0])); + case "rnd": Random r = new Random(); + return r.Next(); + case "random": r = new Random(); + return r.Next(Convert.ToInt32(a_params[0]), Convert.ToInt32(a_params[1])); + case "now": return DateTime.Now; + case "today": return DateTime.Today; + case "e": return Math.E; + case "pi": return Math.PI; + case "calc": return ExpressionEval.Evaluate("" + a_params[0]); + default: return FunctionHelper(strName, a_params); + } + } + + protected object FunctionHelper(string strName, object[] a_params) + { + if (FunctionHandler != null) + return FunctionHandler(strName, a_params); + return null; + } + + public event FunctionHandler FunctionHandler; + } +} Added: trunk/plugins/GUIScript/GUIScript.cs =================================================================== --- trunk/plugins/GUIScript/GUIScript.cs (rev 0) +++ trunk/plugins/GUIScript/GUIScript.cs 2008-04-21 23:01:33 UTC (rev 1690) @@ -0,0 +1,103 @@ +#region Copyright (C) 2005-2008 Team MediaPortal + +/* + * Copyright (C) 2005-2008 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program 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, or (at your option) + * any later version. + * + * This Program 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 GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +#region usings +using System; +using System.IO; +using System.Collections; +using System.Management; +using MediaPortal.Util; +using MediaPortal.GUI.Library; +using MediaPortal.Dialogs; +#endregion + +namespace MediaPortal.GUI.GUIScript +{ + /// <summary> + /// Summary description for GUIExplorer + /// </summary> + public class GUIScript : GUIWindow + { + public static int WINDOW_STATUS = 740; + + #region Constructor + public GUIScript() + { + // + // TODO: Add constructor logic here + // + } + #endregion + + #region Overrides + public override int GetID + { + get { return WINDOW_STATUS; } + set { base.GetID = value; } + } + + public override bool Init() + { + //return Load (GUIGraphicsContext.Skin+@"\myexplorer.xml"); + return true; + } + + public override void OnAction(Action action) + { + if (action.wID == Action.ActionType.ACTION_PREVIOUS_MENU) + { + GUIWindowManager.ShowPreviousWindow(); + return; + } + base.OnAction(action); + } + + public override bool OnMessage(GUIMessage message) + { + switch ( message.Message ) + { + case GUIMessage.MessageType.GUI_MSG_WINDOW_INIT: // MyScript starts + base.OnMessage(message); + LoadSettings(); // loads all settings from XML + return true; + } + return base.OnMessage (message); + } + + #endregion + + #region Private Methods + + /// <summary> + /// Loads all Settings from MediaPortal.xml + /// </summary> + private void LoadSettings() + { + + } + + #endregion + } +} Added: trunk/plugins/GUIScript/MPScript.cs =================================================================== --- trunk/plugins/GUIScript/MPScript.cs (rev 0) +++ trunk/plugins/GUIScript/MPScript.cs 2008-04-21 23:01:33 UTC (rev 1690) @@ -0,0 +1,1004 @@ +#region Copyright (C) 2005-2008 Team MediaPortal + +/* + * Copyright (C) 2005-2008 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program 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, or (at your option) + * any later version. + * + * This Program 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 GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +#region Usings +using System; +using System.IO; +using System.Collections; +using System.Management; +using MediaPortal.GUI.Library; +using MediaPortal.Util; +using MediaPortal.Dialogs; +using System.Text.RegularExpressions; +#endregion + +namespace MediaPortal.GUI.GUIScript +{ + /// <summary> + /// Summary description for MPScript. + /// </summary> + public class MPScript + { + #region Private Variables + // funktions token + private const char tDebugOn='0'; + private const char tDebugOff='1'; + private const char tStatic='@'; + private const char tGlobal='\xB0'; + private const char tVar='@'; + private const char tIf='a'; + private const char tEndIf='b'; + private const char tElse='c'; + private const char tWhile='d'; + private const char tSwitch='e'; + private const char tFor='f'; + private const char tMp_action='g'; + private const char tEnd='h'; + private const char tEndWhile='i'; + private const char tEndSwitch='j'; + private const char tCase='k'; + private const char tMessageBox='l'; + private const char tEndFor='m'; + private const char tCall='n'; + private const char tDefault='o'; + private const char tContinue='p'; + private const char tBreak='q'; + + // regular expression + Regex rexStripOp = new Regex(@"\+|-|\*|/|%|&&|\|\||&|\||\^|==|!=|>=|<=|=|<|>|!|\(|\)|\:|true|false|,", RegexOptions.IgnoreCase); + Regex rexStripQuote = new Regex("\"", RegexOptions.IgnoreCase); + Regex rexStripString = new Regex( "\\\"(?<String>.*?[^\\\\])\\\"", RegexOptions.IgnoreCase); + + // static vars + private static string strTokenbuffer; + private static char[] DELIMITER = {' ','(','=','\"',')' }; + private static char[] BYPASSCODE = {'\t',' ','(','\"',')','=','%','\xA7','@','$','\xB0' }; + private static Hashtable global_variable = new Hashtable(); + private static int numScripts=0; + private static bool m_bForceShutdown = false; // Force shutdown + + private char oper=' '; + private String[] scriptArray; + private String[] debugArray; + private int progPointer=0; + private int ScriptEnd=0; + private long BreakTime=5000; + private string ScriptName=""; + private bool debuging=false; + private string debugName=""; + + // hashtables for vars and functions + private Hashtable tokens = new Hashtable(); + private Hashtable variable = new Hashtable(); + private Hashtable functions = new Hashtable(); + + // stack + private Stack stack = new Stack(); + + ExpressionEval eval = new ExpressionEval(); + + #endregion + + #region Constructor + public MPScript() + { + + eval.FunctionHandler += new FunctionHandler(MPFunctions); + + // save Tokens in hashtable + tokens.Add("static",tStatic); + tokens.Add("var",tVar); + tokens.Add("global",tGlobal); + tokens.Add("end",tEnd); + tokens.Add("if",tIf); + tokens.Add("endif",tEndIf); + tokens.Add("else",tElse); + tokens.Add("while",tWhile); + tokens.Add("endwhile",tEndWhile); + tokens.Add("switch",tSwitch); + tokens.Add("case",tCase); + tokens.Add("default",tCase); + tokens.Add("endswitch",tEndSwitch); + tokens.Add("for",tFor); + tokens.Add("continue",tContinue); + tokens.Add("break",tBreak); + tokens.Add("call",tCall); + tokens.Add("mp_action",tMp_action); + tokens.Add("messagebox",tMessageBox); + + // save functions in hashtable + functions.Add("yesnobox",'a'); + functions.Add("mp_var",'b'); + functions.Add("sin",'B'); + functions.Add("cos",'C'); + functions.Add("tan",'D'); + functions.Add("asin",'E'); + functions.Add("acos",'F'); + functions.Add("atan",'G'); + functions.Add("sinh",'H'); + functions.Add("cosh",'I'); + functions.Add("tanh",'J'); + functions.Add("abs",'K'); + functions.Add("sqrt",'L'); + functions.Add("ciel",'M'); + functions.Add("floor",'N'); + functions.Add("exp",'O'); + functions.Add("log10",'P'); + functions.Add("log",'Q'); + functions.Add("max",'R'); + functions.Add("min",'S'); + functions.Add("pow",'T'); + functions.Add("round",'U'); + functions.Add("e",'V'); + functions.Add("pi",'W'); + functions.Add("now",'X'); + functions.Add("today",'Y'); + functions.Add("calc",'2'); + functions.Add("rnd",'3'); + functions.Add("random",'4'); + } + #endregion + + #region Public helpers + /// <summary> + /// sets a global var + /// </summary> + public void setGlobalVar(string key,object val) + { + if (global_variable.ContainsKey(key)) + { + global_variable[key]=val; + } + else + { + global_variable.Add(key,val); + } + } + #endregion + + #region Load Script in Memory + /// <summary> + /// Reads the script into Memory and make preprocessing + /// </summary> + /// <returns>A string containing the button text.</returns> + // TODO: Add more commands and funktions + public string GetScript(string name) // Read the MPScript + { + numScripts++; + bool debugInit=false; + string work=""; + string scratch=""; + string buttonText=""; + string scriptdir=System.IO.Directory.GetCurrentDirectory()+"\\"+"scripts"; + try + { + StreamReader sr = new StreamReader(scriptdir+"\\"+name+".mps"); + String fileContent = sr.ReadToEnd(); + char[] separator = {'\n'}; + scriptArray = fileContent.Split(separator); + debugArray = fileContent.Split(separator); + ScriptName=name; + global_variable.Add(ScriptName,"Load"); + + //-------------------------------------------------------------------------- + for (int i=0;i<scriptArray.Length;i++) // little preprocessor + { + scriptArray[i]=scriptArray[i].Trim(); + work=scriptArray[i]; + if (work.Length<2) + { + scriptArray[i]="#"; + continue; + } + work=work.Trim().ToLower(); + if (work.StartsWith("#description:") ==true) + { + scriptArray[i]="#"; + continue; + } + if (work.StartsWith("#button:") ==true) + { + buttonText=checkText(scriptArray[i].Trim().Substring(8)); + scriptArray[i]="#"; + continue; + } + if (work.StartsWith("#debugon") ==true) + { + scriptArray[i]="\xA7"+tDebugOn; + if(debugInit==false) + { + InitDebugLog(); + debugInit=true; + } + continue; + } + if (work.StartsWith("#debugoff") ==true) + { + scriptArray[i]="\xA7"+tDebugOff; + continue; + } + if (work.StartsWith("#breaktime:") ==true) + { + string tx=work.Substring(11); + try + { + int bx=Convert.ToInt32(tx); + BreakTime=bx*1000; + } + catch(Exception) + { + BreakTime=5000; + } + scriptArray[i]="#"; + continue; + } + int indx=work.IndexOf("\"",0); + if (indx>0) + { + string w=work.Substring(0,indx); + w=w+scriptArray[i].Substring(indx); + scriptArray[i]=w; + } + else + { + scriptArray[i]=work; + } + indx=work.IndexOf("//"); // any remarks? + if (indx!=-1) + { + if (indx==0) + { + scriptArray[i]="#"; + continue; + } + else + { + scriptArray[i]=work.Substring(0,indx); + } + } + //------------------------------------------------------------ + // Replace any command with tokens + string tok=ParseToken(scriptArray[i]); + if (variable.ContainsKey(tok)) // is token a variable? + { + scriptArray[i]=tVar+tok+" "+changeFunc(strTokenbuffer); + } + if (global_variable.ContainsKey(tok)) + { + scriptArray[i]=tGlobal+tok+" "+changeFunc(strTokenbuffer); + } + if (tokens.ContainsKey(tok)) // is token a command + { + switch (tok) + { + case "static" : + scriptArray[i]="#"; + string k=ParseToken(strTokenbuffer); + if (strTokenbuffer.IndexOf("*",0)!=-1 || strTokenbuffer.IndexOf("/",0)!=-1 || strTokenbuffer.IndexOf("+",0)!=-1 || strTokenbuffer.IndexOf("-",0)!=-1) + { + eval.Expression = strTokenbuffer; + strTokenbuffer=eval.Evaluate().ToString(); + } + string b=ParseToken(strTokenbuffer); + variable.Add(k,b); + break; + case "global" : + k=ParseToken(strTokenbuffer); + if (strTokenbuffer.IndexOf("*",0)!=-1 || strTokenbuffer.IndexOf("/",0)!=-1 || strTokenbuffer.IndexOf("+",0)!=-1 || strTokenbuffer.IndexOf("-",0)!=-1) + { + eval.Expression = strTokenbuffer; + strTokenbuffer=eval.Evaluate().ToString(); + } + b=ParseToken(strTokenbuffer); + scriptArray[i]=tGlobal+k+"="+b; + global_variable.Add(k,b); + break; + case "var" : + k=ParseToken(strTokenbuffer); + if (strTokenbuffer.IndexOf("*",0)!=-1 || strTokenbuffer.IndexOf("/",0)!=-1 || strTokenbuffer.IndexOf("+",0)!=-1 || strTokenbuffer.IndexOf("-",0)!=-1) + { + eval.Expression = strTokenbuffer; + strTokenbuffer=eval.Evaluate().ToString(); + } + b=ParseToken(strTokenbuffer); + scriptArray[i]=tVar+k+"="+b; + variable.Add(k,b); + break; + case "if" : + scriptArray[i]="\xA7"+tokens[tok]+changeFunc(strTokenbuffer); + break; + case "endif" : + scriptArray[i]="\xA7"+tokens[tok]; + break; + case "else" : + scriptArray[i]="\xA7"+tokens[tok]; + break; + case "while" : + scriptArray[i]="\xA7"+tokens[tok]+changeFunc(strTokenbuffer); + break; + case "endwhile" : + scriptArray[i]="\xA7"+tokens[tok]; + break; + case "continue" : + scriptArray[i]="\xA7"+tokens[tok]; + break; + case "break" : + scriptArray[i]="\xA7"+tokens[tok]; + break; + case "switch" : + scriptArray[i]="\xA7"+tokens[tok]+changeFunc(strTokenbuffer); + break; + case "case" : + scriptArray[i]="\xA7"+tokens[tok]+changeFunc(strTokenbuffer); + break; + case "default" : + scriptArray[i]="\xA7"+tokens[tok]; + break; + case "endswitch" : + scriptArray[i]="\xA7"+tokens[tok]; + break; + case "for" : + scriptArray[i]="\xA7"+tokens[tok]+changeFunc(strTokenbuffer); + break; + case "messagebox" : + scriptArray[i]="\xA7"+tokens[tok]+changeFunc(strTokenbuffer); + break; + case "call" : + scratch=changeFunc(strTokenbuffer); + scratch = rexStripOp.Replace(scratch,""); + scratch = rexStripQuote.Replace(scratch,""); + scriptArray[i]="\xA7"+tokens[tok]+scratch.Trim(); + ScriptHandler gScript=new ScriptHandler(); + scratch=gScript.LoadScript(scratch.Trim()); + break; + case "mp_action" : + scriptArray[i]="\xA7"+tokens[tok]+ParseToken(strTokenbuffer); + break; + case "end" : + scriptArray[i]="\xA7"+tokens[tok]; + break; + } + } + } + } + catch(Exception ex) + { + Log.Info("Syntax Error!", ex.Message); + buttonText="SCRIPT ERROR!!"; + global_variable[ScriptName]="ERROR"; + } + global_variable[ScriptName]="Loaded"; + return buttonText; + } + #endregion + + #region Run MPScript + /// <summary> + /// Starts the Script + /// </summary> + // TODO: Add more commands and funktions + public bool RunScript() + { + bool debugHeader=false; + string progLine=""; + string leftvar=""; + long lStartTime = DateTime.Now.Ticks; + long lDiff = 0; + + ScriptEnd=scriptArray.Length; + try + { + global_variable[ScriptName]="Run"; + while (progPointer<ScriptEnd) + { + if (debuging==true) + { + if(debugHeader==false) + { + WriteDebugHeader(); + debugHeader=true; + } + WriteDebug("S:{0:000} L:{1:000}: {2}",stack.Count,progPointer,debugArray[progPointer]); + WriteLnDebug(" "); + WriteDebug(" > "); + } + if (BreakTime>0) + { + lDiff = (DateTime.Now.Ticks - lStartTime)/10000; + if(lDiff>BreakTime) + { + global_variable[ScriptName]="Time Break"; + if (debuging==true) WriteLnDebug(" Time Break! {0} ms",lDiff); + return false; + } + } + progLine=scriptArray[progPointer]; + if (progLine.Substring(0,1)=="#") // Nothing to do + { + if (debuging==true) WriteLnDebug(" NOP"); + progPointer++; + continue; + } + if (progLine.Substring(0,1)==tVar.ToString()) // var first + { + leftvar=ParseToken(progLine); + if (variable.ContainsKey(leftvar)) + { + if (oper=='=') // assignment + { + progLine=ChangeVar(strTokenbuffer); + { + if (progLine=="=") + { + variable[leftvar]=""; + } + else + { + eval.Expression = progLine; + progLine=eval.Evaluate().ToString(); + variable[leftvar]=progLine; + } + if (debuging==true) WriteLnDebug("Var {0} = {1}",leftvar,progLine); + progPointer++; + continue; + } + } + } + } + if (progLine.Substring(0,1)==tGlobal.ToString()) // global var first + { + leftvar=ParseToken(progLine); + if (global_variable.ContainsKey(leftvar)) + { + if (oper=='=') // assignment + { + progLine=ChangeVar(strTokenbuffer); + { + if (progLine=="=") + { + variable[leftvar]=""; + } + else + { + eval.Expression = progLine; + progLine=eval.Evaluate().ToString(); + global_variable[leftvar]=progLine; + } + if (debuging==true) WriteLnDebug("Global {0} = {1}",leftvar,progLine); + progPointer++; + continue; + } + } + } + } + if (progLine.Substring(0,1)=="\xA7") // command processing + { + char ch = Convert.ToChar(progLine.Substring(1,1)); + if (progLine.Length>2) + { + progLine=progLine.Substring(2); + progLine=ChangeVar(progLine); + } + switch (ch) + { + // If statement ------------------------------------------------ + case tIf: + eval.Expression = progLine; + progLine=eval.Evaluate().ToString(); + if (debuging==true) WriteLnDebug("IF = {0}",progLine); + if(progLine=="True") + { + progPointer++; + } + else + { + progPointer++; + jump(tElse,tIf,tEndIf); + } + break; + // While statement ----------------------------------------------- + case tWhile: + eval.Expression = progLine; + progLine=eval.Evaluate().ToString(); + if (debuging==true) WriteLnDebug("WHILE = {0}",progLine); + if(progLine=="True") + { + stack.Push(progPointer++); + } + else + { + progPointer++; + jump(tWhile,tWhile,tEndWhile); + } + break; + // Switch statement ---------------------------------------------- + case tSwitch: + eval.Expression = progLine; + progLine=eval.Evaluate().ToString(); + if (debuging==true) WriteLnDebug("SWITCH = {0}",progLine); + searchCase(progLine); + break; + // Case statement ------------------------------------------------ + case tCase: + progPointer++; + jump(tSwitch,tSwitch,tEndSwitch); + break; + // EndSwitch statement ------------------------------------------- + case tEndSwitch: + progPointer++; + break; + // Continue statement ------------------------------------------- + case tContinue: + if(stack.Count>0) + { + progPointer=Convert.ToInt32(stack.Pop()); + if (debuging==true) WriteLnDebug("JUMPTO {0:000}",progPointer); + } + else + { + if (debuging==true) WriteLnDebug("ERROR Continue!"); + } + break; + // Break statement ------------------------------------------- + case tBreak: + progPointer++; + jump(tWhile,tWhile,tEndWhile); + break; + // EndWhile statement -------------------------------------------- + case tEndWhile: + progPointer=Convert.ToInt32(stack.Pop()); + if (debuging==true) WriteLnDebug("JUMPTO {0:000}",progPointer); + break; + // End statement ------------------------------------------------- + case tEnd: + global_variable[ScriptName]="End"; + if (debuging==true) WriteLnDebug("Program End!"); + return true; + // Call statement ------------------------------------------------- + case tCall: + ScriptHandler gScript=new ScriptHandler(); + global_variable[ScriptName]="Call"; + if (debuging==true) WriteLnDebug("CALL {0}",progLine); + gScript.StartScriptName(progLine); + if (debuging==true) WriteLnDebug("RET {0}",progLine); + progPointer++; + break; + // MP_Action statement -------------------------------------------- + case tMp_action: + callAction(progLine); + progPointer++; + break; + // MessageBox statement ------------------------------------------- + case tMessageBox: + DialogBox(checkText(progLine.Substring(2))); + progPointer++; + break; + case tDebugOn: + debuging=true; + if (debuging==true) WriteLnDebug("DEBUG On"); + progPointer++; + break; + case tDebugOff: + debuging=false; + if (debuging==true) WriteLnDebug("DEBUG Off"); + progPointer++; + break; + default: + progPointer++; + break; + } + } + else + { + if (debuging==true) WriteLnDebug("ERROR in Line {0:000}",progPointer); + Log.Info("MPScript: Syntax error in Line {0}",progPointer); + progPointer++; + } + } + } + catch(Exception ex) + { + global_variable[ScriptName]="ERROR"; + Log.Info("Syntax Error!", ex.Message); + if (debuging==true) WriteLnDebug("ERROR in Line {0:000}",progPointer); + } + return true; + } + #endregion + + #region MPScript helpers + + private string changeFunc(string buffer) + { + string buf=""; + string tok=""; + int i=0; + + buf = rexStripString.Replace(buffer,""); + buf = rexStripOp.Replace(buf," "); + + strTokenbuffer=buf.Trim(); + while (strTokenbuffer.Length>=1) + { + tok=ParseToken(strTokenbuffer); + if(functions.ContainsKey(tok)) + { + i=buffer.IndexOf(tok,0); + buffer=buffer.Substring(0,i)+"$"+buffer.Substring(i); + continue; + } + if(variable.ContainsKey(tok)) + { + i=buffer.IndexOf(tok,0); + buffer=buffer.Substring(0,i)+tVar+buffer.Substring(i); + continue; + } + if(global_variable.ContainsKey(tok)) + { + i=buffer.IndexOf(tok,0); + buffer=buffer.Substring(0,i)+tGlobal+buffer.Substring(i); + continue; + } + } + return buffer; + } + + private string ChangeVar(string buffer) + { + string buf=buffer; + string buf2=""; + string tok; + + int i=buffer.IndexOf(tGlobal.ToString()); + while(i>-1) + { + buf = buffer; + buf = rexStripOp.Replace(buf," "); + buf2=buffer.Substring(0,i); + tok=ParseToken(buf.Substring(i)); + buffer=buf2+" "+global_variable[tok]+buffer.Substring(i+tok.Length+1); + i=buffer.IndexOf(tGlobal.ToString()); + } + i=buffer.IndexOf(tVar.ToString()); + while(i>-1) + { + buf = buffer; + buf = rexStripOp.Replace(buf," "); + buf2=buffer.Substring(0,i); + tok=ParseToken(buf.Substring(i)); + buffer=buf2+" "+variable[tok]+buffer.Substring(i+tok.Length+1); + i=buffer.IndexOf(tVar.ToString()); + } + return buffer; + } + + private void searchCase(string cond) + { + string scratch; + string buffer; + while (progPointer<ScriptEnd) + { + if (scriptArray[progPointer].Substring(0,1)=="\xA7") + { + if (Convert.ToChar(scriptArray[progPointer].Substring(1,1))==tCase) + { + buffer=scriptArray[progPointer].Substring(1); + scratch=ParseToken(buffer); + buffer=ParseToken(strTokenbuffer); + buffer=rexStripOp.Replace(buffer," "); + buffer=buffer.Trim(); + if (buffer==cond) + { + progPointer++; + break; + } + } + } + progPointer++; + } + } + + private void jump(char tst,char skip,char end) + { + int skipCnt=0; + while (progPointer<ScriptEnd) + { + if (scriptArray[progPointer].Substring(0,1)=="\xA7") + { + if (Convert.ToChar(scriptArray[progPointer].Substring(1,1))==skip) + { + skipCnt++; + progPointer++; + continue; + } + if (Convert.ToChar(scriptArray[progPointer].Substring(1,1))==end) + { + if (skipCnt==0) + { + progPointer++; + break; + } + else + { + skipCnt--; + progPointer++; + continue; + } + } + if (Convert.ToChar(scriptArray[progPointer].Substring(1,1))==tst) + { + if(skipCnt==0) + { + progPointer++; + break; + } + } + } + progPointer++; + } + } + + /// <summary> + /// Reads the next token and operant + /// </summary> + /// <returns>A string containing the next token</returns> + private string ParseToken(string line) + { + int i = 0; + int j = line.Length; + bool foundFg = false; + + char[] p; + int k; + + p = line.ToCharArray(); + + do + { + for(int ii = 0; ii < BYPASSCODE.Length; ii++) + { + if( p[i] == BYPASSCODE[ii] ) + { + foundFg = true; + break; + } + } + if( foundFg ) + { + i++; + foundFg = false; + } + else + break; + } while(i < j); + + k = i; + int d=0; + while(i < j && p[i] != DELIMITER[d]) + { + if (d<DELIMITER.Length-1) + { + d++; + } + else + { + i++; + d=0; + } + } + oper=DELIMITER[d]; + if (oper==' ') + { + int ii=i; + while(ii < j && p[ii]==' ') + { + ii++; + } + if (ii<j) + { + oper=p[ii]; + } + } + strTokenbuffer = line.Substring(i, j-i); + + return(line.Substring(k, i-k)); + } + #endregion + + #region MPScript functions + private void DialogBox(string text) + { + GUIDialogOK dlgOk = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK); + dlgOk.SetHeading(""); + dlgOk.SetLine(1,text); + dlgOk.DoModal(GUIWindowManager.ActiveWindow); + } + + private void callAction(string ac) + { + Action act; + switch (ac) + { + case "reboot" : + act = new Action(Action.ActionType.ACTION_REBOOT,0,0); + GUIGraphicsContext.OnAction(act); + break; + case "shutdown" : + act = new Action(Action.ActionType.ACTION_SHUTDOWN,0,0); + GUIGraphicsContext.OnAction(act); + break; + case "hibernate" : + WindowsController.ExitWindows(RestartOptions.Hibernate, m_bForceShutdown); + break; + case "ejectcd" : + act = new Action(Action.ActionType.ACTION_EJECTCD,0,0); + GUIGraphicsContext.OnAction(act); + break; + case "previous_menu" : + act = new Action(Action.ActionType.ACTION_PREVIOUS_MENU,0,0); + GUIGraphicsContext.OnAction(act); + break; + } + } + #endregion + + #region Private Static Functions + + /// <summary> + /// Call user functions + /// </summary> + private static object MPFunctions(string strName, object[] a_params) + { + switch (strName.ToLower()) + { + case "yesnobox" : string t=a_params[0].ToString(); + t=checkText(t); + bool yn=YesNoBox(t); + return yn; + case "mp_var" : t=a_params[0].ToString(); + t=checkText(t); + return null; + case "testit" : return "0"; + default: + return null; + } + } + + /// <summary> + /// Converts MP nums in localize text + /// </summary> + private static string checkText(string text) + { + string conv=text.Trim(); + try + { + int bx=Convert.ToInt32(text); + if (bx>0) + { + conv=GUILocalizeStrings.Get(bx); + } + } + catch(Exception) + { + } + return conv; + } + + /// <summary> + /// Shows Yes No Box + /// </summary> + private static bool YesNoBox(string text) + { + GUIDialogYesNo dlgYesNo = (GUIDialogYesNo)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_YES_NO); + if (null==dlgYesNo) return false; + dlgYesNo.SetHeading(""); + dlgYesNo.SetLine(1,text); + dlgYesNo.DoModal(GUIWindowManager.ActiveWindow); + return dlgYesNo.IsConfirmed; + } + #endregion + + #region Debug helpers + + private void InitDebugLog() + { + try + { + debugName=@"log\script"+ScriptName+".log"; + System.IO.File.Delete(debugName.Replace(".log",".bak")); + System.IO.File.Move(debugName,debugName.Replace(".log",".bak")); + } + catch(Exception) + { + } + } + + public void WriteDebug(string strFormat, params object[] arg) + { + try + { + using (StreamWriter writer = new StreamWriter(debugName,true)) + { + writer.BaseStream.Seek(0, SeekOrigin.End); // set the file pointer to the end of + writer.WriteLine(" "); + writer.Write(DateTime.Now.ToLongTimeString()+" "); + writer.Write(strFormat,arg); + writer.Close(); + } + } + catch(Exception) + { + } + } + + public void WriteLnDebug(string strFormat, params object[] arg) + { + try + { + using (StreamWriter writer = new StreamWriter(debugName,true)) + { + writer.BaseStream.Seek(0, SeekOrigin.End); // set the file pointer to the end of + writer.Write(strFormat,arg); + writer.Close(); + } + } + catch(Exception) + { + } + } + + public void WriteDebugHeader() + { + try + { + using (StreamWriter writer = new StreamWriter(debugName,true)) + { + writer.BaseStream.Seek(0, SeekOrigin.End); // set the file pointer to the end of + writer.WriteLine("MPScript V0.1 Debug Output from {0}",debugName); + writer.WriteLine(DateTime.Now.ToShortDateString()+ " "+DateTime.Now.ToLongTimeString()+ " "); + writer.WriteLine("\n-------------------------------------"); + writer.WriteLine("Global Vars:"); + foreach (DictionaryEntry de in global_variable) + { + writer.WriteLine("Global Var {0}={1}",de.Key,de.Value); + } + writer.WriteLine("\n-------------------------------------"); + writer.WriteLine("Local Vars:"); + foreach (DictionaryEntry de in variable) + { + writer.WriteLine("Local Var {0}={1}",de.Key,de.Value); + } + writer.WriteLine("\n-------------------------------------\n"); + writer.Close(); + } + } + catch(Exception) + { + } + } + + #endregion + } +} Added: trunk/plugins/GUIScript/RegexObjects.cs =================================================================== --- trunk/plugins/GUIScript/RegexObjects.cs (rev 0) +++ trunk/plugins/GUIScript/RegexObjects.cs 2008-04-21 23:01:33 UTC (rev 1690) @@ -0,0 +1,86 @@ +#region Copyright (C) 2005-2008 Team MediaPortal + +/* + * Copyright (C) 2005-2008 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program 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, or (at your option) + * any later version. + * + * This Program 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 GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +// Code based on source from "The Code Project" +// by railerb + +using System; +using System.Text; +using System.Text.RegularExpressions; + +namespace MediaPortal.GUI.GUIScript +{ + internal class DefinedRegex + { + private const string c_strNumeric = @"(?:[0-9]+)?(?:\.[0-9]+)?(?:E-?[0-9]+)?(?=\b)"; + private const string c_strHex = @"0x([0-9a-fA-F]+)"; + private const string c_strUnaryOp = @"(?:\+|-|!|~)(?=\w|\()"; + private const string c_strBinaryOp = @"\+|-|\*|/|%|&&|\|\||&|\||\^|==|!=|>=|<=|=|<|>"; + private const string c_strBool = @"true|false"; + private const string c_strFunction = @"\$(?<Function>\w+)\("; + private const string c_strString = "\\\"(?<String>.*?[^\\\\])\\\""; + + internal static Regex Numeric = new Regex( + c_strNumeric, + RegexOptions.Compiled + ); + + internal static Regex Hexadecimal = new Regex( + c_strHex, + RegexOptions.Compiled + ); + + internal static Regex Boolean = new Regex( + c_strBool, + RegexOptions.Compiled | RegexOptions.IgnoreCase + ); + + internal static Regex UnaryOp = new Regex( + @"(?<=(?:" + c_strBinaryOp + @")\s*|\A)(?:" + c_strUnaryOp + @")", + RegexOptions.Compiled + ); + + internal static Regex BinaryOp = new Regex( + @"(?<!(?:" + c_strBinaryOp + @")\s*|^\A)(?:" + c_strBinaryOp + @")", + RegexOptions.Compiled + ); + + internal static Regex Parenthesis = new Regex( + @"\(", + RegexOptions.Compiled + ); + + internal static Regex Function = new Regex( + c_strFunction, + RegexOptions.Compiled + ); + + internal static Regex String = new Regex( + c_strString, + RegexOptions.Compiled + ); + + } +} Added: trunk/plugins/GUIScript/ScriptHandler.cs =================================================================== --- trunk/plugins/GUIScript/ScriptHandler.cs (rev 0) +++ trunk/plugins/GUIScript/ScriptHandler.cs 2008-04-21 23:01:33 UTC (rev 1690) @@ -0,0 +1,138 @@ +#region Copyright (C) 2005-2008 Team MediaPortal + +/* + * Copyright (C) 2005-2008 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program 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, or (at your option) + * any later version. + * + * This Program 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 GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +#region Usings +using System; +using System.IO; +using System.Collections; +using System.Management; +#endregion + +namespace MediaPortal.GUI.GUIScript +{ + /// <summary> + /// Summary description for ScriptHandler. + /// </summary> + public class ScriptHandler + { + + private struct script + { + public string name; + public string button; + public MPScript mpScript; + } + private static MPScript gscript=new MPScript(); + private static ArrayList scripts = new ArrayList(); + + public ScriptHandler() + { + // + // TODO: Add constructor logic here + // + } + + /// <summary> + /// sets a global bool var + /// </summary> + public void SetGlobalVar(string key,object val) + { + gscript.setGlobalVar(key,val); + } + + /// <summary> + /// start a script with Button Name + /// </summary> + public void StartScript(string name) // starts script "name" + { + foreach (script scr in scripts) + { + if (scr.button==name) + { + bool b=scr.mpScript.RunScript(); + break; + } + } + } + + /// <summary> + /// start a script with Script Name + /// </summary> + public void StartScriptName(string name) // starts script "name" + { + foreach (script scr in scripts) + { + if (scr.name==name) + { + bool b=scr.mpScript.RunScript(); + break; + } + } + } + + /// <summary> + /// load a script in memory + /// </summary> + public string LoadScript(string name) // loads a script in memory + { + string btnTxt=""; + if (scripts.Count>0) + { + bool found=false; + foreach (script scr in scripts) // is script already here? + { + if (scr.name==name) + { + found=true; + btnTxt=scr.button; + break; + } + } + if (found==false) + { + script sc = new script(); + sc.name=name; + MPScript mpScript = new MPScript(); + sc.button=mpScript.GetScript(name); + sc.mpScript=mpScript; + scripts.Add(sc); + btnTxt=sc.button; + } + } + else + { + script sc = new script(); + sc.name=name; + MPScript mpScript = new MPScript(); + btnTxt=mpScript.GetScript(name); + sc.button=btnTxt; + sc.mpScript=mpScript; + scripts.Add(sc); + } + return btnTxt; + } + + } +} Added: trunk/plugins/GUIScript/SetupForm.cs =================================================================== --- trunk/plugins/GUIScript/SetupForm.cs (rev 0) +++ trunk/plugins/GUIScript/SetupForm.cs 2008-04-21 23:01:33 UTC (rev 1690) @@ -0,0 +1,236 @@ +#region Copyright (C) 2005-2008 Team MediaPortal + +/* + * Copyright (C) 2005-2008 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program 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, or (at your option) + * any later version. + * + * This Program 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 GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.IO; +using System.Drawing; +using System.Collections; +using System.ComponentModel; +using System.Windows.Forms; +using MediaPortal.GUI.Library; + +namespace GUIScript +{ + /// <summary> + /// Summary description for SetupForm. + /// </summary> + public class SetupForm : System.Windows.Forms.Form, ISetupForm, IShowPlugin + { + private System.Windows.Forms.ListBox ScriptsFunctions; + /// <summary> + /// Required designer variable. + /// </summary> + ... [truncated message content] |
From: <che...@us...> - 2008-04-21 23:14:56
|
Revision: 1691 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1691&view=rev Author: chef_koch Date: 2008-04-21 16:14:54 -0700 (Mon, 21 Apr 2008) Log Message: ----------- added MyDreambox and ExternalDreamboxTV plugin from mp svn revision 15748 Revision Links: -------------- http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=15748&view=rev Added Paths: ----------- trunk/plugins/ExternalDreamboxTV/ trunk/plugins/ExternalDreamboxTV/Dreambox/ trunk/plugins/ExternalDreamboxTV/Dreambox/BoxInfo.cs trunk/plugins/ExternalDreamboxTV/Dreambox/ChannelInfo.cs trunk/plugins/ExternalDreamboxTV/Dreambox/Core.cs trunk/plugins/ExternalDreamboxTV/Dreambox/Data.cs trunk/plugins/ExternalDreamboxTV/Dreambox/NowPlaying799.cs trunk/plugins/ExternalDreamboxTV/Dreambox/Remote.cs trunk/plugins/ExternalDreamboxTV/Dreambox/Request.cs trunk/plugins/ExternalDreamboxTV/Dreambox/XML.cs trunk/plugins/ExternalDreamboxTV/Dreambox/Zap.cs trunk/plugins/ExternalDreamboxTV/ExternalDreamBoxTVSettings.Designer.cs trunk/plugins/ExternalDreamboxTV/ExternalDreamBoxTVSettings.cs trunk/plugins/ExternalDreamboxTV/ExternalDreamBoxTVSettings.resx trunk/plugins/ExternalDreamboxTV/ExternalDreamboxTV.cs trunk/plugins/MyDreambox/ trunk/plugins/MyDreambox/AxInterop.AXVLC.dll trunk/plugins/MyDreambox/Dreambox/ trunk/plugins/MyDreambox/Dreambox/BoxInfo.cs trunk/plugins/MyDreambox/Dreambox/ChannelInfo.cs trunk/plugins/MyDreambox/Dreambox/Core.cs trunk/plugins/MyDreambox/Dreambox/Data.cs trunk/plugins/MyDreambox/Dreambox/EPG.cs trunk/plugins/MyDreambox/Dreambox/NowPlaying799.cs trunk/plugins/MyDreambox/Dreambox/Remote.cs trunk/plugins/MyDreambox/Dreambox/Request.cs trunk/plugins/MyDreambox/Dreambox/XML.cs trunk/plugins/MyDreambox/Dreambox/Zap.cs trunk/plugins/MyDreambox/DreamboxSetupForm.Designer.cs trunk/plugins/MyDreambox/DreamboxSetupForm.cs trunk/plugins/MyDreambox/DreamboxSetupForm.resx trunk/plugins/MyDreambox/GuiRecordings.cs trunk/plugins/MyDreambox/Interop.AXVLC.dll trunk/plugins/MyDreambox/MyDreamboxGui.cs trunk/plugins/MyDreambox/MyDreamboxPlugin.cs trunk/plugins/MyDreambox/MyDreamboxRadio.cs Added: trunk/plugins/ExternalDreamboxTV/Dreambox/BoxInfo.cs =================================================================== --- trunk/plugins/ExternalDreamboxTV/Dreambox/BoxInfo.cs (rev 0) +++ trunk/plugins/ExternalDreamboxTV/Dreambox/BoxInfo.cs 2008-04-21 23:14:54 UTC (rev 1691) @@ -0,0 +1,414 @@ +#region Copyright (C) 2005-2007 Team MediaPortal + +/* + * Copyright (C) 2005-2007 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program 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, or (at your option) + * any later version. + * + * This Program 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 GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; + +namespace DreamBox +{ + public class BoxInfo + { + private string _Url = ""; + private string _UserName = ""; + private string _Password = ""; + private string _Command = "/data"; + + public BoxInfo(string url, string username, string password) + { + _Url = url; + _UserName = username; + _Password = password; + Request request = new Request(_Url, _UserName, _Password); + string s = request.PostData(_Command); + InternalParsing(s); + } + + public void Refresh() + { + Request request = new Request(_Url, _UserName, _Password); + string s = request.PostData(_Command); + InternalParsing(s); + } + void InternalParsing(string s) + { + Regex objAlphaPattern = new Regex("var ?.*\n"); + MatchCollection col = objAlphaPattern.Matches(s); + for (int i = 0; i < col.Count; i++) + { + string val = col[i].ToString().Replace("var ","").Replace("\n",""); + if (val.Contains("=") && val.Contains(";")) + { + val = val.Replace(";", "").Replace(" = ", "="); + Console.WriteLine("[" + val + "]"); + string[] arr = val.Split('='); + + string name = arr[0]; + string value = arr[1].Replace("\"", "") ; + switch (name) + { + case "updateCycleTime": + this.updateCycleTime = int.Parse(value.ToString()); + break; + case "standby": + if (value.ToString() == "0") + { + this.Standby = false; + } + else this.Standby = true; + break; + case "serviceName": + this.ServiceName = value.ToString(); + break; + case "nowT": + this.NowT = value.ToString(); + break; + case "nowD": + this.NowD = value.ToString(); + break; + case "nowSt": + this.NowSt = value.ToString(); + break; + case "nextT": + this.NextT = value.ToString(); + break; + case "nextD": + this.NextD = value.ToString(); + break; + case "nextSt": + this.NextSt = value.ToString(); + break; + case "diskGB": + this.DiskGB = value.ToString(); + break; + case "diskH": + this.DiskH = value.ToString(); + break; + case "apid": + this.Apid = value.ToString(); + break; + case "vpid": + this.Vpid = value.ToString(); + break; + case "ip": + this.IP = value.ToString(); + break; + case "lock": + this.Lock = value.ToString(); + break; + case "upTime": + this.UpTime = value.ToString(); + break; + case "volume": + this.Volume = int.Parse(value.ToString()); + break; + case "mute": + if (value.ToString() == "0") + { + this.Mute = false; + } + else this.Mute = true; + break; + case "dolby": + if (value.ToString() == "0") + { + this.Dolby = false; + } + else this.Dolby = true; + break; + case "crypt": + if (value.ToString() == "0") + { + this.Crypt = false; + } + else this.Crypt = true; + break; + case "format": + if (value.ToString() == "0") + { + this.Format = false; + } + else this.Format = true; + break; + case "recording": + if (value.ToString() == "0") + { + this.Recording = false; + } + else this.Recording = true; + break; + case "vlcparms": + this.VlcParms = value.ToString(); + break; + case "serviceReference": + this.ServiceReference = value.ToString(); + break; + case "videoTime": + this.VideoTime = value.ToString(); + break; + case "videoPosition": + this.VideoPosition = int.Parse(value.ToString()); + break; + case "agc": + this.AGC = int.Parse(value.ToString()); + break; + case "snr": + this.SNR = int.Parse(value.ToString()); + break; + case "ber": + this.BER = int.Parse(value.ToString()); + break; + case "streamingClientStatus": + this.StreamingClientStatus = value.ToString(); + break; + default: + return; + + } + + } + + + } + } + + #region Properties + private int _updateCycleTime; + + public int updateCycleTime + { + get { return _updateCycleTime; } + set { _updateCycleTime = value; } + } + private bool _Standby; + + public bool Standby + { + get { return _Standby; } + set { _Standby = value; } + } + private string _ServiceName; + + public string ServiceName + { + get { return _ServiceName; } + set { _ServiceName = value; } + } + private string _NowT; + + public string NowT + { + get { return _NowT; } + set { _NowT = value; } + } + private string _NowD; + + public string NowD + { + get { return _NowD; } + set { _NowD = value; } + } + private string _NowSt; + + public string NowSt + { + get { return _NowSt; } + set { _NowSt = value; } + } + private string _NextT; + + public string NextT + { + get { return _NextT; } + set { _NextT = value; } + } + private string _NextD; + + public string NextD + { + get { return _NextD; } + set { _NextD = value; } + } + private string _NextSt; + + public string NextSt + { + get { return _NextSt; } + set { _NextSt = value; } + } + private string _DiskGB; + + public string DiskGB + { + get { return _DiskGB; } + set { _DiskGB = value; } + } + private string _DiskH; + + public string DiskH + { + get { return _DiskH; } + set { _DiskH = value; } + } + private string _Apid; + + public string Apid + { + get { return _Apid; } + set { _Apid = value; } + } + private string _Vpid; + + public string Vpid + { + get { return _Vpid; } + set { _Vpid = value; } + } + private string _IP; + + public string IP + { + get { return _IP; } + set { _IP = value; } + } + private string _Lock; + + public string Lock + { + get { return _Lock; } + set { _Lock = value; } + } + private string _UpTime; + + public string UpTime + { + get { return _UpTime; } + set { _UpTime = value; } + } + private int _Volume; + + public int Volume + { + get { return _Volume; } + set { _Volume = value; } + } + private bool _Mute; + + public bool Mute + { + get { return _Mute; } + set { _Mute = value; } + } + private bool _Dolby; + + public bool Dolby + { + get { return _Dolby; } + set { _Dolby = value; } + } + private bool _Crypt; + + public bool Crypt + { + get { return _Crypt; } + set { _Crypt = value; } + } + private bool _format; + + public bool Format + { + get { return _format; } + set { _format = value; } + } + private bool _Recording; + + public bool Recording + { + get { return _Recording; } + set { _Recording = value; } + } + private string _VlcParms; + + public string VlcParms + { + get { return _VlcParms; } + set { _VlcParms = value; } + } + private string _ServiceReference; + + public string ServiceReference + { + get { return _ServiceReference; } + set { _ServiceReference = value; } + } + private string _VideoTime; + + public string VideoTime + { + get { return _VideoTime; } + set { _VideoTime = value; } + } + private int _VideoPosition; + + public int VideoPosition + { + get { return _VideoPosition; } + set { _VideoPosition = value; } + } + private int _AGC; + + public int AGC + { + get { return _AGC; } + set { _AGC = value; } + } + private int _SNR; + + public int SNR + { + get { return _SNR; } + set { _SNR = value; } + } + private int _BER; + + public int BER + { + get { return _BER; } + set { _BER = value; } + } + private string _StreamingClientStatus; + + public string StreamingClientStatus + { + get { return _StreamingClientStatus; } + set { _StreamingClientStatus = value; } + } + + + + #endregion + } +} Added: trunk/plugins/ExternalDreamboxTV/Dreambox/ChannelInfo.cs =================================================================== --- trunk/plugins/ExternalDreamboxTV/Dreambox/ChannelInfo.cs (rev 0) +++ trunk/plugins/ExternalDreamboxTV/Dreambox/ChannelInfo.cs 2008-04-21 23:14:54 UTC (rev 1691) @@ -0,0 +1,262 @@ +#region Copyright (C) 2005-2007 Team MediaPortal + +/* + * Copyright (C) 2005-2007 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program 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, or (at your option) + * any later version. + * + * This Program 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 GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; + +namespace DreamBox +{ + public class ChannelInfo + { + private string _Url = ""; + private string _UserName = ""; + private string _Password = ""; + private string _Command = "/cgi-bin/status"; + + + public ChannelInfo(string url, string username, string password) + { + _Url = url; + _UserName = username; + _Password = password; + + Request request = new Request(_Url, _UserName, _Password); + string s = request.PostData(_Command); + InternalParsing(s); + } + + void InternalParsing(string s) + { + Regex objAlphaPattern = new Regex("<tr><td>?.*</td></tr>"); + MatchCollection col = objAlphaPattern.Matches(s); + for (int i = 0; i < col.Count; i++) + { + string val = col[i].ToString().Replace("<tr><td>", "").Replace("</td></tr>", "").Replace("</td></td>", "").Replace("</td><td>", ""); + string[] arr = val.Split(':'); + + switch (arr[0]) + { + case "WebIf-Version": + this.WebIfVersion = arr[1]; + break; + case "Standby": + if (arr[1] == "OFF") + { + this.Standby = false; + } + else + { + this.Standby = true; + } + break; + case "Recording": + if (arr[1] == "OFF") + { + this.Standby = false; + } + else + { + this.Standby = true; + } + break; + case "Mode": + this.Mode = Convert.ToInt32(arr[1]); + break; + case "Current service reference": + this.CurrentServiceReference = arr[1]; + break; + case "name": + this.Name = arr[1]; + break; + case "provider": + this.Provider = arr[1]; + break; + case "vpid": + this.Vpid = arr[1].Replace("<td>", "").Substring(0, arr[1].Replace("<td>", "").IndexOf("(")); + break; + case "apid": + this.Apid = arr[1].Replace("<td>", "").Substring(0, arr[1].Replace("<td>", "").IndexOf("(")); + break; + case "pcrpid": + this.Pcrpid = arr[1].Replace("<td>", "").Substring(0, arr[1].Replace("<td>", "").IndexOf("(")); + break; + case "tpid": + this.Tpid = arr[1].Replace("<td>", "").Substring(0, arr[1].Replace("<td>", "").IndexOf("(")); + break; + case "tsid": + this.Tsid = arr[1]; + break; + case "onid": + this.Onid = arr[1]; + break; + case "sid": + this.Sid = arr[1]; + break; + case "pmt": + this.Pmt = arr[1]; + break; + case "vidformat": + this.VidFormat = arr[1]; + this.VidFormat = this.VidFormat.Replace("<td>", ""); + this.VidFormat = this.VidFormat.Replace("</td>", ""); + break; + default: + return; + + } + + } + } + + #region Properties + private string _CurrentTime; + + public string CurrentTime + { + get { return _CurrentTime; } + set { _CurrentTime = value; } + } + + private string _WebIfVersion; + + public string WebIfVersion + { + get { return _WebIfVersion; } + set { _WebIfVersion = value; } + } + private bool _Standby; + + public bool Standby + { + get { return _Standby; } + set { _Standby = value; } + } + private bool _Recording; + + public bool Recording + { + get { return _Recording; } + set { _Recording = value; } + } + private int _Mode; + + public int Mode + { + get { return _Mode; } + set { _Mode = value; } + } + private string _CurrentServiceReference; + + public string CurrentServiceReference + { + get { return _CurrentServiceReference; } + set { _CurrentServiceReference = value; } + } + + private string _Name; + + public string Name + { + get { return _Name; } + set { _Name = value; } + } + private string _Provider; + + public string Provider + { + get { return _Provider; } + set { _Provider = value; } + } + private string _vpid; + + public string Vpid + { + get { return _vpid; } + set { _vpid = value; } + } + private string _apid; + + public string Apid + { + get { return _apid; } + set { _apid = value; } + } + private string _pcrpid; + + public string Pcrpid + { + get { return _pcrpid; } + set { _pcrpid = value; } + } + private string _tpid; + + public string Tpid + { + get { return _tpid; } + set { _tpid = value; } + } + private string _tsid; + + public string Tsid + { + get { return _tsid; } + set { _tsid = value; } + } + private string _onid; + + public string Onid + { + get { return _onid; } + set { _onid = value; } + } + private string _sid; + + public string Sid + { + get { return _sid; } + set { _sid = value; } + } + private string _pmt; + + public string Pmt + { + get { return _pmt; } + set { _pmt = value; } + } + private string _vidformat; + + public string VidFormat + { + get { return _vidformat; } + set { _vidformat = value; } + } + #endregion + + + + } +} Added: trunk/plugins/ExternalDreamboxTV/Dreambox/Core.cs =================================================================== --- trunk/plugins/ExternalDreamboxTV/Dreambox/Core.cs (rev 0) +++ trunk/plugins/ExternalDreamboxTV/Dreambox/Core.cs 2008-04-21 23:14:54 UTC (rev 1691) @@ -0,0 +1,125 @@ +#region Copyright (C) 2005-2007 Team MediaPortal + +/* + * Copyright (C) 2005-2007 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program 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, or (at your option) + * any later version. + * + * This Program 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 GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.Collections.Generic; +using System.Text; + + + +namespace DreamBox +{ + public class Core + { + private string _Url = ""; + private string _UserName = ""; + private string _Password = ""; + + public DreamBox.Data Data = null; + public DreamBox.Remote Remote = null; + private DreamBox.XML _XML = null; + + public Core(string url, string username, string password) + { + _Url = url; + _UserName = username; + _Password = password; + + this.Data = new Data(url, username, password); + this.Remote = new Remote(url, username, password); + this._XML = new XML(url, username, password); + } + + + + + public XML XML + { + get + { + return _XML; + } + } + + public string Url + { + get { return _Url; } + set { _Url = value; } + } + + public string Password + { + get { return _Password; } + set { _Password = value; } + } + + public string UserName + { + get { return _UserName; } + set { _UserName = value; } + } + + + private string _SelectedBouquet; + public string SelectedBouquet + { + get { return _SelectedBouquet; } + set { _SelectedBouquet = value; } + } + private string _SelectedChannel; + + public string SelectedChannel + { + get { return _SelectedChannel; } + set { _SelectedChannel = value; } + } + + + public ChannelInfo CurrentChannel + { + get + { + return new ChannelInfo(_Url, _UserName, _Password); + } + } + public Remote RemoteControl + { + get + { + return new Remote(_Url, _UserName, _Password); + } + } + + public void Reboot() + { + Request request = new Request(_Url, _UserName, _Password); + string sreturn = request.PostData("/cgi-bin/admin?command=reboot"); + } + + + + + } +} Added: trunk/plugins/ExternalDreamboxTV/Dreambox/Data.cs =================================================================== --- trunk/plugins/ExternalDreamboxTV/Dreambox/Data.cs (rev 0) +++ trunk/plugins/ExternalDreamboxTV/Dreambox/Data.cs 2008-04-21 23:14:54 UTC (rev 1691) @@ -0,0 +1,364 @@ +#region Copyright (C) 2005-2007 Team MediaPortal + +/* + * Copyright (C) 2005-2007 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program 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, or (at your option) + * any later version. + * + * This Program 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 GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.Collections.Generic; +using System.Text; +using System.Data; +using System.Text.RegularExpressions; + +namespace DreamBox +{ + public class Data + { + private string _Url = ""; + private string _UserName = ""; + private string _Password = ""; + private string _Command = "/cgi-bin/"; + + public Data(string url, string username, string password) + { + _Url = url; + _UserName = username; + _Password = password; + } + + public DataSet AllBouquets + { + get + { + Request request = new Request(_Url, _UserName, _Password); + string sreturn = request.PostData(_Command + "getServices?ref=0"); + string[] allBouquets = sreturn.Split('\n'); + + // convert to dataset + DataSet ds = new DataSet(); + DataTable table = new DataTable("Bouquets"); + DataRow row = null; + + try + { + + table.Columns.Add("Ref", Type.GetType("System.String")); + table.Columns.Add("Name", Type.GetType("System.String")); + + foreach (string bouquets in allBouquets) + { + if (bouquets.IndexOf(';') > -1) + { + string[] bouquet = bouquets.Split(';'); + row = table.NewRow(); + row["Ref"] = bouquet[0].ToString(); + row["Name"] = bouquet[1].ToString(); + table.Rows.Add(row); + } + + } + + ds.Tables.Add(table); + + } + catch (Exception ex) + { + throw ex; + } + + return ds; + } + } + + public DataSet UserTVBouquets + { + get + { + string userbouquests = "Bouquets (TV)".ToLower(); + string temp = ""; + Request request = new Request(_Url, _UserName, _Password); + string sreturn = request.PostData(_Command + "getServices?ref=0"); + string[] allBouquets = sreturn.Split('\n'); + + // convert to dataset + DataSet ds = new DataSet(); + DataTable table = new DataTable("Bouquets"); + DataRow row = null; + + try + { + + table.Columns.Add("Ref", Type.GetType("System.String")); + table.Columns.Add("Name", Type.GetType("System.String")); + + foreach (string s in allBouquets) + { + if (s.ToLower().Contains(userbouquests)) + { + temp = s.Split(';')[0]; + break; + } + } + + sreturn = request.PostData(_Command + "getServices?ref=" + temp); + allBouquets = sreturn.Split('\n'); + + foreach (string bouquets in allBouquets) + { + if (bouquets.IndexOf(';') > -1 && bouquets.Length > 0) // HOTFIX!!!!! 28-10-2006 + { + string[] bouquet = bouquets.Split(';'); + row = table.NewRow(); + row["Ref"] = bouquet[0].ToString(); + row["Name"] = bouquet[1].ToString(); + table.Rows.Add(row); + } + + } + + ds.Tables.Add(table); + + } + catch + { + + } + + return ds; + } + } + + public DataSet UserRadioBouquets + { + get + { + string userbouquests = "bouquets (radio)"; + string temp = ""; + Request request = new Request(_Url, _UserName, _Password); + string sreturn = request.PostData(_Command + "getServices?ref=0"); + string[] allBouquets = sreturn.Split('\n'); + + // convert to dataset + DataSet ds = new DataSet(); + DataTable table = new DataTable("Bouquets"); + DataRow row = null; + + try + { + + table.Columns.Add("Ref", Type.GetType("System.String")); + table.Columns.Add("Name", Type.GetType("System.String")); + + foreach (string s in allBouquets) + { + if (s.ToLower().Contains(userbouquests)) // HOTFIX!!!!! 28-10-2006 + { + temp = s.Split(';')[0]; + break; + } + } + + sreturn = request.PostData(_Command + "getServices?ref=" + temp); + allBouquets = sreturn.Split('\n'); + + foreach (string bouquets in allBouquets) + { + if (bouquets.IndexOf(';') > -1) + { + string[] bouquet = bouquets.Split(';'); + row = table.NewRow(); + row["Ref"] = bouquet[0].ToString(); + row["Name"] = bouquet[1].ToString(); + table.Rows.Add(row); + } + + } + + ds.Tables.Add(table); + + } + catch (Exception ex) + { + throw ex; + } + + return ds; + } + } + + public DataSet Channels(string reference) + { + Request request = new Request(_Url, _UserName, _Password); + string sreturn = request.PostData(_Command + "getServices?ref=" + reference); + string[] allBouquets = sreturn.Split('\n'); + + // convert to dataset + DataSet ds = new DataSet(); + DataTable table = new DataTable("Bouquets"); + DataRow row = null; + + try + { + + table.Columns.Add("Ref", Type.GetType("System.String")); + table.Columns.Add("Name", Type.GetType("System.String")); + + foreach (string bouquets in allBouquets) + { + if (bouquets.IndexOf(';') > -1) + { + string[] bouquet = bouquets.Split(';'); + row = table.NewRow(); + row["Ref"] = bouquet[0].ToString(); + row["Name"] = bouquet[1].ToString(); + table.Rows.Add(row); + } + + } + table.DefaultView.Sort = "Name"; + ds.Tables.Add(table); + + } + catch (Exception ex) + { + throw ex; + } + + return ds; + } + + public DataSet Recordings + { + get + { + Request request = new Request(_Url, _UserName, _Password); + string sreturn = request.PostData("/body?mode=zap&zapmode=3&zapsubmode=1"); + string result = ""; + Regex objAlphaPattern = new Regex(@"channels\[0\].*?;"); + MatchCollection col = objAlphaPattern.Matches(sreturn); + for (int i = 0; i < col.Count; i++) + { + result = col[i].Value.ToString(); + } + result = result.Replace(@"channels[0] = new Array(", ""); + string[] temparr = result.Split('\"'); + int amount = 0; + for (int i = 0; i < temparr.GetUpperBound(0); i++) + { + if (temparr[i].ToString().Trim() != "," && temparr[i].ToString().Trim() != "") + { + amount += 1; + } + } + string[] names = new string[amount]; + amount = 0; + for (int i = 0; i < temparr.GetUpperBound(0); i++) + { + if (temparr[i].ToString().Trim() != "," && temparr[i].ToString().Trim() != "") + { + names[amount] = temparr[i]; + amount += 1; + } + } + // remove ending ',' + for (int i = 0; i < names.GetUpperBound(0); i++) + { + if (names[i].EndsWith(",")) + names[i] = names[i].Substring(0, names[i].Length - 1); + } + + // get refs + objAlphaPattern = new Regex(@"channelRefs\[0\].*?;"); + col = objAlphaPattern.Matches(sreturn); + for (int i = 0; i < col.Count; i++) + { + result = col[i].Value.ToString(); + } + result = result.Replace(@"channelRefs[0] = new Array(", ""); + temparr = result.Split('\"'); + + string[] refs = new string[names.GetUpperBound(0) + 1]; + amount = 0; + for (int i = 0; i < temparr.GetUpperBound(0); i++) + { + if (temparr[i].ToString().Trim() != "," && temparr[i].ToString().Trim() != "") + { + refs[amount] = temparr[i]; + amount += 1; + } + } + + + + // convert to dataset + DataSet ds = new DataSet(); + DataTable table = new DataTable("Recordings"); + DataRow row = null; + + try + { + + table.Columns.Add("Ref", Type.GetType("System.String")); + table.Columns.Add("Name", Type.GetType("System.String")); + + for (int i = 0; i < names.GetUpperBound(0) + 1; i++) + { + { + row = table.NewRow(); + row["Ref"] = refs[i].ToString(); + row["Name"] = names[i].ToString(); + table.Rows.Add(row); + } + } + table.DefaultView.Sort = "Name"; + ds.Tables.Add(table); + + } + catch (Exception ex) + { + throw ex; + } + return ds; + } + } + + #region EPG + public DataSet CurrentEPG + { + get + { + Request request = new Request(_Url, _UserName, _Password); + string sreturn = request.PostData(_Command + "getcurrentepg"); + string result = ""; + Regex objAlphaPattern = new Regex("middle.*?", RegexOptions.IgnoreCase | RegexOptions.Multiline); + MatchCollection col = objAlphaPattern.Matches(sreturn); + for (int i = 0; i < col.Count; i++) + { + result = col[i].Value.ToString(); + } + return null; + } + } + #endregion + } + +} Added: trunk/plugins/ExternalDreamboxTV/Dreambox/NowPlaying799.cs =================================================================== --- trunk/plugins/ExternalDreamboxTV/Dreambox/NowPlaying799.cs (rev 0) +++ trunk/plugins/ExternalDreamboxTV/Dreambox/NowPlaying799.cs 2008-04-21 23:14:54 UTC (rev 1691) @@ -0,0 +1,62 @@ +#region Copyright (C) 2005-2007 Team MediaPortal + +/* + * Copyright (C) 2005-2007 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program 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, or (at your option) + * any later version. + * + * This Program 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 GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; + + +namespace DreamBox +{ + public class NowPlaying799 + { + + + public NowPlaying799() + { + + } + + public string NowPlaying() + { + string nowPlaying = ""; + Request request = new Request("http://www.club977.com/", null, null); + nowPlaying = request.PostData(""); + return RunningPart(nowPlaying); + } + + string RunningPart(String strToCheck) + { + Regex objAlphaPattern = new Regex("<td height=\"30\" class=\"last\">?.*<br>"); + Match m = objAlphaPattern.Match(strToCheck); + string s = m.ToString().Replace("<td height=\"30\" class=\"last\">", "").Replace("<br>", ""); + + return s; + + } + + } +} Added: trunk/plugins/ExternalDreamboxTV/Dreambox/Remote.cs =================================================================== --- trunk/plugins/ExternalDreamboxTV/Dreambox/Remote.cs (rev 0) +++ trunk/plugins/ExternalDreamboxTV/Dreambox/Remote.cs 2008-04-21 23:14:54 UTC (rev 1691) @@ -0,0 +1,269 @@ +#region Copyright (C) 2005-2007 Team MediaPortal + +/* + * Copyright (C) 2005-2007 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program 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, or (at your option) + * any later version. + * + * This Program 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 GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.Collections.Generic; +using System.Text; + +namespace DreamBox +{ + public class Remote + { + private string _Url = ""; + private string _UserName = ""; + private string _Password = ""; + + public Remote(string url, string username, string password) + { + _Url = url; + _UserName = username; + _Password = password; + } + + #region RemoteControl + public void Left() + { + Zap z = new Zap(_Url, _UserName, _Password); + z.Left(); + } + public void Right() + { + Zap z = new Zap(_Url, _UserName, _Password); + z.Right(); + } + + public void Mute() + { + Zap z = new Zap(_Url, _UserName, _Password); + z.Mute(); + } + public void Lame() + { + Zap z = new Zap(_Url, _UserName, _Password); + z.Lame(); + } + + public void VolumeUp() + { + Zap z = new Zap(_Url, _UserName, _Password); + z.VolumeUp(); + } + + public void VolumeDown() + { + Zap z = new Zap(_Url, _UserName, _Password); + z.VolumeDown(); + } + public void BouquetUp() + { + Zap z = new Zap(_Url, _UserName, _Password); + z.BouquetUp(); + } + public void BouquetDown() + { + Zap z = new Zap(_Url, _UserName, _Password); + z.BouquetDown(); + } + public void Up() + { + Zap z = new Zap(_Url, _UserName, _Password); + z.Up(); + } + public void Down() + { + Zap z = new Zap(_Url, _UserName, _Password); + z.Down(); + } + public void Info() + { + Zap z = new Zap(_Url, _UserName, _Password); + z.Info(); + } + public void Menu() + { + Zap z = new Zap(_Url, _UserName, _Password); + z.Menu(); + } + public void OK() + { + Zap z = new Zap(_Url, _UserName, _Password); + z.OK(); + } + public void Previous() + { + Zap z = new Zap(_Url, _UserName, _Password); + z.Previous(); + } + public void Next() + { + Zap z = new Zap(_Url, _UserName, _Password); + z.OK(); + } + public void Audio() + { + Zap z = new Zap(_Url, _UserName, _Password); + z.Audio(); + } + public void Video() + { + Zap z = new Zap(_Url, _UserName, _Password); + z.Video(); + } + public void Red() + { + Zap z = new Zap(_Url, _UserName, _Password); + z.Red(); + } + public void Green() + { + Zap z = new Zap(_Url, _UserName, _Password); + z.Green(); + } + public void Yellow() + { + Zap z = new Zap(_Url, _UserName, _Password); + z.Yellow(); + } + public void Blue() + { + Zap z = new Zap(_Url, _UserName, _Password); + z.Blue(); + } + public void TV() + { + Zap z = new Zap(_Url, _UserName, _Password); + z.TV(); + } + public void Radio() + { + Zap z = new Zap(_Url, _UserName, _Password); + z.Radio(); + } + public void Text() + { + Zap z = new Zap(_Url, _UserName, _Password); + z.Text(); + } + public void Help() + { + Zap z = new Zap(_Url, _UserName, _Password); + z.Help(); + } + public void Zap(string reference) + { + Zap z = new Zap(_Url, _UserName, _Password); + z.ZapTo(reference); + } + + #region Video Keys + public void Rewind() + { + Zap z = new Zap(_Url, _UserName, _Password); + z.Rewind(); + } + public void Play() + { + Zap z = new Zap(_Url, _UserName, _Password); + z.Play(); + } + public void Pause() + { + Zap z = new Zap(_Url, _UserName, _Password); + z.Pause(); + } + public void Forward() + { + Zap z = new Zap(_Url, _UserName, _Password); + z.Forward(); + } + public void Stop() + { + Zap z = new Zap(_Url, _UserName, _Password); + z.Stop(); + } + public void Record() + { + Zap z = new Zap(_Url, _UserName, _Password); + z.Record(); + } + + #endregion + + #region Numbers + public void Zap0() + { + Zap z = new Zap(_Url, _UserName, _Password); + z.Zap0(); + } + public void Zap1() + { + Zap z = new Zap(_Url, _UserName, _Password); + z.Zap1(); + } + public void Zap2() + { + Zap z = new Zap(_Url, _UserName, _Password); + z.Zap2(); + } + public void Zap3() + { + Zap z = new Zap(_Url, _UserName, _Password); + z.Zap3(); + } + public void Zap4() + { + Zap z = new Zap(_Url, _UserName, _Password); + z.Zap4(); + } + public void Zap5() + { + Zap z = new Zap(_Url, _UserName, _Password); + z.Zap5(); + } + public void Zap6() + { + Zap z = new Zap(_Url, _UserName, _Password); + z.Zap6(); + } + public void Zap7() + { + Zap z = new Zap(_Url, _UserName, _Password); + z.Zap7(); + } + public void Zap8() + { + Zap z = new Zap(_Url, _UserName, _Password); + z.Zap8(); + } + public void Zap9() + { + Zap z = new Zap(_Url, _UserName, _Password); + z.Zap9(); + } + + #endregion + #endregion + } +} Added: trunk/plugins/ExternalDreamboxTV/Dreambox/Request.cs =================================================================== --- trunk/plugins/ExternalDreamboxTV/Dreambox/Request.cs (rev 0) +++ trunk/plugins/ExternalDreamboxTV/Dreambox/Request.cs 2008-04-21 23:14:54 UTC (rev 1691) @@ -0,0 +1,72 @@ +#region Copyright (C) 2005-2007 Team MediaPortal + +/* + * Copyright (C) 2005-2007 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program 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, or (at your option) + * any later version. + * + * This Program 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 GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.Collections.Generic; +using System.Text; +using System.Net; +using System.IO; + +namespace DreamBox +{ + public class Request + { + private string _Url = ""; + private string _UserName = ""; + private string _Password = ""; + + public Request(string url, string username, string password) + { + _Url = url; + _UserName = username; + _Password = password; + } + + public Stream GetStream(string command) + { + Uri uri = new Uri(_Url + command); + WebRequest request = WebRequest.Create(uri); + request.Credentials = new NetworkCredential(_UserName, _Password); + + WebResponse response = request.GetResponse(); + Stream stream = response.GetResponseStream(); + return stream; + } + + public string PostData(string command) + { + Uri uri = new Uri(_Url + command); + WebRequest request = WebRequest.Create(uri); + request.Credentials = new NetworkCredential(_UserName, _Password); + + WebResponse response = request.GetResponse(); + + StreamReader reader = new StreamReader(response.GetResponseStream()); + + string str = reader.ReadToEnd(); + return str; + } + } +} Added: trunk/plugins/ExternalDreamboxTV/Dreambox/XML.cs =================================================================== --- trunk/plugins/ExternalDreamboxTV/Dreambox/XML.cs (rev 0) +++ trunk/plugins/ExternalDreamboxTV/Dreambox/XML.cs 2008-04-21 23:14:54 UTC (rev 1691) @@ -0,0 +1,931 @@ +#region Copyright (C) 2005-2007 Team MediaPortal + +/* + * Copyright (C) 2005-2007 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program 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, or (at your option) + * any later version. + * + * This Program 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 GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.RegularExpressions; +using System.Xml; +using System.IO; + +namespace DreamBox +{ + public class XML + { + private string _Url = ""; + private string _UserName = ""; + private string _Password = ""; + private string _Command = "/xml/"; + + public XML(string url, string username, string password) + { + _Url = url; + _UserName = username; + _Password = password; + } + + + #region Accessible Interface + public StreamInfoData StreamInfo + { + get + { + Request request = new Request(_Url, _UserName, _Password); + Stream sreturn = request.GetStream(_Command + "streaminfo"); + XmlDocument xDoc = new XmlDocument(); + xDoc.Load(sreturn); + StreamInfoData streamInfo = new StreamInfoData(); + + + XmlNodeList streaminfo = xDoc.GetElementsByTagName("streaminfo"); + streamInfo.Agc = streaminfo.Item(0)["agc"].InnerText.Trim(); + streamInfo.Apid = streaminfo.Item(0)["apid"].InnerText.Trim(); + streamInfo.Ber = streaminfo.Item(0)["ber"].InnerText.Trim(); + streamInfo.Fec = streaminfo.Item(0)["fec"].InnerText.Trim(); + streamInfo.Frequency = streaminfo.Item(0)["frequency"].InnerText.Trim(); + streamInfo.FrontEnd = streaminfo.Item(0)["frontend"].InnerText.Trim(); + streamInfo.Inversion = streaminfo.Item(0)["inversion"].InnerText.Trim(); + streamInfo.Lock = streaminfo.Item(0)["lock"].InnerText.Trim(); + streamInfo.NameSpace = streaminfo.Item(0)["namespace"].InnerText.Trim(); + streamInfo.OnId = streaminfo.Item(0)["onid"].InnerText.Trim(); + streamInfo.PcrPid = streaminfo.Item(0)["pcrpid"].InnerText.Trim(); + streamInfo.Pmt = streaminfo.Item(0)["pmt"].InnerText.Trim(); + streamInfo.Polarisation = streaminfo.Item(0)["polarisation"].InnerText.Trim(); + streamInfo.Provider = streaminfo.Item(0)["provider"].InnerText.Trim(); + streamInfo.Satellite = streaminfo.Item(0)["satellite"].InnerText.Trim(); + streamInfo.ServiceName = streaminfo.Item(0)["service"].ChildNodes[0].InnerText.Trim(); + streamInfo.ServiceReference = streaminfo.Item(0)["service"].ChildNodes[1].InnerText.Trim(); + streamInfo.Sid = streaminfo.Item(0)["sid"].InnerText.Trim(); + streamInfo.Snr = streaminfo.Item(0)["snr"].InnerText.Trim(); + streamInfo.SupportedCryptSystems = streaminfo.Item(0)["supported_crypt_systems"].InnerText.Trim(); + streamInfo.SymbolRate = streaminfo.Item(0)["symbol_rate"].InnerText.Trim(); + streamInfo.Sync = streaminfo.Item(0)["sync"].InnerText.Trim(); + streamInfo.TPid = streaminfo.Item(0)["tpid"].InnerText.Trim(); + streamInfo.TsId = streaminfo.Item(0)["tsid"].InnerText.Trim(); + streamInfo.UsedCryptSystems = streaminfo.Item(0)["used_crypt_systems"].InnerText.Trim(); + streamInfo.VideoFormat = streaminfo.Item(0)["video_format"].InnerText.Trim(); + streamInfo.Vpid = streaminfo.Item(0)["vpid"].InnerText.Trim(); + return streamInfo; + + } + } + public CurrentServiceData CurrentService + { + get + { + Request request = new Request(_Url, _UserName, _Password); + Stream sreturn = request.GetStream(_Command + "currentservicedata"); + XmlDocument xDoc = new XmlDocument(); + xDoc.Load(sreturn); + XmlNodeList service = xDoc.GetElementsByTagName("service"); + XmlNodeList audiochannels = xDoc.GetElementsByTagName("audio_channels"); + XmlNodeList audiotrack = xDoc.GetElementsByTagName("audio_track"); + XmlNodeList videochannels = xDoc.GetElementsByTagName("video_channels"); + XmlNodeList currentevent = xDoc.GetElementsByTagName("current_event"); + XmlNodeList nextevent = xDoc.GetElementsByTagName("next_event"); + + CurrentServiceData currentServiceData = new CurrentServiceData(); + + // service + currentServiceData.ServiceName = service.Item(0)["name"].InnerText.Trim(); + currentServiceData.ServiceReference = service.Item(0)["reference"].InnerText.Trim(); + currentServiceData.AudioTrack = audiotrack.Item(0).InnerText.Trim(); + + // audiochannel + foreach (System.Xml.XmlElement el in audiochannels.Item(0).ChildNodes) + { + string name = el.GetElementsByTagName("name").Item(0).InnerText.Trim(); + string selected = el.GetElementsByTagName("selected").Item(0).InnerText.Trim(); + string pid = el.GetElementsByTagName("pid").Item(0).InnerText.Trim(); + ServiceDataChannel ac = new ServiceDataChannel(); + ac.Name = name; + if (selected == "1") { ac.Selected = true; } else ac.Selected = false; + ac.Pid = pid; + currentServiceData.AudioChannels.Add(ac); + } + // videochannel + foreach (System.Xml.XmlElement el in videochannels.Item(0).ChildNodes) + { + string name = el.GetElementsByTagName("name").Item(0).InnerText.Trim(); + string selected = el.GetElementsByTagName("selected").Item(0).InnerText.Trim(); + string pid = el.GetElementsByTagName("pid").Item(0).InnerText.Trim(); + ServiceDataChannel ac = new ServiceDataChannel(); + ac.Name = name; + if (selected == "1") { ac.Selected = true; } else ac.Selected = false; + ac.Pid = pid; + currentServiceData.VideoChannels.Add(ac); + } + + // current event + currentServiceData.CurrentEvent.Date = currentevent.Item(0)["date"].InnerText.Trim(); + currentServiceData.CurrentEvent.Time = currentevent.Item(0)["time"].InnerText.Trim(); + currentServiceData.CurrentEvent.Start = currentevent.Item(0)["start"].InnerText.Trim(); + currentServiceData.CurrentEvent.Duration = currentevent.Item(0)["duration"].InnerText.Trim(); + currentServiceData.CurrentEvent.Description = currentevent.Item(0)["description"].InnerText.Trim(); + currentServiceData.CurrentEvent.Details = currentevent.Item(0)["details"].InnerText.Trim(); + +... [truncated message content] |
From: <che...@us...> - 2008-04-21 23:23:31
|
Revision: 1692 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1692&view=rev Author: chef_koch Date: 2008-04-21 16:23:29 -0700 (Mon, 21 Apr 2008) Log Message: ----------- renamed several directories to get them better sorted alphabetical Added Paths: ----------- trunk/plugins/MyChess/ trunk/plugins/MyConnect4/ trunk/plugins/MyHexxagon/ trunk/plugins/MyMPlayer/ trunk/plugins/MyMPlayer/ExternalOSDLibrary/ trunk/plugins/MyMPlayer/MPlayer_ExtPlayer/ trunk/plugins/MyMPlayer/MPlayer_GUIPlugin/ trunk/plugins/MyMPlayer/MPlayer_Installer/ trunk/plugins/MyMPlayer/My MPlayer-License.txt trunk/plugins/MyMPlayer/My MPlayer.xmp trunk/plugins/MyMPlayer/My Mplayer.sln trunk/plugins/MyMinesweeper/ trunk/plugins/MyRefresh/ trunk/plugins/MyStreamradio/ trunk/plugins/MyStreamradio/Release/ trunk/plugins/MyStreamradio/Source/ trunk/plugins/MyStreamradio/StreamDir.jpg trunk/plugins/MyStreamradio/StreamFull.jpg trunk/plugins/MyStreamradio/StreamWindow.jpg trunk/plugins/MyStreamradio/readme.txt Removed Paths: ------------- trunk/plugins/My Chess/ trunk/plugins/My Connect4/ trunk/plugins/My Hexxagon/ trunk/plugins/My MPlayer/ trunk/plugins/My Minesweeper/ trunk/plugins/My Refresh/ trunk/plugins/My Streamradio/ trunk/plugins/MyMPlayer/ExternalOSDLibrary/ trunk/plugins/MyMPlayer/MPlayer_ExtPlayer/ trunk/plugins/MyMPlayer/MPlayer_GUIPlugin/ trunk/plugins/MyMPlayer/MPlayer_Installer/ trunk/plugins/MyMPlayer/My MPlayer-License.txt trunk/plugins/MyMPlayer/My MPlayer.xmp trunk/plugins/MyMPlayer/My Mplayer.sln trunk/plugins/MyStreamradio/Release/ trunk/plugins/MyStreamradio/Source/ trunk/plugins/MyStreamradio/StreamDir.jpg trunk/plugins/MyStreamradio/StreamFull.jpg trunk/plugins/MyStreamradio/StreamWindow.jpg trunk/plugins/MyStreamradio/readme.txt Copied: trunk/plugins/MyChess (from rev 1691, trunk/plugins/My Chess) Copied: trunk/plugins/MyConnect4 (from rev 1691, trunk/plugins/My Connect4) Copied: trunk/plugins/MyHexxagon (from rev 1691, trunk/plugins/My Hexxagon) Copied: trunk/plugins/MyMPlayer (from rev 1689, trunk/plugins/My MPlayer) Copied: trunk/plugins/MyMPlayer/ExternalOSDLibrary (from rev 1691, trunk/plugins/My MPlayer/ExternalOSDLibrary) Copied: trunk/plugins/MyMPlayer/MPlayer_ExtPlayer (from rev 1691, trunk/plugins/My MPlayer/MPlayer_ExtPlayer) Copied: trunk/plugins/MyMPlayer/MPlayer_GUIPlugin (from rev 1691, trunk/plugins/My MPlayer/MPlayer_GUIPlugin) Copied: trunk/plugins/MyMPlayer/MPlayer_Installer (from rev 1691, trunk/plugins/My MPlayer/MPlayer_Installer) Deleted: trunk/plugins/MyMPlayer/My MPlayer-License.txt =================================================================== --- trunk/plugins/My MPlayer/My MPlayer-License.txt 2008-04-21 21:46:12 UTC (rev 1689) +++ trunk/plugins/MyMPlayer/My MPlayer-License.txt 2008-04-21 23:23:29 UTC (rev 1692) @@ -1,96 +0,0 @@ -The plugin is licensed under the terms of the terms of the GNU General Public License as published by the Free Software Foundation, which is displayed below. You are only allowed to use this plugin if your with this plugin used version of MPlayer does not violate the laws of your country! - ------------------------------------------------------------ - - - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - - - Preamble - - The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. - - When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. - - We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. - - Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. - -You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. - - c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. - -If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. - - 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. - - 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. - -This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. - - 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS Copied: trunk/plugins/MyMPlayer/My MPlayer-License.txt (from rev 1691, trunk/plugins/My MPlayer/My MPlayer-License.txt) =================================================================== --- trunk/plugins/MyMPlayer/My MPlayer-License.txt (rev 0) +++ trunk/plugins/MyMPlayer/My MPlayer-License.txt 2008-04-21 23:23:29 UTC (rev 1692) @@ -0,0 +1,96 @@ +The plugin is licensed under the terms of the terms of the GNU General Public License as published by the Free Software Foundation, which is displayed below. You are only allowed to use this plugin if your with this plugin used version of MPlayer does not violate the laws of your country! + +----------------------------------------------------------- + + + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. + + + Preamble + + The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. + + When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. + + We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. + + Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. + +You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. + + c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. + +If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. + + 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. + + 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. + +This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. + + 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS Deleted: trunk/plugins/MyMPlayer/My MPlayer.xmp =================================================================== --- trunk/plugins/My MPlayer/My MPlayer.xmp 2008-04-21 21:46:12 UTC (rev 1689) +++ trunk/plugins/MyMPlayer/My MPlayer.xmp 2008-04-21 23:23:29 UTC (rev 1692) @@ -1,212 +0,0 @@ -<MPinstaler> - <ver>1.00.000</ver> - <FileList> - <File> - <FileName>ExternalOSDLibrary.dll</FileName> - <Type>Other</Type> - <SubType /> - <Source>ExternalOSDLibrary\bin\Release\ExternalOSDLibrary.dll</Source> - <Id>04010</Id> - <Option /> - <Guid>27bda5fd-3d23-47a0-a61f-fe4b74a666ef</Guid> - </File> - <File> - <FileName>ExternalOSDLibrary.dll</FileName> - <Type>Other</Type> - <SubType /> - <Source>ExternalOSDLibrary.dll</Source> - <Id>04010</Id> - <Option /> - <Guid>32781bff-ef5a-491d-a9ba-d7a6e06aaef2</Guid> - </File> - <File> - <FileName>MPlayer_ExtPlayer.dll</FileName> - <Type>Plugin</Type> - <SubType>External Player</SubType> - <Source>MPlayer_ExtPlayer\bin\Release\MPlayer_ExtPlayer.dll</Source> - <Id>01050</Id> - <Option /> - <Guid>1d322825-c79f-432f-9f96-39aceb300cbe</Guid> - </File> - <File> - <FileName>MPlayer_ExtPlayer.xml</FileName> - <Type>Other</Type> - <SubType>%Config%</SubType> - <Source>MPlayer_ExtPlayer\SampleConfiguration\MPlayer_ExtPlayer.xml</Source> - <Id>04010</Id> - <Option /> - <Guid>b9f36476-387d-4179-8e68-ddd2c66f62fe</Guid> - </File> - <File> - <FileName>MPlayer_GUIPlugin.dll</FileName> - <Type>Plugin</Type> - <SubType>Window</SubType> - <Source>MPlayer_GUIPlugin\bin\Release\MPlayer_GUIPlugin.dll</Source> - <Id>01010</Id> - <Option /> - <Guid>844ca32f-7462-44f8-b5ba-a49d0f05480a</Guid> - </File> - <File> - <FileName>MPlayer_GUIPlugin.xml</FileName> - <Type>Other</Type> - <SubType>%Config%</SubType> - <Source>MPlayer_GUIPlugin\SampleConfiguration\MPlayer_GUIPlugin.xml</Source> - <Id>04010</Id> - <Option /> - <Guid>24ce8fc9-20c1-471b-9a33-bc928f431956</Guid> - </File> - <File> - <FileName>MPlayer_Installer.dll</FileName> - <Type>Internal</Type> - <SubType>Plugin</SubType> - <Source>MPlayer_Installer\bin\Release\MPlayer_Installer.dll</Source> - <Id>07010</Id> - <Option /> - <Guid /> - </File> - <File> - <FileName>My MPlayer-License.txt</FileName> - <Type>Text</Type> - <SubType>EULA</SubType> - <Source>My MPlayer-License.txt</Source> - <Id>03010</Id> - <Option /> - <Guid>472d538b-55a9-43e7-9c79-009c2d1233e4</Guid> - </File> - <File> - <FileName>myMPlayer.xml</FileName> - <Type>Skin</Type> - <SubType>BlueTwo</SubType> - <Source>MPlayer_GUIPlugin\SkinFiles\BlueTwo 4x3\myMPlayer.xml</Source> - <Id>02010</Id> - <Option>OutputFileName=|DefaultFile=True|</Option> - <Guid>275210a5-e10f-481f-985c-2b7e127bc798</Guid> - </File> - <File> - <FileName>myMPlayer.xml</FileName> - <Type>Skin</Type> - <SubType>BlueTwo wide</SubType> - <Source>MPlayer_GUIPlugin\SkinFiles\BlueTwo 16x9\myMPlayer.xml</Source> - <Id>02010</Id> - <Option /> - <Guid>d5d4eb55-25b2-4180-b683-677be3e26f66</Guid> - </File> - <File> - <FileName>myMPlayer.xml</FileName> - <Type>Skin</Type> - <SubType>Project Mayhem 3</SubType> - <Source>MPlayer_GUIPlugin\SkinFiles\PM III\myMPlayer.xml</Source> - <Id>02010</Id> - <Option /> - <Guid>98c7e40a-21e5-4b8a-8a2b-a200ed35ae40</Guid> - </File> - <File> - <FileName>strings_de.xml</FileName> - <Type>Other</Type> - <SubType>%Language%\MPlayer</SubType> - <Source>MPlayer_ExtPlayer\Language\strings_de.xml</Source> - <Id>04010</Id> - <Option /> - <Guid>d8ce7cb4-c0c5-4e68-ad1f-fd0debde6d2a</Guid> - </File> - <File> - <FileName>strings_en.xml</FileName> - <Type>Other</Type> - <SubType>%Language%\MPlayer</SubType> - <Source>MPlayer_ExtPlayer\Language\strings_en.xml</Source> - <Id>04010</Id> - <Option /> - <Guid>7b4b9b76-e9b7-4992-9a19-f7d91ba2e1a3</Guid> - </File> - <File> - <FileName>strings_es.xml</FileName> - <Type>Other</Type> - <SubType>%Language%\MPlayer</SubType> - <Source>MPlayer_ExtPlayer\Language\strings_es.xml</Source> - <Id>04010</Id> - <Option /> - <Guid>c64828fc-4eb0-406f-b3a6-a80e03bbb9d3</Guid> - </File> - <File> - <FileName>strings_fr.xml</FileName> - <Type>Other</Type> - <SubType>%Language%\MPlayer</SubType> - <Source>MPlayer_ExtPlayer\Language\strings_fr.xml</Source> - <Id>04010</Id> - <Option /> - <Guid>d25b5af7-155e-40eb-9b68-4941adee9bac</Guid> - </File> - <File> - <FileName>strings_it.xml</FileName> - <Type>Other</Type> - <SubType>%Language%\MPlayer</SubType> - <Source>MPlayer_ExtPlayer\Language\strings_it.xml</Source> - <Id>04010</Id> - <Option /> - <Guid>e6b322b4-6ac5-42e9-b15d-76c316b243b9</Guid> - </File> - </FileList> - <StringList /> - <Actions /> - <SetupGroups> - <SetupGroup Id="1" Name="MP 0.2.3" /> - <SetupGroup Id="2" Name="MP 0.2.3 + SVN 16546 or higher (Improved performance)" /> - </SetupGroups> - <SetupGroupMappings> - <SetupGroupMapping Id="1" FileName="ExternalOSDLibrary.dll" /> - <SetupGroupMapping Id="1" FileName="MPlayer_ExtPlayer\bin\Release\MPlayer_ExtPlayer.dll" /> - <SetupGroupMapping Id="1" FileName="MPlayer_ExtPlayer\Language\strings_de.xml" /> - <SetupGroupMapping Id="1" FileName="MPlayer_ExtPlayer\Language\strings_en.xml" /> - <SetupGroupMapping Id="1" FileName="MPlayer_ExtPlayer\Language\strings_es.xml" /> - <SetupGroupMapping Id="1" FileName="MPlayer_ExtPlayer\Language\strings_fr.xml" /> - <SetupGroupMapping Id="1" FileName="MPlayer_ExtPlayer\Language\strings_it.xml" /> - <SetupGroupMapping Id="1" FileName="MPlayer_ExtPlayer\SampleConfiguration\MPlayer_ExtPlayer.xml" /> - <SetupGroupMapping Id="1" FileName="MPlayer_GUIPlugin\bin\Release\MPlayer_GUIPlugin.dll" /> - <SetupGroupMapping Id="1" FileName="MPlayer_GUIPlugin\SampleConfiguration\MPlayer_GUIPlugin.xml" /> - <SetupGroupMapping Id="1" FileName="MPlayer_GUIPlugin\SkinFiles\BlueTwo 16x9\myMPlayer.xml" /> - <SetupGroupMapping Id="1" FileName="MPlayer_GUIPlugin\SkinFiles\BlueTwo 4x3\myMPlayer.xml" /> - <SetupGroupMapping Id="1" FileName="MPlayer_GUIPlugin\SkinFiles\PM III\myMPlayer.xml" /> - <SetupGroupMapping Id="1" FileName="MPlayer_Installer\bin\Release\MPlayer_Installer.dll" /> - <SetupGroupMapping Id="1" FileName="My MPlayer-License.txt" /> - <SetupGroupMapping Id="2" FileName="ExternalOSDLibrary\bin\Release\ExternalOSDLibrary.dll" /> - <SetupGroupMapping Id="2" FileName="MPlayer_ExtPlayer\bin\Release\MPlayer_ExtPlayer.dll" /> - <SetupGroupMapping Id="2" FileName="MPlayer_ExtPlayer\Language\strings_de.xml" /> - <SetupGroupMapping Id="2" FileName="MPlayer_ExtPlayer\Language\strings_en.xml" /> - <SetupGroupMapping Id="2" FileName="MPlayer_ExtPlayer\Language\strings_es.xml" /> - <SetupGroupMapping Id="2" FileName="MPlayer_ExtPlayer\Language\strings_fr.xml" /> - <SetupGroupMapping Id="2" FileName="MPlayer_ExtPlayer\Language\strings_it.xml" /> - <SetupGroupMapping Id="2" FileName="MPlayer_ExtPlayer\SampleConfiguration\MPlayer_ExtPlayer.xml" /> - <SetupGroupMapping Id="2" FileName="MPlayer_GUIPlugin\bin\Release\MPlayer_GUIPlugin.dll" /> - <SetupGroupMapping Id="2" FileName="MPlayer_GUIPlugin\SampleConfiguration\MPlayer_GUIPlugin.xml" /> - <SetupGroupMapping Id="2" FileName="MPlayer_GUIPlugin\SkinFiles\BlueTwo 16x9\myMPlayer.xml" /> - <SetupGroupMapping Id="2" FileName="MPlayer_GUIPlugin\SkinFiles\BlueTwo 4x3\myMPlayer.xml" /> - <SetupGroupMapping Id="2" FileName="MPlayer_GUIPlugin\SkinFiles\PM III\myMPlayer.xml" /> - <SetupGroupMapping Id="2" FileName="MPlayer_Installer\bin\Release\MPlayer_Installer.dll" /> - <SetupGroupMapping Id="2" FileName="My MPlayer-License.txt" /> - </SetupGroupMappings> - <Option> - <BuildFileName>Z:\Source-MediaPortal\MP-Plugins\My MPlayer\My Mplayer.mpi</BuildFileName> - <ProiectFileName>Z:\Source-MediaPortal\MP-Plugins\My MPlayer\My MPlayer.xmp</ProiectFileName> - <ProiectName>My MPlayer</ProiectName> - <Author>MisterD</Author> - <UpdateURL>http://mpi.team-mediaportal.com</UpdateURL> - <Version>0.86</Version> - <Description>My MPlayer is an external player and window plugin that gives the user the ability to use MPlayer in MediaPortal. - -With the window plugin the user can play more medias like rtsp streams etc. than with the standard plugins of MP. It always uses MPlayer even if normally the internal players or an other external player is used by the other Plugins. - -This version also includes a new OSD, which simulates the OSD of MP.</Description> - <Group>Video/Movies</Group> - <Release>Stable </Release> - </Option> - <Properties> - <MPMaxVersion /> - <MPMinVersion>0.2.3</MPMinVersion> - <MinExtensionVersion /> - <MaxExtensionVersion /> - <ForumURL /> - <WebURL /> - <CreationDate>Monday, August 13, 2007 12:00:00 AM</CreationDate> - <SingleGroupSelect>True</SingleGroupSelect> - </Properties> -</MPinstaler> \ No newline at end of file Copied: trunk/plugins/MyMPlayer/My MPlayer.xmp (from rev 1691, trunk/plugins/My MPlayer/My MPlayer.xmp) =================================================================== --- trunk/plugins/MyMPlayer/My MPlayer.xmp (rev 0) +++ trunk/plugins/MyMPlayer/My MPlayer.xmp 2008-04-21 23:23:29 UTC (rev 1692) @@ -0,0 +1,212 @@ +<MPinstaler> + <ver>1.00.000</ver> + <FileList> + <File> + <FileName>ExternalOSDLibrary.dll</FileName> + <Type>Other</Type> + <SubType /> + <Source>ExternalOSDLibrary\bin\Release\ExternalOSDLibrary.dll</Source> + <Id>04010</Id> + <Option /> + <Guid>27bda5fd-3d23-47a0-a61f-fe4b74a666ef</Guid> + </File> + <File> + <FileName>ExternalOSDLibrary.dll</FileName> + <Type>Other</Type> + <SubType /> + <Source>ExternalOSDLibrary.dll</Source> + <Id>04010</Id> + <Option /> + <Guid>32781bff-ef5a-491d-a9ba-d7a6e06aaef2</Guid> + </File> + <File> + <FileName>MPlayer_ExtPlayer.dll</FileName> + <Type>Plugin</Type> + <SubType>External Player</SubType> + <Source>MPlayer_ExtPlayer\bin\Release\MPlayer_ExtPlayer.dll</Source> + <Id>01050</Id> + <Option /> + <Guid>1d322825-c79f-432f-9f96-39aceb300cbe</Guid> + </File> + <File> + <FileName>MPlayer_ExtPlayer.xml</FileName> + <Type>Other</Type> + <SubType>%Config%</SubType> + <Source>MPlayer_ExtPlayer\SampleConfiguration\MPlayer_ExtPlayer.xml</Source> + <Id>04010</Id> + <Option /> + <Guid>b9f36476-387d-4179-8e68-ddd2c66f62fe</Guid> + </File> + <File> + <FileName>MPlayer_GUIPlugin.dll</FileName> + <Type>Plugin</Type> + <SubType>Window</SubType> + <Source>MPlayer_GUIPlugin\bin\Release\MPlayer_GUIPlugin.dll</Source> + <Id>01010</Id> + <Option /> + <Guid>844ca32f-7462-44f8-b5ba-a49d0f05480a</Guid> + </File> + <File> + <FileName>MPlayer_GUIPlugin.xml</FileName> + <Type>Other</Type> + <SubType>%Config%</SubType> + <Source>MPlayer_GUIPlugin\SampleConfiguration\MPlayer_GUIPlugin.xml</Source> + <Id>04010</Id> + <Option /> + <Guid>24ce8fc9-20c1-471b-9a33-bc928f431956</Guid> + </File> + <File> + <FileName>MPlayer_Installer.dll</FileName> + <Type>Internal</Type> + <SubType>Plugin</SubType> + <Source>MPlayer_Installer\bin\Release\MPlayer_Installer.dll</Source> + <Id>07010</Id> + <Option /> + <Guid /> + </File> + <File> + <FileName>My MPlayer-License.txt</FileName> + <Type>Text</Type> + <SubType>EULA</SubType> + <Source>My MPlayer-License.txt</Source> + <Id>03010</Id> + <Option /> + <Guid>472d538b-55a9-43e7-9c79-009c2d1233e4</Guid> + </File> + <File> + <FileName>myMPlayer.xml</FileName> + <Type>Skin</Type> + <SubType>BlueTwo</SubType> + <Source>MPlayer_GUIPlugin\SkinFiles\BlueTwo 4x3\myMPlayer.xml</Source> + <Id>02010</Id> + <Option>OutputFileName=|DefaultFile=True|</Option> + <Guid>275210a5-e10f-481f-985c-2b7e127bc798</Guid> + </File> + <File> + <FileName>myMPlayer.xml</FileName> + <Type>Skin</Type> + <SubType>BlueTwo wide</SubType> + <Source>MPlayer_GUIPlugin\SkinFiles\BlueTwo 16x9\myMPlayer.xml</Source> + <Id>02010</Id> + <Option /> + <Guid>d5d4eb55-25b2-4180-b683-677be3e26f66</Guid> + </File> + <File> + <FileName>myMPlayer.xml</FileName> + <Type>Skin</Type> + <SubType>Project Mayhem 3</SubType> + <Source>MPlayer_GUIPlugin\SkinFiles\PM III\myMPlayer.xml</Source> + <Id>02010</Id> + <Option /> + <Guid>98c7e40a-21e5-4b8a-8a2b-a200ed35ae40</Guid> + </File> + <File> + <FileName>strings_de.xml</FileName> + <Type>Other</Type> + <SubType>%Language%\MPlayer</SubType> + <Source>MPlayer_ExtPlayer\Language\strings_de.xml</Source> + <Id>04010</Id> + <Option /> + <Guid>d8ce7cb4-c0c5-4e68-ad1f-fd0debde6d2a</Guid> + </File> + <File> + <FileName>strings_en.xml</FileName> + <Type>Other</Type> + <SubType>%Language%\MPlayer</SubType> + <Source>MPlayer_ExtPlayer\Language\strings_en.xml</Source> + <Id>04010</Id> + <Option /> + <Guid>7b4b9b76-e9b7-4992-9a19-f7d91ba2e1a3</Guid> + </File> + <File> + <FileName>strings_es.xml</FileName> + <Type>Other</Type> + <SubType>%Language%\MPlayer</SubType> + <Source>MPlayer_ExtPlayer\Language\strings_es.xml</Source> + <Id>04010</Id> + <Option /> + <Guid>c64828fc-4eb0-406f-b3a6-a80e03bbb9d3</Guid> + </File> + <File> + <FileName>strings_fr.xml</FileName> + <Type>Other</Type> + <SubType>%Language%\MPlayer</SubType> + <Source>MPlayer_ExtPlayer\Language\strings_fr.xml</Source> + <Id>04010</Id> + <Option /> + <Guid>d25b5af7-155e-40eb-9b68-4941adee9bac</Guid> + </File> + <File> + <FileName>strings_it.xml</FileName> + <Type>Other</Type> + <SubType>%Language%\MPlayer</SubType> + <Source>MPlayer_ExtPlayer\Language\strings_it.xml</Source> + <Id>04010</Id> + <Option /> + <Guid>e6b322b4-6ac5-42e9-b15d-76c316b243b9</Guid> + </File> + </FileList> + <StringList /> + <Actions /> + <SetupGroups> + <SetupGroup Id="1" Name="MP 0.2.3" /> + <SetupGroup Id="2" Name="MP 0.2.3 + SVN 16546 or higher (Improved performance)" /> + </SetupGroups> + <SetupGroupMappings> + <SetupGroupMapping Id="1" FileName="ExternalOSDLibrary.dll" /> + <SetupGroupMapping Id="1" FileName="MPlayer_ExtPlayer\bin\Release\MPlayer_ExtPlayer.dll" /> + <SetupGroupMapping Id="1" FileName="MPlayer_ExtPlayer\Language\strings_de.xml" /> + <SetupGroupMapping Id="1" FileName="MPlayer_ExtPlayer\Language\strings_en.xml" /> + <SetupGroupMapping Id="1" FileName="MPlayer_ExtPlayer\Language\strings_es.xml" /> + <SetupGroupMapping Id="1" FileName="MPlayer_ExtPlayer\Language\strings_fr.xml" /> + <SetupGroupMapping Id="1" FileName="MPlayer_ExtPlayer\Language\strings_it.xml" /> + <SetupGroupMapping Id="1" FileName="MPlayer_ExtPlayer\SampleConfiguration\MPlayer_ExtPlayer.xml" /> + <SetupGroupMapping Id="1" FileName="MPlayer_GUIPlugin\bin\Release\MPlayer_GUIPlugin.dll" /> + <SetupGroupMapping Id="1" FileName="MPlayer_GUIPlugin\SampleConfiguration\MPlayer_GUIPlugin.xml" /> + <SetupGroupMapping Id="1" FileName="MPlayer_GUIPlugin\SkinFiles\BlueTwo 16x9\myMPlayer.xml" /> + <SetupGroupMapping Id="1" FileName="MPlayer_GUIPlugin\SkinFiles\BlueTwo 4x3\myMPlayer.xml" /> + <SetupGroupMapping Id="1" FileName="MPlayer_GUIPlugin\SkinFiles\PM III\myMPlayer.xml" /> + <SetupGroupMapping Id="1" FileName="MPlayer_Installer\bin\Release\MPlayer_Installer.dll" /> + <SetupGroupMapping Id="1" FileName="My MPlayer-License.txt" /> + <SetupGroupMapping Id="2" FileName="ExternalOSDLibrary\bin\Release\ExternalOSDLibrary.dll" /> + <SetupGroupMapping Id="2" FileName="MPlayer_ExtPlayer\bin\Release\MPlayer_ExtPlayer.dll" /> + <SetupGroupMapping Id="2" FileName="MPlayer_ExtPlayer\Language\strings_de.xml" /> + <SetupGroupMapping Id="2" FileName="MPlayer_ExtPlayer\Language\strings_en.xml" /> + <SetupGroupMapping Id="2" FileName="MPlayer_ExtPlayer\Language\strings_es.xml" /> + <SetupGroupMapping Id="2" FileName="MPlayer_ExtPlayer\Language\strings_fr.xml" /> + <SetupGroupMapping Id="2" FileName="MPlayer_ExtPlayer\Language\strings_it.xml" /> + <SetupGroupMapping Id="2" FileName="MPlayer_ExtPlayer\SampleConfiguration\MPlayer_ExtPlayer.xml" /> + <SetupGroupMapping Id="2" FileName="MPlayer_GUIPlugin\bin\Release\MPlayer_GUIPlugin.dll" /> + <SetupGroupMapping Id="2" FileName="MPlayer_GUIPlugin\SampleConfiguration\MPlayer_GUIPlugin.xml" /> + <SetupGroupMapping Id="2" FileName="MPlayer_GUIPlugin\SkinFiles\BlueTwo 16x9\myMPlayer.xml" /> + <SetupGroupMapping Id="2" FileName="MPlayer_GUIPlugin\SkinFiles\BlueTwo 4x3\myMPlayer.xml" /> + <SetupGroupMapping Id="2" FileName="MPlayer_GUIPlugin\SkinFiles\PM III\myMPlayer.xml" /> + <SetupGroupMapping Id="2" FileName="MPlayer_Installer\bin\Release\MPlayer_Installer.dll" /> + <SetupGroupMapping Id="2" FileName="My MPlayer-License.txt" /> + </SetupGroupMappings> + <Option> + <BuildFileName>Z:\Source-MediaPortal\MP-Plugins\My MPlayer\My Mplayer.mpi</BuildFileName> + <ProiectFileName>Z:\Source-MediaPortal\MP-Plugins\My MPlayer\My MPlayer.xmp</ProiectFileName> + <ProiectName>My MPlayer</ProiectName> + <Author>MisterD</Author> + <UpdateURL>http://mpi.team-mediaportal.com</UpdateURL> + <Version>0.86</Version> + <Description>My MPlayer is an external player and window plugin that gives the user the ability to use MPlayer in MediaPortal. + +With the window plugin the user can play more medias like rtsp streams etc. than with the standard plugins of MP. It always uses MPlayer even if normally the internal players or an other external player is used by the other Plugins. + +This version also includes a new OSD, which simulates the OSD of MP.</Description> + <Group>Video/Movies</Group> + <Release>Stable </Release> + </Option> + <Properties> + <MPMaxVersion /> + <MPMinVersion>0.2.3</MPMinVersion> + <MinExtensionVersion /> + <MaxExtensionVersion /> + <ForumURL /> + <WebURL /> + <CreationDate>Monday, August 13, 2007 12:00:00 AM</CreationDate> + <SingleGroupSelect>True</SingleGroupSelect> + </Properties> +</MPinstaler> \ No newline at end of file Deleted: trunk/plugins/MyMPlayer/My Mplayer.sln =================================================================== --- trunk/plugins/My MPlayer/My Mplayer.sln 2008-04-21 21:46:12 UTC (rev 1689) +++ trunk/plugins/MyMPlayer/My Mplayer.sln 2008-04-21 23:23:29 UTC (rev 1692) @@ -1,38 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MPlayer_ExtPlayer", "MPlayer_ExtPlayer\MPlayer_ExtPlayer.csproj", "{77254E2B-4032-495A-AF2D-1804AB2127EF}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MPlayer_GUIPlugin", "MPlayer_GUIPlugin\MPlayer_GUIPlugin.csproj", "{53898324-E882-4D37-86C1-E4696B248A13}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExternalOSDLibrary", "ExternalOSDLibrary\ExternalOSDLibrary.csproj", "{CA1C8C7D-4AB2-4D8D-87E9-AB9FC970A8C7}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MPlayer_Installer", "MPlayer_Installer\MPlayer_Installer.csproj", "{BB0EE0B3-0BC4-4337-8DA5-3AEFC8E42547}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {77254E2B-4032-495A-AF2D-1804AB2127EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {77254E2B-4032-495A-AF2D-1804AB2127EF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {77254E2B-4032-495A-AF2D-1804AB2127EF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {77254E2B-4032-495A-AF2D-1804AB2127EF}.Release|Any CPU.Build.0 = Release|Any CPU - {53898324-E882-4D37-86C1-E4696B248A13}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {53898324-E882-4D37-86C1-E4696B248A13}.Debug|Any CPU.Build.0 = Debug|Any CPU - {53898324-E882-4D37-86C1-E4696B248A13}.Release|Any CPU.ActiveCfg = Release|Any CPU - {53898324-E882-4D37-86C1-E4696B248A13}.Release|Any CPU.Build.0 = Release|Any CPU - {CA1C8C7D-4AB2-4D8D-87E9-AB9FC970A8C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CA1C8C7D-4AB2-4D8D-87E9-AB9FC970A8C7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CA1C8C7D-4AB2-4D8D-87E9-AB9FC970A8C7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CA1C8C7D-4AB2-4D8D-87E9-AB9FC970A8C7}.Release|Any CPU.Build.0 = Release|Any CPU - {BB0EE0B3-0BC4-4337-8DA5-3AEFC8E42547}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BB0EE0B3-0BC4-4337-8DA5-3AEFC8E42547}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BB0EE0B3-0BC4-4337-8DA5-3AEFC8E42547}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BB0EE0B3-0BC4-4337-8DA5-3AEFC8E42547}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal Copied: trunk/plugins/MyMPlayer/My Mplayer.sln (from rev 1691, trunk/plugins/My MPlayer/My Mplayer.sln) =================================================================== --- trunk/plugins/MyMPlayer/My Mplayer.sln (rev 0) +++ trunk/plugins/MyMPlayer/My Mplayer.sln 2008-04-21 23:23:29 UTC (rev 1692) @@ -0,0 +1,38 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MPlayer_ExtPlayer", "MPlayer_ExtPlayer\MPlayer_ExtPlayer.csproj", "{77254E2B-4032-495A-AF2D-1804AB2127EF}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MPlayer_GUIPlugin", "MPlayer_GUIPlugin\MPlayer_GUIPlugin.csproj", "{53898324-E882-4D37-86C1-E4696B248A13}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExternalOSDLibrary", "ExternalOSDLibrary\ExternalOSDLibrary.csproj", "{CA1C8C7D-4AB2-4D8D-87E9-AB9FC970A8C7}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MPlayer_Installer", "MPlayer_Installer\MPlayer_Installer.csproj", "{BB0EE0B3-0BC4-4337-8DA5-3AEFC8E42547}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {77254E2B-4032-495A-AF2D-1804AB2127EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {77254E2B-4032-495A-AF2D-1804AB2127EF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {77254E2B-4032-495A-AF2D-1804AB2127EF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {77254E2B-4032-495A-AF2D-1804AB2127EF}.Release|Any CPU.Build.0 = Release|Any CPU + {53898324-E882-4D37-86C1-E4696B248A13}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {53898324-E882-4D37-86C1-E4696B248A13}.Debug|Any CPU.Build.0 = Debug|Any CPU + {53898324-E882-4D37-86C1-E4696B248A13}.Release|Any CPU.ActiveCfg = Release|Any CPU + {53898324-E882-4D37-86C1-E4696B248A13}.Release|Any CPU.Build.0 = Release|Any CPU + {CA1C8C7D-4AB2-4D8D-87E9-AB9FC970A8C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CA1C8C7D-4AB2-4D8D-87E9-AB9FC970A8C7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CA1C8C7D-4AB2-4D8D-87E9-AB9FC970A8C7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CA1C8C7D-4AB2-4D8D-87E9-AB9FC970A8C7}.Release|Any CPU.Build.0 = Release|Any CPU + {BB0EE0B3-0BC4-4337-8DA5-3AEFC8E42547}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BB0EE0B3-0BC4-4337-8DA5-3AEFC8E42547}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BB0EE0B3-0BC4-4337-8DA5-3AEFC8E42547}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BB0EE0B3-0BC4-4337-8DA5-3AEFC8E42547}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal Copied: trunk/plugins/MyMinesweeper (from rev 1691, trunk/plugins/My Minesweeper) Copied: trunk/plugins/MyRefresh (from rev 1691, trunk/plugins/My Refresh) Copied: trunk/plugins/MyStreamradio (from rev 1689, trunk/plugins/My Streamradio) Copied: trunk/plugins/MyStreamradio/Release (from rev 1691, trunk/plugins/My Streamradio/Release) Copied: trunk/plugins/MyStreamradio/Source (from rev 1691, trunk/plugins/My Streamradio/Source) Deleted: trunk/plugins/MyStreamradio/StreamDir.jpg =================================================================== (Binary files differ) Copied: trunk/plugins/MyStreamradio/StreamDir.jpg (from rev 1691, trunk/plugins/My Streamradio/StreamDir.jpg) =================================================================== (Binary files differ) Deleted: trunk/plugins/MyStreamradio/StreamFull.jpg =================================================================== (Binary files differ) Copied: trunk/plugins/MyStreamradio/StreamFull.jpg (from rev 1691, trunk/plugins/My Streamradio/StreamFull.jpg) =================================================================== (Binary files differ) Deleted: trunk/plugins/MyStreamradio/StreamWindow.jpg =================================================================== (Binary files differ) Copied: trunk/plugins/MyStreamradio/StreamWindow.jpg (from rev 1691, trunk/plugins/My Streamradio/StreamWindow.jpg) =================================================================== (Binary files differ) Deleted: trunk/plugins/MyStreamradio/readme.txt =================================================================== --- trunk/plugins/My Streamradio/readme.txt 2008-04-21 21:46:12 UTC (rev 1689) +++ trunk/plugins/MyStreamradio/readme.txt 2008-04-21 23:23:29 UTC (rev 1692) @@ -1,181 +0,0 @@ -My streamradio -------------------- - -Hi there, - -I had some trouble with radio station playing tiscali streams. -Well..... here is my work arround. - -I used part from My Radio to built a stream radio. -Now radio stations like saw or radio hamburg work. - -You can use the visualisation from vlc which is configurable in the setup. The title and artist is displayed automaticly every time a change is detected (not on all streams) - -Also you can record the actual stream to disk (mp3) . The actual artist and title will be saved to the record path. So you can later on cut the mp3 ;-) - -This Version is for the 0.2.3.0 - -http://forum.team-mediaportal.com/plugins-47/my-streamradio-22803/ - -Install vlc with the option ActiveX -Put the folder streamradio onto your hdd -Copy the skin file into the skin folder -Copy the dll into the plugins folder -Copy the VLC dll into the MP root folder - -Setup the plugin, set the folder and set the OSD. - -Keyboard R Record - X Toggle Windowed / Fullscreen - P Play / Radion on - B Stop Play - - F9 show info - -Greetz -kroko - - - -INSTALL -------- -Install vlc w... [truncated message content] |
From: <an...@us...> - 2008-04-24 16:41:09
|
Revision: 1704 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1704&view=rev Author: and-81 Date: 2008-04-24 09:39:14 -0700 (Thu, 24 Apr 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/Translator/Program.cs trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/RawInput.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Keyboard.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Mouse.cs trunk/plugins/IR Server Suite/IR Server Suite.sln trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/MacroEditor.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MPControlPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/MacroEditor.cs trunk/plugins/IR Server Suite/setup/setup.nsi trunk/plugins/MCEReplacement/MCEReplacement.cs trunk/plugins/PlayOnStart/PlayOnStart.cs trunk/plugins/TelnetInterface/TelnetInterface.cs Added Paths: ----------- trunk/plugins/IR Server Suite/IR Server Plugins/Imon USB Receivers/ trunk/plugins/IR Server Suite/IR Server Plugins/Imon USB Receivers/Configuration.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/Imon USB Receivers/Configuration.cs trunk/plugins/IR Server Suite/IR Server Plugins/Imon USB Receivers/Configuration.resx trunk/plugins/IR Server Suite/IR Server Plugins/Imon USB Receivers/Icon.ico trunk/plugins/IR Server Suite/IR Server Plugins/Imon USB Receivers/Imon USB Receivers.cs trunk/plugins/IR Server Suite/IR Server Plugins/Imon USB Receivers/Imon USB Receivers.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Imon USB Receivers/Keyboard.cs trunk/plugins/IR Server Suite/IR Server Plugins/Imon USB Receivers/Mouse.cs trunk/plugins/IR Server Suite/IR Server Plugins/Imon USB Receivers/Properties/ trunk/plugins/IR Server Suite/IR Server Plugins/Imon USB Receivers/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/Imon USB Receivers/Properties/Resources.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/Imon USB Receivers/Properties/Resources.resx trunk/plugins/IR Server Suite/IR Server Plugins/Imon USB Receivers/RawInput.cs trunk/plugins/IR Server Suite/IR Server Plugins/Imon USB Receivers/ReceiverWindow.cs trunk/plugins/IR Server Suite/Input Service/Input Service/Abstract Remote Maps/iMon USB Receivers/ trunk/plugins/IR Server Suite/Input Service/Input Service/Abstract Remote Maps/iMon USB Receivers/Imon Front Panel.xml trunk/plugins/IR Server Suite/Input Service/Input Service/Abstract Remote Maps/iMon USB Receivers/Imon PAD.xml trunk/plugins/IR Server Suite/Input Service/Input Service/Abstract Remote Maps/iMon USB Receivers/Imon Volume Knob.xml trunk/plugins/IR Server Suite/Input Service/Input Service/Abstract Remote Maps/iMon USB Receivers/Microsoft MCE.xml Modified: trunk/plugins/IR Server Suite/Applications/Translator/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2008-04-24 16:33:56 UTC (rev 1703) +++ trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2008-04-24 16:39:14 UTC (rev 1704) @@ -186,7 +186,7 @@ _notifyIcon.Icon = Properties.Resources.Icon16Connecting; _notifyIcon.Text = "Translator - Connecting ..."; _notifyIcon.DoubleClick += new EventHandler(ClickSetup); - _notifyIcon.Visible = false; + _notifyIcon.Visible = !_config.HideTrayIcon; // Setup the main form ... _mainForm = new MainForm(); @@ -223,8 +223,6 @@ IrssLog.Error("Error enabling CopyData messages: {0}", ex.ToString()); } - _notifyIcon.Visible = !_config.HideTrayIcon; - Application.Run(); if (_copyDataWM != null) Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/RawInput.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/RawInput.cs 2008-04-24 16:33:56 UTC (rev 1703) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/RawInput.cs 2008-04-24 16:39:14 UTC (rev 1704) @@ -165,7 +165,7 @@ public enum RawInputCommand { Input = 0x10000003, - Header = 0x10000005 + Header = 0x10000005, } [Flags()] Property changes on: trunk/plugins/IR Server Suite/IR Server Plugins/Imon USB Receivers ___________________________________________________________________ Name: svn:ignore + bin obj Added: trunk/plugins/IR Server Suite/IR Server Plugins/Imon USB Receivers/Configuration.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Imon USB Receivers/Configuration.Designer.cs (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Imon USB Receivers/Configuration.Designer.cs 2008-04-24 16:39:14 UTC (rev 1704) @@ -0,0 +1,556 @@ +namespace InputService.Plugin +{ + + partial class Configuration + { + + /// <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(); + this.labelButtonRepeatDelay = new System.Windows.Forms.Label(); + this.labelButtonHeldDelay = new System.Windows.Forms.Label(); + this.numericUpDownButtonRepeatDelay = new System.Windows.Forms.NumericUpDown(); + this.numericUpDownButtonHeldDelay = new System.Windows.Forms.NumericUpDown(); + this.buttonOK = new System.Windows.Forms.Button(); + this.buttonCancel = new System.Windows.Forms.Button(); + this.groupBoxRemoteTiming = new System.Windows.Forms.GroupBox(); + this.toolTips = new System.Windows.Forms.ToolTip(this.components); + this.numericUpDownKeyHeldDelay = new System.Windows.Forms.NumericUpDown(); + this.numericUpDownKeyRepeatDelay = new System.Windows.Forms.NumericUpDown(); + this.checkBoxHandleKeyboardLocal = new System.Windows.Forms.CheckBox(); + this.checkBoxHandleMouseLocal = new System.Windows.Forms.CheckBox(); + this.numericUpDownMouseSensitivity = new System.Windows.Forms.NumericUpDown(); + this.checkBoxEnableRemote = new System.Windows.Forms.CheckBox(); + this.checkBoxEnableKeyboard = new System.Windows.Forms.CheckBox(); + this.checkBoxEnableMouse = new System.Windows.Forms.CheckBox(); + this.checkBoxUseSystemRatesRemote = new System.Windows.Forms.CheckBox(); + this.checkBoxUseSystemRatesKeyboard = new System.Windows.Forms.CheckBox(); + this.comboBoxHardwareMode = new System.Windows.Forms.ComboBox(); + this.tabControl = new System.Windows.Forms.TabControl(); + this.tabPageRemote = new System.Windows.Forms.TabPage(); + this.labelHardwareMode = new System.Windows.Forms.Label(); + this.tabPageKeyboard = new System.Windows.Forms.TabPage(); + this.groupBoxKeypressTiming = new System.Windows.Forms.GroupBox(); + this.labelKeyRepeatDelay = new System.Windows.Forms.Label(); + this.labelKeyHeldDelay = new System.Windows.Forms.Label(); + this.tabPageMouse = new System.Windows.Forms.TabPage(); + this.labelMouseSensitivity = new System.Windows.Forms.Label(); + this.comboBoxRemoteMode = new System.Windows.Forms.ComboBox(); + this.labelRemoteMode = new System.Windows.Forms.Label(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownButtonRepeatDelay)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownButtonHeldDelay)).BeginInit(); + this.groupBoxRemoteTiming.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownKeyHeldDelay)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownKeyRepeatDelay)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownMouseSensitivity)).BeginInit(); + this.tabControl.SuspendLayout(); + this.tabPageRemote.SuspendLayout(); + this.tabPageKeyboard.SuspendLayout(); + this.groupBoxKeypressTiming.SuspendLayout(); + this.tabPageMouse.SuspendLayout(); + this.SuspendLayout(); + // + // labelButtonRepeatDelay + // + this.labelButtonRepeatDelay.Location = new System.Drawing.Point(8, 24); + this.labelButtonRepeatDelay.Name = "labelButtonRepeatDelay"; + this.labelButtonRepeatDelay.Size = new System.Drawing.Size(128, 20); + this.labelButtonRepeatDelay.TabIndex = 0; + this.labelButtonRepeatDelay.Text = "Button repeat delay:"; + this.labelButtonRepeatDelay.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // labelButtonHeldDelay + // + this.labelButtonHeldDelay.Location = new System.Drawing.Point(8, 56); + this.labelButtonHeldDelay.Name = "labelButtonHeldDelay"; + this.labelButtonHeldDelay.Size = new System.Drawing.Size(128, 20); + this.labelButtonHeldDelay.TabIndex = 2; + this.labelButtonHeldDelay.Text = "Button held delay:"; + this.labelButtonHeldDelay.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // numericUpDownButtonRepeatDelay + // + this.numericUpDownButtonRepeatDelay.Increment = new decimal(new int[] { + 50, + 0, + 0, + 0}); + this.numericUpDownButtonRepeatDelay.Location = new System.Drawing.Point(144, 24); + this.numericUpDownButtonRepeatDelay.Maximum = new decimal(new int[] { + 10000, + 0, + 0, + 0}); + this.numericUpDownButtonRepeatDelay.Name = "numericUpDownButtonRepeatDelay"; + this.numericUpDownButtonRepeatDelay.Size = new System.Drawing.Size(80, 20); + this.numericUpDownButtonRepeatDelay.TabIndex = 1; + this.numericUpDownButtonRepeatDelay.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.numericUpDownButtonRepeatDelay.ThousandsSeparator = true; + this.toolTips.SetToolTip(this.numericUpDownButtonRepeatDelay, "When the button is held this is the time between the first press and the first re" + + "peat"); + this.numericUpDownButtonRepeatDelay.Value = new decimal(new int[] { + 10000, + 0, + 0, + 0}); + // + // numericUpDownButtonHeldDelay + // + this.numericUpDownButtonHeldDelay.Increment = new decimal(new int[] { + 50, + 0, + 0, + 0}); + this.numericUpDownButtonHeldDelay.Location = new System.Drawing.Point(144, 56); + this.numericUpDownButtonHeldDelay.Maximum = new decimal(new int[] { + 10000, + 0, + 0, + 0}); + this.numericUpDownButtonHeldDelay.Name = "numericUpDownButtonHeldDelay"; + this.numericUpDownButtonHeldDelay.Size = new System.Drawing.Size(80, 20); + this.numericUpDownButtonHeldDelay.TabIndex = 3; + this.numericUpDownButtonHeldDelay.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.numericUpDownButtonHeldDelay.ThousandsSeparator = true; + this.toolTips.SetToolTip(this.numericUpDownButtonHeldDelay, "When the button is held this is the time between repeats"); + this.numericUpDownButtonHeldDelay.Value = new decimal(new int[] { + 10000, + 0, + 0, + 0}); + // + // buttonOK + // + this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonOK.Location = new System.Drawing.Point(128, 263); + this.buttonOK.Name = "buttonOK"; + this.buttonOK.Size = new System.Drawing.Size(64, 24); + this.buttonOK.TabIndex = 1; + this.buttonOK.Text = "OK"; + this.buttonOK.UseVisualStyleBackColor = true; + this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); + // + // buttonCancel + // + this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.buttonCancel.Location = new System.Drawing.Point(200, 263); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.Size = new System.Drawing.Size(64, 24); + this.buttonCancel.TabIndex = 2; + this.buttonCancel.Text = "Cancel"; + this.buttonCancel.UseVisualStyleBackColor = true; + this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); + // + // groupBoxRemoteTiming + // + this.groupBoxRemoteTiming.Controls.Add(this.labelButtonRepeatDelay); + this.groupBoxRemoteTiming.Controls.Add(this.numericUpDownButtonHeldDelay); + this.groupBoxRemoteTiming.Controls.Add(this.labelButtonHeldDelay); + this.groupBoxRemoteTiming.Controls.Add(this.numericUpDownButtonRepeatDelay); + this.groupBoxRemoteTiming.Location = new System.Drawing.Point(8, 72); + this.groupBoxRemoteTiming.Name = "groupBoxRemoteTiming"; + this.groupBoxRemoteTiming.Size = new System.Drawing.Size(232, 88); + this.groupBoxRemoteTiming.TabIndex = 2; + this.groupBoxRemoteTiming.TabStop = false; + this.groupBoxRemoteTiming.Text = "Remote button timing (in milliseconds)"; + // + // numericUpDownKeyHeldDelay + // + this.numericUpDownKeyHeldDelay.Increment = new decimal(new int[] { + 50, + 0, + 0, + 0}); + this.numericUpDownKeyHeldDelay.Location = new System.Drawing.Point(144, 56); + this.numericUpDownKeyHeldDelay.Maximum = new decimal(new int[] { + 1000, + 0, + 0, + 0}); + this.numericUpDownKeyHeldDelay.Name = "numericUpDownKeyHeldDelay"; + this.numericUpDownKeyHeldDelay.Size = new System.Drawing.Size(80, 20); + this.numericUpDownKeyHeldDelay.TabIndex = 4; + this.numericUpDownKeyHeldDelay.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.numericUpDownKeyHeldDelay.ThousandsSeparator = true; + this.toolTips.SetToolTip(this.numericUpDownKeyHeldDelay, "When a key is held this is the time between repeats"); + this.numericUpDownKeyHeldDelay.Value = new decimal(new int[] { + 1000, + 0, + 0, + 0}); + // + // numericUpDownKeyRepeatDelay + // + this.numericUpDownKeyRepeatDelay.Increment = new decimal(new int[] { + 50, + 0, + 0, + 0}); + this.numericUpDownKeyRepeatDelay.Location = new System.Drawing.Point(144, 24); + this.numericUpDownKeyRepeatDelay.Maximum = new decimal(new int[] { + 1000, + 0, + 0, + 0}); + this.numericUpDownKeyRepeatDelay.Name = "numericUpDownKeyRepeatDelay"; + this.numericUpDownKeyRepeatDelay.Size = new System.Drawing.Size(80, 20); + this.numericUpDownKeyRepeatDelay.TabIndex = 2; + this.numericUpDownKeyRepeatDelay.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.numericUpDownKeyRepeatDelay.ThousandsSeparator = true; + this.toolTips.SetToolTip(this.numericUpDownKeyRepeatDelay, "When a key is held this is the time between the first press and the first repeat"); + this.numericUpDownKeyRepeatDelay.Value = new decimal(new int[] { + 1000, + 0, + 0, + 0}); + // + // checkBoxHandleKeyboardLocal + // + this.checkBoxHandleKeyboardLocal.AutoSize = true; + this.checkBoxHandleKeyboardLocal.Checked = true; + this.checkBoxHandleKeyboardLocal.CheckState = System.Windows.Forms.CheckState.Checked; + this.checkBoxHandleKeyboardLocal.Location = new System.Drawing.Point(8, 168); + this.checkBoxHandleKeyboardLocal.Name = "checkBoxHandleKeyboardLocal"; + this.checkBoxHandleKeyboardLocal.Size = new System.Drawing.Size(139, 17); + this.checkBoxHandleKeyboardLocal.TabIndex = 2; + this.checkBoxHandleKeyboardLocal.Text = "Handle keyboard locally"; + this.toolTips.SetToolTip(this.checkBoxHandleKeyboardLocal, "Act on key presses locally (on the machine Input Servie is running on)"); + this.checkBoxHandleKeyboardLocal.UseVisualStyleBackColor = true; + // + // checkBoxHandleMouseLocal + // + this.checkBoxHandleMouseLocal.AutoSize = true; + this.checkBoxHandleMouseLocal.Checked = true; + this.checkBoxHandleMouseLocal.CheckState = System.Windows.Forms.CheckState.Checked; + this.checkBoxHandleMouseLocal.Location = new System.Drawing.Point(8, 40); + this.checkBoxHandleMouseLocal.Name = "checkBoxHandleMouseLocal"; + this.checkBoxHandleMouseLocal.Size = new System.Drawing.Size(126, 17); + this.checkBoxHandleMouseLocal.TabIndex = 1; + this.checkBoxHandleMouseLocal.Text = "Handle mouse locally"; + this.toolTips.SetToolTip(this.checkBoxHandleMouseLocal, "Act on mouse locally (on the machine Input Service is running on)"); + this.checkBoxHandleMouseLocal.UseVisualStyleBackColor = true; + // + // numericUpDownMouseSensitivity + // + this.numericUpDownMouseSensitivity.DecimalPlaces = 1; + this.numericUpDownMouseSensitivity.Increment = new decimal(new int[] { + 1, + 0, + 0, + 65536}); + this.numericUpDownMouseSensitivity.Location = new System.Drawing.Point(160, 80); + this.numericUpDownMouseSensitivity.Maximum = new decimal(new int[] { + 10, + 0, + 0, + 0}); + this.numericUpDownMouseSensitivity.Minimum = new decimal(new int[] { + 10, + 0, + 0, + -2147483648}); + this.numericUpDownMouseSensitivity.Name = "numericUpDownMouseSensitivity"; + this.numericUpDownMouseSensitivity.Size = new System.Drawing.Size(80, 20); + this.numericUpDownMouseSensitivity.TabIndex = 3; + this.numericUpDownMouseSensitivity.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.toolTips.SetToolTip(this.numericUpDownMouseSensitivity, "Multiply mouse movements by this number"); + this.numericUpDownMouseSensitivity.Value = new decimal(new int[] { + 10, + 0, + 0, + 65536}); + // + // checkBoxEnableRemote + // + this.checkBoxEnableRemote.AutoSize = true; + this.checkBoxEnableRemote.Checked = true; + this.checkBoxEnableRemote.CheckState = System.Windows.Forms.CheckState.Checked; + this.checkBoxEnableRemote.Location = new System.Drawing.Point(8, 8); + this.checkBoxEnableRemote.Name = "checkBoxEnableRemote"; + this.checkBoxEnableRemote.Size = new System.Drawing.Size(155, 17); + this.checkBoxEnableRemote.TabIndex = 0; + this.checkBoxEnableRemote.Text = "Enable remote control input"; + this.toolTips.SetToolTip(this.checkBoxEnableRemote, "Decode remote control button presses"); + this.checkBoxEnableRemote.UseVisualStyleBackColor = true; + // + // checkBoxEnableKeyboard + // + this.checkBoxEnableKeyboard.AutoSize = true; + this.checkBoxEnableKeyboard.Checked = true; + this.checkBoxEnableKeyboard.CheckState = System.Windows.Forms.CheckState.Checked; + this.checkBoxEnableKeyboard.Location = new System.Drawing.Point(8, 8); + this.checkBoxEnableKeyboard.Name = "checkBoxEnableKeyboard"; + this.checkBoxEnableKeyboard.Size = new System.Drawing.Size(132, 17); + this.checkBoxEnableKeyboard.TabIndex = 0; + this.checkBoxEnableKeyboard.Text = "Enable keyboard input"; + this.toolTips.SetToolTip(this.checkBoxEnableKeyboard, "Decode remote keyboard input"); + this.checkBoxEnableKeyboard.UseVisualStyleBackColor = true; + // + // checkBoxEnableMouse + // + this.checkBoxEnableMouse.AutoSize = true; + this.checkBoxEnableMouse.Checked = true; + this.checkBoxEnableMouse.CheckState = System.Windows.Forms.CheckState.Checked; + this.checkBoxEnableMouse.Location = new System.Drawing.Point(8, 8); + this.checkBoxEnableMouse.Name = "checkBoxEnableMouse"; + this.checkBoxEnableMouse.Size = new System.Drawing.Size(119, 17); + this.checkBoxEnableMouse.TabIndex = 0; + this.checkBoxEnableMouse.Text = "Enable mouse input"; + this.toolTips.SetToolTip(this.checkBoxEnableMouse, "Decode remote mouse input"); + this.checkBoxEnableMouse.UseVisualStyleBackColor = true; + // + // checkBoxUseSystemRatesRemote + // + this.checkBoxUseSystemRatesRemote.AutoSize = true; + this.checkBoxUseSystemRatesRemote.Location = new System.Drawing.Point(8, 40); + this.checkBoxUseSystemRatesRemote.Name = "checkBoxUseSystemRatesRemote"; + this.checkBoxUseSystemRatesRemote.Size = new System.Drawing.Size(187, 17); + this.checkBoxUseSystemRatesRemote.TabIndex = 1; + this.checkBoxUseSystemRatesRemote.Text = "Use system keyboard rate settings"; + this.toolTips.SetToolTip(this.checkBoxUseSystemRatesRemote, "Use the system keyboard repeat rate settings for remote button timing"); + this.checkBoxUseSystemRatesRemote.UseVisualStyleBackColor = true; + // + // checkBoxUseSystemRatesKeyboard + // + this.checkBoxUseSystemRatesKeyboard.AutoSize = true; + this.checkBoxUseSystemRatesKeyboard.Location = new System.Drawing.Point(8, 40); + this.checkBoxUseSystemRatesKeyboard.Name = "checkBoxUseSystemRatesKeyboard"; + this.checkBoxUseSystemRatesKeyboard.Size = new System.Drawing.Size(187, 17); + this.checkBoxUseSystemRatesKeyboard.TabIndex = 0; + this.checkBoxUseSystemRatesKeyboard.Text = "Use system keyboard rate settings"; + this.toolTips.SetToolTip(this.checkBoxUseSystemRatesKeyboard, "Use the system keyboard repeat rate settings for remote keyboard repeat rates"); + this.checkBoxUseSystemRatesKeyboard.UseVisualStyleBackColor = true; + // + // comboBoxHardwareMode + // + this.comboBoxHardwareMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBoxHardwareMode.FormattingEnabled = true; + this.comboBoxHardwareMode.Location = new System.Drawing.Point(152, 168); + this.comboBoxHardwareMode.Name = "comboBoxHardwareMode"; + this.comboBoxHardwareMode.Size = new System.Drawing.Size(89, 21); + this.comboBoxHardwareMode.TabIndex = 4; + this.toolTips.SetToolTip(this.comboBoxHardwareMode, "Choose between MCE and iMon remote types"); + // + // tabControl + // + this.tabControl.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.tabControl.Controls.Add(this.tabPageRemote); + this.tabControl.Controls.Add(this.tabPageKeyboard); + this.tabControl.Controls.Add(this.tabPageMouse); + this.tabControl.Location = new System.Drawing.Point(8, 8); + this.tabControl.Name = "tabControl"; + this.tabControl.SelectedIndex = 0; + this.tabControl.Size = new System.Drawing.Size(256, 247); + this.tabControl.TabIndex = 0; + // + // tabPageRemote + // + this.tabPageRemote.Controls.Add(this.comboBoxRemoteMode); + this.tabPageRemote.Controls.Add(this.labelRemoteMode); + this.tabPageRemote.Controls.Add(this.comboBoxHardwareMode); + this.tabPageRemote.Controls.Add(this.labelHardwareMode); + this.tabPageRemote.Controls.Add(this.checkBoxUseSystemRatesRemote); + this.tabPageRemote.Controls.Add(this.checkBoxEnableRemote); + this.tabPageRemote.Controls.Add(this.groupBoxRemoteTiming); + this.tabPageRemote.Location = new System.Drawing.Point(4, 22); + this.tabPageRemote.Name = "tabPageRemote"; + this.tabPageRemote.Padding = new System.Windows.Forms.Padding(3); + this.tabPageRemote.Size = new System.Drawing.Size(248, 221); + this.tabPageRemote.TabIndex = 1; + this.tabPageRemote.Text = "Remote"; + this.tabPageRemote.UseVisualStyleBackColor = true; + // + // labelHardwareMode + // + this.labelHardwareMode.Location = new System.Drawing.Point(8, 168); + this.labelHardwareMode.Name = "labelHardwareMode"; + this.labelHardwareMode.Size = new System.Drawing.Size(136, 21); + this.labelHardwareMode.TabIndex = 3; + this.labelHardwareMode.Text = "Hardware mode:"; + this.labelHardwareMode.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // tabPageKeyboard + // + this.tabPageKeyboard.Controls.Add(this.checkBoxUseSystemRatesKeyboard); + this.tabPageKeyboard.Controls.Add(this.checkBoxHandleKeyboardLocal); + this.tabPageKeyboard.Controls.Add(this.checkBoxEnableKeyboard); + this.tabPageKeyboard.Controls.Add(this.groupBoxKeypressTiming); + this.tabPageKeyboard.Location = new System.Drawing.Point(4, 22); + this.tabPageKeyboard.Name = "tabPageKeyboard"; + this.tabPageKeyboard.Padding = new System.Windows.Forms.Padding(3); + this.tabPageKeyboard.Size = new System.Drawing.Size(248, 221); + this.tabPageKeyboard.TabIndex = 2; + this.tabPageKeyboard.Text = "Keyboard"; + this.tabPageKeyboard.UseVisualStyleBackColor = true; + // + // groupBoxKeypressTiming + // + this.groupBoxKeypressTiming.Controls.Add(this.labelKeyRepeatDelay); + this.groupBoxKeypressTiming.Controls.Add(this.numericUpDownKeyHeldDelay); + this.groupBoxKeypressTiming.Controls.Add(this.labelKeyHeldDelay); + this.groupBoxKeypressTiming.Controls.Add(this.numericUpDownKeyRepeatDelay); + this.groupBoxKeypressTiming.Location = new System.Drawing.Point(8, 72); + this.groupBoxKeypressTiming.Name = "groupBoxKeypressTiming"; + this.groupBoxKeypressTiming.Size = new System.Drawing.Size(232, 88); + this.groupBoxKeypressTiming.TabIndex = 1; + this.groupBoxKeypressTiming.TabStop = false; + this.groupBoxKeypressTiming.Text = "Key press timing (in milliseconds)"; + // + // labelKeyRepeatDelay + // + this.labelKeyRepeatDelay.Location = new System.Drawing.Point(8, 24); + this.labelKeyRepeatDelay.Name = "labelKeyRepeatDelay"; + this.labelKeyRepeatDelay.Size = new System.Drawing.Size(128, 20); + this.labelKeyRepeatDelay.TabIndex = 1; + this.labelKeyRepeatDelay.Text = "Key repeat delay:"; + this.labelKeyRepeatDelay.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // labelKeyHeldDelay + // + this.labelKeyHeldDelay.Location = new System.Drawing.Point(8, 56); + this.labelKeyHeldDelay.Name = "labelKeyHeldDelay"; + this.labelKeyHeldDelay.Size = new System.Drawing.Size(128, 20); + this.labelKeyHeldDelay.TabIndex = 3; + this.labelKeyHeldDelay.Text = "Key held delay:"; + this.labelKeyHeldDelay.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // tabPageMouse + // + this.tabPageMouse.Controls.Add(this.labelMouseSensitivity); + this.tabPageMouse.Controls.Add(this.numericUpDownMouseSensitivity); + this.tabPageMouse.Controls.Add(this.checkBoxHandleMouseLocal); + this.tabPageMouse.Controls.Add(this.checkBoxEnableMouse); + this.tabPageMouse.Location = new System.Drawing.Point(4, 22); + this.tabPageMouse.Name = "tabPageMouse"; + this.tabPageMouse.Padding = new System.Windows.Forms.Padding(3); + this.tabPageMouse.Size = new System.Drawing.Size(248, 221); + this.tabPageMouse.TabIndex = 3; + this.tabPageMouse.Text = "Mouse"; + this.tabPageMouse.UseVisualStyleBackColor = true; + // + // labelMouseSensitivity + // + this.labelMouseSensitivity.Location = new System.Drawing.Point(8, 80); + this.labelMouseSensitivity.Name = "labelMouseSensitivity"; + this.labelMouseSensitivity.Size = new System.Drawing.Size(144, 20); + this.labelMouseSensitivity.TabIndex = 2; + this.labelMouseSensitivity.Text = "Mouse sensitivity:"; + this.labelMouseSensitivity.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // comboBoxRemoteMode + // + this.comboBoxRemoteMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBoxRemoteMode.FormattingEnabled = true; + this.comboBoxRemoteMode.Location = new System.Drawing.Point(152, 194); + this.comboBoxRemoteMode.Name = "comboBoxRemoteMode"; + this.comboBoxRemoteMode.Size = new System.Drawing.Size(89, 21); + this.comboBoxRemoteMode.TabIndex = 6; + this.toolTips.SetToolTip(this.comboBoxRemoteMode, "Choose between MCE and iMon remote types"); + // + // labelRemoteMode + // + this.labelRemoteMode.Location = new System.Drawing.Point(8, 194); + this.labelRemoteMode.Name = "labelRemoteMode"; + this.labelRemoteMode.Size = new System.Drawing.Size(136, 21); + this.labelRemoteMode.TabIndex = 5; + this.labelRemoteMode.Text = "Remote MouseStick mode:"; + this.labelRemoteMode.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // AdvancedSettings + // + this.AcceptButton = this.buttonOK; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.buttonCancel; + this.ClientSize = new System.Drawing.Size(272, 295); + this.Controls.Add(this.tabControl); + this.Controls.Add(this.buttonCancel); + this.Controls.Add(this.buttonOK); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.MinimumSize = new System.Drawing.Size(280, 306); + this.Name = "AdvancedSettings"; + this.ShowIcon = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "iMon Configuration"; + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownButtonRepeatDelay)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownButtonHeldDelay)).EndInit(); + this.groupBoxRemoteTiming.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownKeyHeldDelay)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownKeyRepeatDelay)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownMouseSensitivity)).EndInit(); + this.tabControl.ResumeLayout(false); + this.tabPageRemote.ResumeLayout(false); + this.tabPageRemote.PerformLayout(); + this.tabPageKeyboard.ResumeLayout(false); + this.tabPageKeyboard.PerformLayout(); + this.groupBoxKeypressTiming.ResumeLayout(false); + this.tabPageMouse.ResumeLayout(false); + this.tabPageMouse.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Label labelButtonRepeatDelay; + private System.Windows.Forms.Label labelButtonHeldDelay; + private System.Windows.Forms.NumericUpDown numericUpDownButtonRepeatDelay; + private System.Windows.Forms.NumericUpDown numericUpDownButtonHeldDelay; + private System.Windows.Forms.Button buttonOK; + private System.Windows.Forms.Button buttonCancel; + private System.Windows.Forms.GroupBox groupBoxRemoteTiming; + private System.Windows.Forms.ToolTip toolTips; + private System.Windows.Forms.TabControl tabControl; + private System.Windows.Forms.TabPage tabPageRemote; + private System.Windows.Forms.CheckBox checkBoxEnableRemote; + private System.Windows.Forms.TabPage tabPageKeyboard; + private System.Windows.Forms.GroupBox groupBoxKeypressTiming; + private System.Windows.Forms.Label labelKeyRepeatDelay; + private System.Windows.Forms.NumericUpDown numericUpDownKeyHeldDelay; + private System.Windows.Forms.Label labelKeyHeldDelay; + private System.Windows.Forms.NumericUpDown numericUpDownKeyRepeatDelay; + private System.Windows.Forms.CheckBox checkBoxHandleKeyboardLocal; + private System.Windows.Forms.CheckBox checkBoxEnableKeyboard; + private System.Windows.Forms.TabPage tabPageMouse; + private System.Windows.Forms.Label labelMouseSensitivity; + private System.Windows.Forms.NumericUpDown numericUpDownMouseSensitivity; + private System.Windows.Forms.CheckBox checkBoxHandleMouseLocal; + private System.Windows.Forms.CheckBox checkBoxEnableMouse; + private System.Windows.Forms.CheckBox checkBoxUseSystemRatesRemote; + private System.Windows.Forms.CheckBox checkBoxUseSystemRatesKeyboard; + private System.Windows.Forms.ComboBox comboBoxHardwareMode; + private System.Windows.Forms.Label labelHardwareMode; + private System.Windows.Forms.ComboBox comboBoxRemoteMode; + private System.Windows.Forms.Label labelRemoteMode; + + } + +} Added: trunk/plugins/IR Server Suite/IR Server Plugins/Imon USB Receivers/Configuration.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Imon USB Receivers/Configuration.cs (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Imon USB Receivers/Configuration.cs 2008-04-24 16:39:14 UTC (rev 1704) @@ -0,0 +1,110 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace InputService.Plugin +{ + + partial class Configuration : Form + { + + public iMonUSBReceivers.RcMode HardwareMode + { + get { return (iMonUSBReceivers.RcMode)Enum.Parse(typeof(iMonUSBReceivers.RcMode), comboBoxHardwareMode.SelectedItem as string); } + set { comboBoxHardwareMode.SelectedItem = Enum.GetName(typeof(iMonUSBReceivers.RcMode), value); } + } + + public iMonUSBReceivers.RemoteMode RemoteMode + { + get { return (iMonUSBReceivers.RemoteMode)Enum.Parse(typeof(iMonUSBReceivers.RemoteMode), comboBoxRemoteMode.SelectedItem as string); } + set { comboBoxRemoteMode.SelectedItem = Enum.GetName(typeof(iMonUSBReceivers.RemoteMode), value); } + } + + public bool EnableRemote + { + get { return checkBoxEnableRemote.Checked; } + set { checkBoxEnableRemote.Checked = value; } + } + public bool UseSystemRatesForRemote + { + get { return checkBoxUseSystemRatesRemote.Checked; } + set { checkBoxUseSystemRatesRemote.Checked = value; } + } + public int RemoteRepeatDelay + { + get { return Decimal.ToInt32(numericUpDownButtonRepeatDelay.Value); } + set { numericUpDownButtonRepeatDelay.Value = new Decimal(value); } + } + public int RemoteHeldDelay + { + get { return Decimal.ToInt32(numericUpDownButtonHeldDelay.Value); } + set { numericUpDownButtonHeldDelay.Value = new Decimal(value); } + } + + public bool EnableKeyboard + { + get { return checkBoxEnableKeyboard.Checked; } + set { checkBoxEnableKeyboard.Checked = value; } + } + public bool UseSystemRatesForKeyboard + { + get { return checkBoxUseSystemRatesKeyboard.Checked; } + set { checkBoxUseSystemRatesKeyboard.Checked = value; } + } + public int KeyboardRepeatDelay + { + get { return Decimal.ToInt32(numericUpDownKeyRepeatDelay.Value); } + set { numericUpDownKeyRepeatDelay.Value = new Decimal(value); } + } + public int KeyboardHeldDelay + { + get { return Decimal.ToInt32(numericUpDownKeyHeldDelay.Value); } + set { numericUpDownKeyHeldDelay.Value = new Decimal(value); } + } + public bool HandleKeyboardLocal + { + get { return checkBoxHandleKeyboardLocal.Checked; } + set { checkBoxHandleKeyboardLocal.Checked = value; } + } + + public bool EnableMouse + { + get { return checkBoxEnableMouse.Checked; } + set { checkBoxEnableMouse.Checked = value; } + } + public double MouseSensitivity + { + get { return Decimal.ToDouble(numericUpDownMouseSensitivity.Value); } + set { numericUpDownMouseSensitivity.Value = new Decimal(value); } + } + public bool HandleMouseLocal + { + get { return checkBoxHandleMouseLocal.Checked; } + set { checkBoxHandleMouseLocal.Checked = value; } + } + + public Configuration() + { + InitializeComponent(); + comboBoxHardwareMode.Items.AddRange(Enum.GetNames(typeof(iMonUSBReceivers.RcMode))); + comboBoxRemoteMode.Items.AddRange(Enum.GetNames(typeof(iMonUSBReceivers.RemoteMode))); + } + + private void buttonOK_Click(object sender, EventArgs e) + { + this.DialogResult = DialogResult.OK; + this.Close(); + } + + private void buttonCancel_Click(object sender, EventArgs e) + { + this.DialogResult = DialogResult.Cancel; + this.Close(); + } + + } + +} Added: trunk/plugins/IR Server Suite/IR Server Plugins/Imon USB Receivers/Configuration.resx =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Imon USB Receivers/Configuration.resx (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Imon USB Receivers/Configuration.resx 2008-04-24 16:39:14 UTC (rev 1704) @@ -0,0 +1,123 @@ +<?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="toolTips.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>17, 17</value> + </metadata> +</root> \ No newline at end of file Added: trunk/plugins/IR Server Suite/IR Server Plugins/Imon USB Receivers/Icon.ico =================================================================== (Binary files differ) Property changes on: trunk/plugins/IR Server Suite/IR Server Plugins/Imon USB Receivers/Icon.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/IR Server Suite/IR Server Plugins/Imon USB Receivers/Imon USB Receivers.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Imon USB Receivers/Imon USB Receivers.cs (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Imon USB Receivers/Imon USB Receivers.cs 2008-04-24 16:39:14 UTC (rev 1704) @@ -0,0 +1,3974 @@ +//#define TEST_APPLICATION +//#define DEBUG +//#define DISABLE_DEVICE_FILTER +//#define DEBUG_FAKE_KEYBOARD +//#define DEBUG_FAKE_MOUSE +//#define DEBUG_FAKE_HID + +using System; +using System.ComponentModel; +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics; +using System.Drawing; +using System.IO; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading; +using System.Windows.Forms; +using System.Xml; +using Microsoft.Win32; +using Microsoft.Win32.SafeHandles; + +namespace InputService.Plugin +{ + + /// <summary> + /// IR Server plugin to support iMon USB devices. + /// </summary> + public partial class iMonUSBReceivers : PluginBase, IConfigure, IRemoteReceiver, IKeyboardReceiver, IMouseReceiver, IDisposable + { + #region Code to impliment the test application version of the plugin + // #define TEST_APPLICATION in the project properties when creating the console test app ... +#if TEST_APPLICATION + + #region Test Application - Enumeration for KeyCode Translation + /// <summary> + /// Remote Key Mapping (for displaying the remote button names). + /// </summary> + internal enum iMonRemoteKeyMapping + { + // iMon PAD mappings + IMON_PAD_BUTTON_APPEXIT = 1002, + IMON_PAD_BUTTON_POWER = 1016, + IMON_PAD_BUTTON_RECORD = 1064, + IMON_PAD_BUTTON_PLAY = 1128, + IMON_PAD_BUTTON_EJECT = 1114, + IMON_PAD_BUTTON_REWIND = 1130, + IMON_PAD_BUTTON_PAUSE = 1144, + IMON_PAD_BUTTON_FORWARD = 1192, + IMON_PAD_BUTTON_REPLAY = 1208, + IMON_PAD_BUTTON_STOP = 1220, + IMON_PAD_BUTTON_SKIP = 1066, + + IMON_PAD_BUTTON_BACKSPACE = 1032, + IMON_PAD_BUTTON_MOUSE_KEYBD = 1080, + IMON_PAD_BUTTON_SELECT_SPACE = 1148, + IMON_PAD_BUTTON_WINKEY = 1194, + IMON_PAD_BUTTON_MENUKEY = 1060, + + IMON_PAD_BUTTON_LEFTCLICK = 1226, + IMON_PAD_BUTTON_RIGHTCLICK = 1228, + + IMON_PAD_BUTTON_ENTER = 1034, + IMON_PAD_BUTTON_ESC = 1252, + IMON_PAD_BUTTON_EJECT2 = 1086, + IMON_PAD_BUTTON_APPLAUNCH = 1124, + IMON_PAD_BUTTON_GREENBUTTON = 1178, + IMON_PAD_BUTTON_TASKSWITCH = 1150, + + IMON_PAD_BUTTON_MUTE = 1218, + IMON_PAD_BUTTON_VOLUME_UP = 1038, + IMON_PAD_BUTTON_CHANNEL_UP = 1022, + IMON_PAD_BUTTON_TIMER = 1198, + IMON_PAD_BUTTON_VOLUME_DOWN = 1042, + IMON_PAD_BUTTON_CHANNEL_DOWN = 1014, + + IMON_PAD_BUTTON_NUMPAD_1 = 1058, + IMON_PAD_BUTTON_NUMPAD_2 = 1242, + IMON_PAD_BUTTON_NUMPAD_3 = 1050, + IMON_PAD_BUTTON_NUMPAD_4 = 1138, + IMON_PAD_BUTTON_NUMPAD_5 = 1090, + IMON_PAD_BUTTON_NUMPAD_6 = 1170, + IMON_PAD_BUTTON_NUMPAD_7 = 1214, + IMON_PAD_BUTTON_NUMPAD_8 = 1136, + IMON_PAD_BUTTON_NUMPAD_9 = 1160, + IMON_PAD_BUTTON_NUMPAD_STAR = 1056, + IMON_PAD_BUTTON_NUMPAD_0 = 1234, + IMON_PAD_BUTTON_NUMPAD_HASH = 1096, + + IMON_PAD_BUTTON_MY_MOVIE = 1200, + IMON_PAD_BUTTON_MY_MUSIC = 1082, + IMON_PAD_BUTTON_MY_PHOTO = 1224, + IMON_PAD_BUTTON_MY_TV = 1040, + IMON_PAD_BUTTON_BOOKMARK = 1008, + IMON_PAD_BUTTON_THUMBNAIL = 1188, + IMON_PAD_BUTTON_ASPECT_RATIO = 1106, + IMON_PAD_BUTTON_FULLSCREEN = 1166, + IMON_PAD_BUTTON_MY_DVD = 1102, + IMON_PAD_BUTTON_MENU = 1230, + IMON_PAD_BUTTON_CAPTION = 1074, + IMON_PAD_BUTTON_LANGUAGE = 1202, + + + IMON_PAD_BUTTON_RIGHT = 1244, + IMON_PAD_BUTTON_LEFT = 1246, + IMON_PAD_BUTTON_DOWN = 1248, + IMON_PAD_BUTTON_UP = 1250, + + IMON_MCE_BUTTON_POWER_TV = 2101, + IMON_MCE_BUTTON_RECORD = 2023, + IMON_MCE_BUTTON_STOP = 2025, + IMON_MCE_BUTTON_PAUSE = 2024, + IMON_MCE_BUTTON_REWIND = 2021, + IMON_MCE_BUTTON_PLAY = 2022, + IMON_MCE_BUTTON_FORWARD = 2020, + IMON_MCE_BUTTON_REPLAY = 2027, + IMON_MCE_BUTTON_SKIP = 2026, + IMON_MCE_BUTTON_BACK = 2035, + IMON_MCE_BUTTON_UP = 2030, + IMON_MCE_BUTTON_DOWN = 2031, + IMON_MCE_BUTTON_LEFT = 2032, + IMON_MCE_BUTTON_RIGHT = 2033, + IMON_MCE_BUTTON_OK = 2034, + IMON_MCE_BUTTON_INFO = 2015, + IMON_MCE_BUTTON_VOLUME_UP = 2016, + IMON_MCE_BUTTON_VOLUME_DOWN = 2017, + IMON_MCE_BUTTON_START = 2013, + IMON_MCE_BUTTON_CHANNEL_UP = 2018, + IMON_MCE_BUTTON_CHANNEL_DOWN = 2019, + IMON_MCE_BUTTON_MUTE = 2014, + IMON_MCE_BUTTON_RECORDED_TV = 2072, + IMON_MCE_BUTTON_GUIDE = 2038, + IMON_MCE_BUTTON_LIVE_TV = 2037, + IMON_MCE_BUTTON_DVD_MENU = 2036, + IMON_MCE_BUTTON_NUMPAD_1 = 2001, + IMON_MCE_BUTTON_NUMPAD_2 = 2002, + IMON_MCE_BUTTON_NUMPAD_3 = 2003, + IMON_MCE_BUTTON_NUMPAD_4 = 2004, + IMON_MCE_BUTTON_NUMPAD_5 = 2005, + IMON_MCE_BUTTON_NUMPAD_6 = 2006, + IMON_MCE_BUTTON_NUMPAD_7 = 2007, + IMON_MCE_BUTTON_NUMPAD_8 = 2008, + IMON_MCE_BUTTON_NUMPAD_9 = 2009, + IMON_MCE_BUTTON_NUMPAD_0 = 2000, + IMON_MCE_BUTTON_NUMPAD_STAR = 2029, + IMON_MCE_BUTTON_NUMPAD_HASH = 2028, + IMON_MCE_BUTTON_CLEAR = 2010, + IMON_MCE_BUTTON_ENTER = 2011, + IMON_MCE_BUTTON_TELETEXT = 2090, + IMON_MCE_BUTTON_RED = 2091, + IMON_MCE_BUTTON_GREEN = 2092, + IMON_MCE_BUTTON_YELLOW = 2093, + IMON_MCE_BUTTON_BLUE = 2094, + IMON_MCE_BUTTON_MY_TV = 2070, + IMON_MCE_BUTTON_MY_MUSIC = 2071, + IMON_MCE_BUTTON_MY_PICTURES = 2073, + IMON_MCE_BUTTON_MY_VIDEOS = 2074, + IMON_MCE_BUTTON_MY_RADIO = 2080, + IMON_MCE_BUTTON_MESSENGER = 2105, + IMON_MCE_BUTTON_ASPECT_RATIO = 2012, + IMON_MCE_BUTTON_PRINT = 2078, + + IMON_PANEL_BUTTON = 3000, + + IMON_PANEL_BUTTON_VOLUME_KNOB = 3001, + IMON_PANEL_BUTTON_MCE = 3015, + IMON_PANEL_BUTTON_APPEXIT = 3043, + IMON_PANEL_BUTTON_BACK = 3023, + IMON_PANEL_BUTTON_UP = 3018, + IMON_PANEL_BUTTON_ENTER = 3022, + IMON_PANEL_BUTTON_START = 3044, + IMON_PANEL_BUTTON_MENU = 3045, + IMON_PANEL_BUTTON_LEFT = 3020, + IMON_PANEL_BUTTON_DOWN = 3019, + IMON_PANEL_BUTTON_RIGHT = 3021, + + IMON_VOLUME_UP = 4001, + IMON_VOLUME_DOWN = 4002, + } + #endregion + + static void xRemote_HID(string deviceName, string code) + { + Console.WriteLine("iMon HID Remote: {0} (button = {1})\n", code, Enum.GetName(typeof(iMonRemoteKeyMapping), Enum.Parse(typeof(iMonRemoteKeyMapping), code))); +#if DEBUG + DebugWriteLine("iMon HID Remote: {0} (button = {1})\n", code, Enum.GetName(typeof(iMonRemoteKeyMapping), Enum.Parse(typeof(iMonRemoteKeyMapping), code))); +#endif + } + + static void xRemote_DOS(string deviceName, string code) + { + Console.WriteLine("iMon DOS Remote: {0} (button = {1})\n", code, Enum.GetName(typeof(iMonRemoteKeyMapping), Enum.Parse(typeof(iMonRemoteKeyMapping), code))); +#if DEBUG + DebugWriteLine("iMon DOS Remote: {0} (button = {1})\n", code, Enum.GetName(typeof(iMonRemoteKeyMapping), Enum.Parse(typeof(iMonRemoteKeyMapping), code))); +#endif + } + + static void xKeyboard_HID(string deviceName, int button, bool up) + { + Console.WriteLine("iMon HID Keyboard: {0}, {1} (key = {2})\n", button, (up ? "Released" : "Pressed"), Enum.GetName(typeof(iMonRemoteKeyMapping), Enum.Parse(typeof(iMonRemoteKeyMapping), button.ToString()))); +#if DEBUG + DebugWriteLine("iMon HID Keyboard: {0}, {1} (key = {2})\n", button, (up ? "Released" : "Pressed"), Enum.GetName(typeof(iMonRemoteKeyMapping), Enum.Parse(typeof(iMonRemoteKeyMapping), button.ToString()))); +#endif + } + + static void xKeyboard_DOS(string deviceName, int button, bool up) + { + Console.WriteLine("iMon DOS Keyboard: {0}, {1} (key = {2})\n", button, (up ? "Released" : "Pressed"), Enum.GetName(typeof(iMonRemoteKeyMapping), Enum.Parse(typeof(iMonRemoteKeyMapping), button.ToString()))); +#if DEBUG + DebugWriteLine("iMon DOS Keyboard: {0}, {1} (key = {2})\n", button, (up ? "Released" : "Pressed"), Enum.GetName(typeof(iMonRemoteKeyMapping), Enum.Parse(typeof(iMonRemoteKeyMapping), button.ToString()))); +#endif + } + + static void xMouse_HID(string deviceName, int x, int y, int buttons) + { + Console.WriteLine("iMon HID Mouse: ({0}, {1}) - {2}\n", x, y, buttons); +#if DEBUG + DebugWriteLine("iMon HID Mouse: ({0}, {1}) - {2}\n", x, y, buttons); +#endif + } + + static void xMouse_DOS(string deviceName, int x, int y, int buttons) + { + Console.WriteLine("iMon DOS Mouse: ({0}, {1}) - {2}\n", x, y, buttons); +#if DEBUG + DebugWriteLine("iMon DOS Mouse: ({0}, {1}) - {2}\n", x, y, buttons); +#endif + } + + [STAThread] + static void Main() + { +#if DEBUG + DebugOpen("iMonTestApp.log"); + DebugWriteLine("Main()"); +#endif + + DeviceType DevType; + + iMonUSBReceiver device = new iMonUSBReceiver(); + + try + { + device.Configure(null); + + DevType = device.DeviceDriverMode; + +#if DEBUG + DebugWriteLine("Main(): Detected device type = {0}", Enum.GetName(typeof(DeviceType), DevType)); +#endif + + if (DevType == DeviceType.DOS) + { + Console.WriteLine("Found an iMon DOS Device\n"); +#if DEBUG + DebugWriteLine("Found an iMon DOS Device\n"); +#endif + device.RemoteCallback += new RemoteHandler(xRemote_DOS); + device.KeyboardCallback += new KeyboardHandler(xKeyboard_DOS); + device.MouseCallback += new MouseHandler(xMouse_DOS); + } + else if (DevType == DeviceType.HID) + { + Console.WriteLine("Found an iMon HID Device\n"); +#if DEBUG + DebugWriteLine("Found an iMon HID Device\n"); +#endif + device.RemoteCallback += new RemoteHandler(xRemote_HID); + device.KeyboardCallback += new KeyboardHandler(xKeyboard_HID); + device.MouseCallback += new MouseHandler(xMouse_HID); + } + + if ((DevType == DeviceType.DOS) | (DevType == DeviceType.HID)) + { + device.Start(); + + Application.Run(); + + device.Stop(); + } + else + { +#if DEBUG + DebugWriteLine("Main(): NO SUPPORTED iMon DEVICE FOUND\n"); +#endif + throw new Exception("NO SUPPORTED iMon DEVICE FOUND"); + } + } + catch (Exception ex) + { + Console.WriteLine(ex.ToString()); + } + finally + { + device = null; + } +#if DEBUG + DebugWriteLine("Main(): completed"); +#endif + + Console.ReadKey(); + } + +#endif + #endregion + + #region iMon DosDevice Constants + + const int DosDeviceBufferSize = 8; + const string DosDevicePath = @"\\.\SGIMON"; + + const int ErrorIoPending = 997; + + // IOCTL definitions 0x0022xxxx + const uint IOCTL_IMON_READ = 0x00222008; // function 0x802 - read data (64 bytes?) from device + const uint IOCTL_IMON_WRITE = 0x00222018; // function 0x806 - write data (8 bytes) to device + const uint IOCTL_IMON_READ_RC = 0x00222030; // function 0x80C - read data (8 bytes) from device + const uint IOCTL_IMON_RC_SET = 0x00222010; // function 0x804 - write RCset data (2 bytes) to device + const uint IOCTL_IMON_FW_VER = 0x00222014; // function 0x805 - read FW version (4 bytes) + const uint IOCTL_IMON_READ2 = 0x00222034; // function 0x80D - ??? read (8 bytes) + + static readonly byte[][] SetModeMCE = new byte[][] { + new byte[] { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00 }, + new byte[] { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x02 }, + new byte[] { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x04 }, + new byte[] { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x06 }, + new byte[] { 0x20, 0x20, 0x20, 0x20, 0x01, 0x00, 0x00, 0x08 }, + new byte[] { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x0A } + }; + + static readonly byte[][] SetModeiMon = new byte[][] { + new byte[] { 0x20, 0x20, 0x20, 0x20,... [truncated message content] |
From: <che...@us...> - 2008-04-26 17:02:32
|
Revision: 1723 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1723&view=rev Author: chef_koch Date: 2008-04-26 10:02:11 -0700 (Sat, 26 Apr 2008) Log Message: ----------- moved MyMail to mp-Plugins Added Paths: ----------- trunk/plugins/MyMail/ trunk/plugins/MyMail/GUIMyMailPlugin.cs trunk/plugins/MyMail/MailClass.cs trunk/plugins/MyMail/MailDetailSetup.cs trunk/plugins/MyMail/MailDetailSetup.resx trunk/plugins/MyMail/MailInfo.cs trunk/plugins/MyMail/MailOverlay.cs trunk/plugins/MyMail/MailSetupFrom.cs trunk/plugins/MyMail/MailSetupFrom.resx trunk/plugins/MyMail/MyMail.csproj trunk/plugins/MyMail/MyMail.xmp trunk/plugins/MyMail/Properties/ trunk/plugins/MyMail/Properties/AssemblyInfo.cs trunk/plugins/MyMail/skinfiles/ trunk/plugins/MyMail/skinfiles/BlueTwo/ trunk/plugins/MyMail/skinfiles/BlueTwo/mailInfo.xml trunk/plugins/MyMail/skinfiles/BlueTwo/mailnotify.xml trunk/plugins/MyMail/skinfiles/BlueTwo/mymail.xml trunk/plugins/MyMail/skinfiles/BlueTwo wide/ trunk/plugins/MyMail/skinfiles/BlueTwo wide/mailInfo.xml trunk/plugins/MyMail/skinfiles/BlueTwo wide/mailnotify.xml trunk/plugins/MyMail/skinfiles/BlueTwo wide/mymail.xml Added: trunk/plugins/MyMail/GUIMyMailPlugin.cs =================================================================== --- trunk/plugins/MyMail/GUIMyMailPlugin.cs (rev 0) +++ trunk/plugins/MyMail/GUIMyMailPlugin.cs 2008-04-26 17:02:11 UTC (rev 1723) @@ -0,0 +1,654 @@ +#region Copyright (C) 2005-2008 Team MediaPortal + +/* + * Copyright (C) 2005-2008 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program 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, or (at your option) + * any later version. + * + * This Program 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 GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.Windows.Forms; +using System.Collections; + +using MediaPortal.Configuration; +using MediaPortal.Dialogs; +using MediaPortal.GUI.Library; + +namespace MediaPortal.GUI.MyMail +{ + /// <summary> + /// Zusammenfassung f\xFCr Class1. + /// </summary> + public class MyMailPlugin : GUIWindow, ISetupForm, IShowPlugin + { + + public MyMailPlugin() + { + GetID = 8000; + } + ~MyMailPlugin() + { + } + + #region "Declares" + // + enum Controls + { + CONTROL_LIST = 50, + CONTROL_LABELFILES = 1, + CONTROL_REFRESH_ALL = 20, + CONTROL_SWITCH_AUTOCHECK, + CONTROL_SET_ALL_UNREAD + + } + // + enum Views + { + VIEW_MAILBOX = 1, + VIEW_MAILS, + VIEW_ERROR_HAPPEND // here we dont set the list to view what happend + } + // + enum MailActions + { + ACTION_VIEW_MAILBOX = 1, // thats reserved. dont use it. + ACTION_LIST_MAILS, + ACTION_REFRESH_MAILBOX, + ACTION_TIMER_EVENT, + ACTION_DO_NOTHING, + ACTION_DELETE_MAIL + } + // + enum AutocheckStatus + { + AUTOCHECK_OFF = 0, + AUTOCHECK_ON + } + // + ArrayList m_mailBox = new ArrayList(); // stored mailboxes + MailClass m_mc = new MailClass(); // our class with the comm-parts + MailBox m_currMailBox; // the selected Mailbox + bool m_autoCheck; + bool m_bAutoCheck; // indicates auto check mails on/off + int m_currentView; + int m_currMailAction; + MailBox m_prevMailBox; + // this timer checks the inbox(es) for mail + System.Windows.Forms.Timer m_checkMailTimer = new Timer(); + ArrayList m_strUserName = new ArrayList(); + ArrayList m_strUserPass = new ArrayList(); + ArrayList m_knownMails = new ArrayList(); + #endregion + + #region ISetupForm + public bool HasSetup() + { + return true; + } + public string PluginName() + { + return "My Mail"; + } + public string Description() // Return the description which should b shown in the plugin menu + { + return "Receive and read your mails in MediaPortal"; + } + public string Author() // Return the author which should b shown in the plugin menu + { + return "_Agree_"; + } + public void ShowPlugin() // show the setup dialog + { + System.Windows.Forms.Form setup = new MailSetupFrom(); + setup.ShowDialog(); + } + public bool CanEnable() // Indicates whether plugin can be enabled/disabled + { + return true; + } + public int GetWindowId() // get ID of plugin window + { + return GetID; + } + public bool DefaultEnabled() // Indicates if plugin is enabled by default; + { + return false; + } + public bool GetHome(out string strButtonText, out string strButtonImage, out string + strButtonImageFocus, out string strPictureImage) + { + strButtonText = GUILocalizeStrings.Get(8000); + strButtonImage = ""; + strButtonImageFocus = ""; + strPictureImage = "hover_my mail.png"; + return true; + } + + #endregion + + #region IShowPlugin Members + + public bool ShowDefaultHome() + { + return false; + } + + #endregion + + public override bool Init() + { + // the event handler function gets the mail-data + m_mc.GotMailData += new MyMail.MailClass.GotMailDataEventHandler(m_mc_GotMailData); + m_mc.InformUser += new MyMail.MailClass.InformEventHandler(m_mc_InformUser); + LoadSettings(); + + if (m_mailBox.Count > 0) // when at least 1 mailbox is given + { + m_checkMailTimer.Tick += new EventHandler(checkMails); + m_checkMailTimer.Start(); + DisplayOverlayNotify(false, ""); + m_checkMailTimer.Enabled = true; + m_currentView = (int)Views.VIEW_MAILBOX; // for init show mailboxes + } + else + { + DisplayOverlayNotify(false, ""); + } + bool bResult = Load(GUIGraphicsContext.Skin + @"\mymail.xml"); + + return bResult; + } + + public override bool OnMessage(GUIMessage message) + { + switch (message.Message) + { + case GUIMessage.MessageType.GUI_MSG_WINDOW_INIT: + base.OnMessage(message); + GUIPropertyManager.SetProperty("#currentmodule", GUILocalizeStrings.Get(8000)); + + if (m_mailBox.Count == 0) // when at least 1 mailbox is given, + { + GUIDialogOK dlgOK = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK); + if (dlgOK != null) + { + dlgOK.SetHeading(8010); + dlgOK.SetLine(1, 8011); + dlgOK.SetLine(2, 8012); + dlgOK.SetLine(3, ""); + dlgOK.DoModal(GetID); + } + } + else + { + SetAutoCheckButton(); + m_autoCheck = false; + m_checkMailTimer.Stop(); + if (m_currentView == (int)Views.VIEW_MAILBOX) + SetMailBoxList(); + else + SetMailsList(); + } + return true; + + + + case GUIMessage.MessageType.GUI_MSG_WINDOW_DEINIT: + SaveSettings(); + m_checkMailTimer.Start(); + break; + + case GUIMessage.MessageType.GUI_MSG_CLICKED: + int iControl = message.SenderControlId; + if (iControl == (int)Controls.CONTROL_SET_ALL_UNREAD) + { + // unread all + foreach (MailBox mb in m_mailBox) + { + if (System.IO.File.Exists(mb.MailboxFolder + @"\knownmails.txt")) + System.IO.File.Delete(mb.MailboxFolder + @"\knownmails.txt"); + if (System.IO.File.Exists(mb.MailboxFolder + @"\transferList.txt")) + System.IO.File.Delete(mb.MailboxFolder + @"\transferList.txt"); + } + SetMailBoxList(); + } + if (iControl == (int)Controls.CONTROL_SWITCH_AUTOCHECK) + { + if (m_bAutoCheck == true) + m_bAutoCheck = false; + else + m_bAutoCheck = true; + + GUIToggleButtonControl theControl = (GUIToggleButtonControl)GUIWindowManager.GetWindow(GetID).GetControl(iControl); + if (theControl != null) + { + theControl.Selected = m_bAutoCheck; + SetAutoCheckButton(); + } + } + + if (iControl == (int)Controls.CONTROL_REFRESH_ALL) + { + RefreshAllBoxes(0); + } + + if (iControl == (int)Controls.CONTROL_LIST) + { + GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_ITEM_SELECTED, GetID, 0, iControl, 0, 0, null); + OnMessage(msg); + int iItem = (int)msg.Param1; + int iAction = (int)message.Param1; + if (iAction == (int)Action.ActionType.ACTION_SELECT_ITEM) + { + OnClick(iItem); + } + } + break; + + } + + return base.OnMessage(message); + } + + public override void OnAction(Action action) + { + if (action.wID == Action.ActionType.ACTION_PREVIOUS_MENU) + { + GUIWindowManager.ShowPreviousWindow(); + return; + } + base.OnAction(action); + } + private void checkMails(object sender, System.EventArgs e) + { + if (m_mailBox.Count > 0) + if (m_bAutoCheck) + { + m_autoCheck = true; + RefreshAllBoxes(0); + } + } + // + // handle data income + private void m_mc_InformUser(int msgNum, object data) + { + if ((int)GUIWindowManager.ActiveWindow == GetID) + { + string strObjects = String.Format("{0} {1}...", GUILocalizeStrings.Get(msgNum), (string)data); + GUIPropertyManager.SetProperty("#itemcount", strObjects); + GUIControl ctrl = GetControl((int)Controls.CONTROL_LABELFILES); + if (ctrl != null) + GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_LABELFILES, strObjects); + } + + } + private void m_mc_GotMailData(object eventObject, string mailText, int results) + { + int newMailsCount = 0; + // error handling + switch (results) + { + case 1:// timeout error + if ((int)GUIWindowManager.ActiveWindow == GetID) + { + string strObjects = String.Format("{0} '{1}'", "(!)Timeout", m_currMailBox.BoxLabel); + GUIPropertyManager.SetProperty("#itemcount", strObjects); + GUIControl ctrl = GetControl((int)Controls.CONTROL_LABELFILES); + if (ctrl != null) + GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_LABELFILES, strObjects); + } + m_currentView = (int)Views.VIEW_ERROR_HAPPEND; + break; + case 999:// this is an extended error, the message is from the mail server + if ((int)GUIWindowManager.ActiveWindow == GetID) + { + string strObjects = String.Format("{0} '{1}'", (string)eventObject, m_currMailBox.BoxLabel); + GUIPropertyManager.SetProperty("#itemcount", strObjects); + GUIControl ctrl = GetControl((int)Controls.CONTROL_LABELFILES); + if (ctrl != null) + GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_LABELFILES, strObjects); + } + m_currentView = (int)Views.VIEW_ERROR_HAPPEND; + break; + }// + // + switch (m_currMailAction) + { + case (int)MailActions.ACTION_REFRESH_MAILBOX: + int mbNumber = GetMailBoxNumber(m_currMailBox); + if (m_mailBox.Count > 0) + { + mbNumber++; + RefreshAllBoxes(mbNumber); + } + break; + case (int)MailActions.ACTION_LIST_MAILS: + break; + case (int)MailActions.ACTION_DO_NOTHING: + break; + case (int)MailActions.ACTION_TIMER_EVENT: + break; + case (int)MailActions.ACTION_DELETE_MAIL: + break; + + } + if (m_autoCheck == true) + { + string data = GUILocalizeStrings.Get(8023); + foreach (MailBox mb in m_mailBox) + { + newMailsCount += m_mc.CountNewMail(mb); + data += " in Mailbox '" + mb.BoxLabel + "': " + Convert.ToString(m_mc.CountNewMail(mb)) + " " + GUILocalizeStrings.Get(8004) + " "; + } + if (newMailsCount > 0) + { + MediaPortal.Util.Utils.PlaySound("notify.wav", false, true); + DisplayOverlayNotify(true, data); + } + } + } + // build the list of mailboxes + void SetMailBoxList() + { + m_currentView = (int)Views.VIEW_MAILBOX; + if ((int)GUIWindowManager.ActiveWindow == GetID) + { + + GUIControl.ClearControl(GetID, (int)Controls.CONTROL_LIST); + ArrayList itemlist = new ArrayList(); + // make item list + foreach (MailBox mb in m_mailBox) + { + m_mc.SetMailboxPath(mb.MailboxFolder, mb.AttachmentFolder); + int nmc = m_mc.CountNewMail(mb); + GUIListItem item = new GUIListItem(mb.Username); + if (nmc != 0) + item.IconImage = "newMailIcon.png"; + item.Label = mb.BoxLabel + " (" + Convert.ToString(mb.MailCount) + ")"; + item.Label2 = "(" + mb.ServerAddress + ")"; + item.Label3 = ""; + item.Path = mb.Username; + item.IsFolder = false; + itemlist.Add(item); + + } + + // list items + foreach (GUIListItem item in itemlist) + { + GUIControl.AddListItemControl(GetID, (int)Controls.CONTROL_LIST, item); + } + + //set object count label + GUIPropertyManager.SetProperty("#itemcount", Util.Utils.GetObjectCountLabel(itemlist.Count)); + GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_LABELFILES, Util.Utils.GetObjectCountLabel(itemlist.Count)); + } + + } + // + void ClearItemList() + { + if ((int)GUIWindowManager.ActiveWindow == GetID) + { + GUIControl.ClearControl(GetID, (int)Controls.CONTROL_LIST); + + //set object count label + GUIPropertyManager.SetProperty("#itemcount", Util.Utils.GetObjectCountLabel(0)); + GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_LABELFILES, Util.Utils.GetObjectCountLabel(0)); + } + } + // add a incoming mail + int GetMailBoxNumber(MailBox theMailbox) + { + int count = 0; + foreach (MailBox mb in m_mailBox) + { + if (mb.Equals(theMailbox)) + return count; + count++; + } + return -1; + } + void SetMailsList() + { + if ((int)GUIWindowManager.ActiveWindow == GetID && m_currMailBox.MailCount > 0) + { + m_currentView = (int)Views.VIEW_MAILS; + ArrayList itemlist = new ArrayList(); + GUIControl.ClearControl(GetID, (int)Controls.CONTROL_LIST); + System.IO.FileInfo[] theMails = null; + m_mc.SetMailboxPath(m_currMailBox.MailboxFolder, m_currMailBox.AttachmentFolder); + int mCount = m_mc.GetEMailList(m_currMailBox.MailboxFolder, ref theMails); + string path = m_currMailBox.MailboxFolder + @"\"; + foreach (System.IO.FileInfo fInfo in theMails) + { + eMail theMail = m_mc.ParseMailText(m_mc.LoadEMail(path + fInfo.Name), false); + GUIListItem item = new GUIListItem(theMail.Subject); + if (m_mc.IsMailKnown(path + fInfo.Name) == false) + item.IconImage = "newMailIcon.png"; + item.Label = theMail.Subject; + item.Label2 = theMail.From; + item.Label3 = ""; + item.Path = path + fInfo.Name; + item.IsFolder = false; + itemlist.Add(item); + } + // + GUIListItem dirUp = new GUIListItem(".."); + dirUp.Path = "mailboxlist"; // to get where we are + dirUp.IsFolder = false; + dirUp.ThumbnailImage = ""; + dirUp.IconImage = "defaultFolderBack.png"; + dirUp.IconImageBig = "defaultFolderBackBig.png"; + itemlist.Insert(0, dirUp); + // + foreach (GUIListItem item in itemlist) + { + GUIControl.AddListItemControl(GetID, (int)Controls.CONTROL_LIST, item); + } + + //set object count label + GUIPropertyManager.SetProperty("#itemcount", Util.Utils.GetObjectCountLabel(itemlist.Count - 1)); + GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_LABELFILES, Util.Utils.GetObjectCountLabel(itemlist.Count - 1)); + + DisplayOverlayNotify(false, ""); // remove the notify + } + } + + void SaveSettings() + { + using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + { + xmlwriter.SetValueAsBool("mymail", "autoCheck", m_bAutoCheck); + } + } + + void LoadSettings() + { + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + { + int boxCount = 0; + MailBox tmpBox; + m_mailBox.Clear(); + m_checkMailTimer.Interval = xmlreader.GetValueAsInt("mymail", "timer", 300000); + m_bAutoCheck = xmlreader.GetValueAsBool("mymail", "autoCheck", false); + boxCount = xmlreader.GetValueAsInt("mymail", "mailBoxCount", 0); + System.IO.FileInfo[] theMails = null; + if (boxCount > 0) + { + for (int i = 0; i < boxCount; i++) + { + string[] boxData = null; + string mailBoxString = xmlreader.GetValueAsString("mymail", "mailBox" + Convert.ToString(i), ""); + if (mailBoxString.Length > 0) + { + boxData = mailBoxString.Split(new char[] { ';' }); + //<OKAY_AWRIGHT> + if ((boxData.Length == 8) || ((boxData.Length > 8) && (boxData[8] == "T"))) + { + tmpBox = new MailBox(boxData[0], boxData[1], boxData[2], boxData[3], Convert.ToInt16(boxData[4]), Convert.ToByte(boxData[5]), boxData[6], boxData[7]); + //</OKAY_AWRIGHT> + tmpBox.MailCount = m_mc.GetEMailList(tmpBox.MailboxFolder, ref theMails); + if (tmpBox != null) + m_mailBox.Add(tmpBox); + } + } + } + } + + } + } + + // set mail box + void OnClick(int iItem) + { + GUIListItem item = GetSelectedItem(); + if (item == null) return; + switch (m_currentView) + { + case (int)Views.VIEW_MAILBOX: + if (iItem >= 0 && iItem <= m_mailBox.Count - 1) + { + m_currMailBox = (MailBox)m_mailBox[iItem]; + m_mc.SetMailboxPath(m_currMailBox.MailboxFolder, m_currMailBox.AttachmentFolder); + m_prevMailBox = m_currMailBox; + if (m_currMailBox.MailCount > 0) + { + m_currMailAction = (int)MailActions.ACTION_LIST_MAILS; + m_currentView = (int)Views.VIEW_MAILS; + SetMailsList(); + } + } + break; + case (int)Views.VIEW_MAILS: + if (iItem >= 0) + { + if (iItem == 0) + SetMailBoxList(); + else + if (m_currMailBox.MailCount > 0) + { + //get email here + string mailText = m_mc.LoadEMail(item.Path); + eMail theMail = m_mc.ParseMailText(mailText, true); + if (theMail != null) + { + m_mc_InformUser(8025, " (please wait...)"); + m_mc.SetMailboxPath(m_currMailBox.MailboxFolder, m_currMailBox.AttachmentFolder); + m_mc.SetMailToKnownState(mailText); + ShowMail(theMail); + if (m_currMailBox.MailCount == 0) + SetMailBoxList(); + + } + } + + } + break; + } + } + + void RefreshAllBoxes(int mbNumber) + { + if (m_mailBox.Count > 0) + { + if (mbNumber <= m_mailBox.Count - 1) + { + + GUIControl.DisableControl(GetID, (int)Controls.CONTROL_REFRESH_ALL); + + m_currMailBox = (MailBox)m_mailBox[mbNumber]; + if ((int)GUIWindowManager.ActiveWindow == GetID) + { + string strObjects = String.Format("{0} '{1}'", GUILocalizeStrings.Get(8005), m_currMailBox.BoxLabel); + GUIPropertyManager.SetProperty("#itemcount", strObjects); + GUIControl ctrl = GetControl((int)Controls.CONTROL_LABELFILES); + if (ctrl != null) + GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_LABELFILES, strObjects); + } + m_currMailAction = (int)MailActions.ACTION_REFRESH_MAILBOX; + + m_mc.ReadMailBox(ref m_currMailBox); + } + else + { + GUIControl.EnableControl(GetID, (int)Controls.CONTROL_REFRESH_ALL); + + if (m_currentView == (int)Views.VIEW_MAILBOX) + { + SetMailBoxList(); + } + + if (m_currentView == (int)Views.VIEW_MAILS) + { + if (m_prevMailBox != null) + { + m_currMailBox = m_prevMailBox; + m_prevMailBox = null; + SetMailsList(); + } + } + } + } + } + + //mb.BoxLabel+"("+Convert.ToString(mb.NewMailCount)+"/"+Convert.ToString(mb.MailCount)+")"; + GUIListItem GetSelectedItem() + { + int iControl; + iControl = (int)Controls.CONTROL_LIST; + GUIListItem item = GUIControl.GetSelectedListItem(GetID, iControl); + return item; + } + + void ShowMail(eMail theMail) + { + MailInfo mailWindow = (MailInfo)GUIWindowManager.GetWindow(8001); + mailWindow.SetEMail = theMail; + mailWindow.SetMailBox = m_currMailBox; + GUIWindowManager.ActivateWindow(8001); + } + + void SetAutoCheckButton() + { + GUIToggleButtonControl theControl = (GUIToggleButtonControl)GUIWindowManager.GetWindow(GetID).GetControl((int)Controls.CONTROL_SWITCH_AUTOCHECK); + if (theControl != null) + { + theControl.Selected = m_bAutoCheck; + } + } + + void DisplayOverlayNotify(bool state, string data) + { + MailOverlay mailOverlay = (MailOverlay)GUIWindowManager.GetWindow(8002); + if (mailOverlay != null) + { + GUIFadeLabel fader = (GUIFadeLabel)mailOverlay.GetControl(2); + + if (fader != null) + { + fader.Label = data; + fader.IsVisible = state; + } + } + } + + } +} \ No newline at end of file Added: trunk/plugins/MyMail/MailClass.cs =================================================================== --- trunk/plugins/MyMail/MailClass.cs (rev 0) +++ trunk/plugins/MyMail/MailClass.cs 2008-04-26 17:02:11 UTC (rev 1723) @@ -0,0 +1,1702 @@ +#region Copyright (C) 2005-2008 Team MediaPortal + +/* + * Copyright (C) 2005-2008 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program 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, or (at your option) + * any later version. + * + * This Program 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 GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.Collections; +using System.Net.Sockets; +using System.Net; +using System.Text; +using System.Text.RegularExpressions; +using System.ComponentModel; +using System.Net.Security; +using System.Security.Cryptography.X509Certificates; +using System.Security.Cryptography; + +using MediaPortal.Dialogs; +using MediaPortal.GUI.Library; + +namespace MediaPortal.GUI.MyMail +{ + /// <summary> + /// this a mail-client in a class + /// to read a mailbox + /// </summary> + + public class MailClass + { + const int m_buffSize = 2048; // buffer for rec. data + const string _CRLF_ = "\r\n"; + const System.Net.Sockets.SocketFlags noFlags = System.Net.Sockets.SocketFlags.None; + MailBox m_mb; + IPEndPoint m_endPoint; + Socket m_mailSocket;// + NetworkStream m_mailSocketStream; + SslStream m_mailTLSStream; + + static string m_emptyBuffer = new string((char)0, 2048);// 2kbyte socket buffer + //System.Net.Sockets.TcpClient m_mailReciever=new TcpClient(); + int m_imailCount; + int m_currAction = -1; // + int m_mailAction; + int m_mailNumber; + int m_ierrorNumber; + string m_mailFolder; + string m_attachmentFolder; + string m_errorMessage; + int m_mailNumberSize; + string m_recMailData; + System.Windows.Forms.Timer m_timeOutTimer = new System.Windows.Forms.Timer(); + ArrayList m_knownMails = new ArrayList(); + System.Security.Cryptography.MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider(); + byte[] m_mailBuffer = new Byte[m_buffSize]; + Byte m_TLSSecured = MailBox.NO_SSL; //NO_SSL: user/password combination won't be encrypted, STLS: use explicit SSL, SSL_PORT: use implicit SSL; The authentication method is chosen during mailbox configuration + Boolean m_TLS_OK = false; //Are we actually protected under a SSL layer? + public const Boolean UntrustedRootOK = true; //Accept that the server to securely connect to has produced its own certificate + public const Boolean CertNameMistmatchOK = false; //Accept that the server name (domain name) to securely connect to may mismatch the one provided in the certificate + public const Boolean CertRevokedOK = true; //Allow expired certificates to be used by the server + + private struct MailMultiPart + { + public int lineStart; + public int lineEnd; + public string contentID; + public string boundary; + public string contentType; + public string fileName; + public string name; + public string transferEncoding; + public string contentDisposition; + } + public struct MailAttachment + { + public string attPath; + public string attFileName; + public int attKind; // 1 - image, 2 - audio, 3 - application rel. + } + // + enum SocketError + { + ERROR_NO_ERROR = 0, + ERROR_TIMEOUT, + ERROR_NO_DATA, + ERROR_CONNECTION_ERR, + ERROR_WRONG_DATA, + ERROR_SERVER_NOT_READY, + ERROR_UNKNOWN_MSG_FROM_SERVER = 999 + } + + enum MailAction + { + MAIL_MB_CONNECTED = 1, + MAIL_SEND_CAPABILITIES, + MAIL_SEND_STARTTLS, + MAIL_ACTION_WAIT_SERVER_CERTIFICATE, + MAIL_SEND_USER, + MAIL_SEND_PASS, + MAIL_SEND_STAT, + MAIL_SEND_RETR, + MAIL_SEND_QUIT, + MAIL_SEND_LIST, + MAIL_SEND_DELE, + MAIL_SEND_RETR_LIST, + MAIL_SEND_PERFORM, + MAIL_ACTION_INVALID, + MAIL_ACTION_READ_ON, + MAIL_ACTION_READ_LIST + + } + + enum InformNumber + { + INFORM_CONNECTED = 8030, + INFORM_GETTING_MAIL, + INFORM_LOGOUT, + INFORM_GETTING_MAIL_PROGRESS + } + // our events + // an event to set diverse data + public delegate void InformEventHandler(int informNumber, object informObject); + public event InformEventHandler InformUser; + // + // timout handler + public delegate void GotMailDataEventHandler(object mailObject, string mailData, int mailAction); + public event GotMailDataEventHandler GotMailData; + // + // get mail known state + // + public MailClass() + { + + m_timeOutTimer.Tick += new EventHandler(TimeOut); + } + ~MailClass() + { + //m_timeOutTimer.Tick-=new EventHandler(TimeOut); + } + // getting all mails from an mailbox + public void ReadMailBox(ref MailBox mailbox) + { + IPAddress[] addr = new IPAddress[0]; + if (ServerExists(mailbox, ref addr) == true) + { + System.Net.IPEndPoint ePoint = new IPEndPoint(addr[0], mailbox.Port); + //mailbox.ClearMailList(); + m_mb = mailbox; + m_mailNumber = 0; + m_endPoint = ePoint; + m_TLSSecured = mailbox.TLS; + m_mailSocket = new Socket(System.Net.Sockets.AddressFamily.InterNetwork, System.Net.Sockets.SocketType.Stream, System.Net.Sockets.ProtocolType.IP); + m_ierrorNumber = (int)SocketError.ERROR_NO_ERROR; + m_errorMessage = ""; + m_mailFolder = mailbox.MailboxFolder; + m_attachmentFolder = mailbox.AttachmentFolder; + m_timeOutTimer.Interval = 60000; // set timeout to 15 seconds + m_timeOutTimer.Start(); + AsyncCallback callback = new AsyncCallback(ConnectCallback); + // Begin Asyncronous Connection + m_mailSocket.BeginConnect(ePoint, callback, m_mailSocket); + m_mailAction = (int)MailAction.MAIL_SEND_STAT; + m_mailBuffer.Initialize(); + + } + else + { + GUIDialogOK dlgOK = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK); + if (dlgOK != null) + { + string serverString = GUILocalizeStrings.Get(8014); + string mailBoxString = GUILocalizeStrings.Get(8015); + dlgOK.SetHeading(8013); + dlgOK.SetLine(1, string.Format(serverString, mailbox.ServerAddress)); + dlgOK.SetLine(2, string.Format(mailBoxString, mailbox.BoxLabel)); + dlgOK.SetLine(3, ""); + dlgOK.DoModal(8000); + + } + m_ierrorNumber = (int)SocketError.ERROR_SERVER_NOT_READY; + m_mb.MailCount = 0; + Log.Info("mymail: server connecting problem {0}", m_mb.ServerAddress); + InteractServer((int)MailAction.MAIL_SEND_QUIT); // logout from the server + } + } + // delete an mail from the server + + private void ConnectCallback(IAsyncResult ar) + { + try + { + Socket sock1 = (Socket)ar.AsyncState; + if (sock1.Connected) + { + InformUser((int)InformNumber.INFORM_CONNECTED, ""); + m_timeOutTimer.Stop(); + + m_mailSocketStream = new NetworkStream(m_mailSocket, false); + + if (m_TLSSecured == MailBox.SSL_PORT) + { + + AsyncCallback recieveData = new AsyncCallback(OnRecievedData); + + try + { + m_mailTLSStream = new SslStream(m_mailSocketStream, false, this.RemoteCertificateValidationCallback); + m_mailTLSStream.AuthenticateAsClient(m_mb.ServerAddress, null, System.Security.Authentication.SslProtocols.Ssl2 | System.Security.Authentication.SslProtocols.Ssl3 | System.Security.Authentication.SslProtocols.Tls, !CertRevokedOK); + + m_TLS_OK = true; + + m_currAction = (int)MailAction.MAIL_MB_CONNECTED; + m_mailTLSStream.BeginRead(m_mailBuffer, 0, m_buffSize, recieveData, m_mailTLSStream); + + Log.Info("mymail: connected to server {0} using SSL", m_mb.ServerAddress); + + } + catch //(Exception ee) + { + /* + Log.Info("mymail: SSL connection attempt to dedicated port failed: {0}", ee.Message); + + m_mailTLSStream = null; + m_TLS_OK = false; + + m_ierrorNumber = (int)SocketError.ERROR_CONNECTION_ERR; + m_currAction = (int)MailAction.MAIL_SEND_QUIT; + m_mailSocketStream.BeginRead(m_mailBuffer, 0, m_buffSize, recieveData, m_mailSocketStream); + */ + } + + + } + else + { + AsyncCallback recieveData = new AsyncCallback(OnRecievedData); + + m_TLS_OK = false; + + m_currAction = (int)MailAction.MAIL_MB_CONNECTED; + m_mailSocketStream.BeginRead(m_mailBuffer, 0, m_buffSize, recieveData, m_mailSocketStream); + + Log.Info("mymail: connected to server {0}", m_mb.ServerAddress); + + } + + } + } + catch + { + // + } + } + + private void OnRecievedData(IAsyncResult ar) + { + if (m_currAction == (int)MailAction.MAIL_ACTION_WAIT_SERVER_CERTIFICATE) + { + + if (m_TLSSecured == MailBox.STLS && m_TLS_OK) + { + Log.Info("mymail: re-connected to server {0} using SSL", m_mb.ServerAddress); + InteractServer((int)MailAction.MAIL_SEND_USER); + } + else + { + Log.Info("mymail: SSL re-connection attempt using STARTTLS command failed: Explicit TLS issued w/out any effective SSL layer protection"); + m_ierrorNumber = (int)SocketError.ERROR_CONNECTION_ERR; + InteractServer((int)MailAction.MAIL_SEND_QUIT); // logout from the server + } + return; + } + + int bytesCount; + if (m_TLSSecured != MailBox.NO_SSL && m_TLS_OK) + bytesCount = ((SslStream)ar.AsyncState).EndRead(ar); + else + bytesCount = ((NetworkStream)ar.AsyncState).EndRead(ar); + System.String strData = System.Text.Encoding.ASCII.GetString(m_mailBuffer, 0, bytesCount); + m_timeOutTimer.Stop(); + + try + { + + if (bytesCount == 0 && m_currAction == (int)MailAction.MAIL_ACTION_READ_ON) + { + Log.Info("mymail: there is an recieve error. no data was send from server"); + m_errorMessage = "Error. No Mail-End indicator found"; + m_ierrorNumber = (int)SocketError.ERROR_WRONG_DATA; + InteractServer((int)MailAction.MAIL_SEND_QUIT); // logout from the server + } + // getting mailbox list + + // getting mail number x + if (bytesCount > 0 && m_currAction == (int)MailAction.MAIL_ACTION_READ_ON) + { + + m_recMailData += strData; + + double percentDone = m_recMailData.Length * 100 / m_mailNumberSize; + if (percentDone > 100f) percentDone = 100f; + string percentDoneText = " (" + Convert.ToString(percentDone) + "%)"; + InformUser((int)InformNumber.INFORM_GETTING_MAIL, Convert.ToString((m_imailCount + 1) - m_mailNumber) + "/" + Convert.ToString(m_imailCount) + percentDoneText); + + if (m_recMailData.EndsWith(_CRLF_ + "." + _CRLF_) == false) + { + + AsyncCallback recieveData = new AsyncCallback(OnRecievedData); + //m_timeOutTimer.Start(); + m_mailBuffer = System.Text.Encoding.ASCII.GetBytes(m_emptyBuffer); + m_timeOutTimer.Start(); + if (recieveData != null) + if (m_TLSSecured != MailBox.NO_SSL && m_TLS_OK) + ((SslStream)ar.AsyncState).BeginRead(m_mailBuffer, 0, m_buffSize, recieveData, (SslStream)ar.AsyncState); + else + ((NetworkStream)ar.AsyncState).BeginRead(m_mailBuffer, 0, m_buffSize, recieveData, (NetworkStream)ar.AsyncState); + } + else + { + + Log.Info("mymail: recieved message number {0}", Convert.ToString(m_mailNumber)); + try + { + SaveEMail(m_recMailData, m_mailNumber); + } + catch + { + Log.Info("mymail: there was an error creating the mail nr. {0}", Convert.ToString(m_mailNumber)); + } + m_recMailData = ""; + m_mailNumber--; + + if (m_mailNumber <= 0) + { + m_mailBuffer = System.Text.Encoding.ASCII.GetBytes(m_emptyBuffer); + Log.Info("mymail: all messages transfered. count: {0}", Convert.ToString(m_imailCount)); + m_ierrorNumber = (int)SocketError.ERROR_NO_ERROR; + InteractServer((int)MailAction.MAIL_SEND_QUIT); // logout from the server + } + else + { + InformUser((int)InformNumber.INFORM_GETTING_MAIL, Convert.ToString((m_imailCount + 1) - m_mailNumber) + "/" + Convert.ToString(m_imailCount)); + Log.Info("mymail: getting message number {0}", Convert.ToString(m_mailNumber)); + m_mailAction = (int)MailAction.MAIL_SEND_LIST; + InteractServer((int)MailAction.MAIL_SEND_LIST); + } + return; + } + } + + + if (bytesCount > 0 && m_currAction != (int)MailAction.MAIL_ACTION_READ_ON) + { + + string strRecieved = strData; + + if (strRecieved.StartsWith("-ERR")) + { + m_errorMessage = strRecieved.Substring(4, strRecieved.Length - 4); + m_ierrorNumber = (int)SocketError.ERROR_UNKNOWN_MSG_FROM_SERVER; + InteractServer((int)MailAction.MAIL_SEND_QUIT); + } + if (strRecieved.Substring(0, 3).Equals("+OK")) + { + switch (m_currAction) + { + case (int)MailAction.MAIL_SEND_LIST: + + string size = strRecieved; + size = size.Replace(_CRLF_, ""); + string[] strSeg = size.Split(new char[] { ' ' }); + int count = int.Parse(strSeg[strSeg.Length - 1]); + + if (count > 0 && IsMailInList(size) == false) + { + AppendMailToList(size); + m_mailNumberSize = count; + m_mailAction = (int)MailAction.MAIL_SEND_RETR; + InteractServer((int)MailAction.MAIL_SEND_PERFORM); // get the next mail + } + else + { + Log.Info("mymail: message number {0} has already been downloaded or is malformed", Convert.ToString(m_mailNumber)); + m_mailNumber--; + if (m_mailNumber <= 0) + { + m_ierrorNumber = (int)SocketError.ERROR_NO_ERROR; + InteractServer((int)MailAction.MAIL_SEND_QUIT); // logout from the server + } + else + InteractServer((int)MailAction.MAIL_SEND_LIST); + } + break; + case (int)MailAction.MAIL_MB_CONNECTED: // send the user and begin login or first issue a STLS command + if (m_TLSSecured == MailBox.STLS && !m_TLS_OK) + InteractServer((int)MailAction.MAIL_SEND_CAPABILITIES); + else + InteractServer((int)MailAction.MAIL_SEND_USER); + break; + case (int)MailAction.MAIL_SEND_CAPABILITIES: // check server capabilities + + Boolean is_STLS_Authorized = false; + //A t'on \xE0 faire \xE0 un serveur qui peut utiliser une couche SSL/TLS? + Regex regexEndOfLine = new Regex(_CRLF_); + string[] caps = regexEndOfLine.Split(strRecieved); + for (int i = 0; i < caps.Length; i++) + if (caps[i].Substring(0, 4).Equals("STLS")) + { + is_STLS_Authorized = true; + InteractServer((int)MailAction.MAIL_SEND_STARTTLS); + break; + } + //Non? alors on arr\xEAte l\xE0... + if (!is_STLS_Authorized) + { + Log.Info("mymail: Server does not advertise STLS. No secure connection will be issued."); + m_ierrorNumber = (int)SocketError.ERROR_CONNECTION_ERR; + InteractServer((int)MailAction.MAIL_SEND_QUIT); // logout from the server + } + break; + case (int)MailAction.MAIL_SEND_STARTTLS: // SSL/TLS via standard POP3 port + + AsyncCallback recieveData_TLS = new AsyncCallback(OnRecievedData); + try + { + m_mailTLSStream = new SslStream((NetworkStream)ar.AsyncState, false, this.RemoteCertificateValidationCallback); + m_TLS_OK = true; + m_currAction = (int)MailAction.MAIL_ACTION_WAIT_SERVER_CERTIFICATE; + m_mailTLSStream.BeginAuthenticateAsClient(m_mb.ServerAddress, null, System.Security.Authentication.SslProtocols.Ssl2 | System.Security.Authentication.SslProtocols.Ssl3 | System.Security.Authentication.SslProtocols.Tls, !CertRevokedOK, recieveData_TLS, m_mailTLSStream); + } + catch (Exception ee) + { + m_mailSocket.Blocking = false; + + Log.Info("mymail: SSL connection attempt using STARTTLS command failed: {0}", ee.Message); + + m_mailTLSStream = null; + m_TLS_OK = false; + + m_ierrorNumber = (int)SocketError.ERROR_CONNECTION_ERR; + m_currAction = (int)MailAction.MAIL_SEND_QUIT; + m_mailSocketStream.BeginRead(m_mailBuffer, 0, m_buffSize, recieveData_TLS, m_mailSocketStream); + } + break; + case (int)MailAction.MAIL_SEND_USER: // send password + InteractServer((int)MailAction.MAIL_SEND_PASS); + break; + case (int)MailAction.MAIL_SEND_PASS: // if the pass is sended we perform our action + InteractServer((int)MailAction.MAIL_SEND_PERFORM); + break; + + case (int)MailAction.MAIL_SEND_PERFORM: // we quit now + + if (m_mailAction == (int)MailAction.MAIL_SEND_STAT) // return the mail count from the inbox + { + + // get the mails count + strRecieved = strRecieved.Replace(_CRLF_, ""); + try + { + m_imailCount = int.Parse(Regex.Replace(strRecieved, @"^.*\+OK[ | ]+([0-9]+)[ | ]+.*$", "$1")); + } + catch + { + m_imailCount = 0; + } + // m_imailCount=m_imailCount; + m_mb.MailCount = m_imailCount; + Log.Info("mymail: there are {0} messages in the mailbox {1}", Convert.ToString(m_imailCount), m_mb.BoxLabel); + if (m_imailCount > 0) + { + //m_lastMailToRecieve=m_mb.LastCheckCount; + m_mailNumber = m_imailCount; + //m_mb.LastCheckCount=m_imailCount; + InformUser((int)InformNumber.INFORM_GETTING_MAIL, Convert.ToString((m_imailCount + 1) - m_mailNumber) + "/" + Convert.ToString(m_imailCount)); + InteractServer((int)MailAction.MAIL_SEND_LIST); + // starting out with getting a list + //m_mailAction=(int)MailAction.MAIL_SEND_RETR_LIST; + //InteractServer((int)MailAction.MAIL_SEND_PERFORM); + } + else + { + m_ierrorNumber = 2;// no mails on server + m_mb.MailCount = CountMail(m_mb); + InteractServer((int)MailAction.MAIL_SEND_QUIT); // logout from the server + } + } + if (m_mailAction == (int)MailAction.MAIL_SEND_RETR) // return the mail content (if its size is greater than the actual buffer size, will pursue using MAIL_ACTION_READ_ON command on next buffer filling pass) + { + //m_recMailData = ""; + m_recMailData = strRecieved; + //QUICK FIX: mail bodies whose size is lower than buffer length don't pass MAIL_ACTION_READ_ON related procedure through MAIL_SEND_RETR related procedure. + if (strRecieved.EndsWith(_CRLF_ + "." + _CRLF_)) + { + Log.Info("mymail: recieved message number {0}", Convert.ToString(m_mailNumber)); + try + { + SaveEMail(m_recMailData, m_mailNumber); + } + catch + { + Log.Info("mymail: there was an error creating the mail nr. {0}", Convert.ToString(m_mailNumber)); + } + m_recMailData = ""; + m_mailNumber--; + if (m_mailNumber <= 0) + { + m_mailBuffer = System.Text.Encoding.ASCII.GetBytes(m_emptyBuffer); + Log.Info("mymail: all messages transfered. count: {0}", Convert.ToString(m_imailCount)); + m_ierrorNumber = (int)SocketError.ERROR_NO_ERROR; + InteractServer((int)MailAction.MAIL_SEND_QUIT); // logout from the server + } + else + { + InformUser((int)InformNumber.INFORM_GETTING_MAIL, Convert.ToString((m_imailCount + 1) - m_mailNumber) + "/" + Convert.ToString(m_imailCount)); + Log.Info("mymail: getting message number {0}", Convert.ToString(m_mailNumber)); + m_mailAction = (int)MailAction.MAIL_SEND_LIST; + InteractServer((int)MailAction.MAIL_SEND_LIST); + } + } + else + { + m_currAction = (int)MailAction.MAIL_ACTION_READ_ON; + AsyncCallback recieveData = new AsyncCallback(OnRecievedData); + if (m_TLSSecured != MailBox.NO_SSL && m_TLS_OK) + ((SslStream)ar.AsyncState).BeginRead(m_mailBuffer, 0, m_buffSize, recieveData, (SslStream)ar.AsyncState); + else + ((NetworkStream)ar.AsyncState).BeginRead(m_mailBuffer, 0, m_buffSize, recieveData, (NetworkStream)ar.AsyncState); + } + } + if (m_mailAction == (int)MailAction.MAIL_SEND_DELE) // return the mail count from the inbox + InteractServer((int)MailAction.MAIL_SEND_QUIT); // logout from the server + + break; + case (int)MailAction.MAIL_SEND_QUIT: + m_mb.MailCount = CountMail(m_mb); + m_timeOutTimer.Stop(); + m_mailSocket.Close(); + m_mailSocketStream = null; + m_mailTLSStream = null; + if (m_ierrorNumber != 0) + { + Log.Info("mymail: an error occured. errornumber {0} on mailbox {1}", Convert.ToString(m_ierrorNumber), m_mb.ServerAddress); + Log.Info("mymail: an error occured. errormessage from server {0}", m_errorMessage); + } + GotMailData(m_errorMessage, "Ready", m_ierrorNumber); // ready + break; + } + } // else we are ready + } + } + catch + { + Log.Info("mymail: recieve error. mail number {0} on mailbox {1}", Convert.ToString(m_mailNumber), m_mb.BoxLabel); + InteractServer((int)MailAction.MAIL_SEND_QUIT); // logout from the server + } + } + // sending some request to the mailserver + // and set the required mailAction + // for example: if we sended the user we send the pass... + private int InteractServer(int action) + { + Socket sock1 = m_mailSocket; + byte[] toSend = System.Text.ASCIIEncoding.ASCII.GetBytes(""); + if (sock1.Connected == true) + { + switch (action) + { + case (int)MailAction.MAIL_SEND_LIST: // send user + toSend = System.Text.ASCIIEncoding.ASCII.GetBytes("list " + Convert.ToString(m_mailNumber) + _CRLF_); + break; + case (int)MailAction.MAIL_SEND_CAPABILITIES: //check capabilities (to this date, only used to verify if server supports STARTTLS) + toSend = System.Text.ASCIIEncoding.ASCII.GetBytes("capa" + _CRLF_); + break; + case (int)MailAction.MAIL_SEND_STARTTLS: //authenticate through explicit SSL/TLS + toSend = System.Text.ASCIIEncoding.ASCII.GetBytes("stls" + _CRLF_); + break; + case (int)MailAction.MAIL_SEND_USER: // send user + toSend = System.Text.ASCIIEncoding.ASCII.GetBytes("user " + m_mb.Username + _CRLF_); + break; + case (int)MailAction.MAIL_SEND_PASS: // send pass + toSend = System.Text.ASCIIEncoding.ASCII.GetBytes("pass " + m_mb.Password + _CRLF_); + break; + case (int)MailAction.MAIL_SEND_PERFORM: // send depends on what we request in Connect() + if (m_mailAction == (int)MailAction.MAIL_SEND_STAT) + toSend = System.Text.ASCIIEncoding.ASCII.GetBytes("stat" + _CRLF_); + if (m_mailAction == (int)MailAction.MAIL_SEND_RETR) + toSend = System.Text.ASCIIEncoding.ASCII.GetBytes("retr " + Convert.ToString(m_mailNumber) + _CRLF_); + if (m_mailAction == (int)MailAction.MAIL_SEND_DELE) + toSend = System.Text.ASCIIEncoding.ASCII.GetBytes("dele " + Convert.ToString(m_mailNumber) + _CRLF_); + if (m_mailAction == (int)MailAction.MAIL_SEND_RETR_LIST) + toSend = System.Text.ASCIIEncoding.ASCII.GetBytes("list" + _CRLF_); + break; + case (int)MailAction.MAIL_SEND_QUIT: + toSend = System.Text.ASCIIEncoding.ASCII.GetBytes("QUIT" + _CRLF_); + break; + default: + toSend = System.Text.ASCIIEncoding.ASCII.GetBytes(""); + break; + } + } + //m_timeOutTimer.Start(); + if (sock1.Connected == true && action > 0 && toSend.Length > 1) + { + m_currAction = action; + AsyncCallback recieveData = new AsyncCallback(OnRecievedData); + sock1.Blocking = false; + //Log.Info(System.Text.Encoding.ASCII.GetString(toSend)); + //sock1.Poll(15000,System.Net.Sockets.SelectMode.SelectRead); + //sock1.Send(toSend,0,toSend.Length,noFlags); + if (m_TLSSecured != MailBox.NO_SSL && m_TLS_OK) + m_mailTLSStream.Write(toSend, 0, toSend.Length); + else + m_mailSocketStream.Write(toSend, 0, toSend.Length); + m_mailBuffer = System.Text.Encoding.ASCII.GetBytes(m_emptyBuffer); + m_timeOutTimer.Start(); + //sock1.BeginReceive( m_mailBuffer, 0, m_buffSize, noFlags, recieveData , sock1 ); + if (m_TLSSecured != MailBox.NO_SSL && m_TLS_OK) + m_mailTLSStream.BeginRead(m_mailBuffer, 0, m_buffSize, recieveData, m_mailTLSStream); + else + m_mailSocketStream.BeginRead(m_mailBuffer, 0, m_buffSize, recieveData, m_mailSocketStream); + } + return 0; + } + + private bool RemoteCertificateValidationCallback(Object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) + { + SslPolicyErrors errors = sslPolicyErrors; + + if (((errors & SslPolicyErrors.RemoteCertificateChainErrors) == + SslPolicyErrors.RemoteCertificateChainErrors) && UntrustedRootOK) + { + errors -= SslPolicyErrors.RemoteCertificateChainErrors; + } + + /* --> CertNameMistmatchOK is always set to false + if (((errors & SslPolicyErrors.RemoteCertificateNameMismatch) == + SslPolicyErrors.RemoteCertificateNameMismatch) && CertNameMistmatchOK) + { + errors -= SslPolicyErrors.RemoteCertificateNameMismatch; + } + */ + + if (errors == SslPolicyErrors.None) + return true; + else + return false; + + //Le serveur doit s'authentifier sans erreur + } + + private void TimeOut(object sender, System.EventArgs e) + { + + m_mailSocket.Close(); + m_ierrorNumber = (int)SocketError.ERROR_TIMEOUT; // error timeout + GotMailData(m_errorMessage, "Ready", m_ierrorNumber); // ready + + } + public void SetMailboxPath(string mailbox, string attachments) + { + m_mailFolder = mailbox; + m_attachmentFolder = attachments; + } + public Socket GetSocket + { + get { return m_mailSocket; } + } + // get a mail + protected virtual bool ServerExists(MailBox mb) + { + try + { + IPHostEntry hostIP = Dns.GetHostEntry(mb.ServerAddress); + IPAddress[] addr = hostIP.AddressList; + } + catch + { + return false; + } + return true; + } + protected virtual bool ServerExists(MailBox mb, ref IPAddress[] addr) + { + try + { + IPHostEntry hostIP = Dns.GetHostEntry(mb.ServerAddress); + string[] aliases = hostIP.Aliases; + addr = hostIP.AddressList; + } + catch + { + return false; + } + return true; + } + // email body line + bool IsBodyLine(string line) + { + return false; + } + // parse the mail + public eMail ParseMailText(string mailText, bool decodeBody) + { + eMail retMail = new eMail(); + bool isMultipartMail = false; + string mailBoundary = ""; + string multipartType = ""; + string headerCheckText = ""; + int bodyBlockOffset = 0; + ArrayList headerBlock = new ArrayList(); + ArrayList bodyBlock = new ArrayList(); + retMail.AttachmentsPath = m_attachmentFolder; + retMail.MailboxPath = m_mailFolder; + string singlePartType = ""; + Regex mailSeparator = new Regex(@_CRLF_); + InformUser(8025, ""); + try + { + string[] lines = mailSeparator.Split(mailText); + // first getting the header-block + int counter = 0; + foreach (string line in lines) + { + if (line == "") break; // the first empty line indicates header end + headerBlock.Add(line); + headerCheckText += line; + counter += 1; + } + // header ready + byte[] mailID = md5.ComputeHash(System.Text.Encoding.ASCII.GetBytes(headerCheckText), 0, headerCheckText.Length); + retMail.MailID = System.Text.Encoding.ASCII.GetString(mailID); + // + bodyBlockOffset = counter + 1; + if (decodeBody == true) + for (int i = counter + 1; i < lines.Length; i++) + bodyBlock.Add(lines[i]); + // getting the body block + foreach (string line in headerBlock) + { + string tmpText = ""; + if (Regex.Match(line, "^.*boundary=[\"]*([^\"]*).*$").Success) + mailBoundary = Regex.Replace(line, "^.*boundary=[\"]*([^\"]*).*$", "$1"); + + + if (Regex.Match(line, @"^Content-Type: (.*)$").Success) + { + tmpText = Regex.Replace(line, @"^Content-Type: (.*)$", "$1"); + if (Regex.Match(tmpText, "^multipart/.*").Success) + { isMultipartMail = true; multipartType = tmpText; } + else + singlePartType = Regex.Replace(tmpText, @"(.*);.*", "$1"); + } + // get sender + // get sender + + if (line.Length > 5) + if (line.Substring(0, 5).Equals("From:")) + { + tmpText = Regex.Replace(line, @"^From:.*[ |<]([a-z|A-Z|0-9|\.|\-|_]+@[a-z|A-Z|0-9|\.|\-|_]+).*$", "$1"); + if (tmpText != "" && retMail.From.Equals("")) + { retMail.From = tmpText; continue; } + } + // get to + if (line.Length > 3) + if (line.Substring(0, 3).Equals("To:")) + { + tmpText = Regex.Replace(line, @"^To:.*[ |<]([a-z|A-Z|0-9|\.|\-|_]+@[a-z|A-Z|0-9|\.|\-|_]+).*$", "$1"); + if (tmpText != "" && retMail.To.Equals("")) + { retMail.To = tmpText; continue; } + } + // get subject + if (line.Length > 8) + if (line.Substring(0, 8).Equals("Subject:")) + { + tmpText = Regex.Replace(line, @"^Subject: (.*)$", "$1"); + if (tmpText != "" && retMail.Subject.Equals("")) + { + tmpText = Regex.Replace(tmpText, @".*=\?.*\?.*\?(.*)\?=$", "$1"); + tmpText = Regex.Replace(tmpText, @"_", " "); + retMail.Subject += tmpText; + retMail.Subject = TextToIntText(retMail.Subject); + retMail.Subject.TrimEnd(new char[] { ' ' }); + continue; + } + } + if (retMail.Subject != "" && Regex.Match(line, @".*=\?.*\?.*\?").Success) + { + tmpText = Regex.Replace(line, @".*=\?.*\?.*\?(.*)\?=$", "$1"); + tmpText = Regex.Replace(tmpText, @"_", " "); + retMail.Subject += tmpText; + retMail.Subject.TrimEnd(new char[] { ' ' }); + retMail.Subject = TextToIntText(retMail.Subject); + } + + } + if (isMultipartMail == true && decodeBody == true)//isMultipartMail==true && + { + ArrayList boundarys = new ArrayList(); + ArrayList multiParts = new ArrayList(); + bool getAll = GetAllBoundarys(bodyBlock, mailBoundary, ref boundarys); + GetAllMultiParts(bodyBlock, boundarys, ref multiParts);// we set all the parts from the mail + if (multiParts.Count > 0) + { + int stepCount = 0; + foreach (MailMultiPart mp in multiParts) + { + stepCount++; + string mimeType = ""; + string mimeSubType = ""; + string contentType = mp.contentType.Replace(";", ""); + string[] splitter = contentType.Split(new char[] { '/' }); + InformUser(8025, " (step " + Convert.ToString(stepCount) + "/" + Convert.ToString(multiParts.Count) + ")"); + if (splitter.Length > 0) + { + string path = m_attachmentFolder + @"\"; + mimeType = splitter[0]; + mimeSubType = splitter[1]; + string tmpData = ""; + byte[] binData = null; + MailAttachment mailAtt = new MailAttachment(); + System.IO.FileStream fs = null; + string tmpName = ""; + if (mimeType != "image" && mimeType != "multipart") + { + string[] splitt = mp.fileName.Split(new char[] { '.' }); + if (splitt.Length > 1) + { + switch (splitt[splitt.Length - 1].ToLower()) + { + case "jpg": + case "gif": + case "png": + case "tiff": + case "bmp": + case "jpeg": + mimeType = "application"; + mimeSubType = splitt[splitt.Length - 1].ToLower(); + break; + default: + // + break; + } + } + else + { + splitt = mp.fileName.Split(new char[] { '.' }); + if (splitt.Length > 1) + { + switch (splitt[splitt.Length - 1].ToLower()) + { + case "jpg": + case "gif": + case "png": + case "tiff": + case "bmp": + case "jpeg": + mimeType = "application"; + mimeSubType = splitt[splitt.Length - 1].ToLower(); + break; + default: + // + break; + } + } + + } + } + switch (mimeType) + { + + case "text": // here are the plain and html body we want + if (mp.contentDisposition == "") // not an attachment + {... [truncated message content] |
From: <che...@us...> - 2008-04-26 20:05:18
|
Revision: 1727 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1727&view=rev Author: chef_koch Date: 2008-04-26 13:05:15 -0700 (Sat, 26 Apr 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/FritzBox/FritzBox/FritzBox.csproj trunk/plugins/MyPrograms/MyPrograms.csproj Modified: trunk/plugins/FritzBox/FritzBox/FritzBox.csproj =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzBox.csproj 2008-04-26 19:56:41 UTC (rev 1726) +++ trunk/plugins/FritzBox/FritzBox/FritzBox.csproj 2008-04-26 20:05:15 UTC (rev 1727) @@ -46,27 +46,11 @@ <ErrorReport>prompt</ErrorReport> </PropertyGroup> <ItemGroup> - <Reference Include="Core, Version=0.2.2.9991, Culture=neutral, processorArchitecture=x86"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\mediaportal\xbmc\bin\Release\Core.dll</HintPath> - </Reference> - <Reference Include="Dialogs, Version=0.2.2.9991, Culture=neutral, processorArchitecture=x86"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\mediaportal\xbmc\bin\Release\plugins\Windows\Dialogs.dll</HintPath> - </Reference> <Reference Include="System" /> <Reference Include="System.Data" /> <Reference Include="System.Drawing" /> <Reference Include="System.Windows.Forms" /> <Reference Include="System.Xml" /> - <Reference Include="Utils, Version=0.2.2.9991, Culture=neutral, processorArchitecture=x86"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\mediaportal\xbmc\bin\Release\Utils.dll</HintPath> - </Reference> - <Reference Include="WindowPlugins, Version=0.2.2.9991, Culture=neutral, processorArchitecture=x86"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\mediaportal\xbmc\bin\Release\plugins\Windows\WindowPlugins.dll</HintPath> - </Reference> </ItemGroup> <ItemGroup> <Compile Include="Caller.cs" /> @@ -107,6 +91,24 @@ <CopyToOutputDirectory>Always</CopyToOutputDirectory> </Content> </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\..\..\mediaportal\Core\Core.csproj"> + <Project>{02FFFC1F-2555-4B99-8B01-3432D0673855}</Project> + <Name>Core</Name> + </ProjectReference> + <ProjectReference Include="..\..\..\mediaportal\Dialogs\Dialogs.csproj"> + <Project>{396C5208-5D46-4A11-92C1-FD0F2F42D7DD}</Project> + <Name>Dialogs</Name> + </ProjectReference> + <ProjectReference Include="..\..\..\mediaportal\Utils\Utils.csproj"> + <Project>{6DA0E4DF-6230-4642-98B5-E690BB6942BB}</Project> + <Name>Utils</Name> + </ProjectReference> + <ProjectReference Include="..\..\..\mediaportal\WindowPlugins\WindowPlugins.csproj"> + <Project>{B282C55B-A37B-4CEC-A4FC-00791069BF00}</Project> + <Name>WindowPlugins</Name> + </ProjectReference> + </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. Modified: trunk/plugins/MyPrograms/MyPrograms.csproj =================================================================== --- trunk/plugins/MyPrograms/MyPrograms.csproj 2008-04-26 19:56:41 UTC (rev 1726) +++ trunk/plugins/MyPrograms/MyPrograms.csproj 2008-04-26 20:05:15 UTC (rev 1727) @@ -30,7 +30,7 @@ <ItemGroup> <Reference Include="Microsoft.DirectX.Direct3D, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\MediaPortal.Base\Microsoft.DirectX.Direct3D.dll</HintPath> + <HintPath>..\..\mediaportal\MediaPortal.Base\Microsoft.DirectX.Direct3D.dll</HintPath> </Reference> <Reference Include="System" /> <Reference Include="System.Data" /> @@ -135,19 +135,19 @@ <Compile Include="Properties\AssemblyInfo.cs" /> </ItemGroup> <ItemGroup> - <ProjectReference Include="..\..\..\Core\Core.csproj"> + <ProjectReference Include="..\..\mediaportal\Core\Core.csproj"> <Project>{02FFFC1F-2555-4B99-8B01-3432D0673855}</Project> <Name>Core</Name> </ProjectReference> - <ProjectReference Include="..\..\..\Databases\Databases.csproj"> + <ProjectReference Include="..\..\mediaportal\Databases\Databases.csproj"> <Project>{C1BCEC3E-6074-4328-B5D9-391A457C8FFB}</Project> <Name>Databases</Name> </ProjectReference> - <ProjectReference Include="..\..\..\Dialogs\Dialogs.csproj"> + <ProjectReference Include="..\..\mediaportal\Dialogs\Dialogs.csproj"> <Project>{396C5208-5D46-4A11-92C1-FD0F2F42D7DD}</Project> <Name>Dialogs</Name> </ProjectReference> - <ProjectReference Include="..\..\..\Utils\Utils.csproj"> + <ProjectReference Include="..\..\mediaportal\Utils\Utils.csproj"> <Project>{6DA0E4DF-6230-4642-98B5-E690BB6942BB}</Project> <Name>Utils</Name> </ProjectReference> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2008-04-27 06:48:10
|
Revision: 1730 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1730&view=rev Author: framug Date: 2008-04-26 23:48:08 -0700 (Sat, 26 Apr 2008) Log Message: ----------- - local copy reference dll = false Modified Paths: -------------- trunk/plugins/MultiShortcut/DLLFix/DLLFix.csproj trunk/plugins/MultiShortcut/MultiShortcut/MultiShortcut.csproj trunk/plugins/MultiShortcut/TestServer/TestServer.csproj trunk/plugins/MyExplorer/My Explorer.csproj trunk/plugins/MyStatus/My Status.csproj trunk/plugins/file explorer/Source/File Explorer.csproj Modified: trunk/plugins/MultiShortcut/DLLFix/DLLFix.csproj =================================================================== --- trunk/plugins/MultiShortcut/DLLFix/DLLFix.csproj 2008-04-27 06:46:29 UTC (rev 1729) +++ trunk/plugins/MultiShortcut/DLLFix/DLLFix.csproj 2008-04-27 06:48:08 UTC (rev 1730) @@ -32,6 +32,7 @@ <Reference Include="Core, Version=1.0.2587.38185, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>..\..\..\MediaPortal\Core\bin\Release\Core.dll</HintPath> + <Private>False</Private> </Reference> <Reference Include="System" /> <Reference Include="System.Data" /> @@ -45,6 +46,7 @@ <ProjectReference Include="..\MultiShortcut\MultiShortcut.csproj"> <Project>{7CBDA33F-E11F-400B-8B3F-ABB0B54462AC}</Project> <Name>MultiShortcut</Name> + <Private>False</Private> </ProjectReference> </ItemGroup> <ItemGroup> Modified: trunk/plugins/MultiShortcut/MultiShortcut/MultiShortcut.csproj =================================================================== --- trunk/plugins/MultiShortcut/MultiShortcut/MultiShortcut.csproj 2008-04-27 06:46:29 UTC (rev 1729) +++ trunk/plugins/MultiShortcut/MultiShortcut/MultiShortcut.csproj 2008-04-27 06:48:08 UTC (rev 1730) @@ -31,14 +31,17 @@ <Reference Include="Core, Version=1.0.2587.38185, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>..\..\..\MediaPortal\Core\bin\Release\Core.dll</HintPath> + <Private>False</Private> </Reference> <Reference Include="Databases, Version=1.0.2587.38186, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>..\..\..\MediaPortal\Databases\bin\Release\Databases.dll</HintPath> + <Private>False</Private> </Reference> <Reference Include="Dialogs, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>..\..\..\MediaPortal\Dialogs\bin\Release\Dialogs.dll</HintPath> + <Private>False</Private> </Reference> <Reference Include="System" /> <Reference Include="System.Data" /> @@ -48,6 +51,7 @@ <Reference Include="Utils, Version=1.0.2587.38184, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>..\..\..\MediaPortal\Utils\bin\Release\Utils.dll</HintPath> + <Private>False</Private> </Reference> </ItemGroup> <ItemGroup> Modified: trunk/plugins/MultiShortcut/TestServer/TestServer.csproj =================================================================== --- trunk/plugins/MultiShortcut/TestServer/TestServer.csproj 2008-04-27 06:46:29 UTC (rev 1729) +++ trunk/plugins/MultiShortcut/TestServer/TestServer.csproj 2008-04-27 06:48:08 UTC (rev 1730) @@ -31,6 +31,7 @@ <Reference Include="Core, Version=1.0.2587.38185, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>..\..\..\MediaPortal\Core\bin\Release\Core.dll</HintPath> + <Private>False</Private> </Reference> <Reference Include="System" /> <Reference Include="System.Data" /> @@ -44,6 +45,7 @@ <ProjectReference Include="..\MultiShortcut\MultiShortcut.csproj"> <Project>{7CBDA33F-E11F-400B-8B3F-ABB0B54462AC}</Project> <Name>MultiShortcut</Name> + <Private>False</Private> </ProjectReference> </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> Modified: trunk/plugins/MyExplorer/My Explorer.csproj =================================================================== --- trunk/plugins/MyExplorer/My Explorer.csproj 2008-04-27 06:46:29 UTC (rev 1729) +++ trunk/plugins/MyExplorer/My Explorer.csproj 2008-04-27 06:48:08 UTC (rev 1730) @@ -31,10 +31,12 @@ <Reference Include="Core, Version=1.0.2590.13808, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>..\..\MediaPortal\Core\bin\Release\Core.dll</HintPath> + <Private>False</Private> </Reference> <Reference Include="Dialogs, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>..\..\MediaPortal\Dialogs\bin\Release\Dialogs.dll</HintPath> + <Private>False</Private> </Reference> <Reference Include="System" /> <Reference Include="System.Data" /> @@ -44,6 +46,7 @@ <Reference Include="Utils, Version=1.0.2590.13806, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>..\..\MediaPortal\Utils\bin\Release\Utils.dll</HintPath> + <Private>False</Private> </Reference> </ItemGroup> <ItemGroup> Modified: trunk/plugins/MyStatus/My Status.csproj =================================================================== --- trunk/plugins/MyStatus/My Status.csproj 2008-04-27 06:46:29 UTC (rev 1729) +++ trunk/plugins/MyStatus/My Status.csproj 2008-04-27 06:48:08 UTC (rev 1730) @@ -31,14 +31,17 @@ <Reference Include="Core, Version=1.0.2590.13808, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>..\..\MediaPortal\Core\bin\Release\Core.dll</HintPath> + <Private>False</Private> </Reference> <Reference Include="Dialogs, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>..\..\MediaPortal\Dialogs\bin\Release\Dialogs.dll</HintPath> + <Private>False</Private> </Reference> <Reference Include="mbm5, Version=1.0.1778.42739, Culture=neutral"> <SpecificVersion>False</SpecificVersion> <HintPath>.\mbm5.dll</HintPath> + <Private>False</Private> </Reference> <Reference Include="System" /> <Reference Include="System.Data" /> @@ -49,6 +52,7 @@ <Reference Include="Utils, Version=1.0.2590.13806, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>..\..\MediaPortal\Utils\bin\Release\Utils.dll</HintPath> + <Private>False</Private> </Reference> </ItemGroup> <ItemGroup> Modified: trunk/plugins/file explorer/Source/File Explorer.csproj =================================================================== --- trunk/plugins/file explorer/Source/File Explorer.csproj 2008-04-27 06:46:29 UTC (rev 1729) +++ trunk/plugins/file explorer/Source/File Explorer.csproj 2008-04-27 06:48:08 UTC (rev 1730) @@ -38,23 +38,26 @@ <Reference Include="Core, Version=1.0.2590.13808, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>..\..\..\MediaPortal\Core\bin\Release\Core.dll</HintPath> + <Private>False</Private> </Reference> <Reference Include="Dialogs, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>..\..\..\MediaPortal\Dialogs\bin\Release\Dialogs.dll</HintPath> + <Private>False</Private> </Reference> <Reference Include="System" /> <Reference Include="System.Xml" /> <Reference Include="System.Drawing"> - <Private>True</Private> + <Private>False</Private> </Reference> <Reference Include="System.Windows.Forms"> - <Private>True</Private> + <Private>False</Private> </Reference> <Reference Include="Microsoft.VisualBasic" /> <Reference Include="Utils, Version=1.0.2590.13806, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>..\..\..\MediaPortal\Utils\bin\Release\Utils.dll</HintPath> + <Private>False</Private> </Reference> </ItemGroup> <ItemGroup> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2008-05-09 01:38:58
|
Revision: 1771 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1771&view=rev Author: and-81 Date: 2008-05-08 18:38:54 -0700 (Thu, 08 May 2008) Log Message: ----------- New Plugin: Cancel AutoPlay Added Paths: ----------- trunk/plugins/CancelAutoPlay/ trunk/plugins/CancelAutoPlay/AssemblyInfo.cs trunk/plugins/CancelAutoPlay/CancelAutoPlay Plugin.csproj trunk/plugins/CancelAutoPlay/CancelAutoPlay.cs Property changes on: trunk/plugins/CancelAutoPlay ___________________________________________________________________ Name: svn:ignore + bin obj Added: trunk/plugins/CancelAutoPlay/AssemblyInfo.cs =================================================================== --- trunk/plugins/CancelAutoPlay/AssemblyInfo.cs (rev 0) +++ trunk/plugins/CancelAutoPlay/AssemblyInfo.cs 2008-05-09 01:38:54 UTC (rev 1771) @@ -0,0 +1,63 @@ +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Security.Permissions; + +// +// 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("CancelAutoPlay Plugin")] +[assembly: AssemblyDescription("Prevents AutoPlay while MediaPortal is running")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("and-81")] +[assembly: AssemblyProduct("MediaPortal")] +[assembly: AssemblyCopyright("Aaron Dinnage")] +[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.4.2.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\<setupForm>. 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("")] +[assembly: ComVisibleAttribute(false)] +[assembly: AssemblyFileVersionAttribute("1.4.2.0")] Added: trunk/plugins/CancelAutoPlay/CancelAutoPlay Plugin.csproj =================================================================== --- trunk/plugins/CancelAutoPlay/CancelAutoPlay Plugin.csproj (rev 0) +++ trunk/plugins/CancelAutoPlay/CancelAutoPlay Plugin.csproj 2008-05-09 01:38:54 UTC (rev 1771) @@ -0,0 +1,71 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>8.0.50727</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{88520E4C-5C49-478A-8AFA-959B45075922}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>MediaPortal.Plugins</RootNamespace> + <AssemblyName>CancelAutoPlay</AssemblyName> + <StartupObject> + </StartupObject> + <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>false</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + <UseVSHostingProcess>false</UseVSHostingProcess> + <DocumentationFile> + </DocumentationFile> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>none</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants> + </DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + <UseVSHostingProcess>false</UseVSHostingProcess> + </PropertyGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> + <ItemGroup> + <Compile Include="AssemblyInfo.cs" /> + <Compile Include="CancelAutoPlay.cs" /> + </ItemGroup> + <ItemGroup> + <Reference Include="Core, Version=0.2.3.0, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\MediaPortal\xbmc\bin\Release\Core.dll</HintPath> + <Private>False</Private> + </Reference> + <Reference Include="System" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml" /> + <Reference Include="Utils, Version=2.2.4.0, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\MediaPortal\xbmc\bin\Release\Utils.dll</HintPath> + <Private>False</Private> + </Reference> + </ItemGroup> + <PropertyGroup> + </PropertyGroup> +</Project> \ No newline at end of file Added: trunk/plugins/CancelAutoPlay/CancelAutoPlay.cs =================================================================== --- trunk/plugins/CancelAutoPlay/CancelAutoPlay.cs (rev 0) +++ trunk/plugins/CancelAutoPlay/CancelAutoPlay.cs 2008-05-09 01:38:54 UTC (rev 1771) @@ -0,0 +1,131 @@ +using System; +using System.Runtime.InteropServices; +using System.Windows.Forms; + +using MediaPortal.GUI.Library; + +namespace MediaPortal.Plugins +{ + + /// <summary> + /// Prevents AutoPlay while MediaPortal is running. + /// </summary> + public class CancelAutoPlay : IPluginReceiver, ISetupForm + { + + #region Interop + + [DllImport("user32.dll")] + static extern uint RegisterWindowMessage(string message); + + #endregion Interop + + #region Variables + + uint _cancelAutoPlay; + + #endregion Variables + + #region IPluginReceiver Members + + public bool WndProc(ref Message msg) + { + if (msg.Msg == _cancelAutoPlay) + { + Log.Info("CancelAutoPlay: Preventing AutoPlay ..."); + + msg.Result = new IntPtr(1); + return true; + } + + return false; + } + + #endregion IPluginReceiver Members + + #region IPlugin Members + + public void Start() + { + _cancelAutoPlay = RegisterWindowMessage("QueryCancelAutoPlay"); + + Log.Info("CancelAutoPlay: Started"); + } + + public void Stop() + { + _cancelAutoPlay = 0; + + Log.Info("CancelAutoPlay: Stopped"); + } + + #endregion IPlugin Members + + #region ISetupForm methods + + /// <summary> + /// Determines whether this plugin can be enabled. + /// </summary> + /// <returns> + /// <c>true</c> if this plugin can be enabled; otherwise, <c>false</c>. + /// </returns> + public bool CanEnable() { return true; } + /// <summary> + /// Determines whether this plugin has setup. + /// </summary> + /// <returns> + /// <c>true</c> if this plugin has setup; otherwise, <c>false</c>. + /// </returns> + public bool HasSetup() { return false; } + /// <summary> + /// Gets the plugin name. + /// </summary> + /// <returns>The plugin name.</returns> + public string PluginName() { return "Cancel AutoPlay"; } + /// <summary> + /// Defaults enabled. + /// </summary> + /// <returns>true if this plugin is enabled by default, otherwise false.</returns> + public bool DefaultEnabled() { return true; } + /// <summary> + /// Gets the window id. + /// </summary> + /// <returns>The window id.</returns> + public int GetWindowId() { return 0; } + /// <summary> + /// Gets the plugin author. + /// </summary> + /// <returns>The plugin author.</returns> + public string Author() { return "and-81"; } + /// <summary> + /// Gets the description of the plugin. + /// </summary> + /// <returns>The plugin description.</returns> + public string Description() { return "Prevents AutoPlay while MediaPortal is running"; } + + /// <summary> + /// Shows the plugin configuration. + /// </summary> + public void ShowPlugin() + { + } + + /// <summary> + /// Gets the home screen details for the plugin. + /// </summary> + /// <param name="strButtonText">The button text.</param> + /// <param name="strButtonImage">The button image.</param> + /// <param name="strButtonImageFocus">The button image focus.</param> + /// <param name="strPictureImage">The picture image.</param> + /// <returns>true if the plugin can be seen, otherwise false.</returns> + public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) + { + strButtonText = strButtonImage = strButtonImageFocus = strPictureImage = String.Empty; + return false; + } + + #endregion ISetupForm methods + + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ze...@us...> - 2008-05-16 22:05:34
|
Revision: 1779 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1779&view=rev Author: zebons Date: 2008-05-16 15:05:31 -0700 (Fri, 16 May 2008) Log Message: ----------- amcupdater v 0.6.2 Added Paths: ----------- trunk/plugins/amcupdater/ trunk/plugins/amcupdater/AMCUpdater/ trunk/plugins/amcupdater/AMCUpdater/AMCUpdater.config trunk/plugins/amcupdater/AMCUpdater/AMCUpdater.ico trunk/plugins/amcupdater/AMCUpdater/AMCUpdater.vbproj trunk/plugins/amcupdater/AMCUpdater/AMCUpdater.vbproj.user trunk/plugins/amcupdater/AMCUpdater/AntProcessor.vb trunk/plugins/amcupdater/AMCUpdater/AntProcessor.vb.bak trunk/plugins/amcupdater/AMCUpdater/AntRecord.vb trunk/plugins/amcupdater/AMCUpdater/AntRecord.vb.bak trunk/plugins/amcupdater/AMCUpdater/ApplicationEvents.vb trunk/plugins/amcupdater/AMCUpdater/FileFolderEnum.vb trunk/plugins/amcupdater/AMCUpdater/Form1.Designer.vb trunk/plugins/amcupdater/AMCUpdater/Form1.Designer.vb.bak trunk/plugins/amcupdater/AMCUpdater/Form1.resx trunk/plugins/amcupdater/AMCUpdater/Form1.vb trunk/plugins/amcupdater/AMCUpdater/MediaInfo.dll trunk/plugins/amcupdater/AMCUpdater/MediaInfoDLL.vb trunk/plugins/amcupdater/AMCUpdater/Module1.vb trunk/plugins/amcupdater/AMCUpdater/My Project/ trunk/plugins/amcupdater/AMCUpdater/My Project/Application.Designer.vb trunk/plugins/amcupdater/AMCUpdater/My Project/Application.myapp trunk/plugins/amcupdater/AMCUpdater/My Project/AssemblyInfo.vb trunk/plugins/amcupdater/AMCUpdater/My Project/Resources.Designer.vb trunk/plugins/amcupdater/AMCUpdater/My Project/Resources.resx trunk/plugins/amcupdater/AMCUpdater/My Project/Settings.Designer.vb trunk/plugins/amcupdater/AMCUpdater/My Project/Settings.settings trunk/plugins/amcupdater/AMCUpdater/MyFilmsAlloCine.xml trunk/plugins/amcupdater/AMCUpdater/Settings.vb trunk/plugins/amcupdater/AMCUpdater/app.config trunk/plugins/amcupdater/AMCUpdater/dgLogWindow.Designer.vb trunk/plugins/amcupdater/AMCUpdater/dgLogWindow.resx trunk/plugins/amcupdater/AMCUpdater/dgLogWindow.vb trunk/plugins/amcupdater/AMCUpdater/frmAbout.Designer.vb trunk/plugins/amcupdater/AMCUpdater/frmAbout.resx trunk/plugins/amcupdater/AMCUpdater/frmAbout.vb trunk/plugins/amcupdater/AMCUpdater/frmList.Designer.vb trunk/plugins/amcupdater/AMCUpdater/frmList.resx trunk/plugins/amcupdater/AMCUpdater/frmList.vb trunk/plugins/amcupdater/AMCUpdater/frmOptions.Designer.vb trunk/plugins/amcupdater/AMCUpdater/frmOptions.resx trunk/plugins/amcupdater/AMCUpdater/frmOptions.vb trunk/plugins/amcupdater/AMCUpdater.sln trunk/plugins/amcupdater/AMCUpdater.suo trunk/plugins/amcupdater/Core.dll trunk/plugins/amcupdater/MediaInfo.dll trunk/plugins/amcupdater/Utils.dll trunk/plugins/amcupdater/grabber.dll Added: trunk/plugins/amcupdater/AMCUpdater/AMCUpdater.config =================================================================== --- trunk/plugins/amcupdater/AMCUpdater/AMCUpdater.config (rev 0) +++ trunk/plugins/amcupdater/AMCUpdater/AMCUpdater.config 2008-05-16 22:05:31 UTC (rev 1779) @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="utf-8" ?> +<configuration> + <system.diagnostics> + <sources> + <!-- This section defines the logging configuration for My.Application.Log --> + <source name="DefaultSource" switchName="DefaultSwitch"> + <listeners> + <add name="FileLog"/> + <!-- Uncomment the below section to write to the Application Event Log --> + <!--<add name="EventLog"/>--> + </listeners> + </source> + </sources> + <switches> + <add name="DefaultSwitch" value="Information" /> + </switches> + <sharedListeners> + <add name="FileLog" + type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" + initializeData="FileLogWriter"/> + <!-- Uncomment the below section and replace APPLICATION_NAME with the name of your application to write to the Application Event Log --> + <!--<add name="EventLog" type="System.Diagnostics.EventLogTraceListener" initializeData="APPLICATION_NAME"/> --> + </sharedListeners> + </system.diagnostics> +</configuration> Added: trunk/plugins/amcupdater/AMCUpdater/AMCUpdater.ico =================================================================== (Binary files differ) Property changes on: trunk/plugins/amcupdater/AMCUpdater/AMCUpdater.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/amcupdater/AMCUpdater/AMCUpdater.vbproj =================================================================== --- trunk/plugins/amcupdater/AMCUpdater/AMCUpdater.vbproj (rev 0) +++ trunk/plugins/amcupdater/AMCUpdater/AMCUpdater.vbproj 2008-05-16 22:05:31 UTC (rev 1779) @@ -0,0 +1,211 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>8.0.50727</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{6B6B4D52-6F95-4ACD-9F65-9AB06D8F9DF4}</ProjectGuid> + <OutputType>WinExe</OutputType> + <StartupObject>AMCUpdater.My.MyApplication</StartupObject> + <RootNamespace>AMCUpdater</RootNamespace> + <AssemblyName>AMCUpdater</AssemblyName> + <MyType>WindowsForms</MyType> + <ApplicationIcon>AMCUpdater.ico</ApplicationIcon> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <DefineDebug>true</DefineDebug> + <DefineTrace>true</DefineTrace> + <OutputPath>bin\Any CPU\Debug\</OutputPath> + <DocumentationFile> + </DocumentationFile> + <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <DefineDebug>false</DefineDebug> + <DefineTrace>true</DefineTrace> + <Optimize>true</Optimize> + <OutputPath>bin\Any CPU\Release\</OutputPath> + <DocumentationFile> + </DocumentationFile> + <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn> + <UseVSHostingProcess>false</UseVSHostingProcess> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' "> + <DebugSymbols>true</DebugSymbols> + <DefineDebug>true</DefineDebug> + <DefineTrace>true</DefineTrace> + <OutputPath>bin\x64\Debug\</OutputPath> + <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn> + <DebugType>full</DebugType> + <PlatformTarget>x64</PlatformTarget> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' "> + <DefineTrace>true</DefineTrace> + <OutputPath>bin\x64\Release\</OutputPath> + <Optimize>true</Optimize> + <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn> + <DebugType>pdbonly</DebugType> + <PlatformTarget>x64</PlatformTarget> + <UseVSHostingProcess>false</UseVSHostingProcess> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> + <DebugSymbols>true</DebugSymbols> + <DefineDebug>true</DefineDebug> + <DefineTrace>true</DefineTrace> + <OutputPath>bin\x86\Debug\</OutputPath> + <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn> + <DebugType>full</DebugType> + <PlatformTarget>x86</PlatformTarget> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> + <DefineTrace>true</DefineTrace> + <OutputPath>bin\x86\Release\</OutputPath> + <Optimize>true</Optimize> + <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn> + <DebugType>pdbonly</DebugType> + <PlatformTarget>x86</PlatformTarget> + <UseVSHostingProcess>false</UseVSHostingProcess> + </PropertyGroup> + <ItemGroup> + <Reference Include="Core, Version=0.2.3.17991, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\Core.dll</HintPath> + </Reference> + <Reference Include="grabber, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\grabber.dll</HintPath> + </Reference> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Deployment" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml" /> + <Reference Include="Utils, Version=0.2.3.17991, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\Utils.dll</HintPath> + </Reference> + </ItemGroup> + <ItemGroup> + <Import Include="Microsoft.VisualBasic" /> + <Import Include="System" /> + <Import Include="System.Collections" /> + <Import Include="System.Collections.Generic" /> + <Import Include="System.Data" /> + <Import Include="System.Diagnostics" /> + <Import Include="System.IO" /> + <Import Include="System.Text.RegularExpressions" /> + <Import Include="System.Threading" /> + </ItemGroup> + <ItemGroup> + <Compile Include="AntProcessor.vb" /> + <Compile Include="AntRecord.vb" /> + <Compile Include="ApplicationEvents.vb" /> + <Compile Include="dgLogWindow.Designer.vb"> + <DependentUpon>dgLogWindow.vb</DependentUpon> + </Compile> + <Compile Include="dgLogWindow.vb"> + <SubType>Form</SubType> + </Compile> + <Compile Include="FileFolderEnum.vb" /> + <Compile Include="frmAbout.Designer.vb"> + <DependentUpon>frmAbout.vb</DependentUpon> + </Compile> + <Compile Include="frmAbout.vb"> + <SubType>Form</SubType> + </Compile> + <Compile Include="Form1.Designer.vb"> + <DependentUpon>Form1.vb</DependentUpon> + </Compile> + <Compile Include="Form1.vb"> + <SubType>Form</SubType> + </Compile> + <Compile Include="frmList.Designer.vb"> + <DependentUpon>frmList.vb</DependentUpon> + </Compile> + <Compile Include="frmList.vb"> + <SubType>Form</SubType> + </Compile> + <Compile Include="frmOptions.Designer.vb"> + <DependentUpon>frmOptions.vb</DependentUpon> + </Compile> + <Compile Include="frmOptions.vb"> + <SubType>Form</SubType> + </Compile> + <Compile Include="MediaInfoDLL.vb" /> + <Compile Include="Module1.vb" /> + <Compile Include="My Project\AssemblyInfo.vb" /> + <Compile Include="My Project\Application.Designer.vb"> + <AutoGen>True</AutoGen> + <DependentUpon>Application.myapp</DependentUpon> + </Compile> + <Compile Include="My Project\Resources.Designer.vb"> + <AutoGen>True</AutoGen> + <DesignTime>True</DesignTime> + <DependentUpon>Resources.resx</DependentUpon> + </Compile> + <Compile Include="My Project\Settings.Designer.vb"> + <AutoGen>True</AutoGen> + <DependentUpon>Settings.settings</DependentUpon> + <DesignTimeSharedInput>True</DesignTimeSharedInput> + </Compile> + <Compile Include="Settings.vb" /> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="dgLogWindow.resx"> + <SubType>Designer</SubType> + <DependentUpon>dgLogWindow.vb</DependentUpon> + </EmbeddedResource> + <EmbeddedResource Include="frmAbout.resx"> + <SubType>Designer</SubType> + <DependentUpon>frmAbout.vb</DependentUpon> + </EmbeddedResource> + <EmbeddedResource Include="Form1.resx"> + <SubType>Designer</SubType> + <DependentUpon>Form1.vb</DependentUpon> + </EmbeddedResource> + <EmbeddedResource Include="frmList.resx"> + <SubType>Designer</SubType> + <DependentUpon>frmList.vb</DependentUpon> + </EmbeddedResource> + <EmbeddedResource Include="frmOptions.resx"> + <SubType>Designer</SubType> + <DependentUpon>frmOptions.vb</DependentUpon> + </EmbeddedResource> + <EmbeddedResource Include="My Project\Resources.resx"> + <Generator>VbMyResourcesResXFileCodeGenerator</Generator> + <LastGenOutput>Resources.Designer.vb</LastGenOutput> + <CustomToolNamespace>My.Resources</CustomToolNamespace> + <SubType>Designer</SubType> + </EmbeddedResource> + </ItemGroup> + <ItemGroup> + <None Include="AMCUpdater.config" /> + <None Include="app.config" /> + <None Include="My Project\Application.myapp"> + <Generator>MyApplicationCodeGenerator</Generator> + <LastGenOutput>Application.Designer.vb</LastGenOutput> + </None> + <None Include="My Project\Settings.settings"> + <Generator>SettingsSingleFileGenerator</Generator> + <CustomToolNamespace>My</CustomToolNamespace> + <LastGenOutput>Settings.Designer.vb</LastGenOutput> + </None> + </ItemGroup> + <ItemGroup> + <Content Include="AMCUpdater.ico" /> + <Content Include="Symbol New.png" /> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.VisualBasic.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> \ No newline at end of file Added: trunk/plugins/amcupdater/AMCUpdater/AMCUpdater.vbproj.user =================================================================== --- trunk/plugins/amcupdater/AMCUpdater/AMCUpdater.vbproj.user (rev 0) +++ trunk/plugins/amcupdater/AMCUpdater/AMCUpdater.vbproj.user 2008-05-16 22:05:31 UTC (rev 1779) @@ -0,0 +1,26 @@ +<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <PublishUrlHistory>http://localhost/AMCUpdater/|http://localhost/AMCRobot/|http://localhost/AMC_Robot/</PublishUrlHistory> + <InstallUrlHistory> + </InstallUrlHistory> + <SupportUrlHistory> + </SupportUrlHistory> + <UpdateUrlHistory> + </UpdateUrlHistory> + <BootstrapperUrlHistory> + </BootstrapperUrlHistory> + <ApplicationRevision>0</ApplicationRevision> + <FallbackCulture>en-US</FallbackCulture> + <VerifyUploadedFiles>true</VerifyUploadedFiles> + <ProjectView>ShowAllFiles</ProjectView> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <StartArguments> + </StartArguments> + <EnableUnmanagedDebugging>false</EnableUnmanagedDebugging> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <StartArguments> + </StartArguments> + </PropertyGroup> +</Project> \ No newline at end of file Added: trunk/plugins/amcupdater/AMCUpdater/AntProcessor.vb =================================================================== --- trunk/plugins/amcupdater/AMCUpdater/AntProcessor.vb (rev 0) +++ trunk/plugins/amcupdater/AMCUpdater/AntProcessor.vb 2008-05-16 22:05:31 UTC (rev 1779) @@ -0,0 +1,1783 @@ +Imports System.Threading +Imports System.Xml +Imports System.ComponentModel + +Public Class AntProcessor + + Private Shared WithEvents backgroundWorker1 As New System.ComponentModel.BackgroundWorker + + Private Shared ds As DataSet + + Private Shared XMLDoc As Xml.XmlDocument = New Xml.XmlDocument + + Private Shared _XMLFilePath As String + Private Shared _OverridePath As String + Private Shared _AntSourceField As String = "Source" + Private Shared _FoldersToScan As String + Private Shared _CheckForDVDFolders As Boolean + Private Shared _CountXMLRecords As Integer + Private Shared _CountOrphanFiles As Integer = 0 + Private Shared _CountOrphanRecords As Integer = 0 + Private Shared _CountRecordsAdded As Integer = 0 + Private Shared _CountRecordsDeleted As Integer = 0 + Private Shared _CountMultiPartFiles As Integer = 0 + Private Shared _CountMultiPartFilesMerged As Integer = 0 + + Private Shared _IsMultiFolderScan As Boolean + + Private Shared _OverwriteXMLFile As Boolean = False + Private Shared _PurgeOrphanRecords As Boolean + Private Shared _AntMediaLabel As String = "" + Private Shared _AntMediaType As String = "" + Private Shared _BackupXMLFile As Boolean = True + Private Shared _NextAntID As Integer + + Private Shared _ManualFieldName As String + Private Shared _ManualFieldValue As String + Private Shared _ManualOperation As String + Private Shared _ManualParameterField As String + Private Shared _ManualParameterOperator As String + Private Shared _ManualParameterValue As String + Private Shared _ManualParameterMatchAll As Boolean + + Private Shared _blShortNames As Boolean + Private Shared _ExcludePath As String + Private Shared _MultiPath As String + Private Shared _ParserPath As String + + Public ReadOnly Property CountXMLRecords() As Integer + Get + _CountXMLRecords = 0 + _CountXMLRecords = ds.Tables("tblXML").Rows.Count + Return _CountXMLRecords + End Get + End Property + Public ReadOnly Property CountFilesFound() As Integer + Get + Dim FileCount As Integer = 0 + If ds.Tables("tblFoundMediaFiles") IsNot Nothing Then + FileCount += ds.Tables("tblFoundMediaFiles").Rows.Count + End If + If ds.Tables("tblFoundNonMediaFiles") IsNot Nothing Then + FileCount += ds.Tables("tblFoundNonMediaFiles").Rows.Count + End If + Return FileCount + End Get + End Property + Public ReadOnly Property CountOrphanFiles() As Integer + Get + _CountOrphanFiles = 0 + If ds.Tables("tblOrphanedMediaFiles") IsNot Nothing Then + _CountOrphanFiles += ds.Tables("tblOrphanedMediaFiles").Rows.Count + End If + If ds.Tables("tblOrphanedNonMediaFiles") IsNot Nothing Then + _CountOrphanFiles += ds.Tables("tblOrphanedNonMediaFiles").Rows.Count + End If + + Return _CountOrphanFiles + End Get + End Property + Public ReadOnly Property CountOrphanRecords() As Integer + Get + _CountOrphanRecords = 0 + If ds.Tables("tblOrphanedAntRecords").Rows.Count > 0 Then + _CountOrphanRecords = ds.Tables("tblOrphanedAntRecords").Rows.Count + End If + + Return _CountOrphanRecords + End Get + End Property + Public ReadOnly Property CountRecordsAdded() As Integer + Get + Return _CountRecordsAdded + End Get + End Property + Public ReadOnly Property CountRecordsDeleted() As Integer + Get + Return _CountRecordsDeleted + End Get + End Property + Public ReadOnly Property CountMultiPartFiles() As Integer + Get + If ds.Tables("tblMultiPartFiles") IsNot Nothing Then + _CountMultiPartFiles = ds.Tables("tblMultiPartFiles").Rows.Count + End If + + Return _CountMultiPartFiles + End Get + End Property + Public ReadOnly Property CountMultiPartFilesMerged() As Integer + Get + Return _CountMultiPartFilesMerged + End Get + End Property + + Public ReadOnly Property GetAntFieldNames() As DataTable + Get + 'If ds.Tables("tblAntFields") IsNot Nothing Then + Dim dt As DataTable = ds.Tables("tblAntFields") + 'Return ds.Tables("tblAntFields") + Return dt + 'End If + End Get + End Property + + Public Property CheckForDVDFolders() As Boolean + Get + Return _CheckForDVDFolders + End Get + Set(ByVal value As Boolean) + _CheckForDVDFolders = value + End Set + End Property + Public Property XMLFilePath() As String + Get + Return _XMLFilePath + End Get + Set(ByVal Value As String) + _XMLFilePath = Value + End Set + End Property + Public Property OverridePath() As String + Get + Return _OverridePath + End Get + Set(ByVal Value As String) + _OverridePath = Value + End Set + End Property + Public Property AntSourceField() As String + Get + Return _AntSourceField + End Get + Set(ByVal Value As String) + _AntSourceField = Value + End Set + End Property + Public Property FoldersToScan() As String + Get + Return _FoldersToScan + End Get + Set(ByVal Value As String) + _FoldersToScan = Value + If _FoldersToScan.IndexOf(";") >= 0 Then + _IsMultiFolderScan = True + Else + _IsMultiFolderScan = False + End If + End Set + End Property + Public Property OverwriteXMLFile() As Boolean + Get + Return _OverwriteXMLFile + End Get + Set(ByVal value As Boolean) + _OverwriteXMLFile = value + End Set + End Property + Public Property PurgeOrphanRecords() As Boolean + Get + Return _PurgeOrphanRecords + End Get + Set(ByVal value As Boolean) + _PurgeOrphanRecords = value + End Set + End Property + Public Property AntMediaType() As String + Get + Return _AntMediaType + End Get + Set(ByVal value As String) + _AntMediaType = value + End Set + End Property + Public Property AntMediaLabel() As String + Get + Return _AntMediaLabel + End Get + Set(ByVal value As String) + _AntMediaLabel = value + End Set + End Property + Public Property BackupXMLFile() As Boolean + Get + Return _BackupXMLFile + End Get + Set(ByVal value As Boolean) + _BackupXMLFile = value + End Set + End Property + + Public Property ManualFieldName() As String + Get + Return _ManualFieldName + End Get + Set(ByVal value As String) + _ManualFieldName = value + End Set + End Property + Public Property ManualFieldValue() As String + Get + Return _ManualFieldValue + End Get + Set(ByVal value As String) + _ManualFieldValue = value + End Set + End Property + Public Property ManualOperation() As String + Get + Return _ManualOperation + End Get + Set(ByVal value As String) + _ManualOperation = value + End Set + End Property + Public Property ManualParameterField() As String + Get + Return _ManualParameterField + End Get + Set(ByVal value As String) + _ManualParameterField = value + End Set + End Property + Public Property ManualParameterOperator() As String + Get + Return _ManualParameterOperator + End Get + Set(ByVal value As String) + _ManualParameterOperator = value + End Set + End Property + Public Property ManualParameterValue() As String + Get + Return _ManualParameterValue + End Get + Set(ByVal value As String) + _ManualParameterValue = value + End Set + End Property + Public Property ManualParameterMatchAll() As Boolean + Get + Return _ManualParameterMatchAll + End Get + Set(ByVal value As Boolean) + _ManualParameterMatchAll = value + End Set + End Property + Public ReadOnly Property ManualTestResultCount() As Integer + Get + If ds.Tables("tblNodesToProcess") Is Nothing Then + Return 0 + Else + Return ds.Tables("tblNodesToProcess").Rows.Count + End If + End Get + End Property + + Public Property blShortNames() As Boolean + Get + Return _blShortNames + End Get + Set(ByVal value As Boolean) + _blShortNames = value + End Set + End Property + Public Property ExcludePath() As String + Get + Return _ExcludePath + End Get + Set(ByVal value As String) + _ExcludePath = value + End Set + End Property + Public Property MultiPath() As String + Get + Return _MultiPath + End Get + Set(ByVal value As String) + _MultiPath = value + End Set + End Property + Public Property ParserPath() As String + Get + Return _ParserPath + End Get + Set(ByVal value As String) + _ParserPath = value + End Set + End Property + + Public Sub ManualTestOperation() + + '_ManualOperation = 'Update Value', 'Delete Record', 'Delete Value', 'Scan Media Data' + '_ManualFieldName = For Update or Delete Value + '_ManualFieldValue = as above + '_ManualParameterField = ant field to check + '_ManualParameterOperator = '=', '!=', 'EXISTS', 'NOT EXISTS' + '_ManualParameterValue = value to set. + '_ManualParameterMatchAll = ignore params and match all + + 'Dim NodesToProcess As New ArrayList() + Dim TextReader As Xml.XmlTextReader + TextReader = New Xml.XmlTextReader(_XMLFilePath) + Dim CurrentNode As Xml.XmlNode + + 'Update a value = check if attribute exists and update it - + 'Delete a record - check the parameter and delete if match. - + 'Delete Value = check if attribute exists and delete it - + + fnLogEvent("Manual Database Operation Starting", 3) + fnLogEvent(" - Operation : " & _ManualOperation.ToString, 3) + fnLogEvent(" - Field to Update : " & _ManualFieldName.ToString, 3) + fnLogEvent(" - Value to Set : " & _ManualFieldValue.ToString, 3) + If _ManualParameterMatchAll = True Then + fnLogEvent(" - Parameters - Match All Records : True", 3) + Else + fnLogEvent(" - Parameters - Field to Check : " & _ManualParameterField.ToString, 3) + fnLogEvent(" - Parameters - Operator : " & _ManualParameterOperator.ToString, 3) + fnLogEvent(" - Parameters - Value to Find : " & _ManualParameterValue.ToString, 3) + End If + + Dim XmlDoc As New XmlDocument + XmlDoc.Load(_XMLFilePath) + Dim CurrentMovieNumber As Integer + + While TextReader.Read() + If TextReader.Name = "Movie" Then + CurrentMovieNumber = TextReader.GetAttribute("Number") + + If _ManualParameterMatchAll = True Then + 'We're matching all records - proceed with editing + CurrentNode = XmlDoc.SelectSingleNode("//AntMovieCatalog/Catalog/Contents/Movie[@Number='" & CurrentMovieNumber.ToString & "']") + ds.Tables("tblNodesToProcess").Rows.Add(New Object() {CurrentMovieNumber, CurrentNode.Attributes("OriginalTitle").Value}) + fnLogEvent(" - Entry to process : " & CurrentMovieNumber.ToString & " | " & CurrentNode.Attributes("OriginalTitle").Value, 3) + Else + 'Parameters in use - check first then proceed + CurrentNode = XmlDoc.SelectSingleNode("//AntMovieCatalog/Catalog/Contents/Movie[@Number='" & CurrentMovieNumber.ToString & "']") + If CurrentNode IsNot Nothing Then + Select Case _ManualParameterOperator + Case "LIKE" + If CurrentNode.Attributes(_ManualParameterField) IsNot Nothing Then + 'Dim str As String = "kkk" + 'Console.WriteLine(str.CompareTo(str1)) + Dim str1 As String = CurrentNode.Attributes(_ManualParameterField).Value.ToString + Dim str2 As String = _ManualParameterValue + + 'Console.WriteLine(str1) + 'Console.WriteLine(str1.CompareTo(str2)) + + 'If str1.CompareTo(str2) > 0 Then + If str1.ToLower.IndexOf(str2.ToLower) >= 0 Then + ds.Tables("tblNodesToProcess").Rows.Add(New Object() {CurrentMovieNumber, CurrentNode.Attributes("OriginalTitle").Value}) + fnLogEvent(" - Entry to process : " & CurrentMovieNumber.ToString & " | " & CurrentNode.Attributes("OriginalTitle").Value, 3) + End If + End If + Case "=" + If CurrentNode.Attributes(_ManualParameterField) IsNot Nothing Then + 'Console.WriteLine(CurrentNode.Attributes(_ManualParameterField.ToString)) + If CurrentNode.Attributes(_ManualParameterField).Value.ToString = _ManualParameterValue Then + ds.Tables("tblNodesToProcess").Rows.Add(New Object() {CurrentMovieNumber, CurrentNode.Attributes("OriginalTitle").Value}) + fnLogEvent(" - Entry to process : " & CurrentMovieNumber.ToString & " | " & CurrentNode.Attributes("OriginalTitle").Value, 3) + End If + End If + Case "!=" + If CurrentNode.Attributes(_ManualParameterField) IsNot Nothing Then + 'Attribute exists, check it's not a match: + If CurrentNode.Attributes(_ManualParameterField).Value.ToString <> _ManualParameterValue Then + ds.Tables("tblNodesToProcess").Rows.Add(New Object() {CurrentMovieNumber, CurrentNode.Attributes("OriginalTitle").Value}) + fnLogEvent(" - Entry to process : " & CurrentMovieNumber.ToString & " | " & CurrentNode.Attributes("OriginalTitle").Value, 3) + End If + Else + 'Not there, so obviously not equal to our parameter! + ds.Tables("tblNodesToProcess").Rows.Add(New Object() {CurrentMovieNumber, CurrentNode.Attributes("OriginalTitle").Value}) + fnLogEvent(" - Entry to process : " & CurrentMovieNumber.ToString & " | " & CurrentNode.Attributes("OriginalTitle").Value, 3) + End If + Case "EXISTS" + If CurrentNode.Attributes(_ManualParameterField) IsNot Nothing Then + ds.Tables("tblNodesToProcess").Rows.Add(New Object() {CurrentMovieNumber, CurrentNode.Attributes("OriginalTitle").Value}) + fnLogEvent(" - Entry to process : " & CurrentMovieNumber.ToString & " | " & CurrentNode.Attributes("OriginalTitle").Value, 3) + End If + Case "NOT EXISTS" + If CurrentNode.Attributes(_ManualParameterField) Is Nothing Then + ds.Tables("tblNodesToProcess").Rows.Add(New Object() {CurrentMovieNumber, CurrentNode.Attributes("OriginalTitle").Value}) + fnLogEvent(" - Entry to process : " & CurrentMovieNumber.ToString & " | " & CurrentNode.Attributes("OriginalTitle").Value, 3) + End If + End Select + End If + End If + + End If + End While + + fnLogEvent("Ready to Proceed. " & ds.Tables("tblNodesToProcess").Rows.Count.ToString & " Records Matched.", 3) + + + If Not (TextReader Is Nothing) Then + TextReader.Close() + End If + + + + End Sub + Public Sub ManualRunOperation() + + If ds.Tables("tblNodesToProcess") IsNot Nothing Then + fnLogEvent("Performing Manual Update Process", 2) + + Dim XmlDoc As New XmlDocument + Dim CurrentNode As Xml.XmlNode + Dim newAttr As Xml.XmlAttribute + XmlDoc.Load(_XMLFilePath) + Dim MovieRootNode As Xml.XmlNode = XmlDoc.SelectSingleNode("//AntMovieCatalog/Catalog/Contents") + + For Each row As DataRow In ds.Tables("tblNodesToProcess").Rows + CurrentNode = XmlDoc.SelectSingleNode("//AntMovieCatalog/Catalog/Contents/Movie[@Number='" & row("AntID") & "']") + Select Case _ManualOperation + Case "Update Value" + If CurrentNode.Attributes(_ManualFieldName) Is Nothing Then + newAttr = XmlDoc.CreateAttribute("Number") + newAttr.Value = _ManualFieldValue + CurrentNode.Attributes.Append(newAttr) + fnLogEvent("Value Updated (Added too) : " & CurrentNode.Attributes("Number").Value & " | " & CurrentNode.Attributes("OriginalTitle").Value, 1) + Else + CurrentNode.Attributes(_ManualFieldName).Value = _ManualFieldValue + fnLogEvent("Value Updated : " & CurrentNode.Attributes("Number").Value & " | " & CurrentNode.Attributes("OriginalTitle").Value, 1) + End If + Case "Delete Record" + If Not CurrentNode Is Nothing Then + MovieRootNode.RemoveChild(CurrentNode) + fnLogEvent("Record Deleted : " & CurrentNode.Attributes("Number").Value & " | " & CurrentNode.Attributes("OriginalTitle").Value, 1) + End If + Case "Delete Value" + If Not CurrentNode.Attributes(_ManualFieldName) Is Nothing Then + CurrentNode.Attributes.Remove(CurrentNode.Attributes.GetNamedItem(_ManualFieldName)) + fnLogEvent("Value Deleted : " & CurrentNode.Attributes("Number").Value & " | " & CurrentNode.Attributes("OriginalTitle").Value, 1) + End If + Case "Scan Media Data" + Dim FileToScan As String = CurrentNode.Attributes("Source").Value + If FileToScan.IndexOf(";") < 0 Then 'Ignore multi-part files for now + Dim f As New IO.FileInfo(FileToScan) + If f.Exists Then + Dim blah As New AntRecord + With blah + .XMLDoc = XmlDoc + .XMLElement = CurrentNode + .FilePath = FileToScan + .UpdateMediaData() + End With + 'CurrentNode.Attributes. + Else + fnLogEvent("File Not Scanned (File Not Found) : " & CurrentNode.Attributes("Number").Value & " | " & CurrentNode.Attributes("OriginalTitle").Value, 1) + End If + End If + + End Select + Next + + XmlDoc.Save(_XMLFilePath) + fnLogEvent("Manual Update Process Complete.", 2) + + End If + + End Sub + + Public Sub New() + BuildTables() + End Sub + + Public Sub Reset() + If ds.Tables("tblXML") IsNot Nothing Then + ds.Tables("tblXML").Clear() + End If + If ds.Tables("tblFoundMediaFiles") IsNot Nothing Then + ds.Tables("tblFoundMediaFiles").Clear() + End If + If ds.Tables("tblFoundNonMediaFiles") IsNot Nothing Then + ds.Tables("tblFoundNonMediaFiles").Clear() + End If + If ds.Tables("tblOrphanedMediaFiles") IsNot Nothing Then + ds.Tables("tblOrphanedMediaFiles").Clear() + End If + If ds.Tables("tblOrphanedNonMediaFiles") IsNot Nothing Then + ds.Tables("tblOrphanedNonMediaFiles").Clear() + End If + If ds.Tables("tblOrphanedAntRecords") IsNot Nothing Then + ds.Tables("tblOrphanedAntRecords").Clear() + End If + If ds.Tables("tblMultiPartFiles") IsNot Nothing Then + ds.Tables("tblMultiPartFiles").Clear() + End If + End Sub + + Public Sub TEST_ListTable(ByVal TableName As String) + Dim row As DataRow + + If TableName.ToLower = "tblxml" Then + fnLogEvent("tblXML : " & ds.Tables("tblXML").Rows.Count.ToString, 3) + If ds.Tables("tblXML").Rows.Count > 0 Then + fnLogEvent("AntID | AntPath", 3) + For Each row In ds.Tables("tblXML").Rows + fnLogEvent(row("AntID") & " | " & row("AntPath"), 3) + Next + End If + ElseIf TableName.ToLower = "tblfoundmediafiles" Then + fnLogEvent("tblFoundMediaFiles : " & ds.Tables("tblFoundMediaFiles").Rows.Count.ToString, 3) + If ds.Tables("tblFoundMediaFiles").Rows.Count > 0 Then + fnLogEvent("FileName | FilePath", 3) + For Each row In ds.Tables("tblFoundMediaFiles").Rows + fnLogEvent(row("FileName") & " | " & row("FilePath"), 3) + Next + End If + ElseIf TableName.ToLower = "tblfoundnonmediafiles" Then + fnLogEvent("tblFoundNonMediaFiles : " & ds.Tables("tblFoundNonMediaFiles").Rows.Count.ToString, 3) + If ds.Tables("tblFoundNonMediaFiles").Rows.Count > 0 Then + fnLogEvent("FileName | FilePath", 3) + For Each row In ds.Tables("tblFoundNonMediaFiles").Rows + fnLogEvent(row("FileName") & " | " & row("FilePath"), 3) + Next + End If + ElseIf TableName.ToLower = "tblorphanedmediafiles" Then + fnLogEvent("tblOrphanedMediaFiles : " & ds.Tables("tblOrphanedMediaFiles").Rows.Count.ToString, 3) + If ds.Tables("tblOrphanedMediaFiles").Rows.Count > 0 Then + fnLogEvent("AntID | PhysicalPath | VirtualPath | FileName", 3) + For Each row In ds.Tables("tblOrphanedMediaFiles").Rows + fnLogEvent(row("AntID") & " | " & row("PhysicalPath") & " | " & row("VirtualPath") & " | " & row("FileName"), 3) + Next + End If + ElseIf TableName.ToLower = "tblorphanednonmediafiles" Then + fnLogEvent("tblOrphanedNonMediaFiles : " & ds.Tables("tblOrphanedNonMediaFiles").Rows.Count.ToString, 3) + If ds.Tables("tblOrphanedNonMediaFiles").Rows.Count > 0 Then + fnLogEvent("AntID | PhysicalPath | VirtualPath | FileName", 3) + For Each row In ds.Tables("tblOrphanedNonMediaFiles").Rows + fnLogEvent(row("AntID") & " | " & row("PhysicalPath") & " | " & row("VirtualPath") & " | " & row("FileName"), 3) + Next + End If + ElseIf TableName.ToLower = "tblorphanedantrecords" Then + fnLogEvent("tblOrphanedAntRecords : " & ds.Tables("tblOrphanedAntRecords").Rows.Count.ToString, 3) + If ds.Tables("tblOrphanedAntRecords").Rows.Count > 0 Then + fnLogEvent("AntID | PhysicalPath | FileName", 3) + For Each row In ds.Tables("tblOrphanedAntRecords").Rows + fnLogEvent(row("AntID") & " | " & row("PhysicalPath") & " | " & row("FileName"), 3) + Next + End If + ElseIf TableName.ToLower = "tblmultipartfiles" Then + fnLogEvent("tblMultiPartFiles : " & ds.Tables("tblMultiPartFiles").Rows.Count.ToString, 3) + If ds.Tables("tblMultiPartFiles").Rows.Count > 0 Then + fnLogEvent("AntID | PhysicalPath | VirtualPath | FileName", 3) + For Each row In ds.Tables("tblMultiPartFiles").Rows + fnLogEvent(row("AntID") & " | " & row("PhysicalPath") & " | " & row("VirtualPath") & " | " & row("FileName"), 3) + Next + End If + + End If + + + End Sub + + Private Sub BuildTables() + + Dim table As DataTable + Dim column As DataColumn + ds = New DataSet + + 'XML Table + table = New DataTable("tblXML") + column = New DataColumn() + column.DataType = System.Type.GetType("System.Int32") + column.ColumnName = "AntID" + table.Columns.Add(column) + column = New DataColumn() + column.DataType = System.Type.GetType("System.String") + column.ColumnName = "AntPath" + table.Columns.Add(column) + ds.Tables.Add(table) + + 'Found Media Files Table + table = New DataTable("tblFoundMediaFiles") + column = New DataColumn() + column.DataType = System.Type.GetType("System.String") + column.ColumnName = "FileName" + table.Columns.Add(column) + column = New DataColumn() + column.DataType = System.Type.GetType("System.String") + column.ColumnName = "FilePath" + table.Columns.Add(column) + ds.Tables.Add(table) + + 'Found Non-Media Files Table + table = New DataTable("tblFoundNonMediaFiles") + column = New DataColumn() + column.DataType = System.Type.GetType("System.String") + column.ColumnName = "FileName" + table.Columns.Add(column) + column = New DataColumn() + column.DataType = System.Type.GetType("System.String") + column.ColumnName = "FilePath" + table.Columns.Add(column) + ds.Tables.Add(table) + + table = New DataTable("tblOrphanedMediaFiles") + column = New DataColumn() + column.DataType = System.Type.GetType("System.Int32") + column.ColumnName = "AntID" + table.Columns.Add(column) + column = New DataColumn() + column.DataType = System.Type.GetType("System.String") + column.ColumnName = "PhysicalPath" + table.Columns.Add(column) + column = New DataColumn() + column.DataType = System.Type.GetType("System.String") + column.ColumnName = "VirtualPath" + table.Columns.Add(column) + column = New DataColumn() + column.DataType = System.Type.GetType("System.String") + column.ColumnName = "FileName" + table.Columns.Add(column) + ds.Tables.Add(table) + + table = New DataTable("tblOrphanedNonMediaFiles") + column = New DataColumn() + column.DataType = System.Type.GetType("System.Int32") + column.ColumnName = "AntID" + table.Columns.Add(column) + column = New DataColumn() + column.DataType = System.Type.GetType("System.String") + column.ColumnName = "PhysicalPath" + table.Columns.Add(column) + column = New DataColumn() + column.DataType = System.Type.GetType("System.String") + column.ColumnName = "VirtualPath" + table.Columns.Add(column) + column = New DataColumn() + column.DataType = System.Type.GetType("System.String") + column.ColumnName = "FileName" + table.Columns.Add(column) + ds.Tables.Add(table) + + table = New DataTable("tblOrphanedAntRecords") + column = New DataColumn() + column.DataType = System.Type.GetType("System.Int32") + column.ColumnName = "AntID" + table.Columns.Add(column) + column = New DataColumn() + column.DataType = System.Type.GetType("System.String") + column.ColumnName = "PhysicalPath" + table.Columns.Add(column) + column = New DataColumn() + column.DataType = System.Type.GetType("System.String") + column.ColumnName = "FileName" + table.Columns.Add(column) + ds.Tables.Add(table) + + table = New DataTable("tblMultiPartFiles") + column = New DataColumn() + column.DataType = System.Type.GetType("System.Int32") + column.ColumnName = "AntID" + table.Columns.Add(column) + column = New DataColumn() + column.DataType = System.Type.GetType("System.String") + column.ColumnName = "PhysicalPath" + table.Columns.Add(column) + column = New DataColumn() + column.DataType = System.Type.GetType("System.String") + column.ColumnName = "VirtualPath" + table.Columns.Add(column) + column = New DataColumn() + column.DataType = System.Type.GetType("System.String") + column.ColumnName = "FileName" + table.Columns.Add(column) + Dim PrimaryKeyColumns(0) As DataColumn + PrimaryKeyColumns(0) = table.Columns("FileName") + table.PrimaryKey = PrimaryKeyColumns + ds.Tables.Add(table) + + table = New DataTable("tblAntFields") + column = New DataColumn() + column.DataType = System.Type.GetType("System.String") + column.ColumnName = "FieldName" + table.Columns.Add(column) + column = New DataColumn() + column.DataType = System.Type.GetType("System.String") + column.ColumnName = "FieldDataType" + table.Columns.Add(column) + ds.Tables.Add(table) + + 'XML Table + table = New DataTable("tblNodesToProcess") + column = New DataColumn() + column.DataType = System.Type.GetType("System.Int32") + column.ColumnName = "AntID" + table.Columns.Add(column) + column = New DataColumn() + column.DataType = System.Type.GetType("System.String") + column.ColumnName = "AntTitle" + table.Columns.Add(column) + ds.Tables.Add(table) + + table = New DataTable("dtNone") + 'Dim dtnone As DataTable + 'dtnone = New DataTable("File") + 'dtnone.Columns.Add("FileName") + table.Columns.Add(New DataColumn("FileName")) + ds.Tables.Add(table) + + table = New DataTable("dtDone") + table.Columns.Add(New DataColumn("FileName")) + ds.Tables.Add(table) + + 'Dim dtdone As DataTable + 'dtdone = New DataTable("File") + 'dtdone.Columns.Add("FileName") + + + PopulateReferenceTables() + + End Sub + + Private Sub PopulateReferenceTables() + If ds.Tables("tblAntFields") IsNot Nothing Then + ds.Tables("tblAntFields").Rows.Add(New Object() {"Number", "Int"}) + ds.Tables("tblAntFields").Rows.Add(New Object() {"Date", "Date"}) + ds.Tables("tblAntFields").Rows.Add(New Object() {"Rating", "Int"}) + ds.Tables("tblAntFields").Rows.Add(New Object() {"Year", "Int"}) + ds.Tables("tblAntFields").Rows.Add(New Object() {"Length", "Int"}) + ds.Tables("tblAntFields").Rows.Add(New Object() {"VideoBitrate", "Int"}) + ds.Tables("tblAntFields").Rows.Add(New Object() {"AudioBitrate", "Int"}) + ds.Tables("tblAntFields").Rows.Add(New Object() {"Disks", "Int"}) + ds.Tables("tblAntFields").Rows.Add(New Object() {"Checked", "Boolean"}) + ds.Tables("tblAntFields").Rows.Add(New Object() {"MediaLabel", "String"}) + ds.Tables("tblAntFields").Rows.Add(New Object() {"MediaType", "String"}) + ds.Tables("tblAntFields").Rows.Add(New Object() {"Source", "String"}) + ds.Tables("tblAntFields").Rows.Add(New Object() {"Borrower", "String"}) + ds.Tables("tblAntFields").Rows.Add(New Object() {"OriginalTitle", "String"}) + ds.Tables("tblAntFields").Rows.Add(New Object() {"TranslatedTitle", "String"}) + ds.Tables("tblAntFields").Rows.Add(New Object() {"Director", "String"}) + ds.Tables("tblAntFields").Rows.Add(New Object() {"Producer", "String"}) + ds.Tables("tblAntFields").Rows.Add(New Object() {"Country", "String"}) + ds.Tables("tblAntFields").Rows.Add(New Object() {"Category", "String"}) + ds.Tables("tblAntFields").Rows.Add(New Object() {"Actors", "String"}) + ds.Tables("tblAntFields").Rows.Add(New Object() {"URL", "String"}) + ds.Tables("tblAntFields").Rows.Add(New Object() {"Description", "String"}) + ds.Tables("tblAntFields").Rows.Add(New Object() {"Comments", "String"}) + ds.Tables("tblAntFields").Rows.Add(New Object() {"VideoFormat", "String"}) + ds.Tables("tblAntFields").Rows.Add(New Object() {"AudioFormat", "String"}) + ds.Tables("tblAntFields").Rows.Add(New Object() {"Resolution", "String"}) + ds.Tables("tblAntFields").Rows.Add(New Object() {"Framerate", "String"}) + ds.Tables("tblAntFields").Rows.Add(New Object() {"Languages", "String"}) + ds.Tables("tblAntFields").Rows.Add(New Object() {"Subtitles", "String"}) + ds.Tables("tblAntFields").Rows.Add(New Object() {"Size", "Int"}) + ds.Tables("tblAntFields").Rows.Add(New Object() {"PictureName", "String"}) + ds.Tables("tblAntFields").Rows.Add(New Object() {"PictureSize", "Int"}) + End If + + End Sub + + Public Sub ProcessXML(Optional ByVal XMLFilePath As String = "") + Dim textReader As Xml.XmlTextReader + Dim CurrentMovieTitle As String = "" + Dim CurrentMovieNumber As Integer + 'Dim FoundEntries As Integer = 0 + 'Dim row As System.Data.DataRow + + Try + If ds.Tables("tblXML") IsNot Nothing Then + ds.Tables("tblXML").Clear() + End If + + If XMLFilePath = "" Then + textReader = New Xml.XmlTextReader(_XMLFilePath) + Else + textReader = New Xml.XmlTextReader(XMLFilePath) + End If + While textReader.Read() + If textReader.Name = "Movie" Then + CurrentMovieTitle = textReader.GetAttribute(AntSourceField) + CurrentMovieNumber = textReader.GetAttribute("Number") + If Not CurrentMovieTitle Is Nothing Then + 'Check for multi-valued entries: + If CurrentMovieTitle.IndexOf(";") > -1 Then + Dim TitleList() As String + TitleList = CurrentMovieTitle.Split(";") + Dim myEnumerator As System.Collections.IEnumerator = TitleList.GetEnumerator() + While myEnumerator.MoveNext() + If _IsMultiFolderScan = True Then + CurrentMovieTitle = myEnumerator.Current + Else + CurrentMovieTitle = fnStripPathFromFile(myEnumerator.Current, _FoldersToScan, _OverridePath) + End If + 'CurrentMovieTitle = myEnumerator.Current + ds.Tables("tblXML").Rows.Add(New Object() {CurrentMovieNumber, CurrentMovieTitle}) + fnLogEvent(" Entry Found - " & CurrentMovieTitle, 1) + End While + TitleList = Nothing + Else + If _IsMultiFolderScan = True Then + CurrentMovieTitle = CurrentMovieTitle + Else + CurrentMovieTitle = fnStripPathFromFile(CurrentMovieTitle, _FoldersToScan, _OverridePath) + End If + ds.Tables("tblXML").Rows.Add(New Object() {CurrentMovieNumber, CurrentMovieTitle}) + fnLogEvent(" Entry Found - " & CurrentMovieTitle.ToString, 1) + End If + End If + End If + End While + + If Not (textReader Is Nothing) Then + textReader.Close() + End If + + + fnLogEvent("Parsing XML File - Complete - " & ds.Tables("tblXML").Rows.Count.ToString & " entries found.", 2) + Catch ex As Exception + fnLogEvent("ERROR : Cannot parse XML file", 3) + End Try + + End Sub + + Public Sub ProcessMovieFolder() + 'Sub to enumerate all files in the given MoviePath location. + + If ds.Tables("tblFoundNonMediaFiles") IsNot Nothing Then + ds.Tables("tblFoundNonMediaFiles").Clear() + End If + If ds.Tables("tblFoundMediaFiles") IsNot Nothing Then + ds.Tables("tblFoundMediaFiles").Clear() + End If + + 'Dim dtnone As DataTable + 'dtnone = New DataTable("File") + 'dtnone.Columns.Add("FileName") + Dim XMLExclTable As New Hashtable + If (IO.File.Exists(_ExcludePath)) Then + Dim sr As StreamReader = File.OpenText(_ExcludePath) + Dim i As Integer = 0 + Do While sr.Peek() >= 0 + XMLExclTable.Add(i, sr.ReadLine) + i += 1 + Loop + End If + + + 'Dim MovieCounter As Integer = 0 + Dim FoundFileName As String + Dim ValidMediaExtensions As String() = My.Settings.FileTypesToCheck.Split(";") + Dim ValidNonMediaExtensions As String() = My.Settings.FileTypesNonMedia.Split(";") + Dim row As DataRow + + Dim CurrentMoviePath As String + For Each CurrentMoviePath In _FoldersToScan.Split(";") + + Dim dir As New DirectoryInfo(CurrentMoviePath) + 'If dir.Name <> "System Volume Information" Then + If Not dir.Exists Then + fnLogEvent("ERROR : Cannot access folder '" + CurrentMoviePath.ToString + "'", 3) + Else + If Not CurrentMoviePath.EndsWith("\") = True Then + CurrentMoviePath = CurrentMoviePath & "\" + End If + + fnLogEvent("Processing Movie Folder : " & CurrentMoviePath.ToString, 2) + 'fnLogEvent(" MoviePath : " + CurrentMoviePath.ToString, 2) + + Dim blah As New FileFolderEnum(CurrentMoviePath) + For Each foundFile As String In blah.Files + + If (XMLExclTable.ContainsValue(foundFile.ToLower) = False) Then + 'Check for match against movie file types: + Try + FoundFileName = fnStripPathFromFile(foundFile, CurrentMoviePath, "") + + 'File Handling - compare extension to known media filetypes + If Array.IndexOf(ValidMediaExtensions, foundFile.Substring(InStrRev(foundFile, "."))) >= 0 Then + fnLogEvent(" File Found - " & FoundFileName, 1) + + row = ds.Tables("tblFoundMediaFiles").NewRow() + row("FileName") = FoundFileName + row("FilePath") = CurrentMoviePath + ds.Tables("tblFoundMediaFiles").Rows.Add(row) + + ElseIf Array.IndexOf(ValidNonMediaExtensions, foundFile.Substring(InStrRev(foundFile, "."))) >= 0 Then + 'Check for match against non-movie file types: + fnLogEvent(" File Found - " & FoundFileName, 1) + + row = ds.Tables("tblFoundNonMediaFiles").NewRow() + row("FileName") = FoundFileName + row("FilePath") = CurrentMoviePath + ds.Tables("tblFoundNonMediaFiles").Rows.Add(row) + + ElseIf _CheckForDVDFolders = True Then + 'Finally special handling to check for DVD images in folders. + If Right(FoundFileName, 12).ToLower = "video_ts.ifo" Then + fnLogEvent(" File Found - " & FoundFileName, 1) + + row = ds.Tables("tblFoundNonMediaFiles").NewRow() + row("FileName") = FoundFileName + row("FilePath") = CurrentMoviePath + ds.Tables("tblFoundNonMediaFiles").Rows.Add(row) + End If + End If + Catch ex As Exception + fnLogEvent("ERROR : " & ex.Message, 3) + End Try + End If + + Next + + End If + Next + fnLogEvent("Processing Movie Folder - Done - " & CountFilesFound.ToString & " files found.", 2) + + 'If (_MultiPath = "") Then + ' Exit Sub + 'End If + + 'Dim dtmulti As DataTable + 'dtmulti = New DataTable("File") + 'dtmulti.Columns.Add("FileName") + 'dtmulti.ReadXml(MultiPath) + 'For i As Integer = 0 To dtmulti.Rows.Count - 1 + ' 'FoundFileName = fnStripPathFromFile(dtmulti.Rows.Item(i).ItemArray(0), CurrentMoviePath, "") + ' 'Console.WriteLine(FoundFileName) + + ' 'Not sure here - we're outside of the multi-folder loop so this may need to move, or we store the full path and filename separately for Re-Scans: + ' FoundFileName = dtmulti.Rows.Item(i).ItemArray(0) + ' CurrentMoviePath = _FoldersToScan + + ' If Array.IndexOf(ValidMediaExtensions, dtmulti.Rows.Item(i).ItemArray(0).Substring(InStrRev(dtmulti.Rows.Item(i).ItemArray(0), "."))) >= 0 Then + ' fnLogEvent(" Reprocessing File Found - " & FoundFileName, 1) + + ' row = ds.Tables("tblFoundMediaFiles").NewRow() + ' row("FileName") = FoundFileName + ' row("FilePath") = CurrentMoviePath + ' ds.Tables("tblFoundMediaFiles").Rows.Add(row) + + ' 'MovieCounter += 1 + ' 'fnLogEvent(" Reprocessing File Found - " & FoundFileName, 1) + ' 'PhysicalMovies.Add(FoundFileName) + + ' 'Check for match against non-movie file types: + ' ElseIf Array.IndexOf(ValidNonMediaExtensions, dtmulti.Rows.Item(i).ItemArray(0).Substring(InStrRev(dtmulti.Rows.Item(i).ItemArray(0), "."))) >= 0 Then + ' fnLogEvent(" Reprocessing File Found - " & FoundFileName, 1) + + ' row = ds.Tables("tblFoundNonMediaFiles").NewRow() + ' row("FileName") = FoundFileName + ' row("FilePath") = CurrentMoviePath + ' ds.Tables("tblFoundNonMediaFiles").Rows.Add(row) + + ' 'MovieCounter += 1 + ' 'FoundFileName = fnStripPathFromFile(foundFile, MoviePath, "", False) + ' 'fnLogEvent(" Reprocessing File Found - " & FoundFileName, 1) + ' 'PhysicalNonMovies.Add(FoundFileName) + + ' ElseIf _CheckForDVDFolders = True Then + ' 'Finally special handling to check for DVD images in folders. + ' If Right(FoundFileName, 12).ToLower = "video_ts.ifo" Then + ' fnLogEvent(" Reprocessing File Found - " & FoundFileName, 1) + + ' row = ds.Tables("tblFoundNonMediaFiles").NewRow() + ' row("FileName") = FoundFileName + ' row("FilePath") = CurrentMoviePath + ' ds.Tables("tblFoundNonMediaFiles").Rows.Add(row) + ' End If + + 'If Right(FoundFileName, 12).ToLower = "video_ts.ifo" Then + ' MovieCounter += 1 + ' fnLogEvent(" Reprocessing File Found - " & FoundFileName,... [truncated message content] |