From: <che...@us...> - 2010-09-17 16:46:17
|
Revision: 3790 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3790&view=rev Author: chef_koch Date: 2010-09-17 16:46:08 +0000 (Fri, 17 Sep 2010) Log Message: ----------- Added Paths: ----------- trunk/plugins/ListeningTo/ trunk/plugins/ListeningTo/Build/ trunk/plugins/ListeningTo/Build/build.bat trunk/plugins/ListeningTo/Build/build.log trunk/plugins/ListeningTo/Build/filever.exe trunk/plugins/ListeningTo/ListeningTo/ trunk/plugins/ListeningTo/ListeningTo/Helper/ trunk/plugins/ListeningTo/ListeningTo/Helper/ClientServer.cs trunk/plugins/ListeningTo/ListeningTo/IrssUtils/ trunk/plugins/ListeningTo/ListeningTo/IrssUtils/Network.cs trunk/plugins/ListeningTo/ListeningTo/IrssUtils/ProcessHelper.cs trunk/plugins/ListeningTo/ListeningTo/IrssUtils/SystemRegistry.cs trunk/plugins/ListeningTo/ListeningTo/IrssUtils/Win32.cs trunk/plugins/ListeningTo/ListeningTo/ListeningTo/ trunk/plugins/ListeningTo/ListeningTo/ListeningTo/PlayingInfo.cs trunk/plugins/ListeningTo/ListeningTo/ListeningTo/SendPlayingInfo.cs trunk/plugins/ListeningTo/ListeningTo/ListeningTo.cs trunk/plugins/ListeningTo/ListeningTo/ListeningTo.csproj trunk/plugins/ListeningTo/ListeningTo/ListeningToConfig.Designer.cs trunk/plugins/ListeningTo/ListeningTo/ListeningToConfig.cs trunk/plugins/ListeningTo/ListeningTo/ListeningToConfig.resx trunk/plugins/ListeningTo/ListeningTo/Properties/ trunk/plugins/ListeningTo/ListeningTo/Properties/AssemblyInfo.cs trunk/plugins/ListeningTo/ListeningTo/Properties/Resources.Designer.cs trunk/plugins/ListeningTo/ListeningTo/Properties/Resources.resx trunk/plugins/ListeningTo/ListeningTo/Settings.cs trunk/plugins/ListeningTo/ListeningTo/img/ trunk/plugins/ListeningTo/ListeningTo/img/ListeningTo_disabled.png trunk/plugins/ListeningTo/ListeningTo/img/ListeningTo_enabled.png trunk/plugins/ListeningTo/ListeningTo.5.1.ReSharper trunk/plugins/ListeningTo/ListeningTo.sln trunk/plugins/ListeningTo/ListeningToRepeater/ trunk/plugins/ListeningTo/ListeningToRepeater/DebugWindow.Designer.cs trunk/plugins/ListeningTo/ListeningToRepeater/DebugWindow.cs trunk/plugins/ListeningTo/ListeningToRepeater/DebugWindow.resx trunk/plugins/ListeningTo/ListeningToRepeater/Helper/ trunk/plugins/ListeningTo/ListeningToRepeater/Helper/ClientServer.cs trunk/plugins/ListeningTo/ListeningToRepeater/IrssUtils/ trunk/plugins/ListeningTo/ListeningToRepeater/IrssUtils/Network.cs trunk/plugins/ListeningTo/ListeningToRepeater/IrssUtils/ProcessHelper.cs trunk/plugins/ListeningTo/ListeningToRepeater/IrssUtils/SystemRegistry.cs trunk/plugins/ListeningTo/ListeningToRepeater/IrssUtils/Win32.cs trunk/plugins/ListeningTo/ListeningToRepeater/ListeningTo/ trunk/plugins/ListeningTo/ListeningToRepeater/ListeningTo/PlayingInfo.cs trunk/plugins/ListeningTo/ListeningToRepeater/ListeningTo/SendPlayingInfo.cs trunk/plugins/ListeningTo/ListeningToRepeater/ListeningToRepeater.csproj trunk/plugins/ListeningTo/ListeningToRepeater/Program.cs trunk/plugins/ListeningTo/ListeningToRepeater/Properties/ trunk/plugins/ListeningTo/ListeningToRepeater/Properties/AssemblyInfo.cs trunk/plugins/ListeningTo/ListeningToRepeater/Properties/Resources.Designer.cs trunk/plugins/ListeningTo/ListeningToRepeater/Properties/Resources.resx trunk/plugins/ListeningTo/ListeningToRepeater/iconPlaying.ico trunk/plugins/ListeningTo/MpeRelease/ trunk/plugins/ListeningTo/releases/ Added: trunk/plugins/ListeningTo/Build/build.bat =================================================================== --- trunk/plugins/ListeningTo/Build/build.bat (rev 0) +++ trunk/plugins/ListeningTo/Build/build.bat 2010-09-17 16:46:08 UTC (rev 3790) @@ -0,0 +1,28 @@ +@ECHO OFF + + +REM Select program path based on current machine environment +set ProgramDir=%ProgramFiles% +if not "%ProgramFiles(x86)%".=="". set ProgramDir=%ProgramFiles(x86)% + + +REM set logfile where the infos are written to, and clear that file +set LOG=build.log +echo. > %LOG% + + +echo. +echo -= MusicBrainzRating =- +echo -=====================- +echo. + + +echo. +echo Building MusicBrainzRating... +"%WINDIR%\Microsoft.NET\Framework\v3.5\MSBUILD.exe" /target:Rebuild /property:Configuration=Release;AllowUnsafeBlocks=true "..\MusicBrainzRating.sln" >> %LOG% + + +echo. +echo Building MpeExtension package... +"%ProgramDir%\Team MediaPortal\MediaPortal\MpeMaker.exe" "..\MpeRelease\MusicBrainzRating.xmp2" /B /UpdateXML >> %LOG% + Added: trunk/plugins/ListeningTo/Build/build.log =================================================================== --- trunk/plugins/ListeningTo/Build/build.log (rev 0) +++ trunk/plugins/ListeningTo/Build/build.log 2010-09-17 16:46:08 UTC (rev 3790) @@ -0,0 +1,63 @@ + +Microsoft (R)-Buildmodul, Version 3.5.30729.4926 +[Microsoft .NET Framework, Version 2.0.50727.4927] +Copyright (C) Microsoft Corporation 2007. Alle Rechte vorbehalten. + +Build started 29.06.2010 12:53:01. +Project "D:\MediaPortal\mp-plugins\trunk\plugins\MusicBrainzRating\MusicBrainzRating.sln" on node 0 (Rebuild target(s)). + Building solution configuration "Release|Any CPU". +Project "D:\MediaPortal\mp-plugins\trunk\plugins\MusicBrainzRating\MusicBrainzRating.sln" (1) is building "D:\MediaPortal\mp-plugins\trunk\plugins\MusicBrainzRating\MusicBrainzRating\MusicBrainzRating.csproj" (2) on node 0 (Rebuild target(s)). +Project file contains ToolsVersion="4.0", which is not supported by this version of MSBuild. Treating the project as if it had ToolsVersion="3.5". +CoreClean: + Das Verzeichnis "obj\Release\" wird erstellt. +PrepareForBuild: + Das Verzeichnis "bin\Release\" wird erstellt. +CoreResGen: + Die Ressourcendatei MusicBrainzRatingConfig.resx wird zu obj\Release\MusicBrainzRating.MusicBrainzRatingConfig.resources verarbeitet. + Die Ressourcendatei Properties\Resources.resx wird zu obj\Release\MusicBrainzRating.Properties.Resources.resources verarbeitet. +HelperClasses\MusicBrainzService.cs(33,12): warning CS0414: Dem Feld "MusicBrainz.MusicBrainzService.host" wurde ein Wert zugewiesen, der aber nie verwendet wird. +HelperClasses\MusicBrainzService.cs(34,9): warning CS0414: Dem Feld "MusicBrainz.MusicBrainzService.port" wurde ein Wert zugewiesen, der aber nie verwendet wird. +HelperClasses\MusicBrainzService.cs(35,12): warning CS0414: Dem Feld "MusicBrainz.MusicBrainzService.pathPrefix" wurde ein Wert zugewiesen, der aber nie verwendet wird. +HelperClasses\MusicBrainzService.cs(36,12): warning CS0414: Dem Feld "MusicBrainz.MusicBrainzService.realm" wurde ein Wert zugewiesen, der aber nie verwendet wird. +_CopyFilesMarkedCopyLocal: + Die Datei wird von "..\..\..\..\..\MediaPortal\trunk\mediaportal\Core\bin\Release\Core.dll" in "bin\Release\Core.dll" kopiert. + Die Datei wird von "..\..\..\..\..\MediaPortal\trunk\mediaportal\Databases\bin\Release\Databases.dll" in "bin\Release\Databases.dll" kopiert. + Die Datei wird von "..\..\..\..\..\MediaPortal\trunk\mediaportal\Dialogs\bin\Release\Dialogs.dll" in "bin\Release\Dialogs.dll" kopiert. + Die Datei wird von "..\..\..\..\..\MediaPortal\trunk\mediaportal\MediaPortal.Base\taglib-sharp.dll" in "bin\Release\taglib-sharp.dll" kopiert. + Die Datei wird von "..\..\..\..\..\MediaPortal\trunk\mediaportal\Utils\bin\Release\Utils.dll" in "bin\Release\Utils.dll" kopiert. + Die Datei wird von "..\..\..\..\..\MediaPortal\trunk\mediaportal\Core\bin\Release\Ionic.Zip.dll" in "bin\Release\Ionic.Zip.dll" kopiert. + Die Datei wird von "..\..\..\..\..\MediaPortal\trunk\mediaportal\Core\bin\Release\DirectShowLib.dll" in "bin\Release\DirectShowLib.dll" kopiert. + Die Datei wird von "..\..\..\..\..\MediaPortal\trunk\mediaportal\Core\bin\Release\edtftpnet-1.2.2.dll" in "bin\Release\edtftpnet-1.2.2.dll" kopiert. + Die Datei wird von "..\..\..\..\..\MediaPortal\trunk\mediaportal\Core\bin\Release\Interop.WMPLib.dll" in "bin\Release\Interop.WMPLib.dll" kopiert. + Die Datei wird von "..\..\..\..\..\MediaPortal\trunk\mediaportal\Utils\bin\Release\Interop.SHDocVw.dll" in "bin\Release\Interop.SHDocVw.dll" kopiert. + Die Datei wird von "..\..\..\..\..\MediaPortal\trunk\mediaportal\Core\bin\Release\BassRegistration.dll" in "bin\Release\BassRegistration.dll" kopiert. + Die Datei wird von "..\..\..\..\..\MediaPortal\trunk\mediaportal\Core\bin\Release\Bass.Net.dll" in "bin\Release\Bass.Net.dll" kopiert. + Die Datei wird von "..\..\..\..\..\MediaPortal\trunk\mediaportal\Databases\bin\Release\CSScriptLibrary.dll" in "bin\Release\CSScriptLibrary.dll" kopiert. + Die Datei wird von "..\..\..\..\..\MediaPortal\trunk\mediaportal\Core\bin\Release\AxInterop.WMPLib.dll" in "bin\Release\AxInterop.WMPLib.dll" kopiert. + Die Datei wird von "..\..\..\..\..\MediaPortal\trunk\mediaportal\Core\bin\Release\MediaPortal.Support.dll" in "bin\Release\MediaPortal.Support.dll" kopiert. + Die Datei wird von "..\..\..\..\..\MediaPortal\trunk\mediaportal\Core\bin\Release\MediaPortal.Support.pdb" in "bin\Release\MediaPortal.Support.pdb" kopiert. +CopyFilesToOutputDirectory: + Die Datei wird von "obj\Release\MusicBrainzRating.dll" in "bin\Release\MusicBrainzRating.dll" kopiert. + MusicBrainzRating -> D:\MediaPortal\mp-plugins\trunk\plugins\MusicBrainzRating\MusicBrainzRating\bin\Release\MusicBrainzRating.dll +Done Building Project "D:\MediaPortal\mp-plugins\trunk\plugins\MusicBrainzRating\MusicBrainzRating\MusicBrainzRating.csproj" (Rebuild target(s)). +Done Building Project "D:\MediaPortal\mp-plugins\trunk\plugins\MusicBrainzRating\MusicBrainzRating.sln" (Rebuild target(s)). + +Build succeeded. + +"D:\MediaPortal\mp-plugins\trunk\plugins\MusicBrainzRating\MusicBrainzRating.sln" (Rebuild target) (1) -> +"D:\MediaPortal\mp-plugins\trunk\plugins\MusicBrainzRating\MusicBrainzRating\MusicBrainzRating.csproj" (Rebuild target) (2) -> +(CoreCompile target) -> + HelperClasses\MusicBrainzService.cs(33,12): warning CS0414: Dem Feld "MusicBrainz.MusicBrainzService.host" wurde ein Wert zugewiesen, der aber nie verwendet wird. + HelperClasses\MusicBrainzService.cs(34,9): warning CS0414: Dem Feld "MusicBrainz.MusicBrainzService.port" wurde ein Wert zugewiesen, der aber nie verwendet wird. + HelperClasses\MusicBrainzService.cs(35,12): warning CS0414: Dem Feld "MusicBrainz.MusicBrainzService.pathPrefix" wurde ein Wert zugewiesen, der aber nie verwendet wird. + HelperClasses\MusicBrainzService.cs(36,12): warning CS0414: Dem Feld "MusicBrainz.MusicBrainzService.realm" wurde ein Wert zugewiesen, der aber nie verwendet wird. + + 4 Warning(s) + 0 Error(s) + +Time Elapsed 00:00:07.97 +MpeMaker version: 1.0.8.25985 +Build started at 12:53:14 +Building "D:\MediaPortal\mp-plugins\trunk\plugins\MusicBrainzRating\MpeRelease\MusicBrainzRating.xmp2" +Output: "D:\MediaPortal\mp-plugins\trunk\plugins\MusicBrainzRating\MpeRelease\MusicBrainzRating.mpe1" +Writing UpdateXML to "D:\MediaPortal\mp-plugins\trunk\plugins\MusicBrainzRating\MpeRelease\update.xml" Added: trunk/plugins/ListeningTo/Build/filever.exe =================================================================== (Binary files differ) Property changes on: trunk/plugins/ListeningTo/Build/filever.exe ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/ListeningTo/ListeningTo/Helper/ClientServer.cs =================================================================== --- trunk/plugins/ListeningTo/ListeningTo/Helper/ClientServer.cs (rev 0) +++ trunk/plugins/ListeningTo/ListeningTo/Helper/ClientServer.cs 2010-09-17 16:46:08 UTC (rev 3790) @@ -0,0 +1,117 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Net.Sockets; +using System.Text; +using System.Threading; + +namespace ListeningToRepeater.HelperClasses +{ + class Server + { + private TcpListener tcpListener; + private Thread listenThread; + + public delegate void DoSomething(string text); + public event DoSomething OnDoSomething; + + public Server() + { + this.tcpListener = new TcpListener(IPAddress.Any, 3000); + } + + public bool IsStarted + { + get + { + if (listenThread == null) return false; + + return listenThread.IsAlive; + } + } + + private void ListenForClients() + { + this.tcpListener.Start(); + + while (true) + { + TcpClient client; + + try + { + //blocks until a client has connected to the server + client = this.tcpListener.AcceptTcpClient(); + } + catch (SocketException) + { + break; + } + + //create a thread to handle communication + //with connected client + Thread clientThread = new Thread(new ParameterizedThreadStart(HandleClientComm)); + clientThread.Start(client); + } + } + + private void HandleClientComm(object client) + { + TcpClient tcpClient = (TcpClient)client; + NetworkStream clientStream = tcpClient.GetStream(); + + byte[] message = new byte[4096]; + int bytesRead; + + while (true) + { + bytesRead = 0; + + try + { + //blocks until a client sends a message + bytesRead = clientStream.Read(message, 0, 4096); + } + catch + { + //a socket error has occured + break; + } + + if (bytesRead == 0) + { + //the client has disconnected from the server + break; + } + + //message has successfully been received + ASCIIEncoding encoder = new ASCIIEncoding(); + string newMsg = encoder.GetString(message, 0, bytesRead); + System.Diagnostics.Debug.WriteLine(newMsg); + + if (OnDoSomething != null) + OnDoSomething(newMsg); + } + + tcpClient.Close(); + } + + public void Start() + { + if (IsStarted) return; + + this.listenThread = new Thread(new ThreadStart(ListenForClients)); + listenThread.Start(); + } + + public void Stop() + { + if (!IsStarted) return; + + tcpListener.Stop(); + } + + + } +} Added: trunk/plugins/ListeningTo/ListeningTo/IrssUtils/Network.cs =================================================================== --- trunk/plugins/ListeningTo/ListeningTo/IrssUtils/Network.cs (rev 0) +++ trunk/plugins/ListeningTo/ListeningTo/IrssUtils/Network.cs 2010-09-17 16:46:08 UTC (rev 3790) @@ -0,0 +1,135 @@ +#region Copyright (C) 2005-2009 Team MediaPortal + +// Copyright (C) 2005-2009 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.Runtime.InteropServices; +using System.Security; +using System.Security.Permissions; + +namespace IrssUtils +{ + /// <summary> + /// Provides access to Win32 Network functions. + /// </summary> + public static class Network + { + #region Constants + + private const int MAX_PREFERRED_LENGTH = -1; + + private const int SV_TYPE_SERVER = 2; + private const int SV_TYPE_WORKSTATION = 1; + + #endregion Constants + + #region Structures + + [StructLayout(LayoutKind.Sequential)] + private struct _SERVER_INFO_100 + { + public int sv100_platform_id; + [MarshalAs(UnmanagedType.LPWStr)] public string sv100_name; + } + + #endregion Structures + + #region Interop + + [DllImport("netapi32.dll", CharSet = CharSet.Auto, SetLastError = true), SuppressUnmanagedCodeSecurity] + private static extern int NetServerEnum( + string ServerName, // must be null + int Level, + ref IntPtr Buf, + int PrefMaxLen, + out int EntriesRead, + out int TotalEntries, + int ServerType, + string Domain, // null for login domain + out int ResumeHandle + ); + + [DllImport("netapi32.dll", SetLastError = true), SuppressUnmanagedCodeSecurity] + private static extern int NetApiBufferFree(IntPtr pBuf); + + #endregion Interop + + #region Methods + + /// <summary> + /// Get a list of all computer names on the LAN, except for the local host. + /// </summary> + /// <param name="includeLocalMachine">Include this computer in the list.</param> + /// <returns>List of LAN computer names.</returns> + [EnvironmentPermission(SecurityAction.Demand, Read = "COMPUTERNAME")] + public static List<string> GetComputers(bool includeLocalMachine) + { + try + { + List<string> networkComputers = new List<string>(); + + IntPtr buffer = IntPtr.Zero; + IntPtr tmpBuffer = IntPtr.Zero; + int entriesRead = 0; + int totalEntries = 0; + int resHandle = 0; + int sizeofINFO = Marshal.SizeOf(typeof (_SERVER_INFO_100)); + + int ret = NetServerEnum( + null, + 100, + ref buffer, + MAX_PREFERRED_LENGTH, + out entriesRead, + out totalEntries, + SV_TYPE_WORKSTATION, // | SV_TYPE_SERVER + null, + out resHandle); + + if (ret == 0) + { + for (int i = 0; i < totalEntries; i++) + { + tmpBuffer = new IntPtr((int) buffer + (i * sizeofINFO)); + _SERVER_INFO_100 svrInfo = (_SERVER_INFO_100) Marshal.PtrToStructure(tmpBuffer, typeof (_SERVER_INFO_100)); + + if (includeLocalMachine || + !svrInfo.sv100_name.Equals(Environment.MachineName, StringComparison.OrdinalIgnoreCase)) + networkComputers.Add(svrInfo.sv100_name); + } + } + + NetApiBufferFree(buffer); + + if (networkComputers.Count > 0) + return networkComputers; + } + catch + { + } + + return null; + } + + #endregion Methods + } +} \ No newline at end of file Added: trunk/plugins/ListeningTo/ListeningTo/IrssUtils/ProcessHelper.cs =================================================================== --- trunk/plugins/ListeningTo/ListeningTo/IrssUtils/ProcessHelper.cs (rev 0) +++ trunk/plugins/ListeningTo/ListeningTo/IrssUtils/ProcessHelper.cs 2010-09-17 16:46:08 UTC (rev 3790) @@ -0,0 +1,68 @@ +using System; +using System.Diagnostics; +using System.Reflection; +using System.Runtime.InteropServices; + +namespace IrssUtils +{ + public static class ProcessHelper + { + /// <summary> + /// Checks if the Process is already running. + /// </summary> + /// <returns>true if process is already running.</returns> + public static bool IsProcessAlreadyRunning() + { + return IsProcessAlreadyRunning(true); + } + + /// <summary> + /// Checks if the Process is already running. + /// </summary> + /// <param name="activateMainForm">If true, the mainForm will be activated, if process is already running.</param> + /// <returns>true if process is already running.</returns> + public static bool IsProcessAlreadyRunning(bool activateMainForm) + { + Process process = RunningInstance(); + if (process == null) return false; + + // activates the main form of the application + if (activateMainForm && process.MainWindowHandle != IntPtr.Zero) + ShowWindow(process.MainWindowHandle, SW_SHOWNORMAL); + + return true; + } + + public static Process RunningInstance() + { + Process current = Process.GetCurrentProcess(); + Process[] processes = Process.GetProcessesByName(current.ProcessName); + + // Loop through the running processes in with the same name + foreach (Process process in processes) + { + // Ignore the current process + if (process.Id == current.Id) continue; + + // Make sure that the process is running from the same exe file. + // todo: is this really needed??? + //if (process.MainModule.FileName == current.MainModule.FileName) + //{ + // Return the other process instance. + return process; + //} + } + + // No other instance was found, return null + return null; + } + + #region InterOp + + private const int SW_SHOWNORMAL = 1; + [DllImport("user32.dll")] + private static extern IntPtr ShowWindow(IntPtr hwnd, int nCmdShow); + + #endregion + } +} Added: trunk/plugins/ListeningTo/ListeningTo/IrssUtils/SystemRegistry.cs =================================================================== --- trunk/plugins/ListeningTo/ListeningTo/IrssUtils/SystemRegistry.cs (rev 0) +++ trunk/plugins/ListeningTo/ListeningTo/IrssUtils/SystemRegistry.cs 2010-09-17 16:46:08 UTC (rev 3790) @@ -0,0 +1,100 @@ +#region Copyright (C) 2005-2009 Team MediaPortal + +// Copyright (C) 2005-2009 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.Security.Permissions; +using Microsoft.Win32; + +namespace IrssUtils +{ + /// <summary> + /// Used for accessing the Windows System Registry. + /// </summary> + [RegistryPermission(SecurityAction.Demand, Read = "HKEY_CURRENT_USER\\SOFTWARE", Write = "HKEY_CURRENT_USER\\SOFTWARE" + )] + [RegistryPermission(SecurityAction.Demand, Read = "HKEY_LOCAL_MACHINE\\Software")] + public static class SystemRegistry + { + #region Constants + + private const string AutoRunPath = @"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run"; + private const string SoftwarePath = @"HKEY_LOCAL_MACHINE\Software\IR Server Suite"; + + #endregion Constants + + #region Methods + + /// <summary> + /// Get the install folder for IR Server Suite. + /// </summary> + /// <returns>String containing the Install Folder (no trailing slash).</returns> + public static string GetInstallFolder() + { + return Registry.GetValue(SoftwarePath, "Install_Dir", null) as string; + } + + /// <summary> + /// Returns a boolean value indicating if there is an auto-run in place for the specified name. + /// </summary> + /// <param name="name">Auto-run program name.</param> + /// <returns>If key of name exists return true else return false.</returns> + public static bool GetAutoRun(string name) + { + if (String.IsNullOrEmpty(name)) + throw new ArgumentNullException("name"); + + string value = Registry.GetValue(AutoRunPath, name, null) as string; + + return !String.IsNullOrEmpty(value); + } + + /// <summary> + /// Setup an auto-run in the system registry. + /// </summary> + /// <param name="name">Auto-run program name.</param> + /// <param name="executablePath">Executable Path for program.</param> + public static void SetAutoRun(string name, string executablePath) + { + if (String.IsNullOrEmpty(name)) + throw new ArgumentNullException("name"); + + if (String.IsNullOrEmpty(executablePath)) + throw new ArgumentNullException("executablePath"); + + Registry.SetValue(AutoRunPath, name, executablePath, RegistryValueKind.String); + } + + /// <summary> + /// Remove an auto-run from the system registry. + /// </summary> + /// <param name="name">Auto-run program name.</param> + public static void RemoveAutoRun(string name) + { + if (String.IsNullOrEmpty(name)) + throw new ArgumentNullException("name"); + + Registry.SetValue(AutoRunPath, name, String.Empty, RegistryValueKind.String); + } + + #endregion Methods + } +} \ No newline at end of file Added: trunk/plugins/ListeningTo/ListeningTo/IrssUtils/Win32.cs =================================================================== --- trunk/plugins/ListeningTo/ListeningTo/IrssUtils/Win32.cs (rev 0) +++ trunk/plugins/ListeningTo/ListeningTo/IrssUtils/Win32.cs 2010-09-17 16:46:08 UTC (rev 3790) @@ -0,0 +1,2876 @@ +#region Copyright (C) 2005-2009 Team MediaPortal + +// Copyright (C) 2005-2009 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.ComponentModel; +using System.Diagnostics; +using System.Drawing; +using System.IO; +using System.Runtime.InteropServices; +using System.Text; +using Microsoft.Win32.SafeHandles; + +namespace IrssUtils +{ + /// <summary> + /// Win32 native method class. + /// </summary> + [CLSCompliant(false)] + public static class Win32 + { + #region Constants + + private const int GCL_HICON = -14; + private const int GCL_HICONSM = -34; + + + private const int ICON_BIG = 1; + private const int ICON_SMALL = 0; + + /// <summary> + /// Maximum length of unmanaged Windows Path strings. + /// </summary> + private const int MAX_PATH = 260; + + /// <summary> + /// Maximum length of unmanaged Typename. + /// </summary> + private const int MAX_TYPE = 80; + + private const int MINIMIZE_ALL = 419; + private const int MINIMIZE_ALL_UNDO = 416; + private const int WPF_RESTORETOMAXIMIZED = 2; + + + /// <summary>Required to enable or disable the privileges in an access token.</summary> + private const int TOKEN_ADJUST_PRIVILEGES = 0x20; + /// <summary>Required to query an access token.</summary> + private const int TOKEN_QUERY = 0x8; + /// <summary>The privilege is enabled.</summary> + private const int SE_PRIVILEGE_ENABLED = 0x2; + /// <summary>Specifies that the function should search the system message-table resource(s) for the requested message.</summary> + private const int FORMAT_MESSAGE_FROM_SYSTEM = 0x1000; + /// <summary>Forces processes to terminate. When this flag is set, the system does not send the WM_QUERYENDSESSION and WM_ENDSESSION messages. This can cause the applications to lose data. Therefore, you should only use this flag in an emergency.</summary> + private const int EWX_FORCE = 4; + + + #endregion Constants + + #region Enumerations + + #region AppCommand enum + + /// <summary> + /// Windows Message App Commands. + /// </summary> + public enum AppCommand + { + /// <summary> + /// APPCOMMAND_BROWSER_BACKWARD + /// </summary> + APPCOMMAND_BROWSER_BACKWARD = 1, + /// <summary> + /// APPCOMMAND_BROWSER_FORWARD + /// </summary> + APPCOMMAND_BROWSER_FORWARD = 2, + /// <summary> + /// APPCOMMAND_BROWSER_REFRESH + /// </summary> + APPCOMMAND_BROWSER_REFRESH = 3, + /// <summary> + /// APPCOMMAND_BROWSER_STOP + /// </summary> + APPCOMMAND_BROWSER_STOP = 4, + /// <summary> + /// APPCOMMAND_BROWSER_SEARCH + /// </summary> + APPCOMMAND_BROWSER_SEARCH = 5, + /// <summary> + /// APPCOMMAND_BROWSER_FAVORITES + /// </summary> + APPCOMMAND_BROWSER_FAVORITES = 6, + /// <summary> + /// APPCOMMAND_BROWSER_HOME + /// </summary> + APPCOMMAND_BROWSER_HOME = 7, + /// <summary> + /// APPCOMMAND_VOLUME_MUTE + /// </summary> + APPCOMMAND_VOLUME_MUTE = 8, + /// <summary> + /// APPCOMMAND_VOLUME_DOWN + /// </summary> + APPCOMMAND_VOLUME_DOWN = 9, + /// <summary> + /// APPCOMMAND_VOLUME_UP + /// </summary> + APPCOMMAND_VOLUME_UP = 10, + /// <summary> + /// APPCOMMAND_MEDIA_NEXTTRACK + /// </summary> + APPCOMMAND_MEDIA_NEXTTRACK = 11, + /// <summary> + /// APPCOMMAND_MEDIA_PREVIOUSTRACK + /// </summary> + APPCOMMAND_MEDIA_PREVIOUSTRACK = 12, + /// <summary> + /// APPCOMMAND_MEDIA_STOP + /// </summary> + APPCOMMAND_MEDIA_STOP = 13, + /// <summary> + /// APPCOMMAND_MEDIA_PLAY_PAUSE + /// </summary> + APPCOMMAND_MEDIA_PLAY_PAUSE = 4143, + /// <summary> + /// APPCOMMAND_MEDIA_PLAY + /// </summary> + APPCOMMAND_MEDIA_PLAY = 4142, + /// <summary> + /// APPCOMMAND_MEDIA_PAUSE + /// </summary> + APPCOMMAND_MEDIA_PAUSE = 4143, + /// <summary> + /// APPCOMMAND_MEDIA_RECORD + /// </summary> + APPCOMMAND_MEDIA_RECORD = 4144, + /// <summary> + /// APPCOMMAND_MEDIA_FASTFORWARD + /// </summary> + APPCOMMAND_MEDIA_FASTFORWARD = 4145, + /// <summary> + /// APPCOMMAND_MEDIA_REWIND + /// </summary> + APPCOMMAND_MEDIA_REWIND = 4146, + /// <summary> + /// APPCOMMAND_MEDIA_CHANNEL_UP + /// </summary> + APPCOMMAND_MEDIA_CHANNEL_UP = 4147, + /// <summary> + /// APPCOMMAND_MEDIA_CHANNEL_DOWN + /// </summary> + APPCOMMAND_MEDIA_CHANNEL_DOWN = 4148, + } + + #endregion + + #region ExitWindows enum + + /// <summary> + /// Exit Windows method. + /// </summary> + [Flags] + public enum ExitWindows + { + /// <summary> + /// LogOff + /// </summary> + LogOff = 0, + /// <summary> + /// ShutDown + /// </summary> + ShutDown = 1, + /// <summary> + /// Reboot + /// </summary> + Reboot = 2, + /// <summary> + /// PowerOff + /// </summary> + PowerOff = 8, + } + + #endregion + + #region GWL enum + + /// <summary> + /// GWL. + /// </summary> + public enum GWL + { + /// <summary> + /// WndProc. + /// </summary> + GWL_WNDPROC = (-4), + /// <summary> + /// HInstance. + /// </summary> + GWL_HINSTANCE = (-6), + /// <summary> + /// hWnd Parent. + /// </summary> + GWL_HWNDPARENT = (-8), + /// <summary> + /// Style. + /// </summary> + GWL_STYLE = (-16), + /// <summary> + /// Extended Style. + /// </summary> + GWL_EXSTYLE = (-20), + /// <summary> + /// User Data. + /// </summary> + GWL_USERDATA = (-21), + /// <summary> + /// ID. + /// </summary> + GWL_ID = (-12), + } + + #endregion + + #region SendMessageTimeoutFlags enum + + /// <summary> + /// Send Windows Message with Timeout Flags. + /// </summary> + [Flags] + public enum SendMessageTimeoutFlags + { + /// <summary> + /// Normal. + /// </summary> + SMTO_NORMAL = 0x0000, + /// <summary> + /// Block. + /// </summary> + SMTO_BLOCK = 0x0001, + /// <summary> + /// Abort if hung. + /// </summary> + SMTO_ABORTIFHUNG = 0x0002, + /// <summary> + /// To timeout if not hung. + /// </summary> + SMTO_NOTIMEOUTIFNOTHUNG = 0x0008, + } + + #endregion + + #region ShutdownReasons enum + + /// <summary> + /// Shutdown Reasons. + /// </summary> + [Flags] + public enum ShutdownReasons + { + /// <summary> + /// MajorApplication + /// </summary> + MajorApplication = 0x00040000, + /// <summary> + /// MajorHardware + /// </summary> + MajorHardware = 0x00010000, + /// <summary> + /// MajorLegacyApi + /// </summary> + MajorLegacyApi = 0x00070000, + /// <summary> + /// MajorOperatingSystem + /// </summary> + MajorOperatingSystem = 0x00020000, + /// <summary> + /// MajorOther + /// </summary> + MajorOther = 0x00000000, + /// <summary> + /// MajorPower + /// </summary> + MajorPower = 0x00060000, + /// <summary> + /// MajorSoftware + /// </summary> + MajorSoftware = 0x00030000, + /// <summary> + /// MajorSystem + /// </summary> + MajorSystem = 0x00050000, + + /// <summary> + /// MinorBlueScreen + /// </summary> + MinorBlueScreen = 0x0000000F, + /// <summary> + /// MinorCordUnplugged + /// </summary> + MinorCordUnplugged = 0x0000000b, + /// <summary> + /// MinorDisk + /// </summary> + MinorDisk = 0x00000007, + /// <summary> + /// MinorEnvironment + /// </summary> + MinorEnvironment = 0x0000000c, + /// <summary> + /// MinorHardwareDriver + /// </summary> + MinorHardwareDriver = 0x0000000d, + /// <summary> + /// MinorHotfix + /// </summary> + MinorHotfix = 0x00000011, + /// <summary> + /// MinorHung + /// </summary> + MinorHung = 0x00000005, + /// <summary> + /// MinorInstallation + /// </summary> + MinorInstallation = 0x00000002, + /// <summary> + /// MinorMaintenance + /// </summary> + MinorMaintenance = 0x00000001, + /// <summary> + /// MinorMMC + /// </summary> + MinorMMC = 0x00000019, + /// <summary> + /// MinorNetworkConnectivity + /// </summary> + MinorNetworkConnectivity = 0x00000014, + /// <summary> + /// MinorNetworkCard + /// </summary> + MinorNetworkCard = 0x00000009, + /// <summary> + /// MinorOther + /// </summary> + MinorOther = 0x00000000, + /// <summary> + /// MinorOtherDriver + /// </summary> + MinorOtherDriver = 0x0000000e, + /// <summary> + /// MinorPowerSupply + /// </summary> + MinorPowerSupply = 0x0000000a, + /// <summary> + /// MinorProcessor + /// </summary> + MinorProcessor = 0x00000008, + /// <summary> + /// MinorReconfig + /// </summary> + MinorReconfig = 0x00000004, + /// <summary> + /// MinorSecurity + /// </summary> + MinorSecurity = 0x00000013, + /// <summary> + /// MinorSecurityFix + /// </summary> + MinorSecurityFix = 0x00000012, + /// <summary> + /// MinorSecurityFixUninstall + /// </summary> + MinorSecurityFixUninstall = 0x00000018, + /// <summary> + /// MinorServicePack + /// </summary> + MinorServicePack = 0x00000010, + /// <summary> + /// MinorServicePackUninstall + /// </summary> + MinorServicePackUninstall = 0x00000016, + /// <summary> + /// MinorTermSrv + /// </summary> + MinorTermSrv = 0x00000020, + /// <summary> + /// MinorUnstable + /// </summary> + MinorUnstable = 0x00000006, + /// <summary> + /// MinorUpgrade + /// </summary> + MinorUpgrade = 0x00000003, + /// <summary> + /// MinorWMI + /// </summary> + MinorWMI = 0x00000015, + + /// <summary> + /// FlagUserDefined + /// </summary> + FlagUserDefined = 0x40000000, + + //FlagPlanned = 0x80000000, + } + + #endregion + + #region SysCommand enum + + /// <summary> + /// Windows Message System Commands. + /// </summary> + public enum SysCommand + { + /// <summary> + /// SC_SIZE + /// </summary> + SC_SIZE = 0xF000, + /// <summary> + /// SC_MOVE + /// </summary> + SC_MOVE = 0xF010, + /// <summary> + /// SC_MINIMIZE + /// </summary> + SC_MINIMIZE = 0xF020, + /// <summary> + /// SC_MAXIMIZE + /// </summary> + SC_MAXIMIZE = 0xF030, + /// <summary> + /// SC_NEXTWINDOW + /// </summary> + SC_NEXTWINDOW = 0xF040, + /// <summary> + /// SC_PREVWINDOW + /// </summary> + SC_PREVWINDOW = 0xF050, + /// <summary> + /// SC_CLOSE + /// </summary> + SC_CLOSE = 0xF060, + /// <summary> + /// SC_VSCROLL + /// </summary> + SC_VSCROLL = 0xF070, + /// <summary> + /// SC_HSCROLL + /// </summary> + SC_HSCROLL = 0xF080, + /// <summary> + /// SC_MOUSEMENU + /// </summary> + SC_MOUSEMENU = 0xF090, + /// <summary> + /// SC_KEYMENU + /// </summary> + SC_KEYMENU = 0xF100, + /// <summary> + /// SC_ARRANGE + /// </summary> + SC_ARRANGE = 0xF110, + /// <summary> + /// SC_RESTORE + /// </summary> + SC_RESTORE = 0xF120, + /// <summary> + /// SC_TASKLIST + /// </summary> + SC_TASKLIST = 0xF130, + /// <summary> + /// SC_SCREENSAVE + /// </summary> + SC_SCREENSAVE = 0xF140, + /// <summary> + /// SC_HOTKEY + /// </summary> + SC_HOTKEY = 0xF150, + /// <summary> + /// SC_DEFAULT + /// </summary> + SC_DEFAULT = 0xF160, + /// <summary> + /// SC_MONITORPOWER + /// </summary> + SC_MONITORPOWER = 0xF170, + /// <summary> + /// SC_CONTEXTHELP + /// </summary> + SC_CONTEXTHELP = 0xF180, + /// <summary> + /// SC_SEPARATOR + /// </summary> + SC_SEPARATOR = 0xF00F, + + /// <summary> + /// SCF_ISSECURE + /// </summary> + SCF_ISSECURE = 0x00000001, + + /// <summary> + /// SC_ICON + /// </summary> + SC_ICON = SC_MINIMIZE, + /// <summary> + /// SC_ZOOM + /// </summary> + SC_ZOOM = SC_MAXIMIZE, + } + + #endregion + + #region WindowExStyles enum + + /// <summary> + /// Win32 Window Extended Styles. + /// </summary> + [Flags] + public enum WindowExStyles + { + /// <summary> + /// Specifies that a window created with this style accepts drag-drop files. + /// </summary> + WS_EX_ACCEPTFILES = 0x00000010, + /// <summary> + /// Forces a top-level window onto the taskbar when the window is visible. + /// </summary> + WS_EX_APPWINDOW = 0x00040000, + /// <summary> + /// Specifies that a window has a border with a sunken edge. + /// </summary> + WS_EX_CLIENTEDGE = 0x00000200, + /// <summary> + /// Windows XP: Paints all descendants of a window in bottom-to-top painting order using double-buffering. For more information, see Remarks. This cannot be used if the window has a class style of either CS_OWNDC or CS_CLASSDC. + /// </summary> + WS_EX_COMPOSITED = 0x02000000, + /// <summary> + /// Includes a question mark in the title bar of the window. When the user clicks the question mark, the cursor changes to a question mark with a pointer. If the user then clicks a child window, the child receives a WM_HELP message. The child window should pass the message to the parent window procedure, which should call the WinHelp function using the HELP_WM_HELP command. The Help application displays a pop-up window that typically contains help for the child window. + /// WS_EX_CONTEXTHELP cannot be used with the WS_MAXIMIZEBOX or WS_MINIMIZEBOX styles. + /// </summary> + WS_EX_CONTEXTHELP = 0x00000400, + /// <summary> + /// The window itself contains child windows that should take part in dialog box navigation. If this style is specified, the dialog manager recurses into children of this window when performing navigation operations such as handling the TAB key, an arrow key, or a keyboard mnemonic. + /// </summary> + WS_EX_CONTROLPARENT = 0x00010000, + /// <summary> + /// Creates a window that has a double border; the window can, optionally, be created with a title bar by specifying the WS_CAPTION style in the dwStyle parameter. + /// </summary> + WS_EX_DLGMODALFRAME = 0x00000001, + /// <summary> + /// Windows 2000/XP: Creates a layered window. Be aware that this cannot be used for child windows. Also, this cannot be used if the window has a class style of either CS_OWNDC or CS_CLASSDC. + /// </summary> + WS_EX_LAYERED = 0x00080000, + /// <summary> + /// Arabic and Hebrew versions of Windows 98/Me, Windows 2000/XP: Creates a window whose horizontal origin is on the right edge. Increasing horizontal values advance to the left. + /// </summary> + WS_EX_LAYOUTRTL = 0x00400000, + /// <summary> + /// Creates a window that has generic left-aligned properties. This is the default. + /// </summary> + WS_EX_LEFT = 0x00000000, + /// <summary> + /// If the shell language is Hebrew, Arabic, or another language that supports reading order alignment, the vertical scroll bar (if present) is to the left of the client area. For other languages, the style is ignored. + /// </summary> + WS_EX_LEFTSCROLLBAR = 0x00004000, + /// <summary> + /// The window text is displayed using left-to-right reading-order properties. This is the default. + /// </summary> + WS_EX_LTRREADING = 0x00000000, + /// <summary> + /// Creates a multiple-document interface (MDI) child window. + /// </summary> + WS_EX_MDICHILD = 0x00000040, + /// <summary> + /// Windows 2000/XP: A top-level window created with this style does not become the foreground window when the user clicks it. The system does not bring this window to the foreground when the user minimizes or closes the foreground window. + /// To activate the window, use the SetActiveWindow or SetForegroundWindow function. + /// The window does not appear on the taskbar by default. To force the window to appear on the taskbar, use the WS_EX_APPWINDOW style. + /// </summary> + WS_EX_NOACTIVATE = 0x08000000, + /// <summary> + /// Windows 2000/XP: A window created with this style does not pass its window layout to its child windows. + /// </summary> + WS_EX_NOINHERITLAYOUT = 0x00100000, + /// <summary> + /// Specifies that a child window created with this style does not send the WM_PARENTNOTIFY message to its parent window when it is created or destroyed. + /// </summary> + WS_EX_NOPARENTNOTIFY = 0x00000004, + /// <summary> + /// Combines the WS_EX_CLIENTEDGE and WS_EX_WINDOWEDGE styles. + /// </summary> + WS_EX_OVERLAPPEDWINDOW = WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE, + /// <summary> + /// Combines the WS_EX_WINDOWEDGE, WS_EX_TOOLWINDOW, and WS_EX_TOPMOST styles. + /// </summary> + WS_EX_PALETTEWINDOW = WS_EX_WINDOWEDGE | WS_EX_TOOLWINDOW | WS_EX_TOPMOST, + /// <summary> + /// The window has generic "right-aligned" properties. This depends on the window class. This style has an effect only if the shell language is Hebrew, Arabic, or another language that supports reading-order alignment; otherwise, the style is ignored. + /// Using the WS_EX_RIGHT style for static or edit controls has the same effect as using the SS_RIGHT or ES_RIGHT style, respectively. Using this style with button controls has the same effect as using BS_RIGHT and BS_RIGHTBUTTON styles. + /// </summary> + WS_EX_RIGHT = 0x00001000, + /// <summary> + /// Vertical scroll bar (if present) is to the right of the client area. This is the default. + /// </summary> + WS_EX_RIGHTSCROLLBAR = 0x00000000, + /// <summary> + /// If the shell language is Hebrew, Arabic, or another language that supports reading-order alignment, the window text is displayed using right-to-left reading-order properties. For other languages, the style is ignored. + /// </summary> + WS_EX_RTLREADING = 0x00002000, + /// <summary> + /// Creates a window with a three-dimensional border style intended to be used for items that do not accept user input. + /// </summary> + WS_EX_STATICEDGE = 0x00020000, + /// <summary> + /// Creates a tool window; that is, a window intended to be used as a floating toolbar. A tool window has a title bar that is shorter than a normal title bar, and the window title is drawn using a smaller font. A tool window does not appear in the taskbar or in the dialog that appears when the user presses ALT+TAB. If a tool window has a system menu, its icon is not displayed on the title bar. However, you can display the system menu by right-clicking or by typing ALT+SPACE. + /// </summary> + WS_EX_TOOLWINDOW = 0x00000080, + /// <summary> + /// Specifies that a window created with this style should be placed above all non-topmost windows and should stay above them, even when the window is deactivated. To add or remove this style, use the SetWindowPos function. + /// </summary> + WS_EX_TOPMOST = 0x00000008, + /// <summary> + /// Specifies that a window created with this style should not be painted until siblings beneath the window (that were created by the same thread) have been painted. The window appears transparent because the bits of underlying sibling windows have already been painted. + /// To achieve transparency without these restrictions, use the SetWindowRgn function. + /// </summary> + WS_EX_TRANSPARENT = 0x00000020, + /// <summary> + /// Specifies that a window has a border with a raised edge. + /// </summary> + WS_EX_WINDOWEDGE = 0x00000100 + } + + #endregion + + #region WindowsMessage enum + + /// <summary> + /// Windows Message types. + /// </summary> + public enum WindowsMessage + { + /// <summary> + /// WM_ACTIVATE + /// </summary> + WM_ACTIVATE = 0x6, + /// <summary> + /// WM_ACTIVATEAPP + /// </summary> + WM_ACTIVATEAPP = 0x1C, + /// <summary> + /// WM_AFXFIRST + /// </summary> + WM_AFXFIRST = 0x360, + /// <summary> + /// WM_AFXLAST + /// </summary> + WM_AFXLAST = 0x37F, + /// <summary> + /// WM_APP + /// </summary> + WM_APP = 0x8000, + /// <summary> + /// WM_APPCOMMAND + /// </summary> + WM_APPCOMMAND = 0x319, + /// <summary> + /// WM_ASKCBFORMATNAME + /// </summary> + WM_ASKCBFORMATNAME = 0x30C, + /// <summary> + /// WM_CANCELJOURNAL + /// </summary> + WM_CANCELJOURNAL = 0x4B, + /// <summary> + /// WM_CANCELMODE + /// </summary> + WM_CANCELMODE = 0x1F, + /// <summary> + /// WM_CAPTURECHANGED + /// </summary> + WM_CAPTURECHANGED = 0x215, + /// <summary> + /// WM_CHANGECBCHAIN + /// </summary> + WM_CHANGECBCHAIN = 0x30D, + /// <summary> + /// WM_CHAR + /// </summary> + WM_CHAR = 0x102, + /// <summary> + /// + /// </summary> + WM_CHARTOITEM = 0x2F, + /// <summary> + /// + /// </summary> + WM_CHILDACTIVATE = 0x22, + /// <summary> + /// + /// </summary> + WM_CLEAR = 0x303, + /// <summary> + /// + /// </summary> + WM_CLOSE = 0x10, + /// <summary> + /// + /// </summary> + WM_COMMAND = 0x111, + /// <summary> + /// + /// </summary> + WM_COMPACTING = 0x41, + /// <summary> + /// + /// </summary> + WM_COMPAREITEM = 0x39, + /// <summary> + /// + /// </summary> + WM_CONTEXTMENU = 0x7B, + /// <summary> + /// + /// </summary> + WM_COPY = 0x301, + /// <summary> + /// + /// </summary> + WM_COPYDATA = 0x4A, + /// <summary> + /// + /// </summary> + WM_CREATE = 0x1, + /// <summary> + /// + /// </summary> + WM_CTLCOLORBTN = 0x135, + /// <summary> + /// + /// </summary> + WM_CTLCOLORDLG = 0x136, + /// <summary> + /// + /// </summary> + WM_CTLCOLOREDIT = 0x133, + /// <summary> + /// + /// </summary> + WM_CTLCOLORLISTBOX = 0x134, + /// <summary> + /// + /// </summary> + WM_CTLCOLORMSGBOX = 0x132, + /// <summary> + /// + /// </summary> + WM_CTLCOLORSCROLLBAR = 0x137, + /// <summary> + /// + /// </summary> + WM_CTLCOLORSTATIC = 0x138, + /// <summary> + /// + /// </summary> + WM_CUT = 0x300, + /// <summary> + /// + /// </summary> + WM_DEADCHAR = 0x103, + /// <summary> + /// + /// </summary> + WM_DELETEITEM = 0x2D, + /// <summary> + /// + /// </summary> + WM_DESTROY = 0x2, + /// <summary> + /// + /// </summary> + WM_DESTROYCLIPBOARD = 0x307, + /// <summary> + /// + /// </summary> + WM_DEVICECHANGE = 0x219, + /// <summary> + /// + /// </summary> + WM_DEVMODECHANGE = 0x1B, + /// <summary> + /// + /// </summary> + WM_DISPLAYCHANGE = 0x7E, + /// <summary> + /// + /// </summary> + WM_DRAWCLIPBOARD = 0x308, + /// <summary> + /// + /// </summary> + WM_DRAWITEM = 0x2B, + /// <summary> + /// + /// </summary> + WM_DROPFILES = 0x233, + /// <summary> + /// + /// </summary> + WM_ENABLE = 0xA, + /// <summary> + /// + /// </summary> + WM_ENDSESSION = 0x16, + /// <summary> + /// + /// </summary> + WM_ENTERIDLE = 0x121, + /// <summary> + /// + /// </summary> + WM_ENTERMENULOOP = 0x211, + /// <summary> + /// + /// </summary> + WM_ENTERSIZEMOVE = 0x231, + /// <summary> + /// + /// </summary> + WM_ERASEBKGND = 0x14, + /// <summary> + /// + /// </summary> + WM_EXITMENULOOP = 0x212, + /// <summary> + /// + /// </summary> + WM_EXITSIZEMOVE = 0x232, + /// <summary> + /// + /// </summary> + WM_FONTCHANGE = 0x1D, + /// <summary> + /// + /// </summary> + WM_GETDLGCODE = 0x87, + /// <summary> + /// + /// </summary> + WM_GETFONT = 0x31, + /// <summary> + /// + /// </summary> + WM_GETHOTKEY = 0x33, + /// <summary> + /// + /// </summary> + WM_GETICON = 0x7F, + /// <summary> + /// + /// </summary> + WM_GETMINMAXINFO = 0x24, + /// <summary> + /// + /// </summary> + WM_GETOBJECT = 0x3D, + /// <summary> + /// + /// </summary> + WM_GETSYSMENU = 0x313, + /// <summary> + /// + /// </summary> + WM_GETTEXT = 0xD, + /// <summary> + /// + /// </summary> + WM_GETTEXTLENGTH = 0xE, + /// <summary> + /// + /// </summary> + WM_HANDHELDFIRST = 0x358, + /// <summary> + /// + /// </summary> + WM_HANDHELDLAST = 0x35F, + /// <summary> + /// + /// </summary> + WM_HELP = 0x53, + /// <summary> + /// + /// </summary> + WM_HOTKEY = 0x312, + /// <summary> + /// + /// </summary> + WM_HSCROLL = 0x114, + /// <summary> + /// + /// </summary> + WM_HSCROLLCLIPBOARD = 0x30E, + /// <summary> + /// + /// </summary> + WM_ICONERASEBKGND = 0x27, + /// <summary> + /// + /// </summary> + WM_IME_CHAR = 0x286, + /// <summary> + /// + /// </summary> + WM_IME_COMPOSITION = 0x10F, + /// <summary> + /// + /// </summary> + WM_IME_COMPOSITIONFULL = 0x284, + /// <summary> + /// + /// </summary> + WM_IME_CONTROL = 0x283, + /// <summary> + /// + /// </summary> + WM_IME_ENDCOMPOSITION = 0x10E, + /// <summary> + /// + /// </summary> + WM_IME_KEYDOWN = 0x290, + /// <summary> + /// + /// </summary> + WM_IME_KEYLAST = 0x10F, + /// <summary> + /// + /// </summary> + WM_IME_KEYUP = 0x291, + /// <summary> + /// + /// </summary> + WM_IME_NOTIFY = 0x282, + /// <summary> + /// + /// </summary> + WM_IME_REQUEST = 0x288, + /// <summary> + /// + /// </summary> + WM_IME_SELECT = 0x285, + /// <summary> + /// + /// </summary> + WM_IME_SETCONTEXT = 0x281, + /// <summary> + /// + /// </summary> + WM_IME_STARTCOMPOSITION = 0x10D, + /// <summary> + /// + /// </summary> + WM_INITDIALOG = 0x110, + /// <summary> + /// + /// </summary> + WM_INITMENU = 0x116, + /// <summary> + /// + /// </summary> + WM_INITMENUPOPUP = 0x117, + /// <summary> + /// + /// </summary> + WM_INPUTLANGCHANGE = 0x51, + /// <summary> + /// + /// </summary> + WM_INPUTLANGCHANGEREQUEST = 0x50, + /// <summary> + /// + /// </summary> + WM_KEYDOWN = 0x100, + /// <summary> + /// + /// </summary> + WM_KEYFIRST = 0x100, + /// <summary> + /// + /// </summary> + WM_KEYLAST = 0x108, + /// <summary> + /// + /// </summary> + WM_KEYUP = 0x101, + /// <summary> + /// + /// </summary> + WM_KILLFOCUS = 0x8, + /// <summary> + /// + /// </summary> + WM_LBUTTONDBLCLK = 0x203, + /// <summary> + /// + /// </summary> + WM_LBUTTONDOWN = 0x201, + /// <summary> + /// + /// </summary> + WM_LBUTTONUP = 0x202, + /// <summary> + /// + /// </summary> + WM_MBUTTONDBLCLK = 0x209, + /// <summary> + /// + /// </summary> + WM_MBUTTONDOWN = 0x207, + /// <summary> + /// + /// </summary> + WM_MBUTTONUP = 0x208, + /// <summary> + /// + /// </summary> + WM_MDIACTIVATE = 0x222, + /// <summary> + /// + /// </summary> + WM_MDICASCADE = 0x227, + /// <summary> + /// + /// </summary> + WM_MDICREATE = 0x220, + /// <summary> + /// + /// </summary> + WM_MDIDESTROY = 0x221, + /// <summary> + /// + /// </summary> + WM_MDIGETACTIVE = 0x229, + /// <summary> + /// + /// </summary> + WM_MDIICONARRANGE = 0x228, + /// <summary> + /// + /// </summary> + WM_MDIMAXIMIZE = 0x225, + /// <summary> + /// + /// </summary> + WM_MDINEXT = 0x224, + /// <summary> + /// + /// </summary> + WM_MDIREFRESHMENU = 0x234, + /// <summary> + /// + /// </summary> + WM_MDIRESTORE = 0x223, + /// <summary> + /// + /// </summary> + WM_MDISETMENU = 0x230, + /// <summary> + /// + /// </summary> + WM_MDITILE = 0x226, + /// <summary> + /// + /// </summary> + WM_MEASUREITEM = 0x2C, + /// <summary> + /// + /// </summary> + WM_MENUCHAR = 0x120, + /// <summary> + /// + /// </summary> + WM_MENUCOMMAND = 0x126, + /// <summary> + /// + /// </summary> + WM_MENUDRAG = 0x123, + /// <summary> + /// + /// </summary> + WM_MENUGETOBJECT = 0x124, + /// <summary> + /// + /// </summary> + WM_MENURBUTTONUP = 0x122, + /// <summary> + /// + /// </summary> + WM_MENUSELECT = 0x11F, + /// <summary> + /// + /// </summary> + WM_MOUSEACTIVATE = 0x21, + /// <summary> + /// + /// </summary> + WM_MOUSEFIRST = 0x200, + /// <summary> + /// + /// </summary> + WM_MOUSEHOVER = 0x2A1, + /// <summary> + /// + /// </summary> + WM_MOUSELAST = 0x20A, + /// <summary> + /// + /// </summary> + WM_MOUSELEAVE = 0x2A3, + /// <summary> + /// + /// </summary> + WM_MOUSEMOVE = 0x200, + /// <summary> + /// + /// </summary> + WM_MOUSEWHEEL = 0x20A, + /// <summary> + /// + /// </summary> + WM_MOVE = 0x3, + /// <summary> + /// + /// </summary> + WM_MOVING = 0x216, + /// <summary> + /// + /// </summary> + WM_NCACTIVATE = 0x86, + /// <summary> + /// + /// </summary> + WM_NCCALCSIZE = 0x83, + /// <summary> + /// + /// </summary> + WM_NCCREATE = 0x81, + /// <summary> + /// + /// </summary> + WM_NCDESTROY = 0x82, + /// <summary> + /// + /// </summary> + WM_NCHITTEST = 0x84, + /// <summary> + /// + /// </summary> + WM_NCLBUTTONDBLCLK = 0xA3, + /// <summary> + /// + /// </summary> + WM_NCLBUTTONDOWN = 0xA1, + /// <summary> + /// + /// </summary> + WM_NCLBUTTONUP = 0xA2, + /// <summary> + /// + /// </summary> + WM_NCMBUTTONDBLCLK = 0xA9, + /// <summary> + /// + /// </summary> + WM_NCMBUTTONDOWN = 0xA7, + /// <summary> + /// + /// </summary> + WM_NCMBUTTONUP = 0xA8, + /// <summary> + /// + /// </summary> + WM_NCMOUSEHOVER = 0x2A0, + /// <summary> + /// + /// </summary> + WM_NCMOUSELEAVE = 0x2A2, + /// <summary> + /// + /// </summary> + WM_NCMOUSEMOVE = 0xA0, + /// <summary> + /// + /// </summary> + WM_NCPAINT = 0x85, + /// <summary> + /// + /// </summary> + WM_NCRBUTTONDBLCLK = 0xA6, + /// <summary> + /// + /// </summary> + WM_NCRBUTTONDOWN = 0xA4, + /// <summary> + /// + /// </summary> + WM_NCRBUTTONUP = 0xA5, + /// <summary> + /// + /// </summary> + WM_NEXTDLGCTL = 0x28, + /// <summary> + /// + /// </summary> + WM_NEXTMENU = 0x213, + /// <summary> + /// + /// </summary> + WM_NOTIFY = 0x4E, + /// <summary> + /// + /// </summary> + WM_NOTIFYFORMAT = 0x55, + /// <summary> + /// + /// </summary> + WM_NULL = 0x0, + /// <summary> + /// + /// </summary> + WM_PAINT = 0xF, + /// <summary> + /// + /// </summary> + WM_PAINTCLIPBOARD = 0x309, + /// <summary> + /// + /// </summary> + WM_PAINTICON = 0x26, + /// <summary> + /// + /// </summary> + WM_PALETTECHANGED = 0x311, + /// <summary> + /// + /// </summary> + WM_PALETTEISCHANGING = 0x310, + /// <summary> + /// + /// </summary> + WM_PARENTNOTIFY = 0x210, + /// <summary> + /// + /// </summary> + WM_PASTE = 0x302, + /// <summary> + /// + /// </summary> + WM_PENWINFIRST = 0x380, + /// <summary> + /// + /// </summary> + WM_PENWINLAST = 0x38F, + /// <summary> + /// + /// </summary> + WM_POWER = 0x48, + /// <summary> + /// + /// </summary> + WM_PRINT = 0x317, + /// <summary> + /// + /// </summary> + WM_PRINTCLIENT = 0x318, + /// <summary> + /// + /// </summary> + WM_QUERYDRAGICON = 0x37, + /// <summary> + ... [truncated message content] |
From: <che...@us...> - 2010-09-19 15:00:32
|
Revision: 3791 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3791&view=rev Author: chef_koch Date: 2010-09-19 15:00:23 +0000 (Sun, 19 Sep 2010) Log Message: ----------- added CallerID from MPsvn as separate plugin Added Paths: ----------- trunk/plugins/CallerId/ trunk/plugins/CallerId/CallerID/ trunk/plugins/CallerId/CallerID/BASE/ trunk/plugins/CallerId/CallerID/BASE/ISDNCodes.xml trunk/plugins/CallerId/CallerID/BASE/thumbs/ trunk/plugins/CallerId/CallerID/BASE/thumbs/yac/ trunk/plugins/CallerId/CallerID/BASE/thumbs/yac/out-of-area.jpg trunk/plugins/CallerId/CallerID/BASE/thumbs/yac/private-number.jpg trunk/plugins/CallerId/CallerID/BASE/thumbs/yac/text-message.jpg trunk/plugins/CallerId/CallerID/BASE/thumbs/yac/wireless-caller.jpg trunk/plugins/CallerId/CallerID/BASE/yac-area-codes.xml trunk/plugins/CallerId/CallerID/CallerID.csproj trunk/plugins/CallerId/CallerID/ISDN/ trunk/plugins/CallerId/CallerID/ISDN/CallerIdISDN.cs trunk/plugins/CallerId/CallerID/ISDN/ISDNSetupForm.cs trunk/plugins/CallerId/CallerID/ISDN/ISDNSetupForm.resx trunk/plugins/CallerId/CallerID/ISDN/ISDNWatch.cs trunk/plugins/CallerId/CallerID/ISDN/OutlookHelper.cs trunk/plugins/CallerId/CallerID/Properties/ trunk/plugins/CallerId/CallerID/Properties/AssemblyInfo.cs trunk/plugins/CallerId/CallerID/Properties/Resources.Designer.cs trunk/plugins/CallerId/CallerID/Properties/Resources.resx trunk/plugins/CallerId/CallerID/References/ trunk/plugins/CallerId/CallerID/References/Microsoft.Office.Interop.Outlook.dll trunk/plugins/CallerId/CallerID/YAC/ trunk/plugins/CallerId/CallerID/YAC/CallerIdPlugin.cs trunk/plugins/CallerId/CallerID.sln Added: trunk/plugins/CallerId/CallerID/BASE/ISDNCodes.xml =================================================================== --- trunk/plugins/CallerId/CallerID/BASE/ISDNCodes.xml (rev 0) +++ trunk/plugins/CallerId/CallerID/BASE/ISDNCodes.xml 2010-09-19 15:00:23 UTC (rev 3791) @@ -0,0 +1,6526 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> +<codes> + <country iso="af" name="Afghanistan" code="93" /> + <country iso="al" name="Albania" code="355" /> + <country iso="dz" name="Algeria" code="213" /> + <country iso="as" name="American Samoa" code="684" /> + <country iso="ad" name="Andorra" code="376" /> + <country iso="ao" name="Angola" code="244" /> + <country iso="ai" name="Anguilla" code="1264" /> + <country iso="ag" name="Antigua and Barbuda" code="1268" /> + <country iso="ar" name="Argentina" code="54" /> + <country iso="am" name="Armenia" code="374" /> + <country iso="aw" name="Aruba" code="297" /> + <country iso="ac" name="Ascension Island" code="247" /> + <country iso="au" name="Australia" code="61" /> + <country iso="at" name="Austria" code="43" /> + <country iso="az" name="Azerbaijan" code="994" /> + <country iso="bs" name="Bahamas" code="1242" /> + <country iso="bh" name="Bahrain" code="973" /> + <country iso="bd" name="Bangladesh" code="880" /> + <country iso="bb" name="Barbados" code="1246" /> + <country iso="by" name="Belarus (Belorussia)" code="375" /> + <country iso="be" name="Belgium" code="32" /> + <country iso="bz" name="Belize" code="501" /> + <country iso="bj" name="Benin" code="229" /> + <country iso="bm" name="Bermuda" code="1441" /> + <country iso="bt" name="Bhutan" code="975" /> + <country iso="bo" name="Bolivia" code="591" /> + <country iso="ba" name="Bosnia-Herzegovina" code="387" /> + <country iso="bw" name="Botswana" code="267" /> + <country iso="br" name="Brazil" code="55" /> + <country iso="bn" name="Brunei" code="673" /> + <country iso="bg" name="Bulgaria" code="359" /> + <country iso="bf" name="Burkina Faso" code="226" /> + <country iso="bi" name="Burundi" code="257" /> + <country iso="kh" name="Cambodia" code="855" /> + <country iso="cm" name="Cameroon" code="237" /> + <country iso="cv" name="Cape Verde" code="238" /> + <country iso="ky" name="Cayman Islands" code="1345" /> + <country iso="cf" name="Central African Republic" code="236" /> + <country iso="td" name="Chad" code="235" /> + <country iso="cl" name="Chile" code="56" /> + <country iso="cn" name="China" code="86" /> + <country iso="co" name="Colombia" code="57" /> + <country iso="km" name="Comoros / Mayotte" code="269" /> + <country iso="cg" name="Congo" code="242" /> + <country iso="ck" name="Cook Islands" code="682" /> + <country iso="cr" name="Costa Rica" code="506" /> + <country iso="hr" name="Croatia" code="385" /> + <country iso="cu" name="Cuba" code="53" /> + <country iso="cy" name="Cyprus" code="357" /> + <country iso="cz" name="Czech Republic" code="420" /> + <country iso="dk" name="Denmark" code="45" /> + <country iso="dg" name="Diego Garcia" code="246" /> + <country iso="dj" name="Djibouti" code="253" /> + <country iso="dm" name="Dominica" code="1767" /> + <country iso="do" name="Dominican Republic" code="1809" /> + <country iso="tp" name="East Timor" code="670" /> + <country iso="ec" name="Ecuador" code="593" /> + <country iso="eg" name="Egypt" code="20" /> + <country iso="sv" name="El Salvador" code="503" /> + <country iso="gq" name="Equatorial Guinea" code="240" /> + <country iso="er" name="Eritrea" code="291" /> + <country iso="ee" name="Estonia" code="372" /> + <country iso="et" name="Ethiopia" code="251" /> + <country iso="fk" name="Falkland Islands" code="500" /> + <country iso="fo" name="Faroe Islands" code="298" /> + <country iso="fj" name="Fiji" code="679" /> + <country iso="fi" name="Finland" code="358" /> + <country iso="fr" name="France" code="33" /> + <country iso="gf" name="French Guiana" code="594" /> + <country iso="pf" name="French Polynesia" code="689" /> + <country iso="ga" name="Gabon" code="241" /> + <country iso="gm" name="Gambia" code="220" /> + <country iso="gs" name="Georgia" code="995" /> + <country iso="de" name="Germany" code="49" /> + <country iso="gh" name="Ghana" code="233" /> + <country iso="gi" name="Gibraltar" code="350" /> + <country iso="gr" name="Greece" code="30" /> + <country iso="gl" name="Greenland" code="299" /> + <country iso="gd" name="Grenada" code="1473" /> + <country iso="gp" name="Guadeloupe" code="590" /> + <country iso="gu" name="Guam" code="1671" /> + <country iso="gt" name="Guatemala" code="502" /> + <country iso="gn" name="Guinea" code="224" /> + <country iso="gw" name="Guinea-Bissau" code="245" /> + <country iso="gy" name="Guyana" code="592" /> + <country iso="ht" name="Haiti" code="509" /> + <country iso="hn" name="Honduras" code="504" /> + <country iso="hk" name="Hong Kong" code="852" /> + <country iso="hu" name="Hungary" code="36" /> + <country iso="is" name="Iceland" code="354" /> + <country iso="in" name="India" code="91" /> + <country iso="id" name="Indonesia" code="62" /> + <country iso="ism" name="Inmarsat / Satellite Mobile" code="870" /> + <country iso="ir" name="Iran" code="98" /> + <country iso="iq" name="Iraq" code="964" /> + <country iso="ie" name="Ireland" code="353" /> + <country iso="il" name="Israel" code="972" /> + <country iso="it" name="Italy" code="39" /> + <country iso="ci" name="Ivory Coast (Côte d’Ivoire)" code="225" /> + <country iso="jm" name="Jamaica" code="1876" /> + <country iso="jp" name="Japan" code="81" /> + <country iso="jo" name="Jordan" code="962" /> + <country iso="ke" name="Kenya" code="254" /> + <country iso="ki" name="Kiribati" code="686" /> + <country iso="kw" name="Kuwait" code="965" /> + <country iso="kg" name="Kyrgyzstan (Kirghizia)" code="996" /> + <country iso="la" name="Laos" code="856" /> + <country iso="lv" name="Latvia" code="371" /> + <country iso="lb" name="Lebanon" code="961" /> + <country iso="ls" name="Lesotho" code="266" /> + <country iso="lr" name="Liberia" code="231" /> + <country iso="ly" name="Libya" code="218" /> + <country iso="li" name="Liechtenstein" code="423" /> + <country iso="lt" name="Lithuania" code="370" /> + <country iso="lu" name="Luxembourg" code="352" /> + <country iso="mo" name="Macao" code="853" /> + <country iso="mk" name="Macedonia" code="389" /> + <country iso="mg" name="Madagascar" code="261" /> + <country iso="mw" name="Malawi" code="265" /> + <country iso="my" name="Malaysia" code="60" /> + <country iso="mv" name="Maldives" code="960" /> + <country iso="ml" name="Mali" code="223" /> + <country iso="mt" name="Malta" code="356" /> + <country iso="mh" name="Marshall Islands" code="692" /> + <country iso="mq" name="Martinique" code="596" /> + <country iso="mr" name="Mauritania" code="222" /> + <country iso="mu" name="Mauritius / Rodriguez Island" code="230" /> + <country iso="mx" name="Mexico" code="52" /> + <country iso="fm" name="Micronesia" code="691" /> + <country iso="md" name="Moldova (Moldavia)" code="373" /> + <country iso="mc" name="Monaco" code="377" /> + <country iso="mn" name="Mongolia" code="976" /> + <country iso="ms" name="Montserrat" code="1664" /> + <country iso="ma" name="Morocco" code="212" /> + <country iso="mz" name="Mozambique" code="258" /> + <country iso="mm" name="Myanmar / Burma" code="95" /> + <country iso="na" name="Namibia" code="264" /> + <country iso="nr" name="Nauru" code="674" /> + <country iso="np" name="Nepal" code="977" /> + <country iso="an" name="Netherlands Antilles" code="599" /> + <country iso="nc" name="New Caledonia" code="687" /> + <country iso="nz" name="New Zealand" code="64" /> + <country iso="ni" name="Nicaragua" code="505" /> + <country iso="ne" name="Niger" code="227" /> + <country iso="ng" name="Nigeria" code="234" /> + <country iso="nu" name="Niue" code="683" /> + <country iso="nf" name="Norfolk Island / Antarctic Australian Territory" code="672" /> + <country iso="kp" name="North Korea" code="850" /> + <country iso="mp" name="Northern Marianas" code="1670" /> + <country iso="no" name="Norway" code="47" /> + <country iso="om" name="Oman" code="968" /> + <country iso="pk" name="Pakistan" code="92" /> + <country iso="pw" name="Palau" code="680" /> + <country iso="ps" name="Palestinian Authority" code="970" /> + <country iso="pa" name="Panama" code="507" /> + <country iso="pg" name="Papua New Guinea" code="675" /> + <country iso="py" name="Paraguay" code="595" /> + <country iso="pe" name="Peru" code="51" /> + <country iso="ph" name="Philippines" code="63" /> + <country iso="pn" name="Pitcairn Islands" code="872" /> + <country iso="pl" name="Poland" code="48" /> + <country iso="pt" name="Portugal" code="351" /> + <country iso="pr" name="Puerto Rico" code="1787" /> + <country iso="qa" name="Qatar" code="974" /> + <country iso="re" name="Réunion" code="262" /> + <country iso="ro" name="Romania" code="40" /> + <country iso="ru" name="Russian Federation / Kazakhstan" code="7" /> + <country iso="rw" name="Rwanda" code="250" /> + <country iso="ws" name="Samoa" code="685" /> + <country iso="sm" name="San Marino" code="378" /> + <country iso="st" name="São Tomé and Principe" code="239" /> + <country iso="sa" name="Saudi Arabia" code="966" /> + <country iso="sn" name="Senegal" code="221" /> + <country iso="cs" name="Serbia & Montenegro" code="381" /> + <country iso="sc" name="Seychelles" code="248" /> + <country iso="sl" name="Sierra Leone" code="232" /> + <country iso="sg" name="Singapore" code="65" /> + <country iso="sk" name="Slovakia" code="421" /> + <country iso="si" name="Slovenia" code="386" /> + <country iso="sb" name="Solomon Islands" code="677" /> + <country iso="so" name="Somalia" code="252" /> + <country iso="za" name="South Africa" code="27" /> + <country iso="kr" name="South Korea" code="82" /> + <country iso="es" name="Spain" code="34" /> + <country iso="lk" name="Sri Lanka" code="94" /> + <country iso="sh" name="St. Helena" code="290" /> + <country iso="kn" name="St. Kitts and Nevis" code="1869" /> + <country iso="lc" name="St. Lucia" code="1758" /> + <country iso="pm" name="St. Pierre and Miquelon" code="508" /> + <country iso="vc" name="St. Vincent and the Grenadines" code="1784" /> + <country iso="sd" name="Sudan" code="249" /> + <country iso="sr" name="Suriname" code="597" /> + <country iso="sz" name="Swaziland" code="268" /> + <country iso="se" name="Sweden" code="46" /> + <country iso="ch" name="Switzerland" code="41" /> + <country iso="sy" name="Syria" code="963" /> + <country iso="tw" name="Taiwan" code="886" /> + <country iso="tj" name="Tajikistan" code="992" /> + <country iso="tz" name="Tanzania" code="255" /> + <country iso="th" name="Thailand" code="66" /> + <country iso="nl" name="the Netherlands" code="31" /> + <country iso="tg" name="Togo" code="228" /> + <country iso="tk" name="Tokelau" code="690" /> + <country iso="to" name="Tonga" code="676" /> + <country iso="tt" name="Trinidad and Tobago" code="1868" /> + <country iso="tn" name="Tunisia" code="216" /> + <country iso="tr" name="Turkey" code="90" /> + <country iso="tm" name="Turkmenistan" code="993" /> + <country iso="tc" name="Turks and Caicos Islands" code="1649" /> + <country iso="tv" name="Tuvalu" code="688" /> + <country iso="ug" name="Uganda" code="256" /> + <country iso="ua" name="Ukraine" code="380" /> + <country iso="ae" name="United Arab Emirates" code="971" /> + <country iso="gb" name="United Kingdom" code="44" /> + <country iso="uy" name="Uruguay" code="598" /> + <country iso="us" name="USA / Canada" code="1" /> + <country iso="uz" name="Uzbekistan" code="998" /> + <country iso="vu" name="Vanuatu" code="678" /> + <country iso="ve" name="Venezuela" code="58" /> + <country iso="vn" name="Vietnam" code="84" /> + <country iso="vgu" name="Virgin Islands (UK)" code="1284" /> + <country iso="vg" name="Virgin Islands (US)" code="1340" /> + <country iso="wf" name="Wallis and Futuna" code="681" /> + <country iso="ye" name="Yemen" code="967" /> + <country iso="cd" name="Zaire / Democratic Republic of the Congo" code="243" /> + <country iso="zm" name="Zambia" code="260" /> + <country iso="zw" name="Zimbabwe" code="263" /> + <area iso="at" areacode="664" location="Mobilkom Austria" /> + <area iso="at" areacode="676" location="T Mobile" /> + <area iso="at" areacode="699" location="One" /> + <area iso="at" areacode="650" location="Telering" /> + <area iso="at" areacode="660" location="Drei" /> + <area iso="at" areacode="1" location="Wien" /> + <area iso="at" areacode="2142" location="Gattendorf" /> + <area iso="at" areacode="2143" location="Kittsee" /> + <area iso="at" areacode="2144" location="Deutsch Jahrndorf" /> + <area iso="at" areacode="2145" location="Prellenkirchen" /> + <area iso="at" areacode="2146" location="Nickelsdorf, Leitha" /> + <area iso="at" areacode="2147" location="Zurndorf" /> + <area iso="at" areacode="2160" location="Jois" /> + <area iso="at" areacode="2162" location="Bruck a.d. Leitha" /> + <area iso="at" areacode="2163" location="Petronell" /> + <area iso="at" areacode="2164" location="Rohrau" /> + <area iso="at" areacode="2165" location="Hainburg a.d. Donau" /> + <area iso="at" areacode="2166" location="Parndorf" /> + <area iso="at" areacode="2167" location="Neusiedl am See" /> + <area iso="at" areacode="2168" location="Mannersdorf am Leithagebirge" /> + <area iso="at" areacode="2169" location="Trautmannsdorf a.d. Leitha" /> + <area iso="at" areacode="2172" location="Frauenkirchen" /> + <area iso="at" areacode="2173" location="Gols am Neusiedlersee" /> + <area iso="at" areacode="2174" location="Wallern im Bgl." /> + <area iso="at" areacode="2175" location="Apetlon" /> + <area iso="at" areacode="2176" location="Tadten" /> + <area iso="at" areacode="2177" location="Podersdorf am See" /> + <area iso="at" areacode="2212" location="Orth a.d. Donau" /> + <area iso="at" areacode="2213" location="Lassee, NÖ" /> + <area iso="at" areacode="2214" location="Kopfstetten" /> + <area iso="at" areacode="2215" location="Probstdorf" /> + <area iso="at" areacode="2216" location="Leopoldsdorf im Marchfelde" /> + <area iso="at" areacode="222" location="Wien" /> + <area iso="at" areacode="2230" location="Schwadorf bei Wien" /> + <area iso="at" areacode="2231" location="Purkersdorf" /> + <area iso="at" areacode="2232" location="Fischamend" /> + <area iso="at" areacode="2233" location="Preßbaum" /> + <area iso="at" areacode="2234" location="Gramatneusiedl" /> + <area iso="at" areacode="2235" location="Maria Lanzendorf" /> + <area iso="at" areacode="2236" location="Mödling" /> + <area iso="at" areacode="2237" location="Gaaden" /> + <area iso="at" areacode="2238" location="Kaltenleutgeben" /> + <area iso="at" areacode="2239" location="Breitenfurt" /> + <area iso="at" areacode="2242" location="St. Andrä-Wördern" /> + <area iso="at" areacode="2243" location="Klosterneuburg" /> + <area iso="at" areacode="2244" location="Langenzersdorf" /> + <area iso="at" areacode="2245" location="Wolkersdorf, Bezirk Mistelbach" /> + <area iso="at" areacode="2246" location="Gerasdorf bei Wien" /> + <area iso="at" areacode="2247" location="Deutsch Wagram" /> + <area iso="at" areacode="2248" location="Markgrafneusiedl" /> + <area iso="at" areacode="2249" location="Großenzersdorf" /> + <area iso="at" areacode="2252" location="Baden bei Wien" /> + <area iso="at" areacode="2253" location="Oberwaltersdorf" /> + <area iso="at" areacode="2254" location="Ebreichsdorf" /> + <area iso="at" areacode="2255" location="Deutsch Brodersdorf" /> + <area iso="at" areacode="2256" location="Leobersdorf" /> + <area iso="at" areacode="2257" location="Klausen-Leopoldsdorf" /> + <area iso="at" areacode="2258" location="Alland" /> + <area iso="at" areacode="2259" location="Münchendorf" /> + <area iso="at" areacode="2262" location="Korneuburg" /> + <area iso="at" areacode="2263" location="Großrußbach" /> + <area iso="at" areacode="2264" location="Rückersdorf-Harmannsdorf" /> + <area iso="at" areacode="2265" location="Hausleiten" /> + <area iso="at" areacode="2266" location="Stockerau" /> + <area iso="at" areacode="2267" location="Sierndorf, Bezirk Korneuburg" /> + <area iso="at" areacode="2268" location="Großmugl" /> + <area iso="at" areacode="2269" location="Niederfellabrunn" /> + <area iso="at" areacode="2271" location="Ried am Riederberg" /> + <area iso="at" areacode="2272" location="Tulln" /> + <area iso="at" areacode="2273" location="Tulbing" /> + <area iso="at" areacode="2274" location="Sieghartskirchen" /> + <area iso="at" areacode="2275" location="Atzenbrugg" /> + <area iso="at" areacode="2276" location="Reidling" /> + <area iso="at" areacode="2277" location="Zwentendorf" /> + <area iso="at" areacode="2278" location="Absdorf" /> + <area iso="at" areacode="2279" location="Kirchberg am Wagram" /> + <area iso="at" areacode="2282" location="Gänserndorf" /> + <area iso="at" areacode="2283" location="Angern a.d. March" /> + <area iso="at" areacode="2284" location="Oberweiden" /> + <area iso="at" areacode="2285" location="Marchegg" /> + <area iso="at" areacode="2286" location="Obersiebenbrunn" /> + <area iso="at" areacode="2287" location="Straßhof an der Nordbahn" /> + <area iso="at" areacode="2288" location="Auersthal" /> + <area iso="at" areacode="2289" location="Matzen" /> + <area iso="at" areacode="2522" location="Laa a.d. Thaya" /> + <area iso="at" areacode="2523" location="Kirchstetten, Bez. Mistelbach" /> + <area iso="at" areacode="2524" location="Kautendorf" /> + <area iso="at" areacode="2525" location="Gnadendorf" /> + <area iso="at" areacode="2526" location="Stronsdorf" /> + <area iso="at" areacode="2527" location="Wulzeshofen" /> + <area iso="at" areacode="2532" location="Zistersdorf" /> + <area iso="at" areacode="2533" location="Neusiedl a.d. Zaya" /> + <area iso="at" areacode="2534" location="Niedersulz" /> + <area iso="at" areacode="2535" location="Hohenau a.d. March" /> + <area iso="at" areacode="2536" location="Drösing" /> + <area iso="at" areacode="2538" location="Velm-Götzendorf" /> + <area iso="at" areacode="2552" location="Poysdorf" /> + <area iso="at" areacode="2554" location="Stützenhofen" /> + <area iso="at" areacode="2555" location="Herrnbaumgarten" /> + <area iso="at" areacode="2556" location="Großkrut" /> + <area iso="at" areacode="2557" location="Reinthal bei Bernhardsthal" /> + <area iso="at" areacode="2572" location="Mistelbach a.d. Zaya" /> + <area iso="at" areacode="2573" location="Wilfersdorf" /> + <area iso="at" areacode="2574" location="Gaweinstal" /> + <area iso="at" areacode="2575" location="Ladendorf" /> + <area iso="at" areacode="2576" location="Ernstbrunn" /> + <area iso="at" areacode="2577" location="Asparn a.d. Zaya" /> + <area iso="at" areacode="2610" location="Horitschon" /> + <area iso="at" areacode="2611" location="Mannersdorf a.d. Rabnitz" /> + <area iso="at" areacode="2612" location="Oberpullendorf" /> + <area iso="at" areacode="2613" location="Deutschkreutz" /> + <area iso="at" areacode="2614" location="Kleinwarasdorf" /> + <area iso="at" areacode="2615" location="Lutzmannsburg" /> + <area iso="at" areacode="2616" location="Lockenhaus" /> + <area iso="at" areacode="2617" location="Draßmarkt" /> + <area iso="at" areacode="2618" location="Markt St. Martin" /> + <area iso="at" areacode="2619" location="Lackendorf" /> + <area iso="at" areacode="2620" location="Willendorf am Steinfeld" /> + <area iso="at" areacode="2621" location="Sieggraben" /> + <area iso="at" areacode="2622" location="Wiener Neustadt" /> + <area iso="at" areacode="2623" location="Pottendorf" /> + <area iso="at" areacode="2624" location="Ebenfurth" /> + <area iso="at" areacode="2625" location="Sauerbrunn" /> + <area iso="at" areacode="2626" location="Mattersburg" /> + <area iso="at" areacode="2627" location="Pitten" /> + <area iso="at" areacode="2628" location="Felixdorf" /> + <area iso="at" areacode="2629" location="Warth, NÖ" /> + <area iso="at" areacode="2630" location="Ternitz" /> + <area iso="at" areacode="2631" location="Pöttsching" /> + <area iso="at" areacode="2632" location="Pernitz, NÖ" /> + <area iso="at" areacode="2633" location="Piesting, NÖ" /> + <area iso="at" areacode="2634" location="Gutenstein, NÖ" /> + <area iso="at" areacode="2635" location="Neunkirchen, NÖ" /> + <area iso="at" areacode="2636" location="Puchberg am Schneeberg" /> + <area iso="at" areacode="2637" location="Grünbach am Schneeberg" /> + <area iso="at" areacode="2638" location="Winzendorf, NÖ" /> + <area iso="at" areacode="2639" location="Bad Fischau" /> + <area iso="at" areacode="2641" location="Kirchberg am Wechsel" /> + <area iso="at" areacode="2642" location="Aspang" /> + <area iso="at" areacode="2643" location="Lichtenegg" /> + <area iso="at" areacode="2644" location="Grimmenstein" /> + <area iso="at" areacode="2645" location="Wiesmath" /> + <area iso="at" areacode="2646" location="Kirchschlag i.d. Buckl. Welt" /> + <area iso="at" areacode="2647" location="Krumbach, NÖ" /> + <area iso="at" areacode="2648" location="Hochneukirchen" /> + <area iso="at" areacode="2649" location="Mönichkirchen" /> + <area iso="at" areacode="2662" location="Gloggnitz" /> + <area iso="at" areacode="2663" location="Schottwien" /> + <area iso="at" areacode="2664" location="Semmering" /> + <area iso="at" areacode="2665" location="Prein a.d. Rax" /> + <area iso="at" areacode="2666" location="Reichenau a.d. Rax" /> + <area iso="at" areacode="2667" location="Schwarzau im Gebirge" /> + <area iso="at" areacode="2672" location="Berndorf, NÖ" /> + <area iso="at" areacode="2673" location="Altenmarkt-Thenneberg" /> + <area iso="at" areacode="2674" location="Weißenbach a.d. Triesting" /> + <area iso="at" areacode="2680" location="St. Margarethen im Bgl." /> + <area iso="at" areacode="2682" location="Eisenstadt" /> + <area iso="at" areacode="2683" location="Purbach am Neusiedler See" /> + <area iso="at" areacode="2684" location="Schützen am Gebirge" /> + <area iso="at" areacode="2685" location="Rust, Bgl." /> + <area iso="at" areacode="2686" location="Draßburg" /> + <area iso="at" areacode="2687" location="Siegendorf" /> + <area iso="at" areacode="2688" location="Steinbrunn, Bgl." /> + <area iso="at" areacode="2689" location="Hornstein, Bgl." /> + <area iso="at" areacode="2711" location="Dürnstein, NÖ" /> + <area iso="at" areacode="2712" location="Aggsbach Markt" /> + <area iso="at" areacode="2713" location="Spitz a.d. Donau" /> + <area iso="at" areacode="2714" location="Rossatz" /> + <area iso="at" areacode="2715" location="Weißenkirchen in der Wachau" /> + <area iso="at" areacode="2716" location="Gföhl" /> + <area iso="at" areacode="2717" location="Untermeisling" /> + <area iso="at" areacode="2718" location="Lichtenau im Waldviertel" /> + <area iso="at" areacode="2719" location="Droß" /> + <area iso="at" areacode="2722" location="Kirchberg a.d. Pielach" /> + <area iso="at" areacode="2723" location="Rabenstein a.d. Pielach" /> + <area iso="at" areacode="2724" location="Schwarzenbach a.d. Pielach" /> + <area iso="at" areacode="2725" location="Frankenfels" /> + <area iso="at" areacode="2726" location="Puchenstuben" /> + <area iso="at" areacode="2728" location="Wienerbruck" /> + <area iso="at" areacode="2731" location="Idolsberg" /> + <area iso="at" areacode="2732" location="Krems a.d. Donau" /> + <area iso="at" areacode="2733" location="Schönberg am Kamp" /> + <area iso="at" areacode="2734" location="Langenlois" /> + <area iso="at" areacode="2735" location="Hadersdorf am Kamp" /> + <area iso="at" areacode="2736" location="Paudorf" /> + <area iso="at" areacode="2738" location="Fels am Wagram" /> + <area iso="at" areacode="2739" location="Tiefenfucha" /> + <area iso="at" areacode="2741" location="Flinsbach" /> + <area iso="at" areacode="2742" location="St. Pölten" /> + <area iso="at" areacode="2743" location="Böheimkirchen" /> + <area iso="at" areacode="2744" location="Kasten bei Böheimkirchen" /> + <area iso="at" areacode="2745" location="Pyhra, Bezirk St. Pölten" /> + <area iso="at" areacode="2746" location="Wilhelmsburg a.d. Traisen" /> + <area iso="at" areacode="2747" location="Obergrafendorf" /> + <area iso="at" areacode="2748" location="Kilb" /> + <area iso="at" areacode="2749" location="Prinzersdorf" /> + <area iso="at" areacode="2752" location="Melk" /> + <area iso="at" areacode="2753" location="Gansbach" /> + <area iso="at" areacode="2754" location="Loosdorf, Bezirk Melk" /> + <area iso="at" areacode="2755" location="Mank" /> + <area iso="at" areacode="2756" location="St. Leonhard am Forst" /> + <area iso="at" areacode="2757" location="Pöchlarn" /> + <area iso="at" areacode="2758" location="Pöggstall" /> + <area iso="at" areacode="2762" location="Lilienfeld" /> + <area iso="at" areacode="2763" location="St. Veit a.d. Gölsen" /> + <area iso="at" areacode="2764" location="Hainfeld, NÖ" /> + <area iso="at" areacode="2765" location="Kaumberg" /> + <area iso="at" areacode="2766" location="Kleinzell" /> + <area iso="at" areacode="2767" location="Hohenberg" /> + <area iso="at" areacode="2768" location="St. Aegyd am Neuwalde" /> + <area iso="at" areacode="2769" location="Türnitz, NÖ" /> + <area iso="at" areacode="2772" location="Neulengbach" /> + <area iso="at" areacode="2773" location="Eichgraben, NÖ" /> + <area iso="at" areacode="2774" location="Innermanzing" /> + <area iso="at" areacode="2782" location="Herzogenburg" /> + <area iso="at" areacode="2783" location="Traismauer" /> + <area iso="at" areacode="2784" location="Perschling" /> + <area iso="at" areacode="2786" location="Oberwölbling" /> + <area iso="at" areacode="2812" location="Groß Gerungs" /> + <area iso="at" areacode="2813" location="Arbesbach" /> + <area iso="at" areacode="2814" location="Langschlag bei Weitra" /> + <area iso="at" areacode="2815" location="Großschönau" /> + <area iso="at" areacode="2816" location="Karlstift" /> + <area iso="at" areacode="2822" location="Zwettl, NÖ" /> + <area iso="at" areacode="2823" location="Großglobnitz" /> + <area iso="at" areacode="2824" location="Allentsteig" /> + <area iso="at" areacode="2825" location="Göpfritz a.d. Wild" /> + <area iso="at" areacode="2826" location="Rastenfeld, NÖ" /> + <area iso="at" areacode="2827" location="Schönbach" /> + <area iso="at" areacode="2828" location="Rappottenstein" /> + <area iso="at" areacode="2829" location="Schweiggers" /> + <area iso="at" areacode="2841" location="Vitis, NÖ" /> + <area iso="at" areacode="2842" location="Waidhofen a.d. Thaya" /> + <area iso="at" areacode="2843" location="Dobersberg" /> + <area iso="at" areacode="2844" location="Karlstein a.d. Thaya" /> + <area iso="at" areacode="2845" location="Weikertschlag a.d. Thaya" /> + <area iso="at" areacode="2846" location="Raabs a.d. Thaya" /> + <area iso="at" areacode="2847" location="Groß Siegharts" /> + <area iso="at" areacode="2848" location="Pfaffenschlag" /> + <area iso="at" areacode="2849" location="Schwarzenau" /> + <area iso="at" areacode="2852" location="Gmünd, NÖ" /> + <area iso="at" areacode="2853" location="Schrems, NÖ" /> + <area iso="at" areacode="2854" location="Kirchberg am Walde" /> + <area iso="at" areacode="2855" location="Waldenstein" /> + <area iso="at" areacode="2856" location="Weitra" /> + <area iso="at" areacode="2857" location="Großpertholz" /> + <area iso="at" areacode="2858" location="Harbach bei Weitra" /> + <area iso="at" areacode="2859" location="Nagelberg" /> + <area iso="at" areacode="2862" location="Heidenreichstein" /> + <area iso="at" areacode="2863" location="Eggern" /> + <area iso="at" areacode="2864" location="Kautzen" /> + <area iso="at" areacode="2865" location="Litschau" /> + <area iso="at" areacode="2872" location="Ottenschlag, NÖ" /> + <area iso="at" areacode="2873" location="Kottes" /> + <area iso="at" areacode="2874" location="Martinsberg, NÖ" /> + <area iso="at" areacode="2875" location="Grafenschlag" /> + <area iso="at" areacode="2876" location="Els" /> + <area iso="at" areacode="2877" location="Grainbrunn" /> + <area iso="at" areacode="2878" location="Spielberg" /> + <area iso="at" areacode="2912" location="Geras" /> + <area iso="at" areacode="2913" location="Hötzelsdorf" /> + <area iso="at" areacode="2914" location="Japons" /> + <area iso="at" areacode="2915" location="Drosendorf" /> + <area iso="at" areacode="2916" location="Riegersburg, NÖ" /> + <area iso="at" areacode="2942" location="Retz, NÖ" /> + <area iso="at" areacode="2943" location="Obritz" /> + <area iso="at" areacode="2944" location="Haugsdorf" /> + <area iso="at" areacode="2945" location="Zellerndorf" /> + <area iso="at" areacode="2946" location="Pulkau" /> + <area iso="at" areacode="2947" location="Theras" /> + <area iso="at" areacode="2948" location="Weitersfeld" /> + <area iso="at" areacode="2949" location="Niederfladnitz" /> + <area iso="at" areacode="2951" location="Guntersdorf" /> + <area iso="at" areacode="2952" location="Hollabrunn" /> + <area iso="at" areacode="2953" location="Nappersdorf" /> + <area iso="at" areacode="2954" location="Göllersdorf" /> + <area iso="at" areacode="2955" location="Großweikersdorf" /> + <area iso="at" areacode="2956" location="Ziersdorf" /> + <area iso="at" areacode="2957" location="Hohenwarth" /> + <area iso="at" areacode="2958" location="Maissau" /> + <area iso="at" areacode="2959" location="Sitzendorf a.d. Schmida" /> + <area iso="at" areacode="2982" location="Horn, NÖ" /> + <area iso="at" areacode="2983" location="Sigmundsherberg" /> + <area iso="at" areacode="2984" location="Eggenburg" /> + <area iso="at" areacode="2985" location="Gars am Kamp" /> + <area iso="at" areacode="2986" location="Irnfritz" /> + <area iso="at" areacode="2987" location="St. Leonhard am Hornerwald" /> + <area iso="at" areacode="2988" location="Neupölla" /> + <area iso="at" areacode="2989" location="Brunn a.d. Wild" /> + <area iso="at" areacode="3112" location="Gleisdorf" /> + <area iso="at" areacode="3113" location="Pischelsdorf in Stmk." /> + <area iso="at" areacode="3114" location="Markt Hartmannsdorf" /> + <area iso="at" areacode="3115" location="Studenzen" /> + <area iso="at" areacode="3116" location="Kirchbach in Stmk." /> + <area iso="at" areacode="3117" location="Eggersdorf" /> + <area iso="at" areacode="3118" location="Sinabelkirchen" /> + <area iso="at" areacode="3119" location="St. Marein bei Graz" /> + <area iso="at" areacode="3123" location="St. Oswald bei Plankenwarth" /> + <area iso="at" areacode="3124" location="Gratkorn" /> + <area iso="at" areacode="3125" location="Übelbach" /> + <area iso="at" areacode="3126" location="Frohnleiten" /> + <area iso="at" areacode="3127" location="Peggau" /> + <area iso="at" areacode="3132" location="Kumberg" /> + <area iso="at" areacode="3133" location="Nestelbach" /> + <area iso="at" areacode="3134" location="Heiligenkreuz am Waasen" /> + <area iso="at" areacode="3135" location="Kalsdorf bei Graz" /> + <area iso="at" areacode="3136" location="Dobl" /> + <area iso="at" areacode="3137" location="Söding" /> + <area iso="at" areacode="3140" location="St. Martin am Wöllmißberg" /> + <area iso="at" areacode="3141" location="Hirschegg" /> + <area iso="at" areacode="3142" location="Voitsberg" /> + <area iso="at" areacode="3143" location="Krottendorf" /> + <area iso="at" areacode="3144" location="Köflach" /> + <area iso="at" areacode="3145" location="Edelschrott" /> + <area iso="at" areacode="3146" location="Modriach" /> + <area iso="at" areacode="3147" location="Salla" /> + <area iso="at" areacode="3148" location="Kainach bei Voitsberg" /> + <area iso="at" areacode="3149" location="Geistthal" /> + <area iso="at" areacode="3150" location="Paldau" /> + <area iso="at" areacode="3151" location="Gnas" /> + <area iso="at" areacode="3152" location="Feldbach" /> + <area iso="at" areacode="3153" location="Riegersburg, Stmk." /> + <area iso="at" areacode="3155" location="Fehring" /> + <area iso="at" areacode="3157" location="Kapfenstein" /> + <area iso="at" areacode="3158" location="St. Anna am Aigen" /> + <area iso="at" areacode="3159" location="Bad Gleichenberg" /> + <area iso="at" areacode="316" location="Graz" /> + <area iso="at" areacode="3170" location="Fischbach" /> + <area iso="at" areacode="3171" location="Gasen" /> + <area iso="at" areacode="3172" location="Weiz" /> + <area iso="at" areacode="3173" location="Ratten" /> + <area iso="at" areacode="3174" location="Birkfeld" /> + <area iso="at" areacode="3175" location="Anger, Stmk." /> + <area iso="at" areacode="3176" location="Stubenberg am See" /> + <area iso="at" areacode="3177" location="Puch bei Weiz" /> + <area iso="at" areacode="3178" location="St. Ruprecht a.d. Raab" /> + <area iso="at" areacode="3179" location="Passail" /> + <area iso="at" areacode="3182" location="Wildon" /> + <area iso="at" areacode="3183" location="St. Georgen a.d. Stiefing" /> + <area iso="at" areacode="3184" location="Wolfsberg im Schwarzautal" /> + <area iso="at" areacode="3185" location="Preding" /> + <area iso="at" areacode="3322" location="Güssing" /> + <area iso="at" areacode="3323" location="Eberau" /> + <area iso="at" areacode="3324" location="Strem" /> + <area iso="at" areacode="3325" location="Heiligenkreuz im Lafnitztal" /> + <area iso="at" areacode="3326" location="Stegersbach" /> + <area iso="at" areacode="3327" location="St. Michael bei Güssing" /> + <area iso="at" areacode="3328" location="Kukmirn" /> + <area iso="at" areacode="3329" location="Jennersdorf" /> + <area iso="at" areacode="3331" location="St. Lorenzen am Wechsel" /> + <area iso="at" areacode="3332" location="Hartberg" /> + <area iso="at" areacode="3333" location="Sebersdorf" /> + <area iso="at" areacode="3334" location="Kaindorf bei Hartberg" /> + <area iso="at" areacode="3335" location="Pöllau" /> + <area iso="at" areacode="3336" location="Waldbach" /> + <area iso="at" areacode="3337" location="Vorau" /> + <area iso="at" areacode="3338" location="Lafnitz" /> + <area iso="at" areacode="3339" location="Friedberg" /> + <area iso="at" areacode="3352" location="Oberwart" /> + <area iso="at" areacode="3353" location="Oberschützen" /> + <area iso="at" areacode="3354" location="Bernstein" /> + <area iso="at" areacode="3355" location="Stadtschlaining" /> + <area iso="at" areacode="3356" location="Markt Allhau" /> + <area iso="at" areacode="3357" location="Pinkafeld" /> + <area iso="at" areacode="3358" location="Litzelsdorf" /> + <area iso="at" areacode="3359" location="Loipersdorf im Bgl." /> + <area iso="at" areacode="3362" location="Großpetersdorf" /> + <area iso="at" areacode="3363" location="Rechnitz" /> + <area iso="at" areacode="3364" location="Hannersdorf" /> + <area iso="at" areacode="3365" location="Deutsch Schützen" /> + <area iso="at" areacode="3366" location="Kohfidisch" /> + <area iso="at" areacode="3382" location="Fürstenfeld" /> + <area iso="at" areacode="3383" location="Burgau" /> + <area iso="at" areacode="3385" location="Ilz" /> + <area iso="at" areacode="3386" location="Großsteinbach" /> + <area iso="at" areacode="3387" location="Söchau" /> + <area iso="at" areacode="3452" location="Leibnitz" /> + <area iso="at" areacode="3453" location="Ehrenhausen" /> + <area iso="at" areacode="3454" location="Leutschach" /> + <area iso="at" areacode="3455" location="Arnfels" /> + <area iso="at" areacode="3456" location="Fresing" /> + <area iso="at" areacode="3457" location="Gleinstätten" /> + <area iso="at" areacode="3460" location="Soboth" /> + <area iso="at" areacode="3461" location="Trahütten" /> + <area iso="at" areacode="3462" location="Deutschlandsberg" /> + <area iso="at" areacode="3463" location="Stainz" /> + <area iso="at" areacode="3464" location="Groß St. Florian" /> + <area iso="at" areacode="3465" location="Pölfing-Brunn" /> + <area iso="at" areacode="3466" location="Eibiswald" /> + <area iso="at" areacode="3467" location="Schwanberg" /> + <area iso="at" areacode="3468" location="St. Oswald ob Eibiswald" /> + <area iso="at" areacode="3469" location="St. Oswald-Freiland" /> + <area iso="at" areacode="3472" location="Mureck" /> + <area iso="at" areacode="3473" location="Straden" /> + <area iso="at" areacode="3474" location="Deutsch Goritz" /> + <area iso="at" areacode="3475" location="Hürth bei Halbenrain" /> + <area iso="at" areacode="3476" location="Bad Radkersburg" /> + <area iso="at" areacode="3477" location="St. Peter am Ottersbach" /> + <area iso="at" areacode="3512" location="Knittelfeld" /> + <area iso="at" areacode="3513" location="Bischoffeld" /> + <area iso="at" areacode="3514" location="Seckau" /> + <area iso="at" areacode="3515" location="St. Lorenzen bei Knittelfeld" /> + <area iso="at" areacode="3516" location="Kleinlobming" /> + <area iso="at" areacode="3532" location="Murau" /> + <area iso="at" areacode="3533" location="Turrach" /> + <area iso="at" areacode="3534" location="Stadl a.d. Mur" /> + <area iso="at" areacode="3535" location="Krakaudorf" /> + <area iso="at" areacode="3536" location="St. Peter am Kammersberg" /> + <area iso="at" areacode="3537" location="St. Georgen ob Murau" /> + <area iso="at" areacode="3571" location="Möderbrugg" /> + <area iso="at" areacode="3572" location="Judenburg" /> + <area iso="at" areacode="3573" location="Fohnsdorf" /> + <area iso="at" areacode="3574" location="Pusterwald" /> + <area iso="at" areacode="3575" location="St. Johann am Tauern" /> + <area iso="at" areacode="3576" location="Bretstein" /> + <area iso="at" areacode="3577" location="Zeltweg" /> + <area iso="at" areacode="3578" location="Obdach" /> + <area iso="at" areacode="3579" location="Thalheim" /> + <area iso="at" areacode="3581" location="Oberwölz" /> + <area iso="at" areacode="3582" location="Scheifling" /> + <area iso="at" areacode="3583" location="Unzmarkt" /> + <area iso="at" areacode="3584" location="Neumarkt in der Stmk." /> + <area iso="at" areacode="3585" location="St. Lambrecht" /> + <area iso="at" areacode="3586" location="Mühlen" /> + <area iso="at" areacode="3587" location="Lachtal" /> + <area iso="at" areacode="3588" location="Katsch a.d. Mur" /> + <area iso="at" areacode="3611" location="Johnsbach" /> + <area iso="at" areacode="3612" location="Liezen" /> + <area iso="at" areacode="3613" location="Admont" /> + <area iso="at" areacode="3614" location="Rottenmann" /> + <area iso="at" areacode="3615" location="Trieben" /> + <area iso="at" areacode="3616" location="Selzthal" /> + <area iso="at" areacode="3617" location="Gaishorn" /> + <area iso="at" areacode="3618" location="Hohentauern" /> + <area iso="at" areacode="3619" location="Oppenberg" /> + <area iso="at" areacode="3622" location="Bad Aussee" /> + <area iso="at" areacode="3623" location="Bad Mitterndorf" /> + <area iso="at" areacode="3624" location="Kainisch bei Bad Aussee" /> + <area iso="at" areacode="3631" location="Unterlaussa" /> + <area iso="at" areacode="3632" location="St. Gallen, Stmk." /> + <area iso="at" areacode="3633" location="Landl" /> + <area iso="at" areacode="3634" location="Hieflau" /> + <area iso="at" areacode="3635" location="Radmer" /> + <area iso="at" areacode="3636" location="Wildalpen" /> + <area iso="at" areacode="3637" location="Gams bei Hieflau" /> + <area iso="at" areacode="3638" location="Palfau" /> + <area iso="at" areacode="3680" location="Donnersbachwald" /> + <area iso="at" areacode="3682" location="Stainach" /> + <area iso="at" areacode="3683" location="Donnersbach" /> + <area iso="at" areacode="3684" location="St. Martin am Grimming" /> + <area iso="at" areacode="3685" location="Gröbming" /> + <area iso="at" areacode="3686" location="Haus" /> + <area iso="at" areacode="3687" location="Schladming" /> + <area iso="at" areacode="3688" location="Tauplitz" /> + <area iso="at" areacode="3689" location="St. Nikolai im Sölktal" /> + <area iso="at" areacode="3832" location="Kraubath" /> + <area iso="at" areacode="3833" location="Traboch" /> + <area iso="at" areacode="3834" location="Wald am Schoberpaß" /> + <area iso="at" areacode="3842" location="Leoben" /> + <area iso="at" areacode="3843" location="St. Michael in der Oberstmk." /> + <area iso="at" areacode="3844" location="Kammern" /> + <area iso="at" areacode="3845" location="Mautern" /> + <area iso="at" areacode="3846" location="Kalwang" /> + <area iso="at" areacode="3847" location="Trofaiach" /> + <area iso="at" areacode="3848" location="Eisenerz" /> + <area iso="at" areacode="3849" location="Vordernberg" /> + <area iso="at" areacode="3852" location="Mürzzuschlag" /> + <area iso="at" areacode="3853" location="Spital am Semmering" /> + <area iso="at" areacode="3854" location="Langenwang" /> + <area iso="at" areacode="3855" location="Krieglach" /> + <area iso="at" areacode="3856" location="Veitsch" /> + <area iso="at" areacode="3857" location="Neuberg a.d. Mürz" /> + <area iso="at" areacode="3858" location="Mitterdorf im Mürztal" /> + <area iso="at" areacode="3859" location="Mürzsteg" /> + <area iso="at" areacode="3861" location="Aflenz" /> + <area iso="at" areacode="3862" location="Bruck a.d. Mur" /> + <area iso="at" areacode="3863" location="Turnau" /> + <area iso="at" areacode="3864" location="St. Marein im Mürztal" /> + <area iso="at" areacode="3865" location="Kindberg" /> + <area iso="at" areacode="3866" location="St. Jakob bei Mixnitz" /> + <area iso="at" areacode="3867" location="Pernegg" /> + <area iso="at" areacode="3868" location="Tragöß" /> + <area iso="at" areacode="3869" location="St. Katharein a.d. Laming" /> + <area iso="at" areacode="3882" location="Mariazell" /> + <area iso="at" areacode="3883" location="Terz" /> + <area iso="at" areacode="3884" location="Wegscheid" /> + <area iso="at" areacode="3885" location="Greith" /> + <area iso="at" areacode="3886" location="Weichselboden" /> + <area iso="at" areacode="4212" location="St. Veit a.d. Glan" /> + <area iso="at" areacode="4213" location="Launsdorf" /> + <area iso="at" areacode="4214" location="Brückl" /> + <area iso="at" areacode="4215" location="Liebenfels" /> + <area iso="at" areacode="4220" location="Köttmannsdorf" /> + <area iso="at" areacode="4221" location="Gallizien" /> + <area iso="at" areacode="4223" location="Maria Saal" /> + <area iso="at" areacode="4224" location="Pischeldorf, Kärnten" /> + <area iso="at" areacode="4225" location="Grafenstein" /> + <area iso="at" areacode="4226" location="St. Margareten im Rosental" /> + <area iso="at" areacode="4227" location="Ferlach" /> + <area iso="at" areacode="4228" location="Feistritz im Rosental" /> + <area iso="at" areacode="4229" location="Krumpendorf" /> + <area iso="at" areacode="4230" location="Globasnitz" /> + <area iso="at" areacode="4231" location="Mittertrixen" /> + <area iso="at" areacode="4232" location="Völkermarkt" /> + <area iso="at" areacode="4233" location="Griffen" /> + <area iso="at" areacode="4234" location="Ruden" /> + <area iso="at" areacode="4235" location="Bleiburg" /> + <area iso="at" areacode="4236" location="Eberndorf" /> + <area iso="at" areacode="4237" location="Miklauzhof" /> + <area iso="at" areacode="4238" location="Eisenkappel" /> + <area iso="at" areacode="4239" location="St. Kanzian" /> + <area iso="at" areacode="4240" location="Bad Kleinkirchheim" /> + <area iso="at" areacode="4242" location="Villach" /> + <area iso="at" areacode="4243" location="Bodensdorf" /> + <area iso="at" areacode="4244" location="Bleiberg" /> + <area iso="at" areacode="4245" location="Feistritz a.d. Drau" /> + <area iso="at" areacode="4246" location="Radenthein" /> + <area iso="at" areacode="4247" location="Afritz" /> + <area iso="at" areacode="4248" location="Treffen" /> + <area iso="at" areacode="4252" location="Wernberg" /> + <area iso="at" areacode="4253" location="St. Jakob im Rosental" /> + <area iso="at" areacode="4254" location="Faak am See" /> + <area iso="at" areacode="4255" location="Arnoldstein" /> + <area iso="at" areacode="4256" location="Nötsch" /> + <area iso="at" areacode="4257" location="Fürnitz" /> + <area iso="at" areacode="4258" location="Gummern" /> + <area iso="at" areacode="4262" location="Treibach" /> + <area iso="at" areacode="4263" location="Hüttenberg" /> + <area iso="at" areacode="4264" location="Klein St. Paul" /> + <area iso="at" areacode="4265" location="Weitensfeld, Kärnten" /> + <area iso="at" areacode="4266" location="Straßburg" /> + <area iso="at" areacode="4267" location="Metnitz" /> + <area iso="at" areacode="4268" location="Friesach" /> + <area iso="at" areacode="4269" location="Flattnitz" /> + <area iso="at" areacode="4271" location="Steuerberg" /> + <area iso="at" areacode="4272" location="Pörtschach" /> + <area iso="at" areacode="4273" location="Reifnitz" /> + <area iso="at" areacode="4274" location="Velden am Wörther See" /> + <area iso="at" areacode="4275" location="Ebene Reichenau" /> + <area iso="at" areacode="4276" location="Feldkirchen in Kärnten" /> + <area iso="at" areacode="4277" location="Glanegg, Kärnten" /> + <area iso="at" areacode="4278" location="Gnesau" /> + <area iso="at" areacode="4279" location="Sirnitz" /> + <area iso="at" areacode="4282" location="Hermagor" /> + <area iso="at" areacode="4283" location="St. Stefan a.d. Gail" /> + <area iso="at" areacode="4284" location="Kirchbach, Gailtal" /> + <area iso="at" areacode="4285" location="Tröpolach" /> + <area iso="at" areacode="4286" location="Weißbriach" /> + <area iso="at" areacode="4350" location="Bad St. Leonhard" /> + <area iso="at" areacode="4352" location="Wolfsberg, Kärnten" /> + <area iso="at" areacode="4353" location="Prebl" /> + <area iso="at" areacode="4354" location="Preitenegg" /> + <area iso="at" areacode="4355" location="Gemmersdorf" /> + <area iso="at" areacode="4356" location="Lavamünd" /> + <area iso="at" areacode="4357" location="St. Paul im Lavanttal" /> + <area iso="at" areacode="4358" location="St. Andrä im Lavanttal" /> + <area iso="at" areacode="4359" location="Reichenfels" /> + <area iso="at" areacode="463" location="Klagenfurt" /> + <area iso="at" areacode="4710" location="Oberdrauburg" /> + <area iso="at" areacode="4712" location="Greifenburg" /> + <area iso="at" areacode="4713" location="Techendorf" /> + <area iso="at" areacode="4714" location="Dellach im Drautal" /> + <area iso="at" areacode="4715" location="Kötschach" /> + <area iso="at" areacode="4716" location="St. Lorenzen im Lesachtal" /> + <area iso="at" areacode="4717" location="Steinfeld" /> + <area iso="at" areacode="4718" location="Dellach im Gailtal" /> + <area iso="at" areacode="4732" location="Gmünd, Kärnten" /> + <area iso="at" areacode="4733" location="Malta" /> + <area iso="at" areacode="4734" location="Rennweg" /> + <area iso="at" areacode="4735" location="Kremsbrücke" /> + <area iso="at" areacode="4736" location="Innerkrems" /> + <area iso="at" areacode="4761" location="Stockenboi" /> + <area iso="at" areacode="4762" location="Spittal a.d. Drau" /> + <area iso="at" areacode="4766" location="Millstatt" /> + <area iso="at" areacode="4767" location="Rothenthurn" /> + <area iso="at" areacode="4768" location="Kleblach" /> + <area iso="at" areacode="4769" location="Möllbrücke" /> + <area iso="at" areacode="4782" location="Obervellach" /> + <area iso="at" areacode="4783" location="Kolbnitz" /> + <area iso="at" areacode="4784" location="Mallnitz" /> + <area iso="at" areacode="4785" location="Außerfragant" /> + <area iso="at" areacode="4822" location="Winklern im Mölltal" /> + <area iso="at" areacode="4823" location="Tresdorf" /> + <area iso="at" areacode="4824" location="Heiligenblut, Ktn." /> + <area iso="at" areacode="4825" location="Großkirchheim" /> + <area iso="at" areacode="4826" location="Mörtschach" /> + <area iso="at" areacode="4842" location="Sillian" /> + <area iso="at" areacode="4843" location="Außervillgraten" /> + <area iso="at" areacode="4846" location="Abfaltersbach" /> + <area iso="at" areacode="4847" location="Obertilliach" /> + <area iso="at" areacode="4848" location="Kartitsch" /> + <area iso="at" areacode="4852" location="Lienz" /> + <area iso="at" areacode="4853" location="Ainet" /> + <area iso="at" areacode="4855" location="Thal-Aßling" /> + <area iso="at" areacode="4858" location="Nikolsdorf" /> + <area iso="at" areacode="4872" location="Huben, Osttirol" /> + <area iso="at" areacode="4873" location="St. Jakob in Defereggen" /> + <area iso="at" areacode="4874" location="Virgen" /> + <area iso="at" areacode="4875" location="Matrei, Osttirol" /> + <area iso="at" areacode="4876" location="Kals" /> + <area iso="at" areacode="4877" location="Prägraten" /> + <area iso="at" areacode="4879" location="St. Veit in Defereggen" /> + <area iso="at" areacode="512" location="Innsbruck" /> + <area iso="at" areacode="5212" location="Seefeld" /> + <area iso="at" areacode="5213" location="Scharnitz" /> + <area iso="at" areacode="5214" location="Leutasch" /> + <area iso="at" areacode="5223" location="Hall in Tirol" /> + <area iso="at" areacode="5224" location="Wattens" /> + <area iso="at" areacode="5225" location="Fulpmes" /> + <area iso="at" areacode="5226" location="Neustift im Stubaital" /> + <area iso="at" areacode="5230" location="Sellrain" /> + <area iso="at" areacode="5232" location="Kematen in Tirol" /> + <area iso="at" areacode="5234" location="Axams" /> + <area iso="at" areacode="5236" location="Gries im Sellrain" /> + <area iso="at" areacode="5238" location="Zirl" /> + <area iso="at" areacode="5239" location="Kühtai" /> + <area iso="at" areacode="5242" location="Schwaz" /> + <area iso="at" areacode="5243" location="Maurach" /> + <area iso="at" areacode="5244" location="Jenbach" /> + <area iso="at" areacode="5245" location="Hinterriß" /> + <area iso="at" areacode="5246" location="Achenkirch" /> + <area iso="at" areacode="5248" location="Steinberg am Rofan" /> + <area iso="at" areacode="5252" location="Ötz" /> + <area iso="at" areacode="5253" location="Längenfeld" /> + <area iso="at" areacode="5254" location="Sölden" /> + <area iso="at" areacode="5255" location="Umhausen" /> + <area iso="at" areacode="5256" location="Untergurgl" /> + <area iso="at" areacode="5262" location="Telfs" /> + <area iso="at" areacode="5263" location="Silz" /> + <area iso="at" areacode="5264" location="Obermieming" /> + <area iso="at" areacode="5265" location="Nassereith" /> + <area iso="at" areacode="5266" location="Ötztal" /> + <area iso="at" areacode="5272" location="Steinach, Tirol" /> + <area iso="at" areacode="5273" location="Matrei am Brenner" /> + <area iso="at" areacode="5274" location="Gries am Brenner" /> + <area iso="at" areacode="5275" location="Trins" /> + <area iso="at" areacode="5276" location="Gschnitz" /> + <area iso="at" areacode="5278" location="Navis" /> + <area iso="at" areacode="5279" location="St. Jodok am Brenner" /> + <area iso="at" areacode="5280" location="Hochfügen" /> + <area iso="at" areacode="5282" location="Zell am Ziller" /> + <area iso="at" areacode="5283" location="Kaltenbach" /> + <area iso="at" areacode="5284" location="Gerlos" /> + <area iso="at" areacode="5285" location="Mayrhofen" /> + <area iso="at" areacode="5286" location="Ginzling" /> + <area iso="at" areacode="5287" location="Lanersbach" /> + <area iso="at" areacode="5288" location="Fügen" /> + <area iso="at" areacode="5289" location="Häusling" /> + <area iso="at" areacode="5331" location="Brandenberg" /> + <area iso="at" areacode="5332" location="Wörgl" /> + <area iso="at" areacode="5333" location="Söll" /> + <area iso="at" areacode="5334" location="Westendorf" /> + <area iso="at" areacode="5335" location="Hopfgarten" /> + <area iso="at" areacode="5336" location="Alpbach" /> + <area iso="at" areacode="5337" location="Brixlegg" /> + <area iso="at" areacode="5338" location="Kundl" /> + <area iso="at" areacode="5339" location="Wildschönau" /> + <area iso="at" areacode="5352" location="St. Johann in Tirol" /> + <area iso="at" areacode="5353" location="Waidring" /> + <area iso="at" areacode="5354" location="Fieberbrunn" /> + <area iso="at" areacode="5355" location="Jochberg" /> + <area iso="at" areacode="5356" location="Kitzbühel" /> + <area iso="at" areacode="5357" location="Kirchberg in Tirol" /> + <area iso="at" areacode="5358" location="Ellmau" /> + <area iso="at" areacode="5359" location="Hochfilzen" /> + <area iso="at" areacode="5372" location="Kufstein" /> + <area iso="at" areacode="5373" location="Ebbs" /> + <area iso="at" areacode="5374" location="Walchsee" /> + <area iso="at" areacode="5375" location="Kössen" /> + <area iso="at" areacode="5376" location="Thiersee" /> + <area iso="at" areacode="5412" location="Imst" /> + <area iso="at" areacode="5413" location="St. Leonhard im Pitztal" /> + <area iso="at" areacode="5414" location="Wenns" /> + <area iso="at" areacode="5417" location="Roppen" /> + <area iso="at" areacode="5418" location="Schönwies" /> + <area iso="at" areacode="5441" location="See, Paznaun" /> + <area iso="at" areacode="5442" location="Landeck" /> + <area iso="at" areacode="5443" location="Galtür" /> + <area iso="at" areacode="5444" location="Ischgl" /> + <area iso="at" areacode="5445" location="Kappl" /> + <area iso="at" areacode="5446" location="St. Anton am Arlberg" /> + <area iso="at" areacode="5447" location="Flirsch" /> + <area iso="at" areacode="5448" location="Pettneu" /> + <area iso="at" areacode="5449" location="Fließ" /> + <area iso="at" areacode="5472" location="Prutz" /> + <area iso="at" areacode="5473" location="Nauders" /> + <area iso="at" areacode="5474" location="Pfunds" /> + <area iso="at" areacode="5475" location="Feichten" /> + <area iso="at" areacode="5476" location="Serfaus" /> + <area iso="at" areacode="5477" location="Tösens" /> + <area iso="at" areacode="5510" location="Damüls" /> + <area iso="at" areacode="5512" location="Egg" /> + <area iso="at" areacode="5513" location="Hittisau" /> + <area iso="at" areacode="5514" location="Bezau" /> + <area iso="at" areacode="5515" location="Au, Bregenzerwald" /> + <area iso="at" areacode="5516" location="Doren" /> + <area iso="at" areacode="5517" location="Riezlern" /> + <area iso="at" areacode="5518" location="Mellau" /> + <area iso="at" areacode="5519" location="Schröcken" /> + <area iso="at" areacode="5522" location="Feldkirch" /> + <area iso="at" areacode="5523" location="Götzis" /> + <area iso="at" areacode="5524" location="Satteins" /> + <area iso="at" areacode="5525" location="Nenzing" /> + <area iso="at" areacode="5526" location="Laterns" /> + <area iso="at" areacode="5550" location="Thüringen" /> + <area iso="at" areacode="5552" location="Bludenz" /> + <area iso="at" areacode="5553" location="Raggal" /> + <area iso="at" areacode="5554" location="Sonntag" /> + <area iso="at" areacode="5556" location="Schruns" /> + <area iso="at" areacode="5557" location="St. Gallenkirch" /> + <area iso="at" areacode="5558" location="Gaschurn" /> + <area iso="at" areacode="5559" location="Brand" /> + <area iso="at" areacode="5572" location="Dornbirn" /> + <area iso="at" areacode="5573" location="Hörbranz" /> + <area iso="at" areacode="5574" location="Bregenz" /> + <area iso="at" areacode="5575" location="Langen bei Bregenz" /> + <area iso="at" areacode="5576" location="Hohenems" /> + <area iso="at" areacode="5577" location="Lustenau" /> + <area iso="at" areacode="5578" location="Höchst" /> + <area iso="at" areacode="5579" location="Alberschwende" /> + <area iso="at" areacode="5582" location="Langen am Arlberg" /> + <area iso="at" areacode="5583" location="Lech" /> + <area iso="at" areacode="5585" location="Dalaas" /> + <area iso="at" areacode="5632" location="Stanzach" /> + <area iso="at" areacode="5633" location="Hägerau" /> + <area iso="at" areacode="5634" location="Elbigenalp" /> + <area iso="at" areacode="5635" location="Elmen" /> + <area iso="at" areacode="5672" location="Reutte" /> + <area iso="at" areacode="5673" location="Ehrwald" /> + <area iso="at" areacode="5674" location="Bichlbach" /> + <area iso="at" areacode="5675" location="Tannheim" /> + <area iso="at" areacode="5676" location="Jungholz" /> + <area iso="at" areacode="5677" location="Vils" /> + <area iso="at" areacode="5678" location="Weißenbach am Lech" /> + <area iso="at" areacode="6131" location="Obertraun" /> + <area iso="at" areacode="6132" location="Bad Ischl" /> + <area iso="at" areacode="6133" location="Ebensee" /> + <area iso="at" areacode="6134" location="Hallstatt" /> + <area iso="at" areacode="6135" location="Bad Goisern" /> + <area iso="at" areacode="6136" location="Gosau" /> + <area iso="at" areacode="6137" location="Strobl" /> + <area iso="at" areacode="6138" location="St. Wolfgang im Salzkammergut" /> + <area iso="at" areacode="6210" location="Lochen" /> + <area iso="at" areacode="6212" location="Seekirchen" /> + <area iso="at" areacode="6213" location="Oberhofen" /> + <area iso="at" areacode="6214" location="Henndorf am Wallersee" /> + <area iso="at" areacode="6215" location="Straßwalchen" /> + <area iso="at" areacode="6216" location="Neumarkt am Wallersee" /> + <area iso="at" areacode="6217" location="Mattsee" /> + <area iso="at" areacode="6218" location="Friedburg, OÖ" /> + <area iso="at" areacode="6219" location="Obertrum" /> + <area iso="at" areacode="6221" location="Koppl" /> + <area iso="at" areacode="6223" location="Anthering" /> + <area iso="at" areacode="6224" location="Hintersee" /> + <area iso="at" areacode="6225" location="Eugendorf" /> + <area iso="at" areacode="6226" location="Fuschl am See" /> + <area iso="at" areacode="6227" location="St. Gilgen" /> + <area iso="at" areacode="6228" location="Faistenau" /> + <area iso="at" areacode="6229" location="Hof bei Salzburg" /> + <area iso="at" areacode="6232" location="Mondsee, OÖ" /> + <area iso="at" areacode="6233" location="Oberwang" /> + <area iso="at" areacode="6234" location="Zell am Moos" /> + <area iso="at" areacode="6235" location="Thalgau" /> + <area iso="at" areacode="6240" location="Krispl" /> + <area iso="at" areacode="6241" location="St. Koloman" /> + <area iso="at" areacode="6242" location="Rußbach" /> + <area iso="at" areacode="6243" location="Abtenau" /> + <area iso="at" areacode="6244" location="Golling" /> + <area iso="at" areacode="6245" location="Hallein" /> + <area iso="at" areacode="6246" location="Grödig" /> + <area iso="at" areacode="6247" location="Großgmain" /> + <area iso="at" areacode="6272" location="Oberndorf bei Salzburg" /> + <area iso="at" areacode="6274" location="Lamprechtshausen" /> + <area iso="at" areacode="6276" location="Nußdorf am Haunsberg... [truncated message content] |
From: <aj...@us...> - 2010-10-08 14:44:08
|
Revision: 3811 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3811&view=rev Author: ajp5199 Date: 2010-10-08 14:43:59 +0000 (Fri, 08 Oct 2010) Log Message: ----------- Adding MediaPortal Widgets plug-in; provides an analog clock widget, could be easily extended to offer more widgets for the UI. Added Paths: ----------- trunk/plugins/MediaPortalWidgets Plugin/ trunk/plugins/MediaPortalWidgets Plugin/MPWSamples-1.0.0.0.rar trunk/plugins/MediaPortalWidgets Plugin/MediaPortal Widgets Plugin.sln trunk/plugins/MediaPortalWidgets Plugin/MediaPortal Widgets Plugin.suo trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/ trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/AnalogClock/ trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/AnalogClock/GUIAnalogClock.cs trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/MediaPortalWidgets.cs trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/MediaPortalWidgets.csproj trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/MediaPortalWidgets.csproj.user trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/MediaPortalWidgets.png trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/MediaPortalWidgetsDisabled.png trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/Properties/ trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/Properties/AssemblyInfo.cs trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/Thumbs.db trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/ trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/ trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/AxInterop.WMPLib.dll trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/Bass.Net.dll trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/BassRegistration.dll trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/Core.dll trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/DirectShowLib.dll trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/Gentle.Common.dll trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/Gentle.Framework.dll trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/Gentle.Provider.MySQL.dll trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/Gentle.Provider.SQLServer.dll trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/Interop.SHDocVw.dll trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/Interop.WMPLib.dll trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/Ionic.Zip.dll trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/MediaPortal.Support.dll trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/MediaPortalWidgets.dll trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/MediaPortalWidgets.pdb trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/MySql.Data.dll trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/Utils.dll trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/edtftpnet-1.2.2.dll trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/log4net.dll trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/taglib-sharp.dll trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/ trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/AxInterop.WMPLib.dll trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/Bass.Net.dll trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/BassRegistration.dll trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/Core.dll trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/DirectShowLib.dll trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/Gentle.Common.dll trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/Gentle.Framework.dll trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/Gentle.Provider.MySQL.dll trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/Gentle.Provider.SQLServer.dll trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/Interop.SHDocVw.dll trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/Interop.WMPLib.dll trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/Ionic.Zip.dll trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/MediaPortal.Support.dll trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/MediaPortalWidgets-1.0.0.0.rar trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/MediaPortalWidgets.dll trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/MediaPortalWidgets.pdb trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/MySql.Data.dll trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/Utils.dll trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/edtftpnet-1.2.2.dll trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/log4net.dll trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/taglib-sharp.dll trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/obj/ trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/obj/Debug/ trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/obj/Debug/MediaPortalWidgets.csproj.FileListAbsolute.txt trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/obj/Debug/MediaPortalWidgets.dll trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/obj/Debug/MediaPortalWidgets.pdb trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/obj/Debug/ResolveAssemblyReference.cache trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/obj/Debug/TempPE/ trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/obj/Release/ trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/obj/Release/MediaPortalWidgets.csproj.FileListAbsolute.txt trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/obj/Release/MediaPortalWidgets.dll trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/obj/Release/MediaPortalWidgets.pdb trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/obj/Release/ResolveAssemblyReference.cache trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/obj/Release/TempPE/ trunk/plugins/MediaPortalWidgets Plugin/Samples/ trunk/plugins/MediaPortalWidgets Plugin/Samples/AnalogClock/ trunk/plugins/MediaPortalWidgets Plugin/Samples/AnalogClock/AnalogClock.psd trunk/plugins/MediaPortalWidgets Plugin/Samples/AnalogClock/AnalogClock24.psd trunk/plugins/MediaPortalWidgets Plugin/Samples/AnalogClock/AnalogClockExample.png trunk/plugins/MediaPortalWidgets Plugin/Samples/AnalogClock/AnalogClockStylish.psd trunk/plugins/MediaPortalWidgets Plugin/Samples/AnalogClock/Thumbs.db trunk/plugins/MediaPortalWidgets Plugin/Samples/AnalogClock/clockCover3.png trunk/plugins/MediaPortalWidgets Plugin/Samples/AnalogClock/clockFace1.png trunk/plugins/MediaPortalWidgets Plugin/Samples/AnalogClock/clockFace2.png trunk/plugins/MediaPortalWidgets Plugin/Samples/AnalogClock/clockFace3.png trunk/plugins/MediaPortalWidgets Plugin/Samples/AnalogClock/clockHandHour1.png trunk/plugins/MediaPortalWidgets Plugin/Samples/AnalogClock/clockHandHour2.png trunk/plugins/MediaPortalWidgets Plugin/Samples/AnalogClock/clockHandHour3.png trunk/plugins/MediaPortalWidgets Plugin/Samples/AnalogClock/clockHandMinute1.png trunk/plugins/MediaPortalWidgets Plugin/Samples/AnalogClock/clockHandMinute2.png trunk/plugins/MediaPortalWidgets Plugin/Samples/AnalogClock/clockHandMinute3.png trunk/plugins/MediaPortalWidgets Plugin/Samples/AnalogClock/clockHandSecond1.png trunk/plugins/MediaPortalWidgets Plugin/Samples/AnalogClock/clockHandSecond3.png trunk/plugins/MediaPortalWidgets Plugin/Samples/AnalogClock/hands1.psd trunk/plugins/MediaPortalWidgets Plugin/Samples/MPW Readme.txt trunk/plugins/MediaPortalWidgets Plugin/Samples/Thumbs.db trunk/plugins/MediaPortalWidgets Plugin/Thumbs.db trunk/plugins/MediaPortalWidgets Plugin/logo.psd Added: trunk/plugins/MediaPortalWidgets Plugin/MPWSamples-1.0.0.0.rar =================================================================== (Binary files differ) Property changes on: trunk/plugins/MediaPortalWidgets Plugin/MPWSamples-1.0.0.0.rar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortal Widgets Plugin.sln =================================================================== --- trunk/plugins/MediaPortalWidgets Plugin/MediaPortal Widgets Plugin.sln (rev 0) +++ trunk/plugins/MediaPortalWidgets Plugin/MediaPortal Widgets Plugin.sln 2010-10-08 14:43:59 UTC (rev 3811) @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MediaPortalWidgets", "MediaPortalWidgets Plugin\MediaPortalWidgets.csproj", "{C223CD83-9E3D-4091-A276-7FC64647887C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {C223CD83-9E3D-4091-A276-7FC64647887C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C223CD83-9E3D-4091-A276-7FC64647887C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C223CD83-9E3D-4091-A276-7FC64647887C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C223CD83-9E3D-4091-A276-7FC64647887C}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortal Widgets Plugin.suo =================================================================== (Binary files differ) Property changes on: trunk/plugins/MediaPortalWidgets Plugin/MediaPortal Widgets Plugin.suo ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/AnalogClock/GUIAnalogClock.cs =================================================================== --- trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/AnalogClock/GUIAnalogClock.cs (rev 0) +++ trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/AnalogClock/GUIAnalogClock.cs 2010-10-08 14:43:59 UTC (rev 3811) @@ -0,0 +1,347 @@ +#region Copyright (C) 2005-2010 Team MediaPortal + +/* + * Copyright (C) 2005-2010 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 +/// <summary> +/// Written by Andy Phillipson (aj...@mi...) +/// </summary> + +using MediaPortal.GUI.Library; +using Microsoft.DirectX.Direct3D; + +namespace MediaPortalWidgets +{ + public class GUIAnalogClock : GUIControl + { + #region Skin variables + + [XMLSkinElement("colordiffuse")] protected long m_dwColorDiffuse = 0xFFFFFFFF; + [XMLSkinElement("textureFace")] protected string m_strTextureFace = ""; + [XMLSkinElement("textureHourHand")] protected string m_strTextureHandHour = ""; + [XMLSkinElement("textureMinuteHand")] protected string m_strTextureHandMinute = ""; + [XMLSkinElement("textureSecondHand")] protected string m_strTextureHandSecond = ""; + [XMLSkinElement("textureCover")] protected string m_strTextureCover = ""; + [XMLSkinElement("handOriginX")] protected int m_intHandOriginX = -1; + [XMLSkinElement("handOriginY")] protected int m_intHandOriginY = -1; + [XMLSkinElement("handScale")] protected int m_intHandScale = 100; + [XMLSkinElement("sweepSecondHand")] protected bool m_bSweepHand = false; + [XMLSkinElement("clock24Hour")] protected bool m_b24HourClock = false; + + #endregion + + #region Member variables + + private GUIImage m_imgTextureFace = null; + private GUIImage m_imgTextureHandHour = null; + private GUIImage m_imgTextureHandMinute = null; + private GUIImage m_imgTextureHandSecond = null; + private GUIImage m_imgTextureCover = null; + + private float _hourHandAngle = 0f; + private float _minuteHandAngle = 0f; + private float _secondHandAngle = 0f; + + #endregion Member variables + + #region Construction + + public GUIAnalogClock(int nParentID) + : base(nParentID) + { + } + + #endregion Construction + + #region Properties + + #endregion Properties + + #region Implementation + + private void Calculate() + { + System.DateTime now = System.DateTime.Now.ToLocalTime(); + + // There is 6 degrees from one second to the next on the clock face. + _secondHandAngle = now.Second * 0.104719755f; // now.Second * 6.0f * (float)System.Math.PI / 180.0f; + + // Smooth clock. + // Add some portion of angle associated with the current millisecond to provide smooth movement clock. + // There is 0.006 degrees second hand movement for each millisecond. + if (m_bSweepHand) + { + _secondHandAngle += now.Millisecond * 0.000104719755f; // now.Millisecond * (0.006f *(float)System.Math.PI / 180.f; + } + + // There is 6 degrees from one minute to the next on the clock face. + _minuteHandAngle = now.Minute * 0.104719755f; // now.Minute * 6.0f * (float)System.Math.PI / 180.0f; + + // Smooth clock. + // Add some portion of angle associated with the current second to provide smooth movement clock. + // There is 0.1 degrees minute hand movement for each second. + _minuteHandAngle += now.Second * 0.00174532925f; // now.Second * (0.1f *(float)System.Math.PI / 180.f; + + int nowHour = now.Hour; + if (m_b24HourClock) + { + // There is 15 degrees between numbers on the 24 hour clock face. + _hourHandAngle = nowHour * 0.261799388f; // now.Hour * 15.0f * (float)System.Math.PI / 180.0f; + + // Smooth clock. + // Add some portion of angle associated with the current minute to provide smooth movement clock. + // There is 0.25 degrees hour hand movement for each minute on a 24 hour clock. + _hourHandAngle += now.Minute * 0.00436332313f; // now.Minute * (0.25f *(float)System.Math.PI / 180.f; + } + else + { + if (nowHour >= 12) + { + nowHour -= 12; + } + + // There is 30 degrees between numbers on the 12 hour clock face. + _hourHandAngle = nowHour * 0.523598776f; // now.Hour * 30.0f * (float)System.Math.PI / 180.0f; + + // Smooth clock. + // Add some portion of angle associated with the current minute to provide smooth movement clock. + // There is 0.5 degrees hour hand movement for each minute on a 12 hour clock. + _hourHandAngle += now.Minute * 0.00872664626f; // now.Minute * (0.5f *(float)System.Math.PI / 180.f; + } + + } + + private void RenderFace(float timePassed) + { + if (m_imgTextureFace != null) + { + m_imgTextureFace.Render(timePassed); + } + } + + private void RenderHand(float timePassed, float angle, GUIImage imageHand) + { + // Return if there is nothing to draw. + if (imageHand == null) + { + return; + } + + // Get the current final (or global) transform for our current geometry. + TransformMatrix globalTransform = GUIGraphicsContext.GetFinalTransform(); + + // Compute the matrix that rotates the hand around the x,y point of the clock hands origin. + TransformMatrix localTransform = new TransformMatrix(); + localTransform.SetZRotation(angle, m_intHandOriginX, m_intHandOriginY, 1.0f); + localTransform = globalTransform.multiply(localTransform); + + /* + int w = imageHand.Width; + int h = imageHand.Height; + GUIGraphicsContext.ScaleHorizontal(ref w); + GUIGraphicsContext.ScaleHorizontal(ref h); + imageHand.Width = w; + imageHand.Height = h; + */ + + // Set the computed tranform matrix, render the hand, and restore the original (global) tranform matrix. + GUIGraphicsContext.UpdateFinalTransform(localTransform); + imageHand.Render(timePassed); + GUIGraphicsContext.UpdateFinalTransform(globalTransform); + } + + private void RenderHandHour(float timePassed) + { + RenderHand(timePassed, _hourHandAngle, m_imgTextureHandHour); + } + + private void RenderHandMinute(float timePassed) + { + RenderHand(timePassed, _minuteHandAngle, m_imgTextureHandMinute); + } + + private void RenderHandSecond(float timePassed) + { + RenderHand(timePassed, _secondHandAngle, m_imgTextureHandSecond); + } + + private void RenderCover(float timePassed) + { + if (m_imgTextureCover != null) + { + m_imgTextureCover.Render(timePassed); + } + } + + #endregion Implementation + + #region Overrides + + public override void FinalizeConstruction() + { + base.FinalizeConstruction(); + + // If the hand origin is not specified then compute it to be at the center of the face. + if (m_intHandOriginX < 0 || m_intHandOriginY < 0) + { + m_intHandOriginX = _positionX + (Width / 2); + m_intHandOriginY = _positionY + (Height / 2); + } + + if (m_strTextureFace != "" && m_strTextureFace != "-") + { + m_imgTextureFace = new GUIImage(_parentControlId, 0, + _positionX, _positionY, Width, Height, + m_strTextureFace, m_dwColorDiffuse); + } + + // Create each of the clock hand images. + if (m_strTextureHandHour != "" && m_strTextureHandHour != "-") + { + m_imgTextureHandHour = CreateHand(m_strTextureHandHour); + } + + if (m_strTextureHandMinute != "" && m_strTextureHandMinute != "-") + { + m_imgTextureHandMinute = CreateHand(m_strTextureHandMinute); + } + + if (m_strTextureHandSecond != "" && m_strTextureHandSecond != "-") + { + m_imgTextureHandSecond = CreateHand(m_strTextureHandSecond); + } + + // The clock cover image is setup to fit exactly over the clock face image. + if (m_strTextureCover != "" && m_strTextureCover != "-") + { + m_imgTextureCover = new GUIImage(_parentControlId, 0, + _positionX, _positionY, Width, Height, + m_strTextureCover, m_dwColorDiffuse); + } + } + + private GUIImage CreateHand(string strHandTextureFile) + { + float uoff, voff, umax, vmax; + Texture texture; + int textureNo; + int handWidth = 0; + int handHeight = 0; + + // Get the hand texture size and scale it as requested. + GUITextureManager.GetPackedTexture(strHandTextureFile, out uoff, out voff, + out umax, out vmax, out handWidth, + out handHeight, out texture, out textureNo); + handWidth = handWidth * m_intHandScale / 100; + handHeight = handHeight * m_intHandScale / 100; + + // Create and return the hand image. + return new GUIImage(_parentControlId, 0, + m_intHandOriginX - (handWidth / 2), + m_intHandOriginY - (handHeight / 2), + handWidth, + handHeight, + strHandTextureFile, m_dwColorDiffuse); + } + + public override void AllocResources() + { + base.AllocResources(); + + if (m_imgTextureFace != null) + { + m_imgTextureFace.AllocResources(); + } + + if (m_imgTextureHandHour != null) + { + m_imgTextureHandHour.AllocResources(); + } + + if (m_imgTextureHandMinute != null) + { + m_imgTextureHandMinute.AllocResources(); + } + + if (m_imgTextureHandSecond != null) + { + m_imgTextureHandSecond.AllocResources(); + } + + if (m_imgTextureCover != null) + { + m_imgTextureCover.AllocResources(); + } + } + + public override void FreeResources() + { + if (m_imgTextureFace != null) + { + m_imgTextureFace.FreeResources(); + } + + if (m_imgTextureHandHour != null) + { + m_imgTextureHandHour.FreeResources(); + } + + if (m_imgTextureHandMinute != null) + { + m_imgTextureHandMinute.FreeResources(); + } + + if (m_imgTextureHandSecond != null) + { + m_imgTextureHandSecond.FreeResources(); + } + + if (m_imgTextureCover != null) + { + m_imgTextureCover.FreeResources(); + } + + base.FreeResources(); + } + + public override void Render(float timePassed) + { + if (!IsVisible) + { + base.Render(timePassed); + return; + } + + // Calculate hand rotations. + Calculate(); + + // Draw the clock. + RenderFace(timePassed); + RenderHandHour(timePassed); + RenderHandMinute(timePassed); + RenderHandSecond(timePassed); + RenderCover(timePassed); + } + + #endregion Overrides + } +} \ No newline at end of file Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/MediaPortalWidgets.cs =================================================================== --- trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/MediaPortalWidgets.cs (rev 0) +++ trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/MediaPortalWidgets.cs 2010-10-08 14:43:59 UTC (rev 3811) @@ -0,0 +1,139 @@ +#region Copyright (C) 2005-2010 Team MediaPortal + +/* + * Copyright (C) 2005-2010 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 MediaPortal.Configuration; +using MediaPortal.GUI.Library; + +namespace MediaPortalWidgets +{ + [PluginIcons("MediaPortalWidgets.MediaPortalWidgets.png", "MediaPortalWidgets.MediaPortalWidgetsDisabled.png")] + public class MediaPortalWidgets : GUIWindow, ISetupForm + { + + static public string m_PluginName = "MediaPortal Widgets"; + static public string m_PluginDescription = "Adds new controls to MediaPortal"; + static public string m_PluginVerson = "Alpha 1"; + static public string m_PluginDeveloper = "ajp8164"; + + public MediaPortalWidgets() + { + // Register each of the control classes so that the factory knows how to create them. + GUIControlFactory.RegisterControl("analogClock", typeof(GUIAnalogClock)); + } + + #region ISetupForm Members + + // Returns the name of the plugin which is shown in the plugin menu + public string PluginName() + { + return m_PluginName; + } + + // Returns the description of the plugin is shown in the plugin menu + public string Description() + { + return m_PluginDescription; + } + + // Returns the author of the plugin which is shown in the plugin menu + public string Author() + { + return m_PluginDeveloper; + } + + // Show the setup dialog + public void ShowPlugin() + { + MessageBox.Show("Nothing to configure."); + } + + // Indicates whether plugin can be enabled/disabled + public bool CanEnable() + { + return true; + } + + // Get Windows-ID + public int GetWindowId() + { + // WindowID of windowplugin belonging to this setup + // enter your own unique code + return 0; + } + + // Indicates if plugin is enabled by default; + public bool DefaultEnabled() + { + return true; + } + + // Indicates if a plugin has it's own setup screen + public bool HasSetup() + { + return false; + } + + /// <summary> + /// If the plugin should have it's own button on the main menu of MediaPortal then it + /// should return true to this method, otherwise if it should not be on home + /// it should return false + /// </summary> + /// <param name="strButtonText">text the button should have</param> + /// <param name="strButtonImage">image for the button, or empty for default</param> + /// <param name="strButtonImageFocus">image for the button, or empty for default</param> + /// <param name="strPictureImage">subpicture for the button or empty for none</param> + /// <returns>true : plugin needs it's own button on home + /// false : plugin does not need it's own button on home</returns> + + public bool GetHome(out string strButtonText, out string strButtonImage, + out string strButtonImageFocus, out string strPictureImage) + { + strButtonText = String.Empty; + strButtonImage = String.Empty; + strButtonImageFocus = String.Empty; + strPictureImage = String.Empty; + return false; + } + + // With GetID it will be an window-plugin / otherwise a process-plugin + // Enter the id number here again + public override int GetID + { + get + { + return GetWindowId(); + } + + set + { + } + } + + #endregion + + } +} \ No newline at end of file Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/MediaPortalWidgets.csproj =================================================================== --- trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/MediaPortalWidgets.csproj (rev 0) +++ trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/MediaPortalWidgets.csproj 2010-10-08 14:43:59 UTC (rev 3811) @@ -0,0 +1,97 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>9.0.30729</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{C223CD83-9E3D-4091-A276-7FC64647887C}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>MediaPortalWidgets</RootNamespace> + <AssemblyName>MediaPortalWidgets</AssemblyName> + <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + </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> + </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="Core, Version=1.0.3.35689, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\mediaportal\mediaportal\Core\bin\Release\Core.dll</HintPath> + </Reference> + <Reference Include="DirectShowLib, Version=2.0.0.24535, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\mediaportal\mediaportal\DirectShowLib\bin\Release\DirectShowLib.dll</HintPath> + </Reference> + <Reference Include="Gentle.Common, Version=1.5.0.29053, Culture=neutral, PublicKeyToken=80b5de62e27be49b, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\mediaportal\TvEngine3\TVLibrary\TVDatabase\references\Gentle.Common.dll</HintPath> + </Reference> + <Reference Include="Gentle.Framework, Version=1.5.0.29053, Culture=neutral, PublicKeyToken=80b5de62e27be49b, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\mediaportal\TvEngine3\TVLibrary\TVDatabase\references\Gentle.Framework.dll</HintPath> + </Reference> + <Reference Include="Gentle.Provider.MySQL, Version=1.5.0.29054, Culture=neutral, PublicKeyToken=80b5de62e27be49b, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\mediaportal\TvEngine3\TVLibrary\TVDatabase\references\Gentle.Provider.MySQL.dll</HintPath> + </Reference> + <Reference Include="Gentle.Provider.SQLServer, Version=1.5.0.29053, Culture=neutral, PublicKeyToken=80b5de62e27be49b, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\mediaportal\TvEngine3\TVLibrary\TVDatabase\references\Gentle.Provider.SQLServer.dll</HintPath> + </Reference> + <Reference Include="Microsoft.DirectX, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> + <Reference Include="Microsoft.DirectX.Direct3D, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> + <Reference Include="System" /> + <Reference Include="System.configuration" /> + <Reference Include="System.Core"> + <RequiredTargetFramework>3.5</RequiredTargetFramework> + </Reference> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml.Linq"> + <RequiredTargetFramework>3.5</RequiredTargetFramework> + </Reference> + <Reference Include="System.Data.DataSetExtensions"> + <RequiredTargetFramework>3.5</RequiredTargetFramework> + </Reference> + <Reference Include="System.Data" /> + <Reference Include="System.Xml" /> + <Reference Include="Utils, Version=2.2.7.35687, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\mediaportal\mediaportal\Utils\bin\Release\Utils.dll</HintPath> + </Reference> + </ItemGroup> + <ItemGroup> + <Compile Include="AnalogClock\GUIAnalogClock.cs" /> + <Compile Include="MediaPortalWidgets.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="MediaPortalWidgets.png" /> + <EmbeddedResource Include="MediaPortalWidgetsDisabled.png" /> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\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 Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/MediaPortalWidgets.csproj.user =================================================================== --- trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/MediaPortalWidgets.csproj.user (rev 0) +++ trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/MediaPortalWidgets.csproj.user 2010-10-08 14:43:59 UTC (rev 3811) @@ -0,0 +1,6 @@ +<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <StartAction>Program</StartAction> + <StartProgram>C:\Program Files\Team MediaPortal\MediaPortal\MediaPortal.exe</StartProgram> + </PropertyGroup> +</Project> \ No newline at end of file Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/MediaPortalWidgets.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/MediaPortalWidgets.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/MediaPortalWidgetsDisabled.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/MediaPortalWidgetsDisabled.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/Properties/AssemblyInfo.cs (rev 0) +++ trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/Properties/AssemblyInfo.cs 2010-10-08 14:43:59 UTC (rev 3811) @@ -0,0 +1,36 @@ +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("MediaPortalWidgets Plugin")] +[assembly: AssemblyDescription("A collection of MediaPortal controls")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("MediaPortalWidgets Plugin")] +[assembly: AssemblyCopyright("Copyright © 2010")] +[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("7c8ba79a-a7d5-4385-a2ca-8e8d0c7573d9")] + +// 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.*")] +[assembly: AssemblyFileVersion("1.0.0.0")] Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/Thumbs.db =================================================================== (Binary files differ) Property changes on: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/Thumbs.db ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/AxInterop.WMPLib.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/AxInterop.WMPLib.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/Bass.Net.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/Bass.Net.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/BassRegistration.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/BassRegistration.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/Core.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/Core.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/DirectShowLib.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/DirectShowLib.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/Gentle.Common.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/Gentle.Common.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/Gentle.Framework.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/Gentle.Framework.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/Gentle.Provider.MySQL.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/Gentle.Provider.MySQL.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/Gentle.Provider.SQLServer.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/Gentle.Provider.SQLServer.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/Interop.SHDocVw.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/Interop.SHDocVw.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/Interop.WMPLib.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/Interop.WMPLib.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/Ionic.Zip.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/Ionic.Zip.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/MediaPortal.Support.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/MediaPortal.Support.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/MediaPortalWidgets.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/MediaPortalWidgets.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/MediaPortalWidgets.pdb =================================================================== (Binary files differ) Property changes on: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/MediaPortalWidgets.pdb ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/MySql.Data.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/MySql.Data.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/Utils.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/Utils.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/edtftpnet-1.2.2.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/edtftpnet-1.2.2.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/log4net.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/log4net.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/taglib-sharp.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Debug/taglib-sharp.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/AxInterop.WMPLib.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/AxInterop.WMPLib.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/Bass.Net.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/Bass.Net.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/BassRegistration.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/BassRegistration.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/Core.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/Core.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/DirectShowLib.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/DirectShowLib.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/Gentle.Common.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/Gentle.Common.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/Gentle.Framework.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/Gentle.Framework.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/Gentle.Provider.MySQL.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/Gentle.Provider.MySQL.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/Gentle.Provider.SQLServer.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/Gentle.Provider.SQLServer.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/Interop.SHDocVw.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/Interop.SHDocVw.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/Interop.WMPLib.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/Interop.WMPLib.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/Ionic.Zip.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/Ionic.Zip.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/MediaPortal.Support.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/MediaPortal.Support.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/MediaPortalWidgets-1.0.0.0.rar =================================================================== (Binary files differ) Property changes on: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/MediaPortalWidgets-1.0.0.0.rar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/MediaPortalWidgets.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/MediaPortalWidgets.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/MediaPortalWidgets.pdb =================================================================== (Binary files differ) Property changes on: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/MediaPortalWidgets.pdb ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/MySql.Data.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/MySql.Data.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/Utils.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/Utils.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/edtftpnet-1.2.2.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/edtftpnet-1.2.2.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/log4net.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/log4net.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/taglib-sharp.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/bin/Release/taglib-sharp.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/obj/Debug/MediaPortalWidgets.csproj.FileListAbsolute.txt =================================================================== --- trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/obj/Debug/MediaPortalWidgets.csproj.FileListAbsolute.txt (rev 0) +++ trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/obj/Debug/MediaPortalWidgets.csproj.FileListAbsolute.txt 2010-10-08 14:43:59 UTC (rev 3811) @@ -0,0 +1,23 @@ +C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\MediaPortalWidgets Plugin\MediaPortalWidgets Plugin\bin\Debug\MediaPortalWidgets.dll +C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\MediaPortalWidgets Plugin\MediaPortalWidgets Plugin\bin\Debug\MediaPortalWidgets.pdb +C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\MediaPortalWidgets Plugin\MediaPortalWidgets Plugin\bin\Debug\Core.dll +C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\MediaPortalWidgets Plugin\MediaPortalWidgets Plugin\bin\Debug\DirectShowLib.dll +C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\MediaPortalWidgets Plugin\MediaPortalWidgets Plugin\bin\Debug\Gentle.Common.dll +C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\MediaPortalWidgets Plugin\MediaPortalWidgets Plugin\bin\Debug\Gentle.Framework.dll +C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\MediaPortalWidgets Plugin\MediaPortalWidgets Plugin\bin\Debug\Gentle.Provider.MySQL.dll +C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\MediaPortalWidgets Plugin\MediaPortalWidgets Plugin\bin\Debug\Gentle.Provider.SQLServer.dll +C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\MediaPortalWidgets Plugin\MediaPortalWidgets Plugin\bin\Debug\Utils.dll +C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\MediaPortalWidgets Plugin\MediaPortalWidgets Plugin\bin\Debug\BassRegistration.dll +C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\MediaPortalWidgets Plugin\MediaPortalWidgets Plugin\bin\Debug\edtftpnet-1.2.2.dll +C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\MediaPortalWidgets Plugin\MediaPortalWidgets Plugin\bin\Debug\Ionic.Zip.dll +C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\MediaPortalWidgets Plugin\MediaPortalWidgets Plugin\bin\Debug\Interop.WMPLib.dll +C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\MediaPortalWidgets Plugin\MediaPortalWidgets Plugin\bin\Debug\MediaPortal.Support.dll +C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\MediaPortalWidgets Plugin\MediaPortalWidgets Plugin\bin\Debug\Bass.Net.dll +C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\MediaPortalWidgets Plugin\MediaPortalWidgets Plugin\bin\Debug\Interop.SHDocVw.dll +C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\MediaPortalWidgets Plugin\MediaPortalWidgets Plugin\bin\Debug\AxInterop.WMPLib.dll +C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\MediaPortalWidgets Plugin\MediaPortalWidgets Plugin\bin\Debug\taglib-sharp.dll +C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\MediaPortalWidgets Plugin\MediaPortalWidgets Plugin\bin\Debug\log4net.dll +C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\MediaPortalWidgets Plugin\MediaPortalWidgets Plugin\bin\Debug\MySql.Data.dll +C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\MediaPortalWidgets Plugin\MediaPortalWidgets Plugin\obj\Debug\ResolveAssemblyReference.cache +C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\MediaPortalWidgets Plugin\MediaPortalWidgets Plugin\obj\Debug\MediaPortalWidgets.dll +C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\MediaPortalWidgets Plugin\MediaPortalWidgets Plugin\obj\Debug\MediaPortalWidgets.pdb Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/obj/Debug/MediaPortalWidgets.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/obj/Debug/MediaPortalWidgets.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/obj/Debug/MediaPortalWidgets.pdb =================================================================== (Binary files differ) Property changes on: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/obj/Debug/MediaPortalWidgets.pdb ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/obj/Debug/ResolveAssemblyReference.cache =================================================================== (Binary files differ) Property changes on: trunk/plugins/MediaPortalWidgets Plugin/MediaPortalWidgets Plugin/obj/Debug/ResolveAssemblyReferenc... [truncated message content] |
From: <aj...@us...> - 2010-10-08 14:45:40
|
Revision: 3812 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3812&view=rev Author: ajp5199 Date: 2010-10-08 14:45:34 +0000 (Fri, 08 Oct 2010) Log Message: ----------- Better name ;-) Added Paths: ----------- trunk/plugins/MediaPortal Widgets/ Removed Paths: ------------- trunk/plugins/MediaPortalWidgets Plugin/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kro...@us...> - 2010-10-17 10:23:15
|
Revision: 3832 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3832&view=rev Author: kroko_koenig Date: 2010-10-17 10:23:08 +0000 (Sun, 17 Oct 2010) Log Message: ----------- clean up the name Added Paths: ----------- trunk/plugins/Yahtzee/ Removed Paths: ------------- trunk/plugins/MyYahtzee/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kro...@us...> - 2010-10-25 18:58:09
|
Revision: 3845 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3845&view=rev Author: kroko_koenig Date: 2010-10-25 18:58:03 +0000 (Mon, 25 Oct 2010) Log Message: ----------- Added Paths: ----------- trunk/plugins/Frustration/ Removed Paths: ------------- trunk/plugins/MyFrustration/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kro...@us...> - 2010-10-26 07:11:04
|
Revision: 3849 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3849&view=rev Author: kroko_koenig Date: 2010-10-26 07:10:58 +0000 (Tue, 26 Oct 2010) Log Message: ----------- better name, we dont need the MY Added Paths: ----------- trunk/plugins/Connect4/ Removed Paths: ------------- trunk/plugins/MyConnect4/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kro...@us...> - 2010-10-26 11:27:10
|
Revision: 3855 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3855&view=rev Author: kroko_koenig Date: 2010-10-26 11:27:04 +0000 (Tue, 26 Oct 2010) Log Message: ----------- without my, better name Added Paths: ----------- trunk/plugins/Chess/ Removed Paths: ------------- trunk/plugins/MyChess/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2010-10-28 09:14:20
|
Revision: 3869 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3869&view=rev Author: chef_koch Date: 2010-10-28 09:14:13 +0000 (Thu, 28 Oct 2010) Log Message: ----------- renamed some resharper files Added Paths: ----------- trunk/plugins/FritzBox/FritzBox.5.1.resharper trunk/plugins/MyAlarm/MyAlarm.5.1.resharper trunk/plugins/MySleepTimer/MySleepTimer.5.1.resharper Removed Paths: ------------- trunk/plugins/FritzBox/FritzBox.5.0.resharper trunk/plugins/MyAlarm/MyAlarm.5.0.resharper trunk/plugins/MySleepTimer/MySleepTimer.5.0.resharper Deleted: trunk/plugins/FritzBox/FritzBox.5.0.resharper =================================================================== --- trunk/plugins/FritzBox/FritzBox.5.0.resharper 2010-10-28 09:11:21 UTC (rev 3868) +++ trunk/plugins/FritzBox/FritzBox.5.0.resharper 2010-10-28 09:14:13 UTC (rev 3869) @@ -1,6 +0,0 @@ -<Configuration> - <CodeStyleSettings> - <ExternalPath>..\..\..\..\MediaPortal\trunk\mediaportal\MediaPortal.ReSharper.xml</ExternalPath> - <Sharing>EXTERNAL</Sharing> - </CodeStyleSettings> -</Configuration> \ No newline at end of file Copied: trunk/plugins/FritzBox/FritzBox.5.1.resharper (from rev 3848, trunk/plugins/FritzBox/FritzBox.5.0.resharper) =================================================================== --- trunk/plugins/FritzBox/FritzBox.5.1.resharper (rev 0) +++ trunk/plugins/FritzBox/FritzBox.5.1.resharper 2010-10-28 09:14:13 UTC (rev 3869) @@ -0,0 +1,6 @@ +<Configuration> + <CodeStyleSettings> + <ExternalPath>..\..\..\..\MediaPortal\trunk\mediaportal\MediaPortal.ReSharper.xml</ExternalPath> + <Sharing>EXTERNAL</Sharing> + </CodeStyleSettings> +</Configuration> \ No newline at end of file Deleted: trunk/plugins/MyAlarm/MyAlarm.5.0.resharper =================================================================== --- trunk/plugins/MyAlarm/MyAlarm.5.0.resharper 2010-10-28 09:11:21 UTC (rev 3868) +++ trunk/plugins/MyAlarm/MyAlarm.5.0.resharper 2010-10-28 09:14:13 UTC (rev 3869) @@ -1,6 +0,0 @@ -<Configuration> - <CodeStyleSettings> - <ExternalPath>..\..\..\..\MediaPortal\trunk\mediaportal\MediaPortal.ReSharper.xml</ExternalPath> - <Sharing>EXTERNAL</Sharing> - </CodeStyleSettings> -</Configuration> \ No newline at end of file Copied: trunk/plugins/MyAlarm/MyAlarm.5.1.resharper (from rev 3848, trunk/plugins/MyAlarm/MyAlarm.5.0.resharper) =================================================================== --- trunk/plugins/MyAlarm/MyAlarm.5.1.resharper (rev 0) +++ trunk/plugins/MyAlarm/MyAlarm.5.1.resharper 2010-10-28 09:14:13 UTC (rev 3869) @@ -0,0 +1,6 @@ +<Configuration> + <CodeStyleSettings> + <ExternalPath>..\..\..\..\MediaPortal\trunk\mediaportal\MediaPortal.ReSharper.xml</ExternalPath> + <Sharing>EXTERNAL</Sharing> + </CodeStyleSettings> +</Configuration> \ No newline at end of file Deleted: trunk/plugins/MySleepTimer/MySleepTimer.5.0.resharper =================================================================== --- trunk/plugins/MySleepTimer/MySleepTimer.5.0.resharper 2010-10-28 09:11:21 UTC (rev 3868) +++ trunk/plugins/MySleepTimer/MySleepTimer.5.0.resharper 2010-10-28 09:14:13 UTC (rev 3869) @@ -1,6 +0,0 @@ -<Configuration> - <CodeStyleSettings> - <ExternalPath>..\..\..\..\MediaPortal\trunk\mediaportal\MediaPortal.ReSharper.xml</ExternalPath> - <Sharing>EXTERNAL</Sharing> - </CodeStyleSettings> -</Configuration> \ No newline at end of file Copied: trunk/plugins/MySleepTimer/MySleepTimer.5.1.resharper (from rev 3848, trunk/plugins/MySleepTimer/MySleepTimer.5.0.resharper) =================================================================== --- trunk/plugins/MySleepTimer/MySleepTimer.5.1.resharper (rev 0) +++ trunk/plugins/MySleepTimer/MySleepTimer.5.1.resharper 2010-10-28 09:14:13 UTC (rev 3869) @@ -0,0 +1,6 @@ +<Configuration> + <CodeStyleSettings> + <ExternalPath>..\..\..\..\MediaPortal\trunk\mediaportal\MediaPortal.ReSharper.xml</ExternalPath> + <Sharing>EXTERNAL</Sharing> + </CodeStyleSettings> +</Configuration> \ 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: <kro...@us...> - 2010-10-30 18:34:07
|
Revision: 3877 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3877&view=rev Author: kroko_koenig Date: 2010-10-30 18:34:00 +0000 (Sat, 30 Oct 2010) Log Message: ----------- initial check-in Added Paths: ----------- trunk/plugins/WakeOnLan/ trunk/plugins/WakeOnLan/Release/ trunk/plugins/WakeOnLan/Release/WakeOnLan.zip trunk/plugins/WakeOnLan/Source/ trunk/plugins/WakeOnLan/Source/WakeOnLan/ trunk/plugins/WakeOnLan/Source/WakeOnLan/Properties/ trunk/plugins/WakeOnLan/Source/WakeOnLan/Properties/AssemblyInfo.cs trunk/plugins/WakeOnLan/Source/WakeOnLan/Setup.Designer.cs trunk/plugins/WakeOnLan/Source/WakeOnLan/Setup.cs trunk/plugins/WakeOnLan/Source/WakeOnLan/Setup.resx trunk/plugins/WakeOnLan/Source/WakeOnLan/WOL.cs trunk/plugins/WakeOnLan/Source/WakeOnLan/WakeOnLan.cs trunk/plugins/WakeOnLan/Source/WakeOnLan/WakeOnLan.csproj trunk/plugins/WakeOnLan/Source/WakeOnLan/WakeOnLan.csproj.user trunk/plugins/WakeOnLan/Source/WakeOnLan/bin/ trunk/plugins/WakeOnLan/Source/WakeOnLan/bin/Debug/ trunk/plugins/WakeOnLan/Source/WakeOnLan/obj/ trunk/plugins/WakeOnLan/Source/WakeOnLan/obj/Debug/ trunk/plugins/WakeOnLan/Source/WakeOnLan/obj/Debug/Refactor/ trunk/plugins/WakeOnLan/Source/WakeOnLan/obj/Debug/ResolveAssemblyReference.cache trunk/plugins/WakeOnLan/Source/WakeOnLan/obj/Debug/TempPE/ trunk/plugins/WakeOnLan/Source/WakeOnLan/obj/Debug/WakeOnLan.Setup.resources trunk/plugins/WakeOnLan/Source/WakeOnLan/obj/Debug/WakeOnLan.csproj.FileListAbsolute.txt trunk/plugins/WakeOnLan/Source/WakeOnLan/obj/Debug/WakeOnLan.csproj.GenerateResource.Cache trunk/plugins/WakeOnLan/Source/WakeOnLan/obj/Debug/WakeOnLan.dll trunk/plugins/WakeOnLan/Source/WakeOnLan/obj/Debug/WakeOnLan.pdb trunk/plugins/WakeOnLan/Source/WakeOnLan/wake.png trunk/plugins/WakeOnLan/Source/WakeOnLan/wakeOff.png trunk/plugins/WakeOnLan/Source/WakeOnLan.sln trunk/plugins/WakeOnLan/Source/WakeOnLan.suo trunk/plugins/WakeOnLan/setup.jpg Added: trunk/plugins/WakeOnLan/Release/WakeOnLan.zip =================================================================== (Binary files differ) Property changes on: trunk/plugins/WakeOnLan/Release/WakeOnLan.zip ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/WakeOnLan/Source/WakeOnLan/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/WakeOnLan/Source/WakeOnLan/Properties/AssemblyInfo.cs (rev 0) +++ trunk/plugins/WakeOnLan/Source/WakeOnLan/Properties/AssemblyInfo.cs 2010-10-30 18:34:00 UTC (rev 3877) @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// Allgemeine Informationen über eine Assembly werden über die folgenden +// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, +// die mit einer Assembly verknüpft sind. +[assembly: AssemblyTitle("WakeOnLan")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("HP")] +[assembly: AssemblyProduct("WakeOnLan")] +[assembly: AssemblyCopyright("Copyright © HP 2010")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar +// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von +// COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest. +[assembly: ComVisible(false)] + +// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird +[assembly: Guid("add60110-5a5b-4f4b-95f2-93741677a0e9")] + +// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: +// +// Hauptversion +// Nebenversion +// Buildnummer +// Revision +// +// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern +// übernehmen, indem Sie "*" eingeben: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] Added: trunk/plugins/WakeOnLan/Source/WakeOnLan/Setup.Designer.cs =================================================================== --- trunk/plugins/WakeOnLan/Source/WakeOnLan/Setup.Designer.cs (rev 0) +++ trunk/plugins/WakeOnLan/Source/WakeOnLan/Setup.Designer.cs 2010-10-30 18:34:00 UTC (rev 3877) @@ -0,0 +1,217 @@ +namespace WakeOnLan +{ + partial class Setup + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.Windows.Forms.Timer tUpdate; + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.txtIp = new System.Windows.Forms.TextBox(); + this.txtMac = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.btnStart = new System.Windows.Forms.Button(); + this.chkRunning = new System.Windows.Forms.CheckBox(); + this.btnSave = new System.Windows.Forms.Button(); + this.btnCancel = new System.Windows.Forms.Button(); + this.statusStrip1 = new System.Windows.Forms.StatusStrip(); + this.infoTxt = new System.Windows.Forms.ToolStripStatusLabel(); + tUpdate = new System.Windows.Forms.Timer(this.components); + this.groupBox1.SuspendLayout(); + this.groupBox2.SuspendLayout(); + this.statusStrip1.SuspendLayout(); + this.SuspendLayout(); + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.txtIp); + this.groupBox1.Controls.Add(this.txtMac); + this.groupBox1.Controls.Add(this.label2); + this.groupBox1.Controls.Add(this.label1); + this.groupBox1.Location = new System.Drawing.Point(18, 14); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(306, 93); + this.groupBox1.TabIndex = 0; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Server"; + // + // txtIp + // + this.txtIp.Location = new System.Drawing.Point(98, 53); + this.txtIp.Name = "txtIp"; + this.txtIp.Size = new System.Drawing.Size(164, 20); + this.txtIp.TabIndex = 3; + this.txtIp.Text = "192.168.10.20"; + // + // txtMac + // + this.txtMac.Location = new System.Drawing.Point(98, 26); + this.txtMac.Name = "txtMac"; + this.txtMac.Size = new System.Drawing.Size(164, 20); + this.txtMac.TabIndex = 2; + this.txtMac.Text = "12-34-56-78-90-12"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(19, 56); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(51, 13); + this.label2.TabIndex = 1; + this.label2.Text = "Server IP"; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(19, 29); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(64, 13); + this.label1.TabIndex = 0; + this.label1.Text = "Server MAC"; + // + // groupBox2 + // + this.groupBox2.Controls.Add(this.btnStart); + this.groupBox2.Controls.Add(this.chkRunning); + this.groupBox2.Location = new System.Drawing.Point(18, 121); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(306, 75); + this.groupBox2.TabIndex = 2; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "Test"; + // + // btnStart + // + this.btnStart.Location = new System.Drawing.Point(22, 30); + this.btnStart.Name = "btnStart"; + this.btnStart.Size = new System.Drawing.Size(97, 23); + this.btnStart.TabIndex = 1; + this.btnStart.Text = "Start Server"; + this.btnStart.UseVisualStyleBackColor = true; + this.btnStart.Click += new System.EventHandler(this.btnStart_Click); + // + // chkRunning + // + this.chkRunning.AutoSize = true; + this.chkRunning.Location = new System.Drawing.Point(172, 36); + this.chkRunning.Name = "chkRunning"; + this.chkRunning.Size = new System.Drawing.Size(105, 17); + this.chkRunning.TabIndex = 0; + this.chkRunning.Text = "Server is running"; + this.chkRunning.UseVisualStyleBackColor = true; + // + // btnSave + // + this.btnSave.Location = new System.Drawing.Point(18, 202); + this.btnSave.Name = "btnSave"; + this.btnSave.Size = new System.Drawing.Size(95, 33); + this.btnSave.TabIndex = 3; + this.btnSave.Text = "Save"; + this.btnSave.UseVisualStyleBackColor = true; + this.btnSave.Click += new System.EventHandler(this.btnSave_Click); + // + // btnCancel + // + this.btnCancel.Location = new System.Drawing.Point(229, 202); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size(95, 33); + this.btnCancel.TabIndex = 4; + this.btnCancel.Text = "Cancel"; + this.btnCancel.UseVisualStyleBackColor = true; + this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); + // + // statusStrip1 + // + this.statusStrip1.AutoSize = false; + this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.infoTxt}); + this.statusStrip1.Location = new System.Drawing.Point(0, 252); + this.statusStrip1.Name = "statusStrip1"; + this.statusStrip1.Size = new System.Drawing.Size(344, 22); + this.statusStrip1.SizingGrip = false; + this.statusStrip1.TabIndex = 5; + this.statusStrip1.Text = "statusStrip1"; + // + // infoTxt + // + this.infoTxt.Name = "infoTxt"; + this.infoTxt.Size = new System.Drawing.Size(96, 17); + this.infoTxt.Text = "nothing send yet"; + // + // tUpdate + // + tUpdate.Enabled = true; + tUpdate.Interval = 300; + tUpdate.Tick += new System.EventHandler(this.tUpdate_Tick); + // + // Setup + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(344, 274); + this.Controls.Add(this.statusStrip1); + this.Controls.Add(this.btnCancel); + this.Controls.Add(this.btnSave); + this.Controls.Add(this.groupBox2); + this.Controls.Add(this.groupBox1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "Setup"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "Setup WakeOnLan"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Setup_FormClosing); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.groupBox2.ResumeLayout(false); + this.groupBox2.PerformLayout(); + this.statusStrip1.ResumeLayout(false); + this.statusStrip1.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.TextBox txtIp; + private System.Windows.Forms.TextBox txtMac; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.GroupBox groupBox2; + private System.Windows.Forms.Button btnStart; + private System.Windows.Forms.CheckBox chkRunning; + private System.Windows.Forms.Button btnSave; + private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.StatusStrip statusStrip1; + private System.Windows.Forms.ToolStripStatusLabel infoTxt; + } +} \ No newline at end of file Added: trunk/plugins/WakeOnLan/Source/WakeOnLan/Setup.cs =================================================================== --- trunk/plugins/WakeOnLan/Source/WakeOnLan/Setup.cs (rev 0) +++ trunk/plugins/WakeOnLan/Source/WakeOnLan/Setup.cs 2010-10-30 18:34:00 UTC (rev 3877) @@ -0,0 +1,152 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +using System.Net; +using System.Net.Sockets; +using System.Net.NetworkInformation; +using System.Threading; + +namespace WakeOnLan +{ + public partial class Setup : Form + { + private Thread aPing; + private bool serverAvailable; + + public Setup() + { + InitializeComponent(); + LoadSettings(); + + aPing = new Thread(testServer); + aPing.Start(); + } + private void Setup_FormClosing(object sender, FormClosingEventArgs e) + { + aPing.Interrupt(); + aPing.Abort(); + } + + private void LoadSettings() + { + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("MediaPortal.xml")) + { + txtMac.Text = xmlreader.GetValueAsString("wakeOnLan", "macId", "12-34-56-12-34-56"); + txtIp.Text = xmlreader.GetValueAsString("wakeOnLan", "ip", "192.168.0.50"); + } + } + private void SaveSettings() + { + using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings("MediaPortal.xml")) + { + xmlwriter.SetValue("wakeOnLan", "macId", txtMac.Text); + xmlwriter.SetValue("wakeOnLan", "ip", txtIp.Text); + } + + MediaPortal.Profile.Settings.SaveCache(); + } + + private void btnSave_Click(object sender, EventArgs e) + { + if (!WOL.CheckIp(txtIp.Text)) + { + MessageBox.Show("Enter a correct IP", "Error IP Adress"); + return; + } + if (WOL.GetMacId(txtMac.Text) == null) + { + MessageBox.Show("Enter a correct MAC ID", "Error MAC ID"); + return; + } + + SaveSettings(); + this.Close(); + } + private void btnCancel_Click(object sender, EventArgs e) + { + this.Close(); + } + private void btnStart_Click(object sender, EventArgs e) + { + byte[] myMac = WOL.GetMacId(txtMac.Text); + if (myMac != null) + { + if (WOL.CheckIp(txtIp.Text)) + { + IPAddress myIp = IPAddress.Parse(txtIp.Text); + IPAddress[] a = Dns.GetHostEntry(Dns.GetHostName()).AddressList; + + for (int i = 0; i < a.Length; i++) + { + byte[] myBytes = myIp.GetAddressBytes(); + byte[] othBytes = a[i].GetAddressBytes(); + if ((myBytes[0] == othBytes[0]) && + (myBytes[1] == othBytes[1]) && + (myBytes[2] == othBytes[2])) + { + infoTxt.Text = DateTime.Now.ToLongTimeString() + " : WOL to " + txtMac.Text; + WOL.WakeOnLan(myMac, a[i]); + return; + } + } + MessageBox.Show("Could not find matching sub-net", "Subnet ???"); + return; + } + else + { + MessageBox.Show("Enter a correct IP", "Error IP Adress"); + return; + } + } + else + { + MessageBox.Show("Enter a correct MAC ID", "Error MAC ID"); + return; + } + } + + private void testServer() + { + try + { + while (true) + { + try + { + if (WOL.CheckIp(txtIp.Text)) + { + IPAddress ip = IPAddress.Parse(txtIp.Text); + + Ping p = new Ping(); + PingReply rep = p.Send(ip, 2000); + + if (rep.Status == IPStatus.Success) + { + serverAvailable = true; + } + else + { + serverAvailable = false; + } + } + } + catch + { + serverAvailable = false; + } + } + } + catch { } + } + + private void tUpdate_Tick(object sender, EventArgs e) + { + chkRunning.Checked = serverAvailable; + } + } +} Added: trunk/plugins/WakeOnLan/Source/WakeOnLan/Setup.resx =================================================================== --- trunk/plugins/WakeOnLan/Source/WakeOnLan/Setup.resx (rev 0) +++ trunk/plugins/WakeOnLan/Source/WakeOnLan/Setup.resx 2010-10-30 18:34:00 UTC (rev 3877) @@ -0,0 +1,129 @@ +<?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="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>17, 17</value> + </metadata> + <metadata name="tUpdate.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>133, 17</value> + </metadata> + <metadata name="tUpdate.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </metadata> +</root> \ No newline at end of file Added: trunk/plugins/WakeOnLan/Source/WakeOnLan/WOL.cs =================================================================== --- trunk/plugins/WakeOnLan/Source/WakeOnLan/WOL.cs (rev 0) +++ trunk/plugins/WakeOnLan/Source/WakeOnLan/WOL.cs 2010-10-30 18:34:00 UTC (rev 3877) @@ -0,0 +1,65 @@ +using System; +using System.Collections.Generic; +using System.Text; + +using System.Net; +using System.Net.Sockets; + +namespace WakeOnLan +{ + public class WOL + { + public static void WakeOnLan(byte[] mac, IPAddress ip) + { + IPEndPoint myIp = new IPEndPoint(ip, 0); + + UdpClient client = new UdpClient(myIp); + client.Connect(IPAddress.Broadcast, 40000); + + // WOL packet contains a 6-bytes trailer and 16 times a 6-bytes sequence containing the MAC address. + byte[] packet = new byte[17 * 6]; + + // Trailer of 6 times 0xFF. + for (int i = 0; i < 6; i++) + packet[i] = 0xFF; + + // Body of magic packet contains 16 times the MAC address. + for (int i = 1; i <= 16; i++) + for (int j = 0; j < 6; j++) + packet[i * 6 + j] = mac[j]; + + // Send WOL packet. + client.Send(packet, packet.Length); + } + + public static byte[] GetMacId(string Input) + { + try + { + string[] val = Input.Split('-'); + if (val.Length == 6) + { + byte[] erg = new byte[6]; + for (int i = 0; i < 6; i++) + { + erg[i] = byte.Parse(val[i], System.Globalization.NumberStyles.HexNumber); + } + return erg; + } + } + catch { } + return null; + } + public static bool CheckIp(string Input) + { + try + { + IPAddress ip = IPAddress.Parse(Input); + return true; + } + catch { } + + return false; + } + } +} Added: trunk/plugins/WakeOnLan/Source/WakeOnLan/WakeOnLan.cs =================================================================== --- trunk/plugins/WakeOnLan/Source/WakeOnLan/WakeOnLan.cs (rev 0) +++ trunk/plugins/WakeOnLan/Source/WakeOnLan/WakeOnLan.cs 2010-10-30 18:34:00 UTC (rev 3877) @@ -0,0 +1,205 @@ +#region Copyright (C) 2005-2010 Team MediaPortal + +/* + * Copyright (C) 2005-2010 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 MediaPortal.GUI.Library; +using MediaPortal.Configuration; + +using System.Net; +using System.Threading; +using System.Net.NetworkInformation; + +namespace WakeOnLan +{ + [PluginIcons("WakeOnLan.wake.png", "WakeOnLan.wakeOff.png")] + + public class WakeOnLan : IPlugin, ISetupForm + { + private string ip; + private string mac; + private bool serverAvailable = false; + + private Thread thread; + + #region IPlugin Member + + public void Start() + { + LoadSettings(); + + Log.Info("WakeOnLan : Start plugin"); + + Log.Info("WakeOnLan : Start keep alive thread"); + thread = new Thread(testServer); + thread.Start(); + + if (mac.Split('-').Length == 6) + { + Log.Info("WakeOnLan : Mac Id = " + mac); + + byte[] myMac = WOL.GetMacId(mac); + if (myMac != null) + { + Log.Info("WakeOnLan : IP Server = " + ip); + + IPAddress myIp = IPAddress.Parse(ip); + + if (myIp != null) + { + IPAddress[] lst = Dns.GetHostEntry(Dns.GetHostName()).AddressList; + + for (int i = 0; i < lst.Length; i++) + { + byte[] myBytes = myIp.GetAddressBytes(); + byte[] othBytes = lst[i].GetAddressBytes(); + + if ((myBytes[0] == othBytes[0]) && + (myBytes[1] == othBytes[1]) && + (myBytes[2] == othBytes[2])) + { + Log.Info("WakeOnLan : wake up server " + mac); + WOL.WakeOnLan(myMac, lst[i]); + return; + } + } + } + } + } + } + + public void Stop() + { + thread.Interrupt(); + thread.Abort(); + + Log.Info("WakeOnLan : Stop plugin"); + } + + #endregion + + #region ISetupForm Member + + public string Author() + { + return "Mark Koenig (kroko) 2010"; + } + + public bool CanEnable() + { + return true; + } + + public bool DefaultEnabled() + { + return true; + } + + public string Description() + { + return "Switch on the server via WOL and keep him running."; + } + + public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) + { + strButtonText = "WakeOnLan"; + strButtonImage = String.Empty; + strButtonImageFocus = String.Empty; + strPictureImage = "hover_WakeOnLan.png"; + return true; + } + + public int GetWindowId() + { + return 43873038; + } + + public bool HasSetup() + { + return true; + } + + public string PluginName() + { + return "WakeOnLan"; + } + + public void ShowPlugin() + { + Setup setup = new Setup(); + setup.ShowDialog(); + } + + #endregion + + private void LoadSettings() + { + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("MediaPortal.xml")) + { + mac = xmlreader.GetValueAsString("wakeOnLan", "macId", "12-34-56-12-34-56"); + ip = xmlreader.GetValueAsString("wakeOnLan", "ip", "192.168.0.50"); + } + } + + private void testServer() + { + try + { + while (true) + { + try + { + if (WOL.CheckIp(ip)) + { + IPAddress myIP = IPAddress.Parse(ip); + + Log.Info("WakeOnLan : ping IP Server = " + ip); + + Ping p = new Ping(); + PingReply rep = p.Send(myIP, 2000); + + if (rep.Status == IPStatus.Success) + { + this.serverAvailable = true; + } + else + { + this.serverAvailable = false; + } + } + Thread.Sleep(60000); + } + catch + { + this.serverAvailable = false; + } + } + } + catch { } + } + } +} Added: trunk/plugins/WakeOnLan/Source/WakeOnLan/WakeOnLan.csproj =================================================================== --- trunk/plugins/WakeOnLan/Source/WakeOnLan/WakeOnLan.csproj (rev 0) +++ trunk/plugins/WakeOnLan/Source/WakeOnLan/WakeOnLan.csproj 2010-10-30 18:34:00 UTC (rev 3877) @@ -0,0 +1,77 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>9.0.21022</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{2E574157-D8EA-458E-B0FE-4CA9DF471445}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>WakeOnLan</RootNamespace> + <AssemblyName>WakeOnLan</AssemblyName> + <TargetFrameworkVersion>v2.0</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>..\..\..\Program Files\Team MediaPortal\MediaPortal\plugins\process\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <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="Core, Version=1.1.1.11854, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\..\Program Files\Team MediaPortal\MediaPortal\Core.dll</HintPath> + <Private>False</Private> + </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.7.11849, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\..\Program Files\Team MediaPortal\MediaPortal\Utils.dll</HintPath> + <Private>False</Private> + </Reference> + </ItemGroup> + <ItemGroup> + <Compile Include="Setup.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="Setup.Designer.cs"> + <DependentUpon>Setup.cs</DependentUpon> + </Compile> + <Compile Include="WakeOnLan.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="WOL.cs" /> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="Setup.resx"> + <DependentUpon>Setup.cs</DependentUpon> + </EmbeddedResource> + <EmbeddedResource Include="wake.png" /> + <EmbeddedResource Include="wakeOff.png" /> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\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 Added: trunk/plugins/WakeOnLan/Source/WakeOnLan/WakeOnLan.csproj.user =================================================================== --- trunk/plugins/WakeOnLan/Source/WakeOnLan/WakeOnLan.csproj.user (rev 0) +++ trunk/plugins/WakeOnLan/Source/WakeOnLan/WakeOnLan.csproj.user 2010-10-30 18:34:00 UTC (rev 3877) @@ -0,0 +1,9 @@ +<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <StartAction>Program</StartAction> + <StartProgram>C:\Program Files\Team MediaPortal\MediaPortal\MediaPortal.exe</StartProgram> + </PropertyGroup> + <PropertyGroup> + <ProjectView>ProjectFiles</ProjectView> + </PropertyGroup> +</Project> \ No newline at end of file Added: trunk/plugins/WakeOnLan/Source/WakeOnLan/obj/Debug/ResolveAssemblyReference.cache =================================================================== (Binary files differ) Property changes on: trunk/plugins/WakeOnLan/Source/WakeOnLan/obj/Debug/ResolveAssemblyReference.cache ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/WakeOnLan/Source/WakeOnLan/obj/Debug/WakeOnLan.Setup.resources =================================================================== (Binary files differ) Property changes on: trunk/plugins/WakeOnLan/Source/WakeOnLan/obj/Debug/WakeOnLan.Setup.resources ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/WakeOnLan/Source/WakeOnLan/obj/Debug/WakeOnLan.csproj.FileListAbsolute.txt =================================================================== --- trunk/plugins/WakeOnLan/Source/WakeOnLan/obj/Debug/WakeOnLan.csproj.FileListAbsolute.txt (rev 0) +++ trunk/plugins/WakeOnLan/Source/WakeOnLan/obj/Debug/WakeOnLan.csproj.FileListAbsolute.txt 2010-10-30 18:34:00 UTC (rev 3877) @@ -0,0 +1,7 @@ +C:\Program Files\Team MediaPortal\MediaPortal\plugins\process\WakeOnLan.dll +C:\Program Files\Team MediaPortal\MediaPortal\plugins\process\WakeOnLan.pdb +C:\AAA\WakeOnLan\WakeOnLan\obj\Debug\ResolveAssemblyReference.cache +C:\AAA\WakeOnLan\WakeOnLan\obj\Debug\WakeOnLan.dll +C:\AAA\WakeOnLan\WakeOnLan\obj\Debug\WakeOnLan.pdb +C:\AAA\WakeOnLan\WakeOnLan\obj\Debug\WakeOnLan.Setup.resources +C:\AAA\WakeOnLan\WakeOnLan\obj\Debug\WakeOnLan.csproj.GenerateResource.Cache Added: trunk/plugins/WakeOnLan/Source/WakeOnLan/obj/Debug/WakeOnLan.csproj.GenerateResource.Cache =================================================================== (Binary files differ) Property changes on: trunk/plugins/WakeOnLan/Source/WakeOnLan/obj/Debug/WakeOnLan.csproj.GenerateResource.Cache ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/WakeOnLan/Source/WakeOnLan/obj/Debug/WakeOnLan.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/WakeOnLan/Source/WakeOnLan/obj/Debug/WakeOnLan.dll ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/WakeOnLan/Source/WakeOnLan/obj/Debug/WakeOnLan.pdb =================================================================== (Binary files differ) Property changes on: trunk/plugins/WakeOnLan/Source/WakeOnLan/obj/Debug/WakeOnLan.pdb ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/WakeOnLan/Source/WakeOnLan/wake.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/WakeOnLan/Source/WakeOnLan/wake.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/WakeOnLan/Source/WakeOnLan/wakeOff.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/WakeOnLan/Source/WakeOnLan/wakeOff.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/WakeOnLan/Source/WakeOnLan.sln =================================================================== --- trunk/plugins/WakeOnLan/Source/WakeOnLan.sln (rev 0) +++ trunk/plugins/WakeOnLan/Source/WakeOnLan.sln 2010-10-30 18:34:00 UTC (rev 3877) @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WakeOnLan", "WakeOnLan\WakeOnLan.csproj", "{2E574157-D8EA-458E-B0FE-4CA9DF471445}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {2E574157-D8EA-458E-B0FE-4CA9DF471445}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2E574157-D8EA-458E-B0FE-4CA9DF471445}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2E574157-D8EA-458E-B0FE-4CA9DF471445}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2E574157-D8EA-458E-B0FE-4CA9DF471445}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal Added: trunk/plugins/WakeOnLan/Source/WakeOnLan.suo =================================================================== (Binary files differ) Property changes on: trunk/plugins/WakeOnLan/Source/WakeOnLan.suo ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/WakeOnLan/setup.jpg =================================================================== (Binary files differ) Property changes on: trunk/plugins/WakeOnLan/setup.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <or...@us...> - 2010-10-31 17:18:05
|
Revision: 3887 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3887&view=rev Author: orencha Date: 2010-10-31 17:17:55 +0000 (Sun, 31 Oct 2010) Log Message: ----------- Added Paths: ----------- trunk/plugins/Installer/ trunk/plugins/Installer/MyPipes-Install.png trunk/plugins/Installer/MyPipes.mpe1 trunk/plugins/Installer/MyPipes.xmp2 trunk/plugins/Installer/update.xml trunk/plugins/Pipes/ trunk/plugins/Pipes/MyPipesDisabled.png trunk/plugins/Pipes/MyPipesEnabled.png trunk/plugins/Pipes/Pipe.cs trunk/plugins/Pipes/PipeGrid.cs trunk/plugins/Pipes/Pipes.csproj trunk/plugins/Pipes/Pipes.csproj.user trunk/plugins/Pipes/PipesControl.cs trunk/plugins/Pipes/PipesSetup.cs trunk/plugins/Pipes/PipesSetup.designer.cs trunk/plugins/Pipes/PipesSetup.resx trunk/plugins/Pipes/Properties/ trunk/plugins/Pipes/Properties/AssemblyInfo.cs trunk/plugins/Pipes/Properties/Resources.Designer.cs trunk/plugins/Pipes/Properties/Resources.resx trunk/plugins/Pipes/myPipes.cs trunk/plugins/Pipes.sln trunk/plugins/Pipes.suo trunk/plugins/Release/ trunk/plugins/Release/Pipes.dll trunk/plugins/Release/Skin/ trunk/plugins/Release/Skin/Blue3/ trunk/plugins/Release/Skin/Blue3/Media/ trunk/plugins/Release/Skin/Blue3/Media/Pipes/ trunk/plugins/Release/Skin/Blue3/Media/Pipes/background.png trunk/plugins/Release/Skin/Blue3/Media/Pipes/background_focus.png trunk/plugins/Release/Skin/Blue3/Media/Pipes/cursor0.png trunk/plugins/Release/Skin/Blue3/Media/Pipes/cursor1.png trunk/plugins/Release/Skin/Blue3/Media/Pipes/cursor2.png trunk/plugins/Release/Skin/Blue3/Media/Pipes/cursor3.PNG trunk/plugins/Release/Skin/Blue3/Media/Pipes/pipe_green_0.png trunk/plugins/Release/Skin/Blue3/Media/Pipes/pipe_green_1.png trunk/plugins/Release/Skin/Blue3/Media/Pipes/pipe_green_10.png trunk/plugins/Release/Skin/Blue3/Media/Pipes/pipe_green_11.png trunk/plugins/Release/Skin/Blue3/Media/Pipes/pipe_green_12.png trunk/plugins/Release/Skin/Blue3/Media/Pipes/pipe_green_13.png trunk/plugins/Release/Skin/Blue3/Media/Pipes/pipe_green_14.png trunk/plugins/Release/Skin/Blue3/Media/Pipes/pipe_green_15.png trunk/plugins/Release/Skin/Blue3/Media/Pipes/pipe_green_2.png trunk/plugins/Release/Skin/Blue3/Media/Pipes/pipe_green_3.png trunk/plugins/Release/Skin/Blue3/Media/Pipes/pipe_green_4.png trunk/plugins/Release/Skin/Blue3/Media/Pipes/pipe_green_5.png trunk/plugins/Release/Skin/Blue3/Media/Pipes/pipe_green_6.png trunk/plugins/Release/Skin/Blue3/Media/Pipes/pipe_green_7.png trunk/plugins/Release/Skin/Blue3/Media/Pipes/pipe_green_8.png trunk/plugins/Release/Skin/Blue3/Media/Pipes/pipe_green_9.png trunk/plugins/Release/Skin/Blue3/Media/Pipes/pipe_red_0.png trunk/plugins/Release/Skin/Blue3/Media/Pipes/pipe_red_1.png trunk/plugins/Release/Skin/Blue3/Media/Pipes/pipe_red_10.png trunk/plugins/Release/Skin/Blue3/Media/Pipes/pipe_red_11.png trunk/plugins/Release/Skin/Blue3/Media/Pipes/pipe_red_12.png trunk/plugins/Release/Skin/Blue3/Media/Pipes/pipe_red_13.png trunk/plugins/Release/Skin/Blue3/Media/Pipes/pipe_red_14.png trunk/plugins/Release/Skin/Blue3/Media/Pipes/pipe_red_15.png trunk/plugins/Release/Skin/Blue3/Media/Pipes/pipe_red_2.png trunk/plugins/Release/Skin/Blue3/Media/Pipes/pipe_red_3.png trunk/plugins/Release/Skin/Blue3/Media/Pipes/pipe_red_4.png trunk/plugins/Release/Skin/Blue3/Media/Pipes/pipe_red_5.png trunk/plugins/Release/Skin/Blue3/Media/Pipes/pipe_red_6.png trunk/plugins/Release/Skin/Blue3/Media/Pipes/pipe_red_7.png trunk/plugins/Release/Skin/Blue3/Media/Pipes/pipe_red_8.png trunk/plugins/Release/Skin/Blue3/Media/Pipes/pipe_red_9.png trunk/plugins/Release/Skin/Blue3/Media/hover_pipes.png trunk/plugins/Release/Skin/Blue3/Sounds/ trunk/plugins/Release/Skin/Blue3/Sounds/Pipes.Beep.wav trunk/plugins/Release/Skin/Blue3/Sounds/Pipes.GameOver.wav trunk/plugins/Release/Skin/Blue3/Sounds/Pipes.Won.wav trunk/plugins/Release/Skin/Blue3/myPipes.xml trunk/plugins/Release/Skin/Blue3Wide/ trunk/plugins/Release/Skin/Blue3Wide/Media/ trunk/plugins/Release/Skin/Blue3Wide/Media/Pipes/ trunk/plugins/Release/Skin/Blue3Wide/Media/Pipes/background.png trunk/plugins/Release/Skin/Blue3Wide/Media/Pipes/background_focus.png trunk/plugins/Release/Skin/Blue3Wide/Media/Pipes/cursor0.png trunk/plugins/Release/Skin/Blue3Wide/Media/Pipes/cursor1.png trunk/plugins/Release/Skin/Blue3Wide/Media/Pipes/cursor2.png trunk/plugins/Release/Skin/Blue3Wide/Media/Pipes/cursor3.PNG trunk/plugins/Release/Skin/Blue3Wide/Media/Pipes/pipe_green_0.png trunk/plugins/Release/Skin/Blue3Wide/Media/Pipes/pipe_green_1.png trunk/plugins/Release/Skin/Blue3Wide/Media/Pipes/pipe_green_10.png trunk/plugins/Release/Skin/Blue3Wide/Media/Pipes/pipe_green_11.png trunk/plugins/Release/Skin/Blue3Wide/Media/Pipes/pipe_green_12.png trunk/plugins/Release/Skin/Blue3Wide/Media/Pipes/pipe_green_13.png trunk/plugins/Release/Skin/Blue3Wide/Media/Pipes/pipe_green_14.png trunk/plugins/Release/Skin/Blue3Wide/Media/Pipes/pipe_green_15.png trunk/plugins/Release/Skin/Blue3Wide/Media/Pipes/pipe_green_2.png trunk/plugins/Release/Skin/Blue3Wide/Media/Pipes/pipe_green_3.png trunk/plugins/Release/Skin/Blue3Wide/Media/Pipes/pipe_green_4.png trunk/plugins/Release/Skin/Blue3Wide/Media/Pipes/pipe_green_5.png trunk/plugins/Release/Skin/Blue3Wide/Media/Pipes/pipe_green_6.png trunk/plugins/Release/Skin/Blue3Wide/Media/Pipes/pipe_green_7.png trunk/plugins/Release/Skin/Blue3Wide/Media/Pipes/pipe_green_8.png trunk/plugins/Release/Skin/Blue3Wide/Media/Pipes/pipe_green_9.png trunk/plugins/Release/Skin/Blue3Wide/Media/Pipes/pipe_red_0.png trunk/plugins/Release/Skin/Blue3Wide/Media/Pipes/pipe_red_1.png trunk/plugins/Release/Skin/Blue3Wide/Media/Pipes/pipe_red_10.png trunk/plugins/Release/Skin/Blue3Wide/Media/Pipes/pipe_red_11.png trunk/plugins/Release/Skin/Blue3Wide/Media/Pipes/pipe_red_12.png trunk/plugins/Release/Skin/Blue3Wide/Media/Pipes/pipe_red_13.png trunk/plugins/Release/Skin/Blue3Wide/Media/Pipes/pipe_red_14.png trunk/plugins/Release/Skin/Blue3Wide/Media/Pipes/pipe_red_15.png trunk/plugins/Release/Skin/Blue3Wide/Media/Pipes/pipe_red_2.png trunk/plugins/Release/Skin/Blue3Wide/Media/Pipes/pipe_red_3.png trunk/plugins/Release/Skin/Blue3Wide/Media/Pipes/pipe_red_4.png trunk/plugins/Release/Skin/Blue3Wide/Media/Pipes/pipe_red_5.png trunk/plugins/Release/Skin/Blue3Wide/Media/Pipes/pipe_red_6.png trunk/plugins/Release/Skin/Blue3Wide/Media/Pipes/pipe_red_7.png trunk/plugins/Release/Skin/Blue3Wide/Media/Pipes/pipe_red_8.png trunk/plugins/Release/Skin/Blue3Wide/Media/Pipes/pipe_red_9.png trunk/plugins/Release/Skin/Blue3Wide/Media/hover_pipes.png trunk/plugins/Release/Skin/Blue3Wide/Sounds/ trunk/plugins/Release/Skin/Blue3Wide/Sounds/Pipes.Beep.wav trunk/plugins/Release/Skin/Blue3Wide/Sounds/Pipes.GameOver.wav trunk/plugins/Release/Skin/Blue3Wide/Sounds/Pipes.Won.wav trunk/plugins/Release/Skin/Blue3Wide/myPipes.xml Added: trunk/plugins/Installer/MyPipes-Install.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/Installer/MyPipes-Install.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/Installer/MyPipes.mpe1 =================================================================== (Binary files differ) Property changes on: trunk/plugins/Installer/MyPipes.mpe1 ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/Installer/MyPipes.xmp2 =================================================================== --- trunk/plugins/Installer/MyPipes.xmp2 (rev 0) +++ trunk/plugins/Installer/MyPipes.xmp2 2010-10-31 17:17:55 UTC (rev 3887) @@ -0,0 +1,1478 @@ +<?xml version="1.0" encoding="utf-8"?> +<PackageClass xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <Version>2.0</Version> + <Groups> + <Items> + <GroupItem Name="Default"> + <ParentGroup /> + <DisplayName>Default</DisplayName> + <DefaulChecked>true</DefaulChecked> + <Description>Default</Description> + <Files> + <Items> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="true"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Release\Pipes.dll</LocalFileName> + <ZipFileName>Installer{CopyFile}\{17e4abc2-7dd9-48a0-a128-f567771ce88b}-Pipes.dll</ZipFileName> + <DestinationFilename>%Plugins%\Windows\Pipes.dll</DestinationFilename> + </FileItem> + </Items> + </Files> + </GroupItem> + <GroupItem Name="Blue3Wide"> + <ParentGroup /> + <DisplayName>Blue3Wide</DisplayName> + <DefaulChecked>true</DefaulChecked> + <Description>Blue3Wide</Description> + <Files> + <Items> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\release\Skin\Blue3Wide\myPipes.xml</LocalFileName> + <ZipFileName>Installer{CopyFile}\{db04b026-eecf-434c-b23a-9b8250ed8323}-myPipes.xml</ZipFileName> + <DestinationFilename>%Skin%\Blue3Wide\myPipes.xml</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\release\Skin\Blue3Wide\Sounds\Pipes.GameOver.wav</LocalFileName> + <ZipFileName>Installer{CopyFile}\{3e526588-4daa-453e-80cb-7c00b9a6778d}-Pipes.GameOver.wav</ZipFileName> + <DestinationFilename>%Skin%\Blue3Wide\Sounds\Pipes.GameOver.wav</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\release\Skin\Blue3Wide\Sounds\Pipes.Won.wav</LocalFileName> + <ZipFileName>Installer{CopyFile}\{0e7311ff-80e1-4d76-abcc-b3b72d695ddc}-Pipes.Won.wav</ZipFileName> + <DestinationFilename>%Skin%\Blue3Wide\Sounds\Pipes.Won.wav</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\release\Skin\Blue3Wide\Media\Pipes\background.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{247ea37b-2c74-4d03-9635-09cb8d69c708}-background.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3Wide\Media\Pipes\background.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\release\Skin\Blue3Wide\Media\Pipes\background_focus.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{7397a74a-5eef-4750-98b7-9bb041f2882b}-background_focus.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3Wide\Media\Pipes\background_focus.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\release\Skin\Blue3Wide\Media\Pipes\cursor0.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{f00e76de-5775-4ddb-a2f1-f2e66eab39da}-cursor0.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3Wide\Media\Pipes\cursor0.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\release\Skin\Blue3Wide\Media\Pipes\cursor1.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{8f7dd60f-6705-4500-895e-1a17dfdeac51}-cursor1.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3Wide\Media\Pipes\cursor1.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\release\Skin\Blue3Wide\Media\Pipes\cursor2.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{b636b4b3-793c-41c8-9315-852564c1d20b}-cursor2.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3Wide\Media\Pipes\cursor2.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\release\Skin\Blue3Wide\Media\Pipes\cursor3.PNG</LocalFileName> + <ZipFileName>Installer{CopyFile}\{f74c0503-95de-4083-8ef2-a94197f0f7a5}-cursor3.PNG</ZipFileName> + <DestinationFilename>%Skin%\Blue3Wide\Media\Pipes\cursor3.PNG</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\release\Skin\Blue3Wide\Media\Pipes\pipe_green_1.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{0c3aef67-73c4-4305-bccf-fd74a4cab4d3}-pipe_green_1.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3Wide\Media\Pipes\pipe_green_1.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\release\Skin\Blue3Wide\Media\Pipes\pipe_green_10.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{55986027-b09e-4701-8f18-c42b8e739d5b}-pipe_green_10.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3Wide\Media\Pipes\pipe_green_10.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\release\Skin\Blue3Wide\Media\Pipes\pipe_green_11.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{13bcdea1-4fbd-46ac-acef-4a203deabfb7}-pipe_green_11.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3Wide\Media\Pipes\pipe_green_11.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\release\Skin\Blue3Wide\Media\Pipes\pipe_green_12.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{e4435c96-5239-4afc-8827-7cf62acdbb92}-pipe_green_12.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3Wide\Media\Pipes\pipe_green_12.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\release\Skin\Blue3Wide\Media\Pipes\pipe_green_13.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{fdefe5cd-8430-4740-a3af-cb69379d4f8f}-pipe_green_13.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3Wide\Media\Pipes\pipe_green_13.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\release\Skin\Blue3Wide\Media\Pipes\pipe_green_14.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{5f2d13e2-5f2b-4a20-bf2f-f1d94bf4a880}-pipe_green_14.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3Wide\Media\Pipes\pipe_green_14.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\release\Skin\Blue3Wide\Media\Pipes\pipe_green_15.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{100ab6ff-9db9-4ef2-a930-729480f3255b}-pipe_green_15.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3Wide\Media\Pipes\pipe_green_15.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\release\Skin\Blue3Wide\Media\Pipes\pipe_green_2.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{bf324fd6-02f4-45a5-9c31-301c95e4dd34}-pipe_green_2.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3Wide\Media\Pipes\pipe_green_2.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\release\Skin\Blue3Wide\Media\Pipes\pipe_green_3.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{472f6b69-0480-4c2e-af4d-f3f2c8209c78}-pipe_green_3.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3Wide\Media\Pipes\pipe_green_3.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\release\Skin\Blue3Wide\Media\Pipes\pipe_green_4.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{02860fa2-bf68-4714-b00a-acf22fceed18}-pipe_green_4.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3Wide\Media\Pipes\pipe_green_4.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\release\Skin\Blue3Wide\Media\Pipes\pipe_green_5.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{a335977b-0194-401e-9f13-387827921c90}-pipe_green_5.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3Wide\Media\Pipes\pipe_green_5.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\release\Skin\Blue3Wide\Media\Pipes\pipe_green_6.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{842393b6-0574-4db7-a3ab-19fc2dec3eee}-pipe_green_6.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3Wide\Media\Pipes\pipe_green_6.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\release\Skin\Blue3Wide\Media\Pipes\pipe_green_7.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{9673b156-fe27-4eab-afbe-d97a2f42ce54}-pipe_green_7.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3Wide\Media\Pipes\pipe_green_7.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\release\Skin\Blue3Wide\Media\Pipes\pipe_green_8.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{75d7ab83-5a34-4b5a-9d66-758bec573ca6}-pipe_green_8.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3Wide\Media\Pipes\pipe_green_8.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\release\Skin\Blue3Wide\Media\Pipes\pipe_green_9.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{3b64f847-b106-41d2-bb39-21cbf0ddf291}-pipe_green_9.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3Wide\Media\Pipes\pipe_green_9.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\release\Skin\Blue3Wide\Media\Pipes\pipe_red_1.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{2a6462eb-6d91-431a-827b-09ea2ca7f930}-pipe_red_1.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3Wide\Media\Pipes\pipe_red_1.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\release\Skin\Blue3Wide\Media\Pipes\pipe_red_10.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{5fc350a9-8e8e-4629-8600-a62f1f7144b1}-pipe_red_10.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3Wide\Media\Pipes\pipe_red_10.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\release\Skin\Blue3Wide\Media\Pipes\pipe_red_11.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{bd1993cf-d84f-4bd1-a4cb-e614b151e859}-pipe_red_11.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3Wide\Media\Pipes\pipe_red_11.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\release\Skin\Blue3Wide\Media\Pipes\pipe_red_12.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{932737fa-26b8-4b91-93d5-bddafa3e57f9}-pipe_red_12.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3Wide\Media\Pipes\pipe_red_12.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\release\Skin\Blue3Wide\Media\Pipes\pipe_red_13.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{a1876b78-53a5-4f5c-83ba-06a0606078b3}-pipe_red_13.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3Wide\Media\Pipes\pipe_red_13.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\release\Skin\Blue3Wide\Media\Pipes\pipe_red_14.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{de044e01-a239-42fd-bfa1-93bd76a149bf}-pipe_red_14.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3Wide\Media\Pipes\pipe_red_14.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\release\Skin\Blue3Wide\Media\Pipes\pipe_red_15.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{1396891c-e2b6-44ea-b38d-d3387e865c72}-pipe_red_15.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3Wide\Media\Pipes\pipe_red_15.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\release\Skin\Blue3Wide\Media\Pipes\pipe_red_2.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{3c94c6b6-f92f-4b08-bed6-a9a07bd1a797}-pipe_red_2.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3Wide\Media\Pipes\pipe_red_2.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\release\Skin\Blue3Wide\Media\Pipes\pipe_red_3.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{c8cc8437-fe00-4372-a168-f718361ec4ee}-pipe_red_3.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3Wide\Media\Pipes\pipe_red_3.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\release\Skin\Blue3Wide\Media\Pipes\pipe_red_4.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{3ceb3a1a-be03-48b6-acb8-69cf43485ac3}-pipe_red_4.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3Wide\Media\Pipes\pipe_red_4.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\release\Skin\Blue3Wide\Media\Pipes\pipe_red_5.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{2e5d285a-10c0-4d44-9cc7-bf83f1712cce}-pipe_red_5.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3Wide\Media\Pipes\pipe_red_5.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\release\Skin\Blue3Wide\Media\Pipes\pipe_red_6.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{3b7e07d4-5e35-458c-817d-23079c854d35}-pipe_red_6.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3Wide\Media\Pipes\pipe_red_6.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\release\Skin\Blue3Wide\Media\Pipes\pipe_red_7.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{2f08ad13-05c6-4c0c-90e3-5f75cebfb5fa}-pipe_red_7.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3Wide\Media\Pipes\pipe_red_7.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\release\Skin\Blue3Wide\Media\Pipes\pipe_red_8.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{8445304b-e3c8-4df6-8429-88022886aead}-pipe_red_8.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3Wide\Media\Pipes\pipe_red_8.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\release\Skin\Blue3Wide\Media\Pipes\pipe_red_9.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{4d366c16-a567-4874-9896-e2cd1fc58b1e}-pipe_red_9.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3Wide\Media\Pipes\pipe_red_9.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\release\Skin\Blue3Wide\Media\hover_pipes.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{3032b28d-a85a-43ef-90d0-0812a3ac1d86}-hover_pipes.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3Wide\Media\hover_pipes.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\release\Skin\Blue3Wide\Sounds\Pipes.Beep.wav</LocalFileName> + <ZipFileName>Installer{CopyFile}\{b5662bfa-2e2a-43cd-ac35-907112bdbbe3}-Pipes.Beep.wav</ZipFileName> + <DestinationFilename>%Skin%\Blue3Wide\Sounds\Pipes.Beep.wav</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\release\Skin\Blue3Wide\Media\Pipes\pipe_green_0.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{91ea5b7a-6db6-49b7-8d93-142ac087989b}-pipe_green_0.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3Wide\Media\Pipes\pipe_green_0.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\release\Skin\Blue3Wide\Media\Pipes\pipe_red_0.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{437b18b9-c233-4a83-a46e-eb2eb30c3e3c}-pipe_red_0.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3Wide\Media\Pipes\pipe_red_0.png</DestinationFilename> + </FileItem> + </Items> + </Files> + </GroupItem> + <GroupItem Name="Blue3"> + <DisplayName>Blue3</DisplayName> + <DefaulChecked>true</DefaulChecked> + <Description>Blue3</Description> + <Files> + <Items> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Release\Skin\Blue3\myPipes.xml</LocalFileName> + <ZipFileName>Installer{CopyFile}\{a8242023-4d83-442b-8bc4-c976ca18971e}-myPipes.xml</ZipFileName> + <DestinationFilename>%Skin%\Blue3\myPipes.xml</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Release\Skin\Blue3\Sounds\Pipes.Beep.wav</LocalFileName> + <ZipFileName>Installer{CopyFile}\{dbb96af5-bbb9-4fe1-a558-8d85d82a0f68}-Pipes.Beep.wav</ZipFileName> + <DestinationFilename>%Skin%\Blue3\Sounds\Pipes.Beep.wav</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Release\Skin\Blue3\Sounds\Pipes.GameOver.wav</LocalFileName> + <ZipFileName>Installer{CopyFile}\{6d501bc2-e16d-4125-9391-0f4de080c7cc}-Pipes.GameOver.wav</ZipFileName> + <DestinationFilename>%Skin%\Blue3\Sounds\Pipes.GameOver.wav</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Release\Skin\Blue3\Sounds\Pipes.Won.wav</LocalFileName> + <ZipFileName>Installer{CopyFile}\{7e74a0e3-a20a-4c3e-b0ea-b8c53979bf4a}-Pipes.Won.wav</ZipFileName> + <DestinationFilename>%Skin%\Blue3\Sounds\Pipes.Won.wav</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Release\Skin\Blue3\Media\hover_pipes.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{9ebcae57-cca4-4b73-a172-393930537a0c}-hover_pipes.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3\Media\hover_pipes.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Release\Skin\Blue3\Media\Pipes\background.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{f92e7249-0c7b-4113-8da5-ba5dbd2aa41c}-background.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3\Media\Pipes\background.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Release\Skin\Blue3\Media\Pipes\background_focus.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{d3eb8a1b-ad3d-4644-9570-2c7ac44e0745}-background_focus.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3\Media\Pipes\background_focus.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Release\Skin\Blue3\Media\Pipes\cursor0.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{292fb027-2dc8-4b9b-bbbf-72428b6b945a}-cursor0.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3\Media\Pipes\cursor0.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Release\Skin\Blue3\Media\Pipes\cursor1.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{46e82011-3d70-4321-b56c-b02cd15cdadf}-cursor1.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3\Media\Pipes\cursor1.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Release\Skin\Blue3\Media\Pipes\cursor2.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{8b01565c-7a4b-43a1-8914-97c36d1829b2}-cursor2.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3\Media\Pipes\cursor2.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Release\Skin\Blue3\Media\Pipes\cursor3.PNG</LocalFileName> + <ZipFileName>Installer{CopyFile}\{0fa55e9e-35e7-467d-8b6e-2d9edb63ddcb}-cursor3.PNG</ZipFileName> + <DestinationFilename>%Skin%\Blue3\Media\Pipes\cursor3.PNG</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Release\Skin\Blue3\Media\Pipes\pipe_green_1.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{97754925-1388-42c6-8182-9022aacaa169}-pipe_green_1.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3\Media\Pipes\pipe_green_1.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Release\Skin\Blue3\Media\Pipes\pipe_green_10.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{d5fc3013-3a60-414d-83a3-03854d34ca12}-pipe_green_10.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3\Media\Pipes\pipe_green_10.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Release\Skin\Blue3\Media\Pipes\pipe_green_11.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{99d35433-a5cb-4e42-8856-c5bd5f0a4ab1}-pipe_green_11.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3\Media\Pipes\pipe_green_11.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Release\Skin\Blue3\Media\Pipes\pipe_green_12.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{94e78a7a-751d-49d3-910d-91a8f38a4bd2}-pipe_green_12.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3\Media\Pipes\pipe_green_12.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Release\Skin\Blue3\Media\Pipes\pipe_green_13.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{13132166-e006-47b7-bd7f-562ab2fe3971}-pipe_green_13.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3\Media\Pipes\pipe_green_13.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Release\Skin\Blue3\Media\Pipes\pipe_green_14.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{bb2bcead-d646-4763-ac88-0c5ffb815a5f}-pipe_green_14.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3\Media\Pipes\pipe_green_14.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Release\Skin\Blue3\Media\Pipes\pipe_green_15.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{0c797f3f-c965-49ab-8de0-0f1424b6c863}-pipe_green_15.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3\Media\Pipes\pipe_green_15.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Release\Skin\Blue3\Media\Pipes\pipe_green_2.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{018da9e3-9258-4b6b-ab88-663588640774}-pipe_green_2.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3\Media\Pipes\pipe_green_2.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Release\Skin\Blue3\Media\Pipes\pipe_green_3.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{1e0918c1-71eb-41af-a224-b63beea70874}-pipe_green_3.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3\Media\Pipes\pipe_green_3.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Release\Skin\Blue3\Media\Pipes\pipe_green_4.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{7cd881b5-3d92-4910-83a5-35bda0b445d4}-pipe_green_4.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3\Media\Pipes\pipe_green_4.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Release\Skin\Blue3\Media\Pipes\pipe_green_5.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{74f637d4-26a2-4ad4-8a60-c31a89bb00e0}-pipe_green_5.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3\Media\Pipes\pipe_green_5.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Release\Skin\Blue3\Media\Pipes\pipe_green_6.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{d6dbb524-f788-4552-9dee-c870eeef0e6b}-pipe_green_6.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3\Media\Pipes\pipe_green_6.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Release\Skin\Blue3\Media\Pipes\pipe_green_7.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{e97fe70e-f467-48e0-8220-58a08fdf3656}-pipe_green_7.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3\Media\Pipes\pipe_green_7.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Release\Skin\Blue3\Media\Pipes\pipe_green_8.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{96dd9952-b056-42b2-be04-a89702fed6b5}-pipe_green_8.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3\Media\Pipes\pipe_green_8.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Release\Skin\Blue3\Media\Pipes\pipe_green_9.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{94ec5329-b524-46a7-b0a3-0770eceaa44b}-pipe_green_9.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3\Media\Pipes\pipe_green_9.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Release\Skin\Blue3\Media\Pipes\pipe_red_1.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{0615e36f-a309-4062-9d10-293980c75fd9}-pipe_red_1.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3\Media\Pipes\pipe_red_1.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Release\Skin\Blue3\Media\Pipes\pipe_red_10.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{4062ab98-93e9-4747-861e-1211c7ebadec}-pipe_red_10.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3\Media\Pipes\pipe_red_10.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Release\Skin\Blue3\Media\Pipes\pipe_red_11.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{4c74c9ba-0577-436e-87f5-a05dc680f2a8}-pipe_red_11.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3\Media\Pipes\pipe_red_11.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Release\Skin\Blue3\Media\Pipes\pipe_red_12.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{1fcbc119-c174-4ef6-9880-2b1e84477980}-pipe_red_12.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3\Media\Pipes\pipe_red_12.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Release\Skin\Blue3\Media\Pipes\pipe_red_13.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{3f11e2b9-2a27-4268-a4e6-5278de303b42}-pipe_red_13.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3\Media\Pipes\pipe_red_13.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Release\Skin\Blue3\Media\Pipes\pipe_red_14.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{f1b8cb18-357f-4b7f-bb01-a6fd257bc2b2}-pipe_red_14.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3\Media\Pipes\pipe_red_14.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Release\Skin\Blue3\Media\Pipes\pipe_red_15.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{aed81148-b564-4c24-a8de-7adb5a0e56b6}-pipe_red_15.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3\Media\Pipes\pipe_red_15.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Release\Skin\Blue3\Media\Pipes\pipe_red_2.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{36060fa7-0e5b-44e7-b377-e70825a21f29}-pipe_red_2.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3\Media\Pipes\pipe_red_2.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Release\Skin\Blue3\Media\Pipes\pipe_red_3.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{da0454f7-2fd4-420b-aac9-27caa652f9de}-pipe_red_3.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3\Media\Pipes\pipe_red_3.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Release\Skin\Blue3\Media\Pipes\pipe_red_4.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{fbf8f971-d467-476a-a5c5-bd1d2fb3eb04}-pipe_red_4.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3\Media\Pipes\pipe_red_4.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Release\Skin\Blue3\Media\Pipes\pipe_red_5.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{d4d705fc-7552-44ab-afc1-2c4ffdb38a09}-pipe_red_5.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3\Media\Pipes\pipe_red_5.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Release\Skin\Blue3\Media\Pipes\pipe_red_6.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{7366dcc6-a22b-4da0-94ce-67b20abe92c1}-pipe_red_6.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3\Media\Pipes\pipe_red_6.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Release\Skin\Blue3\Media\Pipes\pipe_red_7.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{2b322683-a014-47c1-9d06-f1b372753b90}-pipe_red_7.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3\Media\Pipes\pipe_red_7.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Release\Skin\Blue3\Media\Pipes\pipe_red_8.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{68107b98-aea9-4ae9-859b-e1a3b521bc1a}-pipe_red_8.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3\Media\Pipes\pipe_red_8.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Release\Skin\Blue3\Media\Pipes\pipe_red_9.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{2451d015-8d42-4a66-b1fe-5c6f56f6d69c}-pipe_red_9.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3\Media\Pipes\pipe_red_9.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Release\Skin\Blue3\Media\Pipes\pipe_green_0.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{86ece09a-355c-4c21-a0ec-d0718ac58621}-pipe_green_0.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3\Media\Pipes\pipe_green_0.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Release\Skin\Blue3\Media\Pipes\pipe_red_0.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{9c7e6035-797a-49cb-8f88-fe8940711118}-pipe_red_0.png</ZipFileName> + <DestinationFilename>%Skin%\Blue3\Media\Pipes\pipe_red_0.png</DestinationFilename> + </FileItem> + </Items> + </Files> + </GroupItem> + </Items> + </Groups> + <Sections> + <Items> + <SectionItem Guid="71b36a75-ed72-4e5e-b742-5b41c54de4cb" Name="Welcome Screen" ConditionGroup=""> + <Params> + <Items> + <SectionParam Name="Header text"> + <Value>Welcome to the Extension Installer for [Name]</Value> + <ValueType>String</ValueType> + <Description /> + </SectionParam> + <SectionParam Name="Description"> + <Value>This will install [Name] version [Version] on your computer. +It is recommended that you close all other applications before continuing. +Click Next to continue or Cancel to exit Setup.</Value> + <ValueType>String</ValueType> + <Description /> + </SectionParam> + <SectionParam Name="Left part image"> + <Value>MyPipes-Install.png</Value> + <ValueType>File</ValueType> + <Description /> + </SectionParam> + <SectionParam Name="Header image"> + <Value /> + <ValueType>File</ValueType> + <Description>Image in upper right part</Description> + </SectionParam> + </Items> + </Params> + <Actions> + <Items /> + </Actions> + <IncludedGroups /> + <PanelName>Welcome Screen</PanelName> + <WizardButtonsEnum>NextCancel</WizardButtonsEnum> + </SectionItem> + <SectionItem Guid="0ae87794-4638-4df8-b93b-7f40e7c85bd7" Name="Install Section" ConditionGroup=""> + <Params> + <Items> + <SectionParam Name="Header Title"> + <Value /> + <ValueType>String</ValueType> + <Description>Header title</Description> + </SectionParam> + <SectionParam Name="Header description"> + <Value /> + <ValueType>String</ValueType> + <Description>Description of section, shown in under section title</Description> + </SectionParam> + <SectionParam Name="Header image"> + <Value /> + <ValueType>File</ValueType> + <Description>Image in upper right part</Description> + </SectionParam> + </Items> + </Params> + <Actions> + <Items> + <ActionItem Name="InstallFiles" ActionType="InstallFiles" ConditionGroup=""> + <Params> + <Items /> + </Params> + <ExecuteLocation>AfterPanelShow</ExecuteLocation> + </ActionItem> + </Items> + </Actions> + <IncludedGroups /> + <PanelName>Install Section</PanelName> + <WizardButtonsEnum>Next</WizardButtonsEnum> + </SectionItem> + <SectionItem Guid="28fbb2cc-393f-433c-b11e-a5601d927d4c" Name="Setup Complete" ConditionGroup=""> + <Params> + <Items> + <SectionParam Name="Header text"> + <Value>The Extension Installer Wizard has successfully installed [Name].</Value> + <ValueType>String</ValueType> + <Description /> + </SectionParam> + <SectionParam Name="Left part image"> + <Value>MyPipes-Install.png</Value> + <ValueType>File</ValueType> + <Description /> + </SectionParam> + <SectionParam Name="Show radio buttons"> + <Value /> + <ValueType>Bool</ValueType> + <Description>Use radiobutton in place of combobox</Description> + </SectionParam> + <SectionParam Name="Header image"> + <Value /> + <ValueType>File</ValueType> + <Description>Image in upper right part</Description> + </SectionParam> + </Items> + </Params> + <Actions> + <Items> + <ActionItem Name="ConfigurePlugin" ActionType="ConfigurePlugin" ConditionGroup=""> + <Params> + <Items> + <SectionParam Name="Path to plugin"> + <Value>%Plugins%\Windows\Pipes.dll</Value> + <ValueType>Template</ValueType> + <Description>Path to the plugin like + %Plugins%\Windows\plugin.dll</Description> + </SectionParam> + </Items> + </Params> + <ExecuteLocation>AfterPanelShow</ExecuteLocation> + </ActionItem> + </Items> + </Actions> + <IncludedGroups /> + <PanelName>Setup Complete</PanelName> + <WizardButtonsEnum>Finish</WizardButtonsEnum> + </SectionItem> + </Items> + </Sections> + <Dependencies> + <Items /> + </Dependencies> + <GeneralInfo> + <Name>MyPipes</Name> + <Id>6d26cd8b-06df-4d42-bff0-480766467462</Id> + <Author>Oren Chapo</Author> + <HomePage /> + <ForumPage>http://forum.team-mediaportal.com/mediaportal-plugins-47/plugin-mypipes-puzzle-game-88706/</ForumPage> + <UpdateUrl>https://mp-plugins.svn.sourceforge.net/svnroot/mp-plugins/trunk/plugins/MyPipes/Installer/update.xml</UpdateUrl> + <Version> + <Major>0</Major> + <Minor>1</Minor> + <Build>0</Build> + <Revision>0</Revision> + </Version> + <ExtensionDescription>An addictive puzzle game. Rotate the pipe segments to connect all the pieces. Features multiple levels, a timed game, randomly generated puzzles, and auto save and resume. Easy to learn… and yes, every puzzle can be solved. + + + +Based on source code by Michael Kerley (http://www.michaelkerley.net/wp/pipes-j2me/) and Bavarian's "ClickMania" MediaPortal plugin.</ExtensionDescription> + <VersionDescription>* Relaxed time limit calculation * Confirm dialog before starting new game * New sound effects</VersionDescription> + <DevelopmentStatus>Stable</DevelopmentStatus> + <OnlineLocation>https://mp-plugins.svn.sourceforge.net/svnroot/mp-plugins/trunk/plugins/MyPipes/Installer/MyPipes.mpe1</OnlineLocation> + <ReleaseDate>2010-10-30T00:57:38</ReleaseDate> + <Tags>game,games,puzzle,pipes</Tags> + <Location>C:\DEV\MediaPortal\MyPipes\Installer\MyPipes.mpe1</Location> + <Params> + <Items> + <SectionParam Name="Icon"> + <Value>..\Pipes\MyPipesEnabled.png</Value> + <ValueType>File</ValueType> + <Description>The icon file of the package (jpg,png,bmp)</Description> + </SectionParam> + <SectionParam Name="Online Icon"> + <Value /> + <ValueType>String</ValueType> + <Description>The icon file of the package stored online (jpg,png,bmp)</Description> + </SectionParam> + <SectionParam Name="Configuration file"> + <Value /> + <ValueType>Template</ValueType> + <Description>The file used to configure the extension. + If have .exe extension the will be executed + If have .dll extension used like MP plugin configuration</Description> + </SectionParam> + <SectionParam Name="Online Screenshots"> + <Value>http://forum.team-mediaportal.com/attachments/mediaportal-plugins-47/70628d1288544507-plugin-mypipes-puzzle-game-mypipes-18-... [truncated message content] |
From: <or...@us...> - 2010-10-31 19:39:40
|
Revision: 3888 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3888&view=rev Author: orencha Date: 2010-10-31 19:39:34 +0000 (Sun, 31 Oct 2010) Log Message: ----------- Added Paths: ----------- trunk/plugins/MyPipes/Pipes/ Removed Paths: ------------- trunk/plugins/Pipes/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <or...@us...> - 2010-10-31 19:43:16
|
Revision: 3889 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3889&view=rev Author: orencha Date: 2010-10-31 19:43:10 +0000 (Sun, 31 Oct 2010) Log Message: ----------- Added Paths: ----------- trunk/plugins/MyPipes/Installer/ Removed Paths: ------------- trunk/plugins/Installer/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <or...@us...> - 2010-10-31 19:45:22
|
Revision: 3890 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3890&view=rev Author: orencha Date: 2010-10-31 19:45:15 +0000 (Sun, 31 Oct 2010) Log Message: ----------- Added Paths: ----------- trunk/plugins/MyPipes/Release/ Removed Paths: ------------- trunk/plugins/Release/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <or...@us...> - 2010-10-31 19:47:31
|
Revision: 3891 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3891&view=rev Author: orencha Date: 2010-10-31 19:47:25 +0000 (Sun, 31 Oct 2010) Log Message: ----------- Added Paths: ----------- trunk/plugins/MyPipes/Pipes.sln trunk/plugins/MyPipes/Pipes.suo Removed Paths: ------------- trunk/plugins/Pipes.sln trunk/plugins/Pipes.suo Copied: trunk/plugins/MyPipes/Pipes.sln (from rev 3890, trunk/plugins/Pipes.sln) =================================================================== --- trunk/plugins/MyPipes/Pipes.sln (rev 0) +++ trunk/plugins/MyPipes/Pipes.sln 2010-10-31 19:47:25 UTC (rev 3891) @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pipes", "Pipes\Pipes.csproj", "{AC53379F-3218-4C18-B0D8-052BF9ABC107}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {AC53379F-3218-4C18-B0D8-052BF9ABC107}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AC53379F-3218-4C18-B0D8-052BF9ABC107}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AC53379F-3218-4C18-B0D8-052BF9ABC107}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AC53379F-3218-4C18-B0D8-052BF9ABC107}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal Copied: trunk/plugins/MyPipes/Pipes.suo (from rev 3890, trunk/plugins/Pipes.suo) =================================================================== (Binary files differ) Deleted: trunk/plugins/Pipes.sln =================================================================== --- trunk/plugins/Pipes.sln 2010-10-31 19:45:15 UTC (rev 3890) +++ trunk/plugins/Pipes.sln 2010-10-31 19:47:25 UTC (rev 3891) @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pipes", "Pipes\Pipes.csproj", "{AC53379F-3218-4C18-B0D8-052BF9ABC107}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {AC53379F-3218-4C18-B0D8-052BF9ABC107}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AC53379F-3218-4C18-B0D8-052BF9ABC107}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AC53379F-3218-4C18-B0D8-052BF9ABC107}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AC53379F-3218-4C18-B0D8-052BF9ABC107}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal Deleted: trunk/plugins/Pipes.suo =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2010-11-14 11:06:54
|
Revision: 3930 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3930&view=rev Author: chef_koch Date: 2010-11-14 11:06:40 +0000 (Sun, 14 Nov 2010) Log Message: ----------- moved MameDevice from official mp to mp-plugins Added Paths: ----------- trunk/plugins/MameDevice/ trunk/plugins/MameDevice/MameDevice/ trunk/plugins/MameDevice/MameDevice/MameDevice.cs trunk/plugins/MameDevice/MameDevice/MameDevice.csproj trunk/plugins/MameDevice/MameDevice/MappingForm.cs trunk/plugins/MameDevice/MameDevice/MappingForm.resx trunk/plugins/MameDevice/MameDevice.sln trunk/plugins/MameDevice/MediaPortal.Base/ trunk/plugins/MameDevice/MediaPortal.Base/InputDeviceMappings/ trunk/plugins/MameDevice/MediaPortal.Base/InputDeviceMappings/defaults/ trunk/plugins/MameDevice/MediaPortal.Base/InputDeviceMappings/defaults/MameDevice.xml Added: trunk/plugins/MameDevice/MameDevice/MameDevice.cs =================================================================== --- trunk/plugins/MameDevice/MameDevice/MameDevice.cs (rev 0) +++ trunk/plugins/MameDevice/MameDevice/MameDevice.cs 2010-11-14 11:06:40 UTC (rev 3930) @@ -0,0 +1,143 @@ +#region Copyright (C) 2005-2010 Team MediaPortal + +// Copyright (C) 2005-2010 Team MediaPortal +// http://www.team-mediaportal.com +// +// MediaPortal is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 2 of the License, or +// (at your option) any later version. +// +// MediaPortal is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with MediaPortal. If not, see <http://www.gnu.org/licenses/>. + +#endregion + +using System; +using System.Windows.Forms; +using MediaPortal.GUI.Library; + +namespace MediaPortal.InputDevices +{ + /// <summary> + /// Summary description for MameDevice. + /// </summary> + public class MameDevice : ISetupForm, IPluginReceiver + { + private const int WM_KEYDOWN = 0x0100; + private const int WM_SYSKEYDOWN = 0x0104; + + private InputHandler _inputHandler; + + public MameDevice() {} + + #region ISetupForm Members + + public bool CanEnable() + { + return true; + } + + public string Description() + { + return "Use your MAME input device to control MediaPortal"; + } + + public bool DefaultEnabled() + { + return false; + } + + public int GetWindowId() + { + return 0; + } + + public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, + out string strPictureImage) + { + strButtonText = null; + strButtonImage = null; + strButtonImageFocus = null; + strPictureImage = null; + return false; + } + + public string Author() + { + return "mPod"; + } + + public string PluginName() + { + return "MAME Devices"; + } + + public bool HasSetup() + { + return true; + } + + public void ShowPlugin() + { + MappingForm dlg = new MappingForm("MameDevice"); + dlg.Show(); + } + + #endregion + + #region IPluginReceiver Members + + public bool WndProc(ref Message msg) + { + if (!_inputHandler.IsLoaded) + { + return false; + } + + if ((msg.Msg == WM_KEYDOWN) || (msg.Msg == WM_SYSKEYDOWN)) + { + //disabled: following code produces a stack overflow exception + //when i start MP and simply press the cursor up arrow + + Log.Info("WM_KEYDOWN: wParam {0}", (int)msg.WParam); + try + { + _inputHandler.MapAction((int)msg.WParam); + } + catch (ApplicationException) + { + return false; + } + msg.Result = IntPtr.Zero; + return true; + } + return false; + } + + #endregion + + #region IPlugin Members + + public void Start() + { + _inputHandler = new InputHandler("MameDevice"); + if (!_inputHandler.IsLoaded) + { + Log.Info("MameDevice: Error loading default mapping file - please reinstall MediaPortal"); + } + } + + public void Stop() + { + // TODO: Add MameDevice.Stop implementation + } + + #endregion + } +} \ No newline at end of file Added: trunk/plugins/MameDevice/MameDevice/MameDevice.csproj =================================================================== --- trunk/plugins/MameDevice/MameDevice/MameDevice.csproj (rev 0) +++ trunk/plugins/MameDevice/MameDevice/MameDevice.csproj 2010-11-14 11:06:40 UTC (rev 3930) @@ -0,0 +1,76 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>9.0.30729</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{C1374C80-C3EB-42CA-86C3-51C58A6C0A9B}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>MameDevice</RootNamespace> + <AssemblyName>MameDevice</AssemblyName> + <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + <StartupObject> + </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> + </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="Core, Version=1.1.5.41581, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\..\..\..\MediaPortal\trunk\mediaportal\Core\bin\Release\Core.dll</HintPath> + </Reference> + <Reference Include="Dialogs, Version=1.1.5.41584, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\..\..\..\MediaPortal\trunk\mediaportal\Dialogs\bin\Release\Dialogs.dll</HintPath> + </Reference> + <Reference Include="Microsoft.Office.Interop.Outlook, Version=10.0.4504.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> + <SpecificVersion>False</SpecificVersion> + <HintPath>References\Microsoft.Office.Interop.Outlook.dll</HintPath> + </Reference> + <Reference Include="System" /> + <Reference Include="System.Core"> + <RequiredTargetFramework>3.5</RequiredTargetFramework> + </Reference> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml" /> + <Reference Include="Utils, Version=1.1.5.41571, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\..\..\..\MediaPortal\trunk\mediaportal\Dialogs\bin\Release\Utils.dll</HintPath> + </Reference> + </ItemGroup> + <ItemGroup> + <Compile Include="MameDevice.cs"> + <SubType>Code</SubType> + </Compile> + <Compile Include="MappingForm.cs"> + <SubType>Form</SubType> + </Compile> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\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 Added: trunk/plugins/MameDevice/MameDevice/MappingForm.cs =================================================================== --- trunk/plugins/MameDevice/MameDevice/MappingForm.cs (rev 0) +++ trunk/plugins/MameDevice/MameDevice/MappingForm.cs 2010-11-14 11:06:40 UTC (rev 3930) @@ -0,0 +1,1611 @@ +#region Copyright (C) 2005-2010 Team MediaPortal + +// Copyright (C) 2005-2010 Team MediaPortal +// http://www.team-mediaportal.com +// +// MediaPortal is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 2 of the License, or +// (at your option) any later version. +// +// MediaPortal is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with MediaPortal. If not, see <http://www.gnu.org/licenses/>. + +#endregion + +using System; +using System.ComponentModel; +using System.Drawing; +using System.IO; +using System.Text; +using System.Windows.Forms; +using System.Xml; +using MediaPortal.Configuration; +using MediaPortal.GUI.Library; +using MediaPortal.UserInterface.Controls; +using Action = MediaPortal.GUI.Library.Action; + +namespace MediaPortal.InputDevices +{ + /// <summary> + /// Summary description for HCWMappingForm. + /// </summary> + public class MappingForm : MPConfigForm + { + private Array windowsList = Enum.GetValues(typeof (GUIWindow.Window)); + private Array actionList = Enum.GetValues(typeof (Action.ActionType)); + private string[] layerList = new string[] {"all", "1", "2"}; + private string[] fullScreenList = new string[] {"Fullscreen", "No Fullscreen"}; + private string[] playerList = new string[] {"TV", "DVD", "MEDIA"}; + private string[] powerList = new string[] {"EXIT", "REBOOT", "SHUTDOWN", "STANDBY", "HIBERNATE"}; + private string[] soundList = new string[] {"none", "back.wav", "click.wav", "cursor.wav"}; + + private string[] keyList = new string[] + { + "{BACKSPACE}", "{BREAK}", "{CAPSLOCK}", "{DELETE}", "{DOWN}", "{END}", "{ENTER}", + "{ESC}", + "{HELP}", "{HOME}", "{INSERT}", "{LEFT}", "{NUMLOCK}", "{PGDN}", "{PGUP}", "{PRTSC}", + "{RIGHT}", "{SCROLLLOCK}", "{TAB}", "{UP}", "{F1}", "{F2}", "{F3}", "{F4}", "{F5}", + "{F6}", + "{F7}", "{F8}", "{F9}", "{F10}", "{F11}", "{F12}", "{F13}", "{F14}", "{F15}", "{F16}" + , + "{ADD}", "{SUBTRACT}", "{MULTIPLY}", "{DIVIDE}" + }; + + private string[] processList = new string[] {"CLOSE", "KILL"}; + + private string inputClassName; + + private class Data + { + private string type; + private string value; + private string parameter; + + public Data(object newType, object newParameter, object newValue) + { + if (newValue == null) + { + newValue = ""; + } + if (newParameter == null) + { + newParameter = ""; + } + type = (string)newType; + value = newValue.ToString(); + parameter = (string)newParameter; + } + + public string Type + { + get { return type; } + } + + public string Value + { + get { return value; } + } + + public string Parameter + { + get { return parameter; } + } + } + + private TreeView treeMapping; + private MPRadioButton radioButtonWindow; + private MPRadioButton radioButtonFullscreen; + private MPRadioButton radioButtonPlaying; + private MPRadioButton radioButtonNoCondition; + private MPComboBox comboBoxCondProperty; + private MPComboBox comboBoxCmdProperty; + private MPGroupBox groupBoxCondition; + private MPRadioButton radioButtonAction; + private MPRadioButton radioButtonKey; + private MPRadioButton radioButtonActWindow; + private MPRadioButton radioButtonToggle; + private MPRadioButton radioButtonPower; + private MPComboBox comboBoxSound; + private MPLabel labelSound; + private MPGroupBox groupBoxAction; + // private MediaPortal.UserInterface.Controls.MPGradientLabel headerLabel; + private MPButton applyButton; + private MPButton okButton; + private MPButton cancelButton; + // private MediaPortal.UserInterface.Controls.MPBeveledLine beveledLine1; + private MPLabel labelLayer; + private MPComboBox comboBoxLayer; + private MPButton buttonUp; + private MPButton buttonDown; + private MPButton buttonNew; + private MPButton buttonRemove; + private MPButton buttonDefault; + private MPGroupBox groupBoxLayer; + private MPRadioButton radioButtonProcess; + + /// <summary> + /// Required designer variable. + /// </summary> + private Container components = null; + + public MappingForm(string name) + { + // + // Required for Windows Form Designer support + // + InitializeComponent(); + comboBoxSound.DataSource = soundList; + comboBoxLayer.DataSource = layerList; + inputClassName = name; + LoadMapping(inputClassName + ".xml", false); + // headerLabel.Caption = inputClassName; + } + + /// <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.treeMapping = new System.Windows.Forms.TreeView(); + this.radioButtonWindow = new MediaPortal.UserInterface.Controls.MPRadioButton(); + this.radioButtonFullscreen = new MediaPortal.UserInterface.Controls.MPRadioButton(); + this.radioButtonPlaying = new MediaPortal.UserInterface.Controls.MPRadioButton(); + this.radioButtonNoCondition = new MediaPortal.UserInterface.Controls.MPRadioButton(); + this.comboBoxCondProperty = new MediaPortal.UserInterface.Controls.MPComboBox(); + this.comboBoxCmdProperty = new MediaPortal.UserInterface.Controls.MPComboBox(); + this.groupBoxCondition = new MediaPortal.UserInterface.Controls.MPGroupBox(); + this.radioButtonAction = new MediaPortal.UserInterface.Controls.MPRadioButton(); + this.radioButtonKey = new MediaPortal.UserInterface.Controls.MPRadioButton(); + this.radioButtonActWindow = new MediaPortal.UserInterface.Controls.MPRadioButton(); + this.radioButtonToggle = new MediaPortal.UserInterface.Controls.MPRadioButton(); + this.radioButtonPower = new MediaPortal.UserInterface.Controls.MPRadioButton(); + this.groupBoxAction = new MediaPortal.UserInterface.Controls.MPGroupBox(); + this.radioButtonProcess = new MediaPortal.UserInterface.Controls.MPRadioButton(); + this.labelSound = new MediaPortal.UserInterface.Controls.MPLabel(); + this.comboBoxSound = new MediaPortal.UserInterface.Controls.MPComboBox(); + this.applyButton = new MediaPortal.UserInterface.Controls.MPButton(); + this.okButton = new MediaPortal.UserInterface.Controls.MPButton(); + this.cancelButton = new MediaPortal.UserInterface.Controls.MPButton(); + this.groupBoxLayer = new MediaPortal.UserInterface.Controls.MPGroupBox(); + this.comboBoxLayer = new MediaPortal.UserInterface.Controls.MPComboBox(); + this.labelLayer = new MediaPortal.UserInterface.Controls.MPLabel(); + this.buttonUp = new MediaPortal.UserInterface.Controls.MPButton(); + this.buttonDown = new MediaPortal.UserInterface.Controls.MPButton(); + this.buttonNew = new MediaPortal.UserInterface.Controls.MPButton(); + this.buttonRemove = new MediaPortal.UserInterface.Controls.MPButton(); + this.buttonDefault = new MediaPortal.UserInterface.Controls.MPButton(); + this.groupBoxCondition.SuspendLayout(); + this.groupBoxAction.SuspendLayout(); + this.groupBoxLayer.SuspendLayout(); + this.SuspendLayout(); + // + // treeMapping + // + this.treeMapping.AllowDrop = true; + this.treeMapping.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.treeMapping.FullRowSelect = true; + this.treeMapping.HideSelection = false; + this.treeMapping.Location = new System.Drawing.Point(11, 20); + this.treeMapping.Name = "treeMapping"; + this.treeMapping.Size = new System.Drawing.Size(312, 330); + this.treeMapping.TabIndex = 1; + this.treeMapping.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeMapping_AfterSelect); + // + // radioButtonWindow + // + this.radioButtonWindow.AutoSize = true; + this.radioButtonWindow.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.radioButtonWindow.Location = new System.Drawing.Point(24, 24); + this.radioButtonWindow.Name = "radioButtonWindow"; + this.radioButtonWindow.Size = new System.Drawing.Size(63, 17); + this.radioButtonWindow.TabIndex = 9; + this.radioButtonWindow.Text = "Window"; + this.radioButtonWindow.UseVisualStyleBackColor = true; + this.radioButtonWindow.Click += new System.EventHandler(this.radioButtonWindow_Click); + // + // radioButtonFullscreen + // + this.radioButtonFullscreen.AutoSize = true; + this.radioButtonFullscreen.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.radioButtonFullscreen.Location = new System.Drawing.Point(112, 24); + this.radioButtonFullscreen.Name = "radioButtonFullscreen"; + this.radioButtonFullscreen.Size = new System.Drawing.Size(72, 17); + this.radioButtonFullscreen.TabIndex = 10; + this.radioButtonFullscreen.Text = "Fullscreen"; + this.radioButtonFullscreen.UseVisualStyleBackColor = true; + this.radioButtonFullscreen.Click += new System.EventHandler(this.radioButtonFullscreen_Click); + // + // radioButtonPlaying + // + this.radioButtonPlaying.AutoSize = true; + this.radioButtonPlaying.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.radioButtonPlaying.Location = new System.Drawing.Point(24, 48); + this.radioButtonPlaying.Name = "radioButtonPlaying"; + this.radioButtonPlaying.Size = new System.Drawing.Size(58, 17); + this.radioButtonPlaying.TabIndex = 11; + this.radioButtonPlaying.Text = "Playing"; + this.radioButtonPlaying.UseVisualStyleBackColor = true; + this.radioButtonPlaying.Click += new System.EventHandler(this.radioButtonPlaying_Click); + // + // radioButtonNoCondition + // + this.radioButtonNoCondition.AutoSize = true; + this.radioButtonNoCondition.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.radioButtonNoCondition.Location = new System.Drawing.Point(112, 48); + this.radioButtonNoCondition.Name = "radioButtonNoCondition"; + this.radioButtonNoCondition.Size = new System.Drawing.Size(85, 17); + this.radioButtonNoCondition.TabIndex = 12; + this.radioButtonNoCondition.Text = "No Condition"; + this.radioButtonNoCondition.UseVisualStyleBackColor = true; + this.radioButtonNoCondition.Click += new System.EventHandler(this.radioButtonNoCondition_Click); + // + // comboBoxCondProperty + // + this.comboBoxCondProperty.BorderColor = System.Drawing.Color.Empty; + this.comboBoxCondProperty.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBoxCondProperty.ForeColor = System.Drawing.Color.Blue; + this.comboBoxCondProperty.Location = new System.Drawing.Point(24, 72); + this.comboBoxCondProperty.Name = "comboBoxCondProperty"; + this.comboBoxCondProperty.Size = new System.Drawing.Size(176, 21); + this.comboBoxCondProperty.Sorted = true; + this.comboBoxCondProperty.TabIndex = 13; + this.comboBoxCondProperty.SelectedIndexChanged += + new System.EventHandler(this.comboBoxCondProperty_SelectedIndexChanged); + // + // comboBoxCmdProperty + // + this.comboBoxCmdProperty.BorderColor = System.Drawing.Color.Empty; + this.comboBoxCmdProperty.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBoxCmdProperty.ForeColor = System.Drawing.Color.DarkGreen; + this.comboBoxCmdProperty.Location = new System.Drawing.Point(24, 96); + this.comboBoxCmdProperty.Name = "comboBoxCmdProperty"; + this.comboBoxCmdProperty.Size = new System.Drawing.Size(176, 21); + this.comboBoxCmdProperty.Sorted = true; + this.comboBoxCmdProperty.TabIndex = 14; + this.comboBoxCmdProperty.SelectedIndexChanged += + new System.EventHandler(this.comboBoxCmdProperty_SelectedIndexChanged); + // + // groupBoxCondition + // + this.groupBoxCondition.Anchor = System.Windows.Forms.AnchorStyles.Right; + this.groupBoxCondition.Controls.Add(this.radioButtonWindow); + this.groupBoxCondition.Controls.Add(this.radioButtonFullscreen); + this.groupBoxCondition.Controls.Add(this.radioButtonPlaying); + this.groupBoxCondition.Controls.Add(this.radioButtonNoCondition); + this.groupBoxCondition.Controls.Add(this.comboBoxCondProperty); + this.groupBoxCondition.Enabled = false; + this.groupBoxCondition.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.groupBoxCondition.Location = new System.Drawing.Point(347, 93); + this.groupBoxCondition.Name = "groupBoxCondition"; + this.groupBoxCondition.Size = new System.Drawing.Size(224, 112); + this.groupBoxCondition.TabIndex = 15; + this.groupBoxCondition.TabStop = false; + this.groupBoxCondition.Text = "Condition"; + // + // radioButtonAction + // + this.radioButtonAction.AutoSize = true; + this.radioButtonAction.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.radioButtonAction.Location = new System.Drawing.Point(24, 24); + this.radioButtonAction.Name = "radioButtonAction"; + this.radioButtonAction.Size = new System.Drawing.Size(54, 17); + this.radioButtonAction.TabIndex = 14; + this.radioButtonAction.Text = "Action"; + this.radioButtonAction.UseVisualStyleBackColor = true; + this.radioButtonAction.Click += new System.EventHandler(this.radioButtonAction_Click); + // + // radioButtonKey + // + this.radioButtonKey.AutoSize = true; + this.radioButtonKey.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.radioButtonKey.Location = new System.Drawing.Point(112, 24); + this.radioButtonKey.Name = "radioButtonKey"; + this.radioButtonKey.Size = new System.Drawing.Size(71, 17); + this.radioButtonKey.TabIndex = 16; + this.radioButtonKey.Text = "Keystroke"; + this.radioButtonKey.UseVisualStyleBackColor = true; + this.radioButtonKey.Click += new System.EventHandler(this.radioButtonKey_Click); + // + // radioButtonActWindow + // + this.radioButtonActWindow.AutoSize = true; + this.radioButtonActWindow.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.radioButtonActWindow.Location = new System.Drawing.Point(24, 48); + this.radioButtonActWindow.Name = "radioButtonActWindow"; + this.radioButtonActWindow.Size = new System.Drawing.Size(63, 17); + this.radioButtonActWindow.TabIndex = 14; + this.radioButtonActWindow.Text = "Window"; + this.radioButtonActWindow.UseVisualStyleBackColor = true; + this.radioButtonActWindow.Click += new System.EventHandler(this.radioButtonActWindow_Click); + // + // radioButtonToggle + // + this.radioButtonToggle.AutoSize = true; + this.radioButtonToggle.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.radioButtonToggle.Location = new System.Drawing.Point(112, 48); + this.radioButtonToggle.Name = "radioButtonToggle"; + this.radioButtonToggle.Size = new System.Drawing.Size(86, 17); + this.radioButtonToggle.TabIndex = 17; + this.radioButtonToggle.Text = "Toggle Layer"; + this.radioButtonToggle.UseVisualStyleBackColor = true; + this.radioButtonToggle.Click += new System.EventHandler(this.radioButtonToggle_Click); + // + // radioButtonPower + // + this.radioButtonPower.AutoSize = true; + this.radioButtonPower.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.radioButtonPower.Location = new System.Drawing.Point(24, 72); + this.radioButtonPower.Name = "radioButtonPower"; + this.radioButtonPower.Size = new System.Drawing.Size(80, 17); + this.radioButtonPower.TabIndex = 18; + this.radioButtonPower.Text = "Powerdown"; + this.radioButtonPower.UseVisualStyleBackColor = true; + this.radioButtonPower.Click += new System.EventHandler(this.radioButtonPower_Click); + // + // groupBoxAction + // + this.groupBoxAction.Anchor = + ((System.Windows.Forms.AnchorStyles) + ((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.groupBoxAction.Controls.Add(this.radioButtonProcess); + this.groupBoxAction.Controls.Add(this.labelSound); + this.groupBoxAction.Controls.Add(this.comboBoxSound); + this.groupBoxAction.Controls.Add(this.radioButtonAction); + this.groupBoxAction.Controls.Add(this.radioButtonKey); + this.groupBoxAction.Controls.Add(this.radioButtonActWindow); + this.groupBoxAction.Controls.Add(this.radioButtonToggle); + this.groupBoxAction.Controls.Add(this.radioButtonPower); + this.groupBoxAction.Controls.Add(this.comboBoxCmdProperty); + this.groupBoxAction.Enabled = false; + this.groupBoxAction.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.groupBoxAction.Location = new System.Drawing.Point(347, 211); + this.groupBoxAction.Name = "groupBoxAction"; + this.groupBoxAction.Size = new System.Drawing.Size(224, 168); + this.groupBoxAction.TabIndex = 16; + this.groupBoxAction.TabStop = false; + this.groupBoxAction.Text = "Action"; + // + // radioButtonProcess + // + this.radioButtonProcess.AutoSize = true; + this.radioButtonProcess.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.radioButtonProcess.Location = new System.Drawing.Point(112, 72); + this.radioButtonProcess.Name = "radioButtonProcess"; + this.radioButtonProcess.Size = new System.Drawing.Size(62, 17); + this.radioButtonProcess.TabIndex = 21; + this.radioButtonProcess.Text = "Process"; + this.radioButtonProcess.UseVisualStyleBackColor = true; + this.radioButtonProcess.Click += new System.EventHandler(this.radioButtonProcess_Click); + // + // labelSound + // + this.labelSound.Location = new System.Drawing.Point(24, 131); + this.labelSound.Name = "labelSound"; + this.labelSound.Size = new System.Drawing.Size(40, 16); + this.labelSound.TabIndex = 20; + this.labelSound.Text = "Sound:"; + // + // comboBoxSound + // + this.comboBoxSound.BorderColor = System.Drawing.Color.Empty; + this.comboBoxSound.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBoxSound.ForeColor = System.Drawing.Color.DarkRed; + this.comboBoxSound.Location = new System.Drawing.Point(72, 128); + this.comboBoxSound.Name = "comboBoxSound"; + this.comboBoxSound.Size = new System.Drawing.Size(128, 21); + this.comboBoxSound.TabIndex = 19; + this.comboBoxSound.SelectedIndexChanged += new System.EventHandler(this.comboBoxSound_SelectedIndexChanged); + // + // applyButton + // + this.applyButton.Anchor = + ((System.Windows.Forms.AnchorStyles) + ((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.applyButton.Location = new System.Drawing.Point(343, 395); + this.applyButton.Name = "applyButton"; + this.applyButton.Size = new System.Drawing.Size(75, 23); + this.applyButton.TabIndex = 20; + this.applyButton.Text = "&Apply"; + this.applyButton.UseVisualStyleBackColor = true; + this.applyButton.Click += new System.EventHandler(this.applyButton_Click); + // + // okButton + // + this.okButton.Anchor = + ((System.Windows.Forms.AnchorStyles) + ((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.okButton.Location = new System.Drawing.Point(424, 395); + this.okButton.Name = "okButton"; + this.okButton.Size = new System.Drawing.Size(75, 23); + this.okButton.TabIndex = 19; + this.okButton.Text = "&OK"; + this.okButton.UseVisualStyleBackColor = true; + this.okButton.Click += new System.EventHandler(this.okButton_Click); + // + // cancelButton + // + this.cancelButton.Anchor = + ((System.Windows.Forms.AnchorStyles) + ((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.cancelButton.Location = new System.Drawing.Point(505, 395); + this.cancelButton.Name = "cancelButton"; + this.cancelButton.Size = new System.Drawing.Size(75, 23); + this.cancelButton.TabIndex = 18; + this.cancelButton.Text = "&Cancel"; + this.cancelButton.UseVisualStyleBackColor = true; + this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click); + // + // groupBoxLayer + // + this.groupBoxLayer.Anchor = + ((System.Windows.Forms.AnchorStyles) + ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.groupBoxLayer.Controls.Add(this.comboBoxLayer); + this.groupBoxLayer.Controls.Add(this.labelLayer); + this.groupBoxLayer.Enabled = false; + this.groupBoxLayer.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.groupBoxLayer.Location = new System.Drawing.Point(347, 12); + this.groupBoxLayer.Name = "groupBoxLayer"; + this.groupBoxLayer.Size = new System.Drawing.Size(224, 64); + this.groupBoxLayer.TabIndex = 22; + this.groupBoxLayer.TabStop = false; + this.groupBoxLayer.Text = "Layer"; + // + // comboBoxLayer + // + this.comboBoxLayer.BorderColor = System.Drawing.Color.Empty; + this.comboBoxLayer.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBoxLayer.ForeColor = System.Drawing.Color.DimGray; + this.comboBoxLayer.Location = new System.Drawing.Point(80, 24); + this.comboBoxLayer.Name = "comboBoxLayer"; + this.comboBoxLayer.Size = new System.Drawing.Size(121, 21); + this.comboBoxLayer.TabIndex = 25; + this.comboBoxLayer.SelectedIndexChanged += new System.EventHandler(this.comboBoxLayer_SelectedIndexChanged); + // + // labelLayer + // + this.labelLayer.Location = new System.Drawing.Point(24, 27); + this.labelLayer.Name = "labelLayer"; + this.labelLayer.Size = new System.Drawing.Size(40, 16); + this.labelLayer.TabIndex = 16; + this.labelLayer.Text = "Layer:"; + // + // buttonUp + // + this.buttonUp.Anchor = + ((System.Windows.Forms.AnchorStyles) + ((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.buttonUp.Location = new System.Drawing.Point(7, 356); + this.buttonUp.Name = "buttonUp"; + this.buttonUp.Size = new System.Drawing.Size(56, 23); + this.buttonUp.TabIndex = 23; + this.buttonUp.Text = "Up"; + this.buttonUp.UseVisualStyleBackColor = true; + this.buttonUp.Click += new System.EventHandler(this.buttonUp_Click); + // + // buttonDown + // + this.buttonDown.Anchor = + ((System.Windows.Forms.AnchorStyles) + ((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.buttonDown.Location = new System.Drawing.Point(75, 356); + this.buttonDown.Name = "buttonDown"; + this.buttonDown.Size = new System.Drawing.Size(56, 23); + this.buttonDown.TabIndex = 24; + this.buttonDown.Text = "Down"; + this.buttonDown.UseVisualStyleBackColor = true; + this.buttonDown.Click += new System.EventHandler(this.buttonDown_Click); + // + // buttonNew + // + this.buttonNew.Anchor = + ((System.Windows.Forms.AnchorStyles) + ((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.buttonNew.Location = new System.Drawing.Point(139, 356); + this.buttonNew.Name = "buttonNew"; + this.buttonNew.Size = new System.Drawing.Size(56, 23); + this.buttonNew.TabIndex = 26; + this.buttonNew.Text = "New"; + this.buttonNew.UseVisualStyleBackColor = true; + this.buttonNew.Click += new System.EventHandler(this.buttonNew_Click); + // + // buttonRemove + // + this.buttonRemove.Anchor = + ((System.Windows.Forms.AnchorStyles) + ((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.buttonRemove.Location = new System.Drawing.Point(203, 356); + this.buttonRemove.Name = "buttonRemove"; + this.buttonRemove.Size = new System.Drawing.Size(56, 23); + this.buttonRemove.TabIndex = 27; + this.buttonRemove.Text = "Remove"; + this.buttonRemove.UseVisualStyleBackColor = true; + this.buttonRemove.Click += new System.EventHandler(this.buttonRemove_Click); + // + // buttonDefault + // + this.buttonDefault.Anchor = + ((System.Windows.Forms.AnchorStyles) + ((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.buttonDefault.Location = new System.Drawing.Point(267, 356); + this.buttonDefault.Name = "buttonDefault"; + this.buttonDefault.Size = new System.Drawing.Size(56, 23); + this.buttonDefault.TabIndex = 28; + this.buttonDefault.Text = "Default"; + this.buttonDefault.UseVisualStyleBackColor = true; + this.buttonDefault.Click += new System.EventHandler(this.buttonReset_Click); + // + // MappingForm + // + this.AcceptButton = this.okButton; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScroll = true; + this.CancelButton = this.cancelButton; + this.ClientSize = new System.Drawing.Size(592, 430); + this.Controls.Add(this.treeMapping); + this.Controls.Add(this.buttonDefault); + this.Controls.Add(this.buttonRemove); + this.Controls.Add(this.buttonNew); + this.Controls.Add(this.buttonDown); + this.Controls.Add(this.buttonUp); + this.Controls.Add(this.applyButton); + this.Controls.Add(this.okButton); + this.Controls.Add(this.cancelButton); + this.Controls.Add(this.groupBoxAction); + this.Controls.Add(this.groupBoxCondition); + this.Controls.Add(this.groupBoxLayer); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.Name = "MappingForm"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "MAME Devices - Setup"; + this.groupBoxCondition.ResumeLayout(false); + this.groupBoxCondition.PerformLayout(); + this.groupBoxAction.ResumeLayout(false); + this.groupBoxAction.PerformLayout(); + this.groupBoxLayer.ResumeLayout(false); + this.ResumeLayout(false); + } + + #endregion + + private void LoadMapping(string xmlFile, bool defaults) + { + groupBoxLayer.Enabled = false; + groupBoxCondition.Enabled = false; + groupBoxAction.Enabled = false; + treeMapping.Nodes.Clear(); + XmlDocument doc = new XmlDocument(); + string path = Config.GetFile(Config.Dir.Base, @"InputDeviceMappings\defaults", xmlFile); + if (!defaults && File.Exists(Config.GetFile(Config.Dir.CustomInputDevice, xmlFile))) + { + path = Config.GetFile(Config.Dir.CustomInputDevice, xmlFile); + } + doc.Load(path); + XmlNodeList listRemotes = doc.DocumentElement.SelectNodes("/mappings/remote"); + + foreach (XmlNode nodeRemote in listRemotes) + { + TreeNode remoteNode = new TreeNode(nodeRemote.Attributes["family"].Value); + remoteNode.Tag = new Data("REMOTE", null, nodeRemote.Attributes["family"].Value); + XmlNodeList listButtons = nodeRemote.SelectNodes("button"); + foreach (XmlNode nodeButton in listButtons) + { + TreeNode buttonNode = new TreeNode((string)nodeButton.Attributes["name"].Value); + buttonNode.Tag = new Data("BUTTON", nodeButton.Attributes["name"].Value, nodeButton.Attributes["code"].Value); + remoteNode.Nodes.Add(buttonNode); + + TreeNode layer1Node = new TreeNode("Layer 1"); + TreeNode layer2Node = new TreeNode("Layer 2"); + TreeNode layerAllNode = new TreeNode("All Layers"); + layer1Node.Tag = new Data("LAYER", null, "1"); + layer2Node.Tag = new Data("LAYER", null, "2"); + layerAllNode.Tag = new Data("LAYER", null, "0"); + layer1Node.ForeColor = Color.DimGray; + layer2Node.ForeColor = Color.DimGray; + layerAllNode.ForeColor = Color.DimGray; + + XmlNodeList listActions = nodeButton.SelectNodes("action"); + + foreach (XmlNode nodeAction in listActions) + { + string conditionString = ""; + string commandString = ""; + + string condition = nodeAction.Attributes["condition"].Value.ToUpper(); + string conProperty = nodeAction.Attributes["conproperty"].Value.ToUpper(); + string command = nodeAction.Attributes["command"].Value.ToUpper(); + string cmdProperty = nodeAction.Attributes["cmdproperty"].Value.ToUpper(); + string sound = nodeAction.Attributes["sound"].Value; + int layer = Convert.ToInt32(nodeAction.Attributes["layer"].Value); + + #region Conditions + + switch (condition) + { + case "WINDOW": + conditionString = Enum.GetName(typeof (GUIWindow.Window), Convert.ToInt32(conProperty)); + break; + case "FULLSCREEN": + if (conProperty == "TRUE") + { + conditionString = "Fullscreen"; + } + else + { + conditionString = "No Fullscreen"; + } + break; + case "PLAYER": + switch (conProperty) + { + case "TV": + conditionString = "TV Playing"; + break; + case "DVD": + conditionString = "DVD Playing"; + break; + case "MEDIA": + conditionString = "Media Playing"; + break; + } + break; + case "*": + conditionString = "No Condition"; + break; + } + + #endregion + + #region Commands + + switch (command) + { + case "ACTION": + commandString = Enum.GetName(typeof (Action.ActionType), Convert.ToInt32(cmdProperty)); + break; + case "KEY": + commandString = "Key \"" + cmdProperty + "\""; + break; + case "WINDOW": + commandString = Enum.GetName(typeof (GUIWindow.Window), Convert.ToInt32(cmdProperty)); + break; + case "TOGGLE": + commandString = "Toggle Layer"; + break; + case "POWER": + switch (cmdProperty) + { + case "EXIT": + commandString = "Exit MediaPortal"; + break; + case "REBOOT": + commandString = "Reboot Windows"; + break; + case "SHUTDOWN": + commandString = "Shutdown Windows"; + break; + case "STANDBY": + commandString = "Suspend Windows (Standby)"; + break; + case "HIBERNATE": + commandString = "Hibernate Windows"; + break; + } + break; + case "PROCESS": + switch (cmdProperty) + { + case "CLOSE": + commandString = "Close Process"; + break; + case "KILL": + commandString = "Kill Process"; + break; + } + break; + } + + #endregion + + TreeNode conditionNode = new TreeNode(conditionString); + TreeNode commandNode = new TreeNode(commandString); + conditionNode.Tag = new Data("CONDITION", nodeAction.Attributes["condition"].Value, + nodeAction.Attributes["conproperty"].Value); + commandNode.Tag = new Data("COMMAND", nodeAction.Attributes["command"].Value, + nodeAction.Attributes["cmdproperty"].Value); + commandNode.ForeColor = Color.DarkGreen; + conditionNode.ForeColor = Color.Blue; + conditionNode.Nodes.Add(commandNode); + + TreeNode soundNode = new TreeNode(sound); + soundNode.Tag = new Data("SOUND", null, nodeAction.Attributes["sound"].Value); + if (soundNode.Text == "") + { + soundNode.Text = "No Sound"; + } + soundNode.ForeColor = Color.DarkRed; + conditionNode.Nodes.Add(soundNode); + + if (layer == 1) + { + layer1Node.Nodes.Add(conditionNode); + } + if (layer == 2) + { + layer2Node.Nodes.Add(conditionNode); + } + if (layer == 0) + { + layerAllNode.Nodes.Add(conditionNode); + } + } + if (layer1Node.Nodes.Count > 0) + { + buttonNode.Nodes.Add(layer1Node); + } + if (layer2Node.Nodes.Count > 0) + { + buttonNode.Nodes.Add(layer2Node); + } + if (layerAllNode.Nodes.Count > 0) + { + buttonNode.Nodes.Add(layerAllNode); + } + } + treeMapping.Nodes.Add(remoteNode); + if (listRemotes.Count == 1) + { + remoteNode.Expand(); + } + } + } + + private bool SaveMapping(string xmlFile) + { + try + { + DirectoryInfo dir = Directory.CreateDirectory(Config.GetFolder(Config.Dir.CustomInputDevice)); + } + catch + { + Log.Info("MAP: Error accessing directory \"InputDeviceMappings\\custom\""); + } + DialogResult result = MessageBox.Show(this, + "Information:\n\nThere is no plausibility check implemented in this version.\nMake sure your mappings are correct.\n\nThis is just an information, settings will be saved.", + "Information", MessageBoxButtons.OK, MessageBoxIcon.Information); + try + { + XmlTextWriter writer = new XmlTextWriter(Config.GetFile(Config.Dir.CustomInputDevice, xmlFile), Encoding.UTF8); + writer.Formatting = Formatting.Indented; + writer.Indentation = 1; + writer.IndentChar = (char)9; + writer.WriteStartDocument(true); + writer.WriteStartElement("mappings"); // <mappings> + writer.WriteAttributeString("version", "2"); + foreach (TreeNode remoteNode in treeMapping.Nodes) + { + writer.WriteStartElement("remote"); // <remote> + writer.WriteAttributeString("family", ((Data)remoteNode.Tag).Value); + foreach (TreeNode buttonNode in remoteNode.Nodes) + { + writer.WriteStartElement("button"); // <button> + writer.WriteAttributeString("name", ((Data)buttonNode.Tag).Parameter); + writer.WriteAttributeString("code", ((Data)buttonNode.Tag).Value); + + foreach (TreeNode layerNode in buttonNode.Nodes) + { + foreach (TreeNode conditionNode in layerNode.Nodes) + { + string layer; + string condition; + string conProperty; + string command = ""; + string cmdProperty = ""; + string sound = ""; + foreach (TreeNode commandNode in conditionNode.Nodes) + { + if (((Data)commandNode.Tag).Type == "COMMAND") + { + command = ((Data)commandNode.Tag).Parameter; + cmdProperty = ((Data)commandNode.Tag).Value; + } + else + { + sound = ((Data)commandNode.Tag).Value; + } + } + condition = ((Data)conditionNode.Tag).Parameter; + conProperty = ((Data)conditionNode.Tag).Value; + layer = ((Data)layerNode.Tag).Value; + writer.WriteStartElement("action"); // <action> + writer.WriteAttributeString("layer", layer); + writer.WriteAttributeString("condition", condition); + writer.WriteAttributeString("conproperty", conProperty); + writer.WriteAttributeString("command", command); + writer.WriteAttributeString("cmdproperty", cmdProperty); + writer.WriteAttributeString("sound", sound); + writer.WriteEndElement(); // </action> + } + } + writer.WriteEndElement(); // </button> + } + writer.WriteEndElement(); // </remote> + } + writer.WriteEndElement(); // </mapping> + writer.WriteEndDocument(); + writer.Close(); + return true; + } + catch + { + Log.Info("MAP: Error saving mapping to XML file"); + return false; + } + } + + private TreeNode getNode(string type) + { + TreeNode node = treeMapping.SelectedNode; + Data data = (Data)node.Tag; + if (data.Type == type) + { + return node; + } + + #region Find Node + + switch (type) + { + case "COMMAND": + if (data.Type == "SOUND") + { + node = node.Parent; + foreach (TreeNode subNode in node.Nodes) + { + data = (Data)subNode.Tag; + if (data.Type == type) + { + return subNode; + } + } + } + else if (data.Type == "CONDITION") + { + foreach (TreeNode subNode in node.Nodes) + { + data = (Data)subNode.Tag; + if (data.Type == type) + { + return subNode; + } + } + } + break; + case "SOUND": + if (data.Type == "COMMAND") + { + node = node.Parent; + foreach (TreeNode subNode in node.Nodes) + { + data = (Data)subNode.Tag; + if (data.Type == type) + { + return subNode; + } + } + } + else if (data.Type == "CONDITION") + { + foreach (TreeNode subNode in node.Nodes) + { + data = (Data)subNode.Tag; + if (data.Type == type) + { + return subNode; + } + } + } + break; + case "CONDITION": + if ((data.Type == "SOUND") || (data.Type == "COMMAND")) + { + return node.Parent; + } + break; + case "LAYER": + if ((data.Type == "SOUND") || (data.Type == "COMMAND")) + { + return node.Parent.Parent; + } + else if (data.Type == "CONDITION") + { + return node.Parent; + } + break; + case "BUTTON": + if ((data.Type == "SOUND") || (data.Type == "COMMAND")) + { + return node.Parent.Parent.Parent; + } + else if (data.Type == "CONDITION") + { + return node.Parent.Parent; + } + else if (data.Type == "LAYER") + { + return node.Parent; + } + break; + case "REMOTE": + if ((data.Type == "SOUND") || (data.Type == "COMMAND")) + { + return node.Parent.Parent.Parent.Parent; + } + else if (data.Type == "CONDITION") + { + return node.Parent.Parent.Parent; + } + else if (data.Type == "LAYER") + { + return node.Parent.Parent; + } + else if (data.Type == "BUTTON") + { + return node.Parent; + } + break; + } + + #endregion + + return node; + } + + private void treeMapping_AfterSelect(object sender, TreeViewEventArgs e) + { + if (e.Action == TreeViewAction.Unknown) + { + return; + } + + TreeNode node = e.Node; + Data data = (Data)node.Tag; + switch (data.Type) + { + case "REMOTE": + case "BUTTON": + groupBoxLayer.Enabled = false; + groupBoxCondition.Enabled = false; + groupBoxAction.Enabled = false; + comboBoxLayer.Text = "All Layers"; + comboBoxCondProperty.Text = "none"; + comboBoxCmdProperty.Text = "none"; + comboBoxSound.Text = "none"; + return; + case "LAYER": + groupBoxLayer.Enabled = true; + groupBoxCondition.Enabled = false; + groupBoxAction.Enabled = false; + comboBoxCondProperty.Text = "none"; + comboBoxCmdProperty.Text = "none"; + comboBoxSound.Text = "none"; + comboBoxLayer.SelectedIndex = Convert.ToInt32(data.Value); + return; + case "COMMAND": + case "SOUND": + case "CONDITION": + { + groupBoxCondition.Enabled = true; + groupBoxAction.Enabled = true; + groupBoxLayer.Enabled = true; + if ((data.Type == "COMMAND") || (data.Type == "SOUND")) + { + comboBoxLayer.SelectedIndex = Convert.ToInt32(((Data)node.Parent.Parent.Tag).Value); + node = node.Parent; + data = (Data)node.Tag; + } + else + { + comboBoxLayer.SelectedIndex = Convert.ToInt32(((Data)node.Parent.Tag).Value); + } + + switch (data.Parameter) + { + case "WINDOW": + radioButtonWindow.Checked = true; + comboBoxCondProperty.Enabled = true; + UpdateCombo(ref comboBoxCondProperty, windowsList, + Enum.GetName(typeof (GUIWindow.Window), Convert.ToInt32(data.Value))); + break; + case "FULLSCREEN": + radioButtonFullscreen.Checked = true; + comboBoxCondProperty.Enabled = true; + if (Convert.ToBoolean(data.Value)) + { + UpdateCombo(ref comboBoxCondProperty, fullScreenList, "Fullscreen"); + } + else + { + UpdateCombo(ref comboBoxCondProperty, fullScreenList, "No Fullscreen"); + } + break; + case "PLAYER": + radioButtonPlaying.Checked = true; + comboBoxCondProperty.Enabled = true; + UpdateCombo(ref comboBoxCondProperty, playerList, data.Value); + break; + case "*": + comboBoxCondProperty.Text = "none"; + radioButtonNoCondition.Checked = true; + comboBoxCondProperty.Enabled = false; + comboBoxCondProperty.Items.Clear(); + break; + } + foreach (TreeNode typeNode in node.Nodes) + { + data = (Data)typeNode.Tag; + switch (data.Type) + { + case "SOUND": + if (data.Value != "") + { + comboBoxSound.SelectedItem = data.Value; + } + else + { + comboBoxSound.SelectedItem = "none"; + } + break; + case "COMMAND": + switch (data.Parameter) + { + case "ACTION": + comboBoxCmdProperty.DropDownStyle = ComboBoxStyle.DropDownList; + radioButtonAction.Checked = true; + comboBoxSound.Enabled = true; + comboBoxCmdProperty.Enabled = true; + UpdateCombo(ref comboBoxCmdProperty, actionList, + Enum.GetName(typeof (Action.ActionType), Convert.ToInt32(data.Value))); + break; + case "KEY": + comboBoxCmdProperty.DropDownStyle = ComboBoxStyle.DropDown; + radioButtonKey.Checked = true; + comboBoxSound.Enabled = false; + comboBoxSound.Text = "none"; + comboBoxCmdProperty.Enabled = true; + UpdateCombo(ref comboBoxCmdProperty, keyList, data.Value); + break; + case "WINDOW": + comboBoxCmdProperty.DropDownStyle = ComboBoxStyle.DropDownList; + radioButtonActWindow.Checked = true; + comboBoxSound.Enabled = true; + comboBoxCmdProperty.Enabled = true; + UpdateCombo(ref comboBoxCmdProperty, windowsList, + Enum.GetName(typeof (GUIWindow.Window), Convert.ToInt32(data.Value))); + break; + case "TOGGLE": + radioButtonToggle.Checked = true; + comboBoxSound.Enabled = true; + comboBoxCmdProperty.Enabled = false; + comboBoxCmdProperty.Items.Clear(); + comboBoxCmdProperty.Text = ""; + break; + case "POWER": + comboBoxCmdProperty.DropDownStyle = ComboBoxStyle.DropDownList; + radioButtonPower.Checked = true; + comboBoxSound.Enabled = true; + comboBoxCmdProperty.Enabled = true; + UpdateCombo(ref comboBoxCmdProperty, powerList, data.Value); + break; + case "PROCESS": + comboBoxCmdProperty.DropDownStyle = ComboBoxStyle.DropDownList; + radioButtonProcess.Checked = true; + comboBoxSound.Enabled = true; + comboBoxCmdProperty.Enabled = true; + UpdateCombo(ref comboBoxCmdProperty, processList, data.Value); + break; + } + break; + } + } + } + break; + } + } + + private void UpdateCombo(ref MPComboBox comboBox, Array list, string hilight) + { + comboBox.Items.Clear(); + foreach (object item in list) + { + comboBox.Items.Add(item.ToString()); + } + comboBox.Text = hilight; + comboBox.SelectedItem = hilight; + comboBox.Enabled = true; + } + + private void radioButtonWindow_Click(object sender, EventArgs e) + { + comboBoxCondProperty.Enabled = true; + TreeNode node = getNode("CONDITION"); + Data data = new Data("CONDITION", "WINDOW", "-1"); + node.Tag = data; + UpdateCombo(ref comboBoxCondProperty, windowsList, + Enum.GetName(typeof (GUIWindow.Window), Convert.ToInt32(data.Value))); + } + + private void radioButtonFullscreen_Click(object sender, EventArgs e) + { + comboBoxCondProperty.Enabled = true; + TreeNode node = getNode("CONDITION"); + Data data = new Data("CONDITION", "FULLSCREEN", "true"); + node.Tag = data; + UpdateCombo(ref comboBoxCondProperty, fullScreenList, "Fullscreen"); + } + + private void radioButtonPlaying_Click(object sender, EventArgs e) + { + comboBoxCondProperty.Enabled = true; + TreeNode node = getNode("CONDITION"); + Data data = new Data("CONDITION", "PLAYER", "TV"); + node.Tag = data; + UpdateCombo(ref comboBoxCondProperty, playerList, "TV"); + } + + private void radioButtonNoCondition_Click(object sender, EventArgs e) + { + comboBoxCondProperty.Enabled = false; + comboBoxCondProperty.Items.Clear(); + comboBoxCondProperty.Text = "none"; + TreeNode node = getNode("CONDITION"); + Data data = new Data("CONDITION", "*", null); + node.Tag = data; + node.Text = "No Condition"; + } + + private void radioButtonAction_Click(object sender, EventArgs e) + { + comboBoxCmdProperty.DropDownStyle = ComboBoxStyle.DropDownList; + comboBoxSound.Enabled = true; + comboBoxCmdProperty.Enabled = true; + TreeNode node = getNode("COMMAND"); + Data data = new Data("COMMAND", "ACTION", "0"); + node.Tag = data; + UpdateCombo(ref comboBoxCmdProperty, actionList, + Enum.GetName(typeof (Action.ActionType), Convert.ToInt32(data.Value))); + } + + private void radioButtonActWindow_Click(object sender, EventArgs e) + { + comboBoxCmdProperty.DropDownStyle = ComboBoxStyle.DropDownList; + comboBoxSound.Enabled = true; + comboBoxCmdProperty.Enabled = true; + TreeNode node = getNode("COMMAND"); + Data data = new Data("COMMAND", "WINDOW", "-1"); + node.Tag = data; + UpdateCombo(ref comboBoxCmdProperty, windowsList, + Enum.GetName(typeof (GUIWindow.Window), Convert.ToInt32(data.Value))); + } + + private void radioButtonKey_Click(object sender, EventArgs e) + { + comboBoxCmdProperty.DropDownStyle = ComboBoxStyle.DropDown; + comboBoxSound.Enabled = false; + comboBoxSound.Text = "none"; + comboBoxCmdProperty.Enabled = true; + TreeNode node = getNode("COMMAND"); + Data data = new Data("COMMAND", "KEY", "{ENTER}"); + node.Tag = data; + UpdateCombo(ref comboBoxCmdProperty, keyList, data.Value); + node = getNode("SOUND"); + node.Tag = new Data("SOUND", null, ""); + node.Text = "No Sound"; + } + + private void radioButtonTog... [truncated message content] |
From: <che...@us...> - 2010-11-14 12:54:53
|
Revision: 3932 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3932&view=rev Author: chef_koch Date: 2010-11-14 12:54:41 +0000 (Sun, 14 Nov 2010) Log Message: ----------- added burner plugin from official MP Added Paths: ----------- trunk/plugins/Burner/ trunk/plugins/Burner/Burner/ trunk/plugins/Burner/Burner/BurnDVDEvents.cs trunk/plugins/Burner/Burner/BurnDataDVD.cs trunk/plugins/Burner/Burner/BurnVideoDVD.cs trunk/plugins/Burner/Burner/Burner.csproj trunk/plugins/Burner/Burner/Burner.gif trunk/plugins/Burner/Burner/BurnerDisabled.gif trunk/plugins/Burner/Burner/GUIBurner.cs trunk/plugins/Burner/Burner/MadlldlibWrapper.cs trunk/plugins/Burner/Burner/Properties/ trunk/plugins/Burner/Burner/Properties/AssemblyInfo.cs trunk/plugins/Burner/Burner/SetupForm.cs trunk/plugins/Burner/Burner/SetupForm.resx trunk/plugins/Burner/Burner.sln trunk/plugins/Burner/Skin/ trunk/plugins/Burner/Skin/Blue3/ trunk/plugins/Burner/Skin/Blue3/Media/ trunk/plugins/Burner/Skin/Blue3/Media/burn_logo.png trunk/plugins/Burner/Skin/Blue3/Media/hover_my burner.png trunk/plugins/Burner/Skin/Blue3/myburner.xml trunk/plugins/Burner/Skin/Blue3wide/ trunk/plugins/Burner/Skin/Blue3wide/Media/ trunk/plugins/Burner/Skin/Blue3wide/Media/burn_logo.png trunk/plugins/Burner/Skin/Blue3wide/Media/hover_my burner.png trunk/plugins/Burner/Skin/Blue3wide/myburner.xml trunk/plugins/Burner/XPImapiBurner/ trunk/plugins/Burner/XPImapiBurner/AssemblyInfo.cs trunk/plugins/Burner/XPImapiBurner/XPBurn.cs trunk/plugins/Burner/XPImapiBurner/XPBurnCom.cs trunk/plugins/Burner/XPImapiBurner/XPBurnConsts.cs trunk/plugins/Burner/XPImapiBurner/XPBurnDelegates.cs trunk/plugins/Burner/XPImapiBurner/XPBurnEnumStorageElements.cs trunk/plugins/Burner/XPImapiBurner/XPBurnEnums.cs trunk/plugins/Burner/XPImapiBurner/XPBurnExceptions.cs trunk/plugins/Burner/XPImapiBurner/XPBurnIStorage.cs trunk/plugins/Burner/XPImapiBurner/XPBurnIStream.cs trunk/plugins/Burner/XPImapiBurner/XPBurnMessageQueue.cs trunk/plugins/Burner/XPImapiBurner/XPBurnMessageQueue.resx trunk/plugins/Burner/XPImapiBurner/XPBurnProgressEvents.cs trunk/plugins/Burner/XPImapiBurner/XPBurnStructs.cs trunk/plugins/Burner/XPImapiBurner/XPImapiBurner.csproj Property changes on: trunk/plugins/Burner ___________________________________________________________________ Added: svn:ignore + *.suo *.user _ReSharper.Burner Property changes on: trunk/plugins/Burner/Burner ___________________________________________________________________ Added: svn:ignore + bin obj Added: trunk/plugins/Burner/Burner/BurnDVDEvents.cs =================================================================== --- trunk/plugins/Burner/Burner/BurnDVDEvents.cs (rev 0) +++ trunk/plugins/Burner/Burner/BurnDVDEvents.cs 2010-11-14 12:54:41 UTC (rev 3932) @@ -0,0 +1,80 @@ +#region Copyright (C) 2005-2010 Team MediaPortal + +// Copyright (C) 2005-2010 Team MediaPortal +// http://www.team-mediaportal.com +// +// MediaPortal is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 2 of the License, or +// (at your option) any later version. +// +// MediaPortal is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with MediaPortal. If not, see <http://www.gnu.org/licenses/>. + +#endregion + +using System; + +namespace MediaPortal.GUI.GUIBurner +{ + + #region EventArgs Classes + + public class FileFinishedEventArgs : EventArgs + { + public string SourceFile; + public string DestinationFile; + + public FileFinishedEventArgs(string inputFileName, string outputFileName) + { + SourceFile = inputFileName; + DestinationFile = outputFileName; + } + } + + public class ProcessExitedEventArgs : EventArgs + { + public string ProcessName; + public string DestinationFile; + + public ProcessExitedEventArgs(string ProcessExitedName) + { + ProcessName = ProcessExitedName; + } + } + + public class BurnDVDErrorEventArgs : EventArgs + { + public string Error_Process; + public string Error_Text; + + public BurnDVDErrorEventArgs(string ErrorProcess, string ErrorText) + { + Error_Process = ErrorProcess; + Error_Text = ErrorText; + } + } + + public class BurnDVDStatusUpdateEventArgs : EventArgs + { + private string _Status; + + public BurnDVDStatusUpdateEventArgs(string StatusString) + { + _Status = StatusString; + } + + public string Status + { + get { return _Status; } + set { _Status = value; } + } + } + + #endregion +} \ No newline at end of file Added: trunk/plugins/Burner/Burner/BurnDataDVD.cs =================================================================== --- trunk/plugins/Burner/Burner/BurnDataDVD.cs (rev 0) +++ trunk/plugins/Burner/Burner/BurnDataDVD.cs 2010-11-14 12:54:41 UTC (rev 3932) @@ -0,0 +1,586 @@ +#region Copyright (C) 2005-2010 Team MediaPortal + +// Copyright (C) 2005-2010 Team MediaPortal +// http://www.team-mediaportal.com +// +// MediaPortal is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 2 of the License, or +// (at your option) any later version. +// +// MediaPortal is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with MediaPortal. If not, see <http://www.gnu.org/licenses/>. + +#endregion + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using MediaPortal.Configuration; +using MediaPortal.GUI.Library; + +namespace MediaPortal.GUI.GUIBurner +{ + public class BurnDataDVD + { + #region enums + + private enum CopyState + { + FileCopy = 0, + Finished = 1 + } + + private enum DVDBurnStates + { + Step1 = 0, + Step2 = 1, + Finished = 2 + } + + #endregion + + //class variables + + #region Class Variables + + private Process BurnerProcess; // Will run the external processes in another thread + private CopyState _CurrentCopyState; // Current Convert State aka Step + private DVDBurnStates _CurrentBurnState; // Current Burn State aka Step + private string _CurrentProcess = string.Empty; // Current Process Running + private bool _Started = false; // Has the Processing Started + private string _PathtoDvdBurnExe = string.Empty; // Path to the EXE files for Burning + private string _CurrentFileName = string.Empty; // Current Filename being processed + private ArrayList _FileNames; // ArrayList of files to process + private int _FileNameCount = 0; // Track the file in the Array being processed + private string _TempFolderPath = string.Empty; // Path to temp folder used + private string _RecorderDrive = string.Empty; // CD/DVD Drive letter + private bool _InDebugMode = false; // Debug option + private bool _BurnTheDVD = true; // Burn the DVD + private List<string> _FilesToBurn = new List<string>(); // Converted Files ready to Burn + + #endregion + + //events + //in your UI class, listen in on these events to report back to user + + #region Events and Delegates + + public delegate void FileFinishedEventHandler(object sender, FileFinishedEventArgs e); + + public event FileFinishedEventHandler FileFinished; + + public event EventHandler AllFinished; + + public delegate void BurnDVDErrorEventHandler(object sender, BurnDVDErrorEventArgs e); + + public event BurnDVDErrorEventHandler BurnDVDError; + + public delegate void BurnDVDStatusUpdateEventHandler(object sender, BurnDVDStatusUpdateEventArgs e); + + public event BurnDVDStatusUpdateEventHandler BurnDVDStatusUpdate; + + #endregion + + //constructor + + #region Constructors + + ///<summary>BurnDataDVD Class Constructor.</summary> + ///<return>None</return> + ///<param name="FileNames">ArrayList of Filenames to include on the VidoeDVD</param> + ///<param name="PathToTempFolder">Path to the folder to use for creating temporary files</param> + ///<param name="PathToDvdBurnExe">Path to the executable used to write the ISO to the DVD</param> + ///<param name="DebugMode">Debug Mode includes more logging and does not delete the temporary files created</param> + ///<param name="RecorderDrive">The drive letter of the Recorder</param> + ///<param name="DummyBurn">Do everything except the burn. Used for debugging</param> + public BurnDataDVD(ArrayList FileNames, string PathToTempFolder, string PathtoDVDBurnExe, bool DebugMode, + string RecorderDrive, bool DummyBurn) + { + _InDebugMode = DebugMode; + + // Override burn setting if in debug mode + if (DummyBurn) + { + _BurnTheDVD = false; + } + + pBurnDataDVD(FileNames, PathToTempFolder, PathtoDVDBurnExe, RecorderDrive); + } + + ///<summary>Private Initialization method called by the Constructors.</summary> + private void pBurnDataDVD(ArrayList FileNames, string PathToTempFolder, string PathtoDVDBurnExe, + string RecorderDrive) + { + _FileNames = FileNames; + _FileNameCount = 0; + _PathtoDvdBurnExe = PathtoDVDBurnExe; + _Started = false; + _TempFolderPath = PathToTempFolder; + _RecorderDrive = RecorderDrive; + + if (_TempFolderPath.EndsWith(@"\\") || _TempFolderPath.EndsWith("//")) + { + _TempFolderPath = _TempFolderPath.Substring(0, (_TempFolderPath.Length - 2)); + } + else if (_TempFolderPath.EndsWith(@"\") || _TempFolderPath.EndsWith("/")) + { + _TempFolderPath = _TempFolderPath.Substring(0, (_TempFolderPath.Length - 1)); + } + + // Make the DVD dir. Gets deleted straight away, but saves an exception + Directory.CreateDirectory(_TempFolderPath); + + // Delete the temp DVD dir and any contents from any previous DVD creation. + Directory.Delete(_TempFolderPath, true); + + // Make the DVD dir that we just deleted above + Directory.CreateDirectory(_TempFolderPath); + + Directory.CreateDirectory(_TempFolderPath + "/DVD_Image"); + + LogWrite("BurnDataDVDInit", "TempFolderPath: " + _TempFolderPath); + LogWrite("BurnDataDVDInit", "Debug Mode: " + _InDebugMode.ToString()); + } + + #endregion + + #region Getters and Setters + + ///<summary>Called to Start the DataDVD File Conversion and Burning.</summary> + ///<return>True if File Conversion and Burning has Started.</return> + ///<return>False if File Conversion and Burning has not Started.</return> + public bool Started + { + get { return _Started; } + } + + #endregion + + ///<summary>Called to Start the DataDVD File Conversion and Burning.</summary> + ///<return>True is Start successful.</return> + ///<return>False if already Started.</return> + public bool Start() + { + if (_Started == false) + { + ProvideStatusUpdate("Starting Data DVD Burning"); + _Started = true; + + NextFileCopy(); + return true; + } + else + { + return false; + } + } + + ///<summary>Called to do the File Copy for each file in the ArrayList of files to process + /// and resets the Current Copy State to Step 1 + ///</summary> + private void NextFileCopy() + { + _FileNameCount++; + + if (_FileNameCount <= _FileNames.Count) + { + //get next filename and reset the state + _CurrentFileName = (string)_FileNames[_FileNameCount - 1]; + _CurrentCopyState = CopyState.FileCopy; + + ProvideStatusUpdate("Copying " + _CurrentFileName); + + //start again + NextStep_FileCopy(); + } + else + { + //all finished with conversions. So Start the burning steps. + ProvideStatusUpdate("Starting Data DVD Burning Steps"); + BurnPrep(); + } + } + + ///<summary>Called to start the DVD Burning Prep for DVD Creation. + ///</summary> + private void BurnPrep() + { + if (_FilesToBurn.Count > 0) // Make sure we have files to burn + { + // Reset the Burn State + ProvideStatusUpdate("Data DVD Burn Preperation for " + _FilesToBurn.Count.ToString() + " Data files."); + _CurrentBurnState = DVDBurnStates.Step1; + NextStep_DVDCreation(); + } + else + { + //All finished with Burning send the AllFinished event to all listeners + CleanUp(); + if (AllFinished != null) + { + AllFinished(this, new EventArgs()); + } + } + } + + #region DVD Burn Steps + + ///<summary>Generate the DVD ISO File</summary> + private void ISOFileCreation() + { + // Make the ISO of the DVD dir that contains the Data_TS and AUDIO_TS dirs + // mkisofs -V "MyDVDName" -o mydvd.iso DirToMakeIsoOf + + try + { + _CurrentProcess = "DVD ISO Creation - mkisofs.exe"; + LogWrite("Entered ISOFileCreation", ""); + + ProvideStatusUpdate("Generating ISO image of DVD filesystem"); + + BurnerProcess = new Process(); + BurnerProcess.EnableRaisingEvents = true; + BurnerProcess.StartInfo.WorkingDirectory = Config.GetFolder(Config.Dir.BurnerSupport); + BurnerProcess.StartInfo.UseShellExecute = false; + + if (!_InDebugMode) // Show output if in Debug mode + { + BurnerProcess.StartInfo.RedirectStandardOutput = true; + BurnerProcess.StartInfo.CreateNoWindow = true; + } + + string discName = string.Format("\"MP-DVD-{0}\"", DateTime.Now.ToShortDateString()); + string imgFolder = Path.Combine(_TempFolderPath, "DVD_Image"); + string isofile = Path.Combine(_TempFolderPath, "dvd.iso"); + + BurnerProcess.StartInfo.FileName = Config.GetFile(Config.Dir.BurnerSupport, "mkisofs.exe"); + string args = "-V " + discName + " -l -allow-lowercase -o \"" + isofile + "\" \"" + imgFolder + "\""; + BurnerProcess.StartInfo.Arguments = args; + + BurnerProcess.Exited += new EventHandler(BurnProcess_Exited); + BurnerProcess.OutputDataReceived += new DataReceivedEventHandler(MakeISOOutputDataReceivedHandler); + + LogWrite("Starting ISOFileCreation", "Args: " + args); + BurnerProcess.Start(); + + if (!BurnerProcess.HasExited) + { + BurnerProcess.PriorityClass = ProcessPriorityClass.BelowNormal; + BurnerProcess.BeginOutputReadLine(); + } + } + catch (Exception ex) + { + Log.Error(ex.ToString()); + } + } + + + ///<summary>Burn the DVD to a Disc</summary> + private void WriteDVD() + { + try + { + _CurrentProcess = "Burning the DVD - dvdburn.exe"; + + LogWrite("Entered WriteDVD", "BurnOption: " + _BurnTheDVD.ToString()); + + if (_BurnTheDVD == true) + { + ProvideStatusUpdate("Burning ISO image to DVD"); + + BurnerProcess = new Process(); + BurnerProcess.EnableRaisingEvents = true; + BurnerProcess.StartInfo.WorkingDirectory = _TempFolderPath; + BurnerProcess.StartInfo.UseShellExecute = false; + + if (!_InDebugMode) // Show output if in Debug mode + { + BurnerProcess.StartInfo.RedirectStandardOutput = true; + BurnerProcess.StartInfo.CreateNoWindow = true; + } + + //BurnerProcess.StartInfo.FileName = Path.Combine(_PathtoDvdBurnExe, "dvdburn.exe"); + BurnerProcess.StartInfo.FileName = Path.Combine(_PathtoDvdBurnExe, "dvdburn.exe"); + + //string isofile = Path.Combine(_TempFolderPath, "dvd.iso"); + + string args = _RecorderDrive + " " + Path.Combine(_TempFolderPath, "dvd.iso"); + ; + + BurnerProcess.StartInfo.Arguments = args; + + BurnerProcess.Exited += new EventHandler(BurnProcess_Exited); + // BurnerProcess.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler(processOutputHandler); + + LogWrite("Starting DVDBurn", "Args: " + args); + BurnerProcess.Start(); + + if (!BurnerProcess.HasExited) + { + BurnerProcess.PriorityClass = ProcessPriorityClass.BelowNormal; + // BurnerProcess.BeginOutputReadLine(); + } + } + else + { + _CurrentProcess = "DVD Burning is Disabled"; + BurnProcess_Exited(this, new EventArgs()); + } + } + catch (Exception ex) + { + Log.Error(ex.ToString()); + } + } + + #endregion + + ///<summary>Called for each Step in the DVD Creation after the File Copy(ing). </summary> + private void NextStep_DVDCreation() + { + LogWrite("NextStep_DVDCreation", "CurrentState: " + _CurrentBurnState.ToString()); + switch (_CurrentBurnState) + { + case DVDBurnStates.Step1: // ISO File Creation + ISOFileCreation(); + break; + + case DVDBurnStates.Step2: // Write DVD + WriteDVD(); + break; + + case DVDBurnStates.Finished: // Finished + //converting process completed, raise event + _Started = false; + + CleanUp(); + + ProvideStatusUpdate("Completed Data DVD Burning"); + + if (AllFinished != null) + { + AllFinished(this, new EventArgs()); + } + break; + } + } + + ///<summary>Called for each File Stepping through the File Conversion(s).</summary> + private void NextStep_FileCopy() + { + LogWrite("NextStep_FileCopy", + "CurrentState: " + _CurrentCopyState.ToString() + " CurrentFile: " + _CurrentFileName); + + switch (_CurrentCopyState) + { + #region Convert input file to a the DVD temp folder + + case CopyState.FileCopy: + { + string strFileName = Path.GetFileName(_CurrentFileName); + ProvideStatusUpdate("Copying \"" + strFileName); + + + string DestinationFilePath = Path.GetFileName(_CurrentFileName); + DestinationFilePath = Path.Combine(_TempFolderPath + "/DVD_Image", DestinationFilePath); + + + string SourceFilePath = _CurrentFileName; + + // Set the current filename to the new output file + _CurrentFileName = DestinationFilePath; // Ready for next file?? + + _CurrentProcess = "Data file copy"; + + FileInfo fi = new FileInfo(_TempFolderPath + "/Copy.bat"); + using (StreamWriter sw = fi.CreateText()) + { + string CopyLine = "copy /Y \"" + SourceFilePath + "\" \"" + DestinationFilePath + "\" "; + sw.WriteLine(CopyLine); + sw.Close(); + } + + try + { + BurnerProcess = new Process(); + BurnerProcess.EnableRaisingEvents = true; + // Gets or sets whether the Exited event should be raised when the process terminates. + BurnerProcess.StartInfo.WorkingDirectory = Config.GetFolder(Config.Dir.BurnerSupport); + BurnerProcess.StartInfo.UseShellExecute = false; + + if (!_InDebugMode) // Show output if in Debug mode + { + BurnerProcess.StartInfo.RedirectStandardOutput = true; + BurnerProcess.StartInfo.CreateNoWindow = true; + } + BurnerProcess.StartInfo.FileName = fi.FullName; + + BurnerProcess.Exited += new EventHandler(FileCopyProcess_Exited); + + LogWrite("Starting File Copy", "Starting File Copy"); + + BurnerProcess.Start(); + +/* if (!BurnerProcess.HasExited) + { + //BurnerProcess.PriorityClass = System.Diagnostics.ProcessPriorityClass.BelowNormal; + BurnerProcess.BeginOutputReadLine(); + } + */ + } + catch (Exception ex) + { + Log.Error(ex.ToString()); + } + } + break; + + #endregion + + #region Finished File Copy Step Start Next File + + case CopyState.Finished: // Finished one file Start Next + + ProvideStatusUpdate("Completed File Copy For: " + (string)_FileNames[_FileNameCount - 1]); + + if (FileFinished != null) + { + FileFinished(this, new FileFinishedEventArgs((string)_FileNames[_FileNameCount - 1], _CurrentFileName)); + } + _FilesToBurn.Add(_CurrentFileName); + NextFileCopy(); + + break; + + #endregion + } + } + + #region Events etc. + + ///<summary>Called to provide status updates to any BurnDataDVDStatusUpdate event listeners</summary> + private void ProvideStatusUpdate(string status) + { + if (_InDebugMode) + { + Log.Debug("ProvideStatusUpdate: {0}", status.ToString()); + } + + if (BurnDVDStatusUpdate != null) + { + BurnDVDStatusUpdateEventArgs be = new BurnDVDStatusUpdateEventArgs(status); + //announce to anyone who is listening + BurnDVDStatusUpdate(this, be); + } + } + + + ///<summary>Called when each Conversion Process Step has completed + ///to move to the next step.</summary> + private void FileCopyProcess_Exited(object sender, EventArgs e) + { + //LogWrite("Convert Data Step Exited: ", _CurrentCopyState.ToString()); + ProvideStatusUpdate("Convert Process Exited: " + _CurrentProcess); + + //one process has finished, start next process + _CurrentCopyState += 1; + NextStep_FileCopy(); + } + + ///<summary>Called when each Burn Process Step has completed. + ///Also announces the CompletedStep event to any listeners</summary> + private void BurnProcess_Exited(object sender, EventArgs e) + { + LogWrite("Burn DVD Step Exited: Step: ", _CurrentBurnState.ToString()); + ProvideStatusUpdate("DVD Burn Process Exited: " + _CurrentProcess); + + //one process has finished, start next process + _CurrentBurnState += 1; + NextStep_DVDCreation(); + } + + + private void MakeISOOutputDataReceivedHandler(object sender, DataReceivedEventArgs e) + { + // Debugger.Launch(); + // Debugger.Break(); + + /* string sout = "Redirected StandardOutput IsEmpty"; + + if (!String.IsNullOrEmpty(e.Data)) + sout = e.Data.ToString(); + + //Pos: 76.5s 1835f (99%) 34.31fps Trem: 0min 35mb A-V:0.017 [3646:191] + + string Percentage = ""; + string TimeLeft = ""; + + + if (sout.StartsWith("Pos") == true) + { + Percentage = sout.Substring(sout.IndexOf('(') + 1, 2); + TimeLeft = sout.Substring(sout.IndexOf("Trem:") + 5, 4); + + byte Temp = Convert.ToByte(Percentage); + if (Temp % 5 == 0) + ProvideStatusUpdate(Percentage + "% done. Time Left = " + TimeLeft.ToString() + " min"); + } + + // if (OutputReceived != null) + // { + // OutputReceived(this, e); + // } + */ + } + + + private void ProcessingError(string ErrorTitle, string ErrorText) + { + Log.Error("Processing Error: {0} - {1}", ErrorTitle, ErrorText); + ProvideStatusUpdate("Processing Error: " + ErrorTitle + ": " + ErrorText); + if (BurnDVDError != null) + { + BurnDVDErrorEventArgs be = new BurnDVDErrorEventArgs(ErrorTitle, ErrorText); + BurnDVDError(this, be); + } + } + + #endregion + + #region LogWriting + + ///<summary>Called to Write to the MediaPortal.Log file</summary> + ///<param name="EntryTitle">Log Entry Title Text.</param> + ///<param name="EntryText">Log entry Main Text.</param> + private void LogWrite(string EntryTitle, string EntryText) + { + Log.Info("My Burner Plugin->BurnDataDVD Class: {0} - {1}", EntryTitle, EntryText); + } + + #endregion + + ///<summary>Simple Cleanup that deletes the temp files and directory</summary> + private void CleanUp() + { + ProvideStatusUpdate("Performing Cleanup of Temporary Files"); + if (!_InDebugMode) + { + // Delete the temp DVD dir and any contents from any previous DVD creation. + Directory.Delete(_TempFolderPath, true); + } + else + { + ProvideStatusUpdate("Temporary Files Not Deleted: In Debug Mode"); + } + } + } +} \ No newline at end of file Added: trunk/plugins/Burner/Burner/BurnVideoDVD.cs =================================================================== --- trunk/plugins/Burner/Burner/BurnVideoDVD.cs (rev 0) +++ trunk/plugins/Burner/Burner/BurnVideoDVD.cs 2010-11-14 12:54:41 UTC (rev 3932) @@ -0,0 +1,900 @@ +#region Copyright (C) 2005-2010 Team MediaPortal + +// Copyright (C) 2005-2010 Team MediaPortal +// http://www.team-mediaportal.com +// +// MediaPortal is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 2 of the License, or +// (at your option) any later version. +// +// MediaPortal is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with MediaPortal. If not, see <http://www.gnu.org/licenses/>. + +#endregion + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Windows.Forms; +using MediaPortal.Configuration; +using MediaPortal.GUI.Library; + +namespace MediaPortal.GUI.GUIBurner +{ + public class BurnVideoDVD + { + #region enums + + private enum ConvertState + { + VideoConversion = 0, + Finished = 1 + } + + private enum DVDBurnStates + { + Step1 = 0, + Step2 = 1, + Step3 = 2, + Step4 = 3, + Step5 = 4, + Finished = 5 + } + + #endregion + + //class variables + + #region Class Variables + + private Process BurnerProcess; // Will run the external processes in another thread + private ConvertState _CurrentConvertState; // Current Convert State aka Step + private DVDBurnStates _CurrentBurnState; // Current Burn State aka Step + private string _CurrentProcess = string.Empty; // Current Process Running + private bool _Started = false; // Has the Processing Started + private string _PathtoDvdBurnExe = string.Empty; // Path to the EXE files for Burning + private string _CurrentFileName = string.Empty; // Current Filename being processed + private ArrayList _FileNames; // ArrayList of files to process + private int _FileNameCount = 0; // Track the file in the Array being processed + private string _TempFolderPath = string.Empty; // Path to temp folder used + private string _RecorderDrive = string.Empty; // CD/DVD Drive letter + private bool _InDebugMode = false; // Debug option + private bool _BurnTheDVD = true; // Burn the DVD + private List<string> _FilesToBurn = new List<string>(); // Converted Files ready to Burn + private string _TvFormat = string.Empty; // "PAL" or "NTSC" + private string _AspectRatio = string.Empty; // "4/3" or "16/9" + + #endregion + + //events + //in your UI class, listen in on these events to report back to user + + #region Events and Delegates + + public delegate void FileFinishedEventHandler(object sender, FileFinishedEventArgs e); + + public event FileFinishedEventHandler FileFinished; + + public event EventHandler AllFinished; + + //public event System.Diagnostics.DataReceivedEventHandler OutputReceived; + + public delegate void BurnDVDErrorEventHandler(object sender, BurnDVDErrorEventArgs e); + + public event BurnDVDErrorEventHandler BurnDVDError; + + public delegate void BurnDVDStatusUpdateEventHandler(object sender, BurnDVDStatusUpdateEventArgs e); + + public event BurnDVDStatusUpdateEventHandler BurnDVDStatusUpdate; + + #endregion + + //constructor + + #region Constructors + + ///<summary>BurnVideoDVD Class Constructor.</summary> + ///<return>None</return> + ///<param name="FileNames">ArrayList of Filenames to include on the VidoeDVD</param> + ///<param name="PathToTempFolder">Path to the folder to use for creating temporary files</param> + ///<param name="TVFormat">"NTSC" or "PAL" format for the VideoDVD</param> + ///<param name="AspectRatio">Aspect ratio - either "4/3" or "16/9"</param> + ///<param name="PathToDvdBurnExe">Path to the executable used to write the ISO to the DVD</param> + ///<param name="DebugMode">Debug Mode includes more logging and does not delete the temporary files created</param> + ///<param name="RecorderDrive">The drive letter of the Recorder</param> + ///<param name="DummyBurn">Do everything except the burn. Used for debugging</param> + public BurnVideoDVD(ArrayList FileNames, string PathToTempFolder, string TVFormat, string AspectRatio, + string PathtoDVDBurnExe, bool DebugMode, string RecorderDrive, bool DummyBurn) + { + _InDebugMode = DebugMode; + + // Override burn setting if in debug mode + if (DummyBurn) + { + _BurnTheDVD = false; + } + + pBurnVideoDVD(FileNames, PathToTempFolder, TVFormat, AspectRatio, PathtoDVDBurnExe, RecorderDrive); + } + + ///<summary>Private Initialization method called by the Constructors.</summary> + private void pBurnVideoDVD(ArrayList FileNames, string PathToTempFolder, string TVFormat, string AspectRatio, + string PathtoDVDBurnExe, string RecorderDrive) + { + _FileNames = FileNames; + _FileNameCount = 0; + _TvFormat = TVFormat; + _AspectRatio = AspectRatio; + _PathtoDvdBurnExe = PathtoDVDBurnExe; + _Started = false; + _TempFolderPath = PathToTempFolder; + _RecorderDrive = RecorderDrive; + + if (_TempFolderPath.EndsWith(@"\\") || _TempFolderPath.EndsWith("//")) + { + _TempFolderPath = _TempFolderPath.Substring(0, (_TempFolderPath.Length - 2)); + } + else if (_TempFolderPath.EndsWith(@"\") || _TempFolderPath.EndsWith("/")) + { + _TempFolderPath = _TempFolderPath.Substring(0, (_TempFolderPath.Length - 1)); + } + + // Make the DVD dir. Gets deleted straight away, but saves an exception + Directory.CreateDirectory(_TempFolderPath); + + // Delete the temp DVD dir and any contents from any previous DVD creation. + Directory.Delete(_TempFolderPath, true); + + // Make the DVD dir that we just deleted above + Directory.CreateDirectory(_TempFolderPath); + + Log.Debug("BurnVideoDVDInit", "TempFolderPath: " + _TempFolderPath); + Log.Debug("BurnVideoDVDInit", "Debug Mode: " + _InDebugMode.ToString()); + } + + #endregion + + #region Getters and Setters + + ///<summary>Called to Start the VideoDVD File Conversion and Burning.</summary> + ///<return>True if File Conversion and Burning has Started.</return> + ///<return>False if File Conversion and Burning has not Started.</return> + public bool Started + { + get { return _Started; } + } + + #endregion + + ///<summary>Called to Start the VideoDVD File Conversion and Burning.</summary> + ///<return>True is Start successful.</return> + ///<return>False if already Started.</return> + public bool Start() + { + if (_Started == false) + { + ProvideStatusUpdate("Starting Video DVD File Conversion and Burning"); + _Started = true; + + NextFileNameConversion(); + return true; + } + else + { + return false; + } + } + + ///<summary>Called to do the File Conversion for each file in the ArrayList of files to process + /// and resets the Current Convert State to Step 1 + ///</summary> + private void NextFileNameConversion() + { + _FileNameCount++; + + if (_FileNameCount <= _FileNames.Count) + { + //get next filename and reset the state + _CurrentFileName = (string)_FileNames[_FileNameCount - 1]; + _CurrentConvertState = ConvertState.VideoConversion; + + ProvideStatusUpdate("Processing " + _CurrentFileName); + + //start again + NextStep_FileConversion(); + } + else + { + //all finished with conversions. So Start the burning steps. + ProvideStatusUpdate("Starting Video DVD Burning Steps"); + BurnPrep(); + } + } + + ///<summary>Called to start the DVD Burning Prep for DVD Creation. + ///</summary> + private void BurnPrep() + { + if (_FilesToBurn.Count > 0) // Make sure we have files to burn + { + // Reset the Burn State + ProvideStatusUpdate("Video DVD Burn Preperation for " + _FilesToBurn.Count.ToString() + " Video files."); + _CurrentBurnState = DVDBurnStates.Step1; + NextStep_DVDCreation(); + } + else + { + //All finished with Burning send the AllFinished event to all listeners + CleanUp(); + if (AllFinished != null) + { + AllFinished(this, new EventArgs()); + } + } + } + + #region DVD Burn Steps + + ///<summary>Called to Generate the DVD Menu</summary> + private void MenuGeneration() + { + try + { + _CurrentProcess = "Generating DVD Menu - menuGen.exe"; + Log.Debug("Entered MenuGeneration Process", ""); + + ProvideStatusUpdate("Creating DVD Menus"); + + #region Generate the Menu File + + using (StreamWriter SW_MenuGen = File.CreateText(Path.Combine(_TempFolderPath, "menuGen.gen"))) + { + + + + string strTemp = Path.GetDirectoryName(Application.ExecutablePath); + strTemp = Path.Combine(strTemp, GUIGraphicsContext.Skin); + strTemp = "Theme Folder =" + Path.Combine(strTemp, "media"); + + SW_MenuGen.WriteLine(strTemp); + SW_MenuGen.WriteLine(@"Work Folder =" + _TempFolderPath); + SW_MenuGen.WriteLine(@"Graphics Magick =" + Config.GetFile(Config.Dir.BurnerSupport, "gm.exe")); + SW_MenuGen.WriteLine(@"Mplex =" + Config.GetFile(Config.Dir.BurnerSupport, "mplex.exe")); + SW_MenuGen.WriteLine(@"jpeg2yuv =" + Config.GetFile(Config.Dir.BurnerSupport, "png2yuv.exe")); + SW_MenuGen.WriteLine(@"mpeg2enc =" + Config.GetFile(Config.Dir.BurnerSupport, "mpeg2enc.exe")); + SW_MenuGen.WriteLine(@"spumux =" + Config.GetFile(Config.Dir.BurnerSupport, "spumux.exe")); + SW_MenuGen.WriteLine(@"AC3 audio =" + Config.GetFile(Config.Dir.BurnerSupport, "Silence.ac3")); + SW_MenuGen.WriteLine(@"Button Image =" + Config.GetFile(Config.Dir.BurnerSupport, "navButton.png")); + SW_MenuGen.WriteLine(@"DVD Format (PAL or NTSC)=" + _TvFormat.ToUpper()); + + if (_InDebugMode) + { + strTemp = "1"; + } + else + { + strTemp = "0"; + } + + SW_MenuGen.WriteLine(@"Leave files for debugging (0 is false, 1 is true)=" + strTemp); + + int NumberOfFiles = _FilesToBurn.Count; + + for (int i = 0; i < NumberOfFiles; i++) + { + strTemp = "-------------------------Video " + i.ToString() + " -------------------------"; + SW_MenuGen.WriteLine(strTemp); + + strTemp = Path.GetFileName(_FilesToBurn[i]); + string strVideoName = Path.GetFileNameWithoutExtension(strTemp); + strTemp = "Video " + i.ToString() + @" Show Title= " + strVideoName; + SW_MenuGen.WriteLine(strTemp); + + // This will come from the TV/DVD database when it gets integrated into the context menu + //strTemp = "Video " + i.ToString() + @" Episode Title= Live Together, Die Alone"; + strTemp = "Video " + i.ToString() + @" Episode Title="; + SW_MenuGen.WriteLine(strTemp); + + // This will come from the TV/DVD database when it gets integrated into the context menu + //strTemp = "Video " + i.ToString() + @" Description= After discovering something odd just offshore, Jack and Sayid come up with a plan to 'confront'"; + strTemp = "Video " + i.ToString() + @" Description="; + SW_MenuGen.WriteLine(strTemp); + + // Commented until I can work out how to take a thumbnail of the video + // strTemp = "Video " + i.ToString() + @" Thumbnail=C:\temp\DVD\thumbnail.jpg"; + strTemp = "Video " + i.ToString() + @" Thumbnail="; + SW_MenuGen.WriteLine(strTemp); + } + + SW_MenuGen.Close(); + } + + #endregion + + Log.Info("Finished MenuGeneration", "Copying MenuGen Executable"); + + + // Copy menugen to strTempFolder. + // Needs to be in same dir as the menuGen.gen file we just made above + string SourceFile = Config.GetFile(Config.Dir.BurnerSupport, "menuGen.exe"); + string DestFile = Path.Combine(_TempFolderPath, "menuGen.exe"); + File.Copy(SourceFile, DestFile); + + Log.Debug("Finished MenuGen Executable Copy", "Starting MenuGen Execution"); + + #region MenuGen execution + + // Create the DVD menu files + BurnerProcess = new Process(); + BurnerProcess.EnableRaisingEvents = true; + BurnerProcess.StartInfo.WorkingDirectory = _TempFolderPath; + BurnerProcess.StartInfo.UseShellExecute = false; + + if (!_InDebugMode) // Show output if in Debug mode + { + BurnerProcess.StartInfo.RedirectStandardOutput = true; + BurnerProcess.StartInfo.CreateNoWindow = true; + } + + BurnerProcess.StartInfo.FileName = DestFile; + BurnerProcess.StartInfo.Arguments = ""; + + BurnerProcess.Exited += new EventHandler(BurnProcess_Exited); + // BurnerProcess.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler(processOutputHandler); + + BurnerProcess.Start(); + + if (!BurnerProcess.HasExited) + { + BurnerProcess.PriorityClass = ProcessPriorityClass.BelowNormal; + // BurnerProcess.BeginOutputReadLine(); + } + + #endregion + } + catch (Exception ex) + { + Log.Error(ex.ToString()); + } + } + + ///<summary>Generate the DVD Creation Configuration XML File</summary> + private void ConfigXMLCreation() + { + try + { + _CurrentProcess = "Config.xml Writer"; + Log.Debug("Starting ConfigXMLCreation", ""); + + ProvideStatusUpdate("Creating Config file for DVD Generation program"); + + // Now we create the Config.xml file for DvdAuthor.exe + + using (StreamWriter SW_ConfigFile = File.CreateText(Path.Combine(_TempFolderPath, "Config.xml"))) + { + string strTemp; + + SW_ConfigFile.WriteLine("<?xml version=\"1.0\" encoding=\"utf-8\"?>"); + SW_ConfigFile.WriteLine("<dvdauthor>"); + SW_ConfigFile.WriteLine(" <vmgm>"); + SW_ConfigFile.WriteLine(" <menus>"); + SW_ConfigFile.WriteLine(" <video format=\"" + _TvFormat + "\" />"); + SW_ConfigFile.WriteLine(" <pgc>"); + + int NumberOfFiles = _FilesToBurn.Count; + + for (int i = 0; i < NumberOfFiles; i++) + { + strTemp = " <button> jump titleset " + (i + 1).ToString() + " menu; </button>"; + SW_ConfigFile.WriteLine(strTemp); + } + + string mBkgdPath = Path.Combine(_TempFolderPath, "menuBackground.menu.mpg"); + SW_ConfigFile.WriteLine(" <vob file=\"" + mBkgdPath + "\" pause=\"5\"/>"); + SW_ConfigFile.WriteLine(" </pgc>"); + SW_ConfigFile.WriteLine(" </menus>"); + SW_ConfigFile.WriteLine(" </vmgm>"); + + for (int i = 0; i < NumberOfFiles; i++) + { + string smBkgd = "subMenuBackground." + i.ToString() + ".menu.mpg"; + smBkgd = Path.Combine(_TempFolderPath, smBkgd); + + SW_ConfigFile.WriteLine(" <titleset>"); + SW_ConfigFile.WriteLine(" <menus>"); + SW_ConfigFile.WriteLine(" <video format=\"" + _TvFormat + "\" />"); + SW_ConfigFile.WriteLine(" <pgc>"); + SW_ConfigFile.WriteLine(" <button> jump title 1; </button>"); + SW_ConfigFile.WriteLine(" <button> jump vmgm menu; </button>"); + strTemp = " <vob file=\"" + smBkgd + "\" pause=\"5\"/>"; + SW_ConfigFile.WriteLine(strTemp); + SW_ConfigFile.WriteLine(" </pgc>"); + SW_ConfigFile.WriteLine(" </menus>"); + + SW_ConfigFile.WriteLine(" <titles>"); + SW_ConfigFile.WriteLine(" <video format=\"" + _TvFormat + "\" />"); + SW_ConfigFile.WriteLine(" <pgc>"); + strTemp = " <vob file=\"" + _FilesToBurn[i] + + "\" chapters=\"15:00,30:00,45:00,1:00:00,1:15:00,1:30:00,1:45:00,2:00:00,2:15:00,2:30:00,2:45:00,3:00:00\" />"; + SW_ConfigFile.WriteLine(strTemp); + SW_ConfigFile.WriteLine(" <post>call vmgm menu;</post>"); + SW_ConfigFile.WriteLine(" </pgc>"); + SW_ConfigFile.WriteLine(" </titles>"); + SW_ConfigFile.WriteLine(" </titleset>"); + } + + SW_ConfigFile.WriteLine("</dvdauthor>"); + SW_ConfigFile.Close(); + + // No Actual external app running to Exit so + // we just call BurnProcess_Exited + EventArgs e = new EventArgs(); + BurnProcess_Exited(this, e); + } + Log.Info("Finished Config XML Creation", ""); + } + catch (Exception ex) + { + Log.Error(ex.ToString()); + } + } + + ///<summary>Generate the DVD Image File</summary> + private void DVDFilesCreation() + { + try + { + _CurrentProcess = "DVD Image Creation - dvdauthor.exe"; + Log.Debug("Entered DVDFilesCreation", ""); + + ProvideStatusUpdate("Creating DVD filesystem"); + + BurnerProcess = new Process(); + BurnerProcess.EnableRaisingEvents = true; + BurnerProcess.StartInfo.WorkingDirectory = _TempFolderPath; + BurnerProcess.StartInfo.UseShellExecute = false; + if (!_InDebugMode) // Show output if in Debug mode + { + BurnerProcess.StartInfo.RedirectStandardOutput = true; + BurnerProcess.StartInfo.CreateNoWindow = true; + } + + string imgFolder = Path.Combine(_TempFolderPath, "DVD_Image"); + string cfgfile = Path.Combine(_TempFolderPath, "Config.xml"); + + if (!Directory.Exists(imgFolder)) + { + Directory.CreateDirectory(imgFolder); + } + + BurnerProcess.StartInfo.FileName = Config.GetFile(Config.Dir.BurnerSupport, "dvdauthor.exe"); + string args = "-o \"" + imgFolder + "\" -x \"" + cfgfile + "\""; + BurnerProcess.StartInfo.Arguments = args; + + BurnerProcess.Exited += new EventHandler(BurnProcess_Exited); + // BurnerProcess.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler(processOutputHandler); + + Log.Info("Starting DVDFilesCreation Process", "Args: " + args); + BurnerProcess.Start(); + + if (!BurnerProcess.HasExited) + { + BurnerProcess.PriorityClass = ProcessPriorityClass.BelowNormal; + // BurnerProcess.BeginOutputReadLine(); + } + } + catch (Exception ex) + { + Log.Error(ex.ToString()); + } + } + + ///<summary>Generate the DVD ISO File</summary> + private void ISOFileCreation() + { + // Make the ISO of the DVD dir that contains the VIDEO_TS and AUDIO_TS dirs + // mkisofs -V "MyDVDName" -o mydvd.iso -dvd-video DirToMakeIsoOf + + try + { + _CurrentProcess = "DVD ISO Creation - mkisofs.exe"; + Log.Debug("Entered ISOFileCreation", ""); + + ProvideStatusUpdate("Generating ISO image of DVD filesystem"); + + BurnerProcess = new Process(); + BurnerProcess.EnableRaisingEvents = true; + BurnerProcess.StartInfo.WorkingDirectory = Config.GetFolder(Config.Dir.BurnerSupport); + BurnerProcess.StartInfo.UseShellExecute = false; + + if (!_InDebugMode) // Show output if in Debug mode + { + BurnerProcess.StartInfo.RedirectStandardOutput = true; + BurnerProcess.StartInfo.CreateNoWindow = true; + } + + string discName = string.Format("\"MP-DVD-{0}\"", DateTime.Now.ToShortDateString()); + string imgFolder = Path.Combine(_TempFolderPath, "DVD_Image"); + string isofile = Path.Combine(_TempFolderPath, "dvd.iso"); + + BurnerProcess.StartInfo.FileName = Config.GetFile(Config.Dir.BurnerSupport, "mkisofs.exe"); + string args = "-V " + discName + " -o \"" + isofile + "\" -dvd-video \"" + imgFolder + "\""; + BurnerProcess.StartInfo.Arguments = args; + + BurnerProcess.Exited += new EventHandler(BurnProcess_Exited); + BurnerProcess.OutputDataReceived += new DataReceivedEventHandler(MakeISOOutputDataReceivedHandler); + + Log.Info("Starting ISOFileCreation", "Args: " + args); + BurnerProcess.Start(); + + if (!BurnerProcess.HasExited) + { + BurnerProcess.PriorityClass = ProcessPriorityClass.BelowNormal; + BurnerProcess.BeginOutputReadLine(); + } + } + catch (Exception ex) + { + Log.Error(ex.ToString()); + } + } + + + ///<summary>Burn the DVD to a Disc</summary> + private void WriteDVD() + { + try + { + _CurrentProcess = "Burning the DVD - dvdburn.exe"; + + Log.Debug("Entered WriteDVD", "BurnOption: " + _BurnTheDVD.ToString()); + + if (_BurnTheDVD == true) + { + ProvideStatusUpdate("Burning ISO image to DVD"); + + BurnerProcess = new Process(); + BurnerProcess.EnableRaisingEvents = true; + BurnerProcess.StartInfo.WorkingDirectory = _TempFolderPath; + BurnerProcess.StartInfo.UseShellExecute = false; + + if (!_InDebugMode) // Show output if in Debug mode + { + BurnerProcess.StartInfo.RedirectStandardOutput = true; + BurnerProcess.StartInfo.CreateNoWindow = true; + } + + //BurnerProcess.StartInfo.FileName = Path.Combine(_PathtoDvdBurnExe, "dvdburn.exe"); + BurnerProcess.StartInfo.FileName = Path.Combine(_PathtoDvdBurnExe, "dvdburn.exe"); + + //string isofile = Path.Combine(_TempFolderPath, "dvd.iso"); + + string args = _RecorderDrive + " " + Path.Combine(_TempFolderPath, "dvd.iso"); + ; + + BurnerProcess.StartInfo.Arguments = args; + + BurnerProcess.Exited += new EventHandler(BurnProcess_Exited); + // BurnerProcess.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler(processOutputHandler); + + Log.Info("Starting DVDBurn", "Args: " + args); + BurnerProcess.Start(); + + if (!BurnerProcess.HasExited) + { + BurnerProcess.PriorityClass = ProcessPriorityClass.BelowNormal; + // BurnerProcess.BeginOutputReadLine(); + } + } + else + { + _CurrentProcess = "DVD Burning is Disabled"; + BurnProcess_Exited(this, new EventArgs()); + } + } + catch (Exception ex) + { + Log.Error(ex.ToString()); + } + } + + #endregion + + ///<summary>Called for each Step in the DVD Creation after the File Conversion(s). </summary> + private void NextStep_DVDCreation() + { + Log.Debug("NextStep_DVDCreation", "CurrentState: " + _CurrentBurnState.ToString()); + switch (_CurrentBurnState) + { + case DVDBurnStates.Step1: // Menu Generation + MenuGeneration(); + break; + + case DVDBurnStates.Step2: // XML Config File Creation + ConfigXMLCreation(); + break; + + case DVDBurnStates.Step3: // DVD Files Creation + DVDFilesCreation(); + break; + + case DVDBurnStates.Step4: // ISO File Creation + ISOFileCreation(); + break; + + case DVDBurnStates.Step5: // Write DVD + WriteDVD(); + break; + + case DVDBurnStates.Finished: // Finished + //converting process completed, raise event + _Started = false; + + CleanUp(); + + ProvideStatusUpdate("Completed Video DVD Burning"); + + if (AllFinished != null) + { + AllFinished(this, new EventArgs()); + } + break; + } + } + + ///<summary>Called for each File Stepping through the File Conversion(s).</summary> + private void NextStep_FileConversion() + { + Log.Debug("NextStep_FileConversion", + "CurrentState: " + _CurrentConvertState.ToString() + " CurrentFile: " + _CurrentFileName); + switch (_CurrentConvertState) + { + #region Convert input file to a DVD formatted MPG file using Mencoder + + case ConvertState.VideoConversion: + { + string strFileName = Path.GetFileNameWithoutExtension(_CurrentFileName); + ProvideStatusUpdate("Converting \"" + strFileName + "\" to DVD format"); + + + string DestinationFilePath = Path.GetFileNameWithoutExtension(_CurrentFileName); + DestinationFilePath = DestinationFilePath + ".mpg"; + DestinationFilePath = Path.Combine(_TempFolderPath, DestinationFilePath); + + + string SourceFilePath = _CurrentFileName; + + // Set the current filename to the new output file + _CurrentFileName = DestinationFilePath; // Ready for next file?? + + _CurrentProcess = "Video file conversion - mencoder.exe"; + + try + { + BurnerProcess = new Process(); + BurnerProcess.EnableRaisingEvents = true; + // Gets or sets whether the Exited event should be raised when the process terminates. + BurnerProcess.StartInfo.WorkingDirectory = Config.GetFolder(Config.Dir.BurnerSupport); + BurnerProcess.StartInfo.UseShellExecute = false; + + if (!_InDebugMode) // Show output if in Debug mode + { + BurnerProcess.StartInfo.RedirectStandardOutput = true; + BurnerProcess.StartInfo.CreateNoWindow = true; + } + + BurnerProcess.StartInfo.FileName = Config.GetFile(Config.Dir.BurnerSupport, "mencoder.exe"); + + string args = string.Empty; + if (_TvFormat.ToUpper() == "PAL") + { + args = + "-oac lavc -ovc lavc -of mpeg -mpegopts format=dvd:tsaf -vf scale=720:576,harddup -srate 48000 -af lavcresample=48000 -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:keyint=15:acodec=ac3:abitrate=192:aspect=" + + _AspectRatio + " -ofps 25 -o \"" + DestinationFilePath + "\" \"" + SourceFilePath + "\" "; + } + else + { + args = + "-oac lavc -ovc lavc -of mpeg -mpegopts format=dvd:tsaf -vf scale=720:480,harddup -srate 48000 -af lavcresample=48000 -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:keyint=18:acodec=ac3:abitrate=192:aspect=" + + _AspectRatio + " -ofps 30000/1001 -o \"" + DestinationFilePath + "\" \"" + SourceFilePath + "\" "; + } + + BurnerProcess.StartInfo.Arguments = args; + + BurnerProcess.Exited += new EventHandler(BurnerProcess_Exited); + BurnerProcess.OutputDataReceived += new DataReceivedEventHandler(FileConversionOutputDataReceivedHandler); + + Log.Debug("Starting: " + _CurrentProcess, "Exe Arguments: " + args); + + BurnerProcess.Start(); + + if (!BurnerProcess.HasExited) + { + //BurnerProcess.PriorityClass = System.Diagnostics.ProcessPriorityClass.BelowNormal; + BurnerProcess.BeginOutputReadLine(); + } + } + catch (Exception ex) + { + Log.Error(ex.ToString()); + } + } + break; + + #endregion + + #region Finished File Conversion Step Start Next File + + case ConvertState.Finished: // Finished one file Start Next + + ProvideStatusUpdate("Completed File Conversion For: " + (string)_FileNames[_FileNameCount - 1]); + + if (FileFinished != null) + { + FileFinished(this, new FileFinishedEventArgs((string)_FileNames[_FileNameCount - 1], _CurrentFileName)); + } + _FilesToBurn.Add(_CurrentFileName); + NextFileNameConversion(); + + break; + + #endregion + } + } + + #region Events etc. + + ///<summary>Called to provide status updates to any BurnVideoDVDStatusUpdate event listeners</summary> + private void ProvideStatusUpdate(string status) + { + Log.Debug("ProvideStatusUpdate: ", status.ToString()); + + if (BurnDVDStatusUpdate != null) + { + BurnDVDStatusUpdateEventArgs be = new BurnDVDStatusUpdateEventArgs(status); + //announce to anyone who is listening + BurnDVDStatusUpdate(this, be); + } + } + + + ///<summary>Called when each Conversion Process Step has completed + ///to move to the next step.</summary> + private void BurnerProcess_Exited(object sender, EventArgs e) + { + //Log.Debug("Convert Video Step Exited: ", _CurrentConvertState.ToString()); + ProvideStatusUpdate("Convert Process Exited: " + _CurrentProcess); + + //one process has finished, start next process + _CurrentConvertState += 1; + NextStep_FileConversion(); + } + + ///<summary>Called when each Burn Process Step has completed. + ///Also announces the CompletedStep event to any listeners</summary> + private void BurnProcess_Exited(object sender, EventArgs e) + { + Log.Debug("Burn DVD Step Exited: Step: ", _CurrentBurnState.ToString()); + ProvideStatusUpdate("DVD Burn Process Exited: " + _CurrentProcess); + + //one process has finished, start next process + _CurrentBurnState += 1; + NextStep_DVDCreation(); + } + + + private void FileConversionOutputDataReceivedHandler(object sender, DataReceivedEventArgs e) + { + string sout = "Redirected StandardOutput IsEmpty"; + + if (!String.IsNullOrEmpty(e.Data)) + { + sout = e.Data.ToString(); + } + + //Pos: 76.5s 1835f (99%) 34.31fps Trem: 0min 35mb A-V:0.017 [3646:191] + + string Percentage = ""; + string TimeLeft = ""; + + + if (sout.StartsWith("Pos") == true) + { + Percentage = sout.Substring(sout.IndexOf('(') + 1, 2); + TimeLeft = sout.Substring(sout.IndexOf("Trem:") + 5, 4); + + byte Temp = Convert.ToByte(Percentage); + if (Temp % 5 == 0) + { + ProvideStatusUpdate(Percentage + "% done. Time Left = " + TimeLeft.ToString() + " min"); + } + } + + +// if (OutputReceived != null) +// { +// OutputReceived(this, e); +// } + } + + private void MakeISOOutputDataReceivedHandler(object sender, DataReceivedEventArgs e) + { + // Debugger.Launch(); + // Debugger.Break(); + +/* string sout = "Redirected StandardOutput IsEmpty"; + + if (!String.IsNullOrEmpty(e.Data)) + sout = e.Data.ToString(); + + //Pos: 76.5s 1835f (99%) 34.31fps Trem: 0min 35mb A-V:0.017 [3646:191] + + string Percentage = ""; + string TimeLeft = ""; + + + if (sout.StartsWith("Pos") == true) + { + Percentage = sout.Substring(sout.IndexOf('(') + 1, 2); + TimeLeft = sout.Substring(sout.IndexOf("Trem:") + 5, 4); + + byte Temp = Convert.ToByte(Percentage); + if (Temp % 5 == 0) + ProvideStatusUpdate(Percentage + "% done. Time Left = " + TimeLeft.ToString() + " min"); + } + + // if (OutputReceived != null) + // { + // OutputReceived(this, e); + // } + */ + } + + + private void ProcessingError(string ErrorTitle, string ErrorText) + { + Log.Error("Processing Error: " + ErrorTitle, ErrorText); + ProvideStatusUpdate("Processing Error: " + ErrorTitle + ": " + ErrorText); + if (BurnDVDError != null) + { + BurnDVDErrorEventArgs be = new BurnDVDErrorEventArgs(ErrorTitle, ErrorText); + BurnDVDError(this, be); + } + } + + #endregion + + //#region LogWriting + /////<summary>Called to Write to the MediaPortal.Log file when in DebugMode.</summary> + /////<param name="EntryTitle">Log Entry Title Text.</param> + /////<param name="EntryText">Log entry Main Text.</param> + //private void Log.Debug(string EntryTitle, string EntryText) + //{ + // Log.Info("My Burner Plugin->BurnVideoDVD Class: {0} - {1}", EntryTitle, EntryText); + //} + //#endregion + + ///<summary>Simple Cleanup that deletes the temp files and directory</summary> + private void CleanUp() + { + ProvideStatusUpdate("Performing Cleanup of Temporary Files"); + if (!_InDebugMode) + { + // Delete the temp DVD dir and any contents from any previous DVD creation. + Directory.Delete(_TempFolderPath, true); + } + else + { + ProvideStatusUpdate("Temporary Files Not Deleted: In Debug Mode"); + } + } + } +} \ No newline at end of file Added: trunk/plugins/Burner/Burner/Burner.csproj =================================================================== --- trunk/plugins/Burner/Burner/Burner.csproj (rev 0) +++ trunk/plugins/Burner/Burner/Burner.csproj 2010-11-14 12:54:41 UTC (rev 3932) @@ -0,0 +1,86 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>8.0.30703</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{D3161CBB-7179-47A3-B05E-79DBF48EFF62}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>Burner</RootNamespace> + <AssemblyName>Burner</AssemblyName> + <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + </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> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + ... [truncated message content] |
From: <che...@us...> - 2010-11-14 14:20:31
|
Revision: 3933 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3933&view=rev Author: chef_koch Date: 2010-11-14 14:20:19 +0000 (Sun, 14 Nov 2010) Log Message: ----------- added video editor plugin from official MP Added Paths: ----------- trunk/plugins/VideoEditor/ trunk/plugins/VideoEditor/Skin/ trunk/plugins/VideoEditor/Skin/Blue3/ trunk/plugins/VideoEditor/Skin/Blue3/Media/ trunk/plugins/VideoEditor/Skin/Blue3/Media/hover_videoeditor.png trunk/plugins/VideoEditor/Skin/Blue3/VideoEditorCompressSettings.xml trunk/plugins/VideoEditor/Skin/Blue3/VideoEditorCutScreen.xml trunk/plugins/VideoEditor/Skin/Blue3/VideoEditorStartScreen.xml trunk/plugins/VideoEditor/Skin/Blue3wide/ trunk/plugins/VideoEditor/Skin/Blue3wide/Media/ trunk/plugins/VideoEditor/Skin/Blue3wide/Media/hover_videoeditor.png trunk/plugins/VideoEditor/Skin/Blue3wide/VideoEditorCompressSettings.xml trunk/plugins/VideoEditor/Skin/Blue3wide/VideoEditorCutScreen.xml trunk/plugins/VideoEditor/Skin/Blue3wide/VideoEditorStartScreen.xml trunk/plugins/VideoEditor/VideoEditor/ trunk/plugins/VideoEditor/VideoEditor/BufferedTsFileReader.cs trunk/plugins/VideoEditor/VideoEditor/CompressSettings.cs trunk/plugins/VideoEditor/VideoEditor/Converter.cs trunk/plugins/VideoEditor/VideoEditor/DvrMsModifier.cs trunk/plugins/VideoEditor/VideoEditor/EditSettings.cs trunk/plugins/VideoEditor/VideoEditor/GUIVideoEditor.cs trunk/plugins/VideoEditor/VideoEditor/Mpeg2Divx.cs trunk/plugins/VideoEditor/VideoEditor/Mpeg2Splitter.cs trunk/plugins/VideoEditor/VideoEditor/MpegModifier.cs trunk/plugins/VideoEditor/VideoEditor/PcrUtils.cs trunk/plugins/VideoEditor/VideoEditor/Properties/ trunk/plugins/VideoEditor/VideoEditor/Properties/AssemblyInfo.cs trunk/plugins/VideoEditor/VideoEditor/TimeDomain.cs trunk/plugins/VideoEditor/VideoEditor/TsFileCutter.cs trunk/plugins/VideoEditor/VideoEditor/VideoEditor.csproj trunk/plugins/VideoEditor/VideoEditor/VideoEditor.gif trunk/plugins/VideoEditor/VideoEditor/VideoEditorConfiguration.Designer.cs trunk/plugins/VideoEditor/VideoEditor/VideoEditorConfiguration.cs trunk/plugins/VideoEditor/VideoEditor/VideoEditorConfiguration.resx trunk/plugins/VideoEditor/VideoEditor/VideoEditorPreview.cs trunk/plugins/VideoEditor/VideoEditor/VideoEditorSettings.cs trunk/plugins/VideoEditor/VideoEditor/VideoEditorSetup.cs trunk/plugins/VideoEditor/VideoEditor/VideoEditor_disabled.gif trunk/plugins/VideoEditor/VideoEditor.sln Property changes on: trunk/plugins/VideoEditor ___________________________________________________________________ Added: svn:ignore + *.suo *.user _ReSharper.VideoEditor Added: trunk/plugins/VideoEditor/Skin/Blue3/Media/hover_videoeditor.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/VideoEditor/Skin/Blue3/Media/hover_videoeditor.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/VideoEditor/Skin/Blue3/VideoEditorCompressSettings.xml =================================================================== --- trunk/plugins/VideoEditor/Skin/Blue3/VideoEditorCompressSettings.xml (rev 0) +++ trunk/plugins/VideoEditor/Skin/Blue3/VideoEditorCompressSettings.xml 2010-11-14 14:20:19 UTC (rev 3933) @@ -0,0 +1,153 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<window> + <id>2960</id> + <defaultcontrol>104</defaultcontrol> + <allowoverlay>no</allowoverlay> + <controls> + <control> + <type>image</type> + <id>0</id> + <posX>158</posX> + <posY>100</posY> + <width>404</width> + <height>350</height> + <texture>context_background.png</texture> + <animation effect="fade" time="250">WindowOpen</animation> + <animation effect="fade" time="250">WindowClose</animation> + </control> + <control> + <description>Header</description> + <type>label</type> + <id>23</id> + <posX>270</posX> + <posY>133</posY> + <align>left</align> + <font>font16</font> + <label>2055</label> + </control> + <control> + <type>label</type> + <id>34</id> + <posX>230</posX> + <posY>199</posY> + <align>left</align> + <font>font14</font> + <label>2056</label> + </control> + <control> + <description>VideoqualySelect</description> + <type>spincontrol</type> + <id>402</id> + <posX>356</posX> + <posY>201</posY> + <height>20</height> + <width>20</width> + <font>font14</font> + <reverse>yes</reverse> + <onup>302</onup> + <ondown>403</ondown> + <onleft>104</onleft> + <onright>101</onright> + <align>left</align> + <textcolor>FFFFFFFF</textcolor> + <showrange>no</showrange> + <spintype>text</spintype> + <subitems> + <subitem>2062</subitem> + <subitem>2063</subitem> + <subitem>2064</subitem> + </subitems> + </control> + <control> + <type>label</type> + <id>44</id> + <posX>230</posX> + <posY>236</posY> + <align>left</align> + <font>font14</font> + <label>2057</label> + </control> + <control> + <description>VideoqualySelect</description> + <type>spincontrol</type> + <id>403</id> + <posX>356</posX> + <posY>238</posY> + <height>20</height> + <width>20</width> + <font>font14</font> + <reverse>yes</reverse> + <onup>402</onup> + <ondown>100</ondown> + <onleft>104</onleft> + <onright>101</onright> + <align>left</align> + <textcolor>FFFFFFFF</textcolor> + <showrange>no</showrange> + <spintype>text</spintype> + <subitems> + <subitem>2062</subitem> + <subitem>2063</subitem> + <subitem>2064</subitem> + </subitems> + </control> + <control> + <type>label</type> + <id>55</id> + <posX>230</posX> + <posY>272</posY> + <align>left</align> + <font>font14</font> + <label>2058</label> + </control> + <control> + <type>slider</type> + <description>movie slider</description> + <id>100</id> + <posX>230</posX> + <posY>302</posY> + <onup>403</onup> + <ondown>104</ondown> + <textureSliderBar>osd_slider_bg.png</textureSliderBar> + <textureSliderNib>osd_slider_nibNF.png</textureSliderNib> + <label>2089</label> + <textureSliderNibFocus>osd_slider_nibFO.png</textureSliderNibFocus> + </control> + <control> + <type>label</type> + <id>102</id> + <posX>330</posX> + <posY>272</posY> + <font>font14</font> + <label>720x576</label> + </control> + <control> + <type>button</type> + <description>Abort</description> + <id>24</id> + <posX>210</posX> + <posY>380</posY> + <width>100</width> + <onup>100</onup> + <ondown>302</ondown> + <onright>104</onright> + <onleft>104</onleft> + <label>712</label> + <align>center</align> + </control> + <control> + <type>button</type> + <description>OK</description> + <id>104</id> + <posX>390</posX> + <posY>380</posY> + <width>100</width> + <onup>100</onup> + <ondown>302</ondown> + <onright>24</onright> + <onleft>24</onleft> + <label>OK</label> + <align>center</align> + </control> + </controls> +</window> Added: trunk/plugins/VideoEditor/Skin/Blue3/VideoEditorCutScreen.xml =================================================================== --- trunk/plugins/VideoEditor/Skin/Blue3/VideoEditorCutScreen.xml (rev 0) +++ trunk/plugins/VideoEditor/Skin/Blue3/VideoEditorCutScreen.xml 2010-11-14 14:20:19 UTC (rev 3933) @@ -0,0 +1,332 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<window> + <id>170602</id> + <defaultcontrol>100</defaultcontrol> + <allowoverlay>no</allowoverlay> + <controls> + <control> + <description>BG</description> + <type>image</type> + <id>1</id> + <width>720</width> + <height>576</height> + </control> + <control> + <type>button</type> + <description>cut</description> + <id>24</id> + <posX>56</posX> + <posY>107</posY> + <onup>25</onup> + <ondown>25</ondown> + <onright>100</onright> + <label>2095</label> + </control> + <control> + <type>button</type> + <id>25</id> + <posX>56</posX> + <posY>137</posY> + <onup>24</onup> + <ondown>101</ondown> + <onright>100</onright> + <label>510</label> + </control> + <control> + <type>label</type> + <description>Title</description> + <posX>160</posX> + <posY>55</posY> + <align>left</align> + <font>font14</font> + <label>178</label> + </control> + <control> + <description>scrolling info label</description> + <type>fadelabel</type> + <posX>200</posX> + <posY>55</posY> + <width>435</width> + <font>font14</font> + <label>#Play.Current.Title</label> + <id>0</id> + </control> + <control> + <type>label</type> + <description>old duration</description> + <id>26</id> + <posX>58</posX> + <posY>180</posY> + <onup>24</onup> + <ondown>24</ondown> + <label>2097</label> + </control> + <control> + <type>label</type> + <id>35</id> + <description>Label Alte Länge</description> + <posX>58</posX> + <posY>198</posY> + <onup>24</onup> + <ondown>24</ondown> + <label /> + </control> + <control> + <type>label</type> + <description>Neue Länge</description> + <id>27</id> + <posX>58</posX> + <posY>220</posY> + <onup>24</onup> + <ondown>24</ondown> + <label>2098</label> + </control> + <control> + <type>label</type> + <description>Label Neue Länge</description> + <id>36</id> + <posX>58</posX> + <posY>238</posY> + <onup>24</onup> + <ondown>24</ondown> + <label /> + </control> + <control> + <type>label</type> + <description>aktuelle Position</description> + <id>32</id> + <posX>58</posX> + <posY>260</posY> + <onup>24</onup> + <ondown>24</ondown> + <label>2099</label> + </control> + <control> + <type>label</type> + <description>Label Aktuelle Position</description> + <id>33</id> + <posX>58</posX> + <posY>278</posY> + <onup>24</onup> + <ondown>24</ondown> + <label>#currentplaytime</label> + </control> + <control> + <type>button</type> + <description>Hinzufügen</description> + <id>28</id> + <posX>515</posX> + <posY>410</posY> + <width>120</width> + <height>28</height> + <onup>31</onup> + <ondown>28</ondown> + <onleft>30</onleft> + <label /> + </control> + <control> + <type>label</type> + <label>Hinzufügen</label> + <posX>575</posX> + <posY>423</posY> + <align>center</align> + <label>2093</label> + </control> + <control> + <type>button</type> + <description>Start</description> + <id>29</id> + <posX>313</posX> + <posY>410</posY> + <width>94</width> + <height>28</height> + <onup>34</onup> + <ondown>29</ondown> + <onright>30</onright> + <onleft>24</onleft> + </control> + <control> + <type>label</type> + <label>Start</label> + <posX>358</posX> + <posY>423</posY> + <align>center</align> + <label>2084</label> + </control> + <control> + <type>label</type> + <description>Label Start Position</description> + <id>37</id> + <posX>320</posX> + <posY>435</posY> + <onup>24</onup> + <label /> + </control> + <control> + <type>button</type> + <description>Ende</description> + <id>30</id> + <posX>415</posX> + <posY>410</posY> + <width>94</width> + <height>28</height> + <onup>31</onup> + <ondown>30</ondown> + <onright>28</onright> + <onleft>29</onleft> + <align>center</align> + <label /> + </control> + <control> + <type>label</type> + <label>End</label> + <posX>460</posX> + <posY>423</posY> + <align>center</align> + <label>2085</label> + </control> + <control> + <type>label</type> + <description>Label Ende Position</description> + <id>38</id> + <posX>410</posX> + <posY>435</posY> + <onup>24</onup> + <label /> + </control> + <control> + <type>button</type> + <description>forward</description> + <id>31</id> + <posX>567</posX> + <posY>380</posY> + <width>80</width> + <height>28</height> + <onup>100</onup> + <ondown>30</ondown> + <onleft>34</onleft> + </control> + <control> + <type>label</type> + <label>forward</label> + <posX>608</posX> + <posY>395</posY> + <align>center</align> + <label>2086</label> + </control> + <control> + <type>button</type> + <description>backward</description> + <id>34</id> + <posX>297</posX> + <posY>380</posY> + <width>95</width> + <height>28</height> + <onup>100</onup> + <ondown>29</ondown> + <onright>31</onright> + <onleft>24</onleft> + </control> + <control> + <label>backward</label> + <type>label</type> + <posX>346</posX> + <posY>395</posY> + <align>center</align> + <label>2087</label> + </control> + <control> + <type>slider</type> + <description>movie slider</description> + <id>100</id> + <posX>395</posX> + <posY>372</posY> + <onup>24</onup> + <ondown>34</ondown> + <textureSliderBar>osd_slider_bg.png</textureSliderBar> + <textureSliderNib>osd_slider_nibNF.png</textureSliderNib> + <label>2089</label> + <textureSliderNibFocus>osd_slider_nibFO.png</textureSliderNibFocus> + </control> + <control> + <description>Schneideliste</description> + <type>listcontrol</type> + <id>101</id> + <posX>50</posX> + <posY>330</posY> + <width>180</width> + <height>250</height> + <label>Schneideliste</label> + <onleft>31</onleft> + <onright>100</onright> + <onup>24</onup> + <ondown>24</ondown> + <font>font12</font> + </control> + <control> + <type>label</type> + <posX>58</posX> + <posY>310</posY> + <align>left</align> + <label>2088</label> + </control> + <control> + <description>TV background</description> + <type>image</type> + <id>1</id> + <posX>281</posX> + <posY>87</posY> + <width>396</width> + <height>335</height> + <colordiffuse>60ffffff</colordiffuse> + <texture>tv_background.png</texture> + </control> + <control> + <description>video window</description> + <type>videowindow</type> + <id>99</id> + <posX>300</posX> + <posY>107</posY> + <width>350</width> + <height>260</height> + <onleft>2</onleft> + <onright>2</onright> + <action>18</action> + <textureFocus>video_window_focus.png</textureFocus> + </control> + <control> + <type>label</type> + <id>102</id> + <posX>300</posX> + <posY>500</posY> + </control> + <control> + <type>statusbar</type> + <id>103</id> + <posX>300</posX> + <posY>520</posY> + <width>350</width> + <height>20</height> + <texturebg>statusbar_back.png</texturebg> + <midtexture>statusbar_mid.png</midtexture> + <lefttexture>statusbar_left.png</lefttexture> + <righttexture>statusbar_right.png</righttexture> + </control> + <control> + <type>progress</type> + <id>104</id> + <posX>300</posX> + <posY>520</posY> + <width>350</width> + </control> + <control> + <type>label</type> + <description>edit cutpoint</description> + <id>105</id> + <posX>300</posX> + <posY>500</posY> + <align>left</align> + <label>2075</label> + </control> + </controls> +</window> \ No newline at end of file Added: trunk/plugins/VideoEditor/Skin/Blue3/VideoEditorStartScreen.xml =================================================================== --- trunk/plugins/VideoEditor/Skin/Blue3/VideoEditorStartScreen.xml (rev 0) +++ trunk/plugins/VideoEditor/Skin/Blue3/VideoEditorStartScreen.xml 2010-11-14 14:20:19 UTC (rev 3933) @@ -0,0 +1,105 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<window> + <id>2959</id> + <defaultcontrol>101</defaultcontrol> + <allowoverlay>no</allowoverlay> + <define>#header.label:2090</define> + <!-- <define>#header.text:music</define> --> + <define>#header.hover:-</define> + <controls> + <import>common.window.xml</import> + <control> + <type>label</type> + <id>23</id> + <posX>160</posX> + <posY>45</posY> + <align>left</align> + <font>font14</font> + <label>2092</label> + </control> + <control> + <type>button</type> + <id>24</id> + <posX>56</posX> + <posY>96</posY> + <onup>104</onup> + <ondown>102</ondown> + <label>712</label> + <posX>56</posX> + <posY>96</posY> + <align>center</align> + </control> + <control> + <description>Videoliste</description> + <type>listcontrol</type> + <id>101</id> + <posX>270</posX> + <width>400</width> + <height>400</height> + <label>2094</label> + <onleft>24</onleft> + <onright>2</onright> + </control> + <control> + <description>JoinSelect</description> + <type>spincontrol</type> + <id>102</id> + <posX>56</posX> + <posY>150</posY> + <onup>24</onup> + <ondown>104</ondown> + <onleft>101</onleft> + <onright>101</onright> + <textcolor>FFFFFFFF</textcolor> + <showrange>no</showrange> + <subitems> + <subitem>2077</subitem> + <subitem>2078</subitem> + <subitem>2071</subitem> + <subitem>2066</subitem> + </subitems> + </control> + <control> + <description>JoinList</description> + <type>listcontrol</type> + <id>103</id> + <posX>270</posX> + <posY>450</posY> + <width>300</width> + <height>100</height> + <label>JoinList</label> + <onleft>104</onleft> + <onright>104</onright> + <onup>101</onup> + <ondown>101</ondown> + <font>font12</font> + </control> + <control> + <type>button</type> + <id>104</id> + <posX>56</posX> + <posY>180</posY> + <onup>102</onup> + <ondown>24</ondown> + <onright>103</onright> + <label>2079</label> + <align>center</align> + </control> + <control> + <type>progress</type> + <id>105</id> + <posX>56</posX> + <posY>230</posY> + <width>180</width> + </control> + <control> + <type>label</type> + <id>106</id> + <posX>56</posX> + <posY>250</posY> + <align>left</align> + <font>font14</font> + <label></label> + </control> + </controls> +</window> \ No newline at end of file Added: trunk/plugins/VideoEditor/Skin/Blue3wide/Media/hover_videoeditor.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/VideoEditor/Skin/Blue3wide/Media/hover_videoeditor.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/VideoEditor/Skin/Blue3wide/VideoEditorCompressSettings.xml =================================================================== --- trunk/plugins/VideoEditor/Skin/Blue3wide/VideoEditorCompressSettings.xml (rev 0) +++ trunk/plugins/VideoEditor/Skin/Blue3wide/VideoEditorCompressSettings.xml 2010-11-14 14:20:19 UTC (rev 3933) @@ -0,0 +1,153 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<window> + <id>2960</id> + <defaultcontrol>104</defaultcontrol> + <allowoverlay>no</allowoverlay> + <controls> + <control> + <type>image</type> + <id>0</id> + <posX>280</posX> + <posY>125</posY> + <width>718</width> + <height>437</height> + <texture>context_background.png</texture> + <animation effect="fade" time="150">WindowOpen</animation> + <animation effect="fade" time="150">WindowClose</animation> + </control> + <control> + <description>Header</description> + <type>label</type> + <id>23</id> + <posX>480</posX> + <posY>166</posY> + <align>left</align> + <font>font16</font> + <label>2055</label> + </control> + <control> + <type>label</type> + <id>34</id> + <posX>408</posX> + <posY>248</posY> + <align>left</align> + <font>font14</font> + <label>2056</label> + </control> + <control> + <description>VideoqualySelect</description> + <type>spincontrol</type> + <id>402</id> + <posX>632</posX> + <posY>251</posY> + <height>25</height> + <width>35</width> + <font>font14</font> + <reverse>yes</reverse> + <onup>302</onup> + <ondown>403</ondown> + <onleft>104</onleft> + <onright>101</onright> + <align>left</align> + <textcolor>FFFFFFFF</textcolor> + <showrange>no</showrange> + <spintype>text</spintype> + <subitems> + <subitem>2062</subitem> + <subitem>2063</subitem> + <subitem>2064</subitem> + </subitems> + </control> + <control> + <type>label</type> + <id>44</id> + <posX>408</posX> + <posY>295</posY> + <align>left</align> + <font>font14</font> + <label>2057</label> + </control> + <control> + <description>VideoqualySelect</description> + <type>spincontrol</type> + <id>403</id> + <posX>632</posX> + <posY>297</posY> + <height>25</height> + <width>35</width> + <font>font14</font> + <reverse>yes</reverse> + <onup>402</onup> + <ondown>100</ondown> + <onleft>104</onleft> + <onright>101</onright> + <align>left</align> + <textcolor>FFFFFFFF</textcolor> + <showrange>no</showrange> + <spintype>text</spintype> + <subitems> + <subitem>2062</subitem> + <subitem>2063</subitem> + <subitem>2064</subitem> + </subitems> + </control> + <control> + <type>label</type> + <id>55</id> + <posX>408</posX> + <posY>340</posY> + <align>left</align> + <font>font14</font> + <label>2058</label> + </control> + <control> + <type>slider</type> + <description>movie slider</description> + <id>100</id> + <posX>408</posX> + <posY>377</posY> + <onup>403</onup> + <ondown>104</ondown> + <textureSliderBar>osd_slider_bg.png</textureSliderBar> + <textureSliderNib>osd_slider_nibNF.png</textureSliderNib> + <label>2089</label> + <textureSliderNibFocus>osd_slider_nibFO.png</textureSliderNibFocus> + </control> + <control> + <type>label</type> + <id>102</id> + <posX>586</posX> + <posY>340</posY> + <font>font14</font> + <label>720x576</label> + </control> + <control> + <type>button</type> + <description>Abort</description> + <id>24</id> + <posX>373</posX> + <posY>475</posY> + <width>177</width> + <onup>100</onup> + <ondown>302</ondown> + <onright>104</onright> + <onleft>104</onleft> + <label>712</label> + <align>center</align> + </control> + <control> + <type>button</type> + <description>OK</description> + <id>104</id> + <posX>693</posX> + <posY>475</posY> + <width>177</width> + <onup>100</onup> + <ondown>302</ondown> + <onright>24</onright> + <onleft>24</onleft> + <label>OK</label> + <align>center</align> + </control> + </controls> +</window> \ No newline at end of file Added: trunk/plugins/VideoEditor/Skin/Blue3wide/VideoEditorCutScreen.xml =================================================================== --- trunk/plugins/VideoEditor/Skin/Blue3wide/VideoEditorCutScreen.xml (rev 0) +++ trunk/plugins/VideoEditor/Skin/Blue3wide/VideoEditorCutScreen.xml 2010-11-14 14:20:19 UTC (rev 3933) @@ -0,0 +1,326 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<window> + <id>170602</id> + <defaultcontrol>100</defaultcontrol> + <allowoverlay>no</allowoverlay> + <controls> + <control> + <description>BG</description> + <type>image</type> + <id>1</id> + <width>1280</width> + <height>720</height> + </control> + <control> + <type>button</type> + <description>cut</description> + <id>24</id> + <posX>99</posX> + <posY>133</posY> + <onup>25</onup> + <ondown>25</ondown> + <onright>100</onright> + <label>2095</label> + </control> + <control> + <type>button</type> + <id>25</id> + <posX>99</posX> + <posY>171</posY> + <onup>24</onup> + <ondown>101</ondown> + <onright>100</onright> + <label>510</label> + </control> + <control> + <type>label</type> + <description>Title</description> + <posX>284</posX> + <posY>68</posY> + <align>left</align> + <font>font14</font> + <label>178</label> + </control> + <control> + <description>scrolling info label</description> + <type>fadelabel</type> + <posX>355</posX> + <posY>68</posY> + <width>773</width> + <font>font14</font> + <label>#Play.Current.Title</label> + <id>0</id> + </control> + <control> + <type>label</type> + <description>old duration</description> + <id>26</id> + <posX>103</posX> + <posY>225</posY> + <onup>24</onup> + <ondown>24</ondown> + <label>2097</label> + </control> + <control> + <type>label</type> + <id>35</id> + <description>Label Alte Länge</description> + <posX>103</posX> + <posY>247</posY> + <onup>24</onup> + <ondown>24</ondown> + </control> + <control> + <type>label</type> + <description>Neue Länge</description> + <id>27</id> + <posX>103</posX> + <posY>275</posY> + <onup>24</onup> + <ondown>24</ondown> + <label>2098</label> + </control> + <control> + <type>label</type> + <description>Label Neue Länge</description> + <id>36</id> + <posX>103</posX> + <posY>297</posY> + <onup>24</onup> + <ondown>24</ondown> + </control> + <control> + <type>label</type> + <description>aktuelle Position</description> + <id>32</id> + <posX>103</posX> + <posY>325</posY> + <onup>24</onup> + <ondown>24</ondown> + <label>2099</label> + </control> + <control> + <type>label</type> + <description>Label Aktuelle Position</description> + <id>33</id> + <posX>103</posX> + <posY>347</posY> + <onup>24</onup> + <ondown>24</ondown> + <label>#currentplaytime</label> + </control> + <control> + <type>button</type> + <description>Hinzufügen</description> + <id>28</id> + <posX>915</posX> + <posY>512</posY> + <width>213</width> + <height>35</height> + <onup>31</onup> + <ondown>28</ondown> + <onleft>30</onleft> + </control> + <control> + <type>label</type> + <label>Hinzufügen</label> + <posX>1022</posX> + <posY>528</posY> + <align>center</align> + <label>2093</label> + </control> + <control> + <type>button</type> + <description>Start</description> + <id>29</id> + <posX>556</posX> + <posY>512</posY> + <width>167</width> + <height>35</height> + <onup>34</onup> + <ondown>29</ondown> + <onright>30</onright> + <onleft>24</onleft> + </control> + <control> + <type>label</type> + <label>Start</label> + <posX>636</posX> + <posY>528</posY> + <align>center</align> + <label>2084</label> + </control> + <control> + <type>label</type> + <description>Label Start Position</description> + <id>37</id> + <posX>568</posX> + <posY>543</posY> + <onup>24</onup> + </control> + <control> + <type>button</type> + <description>Ende</description> + <id>30</id> + <posX>737</posX> + <posY>512</posY> + <width>167</width> + <height>35</height> + <onup>31</onup> + <ondown>30</ondown> + <onright>28</onright> + <onleft>29</onleft> + <align>center</align> + </control> + <control> + <type>label</type> + <label>End</label> + <posX>817</posX> + <posY>528</posY> + <align>center</align> + <label>2085</label> + </control> + <control> + <type>label</type> + <description>Label Ende Position</description> + <id>38</id> + <posX>728</posX> + <posY>543</posY> + <onup>24</onup> + </control> + <control> + <type>button</type> + <description>forward</description> + <id>31</id> + <posX>1008</posX> + <posY>475</posY> + <width>142</width> + <height>35</height> + <onup>100</onup> + <ondown>30</ondown> + <onleft>34</onleft> + </control> + <control> + <type>label</type> + <label>forward</label> + <posX>1080</posX> + <posY>493</posY> + <align>center</align> + <label>2086</label> + </control> + <control> + <type>button</type> + <description>backward</description> + <id>34</id> + <posX>528</posX> + <posY>475</posY> + <width>168</width> + <height>35</height> + <onup>100</onup> + <ondown>29</ondown> + <onright>31</onright> + <onleft>24</onleft> + </control> + <control> + <label>backward</label> + <type>label</type> + <posX>615</posX> + <posY>493</posY> + <align>center</align> + <label>2087</label> + </control> + <control> + <type>slider</type> + <description>movie slider</description> + <id>100</id> + <posX>702</posX> + <posY>465</posY> + <onup>24</onup> + <ondown>34</ondown> + <textureSliderBar>osd_slider_bg.png</textureSliderBar> + <textureSliderNib>osd_slider_nibNF.png</textureSliderNib> + <label>2089</label> + <textureSliderNibFocus>osd_slider_nibFO.png</textureSliderNibFocus> + </control> + <control> + <description>Schneideliste</description> + <type>listcontrol</type> + <id>101</id> + <posX>88</posX> + <posY>412</posY> + <width>320</width> + <height>312</height> + <label>Schneideliste</label> + <onleft>31</onleft> + <onright>100</onright> + <onup>24</onup> + <ondown>24</ondown> + <font>font12</font> + </control> + <control> + <type>label</type> + <posX>103</posX> + <posY>387</posY> + <align>left</align> + <label>2088</label> + </control> + <control> + <description>TV background</description> + <type>image</type> + <id>1</id> + <posX>499</posX> + <posY>108</posY> + <width>704</width> + <height>418</height> + <colordiffuse>60ffffff</colordiffuse> + <texture>tv_background.png</texture> + </control> + <control> + <description>video window</description> + <type>videowindow</type> + <id>99</id> + <posX>533</posX> + <posY>133</posY> + <width>622</width> + <height>325</height> + <onleft>2</onleft> + <onright>2</onright> + <action>18</action> + <textureFocus>video_window_focus.png</textureFocus> + </control> + <control> + <type>label</type> + <id>102</id> + <posX>533</posX> + <posY>625</posY> + </control> + <control> + <type>statusbar</type> + <id>103</id> + <posX>533</posX> + <posY>650</posY> + <width>622</width> + <height>25</height> + <texturebg>statusbar_back.png</texturebg> + <midtexture>statusbar_mid.png</midtexture> + <lefttexture>statusbar_left.png</lefttexture> + <righttexture>statusbar_right.png</righttexture> + </control> + <control> + <type>progress</type> + <id>104</id> + <posX>533</posX> + <posY>650</posY> + <width>622</width> + </control> + <control> + <type>label</type> + <description>edit cutpoint</description> + <id>105</id> + <posX>533</posX> + <posY>625</posY> + <align>left</align> + <label>2075</label> + </control> + </controls> +</window> \ No newline at end of file Added: trunk/plugins/VideoEditor/Skin/Blue3wide/VideoEditorStartScreen.xml =================================================================== --- trunk/plugins/VideoEditor/Skin/Blue3wide/VideoEditorStartScreen.xml (rev 0) +++ trunk/plugins/VideoEditor/Skin/Blue3wide/VideoEditorStartScreen.xml 2010-11-14 14:20:19 UTC (rev 3933) @@ -0,0 +1,104 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<window> + <id>2959</id> + <defaultcontrol>101</defaultcontrol> + <allowoverlay>no</allowoverlay> + <define>#header.label:2090</define> + <!-- <define>#header.text:music</define> --> + <define>#header.hover:-</define> + <controls> + <import>common.window.xml</import> + <control> + <type>label</type> + <id>23</id> + <posX>284</posX> + <posY>56</posY> + <align>left</align> + <font>font14</font> + <label>2092</label> + </control> + <control> + <type>button</type> + <id>24</id> + <posX>99</posX> + <posY>120</posY> + <onup>104</onup> + <ondown>102</ondown> + <label>712</label> + <posX>99</posX> + <posY>120</posY> + <align>center</align> + </control> + <control> + <description>Videoliste</description> + <type>listcontrol</type> + <id>101</id> + <posX>480</posX> + <width>711</width> + <height>500</height> + <label>2094</label> + <onleft>24</onleft> + <onright>2</onright> + </control> + <control> + <description>JoinSelect</description> + <type>spincontrol</type> + <id>102</id> + <posX>99</posX> + <posY>187</posY> + <onup>24</onup> + <ondown>104</ondown> + <onleft>101</onleft> + <onright>101</onright> + <textcolor>FFFFFFFF</textcolor> + <showrange>no</showrange> + <subitems> + <subitem>2077</subitem> + <subitem>2078</subitem> + <subitem>2071</subitem> + <subitem>2066</subitem> + </subitems> + </control> + <control> + <description>JoinList</description> + <type>listcontrol</type> + <id>103</id> + <posX>480</posX> + <posY>562</posY> + <width>533</width> + <height>125</height> + <label>JoinList</label> + <onleft>104</onleft> + <onright>104</onright> + <onup>101</onup> + <ondown>101</ondown> + <font>font12</font> + </control> + <control> + <type>button</type> + <id>104</id> + <posX>99</posX> + <posY>225</posY> + <onup>102</onup> + <ondown>24</ondown> + <onright>103</onright> + <label>2079</label> + <align>center</align> + </control> + <control> + <type>progress</type> + <id>105</id> + <posX>99</posX> + <posY>287</posY> + <width>320</width> + </control> + <control> + <type>label</type> + <id>106</id> + <posX>99</posX> + <posY>312</posY> + <align>left</align> + <font>font14</font> + </control> + </controls> +</window> \ No newline at end of file Property changes on: trunk/plugins/VideoEditor/VideoEditor ___________________________________________________________________ Added: svn:ignore + bin obj Added: trunk/plugins/VideoEditor/VideoEditor/BufferedTsFileReader.cs =================================================================== --- trunk/plugins/VideoEditor/VideoEditor/BufferedTsFileReader.cs (rev 0) +++ trunk/plugins/VideoEditor/VideoEditor/BufferedTsFileReader.cs 2010-11-14 14:20:19 UTC (rev 3933) @@ -0,0 +1,116 @@ +#region Copyright (C) 2005-2010 Team MediaPortal + +// Copyright (C) 2005-2010 Team MediaPortal +// http://www.team-mediaportal.com +// +// MediaPortal is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 2 of the License, or +// (at your option) any later version. +// +// MediaPortal is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with MediaPortal. If not, see <http://www.gnu.org/licenses/>. + +#endregion + +using System; +using System.IO; + +namespace TsCutterPackage +{ + internal class BufferedTsFileReader + { + #region Consts + + private const int SYNC_BYTE = 0x47; + private const int TS_PACKET_SIZE = 188; + + #endregion + + #region Variables + + private BufferedStream _reader = null; + private long fileSize; + + #endregion + + #region Public members + + public bool Open(string tsFile, long packetsToBuffer) + { + if (_reader != null) + { + return true; + } + try + { + _reader = new BufferedStream(new FileStream(tsFile, FileMode.Open), (int)(packetsToBuffer * 188)); + } + catch (Exception) + { + return false; + } + fileSize = _reader.Length; + return true; + } + + public void Close() + { + if (_reader == null) + { + return; + } + _reader.Close(); + _reader.Dispose(); + _reader = null; + } + + public int GetPositionInPercent() + { + return (int)(_reader.Position * 100 / fileSize); + } + + public bool SeekToFirstPacket() + { + bool found = false; + while (!found) + { + int ch = _reader.ReadByte(); + if (ch == -1) + { + return false; + } + byte b = (byte)ch; + if (b == SYNC_BYTE) + { + _reader.Seek(-1, SeekOrigin.Current); + return true; + } + } + return false; + } + + public bool GetNextPacket(out byte[] tsPacket, out bool isValid) + { + isValid = false; + tsPacket = new byte[TS_PACKET_SIZE]; + if (_reader.Read(tsPacket, 0, TS_PACKET_SIZE) != TS_PACKET_SIZE) + { + return false; + } + //check for sync byte and transport error bit + if (tsPacket[0] == SYNC_BYTE && (tsPacket[1] & 0x80) == 0) + { + isValid = true; + } + return true; + } + + #endregion + } +} \ No newline at end of file Added: trunk/plugins/VideoEditor/VideoEditor/CompressSettings.cs =================================================================== --- trunk/plugins/VideoEditor/VideoEditor/CompressSettings.cs (rev 0) +++ trunk/plugins/VideoEditor/VideoEditor/CompressSettings.cs 2010-11-14 14:20:19 UTC (rev 3933) @@ -0,0 +1,275 @@ +#region Copyright (C) 2005-2010 Team MediaPortal + +// Copyright (C) 2005-2010 Team MediaPortal +// http://www.team-mediaportal.com +// +// MediaPortal is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 2 of the License, or +// (at your option) any later version. +// +// MediaPortal is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with MediaPortal. If not, see <http://www.gnu.org/licenses/>. + +#endregion + +using System; +using MediaPortal.Configuration; +using MediaPortal.Dialogs; +using MediaPortal.GUI.Library; +using MediaPortal.Profile; +using Action = MediaPortal.GUI.Library.Action; + +namespace WindowPlugins.VideoEditor +{ + public class CompressionSettings + { + public int resolutionX = 720; + public int resolutionY = 576; + public int videoQuality = 2200; + public int audioQuality = 128; + } + + public class CompressSettings : GUIDialogWindow + { + private bool result; + + [SkinControl(302)] protected GUISpinControl profilSelect = null; + [SkinControl(402)] protected GUISpinControl videoQualitySelect = null; + [SkinControl(403)] protected GUISpinControl audioQualitySelect = null; + [SkinControl(100)] protected GUISliderControl resolution = null; + [SkinControl(102)] protected GUILabelControl resolutionLbl = null; + [SkinControl(104)] protected GUIButtonControl okBtn = null; + [SkinControl(24)] protected GUIButtonControl abbortBtn = null; + + private CompressionSettings settings; + + public CompressSettings() + { + settings = new CompressionSettings(); + settings.resolutionX = 720; + settings.resolutionY = 576; + settings.videoQuality = 2200; + settings.audioQuality = 192; + GetID = (int)Window.WINDOW_VIDEO_EDITOR_COMPRESSSETTINGS; + } + + public CompressionSettings Settings + { + get { return settings; } + set + { + settings = value; + //settings.resolutionX = 720; + //settings.resolutionY = 576; + //settings.videoQuality = 2200; + //settings.audioQuality = 192; + } + } + + public override bool Init() + { + try + { + bool result = Load(GUIGraphicsContext.Skin + @"\VideoEditorCompressSettings.xml"); + return result; + } + catch (Exception ex) + { + Log.Error(ex); + return false; + } + } + + protected override void OnPageLoad() + { + base.OnPageLoad(); + resolution.SetRange(1, 3); + //resolution.SetRange(1, 4); + resolution.SpinType = GUISpinControl.SpinType.Int; + resolution.IntValue = 1; + LoadSettings(); + } + + protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType) + { + if (control == okBtn) + { + result = true; + SaveSettings(); + this.PageDestroy(); + return; + } + if (control == abbortBtn) + { + result = false; + this.PageDestroy(); + return; + } + if (control == videoQualitySelect) + { + if (videoQualitySelect.GetLabel() == GUILocalizeStrings.Get(2062)) + { + settings.videoQuality = 500; + } + else if (videoQualitySelect.GetLabel() == GUILocalizeStrings.Get(2063)) + { + settings.videoQuality = 1000; + } + else if (videoQualitySelect.GetLabel() == GUILocalizeStrings.Get(2064)) + { + settings.videoQuality = 2200; + } + } + else if (control == audioQualitySelect) + { + if (audioQualitySelect.GetLabel() == GUILocalizeStrings.Get(2062)) + { + settings.audioQuality = 128; + } + else if (audioQualitySelect.GetLabel() == GUILocalizeStrings.Get(2063)) + { + settings.audioQuality = 192; + } + else if (audioQualitySelect.GetLabel() == GUILocalizeStrings.Get(2064)) + { + settings.audioQuality = 256; + } + } + else if (control == resolution) + { + if (resolution.IntValue == 1) + { + settings.resolutionX = 320; + settings.resolutionY = 240; + resolutionLbl.Label = "320 x 240"; + } + else if (resolution.IntValue == 2) + { + settings.resolutionX = 640; + settings.resolutionY = 480; + resolutionLbl.Label = "640 x 480"; + } + else if (resolution.IntValue == 3) + { + settings.resolutionX = 720; + settings.resolutionY = 576; + resolutionLbl.Label = "720 x 576"; + } + else if (resolution.IntValue == 4) + { + settings.resolutionX = 1280; + settings.resolutionY = 720; + resolutionLbl.Label = "1280 x 720"; + } + } + base.OnClicked(controlId, control, actionType); + } + + private void LoadSettings() + { + using (Settings xmlreader = new MPSettings()) + { + settings.audioQuality = xmlreader.GetValueAsInt("VideoEditor", "audioQuality", 192); + settings.videoQuality = xmlreader.GetValueAsInt("VideoEditor", "videoQuality", 2200); + settings.resolutionX = xmlreader.GetValueAsInt("VideoEditor", "resolutionX", 720); + //settings.resolutionY = xmlreader.GetValueAsInt("VideoEditor", "resolutionY", 576); + } + + switch (settings.audioQuality) + { + case 128: + SelectItem(audioQualitySelect, GUILocalizeStrings.Get(2062)); + break; + case 192: + SelectItem(audioQualitySelect, GUILocalizeStrings.Get(2063)); + break; + case 256: + SelectItem(audioQualitySelect, GUILocalizeStrings.Get(2064)); + break; + } + + switch (settings.videoQuality) + { + case 500: + SelectItem(videoQualitySelect, GUILocalizeStrings.Get(2062)); + break; + case 1000: + SelectItem(videoQualitySelect, GUILocalizeStrings.Get(2063)); + break; + case 2200: + SelectItem(videoQualitySelect, GUILocalizeStrings.Get(2064)); + break; + } + + switch (settings.resolutionX) + { + case 320: + resolution.IntValue = 1; + resolutionLbl.Label = "320 x 240"; + settings.resolutionY = 240; + break; + case 640: + resolution.IntValue = 2; + resolutionLbl.Label = "640 x 480"; + settings.resolutionY = 480; + break; + case 720: + resolution.IntValue = 3; + resolutionLbl.Label = "720 x 576"; + settings.resolutionY = 576; + break; + } + resolution.SetRange(1, 3); + } + + private void SelectItem(GUISpinControl spinControl, string text) + { + if (spinControl == null || text == string.Empty) + { + return; + } + for (int i = 0; i < spinControl.SubItemCount; i++) + { + string subItem = (string)spinControl.GetSubItem(i); + if (subItem == text) + { + int j = 0; + while (spinControl.Value != i) + { + //spinControl.Value = i; + spinControl.MoveDown(); + // prevent for endless loop + if (j > (spinControl.SubItemCount * 2)) + { + break; + } + j++; + } + break; + } + } + } + + private void SaveSettings() + { + using (Settings xmlwriter = new MPSettings()) + { + xmlwriter.SetValue("VideoEditor", "audioQuality", settings.audioQuality); + xmlwriter.SetValue("VideoEditor", "videoQuality", settings.videoQuality); + xmlwriter.SetValue("VideoEditor", "resolutionX", settings.resolutionX); + xmlwriter.SetValue("VideoEditor", "resolutionY", settings.resolutionY); + } + } + + public bool Result + { + get { return result; } + } + } +} \ No newline at end of file Added: trunk/plugins/VideoEditor/VideoEditor/Converter.cs =================================================================== --- trunk/plugins/VideoEditor/VideoEditor/Converter.cs (rev 0) +++ trunk/plugins/VideoEditor/VideoEditor/Converter.cs 2010-11-14 14:20:19 UTC (rev 3933) @@ -0,0 +1,180 @@ +#region Copyright (C) 2005-2010 Team MediaPortal + +// Copyright (C) 2005-2010 Team MediaPortal +// http://www.team-mediaportal.com +// +// MediaPortal is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 2 of the License, or +// (at your option) any later version. +// +// MediaPortal is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with MediaPortal. If not, see <http://www.gnu.org/licenses/>. + +#endregion + +using System; +using System.Diagnostics; +using System.IO; +using System.Threading; +using System.Windows.Forms; +using MediaPortal.Configuration; +using MediaPortal.Core.Transcoding; +using MediaPortal.Profile; + +namespace WindowPlugins.VideoEditor +{ + internal class Converter + { + private bool hasMencoder = false; + private string mencoderPath; + private EditSettings settings; + private ProcessStartInfo mencoderProcessInfo; + private Process mencoderProcess; + private StreamReader consoleReader; + + public delegate void Finished(); + + public event Finished OnFinished; + + public delegate void Progress(int percentage); + + public event Progress OnProgress; + + + public Converter(EditSettings settings) + { + this.settings = settings; + CheckHasMencoder(); + } + + public bool CheckHasMencoder() + { + using (Settings xmlreader = new MPSettings()) + { + mencoderPath = xmlreader.GetValueAsString("VideoEditor", "mencoder", ""); + } + hasMencoder = File.Exists(mencoderPath); + if (!hasMencoder) + { + hasMencoder = File.Exists(Application.StartupPath + @"\mencoder.exe"); + if (hasMencoder) + { + mencoderPath = Application.StartupPath + @"\mencoder.exe"; + } + } + return hasMencoder; + } + + public void Convert(VideoFormat format) + { + switch (format) + { + case VideoFormat.Divx: + Thread convert = new Thread(new ThreadStart(ConvertToDivx)); + convert.Priority = ThreadPriority.BelowNormal; + convert.Name = "DivxConverter"; + convert.Start(); + //ConvertToDivx(); + break; + case VideoFormat.Mpeg2: + break; + case VideoFormat.Wmv: + break; + case VideoFormat.MP4: + break; + default: + break; + } + } + + private void ConvertToDivx() + { + try + { + if (hasMencoder) + { + if (settings.Settings is CompressionSettings) + { + CompressionSettings compressSettings = settings.Settings as CompressionSettings; + mencoderProcessInfo = new ProcessStartInfo(mencoderPath); + mencoderProcessInfo.Arguments = "-ffourcc DX50 -oac lavc -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=" + + compressSettings.videoQuality.ToString() + ":acodec=mp3:abitrate=" + + compressSettings.audioQuality.ToString() + + " -vf scale=" + compressSettings.resolutionX.ToString() + ":" + + compressSettings.resolutionY.ToString() + " -o \"" + + settings.FileName.Replace(Path.GetExtension(settings.FileName), ".avi") + + "\" \"" + settings.FileName + "\""; + mencoderProcessInfo.CreateNoWindow = true; + mencoderProcessInfo.RedirectStandardOutput = true; + mencoderProcess = new Process(); + mencoderProcessInfo.UseShellExecute = false; + mencoderProcess.StartInfo = mencoderProcessInfo; + mencoderProcess.Start(); + mencoderProcess.PriorityClass = ProcessPriorityClass.BelowNormal; + consoleReader = mencoderProcess.StandardOutput; + + string line; + int wherePerc; + int lastPerc = 0; + while (!mencoderProcess.HasExited) + { + line = consoleReader.ReadLine(); + if (line != null) + { + wherePerc = line.IndexOf('%'); + if (wherePerc >= 0) + { + string percent = line.Substring(wherePerc - 3, 3); + for (int i = 0; i < percent.Length; i++) + { + if (percent[i] >= '\x39' || percent[i] <= '\x30') + { + percent = percent.Remove(i, 1); + } + } + percent.Trim(); + try + { + if (percent.Length > 0 && percent != " ") + { + if (System.Convert.ToInt32(percent) > lastPerc) + { + lastPerc = System.Convert.ToInt32(percent); + if (OnProgress != null) + { + OnProgress(lastPerc); + } + } + } + } + catch {} + Thread.Sleep(20); + } + } + } + } + } + if (OnFinished != null) + { + OnFinished(); + } + if (OnProgress != null) + { + OnProgress(100); + } + } + catch (Exception) {} + } + + public bool HasMencoder + { + get { return hasMencoder; } + } + } +} \ No newline at end of file Added: trunk/plugins/VideoEditor/VideoEditor/DvrMsModifier.cs =================================================================== --- trunk/plugins/VideoEditor/VideoEditor/DvrMsModifier.cs (rev 0) +++ trunk/plugins/VideoEditor/VideoEditor/DvrMsModifier.cs 2010-11-14 14:20:19 UTC (rev 3933) @@ -0,0 +1,468 @@ +#region Copyright (C) 2005-2010 Team MediaPortal + +// Copyright (C) 2005-2010 Team MediaPortal +// http://www.team-mediaportal.com +// +// MediaPortal is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 2 of the License, or +// (at your option) any later version. +// +// MediaPortal is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with MediaPortal. If not, see <http://www.gnu.org/licenses/>. + +#endregion + +using System; +using System.Collections.Generic; +using System.Drawing; +using System.IO; +using System.Threading; +using System.Timers; +using DirectShowLib.SBE; +using DShowNET.Helper; +using MediaPortal.Core.Transcoding; +using MediaPortal.GUI.Library; +using Timer = System.Timers.Timer; + +namespace WindowPlugins.VideoEditor +{ + internal class DvrMsModifier + { + private IStreamBufferRecComp recCompcut = null; + private Timer cutProgresstime; + private Timer joinProgresstime; + private Timer transcodeProgresstime; + private Timer convertProgresstime; + + public delegate void Finished(); + + public event Finished OnFinished; + + public delegate void Progress(int percentage); + + public event Progress OnProgress; + private int percent = 0; + private int joinedFiles = 0; + private double newDuration = 0; + private FileInfo inFilename; + private List<TimeDomain> cutPoints; + private List<FileInfo> fileList; + private Dvrms2Mpeg tompeg; + private Dvrms2Divx toDivx; + //string filetoConvert; + //bool inDatabase; + + public DvrMsModifier() + { + //cutProgresstime = new System.Timers.Timer(1000); + //cutProgresstime.Elapsed += new System.Timers.ElapsedEventHandler(CutProgresstime_Elapsed); + } + + public void CutDvr(FileInfo inFilename, List<TimeDomain> cutPoints) + { + this.inFilename = inFilename; + this.cutPoints = cutPoints; + Thread cutThread = new Thread(new ThreadStart(CutDvr)); + cutThread.Name = "CutDvr"; + cutThread.Start(); + } + + public void CutDvr() + { + try + { + cutProgresstime = new Timer(1000); + cutProgresstime.Elapsed += new ElapsedEventHandler(CutProgresstime_Elapsed); + recCompcut = (IStreamBufferRecComp)ClassId.CoCreateInstance(ClassId.RecComp); + if (recCompcut != null) + { + FileInfo outFilename; + percent = 0; + //CutProgressTime(); + cutProgresstime.Start(); + string outPath = inFilename.FullName; + //rename the source file ------------later this could be configurable to delete it + //TODO behavior if the renamed sourcefile (_original) exists + inFilename.MoveTo(inFilename.FullName.Replace(inFilename.Extension, "_original" + inFilename.Extension)); + //to not to change the database the outputfile has the same name + outFilename = new FileInfo(outPath); + if (outFilename.Exists) + { + outFilename.Delete(); + } + for (int i = 0; i < cutPoints.Count; i++) + { + newDuration += cutPoints[i].Duration; + } + recCompcut.Initialize(outFilename.FullName, inFilename.FullName); + for (int i = 0; i < cutPoints.Count; i++) + { + //string[] split = cutList[i].ToString().Split(new char[] { ':' }); + //startCut = cutPoints[i].StartTime; + //endCut = cutPoints[i].EndTime; + + recCompcut.AppendEx(inFilename.FullName, (long)(cutPoints[i].StartTime * 10000000), + (long)(cutPoints[i].EndTime * 10000000)); + } + cutProgresstime.Stop(); + recCompcut.Close(); + percent = 100; + /*recInfo = new MediaPortal.TV.Database.TVRecorded(); + if (TVDatabase.GetRecordedTVByFilename(outFilename.FullName, ref rec)) + { + TVDatabase.RemoveRecordedTV(recInfo); + recInfo.End = MediaPortal.Util.Utils.datetolong(recInfo.StartTime.AddSeconds(durationNew)); + TVDatabase.AddRecordedTV(recInfo); + }*/ + + if (OnFinished != null) + { + OnFinished(); + } + //cutFinished = true; + //progressLbl.Label = "100"; + //progressBar.Percentage = 100; + //MessageBox(GUILocalizeStrings.Get(2083), GUILocalizeStrings.Get(2111)); //Dvrms:Finished to cut the video file , Finished ! + //progressBar.IsVisible = false; + //progressLbl.IsVisible = false; + } + } + catch (Exception ex) + { + Log.Error(ex); + } + finally + { + DirectShowUtil.ReleaseComObject((object)recCompcut); + recCompcut = null; + cutPoints = null; + percent = 0; + newDuration = 0; + //cutProgresstime.Stop(); + } + } + + public void JoinDvr(FileInfo firstFile, FileInfo secondFile) + { + fileList = new List<FileInfo>(2); + fileList.Add(firstFile); + fileList.Add(secondFile); + Thread joinThread = new Thread(new ThreadStart(JoinDvr)); + joinThread.Start(); + /* + try + { + cutProgresstime = new System.Timers.Timer(1000); + cutProgresstime.Elapsed += new System.Timers.ElapsedEventHandler(progressTime_Elapsed); + recCompcut = (IStreamBufferRecComp)DShowNET.Helper.ClassId.CoCreateInstance(DShowNET.Helper.ClassId.RecComp); + if (recCompcut != null) + { + System.IO.FileInfo outFilename; + percent = 0; + //cutProgresstime.Start(); + string outPath = firstFile.FullName.Replace(firstFile.Extension, "_joined" + firstFile.Extension); + //rename the source file ------------later this could be configurable to delete it + //TODO behavior if the renamed sourcefile (_original) exists + ... [truncated message content] |
From: <che...@us...> - 2010-11-14 15:51:59
|
Revision: 3935 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3935&view=rev Author: chef_koch Date: 2010-11-14 15:51:46 +0000 (Sun, 14 Nov 2010) Log Message: ----------- added foobar (external player) plugin from official MP Added Paths: ----------- trunk/plugins/FoobarExternalPlayers/ trunk/plugins/FoobarExternalPlayers/FoobarExternalPlayers/ trunk/plugins/FoobarExternalPlayers/FoobarExternalPlayers/FoobarConfigForm.cs trunk/plugins/FoobarExternalPlayers/FoobarExternalPlayers/FoobarConfigForm.resx trunk/plugins/FoobarExternalPlayers/FoobarExternalPlayers/FoobarExternalPlayers.csproj trunk/plugins/FoobarExternalPlayers/FoobarExternalPlayers/FoobarPlugin.cs trunk/plugins/FoobarExternalPlayers/FoobarExternalPlayers/Properties/ trunk/plugins/FoobarExternalPlayers/FoobarExternalPlayers/Properties/AssemblyInfo.cs trunk/plugins/FoobarExternalPlayers/FoobarExternalPlayers/foobarlogo.png trunk/plugins/FoobarExternalPlayers/FoobarExternalPlayers/foobarlogodisabled.png trunk/plugins/FoobarExternalPlayers/FoobarExternalPlayers.sln Property changes on: trunk/plugins/FoobarExternalPlayers ___________________________________________________________________ Added: svn:ignore + *.suo *.user _ReSharper.FoobarExternalPlayers Property changes on: trunk/plugins/FoobarExternalPlayers/FoobarExternalPlayers ___________________________________________________________________ Added: svn:ignore + bin obj Added: trunk/plugins/FoobarExternalPlayers/FoobarExternalPlayers/FoobarConfigForm.cs =================================================================== --- trunk/plugins/FoobarExternalPlayers/FoobarExternalPlayers/FoobarConfigForm.cs (rev 0) +++ trunk/plugins/FoobarExternalPlayers/FoobarExternalPlayers/FoobarConfigForm.cs 2010-11-14 15:51:46 UTC (rev 3935) @@ -0,0 +1,481 @@ +#region Copyright (C) 2005-2010 Team MediaPortal + +// Copyright (C) 2005-2010 Team MediaPortal +// http://www.team-mediaportal.com +// +// MediaPortal is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 2 of the License, or +// (at your option) any later version. +// +// MediaPortal is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with MediaPortal. If not, see <http://www.gnu.org/licenses/>. + +#endregion + +using System; +using System.ComponentModel; +using System.IO; +using System.Text; +using System.Windows.Forms; +using MediaPortal.Configuration; +using MediaPortal.Profile; +using MediaPortal.UserInterface.Controls; +using Microsoft.Win32; + +namespace MediaPortal.FoobarPlugin +{ + /// <summary> + /// Summary description for FoobarConfigForm. + /// </summary> + public class FoobarConfigForm : MPConfigForm + { + private LinkLabel linkLabelPluginSource; + private GroupBox groupBoxFoobarLocation; + private MPLabel labelPortNumber; + private MPTextBox textBoxPortNumber; + private MPTextBox textBoxHostname; + private MPButton buttonBrowseFoobarLoc; + private MPTextBox textBoxFoobarPath; + private MPLabel labelHostname; + private MPLabel labelLocation; + private GroupBox groupBoxFoobarSettings; + private MPTextBox textBoxFoobarExtensions; + private MPLabel labelFoobarFileTypes; + private LinkLabel linkLabelStartupParameter; + private TextBox textBoxStartupParameter; + private MPButton btnOK; + private MPButton btnCancel; + + /// <summary> + /// Required designer variable. + /// </summary> + private Container components = null; + + public FoobarConfigForm() + { + // + // Required for Windows Form Designer support + // + InitializeComponent(); + + LoadSettings(); + } + + /// <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.linkLabelPluginSource = new System.Windows.Forms.LinkLabel(); + this.groupBoxFoobarLocation = new System.Windows.Forms.GroupBox(); + this.labelPortNumber = new MediaPortal.UserInterface.Controls.MPLabel(); + this.textBoxPortNumber = new MediaPortal.UserInterface.Controls.MPTextBox(); + this.textBoxHostname = new MediaPortal.UserInterface.Controls.MPTextBox(); + this.buttonBrowseFoobarLoc = new MediaPortal.UserInterface.Controls.MPButton(); + this.textBoxFoobarPath = new MediaPortal.UserInterface.Controls.MPTextBox(); + this.labelHostname = new MediaPortal.UserInterface.Controls.MPLabel(); + this.labelLocation = new MediaPortal.UserInterface.Controls.MPLabel(); + this.groupBoxFoobarSettings = new System.Windows.Forms.GroupBox(); + this.linkLabelStartupParameter = new System.Windows.Forms.LinkLabel(); + this.textBoxStartupParameter = new System.Windows.Forms.TextBox(); + this.textBoxFoobarExtensions = new MediaPortal.UserInterface.Controls.MPTextBox(); + this.labelFoobarFileTypes = new MediaPortal.UserInterface.Controls.MPLabel(); + this.btnOK = new MediaPortal.UserInterface.Controls.MPButton(); + this.btnCancel = new MediaPortal.UserInterface.Controls.MPButton(); + this.groupBoxFoobarLocation.SuspendLayout(); + this.groupBoxFoobarSettings.SuspendLayout(); + this.SuspendLayout(); + // + // linkLabelPluginSource + // + this.linkLabelPluginSource.Anchor = + ((System.Windows.Forms.AnchorStyles) + (((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.linkLabelPluginSource.LinkArea = new System.Windows.Forms.LinkArea(37, 19); + this.linkLabelPluginSource.Location = new System.Drawing.Point(12, 254); + this.linkLabelPluginSource.Name = "linkLabelPluginSource"; + this.linkLabelPluginSource.Size = new System.Drawing.Size(392, 32); + this.linkLabelPluginSource.TabIndex = 5; + this.linkLabelPluginSource.TabStop = true; + this.linkLabelPluginSource.Text = + "NOTE: Remember to install and setup foo_httpserver_ctrl (version B1) in your foo" + + "bar\\components directory."; + this.linkLabelPluginSource.UseCompatibleTextRendering = true; + this.linkLabelPluginSource.LinkClicked += + new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabelPluginSource_LinkClicked); + // + // groupBoxFoobarLocation + // + this.groupBoxFoobarLocation.Anchor = + ((System.Windows.Forms.AnchorStyles) + (((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBoxFoobarLocation.Controls.Add(this.labelPortNumber); + this.groupBoxFoobarLocation.Controls.Add(this.textBoxPortNumber); + this.groupBoxFoobarLocation.Controls.Add(this.textBoxHostname); + this.groupBoxFoobarLocation.Controls.Add(this.buttonBrowseFoobarLoc); + this.groupBoxFoobarLocation.Controls.Add(this.textBoxFoobarPath); + this.groupBoxFoobarLocation.Controls.Add(this.labelHostname); + this.groupBoxFoobarLocation.Controls.Add(this.labelLocation); + this.groupBoxFoobarLocation.Location = new System.Drawing.Point(12, 12); + this.groupBoxFoobarLocation.Name = "groupBoxFoobarLocation"; + this.groupBoxFoobarLocation.Size = new System.Drawing.Size(392, 91); + this.groupBoxFoobarLocation.TabIndex = 7; + this.groupBoxFoobarLocation.TabStop = false; + this.groupBoxFoobarLocation.Text = "Location"; + // + // labelPortNumber + // + this.labelPortNumber.Anchor = + ((System.Windows.Forms.AnchorStyles) + ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.labelPortNumber.AutoSize = true; + this.labelPortNumber.Location = new System.Drawing.Point(293, 57); + this.labelPortNumber.Name = "labelPortNumber"; + this.labelPortNumber.Size = new System.Drawing.Size(26, 13); + this.labelPortNumber.TabIndex = 13; + this.labelPortNumber.Text = "Port"; + // + // textBoxPortNumber + // + this.textBoxPortNumber.Anchor = + ((System.Windows.Forms.AnchorStyles) + ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.textBoxPortNumber.BorderColor = System.Drawing.Color.Empty; + this.textBoxPortNumber.Enabled = false; + this.textBoxPortNumber.Location = new System.Drawing.Point(326, 54); + this.textBoxPortNumber.Name = "textBoxPortNumber"; + this.textBoxPortNumber.Size = new System.Drawing.Size(54, 20); + this.textBoxPortNumber.TabIndex = 11; + this.textBoxPortNumber.Text = "8989"; + this.textBoxPortNumber.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + // + // textBoxHostname + // + this.textBoxHostname.Anchor = + ((System.Windows.Forms.AnchorStyles) + (((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBoxHostname.BorderColor = System.Drawing.Color.Empty; + this.textBoxHostname.Enabled = false; + this.textBoxHostname.Location = new System.Drawing.Point(92, 54); + this.textBoxHostname.Name = "textBoxHostname"; + this.textBoxHostname.Size = new System.Drawing.Size(195, 20); + this.textBoxHostname.TabIndex = 10; + this.textBoxHostname.Text = "localhost"; + // + // buttonBrowseFoobarLoc + // + this.buttonBrowseFoobarLoc.Anchor = + ((System.Windows.Forms.AnchorStyles) + ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.buttonBrowseFoobarLoc.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.buttonBrowseFoobarLoc.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.buttonBrowseFoobarLoc.Location = new System.Drawing.Point(356, 19); + this.buttonBrowseFoobarLoc.Name = "buttonBrowseFoobarLoc"; + this.buttonBrowseFoobarLoc.Size = new System.Drawing.Size(24, 23); + this.buttonBrowseFoobarLoc.TabIndex = 8; + this.buttonBrowseFoobarLoc.Text = "..."; + this.buttonBrowseFoobarLoc.UseVisualStyleBackColor = true; + this.buttonBrowseFoobarLoc.Click += new System.EventHandler(this.buttonBrowseFoobarLoc_Click); + // + // textBoxFoobarPath + // + this.textBoxFoobarPath.Anchor = + ((System.Windows.Forms.AnchorStyles) + (((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBoxFoobarPath.BorderColor = System.Drawing.Color.Empty; + this.textBoxFoobarPath.Enabled = false; + this.textBoxFoobarPath.Location = new System.Drawing.Point(92, 21); + this.textBoxFoobarPath.Name = "textBoxFoobarPath"; + this.textBoxFoobarPath.Size = new System.Drawing.Size(252, 20); + this.textBoxFoobarPath.TabIndex = 12; + // + // labelHostname + // + this.labelHostname.AutoSize = true; + this.labelHostname.Location = new System.Drawing.Point(10, 57); + this.labelHostname.Name = "labelHostname"; + this.labelHostname.Size = new System.Drawing.Size(55, 13); + this.labelHostname.TabIndex = 9; + this.labelHostname.Text = "Hostname"; + // + // labelLocation + // + this.labelLocation.AutoSize = true; + this.labelLocation.Location = new System.Drawing.Point(10, 24); + this.labelLocation.Name = "labelLocation"; + this.labelLocation.Size = new System.Drawing.Size(76, 13); + this.labelLocation.TabIndex = 7; + this.labelLocation.Text = "foobar2k v.8.3"; + // + // groupBoxFoobarSettings + // + this.groupBoxFoobarSettings.Anchor = + ((System.Windows.Forms.AnchorStyles) + (((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBoxFoobarSettings.Controls.Add(this.linkLabelStartupParameter); + this.groupBoxFoobarSettings.Controls.Add(this.textBoxStartupParameter); + this.groupBoxFoobarSettings.Controls.Add(this.textBoxFoobarExtensions); + this.groupBoxFoobarSettings.Controls.Add(this.labelFoobarFileTypes); + this.groupBoxFoobarSettings.Location = new System.Drawing.Point(12, 109); + this.groupBoxFoobarSettings.Name = "groupBoxFoobarSettings"; + this.groupBoxFoobarSettings.Size = new System.Drawing.Size(392, 132); + this.groupBoxFoobarSettings.TabIndex = 8; + this.groupBoxFoobarSettings.TabStop = false; + this.groupBoxFoobarSettings.Text = "Settings"; + // + // linkLabelStartupParameter + // + this.linkLabelStartupParameter.AutoSize = true; + this.linkLabelStartupParameter.LinkArea = new System.Windows.Forms.LinkArea(8, 9); + this.linkLabelStartupParameter.Location = new System.Drawing.Point(13, 25); + this.linkLabelStartupParameter.Name = "linkLabelStartupParameter"; + this.linkLabelStartupParameter.Size = new System.Drawing.Size(95, 17); + this.linkLabelStartupParameter.TabIndex = 9; + this.linkLabelStartupParameter.TabStop = true; + this.linkLabelStartupParameter.Text = "Startup parameter"; + this.linkLabelStartupParameter.UseCompatibleTextRendering = true; + this.linkLabelStartupParameter.LinkClicked += + new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabelStartupParameter_LinkClicked); + // + // textBoxStartupParameter + // + this.textBoxStartupParameter.Anchor = + ((System.Windows.Forms.AnchorStyles) + (((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBoxStartupParameter.Location = new System.Drawing.Point(13, 45); + this.textBoxStartupParameter.Name = "textBoxStartupParameter"; + this.textBoxStartupParameter.Size = new System.Drawing.Size(367, 20); + this.textBoxStartupParameter.TabIndex = 7; + this.textBoxStartupParameter.Text = "/hide /command:\"Playback/Order/Default\""; + // + // textBoxFoobarExtensions + // + this.textBoxFoobarExtensions.Anchor = + ((System.Windows.Forms.AnchorStyles) + (((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBoxFoobarExtensions.BorderColor = System.Drawing.Color.Empty; + this.textBoxFoobarExtensions.Location = new System.Drawing.Point(13, 93); + this.textBoxFoobarExtensions.Name = "textBoxFoobarExtensions"; + this.textBoxFoobarExtensions.Size = new System.Drawing.Size(367, 20); + this.textBoxFoobarExtensions.TabIndex = 6; + this.textBoxFoobarExtensions.Text = ".cda,.mp3,.mid,.wav,.mpc,.aac,.shn,.wma,.ac3,.ogg"; + // + // labelFoobarFileTypes + // + this.labelFoobarFileTypes.AutoSize = true; + this.labelFoobarFileTypes.Location = new System.Drawing.Point(10, 77); + this.labelFoobarFileTypes.Name = "labelFoobarFileTypes"; + this.labelFoobarFileTypes.Size = new System.Drawing.Size(328, 13); + this.labelFoobarFileTypes.TabIndex = 5; + this.labelFoobarFileTypes.Text = "Supported file types (other files will be played by MP\'s internal player)"; + // + // btnOK + // + this.btnOK.Location = new System.Drawing.Point(248, 291); + this.btnOK.Name = "btnOK"; + this.btnOK.Size = new System.Drawing.Size(75, 23); + this.btnOK.TabIndex = 9; + this.btnOK.Text = "&OK"; + this.btnOK.UseVisualStyleBackColor = true; + this.btnOK.Click += new System.EventHandler(this.btnOK_Click); + // + // btnCancel + // + this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnCancel.Location = new System.Drawing.Point(329, 291); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size(75, 23); + this.btnCancel.TabIndex = 10; + this.btnCancel.Text = "&Cancel"; + this.btnCancel.UseVisualStyleBackColor = true; + this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); + // + // FoobarConfigForm + // + this.AcceptButton = this.btnOK; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.CancelButton = this.btnCancel; + this.ClientSize = new System.Drawing.Size(416, 326); + this.Controls.Add(this.btnCancel); + this.Controls.Add(this.btnOK); + this.Controls.Add(this.groupBoxFoobarSettings); + this.Controls.Add(this.groupBoxFoobarLocation); + this.Controls.Add(this.linkLabelPluginSource); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.Name = "FoobarConfigForm"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Foobar2000 - Setup"; + this.groupBoxFoobarLocation.ResumeLayout(false); + this.groupBoxFoobarLocation.PerformLayout(); + this.groupBoxFoobarSettings.ResumeLayout(false); + this.groupBoxFoobarSettings.PerformLayout(); + this.ResumeLayout(false); + } + + #endregion + + /// <summary> + /// This method is called whenever the browse button is clicked + /// </summary> + /// <param name="sender">the sender instance</param> + /// <param name="e">the event. In this case click!</param> + private void buttonBrowseFoobarLoc_Click(object sender, EventArgs e) + { + string curDir = Directory.GetCurrentDirectory(); + // The filter for the dialog window is foobar2000.exe + OpenFileDialog dlg = new OpenFileDialog(); + dlg.AddExtension = true; + dlg.Filter = "Foobar2000 (Foobar2000.exe)|Foobar2000.exe|All files (*.*)|*.*"; + // start in media folder + //dlg.InitialDirectory = @"C:\"; + // open dialog + if (dlg.ShowDialog(this) == DialogResult.OK) + { + textBoxFoobarPath.Text = dlg.FileName; + } + Directory.SetCurrentDirectory(curDir); + } + + /// <summary> + /// When this form loads, read the configuration file for the variables that this + /// form sets up + /// </summary> + private void LoadSettings() + { + using (Settings xmlreader = new MPSettings()) + { + textBoxFoobarExtensions.Text = xmlreader.GetValueAsString("foobarplugin", "enabledextensions", + ".cda,.mp3,.mid,.wav,.mpc,.aac,.shn,.wma,.ac3,.ogg"); + textBoxPortNumber.Text = xmlreader.GetValueAsString("foobarplugin", "port", "8989"); + textBoxHostname.Text = xmlreader.GetValueAsString("foobarplugin", "host", "localhost"); + textBoxFoobarPath.Text = xmlreader.GetValueAsString("foobarplugin", "path", ""); + textBoxStartupParameter.Text = xmlreader.GetValueAsString("foobarplugin", "startupparameter", + "/hide /command:\"Playback/Order/Default\""); + } + if (textBoxFoobarPath.Text.Equals(String.Empty)) + { + using (RegistryKey pRegKey = Registry.CurrentUser) + { + using (RegistryKey subkey = pRegKey.OpenSubKey("Software\\foobar2000")) + { + if (subkey != null) + { + Object val = subkey.GetValue("InstallDir"); + if (val.ToString().Trim().Length > 0) + { + textBoxFoobarPath.Text = val.ToString() + "\\foobar2000.exe"; + } + } + else + { + MessageBox.Show( + "Foobar2000 is not installed on your system!\r\nPlease install it first before actually trying to use this plugin!", + "Foobar2000 plugin error", MessageBoxButtons.OK, MessageBoxIcon.Error); + Close(); + } + } + } + } + } + + /// <summary> + /// Write the variables from the form to the configuration file when this form closes + /// </summary> + private void SaveSettings() + { + using (Settings xmlWriter = new MPSettings()) + { + xmlWriter.SetValue("foobarplugin", "port", textBoxPortNumber.Text); + xmlWriter.SetValue("foobarplugin", "host", textBoxHostname.Text); + xmlWriter.SetValue("foobarplugin", "path", textBoxFoobarPath.Text); + xmlWriter.SetValue("foobarplugin", "startupparameter", textBoxStartupParameter.Text); + // make sure all the extensions starts with "." If not, add it in... + string[] exts = textBoxFoobarExtensions.Text.Split(new char[] {','}); + StringBuilder buff = new StringBuilder(); + foreach (string ext in exts) + { + if (buff.Length != 0) + { + buff.Append(','); + } + if (!ext.StartsWith(".")) + { + buff.Append('.'); + } + buff.Append(ext); + } + xmlWriter.SetValue("foobarplugin", "enabledextensions", buff.ToString()); + } + } + + private void linkLabelStartupParameter_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + // Determine which link was clicked within the LinkLabel. + this.linkLabelStartupParameter.Links[linkLabelStartupParameter.Links.IndexOf(e.Link)].Visited = true; + try + { + Help.ShowHelp(this, "http://wiki.hydrogenaudio.org/index.php?title=Foobar2000:Commandline_Guide"); + } + catch {} + } + + /// <summary> + /// The link will open the link on a browser to get the foobar plugin from the source + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + private void linkLabelPluginSource_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + // Determine which link was clicked within the LinkLabel. + this.linkLabelPluginSource.Links[linkLabelPluginSource.Links.IndexOf(e.Link)].Visited = true; + try + { + Help.ShowHelp(this, "http://sourceforge.net/projects/foohttpserver"); + } + catch {} + } + + private void btnOK_Click(object sender, EventArgs e) + { + SaveSettings(); + this.Close(); + } + + private void btnCancel_Click(object sender, EventArgs e) + { + LoadSettings(); + this.Close(); + } + } +} \ No newline at end of file Added: trunk/plugins/FoobarExternalPlayers/FoobarExternalPlayers/FoobarConfigForm.resx =================================================================== --- trunk/plugins/FoobarExternalPlayers/FoobarExternalPlayers/FoobarConfigForm.resx (rev 0) +++ trunk/plugins/FoobarExternalPlayers/FoobarExternalPlayers/FoobarConfigForm.resx 2010-11-14 15:51:46 UTC (rev 3935) @@ -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.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> +</root> \ No newline at end of file Added: trunk/plugins/FoobarExternalPlayers/FoobarExternalPlayers/FoobarExternalPlayers.csproj =================================================================== --- trunk/plugins/FoobarExternalPlayers/FoobarExternalPlayers/FoobarExternalPlayers.csproj (rev 0) +++ trunk/plugins/FoobarExternalPlayers/FoobarExternalPlayers/FoobarExternalPlayers.csproj 2010-11-14 15:51:46 UTC (rev 3935) @@ -0,0 +1,70 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>8.0.30703</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{D4BB2A55-2F02-4AB2-B86C-891388E3C616}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>FoobarExternalPlayers</RootNamespace> + <AssemblyName>FoobarExternalPlayers</AssemblyName> + <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + </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> + </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> + <Compile Include="FoobarConfigForm.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="FoobarPlugin.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <ItemGroup> + <Content Include="foobarlogo.png" /> + <Content Include="foobarlogodisabled.png" /> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="FoobarConfigForm.resx"> + <DependentUpon>FoobarConfigForm.cs</DependentUpon> + </EmbeddedResource> + </ItemGroup> + <ItemGroup> + <Reference Include="Core"> + <HintPath>..\..\..\..\..\MediaPortal\trunk\mediaportal\Core\bin\Release\Core.dll</HintPath> + </Reference> + <Reference Include="System" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Net" /> + <Reference Include="System.Web" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="Utils"> + <HintPath>..\..\..\..\..\MediaPortal\trunk\mediaportal\Utils\bin\Release\Utils.dll</HintPath> + </Reference> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\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 Added: trunk/plugins/FoobarExternalPlayers/FoobarExternalPlayers/FoobarPlugin.cs =================================================================== --- trunk/plugins/FoobarExternalPlayers/FoobarExternalPlayers/FoobarPlugin.cs (rev 0) +++ trunk/plugins/FoobarExternalPlayers/FoobarExternalPlayers/FoobarPlugin.cs 2010-11-14 15:51:46 UTC (rev 3935) @@ -0,0 +1,773 @@ +#region Copyright (C) 2005-2010 Team MediaPortal + +// Copyright (C) 2005-2010 Team MediaPortal +// http://www.team-mediaportal.com +// +// MediaPortal is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 2 of the License, or +// (at your option) any later version. +// +// MediaPortal is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with MediaPortal. If not, see <http://www.gnu.org/licenses/>. + +#endregion + +using System; +using System.Diagnostics; +using System.IO; +using System.Net; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading; +using System.Web; +using MediaPortal.Configuration; +using MediaPortal.GUI.Library; +using MediaPortal.Player; +using MediaPortal.Profile; +using MediaPortal.Util; + +namespace MediaPortal.FoobarPlugin +{ + /// <summary> + /// Foobar plugin class + /// </summary> + [PluginIcons("ExternalPlayers.Foobar.foobarlogo.png", "ExternalPlayers.Foobar.foobarlogodisabled.png")] + public class FoobarPlugin : IExternalPlayer + { + private const int WM_HTTPSERVER_MSG_CMD = 0x8898; + private const int WM_HTTPSERVER_MSG_GETSTATE = 0x00; + private const int WM_HTTPSERVER_MSG_GETPLAYLENGTH = 0x01; + private const int WM_HTTPSERVER_MSG_GETPLAYBACKTIME = 0x02; + private const int WM_HTTPSERVER_MSG_STOP = 0x03; + private const int WM_HTTPSERVER_MSG_PAUSE = 0x04; + private const int WM_HTTPSERVER_MSG_SETVOLUME = 0x05; + private const int WM_HTTPSERVER_MSG_GETVOLUME = 0x06; + private const int WM_HTTPSERVER_MSG_SEEK = 0x07; + private const int WM_HTTPSERVER_MSG_SETACTIVEPLAYLIST = 0x08; + private const int WM_HTTPSERVER_MSG_CLEARPLAYLIST = 0x09; + private const int WM_COPYDATA = 0x004a; + + private const string m_author = "int_20h/rtv"; + private const string m_player = "Foobar2000"; + private const string m_version = "2.0b"; + + // set in configuration + private string[] m_supportedExtensions = new string[0]; + private string m_execPath = null; + private string m_hostname = "localhost"; + private int m_port = 8989; + private string m_startupparameter = null; + private string m_windowName = null; + + // internally maintain + private string m_strCurrentFile = null; + + private Process m_foobarProcess = null; + private IntPtr m_hwnd = IntPtr.Zero; + private IntPtr m_hwndPlugin = IntPtr.Zero; + private bool m_bStoppedManualy = false; + private bool _notifyPlaying = false; + private bool _isCDA = false; + + /// <summary> + /// Empty constructor. Nothing to initialize + /// </summary> + public FoobarPlugin() + { + //Thread.CurrentThread.Name = "FoobarPlugin"; + // empty constructor + } + + /// <summary> + /// Starts the player if it is not running... + /// </summary> + private void startPlayerIfNecessary() + { + if (m_execPath != null && m_execPath.Length > 0) + { + if (!string.IsNullOrEmpty(m_windowName)) + { + m_hwnd = Win32API.FindWindow(null, m_windowName); + m_hwndPlugin = Win32API.FindWindow("foo_httpserver_ctrl", null); + } + if (m_hwnd.ToInt32() <= 0) // try to find it and start it since it's not found + { + IntPtr mpHwnd = Win32API.GetActiveWindow(); + RunProgram(m_execPath, m_startupparameter); + Log.Info("ExternalPlayers: Started foobar2000 with {0}", m_startupparameter); + Win32API.ShowWindow(mpHwnd, Win32API.ShowWindowFlags.Restore); + Win32API.SetForegroundWindow(mpHwnd); + m_hwnd = Win32API.FindWindow(null, m_windowName); + m_hwndPlugin = Win32API.FindWindow("foo_httpserver_ctrl", null); + } + } + } + + + /// <summary> + /// Runs a particular program in the local file system + /// </summary> + /// <param name="exeName"></param> + /// <param name="argsLine"></param> + private void RunProgram(string exeName, string argsLine) + { + ProcessStartInfo psI = new ProcessStartInfo(exeName, argsLine); + Process newProcess = new Process(); + try + { + newProcess.StartInfo.FileName = exeName; + newProcess.StartInfo.Arguments = argsLine; + newProcess.StartInfo.UseShellExecute = true; + newProcess.StartInfo.CreateNoWindow = true; + newProcess.StartInfo.WindowStyle = ProcessWindowStyle.Minimized; + newProcess.Start(); + + IntPtr httpPluginWindow; + for (int i = 0; i < (2 * 6); i++) // wait 6 seconds for Foobar2k to start. + { + Thread.Sleep(500); + httpPluginWindow = Win32API.FindWindow("foo_httpserver_ctrl", null); + if (httpPluginWindow.ToInt32() > 0) // window handle was found + { + break; + } + } + m_foobarProcess = newProcess; + } + catch (Exception ex) + { + throw ex; + } + } + + /// <summary> + /// Read the configuration file for parameters needed for the plugin to function correctly + /// </summary> + private void readConfig() + { + string strExt = null; + string execPath = null; + string hostname = null; + string port = null; + string windowName = null; + string startupparameter = null; + + using (Settings xmlreader = new MPSettings()) + { + // extensions to play by this player + strExt = xmlreader.GetValueAsString("foobarplugin", "enabledextensions", ""); + // where is foobar executable + execPath = xmlreader.GetValueAsString("foobarplugin", "path", ""); + // which host to talk to + hostname = xmlreader.GetValueAsString("foobarplugin", "host", "localhost"); + // which port to talk to + port = xmlreader.GetValueAsString("foobarplugin", "port", "8989"); + // what's the window name of the program + windowName = xmlreader.GetValueAsString("foobarplugin", "windowname", ""); + // additional startup options + startupparameter = xmlreader.GetValueAsString("foobarplugin", "startupparameter", + " /hide /command:\"Playback/ReplayGain/Album\""); + } + if (strExt != null && strExt.Length > 0) + { + m_supportedExtensions = strExt.Split(new char[] { ',' }); + } + if (execPath != null && execPath.Length > 0) + { + m_execPath = execPath; + } + if (hostname != null && hostname.Length > 0) + { + m_hostname = hostname; + } + if (port != null && port.Length > 0) + { + try + { + m_port = Convert.ToInt32(port); + } + catch { } + } + if (startupparameter != null && startupparameter.Length > 0) + { + m_startupparameter = startupparameter; + } + if (windowName != null && windowName.Length > 0) + { + m_windowName = windowName; + } + else + { + // lets figure it out by openning the installer.ini file and look at the version. + // The window name is "foobar2000 v<version>" so, if we need to find the window, + // we need the version number! + StringBuilder buff = new StringBuilder(); + StreamReader sr = null; + string version = null; + + try + { + string path = m_execPath.ToLower(); + int index = path.LastIndexOf("foobar"); + string iniFile = m_execPath.Substring(0, index) + "installer.ini"; + + //Pass the file path and file name to the StreamReader constructor + using (sr = new StreamReader(iniFile)) + { + //Read the first line of text + string line = sr.ReadLine(); + //Continue to read until you reach end of file + + while (line != null) + { + if (line.ToLower().Trim().StartsWith("version")) + { + index = line.IndexOf("="); + version = line.Substring(index + 1).Trim(); + } + //Read the next line + line = sr.ReadLine(); + } + //close the file + sr.Close(); + } + } + catch (Exception e) + { + Console.WriteLine("Exception: " + e.Message); + } + if (sr != null) + { + sr.Close(); + sr = null; + } + + if (version != null) + { + m_windowName = "foobar2000 v" + version; + } + } + } + + /// <summary> + /// This method performs the GET method via HTTP to request a specific page + /// </summary> + /// <param name="strURL">The URL to get a request from</param> + /// <returns></returns> + private string GetHTTP(string strURL) + { + string retval = null; + + // Initialize the WebRequest. + WebRequest myRequest = WebRequest.Create(strURL); + try + { + // Use the current user in case an NTLM Proxy or similar is used. + // wr.Proxy = WebProxy.GetDefaultProxy(); + myRequest.Proxy.Credentials = CredentialCache.DefaultCredentials; + } + catch (Exception) { } + + // Return the response. + WebResponse myResponse = myRequest.GetResponse(); + + Stream ReceiveStream = myResponse.GetResponseStream(); + + // 1252 is encoding for Windows format + Encoding encode = Encoding.GetEncoding(1252); + using (StreamReader sr = new StreamReader(ReceiveStream, encode)) + { + retval = sr.ReadToEnd(); + } + + + // Close the response to free resources. + myResponse.Close(); + + return retval; + } + + /// <summary> + /// Executes the given command and pass the given parameters to the foobar httpserver plugin + /// </summary> + /// <param name="command">The command to execute in foobar</param> + /// <param name="param1">The first parameter if necessary</param> + /// <param name="param2">The second parameter if necessary</param> + /// <returns></returns> + private string ExecuteCommand(string command, string param1, string param2) + { + if (command == null || command.Length == 0) + { + return ""; + } + if (m_execPath == null || m_execPath.Length == 0) + { + return "ERROR: MP plugin not configured"; + } + + string retval = null; + string url = "http://" + m_hostname + ":" + m_port + "/?cmd=" + command + "¶m1=" + param1 + "¶m2=" + + param2; + string response = GetHTTP(url); + + // the command is good and was executed correctly + if (response.IndexOf("cmd=" + command) != -1) + { + string val = "retval="; + int cmdValueIndex = response.IndexOf(val) + val.Length; + retval = response.Substring(cmdValueIndex).Trim(); + } + else + { + retval = "ERROR: mismatch command"; + } + return retval; + } + + /// <summary> + /// Supported extensions are defined in the configuration of the plugin. Therefore, + /// this is taken from the configuration file of MediaPortal to what the user + /// defines it + /// </summary> + /// <returns>A string array of all the extensions supported (i.e. .mp3 .cda .mid</returns> + public override string[] GetAllSupportedExtensions() + { + readConfig(); + return m_supportedExtensions; + } + + /// <summary> + /// This method is called by the plugin screen to show the configuration for the foobar plugin + /// </summary> + public override void ShowPlugin() + { + FoobarConfigForm confForm = new FoobarConfigForm(); + confForm.ShowDialog(); + } + + /// <summary> + /// Description property + /// </summary> + /// <returns></returns> + public override string Description() + { + if (m_supportedExtensions.Length == 0) + { + return "Advanced audio player - http://www.foobar2000.org"; + } + return base.Description(); + } + + /// <summary> + /// Author property. Only Get is defined. + /// </summary> + public override string AuthorName + { + get { return m_author; } + } + + + /// <summary> + /// Player name property. Only Get is defined. + /// </summary> + public override string PlayerName + { + get { return m_player; } + } + + /// <summary> + /// Version number property + /// </summary> + public override string VersionNumber + { + get { return m_version; } + } + + /// <summary> + /// This method is called to find out if this plugin supports a given filename. The + /// method uses the extension to figure out if it supports it + /// </summary> + /// <param name="filename">The filename to check if the plugin supports it.</param> + /// <returns>True or false depending if the file is supported or not</returns> + public override bool SupportsFile(string filename) + { + readConfig(); + string ext = null; + int dot = filename.LastIndexOf("."); // couldn't find the dot to get the extension + if (dot == -1) + { + return false; + } + + ext = filename.Substring(dot).Trim(); + if (ext.Length == 0) + { + return false; // no extension so return false; + } + + ext = ext.ToLower(); + + for (int i = 0; i < m_supportedExtensions.Length; i++) + { + if (m_supportedExtensions[i].Equals(ext)) + { + return true; + } + } + // could not match the extension, so return false; + return false; + } + + /// <summary> + /// Play the given file + /// </summary> + /// <param name="strFile"></param> + /// <returns></returns> + public override bool Play(string strFile) + { + // stop other media which might be active until now. + if (g_Player.Playing) + { + g_Player.Stop(); + } + + + _isCDA = false; + if (strFile.IndexOf(".cda") >= 0) + { + string strTrack = ""; + int pos = strFile.IndexOf(".cda"); + if (pos >= 0) + { + pos--; + while (Char.IsDigit(strFile[pos]) && pos > 0) + { + strTrack = strFile[pos] + strTrack; + pos--; + } + } + + string strDrive = strFile.Substring(0, 1); + strDrive += ":"; + strFile = String.Format("{0}Track{1}.cda", strDrive, strTrack); + _isCDA = true; + } + try + { + m_bStoppedManualy = false; + // check if the player is running, if not run it. + startPlayerIfNecessary(); + + string playListName = "MPPlaylist"; + Win32API.COPYDATASTRUCT cds; + cds.dwData = (IntPtr)1; // find/create playlist + cds.lpData = Marshal.StringToCoTaskMemAnsi(playListName); + cds.cbData = playListName.Length + 1; + + // create the playlist or switch to it if there + int index = Win32API.SendMessage(m_hwndPlugin, WM_COPYDATA, 0, ref cds); + Marshal.FreeCoTaskMem(cds.lpData); + + // set the playlist as the active one + Win32API.SendMessageA(m_hwndPlugin, WM_HTTPSERVER_MSG_CMD, WM_HTTPSERVER_MSG_SETACTIVEPLAYLIST, index); + + // Clear playlist + Win32API.SendMessageA(m_hwndPlugin, WM_HTTPSERVER_MSG_CMD, WM_HTTPSERVER_MSG_CLEARPLAYLIST, 0); + + + Encoding encode = Encoding.Default; + // Let's encode the filename so any extended ASCII character is played correctly + // by the Foobar Plugin + byte[] byData = encode.GetBytes(HttpUtility.UrlEncode(strFile).Replace("+", "%20")); + cds.dwData = (IntPtr)0; // Play song + cds.lpData = Marshal.AllocCoTaskMem(byData.Length + 1); + cds.cbData = byData.Length + 1; + // write all the bytes to the lpData byte by byte + for (int i = 0; i < byData.Length; ++i) + { + Marshal.WriteByte(cds.lpData, i, byData[i]); + } + // write the end of string '\0' + Marshal.WriteByte(cds.lpData, byData.Length, (byte)0); + if (Win32API.SendMessage(m_hwndPlugin, WM_COPYDATA, 0, ref cds) == 0) + { + Marshal.FreeCoTaskMem(cds.lpData); + Thread.Sleep(1000); // wait for 1 secs so that foobar starts playing + m_strCurrentFile = strFile; + _notifyPlaying = true; + return true; + } + else + { + _notifyPlaying = false; + Marshal.FreeCoTaskMem(cds.lpData); + return false; + } + } + catch + { + return false; + } + } + + /// <summary> + /// This method returns the Duration of the current song that is been played + /// </summary> + public override double Duration + { + get { return Win32API.SendMessageA(m_hwndPlugin, WM_HTTPSERVER_MSG_CMD, WM_HTTPSERVER_MSG_GETPLAYLENGTH, 0); } + } + + /// <summary> + /// This method returns the current play back time of the song + /// </summary> + public override double CurrentPosition + { + get { return Win32API.SendMessageA(m_hwndPlugin, WM_HTTPSERVER_MSG_CMD, WM_HTTPSERVER_MSG_GETPLAYBACKTIME, 0); } + } + + + /// <summary> + /// This method pauses the currently played song + /// </summary> + public override void Pause() + { + // pause + Win32API.SendMessageA(m_hwndPlugin, WM_HTTPSERVER_MSG_CMD, WM_HTTPSERVER_MSG_PAUSE, 0); + } + + /// <summary> + /// This method returns if the player is in paused state + /// </summary> + public override bool Paused + { + get + { + int state = Win32API.SendMessageA(m_hwndPlugin, WM_HTTPSERVER_MSG_CMD, WM_HTTPSERVER_MSG_GETSTATE, 0); + return (state == 1); + } + } + + + /// <summary> + /// This method returns if the player is in playing state + /// </summary> + public override bool Playing + { + get + { + int state = Win32API.SendMessageA(m_hwndPlugin, WM_HTTPSERVER_MSG_CMD, WM_HTTPSERVER_MSG_GETSTATE, 0); + return (state == 0); + } + } + + + public override bool Ended + { + get + { + if (m_bStoppedManualy) + { + return false; + } + + int state = Win32API.SendMessageA(m_hwndPlugin, WM_HTTPSERVER_MSG_CMD, WM_HTTPSERVER_MSG_GETSTATE, 0); + return (state == 2); + } + } + + public override void Dispose() + { + + } + + + /// <summary> + /// This method returns if the player is in stop state + /// </summary> + public override bool Stopped + { + get + { + if (!m_bStoppedManualy) + { + return false; + } + int state = Win32API.SendMessageA(m_hwndPlugin, WM_HTTPSERVER_MSG_CMD, WM_HTTPSERVER_MSG_GETSTATE, 0); + return (state == 2); + } + } + + + /// <summary> + /// This method returns the file that is been played + /// </summary> + public override string CurrentFile + { + get { return m_strCurrentFile; } + } + + /// <summary> + /// This method stops the player from the played song + /// </summary> + public override void Stop() + { + m_bStoppedManualy = true; + Win32API.SendMessageA(m_hwndPlugin, WM_HTTPSERVER_MSG_CMD, WM_HTTPSERVER_MSG_STOP, 0); + _notifyPlaying = false; + } + + + /// <summary> + /// Volume property for the player + /// </summary> + public override int Volume + { + // GetVolume + get + { + return Win32API.SendMessageA(m_hwndPlugin, WM_HTTPSERVER_MSG_CMD, WM_HTTPSERVER_MSG_GETVOLUME, 0); + } + set + { + Win32API.SendMessageA(m_hwndPlugin, WM_HTTPSERVER_MSG_CMD, WM_HTTPSERVER_MSG_SETVOLUME, value); + } + } + + /// <summary> + /// Seek a relative time in the song from the current position + /// </summary> + /// <param name="dTime">time in seconds</param> + public override void SeekRelative(double dTime) + { + try + { + double dCurTime = CurrentPosition; + dTime = dCurTime + dTime; + if (dTime < 0.0d) + { + dTime = 0.0d; + } + if (dTime < Duration) + { + Win32API.SendMessageA(m_hwndPlugin, WM_HTTPSERVER_MSG_CMD, WM_HTTPSERVER_MSG_SEEK, (int)dTime); + } + } + catch { } + } + + /// <summary> + /// Seek a time in the song from the beginning of the song + /// </summary> + /// <param name="dTime">time in seconds</param> + public override void SeekAbsolute(double dTime) + { + try + { + // seek + if (dTime < 0.0d) + { + dTime = 0.0d; + } + if (dTime < Duration) + { + Win32API.SendMessageA(m_hwndPlugin, WM_HTTPSERVER_MSG_CMD, WM_HTTPSERVER_MSG_SEEK, (int)dTime); + } + } + catch { } + } + + /// <summary> + /// Seek a relative time in the song from the current position as a percentage + /// </summary> + /// <param name="iPercentage">percentage amount</param> + public override void SeekRelativePercentage(int iPercentage) + { + double dCurrentPos = CurrentPosition; + double dDuration = Duration; + + double fCurPercent = (dCurrentPos / Duration) * 100.0d; + double fOnePercent = Duration / 100.0d; + fCurPercent = fCurPercent + (double)iPercentage; + fCurPercent *= fOnePercent; + if (fCurPercent < 0.0d) + { + fCurPercent = 0.0d; + } + if (fCurPercent < Duration) + { + try + { + Win32API.SendMessageA(m_hwndPlugin, WM_HTTPSERVER_MSG_CMD, WM_HTTPSERVER_MSG_SEEK, (int)fCurPercent); + } + catch { } + } + } + + /// <summary> + /// Seek a time in the song from the beginning of the song as a percentage + /// </summary> + /// <param name="iPercentage">percentage amount</param> + public override void SeekAsolutePercentage(int iPercentage) + { + if (iPercentage < 0) + { + iPercentage = 0; + } + if (iPercentage >= 100) + { + iPercentage = 100; + } + double fPercent = Duration / 100.0f; + fPercent *= (double)iPercentage; + try + { + Win32API.SendMessageA(m_hwndPlugin, WM_HTTPSERVER_MSG_CMD, WM_HTTPSERVER_MSG_SEEK, (int)fPercent); + } + catch { } + } + + + /// <summary> + /// The main entry point for testing this class stand alone. + /// </summary> + [STAThread] + private static void Main(string[] args) + { + // + // TODO: Add code to start application here + // + FoobarPlugin plugin = new FoobarPlugin(); + plugin.Stop(); + } + + public override void Process() + { + if (!Playing) + { + return; + } + + if (_notifyPlaying && CurrentPosition >= 10.0) + { + _notifyPlaying = false; + GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_PLAYING_10SEC, 0, 0, 0, 0, 0, null); + msg.Label = CurrentFile; + GUIWindowManager.SendThreadMessage(msg); + } + } + + public override bool IsCDA + { + get { return _isCDA; } + } + } + + // public class FoobarPlugin : MediaPortal.Player.IExternalPlayer +} \ No newline at end of file Added: trunk/plugins/FoobarExternalPlayers/FoobarExternalPlayers/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/FoobarExternalPlayers/FoobarExternalPlayers/Properties/AssemblyInfo.cs (rev 0) +++ trunk/plugins/FoobarExternalPlayers/FoobarExternalPlayers/Properties/AssemblyInfo.cs 2010-11-14 15:51:46 UTC (rev 3935) @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// Allgemeine Informationen über eine Assembly werden über die folgenden +// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, +// die mit einer Assembly verknüpft sind. +[assembly: AssemblyTitle("FoobarExternalPlayers")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("FoobarExternalPlayers")] +[assembly: AssemblyCopyright("Copyright © 2010")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar +// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von +// COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest. +[assembly: ComVisible(false)] + +// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird +[assembly: Guid("af1e0c52-abc6-4685-9a4f-af6d6c9a59a6")] + +// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: +// +// Hauptversion +// Nebenversion +// Buildnummer +// Revision +// +// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern +// übernehmen, indem Sie "*" eingeben: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] Added: trunk/plugins/FoobarExternalPlayers/FoobarExternalPlayers/foobarlogo.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/FoobarExternalPlayers/FoobarExternalPlayers/foobarlogo.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/FoobarExternalPlayers/FoobarExternalPlayers/foobarlogodisabled.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/FoobarExternalPlayers/FoobarExternalPlayers/foobarlogodisabled.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/FoobarExternalPlayers/FoobarExternalPlayers.sln =================================================================== --- trunk/plugins/FoobarExternalPlayers/FoobarExternalPlayers.sln (rev 0) +++ trunk/plugins/FoobarExternalPlayers/FoobarExternalPlayers.sln 2010-11-14 15:51:46 UTC (rev 3935) @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FoobarExternalPlayers", "FoobarExternalPlayers\FoobarExternalPlayers.csproj", "{D4BB2A55-2F02-4AB2-B86C-891388E3C616}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSect... [truncated message content] |
From: <hwa...@us...> - 2011-02-12 16:50:22
|
Revision: 4103 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4103&view=rev Author: hwahrmann Date: 2011-02-12 16:50:15 +0000 (Sat, 12 Feb 2011) Log Message: ----------- Initial import of version 1.0 Added Paths: ----------- trunk/plugins/MusicRatingUpdater/ trunk/plugins/MusicRatingUpdater/MusicRatingUpdater/ trunk/plugins/MusicRatingUpdater/MusicRatingUpdater/MusicRatingUpdater.cs trunk/plugins/MusicRatingUpdater/MusicRatingUpdater/MusicRatingUpdater.csproj trunk/plugins/MusicRatingUpdater/MusicRatingUpdater/MusicRatingUpdater.csproj.user trunk/plugins/MusicRatingUpdater/MusicRatingUpdater/MusicRatingUpdaterSettings.Designer.cs trunk/plugins/MusicRatingUpdater/MusicRatingUpdater/MusicRatingUpdaterSettings.cs trunk/plugins/MusicRatingUpdater/MusicRatingUpdater/MusicRatingUpdaterSettings.resx trunk/plugins/MusicRatingUpdater/MusicRatingUpdater/Properties/ trunk/plugins/MusicRatingUpdater/MusicRatingUpdater/Properties/AssemblyInfo.cs trunk/plugins/MusicRatingUpdater/MusicRatingUpdater.sln trunk/plugins/MusicRatingUpdater/setup/ trunk/plugins/MusicRatingUpdater/setup/MusicRatingUpdater.xmp2 Added: trunk/plugins/MusicRatingUpdater/MusicRatingUpdater/MusicRatingUpdater.cs =================================================================== --- trunk/plugins/MusicRatingUpdater/MusicRatingUpdater/MusicRatingUpdater.cs (rev 0) +++ trunk/plugins/MusicRatingUpdater/MusicRatingUpdater/MusicRatingUpdater.cs 2011-02-12 16:50:15 UTC (rev 4103) @@ -0,0 +1,406 @@ +#region Copyright (C) 2011 Helmut Wahrmann +// Copyright (C) 2011 Helmut Wahrmann +// http://www.team-mediaportal.com +// +// MPTagThat is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 2 of the License, or +// (at your option) any later version. +// +// MPTagThat is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with MediaPortal. If not, see <http://www.gnu.org/licenses/>. +#endregion +#region + +using System; +using System.Collections.Generic; +using System.IO; +using System.Threading; +using MediaPortal.Configuration; +using MediaPortal.GUI.Library; +using MediaPortal.Music.Database; +using MediaPortal.Profile; +using MediaPortal.Services; +using MediaPortal.Threading; +using SQLite.NET; +using TagLib; +using TagLib.Id3v2; +using File = TagLib.File; +using Tag = TagLib.Id3v2.Tag; +using Timer = System.Windows.Forms.Timer; + +#endregion + +namespace MediaPortal.Plugins +{ + public class MusicRatingUpdater : IPlugin, ISetupForm + { + #region Variables + + private delegate void ThreadSafeDelegate(); + + private bool _run; + private string _ratingType; + private readonly bool _updateRealTime; + private readonly MusicDatabase mDB; + private MusicRatingUpdaterSettings _config; + private readonly Dictionary<string, int> _pendingUpdates = new Dictionary<string, int>(); + private Timer _updateTimer; + + #endregion + + #region ctor + + public MusicRatingUpdater() + { + // load settings + using (Settings reader = new Settings(Config.GetFile(Config.Dir.Config, "mediaportal.xml"))) + { + _ratingType = reader.GetValueAsString("musicratingupdater", "ratingtype", "star"); + _updateRealTime = reader.GetValueAsBool("musicratingupdater", "realtimeupdate", false); + } + + mDB = MusicDatabase.Instance; + } + + #endregion + + #region Methods + + /// <summary> + /// The Rating Change event has been fired. + /// Update the file with the rating. + /// </summary> + /// <param name = "sender"></param> + /// <param name = "filePath"></param> + /// <param name = "rating"></param> + private void OnMusicRatingChanged(object sender, string filePath, int rating) + { + if (!_updateRealTime) + { + return; + } + + if (_pendingUpdates.ContainsKey(filePath)) + { + // When we have already the file in the table, then the user changed the rating already before + // remove the old rating + _pendingUpdates.Remove(filePath); + } + _pendingUpdates.Add(filePath, rating); + Log.Info("MusicRatingUpdater: Queued rating for {0}. File will be updated when playback finishes.", filePath); + + if (_updateTimer == null) + { + _updateTimer = new Timer(); + _updateTimer.Interval = 20000; + _updateTimer.Tick += ProcessPendingUpdates; + _updateTimer.Start(); + } + } + + public void StartBatchUpdate() + { + // The rating Type might have been changed on the form + _ratingType = _config.RatingType; + + _run = true; + Work work = new Work(BatchUpdate); + work.ThreadPriority = ThreadPriority.Lowest; + work.Description = "MusicRatingUpdater Thread"; + GlobalServiceProvider.Get<IThreadPool>().Add(work, QueuePriority.Low); + } + + public void StopBatchUpdate() + { + _run = false; + } + + /// <summary> + /// Updates the files in the shares with the ratings of the Music Database + /// </summary> + private void BatchUpdate() + { + //Make calls to our SettiongsForm + if (_config.StatusLabel.InvokeRequired) + { + ThreadSafeDelegate d = BatchUpdate; + _config.StatusLabel.Invoke(d, new object[] {}); + return; + } + + Log.Info("MusicRatingUpdater: Batch Update of ratings started"); + List<Song> songs = new List<Song>(); + mDB.GetSongsWithRating(ref songs); + + int i = 0; + foreach (Song song in songs) + { + if (!_run) + { + Log.Info("MusicRatingUpdater: Update stopped by user"); + break; + } + i++; + _config.StatusLabel.Text = string.Format("Updating ratings for file {0} of {1}", i, songs.Count); + SetRating(song.FileName, song.Rating); + } + Log.Info("MusicRatingUpdater: Batch Update of ratings ended"); + } + + /// <summary> + /// Update the file with the specified rating + /// </summary> + /// <param name = "filePath"></param> + /// <param name = "rating"></param> + private void SetRating(string filePath, int rating) + { + Log.Info("MusicRatingUpdater: Set rating of file {0} to {1}", filePath, rating); + + // Read the Tag + try + { + ByteVector.UseBrokenLatin1Behavior = true; + File file = File.Create(filePath); + + string tagType = file.MimeType.Substring(file.MimeType.IndexOf("/") + 1); + if (tagType.ToLower() == "mp3") + { + Tag id3v2tag = file.GetTag(TagTypes.Id3v2) as Tag; + // Only write POPM tags, if we have an ID3 V2 Tag + // We don't want to have an mp3 file with + if (id3v2tag != null) + { + if (_ratingType == "star") + { + // Look for a POPM Frame written by Mediaportal or MPTagThat first + PopularimeterFrame popmFrame = PopularimeterFrame.Get(id3v2tag, "MediaPortal", + false); + if (popmFrame == null) + { + popmFrame = PopularimeterFrame.Get(id3v2tag, "MPTagThat", false); + if (popmFrame == null) + { + // Lets's create a POPM Frame now + popmFrame = PopularimeterFrame.Get(id3v2tag, "MediaPortal", true); + } + } + + // Now check, if the new rating is different to the stored one and only save it then + if (rating != popmFrame.Rating) + { + popmFrame.Rating = Convert.ToByte(rating); + file.Save(); + } + } + else + { + // Look for POPM written by WMP and create one, if not present + PopularimeterFrame popmFrame = PopularimeterFrame.Get(id3v2tag, + "Windows Media Player 9 Series", + true); + if (popmFrame != null) + { + int i = 0; + if (rating == 5) + i = 255; + else if (rating == 4) + i = 196; + else if (rating == 3) + i = 128; + else if (rating == 2) + i = 64; + else if (rating == 1) + i = 1; + + // Now check, if the new rating is different to the stored one and only save it then + if (i != popmFrame.Rating) + { + popmFrame.Rating = Convert.ToByte(i); + file.Save(); + } + } + } + } + } + } + catch (CorruptFileException) + { + Log.Warn("MusicRatingUpdater: Ignoring track {0} - Corrupt File!", filePath); + } + catch (UnsupportedFormatException) + { + Log.Warn("MusicRatingUpdater: Ignoring track {0} - Unsupported format!", filePath); + } + catch (Exception ex) + { + Log.Error("MusicRatingUpdater: Exception handling rating for: {0} {1} {2}", filePath, ex.Message, ex.StackTrace); + } + } + + private void ProcessPendingUpdates(object sender, EventArgs e) + { + List<string> keysToRemove = new List<string>(); + foreach (KeyValuePair<string, int> item in _pendingUpdates) + { + if (!IsFileOpen(item.Key)) + { + SetRating(item.Key, item.Value); + keysToRemove.Add(item.Key); + } + } + foreach (string item in keysToRemove) + { + _pendingUpdates.Remove(item); + } + } + + private bool IsFileOpen(string filePath) + { + bool rtnvalue = false; + try + { + FileStream fs = System.IO.File.OpenWrite(filePath); + fs.Close(); + } + catch (IOException) + { + rtnvalue = true; + } + return rtnvalue; + } + + #endregion + + #region IPlugin Members + + /// <summary> + /// The plugin is started by Mediaportal + /// </summary> + public void Start() + { + Log.Info("MusicRatingUpdater: listening on rating change events"); + + // Establish Handler to catch rating change events + MusicDatabase.MusicRatingChanged += OnMusicRatingChanged; + } + + /// <summary> + /// The Plugin is stopped + /// </summary> + public void Stop() + { + if (_updateTimer != null) + { + _updateTimer.Stop(); + } + + ProcessPendingUpdates(this, new EventArgs()); + _run = false; + Log.Info("MusicRatingUpdater: 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 true; + } + + /// <summary> + /// Gets the plugin name. + /// </summary> + /// <returns>The plugin name.</returns> + public string PluginName() + { + return "MusicRating Updater"; + } + + /// <summary> + /// Defaults enabled. + /// </summary> + /// <returns>true if this plugin is enabled by default, otherwise false.</returns> + public bool DefaultEnabled() + { + return false; + } + + /// <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 "Helmut Wahrmann"; + } + + /// <summary> + /// Gets the description of the plugin. + /// </summary> + /// <returns>The plugin description.</returns> + public string Description() + { + return + "Updates the Music File with Ratings, when they're changed inside MP. Ratings can be shared between different Media Players"; + } + + /// <summary> + /// Shows the plugin configuration. + /// </summary> + public void ShowPlugin() + { + _config = new MusicRatingUpdaterSettings(this); + _config.ShowDialog(); + } + + /// <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 + } +} \ No newline at end of file Added: trunk/plugins/MusicRatingUpdater/MusicRatingUpdater/MusicRatingUpdater.csproj =================================================================== --- trunk/plugins/MusicRatingUpdater/MusicRatingUpdater/MusicRatingUpdater.csproj (rev 0) +++ trunk/plugins/MusicRatingUpdater/MusicRatingUpdater/MusicRatingUpdater.csproj 2011-02-12 16:50:15 UTC (rev 4103) @@ -0,0 +1,135 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>9.0.30729</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{27F417A4-6D27-4952-B0FC-FDCE9101A7DD}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>MusicRatingUpdater</RootNamespace> + <AssemblyName>MusicRatingUpdater</AssemblyName> + <FileUpgradeFlags> + </FileUpgradeFlags> + <OldToolsVersion>2.0</OldToolsVersion> + <UpgradeBackupLocation> + </UpgradeBackupLocation> + <PublishUrl>publish\</PublishUrl> + <Install>true</Install> + <InstallFrom>Disk</InstallFrom> + <UpdateEnabled>false</UpdateEnabled> + <UpdateMode>Foreground</UpdateMode> + <UpdateInterval>7</UpdateInterval> + <UpdateIntervalUnits>Days</UpdateIntervalUnits> + <UpdatePeriodically>false</UpdatePeriodically> + <UpdateRequired>false</UpdateRequired> + <MapFileExtensions>true</MapFileExtensions> + <ApplicationRevision>0</ApplicationRevision> + <ApplicationVersion>1.0.0.%2a</ApplicationVersion> + <IsWebBootstrapper>false</IsWebBootstrapper> + <UseApplicationTrust>false</UseApplicationTrust> + <BootstrapperEnabled>true</BootstrapperEnabled> + </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> + </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> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> + <DebugSymbols>true</DebugSymbols> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <DebugType>full</DebugType> + <PlatformTarget>x86</PlatformTarget> + <ErrorReport>prompt</ErrorReport> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <Optimize>true</Optimize> + <DebugType>pdbonly</DebugType> + <PlatformTarget>x86</PlatformTarget> + <ErrorReport>prompt</ErrorReport> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_1_02|AnyCPU' "> + <OutputPath>bin\Release_1_02\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <Optimize>true</Optimize> + <DebugType>pdbonly</DebugType> + <PlatformTarget>AnyCPU</PlatformTarget> + <ErrorReport>prompt</ErrorReport> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release_1_02|x86' "> + <OutputPath>bin\x86\Release_1_02\</OutputPath> + <DefineConstants>TRACE;Release_1_02</DefineConstants> + <Optimize>true</Optimize> + <DebugType>pdbonly</DebugType> + <PlatformTarget>x86</PlatformTarget> + <ErrorReport>prompt</ErrorReport> + </PropertyGroup> + <ItemGroup> + <Reference Include="Core, Version=0.9.4.25894, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\..\mediaportal\Core\bin\Debug\Core.dll</HintPath> + </Reference> + <Reference Include="Databases, Version=0.9.4.25896, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\..\mediaportal\Databases\bin\Debug\Databases.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="taglib-sharp, Version=2.0.2.17, Culture=neutral, PublicKeyToken=db62eba44689b5b0, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\..\mediaportal\MediaPortal.Base\taglib-sharp.dll</HintPath> + </Reference> + <Reference Include="Utils, Version=2.2.6.30715, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\..\mediaportal\Utils\bin\Debug\Utils.dll</HintPath> + </Reference> + </ItemGroup> + <ItemGroup> + <Compile Include="MusicRatingUpdater.cs" /> + <Compile Include="MusicRatingUpdaterSettings.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="MusicRatingUpdaterSettings.designer.cs"> + <DependentUpon>MusicRatingUpdaterSettings.cs</DependentUpon> + </Compile> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <ItemGroup> + <BootstrapperPackage Include="Microsoft.Net.Framework.2.0"> + <Visible>False</Visible> + <ProductName>Microsoft.Net.Framework.2.0</ProductName> + <Install>true</Install> + </BootstrapperPackage> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="MusicRatingUpdaterSettings.resx"> + <DependentUpon>MusicRatingUpdaterSettings.cs</DependentUpon> + </EmbeddedResource> + </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 Added: trunk/plugins/MusicRatingUpdater/MusicRatingUpdater/MusicRatingUpdater.csproj.user =================================================================== --- trunk/plugins/MusicRatingUpdater/MusicRatingUpdater/MusicRatingUpdater.csproj.user (rev 0) +++ trunk/plugins/MusicRatingUpdater/MusicRatingUpdater/MusicRatingUpdater.csproj.user 2011-02-12 16:50:15 UTC (rev 4103) @@ -0,0 +1,23 @@ +<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <PublishUrlHistory> + </PublishUrlHistory> + <InstallUrlHistory> + </InstallUrlHistory> + <SupportUrlHistory> + </SupportUrlHistory> + <UpdateUrlHistory> + </UpdateUrlHistory> + <BootstrapperUrlHistory> + </BootstrapperUrlHistory> + <ErrorReportUrlHistory> + </ErrorReportUrlHistory> + <FallbackCulture>en-US</FallbackCulture> + <VerifyUploadedFiles>false</VerifyUploadedFiles> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <StartAction>Program</StartAction> + <StartProgram>D:\Source\mediaportal\xbmc\bin\debug\Configuration.exe</StartProgram> + <StartWorkingDirectory>D:\Source\mediaportal\xbmc\bin\debug</StartWorkingDirectory> + </PropertyGroup> +</Project> \ No newline at end of file Added: trunk/plugins/MusicRatingUpdater/MusicRatingUpdater/MusicRatingUpdaterSettings.Designer.cs =================================================================== --- trunk/plugins/MusicRatingUpdater/MusicRatingUpdater/MusicRatingUpdaterSettings.Designer.cs (rev 0) +++ trunk/plugins/MusicRatingUpdater/MusicRatingUpdater/MusicRatingUpdaterSettings.Designer.cs 2011-02-12 16:50:15 UTC (rev 4103) @@ -0,0 +1,193 @@ +namespace MediaPortal.Plugins +{ + partial class MusicRatingUpdaterSettings + { + /// <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.mpGroupBoxRatingType = new MediaPortal.UserInterface.Controls.MPGroupBox(); + this.rbWMPRating = new MediaPortal.UserInterface.Controls.MPRadioButton(); + this.rbStarRating = new MediaPortal.UserInterface.Controls.MPRadioButton(); + this.mpGroupBoxBatchUpdate = new MediaPortal.UserInterface.Controls.MPGroupBox(); + this.lbStatus = new MediaPortal.UserInterface.Controls.MPLabel(); + this.btStop = new MediaPortal.UserInterface.Controls.MPButton(); + this.btStart = new MediaPortal.UserInterface.Controls.MPButton(); + this.btCancel = new MediaPortal.UserInterface.Controls.MPButton(); + this.btOk = new MediaPortal.UserInterface.Controls.MPButton(); + this.checkBoxUpdateRealTime = new MediaPortal.UserInterface.Controls.MPCheckBox(); + this.mpGroupBoxRatingType.SuspendLayout(); + this.mpGroupBoxBatchUpdate.SuspendLayout(); + this.SuspendLayout(); + // + // mpGroupBoxRatingType + // + this.mpGroupBoxRatingType.Controls.Add(this.rbWMPRating); + this.mpGroupBoxRatingType.Controls.Add(this.rbStarRating); + this.mpGroupBoxRatingType.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.mpGroupBoxRatingType.Location = new System.Drawing.Point(13, 54); + this.mpGroupBoxRatingType.Name = "mpGroupBoxRatingType"; + this.mpGroupBoxRatingType.Size = new System.Drawing.Size(408, 76); + this.mpGroupBoxRatingType.TabIndex = 0; + this.mpGroupBoxRatingType.TabStop = false; + this.mpGroupBoxRatingType.Text = "Write Ratings to file in ..."; + // + // rbWMPRating + // + this.rbWMPRating.AutoSize = true; + this.rbWMPRating.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.rbWMPRating.Location = new System.Drawing.Point(11, 47); + this.rbWMPRating.Name = "rbWMPRating"; + this.rbWMPRating.Size = new System.Drawing.Size(237, 17); + this.rbWMPRating.TabIndex = 1; + this.rbWMPRating.TabStop = true; + this.rbWMPRating.Text = "Windows Media Player (WMP) Rating Format"; + this.rbWMPRating.UseVisualStyleBackColor = true; + // + // rbStarRating + // + this.rbStarRating.AutoSize = true; + this.rbStarRating.Checked = true; + this.rbStarRating.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.rbStarRating.Location = new System.Drawing.Point(11, 23); + this.rbStarRating.Name = "rbStarRating"; + this.rbStarRating.Size = new System.Drawing.Size(145, 17); + this.rbStarRating.TabIndex = 0; + this.rbStarRating.TabStop = true; + this.rbStarRating.Text = "Star Rating Format ( 1 - 5)"; + this.rbStarRating.UseVisualStyleBackColor = true; + // + // mpGroupBoxBatchUpdate + // + this.mpGroupBoxBatchUpdate.Controls.Add(this.lbStatus); + this.mpGroupBoxBatchUpdate.Controls.Add(this.btStop); + this.mpGroupBoxBatchUpdate.Controls.Add(this.btStart); + this.mpGroupBoxBatchUpdate.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.mpGroupBoxBatchUpdate.Location = new System.Drawing.Point(13, 137); + this.mpGroupBoxBatchUpdate.Name = "mpGroupBoxBatchUpdate"; + this.mpGroupBoxBatchUpdate.Size = new System.Drawing.Size(408, 100); + this.mpGroupBoxBatchUpdate.TabIndex = 1; + this.mpGroupBoxBatchUpdate.TabStop = false; + this.mpGroupBoxBatchUpdate.Text = "Batch Update"; + // + // lbStatus + // + this.lbStatus.AutoSize = true; + this.lbStatus.Location = new System.Drawing.Point(8, 30); + this.lbStatus.Name = "lbStatus"; + this.lbStatus.Size = new System.Drawing.Size(0, 13); + this.lbStatus.TabIndex = 2; + // + // btStop + // + this.btStop.Location = new System.Drawing.Point(327, 63); + this.btStop.Name = "btStop"; + this.btStop.Size = new System.Drawing.Size(75, 23); + this.btStop.TabIndex = 1; + this.btStop.Text = "Stop"; + this.btStop.UseVisualStyleBackColor = true; + this.btStop.Click += new System.EventHandler(this.btStop_Click); + // + // btStart + // + this.btStart.Location = new System.Drawing.Point(246, 63); + this.btStart.Name = "btStart"; + this.btStart.Size = new System.Drawing.Size(75, 23); + this.btStart.TabIndex = 0; + this.btStart.Text = "Start"; + this.btStart.UseVisualStyleBackColor = true; + this.btStart.Click += new System.EventHandler(this.btStart_Click); + // + // btCancel + // + this.btCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btCancel.Location = new System.Drawing.Point(340, 277); + this.btCancel.Name = "btCancel"; + this.btCancel.Size = new System.Drawing.Size(75, 23); + this.btCancel.TabIndex = 2; + this.btCancel.Text = "Cancel"; + this.btCancel.UseVisualStyleBackColor = true; + this.btCancel.Click += new System.EventHandler(this.btCancel_Click); + // + // btOk + // + this.btOk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btOk.Location = new System.Drawing.Point(259, 277); + this.btOk.Name = "btOk"; + this.btOk.Size = new System.Drawing.Size(75, 23); + this.btOk.TabIndex = 3; + this.btOk.Text = "Ok"; + this.btOk.UseVisualStyleBackColor = true; + this.btOk.Click += new System.EventHandler(this.btOk_Click); + // + // checkBoxUpdateRealTime + // + this.checkBoxUpdateRealTime.AutoSize = true; + this.checkBoxUpdateRealTime.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.checkBoxUpdateRealTime.Location = new System.Drawing.Point(24, 22); + this.checkBoxUpdateRealTime.Name = "checkBoxUpdateRealTime"; + this.checkBoxUpdateRealTime.Size = new System.Drawing.Size(325, 17); + this.checkBoxUpdateRealTime.TabIndex = 4; + this.checkBoxUpdateRealTime.Text = "Update Ratings automatically when changed within MediaPortal"; + this.checkBoxUpdateRealTime.UseVisualStyleBackColor = true; + // + // MusicRatingUpdaterSettings + // + this.AcceptButton = this.btOk; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.btCancel; + this.ClientSize = new System.Drawing.Size(433, 312); + this.Controls.Add(this.checkBoxUpdateRealTime); + this.Controls.Add(this.btOk); + this.Controls.Add(this.btCancel); + this.Controls.Add(this.mpGroupBoxBatchUpdate); + this.Controls.Add(this.mpGroupBoxRatingType); + this.Name = "MusicRatingUpdaterSettings"; + this.Text = "Music Rating Updater - Setup"; + this.mpGroupBoxRatingType.ResumeLayout(false); + this.mpGroupBoxRatingType.PerformLayout(); + this.mpGroupBoxBatchUpdate.ResumeLayout(false); + this.mpGroupBoxBatchUpdate.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private MediaPortal.UserInterface.Controls.MPGroupBox mpGroupBoxRatingType; + private MediaPortal.UserInterface.Controls.MPRadioButton rbWMPRating; + private MediaPortal.UserInterface.Controls.MPRadioButton rbStarRating; + private MediaPortal.UserInterface.Controls.MPGroupBox mpGroupBoxBatchUpdate; + private MediaPortal.UserInterface.Controls.MPButton btStop; + private MediaPortal.UserInterface.Controls.MPButton btStart; + private MediaPortal.UserInterface.Controls.MPButton btCancel; + private MediaPortal.UserInterface.Controls.MPButton btOk; + private MediaPortal.UserInterface.Controls.MPLabel lbStatus; + private MediaPortal.UserInterface.Controls.MPCheckBox checkBoxUpdateRealTime; + } +} \ No newline at end of file Added: trunk/plugins/MusicRatingUpdater/MusicRatingUpdater/MusicRatingUpdaterSettings.cs =================================================================== --- trunk/plugins/MusicRatingUpdater/MusicRatingUpdater/MusicRatingUpdaterSettings.cs (rev 0) +++ trunk/plugins/MusicRatingUpdater/MusicRatingUpdater/MusicRatingUpdaterSettings.cs 2011-02-12 16:50:15 UTC (rev 4103) @@ -0,0 +1,129 @@ +#region Copyright (C) 2011 Helmut Wahrmann +// Copyright (C) 2011 Helmut Wahrmann +// http://www.team-mediaportal.com +// +// MPTagThat is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 2 of the License, or +// (at your option) any later version. +// +// MPTagThat is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with MediaPortal. If not, see <http://www.gnu.org/licenses/>. +#endregion +#region + +using System; +using MediaPortal.Configuration; +using MediaPortal.Profile; +using MediaPortal.UserInterface.Controls; + +#endregion + +namespace MediaPortal.Plugins +{ + public partial class MusicRatingUpdaterSettings : MPConfigForm + { + #region Variables + + private readonly MusicRatingUpdater main; + + #endregion + + #region Properties + + public MPLabel StatusLabel + { + get { return lbStatus; } + } + + public string RatingType + { + get { return rbStarRating.Checked ? "star" : "wmp"; } + } + + #endregion + + #region ctor + + public MusicRatingUpdaterSettings(MusicRatingUpdater main) + { + this.main = main; + InitializeComponent(); + LoadSettings(); + } + + #endregion + + #region Serialization + + private void LoadSettings() + { + // load settings + using (Settings reader = new Settings(Config.GetFile(Config.Dir.Config, "mediaportal.xml"))) + { + string type = reader.GetValueAsString("musicratingupdater", "ratingtype", "star"); + rbStarRating.Checked = type == "star" ? true : false; + rbWMPRating.Checked = type == "wmp" ? true : false; + + checkBoxUpdateRealTime.Checked = reader.GetValueAsBool("musicratingupdater", "realtimeupdate", false); + } + } + + private void SaveSettings() + { + // save settings + using (Settings writer = new Settings(Config.GetFile(Config.Dir.Config, "mediaportal.xml"))) + { + string type = "star"; + if (rbWMPRating.Checked) + { + type = "wmp"; + } + writer.SetValue("musicratingupdater", "ratingtype", type); + writer.SetValueAsBool("musicratingupdater", "realtimeupdate", checkBoxUpdateRealTime.Checked); + } + } + + #endregion + + #region Event Handler + + private void btOk_Click(object sender, EventArgs e) + { + // save settings + SaveSettings(); + //close form + Close(); + } + + private void btCancel_Click(object sender, EventArgs e) + { + // restore settings + LoadSettings(); + //close form + Close(); + } + + /// <summary> + /// Start the Batch Updater + /// </summary> + /// <param name = "sender"></param> + /// <param name = "e"></param> + private void btStart_Click(object sender, EventArgs e) + { + main.StartBatchUpdate(); + } + + private void btStop_Click(object sender, EventArgs e) + { + main.StopBatchUpdate(); + } + + #endregion + } +} \ No newline at end of file Added: trunk/plugins/MusicRatingUpdater/MusicRatingUpdater/MusicRatingUpdaterSettings.resx =================================================================== --- trunk/plugins/MusicRatingUpdater/MusicRatingUpdater/MusicRatingUpdaterSettings.resx (rev 0) +++ trunk/plugins/MusicRatingUpdater/MusicRatingUpdater/MusicRatingUpdaterSettings.resx 2011-02-12 16:50:15 UTC (rev 4103) @@ -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.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> +</root> \ No newline at end of file Added: trunk/plugins/MusicRatingUpdater/MusicRatingUpdater/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/MusicRatingUpdater/MusicRatingUpdater/Properties/AssemblyInfo.cs (rev 0) +++ trunk/plugins/MusicRatingUpdater/MusicRatingUpdater/Properties/AssemblyInfo.cs 2011-02-12 16:50:15 UTC (rev 4103) @@ -0,0 +1,43 @@ +#region + +using System.Reflection; +using System.Runtime.InteropServices; + +#endregion + +// 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("MusicRatingUpdater")] +[assembly: AssemblyDescription("MediaPortal Plugin to update the Star Ratings in the Files")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Helmut Wahrmann")] +[assembly: AssemblyProduct("MusicRatingUpdater")] +[assembly: AssemblyCopyright("Copyright © 2011")] +[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("e3ad499c-00b5-4114-8799-ac5768fd1c74")] + +// 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")] \ No newline at end of file Added: trunk/plugins/MusicRatingUpdater/MusicRatingUpdater.sln =================================================================== --- trunk/plugins/MusicRatingUpdater/MusicRatingUpdater.sln (rev 0) +++ trunk/plugins/MusicRatingUpdater/MusicRatingUpdater.sln 2011-02-12 16:50:15 UTC (rev 4103) @@ -0,0 +1,26 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MusicRatingUpdater", "MusicRatingUpdater\MusicRatingUpdater.csproj", "{27F417A4-6D27-4952-B0FC-FDCE9101A7DD}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {27F417A4-6D27-4952-B0FC-FDCE9101A7DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {27F417A4-6D27-4952-B0FC-FDCE9101A7DD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {27F417A4-6D27-4952-B0FC-FDCE9101A7DD}.Debug|x86.ActiveCfg = Debug|x86 + {27F417A4-6D27-4952-B0FC-FDCE9101A7DD}.Debug|x86.Build.0 = Debug|x86 + {27F417A4-6D27-4952-B0FC-FDCE9101A7DD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {27F417A4-6D27-4952-B0FC-FDCE9101A7DD}.Release|Any CPU.Build.0 = Release|Any CPU + {27F417A4-6D27-4952-B0FC-FDCE9101A7DD}.Release|x86.ActiveCfg = Release|x86 + {27F417A4-6D27-4952-B0FC-FDCE9101A7DD}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal Added: trunk/plugins/MusicRatingUpdater/setup/MusicRatingUpdater.xmp2 =================================================================== --- trunk/plugins/MusicRatingUpdater/setup/MusicRatingUpdater.xmp2 (rev 0) +++ trunk/plugins/MusicRatingUpdater/setup/MusicRatingUpdater.xmp2 2011-02-12 16:50:15 UTC (rev 4103) @@ -0,0 +1,212 @@ +<?xml version="1.0" encoding="utf-8"?> +<PackageClass xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <Version>2.0</Version> + <Groups> + <Items> + <GroupItem Name="Default"> + <ParentGroup /> + <DisplayName>Music Rating Updater</DisplayName> + <DefaulChecked>true</DefaulChecked> + <Description>Music Rating Updater</Description> + <Files> + <Items> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="true"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\MusicRatingUpdater\bin\Release\MusicRatingUpdater.dll</LocalFileName> + <ZipFileName>Installer{CopyFile}\{4c4da61b-2f5a-4fe8-8c87-40a68b1fa96f}-MusicRatingUpdater.dll</ZipFileName> + <DestinationFilename>%Plugins%\process\MusicRatingUpdater.dll</DestinationFilename> + </FileItem> + </Items> + </Files> + </GroupItem> + </Items> + </Groups> + <Sections> + <Items> + <SectionItem Guid="8b2bba82-51b8-4559-97e5-6c6dee40691d" Name="Welcome Screen" ConditionGroup=""> + <Params> + <Items> + <SectionParam Name="Header text"> + <Value>Welcome to the Extension Installer for [Name]</Value> + <ValueType>String</ValueType> + <Description /> + </SectionParam> + <SectionParam Name="Description"> + <Value>This will install [Name] version [Version] on your computer. +It is recommended that you close all other applications before continuing. +Click Next to continue or Cancel to exit Setup.</Value> + <ValueType>String</ValueType> + <Description /> + </SectionParam> + <SectionParam Name="Left part image"> + <Value /> + <ValueType>File</ValueType> + <Description /> + </SectionParam> + <SectionParam Name="Header image"> + <Value /> + <ValueType>File</ValueType> + <Description>Image in upper right part</Description> + </SectionParam> + </Items> + </Params> + <Actions> + <Items /> + </Actions> + <IncludedGroups /> + <PanelName>Welcome Screen</PanelName> + <WizardButtonsEnum>NextCancel</WizardButtonsEnum> + </SectionItem> + <SectionItem Guid="9d3c22c4-57b0-4109-998f-ece05080cacb" Name="Install Section" ConditionGroup=""> + <Params> + <Items> + <SectionParam Name="Header Title"> + <Value /> + <ValueType>String</ValueType> + <Description>Header title</Description> + </SectionParam> + <SectionParam Name="Header description"> + <Value /> + <ValueType>String</ValueType> + <Description>Description of section, shown in under section title</Description> + </SectionParam> + <SectionParam Name="Header image"> + <Value /> + <ValueType>File</ValueType> + <Description>Image in upper right part</Description> + </SectionParam> + </Items> + </Params> + <Actions> + <Items> + <ActionItem Name="InstallFiles" ActionType="InstallFiles" ConditionGroup=""> + <Params> + <Items /> + </Params> + <ExecuteLocation>AfterPanelShow</ExecuteLocation> + </ActionItem> + </Items> + </Actions> + <IncludedGroups /> + <PanelName>Install Section</PanelName> + <WizardButtonsEnum>Next</WizardButtonsEnum> + </SectionItem> + <SectionItem Guid="ddc37054-1848-4231-8131-358ef51f19a2" Name="Setup Complete" ConditionGroup=""> + <Params> + <Items> + <SectionParam Name="Header text"> + <Value>The Extension Installer Wizard has successfully installed [Name].</Value> + <ValueType>String</ValueType> + <Description /> + </SectionParam> + <SectionParam Name="Left part image"> + <Value /> + <ValueType>File</ValueType> + <Description /> + </SectionParam> + <SectionParam Name="Show radio buttons"> + <Value /> + <ValueType>Bool</ValueType> + <Description>Use radiobutton in place of combobox</Description> + </SectionParam> + <SectionParam Name="Header image"> + <Value /> + <ValueType>File</ValueType> + <Description>Image in upper right part</Description> + </SectionParam> + </Items> + </Params> + <Actions> + <Items /> + </Actions> + <IncludedGroups /> + <PanelName>Setup Complete</PanelName> + <WizardButtonsEnum>Finish</WizardButtonsEnum> + </SectionItem> + </Items> + </Sections> + <Dependencies> + <Items /> + </Dependencies> + <GeneralInfo> + <Name>Music Rating Updater</Name> + <Id>f11d4e87-8755-4be4-83d6-6509d4cac244</Id> + <Author>Helmut Wahrmann (hwahrmann)</Author> + <HomePage>www.team-mediaportal.com</HomePage> + <ForumPage /> + <UpdateUrl /> + <Version> + <Major>1</Major> + <Minor>0</Minor> + <Build>0</Build> + <Revision>0</Revision> + </Version> + <ExtensionDescription>Have you ever wanted the ratings from the Music Now Playing available in the tags of the file, to be used by other applications? + +Now there's a solution. + +With the MusicRatingUpdater Plugin activated you have the ratings instantly available in your files. + +Ratings can be stored in "Star Rating", 1 - 5, or in Windows Media Player Format. + +The plugin has an automatic mode, by which it listens to changes in the ratings, which a user does in the Now Playing screen and will update the file as soon as it finishes. + +The second option is a Batch update, which is available via the plugin's config dialog. This option reads all available ratings for songs found in the MediaPortal Music Database and updates the physical file.</ExtensionDescription> + <VersionDescription /> + <DevelopmentStatus>Stable</DevelopmentStatus> + <OnlineLocation /> + <ReleaseDate>2011-02-12T16:35:08.2807162+01:00</ReleaseDate> + <Tags>music rating stars</Tags> + <Location>D:\Documents\Source\Mp1\mp-plugins\MusicRatingUpdater\setup\MusicRatingUpdater.mpe1</Location> + <Params> + <Items> + <SectionParam Name="Icon"> + <Value /> + <ValueType>File</ValueType> + <Description>The icon file of the package (jpg,png,bmp)</Description> + </SectionParam> + <SectionParam Name="Online Icon"> + <Value /> + <ValueType>String</ValueType> + <Description>The icon file of the package stored online (jpg,png,bmp)</Description> + </SectionParam> + <SectionParam Name="Configuration file"> + <Value /> + <ValueType>Template</ValueType> + <Description>The file used to configure the extension. + If have .exe extension the will be executed + If have .dll extension used like MP plugin configuration</Description> + </SectionParam> + <SectionParam Name="Online Screenshots"> + <Value /> + <ValueType>String</ValueType> + <Description>Online stored screenshot urls separated by ; </Description> + </SectionParam> + <SectionParam Name="Force to uninstall on update"> + <Value>yes</Value> + <ValueType>Bool</ValueType> + <Description>Show dialog and force to uninstall previous version when updating an extension. Should only be disabled if you are using an NSIS/MSI installer.</Description> + </SectionParam> + </Items> + </Params> + </GeneralInfo> + <UniqueFileList> + <Items> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="true"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\MusicRatingUpdater\bin\Release\MusicRatingUpdater.dll</LocalFileName> + <ZipFileName>Installer{CopyFile}\{4c4da61b-2f5a-4fe8-8c87-40a68b1fa96f}-MusicRatingUpdater.dll</ZipFileName> + <DestinationFilename>%Plugins%\process\MusicRatingUpdater.dll</DestinationFilename> + </FileItem> + </Items> + </UniqueFileList> + <ProjectSettings> + <FolderGroups /> + <ProjectFilename>D:\Documents\Source\Mp1\mp-plugins\MusicRatingUpdater\setup\MusicRatingUpdater.xmp2</ProjectFilename> + <UpdatePath1 /> + <UpdatePath2 /> + <UpdatePath3 /> + </ProjectSettings> +</PackageClass> \ 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: <off...@us...> - 2011-11-06 13:41:54
|
Revision: 4325 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4325&view=rev Author: offbyonebb Date: 2011-11-06 13:41:46 +0000 (Sun, 06 Nov 2011) Log Message: ----------- added WiFiManager plugin (C# code, DefaultWide skin, MPEI installer script) Added Paths: ----------- trunk/plugins/WiFiManager/ trunk/plugins/WiFiManager/Installer/ trunk/plugins/WiFiManager/Installer/WifiManager.xmp2 trunk/plugins/WiFiManager/Skins/ trunk/plugins/WiFiManager/Skins/DefaultWide/ trunk/plugins/WiFiManager/Skins/DefaultWide/Media/ trunk/plugins/WiFiManager/Skins/DefaultWide/Media/WifiManager/ trunk/plugins/WiFiManager/Skins/DefaultWide/Media/WifiManager/Secure.png trunk/plugins/WiFiManager/Skins/DefaultWide/Media/WifiManager/WiFi.png trunk/plugins/WiFiManager/Skins/DefaultWide/Media/hover_WifiManager.png trunk/plugins/WiFiManager/Skins/DefaultWide/WifiManager.xml trunk/plugins/WiFiManager/WiFiManager/ trunk/plugins/WiFiManager/WiFiManager/GuiWifiManager.cs trunk/plugins/WiFiManager/WiFiManager/NativeWifi/ trunk/plugins/WiFiManager/WiFiManager/NativeWifi/Interop.cs trunk/plugins/WiFiManager/WiFiManager/NativeWifi/WlanApi.cs trunk/plugins/WiFiManager/WiFiManager/Properties/ trunk/plugins/WiFiManager/WiFiManager/Properties/AssemblyInfo.cs trunk/plugins/WiFiManager/WiFiManager/WiFiManager.csproj trunk/plugins/WiFiManager/WiFiManager/WiFiManager.png trunk/plugins/WiFiManager/WiFiManager/WiFiManagerDisabled.png trunk/plugins/WiFiManager/WiFiManager.sln Added: trunk/plugins/WiFiManager/Installer/WifiManager.xmp2 =================================================================== --- trunk/plugins/WiFiManager/Installer/WifiManager.xmp2 (rev 0) +++ trunk/plugins/WiFiManager/Installer/WifiManager.xmp2 2011-11-06 13:41:46 UTC (rev 4325) @@ -0,0 +1,320 @@ +<?xml version="1.0" encoding="utf-8"?> +<PackageClass xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <Version>2.0</Version> + <Groups> + <Items> + <GroupItem Name="Default"> + <ParentGroup /> + <DisplayName>Default</DisplayName> + <DefaulChecked>true</DefaulChecked> + <Description>Default</Description> + <Files> + <Items> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="true"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\..\..\..\..\..\..\Program Files (x86)\Team MediaPortal\MediaPortal\plugins\Windows\WiFiManager.dll</LocalFileName> + <ZipFileName>Installer{CopyFile}\{aab3d026-d2e8-4f15-8480-3b70f83f3691}-WiFiManager.dll</ZipFileName> + <DestinationFilename>%Plugins%\Windows\WiFiManager.dll</DestinationFilename> + </FileItem> + </Items> + </Files> + </GroupItem> + <GroupItem Name="DefaultWide"> + <DisplayName>DefaultWide</DisplayName> + <DefaulChecked>true</DefaulChecked> + <Description>DefaultWide</Description> + <Files> + <Items> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Skins\DefaultWide\WifiManager.xml</LocalFileName> + <ZipFileName>Installer{CopyFile}\{944d093b-3705-4475-861f-990902757585}-WifiManager.xml</ZipFileName> + <DestinationFilename>%Skin%\DefaultWide\WifiManager.xml</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Skins\DefaultWide\Media\hover_WifiManager.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{04f2f181-b6ab-40f7-b1fc-c750ad55f179}-hover_WifiManager.png</ZipFileName> + <DestinationFilename>%Skin%\DefaultWide\Media\hover_WifiManager.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Skins\DefaultWide\Media\WifiManager\Secure.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{4c2639f2-c49d-4282-ae9f-efec23cd8590}-Secure.png</ZipFileName> + <DestinationFilename>%Skin%\DefaultWide\Media\WifiManager\Secure.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Skins\DefaultWide\Media\WifiManager\WiFi.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{f1ca47e1-c17f-4dea-8ec9-593b889b2b66}-WiFi.png</ZipFileName> + <DestinationFilename>%Skin%\DefaultWide\Media\WifiManager\WiFi.png</DestinationFilename> + </FileItem> + </Items> + </Files> + </GroupItem> + </Items> + </Groups> + <Sections> + <Items> + <SectionItem Guid="69d915bb-c231-409b-bd58-dafd64a2e470" Name="Welcome Screen" ConditionGroup=""> + <Params> + <Items> + <SectionParam Name="Header text"> + <Value>Welcome to the Extension Installer for [Name]</Value> + <ValueType>String</ValueType> + <Description /> + </SectionParam> + <SectionParam Name="Description"> + <Value>This will install [Name] version [Version] on your computer. +It is recommended that you close all other applications before continuing. +Click Next to continue or Cancel to exit Setup.</Value> + <ValueType>String</ValueType> + <Description /> + </SectionParam> + <SectionParam Name="Left part image"> + <Value /> + <ValueType>File</ValueType> + <Description /> + </SectionParam> + <SectionParam Name="Header image"> + <Value /> + <ValueType>File</ValueType> + <Description>Image in upper right part</Description> + </SectionParam> + </Items> + </Params> + <Actions> + <Items /> + </Actions> + <IncludedGroups /> + <PanelName>Welcome Screen</PanelName> + <WizardButtonsEnum>NextCancel</WizardButtonsEnum> + </SectionItem> + <SectionItem Guid="a29114e3-8300-476d-8271-fe07bb3c58e2" Name="Install Section" ConditionGroup=""> + <Params> + <Items> + <SectionParam Name="Header Title"> + <Value /> + <ValueType>String</ValueType> + <Description>Header title</Description> + </SectionParam> + <SectionParam Name="Header description"> + <Value /> + <ValueType>String</ValueType> + <Description>Description of section, shown in under section title</Description> + </SectionParam> + <SectionParam Name="Header image"> + <Value /> + <ValueType>File</ValueType> + <Description>Image in upper right part</Description> + </SectionParam> + </Items> + </Params> + <Actions> + <Items> + <ActionItem Name="InstallFiles" ActionType="InstallFiles" ConditionGroup=""> + <Params> + <Items /> + </Params> + <ExecuteLocation>AfterPanelShow</ExecuteLocation> + </ActionItem> + </Items> + </Actions> + <IncludedGroups /> + <PanelName>Install Section</PanelName> + <WizardButtonsEnum>Next</WizardButtonsEnum> + </SectionItem> + <SectionItem Guid="645d811e-4b75-4ed8-a3ce-06bfe821f676" Name="Setup Complete" ConditionGroup=""> + <Params> + <Items> + <SectionParam Name="Header text"> + <Value>The Extension Installer Wizard has successfully installed [Name].</Value> + <ValueType>String</ValueType> + <Description /> + </SectionParam> + <SectionParam Name="Left part image"> + <Value /> + <ValueType>File</ValueType> + <Description /> + </SectionParam> + <SectionParam Name="Show radio buttons"> + <Value /> + <ValueType>Bool</ValueType> + <Description>Use radiobutton in place of combobox</Description> + </SectionParam> + <SectionParam Name="Header image"> + <Value /> + <ValueType>File</ValueType> + <Description>Image in upper right part</Description> + </SectionParam> + </Items> + </Params> + <Actions> + <Items /> + </Actions> + <IncludedGroups /> + <PanelName>Setup Complete</PanelName> + <WizardButtonsEnum>Finish</WizardButtonsEnum> + </SectionItem> + </Items> + </Sections> + <Dependencies> + <Items> + <DependencyItem> + <Type>MediaPortal</Type> + <Id /> + <MinVersion> + <Major>1</Major> + <Minor>1</Minor> + <Build>6</Build> + <Revision>27644</Revision> + </MinVersion> + <MaxVersion> + <Major>1</Major> + <Minor>1</Minor> + <Build>6</Build> + <Revision>27644</Revision> + </MaxVersion> + <WarnOnly>false</WarnOnly> + <Message>requires MediaPortal version 1.1.6.27644 to 1.1.6.27644.</Message> + <Name>MediaPortal</Name> + </DependencyItem> + </Items> + </Dependencies> + <PluginDependencies> + <Items> + <PluginDependencyItem AssemblyName="WiFiManager.dll"> + <CompatibleVersion> + <Items> + <CompatibleVersionItem> + <MinRequiredVersion>1.1.6.27644</MinRequiredVersion> + <DesignedForVersion>1.1.6.27644</DesignedForVersion> + </CompatibleVersionItem> + </Items> + </CompatibleVersion> + <SubSystemsUsed> + <Items> + <SubSystemItem Name="MP.Input" /> + <SubSystemItem Name="MP.SkinEngine" /> + <SubSystemItem Name="MP.Config" /> + </Items> + </SubSystemsUsed> + </PluginDependencyItem> + </Items> + </PluginDependencies> + <GeneralInfo> + <Name>WifiManager</Name> + <Id>dbd7af5e-8b89-420d-b8b4-a935fa9282c2</Id> + <Author>offbyone</Author> + <HomePage /> + <ForumPage /> + <UpdateUrl /> + <Version> + <Major>1</Major> + <Minor>0</Minor> + <Build>0</Build> + <Revision>0</Revision> + </Version> + <ExtensionDescription>This plugin displays a list of available wireless networks if you have a WiFi adapter installed on your machine and allows connecting or disconnecting without the need to go to your Windows Desktop.</ExtensionDescription> + <VersionDescription /> + <DevelopmentStatus>Beta</DevelopmentStatus> + <OnlineLocation /> + <ReleaseDate>2011-10-03T21:30:37.6965017+02:00</ReleaseDate> + <Tags>settings, wlan, wifi</Tags> + <Location>C:\Users\offbyone\Documents\Code\CodeUnlimited\WiFiManager\Installers\WifiManager.mpe1</Location> + <Params> + <Items> + <SectionParam Name="Icon"> + <Value>..\Skins\DefaultWide\Media\hover_WifiManager.png</Value> + <ValueType>File</ValueType> + <Description>The icon file of the package (jpg,png,bmp)</Description> + </SectionParam> + <SectionParam Name="Online Icon"> + <Value /> + <ValueType>String</ValueType> + <Description>The icon file of the package stored online (jpg,png,bmp)</Description> + </SectionParam> + <SectionParam Name="Configuration file"> + <Value /> + <ValueType>Template</ValueType> + <Description>The file used to configure the extension. + If have .exe extension the will be executed + If have .dll extension used like MP plugin configuration</Description> + </SectionParam> + <SectionParam Name="Online Screenshots"> + <Value /> + <ValueType>String</ValueType> + <Description>Online stored screenshot urls separated by ; </Description> + </SectionParam> + <SectionParam Name="Force to uninstall on update"> + <Value>yes</Value> + <ValueType>Bool</ValueType> + <Description>Show dialog and force to uninstall previous version when updating an extension. Should only be disabled if you are using an NSIS/MSI installer.</Description> + </SectionParam> + </Items> + </Params> + </GeneralInfo> + <UniqueFileList> + <Items> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="true"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\..\..\..\..\..\..\Program Files (x86)\Team MediaPortal\MediaPortal\plugins\Windows\WiFiManager.dll</LocalFileName> + <ZipFileName>Installer{CopyFile}\{aab3d026-d2e8-4f15-8480-3b70f83f3691}-WiFiManager.dll</ZipFileName> + <DestinationFilename>%Plugins%\Windows\WiFiManager.dll</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Skins\DefaultWide\WifiManager.xml</LocalFileName> + <ZipFileName>Installer{CopyFile}\{944d093b-3705-4475-861f-990902757585}-WifiManager.xml</ZipFileName> + <DestinationFilename>%Skin%\DefaultWide\WifiManager.xml</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="true" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Skins\DefaultWide\Media\hover_WifiManager.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{04f2f181-b6ab-40f7-b1fc-c750ad55f179}-hover_WifiManager.png</ZipFileName> + <DestinationFilename>%Skin%\DefaultWide\Media\hover_WifiManager.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Skins\DefaultWide\Media\WifiManager\Secure.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{4c2639f2-c49d-4282-ae9f-efec23cd8590}-Secure.png</ZipFileName> + <DestinationFilename>%Skin%\DefaultWide\Media\WifiManager\Secure.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\Skins\DefaultWide\Media\WifiManager\WiFi.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{f1ca47e1-c17f-4dea-8ec9-593b889b2b66}-WiFi.png</ZipFileName> + <DestinationFilename>%Skin%\DefaultWide\Media\WifiManager\WiFi.png</DestinationFilename> + </FileItem> + </Items> + </UniqueFileList> + <ProjectSettings> + <FolderGroups> + <FolderGroup InstallType="CopyFile" SystemFile="false" Modified="true"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName /> + <ZipFileName>Installer{CopyFile}\{cabbe550-cd32-474d-8a9b-8024dcda05c9}-</ZipFileName> + <DestinationFilename>%Skin%\DefaultWide\</DestinationFilename> + <Folder>..\Skins\DefaultWide</Folder> + <Group>DefaultWide</Group> + <Recursive>true</Recursive> + </FolderGroup> + </FolderGroups> + <ProjectFilename>WifiManager.xmp2</ProjectFilename> + <UpdatePath1 /> + <UpdatePath2 /> + <UpdatePath3 /> + </ProjectSettings> + <IsSkin>false</IsSkin> +</PackageClass> \ No newline at end of file Added: trunk/plugins/WiFiManager/Skins/DefaultWide/Media/WifiManager/Secure.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/WiFiManager/Skins/DefaultWide/Media/WifiManager/Secure.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/WiFiManager/Skins/DefaultWide/Media/WifiManager/WiFi.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/WiFiManager/Skins/DefaultWide/Media/WifiManager/WiFi.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/WiFiManager/Skins/DefaultWide/Media/hover_WifiManager.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/WiFiManager/Skins/DefaultWide/Media/hover_WifiManager.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/WiFiManager/Skins/DefaultWide/WifiManager.xml =================================================================== --- trunk/plugins/WiFiManager/Skins/DefaultWide/WifiManager.xml (rev 0) +++ trunk/plugins/WiFiManager/Skins/DefaultWide/WifiManager.xml 2011-11-06 13:41:46 UTC (rev 4325) @@ -0,0 +1,79 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<window> + <id>4855</id> + <defaultcontrol>50</defaultcontrol> + <allowoverlay>yes</allowoverlay> + <controls> + <control> + <description>background image</description> + <type>image</type> + <id>1</id> + <width>1280</width> + <height>720</height> + </control> + <import>common.window.xml</import> + <import>common.time.xml</import> + <control> + <type>label</type> + <id>1</id> + <posX>60</posX> + <posY>27</posY> + <label>#currentmodule</label> + <font>font16</font> + <align>left</align> + <textcolor>White</textcolor> + </control> + <control> + <type>actiongroup</type> + <description>action menu</description> + <defaultcontrol>2</defaultcontrol> + <onexit>50</onexit> + <buttonX>0</buttonX> + <buttonY>0</buttonY> + <buttonwidth>106</buttonwidth> + <buttonheight>720</buttonheight> + <textureFocus>-</textureFocus> + <textureNoFocus>Action_nofocus.png</textureNoFocus> + <width>275</width> + <height>900</height> + <dimColor>00ffffff</dimColor> + <control> + <type>image</type> + <posX>26</posX> + <posY>78</posY> + <width>367</width> + <height>591</height> + <texture>Backslide.png</texture> + <colorDiffuse>fffffffff</colorDiffuse> + <visible>!Control.HasFocus(50)</visible> + <animation effect="slide" time="70" start="-300,0" reversible="false">visible</animation> + <animation effect="slide" time="70" end="-300,0" reversible="false">hidden</animation> + </control> + <control> + <description>button group</description> + <type>group</type> + <animation effect="slide" time="70" start="-300,0" reversible="false">visible</animation> + <animation effect="slide" time="70" end="-300,0" reversible="false">hidden</animation> + <posX>71</posX> + <posY>121</posY> + <layout>StackLayout</layout> + <visible>!Control.HasFocus(50)</visible> + <control> + <description>Scan button</description> + <type>button</type> + <id>2</id> + <label>Scan</label> + <onright>50</onright> + </control> + <control> + <description>Refresh button</description> + <type>button</type> + <id>3</id> + <label>Refresh List</label> + <onright>50</onright> + </control> + </control> + </control> + <import>common.facade.xml</import> + </controls> +</window> Added: trunk/plugins/WiFiManager/WiFiManager/GuiWifiManager.cs =================================================================== --- trunk/plugins/WiFiManager/WiFiManager/GuiWifiManager.cs (rev 0) +++ trunk/plugins/WiFiManager/WiFiManager/GuiWifiManager.cs 2011-11-06 13:41:46 UTC (rev 4325) @@ -0,0 +1,474 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using MediaPortal.GUI.Library; +using MediaPortal.Configuration; +using NativeWifi; +using MediaPortal.Dialogs; +using System.IO; + +namespace WiFiManager +{ + [PluginIcons("WiFiManager.WiFiManager.png", "WiFiManager.WiFiManagerDisabled.png")] + public class GuiWifiManager : GUIWindow, ISetupForm, IShowPlugin + { + #region Constants + public const int WINDOW_ID = 4855; + public const string FRIENDLY_NAME = "Wifi Manager"; + #endregion + + #region Fields + int outstandingScans = 0; + string selectedSSID = null; + WlanClient wlanClient = null; + #endregion + + #region Enums + enum WinProfileAuthenticationEnumeration { open, shared, WPA, WPAPSK, WPA2, WPA2PSK }; + enum WinProfileEncryptionEnumeration { none, WEP, TKIP, AES }; + #endregion + + #region Skin Controls + [SkinControlAttribute(50)] + protected GUIFacadeControl GUI_facadeWlans = null; + [SkinControlAttribute(2)] + protected GUIButtonControl GUI_btnScan = null; + [SkinControlAttribute(3)] + protected GUIButtonControl GUI_btnRefresh = null; + #endregion + + #region ISetupForm + string ISetupForm.Author() + { + return "offbyone"; + } + + bool ISetupForm.CanEnable() + { + return true; + } + + bool ISetupForm.DefaultEnabled() + { + return true; + } + + string ISetupForm.Description() + { + return "This Plugin list available wirelesse networks and allow connecting to one."; + } + + bool ISetupForm.GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) + { + strButtonText = FRIENDLY_NAME; + strButtonImage = String.Empty; + strButtonImageFocus = String.Empty; + strPictureImage = @"hover_WifiManager.png"; + return true; + } + + int ISetupForm.GetWindowId() + { + return GetID; + } + + bool ISetupForm.HasSetup() + { + return false; + } + + string ISetupForm.PluginName() + { + return "WifiManager"; + } + + void ISetupForm.ShowPlugin() + { + + } + #endregion + + #region IShowPlugin + bool IShowPlugin.ShowDefaultHome() + { + return false; + } + #endregion + + #region GUIWindow overrides + public override int GetID + { + get { return WINDOW_ID; } + set { base.GetID = value; } + } + + public override string GetModuleName() + { + return FRIENDLY_NAME; + } + + public override bool Init() + { + return Load(GUIGraphicsContext.Skin + @"\WifiManager.xml"); + } + + protected override void OnPageLoad() + { + if (wlanClient == null) + { + try + { + wlanClient = new WlanClient(); + } + catch (Exception ex) + { + Log.Warn("WiFiManager: Error creating WlanClient: {0}", ex.Message); + wlanClient = null; + ShowMessage(ex.Message, "Wifi Manager Error"); + } + } + if (wlanClient != null) + { + foreach (var nic in wlanClient.Interfaces) nic.WlanNotification += new WlanClient.WlanInterface.WlanNotificationEventHandler(nic_WlanNotification); + FindNetworks(); + GUI_btnScan.IsEnabled = true; + GUI_btnRefresh.IsEnabled = true; + } + else + { + GUI_btnScan.IsEnabled = false; + GUI_btnRefresh.IsEnabled = false; + } + GUIPropertyManager.SetProperty("#itemtype", "Networks"); + base.OnPageLoad(); + } + + protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType) + { + if (control == GUI_btnScan) + { + outstandingScans = wlanClient.Interfaces.Length; + GUIWaitCursor.Init(); GUIWaitCursor.Show(); // init and show the wait cursor in MediaPortal + foreach (WlanClient.WlanInterface wlanIface in wlanClient.Interfaces) wlanIface.Scan(); + } + else if (control == GUI_btnRefresh) + { + FindNetworks(); + GUIControl.FocusControl(GetID, GUI_facadeWlans.GetID); + } + else if (control == GUI_facadeWlans) + { + GUIDialogMenu dlgWlanOptions = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); + if (dlgWlanOptions == null) return; + string ssid = GUI_facadeWlans.SelectedListItem.Label; + dlgWlanOptions.Reset(); + dlgWlanOptions.SetHeading(ssid); + WlanClient.WlanInterface nic = (WlanClient.WlanInterface)GUI_facadeWlans.SelectedListItem.TVTag; + Wlan.WlanAvailableNetwork network = (Wlan.WlanAvailableNetwork)GUI_facadeWlans.SelectedListItem.AlbumInfoTag; + if ((network.flags & Wlan.WlanAvailableNetworkFlags.Connected) == Wlan.WlanAvailableNetworkFlags.Connected) + { + dlgWlanOptions.Add(new GUIListItem("Disconnect")); + if (!string.IsNullOrEmpty(network.profileName)) dlgWlanOptions.Add(new GUIListItem("Save Profile To XML")); + } + else + { + dlgWlanOptions.Add(new GUIListItem("Connect")); + if (!string.IsNullOrEmpty(network.profileName)) dlgWlanOptions.Add(new GUIListItem("Delete Profile")); + } + dlgWlanOptions.DoModal(GetID); + if (dlgWlanOptions.SelectedId == -1) return; + if (dlgWlanOptions.SelectedLabelText == "Connect") + { + ConnectNetwork(ssid, nic, network); + } + else if (dlgWlanOptions.SelectedLabelText == "Disconnect") + { + Log.Info("WiFiManager: Disconnecting from WLAN '{0}'", ssid); + nic.Disconnect(); + } + else if (dlgWlanOptions.SelectedLabelText == "Delete Profile") + { + Log.Info("WiFiManager: Deleting WLAN Profile '{0}'", network.profileName); + nic.DeleteProfile(network.profileName); + FindNetworks(); + } + else if (dlgWlanOptions.SelectedLabelText == "Save Profile To XML") + { + File.WriteAllText(Config.GetFile(Config.Dir.Log, string.Format("{0}#{1}#{2}.xml", network.profileName, network.dot11DefaultAuthAlgorithm.ToString(), network.dot11DefaultCipherAlgorithm.ToString())), nic.GetProfileXml(network.profileName)); + } + } + else base.OnClicked(controlId, control, actionType); + } + #endregion + + internal static bool GetUserInputString(ref string sString, bool password) + { + VirtualKeyboard keyBoard = (VirtualKeyboard)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_VIRTUAL_KEYBOARD); + if (keyBoard == null) return false; + keyBoard.Reset(); + keyBoard.Text = sString; + keyBoard.Password = password; + keyBoard.DoModal(GUIWindowManager.ActiveWindow); + if (keyBoard.IsConfirmed) sString = keyBoard.Text; + return keyBoard.IsConfirmed; + } + + internal static void ShowMessage(string message, string header = "Wifi Manager") + { + GUIDialogNotify dlg_error = (GUIDialogNotify)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_NOTIFY); + if (dlg_error != null) + { + dlg_error.Reset(); + dlg_error.SetImage(string.Format(@"{0}\Media\WifiManager\WiFi.png", GUIGraphicsContext.Skin)); + dlg_error.SetHeading(header); + dlg_error.SetText(message); + dlg_error.DoModal(GUIWindowManager.ActiveWindow); + } + } + + /// <summary> + /// Converts a 802.11 SSID to a string. + /// </summary> + internal static string GetStringForSSID(Wlan.Dot11Ssid ssid) + { + return Encoding.ASCII.GetString(ssid.SSID, 0, (int)ssid.SSIDLength); + } + + void nic_WlanNotification(Wlan.WlanNotificationData notifyData) + { + if (notifyData.notificationSource == Wlan.WlanNotificationSource.ACM) + { + if (outstandingScans > 0 && (notifyData.notificationCode == (int)NativeWifi.Wlan.WlanNotificationCodeAcm.ScanComplete || notifyData.notificationCode == (int)NativeWifi.Wlan.WlanNotificationCodeAcm.ScanFail)) + { + outstandingScans--; + if (outstandingScans <= 0) + { + if (GUIWindowManager.ActiveWindow == GetID) + { + GUIWindowManager.SendThreadCallback((p1, p2, o) => + { + GUIWaitCursor.Hide(); // hide the wait cursor in MediaPortal + FindNetworks(); + GUIControl.FocusControl(GetID, GUI_facadeWlans.GetID); + return 0; + }, 0, 0, null); + } + } + } + else if (notifyData.notificationCode == (int)NativeWifi.Wlan.WlanNotificationCodeAcm.ConnectionAttemptFail) + { + ShowMessage("Connection failed!", "Wifi Manager Error"); + } + else if (notifyData.notificationCode == (int)NativeWifi.Wlan.WlanNotificationCodeAcm.ConnectionComplete) + { + string connectedTo = ""; + try + { + connectedTo = wlanClient.Interfaces.First(i => i.InterfaceGuid == notifyData.interfaceGuid).CurrentConnection.profileName; + connectedTo = " to " + connectedTo; + } + catch (Exception) { } + if (GUIWindowManager.ActiveWindow == GetID) + { + GUIWindowManager.SendThreadCallback((p1, p2, o) => + { + ShowMessage(string.Format("Successfully connected{0}!", connectedTo)); + FindNetworks(); + return 0; + }, 0, 0, null); + } + } + } + else if (notifyData.notificationSource == Wlan.WlanNotificationSource.MSM) + { + if (notifyData.notificationCode == (int)Wlan.WlanNotificationCodeMsm.Disconnected) + { + if (GUIWindowManager.ActiveWindow == GetID) + { + GUIWindowManager.SendThreadCallback((p1, p2, o) => + { + ShowMessage("Successfully disconnected!"); + FindNetworks(); + return 0; + }, 0, 0, null); + } + } + } + } + + void FindNetworks() + { + if (GUI_facadeWlans == null) return; + + selectedSSID = GUI_facadeWlans.SelectedListItem != null ? GUI_facadeWlans.SelectedListItem.Label : null; // remember the currently selected one + int selectedIndex = 0; // index to select when the currently selected one is found in the new list + GUI_facadeWlans.Clear(); + + + foreach (WlanClient.WlanInterface wlanIface in wlanClient.Interfaces) + { + Wlan.WlanAvailableNetwork[] networks = wlanIface.GetAvailableNetworkList(0); + Dictionary<string, List<Wlan.WlanAvailableNetwork>> hashedNetworks = new Dictionary<string, List<Wlan.WlanAvailableNetwork>>(); + foreach (Wlan.WlanAvailableNetwork network in networks) + { + string ssid = GetStringForSSID(network.dot11Ssid); + if (!string.IsNullOrEmpty(ssid)) + { + List<Wlan.WlanAvailableNetwork> networksForSSID = null; + if (!hashedNetworks.TryGetValue(ssid, out networksForSSID)) hashedNetworks[ssid] = networksForSSID = new List<Wlan.WlanAvailableNetwork>(); + networksForSSID.Add(network); + } + } + foreach (List<Wlan.WlanAvailableNetwork> networklist in hashedNetworks.Values.OrderByDescending(v => v.Max(n => n.wlanSignalQuality))) + { + networklist.Sort((n1,n2) => + { + int result = ((int)n2.flags).CompareTo((int)n1.flags); // the higher the flags the earlier in the list + if (result == 0) result = n2.wlanSignalQuality.CompareTo(n1.wlanSignalQuality); // equal flags -> sort by signal strength descending + return result; + }); + Wlan.WlanAvailableNetwork network = networklist[0]; + if (network.networkConnectable) + { + GUIListItem item = new GUIListItem(GetStringForSSID(network.dot11Ssid)); + if (item.Label == selectedSSID) selectedIndex = GUI_facadeWlans.Count; + if (item.Label.Length == 0) item.Label = "No SSID"; + item.Label2 = network.wlanSignalQuality.ToString() + "%"; + if (network.securityEnabled) item.IconImage = "WifiManager/Secure.png"; + item.IsPlayed = (network.flags & Wlan.WlanAvailableNetworkFlags.Connected) == Wlan.WlanAvailableNetworkFlags.Connected; + if (!item.IsPlayed) item.IsRemote = (network.flags & Wlan.WlanAvailableNetworkFlags.HasProfile) == Wlan.WlanAvailableNetworkFlags.HasProfile; + item.AlbumInfoTag = network; + item.TVTag = wlanIface; + GUI_facadeWlans.Add(item); + } + } + } + + GUIPropertyManager.SetProperty("#itemcount", GUI_facadeWlans.Count.ToString()); + GUI_facadeWlans.SelectedListItemIndex = selectedIndex; + } + + void ConnectNetwork(string ssid, WlanClient.WlanInterface nic, Wlan.WlanAvailableNetwork network) + { + if (!string.IsNullOrEmpty(network.profileName)) + { + Log.Info("WiFiManager: Using existing Profile to connect to WLAN '{0}'", ssid); + bool success = nic.ConnectSynchronously(Wlan.WlanConnectionMode.Profile, Wlan.Dot11BssType.Any, network.profileName, 15000); + FindNetworks(); + } + else + { + if (network.securityEnabled) + { + string key = ""; + if (GetUserInputString(ref key, false) && key.Length > 0) + { + Log.Info("WiFiManager: Building new Profile to connect to WLAN '{0}'", ssid); + string profileXml = GetProfileXml(ssid, key, network.dot11DefaultAuthAlgorithm, network.dot11DefaultCipherAlgorithm); + if (profileXml != null) + { + string error = null; + try + { + Wlan.WlanReasonCode reasonCode = nic.SetProfile(Wlan.WlanProfileFlags.User, profileXml, true); + if (reasonCode != Wlan.WlanReasonCode.Success) error = reasonCode.ToString(); + } + catch (Exception ex) + { + error = ex.Message; + } + if (error == null) + { + nic.Connect(Wlan.WlanConnectionMode.Profile, Wlan.Dot11BssType.Any, ssid); + } + else + { + Log.Warn("WiFiManager: Setting Profile for WLAN '{0}' failed: '{1}'", ssid, error); + ShowMessage(error, "Wifi Manager Error"); + } + } + else + { + // don't know how to build profile + ShowMessage("Unable to build profile. Connect in Windows and save profile to xml in MP.", "Wifi Manager Error"); + } + } + } + else + { + Log.Info("WiFiManager: Connecting to unsecured WLAN '{0}'", ssid); + nic.Connect(Wlan.WlanConnectionMode.Auto, Wlan.Dot11BssType.Any, network.dot11Ssid, 0); + } + } + } + + /// <summary> + /// Create a valid Profile xml according to: http://msdn.microsoft.com/en-us/library/ms707381(v=VS.85).aspx + /// </summary> + /// <param name="ssid"></param> + /// <param name="key"></param> + /// <param name="authAlg"></param> + /// <param name="encAlg"></param> + /// <returns></returns> + string GetProfileXml(string ssid, string key, Wlan.Dot11AuthAlgorithm authAlg, Wlan.Dot11CipherAlgorithm encAlg) + { + WinProfileAuthenticationEnumeration? auth = null; + WinProfileEncryptionEnumeration? enc = null; + switch (authAlg) + { + case Wlan.Dot11AuthAlgorithm.IEEE80211_SharedKey: + auth = WinProfileAuthenticationEnumeration.open; + enc = WinProfileEncryptionEnumeration.WEP; + break; + case Wlan.Dot11AuthAlgorithm.WPA_PSK: + auth = WinProfileAuthenticationEnumeration.WPAPSK; + break; + case Wlan.Dot11AuthAlgorithm.RSNA_PSK: + auth = WinProfileAuthenticationEnumeration.WPA2PSK; + break; + } + switch (encAlg) + { + case Wlan.Dot11CipherAlgorithm.TKIP: + enc = WinProfileEncryptionEnumeration.TKIP; + break; + case Wlan.Dot11CipherAlgorithm.CCMP: + enc = WinProfileEncryptionEnumeration.AES; + break; + } + + if (enc == null || auth == null) + { + Log.Warn("WiFiManager: No known Mapping to create Profile '{0}' for AuthAlg: '{1}' and CipherAlg: '{2}'", ssid, authAlg.ToString(), encAlg.ToString()); + return null; + } + + return string.Format(@"<?xml version=""1.0""?> +<WLANProfile xmlns=""http://www.microsoft.com/networking/WLAN/profile/v1""> + <name>{0}</name> + <SSIDConfig> + <SSID> + <name>{0}</name> + </SSID> + </SSIDConfig> + <connectionType>ESS</connectionType> + <connectionMode>auto</connectionMode> + <MSM> + <security> + <authEncryption> + <authentication>{2}</authentication> + <encryption>{3}</encryption> + <useOneX>false</useOneX> + </authEncryption> + <sharedKey> + <keyType>passPhrase</keyType> + <protected>false</protected> + <keyMaterial>{1}</keyMaterial> + </sharedKey> + </security> + </MSM> +</WLANProfile>", ssid, key, auth.ToString(), enc.ToString()); + } + } +} Added: trunk/plugins/WiFiManager/WiFiManager/NativeWifi/Interop.cs =================================================================== --- trunk/plugins/WiFiManager/WiFiManager/NativeWifi/Interop.cs (rev 0) +++ trunk/plugins/WiFiManager/WiFiManager/NativeWifi/Interop.cs 2011-11-06 13:41:46 UTC (rev 4325) @@ -0,0 +1,1612 @@ +using System; +using System.Runtime.InteropServices; +using System.Net.NetworkInformation; +using System.Text; +using System.Diagnostics; +using System.ComponentModel; + +namespace NativeWifi +{ + // TODO: Separate the functions and the structs/enums. Many of the structs/enums should remain public + // (since they're reused in the OOP interfaces) -- the rest (including all P/Invoke function mappings) + // should become internal. + + // All structures which native methods rely on should be kept in the Wlan class. + // Only change the layout of those structures if it matches the native API documentation. + // Some structures might have helper properties but adding or changing fields is prohibited. + // This class is not documented since all the documentation resides in the MSDN. The code + // documentation only covers details which concern interop users. + // Some identifier names were modified to correspond to .NET naming conventions + // but otherwise retain their native meaning. + + /// <summary> + /// Defines the Native Wifi API through P/Invoke interop. + /// </summary> + /// <remarks> + /// This class is intended for internal use. Use the <see cref="WlanCliient"/> class instead. + /// </remarks> + public static class Wlan + { + #region P/Invoke API + /// <summary> + /// Defines various opcodes used to set and query parameters for an interface. + /// </summary> + /// <remarks> + /// Corresponds to the native <c>WLAN_INTF_OPCODE</c> type. + /// </remarks> + public enum WlanIntfOpcode + { + /// <summary> + /// Opcode used to set or query whether auto config is enabled. + /// </summary> + AutoconfEnabled = 1, + /// <summary> + /// Opcode used to set or query whether background scan is enabled. + /// </summary> + BackgroundScanEnabled, + /// <summary> + /// Opcode used to set or query the media streaming mode of the driver. + /// </summary> + MediaStreamingMode, + /// <summary> + /// Opcode used to set or query the radio state. + /// </summary> + RadioState, + /// <summary> + /// Opcode used to set or query the BSS type of the interface. + /// </summary> + BssType, + /// <summary> + /// Opcode used to query the state of the interface. + /// </summary> + InterfaceState, + /// <summary> + /// Opcode used to query information about the current connection of the interface. + /// </summary> + CurrentConnection, + /// <summary> + /// Opcose used to query the current channel on which the wireless interface is operating. + /// </summary> + ChannelNumber, + /// <summary> + /// Opcode used to query the supported auth/cipher pairs for infrastructure mode. + /// </summary> + SupportedInfrastructureAuthCipherPairs, + /// <summary> + /// Opcode used to query the supported auth/cipher pairs for ad hoc mode. + /// </summary> + SupportedAdhocAuthCipherPairs, + /// <summary> + /// Opcode used to query the list of supported country or region strings. + /// </summary> + SupportedCountryOrRegionStringList, + /// <summary> + /// Opcode used to set or query the current operation mode of the wireless interface. + /// </summary> + CurrentOperationMode, + /// <summary> + /// Opcode used to query driver statistics. + /// </summary> + Statistics = 0x10000101, + /// <summary> + /// Opcode used to query the received signal strength. + /// </summary> + RSSI, + SecurityStart = 0x20010000, + SecurityEnd = 0x2fffffff, + IhvStart = 0x30000000, + IhvEnd = 0x3fffffff + } + + /// <summary> + /// Specifies the origin of automatic configuration (auto config) settings. + /// </summary> + /// <remarks> + /// Corresponds to the native <c>WLAN_OPCODE_VALUE_TYPE</c> type. + /// </remarks> + public enum WlanOpcodeValueType + { + /// <summary> + /// The auto config settings were queried, but the origin of the settings was not determined. + /// </summary> + QueryOnly = 0, + /// <summary> + /// The auto config settings were set by group policy. + /// </summary> + SetByGroupPolicy = 1, + /// <summary> + /// The auto config settings were set by the user. + /// </summary> + SetByUser = 2, + /// <summary> + /// The auto config settings are invalid. + /// </summary> + Invalid = 3 + } + + public const uint WLAN_CLIENT_VERSION_XP_SP2 = 1; + public const uint WLAN_CLIENT_VERSION_LONGHORN = 2; + + [DllImport("wlanapi.dll")] + public static extern int WlanOpenHandle( + [In] UInt32 clientVersion, + [In, Out] IntPtr pReserved, + [Out] out UInt32 negotiatedVersion, + [Out] out IntPtr clientHandle); + + [DllImport("wlanapi.dll")] + public static extern int WlanCloseHandle( + [In] IntPtr clientHandle, + [In, Out] IntPtr pReserved); + + [DllImport("wlanapi.dll")] + public static extern int WlanEnumInterfaces( + [In] IntPtr clientHandle, + [In, Out] IntPtr pReserved, + [Out] out IntPtr ppInterfaceList); + + [DllImport("wlanapi.dll")] + public static extern int WlanQueryInterface( + [In] IntPtr clientHandle, + [In, MarshalAs(UnmanagedType.LPStruct)] Guid interfaceGuid, + [In] WlanIntfOpcode opCode, + [In, Out] IntPtr pReserved, + [Out] out int dataSize, + [Out] out IntPtr ppData, + [Out] out WlanOpcodeValueType wlanOpcodeValueType); + + [DllImport("wlanapi.dll")] + public static extern int WlanSetInterface( + [In] IntPtr clientHandle, + [In, MarshalAs(UnmanagedType.LPStruct)] Guid interfaceGuid, + [In] WlanIntfOpcode opCode, + [In] uint dataSize, + [In] IntPtr pData, + [In, Out] IntPtr pReserved); + + /// <param name="pDot11Ssid">Not supported on Windows XP SP2: must be a <c>null</c> reference.</param> + /// <param name="pIeData">Not supported on Windows XP SP2: must be a <c>null</c> reference.</param> + [DllImport("wlanapi.dll")] + public static extern int WlanScan( + [In] IntPtr clientHandle, + [In, MarshalAs(UnmanagedType.LPStruct)] Guid interfaceGuid, + [In] IntPtr pDot11Ssid, + [In] IntPtr pIeData, + [In, Out] IntPtr pReserved); + + /// <summary> + /// Defines flags passed to <see cref="WlanGetAvailableNetworkList"/>. + /// </summary> + [Flags] + public enum WlanGetAvailableNetworkFlags + { + /// <summary> + /// Include all ad-hoc network profiles in the available network list, including profiles that are not visible. + /// </summary> + IncludeAllAdhocProfiles = 0x00000001, + /// <summary> + /// Include all hidden network profiles in the available network list, including profiles that are not visible. + /// </summary> + IncludeAllManualHiddenProfiles = 0x00000002 + } + + /// <summary> + /// The header of an array of information about available networks. + /// </summary> + [StructLayout(LayoutKind.Sequential)] + internal struct WlanAvailableNetworkListHeader + { + /// <summary> + /// Contains the number of <see cref=""/> items following the header. + /// </summary> + public uint numberOfItems; + /// <summary> + /// The index of the current item. The index of the first item is 0. + /// </summary> + public uint index; + } + + /// <summary> + /// Contains various flags for the network. + /// </summary> + [Flags] + public enum WlanAvailableNetworkFlags + { + /// <summary> + /// This network is currently connected. + /// </summary> + Connected = 0x00000001, + /// <summary> + /// There is a profile for this network. + /// </summary> + HasProfile = 0x00000002 + } + + /// <summary> + /// Contains information about an available wireless network. + /// </summary> + [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)] + public struct WlanAvailableNetwork + { + /// <summary> + /// Contains the profile name associated with the network. + /// If the network doesn't have a profile, this member will be empty. + /// If multiple profiles are associated with the network, there will be multiple entries with the same SSID in the visible network list. Profile names are case-sensitive. + /// </summary> + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] + public string profileName; + /// <summary> + /// Contains the SSID of the visible wireless network. + /// </summary> + public Dot11Ssid dot11Ssid; + /// <summary> + /// Specifies whether the network is infrastructure or ad hoc. + /// </summary> + public Dot11BssType dot11BssType; + /// <summary> + /// Indicates the number of BSSIDs in the network. + /// </summary> + public uint numberOfBssids; + /// <summary> + /// Indicates whether the network is connectable or not. + /// </summary> + public bool networkConnectable; + /// <summary> + /// Indicates why a network cannot be connected to. This member is only valid when <see cref="networkConnectable"/> is <c>false</c>. + /// </summary> + public WlanReasonCode wlanNotConnectableReason; + /// <summary> + /// The number of PHY types supported on available networks. + /// The maximum value of this field is 8. If more than 8 PHY types are supported, <see cref="morePhyTypes"/> must be set to <c>true</c>. + /// </summary> + private uint numberOfPhyTypes; + /// <summary> + /// Contains an array of <see cref="Dot11PhyType"/> values that represent the PHY types supported by the available networks. + /// When <see cref="numberOfPhyTypes"/> is greater than 8, this array contains only the first 8 PHY types. + /// </summary> + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] + private Dot11PhyType[] dot11PhyTypes; + /// <summary> + /// Gets the <see cref="Dot11PhyType"/> values that represent the PHY types supported by the available networks. + /// </summary> + public Dot11PhyType[] Dot11PhyTypes + { + get + { + Dot11PhyType[] ret = new Dot11PhyType[numberOfPhyTypes]; + Array.Copy(dot11PhyTypes, ret, numberOfPhyTypes); + return ret; + } + } + /// <summary> + /// Specifies if there are more than 8 PHY types supported. + /// When this member is set to <c>true</c>, an application must call <see cref="WlanClient.WlanInterface.GetNetworkBssList"/> to get the complete list of PHY types. + /// <see cref="WlanBssEntry.phyId"/> contains the PHY type for an entry. + /// </summary> + public bool morePhyTypes; + /// <summary> + /// A percentage value that represents the signal quality of the network. + /// This field contains a value between 0 and 100. + /// A value of 0 implies an actual RSSI signal strength of -100 dbm. + /// A value of 100 implies an actual RSSI signal strength of -50 dbm. + /// You can calculate the RSSI signal strength value for values between 1 and 99 using linear interpolation. + /// </summary> + public uint wlanSignalQuality; + /// <summary> + /// Indicates whether security is enabled on the network. + /// </summary> + public bool securityEnabled; + /// <summary> + /// Indicates the default authentication algorithm used to join this network for the first time. + /// </summary> + public Dot11AuthAlgorithm dot11DefaultAuthAlgorithm; + /// <summary> + /// Indicates the default cipher algorithm to be used when joining this network. + /// </summary> + public Dot11CipherAlgorithm dot11DefaultCipherAlgorithm; + /// <summary> + /// Contains various flags for the network. + /// </summary> + public WlanAvailableNetworkFlags flags; + /// <summary> + /// Reserved for future use. Must be set to NULL. + /// </summary> + uint reserved; + } + + [DllImport("wlanapi.dll")] + public static extern int WlanGetAvailableNetworkList( + [In] IntPtr clientHandle, + [In, MarshalAs(UnmanagedType.LPStruct)] Guid interfaceGuid, + [In] WlanGetAvailableNetworkFlags flags, + [In, Out] IntPtr reservedPtr, + [Out] out IntPtr availableNetworkListPtr); + + [Flags] + public enum WlanProfileFlags + { + /// <remarks> + /// The only option available on Windows XP SP2. + /// </remarks> + AllUser = 0, + GroupPolicy = 1, + User = 2 + } + + [DllImport("wlanapi.dll")] + public static extern int WlanSetProfile( + [In] IntPtr clientHandle, + [In, MarshalAs(UnmanagedType.LPStruct)] Guid interfaceGuid, + [In] WlanProfileFlags flags, + [In, MarshalAs(UnmanagedType.LPWStr)] string profileXml, + [In, Optional, MarshalAs(UnmanagedType.LPWStr)] string allUserProfileSecurity, + [In] bool overwrite, + [In] IntPtr pReserved, + [Out] out WlanReasonCode reasonCode); + + /// <summary> + /// Defines the access mask of an all-user profile. + /// </summary> + [Flags] + public enum WlanAccess + { + /// <summary> + /// The user can view profile permissions. + /// </summary> + ReadAccess = 0x00020000 | 0x0001, + /// <summary> + /// The user has read access, and the user can also connect to and disconnect from a network using the profile. + /// </summary> + ExecuteAccess = ReadAccess | 0x0020, + /// <summary> + /// The user has execute access and the user can also modify and delete permissions associated with a profile. + /// </summary> + WriteAccess = ReadAccess | ExecuteAccess | 0x0002 | 0x00010000 | 0x00040000 + } + + /// <param name="flags">Not supported on Windows XP SP2: must be a <c>null</c> reference.</param> + [DllImport("wlanapi.dll")] + public static extern int WlanGetProfile( + [In] IntPtr clientHandle, + [In, MarshalAs(UnmanagedType.LPStruct)] Guid interfaceGuid, + [In, MarshalAs(UnmanagedType.LPWStr)] string profileName, + [In] IntPtr pReserved, + [Out] out IntPtr profileXml, + [Out, Optional] out WlanProfileFlags flags, + [Out, Optional] out WlanAccess grantedAccess); + + [DllImport("wlanapi.dll")] + public static extern int WlanGetProfileList( + [In] IntPtr clientHandle, + [In, MarshalAs(UnmanagedType.LPStruct)] Guid interfaceGuid, + [In] IntPtr pReserved, + [Out] out IntPtr profileList + ); + + [DllImport("wlanapi.dll")] + public static extern void WlanFreeMemory(IntPtr pMemory); + + [DllImport("wlanapi.dll")] + public static extern int WlanReasonCodeToString( + [In] WlanReasonCode reasonCode, + [In] int bufferSize, + [In, Out] StringBuilder stringBuffer, + IntPtr pReserved + ); + + /// <summary> + /// Specifies where the notification comes from. + /// </summary> + [Flags] + public enum WlanNotificationSource + { + None = 0, + /// <summary> + /// All notifications, including those generated by the 802.1X module. + /// </summary> + All = 0X0000FFFF, + /// <summary> + /// Notifications generated by the auto configuration module. + /// </summary> + ACM = 0X00000008, + /// <summary> + /// Notifications generated by MSM. + /// </summary> + MSM = 0X00000010, + /// <summary> + /// Notifications generated by the security module. + /// </summary> + Security = 0X00000020, + /// <summary> + /// Notifications generated by independent hardware vendors (IHV). + /// </summary> + IHV = 0X00000040 + } + + /// <summary> + /// Indicates the type of an ACM (<see cref="WlanNotificationSource.ACM"/>) notification. + /// </summary> + /// <remarks> + /// The enumeration identifiers correspond to the native <c>wlan_notification_acm_</c> identifiers. + /// On Windows XP SP2, only the <c>ConnectionComplete</c> and <c>Disconnected</c> notifications are available. + /// </remarks> + public enum WlanNotificationCodeAcm + { + AutoconfEnabled = 1, + AutoconfDisabled, + BackgroundScanEnabled, + BackgroundScanDisabled, + BssTypeChange, + PowerSettingChange, + ScanComplete, + ScanFail, + ConnectionStart, + ConnectionComplete, + ConnectionAttemptFail, + FilterListChange, + InterfaceArrival, + InterfaceRemoval, + ProfileChange, + ProfileNameChange, + ProfilesExhausted, + NetworkNotAvailable, + NetworkAvailable, + Disconnecting, + Disconnected, + AdhocNetworkStateChange + } + + /// <summary> + /// Indicates the type of an MSM (<see cref="WlanNotificationSource.MSM"/>) notification. + /// </summary> + /// <remarks> + /// The enumeration identifiers correspond to the native <c>wlan_notification_msm_</c> identifiers. + /// </remarks> + public enum WlanNotificationCodeMsm + { + Associating = 1, + Associated, + Authenticating, + Connected, + RoamingStart, + RoamingEnd, + RadioStateChange, + SignalQualityChange, + Disassociating, + Disconnected, + PeerJoin, + PeerLeave, + AdapterRemoval, + AdapterOperationModeChange + } + + /// <summary> + /// Contains information provided when registering for notifications. + /// </summary> + /// <remarks> + /// Corresponds to the native <c>WLAN_NOTIFICATION_DATA</c> type. + /// </remarks> + [StructLayout(LayoutKind.Sequential)] + public struct WlanNotificationData + { + /// <summary> + /// Specifies where the notification comes from. + /// </summary> + /// <remarks> + /// On Windows XP SP2, this field must be set to <see cref="WlanNotificationSource.None"/>, <see cref="WlanNotificationSource.All"/> or <see cref="WlanNotificationSource.ACM"/>. + /// </remarks> + public WlanNotificationSource notificationSource; + /// <summary> + /// Indicates the type of notification. The value of this field indicates what type of associated data will be present in <see cref="dataPtr"/>. + /// </summary> + public int notificationCode; + /// <summary> + /// Indicates which interface the notification is for. + /// </summary> + public Guid interfaceGuid; + /// <summary> + /// Specifies the size of <see cref="dataPtr"/>, in bytes. + /// </summary> + public int dataSize; + /// <summary> + /// Pointer to additional data needed for the notification, as indicated by <see cref="notificationCode"/>. + /// </summary> + public IntPtr dataPtr; + + /// <summary> + /// Gets the notification code (in the correct enumeration type) according to the notification source. + /// </summary> + public object NotificationCode + { + get + { + if (notificationSource == WlanNotificationSource.MSM) + return (WlanNotificationCodeMsm)notificationCode; + else if (notificationSource == WlanNotificationSource.ACM) + return (WlanNotificationCodeAcm)notificationCode; + else + return notificationCode; + } + + } + } + + /// <summary> + /// Defines the callback function which accepts WLAN notifications. + /// </summary> + public delegate void WlanNotificationCallbackDelegate(ref WlanNotificationData notificationData, IntPtr context); + + [DllImport("wlanapi.dll")] + public static extern int WlanRegisterNotification( + [In] IntPtr clientHandle, + [In] WlanNotificationSource notifSource, + [In] bool ignoreDuplicate, + [In] WlanNotificationCallbackDelegate funcCallback, + [In] IntPtr callbackContext, + [In] IntPtr reserved, + [Out] out WlanNotificationSource prevNotifSource); + + /// <summary> + /// Defines connection parameter flags. + /// </summary> + [Flags] + public enum WlanConnectionFlags + { + /// <summary> + /// Connect to the destination network even if the destination is a hidden network. A hidden network does not broadcast its SSID. Do not use this flag if the destination network is an ad-hoc network. + /// <para>If the profile specified by <see cref="WlanConnect... [truncated message content] |
From: <dou...@us...> - 2011-11-21 20:30:09
|
Revision: 4338 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4338&view=rev Author: dougmckeen Date: 2011-11-21 20:29:56 +0000 (Mon, 21 Nov 2011) Log Message: ----------- Added Paths: ----------- trunk/plugins/CanadianWeather/ trunk/plugins/CanadianWeather/CanadianWeather.csproj trunk/plugins/CanadianWeather/CanadianWeather.csproj.user trunk/plugins/CanadianWeather/ConfigurationForm.Designer.cs trunk/plugins/CanadianWeather/ConfigurationForm.cs trunk/plugins/CanadianWeather/ConfigurationForm.resx trunk/plugins/CanadianWeather/GUICanadianWeather.cs trunk/plugins/CanadianWeather/Properties/ trunk/plugins/CanadianWeather/Properties/AssemblyInfo.cs trunk/plugins/CanadianWeather/Properties/DataSources/ trunk/plugins/CanadianWeather/Properties/DataSources/ConfigurationForm.datasource trunk/plugins/CanadianWeather/Properties/lf.png trunk/plugins/CanadianWeather/Properties/lf_disabled.png trunk/plugins/CanadianWeather/Resource1.Designer.cs trunk/plugins/CanadianWeather/Resource1.resx trunk/plugins/CanadianWeather/Resources/ trunk/plugins/CanadianWeather/Resources/lf.png trunk/plugins/CanadianWeather/Resources/lf_disabled.png Added: trunk/plugins/CanadianWeather/CanadianWeather.csproj =================================================================== --- trunk/plugins/CanadianWeather/CanadianWeather.csproj (rev 0) +++ trunk/plugins/CanadianWeather/CanadianWeather.csproj 2011-11-21 20:29:56 UTC (rev 4338) @@ -0,0 +1,103 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>8.0.30703</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{4065B871-27FA-4CCE-9ECC-D3722571B79D}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>CanadianWeather</RootNamespace> + <AssemblyName>CanadianWeather</AssemblyName> + <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + <TargetFrameworkProfile /> + </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> + </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> + <PropertyGroup> + <Win32Resource> + </Win32Resource> + </PropertyGroup> + <ItemGroup> + <Reference Include="Common.Utils"> + <HintPath>C:\Program Files\Team MediaPortal\MediaPortal\Common.Utils.dll</HintPath> + </Reference> + <Reference Include="Core, Version=1.1.7.0, Culture=neutral, processorArchitecture=x86"> + <HintPath>C:\Program Files\Team MediaPortal\MediaPortal\Core.dll</HintPath> + <SpecificVersion>False</SpecificVersion> + </Reference> + <Reference Include="Dialogs"> + <HintPath>C:\Program Files\Team MediaPortal\MediaPortal\plugins\Windows\Dialogs.dll</HintPath> + </Reference> + <Reference Include="System" /> + <Reference Include="System.Core" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml.Linq" /> + <Reference Include="System.Data.DataSetExtensions" /> + <Reference Include="System.Data" /> + <Reference Include="System.Xml" /> + <Reference Include="Utils, Version=1.1.7.0, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>C:\Program Files\Team MediaPortal\MediaPortal\Utils.dll</HintPath> + </Reference> + </ItemGroup> + <ItemGroup> + <Compile Include="GUICanadianWeather.cs" /> + <Compile Include="ConfigurationForm.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="ConfigurationForm.Designer.cs"> + <DependentUpon>ConfigurationForm.cs</DependentUpon> + </Compile> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="Resource1.Designer.cs"> + <AutoGen>True</AutoGen> + <DesignTime>True</DesignTime> + <DependentUpon>Resource1.resx</DependentUpon> + </Compile> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="ConfigurationForm.resx"> + <DependentUpon>ConfigurationForm.cs</DependentUpon> + </EmbeddedResource> + <EmbeddedResource Include="Resource1.resx"> + <Generator>ResXFileCodeGenerator</Generator> + <LastGenOutput>Resource1.Designer.cs</LastGenOutput> + </EmbeddedResource> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="Resources\lf.png" /> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="Resources\lf_disabled.png" /> + </ItemGroup> + <ItemGroup> + <None Include="Properties\DataSources\ConfigurationForm.datasource" /> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\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 Added: trunk/plugins/CanadianWeather/CanadianWeather.csproj.user =================================================================== --- trunk/plugins/CanadianWeather/CanadianWeather.csproj.user (rev 0) +++ trunk/plugins/CanadianWeather/CanadianWeather.csproj.user 2011-11-21 20:29:56 UTC (rev 4338) @@ -0,0 +1,3 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +</Project> \ No newline at end of file Added: trunk/plugins/CanadianWeather/ConfigurationForm.Designer.cs =================================================================== --- trunk/plugins/CanadianWeather/ConfigurationForm.Designer.cs (rev 0) +++ trunk/plugins/CanadianWeather/ConfigurationForm.Designer.cs 2011-11-21 20:29:56 UTC (rev 4338) @@ -0,0 +1,451 @@ +namespace MediaPortal.GUI.CanadianWeather +{ + partial class ConfigurationForm + { + /// <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.RadioButtonEnglish = new System.Windows.Forms.RadioButton(); + this.RadioButtonFrench = new System.Windows.Forms.RadioButton(); + this.LanguageChoice = new System.Windows.Forms.GroupBox(); + this.label1 = new System.Windows.Forms.Label(); + this.RefreshIntervalTxtBx = new System.Windows.Forms.TextBox(); + this.PluginNameTextBox = new System.Windows.Forms.Label(); + this.PluginNameTxtBx = new System.Windows.Forms.TextBox(); + this.OKButton = new System.Windows.Forms.Button(); + this.Cancel = new System.Windows.Forms.Button(); + this.Locations = new System.Windows.Forms.ListBox(); + this.MoveUp = new System.Windows.Forms.Button(); + this.MoveDown = new System.Windows.Forms.Button(); + this.Delete = new System.Windows.Forms.Button(); + this.Add = new System.Windows.Forms.Button(); + this.label6 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.listBoxProvince = new System.Windows.Forms.ListBox(); + this.listBoxCity = new System.Windows.Forms.ListBox(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.ImageURL0 = new System.Windows.Forms.TextBox(); + this.label3 = new System.Windows.Forms.Label(); + this.label7 = new System.Windows.Forms.Label(); + this.label8 = new System.Windows.Forms.Label(); + this.label9 = new System.Windows.Forms.Label(); + this.label10 = new System.Windows.Forms.Label(); + this.ImageURL1 = new System.Windows.Forms.TextBox(); + this.ImageURL2 = new System.Windows.Forms.TextBox(); + this.ImageURL3 = new System.Windows.Forms.TextBox(); + this.ImageURL4 = new System.Windows.Forms.TextBox(); + this.label12 = new System.Windows.Forms.Label(); + this.configurationFormBindingSource = new System.Windows.Forms.BindingSource(this.components); + this.LanguageChoice.SuspendLayout(); + this.groupBox1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.configurationFormBindingSource)).BeginInit(); + this.SuspendLayout(); + // + // RadioButtonEnglish + // + this.RadioButtonEnglish.AutoSize = true; + this.RadioButtonEnglish.Checked = true; + this.RadioButtonEnglish.Enabled = false; + this.RadioButtonEnglish.Location = new System.Drawing.Point(6, 19); + this.RadioButtonEnglish.Name = "RadioButtonEnglish"; + this.RadioButtonEnglish.Size = new System.Drawing.Size(59, 17); + this.RadioButtonEnglish.TabIndex = 5; + this.RadioButtonEnglish.TabStop = true; + this.RadioButtonEnglish.Text = "English"; + this.RadioButtonEnglish.UseVisualStyleBackColor = true; + // + // RadioButtonFrench + // + this.RadioButtonFrench.AutoSize = true; + this.RadioButtonFrench.Enabled = false; + this.RadioButtonFrench.Location = new System.Drawing.Point(6, 40); + this.RadioButtonFrench.Name = "RadioButtonFrench"; + this.RadioButtonFrench.Size = new System.Drawing.Size(58, 17); + this.RadioButtonFrench.TabIndex = 6; + this.RadioButtonFrench.Text = "French"; + this.RadioButtonFrench.UseVisualStyleBackColor = true; + // + // LanguageChoice + // + this.LanguageChoice.Controls.Add(this.RadioButtonEnglish); + this.LanguageChoice.Controls.Add(this.RadioButtonFrench); + this.LanguageChoice.Enabled = false; + this.LanguageChoice.Location = new System.Drawing.Point(341, 1); + this.LanguageChoice.Name = "LanguageChoice"; + this.LanguageChoice.Size = new System.Drawing.Size(79, 66); + this.LanguageChoice.TabIndex = 8; + this.LanguageChoice.TabStop = false; + this.LanguageChoice.Text = "Language"; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(14, 37); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(82, 26); + this.label1.TabIndex = 9; + this.label1.Text = "Refresh Interval\r\n(minutes)"; + // + // RefreshIntervalTxtBx + // + this.RefreshIntervalTxtBx.Location = new System.Drawing.Point(102, 45); + this.RefreshIntervalTxtBx.Name = "RefreshIntervalTxtBx"; + this.RefreshIntervalTxtBx.Size = new System.Drawing.Size(135, 20); + this.RefreshIntervalTxtBx.TabIndex = 10; + // + // PluginNameTextBox + // + this.PluginNameTextBox.AutoSize = true; + this.PluginNameTextBox.Location = new System.Drawing.Point(14, 11); + this.PluginNameTextBox.Name = "PluginNameTextBox"; + this.PluginNameTextBox.Size = new System.Drawing.Size(67, 13); + this.PluginNameTextBox.TabIndex = 9; + this.PluginNameTextBox.Text = "Plugin Name"; + // + // PluginNameTxtBx + // + this.PluginNameTxtBx.Location = new System.Drawing.Point(102, 11); + this.PluginNameTxtBx.MaxLength = 127; + this.PluginNameTxtBx.Name = "PluginNameTxtBx"; + this.PluginNameTxtBx.Size = new System.Drawing.Size(135, 20); + this.PluginNameTxtBx.TabIndex = 10; + // + // OKButton + // + this.OKButton.Location = new System.Drawing.Point(345, 491); + this.OKButton.Name = "OKButton"; + this.OKButton.Size = new System.Drawing.Size(75, 23); + this.OKButton.TabIndex = 12; + this.OKButton.Text = "OK"; + this.OKButton.UseVisualStyleBackColor = true; + this.OKButton.Click += new System.EventHandler(this.OK_Click); + // + // Cancel + // + this.Cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.Cancel.Location = new System.Drawing.Point(426, 491); + this.Cancel.Name = "Cancel"; + this.Cancel.Size = new System.Drawing.Size(75, 23); + this.Cancel.TabIndex = 13; + this.Cancel.Text = "Cancel"; + this.Cancel.UseVisualStyleBackColor = true; + this.Cancel.Click += new System.EventHandler(this.Cancel_Click); + // + // Locations + // + this.Locations.FormattingEnabled = true; + this.Locations.HorizontalScrollbar = true; + this.Locations.Location = new System.Drawing.Point(335, 62); + this.Locations.Name = "Locations"; + this.Locations.Size = new System.Drawing.Size(160, 173); + this.Locations.TabIndex = 0; + // + // MoveUp + // + this.MoveUp.Location = new System.Drawing.Point(254, 127); + this.MoveUp.Name = "MoveUp"; + this.MoveUp.Size = new System.Drawing.Size(75, 23); + this.MoveUp.TabIndex = 1; + this.MoveUp.Text = "Move Up"; + this.MoveUp.UseVisualStyleBackColor = true; + this.MoveUp.Click += new System.EventHandler(this.MoveUp_Click); + // + // MoveDown + // + this.MoveDown.Location = new System.Drawing.Point(254, 156); + this.MoveDown.Name = "MoveDown"; + this.MoveDown.Size = new System.Drawing.Size(75, 23); + this.MoveDown.TabIndex = 2; + this.MoveDown.Text = "Move Down"; + this.MoveDown.UseVisualStyleBackColor = true; + this.MoveDown.Click += new System.EventHandler(this.MoveDown_Click); + // + // Delete + // + this.Delete.Location = new System.Drawing.Point(254, 212); + this.Delete.Name = "Delete"; + this.Delete.Size = new System.Drawing.Size(75, 23); + this.Delete.TabIndex = 3; + this.Delete.Text = "Delete"; + this.Delete.UseVisualStyleBackColor = true; + this.Delete.Click += new System.EventHandler(this.Delete_Click); + // + // Add + // + this.Add.Location = new System.Drawing.Point(254, 67); + this.Add.Name = "Add"; + this.Add.Size = new System.Drawing.Size(75, 23); + this.Add.TabIndex = 4; + this.Add.Text = "Add"; + this.Add.UseVisualStyleBackColor = true; + this.Add.Click += new System.EventHandler(this.Add_Click); + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(8, 16); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(215, 13); + this.label6.TabIndex = 9; + this.label6.Text = "Select a Province then a City and press Add"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(335, 40); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(53, 13); + this.label2.TabIndex = 11; + this.label2.Text = "Locations"; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(17, 40); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(49, 13); + this.label4.TabIndex = 16; + this.label4.Text = "Province"; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(17, 129); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(24, 13); + this.label5.TabIndex = 16; + this.label5.Text = "City"; + // + // listBoxProvince + // + this.listBoxProvince.FormattingEnabled = true; + this.listBoxProvince.Location = new System.Drawing.Point(96, 39); + this.listBoxProvince.Name = "listBoxProvince"; + this.listBoxProvince.Size = new System.Drawing.Size(76, 82); + this.listBoxProvince.TabIndex = 17; + this.listBoxProvince.SelectedIndexChanged += new System.EventHandler(this.listBoxProvince_SelectedIndexChanged); + // + // listBoxCity + // + this.listBoxCity.FormattingEnabled = true; + this.listBoxCity.HorizontalScrollbar = true; + this.listBoxCity.Location = new System.Drawing.Point(46, 127); + this.listBoxCity.Name = "listBoxCity"; + this.listBoxCity.Size = new System.Drawing.Size(185, 108); + this.listBoxCity.TabIndex = 18; + this.listBoxCity.SelectedIndexChanged += new System.EventHandler(this.listBoxCity_SelectedIndexChanged); + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.listBoxCity); + this.groupBox1.Controls.Add(this.listBoxProvince); + this.groupBox1.Controls.Add(this.label5); + this.groupBox1.Controls.Add(this.label4); + this.groupBox1.Controls.Add(this.label2); + this.groupBox1.Controls.Add(this.label6); + this.groupBox1.Controls.Add(this.Add); + this.groupBox1.Controls.Add(this.Delete); + this.groupBox1.Controls.Add(this.MoveDown); + this.groupBox1.Controls.Add(this.MoveUp); + this.groupBox1.Controls.Add(this.Locations); + this.groupBox1.Location = new System.Drawing.Point(6, 72); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(509, 254); + this.groupBox1.TabIndex = 19; + this.groupBox1.TabStop = false; + // + // ImageURL0 + // + this.ImageURL0.Location = new System.Drawing.Point(65, 363); + this.ImageURL0.Name = "ImageURL0"; + this.ImageURL0.Size = new System.Drawing.Size(436, 20); + this.ImageURL0.TabIndex = 20; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(14, 366); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(45, 13); + this.label3.TabIndex = 21; + this.label3.Text = "Image 1"; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(14, 389); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(45, 13); + this.label7.TabIndex = 21; + this.label7.Text = "Image 2"; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(14, 412); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(45, 13); + this.label8.TabIndex = 21; + this.label8.Text = "Image 3"; + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Location = new System.Drawing.Point(14, 435); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(45, 13); + this.label9.TabIndex = 21; + this.label9.Text = "Image 4"; + // + // label10 + // + this.label10.AutoSize = true; + this.label10.Location = new System.Drawing.Point(14, 457); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(45, 13); + this.label10.TabIndex = 21; + this.label10.Text = "Image 5"; + // + // ImageURL1 + // + this.ImageURL1.Location = new System.Drawing.Point(65, 386); + this.ImageURL1.Name = "ImageURL1"; + this.ImageURL1.Size = new System.Drawing.Size(436, 20); + this.ImageURL1.TabIndex = 20; + // + // ImageURL2 + // + this.ImageURL2.Location = new System.Drawing.Point(65, 409); + this.ImageURL2.Name = "ImageURL2"; + this.ImageURL2.Size = new System.Drawing.Size(436, 20); + this.ImageURL2.TabIndex = 20; + // + // ImageURL3 + // + this.ImageURL3.Location = new System.Drawing.Point(65, 432); + this.ImageURL3.Name = "ImageURL3"; + this.ImageURL3.Size = new System.Drawing.Size(436, 20); + this.ImageURL3.TabIndex = 20; + // + // ImageURL4 + // + this.ImageURL4.Location = new System.Drawing.Point(65, 454); + this.ImageURL4.Name = "ImageURL4"; + this.ImageURL4.Size = new System.Drawing.Size(436, 20); + this.ImageURL4.TabIndex = 20; + // + // label12 + // + this.label12.AutoSize = true; + this.label12.Location = new System.Drawing.Point(14, 338); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(319, 13); + this.label12.TabIndex = 21; + this.label12.Text = "Enter Image URLs below. e.g. http://www.sample.com/image.jpg"; + // + // configurationFormBindingSource + // + this.configurationFormBindingSource.DataSource = typeof(MediaPortal.GUI.CanadianWeather.ConfigurationForm); + // + // ConfigurationForm + // + this.AcceptButton = this.OKButton; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.Cancel; + this.ClientSize = new System.Drawing.Size(522, 532); + this.Controls.Add(this.label12); + this.Controls.Add(this.label10); + this.Controls.Add(this.label9); + this.Controls.Add(this.label8); + this.Controls.Add(this.label7); + this.Controls.Add(this.label3); + this.Controls.Add(this.ImageURL4); + this.Controls.Add(this.ImageURL3); + this.Controls.Add(this.ImageURL2); + this.Controls.Add(this.ImageURL1); + this.Controls.Add(this.ImageURL0); + this.Controls.Add(this.groupBox1); + this.Controls.Add(this.Cancel); + this.Controls.Add(this.OKButton); + this.Controls.Add(this.PluginNameTxtBx); + this.Controls.Add(this.RefreshIntervalTxtBx); + this.Controls.Add(this.PluginNameTextBox); + this.Controls.Add(this.label1); + this.Controls.Add(this.LanguageChoice); + this.Name = "ConfigurationForm"; + this.Text = "Canadian Weather Configuration"; + this.Load += new System.EventHandler(this.ConfigurationForm_Load); + this.LanguageChoice.ResumeLayout(false); + this.LanguageChoice.PerformLayout(); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.configurationFormBindingSource)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.RadioButton RadioButtonEnglish; + private System.Windows.Forms.RadioButton RadioButtonFrench; + private System.Windows.Forms.GroupBox LanguageChoice; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox RefreshIntervalTxtBx; + private System.Windows.Forms.Label PluginNameTextBox; + private System.Windows.Forms.TextBox PluginNameTxtBx; + private System.Windows.Forms.Button OKButton; + private System.Windows.Forms.Button Cancel; + private System.Windows.Forms.BindingSource configurationFormBindingSource; + private System.Windows.Forms.ListBox Locations; + private System.Windows.Forms.Button MoveUp; + private System.Windows.Forms.Button MoveDown; + private System.Windows.Forms.Button Delete; + private System.Windows.Forms.Button Add; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.ListBox listBoxProvince; + private System.Windows.Forms.ListBox listBoxCity; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.TextBox ImageURL0; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.TextBox ImageURL1; + private System.Windows.Forms.TextBox ImageURL2; + private System.Windows.Forms.TextBox ImageURL3; + private System.Windows.Forms.TextBox ImageURL4; + private System.Windows.Forms.Label label12; + } +} \ No newline at end of file Added: trunk/plugins/CanadianWeather/ConfigurationForm.cs =================================================================== --- trunk/plugins/CanadianWeather/ConfigurationForm.cs (rev 0) +++ trunk/plugins/CanadianWeather/ConfigurationForm.cs 2011-11-21 20:29:56 UTC (rev 4338) @@ -0,0 +1,354 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using System.Xml.Linq; +using System.Text; +using System.Windows.Forms; +using System.Net; +using System.IO; +using MediaPortal.Configuration; + +namespace MediaPortal.GUI.CanadianWeather +{ + public partial class ConfigurationForm : Form + { + String strURL = "http://dd.weatheroffice.ec.gc.ca/citypage_weather/xml/siteList.xml"; + + List<string> _items = new List<string>(); + string PluginName; + int RefreshTime; + string Language; + string[,] Sites; + bool SiteLookupFailed; + int NumberofSites; + int siteIndex; + string[,] tempstring; + List<string> ShortListOfProvs; + List<string> CityNames; + XDocument loaded; + string[] ProvinceArray; + string[] CityArray; + string selectedProvince = ""; + string selectedCity = ""; + string Temp; + + public ConfigurationForm() + { + InitializeComponent(); + + // read settings file, fill in form + using (MediaPortal.Profile.Settings reader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "CanadianWeatherSettings.xml"))) + { + PluginName = reader.GetValueAsString("BasicSettings", "PluginName", "Canadian Weather"); + RefreshTime = reader.GetValueAsInt("BasicSettings", "RefreshTime", 60); + Language = reader.GetValueAsString("BasicSettings", "Language", "English"); + + //create 2D array of sites (20 sites, 4 attributes) + Sites = new string[20, 4]; + for (int i = 0; i < 20; i++) + { + Sites[i, 0] = reader.GetValueAsString("Site" + i, "SiteID", ""); + Sites[i, 1] = reader.GetValueAsString("Site" + i, "EnglishName", ""); + Sites[i, 2] = reader.GetValueAsString("Site" + i, "FrenchName", ""); + Sites[i, 3] = reader.GetValueAsString("Site" + i, "ProvinceCode", ""); + } + + //Fill in Refresh Interval + RefreshIntervalTxtBx.Text = RefreshTime.ToString(); + + //Activate Language Radio Button + if (String.Equals(Language, "French")) + { RadioButtonFrench.Checked = true; } + else + { RadioButtonEnglish.Checked = true; } + + //Determine how many sites exist + NumberofSites = 0; + for (int i = 0; i < 20; i++) + { + if (string.IsNullOrEmpty(Sites[i, 0])) + { + NumberofSites = i; + break; + } + //null string not found so list is full + NumberofSites = 19; //(20 sites, counting from zero) + } + + //fill the list box + for (int i = 0; i < NumberofSites; i++) + { _items.Add(Sites[i, 1]); } + + Locations.DataSource = _items; + + //Fill in the Plugin Name + PluginNameTxtBx.Text = PluginName; + } + + //Get Site List from Environment Canada + GetSiteListFromEnvironmentCanada(); + } + + public Boolean GetSiteListFromEnvironmentCanada() + { + try + { + //get XML + String SiteList; + HttpWebRequest request = (HttpWebRequest)WebRequest.Create(strURL); + request.Timeout = 20000; + HttpWebResponse response = (HttpWebResponse)request.GetResponse(); + Stream responseStream = response.GetResponseStream(); + StreamReader htmlStream = new StreamReader(responseStream, Encoding.Default); + SiteList = htmlStream.ReadToEnd(); + //parse + loaded = XDocument.Parse(SiteList); + //int sitesCount = loaded.Descendants("site").Count(); + + //get a distinct list of the province codes from the XDocument + ShortListOfProvs = loaded.Descendants("provinceCode") + .Select(x => x.Value) + .Distinct() + .ToList(); + ShortListOfProvs.Sort(); + + //display the short list of provinces in the listbox + ProvinceArray = ShortListOfProvs.ToArray(); + listBoxProvince.Items.AddRange(ProvinceArray); + + //clean up + htmlStream.Dispose(); + responseStream.Dispose(); + + SiteLookupFailed = false; + return true; + } + catch (Exception) + { + //error retrieving list of sites + SiteLookupFailed = true; + MessageBox.Show("The list of Provinces and Cities could not be obtained from Environment Canada. You can perform all actions except Add. You can close the plugin Configuration and try again later."); + Add.Enabled.Equals(false); + return false; + } + } + + private void ConfigurationForm_Load(object sender, EventArgs e) + { + + } + + private void OK_Click(object sender, EventArgs e) + { + if (RadioButtonEnglish.Checked == true) + { Language = "English"; } + else + { Language = "French"; } + + //validate Refresh Interval + int tempInteger; + if (!int.TryParse(RefreshIntervalTxtBx.Text.ToString(), out tempInteger) || tempInteger < 0 || tempInteger > 1440) + { RefreshIntervalTxtBx.Text = "60"; } //input error, set as 60 + + //write XML file + using (MediaPortal.Profile.Settings writer = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "CanadianWeatherSettings.xml"))) + { + writer.SetValue("BasicSettings", "PluginName", PluginNameTxtBx.Text); + writer.SetValue("BasicSettings", "RefreshTime", RefreshIntervalTxtBx.Text); + writer.SetValue("BasicSettings", "Language", Language); + + for (int i = 0; i < 19; i++) + { + writer.SetValue("Site" + i, "SiteID", Sites[i, 0]); + writer.SetValue("Site" + i, "EnglishName", Sites[i, 1]); + writer.SetValue("Site" + i, "FrenchName", Sites[i, 2]); + writer.SetValue("Site" + i, "ProvinceCode", Sites[i, 3]); + } + + writer.SetValue("Images", "Image0", ImageURL0.Text); + writer.SetValue("Images", "Image1", ImageURL1.Text); + writer.SetValue("Images", "Image2", ImageURL2.Text); + writer.SetValue("Images", "Image3", ImageURL3.Text); + writer.SetValue("Images", "Image4", ImageURL4.Text); + + MediaPortal.Profile.Settings.SaveCache(); + } + + //close form + Close(); + Dispose(); + } + + private void Add_Click(object sender, EventArgs e) + { + if (NumberofSites == 19) + { + MessageBox.Show("The maximum number of locations allowed is 20. You will have to delete one before adding another."); + + } + else + { + //Add the site + if (SiteLookupFailed == true) + { + MessageBox.Show("The list of Provinces and Cities could not be obtained from Environment Canada. You can perform all actions except Add. You can close the plugin Configuration and try again later."); + Add.Enabled.Equals(false); + } + + if (selectedCity == "" || selectedProvince == "") + { + MessageBox.Show("Select a Province and City first"); + } + else + { + //update the Array + //determine French Name for Province and City selected, then fill the sitecode part of Sites array + Temp = loaded.Descendants("site") + .Where(x => x.Element("provinceCode").Value == selectedProvince) + .Where(x => x.Element("nameEn").Value == selectedCity) + .Select(x => x.Attribute("code").Value) + .SingleOrDefault() + .ToString(); + Sites[NumberofSites, 0] = Temp; + //fill the nameEn part of Sites array + Sites[NumberofSites, 1] = selectedCity; + //determine French Name for Province and City selected, then fill the nameFr part of Sites array + Temp = loaded.Descendants("site") + .Where(x => x.Element("provinceCode").Value == selectedProvince) + .Where(x => x.Element("nameEn").Value == selectedCity) + .Select(x => x.Element("nameFr").Value) + .SingleOrDefault() + .ToString(); + Sites[NumberofSites, 2] = Temp; + //fill the provinceCode part of Sites array + Sites[NumberofSites, 3] = selectedProvince; + + //update the Locations Listbox + _items.Add(selectedCity); + //Locations.SetSelected(NumberofSites, true); + Locations.DataSource = null; + Locations.DataSource = _items; + + NumberofSites++; + } + } + } + + private void Delete_Click(object sender, EventArgs e) + { + if (NumberofSites == 0) + { MessageBox.Show("There are no locations in the list."); } + else + { + //which site is in focus? + siteIndex = Locations.SelectedIndex; + //move the sites one place in the list and mark the last one's attributes as null + for (int i = siteIndex; i < NumberofSites; i++) + { + for (int j = 0; j < 4; j++) + { + Sites[i, j] = Sites[i + 1, j]; + } + } + for (int j = 0; j < 4; j++) + { + Sites[NumberofSites, j] = ""; + } + NumberofSites--; + + //update the ListBox + _items.RemoveAt(siteIndex); + Locations.SetSelected(Math.Max(siteIndex - 1, 0), true); //max prevents from evaluating <0 + Locations.DataSource = null; + Locations.DataSource = _items; + } + } + + private void MoveUp_Click(object sender, EventArgs e) + { + //check if already at the top + siteIndex = Locations.SelectedIndex; + if (siteIndex > 0) + { + //adjust string order + tempstring = new string[1, 4]; + for (int j = 0; j < 4; j++) + { + tempstring[0, j] = Sites[siteIndex, j]; + Sites[siteIndex, j] = Sites[siteIndex - 1, j]; + Sites[siteIndex - 1, j] = tempstring[0, j]; + } + //adjust ListBox order + _items.RemoveAt(siteIndex); + _items.Insert(siteIndex - 1, tempstring[0, 1]); + Locations.SetSelected(siteIndex - 1, true); + Locations.DataSource = null; + Locations.DataSource = _items; + } + } + + private void MoveDown_Click(object sender, EventArgs e) + { + //check if already at the bottom + siteIndex = Locations.SelectedIndex; + if (siteIndex < NumberofSites - 1) + { + //adjust string order + string[,] tempstring; + tempstring = new string[1, 4]; + for (int j = 0; j < 4; j++) + { + tempstring[0, j] = Sites[siteIndex, j]; + Sites[siteIndex, j] = Sites[siteIndex + 1, j]; + Sites[siteIndex + 1, j] = tempstring[0, j]; + } + //adjust ListBox order + _items.RemoveAt(siteIndex); + _items.Insert(siteIndex + 1, tempstring[0, 1]); + Locations.SetSelected(siteIndex + 1, true); + Locations.DataSource = null; + Locations.DataSource = _items; + } + } + + private void Cancel_Click(object sender, EventArgs e) + { + Close(); + Dispose(); + } + + private void listBoxProvince_SelectedIndexChanged(object sender, EventArgs e) + { + //Selected province to a string + selectedProvince = listBoxProvince.SelectedItem.ToString(); + + //make a list of the cities for the selected province + CityNames = loaded.Descendants("site") + .Where(x => x.Element("provinceCode").Value == selectedProvince) + .Select(x => x.Element("nameEn").Value) + .ToList(); + CityNames.Sort(); + + //if we already have a city list, clear it + if (listBoxCity.Items.Count > 0) + { + listBoxCity.Items.Clear(); + } + + //create the listbox + CityArray = CityNames.ToArray(); + listBoxCity.Items.AddRange(CityArray); + //clear the arry for use next time, if required + Array.Clear(CityArray, 0, CityArray.Length); + selectedCity = ""; + } + + private void listBoxCity_SelectedIndexChanged(object sender, EventArgs e) + { + selectedCity = listBoxCity.SelectedItem.ToString(); + } + + } + +} \ No newline at end of file Added: trunk/plugins/CanadianWeather/ConfigurationForm.resx =================================================================== --- trunk/plugins/CanadianWeather/ConfigurationForm.resx (rev 0) +++ trunk/plugins/CanadianWeather/ConfigurationForm.resx 2011-11-21 20:29:56 UTC (rev 4338) @@ -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="configurationFormBindingSource.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/CanadianWeather/GUICanadianWeather.cs =================================================================== --- trunk/plugins/CanadianWeather/GUICanadianWeather.cs (rev 0) +++ trunk/plugins/CanadianWeather/GUICanadianWeather.cs 2011-11-21 20:29:56 UTC (rev 4338) @@ -0,0 +1,1572 @@ +#region using + +using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Xml.Linq; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Text; +using System.Text.RegularExpressions; +using System.Windows.Forms; +using System.IO; +using System.Xml; +using System.Net; +using MediaPortal.Configuration; +using MediaPortal.Dialogs; +using MediaPortal.GUI.Library; +using Action = MediaPortal.GUI.Library.Action; +using System.Threading; +using System.Globalization; +#endregion + +namespace MediaPortal.GUI.CanadianWeather +{ + [PluginIcons("CanadianWeather.Resources.lf.png", "CanadianWeather.Resources.lf_disabled.png")] + public class GUICanadianWeather : GUIInternalWindow, ISetupForm + { + [SkinControlAttribute(2)] protected GUIButtonControl SatelliteImageButton = null; + [SkinControlAttribute(3)] protected GUIButtonControl SevenDayForecastButton = null; + [SkinControlAttribute(4)] protected GUIButtonControl RefreshButton = null; + [SkinControlAttribute(5)] protected GUIButtonControl CityButton = null; + [SkinControlAttribute(6)] protected GUIButtonControl WeatherWarningButton = null; + + #region variables + + int tempint = 0; + string tempsavedlow = ""; + bool nightflag = false; + + + int RefreshTime; + string SelectedCity; + string LanguageChoice; + string Language; + string[,] Sites; + int NumberofSites; + string ForecastXML; + string URL; + private const int NUM_DAYS = 7; + private const char DEGREE_CHARACTER = (char)176; //the degree 'o' character + private DateTime _lastRefreshTime = DateTime.Now.AddHours(-1); //for autorefresh + string mode; + string lastmode; + private string _urlImage0 = string.Empty; + private string _urlImage1 = string.Empty; + private string _urlImage2 = string.Empty; + private string _urlImage3 = string.Empty; + private string _urlImage4 = string.Empty; + private string _urlViewImage = string.Empty; + private bool FirstTimeThruImageLoopIsCompleted; + private bool ContinueImageLoop; + + string currentLocation; + string LocalizedTimeStamp; + string ObservedYear; + string ObservedMonth; + string ObservedDay; + string ObservedHour; + string ObservedMinute; + int intObservedYear; + int intObservedMonth; + int intObservedDay; + int intObservedHour; + int intObservedMinute; + string ObservedTimeStamp; + string ObservedtextSummary; + string currentCondition; + string currentIconCode; + string currentTemperature; + string currentFeelsLike; + string currentWindChill; + string currentHumidex; + string currentDewpoint; + string currentPressure; + string currentPressuretendency; + string currentPressureAndTendency; + string currentVisibility; + string currentRelativeHumidity; + string currentWindspeed; + string currentWindgust; + string currentWinddirection; + string currentWindCombinedString; + string IssuedTimeStamp; + string SunriseTime; + string SunsetTime; + string WeatherWarningPriority; + string WeatherWarningType; + string WeatherWarningURL; + string WarningHTML; + int intIssuedYear; + int intIssuedMonth; + int intIssuedDay; + int intIssuedHour; + int intIssuedMinute; + int intSunriseYear; + int intSunriseMonth; + int intSunriseDay; + int intSunriseHour; + int intSunriseMinute; + int intSunsetYear; + int intSunsetMonth; + int intSunsetDay; + int intSunsetHour; + int intSunsetMinute; + + string strIcon = GUIGraphicsContext.Skin + @"\Media\CanadianWeather\na.png"; + string strBaseURL = "http://dd.weatheroffice.ec.gc.ca/citypage_weather/xml/"; + string strPressure = "Pressure"; + string strVisibility = "Visibility"; + string strSunrise = "Sunrise"; + string strSunset = "Sunset"; + string strForecastIssued = "Forecast Issued: "; + string strSevenDayForecast = "Text Forecast"; + string strCurrentConditions = "Current Conditions"; + string strNotObserved = "not observed"; + string strGust = " gust "; + string strWarning = "Warning - "; + string strHigh = "High"; + string strMed = "Med."; + string strLow = "Low"; + + public string[] Day = new string[NUM_DAYS]; + public string[] High = new string[NUM_DAYS]; + public string[] Low = new string[NUM_DAYS]; + public string[] IconCode = new string[NUM_DAYS]; + public string[] Pop = new string[NUM_DAYS]; + public string[] Overview = new string[NUM_DAYS]; + public string[] TextSummary = new string[NUM_DAYS]; + + private bool _workerCompleted = false; + private object _downloadLock = null; + private bool _workerActive = false; + private Images _images; + + bool SitesFound = false; + XDocument loaded; + string[] ProvinceArray; + string[] CityArray; + List<string> ShortListOfProvs; + List<string> CityNames; + String strURL = "http://dd.weatheroffice.ec.gc.ca/citypage_weather/xml/siteList.xml"; + String strChooseProv = "Select a Province"; + String strChooseCity = "Select a City"; + + #endregion + + #region enums + + private enum Controls + { + CONTROL_BTNSWITCH = 2, + CONTROL_BTNVIEW = 3, + CONTROL_BTNREFRESH = 4, + CONTROL_BTNLOCATIONSELECT = 5, + CONTROL_BTNWEATHERWARNING = 6, + + CONTROL_LABELLOCATION = 10, + CONTROL_FORECASTUPDATED = 11, + CONTROL_IMAGELOGO = 101, + CONTROL_LABELWEATHERWARNING = 16, + CONTROL_LABELSUNRISE = 19, + CONTROL_LABELSUNSET = 20, + CONTROL_IMAGENOWICON = 21, + CONTROL_LABELNOWCOND = 22, + CONTROL_LABELNOWTEMP = 23, + CONTROL_LABELNOWWIND = 24, + CONTROL_LABELNOWRELHUM = 25, + CONTROL_LABELNOWDEW = 26, + CONTROL_LABELNOWPRESSURE = 27, + CONTROL_LABELNOWVISIBILITY = 28, + CONTROL_LABELNOWFEELSLIKE = 29, + + CONTROL_STATICFEEL = 223, + CONTROL_STATICWIND = 224, + CONTROL_STATICRELHUMIDITY = 225, + CONTROL_STATICDEWPOINT = 226, + CONTROL_STATICPRESSURE = 227, + CONTROL_STATICVISIBILIY = 228, + CONTROL_STATICSUNRISE = 229, + CONTROL_STATICSUNSET = 230, + + CONTROL_LABELD0DAY = 31, + CONTROL_LABELD0HI = 32, + CONTROL_LABELD0LOW = 33, + CONTROL_LABELD0GEN = 34, + CONTROL_IMAGED0IMG = 35, + CONTROL_LABELD0POP = 36, + // Controls 31..36 - 91..96 are reserved for day 0-6 !!! + + CONTROL_STATICDAY0 = 110, //110 to 116 for StaticDay0 to StaticDay6 + CONTROL_LABELDAY0 = 120, //120 to 126 for LabelDay0 to LabelDay6 + + CONTROL_IMAGE_SAT = 1000 + + } + + private enum Images + { + Image0 = 0, + Image1 = 1, + Image2 = 2, + Image3 = 3, + Image4 = 4, + } + + #endregion + + //public GUICanadianWeather() + //{ + //} + + public bool IsRefreshing + { + get { return _workerActive; } + [MethodImpl(MethodImplOptions.Synchronized)] + private set { _workerActive = value; } + } + + protected override void OnPageDestroy(int newWindowId) + { + mode = "ShowCurrent"; + lastmode = "ShowCurrent"; + _images = Images.Image0; + FirstTimeThruImageLoopIsCompleted = false; + ContinueImageLoop = true; + } + + //protected override void OnShowContextMenu() + //{ + //} + + protected override void OnPageLoad() + { + base.OnPageLoad(); + + _downloadLock = new object(); + + FirstTimeThruImageLoopIsCompleted = false; + _images = Images.Image0; + mode = "ShowCurrent"; + lastmode = "ShowCurrent"; + LoadSettings(); //get the weather settings from the user + SelectedCity = Sites[0, 3] + "/" + Sites[0, 0] + "_"; // e.g., "AB/s0000047_" + LanguageChoice = "e"; //language choice defaulting to English for now. later check Language and set as appropriate + URL = strBaseURL + SelectedCity + LanguageChoice + ".xml"; //form URL + + OnRefresh(); + } + + public override void Process() + { + TimeSpan ts = DateTime.Now - _lastRefreshTime; + if (ts.TotalMinutes >= RefreshTime && NumberofSites > 0 && !IsRefreshing) + { + //autoupdate + mode = "ShowCurrent"; + lastmode = "ShowCurrent"; + OnRefresh(); + } + base.Process(); + } + + private void BackgroundRefresh(object sender, DoWorkEventArgs e) + { + GetForecast(URL); //get the forecast from EC + ParseXML(ForecastXML); //parse it + SetWeatherModeControls(); //display + _workerCompleted = true; + IsRefreshing = false; + } + + protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType) + { + + if (control == SevenDayForecastButton) + { + OnSevenDayForecast(); + } + if (control == RefreshButton) + { + FirstTimeThruImageLoopIsCompleted = false; + lastmode = "ShowCurrent"; + mode = "ShowCurrent"; + _images = Images.Image0; + OnRefresh(); + } + if (control == CityButton) + { + OnCityButton(); + } + if (control == WeatherWarningButton) + { + OnWeatherWarningButton(); + } + if (control == SatelliteImageButton) + { + OnSatelliteImageButton(); + } + base.OnClicked(controlId, control, actionType); + } + + private void OnSatelliteImageButton() + { + + SetNextViewType(); + if (ContinueImageLoop) + { + UpdateDetailImages(); + } + OnRefresh(); + } + + private void OnSevenDayForecast() + { + if (lastmode != "ShowTextForecast") + { + mode = "ShowTextForecast"; + SetWeatherModeControls(); + lastmode = "ShowTextForeca... [truncated message content] |
From: <Ba...@us...> - 2012-01-05 12:17:33
|
Revision: 4373 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4373&view=rev Author: BartEv Date: 2012-01-05 12:17:24 +0000 (Thu, 05 Jan 2012) Log Message: ----------- Added Paths: ----------- trunk/plugins/VeraControl/ trunk/plugins/VeraControl/DevCategories.cs trunk/plugins/VeraControl/DeviceDimmer.cs trunk/plugins/VeraControl/DeviceDoorlock.cs trunk/plugins/VeraControl/DeviceGWeather.cs trunk/plugins/VeraControl/DeviceGeneric.cs trunk/plugins/VeraControl/DeviceHumidity.cs trunk/plugins/VeraControl/DeviceLightSensor.cs trunk/plugins/VeraControl/DevicePowerMeter.cs trunk/plugins/VeraControl/DeviceSecurity.cs trunk/plugins/VeraControl/DeviceSprinkler.cs trunk/plugins/VeraControl/DeviceSwitch.cs trunk/plugins/VeraControl/DeviceTemperature.cs trunk/plugins/VeraControl/DeviceThermostat.cs trunk/plugins/VeraControl/DeviceWindowCovering.cs trunk/plugins/VeraControl/DialogActionTrigger.cs trunk/plugins/VeraControl/DialogDeviceControl.cs trunk/plugins/VeraControl/Properties/ trunk/plugins/VeraControl/Properties/AssemblyInfo.cs trunk/plugins/VeraControl/Room.cs trunk/plugins/VeraControl/Scene.cs trunk/plugins/VeraControl/Section.cs trunk/plugins/VeraControl/VeraCommunication.cs trunk/plugins/VeraControl/VeraControl.cs trunk/plugins/VeraControl/VeraControl.csproj trunk/plugins/VeraControl/VeraSetupForm.Designer.cs trunk/plugins/VeraControl/VeraSetupForm.cs trunk/plugins/VeraControl/VeraSetupForm.resx trunk/plugins/VeraControl/skin/ trunk/plugins/VeraControl/skin/Default/ trunk/plugins/VeraControl/skin/Default/VeraControl.xml trunk/plugins/VeraControl/skin/Default/VeraDialogActionTrigger.xml trunk/plugins/VeraControl/skin/Default/VeraDialogDeviceControl.xml trunk/plugins/VeraControl/skin/DefaultWide/ trunk/plugins/VeraControl/skin/DefaultWide/VeraControl.xml trunk/plugins/VeraControl/skin/DefaultWide/VeraDialogActionTrigger.xml trunk/plugins/VeraControl/skin/DefaultWide/VeraDialogDeviceControl.xml trunk/plugins/VeraControl/skin/Media/ trunk/plugins/VeraControl/skin/Media/Vera/ trunk/plugins/VeraControl/skin/Media/Vera/Binary_Light_0.png trunk/plugins/VeraControl/skin/Media/Vera/Binary_Light_100.png trunk/plugins/VeraControl/skin/Media/Vera/Dimmable_Light_0.png trunk/plugins/VeraControl/skin/Media/Vera/Dimmable_Light_100.png trunk/plugins/VeraControl/skin/Media/Vera/Dimmable_Light_25.png trunk/plugins/VeraControl/skin/Media/Vera/Dimmable_Light_50.png trunk/plugins/VeraControl/skin/Media/Vera/Dimmable_Light_75.png trunk/plugins/VeraControl/skin/Media/Vera/Door_Lock.png trunk/plugins/VeraControl/skin/Media/Vera/Door_Lock_0.png trunk/plugins/VeraControl/skin/Media/Vera/Door_Lock_100.png trunk/plugins/VeraControl/skin/Media/Vera/Generic_IO.png trunk/plugins/VeraControl/skin/Media/Vera/Humidity_Sensor.png trunk/plugins/VeraControl/skin/Media/Vera/Insteon.png trunk/plugins/VeraControl/skin/Media/Vera/Light_Sensor.png trunk/plugins/VeraControl/skin/Media/Vera/Motion_Sensor_0.png trunk/plugins/VeraControl/skin/Media/Vera/Motion_Sensor_100.png trunk/plugins/VeraControl/skin/Media/Vera/Power_Meter.png trunk/plugins/VeraControl/skin/Media/Vera/Scenes.png trunk/plugins/VeraControl/skin/Media/Vera/Temperature_Sensor.png trunk/plugins/VeraControl/skin/Media/Vera/Thermostat.png trunk/plugins/VeraControl/skin/Media/Vera/Window_Covering.png trunk/plugins/VeraControl/skin/Media/Vera/default_panel.png trunk/plugins/VeraControl/skin/Media/Vera/energy.png trunk/plugins/VeraControl/skin/Media/Vera/findvera.png trunk/plugins/VeraControl/skin/Media/Vera/generic_sensor.png Added: trunk/plugins/VeraControl/DevCategories.cs =================================================================== --- trunk/plugins/VeraControl/DevCategories.cs (rev 0) +++ trunk/plugins/VeraControl/DevCategories.cs 2012-01-05 12:17:24 UTC (rev 4373) @@ -0,0 +1,58 @@ +/* + * Created by SharpDevelop. + * User: Bart + * Date: 22-12-2011 + * Time: 14:14 + * + * Copyright: 2012 GPL - Bart Eversdijk + * MediaPort plugin - MicasaVerde (TM) Vera Controller + * E-mail: ba...@ev... + */ +using System; +using System.Xml; + +namespace VeraControl.Properties +{ + /// <summary> + /// Description of DevCategories. + /// </summary> + public class DevCategories + { + public DevCategories(XmlNode xn) + { + if (xn == null) { + m_sName = ""; + m_iId = 0; + } else { + update(xn); + } + } + + private string m_sName; + private int m_iId; + + public bool update(XmlNode xn) + { + m_sName = xn.Attributes["name"].Value; + m_iId = int.Parse(xn.Attributes["id"].Value); + return true; + } + + public int id + { + get { return m_iId; } + set { } + } + + public string name + { + get { return m_sName; } + set { } + } + + public override string ToString() + { + return name; + } + } +} Added: trunk/plugins/VeraControl/DeviceDimmer.cs =================================================================== --- trunk/plugins/VeraControl/DeviceDimmer.cs (rev 0) +++ trunk/plugins/VeraControl/DeviceDimmer.cs 2012-01-05 12:17:24 UTC (rev 4373) @@ -0,0 +1,108 @@ +/* + * Created by SharpDevelop. + * User: Bart + * Date: 22-12-2011 + * Time: 17:36 + * + * Copyright: 2012 GPL - Bart Eversdijk + * MediaPort plugin - MicasaVerde (TM) Vera Controller + * E-mail: ba...@ev... + */ +using System; +using System.Xml; + +namespace VeraControl.Properties +{ + /// <summary> + /// Description of DeviceDimmer. + /// </summary> + public class DeviceDimmer : DeviceGeneric + { + private int m_iLevel; + private string m_sWatt; + + public DeviceDimmer( XmlNode xn ): base (xn) + { + if (xn != null) + { + update(xn); + } + } + + public override bool update(XmlNode xn) + { + m_iLevel = (xn.Attributes["level"] != null ? int.Parse(xn.Attributes["level"].Value) : 0); + m_sWatt = (xn.Attributes["watts"] != null ? xn.Attributes["watts"].Value : "0"); + + return base.update(xn); + } + + public string watts + { + get { return m_sWatt; } + set { } + } + + public override bool state + { + get { return (m_iLevel > 0); } + set { + + } + } + + public override int level + { + get { return m_iLevel; } + set + { + int newValue = value; + if (newValue > 100) { + newValue = 100; + } else { + if (newValue < 0) { newValue = 0; } + } + VeraCommunication vera = VeraCommunication.Instance; + // Do something with vera + string cmd = "?id=lu_action&DeviceNum="+id.ToString()+ + "&serviceId=urn:upnp-org:serviceId:Dimming1&action=SetLoadLevelTarget" + + "&newLoadlevelTarget="+value; + string sResult = vera.doVeraRequest(cmd); + m_iLevel = newValue; + } + } + + public override int maxLevel + { + get { return 100; } + set { } + } + + public override string ToString() + { + return name + " [" + getStatusText() + "]"; + } + + public override bool isControllable + { + get { return true; } + set { } + } + + public override string getIconName() + { + string leveltxt = "0"; + if (level > 0) { leveltxt = "25"; } + if (level > 35) { leveltxt = "50"; } + if (level > 65) { leveltxt = "75"; } + if (level > 85) { leveltxt = "100"; } + + return "Dimmable_Light_"+leveltxt; + } + + public override string getStatusText() + { + return ( state ? level.ToString() + "%" : "Off"); + } + } +} Added: trunk/plugins/VeraControl/DeviceDoorlock.cs =================================================================== --- trunk/plugins/VeraControl/DeviceDoorlock.cs (rev 0) +++ trunk/plugins/VeraControl/DeviceDoorlock.cs 2012-01-05 12:17:24 UTC (rev 4373) @@ -0,0 +1,89 @@ +/* + * Created by SharpDevelop. + * User: Bart + * Date: 3-1-2012 + * Time: 11:51 + * + * Copyright: 2012 GPL - Bart Eversdijk + * MediaPort plugin - MicasaVerde (TM) Vera Controller + * E-mail: ba...@ev... + */ +using System; +using System.Xml; + +namespace VeraControl.Properties +{ + /// <summary> + /// Description of DeviceDoorlock. + /// </summary> + public class DeviceDoorlock : DeviceGeneric + { + private bool m_bStatus; + + public DeviceDoorlock( XmlNode xn ): base (xn) + { + if (xn != null) + { + update(xn); + } + } + + public override bool update(XmlNode xn) + { + m_bStatus = (xn.Attributes["status"].Value == "1"); + + return base.update(xn); + } + + public override bool state + { + get { return m_bStatus; } + set { + VeraCommunication vera = VeraCommunication.Instance; + // Do something with vera + string cmd = "?id=lu_action&DeviceNum="+id.ToString()+ + "&serviceId=urn:micasaverde-com:serviceId:DoorLock1&action=SetTarget" + + "&newTargetValue="+(value ? "1" : "0"); + string sResult = vera.doVeraRequest(cmd); + m_bStatus = value; + } + } + + public override int level + { + get { return (m_bStatus ? 1 : 0); } + set + { + state = (value > 0); + } + } + + public override int maxLevel + { + get { return 1; } + set { } + } + + public override string ToString() + { + return name + " [" + getStatusText() + "]"; + } + + public override bool isControllable + { + get { return true; } + set { } + } + + public override string getIconName() + { + return "Door_" + (m_bStatus ? "LOCKED" : "UNLOCKED"); + } + + public override string getStatusText() + { + return (state ? "Locked" : "Unlocked"); + } + + } +} Added: trunk/plugins/VeraControl/DeviceGWeather.cs =================================================================== --- trunk/plugins/VeraControl/DeviceGWeather.cs (rev 0) +++ trunk/plugins/VeraControl/DeviceGWeather.cs 2012-01-05 12:17:24 UTC (rev 4373) @@ -0,0 +1,54 @@ +/* + * Created by SharpDevelop. + * User: Bart + * Date: 3-1-2012 + * Time: 12:51 + * + * Copyright: 2012 GPL - Bart Eversdijk + * MediaPort plugin - MicasaVerde (TM) Vera Controller + * E-mail: ba...@ev... + */ +using System; +using System.Xml; + +namespace VeraControl.Properties +{ + /// <summary> + /// Description of DeviceGWeather. + /// </summary> + public class DeviceGWeather : DeviceGeneric + { + private string m_sCondition; + private string m_sWindCondition; + + public DeviceGWeather( XmlNode xn ): base (xn) + { + if (xn != null) + { + update(xn); + } + } + + public override bool update(XmlNode xn) + { + m_sCondition = (xn.Attributes["Condition"] != null ? xn.Attributes["Condition"].Value : "-"); + m_sWindCondition = (xn.Attributes["WindCondition"] != null ? xn.Attributes["WindCondition"].Value : "-"); + + return base.update(xn); + } + + public override string ToString() + { + return name + " [" + getStatusText() + "]"; + } + + public override string getStatusText() + { + return m_sCondition.Replace("_", " "); + } + public override string getExtraText() + { + return m_sWindCondition; + } + } +} Added: trunk/plugins/VeraControl/DeviceGeneric.cs =================================================================== --- trunk/plugins/VeraControl/DeviceGeneric.cs (rev 0) +++ trunk/plugins/VeraControl/DeviceGeneric.cs 2012-01-05 12:17:24 UTC (rev 4373) @@ -0,0 +1,141 @@ +/* + * Created by SharpDevelop. + * User: Bart + * Date: 22-12-2011 + * Time: 13:07 + * + * Copyright: 2012 GPL - Bart Eversdijk + * MediaPort plugin - MicasaVerde (TM) Vera Controller + * E-mail: ba...@ev... + */ +using System; +using System.Xml; +using System.Collections.Generic; + +namespace VeraControl.Properties +{ + /// <summary> + /// Description of DeviceGeneric. + /// </summary> + public class DeviceGeneric + { + private string m_sName = ""; + private int m_iId = 0; + private string m_sAltId = ""; + private int m_iCategory = 0; + private int m_iRoom = 0; + + public DeviceGeneric(XmlNode xn) + { + if (xn != null) + { + update(xn); + } + } + + public virtual bool update(XmlNode xn) + { + m_sName = xn.Attributes["name"].Value; + m_iId = int.Parse(xn.Attributes["id"].Value); + m_sAltId = xn.Attributes["altid"].Value; + m_iCategory = int.Parse(xn.Attributes["category"].Value); + m_iRoom = int.Parse(xn.Attributes["room"].Value); + return true; + } + + public int id + { + get { return m_iId; } + set { } + } + + public string altid + { + get { return m_sAltId; } + set { } + } + + public string name + { + get { return m_sName; } + set { } + } + + public int category + { + get { return m_iCategory; } + set { } + } + + public bool inRoom(int id) + { + return (m_iRoom == id); + } + + public int room + { + get { return m_iRoom; } + set { } + } + + public override string ToString() + { + return name; + } + + public virtual bool isControllable + { + get { return false; } + set { } + } + + public virtual bool state + { + get { return false; } + set { } + } + + public virtual int level + { + get { return 0; } + set { } + } + + public virtual string mode + { + get { return ""; } + set { } + } + + public virtual int maxLevel + { + get { return -1; } + set { } + } + public virtual int minLevel + { + get { return 0; } + set { } + } + + public virtual string getIconName() + { + return "generic_sensor"; + } + + public virtual string getStatusText() + { + return ""; + } + + public virtual string getExtraText() + { + return ""; + } + + public virtual string[] getCommands() + { + return new string [] {"Off", "On"}; + } + } +} Added: trunk/plugins/VeraControl/DeviceHumidity.cs =================================================================== --- trunk/plugins/VeraControl/DeviceHumidity.cs (rev 0) +++ trunk/plugins/VeraControl/DeviceHumidity.cs 2012-01-05 12:17:24 UTC (rev 4373) @@ -0,0 +1,64 @@ +/* + * Created by SharpDevelop. + * User: Bart + * Date: 22-12-2011 + * Time: 17:47 + * + * Copyright: 2012 GPL - Bart Eversdijk + * MediaPort plugin - MicasaVerde (TM) Vera Controller + * E-mail: ba...@ev... + */ +using System; +using System.Xml; + +namespace VeraControl.Properties +{ + /// <summary> + /// Description of DeviceHumidity. + /// </summary> + public class DeviceHumidity : DeviceGeneric + { + private int m_iLevel; + + public DeviceHumidity( XmlNode xn ): base (xn) + { + if (xn != null) + { + update(xn); + } + } + + public override bool update(XmlNode xn) + { + m_iLevel = int.Parse(xn.Attributes["humidity"].Value); + return base.update(xn); + } + + public override int level + { + get { return m_iLevel; } + set {} + } + + public override int maxLevel + { + get { return 100; } + set { } + } + + public override string ToString() + { + return name + " [" + level.ToString() + "%]"; + } + + public override string getIconName() + { + return "Humidity_Sensor"; + } + + public override string getStatusText() + { + return level + "%"; + } + } +} Added: trunk/plugins/VeraControl/DeviceLightSensor.cs =================================================================== --- trunk/plugins/VeraControl/DeviceLightSensor.cs (rev 0) +++ trunk/plugins/VeraControl/DeviceLightSensor.cs 2012-01-05 12:17:24 UTC (rev 4373) @@ -0,0 +1,70 @@ +/* + * Created by SharpDevelop. + * User: Bart + * Date: 3-1-2012 + * Time: 12:09 + * + * Copyright: 2012 GPL - Bart Eversdijk + * MediaPort plugin - MicasaVerde (TM) Vera Controller + * E-mail: ba...@ev... + */ +using System; +using System.Xml; + +namespace VeraControl.Properties +{ + /// <summary> + /// Description of DeviceLightSensor. + /// </summary> + public class DeviceLightSensor : DeviceGeneric + { + private int m_iLevel; + + public DeviceLightSensor( XmlNode xn ): base (xn) + { + if (xn != null) + { + update(xn); + } + } + + public override bool update(XmlNode xn) + { + m_iLevel = (xn.Attributes["level"] != null ? int.Parse(xn.Attributes["level"].Value) : 0); + return base.update(xn); + } + + public override bool state + { + get { return (m_iLevel > 0); } + set { } + } + + public override int level + { + get { return m_iLevel; } + set { } + } + + public override int maxLevel + { + get { return 100; } + set { } + } + + public override string ToString() + { + return name + " [" + getStatusText() + "]"; + } + + public override string getIconName() + { + return "Light_Sensor"; + } + + public override string getStatusText() + { + return level.ToString() + "%"; + } + } +} Added: trunk/plugins/VeraControl/DevicePowerMeter.cs =================================================================== --- trunk/plugins/VeraControl/DevicePowerMeter.cs (rev 0) +++ trunk/plugins/VeraControl/DevicePowerMeter.cs 2012-01-05 12:17:24 UTC (rev 4373) @@ -0,0 +1,76 @@ +/* + * Created by SharpDevelop. + * User: Bart + * Date: 3-1-2012 + * Time: 12:21 + * + * Copyright: 2012 GPL - Bart Eversdijk + * MediaPort plugin - MicasaVerde (TM) Vera Controller + * E-mail: ba...@ev... + */ +using System; +using System.Xml; + +namespace VeraControl.Properties +{ + /// <summary> + /// Description of DevicePowerMeter. + /// </summary> + public class DevicePowerMeter : DeviceGeneric + { + private int m_iLevel; + + public DevicePowerMeter( XmlNode xn ): base (xn) + { + if (xn != null) + { + update(xn); + } + } + + public override bool update(XmlNode xn) + { + m_iLevel = (xn.Attributes["level"] != null ? int.Parse(xn.Attributes["watts"].Value) : 0); + return base.update(xn); + } + + public string watts + { + get { return m_iLevel.ToString(); } + set { } + } + + public override bool state + { + get { return (m_iLevel > 0); } + set { } + } + + public override int level + { + get { return m_iLevel; } + set { } + } + + public override int maxLevel + { + get { return 1000; } + set { } + } + + public override string ToString() + { + return name + " [" + getStatusText() + "]"; + } + + public override string getIconName() + { + return "Power_Meter"; + } + + public override string getStatusText() + { + return level.ToString() + "W"; + } + } +} Added: trunk/plugins/VeraControl/DeviceSecurity.cs =================================================================== --- trunk/plugins/VeraControl/DeviceSecurity.cs (rev 0) +++ trunk/plugins/VeraControl/DeviceSecurity.cs 2012-01-05 12:17:24 UTC (rev 4373) @@ -0,0 +1,95 @@ +/* + * Created by SharpDevelop. + * User: Bart + * Date: 22-12-2011 + * Time: 18:03 + * + * Copyright: 2012 GPL - Bart Eversdijk + * MediaPort plugin - MicasaVerde (TM) Vera Controller + * E-mail: ba...@ev... + */ +using System; +using System.Xml; +using System.Collections.Generic; + +namespace VeraControl.Properties +{ + /// <summary> + /// Description of DeviceSecurity. + /// </summary> + public class DeviceSecurity: DeviceGeneric + { + private bool m_bTripped; + private bool m_bArmed; + + public DeviceSecurity( XmlNode xn ): base (xn) + { + if (xn != null) + { + update(xn); + } + } + + public override bool update(XmlNode xn) + { + m_bTripped = (xn.Attributes["tripped"].Value == "1"); + m_bArmed = (xn.Attributes["armed"].Value == "1"); + return base.update(xn); + } + + public override bool state + { + get { return m_bArmed; } + set { VeraCommunication vera = VeraCommunication.Instance; + // Do something with vera + string cmd = "?id=lu_action&DeviceNum="+id.ToString()+ + "&serviceId=urn:micasaverde-com:serviceId:SecuritySensor1&action=SetArmed" + + "&newArmedValue=" + (value ? "1" : "0"); + string sResult = vera.doVeraRequest(cmd); + m_bArmed = value; + } + } + + public bool tripped + { + get { return m_bTripped; } + set { } + } + + public override int level + { + get { return (m_bArmed ? 1 : 0); } + set { state = (value > 0); } + } + + public override int maxLevel + { + get { return 1; } + set { } + } + public override bool isControllable + { + get { return true; } + set { } + } + public override string ToString() + { + return name + " [" + getStatusText() + "]"; + } + + public override string getIconName() + { + return "Motion_Sensor_" + (m_bTripped ? "100" : "0"); + } + + public override string getStatusText() + { + return (state ? ( tripped ? "TRIPPED" : "standby") : "bypass"); + } + + public override string[] getCommands() + { + return new string [] {"Bypass", "Arm"}; + } + } +} Added: trunk/plugins/VeraControl/DeviceSprinkler.cs =================================================================== --- trunk/plugins/VeraControl/DeviceSprinkler.cs (rev 0) +++ trunk/plugins/VeraControl/DeviceSprinkler.cs 2012-01-05 12:17:24 UTC (rev 4373) @@ -0,0 +1,119 @@ +/* + * Created by SharpDevelop. + * User: Bart + * Date: 3-1-2012 + * Time: 16:26 + * + * Copyright: 2012 GPL - Bart Eversdijk + * MediaPort plugin - MicasaVerde (TM) Vera Controller + * E-mail: ba...@ev... + */ +using System; +using System.Xml; +using System.Collections.Generic; + +namespace VeraControl.Properties +{ + /// <summary> + /// Description of DeviceSprinkler. + /// </summary> + public class DeviceSprinkler : DeviceGeneric + { + private bool m_bStatus; + private string m_sMode; + private string m_sShortMode; + private string m_sOperationMode; + private string m_sCondition; + + public DeviceSprinkler( XmlNode xn ): base (xn) + { + if (xn != null) + { + update(xn); + } + } + + public override bool update(XmlNode xn) + { + m_bStatus = (xn.Attributes["status"].Value == "1"); + m_sMode = (xn.Attributes["Mode"] != null ? xn.Attributes["Mode"].Value : "-"); + m_sShortMode = (xn.Attributes["ShortMode"] != null ? xn.Attributes["ShortMode"].Value : "-"); + m_sOperationMode = (xn.Attributes["OperationMode"] != null ? xn.Attributes["OperationMode"].Value : "-"); + m_sCondition = (xn.Attributes["Condition"] != null ? xn.Attributes["Condition"].Value : "-"); + return base.update(xn); + } + + public override bool state + { + get { return m_bStatus; } + set { + VeraCommunication vera = VeraCommunication.Instance; + // Do something with vera + string cmd = "?id=lu_action&DeviceNum="+id.ToString()+ + "&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget" + + "&newTargetValue="+(value ? "1" : "0"); + string sResult = vera.doVeraRequest(cmd); + m_bStatus = value; + } + } + + public override int level + { + get { return (m_bStatus ? 1 : 0); } + set { state = (value > 0); } + } + + public override string mode + { + get { return m_sMode; } + set { + VeraCommunication vera = VeraCommunication.Instance; + // Do something with vera + string cmd = "?id=lu_action&DeviceNum="+id.ToString()+ + "&serviceId=urn:upnp-micasaverde-com:serviceId:Sprinkler1&action=" + + (value == "Auto" ? "SetModeAuto" : (value == "Block" ? "SetModeBlock" : "SetModeManual")); + string sResult = vera.doVeraRequest(cmd); + m_sMode = value; + } + } + + public override string ToString() + { + return name + " [" + m_sShortMode + "]"; + } + + public override bool isControllable + { + get { return true; } + set { } + } + + public override int maxLevel + { + get { return 1; } + set { } + } + + public override string getIconName() + { + return "Humidity_Sensor"; + } + + public override string getStatusText() + { + return m_sOperationMode.Replace("_", " "); + } + + public override string getExtraText() + { + return m_sCondition; + } + + + + public override string [] getCommands() + { + return new string [] {"Off", "On", "Auto", "Block", "Manual"}; + } + } +} Added: trunk/plugins/VeraControl/DeviceSwitch.cs =================================================================== --- trunk/plugins/VeraControl/DeviceSwitch.cs (rev 0) +++ trunk/plugins/VeraControl/DeviceSwitch.cs 2012-01-05 12:17:24 UTC (rev 4373) @@ -0,0 +1,92 @@ +/* + * Created by SharpDevelop. + * User: Bart + * Date: 22-12-2011 + * Time: 14:25 + * + * Copyright: 2012 GPL - Bart Eversdijk + * MediaPort plugin - MicasaVerde (TM) Vera Controller + * E-mail: ba...@ev... + */ +using System; +using System.Xml; + +namespace VeraControl.Properties +{ + /// <summary> + /// Description of DeviceSwitch. + /// </summary> + public class DeviceSwitch : DeviceGeneric + { + private bool m_bStatus; + private string m_sWatt; + + public DeviceSwitch( XmlNode xn ): base (xn) + { + if (xn != null) + { + update(xn); + } + } + + public override bool update(XmlNode xn) + { + m_bStatus = (xn.Attributes["status"].Value == "1"); + m_sWatt = (xn.Attributes["watts"] != null ? xn.Attributes["watts"].Value : "0"); + return base.update(xn); + } + + public string watts + { + get { return m_sWatt; } + set { } + } + + public override bool state + { + get { return m_bStatus; } + set { + VeraCommunication vera = VeraCommunication.Instance; + // Do something with vera + string cmd = "?id=lu_action&DeviceNum="+id.ToString()+ + "&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget" + + "&newTargetValue="+(value ? "1" : "0"); + string sResult = vera.doVeraRequest(cmd); + m_bStatus = value; + } + } + + public override int level + { + get { return (m_bStatus ? 1 : 0); } + set { state = (value > 0); } + } + + public override int maxLevel + { + get { return 1; } + set { } + } + + public override string ToString() + { + return name + " [" + getStatusText()+ "]"; + } + + public override bool isControllable + { + get { return true; } + set { } + } + + public override string getIconName() + { + return "Binary_Light_" + (m_bStatus ? "100" : "0"); + } + + public override string getStatusText() + { + return (state ? "On" : "Off"); + } + } +} Added: trunk/plugins/VeraControl/DeviceTemperature.cs =================================================================== --- trunk/plugins/VeraControl/DeviceTemperature.cs (rev 0) +++ trunk/plugins/VeraControl/DeviceTemperature.cs 2012-01-05 12:17:24 UTC (rev 4373) @@ -0,0 +1,73 @@ +/* + * Created by SharpDevelop. + * User: Bart + * Date: 22-12-2011 + * Time: 17:52 + * + * Copyright: 2012 GPL - Bart Eversdijk + * MediaPort plugin - MicasaVerde (TM) Vera Controller + * E-mail: ba...@ev... + */ +using System; +using System.Xml; + +namespace VeraControl.Properties +{ + /// <summary> + /// Description of DeviceTemperature. + /// </summary> + public class DeviceTemperature : DeviceGeneric + { + public int m_iLevel; + private bool m_bMetric = true; + + public DeviceTemperature( XmlNode xn, bool bMetric ): base (xn) + { + m_bMetric = bMetric; + if (xn != null) + { + update(xn); + } + } + + public override bool update(XmlNode xn) + { + m_iLevel = (xn.Attributes["temperature"] != null ? int.Parse(xn.Attributes["temperature"].Value) : 0); + return base.update(xn); + } + + public override int level + { + get { return m_iLevel; } + set { } + } + + public override int maxLevel + { + get { return (m_bMetric ? 100 : 212); } + set { } + } + + public override int minLevel + { + get { return (m_bMetric ? -22 : -7); } + set { } + } + + public override string ToString() + { + return name + " [" + getStatusText() + "]"; + } + + public override string getIconName() + { + return "Temperature_Sensor"; + } + + public override string getStatusText() + { + return level + (m_bMetric ? "°C" : "F"); + } + + } +} Added: trunk/plugins/VeraControl/DeviceThermostat.cs =================================================================== --- trunk/plugins/VeraControl/DeviceThermostat.cs (rev 0) +++ trunk/plugins/VeraControl/DeviceThermostat.cs 2012-01-05 12:17:24 UTC (rev 4373) @@ -0,0 +1,109 @@ +/* + * Created by SharpDevelop. + * User: Bart + * Date: 25-12-2011 + * Time: 0:03 + * + * Copyright: 2012 GPL - Bart Eversdijk + * MediaPort plugin - MicasaVerde (TM) Vera Controller + * E-mail: ba...@ev... + */ +using System; +using System.Xml; + +namespace VeraControl.Properties +{ + /// <summary> + /// Description of DeviceThermostat. + /// </summary> + public class DeviceThermostat : DeviceTemperature + { + private bool m_bMetric = true; + private string m_sFan = ""; + private string m_sState = "Off"; // "Off', "Idle", "Heating", "Cooling", "FanOnly", "PendingHeat", "PendingCool", "Vent" + private string m_sMode = "Off"; // "Off', "InDeadBand", "HeatOn", "CoolOn", "AutoChangeOver", "AuxHeatOn", "EconomyHeatOn", "EmergencyHeatOn", + // "AuxCoolOn", "EconomyCoolOn", "BuildingProtection", "EnergySavingsHeating", "EnergySavingsCooling" + + public DeviceThermostat( XmlNode xn, bool bMetric ): base (xn, bMetric) + { + m_bMetric = bMetric; + if (xn != null) + { + update(xn); + } + } + + public override bool update(XmlNode xn) + { + m_iLevel = (xn.Attributes["temperature"] != null ? int.Parse(xn.Attributes["temperature"].Value) : 0); + m_sFan = (xn.Attributes["fan"] != null ? xn.Attributes["fn"].Value : "Off"); + m_sState = (xn.Attributes["hvacstate"] != null ? xn.Attributes["hvacstate"].Value : "Off"); + m_sMode = (xn.Attributes["mode"] != null ? xn.Attributes["mode"].Value : "Off"); + return base.update(xn); + } + + public override bool state + { + get { return (mode != "Off"); } + set { mode = (value ? "Auto" : "Off"); } + } + + public override int level + { + get { return -1; } + set { } + } + + public override string mode + { + get { return m_sMode; } + set { + VeraCommunication vera = VeraCommunication.Instance; + // Do something with vera + string cmd = "?id=lu_action&DeviceNum="+id.ToString()+ + "&serviceId=urn:upnp-org:serviceId:HVAC_UserOperatingMode1&action=SetModeTarget" + + "&NewModeTarget="+(value == "Off" ? "Off" : (value == "Cool" ? "CoolOn" : (value == "Heat" ? "HeatOn" : "AutoChangeOver")) + ); + string sResult = vera.doVeraRequest(cmd); + m_sMode = value; + } + } + + public override string ToString() + { + return name + " [" + mode + "]"; + } + + public override bool isControllable + { + get { return true; } + set { } + } + + public override int maxLevel + { + get { return -1; } + set { } + } + + public override string getStatusText() + { + return mode; + } + + public override string getExtraText() + { + return m_sState + " - Fan : " + m_sFan + " - " + m_iLevel + (m_bMetric ? "°C" : "F") ; + } + + public override string getIconName() + { + return "Thermostat"; + } + + public override string [] getCommands() + { + return new string [] {"Off", "On", "Auto", "Heat", "Cool"}; + } + } +} Added: trunk/plugins/VeraControl/DeviceWindowCovering.cs =================================================================== --- trunk/plugins/VeraControl/DeviceWindowCovering.cs (rev 0) +++ trunk/plugins/VeraControl/DeviceWindowCovering.cs 2012-01-05 12:17:24 UTC (rev 4373) @@ -0,0 +1,34 @@ +/* + * Created by SharpDevelop. + * User: Bart + * Date: 24-12-2011 + * Time: 23:56 + * + * Copyright: 2012 GPL - Bart Eversdijk + * MediaPort plugin - MicasaVerde (TM) Vera Controller + * E-mail: ba...@ev... + */ +using System; +using System.Xml; + +namespace VeraControl.Properties +{ + /// <summary> + /// Description of DeviceWindowCovering. + /// </summary> + public class DeviceWindowCovering : DeviceDimmer + { + public DeviceWindowCovering( XmlNode xn ): base (xn) + { + if (xn != null) + { + update(xn); + } + } + + public override string getIconName() + { + return "Window_Covering"; + } + } +} Added: trunk/plugins/VeraControl/DialogActionTrigger.cs =================================================================== --- trunk/plugins/VeraControl/DialogActionTrigger.cs (rev 0) +++ trunk/plugins/VeraControl/DialogActionTrigger.cs 2012-01-05 12:17:24 UTC (rev 4373) @@ -0,0 +1,176 @@ +/* + * Created by SharpDevelop. + * User: Bart + * Date: 30-12-2011 + * Time: 0:35 + * + * Copyright: 2012 GPL - Bart Eversdijk + * MediaPort plugin - MicasaVerde (TM) Vera Controller + * E-mail: ba...@ev... + */ +using System; +using MediaPortal; +using MediaPortal.Util; +using MediaPortal.GUI.Library; +using MediaPortal.Dialogs; +using System.Collections.Generic; +using Alignment = MediaPortal.GUI.Library.GUIControl.Alignment; +using VAlignment = MediaPortal.GUI.Library.GUIControl.VAlignment; +using Action = MediaPortal.GUI.Library.Action; +using VeraControl.Properties; + +namespace VeraControl +{ + /// <summary> + /// Description of DialogActionTrigger. + /// </summary> + public class DialogActionTrigger : GUIDialogWindow + { + [SkinControl(2)] protected GUIButtonControl btnClose = null; + [SkinControl(4)] protected GUILabelControl lblHeading = null; + [SkinControl(100)] protected GUIButtonControl btnStore = null; + + [SkinControlAttribute(20)] protected GUISpinButton spMusicStart = null; + [SkinControlAttribute(21)] protected GUISpinButton spMusicPause = null; + [SkinControlAttribute(22)] protected GUISpinButton spMusicResume = null; + [SkinControlAttribute(23)] protected GUISpinButton spMusicStop = null; + + [SkinControlAttribute(25)] protected GUISpinButton spVideoStart = null; + [SkinControlAttribute(26)] protected GUISpinButton spVideoPause = null; + [SkinControlAttribute(27)] protected GUISpinButton spVideoResume = null; + [SkinControlAttribute(28)] protected GUISpinButton spVideoStop = null; + + [SkinControlAttribute(30)] protected GUISpinButton spTVStart = null; + [SkinControlAttribute(31)] protected GUISpinButton spTVPause = null; + [SkinControlAttribute(32)] protected GUISpinButton spTVResume = null; + [SkinControlAttribute(33)] protected GUISpinButton spTVStop = null; + + [SkinControlAttribute(35)] protected GUISpinButton spRecStart = null; + [SkinControlAttribute(36)] protected GUISpinButton spRecPause = null; + [SkinControlAttribute(37)] protected GUISpinButton spRecResume = null; + [SkinControlAttribute(38)] protected GUISpinButton spRecStop = null; + + [SkinControlAttribute(40)] protected GUISpinButton spRadioStart = null; + [SkinControlAttribute(41)] protected GUISpinButton spRadioPause = null; + [SkinControlAttribute(42)] protected GUISpinButton spRadioResume = null; + [SkinControlAttribute(43)] protected GUISpinButton spRadioStop = null; + + [SkinControlAttribute(45)] protected GUISpinButton spUnknownStart = null; + [SkinControlAttribute(46)] protected GUISpinButton spUnknownPause = null; + [SkinControlAttribute(47)] protected GUISpinButton spUnknownResume= null; + [SkinControlAttribute(48)] protected GUISpinButton spUnknownStop = null; + + [SkinControlAttribute(50)] protected GUISpinButton spMPStart = null; + [SkinControlAttribute(51)] protected GUISpinButton spMPSleep = null; + [SkinControlAttribute(52)] protected GUISpinButton spMPExit = null; + + + public DialogActionTrigger() + { + GetID = (int)1974; + } + + public void SetHeading(string strLine) + { + //LoadSkin(); + AllocResources(); + InitControls(); + + GUISpinButton[] spinList = new GUISpinButton[] { + spMusicStart, spMusicPause, spMusicResume, spMusicStop, + spVideoStart, spVideoPause, spVideoResume, spVideoStop, + spTVStart, spTVPause, spTVResume, spTVStop, + spRecStart, spRecPause, spRecResume, spRecStop, + spRadioStart, spRadioPause, spRadioResume, spRadioStop, + spUnknownStart, spUnknownPause, spUnknownResume, spUnknownStop, + spMPStart, spMPSleep, spMPExit + }; + + // (P)re load spin contor + for (int i = 0; i < spinList.Length; i++) + { + initSpinButtons(spinList[i], VeraCommunication.Instance.actionTriggerTable[i]); + } + + lblHeading.Label = strLine; + } + + public override bool Init() + { + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.MPSettings()) + { + for (Actiontrigger i = 0; i < Actiontrigger.LAST_ACTIONTRIGGER; i++) + { + VeraCommunication.Instance.actionTriggerTable[(int)i] = xmlreader.GetValueAsInt("veracontroller", i.ToString(), 0); + } + } + return Load(GUIGraphicsContext.Skin + @"\VeraDialogActionTrigger.xml"); + } + + protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType) + { + if (control == btnStore) + { + StoreSettings(); + PageDestroy(); + } + // Back to the text button to switch from image view + if (control == btnClose) + { + PageDestroy(); + } + base.OnClicked(controlId, control, actionType); + } + + private void initSpinButtons(GUISpinButton spin, int iSelectedScene) + { + GUIControl.ClearControl(GetID, spin.GetID); + int iSceneIndex = 0; + spin.AddSpinLabel("- none -", 0); + + for (int i = 0; i < VeraCommunication.Instance.scenes.Count; i++) + { + spin.AddSpinLabel(shortString(VeraCommunication.Instance.scenes[i].name), VeraCommunication.Instance.scenes[i].id); + if (VeraCommunication.Instance.scenes[i].id == iSelectedScene) + { + iSceneIndex = i + 1; // 0 is - none - + } + } + spin.SpinValue = iSceneIndex; + } + + private string shortString( string str ) + { + if (str.Length > 15) + { + return str.Substring(0, 14) + ".."; + } + return str; + } + + private void StoreSettings() + { + using (MediaPortal.Profile.Settings xmlwritter = new MediaPortal.Profile.MPSettings()) + { + GUISpinButton[] spinList = new GUISpinButton[] { + spMusicStart, spMusicPause, spMusicResume, spMusicStop, + spVideoStart, spVideoPause, spVideoResume, spVideoStop, + spTVStart, spTVPause, spTVResume, spTVStop, + spRecStart, spRecPause, spRecResume, spRecStop, + spRadioStart, spRadioPause, spRadioResume, spRadioStop, + spUnknownStart, spUnknownPause, spUnknownResume, spUnknownStop, + spMPStart, spMPSleep, spMPExit + }; + for (int i = 0; i < spinList.Length; i++) + { + if (spinList[i].SpinValue == 0) { + VeraCommunication.Instance.actionTriggerTable[i] = 0; + } else { + VeraCommunication.Instance.actionTriggerTable[i] = VeraCommunication.Instance.scenes[spinList[i].SpinValue - 1].id; + } + xmlwritter.SetValue("veracontroller", ((Actiontrigger) i).ToString(), VeraCommunication.Instance.actionTriggerTable[i].ToString()); + } + } + } + } +} Added: trunk/plugins/VeraControl/DialogDeviceControl.cs =================================================================== --- trunk/plugins/VeraControl/DialogDeviceControl.cs (rev 0) +++ trunk/plugins/VeraControl/DialogDeviceControl.cs 2012-01-05 12:17:24 UTC (rev 4373) @@ -0,0 +1,194 @@ +/* + * Created by SharpDevelop. + * User: Bart + * Date: 24-12-2011 + * Time: 14:17 + * + * Copyright: 2012 GPL - Bart Eversdijk + * MediaPort plugin - MicasaVerde (TM) Vera Controller + * E-mail: ba...@ev... + */ +using System; +using System.Collections; +using MediaPortal; +using MediaPortal.Util; +using MediaPortal.GUI.Library; +using MediaPortal.Dialogs; +using System.Collections.Generic; +using Alignment = MediaPortal.GUI.Library.GUIControl.Alignment; +using VAlignment = MediaPortal.GUI.Library.GUIControl.VAlignment; +using Action = MediaPortal.GUI.Library.Action; +using VeraControl.Properties; + +namespace VeraControl +{ + /// <summary> + /// Description of DialogDeviceControl. + /// </summar`y> + public class DialogDeviceControl : GUIDialogWindow + { + [SkinControl(2)] protected GUIButtonControl btnClose = null; + [SkinControl(4)] protected GUILabelControl lblHeading = null; + [SkinControl(5)] protected GUIImage imgLogo = null; + + [SkinControlAttribute(6)] protected GUILabelControl label1=null; + [SkinControlAttribute(7)] protected GUILabelControl label2=null; + [SkinControlAttribute(8)] protected GUILabelControl label3=null; + + [SkinControl(10)] protected GUIButtonControl btnLeft = null; + [SkinControl(11)] protected GUIButtonControl btnRight = null; + [SkinControl(12)] protected GUIButtonControl btnMode1 = null; + [SkinControl(13)] protected GUIButtonControl btnMode2 = null; + [SkinControl(14)] protected GUIButtonControl btnMode3 = null; + [SkinControl(15)] protected GUISliderControl slider = null; + + DeviceGeneric myDev = null; + + public DialogDeviceControl() + { + GetID = (int)1973; + } + + public void InitDialog(string strLine, DeviceGeneric dev) + { + //LoadSkin(); + AllocResources(); + InitControls(); + + lblHeading.Label = strLine; + + myDev = dev; + } + + public override bool Init() + { + bool bResult = Load(GUIGraphicsContext.Skin + @"\VeraDialogDeviceControl.xml"); + return bResult; + } + + protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType) + { + if (control == btnLeft) + { + myDev.level = myDev.minLevel; + SetSlider( myDev.level, myDev.maxLevel ); + } + + if (control == btnRight) + { + myDev.level = myDev.maxLevel; + SetSlider( myDev.level, myDev.maxLevel ); + } + + if (control == btnMode1) + { + myDev.mode = btnMode1.Label; + SetActiveBut(-1, 0); + } + if (control == btnMode2) + { + myDev.mode = btnMode2.Label; + SetActiveBut(-1, 1); + } + if (control == btnMode3) + { + myDev.mode = btnMode3.Label; + SetActiveBut(-1, 2); + } + + if (control == slider) + { + myDev.level = slider.IntValue; + } + + // update button high lighting + SetActiveBut( (slider.IntValue > 0 ? 1 : 0), -1); + + // update icon + SetImage("Vera\\" + myDev.getIconName() + ".png"); + + // Back to the text button to switch from image view + if (control == btnClose) + { + PageDestroy(); + } + base.OnClicked(controlId, control, actionType); + } + + public void SetButtons(string [] butTxt) + { + GUIButtonControl[] btns = new GUIButtonControl[] {btnLeft, btnRight, btnMode1, btnMode3, btnMode2}; + for (int i=0; i < btns.Length; i++) + { + if (butTxt.Length > i) { + btns[i].Label = butTxt[i]; + btns[i].Visibility = System.Windows.Visibility.Visible; + } else { + btns[i].Visibility = System.Windows.Visibility.Hidden; + } + } + + if (butTxt.Length > 2) + { + btnLeft.NavigateUp = 12; + btnRight.NavigateUp = 14; + + if (butTxt.Length < 5) + { + // if only 2 buttons required, use right iso middle button + btnMode1.NavigateRight = 14; + btnMode3.NavigateLeft = 12; + } + } + } + + public void SetSlider(int iVal, int iMaxval) + { + if (iVal >= 0) + { + slider.SetRange(0, iMaxval); + slider.IntValue = iVal; + slider.Visibility = System.Windows.Visibility.Visible; + } + } + + public void SetText(string txt1, string txt2, string txt3) + { + label1.Label = txt1; + label2.Label = txt2; + label3.Label = txt3; + } + + public void SetActiveBut( int iButNr, int iModeNr ) + { + if (iButNr >= 0) + { + btnLeft.TextColor = (iButNr == 0 ? 0xFFFFFF00 : 0xFFFFFFFF ); + btnLeft.TextColorNoFocus = (iButNr == 0 ? 0x60FFFF00 : 0x60ffffff); + + btnRight.TextColor = (iButNr == 1 ? 0xFFFFFF00 : 0xFFFFFFFF ); + btnRight.TextColorNoFocus = (iButNr == 1 ? 0x60FFFF00 : 0x60ffffff); + } + + if (iModeNr >= 0) + { + btnMode1.TextColor = (iModeNr == 0 ? 0xFFFFFF00 : 0xFFFFFFFF ); + btnMode1.TextColorNoFocus = (iModeNr == 0 ? 0x60FFFF00 : 0x60ffffff); + + btnMode2.TextColor = (iModeNr == 1 ? 0xFFFFFF00 : 0xFFFFFFFF ); + btnMode2.TextColorNoFocus = (iModeNr == 1 ? 0x60FFFF00 : 0x60ffffff); + + btnMode3.TextColor = (iModeNr == 2 ? 0xFFFFFF00 : 0xFFFFFFFF ); + btnMode3.TextColorNoFocus = (iModeNr == 2 ? 0x60FFFF00 : 0x60ffffff); + } + } + + public void SetImage(string filename) + { + imgLogo.Dispose(); + imgLogo.SetFileName(filename); + imgLogo.AllocResources(); + imgLogo.KeepAspectRatio = true; + } + } +} Added: trunk/plugins/VeraControl/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/VeraControl/Properties/AssemblyInfo.cs (rev 0) +++ trunk/plugins/VeraControl/Properties/AssemblyInfo.cs 2012-01-05 12:17:24 UTC (rev 4373) @@ -0,0 +1,31 @@ +#region Using directives + +using System; +using System.Reflection; +using System.Runtime.InteropServices; + +#endregion + +// 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("VeraControl")] +[assembly: AssemblyDescription("MediaPortal - Windows Plugin")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Bart Eversdijk")] +[assembly: AssemblyProduct("VeraControl")] +[assembly: AssemblyCopyright("Copyright 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("ba...@ev...")] + +// This sets the default COM visibility of types in the assembly to invisible. +// If you need to expose a type to COM, use [ComVisible(true)] on that type. +[assembly: ComVisible(false)] + +// The assembly version has following format : +// +// Major.Minor.Build.Revision +// +// You can specify all the values or you can use the default the Revision and +// Build Numbers by using the '*' as shown below: +[assembly: AssemblyVersion("0.5.*")] Added: trunk/plugins/VeraControl/Room.cs =================================================================== --- trunk/plugins/VeraControl/Room.cs (rev 0) +++ trunk/plugins/VeraControl/Room.cs 2012-01-05 12:17:24 UTC (rev 4373) @@ -0,0 +1,69 @@ +/* + * Created by SharpDevelop. + * User: Bart + * Date: 22-12-2011 + * Time: 14:05 + * + * Copyright: 2012 GPL - Bart Eversdijk + * MediaPort plugin - MicasaVerde (TM) Vera Controller + * E-mail: ba...@ev... + */ +using System; +using System.Xml; + +namespace VeraControl.Properties +{ + /// <summary> + /// Description of Room. + /// </summary> + public class Room + { + public Room(XmlNode xn) + { + if (xn == null) + { + m_sName = ""; + m_iId = 0; + m_iSection = 0; + } else { + update(xn); + } + } + + private string m_sName; + private int m_iId; + private int m_iSection; + + public bool update(XmlNode xn) + { + m_sName = xn.Attributes["name"].Value; + m_iId = int.Parse(xn.Attributes["id"].Value); + m_iSection = int.Parse(xn.Attributes["section"].Value); + return true; + } + + public int id + { + get { return m_iId; } + set { } + } + + public string name + { + get { return m_sName; } + set { } + } + + + public int section + { + get { return m_iSection; } + set { } + } + + public override string ToString() + { + return name; + } + } +} Added: trunk/plugins/VeraControl/Scene.cs =================================================================== --- trunk/plugins/VeraControl/Scene.cs (rev 0) +++ trunk/plugins/VeraControl/Scene.cs 2012-01-05 12:17:24 UTC (rev 4373) @@ -0,0 +1,93 @@ +/* + * Created by SharpDevelop. + * User: Bart + * Date: 22-12-2011 + * Time: 13:50 + * + * Copyright: 2012 GPL - Bart Eversdijk + * MediaPort plugin - MicasaVerde (TM) Vera Controller + * E-mail: ba...@ev... + */ +using System; +using System.Xml; + +namespace VeraControl.Properties +{ + /// <summary> + /// Description of Scene. + /// </summary> + public class Scene + { + public Scene(XmlNode xn) + { + if (xn == null) + { + m_sName = ""; + m_iId = 0; + m_bActive = false; + m_iRoom = 0; + } else { + update(xn); + } + } + + private string m_sName; + private int m_iId; + private bool m_bActive; + private int m_iRoom; + + public bool update(XmlNode xn) + { + m_sName = xn.Attributes["name"].Value; + m_iId = int.Parse(xn.Attributes["id"].Value); + m_iRoom = int.Parse(xn.Attributes["room"].Value); + m_bActive = (xn.Attributes["name"].Value == "1"); + return true; + } + + public int id + { + get { return m_iId; } + set { } + } + + public string name + { + get { return m_sName; } + set { } + } + + + public bool isActive() + { + return m_bActive; + } + + public bool inRoom(int id) + { + return (m_iRoom == id); + } + + public int room + { + get { return m_iRoom; } + set { } + } + + public override string ToString() + { + return name; + } + + public string run() + { + if (id == 0) + { + return "Unknown scene"; + } + VeraCommunication vera = VeraCommunication.Instance; + string cmd = "?id=lu_action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=RunScene&SceneNum="+id; + return vera.doVeraRequest(cmd, true); + } + } +} Added: trunk/plugins/VeraControl/Section.cs =================================================================== --- trunk/plugins/VeraControl/Section.cs (rev 0) +++ trunk/plugins/VeraControl/Section.cs 2012-01-05 12:17:24 UTC (rev 4373) @@ -0,0 +1,59 @@ +/* + * Created by SharpDevelop. + * User: Bart + * Date: 23-12-2011 + * Time: 21:05 + * + * Copyright: 2012 GPL - Bart Eversdijk + * MediaPort plugin - MicasaVerde (TM) Vera Controller + * E-mail: ba...@ev... + */ +using System; +using System.Xml; + +namespace VeraControl.Properties +{ + /// <summary> + /// Description of Section. + /// </summary> + public class Section + { + public Section(XmlNode xn) + { + if (xn == null) + { + m_sName = ""; + m_iId = 0; + } else { + update(xn); + } + } + + private string m_sName; + private int m_iId; + + public bool update(XmlNode xn) + { + m_sName = xn.Attributes["name"].Value; + m_iId = int.Parse(xn.Attributes["id"].Value); + return true; + } + + public int id + { + get { return m_iId; } + set { } + } + + public string name + { + get { return m_sName; } + set { } + } + + public override string ToString() + { + return name; + } + } +} Added: trunk/plugins/VeraControl/VeraCommunication.cs =================================================================== --- trunk/plugins/VeraControl/VeraCommunication.cs (rev 0) +++ trunk/plugins/VeraControl/VeraCommunication.cs 2012-01-05 12:17:24 UTC (rev 4373) @@ -0,0 +1,474 @@ +/* + * Created by SharpDevelop. + * User: Bart + * Date: 21-12-2011 + * Time: 22:26 + * + * Copyright: 2012 GPL - Bart Eversdijk + * MediaPort plugin - MicasaVerde (TM) Vera Controller + * E-mail: ba...@ev... + */ +using System; +using System.Net; +using System.IO; +using System.Collections.Generic; +using System.Xml; + +namespace VeraControl.Properties +{ + /// <summary> + /// Description of VeraCommunication. + /// </summary> + + public class VeraStatus + { + public List<DeviceGeneric> devices = new List<DeviceGeneric>(); + public List<Scene> scenes = new List<Scene>(); + public List<Room> rooms = new List<Room>(); + public List<DevCategories> categories = new List<DevCategories>(); + public List<Section> sections = new List<Section>(); + + #region Vers get by id support functions + + public void clearAllLists() + { + devices.Clear(); + scenes.Clear(); + rooms.Clear(); + categories.Clear(); + sections.Clear(); + } + public Room getRoomById( int id ) + { + foreach(Room room in rooms) + { + if (room.id == id) + { + return room; + } + } + return new Room(null); + } + + public Section getSectionById( int id ) + { + foreach(Section section in sections) + { + if (section.id == id) + { + return section; + } + } + return new Section(null); + } + + public DeviceGeneric getDeviceById( int id ) + { + foreach(DeviceGeneric dev in devices) + { + if (dev.id == id) + { + return dev; + } + } + return new DeviceGeneric(null); + } + + public Scene getSceneById( int id ) + { + foreach(Scene scene in scenes) + { + if (scene.id == id) + { + return scene; + } + } + return new Scene(null); + } + + public DevCategories getCategoryById( int id ) + { + foreach(DevCategories cat in categories) + { + if (cat.id == id) + { + return cat; + } + } + return new DevCategories(null); + } + + public bool isSectionFound( int id ) + { + foreach(Section section in sections) + { + if (section.id == id) + { + return true; + } + } + return false; + } + + public bool isRoomFound( int id ) + { + foreach(Room room in rooms) + { + if (room.id == id) + { + return true; + } + } + return false; + } + + public bool isDeviceFound( int id ) + { + foreach(DeviceGeneric dev in devices) + { + if (dev.id == id) + { + return true; + } + } + return false; + } + + public bool isSceneFound( int id ) + { + foreach(Scene scene in scenes) + { + if (scene.id == id) + { + return true; + } + } + return false; + } + + public bool isCategoryFound( int id ) + { + foreach(DevCategories cat in categories) + { + if (cat.id == id) + { + return true; + } + } + return false; + } + #endregion + } + + + public sealed class VeraCommunication + { + private static volatile VeraCommunication instance; + private static object syncRoot = new Object(); + + private string m_sVeraIPAddress; + private string m_sVeraTCPIPPort; + private string m_sDataVersion = ""; + private bool m_bMetric = true; + + private VeraStatus m_status = new VeraStatus(); + private long m_lLastUpdate = 0; + private bool m_bUpdatePending = false; + + public int[] actionTriggerTable = new int[(int)Actiontrigger.LAST_ACTIONTRIGGER]; + + public static VeraCommunication Instance + { + get + { + if (instance == null) + { + lock (syncRoot) + { + if (instance == null) + { + instance = new VeraCommunication(); + } + } + } + + return instance; + } + } + + private VeraCommunication() + { + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.MPSettings()) + { + m_sVeraIPAddress = xmlreader.GetValueAsString("veracontroller", "ipaddress", "127.0.0.1"); + m_sVeraTCPIPPort = xmlreader.GetValueAsString("veracontroller", "portnumber", "49451"); + } + // Clear action table (TO DO: load with config settings) + for (int i = 0; i < (int)Actiontrigger.LAST_ACTIONTRIGGER; i++) + { + actionTriggerTable[i] = 0; + } + } + + public bool updateCurrentStatus() + { + if (m_bUpdatePending) + { + return false; + } + m_bUpdatePending = true; + string verastatus = doVeraRequest("?id=lu_sdata&output_format=xml"); + m_lLastUpdate = getSecondSince1970(); + + var xmlDoc = new XmlDocument(); + xmlDoc.LoadXml(verastatus); + + // Parse header + XmlNode rootnode = xmlDoc.SelectSingleNode("/root"); + m_bMetric = (rootnode.Attributes["temperature"].Value == "C"); + bool bFullRefresh = (m_sDataVersion != rootnode.Attributes["dataversion"].Value); + m_sDataVersion = rootnode.Attributes["dataversion"].Value; + + if (bFullRefresh) + { + // We have a full refresh -> Clear all lists + m_status.clearAllLists(); + } + + // Process Sections + XmlNodeList xnList = xmlDoc.SelectNodes("/root/sections/section"); + foreach (XmlNode xn in xnList) + { + Section sc = m_status.getSectionById( int.Parse(xn.Attributes["id"].Value) ); + if (sc.id != 0) { + sc.update(xn); + } else { + m_status.sections.Add(new Section(xn)); + } + } + + // Process Scenes + xnList = xmlDoc.SelectNodes("/root/scenes/scene"); + foreach (XmlNode xn in xnList) + { + Scene sc = m_status.getSceneById( int.Parse(xn.Attributes["id"].Value) ); + if (sc.id != 0) { + sc.update(xn); + } else { + m_status.scenes.Add(new Scene(xn)); + } + } + + // Process Rooms + xnList = xmlDoc.SelectNodes("/root/rooms/room"); + foreach (XmlNode xn in xnList) + { + Room room = m_status.getRoomById( int.Parse(xn.Attributes["id"].Value) ); + if (room.id != 0) { + room.update(xn); + } else { + m_status.rooms.Add(new Room(xn)); + } + } + + // Process Categories + xnList = xmlDoc.SelectNodes("/root/categories/categorie"); + foreach (XmlNode xn in xnList) + { + DevCategories cat = m_status.getCategoryById( int.Parse(xn.Attributes["id"].Value) ); + if (cat.id != 0) { + cat.update(xn); + } else { + m_status.categories.Add(new DevCategories(xn)); + } + } + + // Process Devices + xnList = xmlDoc.SelectNodes("/root/devices/device"); + foreach (XmlNode xn in xnList) + { + DeviceGeneric dev = m_status.getDeviceById( int.Parse(xn.Attributes["id"].Value) ); + if (dev.id != 0) { + dev.update(xn); + } else { + switch (xn.Attributes["category"].Value) + { + case "2": + m_status.devices.Add(new DeviceDimmer(xn)); + break; + + case "3": + case "11": // Generic IO + m_status.devices.Add(new DeviceSwitch(xn)); + break; + + case "4": // Generic Sensor + case "12": // Motion Sensor + m_status.devices.Add(new DeviceSecurity(xn)); + break; + + case "5": + m_status.devices.Add(new DeviceThermostat(xn, m_bMetric)); + break; + + // case "6": // TODO: Implement camera class ? + // m_status.devices.Add(new DeviceCamera(xn, m_bMetric)); + // break; + + case "7": + m_status.devices.Add(new DeviceDoorlock(xn)); + break; + + case "8": + m_status.devices.Add(new DeviceWindowCovering(xn)); + break; + + // case "14": // TODO: Implement Scene controller device ? + // m_status.devices.Add(new DeviceSceneController(xn)); + // break; + + // case "15": // TODO: Implement AV device ? + // m_status.devices.Add(new DeviceSensor(xn)); + // break; + + case "16": + m_status.devices.Add(new DeviceHumidity(xn)); + break; + + case "17": + m_status.devices.Add(new DeviceTemperature(xn, m_bMetric)); + break; + + case "18": + m_status.devices.Add(new DeviceLightSensor(xn)); + break; + + case "21": + m_status.devices.Add(new DevicePowerMeter(xn)); + break; + + case "0": + default: + // Check for Google Weather Device + if (xn.Attributes["WindCondition"] != null) + { + m_status.devices.Add(new DeviceGWeather(xn)); + break; + } + // Check for Bart's sprinkler Device + if (xn.Attributes["OperationMode"] != null) + { + m_status.devices.Add(new DeviceSprinkler(xn)); + break; + } + /* Falltrough */ + m_status.devices.Add(new DeviceGeneric(xn)); + break; + } + } + } + // update timer again (took some time to get the data) + m_lLastUpdate = getSecondSince1970(); + m_bUpdatePending = false; + return bFullRefresh; + } + + public string doVeraRequest( string param, bool pParseResult ) + { + string response = doVeraRequest( param ); + if (pParseResult) + { + response = parseVeraRespones(response); + } + return response; + } + + public string doVeraRequest( string param ) + { + return retrieveURL("http://" + m_sVeraIPAddress + ":" + m_sVeraTCPIPPort + "/data_request" + p... [truncated message content] |
From: <ks...@us...> - 2012-02-14 20:21:59
|
Revision: 4451 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4451&view=rev Author: ksya Date: 2012-02-14 20:21:46 +0000 (Tue, 14 Feb 2012) Log Message: ----------- Added Paths: ----------- trunk/plugins/OperaMobileLauncher/ trunk/plugins/OperaMobileLauncher/Opera Mobile/ trunk/plugins/OperaMobileLauncher/Opera Mobile/FormSettings.Designer.cs trunk/plugins/OperaMobileLauncher/Opera Mobile/FormSettings.cs trunk/plugins/OperaMobileLauncher/Opera Mobile/FormSettings.resx trunk/plugins/OperaMobileLauncher/Opera Mobile/IniFile.cs trunk/plugins/OperaMobileLauncher/Opera Mobile/OperaLauncher.cs trunk/plugins/OperaMobileLauncher/Opera Mobile/OperaLauncher.cs.bak trunk/plugins/OperaMobileLauncher/Opera Mobile/OperaLauncher.cs.new trunk/plugins/OperaMobileLauncher/Opera Mobile/OperaLauncher.csproj trunk/plugins/OperaMobileLauncher/Opera Mobile/OperaLauncher.csproj.user trunk/plugins/OperaMobileLauncher/Opera Mobile/Properties/ trunk/plugins/OperaMobileLauncher/Opera Mobile/Properties/AssemblyInfo.cs trunk/plugins/OperaMobileLauncher/Opera Mobile/Properties/Resources.Designer.cs trunk/plugins/OperaMobileLauncher/Opera Mobile/Properties/Resources.resx trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/ trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Debug/ trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Debug/OperaMobile.dll trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Debug/OperaMobile.pdb trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Debug/Utils.dll trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Release/ trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Release/OperaMobile.png trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Release/OperaMobile.xml trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Release/OperaMobileLauncher - kopie.xmp2 trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Release/OperaMobileLauncher.dll trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Release/OperaMobileLauncher.mpe1 trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Release/OperaMobileLauncher.pdb trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Release/OperaMobileLauncher.xmp2 trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Release/OperaMobileLauncher_0.2.zip trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Release/OperaMobileLauncher_0.3.zip trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Release/OperaMobileSettings.png trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Release/hover_Opera Mobile Launcher.png trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Release/hover_Opera Mobile Launcher1.png trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Release/opera_left_installer.jpg trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Release/update.xml trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/ trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Debug/ trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Debug/Opera Mobile.csproj.FileListAbsolute.txt trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Debug/OperaLauncher.FormSettings.resources trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Debug/OperaLauncher.csproj.FileListAbsolute.txt trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Debug/OperaMobile.csproj.FileListAbsolute.txt trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Debug/OperaMobile.dll trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Debug/OperaMobile.pdb trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Debug/ResGen.read.1.tlog trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Debug/ResGen.write.1.tlog trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Debug/ResolveAssemblyReference.cache trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Debug/TempPE/ trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Debug/eventGhostTrigger.FormSettings.resources trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Release/ trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Release/Opera Mobile.csproj.FileListAbsolute.txt trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Release/OperaLauncher.FormSettings.resources trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Release/OperaLauncher.Properties.Resources.resources trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Release/OperaLauncher.csproj.FileListAbsolute.txt trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Release/OperaMobile.csproj.FileListAbsolute.txt trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Release/OperaMobileLauncher.dll trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Release/OperaMobileLauncher.pdb trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Release/ResGen.read.1.tlog trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Release/ResGen.write.1.tlog trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Release/ResolveAssemblyReference.cache trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Release/TempPE/ trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Release/TempPE/Properties.Resources.Designer.cs.dll trunk/plugins/OperaMobileLauncher/Opera Mobile/opera-logo.png trunk/plugins/OperaMobileLauncher/Opera Mobile/opera-logo_disabled.png trunk/plugins/OperaMobileLauncher/OperaMobileLauncher.sln trunk/plugins/OperaMobileLauncher/OperaMobileLauncher.suo Added: trunk/plugins/OperaMobileLauncher/Opera Mobile/FormSettings.Designer.cs =================================================================== --- trunk/plugins/OperaMobileLauncher/Opera Mobile/FormSettings.Designer.cs (rev 0) +++ trunk/plugins/OperaMobileLauncher/Opera Mobile/FormSettings.Designer.cs 2012-02-14 20:21:46 UTC (rev 4451) @@ -0,0 +1,388 @@ +namespace OperaLauncher +{ + partial class FormSettings + { + /// <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.buttonOk = new System.Windows.Forms.Button(); + this.buttonCancel = new System.Windows.Forms.Button(); + this.imageFileName_Button = new System.Windows.Forms.Button(); + this.imageFileName_Editbox = new System.Windows.Forms.TextBox(); + this.label4 = new System.Windows.Forms.Label(); + this.test_btn = new System.Windows.Forms.Button(); + this.fullscreen_chk = new System.Windows.Forms.CheckBox(); + this.touchinterface_chk = new System.Windows.Forms.CheckBox(); + this.customargs_txt = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.widthZoom_txt = new System.Windows.Forms.TextBox(); + this.widthZoom_chk = new System.Windows.Forms.CheckBox(); + this.ApplyOpera_btn = new System.Windows.Forms.Button(); + this.downloadLink = new System.Windows.Forms.LinkLabel(); + this.minFontSize_nud = new System.Windows.Forms.NumericUpDown(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.setToDesktopUA_btn = new System.Windows.Forms.Button(); + this.customUA_txt = new System.Windows.Forms.TextBox(); + this.useCustomUA_chk = new System.Windows.Forms.CheckBox(); + this.label2 = new System.Windows.Forms.Label(); + this.useMinFontsize_chk = new System.Windows.Forms.CheckBox(); + this.label3 = new System.Windows.Forms.Label(); + this.openHelp_btn = new System.Windows.Forms.Button(); + this.useButtonForwarding = new System.Windows.Forms.CheckBox(); + ((System.ComponentModel.ISupportInitialize)(this.minFontSize_nud)).BeginInit(); + this.groupBox1.SuspendLayout(); + this.SuspendLayout(); + // + // buttonOk + // + this.buttonOk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonOk.DialogResult = System.Windows.Forms.DialogResult.OK; + this.buttonOk.Location = new System.Drawing.Point(362, 436); + this.buttonOk.Name = "buttonOk"; + this.buttonOk.Size = new System.Drawing.Size(75, 23); + this.buttonOk.TabIndex = 2; + this.buttonOk.Text = "Save"; + 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(443, 436); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.Size = new System.Drawing.Size(75, 23); + this.buttonCancel.TabIndex = 2; + this.buttonCancel.Text = "Cancel"; + this.buttonCancel.UseVisualStyleBackColor = true; + // + // imageFileName_Button + // + this.imageFileName_Button.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.imageFileName_Button.Location = new System.Drawing.Point(493, 24); + this.imageFileName_Button.Name = "imageFileName_Button"; + this.imageFileName_Button.Size = new System.Drawing.Size(27, 23); + this.imageFileName_Button.TabIndex = 19; + this.imageFileName_Button.Text = "..."; + this.imageFileName_Button.UseVisualStyleBackColor = true; + this.imageFileName_Button.Click += new System.EventHandler(this.imageFileName_Button_Click); + // + // imageFileName_Editbox + // + this.imageFileName_Editbox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.imageFileName_Editbox.Location = new System.Drawing.Point(15, 26); + this.imageFileName_Editbox.Name = "imageFileName_Editbox"; + this.imageFileName_Editbox.Size = new System.Drawing.Size(472, 20); + this.imageFileName_Editbox.TabIndex = 20; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(12, 9); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(179, 13); + this.label4.TabIndex = 21; + this.label4.Text = "Select the Opera Mobile executable:"; + // + // test_btn + // + this.test_btn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.test_btn.Location = new System.Drawing.Point(15, 436); + this.test_btn.Name = "test_btn"; + this.test_btn.Size = new System.Drawing.Size(52, 23); + this.test_btn.TabIndex = 22; + this.test_btn.Text = "Test"; + this.test_btn.UseVisualStyleBackColor = true; + this.test_btn.Click += new System.EventHandler(this.test_btn_Click); + // + // fullscreen_chk + // + this.fullscreen_chk.AutoSize = true; + this.fullscreen_chk.Location = new System.Drawing.Point(15, 53); + this.fullscreen_chk.Name = "fullscreen_chk"; + this.fullscreen_chk.Size = new System.Drawing.Size(293, 17); + this.fullscreen_chk.TabIndex = 23; + this.fullscreen_chk.Text = "Do not start in fullscreen (clears the -fullscreen argument)"; + this.fullscreen_chk.UseVisualStyleBackColor = true; + // + // touchinterface_chk + // + this.touchinterface_chk.AutoSize = true; + this.touchinterface_chk.Location = new System.Drawing.Point(15, 73); + this.touchinterface_chk.Name = "touchinterface_chk"; + this.touchinterface_chk.Size = new System.Drawing.Size(231, 17); + this.touchinterface_chk.TabIndex = 24; + this.touchinterface_chk.Text = "Use the touch interface (not recommended)"; + this.touchinterface_chk.UseVisualStyleBackColor = true; + // + // customargs_txt + // + this.customargs_txt.Location = new System.Drawing.Point(15, 116); + this.customargs_txt.Name = "customargs_txt"; + this.customargs_txt.Size = new System.Drawing.Size(250, 20); + this.customargs_txt.TabIndex = 25; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(12, 99); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(97, 13); + this.label1.TabIndex = 26; + this.label1.Text = "Custom arguments:"; + // + // widthZoom_txt + // + this.widthZoom_txt.Enabled = false; + this.widthZoom_txt.Location = new System.Drawing.Point(9, 44); + this.widthZoom_txt.Name = "widthZoom_txt"; + this.widthZoom_txt.Size = new System.Drawing.Size(59, 20); + this.widthZoom_txt.TabIndex = 28; + // + // widthZoom_chk + // + this.widthZoom_chk.AutoSize = true; + this.widthZoom_chk.Location = new System.Drawing.Point(9, 24); + this.widthZoom_chk.Name = "widthZoom_chk"; + this.widthZoom_chk.Size = new System.Drawing.Size(279, 17); + this.widthZoom_chk.TabIndex = 29; + this.widthZoom_chk.Text = "Zoom to fit and use minimum width of: (recommended)"; + this.widthZoom_chk.UseVisualStyleBackColor = true; + this.widthZoom_chk.CheckedChanged += new System.EventHandler(this.widthZoom_chk_CheckedChanged); + // + // ApplyOpera_btn + // + this.ApplyOpera_btn.Anchor = System.Windows.Forms.AnchorStyles.Bottom; + this.ApplyOpera_btn.ForeColor = System.Drawing.Color.DarkBlue; + this.ApplyOpera_btn.Location = new System.Drawing.Point(165, 172); + this.ApplyOpera_btn.Name = "ApplyOpera_btn"; + this.ApplyOpera_btn.Size = new System.Drawing.Size(173, 23); + this.ApplyOpera_btn.TabIndex = 30; + this.ApplyOpera_btn.Text = "Apply settings to Opera Mobile"; + this.ApplyOpera_btn.UseVisualStyleBackColor = false; + this.ApplyOpera_btn.Click += new System.EventHandler(this.ApplyOpera_btn_Click); + // + // downloadLink + // + this.downloadLink.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.downloadLink.AutoSize = true; + this.downloadLink.Location = new System.Drawing.Point(343, 416); + this.downloadLink.Name = "downloadLink"; + this.downloadLink.Size = new System.Drawing.Size(165, 13); + this.downloadLink.TabIndex = 31; + this.downloadLink.TabStop = true; + this.downloadLink.Text = "Download Opera Mobile Emulator"; + this.downloadLink.TextAlign = System.Drawing.ContentAlignment.TopRight; + this.downloadLink.Click += new System.EventHandler(this.downloadLink_Click); + // + // minFontSize_nud + // + this.minFontSize_nud.Enabled = false; + this.minFontSize_nud.Location = new System.Drawing.Point(9, 88); + this.minFontSize_nud.Name = "minFontSize_nud"; + this.minFontSize_nud.Size = new System.Drawing.Size(51, 20); + this.minFontSize_nud.TabIndex = 33; + this.minFontSize_nud.Value = new decimal(new int[] { + 10, + 0, + 0, + 0}); + // + // groupBox1 + // + this.groupBox1.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.groupBox1.Controls.Add(this.setToDesktopUA_btn); + this.groupBox1.Controls.Add(this.customUA_txt); + this.groupBox1.Controls.Add(this.useCustomUA_chk); + this.groupBox1.Controls.Add(this.label2); + this.groupBox1.Controls.Add(this.useMinFontsize_chk); + this.groupBox1.Controls.Add(this.minFontSize_nud); + this.groupBox1.Controls.Add(this.ApplyOpera_btn); + this.groupBox1.Controls.Add(this.widthZoom_txt); + this.groupBox1.Controls.Add(this.widthZoom_chk); + this.groupBox1.Location = new System.Drawing.Point(12, 196); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(505, 201); + this.groupBox1.TabIndex = 34; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "These settings need to be applied first"; + // + // setToDesktopUA_btn + // + this.setToDesktopUA_btn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.setToDesktopUA_btn.Enabled = false; + this.setToDesktopUA_btn.Location = new System.Drawing.Point(406, 133); + this.setToDesktopUA_btn.Name = "setToDesktopUA_btn"; + this.setToDesktopUA_btn.Size = new System.Drawing.Size(88, 23); + this.setToDesktopUA_btn.TabIndex = 38; + this.setToDesktopUA_btn.Text = "Set to desktop"; + this.setToDesktopUA_btn.UseVisualStyleBackColor = true; + this.setToDesktopUA_btn.Click += new System.EventHandler(this.setToDesktopUA_Click); + // + // customUA_txt + // + this.customUA_txt.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.customUA_txt.Enabled = false; + this.customUA_txt.Location = new System.Drawing.Point(9, 135); + this.customUA_txt.Name = "customUA_txt"; + this.customUA_txt.Size = new System.Drawing.Size(391, 20); + this.customUA_txt.TabIndex = 37; + // + // useCustomUA_chk + // + this.useCustomUA_chk.AutoSize = true; + this.useCustomUA_chk.Location = new System.Drawing.Point(9, 114); + this.useCustomUA_chk.Name = "useCustomUA_chk"; + this.useCustomUA_chk.Size = new System.Drawing.Size(276, 17); + this.useCustomUA_chk.TabIndex = 36; + this.useCustomUA_chk.Text = "Use custom User-Agent: (standard is Android/Mobile)"; + this.useCustomUA_chk.UseVisualStyleBackColor = true; + this.useCustomUA_chk.CheckedChanged += new System.EventHandler(this.useCustomUA_chk_CheckedChanged); + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(69, 44); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(33, 13); + this.label2.TabIndex = 35; + this.label2.Text = "pixels"; + // + // useMinFontsize_chk + // + this.useMinFontsize_chk.AutoSize = true; + this.useMinFontsize_chk.Location = new System.Drawing.Point(9, 69); + this.useMinFontsize_chk.Name = "useMinFontsize_chk"; + this.useMinFontsize_chk.Size = new System.Drawing.Size(133, 17); + this.useMinFontsize_chk.TabIndex = 34; + this.useMinFontsize_chk.Text = "Use minimum font size:"; + this.useMinFontsize_chk.UseVisualStyleBackColor = true; + this.useMinFontsize_chk.CheckedChanged += new System.EventHandler(this.useMinFontsize_chk_CheckedChanged); + // + // label3 + // + this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(14, 416); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(83, 13); + this.label3.TabIndex = 35; + this.label3.Text = "0.3 beta - Dragy"; + // + // openHelp_btn + // + this.openHelp_btn.Location = new System.Drawing.Point(268, 114); + this.openHelp_btn.Name = "openHelp_btn"; + this.openHelp_btn.Size = new System.Drawing.Size(75, 23); + this.openHelp_btn.TabIndex = 36; + this.openHelp_btn.Text = "Open help"; + this.openHelp_btn.UseVisualStyleBackColor = true; + this.openHelp_btn.Click += new System.EventHandler(this.openHelp_btn_Click); + // + // useButtonForwarding + // + this.useButtonForwarding.AutoSize = true; + this.useButtonForwarding.Checked = true; + this.useButtonForwarding.CheckState = System.Windows.Forms.CheckState.Checked; + this.useButtonForwarding.Location = new System.Drawing.Point(15, 145); + this.useButtonForwarding.Name = "useButtonForwarding"; + this.useButtonForwarding.Size = new System.Drawing.Size(445, 30); + this.useButtonForwarding.TabIndex = 37; + this.useButtonForwarding.Text = "Use MP to forward remote buttons to Opera Mobile (T9 typing not yet supported/wor" + + "king)\r\n(External app to re-map buttons is still recommended. Don\'t enable when u" + + "sing such app)\r\n"; + this.useButtonForwarding.UseVisualStyleBackColor = true; + // + // FormSettings + // + 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(529, 471); + this.Controls.Add(this.useButtonForwarding); + this.Controls.Add(this.openHelp_btn); + this.Controls.Add(this.label3); + this.Controls.Add(this.downloadLink); + this.Controls.Add(this.label1); + this.Controls.Add(this.customargs_txt); + this.Controls.Add(this.touchinterface_chk); + this.Controls.Add(this.fullscreen_chk); + this.Controls.Add(this.test_btn); + this.Controls.Add(this.label4); + this.Controls.Add(this.imageFileName_Editbox); + this.Controls.Add(this.imageFileName_Button); + this.Controls.Add(this.buttonCancel); + this.Controls.Add(this.buttonOk); + this.Controls.Add(this.groupBox1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "FormSettings"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "Opera Mobile Launcher Settings"; + this.Load += new System.EventHandler(this.FormSettings_Load); + ((System.ComponentModel.ISupportInitialize)(this.minFontSize_nud)).EndInit(); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button buttonOk; + private System.Windows.Forms.Button buttonCancel; + private System.Windows.Forms.Button imageFileName_Button; + private System.Windows.Forms.TextBox imageFileName_Editbox; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.Button test_btn; + private System.Windows.Forms.CheckBox fullscreen_chk; + private System.Windows.Forms.CheckBox touchinterface_chk; + private System.Windows.Forms.TextBox customargs_txt; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox widthZoom_txt; + private System.Windows.Forms.CheckBox widthZoom_chk; + private System.Windows.Forms.Button ApplyOpera_btn; + private System.Windows.Forms.LinkLabel downloadLink; + private System.Windows.Forms.NumericUpDown minFontSize_nud; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.CheckBox useMinFontsize_chk; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Button openHelp_btn; + private System.Windows.Forms.TextBox customUA_txt; + private System.Windows.Forms.CheckBox useCustomUA_chk; + private System.Windows.Forms.Button setToDesktopUA_btn; + private System.Windows.Forms.CheckBox useButtonForwarding; + + } +} \ No newline at end of file Added: trunk/plugins/OperaMobileLauncher/Opera Mobile/FormSettings.cs =================================================================== --- trunk/plugins/OperaMobileLauncher/Opera Mobile/FormSettings.cs (rev 0) +++ trunk/plugins/OperaMobileLauncher/Opera Mobile/FormSettings.cs 2012-02-14 20:21:46 UTC (rev 4451) @@ -0,0 +1,256 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Threading; +using System.Windows.Forms; +using MediaPortal.GUI.Library; +//using MediaPortal.Util; +using MediaPortal.Configuration; +using System.Diagnostics; +using System.IO; +using System.Runtime.InteropServices; + +namespace OperaLauncher +{ + public partial class FormSettings : Form + { + public string arguments; + + public FormSettings() + { + InitializeComponent(); + } + + + private void displayDeviceSettings() + { + using (MediaPortal.Profile.Settings xmlReader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + { + + string Path = xmlReader.GetValueAsString(OperaLauncher.PLUGIN_NAME, "Path", ""); + bool noFullscreen = xmlReader.GetValueAsBool(OperaLauncher.PLUGIN_NAME, "noFullscreen", false); + bool TouchInferface = xmlReader.GetValueAsBool(OperaLauncher.PLUGIN_NAME, "TouchInferface", false); + string Arguments = xmlReader.GetValueAsString(OperaLauncher.PLUGIN_NAME, "Arguments", ""); + bool UseZoomWidth = xmlReader.GetValueAsBool(OperaLauncher.PLUGIN_NAME, "UseZoomWidth", false); + string ZoomWidth = xmlReader.GetValueAsString(OperaLauncher.PLUGIN_NAME, "ZoomWidth", "950"); + bool UseMinFontSize = xmlReader.GetValueAsBool(OperaLauncher.PLUGIN_NAME, "UseMinFontSize", false); + string MinFontSize = xmlReader.GetValueAsString(OperaLauncher.PLUGIN_NAME, "MinFontSize", "9"); + bool UseCustomUserAgent = xmlReader.GetValueAsBool(OperaLauncher.PLUGIN_NAME, "UseCustomUserAgent", false); + string CustomUserAgent = xmlReader.GetValueAsString(OperaLauncher.PLUGIN_NAME, "CustomUserAgent", ""); + bool UseButtonForwarding = xmlReader.GetValueAsBool(OperaLauncher.PLUGIN_NAME, "UseButtonForwarding", true); + + imageFileName_Editbox.Text = Path; + fullscreen_chk.Checked = noFullscreen; + touchinterface_chk.Checked = TouchInferface; + customargs_txt.Text = Arguments; + useButtonForwarding.Checked = UseButtonForwarding; + + widthZoom_txt.Text = ZoomWidth; + if (UseZoomWidth) + { + widthZoom_chk.Checked = true; + widthZoom_txt.Enabled = true; + } + + minFontSize_nud.Value = Convert.ToDecimal(MinFontSize); + if (UseMinFontSize) + { + useMinFontsize_chk.Checked = true; + minFontSize_nud.Enabled = true; + } + + customUA_txt.Text = CustomUserAgent; + if (UseCustomUserAgent) + { + useCustomUA_chk.Checked = true; + customUA_txt.Enabled = true; + setToDesktopUA_btn.Enabled = true; + } + + } + } + private void FormSettings_Load(object sender, EventArgs e) + { + displayDeviceSettings(); + } + + public static void Main() + { + FormSettings frm = new FormSettings(); + if (frm.ShowDialog() == DialogResult.OK) + { + } + } + + private void buttonOk_Click(object sender, EventArgs e) + { + using (MediaPortal.Profile.Settings xmlWriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + { + xmlWriter.SetValue(OperaLauncher.PLUGIN_NAME, "Path", imageFileName_Editbox.Text); + xmlWriter.SetValueAsBool(OperaLauncher.PLUGIN_NAME, "noFullscreen", fullscreen_chk.Checked); + xmlWriter.SetValueAsBool(OperaLauncher.PLUGIN_NAME, "TouchInferface", touchinterface_chk.Checked); + xmlWriter.SetValue(OperaLauncher.PLUGIN_NAME, "Arguments", customargs_txt.Text); + xmlWriter.SetValueAsBool(OperaLauncher.PLUGIN_NAME, "UseZoomWidth", widthZoom_chk.Checked); + xmlWriter.SetValue(OperaLauncher.PLUGIN_NAME, "ZoomWidth", widthZoom_txt.Text); + xmlWriter.SetValueAsBool(OperaLauncher.PLUGIN_NAME, "UseMinFontSize", useMinFontsize_chk.Checked); + xmlWriter.SetValue(OperaLauncher.PLUGIN_NAME, "MinFontSize", minFontSize_nud.Value); + xmlWriter.SetValueAsBool(OperaLauncher.PLUGIN_NAME, "UseCustomUserAgent", useCustomUA_chk.Checked); + xmlWriter.SetValue(OperaLauncher.PLUGIN_NAME, "CustomUserAgent", customUA_txt.Text); + xmlWriter.SetValueAsBool(OperaLauncher.PLUGIN_NAME, "UseButtonForwarding", useButtonForwarding.Checked); + } + } + + private void imageFileName_Button_Click(object sender, EventArgs e) + { + OpenFileDialog fdlg = new OpenFileDialog(); + fdlg.Title = "Select the Opera Mobile Emulator executable"; + fdlg.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles); + fdlg.Filter = "Opera Mobile|OperaMobileEmu.exe"; + fdlg.FilterIndex = 2; + fdlg.RestoreDirectory = true; + + if (fdlg.ShowDialog() == DialogResult.OK) + { + imageFileName_Editbox.Text = fdlg.FileName; + } + } + + private void test_btn_Click(object sender, EventArgs e) + { + arguments = ""; + Process opera = new Process(); + if (!fullscreen_chk.Checked) + arguments += " -fullscreen"; + if (touchinterface_chk.Checked) + arguments += " -tabletui"; + else + arguments += " -notouchwithtouchevents"; + + arguments += " "+customargs_txt.Text; + + opera.StartInfo.FileName = imageFileName_Editbox.Text; + opera.StartInfo.WorkingDirectory = Directory.GetParent(imageFileName_Editbox.Text).FullName; + opera.StartInfo.Arguments = arguments; + + try + { + opera.Start(); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Could not start.."); + Log.Error("Start Opera failed: " + ex.Message); + } + } + + private void ApplyOpera_btn_Click(object sender, EventArgs e) + { + //make scripts/user.js file + string operaLocation = Directory.GetParent(imageFileName_Editbox.Text).FullName; + string scriptsFile = System.IO.Path.Combine(operaLocation, @"opera\user.js"); + + // Delete the file if it exists. + if (File.Exists(scriptsFile)) + { + File.Delete(scriptsFile); + } + + // Create the file. + if (!File.Exists(scriptsFile)) + { + using (FileStream fs = File.Create(scriptsFile)) + { + } + } + + // create a writer and open the file + TextWriter tw = new StreamWriter(scriptsFile); + tw.WriteLine("if(" + widthZoom_chk.Checked.ToString().ToLower() + ")"); + tw.WriteLine("{"); + tw.WriteLine("var yourTag=document.createElement('meta');"); + tw.WriteLine("yourTag.name = \"viewport\";"); + tw.WriteLine("yourTag.content = \"width=" + widthZoom_txt.Text + "px;\";"); + tw.WriteLine("document.getElementsByTagName('head')[0].appendChild(yourTag);"); + tw.WriteLine("}"); + tw.Close(); + + string OperaIniFile = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\Opera\OperaMobileEmulator\opera.ini"; + + if (File.Exists(OperaIniFile)) + { + IniFile ini = new IniFile(OperaIniFile); + + //write values to opera.ini + ini.IniWriteValue("User Prefs", "User JavaScript", "1"); + ini.IniWriteValue("User Prefs", "User JavaScript File", scriptsFile); + + if (useMinFontsize_chk.Checked) + ini.IniWriteValue("User Prefs", "Minimum Font Size", minFontSize_nud.Value.ToString()); + else + ini.IniWriteValue("User Prefs", "Minimum Font Size", null); + + if (useCustomUA_chk.Checked) + ini.IniWriteValue("User Prefs", "Custom User-Agent", customUA_txt.Text); + else + ini.IniWriteValue("User Prefs", "Custom User-Agent", null); + + } + else + { + MessageBox.Show("Opera Program Data not yet created. Please, press the test button first and try to apply settings again.", "Error Message"); + } + } + + private void widthZoom_chk_CheckedChanged(object sender, EventArgs e) + { + if (widthZoom_chk.Checked) + widthZoom_txt.Enabled = true; + else + widthZoom_txt.Enabled = false; + } + private void useMinFontsize_chk_CheckedChanged(object sender, EventArgs e) + { + if (useMinFontsize_chk.Checked) + minFontSize_nud.Enabled = true; + else + minFontSize_nud.Enabled = false; + } + private void useCustomUA_chk_CheckedChanged(object sender, EventArgs e) + { + if (useCustomUA_chk.Checked) + { + customUA_txt.Enabled = true; + setToDesktopUA_btn.Enabled = true; + } + else + { + customUA_txt.Enabled = false; + setToDesktopUA_btn.Enabled = false; + } + } + + + private void downloadLink_Click(object sender, EventArgs e) + { + Process.Start("http://www.opera.com/developer/tools/mobile/"); + } + + private void openHelp_btn_Click(object sender, EventArgs e) + { + Process opera = new Process(); + opera.StartInfo.FileName = imageFileName_Editbox.Text; + opera.StartInfo.WorkingDirectory = Directory.GetParent(imageFileName_Editbox.Text).FullName; + opera.StartInfo.Arguments = "-?"; + opera.Start(); + } + + private void setToDesktopUA_Click(object sender, EventArgs e) + { + customUA_txt.Text = "Opera/9.80 (Windows NT 6.0; U; en) Presto/2.8.99 Version/11.10"; + } + + } +} \ No newline at end of file Added: trunk/plugins/OperaMobileLauncher/Opera Mobile/FormSettings.resx =================================================================== --- trunk/plugins/OperaMobileLauncher/Opera Mobile/FormSettings.resx (rev 0) +++ trunk/plugins/OperaMobileLauncher/Opera Mobile/FormSettings.resx 2012-02-14 20:21:46 UTC (rev 4451) @@ -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.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> +</root> \ No newline at end of file Added: trunk/plugins/OperaMobileLauncher/Opera Mobile/IniFile.cs =================================================================== --- trunk/plugins/OperaMobileLauncher/Opera Mobile/IniFile.cs (rev 0) +++ trunk/plugins/OperaMobileLauncher/Opera Mobile/IniFile.cs 2012-02-14 20:21:46 UTC (rev 4451) @@ -0,0 +1,56 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; + + public class IniFile + { + public string path; + + [DllImport("kernel32")] + private static extern long WritePrivateProfileString(string section, + string key, string val, string filePath); + [DllImport("kernel32")] + private static extern int GetPrivateProfileString(string section, + string key, string def, StringBuilder retVal, int size, string filePath); + + /// <summary> + /// INIFile Constructor. + /// </summary> + /// <PARAM name="INIPath"></PARAM> + + public IniFile(string INIPath) + { + path = INIPath; + } + /// <summary> + /// Write Data to the INI File + /// </summary> + /// <PARAM name="Section"></PARAM> + /// Section name + /// <PARAM name="Key"></PARAM> + /// Key Name + /// <PARAM name="Value"></PARAM> + /// Value Name + + public void IniWriteValue(string Section, string Key, string Value) + { + WritePrivateProfileString(Section, Key, Value, this.path); + } + + /// <summary> + /// Read Data Value From the Ini File + /// </summary> + /// <PARAM name="Section"></PARAM> + /// <PARAM name="Key"></PARAM> + /// <PARAM name="Path"></PARAM> + /// <returns></returns> + + public string IniReadValue(string Section, string Key) + { + StringBuilder temp = new StringBuilder(255); + int i = GetPrivateProfileString(Section, Key, "", temp, + 255, this.path); + return temp.ToString(); + + } + } Added: trunk/plugins/OperaMobileLauncher/Opera Mobile/OperaLauncher.cs =================================================================== --- trunk/plugins/OperaMobileLauncher/Opera Mobile/OperaLauncher.cs (rev 0) +++ trunk/plugins/OperaMobileLauncher/Opera Mobile/OperaLauncher.cs 2012-02-14 20:21:46 UTC (rev 4451) @@ -0,0 +1,299 @@ +using System; +using System.Diagnostics; +using MediaPortal.GUI.Library; +using MediaPortal.Configuration; +using System.IO; +using System.Windows.Forms; +using System.Runtime.InteropServices; + +namespace OperaLauncher +{ + [PluginIcons("OperaLauncher.opera-logo.png", "OperaLauncher.opera-logo_disabled.png")] + + public class OperaLauncher : GUIWindow, ISetupForm + { + public const string PLUGIN_NAME = "Opera Mobile Launcher"; + public string Path; + public bool noFullscreen; + public bool TouchInferface; + public string Arguments; + public bool UseButtonForwarding; + + [DllImport("user32.dll")] + public static extern int FindWindow( + string lpClassName, // class name + string lpWindowName // window name + ); + + [DllImport("user32.dll")] + public static extern int SendMessage( + int hWnd, // handle to destination window + uint Msg, // message + int wParam, // first message parameter + int lParam // second message parameter + ); + + [DllImport("user32.dll")] + private static extern bool ShowWindowAsync(int hWnd, int nCmdShow); + + [DllImport("user32.dll")] + private static extern bool BringWindowToTop(int hWnd); + + [DllImport("user32.dll")] + private static extern bool EnableWindow(int hWnd, bool bEnable); + + [DllImport("user32.dll")] + private static extern int SetFocus(int hWnd); + + + const int WM_KEYDOWN = 0x0100; + const int WM_KEYUP = 0x0101; + const int WM_APPCOMMAND = 0x0319; + const int SW_HIDE = 0; + const int SW_SHOWNORMAL = 1; + const int SW_SHOWMINIMIZED = 2; + const int SW_SHOWMAXIMIZED = 3; + const int SW_RESTORE = 9; + const int VK_F1 = 0x70; + const int VK_F2 = 0x71; + const int VK_NUMPAD0 = 0x60; + const int VK_NUMPAD1 = 0x61; + const int VK_NUMPAD2 = 0x62; + const int VK_NUMPAD3 = 0x63; + const int VK_NUMPAD4 = 0x64; + const int VK_NUMPAD5 = 0x65; + const int VK_NUMPAD6 = 0x66; + const int VK_NUMPAD7 = 0x67; + const int VK_NUMPAD8 = 0x68; + const int VK_NUMPAD9 = 0x69; + + ProcessStartInfo startInfo = new ProcessStartInfo(); + Process opera = new Process(); + public OperaLauncher() + { + using (MediaPortal.Profile.Settings xmlReader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + { + Path = xmlReader.GetValueAsString(OperaLauncher.PLUGIN_NAME, "Path", ""); + noFullscreen = xmlReader.GetValueAsBool(OperaLauncher.PLUGIN_NAME, "noFullscreen", false); + TouchInferface = xmlReader.GetValueAsBool(OperaLauncher.PLUGIN_NAME, "TouchInferface", false); + Arguments = xmlReader.GetValueAsString(OperaLauncher.PLUGIN_NAME, "Arguments", ""); + UseButtonForwarding = xmlReader.GetValueAsBool(OperaLauncher.PLUGIN_NAME, "UseButtonForwarding", true); + } + } + + protected override void OnPageLoad() + { + string strUrl = GUIPropertyManager.GetProperty("#browserlink"); + startOpera(strUrl); + + if(!UseButtonForwarding) + GUIWindowManager.ShowPreviousWindow(); + base.OnPageLoad(); + } + + protected override void OnPageDestroy(int newWindowId) + { + //close opera + opera.CloseMainWindow(); + + /*int WindowToFind = FindWindow("WindowsForms10.Window.8.app.0.2386859", null); + bool test = ShowWindowAsync(WindowToFind, SW_RESTORE);*/ + } + + public void startOpera(string strUrl = null) + { + string arguments = ""; + if (!noFullscreen) + arguments += " -fullscreen"; + if (TouchInferface) + arguments += " -tabletui"; + else + arguments += " -notouchwithtouchevents"; + + arguments += " " + Arguments; + + opera.StartInfo.FileName = @Path; + opera.StartInfo.WorkingDirectory = Directory.GetParent(Path).FullName; + if (strUrl != null) + opera.StartInfo.Arguments = arguments + " -url " + strUrl; + else + opera.StartInfo.Arguments = arguments; + + try + { + opera.Start(); + + int OperaHandle = FindWindow("QWidget", null); + bool top = BringWindowToTop(OperaHandle); + + if (UseButtonForwarding) + { + int MPHandle = FindWindow("WindowsForms10.Window.8.app.0.2386859", null); + int disableinput = SetFocus(MPHandle); + Log.Info("Set focus: (MP Handle: " + MPHandle.ToString() + ", Focus: " + disableinput + ")"); + } + //bool test = ShowWindowAsync(WindowToFind, SW_HIDE); + Cursor.Hide(); + } + catch (Exception ex) + { + Log.Error("Start Opera failed: " + ex.Message); + Cursor.Show(); + } + } + + + public override void OnAction(MediaPortal.GUI.Library.Action action) + { + if (UseButtonForwarding) + { + int WindowToFind = FindWindow("QWidget", null); + + switch (action.wID) + { + case MediaPortal.GUI.Library.Action.ActionType.ACTION_CONTEXT_MENU: + GUIPropertyManager.SetProperty("#keypressed", "Info"); + SendMessage(WindowToFind, WM_KEYDOWN, VK_F1, 0); + SendMessage(WindowToFind, WM_KEYUP, VK_F1, 0); + break; + + case MediaPortal.GUI.Library.Action.ActionType.ACTION_PREV_ITEM: + GUIPropertyManager.SetProperty("#keypressed", "Replay"); + SendMessage(WindowToFind, WM_KEYDOWN, VK_F2, 0); + SendMessage(WindowToFind, WM_KEYUP, VK_F2, 0); + break; + + case MediaPortal.GUI.Library.Action.ActionType.ACTION_PAGE_UP: + GUIPropertyManager.SetProperty("#keypressed", "Channel Up"); + SendMessage(WindowToFind, WM_KEYDOWN, VK_NUMPAD8, 0); + SendMessage(WindowToFind, WM_KEYUP, VK_NUMPAD8, 0); + break; + + case MediaPortal.GUI.Library.Action.ActionType.ACTION_PAGE_DOWN: + GUIPropertyManager.SetProperty("#keypressed", "Channel Down"); + SendMessage(WindowToFind, WM_KEYDOWN, VK_NUMPAD2, 0); + SendMessage(WindowToFind, WM_KEYUP, VK_NUMPAD2, 0); + break; + + case MediaPortal.GUI.Library.Action.ActionType.REMOTE_0: + GUIPropertyManager.SetProperty("#keypressed", "0"); + SendMessage(WindowToFind, WM_KEYDOWN, VK_NUMPAD0, 0); + SendMessage(WindowToFind, WM_KEYUP, VK_NUMPAD0, 0); + break; + case MediaPortal.GUI.Library.Action.ActionType.REMOTE_1: + GUIPropertyManager.SetProperty("#keypressed", "1"); + SendMessage(WindowToFind, WM_KEYDOWN, VK_NUMPAD1, 0); + SendMessage(WindowToFind, WM_KEYUP, VK_NUMPAD1, 0); + break; + case MediaPortal.GUI.Library.Action.ActionType.REMOTE_2: + GUIPropertyManager.SetProperty("#keypressed", "2"); + SendMessage(WindowToFind, WM_KEYDOWN, VK_NUMPAD2, 0); + SendMessage(WindowToFind, WM_KEYUP, VK_NUMPAD2, 0); + break; + } + } + base.OnAction(action); + } + + + public override bool Init() //bij het laden van MediaPortal + { + Log.Debug("Init Opera Mobile Launcher"); + if (UseButtonForwarding) + return Load(GUIGraphicsContext.Skin + @"\OperaMobile.xml"); + else + return true; + } + + #region ISetupForm Members + + // Returns the name of the plugin which is shown in the plugin menu + public string PluginName() + { + return PLUGIN_NAME; + } + + // Returns the description of the plugin is shown in the plugin menu + public string Description() + { + return "Starts Opera Mobile Emulator from MediaPortal"; + } + + // Returns the author of the plugin which is shown in the plugin menu + public string Author() + { + return "Dragy"; + } + + // show the setup dialog + public void ShowPlugin() + { + FormSettings frm = new FormSettings(); + frm.ShowDialog(); + } + + // Indicates whether plugin can be enabled/disabled + public bool CanEnable() + { + return true; + } + + // Get Windows-ID + public int GetWindowId() + { + // WindowID of windowplugin belonging to this setup + // enter your own unique code + return 156778; + } + + // Indicates if plugin is enabled by default; + public bool DefaultEnabled() + { + return true; + } + + // indicates if a plugin has it's own setup screen + public bool HasSetup() + { + return true; + } + + /// <summary> + /// If the plugin should have it's own button on the main menu of MediaPortal then it + /// should return true to this method, otherwise if it should not be on home + /// it should return false + /// </summary> + /// <param name="strButtonText">text the button should have</param> + /// <param name="strButtonImage">image for the button, or empty for default</param> + /// <param name="strButtonImageFocus">image for the button, or empty for default</param> + /// <param name="strPictureImage">subpicture for the button or empty for none</param> + /// <returns>true : plugin needs it's own button on home + /// false : plugin does not need it's own button on home</returns> + + public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) + { + strButtonText = "Opera Mobile"; + strButtonImage = String.Empty; + strButtonImageFocus = String.Empty; + strPictureImage = String.Empty; + return true; + } + + // With GetID it will be an window-plugin / otherwise a process-plugin + // Enter the id number here again + public override int GetID + { + get + { + return 156778; + } + + set + { + } + } + + #endregion + + } +} \ No newline at end of file Added: trunk/plugins/OperaMobileLauncher/Opera Mobile/OperaLauncher.cs.bak =================================================================== --- trunk/plugins/OperaMobileLauncher/Opera Mobile/OperaLauncher.cs.bak (rev 0) +++ trunk/plugins/OperaMobileLauncher/Opera Mobile/OperaLauncher.cs.bak 2012-02-14 20:21:46 UTC (rev 4451) @@ -0,0 +1,260 @@ +using System; +using System.Diagnostics; +using MediaPortal.GUI.Library; +using MediaPortal.Configuration; +using System.IO; +using System.Windows.Forms; +using System.Runtime.InteropServices; + +namespace OperaLauncher +{ + [PluginIcons("OperaLauncher.opera-logo.png", "OperaLauncher.opera-logo_disabled.png")] + + public class OperaLauncher : GUIWindow, ISetupForm + { + public const string PLUGIN_NAME = "Opera Mobile Launcher"; + public string Path; + public bool noFullscreen; + public bool TouchInferface; + public string Arguments; + public bool UseButtonForwarding; + + [DllImport("user32.dll")] + public static extern int FindWindow( + string lpClassName, // class name + string lpWindowName // window name + ); + + [DllImport("user32.dll")] + public static extern int SendMessage( + int hWnd, // handle to destination window + uint Msg, // message + int wParam, // first message parameter + int lParam // second message parameter + ); + + const int WM_KEYDOWN = 0x0100; + const int WM_KEYUP = 0x0101; + //const int WM_APPCOMMAND = 0x0319; + const int VK_F1 = 0x70; + const int VK_F2 = 0x71; + const int VK_NUMPAD0 = 0x60; + const int VK_NUMPAD1 = 0x61; + const int VK_NUMPAD2 = 0x62; + const int VK_NUMPAD3 = 0x63; + const int VK_NUMPAD4 = 0x64; + const int VK_NUMPAD5 = 0x65; + const int VK_NUMPAD6 = 0x66; + const int VK_NUMPAD7 = 0x67; + const int VK_NUMPAD8 = 0x68; + const int VK_NUMPAD9 = 0x69; + + ProcessStartInfo startInfo = new ProcessStartInfo(); + Process opera = new Process(); + public OperaLauncher() + { + using (MediaPortal.Profile.Settings xmlReader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + { + Path = xmlReader.GetValueAsString(OperaLauncher.PLUGIN_NAME, "Path", ""); + noFullscreen = xmlReader.GetValueAsBool(OperaLauncher.PLUGIN_NAME, "noFullscreen", false); + TouchInferface = xmlReader.GetValueAsBool(OperaLauncher.PLUGIN_NAME, "TouchInferface", false); + Arguments = xmlReader.GetValueAsString(OperaLauncher.PLUGIN_NAME, "Arguments", ""); + UseButtonForwarding = xmlReader.GetValueAsBool(OperaLauncher.PLUGIN_NAME, "UseButtonForwarding", true); + } + } + + protected override void OnPageLoad() + { + string strUrl = GUIPropertyManager.GetProperty("#browserlink"); + startOpera(strUrl); + + if(!UseButtonForwarding) + GUIWindowManager.ShowPreviousWindow(); + base.OnPageLoad(); + } + + protected override void OnPageDestroy(int newWindowId) + { + //close opera + opera.CloseMainWindow(); + } + + public void startOpera(string strUrl = null) + { + string arguments = ""; + if (!noFullscreen) + arguments += " -fullscreen"; + if (TouchInferface) + arguments += " -tabletui"; + else + arguments += " -notouchwithtouchevents"; + + arguments += " " + Arguments; + + opera.StartInfo.FileName = @Path; + opera.StartInfo.WorkingDirectory = Directory.GetParent(Path).FullName; + if (strUrl != null) + opera.StartInfo.Arguments = arguments + " -url " + strUrl; + else + opera.StartInfo.Arguments = arguments; + + try + { + opera.Start(); + } + catch (Exception ex) + { + Log.Error("Start Opera failed: " + ex.Message); + } + } + + + public override void OnAction(MediaPortal.GUI.Library.Action action) + { + if (UseButtonForwarding) + { + int WindowToFind = FindWindow("QWidget", null); + + switch (action.wID) + { + case MediaPortal.GUI.Library.Action.ActionType.ACTION_CONTEXT_MENU: + GUIPropertyManager.SetProperty("#keypressed", "Info"); + SendMessage(WindowToFind, WM_KEYDOWN, VK_F1, 0); + SendMessage(WindowToFind, WM_KEYUP, VK_F1, 0); + break; + + case MediaPortal.GUI.Library.Action.ActionType.ACTION_PREV_ITEM: + GUIPropertyManager.SetProperty("#keypressed", "Replay"); + SendMessage(WindowToFind, WM_KEYDOWN, VK_F2, 0); + SendMessage(WindowToFind, WM_KEYUP, VK_F2, 0); + break; + + case MediaPortal.GUI.Library.Action.ActionType.ACTION_PAGE_UP: + GUIPropertyManager.SetProperty("#keypressed", "Channel Up"); + SendMessage(WindowToFind, WM_KEYDOWN, VK_NUMPAD8, 0); + SendMessage(WindowToFind, WM_KEYUP, VK_NUMPAD8, 0); + break; + + case MediaPortal.GUI.Library.Action.ActionType.ACTION_PAGE_DOWN: + GUIPropertyManager.SetProperty("#keypressed", "Channel Down"); + SendMessage(WindowToFind, WM_KEYDOWN, VK_NUMPAD2, 0); + SendMessage(WindowToFind, WM_KEYUP, VK_NUMPAD2, 0); + break; + + case MediaPortal.GUI.Library.Action.ActionType.REMOTE_0: + GUIPropertyManager.SetProperty("#keypressed", "0"); + SendMessage(WindowToFind, WM_KEYDOWN, VK_NUMPAD0, 0); + SendMessage(WindowToFind, WM_KEYUP, VK_NUMPAD0, 0); + break; + case MediaPortal.GUI.Library.Action.ActionType.REMOTE_1: + GUIPropertyManager.SetProperty("#keypressed", "1"); + SendMessage(WindowToFind, WM_KEYDOWN, VK_NUMPAD1, 0); + SendMessage(WindowToFind, WM_KEYUP, VK_NUMPAD1, 0); + break; + } + } + base.OnAction(action); + } + + + public override bool Init() //bij het laden van MediaPortal + { + Log.Debug("Init Opera Mobile Launcher"); + if (UseButtonForwarding) + return Load(GUIGraphicsContext.Skin + @"\OperaMobile.xml")... [truncated message content] |