From: <fr...@us...> - 2007-02-02 17:35:39
|
Revision: 82 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=82&view=rev Author: framug Date: 2007-02-02 09:35:27 -0800 (Fri, 02 Feb 2007) Log Message: ----------- Add My Recipes Was removed from MP, check //fmu Added Paths: ----------- trunk/plugins/My Recipes/ trunk/plugins/My Recipes/CatReader.cs trunk/plugins/My Recipes/GUIRecipes.cs trunk/plugins/My Recipes/My Recipes.csproj trunk/plugins/My Recipes/My Recipes.sln trunk/plugins/My Recipes/My Recipes.suo trunk/plugins/My Recipes/Properties/ trunk/plugins/My Recipes/Properties/AssemblyInfo.cs trunk/plugins/My Recipes/Recipe.cs trunk/plugins/My Recipes/RecipeDatabase.cs trunk/plugins/My Recipes/RecipePrinter.cs trunk/plugins/My Recipes/RecipeReader.cs trunk/plugins/My Recipes/SetupForm.cs trunk/plugins/My Recipes/SetupForm.resx Added: trunk/plugins/My Recipes/CatReader.cs =================================================================== --- trunk/plugins/My Recipes/CatReader.cs (rev 0) +++ trunk/plugins/My Recipes/CatReader.cs 2007-02-02 17:35:27 UTC (rev 82) @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2005 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 + * + */ + +using System; +using System.Collections; +using System.IO; +using MediaPortal.GUI.Library; + +namespace GUIRecipes { + /// <summary> + /// Summary description for CatReader. + /// </summary> + public class CatReader { + + protected string cFileName; + + public int CatCount { + get { return catCount; } + } + + protected int catCount = 0; + + public CatReader( string fileName ) { + cFileName = fileName; + } + + public void GetCategories() { + StreamReader reader = new StreamReader( cFileName, System.Text.Encoding.Default ); + string line = reader.ReadLine(); + bool maincat=false; + bool sorts=false; + string content=""; + int num=0; + + while( line != null ) { + if (line.Trim().StartsWith( "#Main" )) { + maincat=true; + sorts=false; + line = reader.ReadLine(); + } + if (line.Trim().StartsWith( "#Sorts" )) { + sorts=true; + maincat=false; + line = reader.ReadLine(); + } + + string[] lines = line.Split( ';' ); + int l=0; + foreach( string lin in lines ) { + if (l==1) { + content=lin.Trim(); + l++; + } + if (l==0) { + num=Convert.ToInt16(lin); + l++; + } + } + if (maincat==true) { + catCount++; + RecipeDatabase.GetInstance().AddMainCat( content.TrimEnd(), num,0); + } + if (sorts==true) { + catCount++; + RecipeDatabase.GetInstance().AddMainCat( content.TrimEnd(), 0, num); + } + line = reader.ReadLine(); + } + reader.Close(); + } + } +} Added: trunk/plugins/My Recipes/GUIRecipes.cs =================================================================== --- trunk/plugins/My Recipes/GUIRecipes.cs (rev 0) +++ trunk/plugins/My Recipes/GUIRecipes.cs 2007-02-02 17:35:27 UTC (rev 82) @@ -0,0 +1,644 @@ +#region Copyright (C) 2005-2006 Team MediaPortal + +/* + * Copyright (C) 2005-2006 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +#region Usings +using System; +using System.Collections; +using System.Windows.Forms; +using MediaPortal.GUI.Library; +using MediaPortal.Dialogs; + +#endregion + +namespace GUIRecipes +{ + /// <summary> + /// Summary description for GUIRecipes. + /// </summary> + public class GUIRecipes : GUIWindow, ISetupForm, IShowPlugin + { + #region Private Enumerations + enum Controls + { + CONTROL_BACKBUTTON = 2, + CONTROL_SEARCH_TYP = 3, + CONTROL_SEARCH_TOG = 4, + CONTROL_SEARCH = 5, + CONTROL_FAVOR = 6, + CONTROL_DELETE = 7, + CONTROL_PRINT = 8, + CONTROL_SPIN = 9, + CONTROL_LIST = 10, + CONTROL_TEXTBOX = 11 + }; + #endregion + + #region Base variabeles + + Recipe rec = new Recipe(); + RecipePrinter rp = new RecipePrinter(); + string subcatstr = "";// contains actual subcategorie + string catstr = ""; // contains actual categorie + string titstr = ""; // contains actual title of recipe + string seastr = ""; // contains actual search string + bool search = false; // was search mode the last menu? + bool online = false; // online recipe update? + bool subcat = false; // show subcategories ? + + enum States + { + STATE_MAIN = 0, + STATE_CATEGORY = 1, + STATE_Recipe = 2, + STATE_SUB = 3, + STATE_FAVORITES = 4 + }; + + enum Search_Types + { + SEARCH_TITLE = 0, + SEARCH_Recipe = 1 + }; + + private States currentState = States.STATE_MAIN; + private Search_Types currentSearch = Search_Types.SEARCH_TITLE; + + #endregion + + #region Constructor + public GUIRecipes() + { + // + // TODO: Add constructor logic here + // + } + + #endregion + + #region ISetupForm + + public string PluginName() + { + return "My Recipes"; + } + + public string Description() + { + return "Browse your cooking recipes with MediaPortal"; + } + + public string Author() + { + return "Gucky62/Domi_fan"; + } + + public void ShowPlugin() + { + SetupForm form = new SetupForm(); + + form.ShowDialog(); + } + + public bool DefaultEnabled() + { + return false; + } + + public bool CanEnable() + { + return true; + } + + public bool HasSetup() + { + return true; + } + + public int GetWindowId() + { + return 750; + } + + /// <summary> + /// If the plugin should have its own button on the home screen 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 its own button on home + /// false : plugin does not need its own button on home</returns> + public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) + { + + strButtonText = GUILocalizeStrings.Get(10); + strButtonImage = ""; + strButtonImageFocus = ""; + strPictureImage = @"hover_my recipes.png"; + return true; + } + + #endregion + + #region IShowPlugin Members + + public bool ShowDefaultHome() + { + return false; + } + + #endregion + + #region Overides + /// <summary> + /// Return the id of this window + /// </summary> + public override int GetID + { + get { return 750; } + set { base.GetID = value; } + } + + /// <summary> + /// Gets called by the runtime when a new window has been created + /// Every window window should override this method and load itself by calling + /// the Load() method + /// </summary> + /// <returns></returns> + public override bool Init() + { + LoadSettings(); + return Load(GUIGraphicsContext.Skin + @"\myrecipes.xml"); + } + + public override void OnAction(Action action) + { + if (action.wID == Action.ActionType.ACTION_PREVIOUS_MENU) + { + GUIWindowManager.ShowPreviousWindow(); + return; + } + if (action.wID == Action.ActionType.ACTION_KEY_PRESSED) + { + if (action.m_key.KeyChar == 89 || action.m_key.KeyChar == 121) + { + GUIListItem item = GUIControl.GetSelectedListItem(GetID, (int)Controls.CONTROL_LIST); + if (item != null) + { + if (item.Label.Length > 1) RecipeDatabase.GetInstance().AddFavorite(item.Label); + } + } + return; + } + if (action.wID == Action.ActionType.ACTION_QUEUE_ITEM) // add recipe to favorites + { + if (currentState == States.STATE_Recipe) + { + GUIListItem item = GUIControl.GetSelectedListItem(GetID, (int)Controls.CONTROL_LIST); + if (item != null) + { + if (item.Label.Length > 1) RecipeDatabase.GetInstance().AddFavorite(item.Label); + } + } + return; + } + if (action.wID == Action.ActionType.ACTION_DELETE_ITEM) + { + GUIListItem item = GUIControl.GetSelectedListItem(GetID, (int)Controls.CONTROL_LIST); + if (item != null) + { + GUIDialogYesNo dlgYesNo = (GUIDialogYesNo)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_YES_NO); + if (null != dlgYesNo) + { + titstr = item.Label; + dlgYesNo.SetLine(1, ""); + dlgYesNo.SetLine(2, ""); + if (currentState == States.STATE_Recipe || currentState == States.STATE_CATEGORY) + { + dlgYesNo.SetHeading(GUILocalizeStrings.Get(2049)); + dlgYesNo.SetLine(1, titstr); + } + if (currentState == States.STATE_MAIN) + { + dlgYesNo.SetHeading(GUILocalizeStrings.Get(2050)); + dlgYesNo.SetLine(1, titstr); + } + if (currentState == States.STATE_FAVORITES) + { + dlgYesNo.SetHeading(GUILocalizeStrings.Get(933)); + dlgYesNo.SetLine(1, titstr); + } + dlgYesNo.DoModal(GetID); + + if (dlgYesNo.IsConfirmed) + { + switch (currentState) + { + case States.STATE_FAVORITES: + { + RecipeDatabase.GetInstance().DeleteFavorite(titstr); + ArrayList recipes = RecipeDatabase.GetInstance().GetRecipesForFavorites(); + UpDateList(recipes); + GUIControl.FocusControl(GetID, (int)Controls.CONTROL_BACKBUTTON); + currentState = States.STATE_FAVORITES; + UpdateButtons(); + } + break; + case States.STATE_CATEGORY: + case States.STATE_Recipe: + { + RecipeDatabase.GetInstance().DeleteRecipe(titstr); + currentState = States.STATE_CATEGORY; + UpdateButtons(); + ArrayList recipes = RecipeDatabase.GetInstance().GetRecipesForCategory(catstr); + UpDateList(recipes); + GUIControl.FocusControl(GetID, (int)Controls.CONTROL_BACKBUTTON); + } + break; + case States.STATE_MAIN: + { + } + break; + } + } + } + } + } + base.OnAction(action); + } + + public override bool OnMessage(GUIMessage message) + { + switch (message.Message) + { + case GUIMessage.MessageType.GUI_MSG_WINDOW_INIT: + base.OnMessage(message); + GUISpinControl cntlYieldInterval = GetControl((int)Controls.CONTROL_SPIN) as GUISpinControl; + if (cntlYieldInterval != null) + { + for (int i = 1; i <= 24; i++) cntlYieldInterval.AddLabel("", i); + cntlYieldInterval.Value = 1; + } + LoadAllCategories(); + currentState = States.STATE_MAIN; + UpdateButtons(); + return true; + case GUIMessage.MessageType.GUI_MSG_CLICKED: + int iControl = message.SenderControlId; + if (iControl == (int)Controls.CONTROL_SPIN) + { // Yield Calculator + if (currentState == States.STATE_Recipe) + { + GUISpinControl cntlYieldInt = GetControl((int)Controls.CONTROL_SPIN) as GUISpinControl; + int iInterval = (cntlYieldInt.Value) + 1; + rec.CYield = iInterval; + ShowDetails(rec); + UpdateButtons(); + } + } + else if (iControl == (int)Controls.CONTROL_SEARCH_TYP) + { // Select type of search + GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_ITEM_SELECTED, GetID, 0, iControl, 0, 0, null); + OnMessage(msg); + switch (currentSearch) + { + case Search_Types.SEARCH_Recipe: // search by title + currentSearch = Search_Types.SEARCH_TITLE; + break; + case Search_Types.SEARCH_TITLE: // search by recipe + currentSearch = Search_Types.SEARCH_Recipe; + break; + } + UpdateButtons(); + GUIControl.FocusControl(GetID, iControl); + } + else if (iControl == (int)Controls.CONTROL_LIST) // Click on Control_List ? + { + GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_ITEM_SELECTED, GetID, 0, iControl, 0, 0, null); + OnMessage(msg); + int iItem = (int)msg.Param1; + int iAction = (int)message.Param1; + if (iAction == (int)Action.ActionType.ACTION_SELECT_ITEM && iItem != -1) + { + GUIListItem item = GUIControl.GetSelectedListItem(GetID, (int)Controls.CONTROL_LIST); + if (currentState == States.STATE_CATEGORY || currentState == States.STATE_FAVORITES) // show recipe details + { + if (item.Label != GUILocalizeStrings.Get(2054)) + { + rec = RecipeDatabase.GetInstance().GetRecipe(item.Label); + titstr = item.Label; + GUISpinControl cntlYieldInt = GetControl((int)Controls.CONTROL_SPIN) as GUISpinControl; + cntlYieldInt.Value = rec.CYield; + ShowDetails(rec); + GUIControl.FocusControl(GetID, (int)Controls.CONTROL_BACKBUTTON); + currentState = States.STATE_Recipe; + UpdateButtons(); + } + } + else if (currentState == States.STATE_MAIN) + { // show category + // show list of items + ArrayList recipes; + if (subcat == true) + { + recipes = RecipeDatabase.GetInstance().GetSubsForCategory(item.Label); + currentState = States.STATE_SUB; + subcatstr = item.Label; + } + else + { + recipes = RecipeDatabase.GetInstance().GetRecipesForCategory(item.Label); + currentState = States.STATE_CATEGORY; + catstr = item.Label; + } + UpDateList(recipes); + GUIControl.FocusControl(GetID, (int)Controls.CONTROL_BACKBUTTON); + UpdateButtons(); + } + else if (currentState == States.STATE_SUB) + { // show category + // show list of items + ArrayList recipes = RecipeDatabase.GetInstance().GetRecipesForCategory(item.Label); + currentState = States.STATE_CATEGORY; + catstr = item.Label; + UpDateList(recipes); + GUIControl.FocusControl(GetID, (int)Controls.CONTROL_BACKBUTTON); + UpdateButtons(); + } + } + } + else if (iControl == (int)Controls.CONTROL_BACKBUTTON) + { // click on Backbutton + if (currentState == States.STATE_Recipe) + { // back from recipe detail + currentState = States.STATE_CATEGORY; + UpdateButtons(); + if (search == true) + { + byte styp = 0; + if (currentSearch == Search_Types.SEARCH_Recipe) styp = 0; + if (currentSearch == Search_Types.SEARCH_TITLE) styp = 1; + ArrayList recipes = RecipeDatabase.GetInstance().SearchRecipes(seastr, styp); + UpDateList(recipes); + } + else + { + ArrayList recipes = RecipeDatabase.GetInstance().GetRecipesForCategory(catstr); + UpDateList(recipes); + } + GUIControl.FocusControl(GetID, (int)Controls.CONTROL_BACKBUTTON); + } + else if (currentState == States.STATE_CATEGORY || currentState == States.STATE_FAVORITES) + { + search = false; + if (subcat == true) + { + currentState = States.STATE_SUB; + // show list of items + ArrayList recipes = RecipeDatabase.GetInstance().GetSubsForCategory(subcatstr); + UpDateList(recipes); + GUIControl.FocusControl(GetID, (int)Controls.CONTROL_BACKBUTTON); + UpdateButtons(); + } + else + { + currentState = States.STATE_MAIN; + LoadAllCategories(); + } + UpdateButtons(); + GUIControl.FocusControl(GetID, (int)Controls.CONTROL_LIST); + } + else if (currentState == States.STATE_SUB) + { + currentState = States.STATE_MAIN; + LoadAllCategories(); + UpdateButtons(); + GUIControl.FocusControl(GetID, (int)Controls.CONTROL_LIST); + } + } + else if (iControl == (int)Controls.CONTROL_SEARCH) // click on Search Button + { + int activeWindow = (int)GUIWindowManager.ActiveWindow; + + //fmu VirtualSearchKeyboard keyBoard = (VirtualSearchKeyboard)GUIWindowManager.GetWindow(1001); + //fmu keyBoard.Text = ""; + //fmu keyBoard.Reset(); + //fmu keyBoard.TextChanged += new MediaPortal.Dialogs.VirtualSearchKeyboard.TextChangedEventHandler(keyboard_TextChanged); // add the event handler + //fmu keyBoard.DoModal(activeWindow); // show it... + //fmu keyBoard.TextChanged -= new MediaPortal.Dialogs.VirtualSearchKeyboard.TextChangedEventHandler(keyboard_TextChanged); // remove the handler + //fmu seastr = keyBoard.Text; + + VirtualKeyboard keyboard = (VirtualKeyboard)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_VIRTUAL_KEYBOARD); + keyboard.Text = ""; + keyboard.Reset(); + keyboard.TextChanged += new MediaPortal.Dialogs.VirtualKeyboard.TextChangedEventHandler(keyboard_TextChanged); // add the event handler + keyboard.DoModal(activeWindow); // show it... + keyboard.TextChanged -= new MediaPortal.Dialogs.VirtualKeyboard.TextChangedEventHandler(keyboard_TextChanged); // remove the handler + seastr = keyboard.Text; + + GUIListItem item = GUIControl.GetSelectedListItem(GetID, (int)Controls.CONTROL_LIST); + byte styp = 0; + if (currentSearch == Search_Types.SEARCH_Recipe) styp = 0; + if (currentSearch == Search_Types.SEARCH_TITLE) styp = 1; + search = true; + ArrayList recipes = RecipeDatabase.GetInstance().SearchRecipes(seastr, styp); + UpDateList(recipes); + currentState = States.STATE_CATEGORY; + UpdateButtons(); + } + else if (iControl == (int)Controls.CONTROL_FAVOR) // click on Favorites + { + // show list of items + GUIListItem item = GUIControl.GetSelectedListItem(GetID, (int)Controls.CONTROL_LIST); + ArrayList recipes = RecipeDatabase.GetInstance().GetRecipesForFavorites(); + UpDateList(recipes); + GUIControl.FocusControl(GetID, (int)Controls.CONTROL_BACKBUTTON); + currentState = States.STATE_FAVORITES; + UpdateButtons(); + } + else if (iControl == (int)Controls.CONTROL_DELETE) // click on delete button + { + Action action = new Action(Action.ActionType.ACTION_DELETE_ITEM, 0, 0); + OnAction(action); + } + else if (iControl == (int)Controls.CONTROL_PRINT) + { // click on Print button + if (currentState == States.STATE_Recipe) + { + rp.printRecipe(rec, catstr, titstr); + GUIControl.FocusControl(GetID, (int)Controls.CONTROL_BACKBUTTON); + } + } + break; + } + return base.OnMessage(message); + } + #endregion + + #region Private Methods + //loads list control with new values + void UpDateList(ArrayList recipes) + { + GUIControl.ClearControl(GetID, (int)Controls.CONTROL_LIST); + if (recipes.Count > 0) + { + foreach (Recipe r in recipes) + { + GUIListItem gli = new GUIListItem(r.Title); + GUIControl.AddListItemControl(GetID, (int)Controls.CONTROL_LIST, gli); + } + } + else + { + GUIListItem gli = new GUIListItem(GUILocalizeStrings.Get(2054)); + GUIControl.AddListItemControl(GetID, (int)Controls.CONTROL_LIST, gli); + } + string strObjects = String.Format("{0} {1}", recipes.Count, GUILocalizeStrings.Get(632)); + GUIPropertyManager.SetProperty("#itemcount", strObjects); + } + + + void UpdateButtons() + { + string strLine = ""; + switch (currentSearch) + { + case Search_Types.SEARCH_Recipe: + strLine = GUILocalizeStrings.Get(2052); + break; + case Search_Types.SEARCH_TITLE: + strLine = GUILocalizeStrings.Get(2051); + break; + } + GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_SEARCH_TYP, strLine); + switch (currentState) + { + case States.STATE_MAIN: + GUIControl.DisableControl(GetID, (int)Controls.CONTROL_TEXTBOX); + GUIControl.DisableControl(GetID, (int)Controls.CONTROL_SPIN); + GUIControl.HideControl(GetID, (int)Controls.CONTROL_TEXTBOX); + GUIControl.HideControl(GetID, (int)Controls.CONTROL_SPIN); + GUIControl.EnableControl(GetID, (int)Controls.CONTROL_LIST); + GUIControl.ShowControl(GetID, (int)Controls.CONTROL_LIST); + GUIControl.FocusControl(GetID, (int)Controls.CONTROL_LIST); + GUIControl.DisableControl(GetID, (int)Controls.CONTROL_DELETE); + GUIControl.DisableControl(GetID, (int)Controls.CONTROL_BACKBUTTON); + GUIControl.DisableControl(GetID, (int)Controls.CONTROL_PRINT); + break; + case States.STATE_FAVORITES: + case States.STATE_CATEGORY: + GUIControl.DisableControl(GetID, (int)Controls.CONTROL_TEXTBOX); + GUIControl.DisableControl(GetID, (int)Controls.CONTROL_SPIN); + GUIControl.HideControl(GetID, (int)Controls.CONTROL_TEXTBOX); + GUIControl.HideControl(GetID, (int)Controls.CONTROL_SPIN); + GUIControl.EnableControl(GetID, (int)Controls.CONTROL_LIST); + GUIControl.ShowControl(GetID, (int)Controls.CONTROL_LIST); + GUIControl.FocusControl(GetID, (int)Controls.CONTROL_LIST); + GUIControl.DisableControl(GetID, (int)Controls.CONTROL_DELETE); + GUIControl.EnableControl(GetID, (int)Controls.CONTROL_BACKBUTTON); + GUIControl.DisableControl(GetID, (int)Controls.CONTROL_PRINT); + break; + case States.STATE_SUB: + GUIControl.DisableControl(GetID, (int)Controls.CONTROL_TEXTBOX); + GUIControl.DisableControl(GetID, (int)Controls.CONTROL_SPIN); + GUIControl.HideControl(GetID, (int)Controls.CONTROL_TEXTBOX); + GUIControl.HideControl(GetID, (int)Controls.CONTROL_SPIN); + GUIControl.EnableControl(GetID, (int)Controls.CONTROL_LIST); + GUIControl.ShowControl(GetID, (int)Controls.CONTROL_LIST); + GUIControl.FocusControl(GetID, (int)Controls.CONTROL_LIST); + GUIControl.DisableControl(GetID, (int)Controls.CONTROL_DELETE); + GUIControl.EnableControl(GetID, (int)Controls.CONTROL_BACKBUTTON); + GUIControl.DisableControl(GetID, (int)Controls.CONTROL_PRINT); + break; + case States.STATE_Recipe: + GUIControl.HideControl(GetID, (int)Controls.CONTROL_LIST); + GUIControl.DisableControl(GetID, (int)Controls.CONTROL_LIST); + GUIControl.EnableControl(GetID, (int)Controls.CONTROL_BACKBUTTON); + GUIControl.EnableControl(GetID, (int)Controls.CONTROL_TEXTBOX); + GUIControl.EnableControl(GetID, (int)Controls.CONTROL_SPIN); + GUIControl.ShowControl(GetID, (int)Controls.CONTROL_TEXTBOX); + GUIControl.ShowControl(GetID, (int)Controls.CONTROL_SPIN); + GUIControl.EnableControl(GetID, (int)Controls.CONTROL_DELETE); + GUIControl.EnableControl(GetID, (int)Controls.CONTROL_BACKBUTTON); + GUIControl.EnableControl(GetID, (int)Controls.CONTROL_PRINT); + break; + } + } + + /// <summary> + /// Loads my status settings from the profile xml. + /// </summary> + /// + private void LoadSettings() + { + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("MediaPortal.xml")) + { + subcat = xmlreader.GetValueAsBool("recipe", "subcats", false); + online = xmlreader.GetValueAsBool("recipe", "online", false); + } + } + + private void ShowDetails(Recipe rec) // show recipe directions + { + GUITextControl control = (GUITextControl)this.GetControl((int)Controls.CONTROL_TEXTBOX); + control.OnMessage(new GUIMessage(GUIMessage.MessageType.GUI_MSG_LABEL_RESET, GetID, 0, (int)Controls.CONTROL_TEXTBOX, 0, 0, null)); + + GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_TEXTBOX, rec.ToString()); + GUIPropertyManager.SetProperty("#itemcount", " "); + } + + void keyboard_TextChanged(int kindOfSearch, string data) + { + // + } + + private void LoadAllCategories() // show all categories + { + ArrayList recipes; + GUIControl.ClearControl(GetID, (int)Controls.CONTROL_LIST); + if (subcat == true) + { + recipes = RecipeDatabase.GetInstance().GetMainCategories(); + } + else + { + recipes = RecipeDatabase.GetInstance().GetCategories(); + } + foreach (string cat in recipes) + { + GUIListItem gli = new GUIListItem(cat); + GUIControl.AddListItemControl(GetID, (int)Controls.CONTROL_LIST, gli); + } + string strObjects = String.Format("{0} {1}", recipes.Count, GUILocalizeStrings.Get(632)); + GUIPropertyManager.SetProperty("#itemcount", strObjects); + } + #endregion + + + + } +} Added: trunk/plugins/My Recipes/My Recipes.csproj =================================================================== --- trunk/plugins/My Recipes/My Recipes.csproj (rev 0) +++ trunk/plugins/My Recipes/My Recipes.csproj 2007-02-02 17:35:27 UTC (rev 82) @@ -0,0 +1,79 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>8.0.50727</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{44E2881F-457F-4CD9-969F-ECC0981FA0B2}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>GUIRecipes</RootNamespace> + <AssemblyName>My Recipes</AssemblyName> + </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.2589.32413, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\MediaPortal\Core\bin\Release\Core.dll</HintPath> + </Reference> + <Reference Include="Databases, Version=1.0.2589.32414, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\MediaPortal\Databases\bin\Release\Databases.dll</HintPath> + </Reference> + <Reference Include="Dialogs, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\MediaPortal\Dialogs\bin\Release\Dialogs.dll</HintPath> + </Reference> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml" /> + <Reference Include="Utils, Version=1.0.2589.32412, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\MediaPortal\Utils\bin\Release\Utils.dll</HintPath> + </Reference> + </ItemGroup> + <ItemGroup> + <Compile Include="CatReader.cs" /> + <Compile Include="GUIRecipes.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="Recipe.cs" /> + <Compile Include="RecipeDatabase.cs" /> + <Compile Include="RecipePrinter.cs" /> + <Compile Include="RecipeReader.cs" /> + <Compile Include="SetupForm.cs"> + <SubType>Form</SubType> + </Compile> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="SetupForm.resx"> + <DependentUpon>SetupForm.cs</DependentUpon> + <SubType>Designer</SubType> + </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/My Recipes/My Recipes.sln =================================================================== --- trunk/plugins/My Recipes/My Recipes.sln (rev 0) +++ trunk/plugins/My Recipes/My Recipes.sln 2007-02-02 17:35:27 UTC (rev 82) @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual C# Express 2005 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "My Recipes", "My Recipes.csproj", "{44E2881F-457F-4CD9-969F-ECC0981FA0B2}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {44E2881F-457F-4CD9-969F-ECC0981FA0B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {44E2881F-457F-4CD9-969F-ECC0981FA0B2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {44E2881F-457F-4CD9-969F-ECC0981FA0B2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {44E2881F-457F-4CD9-969F-ECC0981FA0B2}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal Added: trunk/plugins/My Recipes/My Recipes.suo =================================================================== (Binary files differ) Property changes on: trunk/plugins/My Recipes/My Recipes.suo ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/My Recipes/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/My Recipes/Properties/AssemblyInfo.cs (rev 0) +++ trunk/plugins/My Recipes/Properties/AssemblyInfo.cs 2007-02-02 17:35:27 UTC (rev 82) @@ -0,0 +1,35 @@ +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("My Recipes")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("My Recipes")] +[assembly: AssemblyCopyright("Copyright © 2006")] +[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("4c9ea42f-aeab-4c44-ab0d-af3adc79d8a5")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] Added: trunk/plugins/My Recipes/Recipe.cs =================================================================== --- trunk/plugins/My Recipes/Recipe.cs (rev 0) +++ trunk/plugins/My Recipes/Recipe.cs 2007-02-02 17:35:27 UTC (rev 82) @@ -0,0 +1,222 @@ +/* + * Copyright (C) 2005 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 + * + */ + +using System; +using System.Collections; +using MediaPortal.GUI.Library; +namespace GUIRecipes +{ + /// <summary> + /// Summary description for Recipe. + /// </summary> + public class Recipe { + string mId; + string mTitle; + int mCYield; + ArrayList mCategories; + string mYield; + ArrayList mIngredients = new ArrayList(); + ArrayList mLot = new ArrayList(); + ArrayList mUnit = new ArrayList(); + ArrayList mRemarks = new ArrayList(); + string mDirections; + + public Recipe(){ + // + // TODO: Add constructor logic here + // + } + + public string Title { + get{ return mTitle; } + set{ mTitle = value; } + } + + public string Id { + get { return mId; } + set { mId = value; } + } + + public ArrayList Categories { + get{ return mCategories; } + set{ mCategories = value; } + } + + public void SetCategories( string Categories) { + mCategories = new ArrayList( Categories.Split( ',' ) ); + } + + public string Yield { + get{ return mYield; } + set{ mYield = value; } + } + + public int CYield { + get{ return mCYield; } + set{ mCYield = value; } + } + + public string Directions { + get{ return mDirections; } + set{ mDirections = value; } + } + + public ArrayList Ingredients { + get{ return mIngredients; } + set{ mIngredients = value; } + } + + public ArrayList Lot { + get{ return mLot; } + set{ mLot = value; } + } + + public ArrayList Unit { + get{ return mUnit; } + set{ mUnit = value; } + } + + public ArrayList Remarks { + get{ return mRemarks; } + set{ mRemarks = value; } + } + + public void AddIngredient( string ing ) { + Ingredients.Add( ing ); + } + + public void AddLot( string lot ) { + Lot.Add( lot ); + } + + public void AddUnit( string unit ) { + Unit.Add( unit ); + } + + public void AddRemarks( string rem ) { + Remarks.Add( rem ); + } + + public override string ToString() + { + int sunit=0; + double dsunit=0.0; + double dilot=0.0; + string s1 = ""; + string stunit = ""; + try { + if (CYield <= 1) { + stunit=Yield; + } else { + stunit=Yield.Trim(); + string[] s2 = stunit.Split( ' ' ); + dsunit=Convert.ToDouble(s2[0]); + stunit=Convert.ToString(CYield); + } + } + catch (Exception ) { + stunit=Yield; + dsunit=1.0; + } + string retval = String.Format("{0}: {1}\n{2}: {3}\n\n{4}:\n", + GUILocalizeStrings.Get(2006),Title, + GUILocalizeStrings.Get(2007),stunit, + GUILocalizeStrings.Get(2008)); + + for( int i=0; i < Ingredients.Count; i++ ) { + sunit=Convert.ToInt16(Unit[i]); + if (sunit > 10) { + stunit=GUILocalizeStrings.Get(sunit)+" "; + } else { + stunit=""; + } + s1=(string)Lot[i]; + s1=s1.Trim(); + if (s1!="") { + try { + if (CYield > 1) { + string SLot=(string)Lot[i]; + SLot=SLot.Trim(); + if (SLot.IndexOf("/",0) > 0) { + int l = SLot.IndexOf("/",0); + string b = SLot.Substring(l-1,3); + double x=0.0; + double y=0.0; + if (l>2) { + int k=SLot.IndexOf(" ",0); + y=Convert.ToDouble(SLot.Substring(0,k)); + } + switch (b) { + case "1/2" : // 1/2 + x=(y+0.5)/dsunit; + x=x*(double)CYield; + break; + case "1/4" : // 1/4 + x=(y+0.25)/dsunit; + x=x*(double)CYield; + break; + case "1/8" : // 1/8 + x=(y+0.125)/dsunit; + x=x*(double)CYield; + break; + case "3/8" : // 3/8 + x=(y+0.375)/dsunit; + x=x*(double)CYield; + break; + case "3/4" : // 3/4 + x=(y+0.75)/dsunit; + x=x*(double)CYield; + break; + } + s1=String.Format("{0:0.##} ",x); + } else { + dilot=Convert.ToDouble(Lot[i]); + dilot=dilot/dsunit; + dilot=dilot*(double)CYield; + s1=String.Format("{0:0.##} ",dilot); + } + } else s1=s1+" "; + } + catch (Exception ) { + s1=(string)Lot[i]; + s1=s1+" "; + } + } + if (i+1 < Ingredients.Count) { + if (Convert.ToInt16(Unit[i+1]) == 1) { // Line Break with "-" in first char + retval = retval + " " + s1 + stunit + Ingredients[i]+ Ingredients[i+1]+"\n"; + i++; + } else { + if (sunit == 2) { // Subtitle + retval = retval + "\n" + Ingredients[i]+ "\n";; + } else { // Normal Ingredients + retval = retval + " " + s1 + stunit + Ingredients[i]+ "\n";; + } + } + } else { + retval = retval + " " + s1 + stunit + Ingredients[i]+ "\n";; + } + } + retval = retval + String.Format("\n{0}:\n{1}",GUILocalizeStrings.Get(2009), Directions) ; + return retval; + } + } +} Added: trunk/plugins/My Recipes/RecipeDatabase.cs =================================================================== --- trunk/plugins/My Recipes/RecipeDatabase.cs (rev 0) +++ trunk/plugins/My Recipes/RecipeDatabase.cs 2007-02-02 17:35:27 UTC (rev 82) @@ -0,0 +1,385 @@ +/* + * Copyright (C) 2005 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 + * + */ + +using System.Collections; +using System.Windows.Forms; +using SQLite.NET; +using MediaPortal.GUI.Library; +using System; + +namespace GUIRecipes +{ + /// <summary> + /// Summary description for RecipeDatabase. + /// </summary> + public class RecipeDatabase + { + public enum M_Keys { + VERSION = 1, + ONLINE = 2, + O_NAME = 3, + O_PASS = 4, + SUB_CAT = 5 + } + + private int m_key=0; + private string m_content; + private int m_var1=0; + private int m_var2=0; + + public int M_Key { + get { return m_key; } + set { m_key = value; } + } + + public string M_Content { + get { return m_content; } + set { m_content = value; } + } + + public int M_Var1 { + get { return m_var1; } + set { m_var1 = value; } + } + + public int M_Var2 { + get { return m_var2; } + set { m_var2 = value; } + } + + private static RecipeDatabase instance=null; + private SQLiteClient m_db; + private bool dbExists; + + private RecipeDatabase() { + try { + // Open database + try + { + System.IO.Directory.CreateDirectory("database"); + } + catch(Exception){} + dbExists = System.IO.File.Exists( @"database\RecipeDatabaseV3.db3" ); + m_db = new SQLiteClient(@"database\RecipeDatabaseV3.db3"); + + MediaPortal.Database.DatabaseUtility.SetPragmas(m_db); + if( !dbExists ){ + CreateTables(); + } + } catch (SQLiteException ex){ + Console.Write("Recipedatabase exception err:{0} stack:{1}", ex.Message,ex.StackTrace); + } + } + + public static RecipeDatabase GetInstance() { + if( instance == null ) { + instance = new RecipeDatabase(); + } + return instance; + } + + private void CreateTables(){ + if( m_db == null ){ + return; + } + m_db.Execute("CREATE TABLE Recipe ( Recipe_ID integer primary key, TITLE text, YIELD text, DIRECTIONS text, VOTE text, VERSION integer)\n"); + m_db.Execute("CREATE TABLE INGREDIENT ( INGREDIENT_ID integer primary key, Recipe_ID integer, TITLE text, LOT text, UNIT text)\n"); + m_db.Execute("CREATE TABLE CATEGORY ( CATEGORY_ID integer primary key, TITLE text)\n" ); + m_db.Execute("CREATE TABLE Recipe_CATEGORY( Recipe_CATEGORY_ID integer primary key, CATEGORY_ID integer, Recipe_ID integer, TITLE text)\n" ); + m_db.Execute("CREATE TABLE FAVORITE ( CATEGORY_ID integer primary key, TITLE text)\n" ); + m_db.Execute("CREATE TABLE MAIN_CATEGORY ( CATEGORY_ID integer primary key, TITLE text, NUM integer, SUB integer)\n" ); + m_db.Execute("CREATE TABLE MAINTENANCE ( ID integer primary key, KEY integer, CONTENT text, VAR1 integer, VAR2 integer)\n" ); + m_db.Execute("CREATE TABLE DELETE ( ID integer primary key, STAT integer)\n" ); + AddMaintenance((int)M_Keys.ONLINE, "Init", 0,0); + AddMaintenance((int)M_Keys.SUB_CAT, "Init", 0,0); + AddMaintenance((int)M_Keys.VERSION, "Version", 0,3); + } + + private void BuildMaintenance(ArrayList row) { + if (row!=null) { + IEnumerator en = row.GetEnumerator(); + en.MoveNext(); + string Id = (string) en.Current; + en.MoveNext(); + M_Key = (int) en.Current; + en.MoveNext(); + M_Content=(string)en.Current; + en.MoveNext(); + M_Var1=(int)en.Current; + en.MoveNext(); + M_Var2=(int)en.Current; + } + } + + public bool CheckKey(int key) { + // look to exist key + string rSQL = String.Format("SELECT * FROM MAINTENANCE WHERE KEY = '{0}'",key); + SQLiteResultSet rs = m_db.Execute( rSQL ); + BuildMaintenance((ArrayList)rs.RowsList[0]); + if (M_Key==key) return true; + else return false; + } + + public void AddMainCat(string content, int num, int sub) { + string rSQL = String.Format( "INSERT INTO MAIN_CATEGORY VALUES ( null, '{0}', '{1}', '{2}' )", content, num, sub); + SQLiteResultSet rs = m_db.Execute( rSQL ); + } + + public void AddMaintenance(int key, string content, int var1, int var2) { + // look to exist key + M_Key=0; + string rSQL = String.Format("SELECT * FROM MAINTENANCE WHERE KEY = '{0}'",key.ToString() ); + SQLiteResultSet rs = m_db.Execute( rSQL ); + BuildMaintenance((ArrayList)rs.RowsList[0]); + + rSQL = String.Format( "INSERT INTO MAINTENANCE VALUES ( null, '{0}', '{1}', '{2}', {3} )", key.ToString(),content,var1,var2); + rs = m_db.Execute( rSQL ); + } + + public void AddRecipe( Recipe r ) // add recipe to database + { + if (r.Categories.Count==0) return; + + string rSql = String.Format( "INSERT INTO Recipe VALUES ( null, '{0}', '{1}', '{2}', {3}, {4} )", + RemoveInvalidChars( r.Title ), + RemoveInvalidChars( r.Yield ), + RemoveInvalidChars( r.Directions ), + "0","1"); + m_db.Execute( "BEGIN" ); + m_db.Execute( rSql ); + int rId = m_db.LastInsertID(); + AddCategories( r, rId ); + for (int i=0; i<r.Ingredients.Count; i++){ + string iSql = String.Format( "INSERT INTO INGREDIENT VALUES ( null, '{0}', '{1}', '{2}', '{3}')", rId, RemoveInvalidChars( (string)r.Ingredients[i] ),RemoveInvalidChars((string)r.Lot[i]),RemoveInvalidChars((string)r.Unit[i])); + m_db.Execute( iSql ); + } + m_db.Execute( "END" ); + } + + private void AddCategories(Recipe r, int id) // add category to database + { + ArrayList cat = r.Categories; + foreach( string category in cat ){ + string cSQL = String.Format( "Select * from CATEGORY where title = '{0}'", + RemoveInvalidChars( category.Trim() ) ); + SQLiteResultSet rs = m_db.Execute( cSQL ); + string cId = ""; + + if( rs.RowsList.Count > 0 ){ + // this category already exists + cId = rs.GetField( 0, 0 ); + } else { + // the category doesn't exist, so we need to add it + string iSQL = String.Format( "INSERT INTO CATEGORY VALUES ( null, '{0}')", + RemoveInvalidChars( category.Trim() )); + m_db.Execute( iSQL ); + cId = m_db.LastInsertID().ToString(); + } + + string crSQL = String.Format( "INSERT INTO Recipe_CATEGORY VALUES( null, {0}, {1}, '{2}' )", cId, id.ToString(),RemoveInvalidChars( r.Title ) ); + m_db.Execute( crSQL ); + } + } + + public Recipe GetRecipe( string title ) // get a recipe from database + { + string rSQL = String.Format("SELECT * FROM Recipe WHERE TITLE = '{0}'",title ); + SQLiteResultSet rs = m_db.Execute( rSQL ); + return BuildRecipe((ArrayList)rs.RowsList[0]); + } + + private Recipe BuildRecipe(ArrayList row){ + string stunit = ""; + + if (row==null) return null; + Recipe rec = new Recipe(); + IEnumerator en = row.GetEnumerator(); + en.MoveNext(); + rec.Id = (string) en.Current; + en.MoveNext(); + rec.Title = (string) en.Current; + en.MoveNext(); + + stunit=(string)en.Current; + stunit=stunit.Trim()+" "; + string[] s2 = stunit.Split( ' ' ); + + rec.Yield = stunit; + rec.CYield = Convert.ToInt16(s2[0]); + en.MoveNext(); + rec.Directions = (string)en.Current; + rec.Ingredients = BuildIngredients( rec.Id ); + rec.Lot = BuildLot( rec.Id ); + rec.Unit = BuildUnit( rec.Id ); + return rec; + } + + private Recipe BuildCategorie(ArrayList row){ + if (row==null) return null; + Recipe rec = new Recipe(); + IEnumerator en = row.GetEnumerator(); + en.MoveNext(); + rec.Id = (string) en.Current; + en.MoveNext(); + rec.Title = (string) en.Current; + return rec; + } + + private ArrayList BuildIngredients(string id){ + string aSQL = String.Format( "SELECT TITLE FROM INGREDIENT WHERE Recipe_ID = {0}", id ); + return m_db.Execute( aSQL ).GetColumn( 0 ); + } + + private ArrayList BuildLot(string id){ + string aSQL = String.Format( "SELECT LOT FROM INGREDIENT WHERE Recipe_ID = {0}", id ); + return m_db.Execute( aSQL ).GetColumn( 0 ); + } + + private ArrayList BuildUnit(string id){ + string aSQL = String.Format( "SELECT UNIT FROM INGREDIENT WHERE Recipe_ID = {0}", id ); + return m_db.Execute( aSQL ).GetColumn( 0 ); + } + + public ArrayList GetCategories(){ + string cSQL = "SELECT * FROM CATEGORY ORDER BY TITLE"; + SQLiteResultSet rs = m_db.Execute( cSQL ); + return rs.GetColumn( 1 ); + } + + public ArrayList GetMainCategories(){ + string cSQL = "SELECT * FROM MAIN_CATEGORY WHERE SUB = '0'"; + SQLiteResultSet rs = m_db.Execute( cSQL ); + return rs.GetColumn( 1 ); + } + + public void AddFavorite(string id ) { + string cSQL = String.Format( "INSERT INTO FAVORITE VALUES ( null, '{0}')",id); + SQLiteResultSet rs = m_db.Execute( cSQL ); + return; + } + + public void DeleteFavorite(string id ) + { + string cSQL = String.Format( "DELETE FROM FAVORITE WHERE TITLE = '{0}'", id ); + SQLiteResultSet rs = m_db.Execute( cSQL ); + return; + } + + public void DeleteRecipe(string id ) // delete a recipe from database + { + string cSQL = String.Format( "SELECT * FROM Recipe WHERE TITLE = '{0}'", id ); + SQLiteResultSet rs = m_db.Execute( cSQL ); + string recipeID = (string) rs.GetField(0,0); + + cSQL = String.Format( "DELETE FROM Recipe WHERE Recipe_ID = '{0}'", recipeID ); + rs = m_db.Execute( cSQL ); + cSQL = String.Format( "DELETE FROM Recipe_CATEGORY WHERE TITLE = '{0}'", id ); + rs = m_db.Execute( cSQL ); + cSQL = String.Format( "DELETE FROM FAVORITE WHERE TITLE = '{0}'", id ); + rs = m_db.Execute( cSQL ); + cSQL = String.Format( "DELETE FROM INGREDIENT WHERE Recipe_ID = '{0}'", recipeID); + rs = m_db.Execute( cSQL ); + return; + } + + public ArrayList SearchRecipes(string text,byte typ) //search recipe in database + { + string stext="%"+RemoveInvalidChars(text)+"%"; + string rSQL=""; + ArrayList recipes = new ArrayList(); + if (typ==1) {// Search in Title + rSQL = String.Format("SELECT recipe_id,title FROM Recipe WHERE TITLE LIKE '{0}'",stext); + } + else { // Search in all + rSQL = String.Format("SELECT recipe_id,title FROM Recipe WHERE TITLE LIKE '{0}' OR DIRECTIONS LIKE '{0}'",stext); + } + SQLiteResultSet rs = m_db.Execute( rSQL ); + + foreach( ArrayList row in rs.RowsList ) { + recipes.Add( BuildCategorie( row )); + } + return recipes; + } + + public ArrayList GetRecipesForFavorites() + { + ArrayList recipes = new ArrayList(); + string sql = String.Format( "Select * from favorite" ); + SQLiteResultSet rs = m_db.Execute( sql ); + foreach( ArrayList row in rs.RowsList ) + { + recipes.Add( BuildCategorie( row )); + } + return recipes; + } + + public ArrayList GetSubsForCategory( string category ) { + ArrayList recipes = new ArrayList(); + string sql = String.Format("SELECT * FROM MAIN_CATEGORY WHERE TITLE = '{0}'",category); + SQLiteResultSet rs = m_db.Execute( sql ); + string categoryID = (string) rs.GetField(0,2); + string sql2 = String.Format( "Select * from main_category where sub = {0}", categoryID ); + rs = m_db.Execute( sql2 ); + foreach( ArrayList row in rs.RowsList ) { + recipes.Add( BuildCategorie( row )); + } + return recipes; + } + + public ArrayList GetRecipesForCategory( string category ) + { + ArrayList recipes = new ArrayList(); + string sql = String.Format( "Select * from category where title = '{0}'", category ); + SQLiteResultSet rs = m_db.Execute( sql ); + + string categoryID = rs.GetField(0,0).ToString(); + string sql2 = String.Format( "Select recipe_id,title from recipe_category where category_id = {0}", categoryID ); + rs = m_db.Execute( sql2 ); + foreach( ArrayList row in rs.RowsList ) + { + recipes.Add( BuildCategorie( row )); + } + return recipes; + } + + string RemoveInvalidChars( string strTxt) + { + if( strTxt == null ) return ""; + string strReturn=""; + for (int i=0; i < (int)strTxt.Length; ++i) + { + char k=strTxt[i]; + int z=(int) k; + if (z<32 || z>255) k=' '; + if (k=='^' || k=='~' || k=='#') k=' '; + if (k=='\'') + { + strReturn += "'"; + } + strReturn += k; + } + if (strReturn=="") + strReturn=GUILocalizeStrings.Get(2014); + strTxt=strReturn.Trim(); + return strTxt; + } + } +} Added: trunk/plugins/My Recipes/RecipePrinter.cs =================================================================== --- trunk/plugins/My Recipes/RecipePrinter.cs (rev 0) +++ trunk/plugins/My Recipes/RecipePrinter.cs 2007-02-02 17:35:27 UTC (rev 82) @@ -0,0 +1,193 @@ +/* + * Copyright (C) 2005 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 + * + */ + +using System; +using System.Collections; +using System.ComponentModel; +using System.Drawing; +using System.Drawing.Printing; +using System.IO; +using MediaPortal.GUI.Library; + +namespace GUIRecipes +{ + + public class RecipePrinter + { + private string cat; + private bool nextpage; // Is there a second Page to print? + private Font printFont; + private Font printBFont; + private Font printHFont; + private string Snextpage; + private Recipe recP = new Recipe(); + + public RecipePrinter() : base() + { + } + + // The Click event is raised when the user clicks the Print button. + public void printRecipe(Recipe rec, string scat, string stit) + { + cat=scat; + recP = rec; + nextpage = false; + Snextpage=""; + printFont = new Font("Arial", 11); + printHFont = new Font("Arial Black",13); + printBFont = new Font("Arial Black",10); + + PrintDocument pd = new PrintDocument(); + pd.PrintPage += new PrintPageEventHandler(this.pd_PrintPage); + pd.Print(); + if (nextpage==true) + { + PrintDocument pd2 = new PrintDocument(); + pd2.PrintPage += new PrintPageEventHandler(this.pd_PrintPage); + pd2.Print(); + } + } + + // The PrintPage event is raised for each page to be printed. + private void pd_PrintPage(object sender, PrintPageEventArgs ev) + { + float linesPerPage = 0; + float yPos = 0; + int count = 0; + int start = 0; + int end = 0; + int mx = 0; + int len = 80; + + float leftMargin = ev.MarginBounds.Left; + float topMargin = ev.MarginBounds.Top; + string contents = recP.ToString(); + + // Calculate the number of lines per page. + linesPerPage = ev.MarginBounds.Height / printFont.GetHeight(ev.Graphics); + + string[] lines = contents.Split( '\n' ); + string pline = ""; + string lline = ""; + + // Create pen. + Pen blackPen = new Pen(Color.Black, 2); + ev.Graphics.DrawRectangle(blackPen,ev.MarginBounds.Left-50,ev.MarginBounds.Top-70,ev.MarginBounds.Width+50,21); + ev.Graphics.DrawRectangle(blackPen,ev.MarginBounds.Left-50,ev.MarginBounds.Top-49,ev.MarginBounds.Width+50,33); + ev.Graphics.DrawString(GUILocalizeStrings.Get(2053)+": "+cat, printBFont, Brushes.Black,leftMargin-30, ev.MarginBounds.Top-69, new StringFormat()); + ev.Graphics.DrawString(lines[0].Substring(8), printHFont, Brushes.Black,leftMargin-30, ev.MarginBounds.Top-47, new StringFormat()); + + // Print each line of the file. + foreach( string line in lines ) + { + if (nextpage==true) + { + if (Snextpage.Length > 1) + { + lline = Snextpage; + start = 0; + end = 0; + mx = len; + for( int i=0; i < Snextpage.Length; i++) + { + if (lline[i] == ' ') end=i; + if (i == mx) + { + pline = Snextpage.Substring(start,end-start); + mx = end + len; + start = end + 1; + pline = " " + pline; + yPos = topMargin + (count * printFont.GetHeight(ev.Graphics)); + ev.Graphics.DrawString(pline, printFont, Brushes.Black,leftMargin, yPos, new StringFormat()); + count++; + if (count >= linesPerPage) break; + } + } + pline = Snextpage.Substring(start); + pline = " " + pline; + yPos = topMargin + (count * printFont.GetHeight(ev.Graphics)); + ev.Graphics.DrawString(pline, printFont, Brushes.Black,leftMargin, yPos, new StringFormat()); + count++; + break; + } + } + if (line.Length > len && nextpage==false) + { + lline=line; + start = 0; + end = 0; + mx=len; + for( int i=0; i<line.Length; i++) + { + if (lline[i] == ' ') end=i; + if (i==mx) + { + pline=line.Substring(start,end-start); + mx=end+len; + start=end+1; + pline=" "+pline; + yPos = topMargin + (count * printFont.GetHeight(ev.Graphics)); + ev.Graphics.DrawString(pline, printFont, Brushes.Black,leftMargin, yPos, new StringFormat()); + count++; + if (count >= linesPerPage) + { + Snextpage=line.Substring(start); + nextpage=true; + break; + } + } + } + if (nextpage==false) + { + pline=line.Substring(start); + pline=" "+pline; + yPos = topMargin + (count * printFont.GetHeight(ev.Graphics)); + ev.Graphics.DrawString(pline, printFont, Brushes.Black,leftMargin, yPos, new StringFormat()); + count++; + } + else + { + break; + } + } + else + { + if (nextpage==false) + { + yPos = topMargin + (count * printFont.GetHeight(ev.Graphics)); + ev.Graphics.DrawString(line, printFont, Brushes.Black,leftMargin, yPos, new StringFormat()); + count++; + if (count >= linesPerPage) + { + nextpage=true; + break; + } + } + } + if (count >= linesPerPage) + { + nextpage=true; + break; + } + } + } + } +} Added: trunk/plugins/My Recipes/RecipeReader.cs ======================... [truncated message content] |
From: <an...@us...> - 2007-02-03 03:10:17
|
Revision: 83 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=83&view=rev Author: and-81 Date: 2007-02-02 19:10:09 -0800 (Fri, 02 Feb 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MCEReplacement/MceIrApi.cs trunk/plugins/MCEReplacementTray/MceIrApi.cs trunk/plugins/TV3MceBlaster/MceIrApi.cs Modified: trunk/plugins/MCEReplacement/MceIrApi.cs =================================================================== --- trunk/plugins/MCEReplacement/MceIrApi.cs 2007-02-02 17:35:27 UTC (rev 82) +++ trunk/plugins/MCEReplacement/MceIrApi.cs 2007-02-03 03:10:09 UTC (rev 83) @@ -78,6 +78,7 @@ public enum MceButtons { Custom = -1, + None = 0, TV_Power = 0x7b9a, Blue = 0x7ba1, Yellow = 0x7ba2, Modified: trunk/plugins/MCEReplacementTray/MceIrApi.cs =================================================================== --- trunk/plugins/MCEReplacementTray/MceIrApi.cs 2007-02-02 17:35:27 UTC (rev 82) +++ trunk/plugins/MCEReplacementTray/MceIrApi.cs 2007-02-03 03:10:09 UTC (rev 83) @@ -78,6 +78,7 @@ public enum MceButtons { Custom = -1, + None = 0, TV_Power = 0x7b9a, Blue = 0x7ba1, Yellow = 0x7ba2, Modified: trunk/plugins/TV3MceBlaster/MceIrApi.cs =================================================================== --- trunk/plugins/TV3MceBlaster/MceIrApi.cs 2007-02-02 17:35:27 UTC (rev 82) +++ trunk/plugins/TV3MceBlaster/MceIrApi.cs 2007-02-03 03:10:09 UTC (rev 83) @@ -78,6 +78,7 @@ public enum MceButtons { Custom = -1, + None = 0, TV_Power = 0x7b9a, Blue = 0x7ba1, Yellow = 0x7ba2, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fr...@us...> - 2007-02-04 08:06:18
|
Revision: 90 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=90&view=rev Author: framug Date: 2007-02-04 00:06:16 -0800 (Sun, 04 Feb 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/My Explorer/My Explorer.csproj trunk/plugins/My Status/My Status.csproj trunk/plugins/My clickmania/GUIClickMania.csproj Removed Paths: ------------- trunk/plugins/MultiShortcut/MultiButton.suo trunk/plugins/My Recipes/My Recipes.suo trunk/plugins/file explorer/Source/Explorer.suo trunk/plugins/file explorer/Source/bin/ Deleted: trunk/plugins/MultiShortcut/MultiButton.suo =================================================================== (Binary files differ) Modified: trunk/plugins/My Explorer/My Explorer.csproj =================================================================== --- trunk/plugins/My Explorer/My Explorer.csproj 2007-02-04 07:51:19 UTC (rev 89) +++ trunk/plugins/My Explorer/My Explorer.csproj 2007-02-04 08:06:16 UTC (rev 90) @@ -28,22 +28,22 @@ <WarningLevel>4</WarningLevel> </PropertyGroup> <ItemGroup> - <Reference Include="Core, Version=1.0.2582.33626, Culture=neutral, processorArchitecture=MSIL"> + <Reference Include="Core, Version=1.0.2590.13808, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>D:\sources mp\Core\bin\Release\Core.dll</HintPath> + <HintPath>..\..\MediaPortal\Core\bin\Release\Core.dll</HintPath> </Reference> <Reference Include="Dialogs, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>D:\sources mp\WindowPlugins\bin\Release\Dialogs.dll</HintPath> + <HintPath>..\..\MediaPortal\Dialogs\bin\Release\Dialogs.dll</HintPath> </Reference> <Reference Include="System" /> <Reference Include="System.Data" /> <Reference Include="System.Drawing" /> <Reference Include="System.Windows.Forms" /> <Reference Include="System.Xml" /> - <Reference Include="Utils, Version=1.0.2582.33625, Culture=neutral, processorArchitecture=MSIL"> + <Reference Include="Utils, Version=1.0.2590.13806, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>D:\sources mp\Core\bin\Release\Utils.dll</HintPath> + <HintPath>..\..\MediaPortal\Utils\bin\Release\Utils.dll</HintPath> </Reference> </ItemGroup> <ItemGroup> Deleted: trunk/plugins/My Recipes/My Recipes.suo =================================================================== (Binary files differ) Modified: trunk/plugins/My Status/My Status.csproj =================================================================== --- trunk/plugins/My Status/My Status.csproj 2007-02-04 07:51:19 UTC (rev 89) +++ trunk/plugins/My Status/My Status.csproj 2007-02-04 08:06:16 UTC (rev 90) @@ -28,27 +28,24 @@ <WarningLevel>4</WarningLevel> </PropertyGroup> <ItemGroup> - <Reference Include="Core, Version=1.0.2582.36060, Culture=neutral, processorArchitecture=MSIL"> + <Reference Include="Core, Version=1.0.2590.13808, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>D:\sources mp\xbmc\bin\Release\Core.dll</HintPath> + <HintPath>..\..\MediaPortal\Core\bin\Release\Core.dll</HintPath> </Reference> <Reference Include="Dialogs, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>D:\sources mp\xbmc\bin\Release\plugins\windows\Dialogs.dll</HintPath> + <HintPath>..\..\MediaPortal\Dialogs\bin\Release\Dialogs.dll</HintPath> </Reference> - <Reference Include="mbm5, Version=1.0.1778.42739, Culture=neutral"> - <SpecificVersion>False</SpecificVersion> - <HintPath>.\mbm5.dll</HintPath> - </Reference> + <Reference Include="mbm5, Version=1.0.1778.42739, Culture=neutral" /> <Reference Include="System" /> <Reference Include="System.Data" /> <Reference Include="System.Drawing" /> <Reference Include="System.Management" /> <Reference Include="System.Windows.Forms" /> <Reference Include="System.Xml" /> - <Reference Include="Utils, Version=1.0.2582.36059, Culture=neutral, processorArchitecture=MSIL"> + <Reference Include="Utils, Version=1.0.2590.13806, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>D:\sources mp\xbmc\bin\Release\Utils.dll</HintPath> + <HintPath>..\..\MediaPortal\Utils\bin\Release\Utils.dll</HintPath> </Reference> </ItemGroup> <ItemGroup> Modified: trunk/plugins/My clickmania/GUIClickMania.csproj =================================================================== --- trunk/plugins/My clickmania/GUIClickMania.csproj 2007-02-04 07:51:19 UTC (rev 89) +++ trunk/plugins/My clickmania/GUIClickMania.csproj 2007-02-04 08:06:16 UTC (rev 90) @@ -74,13 +74,13 @@ <ErrorReport>prompt</ErrorReport> </PropertyGroup> <ItemGroup> - <Reference Include="Core, Version=1.0.2585.31249, Culture=neutral, processorArchitecture=MSIL"> + <Reference Include="Core, Version=1.0.2590.13808, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>D:\sources mp\Core\bin\Release\Core.dll</HintPath> + <HintPath>..\..\MediaPortal\Core\bin\Release\Core.dll</HintPath> </Reference> <Reference Include="Dialogs, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>D:\sources mp\WindowPlugins\bin\Release\Dialogs.dll</HintPath> + <HintPath>..\..\MediaPortal\Dialogs\bin\Release\Dialogs.dll</HintPath> </Reference> <Reference Include="Microsoft.DirectX"> <Name>Microsoft.DirectX</Name> @@ -107,9 +107,9 @@ <Reference Include="System.Xml"> <Name>System.XML</Name> </Reference> - <Reference Include="Utils, Version=1.0.2585.31248, Culture=neutral, processorArchitecture=MSIL"> + <Reference Include="Utils, Version=1.0.2590.13806, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>D:\sources mp\Utils\bin\Release\Utils.dll</HintPath> + <HintPath>..\..\MediaPortal\Utils\bin\Release\Utils.dll</HintPath> </Reference> </ItemGroup> <ItemGroup> Deleted: trunk/plugins/file explorer/Source/Explorer.suo =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-02-05 12:45:15
|
Revision: 93 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=93&view=rev Author: and-81 Date: 2007-02-05 04:45:13 -0800 (Mon, 05 Feb 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MCEReplacement/MCEReplacement.cs trunk/plugins/MCEReplacement/MappedEvent.cs trunk/plugins/MCEReplacement/MceIrApi.cs trunk/plugins/MCEReplacementTray/MceIrApi.cs trunk/plugins/TV3MceBlaster/MceIrApi.cs Modified: trunk/plugins/MCEReplacement/MCEReplacement.cs =================================================================== --- trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-02-04 12:36:28 UTC (rev 92) +++ trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-02-05 12:45:13 UTC (rev 93) @@ -636,7 +636,7 @@ ShowNotifyDialog("Mouse Mode", notifyMessage, 2); if (LogVerbose) - Log.Debug("MCEReplacement: {0}", notifyMessage); + Log.Info("MCEReplacement: {0}", notifyMessage); return true; } @@ -861,7 +861,7 @@ string setName = MultiMaps[_multiMappingSet]; if (LogVerbose) - Log.Debug("MCEReplacement: Multi-Mapping has changed to \"{0}\"", setName); + Log.Info("MCEReplacement: Multi-Mapping has changed to \"{0}\"", setName); ShowNotifyDialog("Multi-Mapping", setName, 2); } Modified: trunk/plugins/MCEReplacement/MappedEvent.cs =================================================================== --- trunk/plugins/MCEReplacement/MappedEvent.cs 2007-02-04 12:36:28 UTC (rev 92) +++ trunk/plugins/MCEReplacement/MappedEvent.cs 2007-02-05 12:45:13 UTC (rev 93) @@ -281,7 +281,14 @@ /// </summary> /// <param name="eventType">Event to act on</param> /// <param name="command">Command to execute when event occurs</param> - public MappedEvent(Events eventType, string command) : this(eventType, "", "", command) { } + public MappedEvent(Events eventType, string command) + { + _matchParam = false; + _eventType = eventType; + _param = ""; + _paramValue = ""; + _command = command; + } /// <summary> /// Used to run the Event Mapper Modified: trunk/plugins/MCEReplacement/MceIrApi.cs =================================================================== --- trunk/plugins/MCEReplacement/MceIrApi.cs 2007-02-04 12:36:28 UTC (rev 92) +++ trunk/plugins/MCEReplacement/MceIrApi.cs 2007-02-05 12:45:13 UTC (rev 93) @@ -1,5 +1,6 @@ using System; using System.Runtime.InteropServices; +using System.Threading; namespace MediaPortal.Plugins { @@ -208,7 +209,7 @@ { _inUse = true; bool returnValue = MceIrPlaybackFromFile(fileHandle); - System.Threading.Thread.Sleep(250); + Thread.Sleep(250); return returnValue; } @@ -235,6 +236,7 @@ _inUse = true; _isSuspended = false; MceIrResume(); + Thread.Sleep(250); } } Modified: trunk/plugins/MCEReplacementTray/MceIrApi.cs =================================================================== --- trunk/plugins/MCEReplacementTray/MceIrApi.cs 2007-02-04 12:36:28 UTC (rev 92) +++ trunk/plugins/MCEReplacementTray/MceIrApi.cs 2007-02-05 12:45:13 UTC (rev 93) @@ -1,5 +1,6 @@ using System; using System.Runtime.InteropServices; +using System.Threading; namespace MCEReplacementTray { @@ -208,7 +209,7 @@ { _inUse = true; bool returnValue = MceIrPlaybackFromFile(fileHandle); - System.Threading.Thread.Sleep(250); + Thread.Sleep(250); return returnValue; } @@ -235,6 +236,7 @@ _inUse = true; _isSuspended = false; MceIrResume(); + Thread.Sleep(250); } } Modified: trunk/plugins/TV3MceBlaster/MceIrApi.cs =================================================================== --- trunk/plugins/TV3MceBlaster/MceIrApi.cs 2007-02-04 12:36:28 UTC (rev 92) +++ trunk/plugins/TV3MceBlaster/MceIrApi.cs 2007-02-05 12:45:13 UTC (rev 93) @@ -1,5 +1,6 @@ using System; using System.Runtime.InteropServices; +using System.Threading; namespace TvEngine { @@ -208,7 +209,7 @@ { _inUse = true; bool returnValue = MceIrPlaybackFromFile(fileHandle); - System.Threading.Thread.Sleep(250); + Thread.Sleep(250); return returnValue; } @@ -235,6 +236,7 @@ _inUse = true; _isSuspended = false; MceIrResume(); + Thread.Sleep(250); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ove...@us...> - 2007-02-06 21:49:44
|
Revision: 98 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=98&view=rev Author: overture Date: 2007-02-06 13:49:35 -0800 (Tue, 06 Feb 2007) Log Message: ----------- Added Paths: ----------- trunk/plugins/WWMP/ trunk/plugins/WWMP/AssemblyInfo.cs trunk/plugins/WWMP/MyIPTVsetup.cs trunk/plugins/WWMP/MyIPTVsetup.resx trunk/plugins/WWMP/WWMP.csproj trunk/plugins/WWMP/WWMP.sln trunk/plugins/WWMP/WWMPgui.cs trunk/plugins/WWMP/WWMPworker.cs trunk/plugins/WWMP/bin/ trunk/plugins/WWMP/bin/Debug/ trunk/plugins/WWMP/bin/Debug/AxInterop.WMPLib.dll trunk/plugins/WWMP/bin/Debug/Core.DLL trunk/plugins/WWMP/bin/Debug/Dialogs.DLL trunk/plugins/WWMP/bin/Debug/DirectShowLib.dll trunk/plugins/WWMP/bin/Debug/ICSharpCode.SharpZipLib.dll trunk/plugins/WWMP/bin/Debug/Interop.WMPLib.dll trunk/plugins/WWMP/bin/Debug/MediaPortal.Support.dll trunk/plugins/WWMP/bin/Debug/WWMP.dll trunk/plugins/WWMP/bin/Debug/WWMP.pdb trunk/plugins/WWMP/bin/Debug/edtftpnet-1.2.2.dll trunk/plugins/WWMP/bin/Release/ trunk/plugins/WWMP/bin/Release/AxInterop.WMPLib.dll trunk/plugins/WWMP/bin/Release/Core.DLL trunk/plugins/WWMP/bin/Release/Dialogs.DLL trunk/plugins/WWMP/bin/Release/DirectShowLib.dll trunk/plugins/WWMP/bin/Release/ICSharpCode.SharpZipLib.dll trunk/plugins/WWMP/bin/Release/Interop.WMPLib.dll trunk/plugins/WWMP/bin/Release/MediaPortal.Support.dll trunk/plugins/WWMP/bin/Release/WWMP.dll trunk/plugins/WWMP/bin/Release/edtftpnet-1.2.2.dll trunk/plugins/WWMP/obj/ trunk/plugins/WWMP/obj/Debug/ trunk/plugins/WWMP/obj/Debug/MePoTrial.csproj.GenerateResource.Cache trunk/plugins/WWMP/obj/Debug/MePoTrial.dll trunk/plugins/WWMP/obj/Debug/MePoTrial.pdb trunk/plugins/WWMP/obj/Debug/MediaPortal.GUI.WorldWideMediaProject.MyIPTVsetup.resources trunk/plugins/WWMP/obj/Debug/WWMP.csproj.GenerateResource.Cache trunk/plugins/WWMP/obj/Debug/WWMP.dll trunk/plugins/WWMP/obj/Debug/WWMP.pdb trunk/plugins/WWMP/obj/MePoTrial.csproj.FileList.txt trunk/plugins/WWMP/obj/Release/ trunk/plugins/WWMP/obj/Release/MediaPortal.GUI.WorldWideMediaProject.MyIPTVsetup.resources trunk/plugins/WWMP/obj/Release/WWMP.csproj.GenerateResource.Cache trunk/plugins/WWMP/obj/Release/WWMP.dll trunk/plugins/WWMP/obj/WWMP.csproj.FileList.txt Added: trunk/plugins/WWMP/AssemblyInfo.cs =================================================================== --- trunk/plugins/WWMP/AssemblyInfo.cs (rev 0) +++ trunk/plugins/WWMP/AssemblyInfo.cs 2007-02-06 21:49:35 UTC (rev 98) @@ -0,0 +1,27 @@ +using System.Reflection; +using System.Runtime.CompilerServices; + +// Information about this assembly is defined by the following +// attributes. +// +// change them to the information which is associated with the assembly +// you compile. + +[assembly: AssemblyTitle("")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// The assembly version has following format : +// +// Major.Minor.Build.Revision +// +// You can specify all values by your own or you can build default build and revision +// numbers with the '*' character (the default): + +[assembly: AssemblyVersion("1.0.*")] + Added: trunk/plugins/WWMP/MyIPTVsetup.cs =================================================================== --- trunk/plugins/WWMP/MyIPTVsetup.cs (rev 0) +++ trunk/plugins/WWMP/MyIPTVsetup.cs 2007-02-06 21:49:35 UTC (rev 98) @@ -0,0 +1,397 @@ +#region Copyright (C) 2005-2006 Team MediaPortal + +/* + * Copyright (C) 2005-2006 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.Drawing; +using System.Windows.Forms; +using System.Xml; +using MediaPortal.GUI.Library; + +namespace MediaPortal.GUI.WorldWideMediaProject +{ + /// <summary> + /// Description of MyIPTVsetup. + /// </summary> + public class MyIPTVsetup : System.Windows.Forms.Form + { + private System.ComponentModel.Container components = null; + private string sPath; + + public MyIPTVsetup() + { + InitializeComponent(); + string sFilePath = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName; + sPath = sFilePath.Substring(0,sFilePath.LastIndexOf(@"\")); + } + + /// <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 Forms Designer generated code + /// <summary> + /// This method is required for Windows Forms designer support. + /// Do not change the method contents inside the source code editor. The Forms designer might + /// not be able to load this method if it was changed manually. + /// </summary> + private void InitializeComponent() + { + this.grpBoxUserInfo = new System.Windows.Forms.GroupBox(); + this.txtURL = new System.Windows.Forms.TextBox(); + this.label3 = new System.Windows.Forms.Label(); + this.grpBoxConnectInfo = new System.Windows.Forms.GroupBox(); + this.chkBoxUseDefaultProxy = new System.Windows.Forms.CheckBox(); + this.txtProxyPort = new System.Windows.Forms.TextBox(); + this.label7 = new System.Windows.Forms.Label(); + this.txtProxyIPAddress = new System.Windows.Forms.TextBox(); + this.label6 = new System.Windows.Forms.Label(); + this.txtProxyPass = new System.Windows.Forms.TextBox(); + this.label5 = new System.Windows.Forms.Label(); + this.chkBoxUseProxy = new System.Windows.Forms.CheckBox(); + this.txtProxyUser = new System.Windows.Forms.TextBox(); + this.label4 = new System.Windows.Forms.Label(); + this.btnCancel = new System.Windows.Forms.Button(); + this.btnOK = new System.Windows.Forms.Button(); + this.grpBoxUserInfo.SuspendLayout(); + this.grpBoxConnectInfo.SuspendLayout(); + this.SuspendLayout(); + // + // grpBoxUserInfo + // + this.grpBoxUserInfo.Controls.Add(this.txtURL); + this.grpBoxUserInfo.Controls.Add(this.label3); + this.grpBoxUserInfo.Location = new System.Drawing.Point(12, 12); + this.grpBoxUserInfo.Name = "grpBoxUserInfo"; + this.grpBoxUserInfo.Size = new System.Drawing.Size(660, 55); + this.grpBoxUserInfo.TabIndex = 0; + this.grpBoxUserInfo.TabStop = false; + this.grpBoxUserInfo.Text = "worldwidemediaproject.com User Information"; + this.grpBoxUserInfo.UseCompatibleTextRendering = true; + // + // txtURL + // + this.txtURL.Location = new System.Drawing.Point(139, 19); + this.txtURL.Name = "txtURL"; + this.txtURL.Size = new System.Drawing.Size(473, 20); + this.txtURL.TabIndex = 5; + // + // label3 + // + this.label3.Location = new System.Drawing.Point(33, 16); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(100, 23); + this.label3.TabIndex = 4; + this.label3.Text = "URL Link"; + this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.label3.UseCompatibleTextRendering = true; + // + // grpBoxConnectInfo + // + this.grpBoxConnectInfo.Controls.Add(this.chkBoxUseDefaultProxy); + this.grpBoxConnectInfo.Controls.Add(this.txtProxyPort); + this.grpBoxConnectInfo.Controls.Add(this.label7); + this.grpBoxConnectInfo.Controls.Add(this.txtProxyIPAddress); + this.grpBoxConnectInfo.Controls.Add(this.label6); + this.grpBoxConnectInfo.Controls.Add(this.txtProxyPass); + this.grpBoxConnectInfo.Controls.Add(this.label5); + this.grpBoxConnectInfo.Controls.Add(this.chkBoxUseProxy); + this.grpBoxConnectInfo.Controls.Add(this.txtProxyUser); + this.grpBoxConnectInfo.Controls.Add(this.label4); + this.grpBoxConnectInfo.Location = new System.Drawing.Point(12, 73); + this.grpBoxConnectInfo.Name = "grpBoxConnectInfo"; + this.grpBoxConnectInfo.Size = new System.Drawing.Size(660, 170); + this.grpBoxConnectInfo.TabIndex = 1; + this.grpBoxConnectInfo.TabStop = false; + this.grpBoxConnectInfo.Text = "Internet Connection Information"; + this.grpBoxConnectInfo.UseCompatibleTextRendering = true; + // + // chkBoxUseDefaultProxy + // + this.chkBoxUseDefaultProxy.Enabled = false; + this.chkBoxUseDefaultProxy.Location = new System.Drawing.Point(69, 64); + this.chkBoxUseDefaultProxy.Name = "chkBoxUseDefaultProxy"; + this.chkBoxUseDefaultProxy.Size = new System.Drawing.Size(242, 24); + this.chkBoxUseDefaultProxy.TabIndex = 9; + this.chkBoxUseDefaultProxy.Text = "Use Default Proxy Authentication?"; + this.chkBoxUseDefaultProxy.UseCompatibleTextRendering = true; + this.chkBoxUseDefaultProxy.UseVisualStyleBackColor = true; + this.chkBoxUseDefaultProxy.CheckedChanged += new System.EventHandler(this.ChkBoxUseDefaultProxyCheckedChanged); + // + // txtProxyPort + // + this.txtProxyPort.Enabled = false; + this.txtProxyPort.Location = new System.Drawing.Point(490, 120); + this.txtProxyPort.Name = "txtProxyPort"; + this.txtProxyPort.Size = new System.Drawing.Size(49, 20); + this.txtProxyPort.TabIndex = 8; + // + // label7 + // + this.label7.Location = new System.Drawing.Point(384, 120); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(100, 23); + this.label7.TabIndex = 7; + this.label7.Text = "Port"; + this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.label7.UseCompatibleTextRendering = true; + // + // txtProxyIPAddress + // + this.txtProxyIPAddress.Enabled = false; + this.txtProxyIPAddress.Location = new System.Drawing.Point(490, 94); + this.txtProxyIPAddress.Name = "txtProxyIPAddress"; + this.txtProxyIPAddress.Size = new System.Drawing.Size(100, 20); + this.txtProxyIPAddress.TabIndex = 6; + // + // label6 + // + this.label6.Location = new System.Drawing.Point(384, 94); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(100, 23); + this.label6.TabIndex = 5; + this.label6.Text = "IP Address"; + this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.label6.UseCompatibleTextRendering = true; + // + // txtProxyPass + // + this.txtProxyPass.Enabled = false; + this.txtProxyPass.Location = new System.Drawing.Point(175, 120); + this.txtProxyPass.Name = "txtProxyPass"; + this.txtProxyPass.Size = new System.Drawing.Size(100, 20); + this.txtProxyPass.TabIndex = 4; + // + // label5 + // + this.label5.Location = new System.Drawing.Point(69, 120); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(100, 23); + this.label5.TabIndex = 3; + this.label5.Text = "Password"; + this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.label5.UseCompatibleTextRendering = true; + // + // chkBoxUseProxy + // + this.chkBoxUseProxy.Location = new System.Drawing.Point(33, 28); + this.chkBoxUseProxy.Name = "chkBoxUseProxy"; + this.chkBoxUseProxy.Size = new System.Drawing.Size(136, 24); + this.chkBoxUseProxy.TabIndex = 2; + this.chkBoxUseProxy.Text = "Use a Proxy Server?"; + this.chkBoxUseProxy.UseCompatibleTextRendering = true; + this.chkBoxUseProxy.UseVisualStyleBackColor = true; + this.chkBoxUseProxy.CheckedChanged += new System.EventHandler(this.ChkBoxUseProxyCheckedChanged); + // + // txtProxyUser + // + this.txtProxyUser.Enabled = false; + this.txtProxyUser.Location = new System.Drawing.Point(175, 94); + this.txtProxyUser.Name = "txtProxyUser"; + this.txtProxyUser.Size = new System.Drawing.Size(100, 20); + this.txtProxyUser.TabIndex = 1; + // + // label4 + // + this.label4.Location = new System.Drawing.Point(69, 94); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(100, 23); + this.label4.TabIndex = 0; + this.label4.Text = "Username"; + this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.label4.UseCompatibleTextRendering = true; + // + // btnCancel + // + this.btnCancel.Location = new System.Drawing.Point(518, 249); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size(75, 25); + this.btnCancel.TabIndex = 2; + this.btnCancel.Text = "Cancel"; + this.btnCancel.TextAlign = System.Drawing.ContentAlignment.TopCenter; + this.btnCancel.UseCompatibleTextRendering = true; + this.btnCancel.UseVisualStyleBackColor = true; + this.btnCancel.Click += new System.EventHandler(this.BtnCancelClick); + // + // btnOK + // + this.btnOK.Location = new System.Drawing.Point(599, 249); + this.btnOK.Name = "btnOK"; + this.btnOK.Size = new System.Drawing.Size(75, 25); + this.btnOK.TabIndex = 3; + this.btnOK.Text = "OK"; + this.btnOK.TextAlign = System.Drawing.ContentAlignment.TopCenter; + this.btnOK.UseCompatibleTextRendering = true; + this.btnOK.UseVisualStyleBackColor = true; + this.btnOK.Click += new System.EventHandler(this.BtnOKClick); + // + // MyIPTVsetup + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 14F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(686, 277); + this.Controls.Add(this.btnOK); + this.Controls.Add(this.btnCancel); + this.Controls.Add(this.grpBoxConnectInfo); + this.Controls.Add(this.grpBoxUserInfo); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.Name = "MyIPTVsetup"; + this.Text = "MyIPTVsetup"; + this.Load += new System.EventHandler(this.MyIPTVsetupLoad); + this.grpBoxUserInfo.ResumeLayout(false); + this.grpBoxUserInfo.PerformLayout(); + this.grpBoxConnectInfo.ResumeLayout(false); + this.grpBoxConnectInfo.PerformLayout(); + this.ResumeLayout(false); + } + private System.Windows.Forms.Button btnOK; + private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.TextBox txtProxyUser; + private System.Windows.Forms.CheckBox chkBoxUseProxy; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.TextBox txtProxyPass; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.TextBox txtProxyIPAddress; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.TextBox txtProxyPort; + private System.Windows.Forms.CheckBox chkBoxUseDefaultProxy; + private System.Windows.Forms.GroupBox grpBoxConnectInfo; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.TextBox txtURL; + private System.Windows.Forms.GroupBox grpBoxUserInfo; + #endregion + + + + void ChkBoxUseProxyCheckedChanged(object sender, System.EventArgs e) + { + if(chkBoxUseProxy.Checked==true) + { + chkBoxUseDefaultProxy.Checked = true; + chkBoxUseDefaultProxy.Enabled = true; + txtProxyIPAddress.Enabled = true; + txtProxyPort.Enabled = true; + } + else + { + chkBoxUseDefaultProxy.Checked = false; + chkBoxUseDefaultProxy.Enabled = false; + txtProxyIPAddress.Enabled = false; + txtProxyPort.Enabled = false; + txtProxyUser.Enabled = false; + txtProxyPass.Enabled = false; + } + + } + + void ChkBoxUseDefaultProxyCheckedChanged(object sender, System.EventArgs e) + { + if(chkBoxUseDefaultProxy.Checked==false) + { + txtProxyUser.Enabled = true; + txtProxyPass.Enabled = true; + } + else + { + txtProxyUser.Enabled = false; + txtProxyPass.Enabled = false; + } + } + + void MyIPTVsetupLoad(object sender, System.EventArgs e) + { + XmlDocument xmld = new XmlDocument(); + xmld.Load(this.sPath + @"\myiptvsettings.xml"); + + // Load Proxy Details from XML file + chkBoxUseProxy.Checked = Convert.ToBoolean(xmld.SelectSingleNode("/settings/proxydetails/useproxy").InnerText); + chkBoxUseDefaultProxy.Checked = Convert.ToBoolean(xmld.SelectSingleNode("/settings/proxydetails/usedefaultproxy").InnerText); + txtProxyUser.Text = xmld.SelectSingleNode("/settings/proxydetails/proxyuser").InnerText; + txtProxyPass.Text = xmld.SelectSingleNode("/settings/proxydetails/proxypassword").InnerText; + txtProxyIPAddress.Text = xmld.SelectSingleNode("/settings/proxydetails/proxyipaddress").InnerText; + txtProxyPort.Text = xmld.SelectSingleNode("/settings/proxydetails/proxyport").InnerText; + + // Load worldwidemediaproject.com Details from XML file + txtURL.Text = xmld.SelectSingleNode("/settings/worldwidemediaproject/playlisturl").InnerText; + } + + void BtnOKClick(object sender, System.EventArgs e) + { + XmlNode nchkBoxUseProxyNode; + XmlNode nchkBoxUseDefaultProxyNode; + XmlNode ntxtProxyUserNode; + XmlNode ntxtProxyPassNode; + XmlNode ntxtProxyIPAddressNode; + XmlNode ntxtProxyPortNode; + + XmlNode ntxtSiteUserNode; + XmlNode ntxtSitePassNode; + XmlNode ntxtURLNode; + + XmlDocument xmld = new XmlDocument(); + xmld.Load(sPath + @"\myiptvsettings.xml"); + + nchkBoxUseProxyNode = xmld.SelectSingleNode("/settings/proxydetails/useproxy"); + nchkBoxUseDefaultProxyNode = xmld.SelectSingleNode("/settings/proxydetails/usedefaultproxy"); + ntxtProxyUserNode = xmld.SelectSingleNode("/settings/proxydetails/proxyuser"); + ntxtProxyPassNode = xmld.SelectSingleNode("/settings/proxydetails/proxypassword"); + ntxtProxyIPAddressNode = xmld.SelectSingleNode("/settings/proxydetails/proxyipaddress"); + ntxtProxyPortNode = xmld.SelectSingleNode("/settings/proxydetails/proxyport"); + + ntxtSiteUserNode = xmld.SelectSingleNode("/settings/worldwidemediaproject/siteuser"); + ntxtSitePassNode = xmld.SelectSingleNode("/settings/worldwidemediaproject/sitepassword"); + ntxtURLNode = xmld.SelectSingleNode("/settings/worldwidemediaproject/playlisturl"); + + nchkBoxUseProxyNode.InnerText = chkBoxUseProxy.Checked.ToString(); + nchkBoxUseDefaultProxyNode.InnerText = chkBoxUseDefaultProxy.Checked.ToString(); + ntxtProxyUserNode.InnerText = txtProxyUser.Text; + ntxtProxyPassNode.InnerText = txtProxyPass.Text; + ntxtProxyIPAddressNode.InnerText = txtProxyIPAddress.Text; + ntxtProxyPortNode.InnerText = txtProxyPort.Text; + + ntxtURLNode.InnerText = txtURL.Text; + + xmld.Save(sPath + @"\myiptvsettings.xml"); + this.Close(); + } + + void BtnCancelClick(object sender, System.EventArgs e) + { + this.Close(); + } + } + +} Added: trunk/plugins/WWMP/MyIPTVsetup.resx =================================================================== --- trunk/plugins/WWMP/MyIPTVsetup.resx (rev 0) +++ trunk/plugins/WWMP/MyIPTVsetup.resx 2007-02-06 21:49:35 UTC (rev 98) @@ -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/WWMP/WWMP.csproj =================================================================== --- trunk/plugins/WWMP/WWMP.csproj (rev 0) +++ trunk/plugins/WWMP/WWMP.csproj 2007-02-06 21:49:35 UTC (rev 98) @@ -0,0 +1,50 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <OutputType>Library</OutputType> + <RootNamespace>MePoTrial</RootNamespace> + <AssemblyName>WWMP</AssemblyName> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProjectGuid>{D1A42628-DA12-4AAB-8AD3-408C080F625F}</ProjectGuid> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> + <OutputPath>bin\Debug\</OutputPath> + <Optimize>False</Optimize> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <DebugSymbols>True</DebugSymbols> + <DebugType>Full</DebugType> + <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)' == 'Release' "> + <OutputPath>bin\Release\</OutputPath> + <Optimize>True</Optimize> + <DefineConstants>TRACE</DefineConstants> + <DebugSymbols>False</DebugSymbols> + <DebugType>None</DebugType> + <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> + </PropertyGroup> + <ItemGroup> + <Reference Include="Core"> + <HintPath>..\..\PROGRAM FILES\Team MediaPortal\MediaPortal\Core.DLL</HintPath> + <SpecificVersion>False</SpecificVersion> + </Reference> + <Reference Include="Dialogs"> + <HintPath>..\..\PROGRAM FILES\Team MediaPortal\MediaPortal\plugins\windows\Dialogs.DLL</HintPath> + <SpecificVersion>False</SpecificVersion> + </Reference> + <Reference Include="System" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Xml" /> + <Reference Include="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> + </ItemGroup> + <ItemGroup> + <Compile Include="WWMPgui.cs" /> + <Compile Include="AssemblyInfo.cs" /> + <Compile Include="WWMPworker.cs" /> + <Compile Include="MyIPTVsetup.cs" /> + <EmbeddedResource Include="MyIPTVsetup.resx"> + <DependentUpon>MyIPTVsetup.cs</DependentUpon> + </EmbeddedResource> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" /> +</Project> \ No newline at end of file Added: trunk/plugins/WWMP/WWMP.sln =================================================================== --- trunk/plugins/WWMP/WWMP.sln (rev 0) +++ trunk/plugins/WWMP/WWMP.sln 2007-02-06 21:49:35 UTC (rev 98) @@ -0,0 +1,16 @@ +Microsoft Visual Studio Solution File, Format Version 9.00 +# SharpDevelop 2.0.0.922 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WWMP", "WWMP.csproj", "{D1A42628-DA12-4AAB-8AD3-408C080F625F}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D1A42628-DA12-4AAB-8AD3-408C080F625F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D1A42628-DA12-4AAB-8AD3-408C080F625F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D1A42628-DA12-4AAB-8AD3-408C080F625F}.Release|Any CPU.Build.0 = Release|Any CPU + {D1A42628-DA12-4AAB-8AD3-408C080F625F}.Release|Any CPU.ActiveCfg = Release|Any CPU + EndGlobalSection +EndGlobal Added: trunk/plugins/WWMP/WWMPgui.cs =================================================================== --- trunk/plugins/WWMP/WWMPgui.cs (rev 0) +++ trunk/plugins/WWMP/WWMPgui.cs 2007-02-06 21:49:35 UTC (rev 98) @@ -0,0 +1,162 @@ +#region Copyright (C) 2005-2006 Team MediaPortal + +/* + * Copyright (C) 2005-2006 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.Windows.Forms; +using System.Text.RegularExpressions; +using System.IO; +using System.Drawing; +using System.Collections; +using System.Collections.Specialized; +using MediaPortal.GUI.Library; +using MediaPortal.Dialogs; + +namespace MediaPortal.GUI.WorldWideMediaProject +{ + /// <summary> + /// Summary description for Class1. + /// </summary> + public class WWMPgui : GUIWindow, ISetupForm + { + [SkinControlAttribute(10)] + protected GUIListControl listBox = null; + private StringCollection Categories = new StringCollection(); + private StringCollection Channels = new StringCollection(); + private WWMPworker wwmpWorker; + + public WWMPgui() + { + this.wwmpWorker = new WWMPworker(); + } + + public override int GetID + { + get { return 5699; } + set + { + base.GetID = value; + } + } + + public override bool Init() + { + return Load(GUIGraphicsContext.Skin+@"\WWMPIPTV.xml"); + } + + protected override void OnPageLoad() + { + this.wwmpWorker.InitialLoad(); + this.Categories = this.wwmpWorker.GetCategoryList(listBox); + this.listBox.Focus = true; + base.OnPageLoad(); + } + + protected override void OnClicked(int controlId, GUIControl control,Action.ActionType actionType) + { + if (control == listBox) + { + if(wwmpWorker.ShowCategories==true) + { + string sSelectedCategroyName = this.Categories[listBox.SelectedListItemIndex]; + this.Channels = wwmpWorker.GetChannelList(sSelectedCategroyName,listBox); + } + else if(wwmpWorker.ShowChannels==true) + { + string sSelectedChannelName = this.Channels[listBox.SelectedListItemIndex]; + wwmpWorker.PlayChannel(sSelectedChannelName); + } + } + base.OnClicked(controlId, control, actionType); + } + + public override void OnAction(Action action) + { + switch (action.wID) + { + case Action.ActionType.ACTION_PREVIOUS_MENU: + { + GUIWindowManager.ShowPreviousWindow(); + return; + } + } + base.OnAction(action); + } + + #region ISetupForm Members + + public bool CanEnable() + { + return true; + } + + public string Description() + { + return "Plugin for viewing Internet TV"; + } + + public bool DefaultEnabled() + { + return true; + } + + public int GetWindowId() + { + return 5699; + } + + public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) + { + strButtonText=PluginName(); + strButtonImage=String.Empty; + strButtonImageFocus=String.Empty; + strPictureImage=String.Empty; + return true; + } + + public string Author() + { + return "overture"; + } + + public string PluginName() + { + return "WWMP IPTV"; + } + + public bool HasSetup() + { + return true; + } + + public void ShowPlugin() + { + MyIPTVsetup myiptvSetup = new MyIPTVsetup(); + myiptvSetup.ShowDialog(); + myiptvSetup.Dispose(); + } + + #endregion + } +} Added: trunk/plugins/WWMP/WWMPworker.cs =================================================================== --- trunk/plugins/WWMP/WWMPworker.cs (rev 0) +++ trunk/plugins/WWMP/WWMPworker.cs 2007-02-06 21:49:35 UTC (rev 98) @@ -0,0 +1,241 @@ +using System; +using System.Windows.Forms; +using System.Text.RegularExpressions; +using System.IO; +using System.Drawing; +using System.Net; +using System.Collections; +using System.Collections.Specialized; +using System.Text; +using System.Xml; +#region Copyright (C) 2005-2006 Team MediaPortal + +/* + * Copyright (C) 2005-2006 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 MediaPortal.GUI.Library; +using MediaPortal.Dialogs; +using MediaPortal.Player; + +namespace MediaPortal.GUI.WorldWideMediaProject +{ + /// <summary> + /// Description of MyIPTVworker. + /// </summary> + public class WWMPworker : StreamBufferPlayer9 + { + private MatchCollection mc; + private string sPath; + private bool bShowCategories = false; + private bool bShowChannels = false; + + public WWMPworker() + { + string sFilePath = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName; + sPath = sFilePath.Substring(0,sFilePath.LastIndexOf(@"\")); + } + + internal bool ShowCategories + { + get + { + return bShowCategories; + } + set + { + bShowCategories = value; + } + } + + internal bool ShowChannels + { + get + { + return bShowChannels; + } + set + { + bShowChannels = value; + } + } + + + internal void InitialLoad() + { + XmlDocument xmld = new XmlDocument(); + xmld.Load(sPath + @"\myiptvsettings.xml"); + bool bUseProxy = Convert.ToBoolean(xmld.SelectSingleNode("/settings/proxydetails/useproxy").InnerText); + bool bUseDefault = Convert.ToBoolean(xmld.SelectSingleNode("/settings/proxydetails/usedefaultproxy").InnerText); + string sPlaylistURL = xmld.SelectSingleNode("/settings/worldwidemediaproject/playlisturl").InnerText; + string sProxyUser = xmld.SelectSingleNode("/settings/proxydetails/proxyuser").InnerText; + string sProxyPass = xmld.SelectSingleNode("/settings/proxydetails/proxypassword").InnerText; + string sProxyIPAdd = xmld.SelectSingleNode("/settings/proxydetails/proxyipaddress").InnerText; + string sProxyPort = xmld.SelectSingleNode("/settings/proxydetails/proxyport").InnerText; + + // Http Get + string result = HttpGet(sPlaylistURL + "&ubu=1",sProxyIPAdd,sProxyPort,bUseProxy,bUseDefault,sProxyUser,sProxyPass); + + // Replace special character "\n" with nothing. + result = result.Replace("\n",""); + + // Regular Expression for extracting the relevant data from the Http Response + mc = Regex.Matches(result, @"file\t?..?=(?<streamurl>.*?)Title\t?..?=\[(?<country>.*?)]\[(?<language>.*?)]\[(?<player>.*?)]\[(?<mediatype>.*?)]\[(?<category>.*?)](?<channel>.*?)\t?Length=-1"); + } + + internal StringCollection GetChannelList(string sSelectedCategoryName,GUIListControl listBox) + { + StringCollection Channels = new StringCollection(); + + listBox.Clear(); + + foreach (Match m in this.mc) + { + if(m.Groups["category"].Value==sSelectedCategoryName) + { + Channels.Add(m.Groups["channel"].Value.Replace("-","-")); + GUIListItem item = new GUIListItem(); + item.Label = m.Groups["channel"].Value.Replace("-","-"); + item.Label2 = m.Groups["language"].Value; + listBox.Add(item); + } + } + this.bShowChannels = true; + this.bShowCategories = false; + return Channels; + } + + internal void PlayChannel(string sSelectedChannelName) + { + string streamURL = null; + + foreach (Match m in this.mc) + { + if(m.Groups["channel"].Value.Replace("-","-")==sSelectedChannelName) + { + GUIListItem item = new GUIListItem(); + streamURL = m.Groups["streamurl"].Value; + } + } + if(streamURL!=null) + { + GUIGraphicsContext.IsFullScreenVideo = true; + GUIWindowManager.ActivateWindow((int)GUIWindow.Window.WINDOW_FULLSCREEN_VIDEO); + g_Player.FullScreen = true; + g_Player.Play(streamURL); + } + else + { + MessageBox.Show("ERROR: Stream url not found"); + } + } + + internal StringCollection GetCategoryList(GUIListControl listBox) + { + StringCollection Categories = new StringCollection(); + string[] sCategory = new string[500]; + string[] sRes = new string[100]; + Categories.Clear(); + listBox.Clear(); + + int i = 0; + foreach (Match m in this.mc) + { + sCategory[i] = m.Groups["category"].Value; + i++; + } + + sRes = removeDuplicates(sCategory); + + foreach(string s in sRes) + { + if(s!=null) + { + Categories.Add(s); + GUIListItem item = new GUIListItem(); + item.Label = s; + listBox.Add(item); + } + } + + this.bShowChannels = false; + this.bShowCategories = true; + return Categories; + } + + private string[] removeDuplicates(string[] inputList) + { + string[] finalList = new string[100]; + int i = 0; + foreach (string currValue in inputList) + { + if (!Contains(finalList, currValue)) + { + finalList[i] = currValue; + i++; + } + } + return finalList; + } + + private bool Contains(string[] list, string comparedValue) + { + foreach(string listValue in list) + { + if (listValue == comparedValue) + { + return true; + } + } + return false; + } + + private string HttpGet(string sURL, string sProxyIPAddress, string sProxyPort, bool bUseProxy, bool bUseDefaults, string sProxyUser, string sProxyPass) + { + string sResponse = null; + + HttpWebRequest httpRequest = (HttpWebRequest)WebRequest.Create(sURL); + httpRequest.Method = "POST"; + + if(bUseProxy) + { + System.Net.WebProxy proxy = new System.Net.WebProxy(sProxyIPAddress.Trim() + ":" + sProxyPort.Trim(),true); + if(bUseDefaults) + { + proxy.Credentials = CredentialCache.DefaultCredentials; + GlobalProxySelection.Select = proxy; + } + else + { + proxy.Credentials = new NetworkCredential(sProxyUser, sProxyPass); + } + } + + // Get Response + HttpWebResponse resp = (HttpWebResponse)httpRequest.GetResponse(); + StreamReader responseReader = new StreamReader(resp.GetResponseStream(),Encoding.ASCII); + sResponse = responseReader.ReadToEnd(); + + return sResponse; + } + } +} Added: trunk/plugins/WWMP/bin/Debug/AxInterop.WMPLib.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/bin/Debug/AxInterop.WMPLib.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/bin/Debug/Core.DLL =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/bin/Debug/Core.DLL ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/bin/Debug/Dialogs.DLL =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/bin/Debug/Dialogs.DLL ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/bin/Debug/DirectShowLib.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/bin/Debug/DirectShowLib.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/bin/Debug/ICSharpCode.SharpZipLib.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/bin/Debug/ICSharpCode.SharpZipLib.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/bin/Debug/Interop.WMPLib.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/bin/Debug/Interop.WMPLib.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/bin/Debug/MediaPortal.Support.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/bin/Debug/MediaPortal.Support.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/bin/Debug/WWMP.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/bin/Debug/WWMP.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/bin/Debug/WWMP.pdb =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/bin/Debug/WWMP.pdb ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/bin/Debug/edtftpnet-1.2.2.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/bin/Debug/edtftpnet-1.2.2.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/bin/Release/AxInterop.WMPLib.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/bin/Release/AxInterop.WMPLib.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/bin/Release/Core.DLL =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/bin/Release/Core.DLL ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/bin/Release/Dialogs.DLL =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/bin/Release/Dialogs.DLL ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/bin/Release/DirectShowLib.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/bin/Release/DirectShowLib.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/bin/Release/ICSharpCode.SharpZipLib.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/bin/Release/ICSharpCode.SharpZipLib.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/bin/Release/Interop.WMPLib.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/bin/Release/Interop.WMPLib.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/bin/Release/MediaPortal.Support.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/bin/Release/MediaPortal.Support.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/bin/Release/WWMP.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/bin/Release/WWMP.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/bin/Release/edtftpnet-1.2.2.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/bin/Release/edtftpnet-1.2.2.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/obj/Debug/MePoTrial.csproj.GenerateResource.Cache =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/obj/Debug/MePoTrial.csproj.GenerateResource.Cache ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/obj/Debug/MePoTrial.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/obj/Debug/MePoTrial.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/obj/Debug/MePoTrial.pdb =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/obj/Debug/MePoTrial.pdb ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/obj/Debug/MediaPortal.GUI.WorldWideMediaProject.MyIPTVsetup.resources =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/obj/Debug/MediaPortal.GUI.WorldWideMediaProject.MyIPTVsetup.resources ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/obj/Debug/WWMP.csproj.GenerateResource.Cache =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/obj/Debug/WWMP.csproj.GenerateResource.Cache ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/obj/Debug/WWMP.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/obj/Debug/WWMP.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/obj/Debug/WWMP.pdb =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/obj/Debug/WWMP.pdb ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/obj/MePoTrial.csproj.FileList.txt =================================================================== --- trunk/plugins/WWMP/obj/MePoTrial.csproj.FileList.txt (rev 0) +++ trunk/plugins/WWMP/obj/MePoTrial.csproj.FileList.txt 2007-02-06 21:49:35 UTC (rev 98) @@ -0,0 +1,15 @@ +bin\Debug\MePoTrial.pdb +bin\Debug\Core.dll +bin\Debug\Microsoft.DirectX.Direct3DX.dll +bin\Debug\Microsoft.DirectX.Direct3D.dll +bin\Debug\Microsoft.DirectX.dll +bin\Debug\edtftpnet-1.1.8.dll +bin\Debug\AxInterop.WMPLib.dll +bin\Debug\Interop.TunerLib.dll +obj\Debug\ResolveAssemblyReference.cache +obj\Debug\MePoTrial.pdb +bin\Debug\Dialogs.dll +obj\Debug\MePoTrial.csproj.GenerateResource.Cache +bin\Debug\MePoTrial.dll +obj\Debug\MePoTrial.dll +obj\Debug\MediaPortal.GUI.WorldWideMediaProject.MyIPTVsetup.resources Added: trunk/plugins/WWMP/obj/Release/MediaPortal.GUI.WorldWideMediaProject.MyIPTVsetup.resources =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/obj/Release/MediaPortal.GUI.WorldWideMediaProject.MyIPTVsetup.resources ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/obj/Release/WWMP.csproj.GenerateResource.Cache =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/obj/Release/WWMP.csproj.GenerateResource.Cache ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/obj/Release/WWMP.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/WWMP/obj/Release/WWMP.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WWMP/obj/WWMP.csproj.FileList.txt =================================================================== --- trunk/plugins/WWMP/obj/WWMP.csproj.FileList.txt (rev 0) +++ trunk/plugins/WWMP/obj/WWMP.csproj.FileList.txt 2007-02-06 21:49:35 UTC (rev 98) @@ -0,0 +1,28 @@ +bin\Debug\WWMP.dll +bin\Debug\WWMP.pdb +bin\Debug\Core.dll +bin\Debug\Dialogs.dll +bin\Debug\AxInterop.WMPLib.dll +obj\Debug\ResolveAssemblyReference.cache +obj\Debug\MediaPortal.GUI.WorldWideMediaProject.MyIPTVsetup.resources +obj\Debug\WWMP.csproj.GenerateResource.Cache +obj\Debug\WWMP.dll +obj\Debug\WWMP.pdb +bin\Release\WWMP.dll +bin\Release\AxInterop.WMPLib.dll +obj\Release\ResolveAssemblyReference.cache +obj\Release\MediaPortal.GUI.WorldWideMediaProject.MyIPTVsetup.resources +obj\Release\WWMP.csproj.GenerateResource.Cache +obj\Release\WWMP.dll +bin\Debug\DirectShowLib.dll +bin\Debug\edtftpnet-1.2.2.dll +bin\Debug\Interop.WMPLib.dll +bin\Debug\MediaPortal.Support.dll +bin\Debug\ICSharpCode.SharpZipLib.dll +bin\Release\Core.DLL +bin\Release\Dialogs.DLL +bin\Release\DirectShowLib.dll +bin\Release\edtftpnet-1.2.2.dll +bin\Release\Interop.WMPLib.dll +bin\Release\MediaPortal.Support.dll +bin\Release\ICSharpCode.SharpZipLib.dll This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-02-10 06:48:55
|
Revision: 107 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=107&view=rev Author: and-81 Date: 2007-02-09 22:48:49 -0800 (Fri, 09 Feb 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MCEReplacement/AssemblyInfo.cs trunk/plugins/MCEReplacement/ExternalChannelConfig.cs trunk/plugins/MCEReplacement/Forms/ExternalChannels.cs trunk/plugins/MCEReplacement/Forms/ExternalProgram.Designer.cs trunk/plugins/MCEReplacement/Forms/MacroEditor.cs trunk/plugins/MCEReplacement/Forms/SetupForm.Designer.cs trunk/plugins/MCEReplacement/Forms/SetupForm.cs trunk/plugins/MCEReplacement/Forms/StbSetup.cs trunk/plugins/MCEReplacement/MCEReplacement.cs trunk/plugins/MCEReplacement/MCEReplacement.csproj trunk/plugins/MCEReplacement/MappedEvent.cs trunk/plugins/MCEReplacement/MceIrApi.cs trunk/plugins/MCEReplacement/Util.cs trunk/plugins/MCEReplacement/Win32.cs trunk/plugins/MCEReplacementTray/MceIrApi.cs trunk/plugins/MCEReplacementTray/Program.cs trunk/plugins/MCEReplacementTray/Properties/AssemblyInfo.cs trunk/plugins/MCEReplacementTray/Setup.Designer.cs trunk/plugins/MCEReplacementTray/Setup.cs trunk/plugins/MCEReplacementTray/Tray.cs trunk/plugins/MessagePlugin/AssemblyInfo.cs trunk/plugins/MessagePlugin/MessagePlugin.cs trunk/plugins/TV3ExtChannelChanger/AssemblyInfo.cs trunk/plugins/TV3ExtChannelChanger/ExternalChannelConfig.cs trunk/plugins/TV3ExtChannelChanger/Forms/ExternalChannels.cs trunk/plugins/TV3ExtChannelChanger/Forms/ExternalProgram.Designer.cs trunk/plugins/TV3ExtChannelChanger/Forms/PluginSetup.Designer.cs trunk/plugins/TV3ExtChannelChanger/Forms/SerialCommand.cs trunk/plugins/TV3ExtChannelChanger/Forms/StbSetup.cs trunk/plugins/TV3ExtChannelChanger/TV3ExtChannelChanger.cs trunk/plugins/TV3ExtChannelChanger/Util.cs trunk/plugins/TV3ExtChannelChanger/Win32.cs trunk/plugins/TV3MceBlaster/AssemblyInfo.cs trunk/plugins/TV3MceBlaster/ExternalChannelConfig.cs trunk/plugins/TV3MceBlaster/Forms/ExternalChannels.cs trunk/plugins/TV3MceBlaster/Forms/ExternalProgram.Designer.cs trunk/plugins/TV3MceBlaster/Forms/MacroEditor.cs trunk/plugins/TV3MceBlaster/Forms/PluginSetup.Designer.cs trunk/plugins/TV3MceBlaster/Forms/PluginSetup.cs trunk/plugins/TV3MceBlaster/Forms/SerialCommand.cs trunk/plugins/TV3MceBlaster/Forms/StbSetup.cs trunk/plugins/TV3MceBlaster/MceIrApi.cs trunk/plugins/TV3MceBlaster/TV3MceBlaster.cs trunk/plugins/TV3MceBlaster/Util.cs trunk/plugins/TV3MceBlaster/Win32.cs trunk/plugins/XBCDRC/AssemblyInfo.cs trunk/plugins/XBCDRC/XBCDRC Plugin.csproj trunk/plugins/XBCDRC/XBCDRCPlugin.cs Added Paths: ----------- trunk/plugins/MCEReplacement/Mouse.cs Modified: trunk/plugins/MCEReplacement/AssemblyInfo.cs =================================================================== --- trunk/plugins/MCEReplacement/AssemblyInfo.cs 2007-02-09 15:00:57 UTC (rev 106) +++ trunk/plugins/MCEReplacement/AssemblyInfo.cs 2007-02-10 06:48:49 UTC (rev 107) @@ -1,6 +1,8 @@ +using System; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; +using System.Security.Permissions; // // General Information about an assembly is controlled through the following @@ -16,6 +18,11 @@ [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)] + // // Version information for an assembly consists of the following four values: // @@ -58,4 +65,7 @@ [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile("")] [assembly: AssemblyKeyName("")] -[assembly: ComVisibleAttribute(false)] + +[assembly: CLSCompliant(true)] + +[assembly: SecurityPermission(SecurityAction.RequestMinimum, UnmanagedCode = true)] Modified: trunk/plugins/MCEReplacement/ExternalChannelConfig.cs =================================================================== --- trunk/plugins/MCEReplacement/ExternalChannelConfig.cs 2007-02-09 15:00:57 UTC (rev 106) +++ trunk/plugins/MCEReplacement/ExternalChannelConfig.cs 2007-02-10 06:48:49 UTC (rev 107) @@ -14,7 +14,7 @@ #region Variables - string _filename; + string _fileName; int _pauseTime = 250; bool _sendSelect = false; @@ -34,9 +34,9 @@ #region Properties - public string Filename + public string FileName { - get { return _filename; } + get { return _fileName; } } public int PauseTime @@ -105,11 +105,11 @@ #region Constructor - public ExternalChannelConfig(string filename) + public ExternalChannelConfig(string fileName) { - _filename = filename; + _fileName = fileName; - if (!File.Exists(_filename)) + if (!File.Exists(_fileName)) { for (int i = 0; i < 10; i++) Digits[i] = ""; @@ -121,7 +121,7 @@ try { - file = new FileStream(_filename, FileMode.Open, FileAccess.Read, FileShare.Read); + file = new FileStream(_fileName, FileMode.Open, FileAccess.Read, FileShare.Read); XmlDocument doc = new XmlDocument(); doc.Load(file); @@ -161,7 +161,7 @@ try { - file = new FileStream(_filename, FileMode.Create, FileAccess.Write, FileShare.Read); + file = new FileStream(_fileName, FileMode.Create, FileAccess.Write, FileShare.Read); XmlTextWriter writer = new XmlTextWriter(file, System.Text.Encoding.UTF8); writer.Formatting = Formatting.Indented; Modified: trunk/plugins/MCEReplacement/Forms/ExternalChannels.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/ExternalChannels.cs 2007-02-09 15:00:57 UTC (rev 106) +++ trunk/plugins/MCEReplacement/Forms/ExternalChannels.cs 2007-02-10 06:48:49 UTC (rev 107) @@ -11,9 +11,6 @@ using System.Windows.Forms; using System.Xml; -using MediaPortal.GUI.Library; -using MediaPortal.Util; - namespace MediaPortal.Plugins { @@ -192,21 +189,36 @@ ProcessExternalChannelProgram(setup.SelectCommand.Substring(MCEReplacement.RunCommandPrefix.Length), -1, channel, setup.ExtBlastPort); if (setup.DoubleChannelSelect) + { + if (setup.PauseTime > 0) + Thread.Sleep(setup.PauseTime); + ProcessExternalChannelProgram(setup.SelectCommand.Substring(MCEReplacement.RunCommandPrefix.Length), -1, channel, setup.ExtBlastPort); + } } else if (setup.SelectCommand.StartsWith(MCEReplacement.SerialCommandPrefix)) { ProcessSerialCommand(setup.SelectCommand.Substring(MCEReplacement.SerialCommandPrefix.Length), -1, channel, setup.ExtBlastPort); if (setup.DoubleChannelSelect) + { + if (setup.PauseTime > 0) + Thread.Sleep(setup.PauseTime); + ProcessSerialCommand(setup.SelectCommand.Substring(MCEReplacement.SerialCommandPrefix.Length), -1, channel, setup.ExtBlastPort); + } } else { MCEReplacement.ProcessCommand(setup.SelectCommand, setup.ExtBlastPort, setup.ExtBlastSpeed); if (setup.DoubleChannelSelect) - MCEReplacement.ProcessCommand(setup.SelectCommand, setup.ExtBlastPort, setup.ExtBlastSpeed); + { + if (setup.PauseTime > 0) + Thread.Sleep(setup.PauseTime); + + MCEReplacement.ProcessCommand(setup.SelectCommand, setup.ExtBlastPort, setup.ExtBlastSpeed); + } } } } @@ -221,7 +233,7 @@ { string quickSetup = comboBoxQuickSetup.Text; - if (quickSetup.Length == 0) + if (String.IsNullOrEmpty(quickSetup)) return; _tvCardStbSetups[tabControlTVCards.SelectedIndex].SetToXml(quickSetup); Modified: trunk/plugins/MCEReplacement/Forms/ExternalProgram.Designer.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/ExternalProgram.Designer.cs 2007-02-09 15:00:57 UTC (rev 106) +++ trunk/plugins/MCEReplacement/Forms/ExternalProgram.Designer.cs 2007-02-10 06:48:49 UTC (rev 107) @@ -99,7 +99,7 @@ this.labelStartup.Name = "labelStartup"; this.labelStartup.Size = new System.Drawing.Size(288, 16); this.labelStartup.TabIndex = 3; - this.labelStartup.Text = "Startup Folder:"; + this.labelStartup.Text = "Start in folder:"; this.labelStartup.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // textBoxStartup @@ -180,7 +180,7 @@ this.checkBoxShellExecute.Name = "checkBoxShellExecute"; this.checkBoxShellExecute.Size = new System.Drawing.Size(184, 21); this.checkBoxShellExecute.TabIndex = 12; - this.checkBoxShellExecute.Text = "Startup using ShellExecute"; + this.checkBoxShellExecute.Text = "Start using ShellExecute"; this.checkBoxShellExecute.UseVisualStyleBackColor = true; // // buttonTest Modified: trunk/plugins/MCEReplacement/Forms/MacroEditor.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/MacroEditor.cs 2007-02-09 15:00:57 UTC (rev 106) +++ trunk/plugins/MCEReplacement/Forms/MacroEditor.cs 2007-02-10 06:48:49 UTC (rev 107) @@ -60,13 +60,13 @@ comboBoxCommands.Items.AddRange(MCEReplacement.GetIRList()); } - void WriteToFile(string filename) + void WriteToFile(string fileName) { FileStream file = null; try { - file = new FileStream(MCEReplacement.AppDataFolder + filename + MCEReplacement.MacroExtension, FileMode.Create, FileAccess.Write, FileShare.Read); + file = new FileStream(MCEReplacement.AppDataFolder + fileName + MCEReplacement.MacroExtension, FileMode.Create, FileAccess.Write, FileShare.Read); XmlTextWriter writer = new XmlTextWriter(file, System.Text.Encoding.UTF8); writer.Formatting = Formatting.Indented; @@ -145,13 +145,13 @@ if (file != null) file.Close(); } - void ReadFromFile(string filename) + void ReadFromFile(string fileName) { FileStream file = null; try { - file = new FileStream(MCEReplacement.AppDataFolder + filename + MCEReplacement.MacroExtension, FileMode.Open, FileAccess.Read, FileShare.Read); + file = new FileStream(MCEReplacement.AppDataFolder + fileName + MCEReplacement.MacroExtension, FileMode.Open, FileAccess.Read, FileShare.Read); XmlDocument doc = new XmlDocument(); doc.Load(file); @@ -339,20 +339,20 @@ private void buttonTest_Click(object sender, EventArgs e) { - string filename = textBoxName.Text.Trim().ToUpperInvariant(); + string fileName = textBoxName.Text.Trim().ToUpperInvariant(); - if (filename.Length == 0) + if (fileName.Length == 0) { MessageBox.Show(this, "You must supply a name for this macro", "Name missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } - if (!filename.StartsWith(MCEReplacement.MacroFolder)) - filename = MCEReplacement.MacroFolder + filename; + if (!fileName.StartsWith(MCEReplacement.MacroFolder)) + fileName = MCEReplacement.MacroFolder + fileName; - WriteToFile(filename); + WriteToFile(fileName); - if (!MCEReplacement.ProcessCommand(filename, _blastPort, _blastSpeed)) + if (!MCEReplacement.ProcessCommand(fileName, _blastPort, _blastSpeed)) MessageBox.Show(this, "Check the log files for details", "Test failed", MessageBoxButtons.OK, MessageBoxIcon.Error); } @@ -364,18 +364,18 @@ private void buttonOK_Click(object sender, EventArgs e) { - string filename = textBoxName.Text.Trim().ToUpperInvariant(); + string fileName = textBoxName.Text.Trim().ToUpperInvariant(); - if (filename.Length == 0) + if (fileName.Length == 0) { MessageBox.Show(this, "You must supply a name for this macro", "Name missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } - if (!filename.StartsWith(MCEReplacement.MacroFolder)) - filename = MCEReplacement.MacroFolder + filename; + if (!fileName.StartsWith(MCEReplacement.MacroFolder)) + fileName = MCEReplacement.MacroFolder + fileName; - WriteToFile(filename); + WriteToFile(fileName); this.DialogResult = DialogResult.OK; this.Close(); Modified: trunk/plugins/MCEReplacement/Forms/SetupForm.Designer.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/SetupForm.Designer.cs 2007-02-09 15:00:57 UTC (rev 106) +++ trunk/plugins/MCEReplacement/Forms/SetupForm.Designer.cs 2007-02-10 06:48:49 UTC (rev 107) @@ -310,7 +310,7 @@ this.checkBoxMCERemote.Size = new System.Drawing.Size(184, 24); this.checkBoxMCERemote.TabIndex = 3; this.checkBoxMCERemote.Text = "Enable MCE remote"; - this.toolTips.SetToolTip(this.checkBoxMCERemote, "Enable the plugin\'s MCE remote mapping"); + this.toolTips.SetToolTip(this.checkBoxMCERemote, "Enable MCE remote button mapping"); this.checkBoxMCERemote.UseVisualStyleBackColor = true; // // checkBoxMessageMode Modified: trunk/plugins/MCEReplacement/Forms/SetupForm.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/SetupForm.cs 2007-02-09 15:00:57 UTC (rev 106) +++ trunk/plugins/MCEReplacement/Forms/SetupForm.cs 2007-02-10 06:48:49 UTC (rev 107) @@ -4,7 +4,7 @@ using System.Data; using System.Drawing; using System.IO; -using System.Security; +using System.Runtime.InteropServices; using System.Security.Permissions; using System.Text; using System.Windows.Forms; @@ -103,7 +103,7 @@ comboBoxCommands.Items.AddRange(MCEReplacement.GetFileList()); comboBoxEvents.Items.Clear(); - foreach (string eventType in Enum.GetNames(typeof(MappedEvent.Events))) + foreach (string eventType in Enum.GetNames(typeof(MappedEvent.MappingEvent))) if (eventType != "None") comboBoxEvents.Items.Add(eventType); @@ -131,9 +131,11 @@ try { + HandleRef handleRef = new HandleRef(this, this.Handle); + do { - registered = MceIrApi.RegisterEvents(this.Handle); + registered = MceIrApi.RegisterEvents(handleRef); if (!registered) { @@ -174,13 +176,14 @@ MessageBox.Show(this, ex.Message, "MCE Replacement Plugin Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } + private void SetupForm_FormClosing(object sender, FormClosingEventArgs e) { if (MceIrApi.InUse) MceIrApi.UnregisterEvents(); } - [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)] + [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)] override protected void WndProc(ref Message m) { // Handle Suspend & Resume ... @@ -193,14 +196,14 @@ case Win32.PBT_APMQUERYSUSPEND: case Win32.PBT_APMQUERYSTANDBY: //case Win32.PBT_APMSUSPEND: - MceIrApi.Suspend(); + MCEReplacement.OnSuspend(); break; //case Win32.PBT_APMRESUMECRITICAL: //case Win32.PBT_APMRESUMESUSPEND: //case Win32.PBT_APMRESUMESTANDBY: case Win32.PBT_APMRESUMEAUTOMATIC: - MceIrApi.Resume(); + MCEReplacement.OnResume(); break; } } @@ -244,16 +247,16 @@ if (listBoxIR.SelectedIndex != -1) { string command = (string)listBoxIR.SelectedItem; - string filename = MCEReplacement.AppDataFolder + command + MCEReplacement.IRExtension; + string fileName = MCEReplacement.AppDataFolder + command + MCEReplacement.IRExtension; - if (File.Exists(filename)) + if (File.Exists(fileName)) { LearnIR learnIR = new LearnIR(false, command, BlastPort, BlastSpeed); learnIR.ShowDialog(this); } else { - MessageBox.Show(this, "File not found: " + filename, "File missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + MessageBox.Show(this, "File not found: " + fileName, "File missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); RefreshIRList(); } } @@ -263,16 +266,16 @@ if (listBoxMacro.SelectedIndex != -1) { string command = (string)listBoxMacro.SelectedItem; - string filename = MCEReplacement.AppDataFolder + command + MCEReplacement.MacroExtension; + string fileName = MCEReplacement.AppDataFolder + command + MCEReplacement.MacroExtension; - if (File.Exists(filename)) + if (File.Exists(fileName)) { MacroEditor macroEditor = new MacroEditor(false, command, BlastPort, BlastSpeed); macroEditor.ShowDialog(this); } else { - MessageBox.Show(this, "File not found: " + filename, "File missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + MessageBox.Show(this, "File not found: " + fileName, "File missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); RefreshMacroList(); } } @@ -403,15 +406,15 @@ if (listBoxIR.SelectedIndex != -1) { string file = (string)listBoxIR.SelectedItem; - string filename = MCEReplacement.AppDataFolder + file + MCEReplacement.IRExtension; - if (File.Exists(filename)) + string fileName = MCEReplacement.AppDataFolder + file + MCEReplacement.IRExtension; + if (File.Exists(fileName)) { if (MessageBox.Show(this, "Are you sure you want to delete \"" + file + "\"?", "Confirm delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - File.Delete(filename); + File.Delete(fileName); } else { - MessageBox.Show(this, "File not found: " + filename, "File missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + MessageBox.Show(this, "File not found: " + fileName, "File missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } RefreshIRList(); @@ -445,15 +448,15 @@ if (listBoxMacro.SelectedIndex != -1) { string file = (string)listBoxMacro.SelectedItem; - string filename = MCEReplacement.AppDataFolder + file + MCEReplacement.MacroExtension; - if (File.Exists(filename)) + string fileName = MCEReplacement.AppDataFolder + file + MCEReplacement.MacroExtension; + if (File.Exists(fileName)) { if (MessageBox.Show(this, "Are you sure you want to delete \"" + file + "\"?", "Confirm delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) - File.Delete(filename); + File.Delete(fileName); } else { - MessageBox.Show(this, "File not found: " + filename, "File missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + MessageBox.Show(this, "File not found: " + fileName, "File missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } RefreshMacroList(); Modified: trunk/plugins/MCEReplacement/Forms/StbSetup.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/StbSetup.cs 2007-02-09 15:00:57 UTC (rev 106) +++ trunk/plugins/MCEReplacement/Forms/StbSetup.cs 2007-02-10 06:48:49 UTC (rev 107) @@ -210,16 +210,16 @@ return; } - string filename = MCEReplacement.AppDataFolder + MCEReplacement.STBFolder + xmlFile + ".xml"; + string fileName = String.Format("{0}{1}{2}.xml", MCEReplacement.AppDataFolder, MCEReplacement.STBFolder, xmlFile); - if (!File.Exists(filename)) + if (!File.Exists(fileName)) return; FileStream file = null; try { - file = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read); + file = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read); XmlDocument doc = new XmlDocument(); doc.Load(file); @@ -229,7 +229,7 @@ string temp; for (int i = 0; i < 10; i++) { - temp = Util.GetXmlString(nodeList, "Digit" + i.ToString(), ""); + temp = Util.GetXmlString(nodeList, String.Format("Digit{0}", i), ""); if (temp.EndsWith(MCEReplacement.IRExtension)) temp = MCEReplacement.STBFolder + temp; Modified: trunk/plugins/MCEReplacement/MCEReplacement.cs =================================================================== --- trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-02-09 15:00:57 UTC (rev 106) +++ trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-02-10 06:48:49 UTC (rev 107) @@ -5,6 +5,7 @@ using System.Drawing; using System.IO; using System.IO.Ports; +using System.Runtime.InteropServices; using System.Text; using System.Threading; using System.Windows.Forms; @@ -97,10 +98,16 @@ static InputHandler _defaultInputHandler; static List<InputHandler> _multiInputHandlers; + static ExternalChannelConfig[] _externalChannelConfigs; + + static bool _inConfiguration = false; + + static bool _mpBasicHome; + static bool _mpMCERemote; + static string _mpSerialUirPort; + SendMessageHandler _sendMessageHandler; - static ExternalChannelConfig[] _externalChannelConfigs = null; - int[] _mceRemoteMap = null; int[] _differentRemoteMap = null; @@ -108,12 +115,6 @@ bool _mouseModeLeftHeld = false; bool _mouseModeMiddleHeld = false; - static bool _mpBasicHome; - static bool _mpMCERemote; - static string _mpSerialUirPort; - - static bool _inConfiguration = false; - #endregion Variables #region Properties @@ -235,6 +236,12 @@ get { return _externalChannelConfigs; } } + public static bool InConfiguration + { + get { return _inConfiguration; } + set { _inConfiguration = value; } + } + // MediaPortal Settings public static bool MP_BasicHome { @@ -249,19 +256,16 @@ get { return _mpSerialUirPort; } } - public static bool InConfiguration - { - get { return _inConfiguration; } - set { _inConfiguration = value; } - } - #endregion Properties #region IPlugin methods + //[SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)] public void Start() { Log.Info("MCEReplacement: Starting ({0})", Version); + + Log.Debug("MCEReplacement: Platform is {0}", (IntPtr.Size == 4 ? "32-bit" : "64-bit")); // Load basic settings LoadSettings(); @@ -320,8 +324,10 @@ try { // Register with MceIrApi to receive remote button presses - IntPtr hWnd = Application.OpenForms["D3DApp"].Handle; - if (MceIrApi.RegisterEvents(hWnd)) + Form mpForm = Application.OpenForms["D3DApp"]; + HandleRef handleRef = new HandleRef(mpForm, mpForm.Handle); + + if (MceIrApi.RegisterEvents(handleRef)) { if (LogVerbose) Log.Debug("MCEReplacement: MceIrApi enabled"); @@ -344,7 +350,7 @@ { LoadEventMappings(); - MapEvent(MappedEvent.Events.MediaPortal_Start); + MapEvent(MappedEvent.MappingEvent.MediaPortal_Start); } // Register with MediaPortal to receive GUI Messages ... @@ -357,13 +363,15 @@ if (LogVerbose) Log.Info("MCEReplacement: Started"); } + + //[SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)] public void Stop() { if (LogVerbose) Log.Info("MCEReplacement: Stopping"); if (EventMapperEnabled) - MapEvent(MappedEvent.Events.MediaPortal_Stop); + MapEvent(MappedEvent.MappingEvent.MediaPortal_Stop); if (ControlExternalEnabled || EventMapperEnabled) GUIWindowManager.Receivers -= _sendMessageHandler; @@ -429,6 +437,7 @@ #region IPluginReceiver methods + //[SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)] public bool WndProc(ref Message msg) { // Handle Suspend & Resume ... @@ -463,9 +472,9 @@ if (RequireFocus && !GUIGraphicsContext.HasFocus) return true; - int lParam = msg.LParam.ToInt32(); - int keyCode = lParam & 0xFFFF; - int repeatCount = lParam >> 16; + int longParam = msg.LParam.ToInt32(); + int keyCode = longParam & 0xFFFF; + int repeatCount = longParam >> 16; int button = -1; @@ -557,9 +566,9 @@ // The plugin just maps it through the input handler. if (MessageModeEnabled && msg.Msg == Win32.WM_APP && msg.WParam.ToInt32() == MessageModeCommand) { - int lParam = msg.LParam.ToInt32(); - int button = lParam & 0xFFFF; - int repeatCount = lParam >> 16; + int longParam = msg.LParam.ToInt32(); + int button = longParam & 0xFFFF; + int repeatCount = longParam >> 16; if (MultiMappingEnabled && button == MultiMappingButton) { @@ -620,13 +629,13 @@ notifyMessage = "Mouse Mode is now OFF"; if (_mouseModeLeftHeld) - Win32.MouseEvent((uint)Win32.MouseEventFlags.LEFTUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.LeftUp); if (_mouseModeRightHeld) - Win32.MouseEvent((uint)Win32.MouseEventFlags.RIGHTUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.RightUp); if (_mouseModeMiddleHeld) - Win32.MouseEvent((uint)Win32.MouseEventFlags.MIDDLEUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.MiddleUp); _mouseModeLeftHeld = false; _mouseModeRightHeld = false; @@ -642,8 +651,8 @@ } else if (MouseModeActive) { - int x = Cursor.Position.X; - int y = Cursor.Position.Y; + //int x = Cursor.Position.X; + //int y = Cursor.Position.Y; int distance = MouseModeStep; if (MouseModeAcceleration) @@ -652,19 +661,23 @@ switch ((RemoteButton)button) { case RemoteButton.Up: - Cursor.Position = new Point(x, y - distance); + //Cursor.Position = new Point(x, y - distance); + Mouse.Move(0, -distance, false); return true; case RemoteButton.Down: - Cursor.Position = new Point(x, y + distance); + //Cursor.Position = new Point(x, y + distance); + Mouse.Move(0, distance, false); return true; case RemoteButton.Left: - Cursor.Position = new Point(x - distance, y); + //Cursor.Position = new Point(x - distance, y); + Mouse.Move(-distance, 0, false); return true; case RemoteButton.Right: - Cursor.Position = new Point(x + distance, y); + //Cursor.Position = new Point(x + distance, y); + Mouse.Move(distance, 0, false); return true; case RemoteButton.Replay: // Left Single-Click @@ -672,20 +685,20 @@ return true; if (_mouseModeLeftHeld) - Win32.MouseEvent((uint)Win32.MouseEventFlags.LEFTUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.LeftUp); if (_mouseModeRightHeld) - Win32.MouseEvent((uint)Win32.MouseEventFlags.RIGHTUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.RightUp); if (_mouseModeMiddleHeld) - Win32.MouseEvent((uint)Win32.MouseEventFlags.MIDDLEUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.MiddleUp); _mouseModeLeftHeld = false; _mouseModeRightHeld = false; _mouseModeMiddleHeld = false; - Win32.MouseEvent((uint)Win32.MouseEventFlags.LEFTDOWN, 0, 0, 0, 0); - Win32.MouseEvent((uint)Win32.MouseEventFlags.LEFTUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.LeftDown); + Mouse.Button(Mouse.MouseEvents.LeftUp); return true; case RemoteButton.Skip: // Right Single-Click @@ -693,20 +706,20 @@ return true; if (_mouseModeLeftHeld) - Win32.MouseEvent((uint)Win32.MouseEventFlags.LEFTUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.LeftUp); if (_mouseModeRightHeld) - Win32.MouseEvent((uint)Win32.MouseEventFlags.RIGHTUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.RightUp); if (_mouseModeMiddleHeld) - Win32.MouseEvent((uint)Win32.MouseEventFlags.MIDDLEUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.MiddleUp); _mouseModeLeftHeld = false; _mouseModeRightHeld = false; _mouseModeMiddleHeld = false; - Win32.MouseEvent((uint)Win32.MouseEventFlags.RIGHTDOWN, 0, 0, 0, 0); - Win32.MouseEvent((uint)Win32.MouseEventFlags.RIGHTUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.RightDown); + Mouse.Button(Mouse.MouseEvents.RightUp); return true; case RemoteButton.Play: // Middle Single-Click @@ -714,20 +727,20 @@ return true; if (_mouseModeLeftHeld) - Win32.MouseEvent((uint)Win32.MouseEventFlags.LEFTUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.LeftUp); if (_mouseModeRightHeld) - Win32.MouseEvent((uint)Win32.MouseEventFlags.RIGHTUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.RightUp); if (_mouseModeMiddleHeld) - Win32.MouseEvent((uint)Win32.MouseEventFlags.MIDDLEUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.MiddleUp); _mouseModeLeftHeld = false; _mouseModeRightHeld = false; _mouseModeMiddleHeld = false; - Win32.MouseEvent((uint)Win32.MouseEventFlags.MIDDLEDOWN, 0, 0, 0, 0); - Win32.MouseEvent((uint)Win32.MouseEventFlags.MIDDLEUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.MiddleDown); + Mouse.Button(Mouse.MouseEvents.MiddleUp); return true; case RemoteButton.Ok: // Double-Click (Left) @@ -735,36 +748,36 @@ return true; if (_mouseModeLeftHeld) - Win32.MouseEvent((uint)Win32.MouseEventFlags.LEFTUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.LeftUp); if (_mouseModeRightHeld) - Win32.MouseEvent((uint)Win32.MouseEventFlags.RIGHTUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.RightUp); if (_mouseModeMiddleHeld) - Win32.MouseEvent((uint)Win32.MouseEventFlags.MIDDLEUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.MiddleUp); _mouseModeLeftHeld = false; _mouseModeRightHeld = false; _mouseModeMiddleHeld = false; - Win32.MouseEvent((uint)Win32.MouseEventFlags.LEFTDOWN, 0, 0, 0, 0); - Win32.MouseEvent((uint)Win32.MouseEventFlags.LEFTUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.LeftDown); + Mouse.Button(Mouse.MouseEvents.LeftUp); - Win32.MouseEvent((uint)Win32.MouseEventFlags.LEFTDOWN, 0, 0, 0, 0); - Win32.MouseEvent((uint)Win32.MouseEventFlags.LEFTUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.LeftDown); + Mouse.Button(Mouse.MouseEvents.LeftUp); return true; case RemoteButton.Back: // Left Click & Hold if (_mouseModeRightHeld) - Win32.MouseEvent((uint)Win32.MouseEventFlags.RIGHTUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.RightUp); if (_mouseModeMiddleHeld) - Win32.MouseEvent((uint)Win32.MouseEventFlags.MIDDLEUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.MiddleUp); if (_mouseModeLeftHeld) - Win32.MouseEvent((uint)Win32.MouseEventFlags.LEFTUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.LeftUp); else - Win32.MouseEvent((uint)Win32.MouseEventFlags.LEFTDOWN, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.LeftDown); _mouseModeLeftHeld = !_mouseModeLeftHeld; _mouseModeRightHeld = false; @@ -773,15 +786,15 @@ case RemoteButton.Info: // Right Click & Hold if (_mouseModeLeftHeld) - Win32.MouseEvent((uint)Win32.MouseEventFlags.LEFTUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.LeftUp); if (_mouseModeMiddleHeld) - Win32.MouseEvent((uint)Win32.MouseEventFlags.MIDDLEUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.MiddleUp); if (_mouseModeRightHeld) - Win32.MouseEvent((uint)Win32.MouseEventFlags.RIGHTUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.RightUp); else - Win32.MouseEvent((uint)Win32.MouseEventFlags.RIGHTDOWN, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.RightDown); _mouseModeRightHeld = !_mouseModeRightHeld; _mouseModeLeftHeld = false; @@ -790,15 +803,15 @@ case RemoteButton.Stop: // Middle Click & Hold if (_mouseModeLeftHeld) - Win32.MouseEvent((uint)Win32.MouseEventFlags.LEFTUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.LeftUp); if (_mouseModeRightHeld) - Win32.MouseEvent((uint)Win32.MouseEventFlags.RIGHTUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.RightUp); if (_mouseModeMiddleHeld) - Win32.MouseEvent((uint)Win32.MouseEventFlags.MIDDLEUP, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.MiddleUp); else - Win32.MouseEvent((uint)Win32.MouseEventFlags.MIDDLEDOWN, 0, 0, 0, 0); + Mouse.Button(Mouse.MouseEvents.MiddleDown); _mouseModeMiddleHeld = !_mouseModeMiddleHeld; _mouseModeLeftHeld = false; @@ -806,11 +819,11 @@ return true; case RemoteButton.ChannelUp: // Scroll Up - Win32.MouseEvent((uint)Win32.MouseEventFlags.SCROLL, 0, 0, (uint)120, 0); + Mouse.Scroll(Mouse.ScrollDir.Up); return true; case RemoteButton.ChannelDown: // Scroll Down - Win32.MouseEvent((uint)Win32.MouseEventFlags.SCROLL, 0, 0, unchecked((uint)-120), 0); + Mouse.Scroll(Mouse.ScrollDir.Down); return true; } } @@ -1022,7 +1035,7 @@ /// <param name="msg">MediaPortal Message to run through the event mapper</param> static void MapEvent(GUIMessage msg) { - MappedEvent.Events eventType = MappedEvent.GetEventType(msg.Message); + MappedEvent.MappingEvent eventType = MappedEvent.GetEventType(msg.Message); foreach (MappedEvent mappedEvent in EventMappings) { @@ -1086,7 +1099,7 @@ continue; if (LogVerbose) - Log.Info("MCEReplacement: Event Mapper - Event \"{0}\"", Enum.GetName(typeof(MappedEvent.Events), eventType)); + Log.Info("MCEReplacement: Event Mapper - Event \"{0}\"", Enum.GetName(typeof(MappedEvent.MappingEvent), eventType)); string command = mappedEvent.Command; @@ -1105,7 +1118,7 @@ /// Run the event mapper over the supplied MappedEvent type /// </summary> /// <param name="msg">MappedEvent to run through the event mapper</param> - static void MapEvent(MappedEvent.Events eventType) + static void MapEvent(MappedEvent.MappingEvent eventType) { foreach (MappedEvent mappedEvent in EventMappings) { @@ -1115,7 +1128,7 @@ continue; if (LogVerbose) - Log.Info("MCEReplacement: Event Mapper - Event \"{0}\"", Enum.GetName(typeof(MappedEvent.Events), eventType)); + Log.Info("MCEReplacement: Event Mapper - Event \"{0}\"", Enum.GetName(typeof(MappedEvent.MappingEvent), eventType)); string command = mappedEvent.Command; @@ -1301,26 +1314,24 @@ return ProcessSerialCommand(commands); } - static bool BlastIR(string filename, MceIrApi.BlasterPort port, MceIrApi.BlasterSpeed speed) + static bool BlastIR(string fileName, MceIrApi.BlasterPort port, MceIrApi.BlasterSpeed speed) { FileStream file = null; try { - file = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read); + file = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read); if (file.Length == 0) { - Log.Error("MCEReplacement: IR file \"{0}\" has no data, possible IR learn failure", filename); + Log.Error("MCEReplacement: IR file \"{0}\" has no data, possible IR learn failure", fileName); file.Close(); return false; } - IntPtr fileHandle = file.SafeFileHandle.DangerousGetHandle(); - - if (!MceIrApi.CheckFile(fileHandle)) + if (!MceIrApi.CheckFile(file.SafeFileHandle)) { - Log.Error("MCEReplacement: Bad IR file \"{0}\"", filename); + Log.Error("MCEReplacement: Bad IR file \"{0}\"", fileName); file.Close(); return false; } @@ -1329,7 +1340,7 @@ MceIrApi.SetBlasterSpeed(speed); MceIrApi.SetBlasterType(BlastType); - if (MceIrApi.PlaybackFromFile(fileHandle)) + if (MceIrApi.PlaybackFromFile(file.SafeFileHandle)) { if (LogVerbose) Log.Info("MCEReplacement: Blast successful"); @@ -1343,7 +1354,7 @@ Log.Error("MCEReplacement: BlastIR() {0}", ex.Message); } - Log.Error("MCEReplacement: Failed to blast IR file \"{0}\"", filename); + Log.Error("MCEReplacement: Failed to blast IR file \"{0}\"", fileName); if (file != null) file.Close(); @@ -1351,7 +1362,7 @@ return false; } - static bool ProcessMacro(string filename, MceIrApi.BlasterPort port, MceIrApi.BlasterSpeed speed) + static bool ProcessMacro(string fileName, MceIrApi.BlasterPort port, MceIrApi.BlasterSpeed speed) { FileStream file = null; @@ -1360,7 +1371,7 @@ try { - file = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read); + file = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read); XmlDocument doc = new XmlDocument(); doc.Load(file); @@ -1378,7 +1389,7 @@ if (!BlastIR(AppDataFolder + commandProperty + IRExtension, macroPort, macroSpeed)) { file.Close(); - Log.Error("MCEReplacement: Error blasting \"{0}\" in \"{1}\"", commandProperty, filename); + Log.Error("MCEReplacement: Error blasting \"{0}\" in \"{1}\"", commandProperty, fileName); return false; } break; @@ -1400,14 +1411,14 @@ if (commands == null) { file.Close(); - Log.Error("MCEReplacement: Error processing Run \"{0}\" in \"{1}\"", commandProperty, filename); + Log.Error("MCEReplacement: Error processing Run \"{0}\" in \"{1}\"", commandProperty, fileName); return false; } if (!ProcessRunCommand(commands)) { file.Close(); - Log.Error("MCEReplacement: Error executing Run in \"{0}\"", filename); + Log.Error("MCEReplacement: Error executing Run in \"{0}\"", fileName); return false; } break; @@ -1420,14 +1431,14 @@ if (commands == null) { file.Close(); - Log.Error("MCEReplacement: Error processing Serial Command \"{0}\" in \"{1}\"", commandProperty, filename); + Log.Error("MCEReplacement: Error processing Serial Command \"{0}\" in \"{1}\"", commandProperty, fileName); return false; } if (!ProcessSerialCommand(commands)) { file.Close(); - Log.Error("MCEReplacement: Error executing Serial Command in \"{0}\"", filename); + Log.Error("MCEReplacement: Error executing Serial Command in \"{0}\"", fileName); return false; } break; @@ -1449,7 +1460,7 @@ if (commands == null) { file.Close(); - Log.Error("MCEReplacement: Error processing Popup Command \"{0}\" in \"{1}\"", commandProperty, filename); + Log.Error("MCEReplacement: Error processing Popup Command \"{0}\" in \"{1}\"", commandProperty, fileName); return false; } @@ -1479,7 +1490,7 @@ if (commands == null) { file.Close(); - Log.Error("MCEReplacement: Error processing Message Command \"{0}\" in \"{1}\"", commandProperty, filename); + Log.Error("MCEReplacement: Error processing Message Command \"{0}\" in \"{1}\"", commandProperty, fileName); return false; } @@ -1499,7 +1510,7 @@ else if (!ProcessKeyCommand(commandProperty)) { file.Close(); - Log.Error("MCEReplacement: Error executing Key Command in \"{0}\"", filename); + Log.Error("MCEReplacement: Error executing Key Command in \"{0}\"", fileName); return false; } @@ -1593,8 +1604,8 @@ /// </summary> public static void OnSuspend() { - if (EventMapperEnabled) - MapEvent(MappedEvent.Events.PC_Suspend); + if (!InConfiguration && EventMapperEnabled) + MapEvent(MappedEvent.MappingEvent.PC_Suspend); if (MceIrApi.InUse) { @@ -1618,8 +1629,8 @@ MceIrApi.Resume(); } - if (EventMapperEnabled) - MapEvent(MappedEvent.Events.PC_Resume); + if (!InConfiguration && EventMapperEnabled) + MapEvent(MappedEvent.MappingEvent.PC_Resume); } /// <summary> @@ -1629,6 +1640,12 @@ /// <returns>Returns string[] of command elements</returns> public static string[] SplitRunCommand(string runCommand) { + if (String.IsNullOrEmpty(runCommand)) + { + Log.Error("MCEReplacement: Invalid run command"); + return null; + } + string[] commands = runCommand.Split(new char[] { '|' }); if (commands.Length != 7) @@ -1647,24 +1664,30 @@ /// <param name="command">An array of arguments for the method /// (the output of SplitRunCommand)</param> /// <returns>success</returns> - public static bool ProcessRunCommand(string[] command) + public static bool ProcessRunCommand(string[] commands) { + if (commands == null) + { + Log.Error("MCEReplacement: Invalid run command"); + return false; + } + try { Process process = new Process(); - process.StartInfo.FileName = command[0]; - process.StartInfo.WorkingDirectory = command[1]; - process.StartInfo.Arguments = command[2]; - process.StartInfo.WindowStyle = (ProcessWindowStyle)Enum.Parse(typeof(ProcessWindowStyle), command[3]); - process.StartInfo.CreateNoWindow = bool.Parse(command[4]); - process.StartInfo.UseShellExecute = bool.Parse(command[5]); + process.StartInfo.FileName = commands[0]; + process.StartInfo.WorkingDirectory = commands[1]; + process.StartInfo.Arguments = commands[2]; + process.StartInfo.WindowStyle = (ProcessWindowStyle)Enum.Parse(typeof(ProcessWindowStyle), commands[3]); + process.StartInfo.CreateNoWindow = bool.Parse(commands[4]); + process.StartInfo.UseShellExecute = bool.Parse(commands[5]); if (LogVerbose) - Log.Info("MCEReplacement: Launching program {0}", command[0]); + Log.Info("MCEReplacement: Launching program {0}", commands[0]); process.Start(); - if (bool.Parse(command[6])) // Wait for exit + if (bool.Parse(commands[6])) // Wait for exit process.WaitForExit(); } catch (Exception ex) @@ -1683,6 +1706,12 @@ /// <returns>Returns string[] of command elements</returns> public static string[] SplitSerialCommand(string serialCommand) { + if (String.IsNullOrEmpty(serialCommand)) + { + Log.Error("MCEReplacement: Invalid serial command"); + return null; + } + string[] commands = serialCommand.Split(new char[] { '|' }); if (commands.Length != 6) @@ -1704,6 +1733,12 @@ /// <returns>success</returns> public static bool ProcessSerialCommand(string[] commands) { + if (commands == null) + { + Log.Error("MCEReplacement: Invalid serial command"); + return false; + } + SerialPort serialPort = null; if (LogVerbose) @@ -1748,41 +1783,47 @@ /// <returns>success</returns> public static bool ProcessCommand(string command, MceIrApi.BlasterPort port, MceIrApi.BlasterSpeed speed) { + if (String.IsNullOrEmpty(command)) + { + Log.Error("MCEReplacement: Invalid command"); + return false; + } + if (command.StartsWith(MacroFolder)) // Macro { - string filename = AppDataFolder + command + MacroExtension; - if (File.Exists(filename)) + string fileName = AppDataFolder + command + MacroExtension; + if (File.Exists(fileName)) { - return ProcessMacro(filename, port, speed); + return ProcessMacro(fileName, port, speed); } else { - Log.Error("MCEReplacement: Macro file missing \"{0}\"", filename); + Log.Error("MCEReplacement: Macro file missing \"{0}\"", fileName); return false; } } else if (command.StartsWith(IRFolder)) // IR Code { - string filename = AppDataFolder + command + IRExtension; - if (File.Exists(filename)) + string fileName = AppDataFolder + command + IRExtension; + if (File.Exists(fileName)) { - return BlastIR(filename, port, speed); + return BlastIR(fileName, port, speed); } else { - Log.Error("MCEReplacement: IR file missing \"{0}\"", filename); + Log.Error("MCEReplacement: IR file missing \"{0}\"", fileName); return false; } } else if (command.StartsWith(STBFolder)) // STB Command { - string filename = AppDataFolder + command; - if (File.Exists(filename)) + string fileName = AppDataFolder + command; + if (File.Exists(fileName)) { - if (filename.EndsWith(IRExtension)) // IR Command - return BlastIR(filename, port, speed); - else if (filename.EndsWith(MacroExtension)) // Macro - return ProcessMacro(filename, port, speed); + if (fileName.EndsWith(IRExtension)) // IR Command + return BlastIR(fileName, port, speed); + else if (fileName.EndsWith(MacroExtension)) // Macro + return ProcessMacro(fileName, port, speed); else { Log.Error("MCEReplacement: Invalid STB Command \"{0}\"", command); @@ -1791,7 +1832,7 @@ } else { - Log.Error("MCEReplacement: STB file missing \"{0}\"", filename); + Log.Error("MCEReplacement: STB file missing \"{0}\"", fileName); return false; } } @@ -1860,6 +1901,12 @@ /// <returns>Returns string[] of command elements</returns> public static string[] SplitMessageCommand(string messageCommand) { + if (String.IsNullOrEmpty(messageCommand)) + { + Log.Error("MCEReplacement: Invalid message command"); + return null; + } + string[] commands = messageCommand.Split(new char[] { '|' }); if (commands.Length != 4) @@ -1880,13 +1927,19 @@ /// <returns>success</returns> public static bool ProcessMessageCommand(string[] commands) { + if (commands == null) + { + Log.Error("MCEReplacement: Invalid message command"); + return false; + } + try { - IntPtr hWnd = IntPtr.Zero; + IntPtr windowHandle = IntPtr.Zero; if (commands[0] == "*") { - hWnd = Win32.GetForegroundWindow(); + windowHandle = Win32.GetForegroundWindow(); } else { @@ -1895,7 +1948,7 @@ try { if (proc.MainModule.FileName == commands[0]) - hWnd = proc.MainWindowHandle; + windowHandle = proc.MainWindowHandle; } catch { @@ -1903,19 +1956,20 @@ } } - if (hWnd == IntPtr.Zero) + if (windowHandle == IntPtr.Zero) { Log.Warn("MCEReplacement: No target found for Message Command"); return false; } int msg = int.Parse(commands[1]); - int wParam = int.Parse(commands[2]); - int lParam = int.Parse(commands[3]); + IntPtr wordParam = new IntPtr(int.Parse(commands[2])); + IntPtr longParam = new IntPtr(int.Parse(commands[3])); - Win32.SendMessage(hWnd, msg, wParam, lParam); + Win32.SendMessage(windowHandle, msg, wordParam, longParam); - Log.Info("MCEReplacement: Message Sent({0}, {1}, {2}, {3})", hWnd.ToString(), msg, wParam, lParam); + if (LogVerbose) + Log.Info("MCEReplacement: Message Sent({0}, {1}, {2}, {3})", commands[0], msg, wordParam, longParam); return true; } @@ -1933,11 +1987,17 @@ /// <returns>Returns string[] of command elements</returns> public static string[] SplitPopupCommand(string popupCommand) { + if (String.IsNullOrEmpty(popupCommand)) + { + Log.Error("MCEReplacement: Invalid popup command"); + return null; + } + string[] commands = popupCommand.Split(new char[] { '|' }); if (commands.Length != 3) { - Log.Error("MCEReplacement: Popup command structure is invalid: {0}", popupCommand); + Log.Error("MCEReplacement: Popup Command structure is invalid: {0}", popupCommand); return null; } @@ -1951,16 +2011,31 @@ /// <returns>Success</returns> public static bool ProcessGoTo(string screen) { - GUIWindow.Window window = (GUIWindow.Window)Enum.Parse(typeof(GUIWindow.Window), "WINDOW_" + screen); + if (String.IsNullOrEmpty(screen)) + { + Log.Error("MCEReplacement: Invalid goto command"); + return false; + } - if (window == GUIWindow.Window.WINDOW_HOME && MP_BasicHome) - window = GUIWindow.Window.WINDOW_SECOND_HOME; + try + { + GUIWindow.Window window = (GUIWindow.Window)Enum.Parse(typeof(GUIWindow.Window), "WINDOW_" + screen); - if (LogVerbose) - Log.Info("MCEReplacement: Go To Window \"{0}\"", Enum.GetName(typeof(GUIWindow.Window), window)); + if (window == GUIWindow.Window.WINDOW_HOME && MP_BasicHome) + window = GUIWindow.Window.WINDOW_SECOND_HOME; - GUIGraphicsContext.ResetLastActivity(); - GUIWindowManager.SendThreadMessage(new GUIMessage(GUIMessage.MessageType.GUI_MSG_GOTO_WINDOW, 0, 0, 0, (int)window, 0, null)); + if (LogVerbose) + Log.Info("MCEReplacement: Go To Window \"{0}\"", Enum.GetName(typeof(GUIWindow.Window), window)); + + GUIGraphicsContext.ResetLastActivity(); + GUIWindowManager.SendThreadMessage(new GUIMessage(GUIMessage.MessageType.GUI_MSG_GOTO_WINDOW, 0, 0, 0, (int)window, 0, null)); + } + catch (Exception ex) + { + Log.Error("MCEReplacement: Error processing Goto Command \"{0}\" - {1}", screen, ex.Message); + return false; + } + return true; } @@ -1971,13 +2046,19 @@ /// <returns>Success</returns> public static bool ProcessKeyCommand(string command) { + if (String.IsNullOrEmpty(command)) + { + Log.Error("MCEReplacement: Invalid key command"); + return false; + } + try { SendKeys.SendWait(command); } catch (Exception ex) { - Log.Error("MCEReplacement: {0}", ex.Message); + Log.Error("MCEReplacement: Error processing Key Command \"{0}\"", ex.Message); return false; } @@ -1991,15 +2072,14 @@ /// <returns>bool value shows success</returns> public static bool LearnIRCommand(string blastCommand) { - string filename = AppDataFolder + blastCommand + IRExtension; + string fileName = AppDataFolder + blastCommand + IRExtension; FileStream file = null; bool status = false; try { - file = new FileStream(filename, FileMode.Create, FileAccess.Write, FileShare.Read); - - status = MceIrApi.RecordToFile(file.SafeFileHandle.DangerousGetHandle(), LearnTimeout); + file = new FileStream(fileName, FileMode.Create, FileAccess.Write, FileShare.Read); + status = MceIrApi.RecordToFile(file.SafeFileHandle, LearnTimeout); } catch (Exception ex) { @@ -2071,6 +2151,17 @@ /// <returns>Modified string with escape codes processed</returns> public static string ReplaceEscapeCodes(string input) { + if (input == null) + { + Log.Error("MCEReplacement: Null escape code string"); + return ""; + } + else if (input.Length == 0) + { + Log.Warn("MCEReplacement: Empty escape code string"); + return ""; + } + bool inEscapeCode = false; bool inHexCode = false; byte hexParsed; @@ -2128,7 +2219,7 @@ if (byte.TryParse(hexCode.ToString(), System.Globalization.NumberStyles.HexNumber, null, out hexParsed)) output.Append((char)hexParsed); else - Log.Error("MCEReplacement: ReplaceEscapeCodes() - Bad Hex Code"); + Log.Error("MCEReplacement: Bad Hex Code \"{0}\"", hexCode.ToString()); inHexCode = false; break; Modified: trunk/plugins/MCEReplacement/MCEReplacement.csproj =================================================================== --- trunk/plugins/MCEReplacement/MCEReplacement.csproj 2007-02-09 15:00:57 UTC (rev 106) +++ trunk/plugins/MCEReplacement/MCEReplacement.csproj 2007-02-10 06:48:49 UTC (rev 107) @@ -13,6 +13,9 @@ <StartupObject> </StartupObject> <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent> + <SignAssembly>false</SignAssembly> + <AssemblyOriginatorKeyFile> + </AssemblyOriginatorKeyFile> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>false</DebugSymbols> @@ -150,6 +153,7 @@ <Compile Include="MappedEvent.cs" /> <Compile Include="MceIrApi.cs" /> <Compile Include="MCEReplacement.cs" /> + <Compile Include="Mouse.cs" /> <Compile Include="Util.cs" /> <Compile Include="Win32.cs" /> </ItemGroup> Modified: trunk/plugins/MCEReplacement/MappedEvent.cs =================================================================== --- trunk/plugins/MCEReplacement/MappedEvent.cs 2007-02-09 15:00:57 UTC (rev 106) +++ trunk/plugins/MCEReplacement/MappedEvent.cs 2007-02-10 06:48:49 UTC (rev 107) @@ -18,7 +18,7 @@ /// <summary> /// A list of events that can be mapped in the Event Mapper /// </summary> - public enum Events + public enum MappingEvent { None, //Time_Schedule, @@ -114,77 +114,78 @@ /// </summary> /// <param name="messageType">MediaPortal GUIMessage.MessageType</param> /// <returns></returns> - public static Events GetEventType(GUIMessage.MessageType messageType) + [CLSCompliant(false)] + public static MappingEvent GetEventType(GUIMessage.MessageType messageType) { switch (messageType) { case GUIMessage.MessageType.GUI_MSG_CD_INSERTED: - return Events.CD_Inserted; + return MappingEvent.CD_Inserted; case GUIMessage.MessageType.GUI_MSG_CD_REMOVED: - return Events.CD_Ejected; + return MappingEvent.CD_Ejected; case GUIMessage.MessageType.GUI_MSG_FILE_DOWNLOADED: - return Events.File_Downloaded; + return MappingEvent.File_Downloaded; case GUIMessage.MessageType.GUI_MSG_FILE_DOWNLOADING: - return Events.File_Downloading; + return MappingEvent.File_Downloading; case GUIMessage.MessageType.GUI_MSG_LOSTFOCUS: - return Events.Focus_Lost; + return MappingEvent.Focus_Lost; case GUIMessage.MessageType.GUI_MSG_MSN_CLOSECONVERSATION: - return Events.MSN_Close_Conversation; + return MappingEvent.MSN_Close_Conversation; case GUIMessage.MessageType.GUI_MSG_MSN_MESSAGE: - return Events.MSN_Message; + return MappingEvent.MSN_Message; case GUIMessage.MessageType.GUI_MSG_MSN_STATUS_MESSAGE: - return Events.MSN_Status_Message; + return MappingEvent.MSN_Status_Message; case GUIMessage.MessageType.GUI_MSG_PLAY_AUDIO_CD: - return Events.Play_Audio_CD; + return MappingEvent.Play_Audio_CD; case GUIMessage.MessageType.GUI_MSG_PLAY_FILE: - return Events.Play_File; + return MappingEvent.Play_File; case GUIMessage.MessageType.GUI_MSG_PLAY_ITEM: - return Events.Play_Item; + return MappingEvent.Play_Item; case GUIMessage.MessageType.GUI_MSG_PLAY_RADIO_STATION: - return Events.Play_Radio_Station; + return MappingEvent.Play_Radio_Station; case GUIMessage.MessageType.GUI_MSG_PLAYBACK_ENDED: - return Events.Playback_Ended; + return MappingEvent.Playback_Ended; case GUIMessage.MessageType.GUI_MSG_PLAYBACK_STARTED: - return Events.Playback_Started; + return MappingEvent.Playback_Started; case GUIMessage.MessageType.GUI_MSG_PLAYBACK_STOPPED: - return Events.Playback_Stopped; + return MappingEvent.Playback_Stopped; case GUIMessage.MessageType.GUI_MSG_RECORD: - return Events.Record; + return MappingEvent.Record; case GUIMessage.MessageType.GUI_MSG_RECORDER_ABOUT_TO_START_RECORDING: - return Events.About_To_Record; + return MappingEvent.About_To_Record; case GUIMessage.MessageType.GUI_MSG_RECORDER_START: - return Events.Recorder_Start; + return MappingEvent.Recorder_Start; case GUIMessage.MessageType.GUI_MSG_RECORDER_STOP: - return Events.Recorder_Stop; + return MappingEvent.Recorder_Stop; case GUIMessage.MessageType.GUI_MSG_RECORDER_STOP_RADIO: - return Events.Recorder_Stop_Radio; + return MappingEvent.Recorder_Stop_Radio; case GUIMessage.MessageType.GUI_MSG_RECORDER_STOP_TIMESHIFT: - return Events.Recorder_Stop_Timeshift; + return MappingEvent.Recorder_Stop_Timeshift; case GUIMessage.MessageType.GUI_MSG_RECORDER_STOP_TV: - return Events.Recorder_Stop_TV; + return MappingEvent.Recorder_Stop_TV; case GUIMessage.Messag... [truncated message content] |
From: <an...@us...> - 2007-02-10 10:47:23
|
Revision: 110 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=110&view=rev Author: and-81 Date: 2007-02-10 02:47:10 -0800 (Sat, 10 Feb 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MCEReplacement/MCEReplacement.cs trunk/plugins/TV3ExtChannelChanger/TV3ExtChannelChanger.cs trunk/plugins/TV3MceBlaster/TV3MceBlaster.cs Modified: trunk/plugins/MCEReplacement/MCEReplacement.cs =================================================================== --- trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-02-10 10:33:25 UTC (rev 109) +++ trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-02-10 10:47:10 UTC (rev 110) @@ -260,7 +260,6 @@ #region IPlugin methods - //[SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)] public void Start() { Log.Info("MCEReplacement: Starting ({0})", Version); @@ -364,7 +363,6 @@ Log.Info("MCEReplacement: Started"); } - //[SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)] public void Stop() { if (LogVerbose) @@ -437,7 +435,6 @@ #region IPluginReceiver methods - //[SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)] public bool WndProc(ref Message msg) { // Handle Suspend & Resume ... @@ -601,7 +598,7 @@ return false; } - #endregion + #endregion IPluginReceiver methods #region Private Methods Modified: trunk/plugins/TV3ExtChannelChanger/TV3ExtChannelChanger.cs =================================================================== --- trunk/plugins/TV3ExtChannelChanger/TV3ExtChannelChanger.cs 2007-02-10 10:33:25 UTC (rev 109) +++ trunk/plugins/TV3ExtChannelChanger/TV3ExtChannelChanger.cs 2007-02-10 10:47:10 UTC (rev 110) @@ -631,16 +631,11 @@ /// <returns>Modified string with escape codes processed</returns> public static string ReplaceEscapeCodes(string input) { - if (input == null) + if (String.IsNullOrEmpty(input)) { - Log.Error("TV3ExtChannelChanger: Null escape code string"); + Log.Error("TV3ExtChannelChanger: Null or empty escape code string"); return ""; } - else if (input.Length == 0) - { - Log.Info("TV3ExtChannelChanger: Empty escape code string"); - return ""; - } bool inEscapeCode = false; bool inHexCode = false; Modified: trunk/plugins/TV3MceBlaster/TV3MceBlaster.cs =================================================================== --- trunk/plugins/TV3MceBlaster/TV3MceBlaster.cs 2007-02-10 10:33:25 UTC (rev 109) +++ trunk/plugins/TV3MceBlaster/TV3MceBlaster.cs 2007-02-10 10:47:10 UTC (rev 110) @@ -691,11 +691,14 @@ } /// <summary> - /// Given a command name this method checks if the file exists as an IR code - /// or a macro and then processes the request accordingly. + /// Given a command this method checks if the file exists as an IR + /// command, macro or other command and then processes the request + /// accordingly. /// </summary> - /// <param name="command">The command name stored in the mapping XML</param> - /// <returns>success</returns> + /// <param name="command">Command to process.</param> + /// <param name="port">Blaster port to IR commands to.</param> + /// <param name="speed">Blaster speed to execute IR commands at.</param> + /// <returns>Success.</returns> public static bool ProcessCommand(string command, MceIrApi.BlasterPort port, MceIrApi.BlasterSpeed speed) { if (String.IsNullOrEmpty(command)) @@ -950,14 +953,22 @@ /// <returns>string[] of IR Commands</returns> public static string[] GetIRList() { - string[] files = Directory.GetFiles(AppDataFolder + IRFolder, "*" + IRExtension); - string[] list = new string[files.Length]; + try + { + string[] files = Directory.GetFiles(AppDataFolder + IRFolder, "*" + IRExtension); + string[] list = new string[files.Length]; - int i = 0; - foreach (string file in files) - list[i++] = IRFolder + Path.GetFileNameWithoutExtension(file).ToUpperInvariant(); + int i = 0; + foreach (string file in files) + list[i++] = IRFolder + Path.GetFileNameWithoutExtension(file).ToUpperInvariant(); - return list; + return list; + } + catch (Exception ex) + { + Log.Error(ex.Message); + return null; + } } /// <summary> @@ -966,14 +977,22 @@ /// <returns>string[] of Macros</returns> public static string[] GetMacroList() { - string[] files = Directory.GetFiles(AppDataFolder + MacroFolder, "*" + MacroExtension); - string[] list = new string[files.Length]; + try + { + string[] files = Directory.GetFiles(AppDataFolder + MacroFolder, "*" + MacroExtension); + string[] list = new string[files.Length]; - int i = 0; - foreach (string file in files) - list[i++] = MacroFolder + Path.GetFileNameWithoutExtension(file).ToUpperInvariant(); + int i = 0; + foreach (string file in files) + list[i++] = MacroFolder + Path.GetFileNameWithoutExtension(file).ToUpperInvariant(); - return list; + return list; + } + catch (Exception ex) + { + Log.Error(ex.Message); + return null; + } } /// <summary> @@ -1003,16 +1022,11 @@ /// <returns>Modified string with escape codes processed</returns> public static string ReplaceEscapeCodes(string input) { - if (input == null) + if (String.IsNullOrEmpty(input)) { - Log.Error("TV3MceBlaster: Null escape code string"); + Log.Error("TV3MceBlaster: Null or empty escape code string"); return ""; } - else if (input.Length == 0) - { - Log.Info("TV3MceBlaster: Empty escape code string"); - return ""; - } bool inEscapeCode = false; bool inHexCode = false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ze...@us...> - 2007-02-12 20:12:06
|
Revision: 113 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=113&view=rev Author: zebons Date: 2007-02-12 12:11:45 -0800 (Mon, 12 Feb 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MyFilms/AntMovieCatalog.Designer.cs trunk/plugins/MyFilms/AntMovieCatalog.cs trunk/plugins/MyFilms/AntMovieCatalog.xsd trunk/plugins/MyFilms/MesFilms.cs trunk/plugins/MyFilms/MesFilms.csproj trunk/plugins/MyFilms/MesFilms.suo trunk/plugins/MyFilms/MesFilmsDetail.cs trunk/plugins/MyFilms/MesFilmsSetup.Designer.cs trunk/plugins/MyFilms/MesFilmsSetup.cs trunk/plugins/MyFilms/MesFilmsSetup.resx trunk/plugins/MyFilms/Properties/AssemblyInfo.cs trunk/plugins/WebBrowser/GUIWebBrowser.suo Modified: trunk/plugins/MyFilms/AntMovieCatalog.Designer.cs =================================================================== --- trunk/plugins/MyFilms/AntMovieCatalog.Designer.cs 2007-02-12 17:42:33 UTC (rev 112) +++ trunk/plugins/MyFilms/AntMovieCatalog.Designer.cs 2007-02-12 20:11:45 UTC (rev 113) @@ -1135,7 +1135,7 @@ [System.Diagnostics.DebuggerNonUserCodeAttribute()] public MovieRow AddMovieRow( - int Number, + string Number, string Checked, string MediaLabel, string MediaType, @@ -1266,7 +1266,7 @@ [System.Diagnostics.DebuggerNonUserCodeAttribute()] private void InitClass() { - this.columnNumber = new System.Data.DataColumn("Number", typeof(int), null, System.Data.MappingType.Attribute); + this.columnNumber = new System.Data.DataColumn("Number", typeof(string), null, System.Data.MappingType.Attribute); base.Columns.Add(this.columnNumber); this.columnChecked = new System.Data.DataColumn("Checked", typeof(string), null, System.Data.MappingType.Attribute); base.Columns.Add(this.columnChecked); @@ -1609,10 +1609,10 @@ } [System.Diagnostics.DebuggerNonUserCodeAttribute()] - public int Number { + public string Number { get { try { - return ((int)(this[this.tableMovie.NumberColumn])); + return ((string)(this[this.tableMovie.NumberColumn])); } catch (System.InvalidCastException e) { throw new System.Data.StrongTypingException("La valeur pour la colonne \'Number\' dans la table \'Movie\' est DBNull.", e); Modified: trunk/plugins/MyFilms/AntMovieCatalog.cs =================================================================== (Binary files differ) Modified: trunk/plugins/MyFilms/AntMovieCatalog.xsd =================================================================== --- trunk/plugins/MyFilms/AntMovieCatalog.xsd 2007-02-12 17:42:33 UTC (rev 112) +++ trunk/plugins/MyFilms/AntMovieCatalog.xsd 2007-02-12 20:11:45 UTC (rev 113) @@ -18,58 +18,58 @@ <xs:element name="Catalog" msprop:Generator_UserTableName="Catalog" msprop:Generator_RowDeletedName="CatalogRowDeleted" msprop:Generator_RowChangedName="CatalogRowChanged" msprop:Generator_RowClassName="CatalogRow" msprop:Generator_RowChangingName="CatalogRowChanging" msprop:Generator_RowEvArgName="CatalogRowChangeEvent" msprop:Generator_RowEvHandlerName="CatalogRowChangeEventHandler" msprop:Generator_TableClassName="CatalogDataTable" msprop:Generator_TableVarName="tableCatalog" msprop:Generator_RowDeletingName="CatalogRowDeleting" msprop:Generator_TablePropName="Catalog"> <xs:complexType> <xs:sequence> - <xs:element name="Properties" msprop:Generator_UserColumnName="Properties" msprop:Generator_ColumnVarNameInTable="columnProperties" msprop:Generator_ColumnPropNameInRow="Properties" msprop:Generator_ColumnPropNameInTable="PropertiesColumn" type="xs:string" minOccurs="0" msdata:Ordinal="1" /> + <xs:element name="Properties" msprop:Generator_UserColumnName="Properties" msprop:Generator_ColumnPropNameInRow="Properties" msprop:Generator_ColumnVarNameInTable="columnProperties" msprop:Generator_ColumnPropNameInTable="PropertiesColumn" type="xs:string" minOccurs="0" msdata:Ordinal="1" /> <xs:element name="Contents" msprop:Generator_UserTableName="Contents" msprop:Generator_RowDeletedName="ContentsRowDeleted" msprop:Generator_RowChangedName="ContentsRowChanged" msprop:Generator_RowClassName="ContentsRow" msprop:Generator_RowChangingName="ContentsRowChanging" msprop:Generator_RowEvArgName="ContentsRowChangeEvent" msprop:Generator_RowEvHandlerName="ContentsRowChangeEventHandler" msprop:Generator_TableClassName="ContentsDataTable" msprop:Generator_TableVarName="tableContents" msprop:Generator_RowDeletingName="ContentsRowDeleting" msprop:Generator_TablePropName="Contents" minOccurs="0" maxOccurs="unbounded"> <xs:complexType> <xs:sequence> <xs:element name="Movie" msprop:Generator_UserTableName="Movie" msprop:Generator_RowDeletedName="MovieRowDeleted" msprop:Generator_RowChangedName="MovieRowChanged" msprop:Generator_RowClassName="MovieRow" msprop:Generator_RowChangingName="MovieRowChanging" msprop:Generator_RowEvArgName="MovieRowChangeEvent" msprop:Generator_RowEvHandlerName="MovieRowChangeEventHandler" msprop:Generator_TableClassName="MovieDataTable" msprop:Generator_TableVarName="tableMovie" msprop:Generator_RowDeletingName="MovieRowDeleting" msprop:Generator_TablePropName="Movie" minOccurs="0" maxOccurs="unbounded"> <xs:complexType> <xs:sequence> - <xs:element name="DateAdded" msdata:ReadOnly="true" msdata:Expression="Convert(Date,'System.DateTime')" msprop:Generator_UserColumnName="DateAdded" msprop:Generator_ColumnVarNameInTable="columnDateAdded" msprop:Generator_ColumnPropNameInRow="DateAdded" msprop:Generator_ColumnPropNameInTable="DateAddedColumn" type="xs:dateTime" minOccurs="0" msdata:Ordinal="29" /> + <xs:element name="DateAdded" msdata:ReadOnly="true" msdata:Expression="Convert(Date,'System.DateTime')" msprop:Generator_UserColumnName="DateAdded" msprop:Generator_ColumnPropNameInRow="DateAdded" msprop:Generator_ColumnVarNameInTable="columnDateAdded" msprop:Generator_ColumnPropNameInTable="DateAddedColumn" type="xs:dateTime" minOccurs="0" msdata:Ordinal="29" /> </xs:sequence> - <xs:attribute name="Number" msprop:Generator_UserColumnName="Number" msprop:Generator_ColumnVarNameInTable="columnNumber" msprop:Generator_ColumnPropNameInRow="Number" msprop:Generator_ColumnPropNameInTable="NumberColumn" type="xs:int" /> - <xs:attribute name="Checked" msprop:Generator_UserColumnName="Checked" msprop:Generator_ColumnVarNameInTable="columnChecked" msprop:Generator_ColumnPropNameInRow="Checked" msprop:Generator_ColumnPropNameInTable="CheckedColumn" type="xs:string" /> - <xs:attribute name="MediaLabel" msprop:Generator_UserColumnName="MediaLabel" msprop:Generator_ColumnPropNameInRow="MediaLabel" msprop:Generator_ColumnVarNameInTable="columnMediaLabel" msprop:Generator_ColumnPropNameInTable="MediaLabelColumn" type="xs:string" /> - <xs:attribute name="MediaType" msprop:Generator_UserColumnName="MediaType" msprop:Generator_ColumnVarNameInTable="columnMediaType" msprop:Generator_ColumnPropNameInRow="MediaType" msprop:Generator_ColumnPropNameInTable="MediaTypeColumn" type="xs:string" /> - <xs:attribute name="Source" msprop:Generator_UserColumnName="Source" msprop:Generator_ColumnPropNameInRow="Source" msprop:Generator_ColumnVarNameInTable="columnSource" msprop:Generator_ColumnPropNameInTable="SourceColumn" type="xs:string" /> - <xs:attribute name="Date" msprop:Generator_UserColumnName="Date" msprop:Generator_ColumnVarNameInTable="columnDate" msprop:Generator_ColumnPropNameInRow="Date" msprop:Generator_ColumnPropNameInTable="DateColumn" type="xs:string" /> - <xs:attribute name="Borrower" msprop:Generator_UserColumnName="Borrower" msprop:Generator_ColumnVarNameInTable="columnBorrower" msprop:Generator_ColumnPropNameInRow="Borrower" msprop:Generator_ColumnPropNameInTable="BorrowerColumn" type="xs:string" /> - <xs:attribute name="Rating" msprop:Generator_UserColumnName="Rating" msprop:Generator_ColumnVarNameInTable="columnRating" msprop:Generator_ColumnPropNameInRow="Rating" msprop:Generator_ColumnPropNameInTable="RatingColumn" type="xs:decimal" /> - <xs:attribute name="OriginalTitle" msprop:Generator_UserColumnName="OriginalTitle" msprop:Generator_ColumnVarNameInTable="columnOriginalTitle" msprop:Generator_ColumnPropNameInRow="OriginalTitle" msprop:Generator_ColumnPropNameInTable="OriginalTitleColumn" type="xs:string" /> - <xs:attribute name="TranslatedTitle" msprop:Generator_UserColumnName="TranslatedTitle" msprop:Generator_ColumnVarNameInTable="columnTranslatedTitle" msprop:Generator_ColumnPropNameInRow="TranslatedTitle" msprop:Generator_ColumnPropNameInTable="TranslatedTitleColumn" type="xs:string" /> - <xs:attribute name="FormattedTitle" msprop:Generator_UserColumnName="FormattedTitle" msprop:Generator_ColumnVarNameInTable="columnFormattedTitle" msprop:Generator_ColumnPropNameInRow="FormattedTitle" msprop:Generator_ColumnPropNameInTable="FormattedTitleColumn" type="xs:string" /> - <xs:attribute name="Director" msprop:Generator_UserColumnName="Director" msprop:Generator_ColumnVarNameInTable="columnDirector" msprop:Generator_ColumnPropNameInRow="Director" msprop:Generator_ColumnPropNameInTable="DirectorColumn" type="xs:string" /> - <xs:attribute name="Producer" msprop:Generator_UserColumnName="Producer" msprop:Generator_ColumnVarNameInTable="columnProducer" msprop:Generator_ColumnPropNameInRow="Producer" msprop:Generator_ColumnPropNameInTable="ProducerColumn" type="xs:string" /> - <xs:attribute name="Country" msprop:Generator_UserColumnName="Country" msprop:Generator_ColumnVarNameInTable="columnCountry" msprop:Generator_ColumnPropNameInRow="Country" msprop:Generator_ColumnPropNameInTable="CountryColumn" type="xs:string" /> - <xs:attribute name="Category" msprop:Generator_UserColumnName="Category" msprop:Generator_ColumnVarNameInTable="columnCategory" msprop:Generator_ColumnPropNameInRow="Category" msprop:Generator_ColumnPropNameInTable="CategoryColumn" type="xs:string" /> - <xs:attribute name="Year" msprop:Generator_UserColumnName="Year" msprop:Generator_ColumnVarNameInTable="columnYear" msprop:Generator_ColumnPropNameInRow="Year" msprop:Generator_ColumnPropNameInTable="YearColumn" type="xs:string" /> - <xs:attribute name="Length" msprop:Generator_UserColumnName="Length" msprop:Generator_ColumnVarNameInTable="columnLength" msprop:Generator_ColumnPropNameInRow="Length" msprop:Generator_ColumnPropNameInTable="LengthColumn" type="xs:string" /> - <xs:attribute name="Actors" msprop:Generator_UserColumnName="Actors" msprop:Generator_ColumnVarNameInTable="columnActors" msprop:Generator_ColumnPropNameInRow="Actors" msprop:Generator_ColumnPropNameInTable="ActorsColumn" type="xs:string" /> - <xs:attribute name="URL" msprop:Generator_UserColumnName="URL" msprop:Generator_ColumnPropNameInRow="URL" msprop:Generator_ColumnVarNameInTable="columnURL" msprop:Generator_ColumnPropNameInTable="URLColumn" type="xs:string" /> - <xs:attribute name="Description" msprop:Generator_UserColumnName="Description" msprop:Generator_ColumnVarNameInTable="columnDescription" msprop:Generator_ColumnPropNameInRow="Description" msprop:Generator_ColumnPropNameInTable="DescriptionColumn" type="xs:string" /> - <xs:attribute name="Comments" msprop:Generator_UserColumnName="Comments" msprop:Generator_ColumnVarNameInTable="columnComments" msprop:Generator_ColumnPropNameInRow="Comments" msprop:Generator_ColumnPropNameInTable="CommentsColumn" type="xs:string" /> - <xs:attribute name="VideoFormat" msprop:Generator_UserColumnName="VideoFormat" msprop:Generator_ColumnVarNameInTable="columnVideoFormat" msprop:Generator_ColumnPropNameInRow="VideoFormat" msprop:Generator_ColumnPropNameInTable="VideoFormatColumn" type="xs:string" /> - <xs:attribute name="VideoBitrate" msprop:Generator_UserColumnName="VideoBitrate" msprop:Generator_ColumnVarNameInTable="columnVideoBitrate" msprop:Generator_ColumnPropNameInRow="VideoBitrate" msprop:Generator_ColumnPropNameInTable="VideoBitrateColumn" type="xs:string" /> - <xs:attribute name="AudioFormat" msprop:Generator_UserColumnName="AudioFormat" msprop:Generator_ColumnVarNameInTable="columnAudioFormat" msprop:Generator_ColumnPropNameInRow="AudioFormat" msprop:Generator_ColumnPropNameInTable="AudioFormatColumn" type="xs:string" /> - <xs:attribute name="AudioBitrate" msprop:Generator_UserColumnName="AudioBitrate" msprop:Generator_ColumnVarNameInTable="columnAudioBitrate" msprop:Generator_ColumnPropNameInRow="AudioBitrate" msprop:Generator_ColumnPropNameInTable="AudioBitrateColumn" type="xs:string" /> - <xs:attribute name="Resolution" msprop:Generator_UserColumnName="Resolution" msprop:Generator_ColumnVarNameInTable="columnResolution" msprop:Generator_ColumnPropNameInRow="Resolution" msprop:Generator_ColumnPropNameInTable="ResolutionColumn" type="xs:string" /> - <xs:attribute name="Framerate" msprop:Generator_UserColumnName="Framerate" msprop:Generator_ColumnVarNameInTable="columnFramerate" msprop:Generator_ColumnPropNameInRow="Framerate" msprop:Generator_ColumnPropNameInTable="FramerateColumn" type="xs:string" /> - <xs:attribute name="Languages" msprop:Generator_UserColumnName="Languages" msprop:Generator_ColumnPropNameInRow="Languages" msprop:Generator_ColumnVarNameInTable="columnLanguages" msprop:Generator_ColumnPropNameInTable="LanguagesColumn" type="xs:string" /> - <xs:attribute name="Subtitles" msprop:Generator_UserColumnName="Subtitles" msprop:Generator_ColumnPropNameInRow="Subtitles" msprop:Generator_ColumnVarNameInTable="columnSubtitles" msprop:Generator_ColumnPropNameInTable="SubtitlesColumn" type="xs:string" /> - <xs:attribute name="Size" msprop:Generator_UserColumnName="Size" msprop:Generator_ColumnVarNameInTable="columnSize" msprop:Generator_ColumnPropNameInRow="Size" msprop:Generator_ColumnPropNameInTable="SizeColumn" type="xs:string" /> - <xs:attribute name="Disks" msprop:Generator_UserColumnName="Disks" msprop:Generator_ColumnVarNameInTable="columnDisks" msprop:Generator_ColumnPropNameInRow="Disks" msprop:Generator_ColumnPropNameInTable="DisksColumn" type="xs:string" /> - <xs:attribute name="Picture" msprop:Generator_UserColumnName="Picture" msprop:Generator_ColumnVarNameInTable="columnPicture" msprop:Generator_ColumnPropNameInRow="Picture" msprop:Generator_ColumnPropNameInTable="PictureColumn" type="xs:string" /> - <xs:attribute name="Contents_Id" msprop:Generator_UserColumnName="Contents_Id" msprop:Generator_ColumnVarNameInTable="columnContents_Id" msprop:Generator_ColumnPropNameInRow="Contents_Id" msprop:Generator_ColumnPropNameInTable="Contents_IdColumn" type="xs:int" use="prohibited" /> + <xs:attribute name="Number" msprop:Generator_UserColumnName="Number" msprop:Generator_ColumnPropNameInRow="Number" msprop:Generator_ColumnVarNameInTable="columnNumber" msprop:Generator_ColumnPropNameInTable="NumberColumn" type="xs:string" /> + <xs:attribute name="Checked" msprop:Generator_UserColumnName="Checked" msprop:Generator_ColumnPropNameInRow="Checked" msprop:Generator_ColumnVarNameInTable="columnChecked" msprop:Generator_ColumnPropNameInTable="CheckedColumn" type="xs:string" /> + <xs:attribute name="MediaLabel" msprop:Generator_UserColumnName="MediaLabel" msprop:Generator_ColumnVarNameInTable="columnMediaLabel" msprop:Generator_ColumnPropNameInRow="MediaLabel" msprop:Generator_ColumnPropNameInTable="MediaLabelColumn" type="xs:string" /> + <xs:attribute name="MediaType" msprop:Generator_UserColumnName="MediaType" msprop:Generator_ColumnPropNameInRow="MediaType" msprop:Generator_ColumnVarNameInTable="columnMediaType" msprop:Generator_ColumnPropNameInTable="MediaTypeColumn" type="xs:string" /> + <xs:attribute name="Source" msprop:Generator_UserColumnName="Source" msprop:Generator_ColumnVarNameInTable="columnSource" msprop:Generator_ColumnPropNameInRow="Source" msprop:Generator_ColumnPropNameInTable="SourceColumn" type="xs:string" /> + <xs:attribute name="Date" msprop:Generator_UserColumnName="Date" msprop:Generator_ColumnPropNameInRow="Date" msprop:Generator_ColumnVarNameInTable="columnDate" msprop:Generator_ColumnPropNameInTable="DateColumn" type="xs:string" /> + <xs:attribute name="Borrower" msprop:Generator_UserColumnName="Borrower" msprop:Generator_ColumnPropNameInRow="Borrower" msprop:Generator_ColumnVarNameInTable="columnBorrower" msprop:Generator_ColumnPropNameInTable="BorrowerColumn" type="xs:string" /> + <xs:attribute name="Rating" msprop:Generator_UserColumnName="Rating" msprop:Generator_ColumnPropNameInRow="Rating" msprop:Generator_ColumnVarNameInTable="columnRating" msprop:Generator_ColumnPropNameInTable="RatingColumn" type="xs:decimal" /> + <xs:attribute name="OriginalTitle" msprop:Generator_UserColumnName="OriginalTitle" msprop:Generator_ColumnPropNameInRow="OriginalTitle" msprop:Generator_ColumnVarNameInTable="columnOriginalTitle" msprop:Generator_ColumnPropNameInTable="OriginalTitleColumn" type="xs:string" /> + <xs:attribute name="TranslatedTitle" msprop:Generator_UserColumnName="TranslatedTitle" msprop:Generator_ColumnPropNameInRow="TranslatedTitle" msprop:Generator_ColumnVarNameInTable="columnTranslatedTitle" msprop:Generator_ColumnPropNameInTable="TranslatedTitleColumn" type="xs:string" /> + <xs:attribute name="FormattedTitle" msprop:Generator_UserColumnName="FormattedTitle" msprop:Generator_ColumnPropNameInRow="FormattedTitle" msprop:Generator_ColumnVarNameInTable="columnFormattedTitle" msprop:Generator_ColumnPropNameInTable="FormattedTitleColumn" type="xs:string" /> + <xs:attribute name="Director" msprop:Generator_UserColumnName="Director" msprop:Generator_ColumnPropNameInRow="Director" msprop:Generator_ColumnVarNameInTable="columnDirector" msprop:Generator_ColumnPropNameInTable="DirectorColumn" type="xs:string" /> + <xs:attribute name="Producer" msprop:Generator_UserColumnName="Producer" msprop:Generator_ColumnPropNameInRow="Producer" msprop:Generator_ColumnVarNameInTable="columnProducer" msprop:Generator_ColumnPropNameInTable="ProducerColumn" type="xs:string" /> + <xs:attribute name="Country" msprop:Generator_UserColumnName="Country" msprop:Generator_ColumnPropNameInRow="Country" msprop:Generator_ColumnVarNameInTable="columnCountry" msprop:Generator_ColumnPropNameInTable="CountryColumn" type="xs:string" /> + <xs:attribute name="Category" msprop:Generator_UserColumnName="Category" msprop:Generator_ColumnPropNameInRow="Category" msprop:Generator_ColumnVarNameInTable="columnCategory" msprop:Generator_ColumnPropNameInTable="CategoryColumn" type="xs:string" /> + <xs:attribute name="Year" msprop:Generator_UserColumnName="Year" msprop:Generator_ColumnPropNameInRow="Year" msprop:Generator_ColumnVarNameInTable="columnYear" msprop:Generator_ColumnPropNameInTable="YearColumn" type="xs:string" /> + <xs:attribute name="Length" msprop:Generator_UserColumnName="Length" msprop:Generator_ColumnPropNameInRow="Length" msprop:Generator_ColumnVarNameInTable="columnLength" msprop:Generator_ColumnPropNameInTable="LengthColumn" type="xs:string" /> + <xs:attribute name="Actors" msprop:Generator_UserColumnName="Actors" msprop:Generator_ColumnPropNameInRow="Actors" msprop:Generator_ColumnVarNameInTable="columnActors" msprop:Generator_ColumnPropNameInTable="ActorsColumn" type="xs:string" /> + <xs:attribute name="URL" msprop:Generator_UserColumnName="URL" msprop:Generator_ColumnVarNameInTable="columnURL" msprop:Generator_ColumnPropNameInRow="URL" msprop:Generator_ColumnPropNameInTable="URLColumn" type="xs:string" /> + <xs:attribute name="Description" msprop:Generator_UserColumnName="Description" msprop:Generator_ColumnPropNameInRow="Description" msprop:Generator_ColumnVarNameInTable="columnDescription" msprop:Generator_ColumnPropNameInTable="DescriptionColumn" type="xs:string" /> + <xs:attribute name="Comments" msprop:Generator_UserColumnName="Comments" msprop:Generator_ColumnPropNameInRow="Comments" msprop:Generator_ColumnVarNameInTable="columnComments" msprop:Generator_ColumnPropNameInTable="CommentsColumn" type="xs:string" /> + <xs:attribute name="VideoFormat" msprop:Generator_UserColumnName="VideoFormat" msprop:Generator_ColumnPropNameInRow="VideoFormat" msprop:Generator_ColumnVarNameInTable="columnVideoFormat" msprop:Generator_ColumnPropNameInTable="VideoFormatColumn" type="xs:string" /> + <xs:attribute name="VideoBitrate" msprop:Generator_UserColumnName="VideoBitrate" msprop:Generator_ColumnPropNameInRow="VideoBitrate" msprop:Generator_ColumnVarNameInTable="columnVideoBitrate" msprop:Generator_ColumnPropNameInTable="VideoBitrateColumn" type="xs:string" /> + <xs:attribute name="AudioFormat" msprop:Generator_UserColumnName="AudioFormat" msprop:Generator_ColumnPropNameInRow="AudioFormat" msprop:Generator_ColumnVarNameInTable="columnAudioFormat" msprop:Generator_ColumnPropNameInTable="AudioFormatColumn" type="xs:string" /> + <xs:attribute name="AudioBitrate" msprop:Generator_UserColumnName="AudioBitrate" msprop:Generator_ColumnPropNameInRow="AudioBitrate" msprop:Generator_ColumnVarNameInTable="columnAudioBitrate" msprop:Generator_ColumnPropNameInTable="AudioBitrateColumn" type="xs:string" /> + <xs:attribute name="Resolution" msprop:Generator_UserColumnName="Resolution" msprop:Generator_ColumnPropNameInRow="Resolution" msprop:Generator_ColumnVarNameInTable="columnResolution" msprop:Generator_ColumnPropNameInTable="ResolutionColumn" type="xs:string" /> + <xs:attribute name="Framerate" msprop:Generator_UserColumnName="Framerate" msprop:Generator_ColumnPropNameInRow="Framerate" msprop:Generator_ColumnVarNameInTable="columnFramerate" msprop:Generator_ColumnPropNameInTable="FramerateColumn" type="xs:string" /> + <xs:attribute name="Languages" msprop:Generator_UserColumnName="Languages" msprop:Generator_ColumnVarNameInTable="columnLanguages" msprop:Generator_ColumnPropNameInRow="Languages" msprop:Generator_ColumnPropNameInTable="LanguagesColumn" type="xs:string" /> + <xs:attribute name="Subtitles" msprop:Generator_UserColumnName="Subtitles" msprop:Generator_ColumnVarNameInTable="columnSubtitles" msprop:Generator_ColumnPropNameInRow="Subtitles" msprop:Generator_ColumnPropNameInTable="SubtitlesColumn" type="xs:string" /> + <xs:attribute name="Size" msprop:Generator_UserColumnName="Size" msprop:Generator_ColumnPropNameInRow="Size" msprop:Generator_ColumnVarNameInTable="columnSize" msprop:Generator_ColumnPropNameInTable="SizeColumn" type="xs:string" /> + <xs:attribute name="Disks" msprop:Generator_UserColumnName="Disks" msprop:Generator_ColumnPropNameInRow="Disks" msprop:Generator_ColumnVarNameInTable="columnDisks" msprop:Generator_ColumnPropNameInTable="DisksColumn" type="xs:string" /> + <xs:attribute name="Picture" msprop:Generator_UserColumnName="Picture" msprop:Generator_ColumnPropNameInRow="Picture" msprop:Generator_ColumnVarNameInTable="columnPicture" msprop:Generator_ColumnPropNameInTable="PictureColumn" type="xs:string" /> + <xs:attribute name="Contents_Id" msprop:Generator_UserColumnName="Contents_Id" msprop:Generator_ColumnPropNameInRow="Contents_Id" msprop:Generator_ColumnVarNameInTable="columnContents_Id" msprop:Generator_ColumnPropNameInTable="Contents_IdColumn" type="xs:int" use="prohibited" /> </xs:complexType> </xs:element> </xs:sequence> - <xs:attribute name="Contents_Id" msdata:AutoIncrement="true" msprop:Generator_UserColumnName="Contents_Id" msprop:Generator_ColumnVarNameInTable="columnContents_Id" msprop:Generator_ColumnPropNameInRow="Contents_Id" msprop:Generator_ColumnPropNameInTable="Contents_IdColumn" type="xs:int" msdata:AllowDBNull="false" use="prohibited" /> - <xs:attribute name="Catalog_Id" msprop:Generator_UserColumnName="Catalog_Id" msprop:Generator_ColumnVarNameInTable="columnCatalog_Id" msprop:Generator_ColumnPropNameInRow="Catalog_Id" msprop:Generator_ColumnPropNameInTable="Catalog_IdColumn" type="xs:int" use="prohibited" /> + <xs:attribute name="Contents_Id" msdata:AutoIncrement="true" msprop:Generator_UserColumnName="Contents_Id" msprop:Generator_ColumnPropNameInRow="Contents_Id" msprop:Generator_ColumnVarNameInTable="columnContents_Id" msprop:Generator_ColumnPropNameInTable="Contents_IdColumn" type="xs:int" msdata:AllowDBNull="false" use="prohibited" /> + <xs:attribute name="Catalog_Id" msprop:Generator_UserColumnName="Catalog_Id" msprop:Generator_ColumnPropNameInRow="Catalog_Id" msprop:Generator_ColumnVarNameInTable="columnCatalog_Id" msprop:Generator_ColumnPropNameInTable="Catalog_IdColumn" type="xs:int" use="prohibited" /> </xs:complexType> </xs:element> </xs:sequence> - <xs:attribute name="AntMovieCatalog_Id" msprop:Generator_UserColumnName="AntMovieCatalog_Id" msprop:Generator_ColumnVarNameInTable="columnAntMovieCatalog_Id" msprop:Generator_ColumnPropNameInRow="AntMovieCatalog_Id" msprop:Generator_ColumnPropNameInTable="AntMovieCatalog_IdColumn" type="xs:int" use="prohibited" /> - <xs:attribute name="Catalog_Id" msdata:AutoIncrement="true" msprop:Generator_UserColumnName="Catalog_Id" msprop:Generator_ColumnVarNameInTable="columnCatalog_Id" msprop:Generator_ColumnPropNameInRow="Catalog_Id" msprop:Generator_ColumnPropNameInTable="Catalog_IdColumn" type="xs:int" msdata:AllowDBNull="false" use="prohibited" /> + <xs:attribute name="AntMovieCatalog_Id" msprop:Generator_UserColumnName="AntMovieCatalog_Id" msprop:Generator_ColumnPropNameInRow="AntMovieCatalog_Id" msprop:Generator_ColumnVarNameInTable="columnAntMovieCatalog_Id" msprop:Generator_ColumnPropNameInTable="AntMovieCatalog_IdColumn" type="xs:int" use="prohibited" /> + <xs:attribute name="Catalog_Id" msdata:AutoIncrement="true" msprop:Generator_UserColumnName="Catalog_Id" msprop:Generator_ColumnPropNameInRow="Catalog_Id" msprop:Generator_ColumnVarNameInTable="columnCatalog_Id" msprop:Generator_ColumnPropNameInTable="Catalog_IdColumn" type="xs:int" msdata:AllowDBNull="false" use="prohibited" /> </xs:complexType> </xs:element> </xs:choice> Modified: trunk/plugins/MyFilms/MesFilms.cs =================================================================== --- trunk/plugins/MyFilms/MesFilms.cs 2007-02-12 17:42:33 UTC (rev 112) +++ trunk/plugins/MyFilms/MesFilms.cs 2007-02-12 20:11:45 UTC (rev 113) @@ -4,8 +4,8 @@ using System.Text.RegularExpressions; using System.Globalization; using MediaPortal.GUI.Library; +using System.Xml; - using System.IO; using System.Data; using MediaPortal.Dialogs; @@ -87,6 +87,8 @@ string StrViewText1 = null; string StrViewItem2 = null; string StrViewText2 = null; + string StrViewDfltItem = null; + string StrViewDfltText = null; string StrFileXml = null; string StrPathImg = null; string StrSort = null; @@ -103,6 +105,8 @@ string FileImage = "9999"; private AntMovieCatalog mydivx; private string StrPluginName = "Films"; + private string CurrentConfig; + private int NbConfig; #endregion #region events @@ -168,9 +172,9 @@ public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) { string wPluginName = StrPluginName; - using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("MediaPortal.xml")) + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("MyFilms.xml")) { - wPluginName = xmlreader.GetValueAsString("MesFilms", "pluginName", "My Films"); + wPluginName = xmlreader.GetValueAsString("MyFilms", "PluginName", "My Films"); } strButtonText = wPluginName; @@ -225,12 +229,7 @@ BtnSrtBy.IsAscending = false; Afficherliste(); return; - // TxtSelect.Label = StrTxtSelect; - // boolselect = false; - // boolreturn = false; - // Afficherliste(); - // return; - } + } if (boolreturn) { boolreturn = false; @@ -295,90 +294,36 @@ base.OnMessage(messageType); g_Player.PlayBackStopped += new MediaPortal.Player.g_Player.StoppedHandler(OnPlayBackStopped); g_Player.PlayBackEnded += new MediaPortal.Player.g_Player.EndedHandler(OnPlayBackEnded); + mydivx = new AntMovieCatalog(); if (g_Player.Playing) affich_overlay(); else supprim_overlay(); - string StrFilterItem1 = null; - string StrFilterText1 = null; - string StrFilterItem2 = null; - string StrFilterText2 = null; - using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("MediaPortal.xml")) + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("MyFilms.xml")) { - StrStorage = xmlreader.GetValueAsString("MesFilms", "AntStorage", ""); - StrIdentItem = xmlreader.GetValueAsString("MesFilms", "AntIdentItem", ""); - StrTitle1 = xmlreader.GetValueAsString("MesFilms", "AntTitle1", ""); - StrFilterItem1 = xmlreader.GetValueAsString("MesFilms", "AntFilterItem1", ""); - StrTSort1 = xmlreader.GetValueAsString("MesFilms", "AntTSort", ""); - StrSort1 = xmlreader.GetValueAsString("MesFilms", "AntSort", ""); - StrFilterText1 = xmlreader.GetValueAsString("MesFilms", "AntFilterText1", ""); - StrFilterItem2 = xmlreader.GetValueAsString("MesFilms", "AntFilterItem2", ""); - StrFilterText2 = xmlreader.GetValueAsString("MesFilms", "AntFilterText2", ""); - StrViewItem1 = xmlreader.GetValueAsString("MesFilms", "AntViewItem1", ""); - StrViewText1 = xmlreader.GetValueAsString("MesFilms", "AntViewText1", ""); - StrViewItem2 = xmlreader.GetValueAsString("MesFilms", "AntViewItem2", ""); - StrViewText2 = xmlreader.GetValueAsString("MesFilms", "AntViewText2", ""); - StrFileXml = xmlreader.GetValueAsString("MesFilms", "AntCatalog", ""); - StrPathImg = xmlreader.GetValueAsString("MesFilms", "AntPicture", ""); - StrSelect = xmlreader.GetValueAsString("MesFilms", "StrSelect", ""); - StrSort = xmlreader.GetValueAsString("MesFilms", "StrSort", ""); - CurrentSortMethod = xmlreader.GetValueAsString("MesFilms", "CurrentSortMethod", ""); - TxtSelect.Label = xmlreader.GetValueAsString("MesFilms", "Selection", ""); - StrSortSens = xmlreader.GetValueAsString("MesFilms", "StrSortSens", ""); - l_index = xmlreader.GetValueAsInt("MesFilms", "IndexItem", -1); - } - mydivx = new AntMovieCatalog(); - if (!ControlFichierDonn\xE9es()) - base.OnPreviousWindow(); - try - { - mydivx.ReadXml(StrFileXml); - } - catch - { - GUIDialogOK dlgOk = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK); - dlgOk.SetHeading("Error");//my videos - dlgOk.SetLine(1, "Invalid character in the XML File after enreg : " + mydivx.Movie[mydivx.Movie.Count - 1]["Number"]); - dlgOk.SetLine(2, "Verify the few next enregs with ANT Movie Catalog"); - dlgOk.DoModal(GetID); - } - StrDfltSelect = ""; - if (StrSort1.Length == 0) - StrSort1 = "(none)"; - if (!(StrFilterItem1 == null) && !(StrFilterItem1 == "(none)") && !(StrFilterItem1 == "")) - StrDfltSelect = "(" + StrFilterItem1 + " not like '" + StrFilterText1 + "' or " + StrFilterItem1 + " is null) AND "; - if (!(StrFilterItem2 == null) && !(StrFilterItem2 == "(none)") && !(StrFilterItem2 == "")) - StrDfltSelect = "(" + StrDfltSelect + StrFilterItem2 + " not like '" + StrFilterText2 + "' or " + StrFilterItem2 + " is null) AND "; - if (StrSelect == "") - StrSelect = StrTitle1.ToString() + " not like ''"; - if (StrSort == "") - StrSort = StrTitle1; - if (StrSortSens == "") - StrSortSens = " ASC"; - if (CurrentSortMethod == "") - CurrentSortMethod = GUILocalizeStrings.Get(103); - else - BtnSrtBy.Label = CurrentSortMethod.ToString(); - string BtnSearchT = GUILocalizeStrings.Get(137) + " " + GUILocalizeStrings.Get(342); - string BtnSearchA = GUILocalizeStrings.Get(137) + " " + GUILocalizeStrings.Get(344); - GUIButtonControl.SetControlLabel(GetID, (int)Controls.CTRL_BtnSearchT, BtnSearchT); - GUIButtonControl.SetControlLabel(GetID, (int)Controls.CTRL_BtnSearchA, BtnSearchA); - // TxtSelect.HorizontalAlignment = MediaPortal.Drawing.HorizontalAlignment.Right; - BtnSrtBy.SortChanged += new SortEventHandler(SortChanged); - if (PreviousWindowId == 7987) - Afficherliste(); - else - { - StrSelect = StrTitle1.ToString() + " not like ''"; - TxtSelect.Label = StrTxtSelect = " "; - boolselect = false; - l_index = -1; - BtnSrtBy.Label = CurrentSortMethod; - if (StrSortSens == " ASC") - BtnSrtBy.IsAscending = true; + if (PreviousWindowId == 7987) + { + CurrentConfig = xmlreader.GetValueAsString("MyFilms", "Current_Config", ""); + Load_Config(CurrentConfig); + Fin_Charge_Init(false); + } else - BtnSrtBy.IsAscending = false; - Afficherliste(); + { + CurrentConfig = xmlreader.GetValueAsString("MyFilms", "Default_Config", ""); + NbConfig = xmlreader.GetValueAsInt("MyFilms", "NbConfig", 0); + if ((CurrentConfig == "") && (NbConfig == 0)) + { + StrFileXml = ""; + Fin_Charge_Init(false); + } + else + { + if (CurrentConfig == "") + CurrentConfig = Choice_Config(); + Load_Config(CurrentConfig); + Fin_Charge_Init(true); + } + } } return true; @@ -712,7 +657,7 @@ //---------------------------------------------------------------------------------------- private void affichage_Lstdetail(int w_item) { - DataRow[] r = LectureDonn\xE9es(StrDfltSelect + StrSelect, StrSort, StrSortSens); + DataRow[] r = LectureDonn\xE9es(StrSelect, StrSort, StrSortSens); if (r.Length == 0) { masquage_Lstdetail(); @@ -859,128 +804,51 @@ //-------------------------------------------------------------------------------------------- private void Selection_type_Video() { + ArrayList choice_view = new ArrayList(); GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); if (dlg == null) return; dlg.Reset(); dlg.SetHeading(924); // menu dlg.Add(GUILocalizeStrings.Get(342));//videos + dlg.Add(GUILocalizeStrings.Get(345));//year dlg.Add(GUILocalizeStrings.Get(135));//genre dlg.Add(GUILocalizeStrings.Get(200026));//pays + choice_view.Add("All"); + choice_view.Add("Year"); + choice_view.Add("Category"); + choice_view.Add("Country"); if (!(StrStorage.Length == 0) && !(StrStorage == "(none)")) - dlg.Add(GUILocalizeStrings.Get(154) + " " + GUILocalizeStrings.Get(1951));//pays + { + dlg.Add(GUILocalizeStrings.Get(154) + " " + GUILocalizeStrings.Get(1951));//storage + choice_view.Add("Storage"); + } if (!(StrViewItem1 == null) && !(StrViewItem1 == "(none)")) - if ((StrViewText1 == null) || (StrViewText1 == null)) + { + choice_view.Add("View1"); + if ((StrViewText1 == null) || (StrViewText1.Length == 0)) dlg.Add(StrViewItem1); // specific user View1 else dlg.Add(StrViewText1); // specific Text for View1 + } if (!(StrViewItem2 == null) && !(StrViewItem2 == "(none)")) - if ((StrViewText2 == null) || (StrViewText2 == null)) + { + choice_view.Add("View2"); + if ((StrViewText2 == null) || (StrViewText2.Length == 0)) dlg.Add(StrViewItem2); // specific user View2 else dlg.Add(StrViewText2); // specific Text for View2 + } + if (NbConfig > 1) + { + dlg.Add(GUILocalizeStrings.Get(6029) + " " + GUILocalizeStrings.Get(6022)); // Change Config + choice_view.Add("Config"); + } dlg.DoModal(GetID); if (dlg.SelectedLabel == -1) return; - boolstorage = false; - switch (dlg.SelectedLabel) - { - case 0: - StrSelect = StrTitle1.ToString() + " not like ''"; - TxtSelect.Label = " "; - boolselect = false; - BtnSrtBy.Label = CurrentSortMethod; - if (StrSortSens == " ASC") - BtnSrtBy.IsAscending = true; - else - BtnSrtBy.IsAscending = false; - Afficherliste(); - break; - case 1: - WStrSort = "YEAR"; - WStrSortSens = " DESC"; - BtnSrtBy.IsAscending = false; - boolreturn = true; - getSelectFromDivx(StrTitle1.ToString() + " not like ''", WStrSort, WStrSortSens, "*"); - break; - case 2: - WStrSort = "CATEGORY"; - WStrSortSens = " ASC"; - BtnSrtBy.IsAscending = true; - getSelectFromDivx(StrTitle1.ToString() + " not like ''", WStrSort, WStrSortSens, "*"); - break; - case 3: - WStrSort = "COUNTRY"; - WStrSortSens = " ASC"; - BtnSrtBy.IsAscending = true; - getSelectFromDivx(StrTitle1.ToString() + " not like ''", WStrSort, WStrSortSens, "*"); - break; - case 4: - if (!(StrStorage.Length == 0) && !(StrStorage == "(none)")) - { - StrSelect = "((" + StrTitle1.ToString() + " not like '') and (" + StrStorage.ToString() + " not like ''))"; - TxtSelect.Label = GUILocalizeStrings.Get(154) + " " + GUILocalizeStrings.Get(1951); - StrTxtSelect = TxtSelect.Label; - boolselect = false; - boolreturn = false; - BtnSrtBy.Label = CurrentSortMethod; - if (StrSortSens == " ASC") - BtnSrtBy.IsAscending = true; - else - BtnSrtBy.IsAscending = false; - Afficherliste(); - break; - } - else - { - if (!(StrViewItem1 == null) && !(StrViewItem1 == "(none)")) - WStrSort = StrViewItem1; // specific user View1 - else - WStrSort = StrViewItem2; - WStrSortSens = " ASC"; - BtnSrtBy.IsAscending = true; - if (WStrSort == "DateAdded") - getSelectFromDivx(StrTitle1.ToString() + " not like ''", "Date", " DESC", "*"); - else - getSelectFromDivx(StrTitle1.ToString() + " not like ''", WStrSort, WStrSortSens, "*"); - break; - } - case 5: - if (!(StrStorage.Length == 0) && !(StrStorage == "(none)")) - { - if (!(StrViewItem1 == null) && !(StrViewItem1 == "(none)")) - WStrSort = StrViewItem1; // specific user View1 - else - WStrSort = StrViewItem2; - WStrSortSens = " ASC"; - BtnSrtBy.IsAscending = true; - if (WStrSort == "DateAdded") - getSelectFromDivx(StrTitle1.ToString() + " not like ''", "Date", " DESC", "*"); - else - getSelectFromDivx(StrTitle1.ToString() + " not like ''", WStrSort, WStrSortSens, "*"); - break; - } - else - { - WStrSort = StrViewItem2; // specific user View2 - WStrSortSens = " ASC"; - BtnSrtBy.IsAscending = true; - if (WStrSort == "DateAdded") - getSelectFromDivx(StrTitle1.ToString() + " not like ''", "Date", " DESC", "*"); - else - getSelectFromDivx(StrTitle1.ToString() + " not like ''", WStrSort, WStrSortSens, "*"); - break; - } - case 6: - WStrSort = StrViewItem2; // specific user View2 - WStrSortSens = " ASC"; - BtnSrtBy.IsAscending = true; - if (WStrSort == "DateAdded") - getSelectFromDivx(StrTitle1.ToString() + " not like ''", "Date", " DESC", "*"); - else - getSelectFromDivx(StrTitle1.ToString() + " not like ''", WStrSort, WStrSortSens, "*"); - break; - } + Change_view(choice_view[dlg.SelectedLabel].ToString()); + return; } //---------------------------------------------------------------------------------------------------- // Search for the selected choice in the ANT Item @@ -1110,21 +978,267 @@ } } //----------------------------------------------------------------------------------------------- - // save Config Parameters in MediaPortal.xml file (section MesFilm) + // save Config Parameters in MyFilms.xml file (section MesFilm) //----------------------------------------------------------------------------------------------- private void save_config_values(bool save_index) { - using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings("MediaPortal.xml")) + using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings("MyFilms.xml")) { - xmlwriter.SetValue("MesFilms", "StrSelect", StrSelect.ToString()); - xmlwriter.SetValue("MesFilms", "StrSort", StrSort.ToString()); - xmlwriter.SetValue("MesFilms", "CurrentSortMethod", CurrentSortMethod.ToString()); - xmlwriter.SetValue("MesFilms", "StrSortSens", StrSortSens.ToString()); - xmlwriter.SetValue("MesFilms", "Selection", TxtSelect.Label.ToString()); + xmlwriter.SetValue(CurrentConfig, "StrSelect", StrSelect.ToString()); + xmlwriter.SetValue(CurrentConfig, "StrDfltSelect", StrDfltSelect.ToString()); + xmlwriter.SetValue(CurrentConfig, "StrSort", StrSort.ToString()); + xmlwriter.SetValue(CurrentConfig, "CurrentSortMethod", CurrentSortMethod.ToString()); + xmlwriter.SetValue(CurrentConfig, "StrSortSens", StrSortSens.ToString()); + xmlwriter.SetValue(CurrentConfig, "Selection", TxtSelect.Label.ToString()); if (save_index) - xmlwriter.SetValue("MesFilms", "IndexItem", lsCtlFilm.SelectedListItemIndex.ToString()); + xmlwriter.SetValue(CurrentConfig, "IndexItem", lsCtlFilm.SelectedListItemIndex.ToString()); } } + private void Load_Config(string CurrentConfig) + { + //----------------------------------------------------------------------------------------------- + // Load Config Parameters in MyFilms.xml file (section CurrentConfig) + //----------------------------------------------------------------------------------------------- + using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings("MyFilms.xml")) + { + xmlwriter.SetValue("MyFilms", "Current_Config", CurrentConfig); + } + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("MyFilms.xml")) + { + StrStorage = xmlreader.GetValueAsString(CurrentConfig, "AntStorage", ""); + StrIdentItem = xmlreader.GetValueAsString(CurrentConfig, "AntIdentItem", ""); + StrTitle1 = xmlreader.GetValueAsString(CurrentConfig, "AntTitle1", ""); + StrTSort1 = xmlreader.GetValueAsString(CurrentConfig, "AntTSort", ""); + StrSort1 = xmlreader.GetValueAsString(CurrentConfig, "AntSort", ""); + StrViewItem1 = xmlreader.GetValueAsString(CurrentConfig, "AntViewItem1", ""); + StrViewText1 = xmlreader.GetValueAsString(CurrentConfig, "AntViewText1", ""); + StrViewItem2 = xmlreader.GetValueAsString(CurrentConfig, "AntViewItem2", ""); + StrViewText2 = xmlreader.GetValueAsString(CurrentConfig, "AntViewText2", ""); + StrFileXml = xmlreader.GetValueAsString(CurrentConfig, "AntCatalog", ""); + StrPathImg = xmlreader.GetValueAsString(CurrentConfig, "AntPicture", ""); + StrSelect = xmlreader.GetValueAsString(CurrentConfig, "StrSelect", ""); + StrDfltSelect = xmlreader.GetValueAsString(CurrentConfig, "StrDfltSelect", ""); + StrSort = xmlreader.GetValueAsString(CurrentConfig, "StrSort", ""); + CurrentSortMethod = xmlreader.GetValueAsString(CurrentConfig, "CurrentSortMethod", ""); + TxtSelect.Label = xmlreader.GetValueAsString(CurrentConfig, "Selection", ""); + StrSortSens = xmlreader.GetValueAsString(CurrentConfig, "StrSortSens", ""); + l_index = xmlreader.GetValueAsInt(CurrentConfig, "IndexItem", -1); + StrViewDfltItem = xmlreader.GetValueAsString(CurrentConfig, "ViewDfltItem", ""); + StrViewDfltText = xmlreader.GetValueAsString(CurrentConfig, "ViewDfltText", ""); + + } + } + //-------------------------------------------------------------------------------------------- + // Change View Response + //-------------------------------------------------------------------------------------------- + private void Change_view(string choice_view) + { + boolstorage = false; + if (choice_view == "All") + { + // Change View All Films + StrSelect = StrTitle1.ToString() + " not like ''"; + TxtSelect.Label = " "; + boolselect = false; + BtnSrtBy.Label = CurrentSortMethod; + if (StrSortSens == " ASC") + BtnSrtBy.IsAscending = true; + else + BtnSrtBy.IsAscending = false; + Afficherliste(); + return; + } + if (choice_view == "Year") + { + // Change View by Year + WStrSort = "YEAR"; + WStrSortSens = " DESC"; + BtnSrtBy.IsAscending = false; + boolreturn = true; + getSelectFromDivx(StrTitle1.ToString() + " not like ''", WStrSort, WStrSortSens, "*"); + return; + } + if (choice_view == "Category") + { + // Change View by "Category": + WStrSort = "CATEGORY"; + WStrSortSens = " ASC"; + BtnSrtBy.IsAscending = true; + getSelectFromDivx(StrTitle1.ToString() + " not like ''", WStrSort, WStrSortSens, "*"); + return; + } + if (choice_view == "Country") + { + // Change View by "Country": + WStrSort = "COUNTRY"; + WStrSortSens = " ASC"; + BtnSrtBy.IsAscending = true; + getSelectFromDivx(StrTitle1.ToString() + " not like ''", WStrSort, WStrSortSens, "*"); + return; + } + if (choice_view == "Storage") + { + // Change View by "Storage": + StrSelect = "((" + StrTitle1.ToString() + " not like '') and (" + StrStorage.ToString() + " not like ''))"; + TxtSelect.Label = GUILocalizeStrings.Get(154) + " " + GUILocalizeStrings.Get(1951); + StrTxtSelect = TxtSelect.Label; + boolselect = false; + boolreturn = false; + BtnSrtBy.Label = CurrentSortMethod; + if (StrSortSens == " ASC") + BtnSrtBy.IsAscending = true; + else + BtnSrtBy.IsAscending = false; + Afficherliste(); + return; + } + if (choice_view == "View1") + { + // Change View by "View1": + WStrSort = StrViewItem1; // specific user View1 + WStrSortSens = " ASC"; + BtnSrtBy.IsAscending = true; + if (WStrSort == "DateAdded") + getSelectFromDivx(StrTitle1.ToString() + " not like ''", "Date", " DESC", "*"); + else + getSelectFromDivx(StrTitle1.ToString() + " not like ''", WStrSort, WStrSortSens, "*"); + return; + } + if (choice_view == "View2") + { + // Change View by "View2": + WStrSort = StrViewItem2; + WStrSortSens = " ASC"; + BtnSrtBy.IsAscending = true; + if (WStrSort == "DateAdded") + getSelectFromDivx(StrTitle1.ToString() + " not like ''", "Date", " DESC", "*"); + else + getSelectFromDivx(StrTitle1.ToString() + " not like ''", WStrSort, WStrSortSens, "*"); + return; + } + if (choice_view == "Config") + { + //Change "Config": + mydivx.Clear(); + Load_Config(Choice_Config()); + Fin_Charge_Init(true); + return; + } + } + //-------------------------------------------------------------------------------------------- + // Choice Configuration + //-------------------------------------------------------------------------------------------- + private string Choice_Config() + { + GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); + if (dlg == null) + { + StrFileXml = ""; + return ""; + } + dlg.Reset(); + dlg.SetHeading(924); // menu + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("MyFilms.xml")) + { + int MesFilms_nb_config = xmlreader.GetValueAsInt("MyFilms", "NbConfig", -1); + for (int i = 0; i < (int)MesFilms_nb_config; i++) + { + dlg.Add(xmlreader.GetValueAsString("MyFilms", "ConfigName" + i, "")); + } + } + dlg.DoModal(GetID); + if (dlg.SelectedLabel == -1) + { + StrFileXml = ""; + return ""; + } + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("MyFilms.xml")) + { + CurrentConfig = xmlreader.GetValueAsString("MyFilms", "ConfigName" + dlg.SelectedLabel, ""); + } + return CurrentConfig; + } + //-------------------------------------------------------------------------------------------- + // Initial Windows load. If LoadDfltSlct = true => load default select if any + // LoadDfltSlct = false => return from MesFilmsDetail + //-------------------------------------------------------------------------------------------- + private void Fin_Charge_Init(bool LoadDfltSlct) + { + if (!ControlFichierDonn\xE9es()) + base.OnPreviousWindow(); + try + { + mydivx.ReadXml(StrFileXml); + } + catch + { + GUIDialogOK dlgOk = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK); + dlgOk.SetHeading("Error");//my videos + dlgOk.SetLine(1, "Invalid character in the XML File after enreg : " + mydivx.Movie[mydivx.Movie.Count - 1]["Number"]); + dlgOk.SetLine(2, "Verify your file with the plugin setup"); + dlgOk.DoModal(GetID); + } + if (StrSelect == "") + StrSelect = StrTitle1.ToString() + " not like ''"; + if (StrSort1.Length == 0) + StrSort1 = "(none)"; + if (StrSort == "") + StrSort = StrTitle1; + if (StrSortSens == "") + StrSortSens = " ASC"; + if (CurrentSortMethod == "") + CurrentSortMethod = GUILocalizeStrings.Get(103); + BtnSrtBy.Label = CurrentSortMethod.ToString(); + string BtnSearchT = GUILocalizeStrings.Get(137) + " " + GUILocalizeStrings.Get(342); + string BtnSearchA = GUILocalizeStrings.Get(137) + " " + GUILocalizeStrings.Get(344); + GUIButtonControl.SetControlLabel(GetID, (int)Controls.CTRL_BtnSearchT, BtnSearchT); + GUIButtonControl.SetControlLabel(GetID, (int)Controls.CTRL_BtnSearchA, BtnSearchA); + // TxtSelect.HorizontalAlignment = MediaPortal.Drawing.HorizontalAlignment.Right; + BtnSrtBy.SortChanged += new SortEventHandler(SortChanged); + if (!(LoadDfltSlct)) + Afficherliste(); + else + { + if ((StrViewDfltItem.Length == 0) || (StrViewDfltItem == "(none)")) + { + StrSelect = StrTitle1.ToString() + " not like ''"; + TxtSelect.Label = StrTxtSelect = " "; + boolselect = false; + l_index = -1; + if (StrSortSens == " ASC") + BtnSrtBy.IsAscending = true; + else + BtnSrtBy.IsAscending = false; + Afficherliste(); + } + else + { + if (StrViewDfltText.Length == 0) + { + Change_view(StrViewDfltItem); + } + else + // View List as selected + { + boolselect = false; + boolreturn = true; + WStrSort = StrViewDfltItem; + if (StrViewDfltItem == "DateAdded") + StrSelect = "Date" + " like '" + DateTime.Parse(StrViewDfltText).ToShortDateString() + "'"; + else + StrSelect = StrViewDfltItem + " like '*" + StrViewDfltText + "*'"; + TxtSelect.Label = "[" + StrViewDfltText + "]"; + BtnSrtBy.Label = CurrentSortMethod; + if (StrSortSens == " ASC") + BtnSrtBy.IsAscending = true; + else + BtnSrtBy.IsAscending = false; + Afficherliste(); + } + + } + } + } #endregion } } \ No newline at end of file Modified: trunk/plugins/MyFilms/MesFilms.csproj =================================================================== --- trunk/plugins/MyFilms/MesFilms.csproj 2007-02-12 17:42:33 UTC (rev 112) +++ trunk/plugins/MyFilms/MesFilms.csproj 2007-02-12 20:11:45 UTC (rev 113) @@ -30,15 +30,15... [truncated message content] |
From: <an...@us...> - 2007-02-13 02:16:25
|
Revision: 114 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=114&view=rev Author: and-81 Date: 2007-02-12 18:16:23 -0800 (Mon, 12 Feb 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MCEReplacement/Forms/LearnIR.cs trunk/plugins/MCEReplacement/Forms/MacroEditor.cs trunk/plugins/MCEReplacement/Forms/StbSetup.cs trunk/plugins/MCEReplacement/MCEReplacement.cs trunk/plugins/TV3ExtChannelChanger/Forms/PluginSetup.cs trunk/plugins/TV3ExtChannelChanger/TV3ExtChannelChanger.cs trunk/plugins/TV3MceBlaster/Forms/LearnIR.cs trunk/plugins/TV3MceBlaster/Forms/MacroEditor.cs trunk/plugins/TV3MceBlaster/Forms/PluginSetup.cs trunk/plugins/TV3MceBlaster/Forms/StbSetup.cs trunk/plugins/TV3MceBlaster/TV3MceBlaster.cs Modified: trunk/plugins/MCEReplacement/Forms/LearnIR.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/LearnIR.cs 2007-02-12 20:11:45 UTC (rev 113) +++ trunk/plugins/MCEReplacement/Forms/LearnIR.cs 2007-02-13 02:16:23 UTC (rev 114) @@ -57,7 +57,7 @@ textBoxName.Text = command; - if (!command.StartsWith(MCEReplacement.IRFolder)) + if (!command.StartsWith(MCEReplacement.IRFolder, StringComparison.InvariantCultureIgnoreCase)) command = MCEReplacement.IRFolder + command; bool resetTextBoxNameEnabled = textBoxName.Enabled; @@ -109,7 +109,7 @@ if (command.Length == 0) return; - if (!command.StartsWith(MCEReplacement.IRFolder)) + if (!command.StartsWith(MCEReplacement.IRFolder, StringComparison.InvariantCultureIgnoreCase)) command = MCEReplacement.IRFolder + command; MCEReplacement.ProcessCommand(command, _blastPort, _blastSpeed); Modified: trunk/plugins/MCEReplacement/Forms/MacroEditor.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/MacroEditor.cs 2007-02-12 20:11:45 UTC (rev 113) +++ trunk/plugins/MCEReplacement/Forms/MacroEditor.cs 2007-02-13 02:16:23 UTC (rev 114) @@ -346,8 +346,8 @@ MessageBox.Show(this, "You must supply a name for this macro", "Name missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } - - if (!fileName.StartsWith(MCEReplacement.MacroFolder)) + + if (!fileName.StartsWith(MCEReplacement.MacroFolder, StringComparison.InvariantCultureIgnoreCase)) fileName = MCEReplacement.MacroFolder + fileName; WriteToFile(fileName); @@ -372,7 +372,7 @@ return; } - if (!fileName.StartsWith(MCEReplacement.MacroFolder)) + if (!fileName.StartsWith(MCEReplacement.MacroFolder, StringComparison.InvariantCultureIgnoreCase)) fileName = MCEReplacement.MacroFolder + fileName; WriteToFile(fileName); @@ -443,7 +443,7 @@ if (commands == null) { - MessageBox.Show(this, "The current Message command is corrupted, please re-set this command", "Corrupt serial command", MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show(this, "The current Message command is corrupted, please re-set this command", "Corrupt message command", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } Modified: trunk/plugins/MCEReplacement/Forms/StbSetup.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/StbSetup.cs 2007-02-12 20:11:45 UTC (rev 113) +++ trunk/plugins/MCEReplacement/Forms/StbSetup.cs 2007-02-13 02:16:23 UTC (rev 114) @@ -230,19 +230,19 @@ for (int i = 0; i < 10; i++) { temp = Util.GetXmlString(nodeList, String.Format("Digit{0}", i), ""); - if (temp.EndsWith(MCEReplacement.IRExtension)) + if (temp.EndsWith(MCEReplacement.IRExtension, StringComparison.InvariantCultureIgnoreCase)) temp = MCEReplacement.STBFolder + temp; listViewExternalCommands.Items[i].SubItems[1].Text = temp; } temp = Util.GetXmlString(nodeList, "SelectCommand", ""); - if (temp.EndsWith(MCEReplacement.IRExtension)) + if (temp.EndsWith(MCEReplacement.IRExtension, StringComparison.InvariantCultureIgnoreCase)) temp = MCEReplacement.STBFolder + temp; listViewExternalCommands.Items[10].SubItems[1].Text = temp; temp = Util.GetXmlString(nodeList, "PreChangeCommand", ""); - if (temp.EndsWith(MCEReplacement.IRExtension)) + if (temp.EndsWith(MCEReplacement.IRExtension, StringComparison.InvariantCultureIgnoreCase)) temp = MCEReplacement.STBFolder + temp; listViewExternalCommands.Items[11].SubItems[1].Text = temp; Modified: trunk/plugins/MCEReplacement/MCEReplacement.cs =================================================================== --- trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-02-12 20:11:45 UTC (rev 113) +++ trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-02-13 02:16:23 UTC (rev 114) @@ -1789,7 +1789,7 @@ return false; } - if (command.StartsWith(MacroFolder)) // Macro + if (command.StartsWith(MacroFolder, StringComparison.InvariantCultureIgnoreCase)) // Macro { string fileName = AppDataFolder + command + MacroExtension; if (File.Exists(fileName)) @@ -1802,7 +1802,7 @@ return false; } } - else if (command.StartsWith(IRFolder)) // IR Code + else if (command.StartsWith(IRFolder, StringComparison.InvariantCultureIgnoreCase)) // IR Code { string fileName = AppDataFolder + command + IRExtension; if (File.Exists(fileName)) @@ -1815,14 +1815,14 @@ return false; } } - else if (command.StartsWith(STBFolder)) // STB Command + else if (command.StartsWith(STBFolder, StringComparison.InvariantCultureIgnoreCase)) // STB Command { string fileName = AppDataFolder + command; if (File.Exists(fileName)) { - if (fileName.EndsWith(IRExtension)) // IR Command + if (fileName.EndsWith(IRExtension, StringComparison.InvariantCultureIgnoreCase)) // IR Command return BlastIR(fileName, port, speed); - else if (fileName.EndsWith(MacroExtension)) // Macro + else if (fileName.EndsWith(MacroExtension, StringComparison.InvariantCultureIgnoreCase)) // Macro return ProcessMacro(fileName, port, speed); else { Modified: trunk/plugins/TV3ExtChannelChanger/Forms/PluginSetup.cs =================================================================== --- trunk/plugins/TV3ExtChannelChanger/Forms/PluginSetup.cs 2007-02-12 20:11:45 UTC (rev 113) +++ trunk/plugins/TV3ExtChannelChanger/Forms/PluginSetup.cs 2007-02-13 02:16:23 UTC (rev 114) @@ -21,6 +21,8 @@ public partial class PluginSetup : SetupTv.SectionSettings { + #region Constructor + public PluginSetup() { InitializeComponent(); @@ -29,20 +31,39 @@ TV3ExtChannelChanger.LogVerbose = checkBoxLogVerbose.Checked = Convert.ToBoolean(layer.GetSetting("TV3ExtChannelChangerLogVerbose", "False").Value); } + #endregion Constructor + + #region SetupTv.SectionSettings + public override void OnSectionDeActivated() { + Log.Info("TV3ExtChannelChanger: Configuration deactivated"); + TvBusinessLayer layer = new TvBusinessLayer(); - Setting setting = layer.GetSetting("TV3ExtChannelChangerLogVerbose"); - setting.Value = checkBoxLogVerbose.Checked.ToString(); + Setting setting; + + TV3ExtChannelChanger.LogVerbose = checkBoxLogVerbose.Checked; + + setting = layer.GetSetting("TV3ExtChannelChangerLogVerbose"); + setting.Value = TV3ExtChannelChanger.LogVerbose.ToString(); setting.Persist(); + TV3ExtChannelChanger.LoadExternalConfigs(); + base.OnSectionDeActivated(); } public override void OnSectionActivated() { + Log.Info("TV3ExtChannelChanger: Configuration activated"); + + if (TV3ExtChannelChanger.ExternalChannelConfigs == null) + TV3ExtChannelChanger.LoadExternalConfigs(); + base.OnSectionActivated(); } + #endregion SetupTv.SectionSettings + private void buttonSTB_Click(object sender, EventArgs e) { ExternalChannels externalChannels = new ExternalChannels(); Modified: trunk/plugins/TV3ExtChannelChanger/TV3ExtChannelChanger.cs =================================================================== --- trunk/plugins/TV3ExtChannelChanger/TV3ExtChannelChanger.cs 2007-02-12 20:11:45 UTC (rev 113) +++ trunk/plugins/TV3ExtChannelChanger/TV3ExtChannelChanger.cs 2007-02-13 02:16:23 UTC (rev 114) @@ -147,19 +147,6 @@ } } - static void LoadExternalConfigs() - { - int cardCount = TvDatabase.Card.ListAll().Count; - - if (cardCount == 0) - cardCount = 1; - - _externalChannelConfigs = new ExternalChannelConfig[cardCount]; - - for (int index = 0; index < cardCount; index++) - ExternalChannelConfigs[index] = new ExternalChannelConfig(AppDataFolder + "ExternalChannelConfig" + (index + 1).ToString() + ".xml"); - } - static bool ProcessExternalChannel(string externalChannel, int card) { bool returnCode = true; @@ -371,6 +358,22 @@ #region Public Methods /// <summary> + /// Load external channel configurations. + /// </summary> + public static void LoadExternalConfigs() + { + int cardCount = TvDatabase.Card.ListAll().Count; + + if (cardCount == 0) + cardCount = 1; + + _externalChannelConfigs = new ExternalChannelConfig[cardCount]; + + for (int index = 0; index < cardCount; index++) + ExternalChannelConfigs[index] = new ExternalChannelConfig(AppDataFolder + "ExternalChannelConfig" + (index + 1).ToString() + ".xml"); + } + + /// <summary> /// Splits a Run command into it's component parts. /// </summary> /// <param name="runCommand">The command to be split</param> Modified: trunk/plugins/TV3MceBlaster/Forms/LearnIR.cs =================================================================== --- trunk/plugins/TV3MceBlaster/Forms/LearnIR.cs 2007-02-12 20:11:45 UTC (rev 113) +++ trunk/plugins/TV3MceBlaster/Forms/LearnIR.cs 2007-02-13 02:16:23 UTC (rev 114) @@ -57,7 +57,7 @@ textBoxName.Text = command; - if (!command.StartsWith(TV3MceBlaster.IRFolder)) + if (!command.StartsWith(TV3MceBlaster.IRFolder, StringComparison.InvariantCultureIgnoreCase)) command = TV3MceBlaster.IRFolder + command; bool resetTextBoxNameEnabled = textBoxName.Enabled; @@ -109,7 +109,7 @@ if (command.Length == 0) return; - if (!command.StartsWith(TV3MceBlaster.IRFolder)) + if (!command.StartsWith(TV3MceBlaster.IRFolder, StringComparison.InvariantCultureIgnoreCase)) command = TV3MceBlaster.IRFolder + command; TV3MceBlaster.ProcessCommand(command, _blastPort, _blastSpeed); Modified: trunk/plugins/TV3MceBlaster/Forms/MacroEditor.cs =================================================================== --- trunk/plugins/TV3MceBlaster/Forms/MacroEditor.cs 2007-02-12 20:11:45 UTC (rev 113) +++ trunk/plugins/TV3MceBlaster/Forms/MacroEditor.cs 2007-02-13 02:16:23 UTC (rev 114) @@ -309,8 +309,8 @@ MessageBox.Show(this, "You must supply a name for this macro", "Name missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } - - if (!fileName.StartsWith(TV3MceBlaster.MacroFolder)) + + if (!fileName.StartsWith(TV3MceBlaster.MacroFolder, StringComparison.InvariantCultureIgnoreCase)) fileName = TV3MceBlaster.MacroFolder + fileName; WriteToFile(fileName); @@ -335,7 +335,7 @@ return; } - if (!fileName.StartsWith(TV3MceBlaster.MacroFolder)) + if (!fileName.StartsWith(TV3MceBlaster.MacroFolder, StringComparison.InvariantCultureIgnoreCase)) fileName = TV3MceBlaster.MacroFolder + fileName; WriteToFile(fileName); @@ -406,7 +406,7 @@ if (commands == null) { - MessageBox.Show(this, "The current Message command is corrupted, please re-set this command", "Corrupt serial command", MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show(this, "The current Message command is corrupted, please re-set this command", "Corrupt message command", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } Modified: trunk/plugins/TV3MceBlaster/Forms/PluginSetup.cs =================================================================== --- trunk/plugins/TV3MceBlaster/Forms/PluginSetup.cs 2007-02-12 20:11:45 UTC (rev 113) +++ trunk/plugins/TV3MceBlaster/Forms/PluginSetup.cs 2007-02-13 02:16:23 UTC (rev 114) @@ -67,21 +67,36 @@ public override void OnSectionDeActivated() { + Log.Info("TV3MceBlaster: Configuration deactivated"); + TvBusinessLayer layer = new TvBusinessLayer(); Setting setting; + TV3MceBlaster.LogVerbose = checkBoxLogVerbose.Checked; + setting = layer.GetSetting("TV3MceBlasterLogVerbose"); - setting.Value = checkBoxLogVerbose.Checked.ToString(); + setting.Value = TV3MceBlaster.LogVerbose.ToString(); setting.Persist(); setting = layer.GetSetting("TV3MceBlasterBlastType"); setting.Value = Enum.GetName(typeof(MceIrApi.BlasterType), TV3MceBlaster.BlastType); setting.Persist(); + TV3MceBlaster.LoadExternalConfigs(); + + TV3MceBlaster.InConfiguration = false; + base.OnSectionDeActivated(); } public override void OnSectionActivated() { + Log.Info("TV3MceBlaster: Configuration activated"); + + TV3MceBlaster.InConfiguration = true; + + if (TV3MceBlaster.ExternalChannelConfigs == null) + TV3MceBlaster.LoadExternalConfigs(); + base.OnSectionActivated(); } Modified: trunk/plugins/TV3MceBlaster/Forms/StbSetup.cs =================================================================== --- trunk/plugins/TV3MceBlaster/Forms/StbSetup.cs 2007-02-12 20:11:45 UTC (rev 113) +++ trunk/plugins/TV3MceBlaster/Forms/StbSetup.cs 2007-02-13 02:16:23 UTC (rev 114) @@ -229,19 +229,19 @@ for (int i = 0; i < 10; i++) { temp = Util.GetXmlString(nodeList, String.Format("Digit{0}", i), ""); - if (temp.EndsWith(TV3MceBlaster.IRExtension)) + if (temp.EndsWith(TV3MceBlaster.IRExtension, StringComparison.InvariantCultureIgnoreCase)) temp = TV3MceBlaster.STBFolder + temp; listViewExternalCommands.Items[i].SubItems[1].Text = temp; } temp = Util.GetXmlString(nodeList, "SelectCommand", ""); - if (temp.EndsWith(TV3MceBlaster.IRExtension)) + if (temp.EndsWith(TV3MceBlaster.IRExtension, StringComparison.InvariantCultureIgnoreCase)) temp = TV3MceBlaster.STBFolder + temp; listViewExternalCommands.Items[10].SubItems[1].Text = temp; temp = Util.GetXmlString(nodeList, "PreChangeCommand", ""); - if (temp.EndsWith(TV3MceBlaster.IRExtension)) + if (temp.EndsWith(TV3MceBlaster.IRExtension, StringComparison.InvariantCultureIgnoreCase)) temp = TV3MceBlaster.STBFolder + temp; listViewExternalCommands.Items[11].SubItems[1].Text = temp; Modified: trunk/plugins/TV3MceBlaster/TV3MceBlaster.cs =================================================================== --- trunk/plugins/TV3MceBlaster/TV3MceBlaster.cs 2007-02-12 20:11:45 UTC (rev 113) +++ trunk/plugins/TV3MceBlaster/TV3MceBlaster.cs 2007-02-13 02:16:23 UTC (rev 114) @@ -110,6 +110,12 @@ get { return _externalChannelConfigs; } } + public static bool InConfiguration + { + get { return _inConfiguration; } + set { _inConfiguration = value; } + } + #endregion Properties #region Plugin methods @@ -143,14 +149,7 @@ [CLSCompliant(false)] public SetupTv.SectionSettings Setup { - get - { - _inConfiguration = true; - - LoadExternalConfigs(); - - return new SetupTv.Sections.PluginSetup(); - } + get { return new SetupTv.Sections.PluginSetup(); } } #endregion Plugin methods @@ -174,19 +173,6 @@ } } - static void LoadExternalConfigs() - { - int cardCount = TvDatabase.Card.ListAll().Count; - - if (cardCount == 0) - cardCount = 1; - - _externalChannelConfigs = new ExternalChannelConfig[cardCount]; - - for (int index = 0; index < cardCount; index++) - ExternalChannelConfigs[index] = new ExternalChannelConfig(AppDataFolder + "ExternalChannelConfig" + (index + 1).ToString() + ".xml"); - } - static bool ProcessExternalChannel(string externalChannel, int card) { bool returnCode = true; @@ -549,6 +535,22 @@ #region Public Methods /// <summary> + /// Load external channel configurations. + /// </summary> + public static void LoadExternalConfigs() + { + int cardCount = TvDatabase.Card.ListAll().Count; + + if (cardCount == 0) + cardCount = 1; + + _externalChannelConfigs = new ExternalChannelConfig[cardCount]; + + for (int index = 0; index < cardCount; index++) + ExternalChannelConfigs[index] = new ExternalChannelConfig(AppDataFolder + "ExternalChannelConfig" + (index + 1).ToString() + ".xml"); + } + + /// <summary> /// Splits a Run command into it's component parts. /// </summary> /// <param name="runCommand">The command to be split</param> @@ -707,7 +709,7 @@ return false; } - if (command.StartsWith(MacroFolder)) // Macro + if (command.StartsWith(MacroFolder, StringComparison.InvariantCultureIgnoreCase)) // Macro { string fileName = AppDataFolder + command + MacroExtension; if (File.Exists(fileName)) @@ -720,7 +722,7 @@ return false; } } - else if (command.StartsWith(IRFolder)) // IR Code + else if (command.StartsWith(IRFolder, StringComparison.InvariantCultureIgnoreCase)) // IR Code { string fileName = AppDataFolder + command + IRExtension; if (File.Exists(fileName)) @@ -733,14 +735,14 @@ return false; } } - else if (command.StartsWith(STBFolder)) // STB Command + else if (command.StartsWith(STBFolder, StringComparison.InvariantCultureIgnoreCase)) // STB Command { string fileName = AppDataFolder + command; if (File.Exists(fileName)) { - if (fileName.EndsWith(IRExtension)) // IR Command + if (fileName.EndsWith(IRExtension, StringComparison.InvariantCultureIgnoreCase)) // IR Command return BlastIR(fileName, port, speed); - else if (fileName.EndsWith(MacroExtension)) // Macro + else if (fileName.EndsWith(MacroExtension, StringComparison.InvariantCultureIgnoreCase)) // Macro return ProcessMacro(fileName, port, speed); else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-02-14 14:00:58
|
Revision: 118 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=118&view=rev Author: and-81 Date: 2007-02-14 06:00:52 -0800 (Wed, 14 Feb 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MCEReplacement/Forms/LearnIR.cs trunk/plugins/TV3MceBlaster/Forms/LearnIR.cs Modified: trunk/plugins/MCEReplacement/Forms/LearnIR.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/LearnIR.cs 2007-02-13 15:50:16 UTC (rev 117) +++ trunk/plugins/MCEReplacement/Forms/LearnIR.cs 2007-02-14 14:00:52 UTC (rev 118) @@ -52,6 +52,7 @@ if (command.Length == 0) { MessageBox.Show(this, "You must supply a name for this IR code", "Missing name", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + textBoxName.Focus(); return; } Modified: trunk/plugins/TV3MceBlaster/Forms/LearnIR.cs =================================================================== --- trunk/plugins/TV3MceBlaster/Forms/LearnIR.cs 2007-02-13 15:50:16 UTC (rev 117) +++ trunk/plugins/TV3MceBlaster/Forms/LearnIR.cs 2007-02-14 14:00:52 UTC (rev 118) @@ -52,6 +52,7 @@ if (command.Length == 0) { MessageBox.Show(this, "You must supply a name for this IR code", "Missing name", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + textBoxName.Focus(); return; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-02-15 03:40:08
|
Revision: 119 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=119&view=rev Author: and-81 Date: 2007-02-14 19:39:19 -0800 (Wed, 14 Feb 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MCEReplacement/Forms/SetupForm.cs trunk/plugins/MCEReplacement/MCEReplacement.cs trunk/plugins/TV3ExtChannelChanger/ExternalChannelConfig.cs trunk/plugins/TV3ExtChannelChanger/Forms/ExternalChannels.cs trunk/plugins/TV3ExtChannelChanger/Forms/ExternalChannels.designer.cs trunk/plugins/TV3ExtChannelChanger/Forms/PluginSetup.cs trunk/plugins/TV3ExtChannelChanger/Forms/StbSetup.Designer.cs trunk/plugins/TV3ExtChannelChanger/Forms/StbSetup.cs trunk/plugins/TV3ExtChannelChanger/TV3ExtChannelChanger.cs trunk/plugins/TV3MceBlaster/Forms/PluginSetup.Designer.cs trunk/plugins/TV3MceBlaster/Forms/StbSetup.Designer.cs trunk/plugins/TV3MceBlaster/TV3MceBlaster.cs Modified: trunk/plugins/MCEReplacement/Forms/SetupForm.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/SetupForm.cs 2007-02-14 14:00:52 UTC (rev 118) +++ trunk/plugins/MCEReplacement/Forms/SetupForm.cs 2007-02-15 03:39:19 UTC (rev 119) @@ -45,7 +45,7 @@ private void SetupForm_Load(object sender, EventArgs e) { - labelVersion.Text = MCEReplacement.Version; + labelVersion.Text = MCEReplacement.PluginVersion; checkBoxLogVerbose.Checked = MCEReplacement.LogVerbose; checkBoxRequiresFocus.Checked = MCEReplacement.RequireFocus; Modified: trunk/plugins/MCEReplacement/MCEReplacement.cs =================================================================== --- trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-02-14 14:00:52 UTC (rev 118) +++ trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-02-15 03:39:19 UTC (rev 119) @@ -26,7 +26,7 @@ #region Constants - public const string Version = "MCE Replacement Plugin 1.0.2.0 for MediaPortal + SVN"; + public const string PluginVersion = "MCE Replacement Plugin 1.0.2.0 for MediaPortal + SVN"; public const int MessageModeCommand = 0x0018; @@ -262,7 +262,7 @@ public void Start() { - Log.Info("MCEReplacement: Starting ({0})", Version); + Log.Info("MCEReplacement: Starting ({0})", PluginVersion); Log.Debug("MCEReplacement: Platform is {0}", (IntPtr.Size == 4 ? "32-bit" : "64-bit")); @@ -1311,55 +1311,91 @@ return ProcessSerialCommand(commands); } - static bool BlastIR(string fileName, MceIrApi.BlasterPort port, MceIrApi.BlasterSpeed speed) + #endregion Private Methods + + #region Public Methods + + /// <summary> + /// Loads the default remote button input handler + /// </summary> + public static void LoadDefaultMapping() { - FileStream file = null; + _defaultInputHandler = new InputHandler("MCE Replacement"); - try + if (!_defaultInputHandler.IsLoaded) + Log.Error("MCEReplacement: Error loading default mapping file"); + } + + /// <summary> + /// Loads multi-mappings for input handling + /// </summary> + public static void LoadMultiMappings() + { + FileStream file = new FileStream(MultiMappingFile, FileMode.Open, FileAccess.Read, FileShare.Read); + + XmlDocument doc = new XmlDocument(); + doc.Load(file); + + XmlNodeList mappings = doc.DocumentElement.SelectNodes("map"); + + _multiInputHandlers = new List<InputHandler>(mappings.Count); + _multiMaps = new string[mappings.Count]; + + string map; + for (int index = 0; index < mappings.Count; index++) { - file = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read); + map = mappings.Item(index).Attributes["name"].Value; - if (file.Length == 0) - { - Log.Error("MCEReplacement: IR file \"{0}\" has no data, possible IR learn failure", fileName); - file.Close(); - return false; - } + _multiMaps[index] = map; + _multiInputHandlers.Add(new InputHandler(map)); - if (!MceIrApi.CheckFile(file.SafeFileHandle)) - { - Log.Error("MCEReplacement: Bad IR file \"{0}\"", fileName); - file.Close(); - return false; - } + if (!_multiInputHandlers[index].IsLoaded) + Log.Error("MCEReplacement: Error loading default mapping file for {0}", map); + } - MceIrApi.SelectBlaster(port); - MceIrApi.SetBlasterSpeed(speed); - MceIrApi.SetBlasterType(BlastType); + file.Close(); + } - if (MceIrApi.PlaybackFromFile(file.SafeFileHandle)) - { - if (LogVerbose) - Log.Info("MCEReplacement: Blast successful"); + /// <summary> + /// Call this when entering standby to ensure that the MceIrApi is informed. + /// </summary> + public static void OnSuspend() + { + if (!InConfiguration && EventMapperEnabled) + MapEvent(MappedEvent.MappingEvent.PC_Suspend); - file.Close(); - return true; - } - } - catch (Exception ex) + if (MceIrApi.InUse) { - Log.Error("MCEReplacement: BlastIR() {0}", ex.Message); + if (LogVerbose) + Log.Info("MCEReplacement: Suspending MceIrApi"); + + MceIrApi.Suspend(); } + } - Log.Error("MCEReplacement: Failed to blast IR file \"{0}\"", fileName); + /// <summary> + /// Call this when leaving standby to ensure the MceIrApi is informed. + /// </summary> + public static void OnResume() + { + if (MceIrApi.InUse) + { + if (LogVerbose) + Log.Info("MCEReplacement: Resuming MceIrApi"); - if (file != null) - file.Close(); + MceIrApi.Resume(); + } - return false; + if (!InConfiguration && EventMapperEnabled) + MapEvent(MappedEvent.MappingEvent.PC_Resume); } - static bool ProcessMacro(string fileName, MceIrApi.BlasterPort port, MceIrApi.BlasterSpeed speed) + /// <summary> + /// Process the supplied Macro file. + /// </summary> + /// <param name="fileName">Macro file to process.</param> + /// <returns>Sucess.</returns> + public static bool ProcessMacro(string fileName, MceIrApi.BlasterPort port, MceIrApi.BlasterSpeed speed) { FileStream file = null; @@ -1395,7 +1431,7 @@ { if (LogVerbose) Log.Debug("MCEReplacement: Pause {0}", commandProperty); - + int sleep = int.Parse(commandProperty); Thread.Sleep(sleep); break; @@ -1551,83 +1587,59 @@ return true; } - #endregion Private Methods - - #region Public Methods - /// <summary> - /// Loads the default remote button input handler + /// Blast an IR command. /// </summary> - public static void LoadDefaultMapping() + /// <param name="fileName">File to blast.</param> + /// <param name="port">Port to blast to.</param> + /// <param name="speed">Speed to blast at.</param> + /// <returns>Success.</returns> + public static bool BlastIR(string fileName, MceIrApi.BlasterPort port, MceIrApi.BlasterSpeed speed) { - _defaultInputHandler = new InputHandler("MCE Replacement"); + FileStream file = null; - if (!_defaultInputHandler.IsLoaded) - Log.Error("MCEReplacement: Error loading default mapping file"); - } + try + { + file = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); - /// <summary> - /// Loads multi-mappings for input handling - /// </summary> - public static void LoadMultiMappings() - { - FileStream file = new FileStream(MultiMappingFile, FileMode.Open, FileAccess.Read, FileShare.Read); + if (file.Length == 0) + { + Log.Error("MCEReplacement: IR file \"{0}\" has no data, possible IR learn failure", fileName); + file.Close(); + return false; + } - XmlDocument doc = new XmlDocument(); - doc.Load(file); + if (!MceIrApi.CheckFile(file.SafeFileHandle)) + { + Log.Error("MCEReplacement: Bad IR file \"{0}\"", fileName); + file.Close(); + return false; + } - XmlNodeList mappings = doc.DocumentElement.SelectNodes("map"); + MceIrApi.SelectBlaster(port); + MceIrApi.SetBlasterSpeed(speed); + MceIrApi.SetBlasterType(BlastType); - _multiInputHandlers = new List<InputHandler>(mappings.Count); - _multiMaps = new string[mappings.Count]; + if (MceIrApi.PlaybackFromFile(file.SafeFileHandle)) + { + if (LogVerbose) + Log.Info("MCEReplacement: Blast successful"); - string map; - for (int index = 0; index < mappings.Count; index++) - { - map = mappings.Item(index).Attributes["name"].Value; - - _multiMaps[index] = map; - _multiInputHandlers.Add(new InputHandler(map)); - - if (!_multiInputHandlers[index].IsLoaded) - Log.Error("MCEReplacement: Error loading default mapping file for {0}", map); + file.Close(); + return true; + } } - - file.Close(); - } - - /// <summary> - /// Call this when entering standby to ensure that the MceIrApi is informed. - /// </summary> - public static void OnSuspend() - { - if (!InConfiguration && EventMapperEnabled) - MapEvent(MappedEvent.MappingEvent.PC_Suspend); - - if (MceIrApi.InUse) + catch (Exception ex) { - if (LogVerbose) - Log.Info("MCEReplacement: Suspending MceIrApi"); - - MceIrApi.Suspend(); + Log.Error("MCEReplacement: BlastIR() {0}", ex.Message); } - } - /// <summary> - /// Call this when leaving standby to ensure the MceIrApi is informed. - /// </summary> - public static void OnResume() - { - if (MceIrApi.InUse) - { - if (LogVerbose) - Log.Info("MCEReplacement: Resuming MceIrApi"); + Log.Error("MCEReplacement: Failed to blast IR file \"{0}\"", fileName); - MceIrApi.Resume(); - } + if (file != null) + file.Close(); - if (!InConfiguration && EventMapperEnabled) - MapEvent(MappedEvent.MappingEvent.PC_Resume); + return false; } /// <summary> @@ -2066,20 +2078,22 @@ } /// <summary> - /// Learn an IR code and put it in a file + /// Learn an IR Command and put it in a file /// </summary> - /// <param name="blastCommand">File to learn</param> - /// <returns>bool value shows success</returns> - public static bool LearnIRCommand(string blastCommand) + /// <param name="fileName">File to place learned IR command in.</param> + /// <returns>Success.</returns> + public static bool LearnIRCommand(string fileName) { - string fileName = AppDataFolder + blastCommand + IRExtension; + string filePath = AppDataFolder + fileName + IRExtension; FileStream file = null; bool status = false; try { - file = new FileStream(fileName, FileMode.Create, FileAccess.Write, FileShare.Read); + file = new FileStream(filePath, FileMode.Create, FileAccess.Write, FileShare.ReadWrite); status = MceIrApi.RecordToFile(file.SafeFileHandle, LearnTimeout); + if (file.Length == 0) + status = false; } catch (Exception ex) { Modified: trunk/plugins/TV3ExtChannelChanger/ExternalChannelConfig.cs =================================================================== --- trunk/plugins/TV3ExtChannelChanger/ExternalChannelConfig.cs 2007-02-14 14:00:52 UTC (rev 118) +++ trunk/plugins/TV3ExtChannelChanger/ExternalChannelConfig.cs 2007-02-15 03:39:19 UTC (rev 119) @@ -16,6 +16,8 @@ string _fileName; + int _cardID = -1; + int _pauseTime = 250; bool _sendSelect = false; bool _doubleChannelSelect = false; @@ -37,6 +39,12 @@ get { return _fileName; } } + public int CardId + { + get { return _cardID; } + set { _cardID = value; } + } + public int PauseTime { get { return _pauseTime; } @@ -93,10 +101,12 @@ #region Constructor - public ExternalChannelConfig(string fileName) + public ExternalChannelConfig(int cardId, string fileName) { _fileName = fileName; + _cardID = cardId; + if (!File.Exists(_fileName)) { for (int i = 0; i < 10; i++) Modified: trunk/plugins/TV3ExtChannelChanger/Forms/ExternalChannels.cs =================================================================== --- trunk/plugins/TV3ExtChannelChanger/Forms/ExternalChannels.cs 2007-02-14 14:00:52 UTC (rev 118) +++ trunk/plugins/TV3ExtChannelChanger/Forms/ExternalChannels.cs 2007-02-15 03:39:19 UTC (rev 119) @@ -19,7 +19,6 @@ #region Variables - TabPage[] _tvCardTabs; StbSetup[] _tvCardStbSetups; #endregion Variables @@ -35,31 +34,30 @@ private void ExternalChannels_Load(object sender, EventArgs e) { - int cards = TV3ExtChannelChanger.ExternalChannelConfigs.Length; - string cardName; - string cardNumber; + IList cards = TvDatabase.Card.ListAll(); - _tvCardTabs = new TabPage[cards]; - _tvCardStbSetups = new StbSetup[cards]; + _tvCardStbSetups = new StbSetup[cards.Count]; comboBoxCopyFrom.Items.Clear(); - for (int index = 0; index < cards; index++) + TabPage tempPage; + int index = 0; + + foreach (TvDatabase.Card card in cards) { - cardNumber = (index + 1).ToString(); - cardName = "TV Card " + cardNumber; + comboBoxCopyFrom.Items.Add(card.IdCard); - comboBoxCopyFrom.Items.Add(cardName); - - _tvCardStbSetups[index] = new StbSetup(index); - _tvCardStbSetups[index].Name = "StbSetup" + cardNumber; + _tvCardStbSetups[index] = new StbSetup(card.IdCard); + _tvCardStbSetups[index].Name = string.Format("StbSetup{0}", index); _tvCardStbSetups[index].Dock = DockStyle.Fill; _tvCardStbSetups[index].TabIndex = 0; - _tvCardTabs[index] = new TabPage(cardName); - _tvCardTabs[index].Controls.Add(_tvCardStbSetups[index]); + tempPage = new TabPage(string.Format("TV Card {0}", index + 1)); + tempPage.Controls.Add(_tvCardStbSetups[index]); - this.tabControlTVCards.TabPages.Add(_tvCardTabs[index]); + this.tabControlTVCards.TabPages.Add(tempPage); + + index++; } comboBoxCopyFrom.SelectedIndex = 0; @@ -104,11 +102,11 @@ private void buttonOK_Click(object sender, EventArgs e) { foreach (StbSetup setup in _tvCardStbSetups) + { setup.Save(); + TV3ExtChannelChanger.GetExternalChannelConfig(setup.CardId).SaveExternalChannelConfig(); + } - foreach (ExternalChannelConfig config in TV3ExtChannelChanger.ExternalChannelConfigs) - config.SaveExternalChannelConfig(); - this.DialogResult = DialogResult.OK; this.Close(); } @@ -267,7 +265,7 @@ private void buttonCopyFrom_Click(object sender, EventArgs e) { - _tvCardStbSetups[tabControlTVCards.SelectedIndex].SetToCard(comboBoxCopyFrom.SelectedIndex); + _tvCardStbSetups[tabControlTVCards.SelectedIndex].SetToCard((int)comboBoxCopyFrom.SelectedItem); } private void buttonCancel_Click(object sender, EventArgs e) Modified: trunk/plugins/TV3ExtChannelChanger/Forms/ExternalChannels.designer.cs =================================================================== --- trunk/plugins/TV3ExtChannelChanger/Forms/ExternalChannels.designer.cs 2007-02-14 14:00:52 UTC (rev 118) +++ trunk/plugins/TV3ExtChannelChanger/Forms/ExternalChannels.designer.cs 2007-02-15 03:39:19 UTC (rev 119) @@ -48,7 +48,7 @@ // buttonOK // this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonOK.Location = new System.Drawing.Point(400, 352); + this.buttonOK.Location = new System.Drawing.Point(400, 360); this.buttonOK.Name = "buttonOK"; this.buttonOK.Size = new System.Drawing.Size(56, 24); this.buttonOK.TabIndex = 5; @@ -62,7 +62,7 @@ | System.Windows.Forms.AnchorStyles.Right))); this.groupBoxQuickSetup.Controls.Add(this.buttonQuickSet); this.groupBoxQuickSetup.Controls.Add(this.comboBoxQuickSetup); - this.groupBoxQuickSetup.Location = new System.Drawing.Point(8, 296); + this.groupBoxQuickSetup.Location = new System.Drawing.Point(8, 304); this.groupBoxQuickSetup.Name = "groupBoxQuickSetup"; this.groupBoxQuickSetup.Size = new System.Drawing.Size(288, 48); this.groupBoxQuickSetup.TabIndex = 1; @@ -97,7 +97,7 @@ this.groupBoxTest.Controls.Add(this.labelCh); this.groupBoxTest.Controls.Add(this.buttonTest); this.groupBoxTest.Controls.Add(this.numericUpDownTest); - this.groupBoxTest.Location = new System.Drawing.Point(304, 296); + this.groupBoxTest.Location = new System.Drawing.Point(304, 304); this.groupBoxTest.Name = "groupBoxTest"; this.groupBoxTest.Size = new System.Drawing.Size(216, 48); this.groupBoxTest.TabIndex = 2; @@ -144,7 +144,7 @@ // buttonCopyFrom // this.buttonCopyFrom.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.buttonCopyFrom.Location = new System.Drawing.Point(8, 352); + this.buttonCopyFrom.Location = new System.Drawing.Point(8, 360); this.buttonCopyFrom.Name = "buttonCopyFrom"; this.buttonCopyFrom.Size = new System.Drawing.Size(144, 21); this.buttonCopyFrom.TabIndex = 3; @@ -157,7 +157,7 @@ this.comboBoxCopyFrom.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.comboBoxCopyFrom.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBoxCopyFrom.FormattingEnabled = true; - this.comboBoxCopyFrom.Location = new System.Drawing.Point(160, 352); + this.comboBoxCopyFrom.Location = new System.Drawing.Point(160, 360); this.comboBoxCopyFrom.Name = "comboBoxCopyFrom"; this.comboBoxCopyFrom.Size = new System.Drawing.Size(120, 21); this.comboBoxCopyFrom.TabIndex = 4; @@ -170,14 +170,14 @@ this.tabControlTVCards.Location = new System.Drawing.Point(8, 8); this.tabControlTVCards.Name = "tabControlTVCards"; this.tabControlTVCards.SelectedIndex = 0; - this.tabControlTVCards.Size = new System.Drawing.Size(512, 280); + this.tabControlTVCards.Size = new System.Drawing.Size(512, 288); this.tabControlTVCards.TabIndex = 0; // // 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(464, 352); + this.buttonCancel.Location = new System.Drawing.Point(464, 360); this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Size = new System.Drawing.Size(56, 24); this.buttonCancel.TabIndex = 6; @@ -191,7 +191,7 @@ 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(528, 383); + this.ClientSize = new System.Drawing.Size(528, 391); this.Controls.Add(this.buttonCancel); this.Controls.Add(this.tabControlTVCards); this.Controls.Add(this.comboBoxCopyFrom); @@ -200,6 +200,7 @@ this.Controls.Add(this.groupBoxQuickSetup); this.Controls.Add(this.buttonOK); this.MinimizeBox = false; + this.MinimumSize = new System.Drawing.Size(536, 418); this.Name = "ExternalChannels"; this.ShowIcon = false; this.ShowInTaskbar = false; Modified: trunk/plugins/TV3ExtChannelChanger/Forms/PluginSetup.cs =================================================================== --- trunk/plugins/TV3ExtChannelChanger/Forms/PluginSetup.cs 2007-02-14 14:00:52 UTC (rev 118) +++ trunk/plugins/TV3ExtChannelChanger/Forms/PluginSetup.cs 2007-02-15 03:39:19 UTC (rev 119) @@ -56,8 +56,7 @@ { Log.Info("TV3ExtChannelChanger: Configuration activated"); - if (TV3ExtChannelChanger.ExternalChannelConfigs == null) - TV3ExtChannelChanger.LoadExternalConfigs(); + TV3ExtChannelChanger.LoadExternalConfigs(); base.OnSectionActivated(); } @@ -66,8 +65,15 @@ private void buttonSTB_Click(object sender, EventArgs e) { - ExternalChannels externalChannels = new ExternalChannels(); - externalChannels.ShowDialog(this); + if (TvDatabase.Card.ListAll().Count == 0) + { + MessageBox.Show(this, "There are no capture cards installed in the TV server", "No TV Cards", MessageBoxButtons.OK, MessageBoxIcon.Stop); + } + else + { + ExternalChannels externalChannels = new ExternalChannels(); + externalChannels.ShowDialog(this); + } } } Modified: trunk/plugins/TV3ExtChannelChanger/Forms/StbSetup.Designer.cs =================================================================== --- trunk/plugins/TV3ExtChannelChanger/Forms/StbSetup.Designer.cs 2007-02-14 14:00:52 UTC (rev 118) +++ trunk/plugins/TV3ExtChannelChanger/Forms/StbSetup.Designer.cs 2007-02-15 03:39:19 UTC (rev 119) @@ -46,6 +46,7 @@ this.listViewExternalCommands = new System.Windows.Forms.ListView(); this.columnHeaderExternal = new System.Windows.Forms.ColumnHeader(); this.columnHeaderCommand = new System.Windows.Forms.ColumnHeader(); + this.labelCardName = new System.Windows.Forms.Label(); this.groupBoxOptions.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownRepeatDelay)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownPauseTime)).BeginInit(); @@ -68,7 +69,7 @@ this.groupBoxOptions.Controls.Add(this.checkBoxDoubleSelect); this.groupBoxOptions.Controls.Add(this.labelMS); this.groupBoxOptions.Controls.Add(this.checkBoxSendSelect); - this.groupBoxOptions.Location = new System.Drawing.Point(296, 8); + this.groupBoxOptions.Location = new System.Drawing.Point(296, 16); this.groupBoxOptions.Name = "groupBoxOptions"; this.groupBoxOptions.Size = new System.Drawing.Size(200, 240); this.groupBoxOptions.TabIndex = 1; @@ -221,7 +222,7 @@ this.groupBoxCommands.Controls.Add(this.buttonSet); this.groupBoxCommands.Controls.Add(this.comboBoxCommands); this.groupBoxCommands.Controls.Add(this.listViewExternalCommands); - this.groupBoxCommands.Location = new System.Drawing.Point(8, 8); + this.groupBoxCommands.Location = new System.Drawing.Point(8, 16); this.groupBoxCommands.Name = "groupBoxCommands"; this.groupBoxCommands.Size = new System.Drawing.Size(280, 240); this.groupBoxCommands.TabIndex = 0; @@ -280,14 +281,27 @@ this.columnHeaderCommand.Text = "Command"; this.columnHeaderCommand.Width = 170; // + // labelCardName + // + this.labelCardName.Dock = System.Windows.Forms.DockStyle.Top; + this.labelCardName.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.labelCardName.Location = new System.Drawing.Point(0, 0); + this.labelCardName.Name = "labelCardName"; + this.labelCardName.Size = new System.Drawing.Size(504, 16); + this.labelCardName.TabIndex = 2; + this.labelCardName.Text = "Unknown TV Card"; + this.labelCardName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // // StbSetup // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.labelCardName); this.Controls.Add(this.groupBoxOptions); this.Controls.Add(this.groupBoxCommands); + this.MinimumSize = new System.Drawing.Size(504, 262); this.Name = "StbSetup"; - this.Size = new System.Drawing.Size(504, 254); + this.Size = new System.Drawing.Size(504, 262); this.groupBoxOptions.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownRepeatDelay)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownPauseTime)).EndInit(); @@ -317,5 +331,6 @@ private System.Windows.Forms.ListView listViewExternalCommands; private System.Windows.Forms.ColumnHeader columnHeaderExternal; private System.Windows.Forms.ColumnHeader columnHeaderCommand; + private System.Windows.Forms.Label labelCardName; } } Modified: trunk/plugins/TV3ExtChannelChanger/Forms/StbSetup.cs =================================================================== --- trunk/plugins/TV3ExtChannelChanger/Forms/StbSetup.cs 2007-02-14 14:00:52 UTC (rev 118) +++ trunk/plugins/TV3ExtChannelChanger/Forms/StbSetup.cs 2007-02-15 03:39:19 UTC (rev 119) @@ -16,8 +16,27 @@ public partial class StbSetup : UserControl { + #region Constants + + const string parameterInfo = +@"%1 = Current channel number digit (-1 for Select/Pre-Change) +%2 = Full channel number string"; + + #endregion Constants + + #region Variables + + int _cardId; + + #endregion Variables + #region Properties + public int CardId + { + get { return _cardId; } + } + public int PauseTime { get { return Decimal.ToInt32(numericUpDownPauseTime.Value); } @@ -74,25 +93,25 @@ #endregion Properties - #region Variables - - const string parameterInfo = -@"%1 = Current channel number digit (-1 for Select/Pre-Change) -%2 = Full channel number string -%3 = Blaster port (0 = Both, 1 = Port 1, 2 = Port 2)"; - - int _card; - - #endregion Variables - #region Constructor - public StbSetup(int card) + public StbSetup(int cardId) { InitializeComponent(); - _card = card; + _cardId = cardId; + foreach (TvDatabase.Card card in TvDatabase.Card.ListAll()) + { + if (card.IdCard == _cardId) + { + labelCardName.Text = card.Name; + if (!card.Enabled) + labelCardName.Text += " (Disabled)"; + break; + } + } + // Setup commands combo box comboBoxCommands.Items.Add("Run Program"); comboBoxCommands.Items.Add("Serial Command"); @@ -121,17 +140,20 @@ item = new ListViewItem(subItems); listViewExternalCommands.Items.Add(item); - SetToCard(_card); + SetToCard(_cardId); } #endregion Constructor #region Public Methods - public void SetToCard(int card) + public void SetToCard(int cardId) { - ExternalChannelConfig config = TV3ExtChannelChanger.ExternalChannelConfigs[card]; + ExternalChannelConfig config = TV3ExtChannelChanger.GetExternalChannelConfig(cardId); + if (config == null) + return; + // Setup command list. for (int i = 0; i < 10; i++) listViewExternalCommands.Items[i].SubItems[1].Text = config.Digits[i]; @@ -158,10 +180,12 @@ numericUpDownRepeatDelay.Value = new Decimal(config.RepeatPauseTime); } - public void SetToConfig(int card) + public void SetToConfig(int cardId) { - ExternalChannelConfig config = TV3ExtChannelChanger.ExternalChannelConfigs[card]; + ExternalChannelConfig config = TV3ExtChannelChanger.GetExternalChannelConfig(cardId); + config.CardId = cardId; + config.PauseTime = Decimal.ToInt32(numericUpDownPauseTime.Value); config.SendSelect = checkBoxSendSelect.Checked; config.DoubleChannelSelect = checkBoxDoubleSelect.Checked; @@ -247,7 +271,7 @@ public void Save() { - SetToConfig(_card); + SetToConfig(_cardId); } #endregion Public Methods Modified: trunk/plugins/TV3ExtChannelChanger/TV3ExtChannelChanger.cs =================================================================== --- trunk/plugins/TV3ExtChannelChanger/TV3ExtChannelChanger.cs 2007-02-14 14:00:52 UTC (rev 118) +++ trunk/plugins/TV3ExtChannelChanger/TV3ExtChannelChanger.cs 2007-02-15 03:39:19 UTC (rev 119) @@ -24,9 +24,7 @@ #region Constants - public static readonly string AppDataFolder = - Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + - "\\MediaPortal TV Server\\"; + public const string PluginVersion = "TV3 Ext Channel Changer Plugin 1.0.2.0"; public const string STBFolder = "STB\\"; @@ -35,6 +33,10 @@ public const string KeyCommandPrefix = "Keys: "; public const string MessageCommandPrefix = "Message: "; + public static readonly string AppDataFolder = + Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + + "\\MediaPortal TV Server\\"; + #endregion Constants #region Variables @@ -85,11 +87,6 @@ set { _logVerbose = value; } } - public static ExternalChannelConfig[] ExternalChannelConfigs - { - get { return _externalChannelConfigs; } - } - #endregion Properties #region Plugin methods @@ -97,8 +94,10 @@ [CLSCompliant(false)] public void Start(IController controller) { - Log.Info("TV3ExtChannelChanger: Version {0}", Version); + Log.Info("TV3ExtChannelChanger: Version {0}", PluginVersion); + Log.Debug("TV3ExtChannelChanger: Platform is {0}", (IntPtr.Size == 4 ? "32-bit" : "64-bit")); + TvBusinessLayer layer = new TvBusinessLayer(); LogVerbose = Convert.ToBoolean(layer.GetSetting("TV3ExtChannelChangerLogVerbose", "False").Value); @@ -118,12 +117,7 @@ [CLSCompliant(false)] public SetupTv.SectionSettings Setup { - get - { - LoadExternalConfigs(); - - return new SetupTv.Sections.PluginSetup(); - } + get { return new SetupTv.Sections.PluginSetup(); } } #endregion Plugin methods @@ -147,13 +141,13 @@ } } - static bool ProcessExternalChannel(string externalChannel, int card) + static bool ProcessExternalChannel(string externalChannel, int cardId) { bool returnCode = true; try { - ExternalChannelConfig config = ExternalChannelConfigs[card - 1]; + ExternalChannelConfig config = GetExternalChannelConfig(cardId); // Clean up the "externalChannel" string into "channel". StringBuilder channel = new StringBuilder(); @@ -362,18 +356,38 @@ /// </summary> public static void LoadExternalConfigs() { - int cardCount = TvDatabase.Card.ListAll().Count; + IList cards = TvDatabase.Card.ListAll(); - if (cardCount == 0) - cardCount = 1; + if (cards.Count == 0) + return; - _externalChannelConfigs = new ExternalChannelConfig[cardCount]; + _externalChannelConfigs = new ExternalChannelConfig[cards.Count]; - for (int index = 0; index < cardCount; index++) - ExternalChannelConfigs[index] = new ExternalChannelConfig(AppDataFolder + "ExternalChannelConfig" + (index + 1).ToString() + ".xml"); + int index = 0; + foreach (TvDatabase.Card card in cards) + { + _externalChannelConfigs[index++] = new ExternalChannelConfig(card.IdCard, string.Format("{0}ExternalChannelConfig{1}.xml", AppDataFolder, card.IdCard)); + } } /// <summary> + /// Given a card ID returns the configuration for that card. + /// </summary> + /// <param name="cardId">ID of card to retreive configuration for.</param> + /// <returns>Card configuration, null if it doesn't exist.</returns> + public static ExternalChannelConfig GetExternalChannelConfig(int cardId) + { + if (_externalChannelConfigs == null) + return null; + + foreach (ExternalChannelConfig config in _externalChannelConfigs) + if (config.CardId == cardId) + return config; + + return null; + } + + /// <summary> /// Splits a Run command into it's component parts. /// </summary> /// <param name="runCommand">The command to be split</param> Modified: trunk/plugins/TV3MceBlaster/Forms/PluginSetup.Designer.cs =================================================================== --- trunk/plugins/TV3MceBlaster/Forms/PluginSetup.Designer.cs 2007-02-14 14:00:52 UTC (rev 118) +++ trunk/plugins/TV3MceBlaster/Forms/PluginSetup.Designer.cs 2007-02-15 03:39:19 UTC (rev 119) @@ -1,5 +1,6 @@ namespace SetupTv.Sections { + partial class PluginSetup { /// <summary> Modified: trunk/plugins/TV3MceBlaster/Forms/StbSetup.Designer.cs =================================================================== --- trunk/plugins/TV3MceBlaster/Forms/StbSetup.Designer.cs 2007-02-14 14:00:52 UTC (rev 118) +++ trunk/plugins/TV3MceBlaster/Forms/StbSetup.Designer.cs 2007-02-15 03:39:19 UTC (rev 119) @@ -343,7 +343,7 @@ this.Controls.Add(this.labelCardName); this.Controls.Add(this.groupBoxOptions); this.Controls.Add(this.groupBoxCommands); - this.MinimumSize = new System.Drawing.Size(504, 310); + this.MinimumSize = new System.Drawing.Size(504, 318); this.Name = "StbSetup"; this.Size = new System.Drawing.Size(504, 318); this.groupBoxOptions.ResumeLayout(false); Modified: trunk/plugins/TV3MceBlaster/TV3MceBlaster.cs =================================================================== --- trunk/plugins/TV3MceBlaster/TV3MceBlaster.cs 2007-02-14 14:00:52 UTC (rev 118) +++ trunk/plugins/TV3MceBlaster/TV3MceBlaster.cs 2007-02-15 03:39:19 UTC (rev 119) @@ -24,8 +24,10 @@ #region Constants - public const int LearnTimeout = 4000; // Milliseconds + public const string PluginVersion = "TV3 MCE Blaster Plugin 1.0.2.0"; + public const int LearnIRTimeout = 4000; // Milliseconds + public const string IRFolder = "IR\\"; public const string MacroFolder = "MACRO\\"; public const string STBFolder = "STB\\"; @@ -118,7 +120,7 @@ [CLSCompliant(false)] public void Start(IController controller) { - Log.Info("TV3MceBlaster: Version {0}", Version); + Log.Info("TV3MceBlaster: Version {0}", PluginVersion); Log.Debug("TV3MceBlaster: Platform is {0}", (IntPtr.Size == 4 ? "32-bit" : "64-bit")); @@ -337,55 +339,52 @@ return ProcessSerialCommand(commands); } - static bool BlastIR(string fileName, MceIrApi.BlasterPort port, MceIrApi.BlasterSpeed speed) - { - FileStream file = null; + #endregion Private Methods - try - { - file = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read); + #region Public Methods - if (file.Length == 0) - { - Log.Error("TV3MceBlaster: IR file \"{0}\" has no data, possible IR learn failure", fileName); - file.Close(); - return false; - } + /// <summary> + /// Load external channel configurations. + /// </summary> + public static void LoadExternalConfigs() + { + IList cards = TvDatabase.Card.ListAll(); - if (!MceIrApi.CheckFile(file.SafeFileHandle)) - { - Log.Error("TV3MceBlaster: Bad IR file \"{0}\"", fileName); - file.Close(); - return false; - } + if (cards.Count == 0) + return; - MceIrApi.SelectBlaster(port); - MceIrApi.SetBlasterSpeed(speed); - MceIrApi.SetBlasterType(BlastType); + _externalChannelConfigs = new ExternalChannelConfig[cards.Count]; - if (MceIrApi.PlaybackFromFile(file.SafeFileHandle)) - { - if (LogVerbose) - Log.Info("TV3MceBlaster: Blast successful"); - - file.Close(); - return true; - } - } - catch (Exception ex) + int index = 0; + foreach (TvDatabase.Card card in cards) { - Log.Error("TV3MceBlaster: BlastIR() {0}", ex.Message); + _externalChannelConfigs[index++] = new ExternalChannelConfig(card.IdCard, string.Format("{0}ExternalChannelConfig{1}.xml", AppDataFolder, card.IdCard)); } + } - Log.Error("TV3MceBlaster: Failed to blast IR file \"{0}\"", fileName); + /// <summary> + /// Given a card ID returns the configuration for that card. + /// </summary> + /// <param name="cardId">ID of card to retreive configuration for.</param> + /// <returns>Card configuration, null if it doesn't exist.</returns> + public static ExternalChannelConfig GetExternalChannelConfig(int cardId) + { + if (_externalChannelConfigs == null) + return null; - if (file != null) - file.Close(); + foreach (ExternalChannelConfig config in _externalChannelConfigs) + if (config.CardId == cardId) + return config; - return false; + return null; } - static bool ProcessMacro(string fileName, MceIrApi.BlasterPort port, MceIrApi.BlasterSpeed speed) + /// <summary> + /// Process the supplied Macro file. + /// </summary> + /// <param name="fileName">Macro file to process.</param> + /// <returns>Sucess.</returns> + public static bool ProcessMacro(string fileName, MceIrApi.BlasterPort port, MceIrApi.BlasterSpeed speed) { FileStream file = null; @@ -525,44 +524,59 @@ return true; } - #endregion Private Methods - - #region Public Methods - /// <summary> - /// Load external channel configurations. + /// Blast an IR command. /// </summary> - public static void LoadExternalConfigs() + /// <param name="fileName">File to blast.</param> + /// <param name="port">Port to blast to.</param> + /// <param name="speed">Speed to blast at.</param> + /// <returns>Success.</returns> + public static bool BlastIR(string fileName, MceIrApi.BlasterPort port, MceIrApi.BlasterSpeed speed) { - IList cards = TvDatabase.Card.ListAll(); + FileStream file = null; - if (cards.Count == 0) - return; + try + { + file = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read); - _externalChannelConfigs = new ExternalChannelConfig[cards.Count]; + if (file.Length == 0) + { + Log.Error("TV3MceBlaster: IR file \"{0}\" has no data, possible IR learn failure", fileName); + file.Close(); + return false; + } - int index = 0; - foreach (TvDatabase.Card card in cards) + if (!MceIrApi.CheckFile(file.SafeFileHandle)) + { + Log.Error("TV3MceBlaster: Bad IR file \"{0}\"", fileName); + file.Close(); + return false; + } + + MceIrApi.SelectBlaster(port); + MceIrApi.SetBlasterSpeed(speed); + MceIrApi.SetBlasterType(BlastType); + + if (MceIrApi.PlaybackFromFile(file.SafeFileHandle)) + { + if (LogVerbose) + Log.Info("TV3MceBlaster: Blast successful"); + + file.Close(); + return true; + } + } + catch (Exception ex) { - _externalChannelConfigs[index++] = new ExternalChannelConfig(card.IdCard, string.Format("{0}ExternalChannelConfig{1}.xml", AppDataFolder, card.IdCard)); + Log.Error("TV3MceBlaster: BlastIR() {0}", ex.Message); } - } - /// <summary> - /// Given a card ID returns the configuration for that card. - /// </summary> - /// <param name="cardId">ID of card to retreive configuration for.</param> - /// <returns>Card configuration, null if it doesn't exist.</returns> - public static ExternalChannelConfig GetExternalChannelConfig(int cardId) - { - if (_externalChannelConfigs == null) - return null; + Log.Error("TV3MceBlaster: Failed to blast IR file \"{0}\"", fileName); - foreach (ExternalChannelConfig config in _externalChannelConfigs) - if (config.CardId == cardId) - return config; + if (file != null) + file.Close(); - return null; + return false; } /// <summary> @@ -938,20 +952,22 @@ } /// <summary> - /// Learn an IR code and put it in a file + /// Learn an IR Command and put it in a file /// </summary> - /// <param name="blastCommand">File to learn</param> - /// <returns>bool value shows success</returns> - public static bool LearnIRCommand(string blastCommand) + /// <param name="fileName">File to place learned IR command in.</param> + /// <returns>Success.</returns> + public static bool LearnIRCommand(string fileName) { - string fileName = AppDataFolder + blastCommand + IRExtension; + string filePath = AppDataFolder + fileName + IRExtension; FileStream file = null; bool status = false; try { - file = new FileStream(fileName, FileMode.Create, FileAccess.Write, FileShare.Read); - status = MceIrApi.RecordToFile(file.SafeFileHandle, LearnTimeout); + file = new FileStream(filePath, FileMode.Create, FileAccess.Write, FileShare.ReadWrite); + status = MceIrApi.RecordToFile(file.SafeFileHandle, LearnIRTimeout); + if (file.Length == 0) + status = false; } catch (Exception ex) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mis...@us...> - 2007-02-18 17:54:37
|
Revision: 123 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=123&view=rev Author: misterd_sf Date: 2007-02-18 09:54:30 -0800 (Sun, 18 Feb 2007) Log Message: ----------- Initial version of My MPlayer Added Paths: ----------- trunk/plugins/My MPlayer/ trunk/plugins/My MPlayer/License.txt trunk/plugins/My MPlayer/Liesmich.pdf trunk/plugins/My MPlayer/MPlayer_ExtPlayer/ trunk/plugins/My MPlayer/MPlayer_ExtPlayer/ConfigurationForm.Designer.cs trunk/plugins/My MPlayer/MPlayer_ExtPlayer/ConfigurationForm.cs trunk/plugins/My MPlayer/MPlayer_ExtPlayer/ConfigurationForm.resx trunk/plugins/My MPlayer/MPlayer_ExtPlayer/ConfigurationManager.cs trunk/plugins/My MPlayer/MPlayer_ExtPlayer/ExtensionSettings.cs trunk/plugins/My MPlayer/MPlayer_ExtPlayer/MPlayer_ExtPlayer.cs trunk/plugins/My MPlayer/MPlayer_ExtPlayer/MPlayer_ExtPlayer.csproj trunk/plugins/My MPlayer/MPlayer_ExtPlayer/Properties/ trunk/plugins/My MPlayer/MPlayer_ExtPlayer/Properties/AssemblyInfo.cs trunk/plugins/My MPlayer/MPlayer_ExtPlayer/SampleConfiguration/ trunk/plugins/My MPlayer/MPlayer_ExtPlayer/SampleConfiguration/MPlayer_ExtPlayer.xml trunk/plugins/My MPlayer/MPlayer_ExtPlayer/config.ico trunk/plugins/My MPlayer/MPlayer_GUIPlugin/ trunk/plugins/My MPlayer/MPlayer_GUIPlugin/ConfigurationForm.Designer.cs trunk/plugins/My MPlayer/MPlayer_GUIPlugin/ConfigurationForm.cs trunk/plugins/My MPlayer/MPlayer_GUIPlugin/ConfigurationForm.resx trunk/plugins/My MPlayer/MPlayer_GUIPlugin/MPlayer_GUIPlugin.cs trunk/plugins/My MPlayer/MPlayer_GUIPlugin/MPlayer_GUIPlugin.csproj trunk/plugins/My MPlayer/MPlayer_GUIPlugin/MPlayer_Share.cs trunk/plugins/My MPlayer/MPlayer_GUIPlugin/Properties/ trunk/plugins/My MPlayer/MPlayer_GUIPlugin/Properties/AssemblyInfo.cs trunk/plugins/My MPlayer/MPlayer_GUIPlugin/SampleConfiguration/ trunk/plugins/My MPlayer/MPlayer_GUIPlugin/SampleConfiguration/MPlayer_GUIPlugin.xml trunk/plugins/My MPlayer/MPlayer_GUIPlugin/SkinFiles/ trunk/plugins/My MPlayer/MPlayer_GUIPlugin/SkinFiles/BlueTwo 16x9/ trunk/plugins/My MPlayer/MPlayer_GUIPlugin/SkinFiles/BlueTwo 16x9/myMPlayer.xml trunk/plugins/My MPlayer/MPlayer_GUIPlugin/SkinFiles/BlueTwo 4x3/ trunk/plugins/My MPlayer/MPlayer_GUIPlugin/SkinFiles/BlueTwo 4x3/myMPlayer.xml trunk/plugins/My MPlayer/MPlayer_GUIPlugin/SkinFiles/PM III/ trunk/plugins/My MPlayer/MPlayer_GUIPlugin/SkinFiles/PM III/myMPlayer.xml trunk/plugins/My MPlayer/MPlayer_GUIPlugin/VirtualWebKeyboard.cs trunk/plugins/My MPlayer/My Mplayer.sln trunk/plugins/My MPlayer/Readme.pdf Added: trunk/plugins/My MPlayer/License.txt =================================================================== --- trunk/plugins/My MPlayer/License.txt (rev 0) +++ trunk/plugins/My MPlayer/License.txt 2007-02-18 17:54:30 UTC (rev 123) @@ -0,0 +1,289 @@ +The plugin is licensed under the terms of the terms of the GNU General +Public License as published by the Free Software Foundation, which is +displayed below. You are only allowed to use this plugin if your with +this plugin used version of MPlayer does not violate the laws of your +country! + +------------------------------------------------------------------------- + + + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS Added: trunk/plugins/My MPlayer/Liesmich.pdf =================================================================== (Binary files differ) Property changes on: trunk/plugins/My MPlayer/Liesmich.pdf ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/My MPlayer/MPlayer_ExtPlayer/ConfigurationForm.Designer.cs =================================================================== --- trunk/plugins/My MPlayer/MPlayer_ExtPlayer/ConfigurationForm.Designer.cs (rev 0) +++ trunk/plugins/My MPlayer/MPlayer_ExtPlayer/ConfigurationForm.Designer.cs 2007-02-18 17:54:30 UTC (rev 123) @@ -0,0 +1,1011 @@ +#region Copyright (C) 2006-2007 MisterD + +/* + * Copyright (C) 2006-2007 MisterD + * + * 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 + +namespace MPlayer { + partial class ConfigurationForm { + + #region Dispose + /// <summary> + /// Verwendete Ressourcen bereinigen. + /// </summary> + /// <param name="disposing">True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.</param> + protected override void Dispose(bool disposing) { + if (disposing && (components != null)) { + components.Dispose(); + } + base.Dispose(disposing); + } + #endregion + + #region Vom Windows Form-Designer generierter Code + + /// <summary> + /// Erforderliche Methode für die Designerunterstützung. + /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. + /// </summary> + private void InitializeComponent() { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ConfigurationForm)); + this.okButton = new System.Windows.Forms.Button(); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); + this.rebuildIndex = new System.Windows.Forms.CheckBox(); + this.priorityBoost = new System.Windows.Forms.CheckBox(); + this.label5 = new System.Windows.Forms.Label(); + this.optionalArguments = new System.Windows.Forms.TextBox(); + this.soundOutputDriver = new System.Windows.Forms.ComboBox(); + this.postProcessing = new System.Windows.Forms.ComboBox(); + this.aspectRatio = new System.Windows.Forms.ComboBox(); + this.deinterlace = new System.Windows.Forms.ComboBox(); + this.cancelButton = new System.Windows.Forms.Button(); + this.mplayerPath = new System.Windows.Forms.TextBox(); + this.label8 = new System.Windows.Forms.Label(); + this.folderSearch = new System.Windows.Forms.Button(); + this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog(); + this.tabControl1 = new System.Windows.Forms.TabControl(); + this.general_Tab = new System.Windows.Forms.TabPage(); + this.label22 = new System.Windows.Forms.Label(); + this.osdFont = new System.Windows.Forms.ComboBox(); + this.audioNormalize = new System.Windows.Forms.CheckBox(); + this.framedrop = new System.Windows.Forms.CheckBox(); + this.directRendering = new System.Windows.Forms.CheckBox(); + this.doubleBuffering = new System.Windows.Forms.CheckBox(); + this.label21 = new System.Windows.Forms.Label(); + this.label7 = new System.Windows.Forms.Label(); + this.noiseDenoise = new System.Windows.Forms.ComboBox(); + this.audioChannels = new System.Windows.Forms.ComboBox(); + this.video_Tab = new System.Windows.Forms.TabPage(); + this.label25 = new System.Windows.Forms.Label(); + this.videoPlayerUse = new System.Windows.Forms.CheckBox(); + this.videoArgument = new System.Windows.Forms.TextBox(); + this.label24 = new System.Windows.Forms.Label(); + this.label23 = new System.Windows.Forms.Label(); + this.videoExtension = new System.Windows.Forms.TextBox(); + this.videoDelete = new System.Windows.Forms.Button(); + this.videoAdd = new System.Windows.Forms.Button(); + this.videoExtList = new System.Windows.Forms.ListBox(); + this.audio_Tab = new System.Windows.Forms.TabPage(); + this.label26 = new System.Windows.Forms.Label(); + this.audioPlayerUse = new System.Windows.Forms.CheckBox(); + this.audioArgument = new System.Windows.Forms.TextBox(); + this.label27 = new System.Windows.Forms.Label(); + this.label28 = new System.Windows.Forms.Label(); + this.audioExtension = new System.Windows.Forms.TextBox(); + this.audioDelete = new System.Windows.Forms.Button(); + this.audioAdd = new System.Windows.Forms.Button(); + this.audioExtList = new System.Windows.Forms.ListBox(); + this.dvd_vcd_svcd_Tab = new System.Windows.Forms.TabPage(); + this.audioCDArguments = new System.Windows.Forms.TextBox(); + this.label6 = new System.Windows.Forms.Label(); + this.label11 = new System.Windows.Forms.Label(); + this.svcdArguments = new System.Windows.Forms.TextBox(); + this.label10 = new System.Windows.Forms.Label(); + this.vcdArguments = new System.Windows.Forms.TextBox(); + this.label9 = new System.Windows.Forms.Label(); + this.dvdArguments = new System.Windows.Forms.TextBox(); + this.streaming_cue_Tab = new System.Windows.Forms.TabPage(); + this.label20 = new System.Windows.Forms.Label(); + this.unsvArguments = new System.Windows.Forms.TextBox(); + this.label19 = new System.Windows.Forms.Label(); + this.udpArguments = new System.Windows.Forms.TextBox(); + this.label18 = new System.Windows.Forms.Label(); + this.sdpArguments = new System.Windows.Forms.TextBox(); + this.label17 = new System.Windows.Forms.Label(); + this.rtspArguments = new System.Windows.Forms.TextBox(); + this.label16 = new System.Windows.Forms.Label(); + this.mpstArguments = new System.Windows.Forms.TextBox(); + this.label15 = new System.Windows.Forms.Label(); + this.mmsArguments = new System.Windows.Forms.TextBox(); + this.label14 = new System.Windows.Forms.Label(); + this.httpArguments = new System.Windows.Forms.TextBox(); + this.label13 = new System.Windows.Forms.Label(); + this.ftpArguments = new System.Windows.Forms.TextBox(); + this.label12 = new System.Windows.Forms.Label(); + this.cueArguments = new System.Windows.Forms.TextBox(); + this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); + this.fontDialog1 = new System.Windows.Forms.FontDialog(); + this.tabControl1.SuspendLayout(); + this.general_Tab.SuspendLayout(); + this.video_Tab.SuspendLayout(); + this.audio_Tab.SuspendLayout(); + this.dvd_vcd_svcd_Tab.SuspendLayout(); + this.streaming_cue_Tab.SuspendLayout(); + this.SuspendLayout(); + // + // okButton + // + this.okButton.Location = new System.Drawing.Point(16, 396); + this.okButton.Name = "okButton"; + this.okButton.Size = new System.Drawing.Size(75, 23); + this.okButton.TabIndex = 3; + this.okButton.Text = "&OK"; + this.okButton.UseVisualStyleBackColor = true; + this.okButton.Click += new System.EventHandler(this.okButton_Click); + // + // label1 + // + this.label1.Location = new System.Drawing.Point(3, 14); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(117, 23); + this.label1.TabIndex = 8; + this.label1.Text = "Sound output driver:"; + // + // label2 + // + this.label2.Location = new System.Drawing.Point(3, 41); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(117, 23); + this.label2.TabIndex = 9; + this.label2.Text = "Postprocessing:"; + // + // label3 + // + this.label3.Location = new System.Drawing.Point(3, 68); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(117, 23); + this.label3.TabIndex = 10; + this.label3.Text = "Aspect Ratio:"; + // + // label4 + // + this.label4.Location = new System.Drawing.Point(3, 95); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(117, 23); + this.label4.TabIndex = 11; + this.label4.Text = "Deinterlace:"; + // + // rebuildIndex + // + this.rebuildIndex.Location = new System.Drawing.Point(6, 228); + this.rebuildIndex.Name = "rebuildIndex"; + this.rebuildIndex.Size = new System.Drawing.Size(188, 23); + this.rebuildIndex.TabIndex = 12; + this.rebuildIndex.Text = "Rebuild file index if necessary"; + this.rebuildIndex.UseVisualStyleBackColor = true; + // + // priorityBoost + // + this.priorityBoost.Location = new System.Drawing.Point(6, 257); + this.priorityBoost.Name = "priorityBoost"; + this.priorityBoost.Size = new System.Drawing.Size(188, 23); + this.priorityBoost.TabIndex = 13; + this.priorityBoost.Text = "Priority Boost"; + this.priorityBoost.UseVisualStyleBackColor = true; + // + // label5 + // + this.label5.Location = new System.Drawing.Point(3, 205); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(117, 23); + this.label5.TabIndex = 14; + this.label5.Text = "Optional Arguments:"; + // + // optionalArguments + // + this.optionalArguments.Location = new System.Drawing.Point(122, 202); + this.optionalArguments.Name = "optionalArguments"; + this.optionalArguments.Size = new System.Drawing.Size(260, 20); + this.optionalArguments.TabIndex = 15; + // + // soundOutputDriver + // + this.soundOutputDriver.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.soundOutputDriver.FormattingEnabled = true; + this.soundOutputDriver.Items.AddRange(new object[] { + "(don\'t decode sound)", + "(don\'t play sound)", + "Win32", + "DirectSound"}); + this.soundOutputDriver.Location = new System.Drawing.Point(122, 11); + this.soundOutputDriver.Name = "soundOutputDriver"; + this.soundOutputDriver.Size = new System.Drawing.Size(260, 21); + this.soundOutputDriver.TabIndex = 16; + // + // postProcessing + // + this.postProcessing.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.postProcessing.FormattingEnabled = true; + this.postProcessing.Items.AddRange(new object[] { + "Off", + "Automatic", + "Maximum quality"}); + this.postProcessing.Location = new System.Drawing.Point(122, 38); + this.postProcessing.Name = "postProcessing"; + this.postProcessing.Size = new System.Drawing.Size(260, 21); + this.postProcessing.TabIndex = 17; + // + // aspectRatio + // + this.aspectRatio.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.aspectRatio.FormattingEnabled = true; + this.aspectRatio.Items.AddRange(new object[] { + "Autodetect", + "4:3", + "16:9", + "2,35"}); + this.aspectRatio.Location = new System.Drawing.Point(122, 65); + this.aspectRatio.Name = "aspectRatio"; + this.aspectRatio.Size = new System.Drawing.Size(260, 21); + this.aspectRatio.TabIndex = 18; + // + // deinterlace + // + this.deinterlace.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.deinterlace.FormattingEnabled = true; + this.deinterlace.Items.AddRange(new object[] { + "Off", + "Simple", + "Adaptive"}); + this.deinterlace.Location = new System.Drawing.Point(122, 92); + this.deinterlace.Name = "deinterlace"; + this.deinterlace.Size = new System.Drawing.Size(260, 21); + this.deinterlace.TabIndex = 19; + // + // cancelButton + // + this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.cancelButton.Location = new System.Drawing.Point(344, 396); + this.cancelButton.Name = "cancelButton"; + this.cancelButton.Size = new System.Drawing.Size(75, 23); + this.cancelButton.TabIndex = 20; + this.cancelButton.Text = "&Cancel"; + this.cancelButton.UseVisualStyleBackColor = true; + this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click); + // + // mplayerPath + // + this.mplayerPath.Location = new System.Drawing.Point(126, 315); + this.mplayerPath.Name = "mplayerPath"; + this.mplayerPath.Size = new System.Drawing.Size(174, 20); + this.mplayerPath.TabIndex = 21; + this.mplayerPath.Text = "C:\\Program Files\\MPlayer"; + // + // label8 + // + this.label8.Location = new System.Drawing.Point(3, 318); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(117, 23); + this.label8.TabIndex = 22; + this.label8.Text = "Path to MPlayer:"; + // + // folderSearch + // + this.folderSearch.Location = new System.Drawing.Point(306, 313); + this.folderSearch.Name = "folderSearch"; + this.folderSearch.Size = new System.Drawing.Size(76, 23); + this.folderSearch.TabIndex = 23; + this.folderSearch.Text = "&Browse ..."; + this.folderSearch.UseVisualStyleBackColor = true; + this.folderSearch.Click += new System.EventHandler(this.folderSearch_Click); + // + // folderBrowserDialog1 + // + this.folderBrowserDialog1.Description = "Select the folger of MPlayer:"; + // + // tabControl1 + // + this.tabControl1.Controls.Add(this.general_Tab); + this.tabControl1.Controls.Add(this.video_Tab); + this.tabControl1.Controls.Add(this.audio_Tab); + this.tabControl1.Controls.Add(this.dvd_vcd_svcd_Tab); + this.tabControl1.Controls.Add(this.streaming_cue_Tab); + this.tabControl1.Location = new System.Drawing.Point(12, 12); + this.tabControl1.Name = "tabControl1"; + this.tabControl1.SelectedIndex = 0; + this.tabControl1.Size = new System.Drawing.Size(411, 378); + this.tabControl1.TabIndex = 24; + // + // general_Tab + // + this.general_Tab.Controls.Add(this.label22); + this.general_Tab.Controls.Add(this.osdFont); + this.general_Tab.Controls.Add(this.audioNormalize); + this.general_Tab.Controls.Add(this.framedrop); + this.general_Tab.Controls.Add(this.directRendering); + this.general_Tab.Controls.Add(this.doubleBuffering); + this.general_Tab.Controls.Add(this.label21); + this.general_Tab.Controls.Add(this.label7); + this.general_Tab.Controls.Add(this.noiseDenoise); + this.general_Tab.Controls.Add(this.audioChannels); + this.general_Tab.Controls.Add(this.label1); + this.general_Tab.Controls.Add(this.folderSearch); + this.general_Tab.Controls.Add(this.label2); + this.general_Tab.Controls.Add(this.label8); + this.general_Tab.Controls.Add(this.mplayerPath); + this.general_Tab.Controls.Add(this.label3); + this.general_Tab.Controls.Add(this.label4); + this.general_Tab.Controls.Add(this.rebuildIndex); + this.general_Tab.Controls.Add(this.deinterlace); + this.general_Tab.Controls.Add(this.priorityBoost); + this.general_Tab.Controls.Add(this.aspectRatio); + this.general_Tab.Controls.Add(this.label5); + this.general_Tab.Controls.Add(this.postProcessing); + this.general_Tab.Controls.Add(this.optionalArguments); + this.general_Tab.Controls.Add(this.soundOutputDriver); + this.general_Tab.Location = new System.Drawing.Point(4, 22); + this.general_Tab.Name = "general_Tab"; + this.general_Tab.Padding = new System.Windows.Forms.Padding(3); + this.general_Tab.Size = new System.Drawing.Size(403, 352); + this.general_Tab.TabIndex = 0; + this.general_Tab.Text = "General"; + this.general_Tab.UseVisualStyleBackColor = true; + // + // label22 + // + this.label22.Location = new System.Drawing.Point(3, 178); + this.label22.Name = "label22"; + this.label22.Size = new System.Drawing.Size(117, 23); + this.label22.TabIndex = 33; + this.label22.Text = "Font of OSD:"; + // + // osdFont + // + this.osdFont.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.osdFont.FormattingEnabled = true; + this.osdFont.Location = new System.Drawing.Point(122, 175); + this.osdFont.Name = "osdFont"; + this.osdFont.Size = new System.Drawing.Size(260, 21); + this.osdFont.TabIndex = 32; + // + // audioNormalize + // + this.audioNormalize.Location = new System.Drawing.Point(200, 286); + this.audioNormalize.Name = "audioNormalize"; + this.audioNormalize.Size = new System.Drawing.Size(178, 23); + this.audioNormalize.TabIndex = 31; + this.audioNormalize.Text = "Volume normalize"; + this.audioNormalize.UseVisualStyleBackColor = true; + // + // framedrop + // + this.framedrop.Location = new System.Drawing.Point(6, 286); + this.framedrop.Name = "framedrop"; + this.framedrop.Size = new System.Drawing.Size(188, 23); + this.framedrop.TabIndex = 30; + this.framedrop.Text = "Framedrop"; + this.framedrop.UseVisualStyleBackColor = true; + // + // directRendering + // + this.directRendering.Location = new System.Drawing.Point(200, 228); + this.directRendering.Name = "directRendering"; + this.directRendering.Size = new System.Drawing.Size(178, 23); + this.directRendering.TabIndex = 29; + this.directRendering.Text = "Direct Rendering"; + this.directRendering.UseVisualStyleBackColor = true; + // + // doubleBuffering + // + this.doubleBuffering.Location = new System.Drawing.Point(200, 257); + this.doubleBuffering.Name = "doubleBuffering"; + this.doubleBuffering.Size = new System.Drawing.Size(178, 23); + this.doubleBuffering.TabIndex = 28; + this.doubleBuffering.Text = "Double Buffering"; + this.doubleBuffering.UseVisualStyleBackColor = true; + // + // label21 + // + this.label21.Location = new System.Drawing.Point(3, 151); + this.label21.Name = "label21"; + this.label21.Size = new System.Drawing.Size(117, 23); + this.label21.TabIndex = 27; + this.label21.Text = "Noise/Denoise:"; + // + // label7 + // + this.label7.Location = new System.Drawing.Point(3, 122); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(117, 23); + this.label7.TabIndex = 26; + this.label7.Text = "Audio Channels:"; + // + // noiseDenoise + // + this.noiseDenoise.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.noiseDenoise.FormattingEnabled = true; + this.noiseDenoise.Items.AddRange(new object[] { + "Nothing", + "Noise", + "High Quality Denoise", + "Denoise"}); + this.noiseDenoise.Location = new System.Drawing.Point(122, 148); + this.noiseDenoise.Name = "noiseDenoise"; + this.noiseDenoise.Size = new System.Drawing.Size(260, 21); + this.noiseDenoise.TabIndex = 25; + // + // audioChannels + // + this.audioChannels.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.audioChannels.FormattingEnabled = true; + this.audioChannels.Items.AddRange(new object[] { + "Default", + "Stereo", + "Surround", + "Full 5.1"}); + this.audioChannels.Location = new System.Drawing.Point(122, 119); + this.audioChannels.Name = "audioChannels"; + this.audioChannels.Size = new System.Drawing.Size(260, 21); + this.audioChannels.TabIndex = 24; + // + // video_Tab + // + this.video_Tab.Controls.Add(this.label25); + this.video_Tab.Controls.Add(this.videoPlayerUse); + this.video_Tab.Controls.Add(this.videoArgument); + this.video_Tab.Controls.Add(this.label24); + this.video_Tab.Controls.Add(this.label23); + this.video_Tab.Controls.Add(this.videoExtension); + this.video_Tab.Controls.Add(this.videoDelete); + this.video_Tab.Controls.Add(this.videoAdd); + this.video_Tab.Controls.Add(this.videoExtList); + this.video_Tab.Location = new System.Drawing.Point(4, 22); + this.video_Tab.Name = "video_Tab"; + this.video_Tab.Padding = new System.Windows.Forms.Padding(3); + this.video_Tab.Size = new System.Drawing.Size(403, 352); + this.video_Tab.TabIndex = 1; + this.video_Tab.Text = "Video"; + this.video_Tab.UseVisualStyleBackColor = true; + // + // label25 + // + this.label25.AutoSize = true; + this.label25.Location = new System.Drawing.Point(87, 64); + this.label25.Name = "label25"; + this.label25.Size = new System.Drawing.Size(100, 13); + this.label25.TabIndex = 26; + this.label25.Text = "External Player use:"; + // + // videoPlayerUse + // + this.videoPlayerUse.AutoSize = true; + this.videoPlayerUse.Location = new System.Drawing.Point(193, 63); + this.videoPlayerUse.Name = "videoPlayerUse"; + this.videoPlayerUse.Size = new System.Drawing.Size(15, 14); + this.videoPlayerUse.TabIndex = 25; + this.videoPlayerUse.UseVisualStyleBackColor = true; + // + // videoArgument + // + this.videoArgument.Location = new System.Drawing.Point(193, 37); + this.videoArgument.Name = "videoArgument"; + this.videoArgument.Size = new System.Drawing.Size(202, 20); + this.videoArgument.TabIndex = 24; + // + // label24 + // + this.label24.AutoSize = true; + this.label24.Location = new System.Drawing.Point(87, 40); + this.label24.Name = "label24"; + this.label24.Size = new System.Drawing.Size(60, 13); + this.label24.TabIndex = 23; + this.label24.Text = "Arguments:"; + // + // label23 + // + this.label23.AutoSize = true; + this.label23.Location = new System.Drawing.Point(87, 14); + this.label23.Name = "label23"; + this.label23.Size = new System.Drawing.Size(56, 13); + this.label23.TabIndex = 22; + this.label23.Text = "Extension:"; + // + // videoExtension + // + this.videoExtension.Location = new System.Drawing.Point(193, 11); + this.videoExtension.Name = "videoExtension"; + this.videoExtension.Size = new System.Drawing.Size(202, 20); + this.videoExtension.TabIndex = 21; + this.videoExtension.Leave += new System.EventHandler(this.videoExtension_Leave); + // + // videoDelete + // + this.videoDelete.Location = new System.Drawing.Point(171, 317); + this.videoDelete.Name = "videoDelete"; + this.videoDelete.Size = new System.Drawing.Size(75, 23); + this.videoDelete.TabIndex = 20; + this.videoDelete.Text = "&Delete"; + this.videoDelete.UseVisualStyleBackColor = true; + this.videoDelete.Click += new System.EventHandler(this.videoDelete_Click); + // + // videoAdd + // + this.videoAdd.Location = new System.Drawing.Point(90, 317); + this.videoAdd.Name = "videoAdd"; + this.videoAdd.Size = new System.Drawing.Size(75, 23); + this.videoAdd.TabIndex = 19; + this.videoAdd.Text = "&Add"; + this.videoAdd.UseVisualStyleBackColor = true; + this.videoAdd.Click += new System.EventHandler(this.videoAdd_Click); + // + // videoExtList + // + this.videoExtList.FormattingEnabled = true; + this.videoExtList.Location = new System.Drawing.Point(3, 11); + this.videoExtList.Name = "videoExtList"; + this.videoExtList.Size = new System.Drawing.Size(78, 329); + this.videoExtList.TabIndex = 18; + this.videoExtList.SelectedIndexChanged += new System.EventHandler(this.videoExtList_SelectedIndexChanged); + // + // audio_Tab + // + this.audio_Tab.Controls.Add(this.label26); + this.audio_Tab.Controls.Add(this.audioPlayerUse); + this.audio_Tab.Controls.Add(this.audioArgument); + this.audio_Tab.Controls.Add(this.label27); + this.audio_Tab.Controls.Add(this.label28); + this.audio_Tab.Controls.Add(this.audioExtension); + this.audio_Tab.Controls.Add(this.audioDelete); + this.audio_Tab.Controls.Add(this.audioAdd); + this.audio_Tab.Controls.Add(this.audioExtList); + this.audio_Tab.Location = new System.Drawing.Point(4, 22); + this.audio_Tab.Name = "audio_Tab"; + this.audio_Tab.Size = new System.Drawing.Size(403, 352); + this.audio_Tab.TabIndex = 2; + this.audio_Tab.Text = "Audio"; + this.audio_Tab.UseVisualStyleBackColor = true; + // + // label26 + // + this.label26.AutoSize = true; + this.label26.Location = new System.Drawing.Point(87, 64); + this.label26.Name = "label26"; + this.label26.Size = new System.Drawing.Size(100, 13); + this.label26.TabIndex = 35; + this.label26.Text = "External Player use:"; + // + // audioPlayerUse + // + this.audioPlayerUse.AutoSize = true; + this.audioPlayerUse.Location = new System.Drawing.Point(193, 63); + this.audioPlayerUse.Name = "audioPlayerUse"; + this.audioPlayerUse.Size = new System.Drawing.Size(15, 14); + this.audioPlayerUse.TabIndex = 34; + this.audioPlayerUse.UseVisualStyleBackColor = true; + // + // audioArgument + // + this.audioArgument.Location = new System.Drawing.Point(193, 37); + this.audioArgument.Name = "audioArgument"; + this.audioArgument.Size = new System.Drawing.Size(202, 20); + this.audioArgument.TabIndex = 33; + // + // label27 + // + this.label27.AutoSize = true; + this.label27.Location = new System.Drawing.Point(87, 40); + this.label27.Name = "label27"; + this.label27.Size = new System.Drawing.Size(60, 13); + this.label27.TabIndex = 32; + this.label27.Text = "Arguments:"; + // + // label28 + // + this.label28.AutoSize = true; + this.label28.Location = new System.Drawing.Point(87, 14); + this.label28.Name = "label28"; + this.label28.Size = new System.Drawing.Size(56, 13); + this.label28.TabIndex = 31; + this.label28.Text = "Extension:"; + // + // audioExtension + // + this.audioExtension.Location = new System.Drawing.Point(193, 11); + this.audioExtension.Name = "audioExtension"; + this.audioExtension.Size = new System.Drawing.Size(202, 20); + this.audioExtension.TabIndex = 30; + this.audioExtension.Leave += new System.EventHandler(this.audioExtension_Leave); + // + // audioDelete + // + this.audioDelete.Location = new System.Drawing.Point(171, 317); + this.audioDelete.Name = "audioDelete"; + this.audioDelete.Size = new System.Drawing.Size(75, 23); + this.audioDelete.TabIndex = 29; + this.audioDelete.Text = "&Delete"; + this.audioDelete.UseVisualStyleBackColor = true; + this.audioDelete.Click += new System.EventHandler(this.audioDelete_Click); + // + // audioAdd + // + this.audioAdd.Location = new System.Drawing.Point(90, 317); + this.audioAdd.Name = "audioAdd"; + this.audioAdd.Size = new System.Drawing.Size(75, 23); + this.audioAdd.TabIndex = 28; + this.audioAdd.Text = "&Add"; + this.audioAdd.UseVisualStyleBackColor = true; + this.audioAdd.Click += new System.EventHandler(this.audioAdd_Click); + // + // audioExtList + // + this.audioExtList.FormattingEnabled = true; + this.audioExtList.Location = new System.Drawing.Point(3, 11); + this.audioExtList.Name = "audioExtList"; + this.audioExtList.Size = new System.Drawing.Size(78, 329); + this.audioExtList.TabIndex = 27; + this.audioExtList.SelectedIndexChanged += new System.EventHandler(this.audioExtList_SelectedIndexChanged); + // + // dvd_vcd_svcd_Tab + // + this.dvd_vcd_svcd_Tab.Controls.Add(this.audioCDArguments); + this.dvd_vcd_svcd_Tab.Controls.Add(this.label6); + this.dvd_vcd_svcd_Tab.Controls.Add(this.label11); + this.dvd_vcd_svcd_Tab.Controls.Add(this.svcdArguments); + this.dvd_vcd_svcd_Tab.Controls.Add(this.label10); + this.dvd_vcd_svcd_Tab.Controls.Add(this.vcdArguments); + this.dvd_vcd_svcd_Tab.Controls.Add(this.label9); + this.dvd_vcd_svcd_Tab.Controls.Add(this.dvdArguments); + this.dvd_vcd_svcd_Tab.Location = new System.Drawing.Point(4, 22); + this.dvd_vcd_svcd_Tab.Name = "dvd_vcd_svcd_Tab"; + this.dvd_vcd_svcd_Tab.Size = new System.Drawing.Size(403, 352); + this.dvd_vcd_svcd_Tab.TabIndex = 3; + this.dvd_vcd_svcd_Tab.Text = "DVD/VCD/SVCD"; + this.dvd_vcd_svcd_Tab.UseVisualStyleBackColor = true; + // + // audioCDArguments + // + this.audioCDArguments.Location = new System.Drawing.Point(122, 89); + this.audioCDArguments.Name = "audioCDArguments"; + this.audioCDArguments.Size = new System.Drawing.Size(256, 20); + this.audioCDArguments.TabIndex = 23; + // + // label6 + // + this.label6.Location = new System.Drawing.Point(3, 92); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(117, 23); + this.label6.TabIndex = 22; + this.label6.Text = "AudioCD Arguments:"; + // + // label11 + // + this.label11.Location = new System.Drawing.Point(3, 66); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(117, 23); + this.label11.TabIndex = 20; + this.label11.Text = "SVCD Arguments:"; + // + // svcdArguments + // + this.svcdArguments.Location = new System.Drawing.Point(122, 63); + this.svcdArguments.Name = "svcdArguments"; + this.svcdArguments.Size = new System.Drawing.Size(256, 20); + this.svcdArguments.TabIndex = 21; + // + // label10 + // + this.label10.Location = new System.Drawing.Point(3, 40); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(117, 23); + this.label10.TabIndex = 18; + this.label10.Text = "VCD Arguments:"; + // + // vcdArguments + // + this.vcdArguments.Location = new System.Drawing.Point(122, 37); + this.vcdArguments.Name = "vcdArguments"; + this.vcdArguments.Size = new System.Drawing.Size(256, 20); + this.vcdArguments.TabIndex = 19; + // + // label9 + // + this.label9.Location = new System.Drawing.Point(3, 14); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(117, 23); + this.label9.TabIndex = 16; + this.label9.Text = "DVD Arguments:"; + // + // dvdArguments + // + this.dvdArguments.Location = new System.Drawing.Point(122, 11); + this.dvdArguments.Name = "dvdArguments"; + this.dvdArguments.Size = new System.Drawing.Size(256, 20); + this.dvdArguments.TabIndex = 17; + // + // streaming_cue_Tab + // + this.streaming_cue_Tab.Controls.Add(this.label20); + this.streaming_cue_Tab.Controls.Add(this.unsvArguments); + this.streaming_cue_Tab.Controls.Add(this.label19); + this.streaming_cue_Tab.Controls.Add(this.udpArguments); + this.streaming_cue_Tab.Controls.Add(this.label18); + this.streaming_cue_Tab.Controls.Add(this.sdpArguments); + this.streaming_cue_Tab.Controls.Add(this.label17); + this.streaming_cue_Tab.Controls.Add(this.rtspArguments); + this.streaming_cue_Tab.Controls.Add(this.label16); + this.streaming_cue_Tab.Controls.Add(this.mpstArguments); + this.streaming_cue_Tab.Controls.Add(this.label15); + this.streaming_cue_Tab.Controls.Add(this.mmsArguments); + this.streaming_cue_Tab.Controls.Add(this.label14); + this.streaming_cue_Tab.Controls.Add(this.httpArguments); + this.streaming_cue_Tab.Controls.Add(this.label13); + this.streaming_cue_Tab.Controls.Add(this.ftpArguments); + this.streaming_cue_Tab.Controls.Add(this.label12); + this.streaming_cue_Tab.Controls.Add(this.cueArguments); + this.streaming_cue_Tab.Location = new System.Drawing.Point(4, 22); + this.streaming_cue_Tab.Name = "streaming_cue_Tab"; + this.streaming_cue_Tab.Size = new System.Drawing.Size(403, 352); + this.streaming_cue_Tab.TabIndex = 5; + this.streaming_cue_Tab.Text = "Other"; + this.streaming_cue_Tab.UseVisualStyleBackColor = true; + // + // label20 + // + this.label20.Location = new System.Drawing.Point(3, 222); + this.label20.Name = "label20"; + this.label20.Size = new System.Drawing.Size(117, 23); + this.label20.TabIndex = 32; + this.label20.Text = "UNSV Arguments:"; + // + // unsvArguments + // + this.unsvArguments.Location = new System.Drawing.Point(122, 219); + this.unsvArguments.Name = "unsvArguments"; + this.unsvArguments.Size = new System.Drawing.Size(256, 20); + this.unsvArguments.TabIndex = 33; + // + // label19 + // + this.label19.Location = new System.Drawing.Point(3, 196); + this.label19.Name = "label19"; + this.label19.Size = new System.Drawing.Size(117, 23); + this.label19.TabIndex = 30; + this.label19.Text = "UDP Arguments:"; + // + // udpArguments + // + this.udpArguments.Location = new System.Drawing.Point(122, 193); + this.udpArguments.Name = "udpArguments"; + this.udpArguments.Size = new System.Drawing.Size(256, 20); + this.udpArguments.TabIndex = 31; + // + // label18 + // + this.label18.Location = new System.Drawing.Point(3, 170); + this.label18.Name = "label18"; + this.label18.Size = new System.Drawing.Size(117, 23); + this.label18.TabIndex = 28; + this.label18.Text = "SDP Arguments:"; + // + // sdpArguments + // + this.sdpArguments.Location = new System.Drawing.Point(122, 167); + this.sdpArguments.Name = "sdpArguments"; + this.sdpArguments.Size = new System.Drawing.Size(256, 20); + this.sdpArguments.TabIndex = 29; + // + // label17 + // + this.label17.Location = new System.Drawing.Point(3, 144); + this.label17.Name = "label17"; + this.label17.Size = new System.Drawing.Size(117, 23); + this.label17.TabIndex = 26; + this.label17.Text = "RT(S)P Arguments:"; + // + // rtspArguments + // + this.rtspArguments.Location = new System.Drawing.Point(122, 141); + this.rtspArguments.Name = "rtspArguments"; + this.rtspArguments.Size = new System.Drawing.Size(256, 20); + this.rtspArguments.TabIndex = 27; + // + // label16 + // + this.label16.Location = new System.Drawing.Point(3, 118); + this.label16.Name = "label16"; + this.label16.Size = new System.Drawing.Size(117, 23); + this.label16.TabIndex = 24; + this.label16.Text = "MPST Arguments:"; + // + // mpstArguments + // + this.mpstArguments.Location = new System.Drawing.Point(122, 115); + this.mpstArguments.Name = "mpstArguments"; + this.mpstArguments.Size = new System.Drawing.Size(256, 20); + this.mpstArguments.TabIndex = 25; + // + // label15 + // + this.label15.Location = new System.Drawing.Point(3, 92); + this.label15.Name = "label15"; + this.label15.Size = new System.Drawing.Size(117, 23); + this.label15.TabIndex = 22; + this.label15.Text = "MMS(T) Arguments:"; + // + // mmsArguments + // + this.mmsArguments.Location = new System.Drawing.Point(122, 89); + this.mmsArguments.Name = "mmsArguments"; + this.mmsArguments.Size = new System.Drawing.Size(256, 20); + this.mmsArguments.TabIndex = 23; + // + // label14 + // + this.label14.Location = new System.Drawing.Point(3, 66); + this.label14.Name = "l... [truncated message content] |
From: <an...@us...> - 2007-02-19 11:19:28
|
Revision: 125 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=125&view=rev Author: and-81 Date: 2007-02-19 03:19:27 -0800 (Mon, 19 Feb 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/TV3ExtChannelChanger/TV3ExtChannelChanger.cs trunk/plugins/TV3MceBlaster/TV3MceBlaster.cs Modified: trunk/plugins/TV3ExtChannelChanger/TV3ExtChannelChanger.cs =================================================================== --- trunk/plugins/TV3ExtChannelChanger/TV3ExtChannelChanger.cs 2007-02-19 11:18:05 UTC (rev 124) +++ trunk/plugins/TV3ExtChannelChanger/TV3ExtChannelChanger.cs 2007-02-19 11:19:27 UTC (rev 125) @@ -400,7 +400,7 @@ return null; } - string[] commands = runCommand.Split(new char[] { '|' }); + string[] commands = runCommand.Split(new char[] { '|' }, StringSplitOptions.None); if (commands.Length != 7) { @@ -466,7 +466,7 @@ return null; } - string[] commands = serialCommand.Split(new char[] { '|' }); + string[] commands = serialCommand.Split(new char[] { '|' }, StringSplitOptions.None); if (commands.Length != 6) { @@ -542,7 +542,7 @@ return null; } - string[] commands = messageCommand.Split(new char[] { '|' }); + string[] commands = messageCommand.Split(new char[] { '|' }, StringSplitOptions.None); if (commands.Length != 4) { Modified: trunk/plugins/TV3MceBlaster/TV3MceBlaster.cs =================================================================== --- trunk/plugins/TV3MceBlaster/TV3MceBlaster.cs 2007-02-19 11:18:05 UTC (rev 124) +++ trunk/plugins/TV3MceBlaster/TV3MceBlaster.cs 2007-02-19 11:19:27 UTC (rev 125) @@ -592,7 +592,7 @@ return null; } - string[] commands = runCommand.Split(new char[] { '|' }); + string[] commands = runCommand.Split(new char[] { '|' }, StringSplitOptions.None); if (commands.Length != 7) { @@ -658,7 +658,7 @@ return null; } - string[] commands = serialCommand.Split(new char[] { '|' }); + string[] commands = serialCommand.Split(new char[] { '|' }, StringSplitOptions.None); if (commands.Length != 6) { @@ -852,7 +852,7 @@ return null; } - string[] commands = messageCommand.Split(new char[] { '|' }); + string[] commands = messageCommand.Split(new char[] { '|' }, StringSplitOptions.None); if (commands.Length != 4) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-02-22 12:41:22
|
Revision: 134 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=134&view=rev Author: and-81 Date: 2007-02-22 04:41:20 -0800 (Thu, 22 Feb 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MCEReplacementTray/MceIrApi.cs trunk/plugins/TV3MceBlaster/MceIrApi.cs Modified: trunk/plugins/MCEReplacementTray/MceIrApi.cs =================================================================== --- trunk/plugins/MCEReplacementTray/MceIrApi.cs 2007-02-22 09:54:55 UTC (rev 133) +++ trunk/plugins/MCEReplacementTray/MceIrApi.cs 2007-02-22 12:41:20 UTC (rev 134) @@ -57,22 +57,29 @@ } /// <summary> - /// Speed to transmit at + /// Speed to transmit IR codes at /// </summary> public enum BlasterSpeed { /// <summary> + /// None - Do not set the blaster speed + /// (Note: If an IR code has been sent with a speed setting previously + /// then that speed setting will continue to take effect, until the + /// unit's power is cycled) + /// </summary> + None = 0, + /// <summary> /// Fast - Set blaster speed to fast /// </summary> - Fast = 0, + Fast = 1, /// <summary> /// Medium - Set blaster speed to medium /// </summary> - Medium = 1, + Medium = 2, /// <summary> /// Slow - Set blaster speed to slow /// </summary> - Slow = 2 + Slow = 3, } /// <summary> Modified: trunk/plugins/TV3MceBlaster/MceIrApi.cs =================================================================== --- trunk/plugins/TV3MceBlaster/MceIrApi.cs 2007-02-22 09:54:55 UTC (rev 133) +++ trunk/plugins/TV3MceBlaster/MceIrApi.cs 2007-02-22 12:41:20 UTC (rev 134) @@ -57,22 +57,29 @@ } /// <summary> - /// Speed to transmit at + /// Speed to transmit IR codes at /// </summary> public enum BlasterSpeed { /// <summary> + /// None - Do not set the blaster speed + /// (Note: If an IR code has been sent with a speed setting previously + /// then that speed setting will continue to take effect, until the + /// unit's power is cycled) + /// </summary> + None = 0, + /// <summary> /// Fast - Set blaster speed to fast /// </summary> - Fast = 0, + Fast = 1, /// <summary> /// Medium - Set blaster speed to medium /// </summary> - Medium = 1, + Medium = 2, /// <summary> /// Slow - Set blaster speed to slow /// </summary> - Slow = 2 + Slow = 3, } /// <summary> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-02-25 05:56:27
|
Revision: 137 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=137&view=rev Author: and-81 Date: 2007-02-24 21:56:26 -0800 (Sat, 24 Feb 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MCEReplacement/MCEReplacement.cs trunk/plugins/MCEReplacement/MceIrApi.cs trunk/plugins/MCEReplacementTray/MceIrApi.cs trunk/plugins/TV3MceBlaster/MceIrApi.cs trunk/plugins/XBCDRC/XBCDRCPlugin.cs Modified: trunk/plugins/MCEReplacement/MCEReplacement.cs =================================================================== --- trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-02-23 03:48:20 UTC (rev 136) +++ trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-02-25 05:56:26 UTC (rev 137) @@ -1148,6 +1148,13 @@ { int card = int.Parse(tunerCard); + // To fix a known bug in MediaPortal scheduled recording (Added: 25-Feb-2007) + if (card < 0) + card = 0; + + if (card >= ExternalChannelConfigs.Length) + throw new ArgumentException("Card number is higher than last card in list, reconfigure plugin TV cards."); + ExternalChannelConfig config = ExternalChannelConfigs[card]; // Clean up the "externalChannel" string into "channel". Modified: trunk/plugins/MCEReplacement/MceIrApi.cs =================================================================== --- trunk/plugins/MCEReplacement/MceIrApi.cs 2007-02-23 03:48:20 UTC (rev 136) +++ trunk/plugins/MCEReplacement/MceIrApi.cs 2007-02-25 05:56:26 UTC (rev 137) @@ -235,6 +235,11 @@ [DllImport("MceIr.dll")] [return: MarshalAs(UnmanagedType.Bool)] static extern bool MceIrPlaybackFromFile(SafeFileHandle fileHandle); + /// <summary> + /// Transmit an IR Code from a file. + /// </summary> + /// <param name="fileHandle">Handle to the file containing the IR Code.</param> + /// <returns>Success.</returns> public static bool PlaybackFromFile(SafeFileHandle fileHandle) { _inUse = true; @@ -246,6 +251,9 @@ [DllImport("MceIr.dll")] [return: MarshalAs(UnmanagedType.Bool)] static extern bool MceIrSuspend(); + /// <summary> + /// Suspend the MceIrApi. + /// </summary> public static void Suspend() { if (!_isSuspended) @@ -259,6 +267,9 @@ [DllImport("MceIr.dll")] [return: MarshalAs(UnmanagedType.Bool)] static extern bool MceIrResume(); + /// <summary> + /// Resume the MceIrApi. + /// </summary> public static void Resume() { if (_isSuspended) @@ -273,6 +284,10 @@ [DllImport("MceIr.dll")] [return: MarshalAs(UnmanagedType.Bool)] static extern bool MceIrSelectBlaster(int portNumber); + /// <summary> + /// Select the Blaster port to use for transmitting IR Codes. + /// </summary> + /// <param name="port">Port to send to.</param> public static void SelectBlaster(BlasterPort port) { _inUse = true; @@ -282,6 +297,11 @@ [DllImport("MceIr.dll")] [return: MarshalAs(UnmanagedType.Bool)] static extern bool MceIrCheckFile(SafeFileHandle fileHandle); + /// <summary> + /// Check an IR Code file to ensure it is valid. + /// </summary> + /// <param name="fileHandle">Handle to file to check.</param> + /// <returns>True if file is valid, False if file is invalid.</returns> public static bool CheckFile(SafeFileHandle fileHandle) { _inUse = true; @@ -291,6 +311,10 @@ [DllImport("MceIr.dll")] [return: MarshalAs(UnmanagedType.Bool)] static extern bool MceIrSetBlasterSpeed(int speed); + /// <summary> + /// Set the Speed to transmit IR Codes at. + /// </summary> + /// <param name="speed">IR Code speed.</param> public static void SetBlasterSpeed(BlasterSpeed speed) { _inUse = true; @@ -300,6 +324,10 @@ [DllImport("MceIr.dll")] [return: MarshalAs(UnmanagedType.Bool)] static extern bool MceIrSetBlasterType(int type); + /// <summary> + /// Set the Type of MCE unit. + /// </summary> + /// <param name="type">Manufacturer of MCE unit.</param> public static void SetBlasterType(BlasterType type) { _inUse = true; Modified: trunk/plugins/MCEReplacementTray/MceIrApi.cs =================================================================== --- trunk/plugins/MCEReplacementTray/MceIrApi.cs 2007-02-23 03:48:20 UTC (rev 136) +++ trunk/plugins/MCEReplacementTray/MceIrApi.cs 2007-02-25 05:56:26 UTC (rev 137) @@ -235,6 +235,11 @@ [DllImport("MceIr.dll")] [return: MarshalAs(UnmanagedType.Bool)] static extern bool MceIrPlaybackFromFile(SafeFileHandle fileHandle); + /// <summary> + /// Transmit an IR Code from a file. + /// </summary> + /// <param name="fileHandle">Handle to the file containing the IR Code.</param> + /// <returns>Success.</returns> public static bool PlaybackFromFile(SafeFileHandle fileHandle) { _inUse = true; @@ -246,6 +251,9 @@ [DllImport("MceIr.dll")] [return: MarshalAs(UnmanagedType.Bool)] static extern bool MceIrSuspend(); + /// <summary> + /// Suspend the MceIrApi. + /// </summary> public static void Suspend() { if (!_isSuspended) @@ -259,6 +267,9 @@ [DllImport("MceIr.dll")] [return: MarshalAs(UnmanagedType.Bool)] static extern bool MceIrResume(); + /// <summary> + /// Resume the MceIrApi. + /// </summary> public static void Resume() { if (_isSuspended) @@ -273,6 +284,10 @@ [DllImport("MceIr.dll")] [return: MarshalAs(UnmanagedType.Bool)] static extern bool MceIrSelectBlaster(int portNumber); + /// <summary> + /// Select the Blaster port to use for transmitting IR Codes. + /// </summary> + /// <param name="port">Port to send to.</param> public static void SelectBlaster(BlasterPort port) { _inUse = true; @@ -282,6 +297,11 @@ [DllImport("MceIr.dll")] [return: MarshalAs(UnmanagedType.Bool)] static extern bool MceIrCheckFile(SafeFileHandle fileHandle); + /// <summary> + /// Check an IR Code file to ensure it is valid. + /// </summary> + /// <param name="fileHandle">Handle to file to check.</param> + /// <returns>True if file is valid, False if file is invalid.</returns> public static bool CheckFile(SafeFileHandle fileHandle) { _inUse = true; @@ -291,6 +311,10 @@ [DllImport("MceIr.dll")] [return: MarshalAs(UnmanagedType.Bool)] static extern bool MceIrSetBlasterSpeed(int speed); + /// <summary> + /// Set the Speed to transmit IR Codes at. + /// </summary> + /// <param name="speed">IR Code speed.</param> public static void SetBlasterSpeed(BlasterSpeed speed) { _inUse = true; @@ -300,6 +324,10 @@ [DllImport("MceIr.dll")] [return: MarshalAs(UnmanagedType.Bool)] static extern bool MceIrSetBlasterType(int type); + /// <summary> + /// Set the Type of MCE unit. + /// </summary> + /// <param name="type">Manufacturer of MCE unit.</param> public static void SetBlasterType(BlasterType type) { _inUse = true; Modified: trunk/plugins/TV3MceBlaster/MceIrApi.cs =================================================================== --- trunk/plugins/TV3MceBlaster/MceIrApi.cs 2007-02-23 03:48:20 UTC (rev 136) +++ trunk/plugins/TV3MceBlaster/MceIrApi.cs 2007-02-25 05:56:26 UTC (rev 137) @@ -235,6 +235,11 @@ [DllImport("MceIr.dll")] [return: MarshalAs(UnmanagedType.Bool)] static extern bool MceIrPlaybackFromFile(SafeFileHandle fileHandle); + /// <summary> + /// Transmit an IR Code from a file. + /// </summary> + /// <param name="fileHandle">Handle to the file containing the IR Code.</param> + /// <returns>Success.</returns> public static bool PlaybackFromFile(SafeFileHandle fileHandle) { _inUse = true; @@ -246,6 +251,9 @@ [DllImport("MceIr.dll")] [return: MarshalAs(UnmanagedType.Bool)] static extern bool MceIrSuspend(); + /// <summary> + /// Suspend the MceIrApi. + /// </summary> public static void Suspend() { if (!_isSuspended) @@ -259,6 +267,9 @@ [DllImport("MceIr.dll")] [return: MarshalAs(UnmanagedType.Bool)] static extern bool MceIrResume(); + /// <summary> + /// Resume the MceIrApi. + /// </summary> public static void Resume() { if (_isSuspended) @@ -273,6 +284,10 @@ [DllImport("MceIr.dll")] [return: MarshalAs(UnmanagedType.Bool)] static extern bool MceIrSelectBlaster(int portNumber); + /// <summary> + /// Select the Blaster port to use for transmitting IR Codes. + /// </summary> + /// <param name="port">Port to send to.</param> public static void SelectBlaster(BlasterPort port) { _inUse = true; @@ -282,6 +297,11 @@ [DllImport("MceIr.dll")] [return: MarshalAs(UnmanagedType.Bool)] static extern bool MceIrCheckFile(SafeFileHandle fileHandle); + /// <summary> + /// Check an IR Code file to ensure it is valid. + /// </summary> + /// <param name="fileHandle">Handle to file to check.</param> + /// <returns>True if file is valid, False if file is invalid.</returns> public static bool CheckFile(SafeFileHandle fileHandle) { _inUse = true; @@ -291,6 +311,10 @@ [DllImport("MceIr.dll")] [return: MarshalAs(UnmanagedType.Bool)] static extern bool MceIrSetBlasterSpeed(int speed); + /// <summary> + /// Set the Speed to transmit IR Codes at. + /// </summary> + /// <param name="speed">IR Code speed.</param> public static void SetBlasterSpeed(BlasterSpeed speed) { _inUse = true; @@ -300,6 +324,10 @@ [DllImport("MceIr.dll")] [return: MarshalAs(UnmanagedType.Bool)] static extern bool MceIrSetBlasterType(int type); + /// <summary> + /// Set the Type of MCE unit. + /// </summary> + /// <param name="type">Manufacturer of MCE unit.</param> public static void SetBlasterType(BlasterType type) { _inUse = true; Modified: trunk/plugins/XBCDRC/XBCDRCPlugin.cs =================================================================== --- trunk/plugins/XBCDRC/XBCDRCPlugin.cs 2007-02-23 03:48:20 UTC (rev 136) +++ trunk/plugins/XBCDRC/XBCDRCPlugin.cs 2007-02-25 05:56:26 UTC (rev 137) @@ -39,11 +39,6 @@ [MarshalAs(UnmanagedType.U4)] EFileAttributes flags, IntPtr template); - //[DllImport("kernel32", SetLastError = true)] - //[return: MarshalAs(UnmanagedType.Bool)] - //static extern bool CloseHandle( - // SafeFileHandle hObject); - [Flags] enum EFileAttributes : uint { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <se...@us...> - 2007-02-28 05:30:12
|
Revision: 140 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=140&view=rev Author: sergem1 Date: 2007-02-27 21:30:01 -0800 (Tue, 27 Feb 2007) Log Message: ----------- Added Paths: ----------- trunk/plugins/ETVNet/ trunk/plugins/ETVNet/ETVNet/ trunk/plugins/ETVNet/ETVNet/ClassDiagram1.cd trunk/plugins/ETVNet/ETVNet/DialogRuKeyboard.cs trunk/plugins/ETVNet/ETVNet/ETVBrowser.cs trunk/plugins/ETVNet/ETVNet/ETVNet.csproj trunk/plugins/ETVNet/ETVNet/ETVNet.csproj.user trunk/plugins/ETVNet/ETVNet/ETVNetStreamInfo.cs trunk/plugins/ETVNet/ETVNet/PathLink.cs trunk/plugins/ETVNet/ETVNet/PathNode.cs trunk/plugins/ETVNet/ETVNet/PathPage.cs trunk/plugins/ETVNet/ETVNet/PathTerminal.cs trunk/plugins/ETVNet/ETVNet/Plugin.cs trunk/plugins/ETVNet/ETVNet/Properties/ trunk/plugins/ETVNet/ETVNet/Properties/AssemblyInfo.cs trunk/plugins/ETVNet/ETVNet/SetupForm.Designer.cs trunk/plugins/ETVNet/ETVNet/SetupForm.cs trunk/plugins/ETVNet/ETVNet/SetupForm.resx trunk/plugins/ETVNet/ETVNet/TODO.txt trunk/plugins/ETVNet/ETVNet/TopList.cs trunk/plugins/ETVNet/ETVNet/skinfiles/ trunk/plugins/ETVNet/ETVNet/skinfiles/DialogETVNetStreamInfo.xml trunk/plugins/ETVNet/ETVNet/skinfiles/DialogRuKeyboard.xml trunk/plugins/ETVNet/ETVNet/skinfiles/ETVNet_logo.png trunk/plugins/ETVNet/ETVNet/skinfiles/etvnet.main.xml trunk/plugins/ETVNet/ETVNet/skinfiles/wide/ trunk/plugins/ETVNet/ETVNet/skinfiles/wide/DialogETVNetStreamInfo.xml trunk/plugins/ETVNet/ETVNet/skinfiles/wide/DialogRuKeyboard.xml trunk/plugins/ETVNet/ETVNet/skinfiles/wide/etvnet.main.xml trunk/plugins/ETVNet/ETVNet.sln trunk/plugins/ETVNet/ETVNet.suo trunk/plugins/ETVNet/Readme.build.txt Added: trunk/plugins/ETVNet/ETVNet/ClassDiagram1.cd =================================================================== --- trunk/plugins/ETVNet/ETVNet/ClassDiagram1.cd (rev 0) +++ trunk/plugins/ETVNet/ETVNet/ClassDiagram1.cd 2007-02-28 05:30:01 UTC (rev 140) @@ -0,0 +1 @@ + \ No newline at end of file Added: trunk/plugins/ETVNet/ETVNet/DialogRuKeyboard.cs =================================================================== --- trunk/plugins/ETVNet/ETVNet/DialogRuKeyboard.cs (rev 0) +++ trunk/plugins/ETVNet/ETVNet/DialogRuKeyboard.cs 2007-02-28 05:30:01 UTC (rev 140) @@ -0,0 +1,250 @@ +#region Copyright (C) 2005-2007 Team MediaPortal + +/* + * Copyright (C) 2005-2007 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.Drawing; +using System.Net; +using System.Collections; +using MediaPortal.GUI.Library; +using MediaPortal.Util; + +namespace ETVNet +{ + /// <summary> + /// + /// </summary> + public class DialogRuKeyboard : GUIWindow, IRenderLayer + { + #region keyButtons + + [SkinControlAttribute(20)] + protected GUILabelControl inputLabel = null; + [SkinControlAttribute(21)] + protected GUIButtonControl doneButton = null; + #endregion + + public string inputString; + public bool done; + Hashtable keyTable; + + #region Base Dialog Variables + bool m_bRunning = false; + int m_dwParentWindowID = 0; + GUIWindow m_pParentWindow = null; + #endregion + + bool m_bOverlay = false; + + public DialogRuKeyboard() + { + GetID = 7767; + inputString = ""; + keyTable = new Hashtable(33); + // 1 + keyTable.Add(9011, "А"); + keyTable.Add(9012, "Б"); + keyTable.Add(9013, "В"); + keyTable.Add(9014, "Г"); + keyTable.Add(9015, "Д"); + keyTable.Add(9016, "Е"); + // 2 + keyTable.Add(9021, "Ё"); + keyTable.Add(9022, "Ж"); + keyTable.Add(9023, "З"); + keyTable.Add(9024, "И"); + keyTable.Add(9025, "Й"); + keyTable.Add(9026, "К"); + // 3 + keyTable.Add(9031, "Л"); + keyTable.Add(9032, "М"); + keyTable.Add(9033, "Н"); + keyTable.Add(9034, "О"); + keyTable.Add(9035, "П"); + keyTable.Add(9036, "Р"); + // 4 + keyTable.Add(9041, "С"); + keyTable.Add(9042, "Т"); + keyTable.Add(9043, "У"); + keyTable.Add(9044, "Ф"); + keyTable.Add(9045, "Х"); + keyTable.Add(9046, "Ц"); + // 5 + keyTable.Add(9051, "Ч"); + keyTable.Add(9052, "Ш"); + keyTable.Add(9053, "Щ"); + keyTable.Add(9054, "Ъ"); + keyTable.Add(9055, "Ы"); + keyTable.Add(9056, "Ь"); + // 6 + keyTable.Add(9061, "Э"); + keyTable.Add(9062, "Ю"); + keyTable.Add(9063, "Я"); + } + + public override bool Init() + { + done = false; + return Load(GUIGraphicsContext.Skin + @"\DialogRuKeyboard.xml"); + } + + public override void PreInit() + { + } + + public override void OnAction(Action action) + { + if (action.wID == Action.ActionType.ACTION_CONTEXT_MENU) + { + Close(); + return; + } + if (action.wID == Action.ActionType.ACTION_PREVIOUS_MENU) + { + if (doneButton.Focus) + { + Close(); + return; + } + else + { + if (inputString.Length > 0) + { + inputString = inputString.Substring(0, inputString.Length - 1); + if (inputString.Length > 0) + inputLabel.Label = inputString; + else + inputLabel.Label = "<...>"; + } + return; + } + } + base.OnAction(action); + } + + #region Base Dialog Members + public void RenderDlg(float timePassed) + { + base.Render(timePassed); + } + + void Close() + { + GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_WINDOW_DEINIT, GetID, 0, 0, 0, 0, null); + OnMessage(msg); + + GUIWindowManager.UnRoute(); + m_pParentWindow = null; + m_bRunning = false; + } + + public void DoModal(int dwParentId) + { + m_dwParentWindowID = dwParentId; + m_pParentWindow = GUIWindowManager.GetWindow(m_dwParentWindowID); + if (null == m_pParentWindow) + { + m_dwParentWindowID = 0; + return; + } + + GUIWindowManager.RouteToWindow(GetID); + + // activate this window... + GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_WINDOW_INIT, GetID, 0, 0, 0, 0, null); + OnMessage(msg); + + GUILayerManager.RegisterLayer(this, GUILayerManager.LayerType.Dialog); + m_bRunning = true; + GUILayerManager.RegisterLayer(this, GUILayerManager.LayerType.Dialog); + while (m_bRunning && GUIGraphicsContext.CurrentState == GUIGraphicsContext.State.RUNNING) + { + GUIWindowManager.Process(); + } + GUILayerManager.UnRegisterLayer(this); + } + #endregion + + + protected override void OnPageDestroy(int newWindowId) + { + if (m_bRunning) + { + // Probably user pressed H (SWITCH_HOME) + GUIWindowManager.UnRoute(); + m_pParentWindow = null; + m_bRunning = false; + } + GUIGraphicsContext.Overlay = m_bOverlay; + base.OnPageDestroy(newWindowId); + } + + protected override void OnPageLoad() + { + base.OnPageLoad(); + m_bOverlay = GUIGraphicsContext.Overlay; + Update(); + } + + protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType) + { + base.OnClicked(controlId, control, actionType); + if (control == doneButton) + { + done = true; + Close(); + } + if (keyTable.ContainsKey(controlId)) + { + inputString += (string)keyTable[controlId]; + inputLabel.Label = inputString; + } + } + + void Update() + { + if(inputString.Length>0) + inputLabel.Label = inputString; + else + inputLabel.Label = "<...>"; + } + + public override void Render(float timePassed) + { + RenderDlg(timePassed); + } + + #region IRenderLayer + public bool ShouldRenderLayer() + { + return true; + } + + public void RenderLayer(float timePassed) + { + Render(timePassed); + } + #endregion + } +} Added: trunk/plugins/ETVNet/ETVNet/ETVBrowser.cs =================================================================== --- trunk/plugins/ETVNet/ETVNet/ETVBrowser.cs (rev 0) +++ trunk/plugins/ETVNet/ETVNet/ETVBrowser.cs 2007-02-28 05:30:01 UTC (rev 140) @@ -0,0 +1,436 @@ +#region Copyright (C) 2005-2007 Team MediaPortal + +/* + * Copyright (C) 2005-2007 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.IO; +using System.Collections.Generic; +using System.Text; +using System.Net; +using System.Xml; +using System.Web; +using System.Collections; +using System.Text.RegularExpressions; + +namespace ETVNet +{ + // the component that goes to etvnet.ca and returns structured data + // most of the site intricacies is hidden here + class ETVBrowser + { + CookieContainer cookies; + Regex regexTopLinks; + Regex regexCategories; + Regex regexLetters; + Regex regexArchivedEntries; + Regex regexPrev; + Regex regexNext; + Regex regexInfo; + Regex regexMMS; + Regex regexJSOpen; + Regex regexDeQuote; + Regex regexTodayEntries; + bool traceHTML; + + public ETVBrowser(bool pTraceHTML) + { + traceHTML = pTraceHTML; + cookies = new CookieContainer(); + regexTopLinks = new Regex( + @"<th.*?>(.*?)</th>.*?(?:<a.*?href=""(.*?)"".*?>([^<]*)?</a>.*" + + @"?(?=<(?:a|th)))+", + RegexOptions.IgnoreCase + | RegexOptions.Singleline + | RegexOptions.CultureInvariant + | RegexOptions.IgnorePatternWhitespace + | RegexOptions.Compiled + ); + regexCategories = new Regex( + @"<a\s+href=""([^""]*?)""\s*>([^<]*?)</a>\s+\((\d+)\)", + RegexOptions.IgnoreCase + | RegexOptions.Singleline + | RegexOptions.CultureInvariant + | RegexOptions.IgnorePatternWhitespace + | RegexOptions.Compiled + ); + regexLetters = new Regex( + @"<a\s+href=""([^""]*?start_letter[^""]*?)""\s*>([^<]*?)</a>", + RegexOptions.IgnoreCase + | RegexOptions.Singleline + | RegexOptions.CultureInvariant + | RegexOptions.IgnorePatternWhitespace + | RegexOptions.Compiled + ); + regexArchivedEntries = new Regex( + @"<td[^>]*?>\d\d(\d\d-\d\d-\d\d)\s(\d\d:\d\d)</td>\s*" + "\r\n" + @"<td[^>]" + + @"*?>(\d+)</td>\s*" + "\r\n" + @"<td[^>]*?>\s*\[<a\s+href=""([^""]*?)""\s*>" + + @"[^<]*?</a>\]\s*</td>\s*" + "\r\n" + @"<td[^>]*?>.*?<a\s+href=""([^""]*?)""\s" + + @"*>([^<]*?)</a>.*?</td>\s*" + "\r\n" + @"<td[^>]*?>(.*?)</td>" + "\r\n" + @"", + RegexOptions.IgnoreCase + | RegexOptions.Singleline + | RegexOptions.CultureInvariant + | RegexOptions.IgnorePatternWhitespace + | RegexOptions.Compiled + ); + regexPrev = new Regex( + @"\[<a\s+href=""([^""]*?)""\s*>\d+</a>\].*?(?=\[<b>\d+</b>\])", + RegexOptions.IgnoreCase + | RegexOptions.Singleline + | RegexOptions.CultureInvariant + | RegexOptions.IgnorePatternWhitespace + | RegexOptions.Compiled + ); + regexNext = new Regex( + @"(?<=\[<b>\d+</b>\]).*?\[<a\s+href=""([^""]*?)""\s*>\d+</a>\]", + RegexOptions.IgnoreCase + | RegexOptions.Singleline + | RegexOptions.CultureInvariant + | RegexOptions.IgnorePatternWhitespace + | RegexOptions.Compiled + ); + regexInfo = new Regex( + @"(?<!(?:<style[^>]*?|<a[^>]*?))>(?:[\s]+|([^<]*?))<", + RegexOptions.IgnoreCase + | RegexOptions.Singleline + | RegexOptions.CultureInvariant + | RegexOptions.IgnorePatternWhitespace + | RegexOptions.Compiled + ); + regexMMS = new Regex( + @"<a\s+href=""(mms:[^""]+)""", + RegexOptions.IgnoreCase + | RegexOptions.Singleline + | RegexOptions.CultureInvariant + | RegexOptions.IgnorePatternWhitespace + | RegexOptions.Compiled + ); + regexJSOpen = new Regex( + @"open\(([^,]+),", + RegexOptions.IgnoreCase + | RegexOptions.Singleline + | RegexOptions.CultureInvariant + | RegexOptions.IgnorePatternWhitespace + | RegexOptions.Compiled + ); + regexDeQuote = new Regex( + @"'([^']+)'", + RegexOptions.IgnoreCase + | RegexOptions.Singleline + | RegexOptions.CultureInvariant + | RegexOptions.IgnorePatternWhitespace + | RegexOptions.Compiled + ); + regexTodayEntries = new Regex( + @"<td[^>]*?>\d\d(\d\d-\d\d-\d\d)\s(\d\d:\d\d)</td>\s*"+"\r\n"+ @" + <td[^>" + + @"]*?>\s*\[<a\s+href=""([^""]*?)""\s*>[^<]*?</a>\]\s*</td>\s*" +"\r\n" + + @"<td[^>]*?>.*?<a\s+href=""([^""]*?)""\s*>([^<]*?)</a>.*?</td>" + + @"\s*"+"\r\n"+ @"<td[^>]*?>(.*?)</td>"+"\r\n"+ @"", + RegexOptions.IgnoreCase + | RegexOptions.Singleline + | RegexOptions.CultureInvariant + | RegexOptions.IgnorePatternWhitespace + | RegexOptions.Compiled + ); + + } + + public void login(string username, string password) + { + System.Collections.Hashtable postData = new System.Collections.Hashtable(3); + postData.Add("action","login"); + postData.Add("login",username); + postData.Add("pwd",password); + Stream s = getHTML("http://www.etvnet.ca/cgi-bin/video/eitv_login.cgi", null, postData); // non-compliant + // how to check result ??? + byte[] buffer = new byte[1024]; + s.Read(buffer,0,1024); + String x = System.Text.Encoding.GetEncoding(0).GetString(buffer); + } + + public Hashtable getTopDirectoryPage() + { + Uri baseUrl = new Uri("http://www.etvnet.ca/main.html"); + String todayPage = getHTMLAsString(baseUrl.AbsoluteUri, null, null); + MatchCollection matches = regexTopLinks.Matches(todayPage, 0); + // + // find all stream types - archive, today, live + Hashtable streams = new Hashtable(3); + foreach (Match match in matches) + { + foreach (Capture streamtype in match.Groups[3].Captures) + { + streams[streamtype.Value] = new System.Collections.ArrayList(); + } + } + // + // fill in stream directory links + foreach (string stream in streams.Keys) + { + System.Collections.ArrayList list = (System.Collections.ArrayList)streams[stream]; + foreach (Match match in matches) + { + for (int i = 0; i < match.Groups[3].Captures.Count; i++) + { + if (match.Groups[3].Captures[i].Value == stream) + { + Hashtable entry = new Hashtable(2); + entry.Add("name", HttpUtility.HtmlDecode(match.Groups[1].Value)); + entry.Add("url", new Uri(baseUrl, match.Groups[2].Captures[i].Value).AbsoluteUri); + // ??? insert if video link analysis + list.Add(entry); + } + } + } + } + return streams; + } + + public Hashtable getDirectoryPage(string url) + { + Uri baseUrl = new Uri(url); + String dirPageString = getHTMLAsString(baseUrl.AbsoluteUri, null, null); + + Hashtable dirPage = new Hashtable(5); + System.Collections.ArrayList list; + MatchCollection matches; + + matches = regexCategories.Matches(dirPageString, 0); + list = new ArrayList(); + foreach (Match match in matches) + { + Hashtable entry = new Hashtable(2); + entry.Add("name", HttpUtility.HtmlDecode(match.Groups[2].Value)); + entry.Add("url", new Uri(baseUrl, match.Groups[1].Value).AbsoluteUri); + entry.Add("secondary", HttpUtility.HtmlDecode(match.Groups[2].Value)); + list.Add(entry); + } + dirPage.Add("categories", list); + + matches = regexLetters.Matches(dirPageString, 0); + list = new ArrayList(); + foreach (Match match in matches) + { + Hashtable entry = new Hashtable(2); + entry.Add("name", HttpUtility.HtmlDecode(match.Groups[2].Value)); + entry.Add("url", new Uri(baseUrl, match.Groups[1].Value).AbsoluteUri); + list.Add(entry); + } + dirPage.Add("letters", list); + + matches = regexArchivedEntries.Matches(dirPageString, 0); + list = new ArrayList(); + foreach (Match match in matches) + { + Hashtable entry = new Hashtable(2); + entry.Add("date", match.Groups[1].Value); + entry.Add("time", match.Groups[2].Value); + entry.Add("rating", match.Groups[3].Value); + entry.Add("infoUrl", new Uri(baseUrl, match.Groups[4].Value).AbsoluteUri); + entry.Add("url", new Uri(baseUrl, match.Groups[5].Value).AbsoluteUri); + entry.Add("name", HttpUtility.HtmlDecode(match.Groups[6].Value)); + entry.Add("length", HttpUtility.HtmlDecode(match.Groups[7].Value)); + entry.Add("pageType", "archive"); + list.Add(entry); + } + if (list.Count < 1) // today page + { + matches = regexTodayEntries.Matches(dirPageString, 0); + list = new ArrayList(); + foreach (Match match in matches) + { + Hashtable entry = new Hashtable(2); + entry.Add("date", match.Groups[1].Value); + entry.Add("time", match.Groups[2].Value); + entry.Add("rating", "0"); + entry.Add("infoUrl", new Uri(baseUrl, match.Groups[3].Value).AbsoluteUri); + entry.Add("url", new Uri(baseUrl, match.Groups[4].Value).AbsoluteUri); + entry.Add("name", HttpUtility.HtmlDecode(match.Groups[5].Value)); + entry.Add("length", HttpUtility.HtmlDecode(match.Groups[6].Value)); + entry.Add("pageType", "today"); + list.Add(entry); + } + } + dirPage.Add("entries", list); + + { + Match match; + match = regexPrev.Match(dirPageString, 0); + if (match.Groups[1].Success) + { + dirPage.Add("prev", new Uri(baseUrl, match.Groups[1].Value).AbsoluteUri); + } + + match = regexNext.Match(dirPageString, 0); + if (match.Groups[1].Success) + { + dirPage.Add("next", new Uri(baseUrl, match.Groups[1].Value).AbsoluteUri); + } + } + + return dirPage; + } + + public String getInfoPage(string url) + { + Uri baseUrl = new Uri(url); + String dirPageString = getHTMLAsString(baseUrl.AbsoluteUri, null, null); + + MatchCollection matches; + matches = regexInfo.Matches(dirPageString, 0); + string info = ""; + foreach (Match match in matches) + { + string text = match.Groups[1].Value; + if (text.Length > 0) + { + text = HttpUtility.HtmlDecode(text); + char [] trimChars = {' ','\t','\n','\r','<','>',';'}; + text = text.Trim(trimChars); + if (text.Length > 0) + { + info += text.Trim() + "\r\n"; + } + } + } + return info; + } + + public string getMMSURL(string paramUrl) + { + Match match = regexJSOpen.Match(paramUrl, 0); + if (!match.Groups[1].Success) + return null; + string url = ""; + MatchCollection matches = regexDeQuote.Matches(match.Groups[1].Value); + foreach (Match stringMatch in matches) + { + url+=stringMatch.Groups[1].Value; + } + if(url.Length < 1) + return null; + + String MMSPageString = getHTMLAsString(url, null, null); + match = regexMMS.Match(MMSPageString, 0); + if (!match.Groups[1].Success) + return null; + return match.Groups[1].Value; + } + + public String getHTMLAsString(string URL, Hashtable GETData, Hashtable POSTData) + { + Stream responseStream = getHTML(URL, GETData, POSTData); + // default encoding for non-unicode programs, set in control panel, in all reality should be win-1251 + StreamReader urlRdr = new StreamReader(new StreamReader(responseStream).BaseStream, Encoding.GetEncoding(0)); + string result = urlRdr.ReadToEnd(); + if (traceHTML) + { + StreamWriter writer; + writer = File.CreateText("htmltrace-"+HttpUtility.UrlEncode(URL)); + writer.Write(result); + writer.Close(); + } + return result; + } + + /* + * If etvnet was XHTML-compliant, we'd use this + public XmlDocument getXHTML(string URL, Hashtable GETData, Hashtable POSTData) + { + Stream responseStream = getHTML(URL, GETData, POSTData); + XmlTextReader reader = new XmlTextReader(responseStream); + reader.XmlResolver = null; + XmlDocument xmlDoc = new XmlDocument(); + xmlDoc.Load(reader); + return xmlDoc; + } + */ + + public Stream getHTML(string URL, Hashtable GETData, Hashtable POSTData) + { + // URL encode GET querystring data, if any + string GETDataString = ""; + if (GETData!=null && GETData.Count > 0) + { + foreach(string key in GETData.Keys) + { + if(GETDataString.Length > 0) + GETDataString += "&"; + GETDataString += HttpUtility.UrlEncode(key, Encoding.GetEncoding(0)) + + "=" + HttpUtility.UrlEncode(GETData[key].ToString(), Encoding.GetEncoding(0)); + } + } + // URL encode POST data, if any + string POSTDataString = ""; + if (POSTData!=null && POSTData.Count > 0) + { + foreach(string key in POSTData.Keys) + { + if(POSTDataString.Length > 0) + POSTDataString += "&"; + POSTDataString += HttpUtility.UrlEncode(key,Encoding.GetEncoding(0)) + + "=" + HttpUtility.UrlEncode(POSTData[key].ToString(), Encoding.GetEncoding(0)); + } + } + + HttpWebRequest webRequest; + Uri url; + if (GETData != null && GETData.Count > 0) + { + url = new Uri(URL); + if(url.Query.Length > 0) // some querystring is present already + url = new Uri(URL + "?" + GETDataString); + else + url = new Uri(URL + "&" + GETDataString); + } + else + { + url = new Uri(URL); + } + + if(POSTData!=null && POSTData.Count > 0) + { + webRequest = (HttpWebRequest)WebRequest.Create(url); + webRequest.CookieContainer = cookies; + webRequest.ContentType = "application/x-www-form-urlencoded"; // no file uploads supported so far + webRequest.Method = "POST"; + webRequest.UserAgent = "MediaPortal-ETVNet-Plugin/1.0"; + webRequest.ContentLength = POSTDataString.Length; + Stream postStream = webRequest.GetRequestStream(); + byte[] postBuffer = System.Text.Encoding.GetEncoding(0).GetBytes(POSTDataString); + postStream.Write(postBuffer,0,postBuffer.Length); + postStream.Close(); + }else + { + webRequest = (HttpWebRequest)WebRequest.Create(url); + webRequest.CookieContainer = cookies; + webRequest.Method = "GET"; + webRequest.UserAgent = "MediaPortal-ETVNet-Plugin/1.0"; + } + + WebResponse response = webRequest.GetResponse(); + return response.GetResponseStream(); + } + } +} Added: trunk/plugins/ETVNet/ETVNet/ETVNet.csproj =================================================================== --- trunk/plugins/ETVNet/ETVNet/ETVNet.csproj (rev 0) +++ trunk/plugins/ETVNet/ETVNet/ETVNet.csproj 2007-02-28 05:30:01 UTC (rev 140) @@ -0,0 +1,98 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>8.0.50727</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{35AD720D-DC3B-46D8-BC67-C67335F1CB4C}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>ETVNet</RootNamespace> + <AssemblyName>ETVNet</AssemblyName> + </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.2605.21111, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\mediaportal\xbmc\bin\Release\Core.dll</HintPath> + </Reference> + <Reference Include="Dialogs, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\mediaportal\xbmc\bin\Release\plugins\windows\Dialogs.dll</HintPath> + </Reference> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Web" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml" /> + <Reference Include="Utils, Version=1.0.2605.20848, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\mediaportal\xbmc\bin\Release\Utils.dll</HintPath> + </Reference> + </ItemGroup> + <ItemGroup> + <Compile Include="DialogRuKeyboard.cs" /> + <Compile Include="ETVBrowser.cs" /> + <Compile Include="ETVNetStreamInfo.cs" /> + <Compile Include="PathLink.cs"> + <SubType>Code</SubType> + </Compile> + <Compile Include="PathNode.cs" /> + <Compile Include="PathPage.cs" /> + <Compile Include="PathTerminal.cs" /> + <Compile Include="Plugin.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="SetupForm.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="SetupForm.Designer.cs"> + <DependentUpon>SetupForm.cs</DependentUpon> + </Compile> + <Compile Include="TopList.cs" /> + </ItemGroup> + <ItemGroup> + <None Include="ClassDiagram1.cd" /> + </ItemGroup> + <ItemGroup> + <Content Include="TODO.txt" /> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="SetupForm.resx"> + <SubType>Designer</SubType> + <DependentUpon>SetupForm.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> + --> + <PropertyGroup> + <PostBuildEvent>copy $(TargetPath) ..\..\mediaportal\xbmc\bin\Release\plugins\windows +copy $(ProjectDir)skinfiles\*.xml $(ProjectDir)..\..\mediaportal\xbmc\bin\Release\skin\BlueTwo +copy $(ProjectDir)skinfiles\*.png $(ProjectDir)..\..\mediaportal\xbmc\bin\Release\skin\BlueTwo\Media +copy $(ProjectDir)skinfiles\wide\*.xml "$(ProjectDir)..\..\mediaportal\xbmc\bin\Release\skin\BlueTwo Wide" +copy $(ProjectDir)skinfiles\*.png "$(ProjectDir)..\..\mediaportal\xbmc\bin\Release\skin\BlueTwo Wide\Media" +</PostBuildEvent> + </PropertyGroup> +</Project> \ No newline at end of file Added: trunk/plugins/ETVNet/ETVNet/ETVNet.csproj.user =================================================================== --- trunk/plugins/ETVNet/ETVNet/ETVNet.csproj.user (rev 0) +++ trunk/plugins/ETVNet/ETVNet/ETVNet.csproj.user 2007-02-28 05:30:01 UTC (rev 140) @@ -0,0 +1,9 @@ +<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <ProjectView>ProjectFiles</ProjectView> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <StartAction>Program</StartAction> + <StartProgram>C:\projects\mp-0.2.2.0\xbmc\bin\Release\MediaPortal.exe</StartProgram> + </PropertyGroup> +</Project> \ No newline at end of file Added: trunk/plugins/ETVNet/ETVNet/ETVNetStreamInfo.cs =================================================================== --- trunk/plugins/ETVNet/ETVNet/ETVNetStreamInfo.cs (rev 0) +++ trunk/plugins/ETVNet/ETVNet/ETVNetStreamInfo.cs 2007-02-28 05:30:01 UTC (rev 140) @@ -0,0 +1,187 @@ +#region Copyright (C) 2005-2007 Team MediaPortal + +/* + * Copyright (C) 2005-2007 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.Drawing; +using System.Net; +using System.Collections; +using MediaPortal.GUI.Library; +using MediaPortal.Util; + +namespace ETVNet +{ + /// <summary> + /// + /// </summary> + public class ETVNetStreamInfo : GUIWindow, IRenderLayer + { + [SkinControlAttribute(20)] + protected GUILabelControl streamLabel = null; + [SkinControlAttribute(4)] + protected GUITextControl streamInfo = null; + [SkinControlAttribute(5)] + protected GUIButtonControl playButton = null; + + #region Base Dialog Variables + bool m_bRunning = false; + int m_dwParentWindowID = 0; + GUIWindow m_pParentWindow = null; + #endregion + + public string streamInfoText; + public string streamTitleText; + public bool playPressed; + + bool m_bOverlay = false; + + public ETVNetStreamInfo() + { + GetID = 7768; + streamInfoText = "info"; + streamTitleText = "info"; + playPressed = false; + } + + public override bool Init() + { + playPressed = false; + return Load(GUIGraphicsContext.Skin + @"\DialogETVNetStreamInfo.xml"); + } + + public override void PreInit() + { + } + + public override void OnAction(Action action) + { + if (action.wID == Action.ActionType.ACTION_PREVIOUS_MENU || action.wID == Action.ActionType.ACTION_CONTEXT_MENU) + { + Close(); + return; + } + base.OnAction(action); + } + + #region Base Dialog Members + public void RenderDlg(float timePassed) + { + base.Render(timePassed); + } + + void Close() + { + GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_WINDOW_DEINIT, GetID, 0, 0, 0, 0, null); + OnMessage(msg); + + GUIWindowManager.UnRoute(); + m_pParentWindow = null; + m_bRunning = false; + } + + public void DoModal(int dwParentId) + { + m_dwParentWindowID = dwParentId; + m_pParentWindow = GUIWindowManager.GetWindow(m_dwParentWindowID); + if (null == m_pParentWindow) + { + m_dwParentWindowID = 0; + return; + } + + GUIWindowManager.RouteToWindow(GetID); + + // active this window... + GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_WINDOW_INIT, GetID, 0, 0, 0, 0, null); + OnMessage(msg); + + GUILayerManager.RegisterLayer(this, GUILayerManager.LayerType.Dialog); + m_bRunning = true; + GUILayerManager.RegisterLayer(this, GUILayerManager.LayerType.Dialog); + while (m_bRunning && GUIGraphicsContext.CurrentState == GUIGraphicsContext.State.RUNNING) + { + GUIWindowManager.Process(); + } + GUILayerManager.UnRegisterLayer(this); + } + #endregion + + + protected override void OnPageDestroy(int newWindowId) + { + if (m_bRunning) + { + // Probably user pressed H (SWITCH_HOME) + GUIWindowManager.UnRoute(); + m_pParentWindow = null; + m_bRunning = false; + } + GUIGraphicsContext.Overlay = m_bOverlay; + base.OnPageDestroy(newWindowId); + } + + protected override void OnPageLoad() + { + base.OnPageLoad(); + m_bOverlay = GUIGraphicsContext.Overlay; + Update(); + } + + protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType) + { + base.OnClicked(controlId, control, actionType); + if (control == playButton) + { + // ??? set result var, exit + playPressed = true; + Close(); + } + } + + void Update() + { + playPressed = false; + streamLabel.Label = streamTitleText; + streamInfo.Clear(); + streamInfo.Label = streamInfoText; + } + + public override void Render(float timePassed) + { + RenderDlg(timePassed); + } + + #region IRenderLayer + public bool ShouldRenderLayer() + { + return true; + } + + public void RenderLayer(float timePassed) + { + Render(timePassed); + } + #endregion + } +} Added: trunk/plugins/ETVNet/ETVNet/PathLink.cs =================================================================== --- trunk/plugins/ETVNet/ETVNet/PathLink.cs (rev 0) +++ trunk/plugins/ETVNet/ETVNet/PathLink.cs 2007-02-28 05:30:01 UTC (rev 140) @@ -0,0 +1,55 @@ +#region Copyright (C) 2005-2007 Team MediaPortal + +/* + * Copyright (C) 2005-2007 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.Collections.Generic; +using System.Collections; +using System.Text; +using System.Xml; + +namespace ETVNet +{ + // this is a list link class, sort of a keychain/placeholder, no data processing here + class PathLink: PathNode + { + public PathLink(string paramTitle, ETVBrowser browser, PathNode predecessor): base(browser, predecessor) + { + title = paramTitle; + nodeType = PathNodeType.Branch; + } + + public void setList(System.Collections.ArrayList paramList) + { + list = paramList; + } + + public override System.Collections.ArrayList getList() + { + if (list != null) + return list; + throw new SystemException("list is not set"); + } + } +} Added: trunk/plugins/ETVNet/ETVNet/PathNode.cs =================================================================== --- trunk/plugins/ETVNet/ETVNet/PathNode.cs (rev 0) +++ trunk/plugins/ETVNet/ETVNet/PathNode.cs 2007-02-28 05:30:01 UTC (rev 140) @@ -0,0 +1,95 @@ +#region Copyright (C) 2005-2007 Team MediaPortal + +/* + * Copyright (C) 2005-2007 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.Collections.Generic; +using System.Text; + +namespace ETVNet +{ + enum PathNodeType + { + Branch, + Terminal + }; + // base path node class, mostly pure virtual + class PathNode + { + protected System.Collections.ArrayList list; + public ETVBrowser browser; + protected PathNode predecessor; + protected PathNodeType nodeType; + protected string title; + protected string title2; + + public PathNode(ETVBrowser paramBrowser, PathNode paramPredecessor) + { + list = null; + browser = paramBrowser; + predecessor = paramPredecessor; + nodeType = PathNodeType.Branch; + title = null; + title2 = null; + } + + public virtual PathNodeType getType() + { + return nodeType; + } + + public virtual string getPointInfo() + { + throw new SystemException("call to virtual method"); + } + + public virtual string getPointURL() + { + throw new SystemException("call to virtual method"); + } + + + public virtual System.Collections.ArrayList getList() + { + throw new SystemException("call to virtual method"); + } + + public virtual string getLabel() + { + if (title != null) + return title; + throw new SystemException("call to virtual method"); + } + + public virtual string getSecondaryLabel() + { + return title2; // null == none + } + + public PathNode getPredecessor() + { + return predecessor; + } + } +} Added: trunk/plugins/ETVNet/ETVNet/PathPage.cs =================================================================== --- trunk/plugins/ETVNet/ETVNet/PathPage.cs (rev 0) +++ trunk/plugins/ETVNet/ETVNet/PathPage.cs 2007-02-28 05:30:01 UTC (rev 140) @@ -0,0 +1,109 @@ +#region Copyright (C) 2005-2007 Team MediaPortal + +/* + * Copyright (C) 2005-2007 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.Collections.Generic; +using System.Collections; +using System.Text; + +namespace ETVNet +{ + class PathPage: PathNode + { + string url; + + public PathPage(string paramTitle, string paramUrl, ETVBrowser browser, PathNode predecessor): base(browser, predecessor) + { + title = paramTitle; + url = paramUrl; + } + + public override System.Collections.ArrayList getList() + { + list = new ArrayList(); + Hashtable dirPage = browser.getDirectoryPage(url); + if (dirPage.ContainsKey("prev")) + { + list.Add(new PathPage("- previous",(string)dirPage["prev"], browser, this)); + } + // categories, if present + if (((ArrayList)dirPage["categories"]).Count > 0) + { + PathLink link = new PathLink("- categories", browser, this); + System.Collections.ArrayList newList = new ArrayList(); + foreach(Hashtable item in (ArrayList)dirPage["categories"]) + { + newList.Add(new PathPage((string)item["name"], (string)item["url"], browser, this)); + } + link.setList(newList); + list.Add(link); + } + // letters, if present + if (((ArrayList)dirPage["letters"]).Count > 0) + { + PathLink link = new PathLink("- jump to letter", browser, this); + System.Collections.ArrayList newList = new ArrayList(); + foreach(Hashtable item in (ArrayList)dirPage["letters"]) + { + newList.Add(new PathPage((string)item["name"], (string)item["url"], browser, this)); + } + link.setList(newList); + list.Add(link); + } + + // entries, if present + if (((ArrayList)dirPage["entries"]).Count > 0) + { + foreach(Hashtable node in (ArrayList)dirPage["entries"]) + { + PathNode pathnode; + if (((string)node["url"]).StartsWith("javascript:")) // stream link + { + string secondaryTitle = null; + if ((string)node["pageType"] == "today") + secondaryTitle = (string)node["time"]; + else + secondaryTitle = (string)node["date"]; + pathnode = new PathTerminal((string)node["name"], secondaryTitle, (string)node["url"], (string)node["infoUrl"], browser, this); + } + else + { + // archive or today page + pathnode = new PathPage((string)node["name"], (string)node["url"], browser, this); + } + list.Add(pathnode); + } + } + + if (dirPage.ContainsKey("next")) + { + list.Add(new PathPage("- next", (string)dirPage["next"], browser, this)); + } + + return list; + } + + } +} Added: trunk/plugins/ETVNet/ETVNet/PathTerminal.cs =================================================================== --- trunk/plugins/ETVNet/ETVNet/PathTerminal.cs (rev 0) +++ trunk/plugins/ETVNet/ETVNet/PathTerminal.cs 2007-02-28 05:30:01 UTC (rev 140) @@ -0,0 +1,71 @@ +#region Copyright (C) 2005-2007 Team MediaPortal + +/* + * Copyright (C) 2005-2007 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.Collections.Generic; +using System.Collections; +using System.Text; +using System.Xml; + +namespace ETVNet +{ + class PathTerminal: PathNode + { + string url; + string infoUrl; + string info; + + public PathTerminal(string paramTitle, string secondaryTitle, string paramUrl, string paramInfoUrl, ETVBrowser browser, PathNode predecessor): base(browser, predecessor) + { + title = paramTitle; + url = paramUrl; + infoUrl = paramInfoUrl; + info = null; + nodeType = PathNodeType.Terminal; + title2 = secondaryTitle; + } + + public override string getPointInfo() + { + if (info!=null) + return info; + if (infoUrl != null) + info = browser.getInfoPage(infoUrl); + else + info = ""; + return info; + } + + public override string getPointURL() + { + return url; + } + + public string getMMS() + { + return browser.getMMSURL(url); + } + } +} Added: trunk/plugins/ETVNet/ETVNet/Plugin.cs =================================================================== --- trunk/plugins/ETVNet/ETVNet/Plugin.cs (rev 0) +++ trunk/plugins/ETVNet/ETVNet/Plugin.cs 2007-02-28 05:30:01 UTC (rev 140) @@ -0,0 +1,342 @@ +#region Copyright (C) 2005-2007 Team MediaPortal + +/* + * Copyright (C) 2005-2007 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.Text; +using System.Web; +using System.Collections.Generic; +using System.Windows.Forms; +using MediaPortal.GUI.Library; +using MediaPortal.Dialogs; +using MediaPortal.Player; +using MediaPortal.Profile; +using MediaPortal.Util; +using MediaPortal.Configuration; + +namespace ETVNet +{ + /// <summary> + /// Summary description for Plugin. + /// </summary> + public class Plugin : GUIWindow, ISetupForm + { + [SkinControlAttribute(2)] + protected GUIButtonControl buttonRefresh = null; + [SkinControlAttribute(3)] + protected GUIButtonControl buttonSearchTitles = null; + [SkinControlAttribute(4)] + protected GUIButtonControl buttonSearchAll = null; + + [SkinControlAttribute(50)] + protected GUIFacadeControl facadeView = null; + + PathNode currentNode; + string username; + string password; + bool traceHTML; + + public Plugin() + { + // + // TODO: Add constructor logic here + // + } + + #region ISetupForm Members + + // Returns the name of the plugin which is shown in the plugin menu + public string PluginName() + { + return "ETVNet"; + } + + // Returns the description of the plugin is shown in the plugin menu + public string Description() + { + return "ETVNet.ca Russian TV-on-demand access plugin"; + } + + // Returns the author of the plugin which is shown in the plugin menu + public string Author() + { + return "Sergey Menshikov"; + } + + // show the setup dialog + public void ShowPlugin() + { + // ??? add configuration dialog for username and password + System.Windows.Forms.Form setup = new SetupForm(); + setup.ShowDialog(); + } + + // Indicates whether plugin can be enabled/disabled + public bool CanEnable() + { + return true; + } + + // get ID of windowplugin belonging to this setup + public int GetWindowId() + { + return 7769; + } + + // Indicates if plugin is enabled by default; + + public bool DefaultEnabled() + { + return true; + } + + // indicates if a plugin has its own setup screen + public bool HasSetup() + { + return true; + } + + /// <summary> + /// If the plugin should have its 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 its own button on home + /// false : plugin does not need its own button on home</returns> + + public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) + { + strButtonText = PluginName(); + strButtonImage = String.Empty; + strButtonImageFocus = String.Empty; + strPictureImage = String.Empty; + return true; + } + + #endregion + + #region CoreFunctionality + public override int GetID + { + get + { + return 7769; + } + + set + { + + } + } + + public override bool Init() + { + // ??? get from configuration + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + { + username = xmlreader.GetValueAsString("ETVNet", "username", "demo"); + password = xmlreader.GetValueAsString("ETVNet", "password", "demo"); + string traceHTMLstr = xmlreader.GetValueAsString("ETVNet", "traceHTML", "false"); + if (traceHTMLstr == "true") + traceHTML = true; + else + traceHTML = false; + } + currentNode = new TopList(username, password,traceHTML); + return Load(GUIGraphicsContext.Skin + @"\etvnet.main.xml"); + } + + public override void OnAction(Action action) + { + if ((action.wID == Action.ActionType.ACTION_PREVIOUS_MENU) && (facadeView.Focus)) + { + // select and render predecessor + PathNode predecessor = currentNode.getPredecessor(); + if (predecessor != null) + { + currentNode = predecessor; + RenderNode(); + return; + } + // allow to leave plugin from list only if there is no predecessor + } + + base.OnAction(action); + } + + protected void RenderNode() + { + System.Collections.ArrayList list = currentNode.getList(); + + facadeView.Clear(); + int i = 0; + foreach (PathNode listItem in list) + { + GUIListItem item = new GUIListItem(listItem.getLabel()); + if(listItem.getSecondaryLabel()!=null) + item.Label2 = listItem.getSecondaryLabel(); + item.ItemId = i++; + facadeView.Add(item); + } + } + + protected override void OnPageLoad() + { + base.OnPageLoad(); + // initial fill + RenderNode(); + } + + protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType) + { + if (control == buttonRefresh) + OnButtonRefresh(); + else if (control == buttonSearchTitles) + OnButtonSearchTitles(); + else if (control == buttonSearchAll) + OnButtonSearchAll(); + else if (control == facadeView) + { + GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_ITEM_SELECTED, GetID, 0, controlId, 0, 0, null); + OnMessage(msg); + int iItem = (int)msg.Param1; + if (actionType == Action.ActionType.ACTION_SHOW_INFO) + { + // ??? auxiliary functions ? + } + if (actionType == Action.ActionType.ACTION_SELECT_ITEM) + { + // navigate forward + int index = facadeView.SelectedListItemIndex; + System.Collections.ArrayList list = currentNode.getList(); + PathNode newNode = (PathNode)list[index]; + if (newNode.getType() == PathNodeType.Branch) + { + currentNode = newNode; + RenderNode(); + } + else + { + ETVNetStreamInfo streamInfoDialog = (ETVNetStreamInfo)GUIWindowManager.GetWindow(7768); + if (null != streamInfoDialog) + { + streamInfoDialog.streamTitleText = newNode.getLabel(); + streamInfoDialog... [truncated message content] |
From: <an...@us...> - 2007-02-28 14:22:47
|
Revision: 144 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=144&view=rev Author: and-81 Date: 2007-02-28 06:22:45 -0800 (Wed, 28 Feb 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MCEReplacement/MCEReplacement.csproj trunk/plugins/MCEReplacementTray/MCEReplacementTray.csproj trunk/plugins/MessagePlugin/MessagePlugin.csproj trunk/plugins/TV3ExtChannelChanger/TV3ExtChannelChanger.csproj trunk/plugins/TV3MceBlaster/TV3MceBlaster.csproj trunk/plugins/XBCDRC/XBCDRC Plugin.csproj Modified: trunk/plugins/MCEReplacement/MCEReplacement.csproj =================================================================== --- trunk/plugins/MCEReplacement/MCEReplacement.csproj 2007-02-28 06:21:21 UTC (rev 143) +++ trunk/plugins/MCEReplacement/MCEReplacement.csproj 2007-02-28 14:22:45 UTC (rev 144) @@ -255,6 +255,6 @@ </EmbeddedResource> </ItemGroup> <PropertyGroup> - <PostBuildEvent>copy "$(TargetPath)" "C:\MediaPortal Development\Plugin Releases\MCE Replacement Plugin\Release\"</PostBuildEvent> + <PostBuildEvent>copy "$(TargetPath)" "\MediaPortal Development\Plugin Releases\MCE Replacement Plugin\Release\"</PostBuildEvent> </PropertyGroup> </Project> \ No newline at end of file Modified: trunk/plugins/MCEReplacementTray/MCEReplacementTray.csproj =================================================================== --- trunk/plugins/MCEReplacementTray/MCEReplacementTray.csproj 2007-02-28 06:21:21 UTC (rev 143) +++ trunk/plugins/MCEReplacementTray/MCEReplacementTray.csproj 2007-02-28 14:22:45 UTC (rev 144) @@ -89,6 +89,6 @@ </Target> --> <PropertyGroup> - <PostBuildEvent>copy "$(TargetPath)" "C:\MediaPortal Development\Plugin Releases\MCE Replacement Plugin\Tray\"</PostBuildEvent> + <PostBuildEvent>copy "$(TargetPath)" "\MediaPortal Development\Plugin Releases\MCE Replacement Plugin\Tray\"</PostBuildEvent> </PropertyGroup> </Project> \ No newline at end of file Modified: trunk/plugins/MessagePlugin/MessagePlugin.csproj =================================================================== --- trunk/plugins/MessagePlugin/MessagePlugin.csproj 2007-02-28 06:21:21 UTC (rev 143) +++ trunk/plugins/MessagePlugin/MessagePlugin.csproj 2007-02-28 14:22:45 UTC (rev 144) @@ -72,6 +72,6 @@ </Target> --> <PropertyGroup> - <PostBuildEvent>copy "*.*" "C:\MediaPortal Development\Plugin Releases\Message Plugin\"</PostBuildEvent> + <PostBuildEvent>copy "*.*" "\MediaPortal Development\Plugin Releases\Message Plugin\"</PostBuildEvent> </PropertyGroup> </Project> \ No newline at end of file Modified: trunk/plugins/TV3ExtChannelChanger/TV3ExtChannelChanger.csproj =================================================================== --- trunk/plugins/TV3ExtChannelChanger/TV3ExtChannelChanger.csproj 2007-02-28 06:21:21 UTC (rev 143) +++ trunk/plugins/TV3ExtChannelChanger/TV3ExtChannelChanger.csproj 2007-02-28 14:22:45 UTC (rev 144) @@ -223,7 +223,7 @@ <PropertyGroup> <PreBuildEvent> </PreBuildEvent> - <PostBuildEvent>copy "$(TargetPath)" "C:\MediaPortal Development\Plugin Releases\TV3ExtChannelChanger\Release\" -copy "ReadMe.txt" "C:\MediaPortal Development\Plugin Releases\TV3ExtChannelChanger\"</PostBuildEvent> + <PostBuildEvent>copy "$(TargetPath)" "\MediaPortal Development\Plugin Releases\TV3ExtChannelChanger\Release\" +copy "ReadMe.txt" "\MediaPortal Development\Plugin Releases\TV3ExtChannelChanger\"</PostBuildEvent> </PropertyGroup> </Project> \ No newline at end of file Modified: trunk/plugins/TV3MceBlaster/TV3MceBlaster.csproj =================================================================== --- trunk/plugins/TV3MceBlaster/TV3MceBlaster.csproj 2007-02-28 06:21:21 UTC (rev 143) +++ trunk/plugins/TV3MceBlaster/TV3MceBlaster.csproj 2007-02-28 14:22:45 UTC (rev 144) @@ -269,6 +269,6 @@ <PropertyGroup> <PreBuildEvent> </PreBuildEvent> - <PostBuildEvent>copy "*.*" "C:\MediaPortal Development\Plugin Releases\TV3 MCE Blaster\Release\"</PostBuildEvent> + <PostBuildEvent>copy "*.*" "\MediaPortal Development\Plugin Releases\TV3 MCE Blaster\Release\"</PostBuildEvent> </PropertyGroup> </Project> \ No newline at end of file Modified: trunk/plugins/XBCDRC/XBCDRC Plugin.csproj =================================================================== --- trunk/plugins/XBCDRC/XBCDRC Plugin.csproj 2007-02-28 06:21:21 UTC (rev 143) +++ trunk/plugins/XBCDRC/XBCDRC Plugin.csproj 2007-02-28 14:22:45 UTC (rev 144) @@ -70,6 +70,6 @@ </Reference> </ItemGroup> <PropertyGroup> - <PostBuildEvent>copy "*.*" "C:\MediaPortal Development\Plugin Releases\XBCDRC Plugin\Release\"</PostBuildEvent> + <PostBuildEvent>copy "*.*" "\MediaPortal Development\Plugin Releases\XBCDRC Plugin\Release\"</PostBuildEvent> </PropertyGroup> </Project> \ 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: <ove...@us...> - 2007-02-28 21:03:18
|
Revision: 146 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=146&view=rev Author: overture Date: 2007-02-28 13:00:46 -0800 (Wed, 28 Feb 2007) Log Message: ----------- Added Paths: ----------- trunk/plugins/AddNewPlugin.cs trunk/plugins/AssemblyInfo.cs trunk/plugins/IPTVPlugin.csproj trunk/plugins/IPTVPlugin.sln trunk/plugins/IPTVSetup.cs trunk/plugins/IPTVsetup.resx trunk/plugins/ReflectionManager.cs trunk/plugins/SetupManager.cs trunk/plugins/SnapperInterface.cs Added: trunk/plugins/AddNewPlugin.cs =================================================================== --- trunk/plugins/AddNewPlugin.cs (rev 0) +++ trunk/plugins/AddNewPlugin.cs 2007-02-28 21:00:46 UTC (rev 146) @@ -0,0 +1,234 @@ +using System; +using System.Drawing; +using System.Collections; +using System.ComponentModel; +using System.Windows.Forms; + + +namespace myIPTV +{ + /// <summary> + /// Summary description for PluginsAddNew. + /// </summary> + public class PluginsAddNew : System.Windows.Forms.Form + { + private System.Windows.Forms.OpenFileDialog openFileDialog1; + private CheckedListBox chklstBox; + private System.Windows.Forms.Button btnOK; + private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.GroupBox grpDetails; + private System.Windows.Forms.TextBox txtDesc; + private System.Windows.Forms.Label lblDescription; + private System.Windows.Forms.CheckBox chkBstate; + private System.Windows.Forms.GroupBox grpDLLFile; + private System.Windows.Forms.TextBox txtFilePath; + private System.Windows.Forms.Button btnBrowse; + private System.ComponentModel.Container components = null; + + #region Constructors + + public PluginsAddNew() + { + InitializeComponent(); + } + + public PluginsAddNew(CheckedListBox chkLstBox) + { + InitializeComponent(); + this.chklstBox = chkLstBox; + } + + #endregion + + #region Dispose + /// <summary> + /// Clean up any resources being used. + /// </summary> + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } + + #endregion + + #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.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); + this.btnOK = new System.Windows.Forms.Button(); + this.btnCancel = new System.Windows.Forms.Button(); + this.grpDetails = new System.Windows.Forms.GroupBox(); + this.txtDesc = new System.Windows.Forms.TextBox(); + this.lblDescription = new System.Windows.Forms.Label(); + this.chkBstate = new System.Windows.Forms.CheckBox(); + this.grpDLLFile = new System.Windows.Forms.GroupBox(); + this.txtFilePath = new System.Windows.Forms.TextBox(); + this.btnBrowse = new System.Windows.Forms.Button(); + this.grpDetails.SuspendLayout(); + this.grpDLLFile.SuspendLayout(); + this.SuspendLayout(); + // + // btnOK + // + this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnOK.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.btnOK.Location = new System.Drawing.Point(336, 216); + this.btnOK.Name = "btnOK"; + this.btnOK.TabIndex = 3; + this.btnOK.Text = "OK"; + this.btnOK.Click += new System.EventHandler(this.btnOK_Click); + // + // btnCancel + // + this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.btnCancel.Location = new System.Drawing.Point(248, 216); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.TabIndex = 2; + this.btnCancel.Text = "Cancel"; + this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); + // + // grpDetails + // + this.grpDetails.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.grpDetails.Controls.Add(this.txtDesc); + this.grpDetails.Controls.Add(this.lblDescription); + this.grpDetails.Controls.Add(this.chkBstate); + this.grpDetails.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.grpDetails.Location = new System.Drawing.Point(8, 80); + this.grpDetails.Name = "grpDetails"; + this.grpDetails.Size = new System.Drawing.Size(400, 128); + this.grpDetails.TabIndex = 1; + this.grpDetails.TabStop = false; + this.grpDetails.Text = "Details"; + + // + // txtDesc + // + this.txtDesc.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txtDesc.Location = new System.Drawing.Point(104, 68); + this.txtDesc.Name = "txtDesc"; + this.txtDesc.Size = new System.Drawing.Size(280, 20); + this.txtDesc.TabIndex = 2; + this.txtDesc.Text = ""; + // + // lblDescription + // + this.lblDescription.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.lblDescription.Location = new System.Drawing.Point(16, 64); + this.lblDescription.Name = "lblDescription"; + this.lblDescription.Size = new System.Drawing.Size(64, 23); + this.lblDescription.TabIndex = 1; + this.lblDescription.Text = "Description"; + this.lblDescription.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + + // + // chkBstate + // + this.chkBstate.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.chkBstate.Location = new System.Drawing.Point(16, 24); + this.chkBstate.Name = "chkBstate"; + this.chkBstate.TabIndex = 0; + this.chkBstate.Text = "State (On/Off)"; + + // + // grpDLLFile + // + this.grpDLLFile.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.grpDLLFile.Controls.Add(this.txtFilePath); + this.grpDLLFile.Controls.Add(this.btnBrowse); + this.grpDLLFile.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.grpDLLFile.Location = new System.Drawing.Point(8, 8); + this.grpDLLFile.Name = "grpDLLFile"; + this.grpDLLFile.Size = new System.Drawing.Size(400, 64); + this.grpDLLFile.TabIndex = 0; + this.grpDLLFile.TabStop = false; + this.grpDLLFile.Text = "File"; + + // + // txtFilePath + // + this.txtFilePath.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txtFilePath.Location = new System.Drawing.Point(104, 24); + this.txtFilePath.Name = "txtFilePath"; + this.txtFilePath.Size = new System.Drawing.Size(280, 20); + this.txtFilePath.TabIndex = 1; + this.txtFilePath.Text = ""; + // + // btnBrowse + // + this.btnBrowse.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.btnBrowse.Location = new System.Drawing.Point(16, 24); + this.btnBrowse.Name = "btnBrowse"; + this.btnBrowse.TabIndex = 0; + this.btnBrowse.Text = "Browse"; + this.btnBrowse.Click += new System.EventHandler(this.btnBrowse_Click); + // + // PluginsAddNew + // + this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); + this.ClientSize = new System.Drawing.Size(416, 242); + this.Controls.Add(this.btnOK); + this.Controls.Add(this.btnCancel); + this.Controls.Add(this.grpDetails); + this.Controls.Add(this.grpDLLFile); + this.Name = "PluginsAddNew"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "PluginsAddNew"; + this.grpDetails.ResumeLayout(false); + this.grpDLLFile.ResumeLayout(false); + this.ResumeLayout(false); + + } + #endregion + + #region Event + + private void btnBrowse_Click(object sender, System.EventArgs e) + { + openFileDialog1.Filter = "Plugin files (*.dll)|*.dll|All files (*.*)|*.*"; + if(DialogResult.OK==openFileDialog1.ShowDialog()) + { + txtFilePath.Text = openFileDialog1.FileName; + } + } + + private void btnOK_Click(object sender, System.EventArgs e) + { + SetupManager setupManager = new SetupManager(); + setupManager.LoadXMLDoc(); + + bool ans = setupManager.TestNewItem(this.txtFilePath.Text,this.txtDesc.Text,this.chkBstate.Checked); + if(ans) + { + setupManager.InsertNewItem(this.txtFilePath.Text,this.txtDesc.Text,this.chkBstate.Checked); + this.chklstBox.Items.Add(this.txtDesc.Text,this.chkBstate.Checked); + } + this.Close(); + } + + private void btnCancel_Click(object sender, System.EventArgs e) + { + this.Close(); + } + + #endregion + } +} Added: trunk/plugins/AssemblyInfo.cs =================================================================== --- trunk/plugins/AssemblyInfo.cs (rev 0) +++ trunk/plugins/AssemblyInfo.cs 2007-02-28 21:00:46 UTC (rev 146) @@ -0,0 +1,27 @@ +using System.Reflection; +using System.Runtime.CompilerServices; + +// Information about this assembly is defined by the following +// attributes. +// +// change them to the information which is associated with the assembly +// you compile. + +[assembly: AssemblyTitle("MediaPortal IPTV Plugin")] +[assembly: AssemblyDescription("IPTV Plugin Host Application for mini IPTV plugins")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// The assembly version has following format : +// +// Major.Minor.Build.Revision +// +// You can specify all values by your own or you can build default build and revision +// numbers with the '*' character (the default): + +[assembly: AssemblyVersion("1.0.*")] + Added: trunk/plugins/IPTVPlugin.csproj =================================================================== --- trunk/plugins/IPTVPlugin.csproj (rev 0) +++ trunk/plugins/IPTVPlugin.csproj 2007-02-28 21:00:46 UTC (rev 146) @@ -0,0 +1,49 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <OutputType>Library</OutputType> + <RootNamespace>IPTVPlugin</RootNamespace> + <AssemblyName>IPTVPlugin</AssemblyName> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProjectGuid>{14CD8D0D-30E2-44FB-8E49-078D1578668D}</ProjectGuid> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> + <OutputPath>bin\Debug\</OutputPath> + <Optimize>False</Optimize> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <DebugSymbols>True</DebugSymbols> + <DebugType>Full</DebugType> + <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)' == 'Release' "> + <OutputPath>bin\Release\</OutputPath> + <Optimize>True</Optimize> + <DefineConstants>TRACE</DefineConstants> + <DebugSymbols>False</DebugSymbols> + <DebugType>None</DebugType> + <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Xml" /> + <Reference Include="System.Data, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> + <Reference Include="System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> + <Reference Include="Core"> + <HintPath>..\..\..\..\..\MediaPortal\mediaportal\Core\bin\Release\Core.dll</HintPath> + <SpecificVersion>False</SpecificVersion> + </Reference> + <Reference Include="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> + </ItemGroup> + <ItemGroup> + <Compile Include="SnapperInterface.cs" /> + <Compile Include="AssemblyInfo.cs" /> + <Compile Include="ReflectionManager.cs" /> + <Compile Include="IPTVSetup.cs" /> + <EmbeddedResource Include="IPTVsetup.resx"> + <DependentUpon>IPTVSetup.cs</DependentUpon> + </EmbeddedResource> + <Compile Include="SetupManager.cs" /> + <Compile Include="AddNewPlugin.cs" /> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" /> +</Project> \ No newline at end of file Added: trunk/plugins/IPTVPlugin.sln =================================================================== --- trunk/plugins/IPTVPlugin.sln (rev 0) +++ trunk/plugins/IPTVPlugin.sln 2007-02-28 21:00:46 UTC (rev 146) @@ -0,0 +1,16 @@ +Microsoft Visual Studio Solution File, Format Version 9.00 +# SharpDevelop 2.0.0.922 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IPTVPlugin", "IPTVPlugin.csproj", "{14CD8D0D-30E2-44FB-8E49-078D1578668D}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {14CD8D0D-30E2-44FB-8E49-078D1578668D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {14CD8D0D-30E2-44FB-8E49-078D1578668D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {14CD8D0D-30E2-44FB-8E49-078D1578668D}.Release|Any CPU.Build.0 = Release|Any CPU + {14CD8D0D-30E2-44FB-8E49-078D1578668D}.Release|Any CPU.ActiveCfg = Release|Any CPU + EndGlobalSection +EndGlobal Added: trunk/plugins/IPTVSetup.cs =================================================================== --- trunk/plugins/IPTVSetup.cs (rev 0) +++ trunk/plugins/IPTVSetup.cs 2007-02-28 21:00:46 UTC (rev 146) @@ -0,0 +1,501 @@ +using System; +using System.Drawing; +using System.Windows.Forms; +using System.Xml; +using MediaPortal.GUI.Library; + +namespace myIPTV +{ + /// <summary> + /// Description of MyIPTVsetup. + /// </summary> + public class IPTVsetup : System.Windows.Forms.Form, ISetupForm + { + private System.ComponentModel.Container components = null; + + public IPTVsetup() + { + InitializeComponent(); + } + + /// <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 Forms Designer generated code + /// <summary> + /// This method is required for Windows Forms designer support. + /// Do not change the method contents inside the source code editor. The Forms designer might + /// not be able to load this method if it was changed manually. + /// </summary> + private void InitializeComponent() + { + this.grpBoxConnectInfo = new System.Windows.Forms.GroupBox(); + this.chkBoxUseDefaultProxy = new System.Windows.Forms.CheckBox(); + this.txtProxyPort = new System.Windows.Forms.TextBox(); + this.label7 = new System.Windows.Forms.Label(); + this.txtProxyIPAddress = new System.Windows.Forms.TextBox(); + this.label6 = new System.Windows.Forms.Label(); + this.txtProxyPass = new System.Windows.Forms.TextBox(); + this.label5 = new System.Windows.Forms.Label(); + this.chkBoxUseProxy = new System.Windows.Forms.CheckBox(); + this.txtProxyUser = new System.Windows.Forms.TextBox(); + this.label4 = new System.Windows.Forms.Label(); + this.btnCancel = new System.Windows.Forms.Button(); + this.btnOK = new System.Windows.Forms.Button(); + this.tabControl1 = new System.Windows.Forms.TabControl(); + this.tabPage1 = new System.Windows.Forms.TabPage(); + this.tabPage2 = new System.Windows.Forms.TabPage(); + this.btnAddNewPlug = new System.Windows.Forms.Button(); + this.btnRemove = new System.Windows.Forms.Button(); + this.checkedListBox1 = new System.Windows.Forms.CheckedListBox(); + this.label1 = new System.Windows.Forms.Label(); + this.lblAuthor = new System.Windows.Forms.Label(); + this.grpBoxConnectInfo.SuspendLayout(); + this.tabControl1.SuspendLayout(); + this.tabPage1.SuspendLayout(); + this.tabPage2.SuspendLayout(); + this.SuspendLayout(); + // + // grpBoxConnectInfo + // + this.grpBoxConnectInfo.Controls.Add(this.chkBoxUseDefaultProxy); + this.grpBoxConnectInfo.Controls.Add(this.txtProxyPort); + this.grpBoxConnectInfo.Controls.Add(this.label7); + this.grpBoxConnectInfo.Controls.Add(this.txtProxyIPAddress); + this.grpBoxConnectInfo.Controls.Add(this.label6); + this.grpBoxConnectInfo.Controls.Add(this.txtProxyPass); + this.grpBoxConnectInfo.Controls.Add(this.label5); + this.grpBoxConnectInfo.Controls.Add(this.chkBoxUseProxy); + this.grpBoxConnectInfo.Controls.Add(this.txtProxyUser); + this.grpBoxConnectInfo.Controls.Add(this.label4); + this.grpBoxConnectInfo.Location = new System.Drawing.Point(6, 35); + this.grpBoxConnectInfo.Name = "grpBoxConnectInfo"; + this.grpBoxConnectInfo.Size = new System.Drawing.Size(640, 246); + this.grpBoxConnectInfo.TabIndex = 1; + this.grpBoxConnectInfo.TabStop = false; + this.grpBoxConnectInfo.Text = "Internet Connection Information"; + this.grpBoxConnectInfo.UseCompatibleTextRendering = true; + // + // chkBoxUseDefaultProxy + // + this.chkBoxUseDefaultProxy.Enabled = false; + this.chkBoxUseDefaultProxy.Location = new System.Drawing.Point(67, 99); + this.chkBoxUseDefaultProxy.Name = "chkBoxUseDefaultProxy"; + this.chkBoxUseDefaultProxy.Size = new System.Drawing.Size(242, 24); + this.chkBoxUseDefaultProxy.TabIndex = 9; + this.chkBoxUseDefaultProxy.Text = "Use Default Proxy Authentication?"; + this.chkBoxUseDefaultProxy.UseCompatibleTextRendering = true; + this.chkBoxUseDefaultProxy.CheckedChanged += new System.EventHandler(this.ChkBoxUseDefaultProxyCheckedChanged); + // + // txtProxyPort + // + this.txtProxyPort.Enabled = false; + this.txtProxyPort.Location = new System.Drawing.Point(488, 155); + this.txtProxyPort.Name = "txtProxyPort"; + this.txtProxyPort.Size = new System.Drawing.Size(49, 20); + this.txtProxyPort.TabIndex = 8; + // + // label7 + // + this.label7.Location = new System.Drawing.Point(382, 155); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(100, 23); + this.label7.TabIndex = 7; + this.label7.Text = "Port"; + this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.label7.UseCompatibleTextRendering = true; + // + // txtProxyIPAddress + // + this.txtProxyIPAddress.Enabled = false; + this.txtProxyIPAddress.Location = new System.Drawing.Point(488, 129); + this.txtProxyIPAddress.Name = "txtProxyIPAddress"; + this.txtProxyIPAddress.Size = new System.Drawing.Size(100, 20); + this.txtProxyIPAddress.TabIndex = 6; + // + // label6 + // + this.label6.Location = new System.Drawing.Point(382, 129); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(100, 23); + this.label6.TabIndex = 5; + this.label6.Text = "IP Address"; + this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.label6.UseCompatibleTextRendering = true; + // + // txtProxyPass + // + this.txtProxyPass.Enabled = false; + this.txtProxyPass.Location = new System.Drawing.Point(173, 155); + this.txtProxyPass.Name = "txtProxyPass"; + this.txtProxyPass.Size = new System.Drawing.Size(100, 20); + this.txtProxyPass.TabIndex = 4; + // + // label5 + // + this.label5.Location = new System.Drawing.Point(67, 155); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(100, 23); + this.label5.TabIndex = 3; + this.label5.Text = "Password"; + this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.label5.UseCompatibleTextRendering = true; + // + // chkBoxUseProxy + // + this.chkBoxUseProxy.Location = new System.Drawing.Point(33, 28); + this.chkBoxUseProxy.Name = "chkBoxUseProxy"; + this.chkBoxUseProxy.Size = new System.Drawing.Size(136, 24); + this.chkBoxUseProxy.TabIndex = 2; + this.chkBoxUseProxy.Text = "Use a Proxy Server?"; + this.chkBoxUseProxy.UseCompatibleTextRendering = true; + this.chkBoxUseProxy.CheckedChanged += new System.EventHandler(this.ChkBoxUseProxyCheckedChanged); + // + // txtProxyUser + // + this.txtProxyUser.Enabled = false; + this.txtProxyUser.Location = new System.Drawing.Point(173, 129); + this.txtProxyUser.Name = "txtProxyUser"; + this.txtProxyUser.Size = new System.Drawing.Size(100, 20); + this.txtProxyUser.TabIndex = 1; + // + // label4 + // + this.label4.Location = new System.Drawing.Point(67, 129); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(100, 23); + this.label4.TabIndex = 0; + this.label4.Text = "Username"; + this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.label4.UseCompatibleTextRendering = true; + // + // btnCancel + // + this.btnCancel.Location = new System.Drawing.Point(597, 384); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size(75, 23); + this.btnCancel.TabIndex = 2; + this.btnCancel.Text = "Cancel"; + this.btnCancel.TextAlign = System.Drawing.ContentAlignment.TopCenter; + this.btnCancel.UseCompatibleTextRendering = true; + this.btnCancel.Click += new System.EventHandler(this.BtnCancelClick); + // + // btnOK + // + this.btnOK.Location = new System.Drawing.Point(516, 384); + this.btnOK.Name = "btnOK"; + this.btnOK.Size = new System.Drawing.Size(75, 23); + this.btnOK.TabIndex = 3; + this.btnOK.Text = "OK"; + this.btnOK.TextAlign = System.Drawing.ContentAlignment.TopCenter; + this.btnOK.UseCompatibleTextRendering = true; + this.btnOK.Click += new System.EventHandler(this.BtnOKClick); + // + // tabControl1 + // + this.tabControl1.Controls.Add(this.tabPage2); + this.tabControl1.Controls.Add(this.tabPage1); + this.tabControl1.Location = new System.Drawing.Point(12, 12); + this.tabControl1.Name = "tabControl1"; + this.tabControl1.SelectedIndex = 0; + this.tabControl1.Size = new System.Drawing.Size(660, 357); + this.tabControl1.TabIndex = 4; + // + // tabPage1 + // + this.tabPage1.Controls.Add(this.grpBoxConnectInfo); + this.tabPage1.Location = new System.Drawing.Point(4, 23); + this.tabPage1.Name = "tabPage1"; + this.tabPage1.Padding = new System.Windows.Forms.Padding(3); + this.tabPage1.Size = new System.Drawing.Size(652, 330); + this.tabPage1.TabIndex = 0; + this.tabPage1.Text = "Proxy Settings"; + this.tabPage1.UseVisualStyleBackColor = true; + // + // tabPage2 + // + this.tabPage2.Controls.Add(this.lblAuthor); + this.tabPage2.Controls.Add(this.label1); + this.tabPage2.Controls.Add(this.btnAddNewPlug); + this.tabPage2.Controls.Add(this.btnRemove); + this.tabPage2.Controls.Add(this.checkedListBox1); + this.tabPage2.Location = new System.Drawing.Point(4, 23); + this.tabPage2.Name = "tabPage2"; + this.tabPage2.Padding = new System.Windows.Forms.Padding(3); + this.tabPage2.Size = new System.Drawing.Size(652, 330); + this.tabPage2.TabIndex = 1; + this.tabPage2.Text = "IPTV Mini Plugins"; + this.tabPage2.UseVisualStyleBackColor = true; + // + // btnAddNewPlug + // + this.btnAddNewPlug.Location = new System.Drawing.Point(526, 301); + this.btnAddNewPlug.Name = "btnAddNewPlug"; + this.btnAddNewPlug.Size = new System.Drawing.Size(107, 23); + this.btnAddNewPlug.TabIndex = 2; + this.btnAddNewPlug.Text = "Add New Plugin"; + this.btnAddNewPlug.UseCompatibleTextRendering = true; + this.btnAddNewPlug.UseVisualStyleBackColor = true; + this.btnAddNewPlug.Click += new System.EventHandler(this.BtnAddNewPlugClick); + // + // btnRemove + // + this.btnRemove.Location = new System.Drawing.Point(18, 301); + this.btnRemove.Name = "btnRemove"; + this.btnRemove.Size = new System.Drawing.Size(110, 23); + this.btnRemove.TabIndex = 1; + this.btnRemove.Text = "Remove Selected"; + this.btnRemove.UseCompatibleTextRendering = true; + this.btnRemove.UseVisualStyleBackColor = true; + this.btnRemove.Click += new System.EventHandler(this.BtnRemoveClick); + // + // checkedListBox1 + // + this.checkedListBox1.FormattingEnabled = true; + this.checkedListBox1.Location = new System.Drawing.Point(18, 36); + this.checkedListBox1.Name = "checkedListBox1"; + this.checkedListBox1.Size = new System.Drawing.Size(615, 259); + this.checkedListBox1.TabIndex = 0; + this.checkedListBox1.UseCompatibleTextRendering = true; + this.checkedListBox1.SelectedIndexChanged += new System.EventHandler(this.CheckedListBox1SelectedIndexChanged); + // + // label1 + // + this.label1.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; + this.label1.Location = new System.Drawing.Point(18, 7); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(100, 23); + this.label1.TabIndex = 3; + this.label1.Text = "Author:"; + this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.label1.UseCompatibleTextRendering = true; + // + // lblAuthor + // + this.lblAuthor.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblAuthor.Location = new System.Drawing.Point(99, 7); + this.lblAuthor.Name = "lblAuthor"; + this.lblAuthor.Size = new System.Drawing.Size(100, 23); + this.lblAuthor.TabIndex = 4; + this.lblAuthor.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.lblAuthor.UseCompatibleTextRendering = true; + // + // IPTVsetup + // + this.ClientSize = new System.Drawing.Size(686, 410); + this.Controls.Add(this.tabControl1); + this.Controls.Add(this.btnOK); + this.Controls.Add(this.btnCancel); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.Name = "IPTVsetup"; + this.Text = "My IPTV Setup"; + this.Load += new System.EventHandler(this.MyIPTVsetupLoad); + this.grpBoxConnectInfo.ResumeLayout(false); + this.grpBoxConnectInfo.PerformLayout(); + this.tabControl1.ResumeLayout(false); + this.tabPage1.ResumeLayout(false); + this.tabPage2.ResumeLayout(false); + this.ResumeLayout(false); + } + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label lblAuthor; + private System.Windows.Forms.Button btnRemove; + private System.Windows.Forms.Button btnAddNewPlug; + private System.Windows.Forms.CheckedListBox checkedListBox1; + private System.Windows.Forms.TabPage tabPage2; + private System.Windows.Forms.TabPage tabPage1; + private System.Windows.Forms.TabControl tabControl1; + private System.Windows.Forms.Button btnOK; + private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.TextBox txtProxyUser; + private System.Windows.Forms.CheckBox chkBoxUseProxy; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.TextBox txtProxyPass; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.TextBox txtProxyIPAddress; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.TextBox txtProxyPort; + private System.Windows.Forms.CheckBox chkBoxUseDefaultProxy; + private System.Windows.Forms.GroupBox grpBoxConnectInfo; + #endregion + + void ChkBoxUseProxyCheckedChanged(object sender, System.EventArgs e) + { + if(chkBoxUseProxy.Checked==true) + { + chkBoxUseDefaultProxy.Checked = true; + chkBoxUseDefaultProxy.Enabled = true; + txtProxyIPAddress.Enabled = true; + txtProxyPort.Enabled = true; + } + else + { + chkBoxUseDefaultProxy.Checked = false; + chkBoxUseDefaultProxy.Enabled = false; + txtProxyIPAddress.Enabled = false; + txtProxyPort.Enabled = false; + txtProxyUser.Enabled = false; + txtProxyPass.Enabled = false; + } + + } + + void ChkBoxUseDefaultProxyCheckedChanged(object sender, System.EventArgs e) + { + if(chkBoxUseDefaultProxy.Checked==false) + { + txtProxyUser.Enabled = true; + txtProxyPass.Enabled = true; + } + else + { + txtProxyUser.Enabled = false; + txtProxyPass.Enabled = false; + } + } + + void MyIPTVsetupLoad(object sender, System.EventArgs e) + { + SetupManager setupManager = new SetupManager(); + setupManager.LoadXMLDoc(); + setupManager.GetPluginDetails(); + setupManager.LoadPluginItems(this.checkedListBox1); + + XmlDocument xmld = new XmlDocument(); + xmld.Load("iptvsettings.xml"); + + // Load Proxy Details from XML file + chkBoxUseProxy.Checked = Convert.ToBoolean(xmld.SelectSingleNode("/settings/proxydetails/useproxy").InnerText); + chkBoxUseDefaultProxy.Checked = Convert.ToBoolean(xmld.SelectSingleNode("/settings/proxydetails/usedefaultproxy").InnerText); + txtProxyUser.Text = xmld.SelectSingleNode("/settings/proxydetails/proxyuser").InnerText; + txtProxyPass.Text = xmld.SelectSingleNode("/settings/proxydetails/proxypassword").InnerText; + txtProxyIPAddress.Text = xmld.SelectSingleNode("/settings/proxydetails/proxyipaddress").InnerText; + txtProxyPort.Text = xmld.SelectSingleNode("/settings/proxydetails/proxyport").InnerText; + } + + void BtnOKClick(object sender, System.EventArgs e) + { + XmlNode nchkBoxUseProxyNode; + XmlNode nchkBoxUseDefaultProxyNode; + XmlNode ntxtProxyUserNode; + XmlNode ntxtProxyPassNode; + XmlNode ntxtProxyIPAddressNode; + XmlNode ntxtProxyPortNode; + + XmlDocument xmld = new XmlDocument(); + xmld.Load("iptvsettings.xml"); + + nchkBoxUseProxyNode = xmld.SelectSingleNode("/settings/proxydetails/useproxy"); + nchkBoxUseDefaultProxyNode = xmld.SelectSingleNode("/settings/proxydetails/usedefaultproxy"); + ntxtProxyUserNode = xmld.SelectSingleNode("/settings/proxydetails/proxyuser"); + ntxtProxyPassNode = xmld.SelectSingleNode("/settings/proxydetails/proxypassword"); + ntxtProxyIPAddressNode = xmld.SelectSingleNode("/settings/proxydetails/proxyipaddress"); + ntxtProxyPortNode = xmld.SelectSingleNode("/settings/proxydetails/proxyport"); + + nchkBoxUseProxyNode.InnerText = chkBoxUseProxy.Checked.ToString(); + nchkBoxUseDefaultProxyNode.InnerText = chkBoxUseDefaultProxy.Checked.ToString(); + ntxtProxyUserNode.InnerText = txtProxyUser.Text; + ntxtProxyPassNode.InnerText = txtProxyPass.Text; + ntxtProxyIPAddressNode.InnerText = txtProxyIPAddress.Text; + ntxtProxyPortNode.InnerText = txtProxyPort.Text; + + xmld.Save("iptvsettings.xml"); + this.Close(); + } + + void BtnCancelClick(object sender, System.EventArgs e) + { + this.Close(); + } + + #region ISetupForm Members + + public bool CanEnable() + { + return true; + } + + public string Description() + { + return "Plugin for viewing Internet TV"; + } + + public bool DefaultEnabled() + { + return true; + } + + public int GetWindowId() + { + return 5699; + } + + public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) + { + strButtonText=PluginName(); + strButtonImage=String.Empty; + strButtonImageFocus=String.Empty; + strPictureImage=String.Empty; + return true; + } + + public string Author() + { + return "overture/juan pablo"; + } + + public string PluginName() + { + return "My IPTV"; + } + + public bool HasSetup() + { + return true; + } + + public void ShowPlugin() + { + IPTVsetup iptvSetup = new IPTVsetup(); + iptvSetup.ShowDialog(); + iptvSetup.Dispose(); + } + + #endregion + + + void BtnRemoveClick(object sender, System.EventArgs e) + { + SetupManager setupManager = new SetupManager(); + setupManager.LoadXMLDoc(); + setupManager.RemoveItem(checkedListBox1.Text); + checkedListBox1.Items.Clear(); + setupManager.GetPluginDetails(); + setupManager.LoadPluginItems(checkedListBox1); + } + + void BtnAddNewPlugClick(object sender, System.EventArgs e) + { + PluginsAddNew newplug = new PluginsAddNew(checkedListBox1); + newplug.ShowDialog(); + newplug.Dispose(); + } + + void CheckedListBox1SelectedIndexChanged(object sender, System.EventArgs e) + { + } + } +} Added: trunk/plugins/IPTVsetup.resx =================================================================== --- trunk/plugins/IPTVsetup.resx (rev 0) +++ trunk/plugins/IPTVsetup.resx 2007-02-28 21:00:46 UTC (rev 146) @@ -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/ReflectionManager.cs =================================================================== --- trunk/plugins/ReflectionManager.cs (rev 0) +++ trunk/plugins/ReflectionManager.cs 2007-02-28 21:00:46 UTC (rev 146) @@ -0,0 +1,161 @@ +using System; +using System.Reflection; +using SnapperInterface; + +namespace ReflectionManager +{ + /// <summary> + /// Controls runtime instances of the mini plugins. + /// </summary> + public class ReflectionControl + { + private object oInstance; + private Assembly theSnapInAsm = null; + + #region Default Constructor + + /// <summary> + /// Default Constructor + /// </summary> + public ReflectionControl() + { + } + + #endregion + + #region Properties + + /// <summary> + /// Property of a given type instance. + /// </summary> + public object ObjInstance + { + get { return this.oInstance; } + } + + #endregion + + #region Public Methods + + /// <summary> + /// Used to load an external assembley. + /// </summary> + /// <param name="path">Path to the assembly.</param> + /// <returns>bool</returns> + public bool LoadExternalModule(string path) + { + try + { + // Dynamically load the selected assembly. + this.theSnapInAsm = Assembly.LoadFrom(path); + } + catch + { + // If any error at all takes place, just return false. + return false; + } + + return true; + } + + /// <summary> + /// Creates an instance of a specified type. + /// </summary> + /// <param name="sFullName">Name of the type i.e. "Namespace.Class"</param> + /// <returns>Instance of the type object.</returns> + public object GetInstanceOfType(string sFullName) + { + // Get all types in assembly. + Type[] theTypes = theSnapInAsm.GetTypes(); + // See if a type implements ... + for (int i = 0; i < theTypes.Length; i++) + { + object[] theAtts = theTypes[i].GetCustomAttributes(false); + for(int j = 0;j< theAtts.Length;j++) + { + if(theAtts[j] is MiniIPTVPluginAttribute) + { + MiniIPTVPluginAttribute pa = theAtts[j] as MiniIPTVPluginAttribute; + // Use late binding to create the type. + this.oInstance = theSnapInAsm.CreateInstance(sFullName); + } + } + } + return this.oInstance; + } + + + /// <summary> + /// Checks if the DLL contains a compatiple type + /// </summary> + /// <returns>bool true or false</returns> + public bool CheckValidType() + { + bool ans = false; + int ctr = 0; + // Get all types in assembly. + Type[] theTypes = theSnapInAsm.GetTypes(); + + // Loop through each type in the assembly + for (int i = 0; i < theTypes.Length; i++) + { + // Get custom attributes for a given type + object[] theAtts = theTypes[i].GetCustomAttributes(false); + + // Loop through each attribute supported by the given type. + for(int j = 0;j< theAtts.Length;j++) + { + if(theAtts[j] is MiniIPTVPluginAttribute) + { + // Increment ctr for each type that supports + // the MiniIPTVPluginAttribute. + ctr++; + } + } + + } + + // If the MiniIPTVPluginAttribute is supported in any type + // in a given assembly then return true so the DLL + // is reported to be plugable. + if(ctr>0) + { + // At least one type supports the MiniIPTVPluginAttribute + ans = true; + } + else + { + // Zero types support the MiniIPTVPluginAttribute + ans = false; + } + + return ans; + } + + /// <summary> + /// Gets the custom attribute(s) of a plugin type. + /// </summary> + /// <param name="sTypeName">Name of the type i.e. "Namespace.Class"</param> + public void GetCustomAttributes(out string sTypeName) + { + sTypeName = ""; + + // Get all types in assembly. + Type[] theTypes = theSnapInAsm.GetTypes(); + // See if a type implements ... + for (int i = 0; i < theTypes.Length; i++) + { + object[] theAtts = theTypes[i].GetCustomAttributes(true); + for(int j = 0;j< theAtts.Length;j++) + { + if(theAtts[j] is MiniIPTVPluginAttribute) + { + MiniIPTVPluginAttribute pa = theAtts[j] as MiniIPTVPluginAttribute; + sTypeName = pa.TypeName; + } + } + } + } + #endregion + } +} Added: trunk/plugins/SetupManager.cs =================================================================== --- trunk/plugins/SetupManager.cs (rev 0) +++ trunk/plugins/SetupManager.cs 2007-02-28 21:00:46 UTC (rev 146) @@ -0,0 +1,279 @@ +using System; +using System.Xml; +using System.Windows.Forms; +using System.Drawing; +using ReflectionManager; +using SnapperInterface; + +namespace myIPTV +{ + /// <summary> + /// Performs working tasks for this assembly. + /// </summary> + public class SetupManager + { + private string[] sDesc; + private string[] sDescP; + private string[] sState; + private XmlDocument xmld; + private string sTypeName; + + #region Default Constructor + + /// <summary> + /// Default Constructor + /// </summary> + public SetupManager() + { + } + + #endregion + + #region Internal Methods + + /// <summary> + /// Load the IPTVMiniPluginDLLs.xml to an XmlDocument + /// </summary> + internal void LoadXMLDoc() + { + this.xmld = new XmlDocument(); + try + { + this.xmld.Load("IPTVMiniPluginDLLs.xml"); + } + catch(Exception ex) + { + MessageBox.Show(ex.Message); + } + } + + /// <summary> + /// Get the require details from the IPTVMiniPluginDLLs.xml file. + /// </summary> + internal void GetParams() + { + XmlNodeList nodeList = null; + this.sDesc = new string[10]; + int i=0; + + nodeList = this.xmld.SelectNodes("/interface/type"); + + foreach(XmlNode n in nodeList) + { + XmlNode StatusAtt = n.SelectSingleNode("dll/@state"); + XmlNode NameAtt = n.SelectSingleNode("dll/@name"); + + if(StatusAtt.InnerXml.ToLower()=="on") + { + this.sDesc[i] = NameAtt.InnerXml; + i++; + } + } + } + + + internal void GetPluginDetails() + { + XmlNodeList nodeList = null; + this.sDescP = new string[10]; + this.sState = new string[10]; + int i=0; + + nodeList = this.xmld.SelectNodes("/interface/type"); + + foreach(XmlNode n in nodeList) + { + XmlNode StatusAtt = n.SelectSingleNode("dll/@state"); + XmlNode NameAtt = n.SelectSingleNode("dll/@name"); + + this.sDescP[i] = NameAtt.InnerXml; + this.sState[i] = StatusAtt.InnerXml; + i++; + } + } + + /// <summary> + /// Load details into the ListBox on the NewItems form. + /// </summary> + /// <param name="listBox">ListBox from the NewItems form</param> + internal void LoadNewItem(ListBox listBox) + { + foreach(string s in this.sDesc) + { + if(s!=null) + { + listBox.Items.Add(s.ToString()); + } + } + } + + internal void LoadPluginItems(CheckedListBox chklistBox) + { + for(int i=0;i<10;i++) + { + if(this.sDescP[i]!=null) + { + if(this.sState[i].ToLower()=="on") + { + chklistBox.Items.Add(this.sDescP[i],CheckState.Checked); + } + else if(this.sState[i].ToLower()=="off") + { + chklistBox.Items.Add(this.sDescP[i],CheckState.Unchecked); + } + else + { + chklistBox.Items.Add(this.sDescP[i],CheckState.Indeterminate); + } + } + } + } + + internal void SavePluginItems(CheckedListBox chklistBox) + { + int itemIndex = 0; + foreach(string item in chklistBox.Items) + { + this.sDesc = new string[10]; + string sNewState = null; + XmlNode nodeInner = null; + XmlNode nodeStatus = null; + + nodeInner = this.xmld.SelectSingleNode("/interface/type/dll[@name='" + item.ToString().Trim() + "']"); + nodeStatus = this.xmld.SelectSingleNode("/interface/type/dll[@name='" + item.ToString().Trim() + "']/@state"); + + if(chklistBox.GetItemCheckState(itemIndex).ToString().ToLower()=="checked") + { + sNewState = "On"; + } + else if (chklistBox.GetItemCheckState(itemIndex).ToString().ToLower()=="unchecked") + { + sNewState = "Off"; + } + + nodeStatus.Value = sNewState; + this.xmld.Save("IPTVMiniPluginDLLs.xml"); + itemIndex++; + } + } + + internal void InsertNewItem(string sFilePath,string sDesc,bool sState) + { + XmlNode root = null; + root = this.xmld.SelectSingleNode("/interface"); + + //Create new nodes + XmlElement eleType = this.xmld.CreateElement("type"); + XmlElement eleDLL = this.xmld.CreateElement("dll"); + eleDLL.InnerText = sFilePath; + + XmlAttribute attState = this.xmld.CreateAttribute("state"); + if(sState) + { attState.InnerText = "On";} + else if(!sState) + { attState.InnerText = "Off";} + eleDLL.SetAttributeNode(attState); + + XmlAttribute attName = this.xmld.CreateAttribute("name"); + attName.InnerText = sDesc; + eleDLL.SetAttributeNode(attName); + + root.AppendChild(eleType); + eleType.InsertBefore(eleDLL,eleType.FirstChild); + + this.xmld.Save("IPTVMiniPluginDLLs.xml"); + } + + internal void RemoveItem(string sSelected) + { + if(sSelected!="") + { + XmlNode node = null; + XmlNode childnode = null; + node = this.xmld.SelectSingleNode("/interface"); + childnode = node.SelectSingleNode("type[dll/@name='" + sSelected + "']"); + node.RemoveChild(childnode); + this.xmld.Save("IPTVMiniPluginDLLs.xml"); + } + } + + internal string[,] GetChannelArray() + { + XmlNodeList nodeList = this.xmld.SelectNodes("/interface/type"); + string[,] sAllChannelDetails; + sAllChannelDetails = new string[4000,6]; // [Rows,Columns] + int iLastArrayIndex = 0; // Default Start Index + + foreach(XmlNode n in nodeList) + { + XmlNode nodeState = n.SelectSingleNode("dll/@state"); + XmlNode nodeDLL = n.SelectSingleNode("dll"); + + //Load Assembs. + ReflectionControl dir = new ReflectionControl(); + bool ans = dir.LoadExternalModule(nodeDLL.InnerXml); + if(ans) + { + dir.GetCustomAttributes(out sTypeName); + object o = dir.GetInstanceOfType(sTypeName); + IMiniIPTVPlugin iplug = o as IMiniIPTVPlugin; + string[,] sChannelDetails = iplug.IPTVChannel(); + sChannelDetails.CopyTo(sAllChannelDetails, iLastArrayIndex); + iLastArrayIndex = sChannelDetails.Length; + } + else + { + MessageBox.Show("ERROR: DLL Failed to load for '" + nodeDLL.InnerXml + "'.\n\nCheck that the DLL specified in the \n'IPTVMiniPluginDLLs.xml' file is correct."); + } + } + return sAllChannelDetails; + } + + internal string GetAuthor(string sDLL) + { + string sAuthor = "unknown"; // Default Author + ReflectionControl dir = new ReflectionControl(); + bool ans = dir.LoadExternalModule(sDLL); + if(ans) + { + dir.GetCustomAttributes(out sTypeName); + object o = dir.GetInstanceOfType(sTypeName); + IMiniIPTVPlugin iplug = o as IMiniIPTVPlugin; + sAuthor = iplug.Author(); + } + else + { + MessageBox.Show("ERROR: DLL Failed to load for '" + sDLL + "'.\n\nCheck that the DLL specified in the \n'IPTVMiniPluginDLLs.xml' file is correct."); + } + return sAuthor; + } + + internal bool TestNewItem(string sFilePath,string sDesc,bool sState) + { + bool ans = false; + if(sFilePath!="" && sDesc!="") + { + //Load Assem. + ReflectionControl dir = new ReflectionControl(); + ans = dir.LoadExternalModule(sFilePath); + if(ans) + { + if(!dir.CheckValidType()) + { + ans = false; + MessageBox.Show("ERROR: This DLL is not a valid IPTV Mini Plugin"); + } + } + else + { + MessageBox.Show("ERROR: DLL Failed to load for '" + sDesc + "'.\n\nThis file may not be a valid DLL File."); + } + dir = null; + } + return ans; + } + + #endregion + + } +} Added: trunk/plugins/SnapperInterface.cs =================================================================== --- trunk/plugins/SnapperInterface.cs (rev 0) +++ trunk/plugins/SnapperInterface.cs 2007-02-28 21:00:46 UTC (rev 146) @@ -0,0 +1,59 @@ +using System; +using System.Windows.Forms; + +namespace SnapperInterface +{ + #region IMiniIPTVPlugin Interface + /// <summary> + /// IMiniIPTVPlugin Interface - for plugging in IPTV providing data. + /// </summary> + public interface IMiniIPTVPlugin + { + /// <summary> + /// Should return a multi-dimensional array return in this order (string channelname, string channelDescription, string genre, string language, string country, string streamURL) + /// </summary> + /// <returns>A multi-dimensional array</returns> + string[,] IPTVChannel(); + string Author(); + } + + #endregion + + #region Plugin Attribute + + /// <summary> + /// MiniIPTVPluginAttribute will be used by classes which + /// support the IMiniIPTVPlugin interface...and thus which are + /// pluggable into the extendable application. + /// </summary> + [AttributeUsage(AttributeTargets.Class)] + public class MiniIPTVPluginAttribute : System.Attribute + { + private string typeName; + + /// <summary> + /// TypeName public property. + /// </summary> + public string TypeName + { + get { return typeName; } + set { typeName = value; } + } + + /// <summary> + /// Custom consturctor for PluginAttribute. + /// </summary> + /// <param name="typeName">TypeName is the full type name of the plugin i.e. formatted "Namespace.Class"</param> + public MiniIPTVPluginAttribute(string typeName) + { + this.typeName = typeName; + } + + /// <summary> + /// Default Constructor + /// </summary> + public MiniIPTVPluginAttribute() {} + } + + #endregion +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ove...@us...> - 2007-02-28 21:12:06
|
Revision: 147 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=147&view=rev Author: overture Date: 2007-02-28 13:05:55 -0800 (Wed, 28 Feb 2007) Log Message: ----------- Added Paths: ----------- trunk/plugins/IPTVPlugin/ trunk/plugins/IPTVPlugin/AddNewPlugin.cs trunk/plugins/IPTVPlugin/AssemblyInfo.cs trunk/plugins/IPTVPlugin/IPTVPlugin.csproj trunk/plugins/IPTVPlugin/IPTVPlugin.sln trunk/plugins/IPTVPlugin/IPTVSetup.cs trunk/plugins/IPTVPlugin/IPTVsetup.resx trunk/plugins/IPTVPlugin/ReflectionManager.cs trunk/plugins/IPTVPlugin/SetupManager.cs trunk/plugins/IPTVPlugin/SnapperInterface.cs Added: trunk/plugins/IPTVPlugin/AddNewPlugin.cs =================================================================== --- trunk/plugins/IPTVPlugin/AddNewPlugin.cs (rev 0) +++ trunk/plugins/IPTVPlugin/AddNewPlugin.cs 2007-02-28 21:05:55 UTC (rev 147) @@ -0,0 +1,234 @@ +using System; +using System.Drawing; +using System.Collections; +using System.ComponentModel; +using System.Windows.Forms; + + +namespace myIPTV +{ + /// <summary> + /// Summary description for PluginsAddNew. + /// </summary> + public class PluginsAddNew : System.Windows.Forms.Form + { + private System.Windows.Forms.OpenFileDialog openFileDialog1; + private CheckedListBox chklstBox; + private System.Windows.Forms.Button btnOK; + private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.GroupBox grpDetails; + private System.Windows.Forms.TextBox txtDesc; + private System.Windows.Forms.Label lblDescription; + private System.Windows.Forms.CheckBox chkBstate; + private System.Windows.Forms.GroupBox grpDLLFile; + private System.Windows.Forms.TextBox txtFilePath; + private System.Windows.Forms.Button btnBrowse; + private System.ComponentModel.Container components = null; + + #region Constructors + + public PluginsAddNew() + { + InitializeComponent(); + } + + public PluginsAddNew(CheckedListBox chkLstBox) + { + InitializeComponent(); + this.chklstBox = chkLstBox; + } + + #endregion + + #region Dispose + /// <summary> + /// Clean up any resources being used. + /// </summary> + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } + + #endregion + + #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.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); + this.btnOK = new System.Windows.Forms.Button(); + this.btnCancel = new System.Windows.Forms.Button(); + this.grpDetails = new System.Windows.Forms.GroupBox(); + this.txtDesc = new System.Windows.Forms.TextBox(); + this.lblDescription = new System.Windows.Forms.Label(); + this.chkBstate = new System.Windows.Forms.CheckBox(); + this.grpDLLFile = new System.Windows.Forms.GroupBox(); + this.txtFilePath = new System.Windows.Forms.TextBox(); + this.btnBrowse = new System.Windows.Forms.Button(); + this.grpDetails.SuspendLayout(); + this.grpDLLFile.SuspendLayout(); + this.SuspendLayout(); + // + // btnOK + // + this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnOK.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.btnOK.Location = new System.Drawing.Point(336, 216); + this.btnOK.Name = "btnOK"; + this.btnOK.TabIndex = 3; + this.btnOK.Text = "OK"; + this.btnOK.Click += new System.EventHandler(this.btnOK_Click); + // + // btnCancel + // + this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.btnCancel.Location = new System.Drawing.Point(248, 216); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.TabIndex = 2; + this.btnCancel.Text = "Cancel"; + this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); + // + // grpDetails + // + this.grpDetails.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.grpDetails.Controls.Add(this.txtDesc); + this.grpDetails.Controls.Add(this.lblDescription); + this.grpDetails.Controls.Add(this.chkBstate); + this.grpDetails.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.grpDetails.Location = new System.Drawing.Point(8, 80); + this.grpDetails.Name = "grpDetails"; + this.grpDetails.Size = new System.Drawing.Size(400, 128); + this.grpDetails.TabIndex = 1; + this.grpDetails.TabStop = false; + this.grpDetails.Text = "Details"; + + // + // txtDesc + // + this.txtDesc.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txtDesc.Location = new System.Drawing.Point(104, 68); + this.txtDesc.Name = "txtDesc"; + this.txtDesc.Size = new System.Drawing.Size(280, 20); + this.txtDesc.TabIndex = 2; + this.txtDesc.Text = ""; + // + // lblDescription + // + this.lblDescription.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.lblDescription.Location = new System.Drawing.Point(16, 64); + this.lblDescription.Name = "lblDescription"; + this.lblDescription.Size = new System.Drawing.Size(64, 23); + this.lblDescription.TabIndex = 1; + this.lblDescription.Text = "Description"; + this.lblDescription.TextAlign = System.Drawing.ContentAlignment.MiddleRight; + + // + // chkBstate + // + this.chkBstate.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.chkBstate.Location = new System.Drawing.Point(16, 24); + this.chkBstate.Name = "chkBstate"; + this.chkBstate.TabIndex = 0; + this.chkBstate.Text = "State (On/Off)"; + + // + // grpDLLFile + // + this.grpDLLFile.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.grpDLLFile.Controls.Add(this.txtFilePath); + this.grpDLLFile.Controls.Add(this.btnBrowse); + this.grpDLLFile.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.grpDLLFile.Location = new System.Drawing.Point(8, 8); + this.grpDLLFile.Name = "grpDLLFile"; + this.grpDLLFile.Size = new System.Drawing.Size(400, 64); + this.grpDLLFile.TabIndex = 0; + this.grpDLLFile.TabStop = false; + this.grpDLLFile.Text = "File"; + + // + // txtFilePath + // + this.txtFilePath.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txtFilePath.Location = new System.Drawing.Point(104, 24); + this.txtFilePath.Name = "txtFilePath"; + this.txtFilePath.Size = new System.Drawing.Size(280, 20); + this.txtFilePath.TabIndex = 1; + this.txtFilePath.Text = ""; + // + // btnBrowse + // + this.btnBrowse.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.btnBrowse.Location = new System.Drawing.Point(16, 24); + this.btnBrowse.Name = "btnBrowse"; + this.btnBrowse.TabIndex = 0; + this.btnBrowse.Text = "Browse"; + this.btnBrowse.Click += new System.EventHandler(this.btnBrowse_Click); + // + // PluginsAddNew + // + this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); + this.ClientSize = new System.Drawing.Size(416, 242); + this.Controls.Add(this.btnOK); + this.Controls.Add(this.btnCancel); + this.Controls.Add(this.grpDetails); + this.Controls.Add(this.grpDLLFile); + this.Name = "PluginsAddNew"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "PluginsAddNew"; + this.grpDetails.ResumeLayout(false); + this.grpDLLFile.ResumeLayout(false); + this.ResumeLayout(false); + + } + #endregion + + #region Event + + private void btnBrowse_Click(object sender, System.EventArgs e) + { + openFileDialog1.Filter = "Plugin files (*.dll)|*.dll|All files (*.*)|*.*"; + if(DialogResult.OK==openFileDialog1.ShowDialog()) + { + txtFilePath.Text = openFileDialog1.FileName; + } + } + + private void btnOK_Click(object sender, System.EventArgs e) + { + SetupManager setupManager = new SetupManager(); + setupManager.LoadXMLDoc(); + + bool ans = setupManager.TestNewItem(this.txtFilePath.Text,this.txtDesc.Text,this.chkBstate.Checked); + if(ans) + { + setupManager.InsertNewItem(this.txtFilePath.Text,this.txtDesc.Text,this.chkBstate.Checked); + this.chklstBox.Items.Add(this.txtDesc.Text,this.chkBstate.Checked); + } + this.Close(); + } + + private void btnCancel_Click(object sender, System.EventArgs e) + { + this.Close(); + } + + #endregion + } +} Added: trunk/plugins/IPTVPlugin/AssemblyInfo.cs =================================================================== --- trunk/plugins/IPTVPlugin/AssemblyInfo.cs (rev 0) +++ trunk/plugins/IPTVPlugin/AssemblyInfo.cs 2007-02-28 21:05:55 UTC (rev 147) @@ -0,0 +1,27 @@ +using System.Reflection; +using System.Runtime.CompilerServices; + +// Information about this assembly is defined by the following +// attributes. +// +// change them to the information which is associated with the assembly +// you compile. + +[assembly: AssemblyTitle("MediaPortal IPTV Plugin")] +[assembly: AssemblyDescription("IPTV Plugin Host Application for mini IPTV plugins")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// The assembly version has following format : +// +// Major.Minor.Build.Revision +// +// You can specify all values by your own or you can build default build and revision +// numbers with the '*' character (the default): + +[assembly: AssemblyVersion("1.0.*")] + Added: trunk/plugins/IPTVPlugin/IPTVPlugin.csproj =================================================================== --- trunk/plugins/IPTVPlugin/IPTVPlugin.csproj (rev 0) +++ trunk/plugins/IPTVPlugin/IPTVPlugin.csproj 2007-02-28 21:05:55 UTC (rev 147) @@ -0,0 +1,49 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <OutputType>Library</OutputType> + <RootNamespace>IPTVPlugin</RootNamespace> + <AssemblyName>IPTVPlugin</AssemblyName> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProjectGuid>{14CD8D0D-30E2-44FB-8E49-078D1578668D}</ProjectGuid> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> + <OutputPath>bin\Debug\</OutputPath> + <Optimize>False</Optimize> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <DebugSymbols>True</DebugSymbols> + <DebugType>Full</DebugType> + <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)' == 'Release' "> + <OutputPath>bin\Release\</OutputPath> + <Optimize>True</Optimize> + <DefineConstants>TRACE</DefineConstants> + <DebugSymbols>False</DebugSymbols> + <DebugType>None</DebugType> + <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Xml" /> + <Reference Include="System.Data, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> + <Reference Include="System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> + <Reference Include="Core"> + <HintPath>..\..\..\..\..\MediaPortal\mediaportal\Core\bin\Release\Core.dll</HintPath> + <SpecificVersion>False</SpecificVersion> + </Reference> + <Reference Include="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> + </ItemGroup> + <ItemGroup> + <Compile Include="SnapperInterface.cs" /> + <Compile Include="AssemblyInfo.cs" /> + <Compile Include="ReflectionManager.cs" /> + <Compile Include="IPTVSetup.cs" /> + <EmbeddedResource Include="IPTVsetup.resx"> + <DependentUpon>IPTVSetup.cs</DependentUpon> + </EmbeddedResource> + <Compile Include="SetupManager.cs" /> + <Compile Include="AddNewPlugin.cs" /> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" /> +</Project> \ No newline at end of file Added: trunk/plugins/IPTVPlugin/IPTVPlugin.sln =================================================================== --- trunk/plugins/IPTVPlugin/IPTVPlugin.sln (rev 0) +++ trunk/plugins/IPTVPlugin/IPTVPlugin.sln 2007-02-28 21:05:55 UTC (rev 147) @@ -0,0 +1,16 @@ +Microsoft Visual Studio Solution File, Format Version 9.00 +# SharpDevelop 2.0.0.922 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IPTVPlugin", "IPTVPlugin.csproj", "{14CD8D0D-30E2-44FB-8E49-078D1578668D}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {14CD8D0D-30E2-44FB-8E49-078D1578668D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {14CD8D0D-30E2-44FB-8E49-078D1578668D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {14CD8D0D-30E2-44FB-8E49-078D1578668D}.Release|Any CPU.Build.0 = Release|Any CPU + {14CD8D0D-30E2-44FB-8E49-078D1578668D}.Release|Any CPU.ActiveCfg = Release|Any CPU + EndGlobalSection +EndGlobal Added: trunk/plugins/IPTVPlugin/IPTVSetup.cs =================================================================== --- trunk/plugins/IPTVPlugin/IPTVSetup.cs (rev 0) +++ trunk/plugins/IPTVPlugin/IPTVSetup.cs 2007-02-28 21:05:55 UTC (rev 147) @@ -0,0 +1,501 @@ +using System; +using System.Drawing; +using System.Windows.Forms; +using System.Xml; +using MediaPortal.GUI.Library; + +namespace myIPTV +{ + /// <summary> + /// Description of MyIPTVsetup. + /// </summary> + public class IPTVsetup : System.Windows.Forms.Form, ISetupForm + { + private System.ComponentModel.Container components = null; + + public IPTVsetup() + { + InitializeComponent(); + } + + /// <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 Forms Designer generated code + /// <summary> + /// This method is required for Windows Forms designer support. + /// Do not change the method contents inside the source code editor. The Forms designer might + /// not be able to load this method if it was changed manually. + /// </summary> + private void InitializeComponent() + { + this.grpBoxConnectInfo = new System.Windows.Forms.GroupBox(); + this.chkBoxUseDefaultProxy = new System.Windows.Forms.CheckBox(); + this.txtProxyPort = new System.Windows.Forms.TextBox(); + this.label7 = new System.Windows.Forms.Label(); + this.txtProxyIPAddress = new System.Windows.Forms.TextBox(); + this.label6 = new System.Windows.Forms.Label(); + this.txtProxyPass = new System.Windows.Forms.TextBox(); + this.label5 = new System.Windows.Forms.Label(); + this.chkBoxUseProxy = new System.Windows.Forms.CheckBox(); + this.txtProxyUser = new System.Windows.Forms.TextBox(); + this.label4 = new System.Windows.Forms.Label(); + this.btnCancel = new System.Windows.Forms.Button(); + this.btnOK = new System.Windows.Forms.Button(); + this.tabControl1 = new System.Windows.Forms.TabControl(); + this.tabPage1 = new System.Windows.Forms.TabPage(); + this.tabPage2 = new System.Windows.Forms.TabPage(); + this.btnAddNewPlug = new System.Windows.Forms.Button(); + this.btnRemove = new System.Windows.Forms.Button(); + this.checkedListBox1 = new System.Windows.Forms.CheckedListBox(); + this.label1 = new System.Windows.Forms.Label(); + this.lblAuthor = new System.Windows.Forms.Label(); + this.grpBoxConnectInfo.SuspendLayout(); + this.tabControl1.SuspendLayout(); + this.tabPage1.SuspendLayout(); + this.tabPage2.SuspendLayout(); + this.SuspendLayout(); + // + // grpBoxConnectInfo + // + this.grpBoxConnectInfo.Controls.Add(this.chkBoxUseDefaultProxy); + this.grpBoxConnectInfo.Controls.Add(this.txtProxyPort); + this.grpBoxConnectInfo.Controls.Add(this.label7); + this.grpBoxConnectInfo.Controls.Add(this.txtProxyIPAddress); + this.grpBoxConnectInfo.Controls.Add(this.label6); + this.grpBoxConnectInfo.Controls.Add(this.txtProxyPass); + this.grpBoxConnectInfo.Controls.Add(this.label5); + this.grpBoxConnectInfo.Controls.Add(this.chkBoxUseProxy); + this.grpBoxConnectInfo.Controls.Add(this.txtProxyUser); + this.grpBoxConnectInfo.Controls.Add(this.label4); + this.grpBoxConnectInfo.Location = new System.Drawing.Point(6, 35); + this.grpBoxConnectInfo.Name = "grpBoxConnectInfo"; + this.grpBoxConnectInfo.Size = new System.Drawing.Size(640, 246); + this.grpBoxConnectInfo.TabIndex = 1; + this.grpBoxConnectInfo.TabStop = false; + this.grpBoxConnectInfo.Text = "Internet Connection Information"; + this.grpBoxConnectInfo.UseCompatibleTextRendering = true; + // + // chkBoxUseDefaultProxy + // + this.chkBoxUseDefaultProxy.Enabled = false; + this.chkBoxUseDefaultProxy.Location = new System.Drawing.Point(67, 99); + this.chkBoxUseDefaultProxy.Name = "chkBoxUseDefaultProxy"; + this.chkBoxUseDefaultProxy.Size = new System.Drawing.Size(242, 24); + this.chkBoxUseDefaultProxy.TabIndex = 9; + this.chkBoxUseDefaultProxy.Text = "Use Default Proxy Authentication?"; + this.chkBoxUseDefaultProxy.UseCompatibleTextRendering = true; + this.chkBoxUseDefaultProxy.CheckedChanged += new System.EventHandler(this.ChkBoxUseDefaultProxyCheckedChanged); + // + // txtProxyPort + // + this.txtProxyPort.Enabled = false; + this.txtProxyPort.Location = new System.Drawing.Point(488, 155); + this.txtProxyPort.Name = "txtProxyPort"; + this.txtProxyPort.Size = new System.Drawing.Size(49, 20); + this.txtProxyPort.TabIndex = 8; + // + // label7 + // + this.label7.Location = new System.Drawing.Point(382, 155); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(100, 23); + this.label7.TabIndex = 7; + this.label7.Text = "Port"; + this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.label7.UseCompatibleTextRendering = true; + // + // txtProxyIPAddress + // + this.txtProxyIPAddress.Enabled = false; + this.txtProxyIPAddress.Location = new System.Drawing.Point(488, 129); + this.txtProxyIPAddress.Name = "txtProxyIPAddress"; + this.txtProxyIPAddress.Size = new System.Drawing.Size(100, 20); + this.txtProxyIPAddress.TabIndex = 6; + // + // label6 + // + this.label6.Location = new System.Drawing.Point(382, 129); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(100, 23); + this.label6.TabIndex = 5; + this.label6.Text = "IP Address"; + this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.label6.UseCompatibleTextRendering = true; + // + // txtProxyPass + // + this.txtProxyPass.Enabled = false; + this.txtProxyPass.Location = new System.Drawing.Point(173, 155); + this.txtProxyPass.Name = "txtProxyPass"; + this.txtProxyPass.Size = new System.Drawing.Size(100, 20); + this.txtProxyPass.TabIndex = 4; + // + // label5 + // + this.label5.Location = new System.Drawing.Point(67, 155); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(100, 23); + this.label5.TabIndex = 3; + this.label5.Text = "Password"; + this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.label5.UseCompatibleTextRendering = true; + // + // chkBoxUseProxy + // + this.chkBoxUseProxy.Location = new System.Drawing.Point(33, 28); + this.chkBoxUseProxy.Name = "chkBoxUseProxy"; + this.chkBoxUseProxy.Size = new System.Drawing.Size(136, 24); + this.chkBoxUseProxy.TabIndex = 2; + this.chkBoxUseProxy.Text = "Use a Proxy Server?"; + this.chkBoxUseProxy.UseCompatibleTextRendering = true; + this.chkBoxUseProxy.CheckedChanged += new System.EventHandler(this.ChkBoxUseProxyCheckedChanged); + // + // txtProxyUser + // + this.txtProxyUser.Enabled = false; + this.txtProxyUser.Location = new System.Drawing.Point(173, 129); + this.txtProxyUser.Name = "txtProxyUser"; + this.txtProxyUser.Size = new System.Drawing.Size(100, 20); + this.txtProxyUser.TabIndex = 1; + // + // label4 + // + this.label4.Location = new System.Drawing.Point(67, 129); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(100, 23); + this.label4.TabIndex = 0; + this.label4.Text = "Username"; + this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.label4.UseCompatibleTextRendering = true; + // + // btnCancel + // + this.btnCancel.Location = new System.Drawing.Point(597, 384); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size(75, 23); + this.btnCancel.TabIndex = 2; + this.btnCancel.Text = "Cancel"; + this.btnCancel.TextAlign = System.Drawing.ContentAlignment.TopCenter; + this.btnCancel.UseCompatibleTextRendering = true; + this.btnCancel.Click += new System.EventHandler(this.BtnCancelClick); + // + // btnOK + // + this.btnOK.Location = new System.Drawing.Point(516, 384); + this.btnOK.Name = "btnOK"; + this.btnOK.Size = new System.Drawing.Size(75, 23); + this.btnOK.TabIndex = 3; + this.btnOK.Text = "OK"; + this.btnOK.TextAlign = System.Drawing.ContentAlignment.TopCenter; + this.btnOK.UseCompatibleTextRendering = true; + this.btnOK.Click += new System.EventHandler(this.BtnOKClick); + // + // tabControl1 + // + this.tabControl1.Controls.Add(this.tabPage2); + this.tabControl1.Controls.Add(this.tabPage1); + this.tabControl1.Location = new System.Drawing.Point(12, 12); + this.tabControl1.Name = "tabControl1"; + this.tabControl1.SelectedIndex = 0; + this.tabControl1.Size = new System.Drawing.Size(660, 357); + this.tabControl1.TabIndex = 4; + // + // tabPage1 + // + this.tabPage1.Controls.Add(this.grpBoxConnectInfo); + this.tabPage1.Location = new System.Drawing.Point(4, 23); + this.tabPage1.Name = "tabPage1"; + this.tabPage1.Padding = new System.Windows.Forms.Padding(3); + this.tabPage1.Size = new System.Drawing.Size(652, 330); + this.tabPage1.TabIndex = 0; + this.tabPage1.Text = "Proxy Settings"; + this.tabPage1.UseVisualStyleBackColor = true; + // + // tabPage2 + // + this.tabPage2.Controls.Add(this.lblAuthor); + this.tabPage2.Controls.Add(this.label1); + this.tabPage2.Controls.Add(this.btnAddNewPlug); + this.tabPage2.Controls.Add(this.btnRemove); + this.tabPage2.Controls.Add(this.checkedListBox1); + this.tabPage2.Location = new System.Drawing.Point(4, 23); + this.tabPage2.Name = "tabPage2"; + this.tabPage2.Padding = new System.Windows.Forms.Padding(3); + this.tabPage2.Size = new System.Drawing.Size(652, 330); + this.tabPage2.TabIndex = 1; + this.tabPage2.Text = "IPTV Mini Plugins"; + this.tabPage2.UseVisualStyleBackColor = true; + // + // btnAddNewPlug + // + this.btnAddNewPlug.Location = new System.Drawing.Point(526, 301); + this.btnAddNewPlug.Name = "btnAddNewPlug"; + this.btnAddNewPlug.Size = new System.Drawing.Size(107, 23); + this.btnAddNewPlug.TabIndex = 2; + this.btnAddNewPlug.Text = "Add New Plugin"; + this.btnAddNewPlug.UseCompatibleTextRendering = true; + this.btnAddNewPlug.UseVisualStyleBackColor = true; + this.btnAddNewPlug.Click += new System.EventHandler(this.BtnAddNewPlugClick); + // + // btnRemove + // + this.btnRemove.Location = new System.Drawing.Point(18, 301); + this.btnRemove.Name = "btnRemove"; + this.btnRemove.Size = new System.Drawing.Size(110, 23); + this.btnRemove.TabIndex = 1; + this.btnRemove.Text = "Remove Selected"; + this.btnRemove.UseCompatibleTextRendering = true; + this.btnRemove.UseVisualStyleBackColor = true; + this.btnRemove.Click += new System.EventHandler(this.BtnRemoveClick); + // + // checkedListBox1 + // + this.checkedListBox1.FormattingEnabled = true; + this.checkedListBox1.Location = new System.Drawing.Point(18, 36); + this.checkedListBox1.Name = "checkedListBox1"; + this.checkedListBox1.Size = new System.Drawing.Size(615, 259); + this.checkedListBox1.TabIndex = 0; + this.checkedListBox1.UseCompatibleTextRendering = true; + this.checkedListBox1.SelectedIndexChanged += new System.EventHandler(this.CheckedListBox1SelectedIndexChanged); + // + // label1 + // + this.label1.ImageAlign = System.Drawing.ContentAlignment.MiddleRight; + this.label1.Location = new System.Drawing.Point(18, 7); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(100, 23); + this.label1.TabIndex = 3; + this.label1.Text = "Author:"; + this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.label1.UseCompatibleTextRendering = true; + // + // lblAuthor + // + this.lblAuthor.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblAuthor.Location = new System.Drawing.Point(99, 7); + this.lblAuthor.Name = "lblAuthor"; + this.lblAuthor.Size = new System.Drawing.Size(100, 23); + this.lblAuthor.TabIndex = 4; + this.lblAuthor.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.lblAuthor.UseCompatibleTextRendering = true; + // + // IPTVsetup + // + this.ClientSize = new System.Drawing.Size(686, 410); + this.Controls.Add(this.tabControl1); + this.Controls.Add(this.btnOK); + this.Controls.Add(this.btnCancel); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.Name = "IPTVsetup"; + this.Text = "My IPTV Setup"; + this.Load += new System.EventHandler(this.MyIPTVsetupLoad); + this.grpBoxConnectInfo.ResumeLayout(false); + this.grpBoxConnectInfo.PerformLayout(); + this.tabControl1.ResumeLayout(false); + this.tabPage1.ResumeLayout(false); + this.tabPage2.ResumeLayout(false); + this.ResumeLayout(false); + } + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label lblAuthor; + private System.Windows.Forms.Button btnRemove; + private System.Windows.Forms.Button btnAddNewPlug; + private System.Windows.Forms.CheckedListBox checkedListBox1; + private System.Windows.Forms.TabPage tabPage2; + private System.Windows.Forms.TabPage tabPage1; + private System.Windows.Forms.TabControl tabControl1; + private System.Windows.Forms.Button btnOK; + private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.TextBox txtProxyUser; + private System.Windows.Forms.CheckBox chkBoxUseProxy; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.TextBox txtProxyPass; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.TextBox txtProxyIPAddress; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.TextBox txtProxyPort; + private System.Windows.Forms.CheckBox chkBoxUseDefaultProxy; + private System.Windows.Forms.GroupBox grpBoxConnectInfo; + #endregion + + void ChkBoxUseProxyCheckedChanged(object sender, System.EventArgs e) + { + if(chkBoxUseProxy.Checked==true) + { + chkBoxUseDefaultProxy.Checked = true; + chkBoxUseDefaultProxy.Enabled = true; + txtProxyIPAddress.Enabled = true; + txtProxyPort.Enabled = true; + } + else + { + chkBoxUseDefaultProxy.Checked = false; + chkBoxUseDefaultProxy.Enabled = false; + txtProxyIPAddress.Enabled = false; + txtProxyPort.Enabled = false; + txtProxyUser.Enabled = false; + txtProxyPass.Enabled = false; + } + + } + + void ChkBoxUseDefaultProxyCheckedChanged(object sender, System.EventArgs e) + { + if(chkBoxUseDefaultProxy.Checked==false) + { + txtProxyUser.Enabled = true; + txtProxyPass.Enabled = true; + } + else + { + txtProxyUser.Enabled = false; + txtProxyPass.Enabled = false; + } + } + + void MyIPTVsetupLoad(object sender, System.EventArgs e) + { + SetupManager setupManager = new SetupManager(); + setupManager.LoadXMLDoc(); + setupManager.GetPluginDetails(); + setupManager.LoadPluginItems(this.checkedListBox1); + + XmlDocument xmld = new XmlDocument(); + xmld.Load("iptvsettings.xml"); + + // Load Proxy Details from XML file + chkBoxUseProxy.Checked = Convert.ToBoolean(xmld.SelectSingleNode("/settings/proxydetails/useproxy").InnerText); + chkBoxUseDefaultProxy.Checked = Convert.ToBoolean(xmld.SelectSingleNode("/settings/proxydetails/usedefaultproxy").InnerText); + txtProxyUser.Text = xmld.SelectSingleNode("/settings/proxydetails/proxyuser").InnerText; + txtProxyPass.Text = xmld.SelectSingleNode("/settings/proxydetails/proxypassword").InnerText; + txtProxyIPAddress.Text = xmld.SelectSingleNode("/settings/proxydetails/proxyipaddress").InnerText; + txtProxyPort.Text = xmld.SelectSingleNode("/settings/proxydetails/proxyport").InnerText; + } + + void BtnOKClick(object sender, System.EventArgs e) + { + XmlNode nchkBoxUseProxyNode; + XmlNode nchkBoxUseDefaultProxyNode; + XmlNode ntxtProxyUserNode; + XmlNode ntxtProxyPassNode; + XmlNode ntxtProxyIPAddressNode; + XmlNode ntxtProxyPortNode; + + XmlDocument xmld = new XmlDocument(); + xmld.Load("iptvsettings.xml"); + + nchkBoxUseProxyNode = xmld.SelectSingleNode("/settings/proxydetails/useproxy"); + nchkBoxUseDefaultProxyNode = xmld.SelectSingleNode("/settings/proxydetails/usedefaultproxy"); + ntxtProxyUserNode = xmld.SelectSingleNode("/settings/proxydetails/proxyuser"); + ntxtProxyPassNode = xmld.SelectSingleNode("/settings/proxydetails/proxypassword"); + ntxtProxyIPAddressNode = xmld.SelectSingleNode("/settings/proxydetails/proxyipaddress"); + ntxtProxyPortNode = xmld.SelectSingleNode("/settings/proxydetails/proxyport"); + + nchkBoxUseProxyNode.InnerText = chkBoxUseProxy.Checked.ToString(); + nchkBoxUseDefaultProxyNode.InnerText = chkBoxUseDefaultProxy.Checked.ToString(); + ntxtProxyUserNode.InnerText = txtProxyUser.Text; + ntxtProxyPassNode.InnerText = txtProxyPass.Text; + ntxtProxyIPAddressNode.InnerText = txtProxyIPAddress.Text; + ntxtProxyPortNode.InnerText = txtProxyPort.Text; + + xmld.Save("iptvsettings.xml"); + this.Close(); + } + + void BtnCancelClick(object sender, System.EventArgs e) + { + this.Close(); + } + + #region ISetupForm Members + + public bool CanEnable() + { + return true; + } + + public string Description() + { + return "Plugin for viewing Internet TV"; + } + + public bool DefaultEnabled() + { + return true; + } + + public int GetWindowId() + { + return 5699; + } + + public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) + { + strButtonText=PluginName(); + strButtonImage=String.Empty; + strButtonImageFocus=String.Empty; + strPictureImage=String.Empty; + return true; + } + + public string Author() + { + return "overture/juan pablo"; + } + + public string PluginName() + { + return "My IPTV"; + } + + public bool HasSetup() + { + return true; + } + + public void ShowPlugin() + { + IPTVsetup iptvSetup = new IPTVsetup(); + iptvSetup.ShowDialog(); + iptvSetup.Dispose(); + } + + #endregion + + + void BtnRemoveClick(object sender, System.EventArgs e) + { + SetupManager setupManager = new SetupManager(); + setupManager.LoadXMLDoc(); + setupManager.RemoveItem(checkedListBox1.Text); + checkedListBox1.Items.Clear(); + setupManager.GetPluginDetails(); + setupManager.LoadPluginItems(checkedListBox1); + } + + void BtnAddNewPlugClick(object sender, System.EventArgs e) + { + PluginsAddNew newplug = new PluginsAddNew(checkedListBox1); + newplug.ShowDialog(); + newplug.Dispose(); + } + + void CheckedListBox1SelectedIndexChanged(object sender, System.EventArgs e) + { + } + } +} Added: trunk/plugins/IPTVPlugin/IPTVsetup.resx =================================================================== --- trunk/plugins/IPTVPlugin/IPTVsetup.resx (rev 0) +++ trunk/plugins/IPTVPlugin/IPTVsetup.resx 2007-02-28 21:05:55 UTC (rev 147) @@ -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/IPTVPlugin/ReflectionManager.cs =================================================================== --- trunk/plugins/IPTVPlugin/ReflectionManager.cs (rev 0) +++ trunk/plugins/IPTVPlugin/ReflectionManager.cs 2007-02-28 21:05:55 UTC (rev 147) @@ -0,0 +1,161 @@ +using System; +using System.Reflection; +using SnapperInterface; + +namespace ReflectionManager +{ + /// <summary> + /// Controls runtime instances of the mini plugins. + /// </summary> + public class ReflectionControl + { + private object oInstance; + private Assembly theSnapInAsm = null; + + #region Default Constructor + + /// <summary> + /// Default Constructor + /// </summary> + public ReflectionControl() + { + } + + #endregion + + #region Properties + + /// <summary> + /// Property of a given type instance. + /// </summary> + public object ObjInstance + { + get { return this.oInstance; } + } + + #endregion + + #region Public Methods + + /// <summary> + /// Used to load an external assembley. + /// </summary> + /// <param name="path">Path to the assembly.</param> + /// <returns>bool</returns> + public bool LoadExternalModule(string path) + { + try + { + // Dynamically load the selected assembly. + this.theSnapInAsm = Assembly.LoadFrom(path); + } + catch + { + // If any error at all takes place, just return false. + return false; + } + + return true; + } + + /// <summary> + /// Creates an instance of a specified type. + /// </summary> + /// <param name="sFullName">Name of the type i.e. "Namespace.Class"</param> + /// <returns>Instance of the type object.</returns> + public object GetInstanceOfType(string sFullName) + { + // Get all types in assembly. + Type[] theTypes = theSnapInAsm.GetTypes(); + // See if a type implements ... + for (int i = 0; i < theTypes.Length; i++) + { + object[] theAtts = theTypes[i].GetCustomAttributes(false); + for(int j = 0;j< theAtts.Length;j++) + { + if(theAtts[j] is MiniIPTVPluginAttribute) + { + MiniIPTVPluginAttribute pa = theAtts[j] as MiniIPTVPluginAttribute; + // Use late binding to create the type. + this.oInstance = theSnapInAsm.CreateInstance(sFullName); + } + } + } + return this.oInstance; + } + + + /// <summary> + /// Checks if the DLL contains a compatiple type + /// </summary> + /// <returns>bool true or false</returns> + public bool CheckValidType() + { + bool ans = false; + int ctr = 0; + // Get all types in assembly. + Type[] theTypes = theSnapInAsm.GetTypes(); + + // Loop through each type in the assembly + for (int i = 0; i < theTypes.Length; i++) + { + // Get custom attributes for a given type + object[] theAtts = theTypes[i].GetCustomAttributes(false); + + // Loop through each attribute supported by the given type. + for(int j = 0;j< theAtts.Length;j++) + { + if(theAtts[j] is MiniIPTVPluginAttribute) + { + // Increment ctr for each type that supports + // the MiniIPTVPluginAttribute. + ctr++; + } + } + + } + + // If the MiniIPTVPluginAttribute is supported in any type + // in a given assembly then return true so the DLL + // is reported to be plugable. + if(ctr>0) + { + // At least one type supports the MiniIPTVPluginAttribute + ans = true; + } + else + { + // Zero types support the MiniIPTVPluginAttribute + ans = false; + } + + return ans; + } + + /// <summary> + /// Gets the custom attribute(s) of a plugin type. + /// </summary> + /// <param name="sTypeName">Name of the type i.e. "Namespace.Class"</param> + public void GetCustomAttributes(out string sTypeName) + { + sTypeName = ""; + + // Get all types in assembly. + Type[] theTypes = theSnapInAsm.GetTypes(); + // See if a type implements ... + for (int i = 0; i < theTypes.Length; i++) + { + object[] theAtts = theTypes[i].GetCustomAttributes(true); + for(int j = 0;j< theAtts.Length;j++) + { + if(theAtts[j] is MiniIPTVPluginAttribute) + { + MiniIPTVPluginAttribute pa = theAtts[j] as MiniIPTVPluginAttribute; + sTypeName = pa.TypeName; + } + } + } + } + #endregion + } +} Added: trunk/plugins/IPTVPlugin/SetupManager.cs =================================================================== --- trunk/plugins/IPTVPlugin/SetupManager.cs (rev 0) +++ trunk/plugins/IPTVPlugin/SetupManager.cs 2007-02-28 21:05:55 UTC (rev 147) @@ -0,0 +1,279 @@ +using System; +using System.Xml; +using System.Windows.Forms; +using System.Drawing; +using ReflectionManager; +using SnapperInterface; + +namespace myIPTV +{ + /// <summary> + /// Performs working tasks for this assembly. + /// </summary> + public class SetupManager + { + private string[] sDesc; + private string[] sDescP; + private string[] sState; + private XmlDocument xmld; + private string sTypeName; + + #region Default Constructor + + /// <summary> + /// Default Constructor + /// </summary> + public SetupManager() + { + } + + #endregion + + #region Internal Methods + + /// <summary> + /// Load the IPTVMiniPluginDLLs.xml to an XmlDocument + /// </summary> + internal void LoadXMLDoc() + { + this.xmld = new XmlDocument(); + try + { + this.xmld.Load("IPTVMiniPluginDLLs.xml"); + } + catch(Exception ex) + { + MessageBox.Show(ex.Message); + } + } + + /// <summary> + /// Get the require details from the IPTVMiniPluginDLLs.xml file. + /// </summary> + internal void GetParams() + { + XmlNodeList nodeList = null; + this.sDesc = new string[10]; + int i=0; + + nodeList = this.xmld.SelectNodes("/interface/type"); + + foreach(XmlNode n in nodeList) + { + XmlNode StatusAtt = n.SelectSingleNode("dll/@state"); + XmlNode NameAtt = n.SelectSingleNode("dll/@name"); + + if(StatusAtt.InnerXml.ToLower()=="on") + { + this.sDesc[i] = NameAtt.InnerXml; + i++; + } + } + } + + + internal void GetPluginDetails() + { + XmlNodeList nodeList = null; + this.sDescP = new string[10]; + this.sState = new string[10]; + int i=0; + + nodeList = this.xmld.SelectNodes("/interface/type"); + + foreach(XmlNode n in nodeList) + { + XmlNode StatusAtt = n.SelectSingleNode("dll/@state"); + XmlNode NameAtt = n.SelectSingleNode("dll/@name"); + + this.sDescP[i] = NameAtt.InnerXml; + this.sState[i] = StatusAtt.InnerXml; + i++; + } + } + + /// <summary> + /// Load details into the ListBox on the NewItems form. + /// </summary> + /// <param name="listBox">ListBox from the NewItems form</param> + internal void LoadNewItem(ListBox listBox) + { + foreach(string s in this.sDesc) + { + if(s!=null) + { + listBox.Items.Add(s.ToString()); + } + } + } + + internal void LoadPluginItems(CheckedListBox chklistBox) + { + for(int i=0;i<10;i++) + { + if(this.sDescP[i]!=null) + { + if(this.sState[i].ToLower()=="on") + { + chklistBox.Items.Add(this.sDescP[i],CheckState.Checked); + } + else if(this.sState[i].ToLower()=="off") + { + chklistBox.Items.Add(this.sDescP[i],CheckState.Unchecked); + } + else + { + chklistBox.Items.Add(this.sDescP[i],CheckState.Indeterminate); + } + } + } + } + + internal void SavePluginItems(CheckedListBox chklistBox) + { + int itemIndex = 0; + foreach(string item in chklistBox.Items) + { + this.sDesc = new string[10]; + string sNewState = null; + XmlNode nodeInner = null; + XmlNode nodeStatus = null; + + nodeInner = this.xmld.SelectSingleNode("/interface/type/dll[@name='" + item.ToString().Trim() + "']"); + nodeStatus = this.xmld.SelectSingleNode("/interface/type/dll[@name='" + item.ToString().Trim() + "']/@state"); + + if(chklistBox.GetItemCheckState(itemIndex).ToString().ToLower()=="checked") + { + sNewState = "On"; + } + else if (chklistBox.GetItemCheckState(itemIndex).ToString().ToLower()=="unchecked") + { + sNewState = "Off"; + } + + nodeStatus.Value = sNewState; + this.xmld.Save("IPTVMiniPluginDLLs.xml"); + itemIndex++; + } + } + + internal void InsertNewItem(string sFilePath,string sDesc,bool sState) + { + XmlNode root = null; + root = this.xmld.SelectSingleNode("/interface"); + + //Create new nodes + XmlElement eleType = this.xmld.CreateElement("type"); + XmlElement eleDLL = this.xmld.CreateElement("dll"); + eleDLL.InnerText = sFilePath; + + XmlAttribute attState = this.xmld.CreateAttribute("state"); + if(sState) + { attState.InnerText = "On";} + else if(!sState) + { attState.InnerText = "Off";} + eleDLL.SetAttributeNode(attState); + + XmlAttribute attName = this.xmld.CreateAttribute("name"); + attName.InnerText = sDesc; + eleDLL.SetAttributeNode(attName); + + root.AppendChild(eleType); + eleType.InsertBefore(eleDLL,eleType.FirstChild); + + this.xmld.Save("IPTVMiniPluginDLLs.xml"); + } + + internal void RemoveItem(string sSelected) + { + if(sSelected!="") + { + XmlNode node = null; + XmlNode childnode = null; + node = this.xmld.SelectSingleNode("/interface"); + childnode = node.SelectSingleNode("type[dll/@name='" + sSelected + "']"); + node.RemoveChild(childnode); + this.xmld.Save("IPTVMiniPluginDLLs.xml"); + } + } + + internal string[,] GetChannelArray() + { + XmlNodeList nodeList = this.xmld.SelectNodes("/interface/type"); + string[,] sAllChannelDetails; + sAllChannelDetails = new string[4000,6]; // [Rows,Columns] + int iLastArrayIndex = 0; // Default Start Index + + foreach(XmlNode n in nodeList) + { + XmlNode nodeState = n.SelectSingleNode("dll/@state"); + XmlNode nodeDLL = n.SelectSingleNode("dll"); + + //Load Assembs. + ReflectionControl dir = new ReflectionControl(); + bool ans = dir.LoadExternalModule(nodeDLL.InnerXml); + if(ans) + { + dir.GetCustomAttributes(out sTypeName); + object o = dir.GetInstanceOfType(sTypeName); + IMiniIPTVPlugin iplug = o as IMiniIPTVPlugin; + string[,] sChannelDetails = iplug.IPTVChannel(); + sChannelDetails.CopyTo(sAllChannelDetails, iLastArrayIndex); + iLastArrayIndex = sChannelDetails.Length; + } + else + { + MessageBox.Show("ERROR: DLL Failed to load for '" + nodeDLL.InnerXml + "'.\n\nCheck that the DLL specified in the \n'IPTVMiniPluginDLLs.xml' file is correct."); + } + } + return sAllChannelDetails; + } + + internal string GetAuthor(string sDLL) + { + string sAuthor = "unknown"; // Default Author + ReflectionControl dir = new ReflectionControl(); + bool ans = dir.LoadExternalModule(sDLL); + if(ans) + { + dir.GetCustomAttributes(out sTypeName); + object o = dir.GetInstanceOfType(sTypeName); + IMiniIPTVPlugin iplug = o as IMiniIPTVPlugin; + sAuthor = iplug.Author(); + } + else + { + MessageBox.Show("ERROR: DLL Failed to load for '" + sDLL + "'.\n\nCheck that the DLL specified in the \n'IPTVMiniPluginDLLs.xml' file is correct."); + } + return sAuthor; + } + + internal bool TestNewItem(string sFilePath,string sDesc,bool sState) + { + bool ans = false; + if(sFilePath!="" && sDesc!="") + { + //Load Assem. + ReflectionControl dir = new ReflectionControl(); + ans = dir.LoadExternalModule(sFilePath); + if(ans) + { + if(!dir.CheckValidType()) + { + ans = false; + MessageBox.Show("ERROR: This DLL is not a valid IPTV Mini Plugin"); + } + } + else + { + MessageBox.Show("ERROR: DLL Failed to load for '" + sDesc + "'.\n\nThis file may not be a valid DLL File."); + } + dir = null; + } + return ans; + } + + #endregion + + } +} Added: trunk/plugins/IPTVPlugin/SnapperInterface.cs =================================================================== --- trunk/plugins/IPTVPlugin/SnapperInterface.cs (rev 0) +++ trunk/plugins/IPTVPlugin/SnapperInterface.cs 2007-02-28 21:05:55 UTC (rev 147) @@ -0,0 +1,59 @@ +using System; +using System.Windows.Forms; + +namespace SnapperInterface +{ + #region IMiniIPTVPlugin Interface + /// <summary> + /// IMiniIPTVPlugin Interface - for plugging in IPTV providing data. + /// </summary> + public interface IMiniIPTVPlugin + { + /// <summary> + /// Should return a multi-dimensional array return in this order (string channelname, string channelDescription, string genre, string language, string country, string streamURL) + /// </summary> + /// <returns>A multi-dimensional array</returns> + string[,] IPTVChannel(); + string Author(); + } + + #endregion + + #region Plugin Attribute + + /// <summary> + /// MiniIPTVPluginAttribute will be used by classes which + /// support the IMiniIPTVPlugin interface...and thus which are + /// pluggable into the extendable application. + /// </summary> + [AttributeUsage(AttributeTargets.Class)] + public class MiniIPTVPluginAttribute : System.Attribute + { + private string typeName; + + /// <summary> + /// TypeName public property. + /// </summary> + public string TypeName + { + get { return typeName; } + set { typeName = value; } + } + + /// <summary> + /// Custom consturctor for PluginAttribute. + /// </summary> + /// <param name="typeName">TypeName is the full type name of the plugin i.e. formatted "Namespace.Class"</param> + public MiniIPTVPluginAttribute(string typeName) + { + this.typeName = typeName; + } + + /// <summary> + /// Default Constructor + /// </summary> + public MiniIPTVPluginAttribute() {} + } + + #endregion +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-03-06 02:54:43
|
Revision: 161 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=161&view=rev Author: and-81 Date: 2007-03-05 18:54:38 -0800 (Mon, 05 Mar 2007) Log Message: ----------- Added Paths: ----------- trunk/plugins/IgorPlugUSB/ trunk/plugins/IgorPlugUSB/AssemblyInfo.cs trunk/plugins/IgorPlugUSB/IgorPlug.dll trunk/plugins/IgorPlugUSB/IgorPlugUSB.cs trunk/plugins/IgorPlugUSB/IgorPlugUSB.csproj Removed Paths: ------------- trunk/plugins/IgorPlugUSB/AssemblyInfo.cs trunk/plugins/IgorPlugUSB/XBCDRC Plugin.csproj trunk/plugins/IgorPlugUSB/XBCDRCPlugin.cs Copied: trunk/plugins/IgorPlugUSB (from rev 151, trunk/plugins/XBCDRC) Deleted: trunk/plugins/IgorPlugUSB/AssemblyInfo.cs =================================================================== --- trunk/plugins/XBCDRC/AssemblyInfo.cs 2007-03-01 20:27:59 UTC (rev 151) +++ trunk/plugins/IgorPlugUSB/AssemblyInfo.cs 2007-03-06 02:54:38 UTC (rev 161) @@ -1,67 +0,0 @@ -using System; -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Security.Permissions; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("XBCDRC Plugin")] -[assembly: AssemblyDescription("Supports the XBox 1 remote receiver using XBCDRC driver")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("and-81")] -[assembly: AssemblyProduct("MediaPortal")] -[assembly: AssemblyCopyright("Aaron Dinnage")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.0.2.0")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\<setupForm>. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// -[assembly: AssemblyDelaySign(false)] -[assembly: AssemblyKeyFile("")] -[assembly: AssemblyKeyName("")] -[assembly: ComVisibleAttribute(false)] -[assembly: AssemblyFileVersionAttribute("1.0.2.0")] - -[assembly: CLSCompliant(true)] - -[assembly: SecurityPermission(SecurityAction.RequestMinimum, UnmanagedCode = true)] Copied: trunk/plugins/IgorPlugUSB/AssemblyInfo.cs (from rev 159, trunk/plugins/XBCDRC/AssemblyInfo.cs) =================================================================== --- trunk/plugins/IgorPlugUSB/AssemblyInfo.cs (rev 0) +++ trunk/plugins/IgorPlugUSB/AssemblyInfo.cs 2007-03-06 02:54:38 UTC (rev 161) @@ -0,0 +1,67 @@ +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Security.Permissions; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly: AssemblyTitle("IgorPlugUSB Plugin")] +[assembly: AssemblyDescription("Supports the Igor do-it-yourself IR receiver, USB version")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("and-81")] +[assembly: AssemblyProduct("MediaPortal")] +[assembly: AssemblyCopyright("Aaron Dinnage")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion("1.0.2.0")] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory which is +// %Project Directory%\obj\<setupForm>. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("")] +[assembly: AssemblyKeyName("")] +[assembly: ComVisibleAttribute(false)] +[assembly: AssemblyFileVersionAttribute("1.0.2.0")] + +[assembly: CLSCompliant(true)] + +[assembly: SecurityPermission(SecurityAction.RequestMinimum, UnmanagedCode = true)] Added: trunk/plugins/IgorPlugUSB/IgorPlug.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/IgorPlugUSB/IgorPlug.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/IgorPlugUSB/IgorPlugUSB.cs =================================================================== --- trunk/plugins/IgorPlugUSB/IgorPlugUSB.cs (rev 0) +++ trunk/plugins/IgorPlugUSB/IgorPlugUSB.cs 2007-03-06 02:54:38 UTC (rev 161) @@ -0,0 +1,218 @@ +using System; +using System.IO; +using System.Runtime.InteropServices; +using System.Threading; + +using Microsoft.Win32.SafeHandles; + +using MediaPortal.GUI.Library; +using MediaPortal.InputDevices; + +namespace MediaPortal.Plugins +{ + + public class IgorPlugUSB : IPlugin, ISetupForm, IDisposable + { + + #region Variables + + InputHandler _inputHandler; + + Thread _readThread; + + bool _disposed = false; + + #endregion Variables + + #region Interop + + const int NO_ERROR = 0; + const int DEVICE_NOT_PRESENT = 1; + const int NO_DATA_AVAILABLE = 2; + const int INVALID_BAUDRATE = 3; + const int OVERRUN_ERROR = 4; + + [DllImport("IgorPlug.dll", SetLastError = true)] + static extern int DoGetInfraCode(out byte[] TimeCodeDiagram, out int DiagramLength); + + /* + static extern int DoSetDataPortDirection(uchar DirectionByte); + static extern int DoGetDataPortDirection(uchar* DataDirectionByte); + static extern int DoSetOutDataPort(uchar DataOutByte); + static extern int DoGetOutDataPort(uchar* DataOutByte); + static extern int DoGetInDataPort(uchar* DataInByte); + static extern int DoEEPROMRead(uchar Address, uchar* DataInByte); + static extern int DoEEPROMWrite(uchar Address, uchar DataOutByte); + static extern int DoRS232Send(uchar DataOutByte); + static extern int DoRS232Read(uchar* DataInByte); + static extern int DoSetRS232Baud(int BaudRate); + static extern int DoGetRS232Baud(int* BaudRate); + */ + + #endregion Interop + + #region Deconstructor + + ~IgorPlugUSB() + { + // call Dispose with false. Since we're in the + // destructor call, the managed resources will be + // disposed of anyways. + Dispose(false); + } + + #endregion + + #region IPlugin Members + + public void Start() + { + Log.Info("IgorPlugUSB Plugin: Start"); + + try + { + _inputHandler = new InputHandler("IgorPlugUSB"); + + ThreadStart readThreadStart = new ThreadStart(ReadThread); + _readThread = new Thread(readThreadStart); + _readThread.Start(); + } + catch (Exception ex) + { + Log.Error("IgorPlugUSB Plugin: {0}", ex.Message); + } + } + + public void Stop() + { + Log.Info("IgorPlugUSB Plugin: Stop"); + + _readThread.Abort(); + } + + #endregion + + #region ISetupForm Members + + public string Author() { return "and-81"; } + public bool CanEnable() { return true; } + public bool DefaultEnabled() { return true; } + public string Description() { return "Supports the Igor USB remote receiver"; } + public int GetWindowId() { return 0; } + public bool HasSetup() { return true; } + public string PluginName() { return "IgorPlugUSB Plugin"; } + + public void ShowPlugin() + { + InputMappingForm inputMappingForm = new InputMappingForm("IgorPlugUSB"); + inputMappingForm.ShowDialog(); + } + + public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) + { + strButtonText = strButtonImage = strButtonImageFocus = strPictureImage = ""; + return false; + } + + #endregion + + #region IDisposable Members + + public void Dispose() + { + // dispose of the managed and unmanaged resources + Dispose(true); + + // tell the GC that the Finalize process no longer needs + // to be run for this object. + GC.SuppressFinalize(this); + } + + #endregion + + #region Implementation + + protected virtual void Dispose(bool disposeManagedResources) + { + // process only if mananged and unmanaged resources have + // not been disposed of. + if (!this._disposed) + { + if (disposeManagedResources) + { + + } + + // dispose unmanaged resources + this._disposed = true; + } + } + + void ReadThread() + { + try + { + byte[] deviceBuffer = new byte[256]; + int codeLength; + int returnCode; + int keyCode; + + int lastCode = -1; + DateTime lastCodeTime = DateTime.Now; + TimeSpan timeSpan; + + while (true) + { + returnCode = DoGetInfraCode(out deviceBuffer, out codeLength); + + switch (returnCode) + { + case NO_ERROR: + break; + + case DEVICE_NOT_PRESENT: + throw new Exception("Device not present."); + + case NO_DATA_AVAILABLE: + break; + + case INVALID_BAUDRATE: + throw new Exception("Invalid baud rate."); + + case OVERRUN_ERROR: + throw new Exception("Overrun error."); + + default: + throw new Exception(string.Format("Unknown error ({0})", returnCode)); + } + + if (codeLength == 0) + continue; + + keyCode = (int)deviceBuffer[3]; + timeSpan = DateTime.Now - lastCodeTime; + + if (keyCode != lastCode || timeSpan.Milliseconds > 250) + { + lastCode = keyCode; + lastCodeTime = DateTime.Now; + _inputHandler.MapAction(keyCode); + } + + } + } + catch (ThreadAbortException) + { + Log.Info("IgorPlugUSB Plugin: IR read thread aborted."); + } + catch (Exception ex) + { + Log.Error("IgorPlugUSB Plugin: {0}", ex.Message); + } + } + + #endregion Implementation + + } + +} Added: trunk/plugins/IgorPlugUSB/IgorPlugUSB.csproj =================================================================== --- trunk/plugins/IgorPlugUSB/IgorPlugUSB.csproj (rev 0) +++ trunk/plugins/IgorPlugUSB/IgorPlugUSB.csproj 2007-03-06 02:54:38 UTC (rev 161) @@ -0,0 +1,80 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>8.0.50727</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{88520E4C-5C49-478A-8AFA-959B45075922}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>MediaPortal.Plugins</RootNamespace> + <AssemblyName>IgorPlugUSB</AssemblyName> + <StartupObject> + </StartupObject> + <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>false</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + <UseVSHostingProcess>false</UseVSHostingProcess> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>none</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants> + </DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + <UseVSHostingProcess>false</UseVSHostingProcess> + </PropertyGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> + <ItemGroup> + <Compile Include="AssemblyInfo.cs" /> + <Compile Include="IgorPlugUSB.cs" /> + </ItemGroup> + <ItemGroup> + <Reference Include="Core, Version=1.0.2581.1884, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\MediaPortal\Core\bin\Release\Core.dll</HintPath> + <Private>False</Private> + </Reference> + <Reference Include="RemotePlugins, Version=1.0.2581.1913, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\MediaPortal\RemotePlugins\bin\Release\RemotePlugins.dll</HintPath> + <Private>False</Private> + </Reference> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml" /> + <Reference Include="Utils, Version=1.0.2581.1867, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\MediaPortal\Utils\bin\Release\Utils.dll</HintPath> + <Private>False</Private> + </Reference> + </ItemGroup> + <PropertyGroup> + <PostBuildEvent>copy "*.*" "\MediaPortal Development\Plugin Releases\IgorPlugUSB\"</PostBuildEvent> + </PropertyGroup> + <ItemGroup> + <Content Include="IgorPlug.dll"> + <CopyToOutputDirectory>Always</CopyToOutputDirectory> + </Content> + </ItemGroup> +</Project> \ No newline at end of file Deleted: trunk/plugins/IgorPlugUSB/XBCDRC Plugin.csproj =================================================================== --- trunk/plugins/XBCDRC/XBCDRC Plugin.csproj 2007-03-01 20:27:59 UTC (rev 151) +++ trunk/plugins/IgorPlugUSB/XBCDRC Plugin.csproj 2007-03-06 02:54:38 UTC (rev 161) @@ -1,75 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <PropertyGroup> - <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> - <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ProductVersion>8.0.50727</ProductVersion> - <SchemaVersion>2.0</SchemaVersion> - <ProjectGuid>{88520E4C-5C49-478A-8AFA-959B45075922}</ProjectGuid> - <OutputType>Library</OutputType> - <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>MediaPortal.Plugins</RootNamespace> - <AssemblyName>XBCDRCPlugin</AssemblyName> - <StartupObject> - </StartupObject> - <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> - <DebugSymbols>false</DebugSymbols> - <DebugType>full</DebugType> - <Optimize>false</Optimize> - <OutputPath>bin\Debug\</OutputPath> - <DefineConstants>DEBUG</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - <TreatWarningsAsErrors>true</TreatWarningsAsErrors> - <UseVSHostingProcess>false</UseVSHostingProcess> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <DebugType>none</DebugType> - <Optimize>true</Optimize> - <OutputPath>bin\Release\</OutputPath> - <DefineConstants> - </DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - <TreatWarningsAsErrors>true</TreatWarningsAsErrors> - <UseVSHostingProcess>false</UseVSHostingProcess> - </PropertyGroup> - <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> - <!-- To modify your build process, add your task inside one of the targets below and uncomment it. - Other similar extension points exist, see Microsoft.Common.targets. - <Target Name="BeforeBuild"> - </Target> - <Target Name="AfterBuild"> - </Target> - --> - <ItemGroup> - <Compile Include="AssemblyInfo.cs" /> - <Compile Include="XBCDRCPlugin.cs" /> - </ItemGroup> - <ItemGroup> - <Reference Include="Core, Version=1.0.2581.1884, Culture=neutral, processorArchitecture=MSIL"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\MediaPortal\Core\bin\Release\Core.dll</HintPath> - <Private>False</Private> - </Reference> - <Reference Include="RemotePlugins, Version=1.0.2581.1913, Culture=neutral, processorArchitecture=MSIL"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\MediaPortal\RemotePlugins\bin\Release\RemotePlugins.dll</HintPath> - <Private>False</Private> - </Reference> - <Reference Include="System" /> - <Reference Include="System.Data" /> - <Reference Include="System.Windows.Forms" /> - <Reference Include="System.Xml" /> - <Reference Include="Utils, Version=1.0.2581.1867, Culture=neutral, processorArchitecture=MSIL"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\MediaPortal\Utils\bin\Release\Utils.dll</HintPath> - <Private>False</Private> - </Reference> - </ItemGroup> - <PropertyGroup> - <PostBuildEvent>copy "*.*" "\MediaPortal Development\Plugin Releases\XBCDRC Plugin\Release\"</PostBuildEvent> - </PropertyGroup> -</Project> \ No newline at end of file Deleted: trunk/plugins/IgorPlugUSB/XBCDRCPlugin.cs =================================================================== --- trunk/plugins/XBCDRC/XBCDRCPlugin.cs 2007-03-01 20:27:59 UTC (rev 151) +++ trunk/plugins/IgorPlugUSB/XBCDRCPlugin.cs 2007-03-06 02:54:38 UTC (rev 161) @@ -1,383 +0,0 @@ -using System; -using System.IO; -using System.Runtime.InteropServices; - -using Microsoft.Win32.SafeHandles; - -using MediaPortal.GUI.Library; -using MediaPortal.InputDevices; - -namespace MediaPortal.Plugins -{ - - public class XBCDRCPlugin : IPlugin, ISetupForm, IDisposable - { - - #region Variables - - InputHandler _inputHandler; - FileStream _deviceStream; - byte[] _deviceBuffer; - - int _lastPacketID = 0; - int _lastCode = -1; - DateTime _lastCodeTime = DateTime.Now; - - bool _disposed = false; - - #endregion Variables - - #region Interop - - [DllImport("kernel32", SetLastError = true, CharSet = CharSet.Auto)] - static extern SafeFileHandle CreateFile( - String fileName, - [MarshalAs(UnmanagedType.U4)] FileAccess fileAccess, - [MarshalAs(UnmanagedType.U4)] FileShare fileShare, - IntPtr securityAttributes, - [MarshalAs(UnmanagedType.U4)] FileMode creationDisposition, - [MarshalAs(UnmanagedType.U4)] EFileAttributes flags, - IntPtr template); - - [Flags] - enum EFileAttributes : uint - { - Readonly = 0x00000001, - Hidden = 0x00000002, - System = 0x00000004, - Directory = 0x00000010, - Archive = 0x00000020, - Device = 0x00000040, - Normal = 0x00000080, - Temporary = 0x00000100, - SparseFile = 0x00000200, - ReparsePoint = 0x00000400, - Compressed = 0x00000800, - Offline = 0x00001000, - NotContentIndexed = 0x00002000, - Encrypted = 0x00004000, - Write_Through = 0x80000000, - Overlapped = 0x40000000, - NoBuffering = 0x20000000, - RandomAccess = 0x10000000, - SequentialScan = 0x08000000, - DeleteOnClose = 0x04000000, - BackupSemantics = 0x02000000, - PosixSemantics = 0x01000000, - OpenReparsePoint = 0x00200000, - OpenNoRecall = 0x00100000, - FirstPipeInstance = 0x00080000 - } - - [StructLayout(LayoutKind.Sequential)] - struct DeviceInfoData - { - public int Size; - public Guid Class; - public uint DevInst; - public IntPtr Reserved; - } - - [StructLayout(LayoutKind.Sequential)] - struct DeviceInterfaceData - { - public int Size; - public Guid Class; - public uint Flags; - public uint Reserved; - } - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] - struct DeviceInterfaceDetailData - { - public int Size; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - public string DevicePath; - } - - [DllImport("hid")] - static extern void HidD_GetHidGuid( - ref Guid guid); - - [DllImport("setupapi", CharSet = CharSet.Auto)] - static extern IntPtr SetupDiGetClassDevs( - ref Guid ClassGuid, - [MarshalAs(UnmanagedType.LPTStr)] string Enumerator, - IntPtr hwndParent, - UInt32 Flags); - - [DllImport("setupapi", SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - static extern bool SetupDiEnumDeviceInfo( - IntPtr handle, - int Index, - ref DeviceInfoData deviceInfoData); - - [DllImport("setupapi", SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - static extern bool SetupDiEnumDeviceInterfaces( - IntPtr handle, - ref DeviceInfoData deviceInfoData, - ref Guid guidClass, - int MemberIndex, - ref DeviceInterfaceData deviceInterfaceData); - - [DllImport("setupapi", SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - static extern bool SetupDiGetDeviceInterfaceDetail( - IntPtr handle, - ref DeviceInterfaceData deviceInterfaceData, - IntPtr unused1, - int unused2, - ref uint requiredSize, - IntPtr unused3); - - [DllImport("setupapi", SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - static extern bool SetupDiGetDeviceInterfaceDetail( - IntPtr handle, - ref DeviceInterfaceData deviceInterfaceData, - ref DeviceInterfaceDetailData deviceInterfaceDetailData, - uint detailSize, - IntPtr unused1, - IntPtr unused2); - - [DllImport("setupapi")] - [return: MarshalAs(UnmanagedType.Bool)] - static extern bool SetupDiDestroyDeviceInfoList(IntPtr handle); - - #endregion Interop - - #region Deconstructor - - ~XBCDRCPlugin() - { - // call Dispose with false. Since we're in the - // destructor call, the managed resources will be - // disposed of anyways. - Dispose(false); - } - - #endregion - - #region IPlugin Members - - public void Start() - { - Log.Info("XBCDRC Plugin: Start"); - - try - { - Guid guid = new Guid(); - HidD_GetHidGuid(ref guid); - - string devicePath = FindDevice(guid); - if (devicePath == null) - { - Log.Error("XBCDRC Plugin: Could not find an Xbox remote receiver"); - return; - } - - SafeFileHandle deviceHandle = CreateFile(devicePath, FileAccess.Read, FileShare.ReadWrite, IntPtr.Zero, FileMode.Open, EFileAttributes.Overlapped, IntPtr.Zero); - - if (deviceHandle.IsInvalid) - Marshal.ThrowExceptionForHR(Marshal.GetLastWin32Error()); - - //_deviceWatcher.RegisterDeviceRemoval(deviceHandle); - - _inputHandler = new InputHandler("XBox Remote"); - - _deviceBuffer = new byte[7]; - _deviceStream = new FileStream(deviceHandle, FileAccess.Read, _deviceBuffer.Length, true); - _deviceStream.BeginRead(_deviceBuffer, 0, _deviceBuffer.Length, new AsyncCallback(OnReadComplete), null); - } - catch (Exception ex) - { - Log.Error("XBCDRC Plugin: {0}", ex.Message); - } - } - - public void Stop() - { - Log.Info("XBCDRC Plugin: Stop"); - - if (_deviceStream == null) - return; - - try - { - _deviceStream.Close(); - } - catch (IOException) - { - } - } - - #endregion - - #region ISetupForm Members - - public string Author() { return "and-81"; } - public bool CanEnable() { return true; } - public bool DefaultEnabled() { return true; } - public string Description() { return "Supports the XBox 1 remote receiver using XBCDRC driver"; } - public int GetWindowId() { return 0; } - public bool HasSetup() { return true; } - public string PluginName() { return "XBCDRC Plugin"; } - - public void ShowPlugin() - { - InputMappingForm inputMappingForm = new InputMappingForm("XBox Remote"); - inputMappingForm.ShowDialog(); - } - - public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) - { - strButtonText = strButtonImage = strButtonImageFocus = strPictureImage = ""; - return false; - } - - #endregion - - #region IDisposable Members - - public void Dispose() - { - // dispose of the managed and unmanaged resources - Dispose(true); - - // tell the GC that the Finalize process no longer needs - // to be run for this object. - GC.SuppressFinalize(this); - } - - #endregion - - #region Implementation - - protected virtual void Dispose(bool disposeManagedResources) - { - // process only if mananged and unmanaged resources have - // not been disposed of. - if (!this._disposed) - { - if (disposeManagedResources) - { - // dispose managed resources - if (_deviceStream != null) - { - _deviceStream.Dispose(); - _deviceStream = null; - } - } - - // dispose unmanaged resources - this._disposed = true; - } - } - - static string FindDevice(Guid classGuid) - { - int lastError; - - // 0x12 = DIGCF_PRESENT or DIGCF_DEVICEINTERFACE - IntPtr handle = SetupDiGetClassDevs(ref classGuid, "", IntPtr.Zero, 0x12); - lastError = Marshal.GetLastWin32Error(); - - if (handle.ToInt32() == -1) - Marshal.ThrowExceptionForHR(lastError); - - string devicePath = null; - - for (int deviceIndex = 0; ; deviceIndex++) - { - DeviceInfoData deviceInfoData = new DeviceInfoData(); - deviceInfoData.Size = Marshal.SizeOf(deviceInfoData); - - if (SetupDiEnumDeviceInfo(handle, deviceIndex, ref deviceInfoData) == false) - { - // out of devices or do we have an error? - lastError = Marshal.GetLastWin32Error(); - if (lastError != 0x0103 && lastError != 0x007E) - { - SetupDiDestroyDeviceInfoList(handle); - Marshal.ThrowExceptionForHR(Marshal.GetLastWin32Error()); - } - - SetupDiDestroyDeviceInfoList(handle); - break; - } - - DeviceInterfaceData deviceInterfaceData = new DeviceInterfaceData(); - deviceInterfaceData.Size = Marshal.SizeOf(deviceInterfaceData); - - if (SetupDiEnumDeviceInterfaces(handle, ref deviceInfoData, ref classGuid, 0, ref deviceInterfaceData) == false) - { - SetupDiDestroyDeviceInfoList(handle); - Marshal.ThrowExceptionForHR(Marshal.GetLastWin32Error()); - } - - uint cbData = 0; - - if (SetupDiGetDeviceInterfaceDetail(handle, ref deviceInterfaceData, IntPtr.Zero, 0, ref cbData, IntPtr.Zero) == false && cbData == 0) - { - SetupDiDestroyDeviceInfoList(handle); - Marshal.ThrowExceptionForHR(Marshal.GetLastWin32Error()); - } - - DeviceInterfaceDetailData deviceInterfaceDetailData = new DeviceInterfaceDetailData(); - deviceInterfaceDetailData.Size = 5; - - if (SetupDiGetDeviceInterfaceDetail(handle, ref deviceInterfaceData, ref deviceInterfaceDetailData, cbData, IntPtr.Zero, IntPtr.Zero) == false) - { - SetupDiDestroyDeviceInfoList(handle); - Marshal.ThrowExceptionForHR(Marshal.GetLastWin32Error()); - } - - if (deviceInterfaceDetailData.DevicePath.IndexOf("vid_045e&pid_0284") != -1) - { - SetupDiDestroyDeviceInfoList(handle); - devicePath = deviceInterfaceDetailData.DevicePath; - break; - } - } - - return devicePath; - } - - void OnReadComplete(IAsyncResult asyncResult) - { - try - { - if (_deviceStream.EndRead(asyncResult) == 7 && _deviceBuffer[1] != 1) - { - int packetID = BitConverter.ToInt32(_deviceBuffer, 3); - - if (packetID != _lastPacketID) - { - _lastPacketID = packetID; - - TimeSpan timeSpan = DateTime.Now - _lastCodeTime; - _lastCodeTime = DateTime.Now; - - int keyCode = (int)_deviceBuffer[3]; - - if (keyCode != _lastCode || timeSpan.Milliseconds > 250) - _inputHandler.MapAction(keyCode); - - _lastCode = keyCode; - } - } - - _deviceStream.BeginRead(_deviceBuffer, 0, _deviceBuffer.Length, new AsyncCallback(OnReadComplete), null); - } - catch (Exception) - { - } - } - - #endregion Implementation - - } - -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kro...@us...> - 2007-03-07 20:29:05
|
Revision: 164 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=164&view=rev Author: kroko_koenig Date: 2007-03-07 12:28:56 -0800 (Wed, 07 Mar 2007) Log Message: ----------- Added Paths: ----------- trunk/plugins/MySimon/ trunk/plugins/MySimon/Release/ trunk/plugins/MySimon/Release/Plugins/ trunk/plugins/MySimon/Release/Plugins/Windows/ trunk/plugins/MySimon/Release/Plugins/Windows/MySimon.dll trunk/plugins/MySimon/Release/Skin/ trunk/plugins/MySimon/Release/Skin/Media/ trunk/plugins/MySimon/Release/Skin/Media/MySimon_1.png trunk/plugins/MySimon/Release/Skin/Media/MySimon_1a.png trunk/plugins/MySimon/Release/Skin/Media/MySimon_2.png trunk/plugins/MySimon/Release/Skin/Media/MySimon_2a.png trunk/plugins/MySimon/Release/Skin/Media/MySimon_3.png trunk/plugins/MySimon/Release/Skin/Media/MySimon_3a.png trunk/plugins/MySimon/Release/Skin/Media/MySimon_4.png trunk/plugins/MySimon/Release/Skin/Media/MySimon_4a.png trunk/plugins/MySimon/Release/Skin/MySimon.xml trunk/plugins/MySimon/Release/Skin/Sounds/ trunk/plugins/MySimon/Release/Skin/Sounds/MySimon_a.wav trunk/plugins/MySimon/Release/Skin/Sounds/MySimon_c.wav trunk/plugins/MySimon/Release/Skin/Sounds/MySimon_e.wav trunk/plugins/MySimon/Release/Skin/Sounds/MySimon_err.wav trunk/plugins/MySimon/Release/Skin/Sounds/MySimon_g.wav trunk/plugins/MySimon/Source/ trunk/plugins/MySimon/Source/SimonSay/ trunk/plugins/MySimon/Source/SimonSay/SimonSay/ trunk/plugins/MySimon/Source/SimonSay/SimonSay/MySimon.cs trunk/plugins/MySimon/Source/SimonSay/SimonSay/MySimon.csproj trunk/plugins/MySimon/Source/SimonSay/SimonSay/Properties/ trunk/plugins/MySimon/Source/SimonSay/SimonSay/Properties/AssemblyInfo.cs trunk/plugins/MySimon/Source/SimonSay/SimonSay/bin/ trunk/plugins/MySimon/Source/SimonSay/SimonSay/bin/Debug/ trunk/plugins/MySimon/Source/SimonSay/SimonSay/bin/Release/ trunk/plugins/MySimon/Source/SimonSay/SimonSay/bin/Release/Core.dll trunk/plugins/MySimon/Source/SimonSay/SimonSay/bin/Release/Dialogs.dll trunk/plugins/MySimon/Source/SimonSay/SimonSay/bin/Release/MySimon.dll trunk/plugins/MySimon/Source/SimonSay/SimonSay/bin/Release/MySimon.pdb trunk/plugins/MySimon/Source/SimonSay/SimonSay/bin/Release/Utils.dll trunk/plugins/MySimon/Source/SimonSay/SimonSay/bin/Release/copy.bat trunk/plugins/MySimon/Source/SimonSay/SimonSay/obj/ trunk/plugins/MySimon/Source/SimonSay/SimonSay/obj/Debug/ trunk/plugins/MySimon/Source/SimonSay/SimonSay/obj/Debug/TempPE/ trunk/plugins/MySimon/Source/SimonSay/SimonSay/obj/Debug/build.force trunk/plugins/MySimon/Source/SimonSay/SimonSay/obj/MySimon.csproj.FileList.txt trunk/plugins/MySimon/Source/SimonSay/SimonSay/obj/Release/ trunk/plugins/MySimon/Source/SimonSay/SimonSay/obj/Release/MySimon.dll trunk/plugins/MySimon/Source/SimonSay/SimonSay/obj/Release/MySimon.pdb trunk/plugins/MySimon/Source/SimonSay/SimonSay/obj/Release/ResolveAssemblyReference.cache trunk/plugins/MySimon/Source/SimonSay/SimonSay/obj/Release/TempPE/ trunk/plugins/MySimon/Source/SimonSay/SimonSay/obj/SimonSay.csproj.FileList.txt trunk/plugins/MySimon/Source/SimonSay/SimonSay.sln trunk/plugins/MySimon/Source/SimonSay/SimonSay.suo trunk/plugins/MySimon/readme.txt Added: trunk/plugins/MySimon/Release/Plugins/Windows/MySimon.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MySimon/Release/Plugins/Windows/MySimon.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/MySimon/Release/Skin/Media/MySimon_1.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/MySimon/Release/Skin/Media/MySimon_1.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/MySimon/Release/Skin/Media/MySimon_1a.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/MySimon/Release/Skin/Media/MySimon_1a.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/MySimon/Release/Skin/Media/MySimon_2.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/MySimon/Release/Skin/Media/MySimon_2.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/MySimon/Release/Skin/Media/MySimon_2a.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/MySimon/Release/Skin/Media/MySimon_2a.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/MySimon/Release/Skin/Media/MySimon_3.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/MySimon/Release/Skin/Media/MySimon_3.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/MySimon/Release/Skin/Media/MySimon_3a.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/MySimon/Release/Skin/Media/MySimon_3a.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/MySimon/Release/Skin/Media/MySimon_4.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/MySimon/Release/Skin/Media/MySimon_4.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/MySimon/Release/Skin/Media/MySimon_4a.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/MySimon/Release/Skin/Media/MySimon_4a.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/MySimon/Release/Skin/MySimon.xml =================================================================== --- trunk/plugins/MySimon/Release/Skin/MySimon.xml (rev 0) +++ trunk/plugins/MySimon/Release/Skin/MySimon.xml 2007-03-07 20:28:56 UTC (rev 164) @@ -0,0 +1,136 @@ +<window> + <id>0709</id> + <defaultcontrol>2</defaultcontrol> + <allowoverlay>yes</allowoverlay> + <autohidetopbar>yes</autohidetopbar> + <controls> + <control> + <description>BackGround</description> + <type>image</type> + <id>1</id> + <posX>0</posX> + <posY>0</posY> + <width>720</width> + <height>576</height> + <texture>background.png</texture> + </control> + <control> + <description>an Image</description> + <type>image</type> + <id>11</id> + <posX>75</posX> + <posY>370</posY> + <texture>hover_my videos.png</texture> + </control> + <control> + <description>text label</description> + <type>label</type> + <id>1</id> + <posX>60</posX> + <posY>70</posY> + <label>Simon Say</label> + <font>font16</font> + <align>Left</align> + <textcolor>ffffffff</textcolor> + </control> + <control> + <description>Start</description> + <type>button</type> + <id>2</id> + <posX>60</posX> + <posY>97</posY> + <label>Start</label> + <onleft>2</onleft> + <onright>2</onright> + <onup>6</onup> + <ondown>3</ondown> + </control> + <control> + <description>Level</description> + <type>button</type> + <id>3</id> + <posX>60</posX> + <posY>131</posY> + <label>Level: Amateur</label> + <onleft>3</onleft> + <onright>3</onright> + <onup>2</onup> + <ondown>6</ondown> + </control> + <control> + <description>text label</description> + <type>label</type> + <id>4</id> + <posX>70</posX> + <posY>170</posY> + <label>#Round</label> + <font>font12</font> + <align>Left</align> + <textcolor>ffffffff</textcolor> + </control> + <control> + <description>text label</description> + <type>label</type> + <id>4</id> + <posX>70</posX> + <posY>204</posY> + <label>#Player</label> + <font>font12</font> + <align>Left</align> + <textcolor>ffffffff</textcolor> + </control> + <control> + <description>Whatsthis</description> + <type>button</type> + <id>6</id> + <posX>60</posX> + <posY>233</posY> + <label>What's this?</label> + <onleft>6</onleft> + <onright>6</onright> + <onup>3</onup> + <ondown>2</ondown> + </control> + <control> + <type>button</type> + <id>101</id> + <posX>280</posX> + <posY>80</posY> + <width>150</width> + <height>150</height> + <textureFocus>#Senso1</textureFocus> + <textureNoFocus>#Senso1</textureNoFocus> + </control> + <control> + <type>button</type> + <id>102</id> + <posX>429</posX> + <posY>80</posY> + <width>150</width> + <height>150</height> + <textureFocus>#Senso2</textureFocus> + <textureNoFocus>#Senso2</textureNoFocus> + </control> + <control> + <type>button</type> + <id>103</id> + <posX>280</posX> + <posY>229</posY> + <width>150</width> + <height>150</height> + <textureFocus>#Senso3</textureFocus> + <textureNoFocus>#Senso3</textureNoFocus> + </control> + <control> + <type>button</type> + <id>104</id> + <posX>429</posX> + <posY>229</posY> + <width>150</width> + <height>150</height> + <textureFocus>#Senso4</textureFocus> + <textureNoFocus>#Senso4</textureNoFocus> + </control> + + </controls> +</window> Added: trunk/plugins/MySimon/Release/Skin/Sounds/MySimon_a.wav =================================================================== (Binary files differ) Property changes on: trunk/plugins/MySimon/Release/Skin/Sounds/MySimon_a.wav ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/MySimon/Release/Skin/Sounds/MySimon_c.wav =================================================================== (Binary files differ) Property changes on: trunk/plugins/MySimon/Release/Skin/Sounds/MySimon_c.wav ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/MySimon/Release/Skin/Sounds/MySimon_e.wav =================================================================== (Binary files differ) Property changes on: trunk/plugins/MySimon/Release/Skin/Sounds/MySimon_e.wav ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/MySimon/Release/Skin/Sounds/MySimon_err.wav =================================================================== (Binary files differ) Property changes on: trunk/plugins/MySimon/Release/Skin/Sounds/MySimon_err.wav ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/MySimon/Release/Skin/Sounds/MySimon_g.wav =================================================================== (Binary files differ) Property changes on: trunk/plugins/MySimon/Release/Skin/Sounds/MySimon_g.wav ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/MySimon/Source/SimonSay/SimonSay/MySimon.cs =================================================================== --- trunk/plugins/MySimon/Source/SimonSay/SimonSay/MySimon.cs (rev 0) +++ trunk/plugins/MySimon/Source/SimonSay/SimonSay/MySimon.cs 2007-03-07 20:28:56 UTC (rev 164) @@ -0,0 +1,512 @@ +#region Copyright (C) 2005-2007 Team MediaPortal + +/* + * Copyright (C) 2005-2007 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.Collections.Generic; +using System.Text; +using System.Windows.Forms; +using MediaPortal.GUI.Library; +using MediaPortal.Dialogs; +using MediaPortal.Util; +using MediaPortal.Utils; + +namespace MediaPortal.GUI.MySimon +{ + public class MySimonGUI : GUIWindow , ISetupForm + { + #region SkinControl + [SkinControlAttribute(2)] protected GUIButtonControl BtnStart = null; + [SkinControlAttribute(3)] protected GUIButtonControl BtnLevel = null; + + [SkinControlAttribute(6)] protected GUIButtonControl BtnWhatsThis = null; + + [SkinControlAttribute(101)] protected GUIButtonControl BtnRed = null; + [SkinControlAttribute(102)] protected GUIButtonControl BtnBlue = null; + [SkinControlAttribute(103)] protected GUIButtonControl BtnGreen = null; + [SkinControlAttribute(104)] protected GUIButtonControl BtnYellow = null; + #endregion + + #region Private variables + string Level="Am"; //Choosen level + + Boolean SimonOn = false; + Boolean PlayerOn = false; + + int[] Code = new int[100]; + + int timeBase = 0; + int timeActual = 0; + int timeWait = 0; + + int round = 0; + int cnt = 0; + + private static OnActionHandler ah; + + private System.Windows.Forms.Timer _Game = new System.Windows.Forms.Timer(); + #endregion + + #region ISetupForm Members + + // Returns the name of the plugin which is shown in the plugin menu + public string PluginName() + { + return "My Simon Say"; + } + + // Returns the description of the plugin is shown in the plugin menu + public string Description() + { + return "Simon Say"; + } + + // Returns the author of the plugin which is shown in the plugin menu + public string Author() + { + return "Mark Koenig (kroko)"; + } + + // show the setup dialog + public void ShowPlugin() + { + MessageBox.Show("Nothing to configure, this is just an example"); + } + + // Indicates whether plugin can be enabled/disabled + public bool CanEnable() + { + return true; + } + + // get ID of windowplugin belonging to this setup + public int GetWindowId() + { + return 0709; + } + + // Indicates if plugin is enabled by default; + public bool DefaultEnabled() + { + return true; + } + + // indicates if a plugin has its own setup screen + public bool HasSetup() + { + return false; + } + + /// <summary> + /// If the plugin should have its 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 its own button on home + /// false : plugin does not need its own button on home</returns> + + public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) + { + strButtonText = PluginName(); + strButtonImage = String.Empty; + strButtonImageFocus = String.Empty; + strPictureImage = String.Empty; + return true; + } + + #endregion + + public override int GetID + { + get + { + return 0709; + } + set + { + base.GetID = value; + } + } + + public override bool Init() + { + bool result = Load(GUIGraphicsContext.Skin + @"\MySimon.xml"); + if (ah == null) ah = new OnActionHandler(OnAction2); + return result; + } + + #region Actions + public override void OnAction(Action action) + { + base.OnAction(action); + } + public void OnAction2(Action action) + { + + if (GUIWindowManager.ActiveWindowEx == (int)GUIWindow.Window.WINDOW_DIALOG_MENU) return; + + //string t = action.wID.ToString(); + //GUIPropertyManager.SetProperty("#Round", t); + + if (PlayerOn) + { + switch (action.wID) + { + //normal + case Action.ActionType.ACTION_REMOTE_RED_BUTTON: + Check(0); + break; + case Action.ActionType.ACTION_REMOTE_BLUE_BUTTON: + Check(1); + break; + case Action.ActionType.ACTION_REMOTE_GREEN_BUTTON: + Check(2); + break; + case Action.ActionType.ACTION_REMOTE_YELLOW_BUTTON: + Check(3); + break; + //my PC + case Action.ActionType.ACTION_SHOW_GUI: + Check(0); + break; + case Action.ActionType.ACTION_ASPECT_RATIO: + Check(1); + break; + case Action.ActionType.ACTION_NEXT_AUDIO: + Check(2); + break; + case Action.ActionType.ACTION_SHOW_INFO: + Check(3); + break; + // play with 1 2 + // play with 4 5 + case Action.ActionType.ACTION_KEY_PRESSED: + switch (action.m_key.KeyChar) + { + case '1': + Check(0); + break; + case '2': + Check(1); + break; + case '4': + Check(2); + break; + case '5': + Check(3); + break; + } + break; + default: + break; + } + } + } + #endregion + + public override bool OnMessage(GUIMessage message) + { + return base.OnMessage(message); + } + + public void Dispose() + { + _Game.Stop(); + _Game.Tick -= new EventHandler(_Game_Tick); + } + + protected override void OnPageLoad() + { + _Game.Interval = 5; + _Game.Tick += new EventHandler(_Game_Tick); + _Game.Start(); + + SimonOn = false; + PlayerOn = false; + Level = "Am"; + + GUIGraphicsContext.OnNewAction -= ah; + GUIGraphicsContext.OnNewAction += ah; + + base.OnPageLoad(); + + Reset(); + + GUIPropertyManager.SetProperty("#Round", "Round: 1"); + GUIPropertyManager.SetProperty("#Player", "GAME OVER"); + } + + protected override void OnPageDestroy(int new_windowId) + { + _Game.Stop(); + _Game.Tick -= new EventHandler(_Game_Tick); + } + + protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType) + { + if (control == BtnLevel) + OnBtnLevel(); + if (control == BtnWhatsThis) + OnBtnWhatsThis(); + if (control == BtnStart) + { //start game + if ((!PlayerOn) && (!SimonOn)) + { + Random randObj = new Random(); + for (int i = 0; i <= 99; i++) + { // do random colors for 100 rounds + Code[i] = (int)(randObj.NextDouble() * 4); + } + // set timebase for game + if (Level == "Pro") + timeBase = 4; + if (Level == "Nor") + timeBase = 10; + if (Level == "Am") + timeBase = 20; + + timeActual = timeBase; + Reset(); + + //init round + round = 0; + cnt = 0; + //simonn starts + SimonOn = true; + } + } + if (PlayerOn) + { + if ((controlId >= 101) && (controlId <= 104)) + { //which button has clicked ? + if (controlId == 101) Check(0); + if (controlId == 102) Check(1); + if (controlId == 103) Check(2); + if (controlId == 104) Check(3); + } + } + base.OnClicked(controlId, control, actionType); + } + + protected override void OnShowContextMenu() + { + base.OnShowContextMenu(); + } + + private void OnBtnLevel() + { //Choose level for the game + if ((!PlayerOn) && (!SimonOn)) + { + if (Level == "Nor") + { + GUIControl.SetControlLabel(GetID, BtnLevel.GetID, "Level: Professional"); + Level = "Pro"; + } + else if (Level == "Pro") + { + GUIControl.SetControlLabel(GetID, BtnLevel.GetID, "Level: Amateur"); + Level = "Am"; + } + else + { + GUIControl.SetControlLabel(GetID, BtnLevel.GetID, "Level: Normal"); + Level = "Nor"; + } + } + } + + private void OnBtnWhatsThis() + { + GUIDialogText dlg = (GUIDialogText)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_TEXT); + dlg.SetHeading("What's Simon Say (Senso)"); + dlg.SetText("Simon Say is a game where your object is to repeat a code of\n" + + "tones and colors.\n" + + "Level Amateur/Normal/Professional: Speed is increasing\n\n" + + "I would like to say 'Thank You' to MB for their great games.\n" + + "In my earlier day's I had a lot of them. We had a lot of fun\n" + + "playing them.\n\n" + + "Good luck\nkroko"); + dlg.DoModal(GetID); + } + + private void Red() + { // draw red field on + GUIPropertyManager.SetProperty("#Senso1", "MySimon_1a.png"); + MediaPortal.Util.Utils.PlaySound ("MySimon_c.wav", false, true); + } + private void Blue() + { // draw blue field on + GUIPropertyManager.SetProperty("#Senso2", "MySimon_2a.png"); + MediaPortal.Util.Utils.PlaySound("MySimon_e.wav", false, true); + } + private void Green() + { // draw green field on + GUIPropertyManager.SetProperty("#Senso3", "MySimon_3a.png"); + MediaPortal.Util.Utils.PlaySound("MySimon_g.wav", false, true); + } + private void Yellow() + { // draw yellow field on + GUIPropertyManager.SetProperty("#Senso4", "MySimon_4a.png"); + MediaPortal.Util.Utils.PlaySound("MySimon_a.wav", false, true); + } + private void Error(int errNo) + { // draw correct field on + Reset(); + if (errNo== 0) + GUIPropertyManager.SetProperty("#Senso1", "MySimon_1a.png"); + if (errNo == 1) + GUIPropertyManager.SetProperty("#Senso2", "MySimon_2a.png"); + if (errNo == 2) + GUIPropertyManager.SetProperty("#Senso3", "MySimon_3a.png"); + if (errNo == 3) + GUIPropertyManager.SetProperty("#Senso4", "MySimon_4a.png"); + + MediaPortal.Util.Utils.PlaySound("MySimon_err.wav", false, true); + } + private void Reset() + { // draw all fields off + GUIPropertyManager.SetProperty("#Senso1", "MySimon_1.png"); + GUIPropertyManager.SetProperty("#Senso2", "MySimon_2.png"); + GUIPropertyManager.SetProperty("#Senso3", "MySimon_3.png"); + GUIPropertyManager.SetProperty("#Senso4", "MySimon_4.png"); + } + + private void Check(int Button) + { + Reset(); // reset display + timeActual = timeBase; // set time to base + + if (Button == 0) + { //red is pressed + Red(); + } + if (Button == 1) + { //blue is pressed + Blue(); + } + if (Button == 2) + { //green is pressed + Green(); + } + if (Button == 3) + { //yellow is pressed + Yellow(); + } + if (Code[cnt] != Button ) + { //wrong color is pressed + PlayerOn = false; + Error(Code[cnt]); + } + else + { // color is correct + cnt++; // next tone + timeActual = 30; // check time for player + if (cnt > round) // last tone reached ? + { + PlayerOn = false; // Simon is now on + SimonOn = true; + + cnt = 0; // Start with tone 0 + round++; // next Round + + if (timeBase >4) // increased difficulty + timeBase--; + + timeWait = 30; // wait a little + timeActual = timeBase; // reset timer + } + } + } + + void _Game_Tick(object sender, EventArgs e) + { //display status of the game + if ((!PlayerOn) && (!SimonOn)) + GUIPropertyManager.SetProperty("#Player", "GAME OVER"); + if (PlayerOn) + GUIPropertyManager.SetProperty("#Player", "PLAYER"); + if (SimonOn) + GUIPropertyManager.SetProperty("#Player", "SIMON"); + //Simon is on and no wait + if ((SimonOn) && (timeWait==0)) + { // just started ? + if (timeBase == timeActual) + { //Display color + if (Code[cnt] == 0) + Red(); + if (Code[cnt] == 1) + Blue(); + if (Code[cnt] == 2) + Green(); + if (Code[cnt] == 3) + Yellow(); + + //Display round + int tmp = round + 1; + GUIPropertyManager.SetProperty("#Round", "Round: " + tmp.ToString() + " "); + } //count timer down + if (timeActual > 0) + timeActual = timeActual - 1; + else + { //if timer is 0 + timeActual = timeBase; + Reset(); + //next tone + if (cnt < round) + cnt++; + else + { //player is next + SimonOn = false; + PlayerOn = true; + // first tone a lot of time + timeActual = 50; + cnt = 0; + } + } + } + + if (timeWait > 0) + { //wait timer for little break + timeWait = timeWait - 1; + if (timeWait==timeBase) + Reset(); + } + + if (PlayerOn) + { // if player is on count down timer + if (timeActual > 0) + timeActual = timeActual - 1; + else + { //Player wait too long + PlayerOn = false; + Error(Code[cnt]); + //Reset(); + } + } + } + } +} Added: trunk/plugins/MySimon/Source/SimonSay/SimonSay/MySimon.csproj =================================================================== --- trunk/plugins/MySimon/Source/SimonSay/SimonSay/MySimon.csproj (rev 0) +++ trunk/plugins/MySimon/Source/SimonSay/SimonSay/MySimon.csproj 2007-03-07 20:28:56 UTC (rev 164) @@ -0,0 +1,51 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>8.0.50727</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{206A81B8-D452-45C2-86C9-CBBECF31C11C}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>ClassLibrary1</RootNamespace> + <AssemblyName>MySimon</AssemblyName> + </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.2593.1921, Culture=neutral, processorArchitecture=MSIL" /> + <Reference Include="Dialogs, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL" /> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml" /> + <Reference Include="Utils, Version=1.0.2593.1896, Culture=neutral, processorArchitecture=MSIL" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="MySimon.cs" /> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> \ No newline at end of file Added: trunk/plugins/MySimon/Source/SimonSay/SimonSay/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/MySimon/Source/SimonSay/SimonSay/Properties/AssemblyInfo.cs (rev 0) +++ trunk/plugins/MySimon/Source/SimonSay/SimonSay/Properties/AssemblyInfo.cs 2007-03-07 20:28:56 UTC (rev 164) @@ -0,0 +1,35 @@ +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("MySimonSay")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("MySimonSay")] +[assembly: AssemblyCopyright("Copyright © 2007")] +[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("1bd4081e-182e-436a-ab7a-abcc7b53684b")] + +// 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 Revisions- und Buildnummern +// übernehmen, indem Sie "*" eingeben: +[assembly: AssemblyVersion("0.1.0.0")] +[assembly: AssemblyFileVersion("0.1.0.0")] Added: trunk/plugins/MySimon/Source/SimonSay/SimonSay/bin/Release/Core.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MySimon/Source/SimonSay/SimonSay/bin/Release/Core.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/MySimon/Source/SimonSay/SimonSay/bin/Release/Dialogs.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MySimon/Source/SimonSay/SimonSay/bin/Release/Dialogs.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/MySimon/Source/SimonSay/SimonSay/bin/Release/MySimon.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MySimon/Source/SimonSay/SimonSay/bin/Release/MySimon.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/MySimon/Source/SimonSay/SimonSay/bin/Release/MySimon.pdb =================================================================== (Binary files differ) Property changes on: trunk/plugins/MySimon/Source/SimonSay/SimonSay/bin/Release/MySimon.pdb ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/MySimon/Source/SimonSay/SimonSay/bin/Release/Utils.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MySimon/Source/SimonSay/SimonSay/bin/Release/Utils.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/MySimon/Source/SimonSay/SimonSay/bin/Release/copy.bat =================================================================== --- trunk/plugins/MySimon/Source/SimonSay/SimonSay/bin/Release/copy.bat (rev 0) +++ trunk/plugins/MySimon/Source/SimonSay/SimonSay/bin/Release/copy.bat 2007-03-07 20:28:56 UTC (rev 164) @@ -0,0 +1,3 @@ +copy MySimon.dll "C:\Programme\Team MediaPortal\MediaPortal\Plugins\Windows" + + Added: trunk/plugins/MySimon/Source/SimonSay/SimonSay/obj/Debug/build.force =================================================================== Added: trunk/plugins/MySimon/Source/SimonSay/SimonSay/obj/MySimon.csproj.FileList.txt =================================================================== --- trunk/plugins/MySimon/Source/SimonSay/SimonSay/obj/MySimon.csproj.FileList.txt (rev 0) +++ trunk/plugins/MySimon/Source/SimonSay/SimonSay/obj/MySimon.csproj.FileList.txt 2007-03-07 20:28:56 UTC (rev 164) @@ -0,0 +1,6 @@ +obj\Release\ResolveAssemblyReference.cache +bin\Release\MySimon.dll +bin\Release\MySimon.pdb +obj\Release\MySimon.dll +obj\Release\MySimon.pdb +obj\Debug\ResolveAssemblyReference.cache Added: trunk/plugins/MySimon/Source/SimonSay/SimonSay/obj/Release/MySimon.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MySimon/Source/SimonSay/SimonSay/obj/Release/MySimon.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/MySimon/Source/SimonSay/SimonSay/obj/Release/MySimon.pdb =================================================================== (Binary files differ) Property changes on: trunk/plugins/MySimon/Source/SimonSay/SimonSay/obj/Release/MySimon.pdb ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/MySimon/Source/SimonSay/SimonSay/obj/Release/ResolveAssemblyReference.cache =================================================================== (Binary files differ) Property changes on: trunk/plugins/MySimon/Source/SimonSay/SimonSay/obj/Release/ResolveAssemblyReference.cache ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/MySimon/Source/SimonSay/SimonSay/obj/SimonSay.csproj.FileList.txt =================================================================== --- trunk/plugins/MySimon/Source/SimonSay/SimonSay/obj/SimonSay.csproj.FileList.txt (rev 0) +++ trunk/plugins/MySimon/Source/SimonSay/SimonSay/obj/SimonSay.csproj.FileList.txt 2007-03-07 20:28:56 UTC (rev 164) @@ -0,0 +1,5 @@ +obj\Release\ResolveAssemblyReference.cache +bin\Release\SimonSay.dll +bin\Release\SimonSay.pdb +obj\Release\SimonSay.dll +obj\Release\SimonSay.pdb Added: trunk/plugins/MySimon/Source/SimonSay/SimonSay.sln =================================================================== --- trunk/plugins/MySimon/Source/SimonSay/SimonSay.sln (rev 0) +++ trunk/plugins/MySimon/Source/SimonSay/SimonSay.sln 2007-03-07 20:28:56 UTC (rev 164) @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MySimon", "SimonSay\MySimon.csproj", "{206A81B8-D452-45C2-86C9-CBBECF31C11C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {206A81B8-D452-45C2-86C9-CBBECF31C11C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {206A81B8-D452-45C2-86C9-CBBECF31C11C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {206A81B8-D452-45C2-86C9-CBBECF31C11C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {206A81B8-D452-45C2-86C9-CBBECF31C11C}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal Added: trunk/plugins/MySimon/Source/SimonSay/SimonSay.suo =================================================================== (Binary files differ) Property changes on: trunk/plugins/MySimon/Source/SimonSay/SimonSay.suo ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/MySimon/readme.txt =================================================================== --- trunk/plugins/MySimon/readme.txt (rev 0) +++ trunk/plugins/MySimon/readme.txt 2007-03-07 20:28:56 UTC (rev 164) @@ -0,0 +1,22 @@ +Simon Say V0.1 +-------------- + +Simon Say (Senso) + +Initial release +This nice game from MB as a MP version. You can play with + +- the mouse +- remote color buttons +- 1 2 + 4 5 (action keys) + +Copy the plugin and skin files into your favorite skin folder. +I had to adjust my remote a little in the setup. It was to sensitve. + +Planed feature: Highscores ? + +Have fun. + +Greets +kroko \ 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...> - 2007-03-07 20:34:05
|
Revision: 165 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=165&view=rev Author: kroko_koenig Date: 2007-03-07 12:33:19 -0800 (Wed, 07 Mar 2007) Log Message: ----------- Added Paths: ----------- trunk/plugins/MyDbox/ trunk/plugins/MyDbox/Release/ trunk/plugins/MyDbox/Release/Plugins/ trunk/plugins/MyDbox/Release/Plugins/ExternalPlayers/ trunk/plugins/MyDbox/Release/Plugins/ExternalPlayers/ExternalPlayers.dll trunk/plugins/MyDbox/Release/Plugins/Windows/ trunk/plugins/MyDbox/Release/Plugins/Windows/ExternalPlayers.dll trunk/plugins/MyDbox/Release/Plugins/Windows/MyDbox.dll trunk/plugins/MyDbox/Release/Skin/ trunk/plugins/MyDbox/Release/Skin/Blue Two/ trunk/plugins/MyDbox/Release/Skin/Blue Two/mydboxmain.xml trunk/plugins/MyDbox/Source/ trunk/plugins/MyDbox/Source/MyDbox/ trunk/plugins/MyDbox/Source/MyDbox/ChannelInfo.cs trunk/plugins/MyDbox/Source/MyDbox/Data.cs trunk/plugins/MyDbox/Source/MyDbox/DboxSetupForm.Designer.cs trunk/plugins/MyDbox/Source/MyDbox/DboxSetupForm.cs trunk/plugins/MyDbox/Source/MyDbox/DboxSetupForm.resx trunk/plugins/MyDbox/Source/MyDbox/Epg.cs trunk/plugins/MyDbox/Source/MyDbox/GuiDbox.cs trunk/plugins/MyDbox/Source/MyDbox/MyDbox.csproj trunk/plugins/MyDbox/Source/MyDbox/MyDbox.csproj.user trunk/plugins/MyDbox/Source/MyDbox/MyDboxGui.cs trunk/plugins/MyDbox/Source/MyDbox/MyDboxPlugin.cs trunk/plugins/MyDbox/Source/MyDbox/Properties/ trunk/plugins/MyDbox/Source/MyDbox/Properties/AssemblyInfo.cs trunk/plugins/MyDbox/Source/MyDbox/Request.cs trunk/plugins/MyDbox/Source/MyDbox/VideoLAN/ trunk/plugins/MyDbox/Source/MyDbox/VideoLAN/ConfigurationForm.cs trunk/plugins/MyDbox/Source/MyDbox/VideoLAN/ConfigurationForm.resx trunk/plugins/MyDbox/Source/MyDbox/VideoLAN/IPlayer.cs trunk/plugins/MyDbox/Source/MyDbox/VideoLAN/InnerVlcWindow.cs trunk/plugins/MyDbox/Source/MyDbox/VideoLAN/InnerVlcWindow.designer.cs trunk/plugins/MyDbox/Source/MyDbox/VideoLAN/InnerVlcWindow.resx trunk/plugins/MyDbox/Source/MyDbox/VideoLAN/NativeLibVlc.cs trunk/plugins/MyDbox/Source/MyDbox/VideoLAN/VideoLanControl.cs trunk/plugins/MyDbox/Source/MyDbox/VideoLAN/VideoLanControl.designer.cs trunk/plugins/MyDbox/Source/MyDbox/VideoLAN/VideoLanControl.resx trunk/plugins/MyDbox/Source/MyDbox/VideoLAN/VideoLanPlugin.cs trunk/plugins/MyDbox/Source/MyDbox/VideoLAN/VideoLanPlugin.cs.bak trunk/plugins/MyDbox/Source/MyDbox/VideoLAN/VlcControl/ trunk/plugins/MyDbox/Source/MyDbox/VideoLAN/VlcControl/IPlayer.cs trunk/plugins/MyDbox/Source/MyDbox/VideoLAN/VlcControl/InnerVlcWindow.Designer.cs trunk/plugins/MyDbox/Source/MyDbox/VideoLAN/VlcControl/InnerVlcWindow.cs trunk/plugins/MyDbox/Source/MyDbox/VideoLAN/VlcControl/NativeLibVlc.cs trunk/plugins/MyDbox/Source/MyDbox/VideoLAN/VlcControl/Properties/ trunk/plugins/MyDbox/Source/MyDbox/VideoLAN/VlcControl/VLanControl.csproj trunk/plugins/MyDbox/Source/MyDbox/VideoLAN/VlcControl/VLanControl.sln trunk/plugins/MyDbox/Source/MyDbox/VideoLAN/VlcControl/VLanControl.suo trunk/plugins/MyDbox/Source/MyDbox/VideoLAN/VlcControl/VlcUserControl.Designer.cs trunk/plugins/MyDbox/Source/MyDbox/VideoLAN/VlcControl/VlcUserControl.cs trunk/plugins/MyDbox/Source/MyDbox/VideoLAN/VlcControl/VlcUserControl.resx trunk/plugins/MyDbox/Source/MyDbox/VideoLAN/VlcControl/bin/ trunk/plugins/MyDbox/Source/MyDbox/VideoLAN/VlcControl/bin/Debug/ trunk/plugins/MyDbox/Source/MyDbox/VideoLAN/VlcControl/bin/Release/ trunk/plugins/MyDbox/Source/MyDbox/VideoLAN/VlcControl/obj/ trunk/plugins/MyDbox/Source/MyDbox/VideoLAN/VlcControl/obj/Debug/ trunk/plugins/MyDbox/Source/MyDbox/VideoLAN/VlcControl/obj/Debug/TempPE/ trunk/plugins/MyDbox/Source/MyDbox/VideoLAN/VlcControl/obj/Release/ trunk/plugins/MyDbox/Source/MyDbox/VideoLAN/VlcControl/obj/Release/TempPE/ trunk/plugins/MyDbox/Source/MyDbox/VideoLAN/VlcControl/obj/Release/VLanControl.VlcUserControl.resources trunk/plugins/MyDbox/Source/MyDbox/VideoLAN/VlcControl/obj/Release/VLanControl.csproj.GenerateResource.Cache trunk/plugins/MyDbox/Source/MyDbox/VideoLAN/VlcControl/obj/VLanControl.csproj.FileList.txt trunk/plugins/MyDbox/Source/MyDbox/VideoLAN/VlcUserControl.cs trunk/plugins/MyDbox/Source/MyDbox/VideoLAN/VlcUserControl.designer.cs trunk/plugins/MyDbox/Source/MyDbox/VideoLAN/VlcUserControl.resx trunk/plugins/MyDbox/Source/MyDbox/VideoLAN/mk.txt trunk/plugins/MyDbox/Source/MyDbox/Zap.cs trunk/plugins/MyDbox/Source/MyDbox/bin/ trunk/plugins/MyDbox/Source/MyDbox/bin/Debug/ trunk/plugins/MyDbox/Source/MyDbox/bin/Release/ trunk/plugins/MyDbox/Source/MyDbox/bin/Release/Communications.DLL trunk/plugins/MyDbox/Source/MyDbox/bin/Release/Core.dll trunk/plugins/MyDbox/Source/MyDbox/bin/Release/Dialogs.dll trunk/plugins/MyDbox/Source/MyDbox/bin/Release/ExternalPlayers.dll trunk/plugins/MyDbox/Source/MyDbox/bin/Release/MyDbox.dll trunk/plugins/MyDbox/Source/MyDbox/bin/Release/MyDbox.pdb trunk/plugins/MyDbox/Source/MyDbox/bin/Release/Utils.dll trunk/plugins/MyDbox/Source/MyDbox/bin/Release/copy.bat trunk/plugins/MyDbox/Source/MyDbox/obj/ trunk/plugins/MyDbox/Source/MyDbox/obj/Debug/ trunk/plugins/MyDbox/Source/MyDbox/obj/Debug/MyDbox.dll trunk/plugins/MyDbox/Source/MyDbox/obj/Debug/MyDbox.pdb trunk/plugins/MyDbox/Source/MyDbox/obj/Debug/ResolveAssemblyReference.cache trunk/plugins/MyDbox/Source/MyDbox/obj/Debug/TempPE/ trunk/plugins/MyDbox/Source/MyDbox/obj/MyDbox.csproj.FileList.txt trunk/plugins/MyDbox/Source/MyDbox/obj/Release/ trunk/plugins/MyDbox/Source/MyDbox/obj/Release/Interop.WinGrabEngine.dll trunk/plugins/MyDbox/Source/MyDbox/obj/Release/MediaPortal.GUI.Mydbox.DboxSetupForm.resources trunk/plugins/MyDbox/Source/MyDbox/obj/Release/MyDbox.csproj.GenerateResource.Cache trunk/plugins/MyDbox/Source/MyDbox/obj/Release/MyDbox.csproj.ResolveComReference.cache trunk/plugins/MyDbox/Source/MyDbox/obj/Release/MyDbox.dll trunk/plugins/MyDbox/Source/MyDbox/obj/Release/MyDbox.pdb trunk/plugins/MyDbox/Source/MyDbox/obj/Release/ResolveAssemblyReference.cache trunk/plugins/MyDbox/Source/MyDbox/obj/Release/TempPE/ trunk/plugins/MyDbox/Source/MyDbox.sln trunk/plugins/MyDbox/Source/MyDbox.suo trunk/plugins/MyDbox/read_me.txt Added: trunk/plugins/MyDbox/Release/Plugins/ExternalPlayers/ExternalPlayers.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MyDbox/Release/Plugins/ExternalPlayers/ExternalPlayers.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/MyDbox/Release/Plugins/Windows/ExternalPlayers.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MyDbox/Release/Plugins/Windows/ExternalPlayers.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/MyDbox/Release/Plugins/Windows/MyDbox.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/MyDbox/Release/Plugins/Windows/MyDbox.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/MyDbox/Release/Skin/Blue Two/mydboxmain.xml =================================================================== --- trunk/plugins/MyDbox/Release/Skin/Blue Two/mydboxmain.xml (rev 0) +++ trunk/plugins/MyDbox/Release/Skin/Blue Two/mydboxmain.xml 2007-03-07 20:33:19 UTC (rev 165) @@ -0,0 +1,251 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<window> + <id>2203</id> + <defaultcontrol>2</defaultcontrol> + <allowoverlay>no</allowoverlay> + <define>#header.image:television_logo.png</define> + <define>#header.label:605</define> + <define>#header.hover:hover_my tv.png</define> + <controls> + <import>common.window.xml</import> + <import>common.time.xml</import> + <control> + <type>group</type> + <layout>StackLayout</layout> + <description>group element</description> + <animation>FlyInFromLeft</animation> + <posX>60</posX> + <posY>97</posY> + <control> + <description>TVGuide</description> + <type>button</type> + <id>2</id> + <label>600</label> + <hyperlink>600</hyperlink> + <onup>17</onup> + <ondown>3</ondown> + <onright>99</onright> + </control> + <control> + <description>Record Now</description> + <type>button</type> + <id>3</id> + <label>601</label> + <onup>2</onup> + <ondown>6</ondown> + <onright>99</onright> + </control> + <control> + <description>Group button</description> + <type>button</type> + <id>6</id> + <label>971</label> + <onup>3</onup> + <ondown>7</ondown> + <onright>99</onright> + </control> + <control> + <description>Channel button</description> + <type>button</type> + <id>7</id> + <label>602</label> + <onup>6</onup> + <ondown>8</ondown> + <onright>99</onright> + </control> + <control> + <description>TV On/Off button</description> + <type>togglebutton</type> + <id>8</id> + <font>font13</font> + <textcolor>White</textcolor> + <colordiffuse>White</colordiffuse> + <disabledcolor>#60ffffff</disabledcolor> + <label>707</label> + <onup>7</onup> + <ondown>9</ondown> + <onright>99</onright> + </control> + <control> + <description>Timeshifting On/Off button</description> + <type>togglebutton</type> + <id>9</id> + <font>font13</font> + <textcolor>White</textcolor> + <colordiffuse>White</colordiffuse> + <label>708</label> + <onup>8</onup> + <ondown>10</ondown> + <onright>99</onright> + </control> + <control> + <description>Scheduler</description> + <type>button</type> + <id>10</id> + <label>603</label> + <hyperlink>601</hyperlink> + <onup>9</onup> + <ondown>11</ondown> + <onright>99</onright> + </control> + <control> + <description>Recordings</description> + <type>button</type> + <id>11</id> + <label>604</label> + <onup>10</onup> + <ondown>12</ondown> + <onright>99</onright> + </control> + <control> + <description>Raido</description> + <type>button</type> + <id>12</id> + <label>665</label> + <onup>11</onup> + <ondown>13</ondown> + <onright>99</onright> + </control> + <control> + <description>DirectChannel</description> + <type>button</type> + <id>13</id> + <label>891</label> + <onup>12</onup> + <ondown>14</ondown> + <onright>99</onright> + </control> + </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>tv_green_border.png</textureFocus> + </control> + <control> + <description>Current program title</description> + <type>fadelabel</type> + <id>13</id> + <posX>290</posX> + <posY>415</posY> + <width>250</width> + <label>#TV.View.title</label> + <font>font13</font> + <textcolor>White</textcolor> + </control> + <control> + <description>Channel label</description> + <type>label</type> + <id>13</id> + <posX>660</posX> + <posY>415</posY> + <label>602</label> + <font>font13</font> + <align>right</align> + <textcolor>FFFFFFFF</textcolor> + </control> + <control> + <description>Current program time</description> + <type>label</type> + <id>13</id> + <posX>290</posX> + <posY>435</posY> + <label>#TV.View.start-#TV.View.stop</label> + <font>font13</font> + <align>left</align> + <textcolor>FFB2D4F5</textcolor> + </control> + <control> + <description>Current Channelname</description> + <type>fadelabel</type> + <id>30</id> + <posX>660</posX> + <posY>435</posY> + <width>90</width> + <label>#TV.View.channel</label> + <font>font13</font> + <align>right</align> + <textcolor>FFB2D4F5</textcolor> + </control> + <control> + <description>Description1</description> + <type>textboxscrollup</type> + <id>15</id> + <posX>290</posX> + <posY>455</posY> + <width>350</width> + <height>90</height> + <seperator>----------------------------------------------------------------------------------------------</seperator> + <label>#TV.View.description</label> + <font>font13</font> + <textcolor>White</textcolor> + </control> + <control> + <description>Progress background</description> + <type>image</type> + <id>1</id> + <posX>300</posX> + <posY>377</posY> + <width>350</width> + <texture>osd_progress_background.png</texture> + </control> + <control> + <description>progress bar</description> + <type>progress</type> + <id>20</id> + <posX>289</posX> + <posY>376</posY> + <width>372</width> + <label>#TV.View.Percentage</label> + <visible>yes</visible> + </control> + <control> + <description>Recording Channel</description> + <type>image</type> + <id>22</id> + <posX>90</posX> + <posY>425</posY> + <width>80</width> + <height>80</height> + <texture>#TV.Record.thumb</texture> + </control> + <control> + <description>record info label</description> + <type>fadelabel</type> + <id>23</id> + <width>150</width> + <height>30</height> + <posX>85</posX> + <label>#TV.Record.channel\r#TV.Record.title\r#TV.Record.start-#TV.Record.stop</label> + <font>font13</font> + <textcolor>White</textcolor> + </control> + <control> + <description>record pin</description> + <type>image</type> + <id>24</id> + <posX>260</posX> + <posY>425</posY> + <texture>tvguide_record_button.png</texture> + <visible>no</visible> + </control> + </controls> +</window> \ No newline at end of file Added: trunk/plugins/MyDbox/Source/MyDbox/ChannelInfo.cs =================================================================== (Binary files differ) Property changes on: trunk/plugins/MyDbox/Source/MyDbox/ChannelInfo.cs ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/MyDbox/Source/MyDbox/Data.cs =================================================================== --- trunk/plugins/MyDbox/Source/MyDbox/Data.cs (rev 0) +++ trunk/plugins/MyDbox/Source/MyDbox/Data.cs 2007-03-07 20:33:19 UTC (rev 165) @@ -0,0 +1,189 @@ +#region Copyright (C) 2005-2007 Team MediaPortal + +/* + * Copyright (C) 2005-2007 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.Collections.Generic; +using System.Text; +using System.Data; +using System.Text.RegularExpressions; + +namespace MediaPortal.GUI.Mydbox +{ + public class Data + { + private string _Url = ""; + private string _UserName = ""; + private string _Password = ""; + private string _Command = "/control/"; + + public Data(string url, string username, string password) + { + _Url = url; + _UserName = username; + _Password = password; + } + + public DataSet UserTVBouquets + { + get + { + string temp = ""; + Request request = new Request(_Url, _UserName, _Password); + string sreturn = request.PostData(_Command + "getbouquets"); + string[] allBouquets = sreturn.Split('\n'); + + // convert to dataset + DataSet ds = new DataSet(); + DataTable table = new DataTable("BouquetsTV"); + DataRow row = null; + + try + { + table.Columns.Add("Ref", Type.GetType("System.String")); + table.Columns.Add("Bouquet", Type.GetType("System.String")); + table.Columns.Add("Channel", Type.GetType("System.String")); + table.Columns.Add("ID", Type.GetType("System.String")); + table.Columns.Add("Name", Type.GetType("System.String")); + + foreach (string s in allBouquets) + { + temp = s.Split(' ')[0]; + + sreturn = request.PostData(_Command + "getbouquet?bouquet=" + temp + "&mode=TV"); + string[] OneBouquet = sreturn.Split('\n'); + + if (OneBouquet[0] != "") + { + + foreach (string bouquets in OneBouquet) + { + if (bouquets.IndexOf(' ') > -1 && bouquets.Length > 0) + { + row = table.NewRow(); + int start = 0; + + String tmp_Ref = s.Split(' ')[0]; + start = tmp_Ref.Length + 1; + String tmp_Bouquet = s.Substring(start,s.Length-start); + String tmp_Channel = bouquets.Split(' ')[0]; + String tmp_ID = bouquets.Split(' ')[1]; + start = tmp_Channel.Length + tmp_ID.Length + 2; + String tmp_Name = bouquets.Substring(start, bouquets.Length - start); + + row["Ref"] = tmp_Ref; + row["Bouquet"] = tmp_Bouquet; + row["Channel"] = tmp_Channel; + row["ID"] = tmp_ID; + row["Name"] = tmp_Name; + + table.Rows.Add(row); + } + } + } + } + ds.Tables.Add(table); + } + catch + { + + } + + return ds; + } + } + + public DataSet UserRadioBouquets + { + get + { + string temp = ""; + Request request = new Request(_Url, _UserName, _Password); + string sreturn = request.PostData(_Command + "getbouquets"); + string[] allBouquets = sreturn.Split('\n'); + + // convert to dataset + DataSet ds = new DataSet(); + DataTable table = new DataTable("BouquetsRadio"); + DataRow row = null; + + try + { + + table.Columns.Add("Ref", Type.GetType("System.String")); + table.Columns.Add("Bouquet", Type.GetType("System.String")); + table.Columns.Add("Channel", Type.GetType("System.String")); + table.Columns.Add("ID", Type.GetType("System.String")); + table.Columns.Add("Name", Type.GetType("System.String")); + + foreach (string s in allBouquets) + { + temp = s.Split(' ')[0]; + + sreturn = request.PostData(_Command + "getbouquet?bouquet=" + temp + "&mode=RADIO"); + string[] OneBouquet = sreturn.Split('\n'); + + if (OneBouquet[0] != "") + { + + foreach (string bouquets in OneBouquet) + { + if (bouquets.IndexOf(' ') > -1 && bouquets.Length > 0) + { + row = table.NewRow(); + int start = 0; + + String tmp_Ref = s.Split(' ')[0]; + start = tmp_Ref.Length + 1; + String tmp_Bouquet = s.Substring(start, s.Length - start); + String tmp_Channel = bouquets.Split(' ')[0]; + String tmp_ID = bouquets.Split(' ')[1]; + start = tmp_Ref.Length + tmp_ID.Length + 2; + String tmp_Name = bouquets.Substring(start, bouquets.Length - start); + + row["Ref"] = tmp_Ref; + row["Bouquet"] = tmp_Bouquet; + row["Channel"] = tmp_Channel; + row["ID"] = tmp_ID; + row["Name"] = tmp_Name; + + table.Rows.Add(row); + } + } + } + } + ds.Tables.Add(table); + } + catch + { + + } + + return ds; + } + } + + } + +} Added: trunk/plugins/MyDbox/Source/MyDbox/DboxSetupForm.Designer.cs =================================================================== --- trunk/plugins/MyDbox/Source/MyDbox/DboxSetupForm.Designer.cs (rev 0) +++ trunk/plugins/MyDbox/Source/MyDbox/DboxSetupForm.Designer.cs 2007-03-07 20:33:19 UTC (rev 165) @@ -0,0 +1,40 @@ +#region Copyright (C) 2005-2007 Team MediaPortal + +/* + * Copyright (C) 2005-2007 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +namespace MediaPortal.GUI.Mydbox +{ + partial class DboxSetupForm + { + + private MediaPortal.UserInterface.Controls.MPLabel mpLabel3; + private MediaPortal.UserInterface.Controls.MPTextBox edtPassword; + private MediaPortal.UserInterface.Controls.MPButton mpButton1; + private MediaPortal.UserInterface.Controls.MPTextBox edtUserName; + private MediaPortal.UserInterface.Controls.MPGroupBox mpGroupBox1; + private MediaPortal.UserInterface.Controls.MPLabel mpLabel2; + private MediaPortal.UserInterface.Controls.MPTextBox edtIP; + private MediaPortal.UserInterface.Controls.MPLabel mpLabel1; + } +} \ No newline at end of file Added: trunk/plugins/MyDbox/Source/MyDbox/DboxSetupForm.cs =================================================================== --- trunk/plugins/MyDbox/Source/MyDbox/DboxSetupForm.cs (rev 0) +++ trunk/plugins/MyDbox/Source/MyDbox/DboxSetupForm.cs 2007-03-07 20:33:19 UTC (rev 165) @@ -0,0 +1,197 @@ +#region Copyright (C) 2005-2007 Team MediaPortal + +/* + * Copyright (C) 2005-2007 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.Collections; +using System.ComponentModel; +using System.IO; +using System.Windows.Forms; +using MediaPortal.Profile; +using MediaPortal.Util; + + +namespace MediaPortal.GUI.Mydbox +{ + public partial class DboxSetupForm : Form + { + public DboxSetupForm() + { + InitializeComponent(); + LoadSettings(); + } + + private void DboxSetupForm_Load(object sender, EventArgs e) + { + LoadSettings(); + } + + private void btnClose_Click(object sender, EventArgs e) + { + SaveSettings(); + this.Close(); + } + + private void InitializeComponent() + { + this.mpGroupBox1 = new MediaPortal.UserInterface.Controls.MPGroupBox(); + this.edtPassword = new MediaPortal.UserInterface.Controls.MPTextBox(); + this.mpLabel3 = new MediaPortal.UserInterface.Controls.MPLabel(); + this.edtUserName = new MediaPortal.UserInterface.Controls.MPTextBox(); + this.mpLabel2 = new MediaPortal.UserInterface.Controls.MPLabel(); + this.edtIP = new MediaPortal.UserInterface.Controls.MPTextBox(); + this.mpLabel1 = new MediaPortal.UserInterface.Controls.MPLabel(); + this.mpButton1 = new MediaPortal.UserInterface.Controls.MPButton(); + this.mpGroupBox1.SuspendLayout(); + this.SuspendLayout(); + // + // mpGroupBox1 + // + this.mpGroupBox1.Controls.Add(this.edtPassword); + this.mpGroupBox1.Controls.Add(this.mpLabel3); + this.mpGroupBox1.Controls.Add(this.edtUserName); + this.mpGroupBox1.Controls.Add(this.mpLabel2); + this.mpGroupBox1.Controls.Add(this.edtIP); + this.mpGroupBox1.Controls.Add(this.mpLabel1); + this.mpGroupBox1.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.mpGroupBox1.Location = new System.Drawing.Point(3, 3); + this.mpGroupBox1.Name = "mpGroupBox1"; + this.mpGroupBox1.Size = new System.Drawing.Size(310, 144); + this.mpGroupBox1.TabIndex = 0; + this.mpGroupBox1.TabStop = false; + this.mpGroupBox1.Text = "D-Box Login Settings"; + // + // edtPassword + // + this.edtPassword.BorderColor = System.Drawing.Color.Empty; + this.edtPassword.Location = new System.Drawing.Point(120, 94); + this.edtPassword.Name = "edtPassword"; + this.edtPassword.Size = new System.Drawing.Size(157, 20); + this.edtPassword.TabIndex = 5; + this.edtPassword.Visible = false; + // + // mpLabel3 + // + this.mpLabel3.AutoSize = true; + this.mpLabel3.Location = new System.Drawing.Point(58, 97); + this.mpLabel3.Name = "mpLabel3"; + this.mpLabel3.Size = new System.Drawing.Size(56, 13); + this.mpLabel3.TabIndex = 4; + this.mpLabel3.Text = "Password:"; + this.mpLabel3.Visible = false; + // + // edtUserName + // + this.edtUserName.BorderColor = System.Drawing.Color.Empty; + this.edtUserName.Location = new System.Drawing.Point(120, 68); + this.edtUserName.Name = "edtUserName"; + this.edtUserName.Size = new System.Drawing.Size(157, 20); + this.edtUserName.TabIndex = 3; + this.edtUserName.Visible = false; + // + // mpLabel2 + // + this.mpLabel2.AutoSize = true; + this.mpLabel2.Location = new System.Drawing.Point(53, 71); + this.mpLabel2.Name = "mpLabel2"; + this.mpLabel2.Size = new System.Drawing.Size(61, 13); + this.mpLabel2.TabIndex = 2; + this.mpLabel2.Text = "User name:"; + this.mpLabel2.Visible = false; + // + // edtIP + // + this.edtIP.BorderColor = System.Drawing.Color.Empty; + this.edtIP.Location = new System.Drawing.Point(120, 42); + this.edtIP.Name = "edtIP"; + this.edtIP.Size = new System.Drawing.Size(157, 20); + this.edtIP.TabIndex = 1; + // + // mpLabel1 + // + this.mpLabel1.AutoSize = true; + this.mpLabel1.Location = new System.Drawing.Point(26, 45); + this.mpLabel1.Name = "mpLabel1"; + this.mpLabel1.Size = new System.Drawing.Size(92, 13); + this.mpLabel1.TabIndex = 0; + this.mpLabel1.Text = "IP address D-Box:"; + // + // mpButton1 + // + this.mpButton1.Location = new System.Drawing.Point(238, 153); + this.mpButton1.Name = "mpButton1"; + this.mpButton1.Size = new System.Drawing.Size(75, 23); + this.mpButton1.TabIndex = 1; + this.mpButton1.Text = "OK"; + this.mpButton1.UseVisualStyleBackColor = true; + this.mpButton1.Click += new System.EventHandler(this.mpButton1_Click); + // + // DboxSetupForm + // + this.ClientSize = new System.Drawing.Size(316, 179); + this.Controls.Add(this.mpButton1); + this.Controls.Add(this.mpGroupBox1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "DboxSetupForm"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "Dbox Settings"; + this.mpGroupBox1.ResumeLayout(false); + this.mpGroupBox1.PerformLayout(); + this.ResumeLayout(false); + + } + + private void mpButton1_Click(object sender, EventArgs e) + { + SaveSettings(); + this.Close(); + } + + void LoadSettings() + { + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("MediaPortal.xml")) + { + edtIP.Text = xmlreader.GetValue("mydbox", "IP"); + edtUserName.Text = xmlreader.GetValue("mydbox", "UserName"); + edtPassword.Text = xmlreader.GetValue("mydbox", "Password"); + } + } + + void SaveSettings() + { + if (edtIP.Text.Length == 0) + return; + + using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings("MediaPortal.xml")) + + { + xmlwriter.SetValue("mydbox", "IP", edtIP.Text); + xmlwriter.SetValue("mydbox", "UserName", edtUserName.Text); + xmlwriter.SetValue("mydbox", "Password", edtPassword.Text); + } + } + } +} \ No newline at end of file Added: trunk/plugins/MyDbox/Source/MyDbox/DboxSetupForm.resx =================================================================== --- trunk/plugins/MyDbox/Source/MyDbox/DboxSetupForm.resx (rev 0) +++ trunk/plugins/MyDbox/Source/MyDbox/DboxSetupForm.resx 2007-03-07 20:33:19 UTC (rev 165) @@ -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/MyDbox/Source/MyDbox/Epg.cs =================================================================== --- trunk/plugins/MyDbox/Source/MyDbox/Epg.cs (rev 0) +++ trunk/plugins/MyDbox/Source/MyDbox/Epg.cs 2007-03-07 20:33:19 UTC (rev 165) @@ -0,0 +1,193 @@ +#region Copyright (C) 2005-2007 Team MediaPortal + +/* + * Copyright (C) 2005-2007 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.Collections.Generic; +using System.Text; +using System.Data; +using System.Text.RegularExpressions; + +namespace MediaPortal.GUI.Mydbox +{ + public class EPG + { + private string _Url = ""; + private string _UserName = ""; + private string _Password = ""; + private string _Command = "/control/"; + + private DateTime StartTime; + private DateTime EndTime; + private DateTime ActTime; + + public EPG(string url, string username, string password) + { + _Url = url; + _UserName = username; + _Password = password; + } + + public DataSet EPG_Now + { + get + { + //get all actual programms EPG + Request request = new Request(_Url, _UserName, _Password); + string sreturn = request.PostData(_Command + "epg?ext"); + string[] allChannels = sreturn.Split('\n'); + + // convert to dataset + DataSet ds = new DataSet(); + DataTable table = new DataTable("EPG"); + DataRow row = null; + + try + { + table.Columns.Add("ID", Type.GetType("System.String")); + table.Columns.Add("Start", Type.GetType("System.DateTime")); + table.Columns.Add("Stop", Type.GetType("System.DateTime")); + table.Columns.Add("Duration", Type.GetType("System.String")); + table.Columns.Add("EventID", Type.GetType("System.String")); + table.Columns.Add("Title", Type.GetType("System.String")); + + + foreach (string s in allChannels) + { + if (s != "") + { + string[] allFields = s.Split(' '); + + row = table.NewRow(); + + ActTime = DateTime.Now; + + + StartTime = DateTime.Parse("01.01.1970 01:00"); + StartTime = StartTime.AddSeconds(Convert.ToInt32(allFields[1])); + EndTime = StartTime.AddSeconds(Convert.ToInt32(allFields[2])); + + String title = ""; + + for (int j = 4; j <= allFields.GetUpperBound(0); j++) + { + title = title + allFields[j] + " "; + } + + row["ID"] = allFields[0]; + row["Start"] = StartTime; + row["Stop"] = EndTime; + row["Duration"] = Convert.ToInt32(allFields[2]); + row["EventID"] = allFields[3]; + row["Title"] = title; + + table.Rows.Add(row); + } + } + + ds.Tables.Add(table); + } + catch + { + + } + return ds; + } + } + + public DataSet EPG_Channel + { + get + { + //get actual channel (ID) + Request request = new Request(_Url, _UserName, _Password); + string sreturn = request.PostData(_Command + "zapto"); + sreturn = sreturn.Replace("\n", ""); + string channel = sreturn; + + //Get EPG for channel + sreturn = request.PostData(_Command + "epg?" + channel); + string[] allRows = sreturn.Split('\n'); + + // convert to dataset + DataSet ds = new DataSet(); + DataTable table = new DataTable("EPG"); + DataRow row = null; + + try + { + table.Columns.Add("ID", Type.GetType("System.String")); + table.Columns.Add("Start", Type.GetType("System.DateTime")); + table.Columns.Add("Stop", Type.GetType("System.DateTime")); + table.Columns.Add("Duration", Type.GetType("System.String")); + table.Columns.Add("EventID", Type.GetType("System.String")); + table.Columns.Add("Title", Type.GetType("System.String")); + + foreach (string s in allRows) + { + if (s != "") + { + string[] allFields = s.Split(' '); + + row = table.NewRow(); + + ActTime = DateTime.Now; + + StartTime = DateTime.Parse("01.01.1970 01:00"); + StartTime = StartTime.AddSeconds(Convert.ToInt32(allFields[1])); + EndTime = StartTime.AddSeconds(Convert.ToInt32(allFields[2])); + + String title = ""; + + for (int j = 3; j <= allFields.GetUpperBound(0); j++) + { + title = title + allFields[j] + " "; + } + + row["ID"] = channel; + row["Start"] = StartTime; + row["Stop"] = EndTime; + row["Duration"] = Convert.ToInt32(allFields[2]); + row["EventID"] = allFields[0]; + row["Title"] = title; + + table.Rows.Add(row); + } + } + + ds.Tables.Add(table); + } + catch + { + + } + return ds; + } + } + + } +} + + + Added: trunk/plugins/MyDbox/Source/MyDbox/GuiDbox.cs =================================================================== --- trunk/plugins/MyDbox/Source/MyDbox/GuiDbox.cs (rev 0) +++ trunk/plugins/MyDbox/Source/MyDbox/GuiDbox.cs 2007-03-07 20:33:19 UTC (rev 165) @@ -0,0 +1,181 @@ +#region Copyright (C) 2005-2007 Team MediaPortal + +/* + * Copyright (C) 2005-2007 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.ComponentModel; +using System.Collections.Generic; +using System.Collections.Specialized; +using System.Text; +using System.Text.RegularExpressions; +using MediaPortal.GUI.Library; +using MediaPortal.Player; +using MediaPortal.Dialogs; +using MediaPortal.Configuration; +using MediaPortal.Playlists; +using System.Xml; +using System.IO; +using System.Data; +using MediaPortal.Util; + +namespace MediaPortal.GUI.Mydbox +{ + public class DboxGui : GUIWindow + { + public const int WindowID = 9900; + + #region Constructor + public DboxGui() + { + GetID = (int)MyDboxGui.WindowID; + } + #endregion + + #region SkinControlAttributes + [SkinControlAttribute(50)] + protected GUIFacadeControl facadeview = null; + [SkinControlAttribute(2)] + protected GUIButtonControl btnFavoriet = null; + [SkinControlAttribute(3)] + protected GUIButtonControl btnRadio = null; + [SkinControlAttribute(4)] + protected GUIButtonControl btnRecordings = null; + #endregion + + #region Variables + //private DBox.Core _Dreambox = null; + //PlayListPlayer playlistPlayer; + + // bools + //private bool _ShowChannels = false; + + private static string server; + private static string username; + private static string password; + + private string _Url = ""; + private string _UserName = ""; + private string _Password = ""; + + private static DataTable _TV_Bouquets = null; + //private static DataTable _Radio_Bouquets = null; + + #endregion + + #region Overrides + public override bool Init() + { + //playlistPlayer = PlayListPlayer.SingletonPlayer; + LoadSettings(); + + return Load(GUIGraphicsContext.Skin + @"\mydbox.xml"); + } + + #endregion + + #region Private Methods + void LoadSettings() + { + string path = Path.Combine(Config.GetFolder(Config.Dir.Config), "MediaPortal.xml"); + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(path)) + //using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + { + server = xmlreader.GetValue("mydbox", "IP"); + username = xmlreader.GetValue("mydbox", "UserName"); + password = xmlreader.GetValue("mydbox", "Password"); + } + + ShowBoutiques(); + + } + + void ShowBoutiques() + { + _Url = "http://" + server ; + _UserName = ""; + _Password = ""; + + //_ShowChannels = false; + facadeview.Clear(); + + //get bouquets + Data _DBox = new Data(_Url, _UserName, _Password); + _TV_Bouquets = _DBox.UserTVBouquets.Tables[0]; + + foreach (DataRow row in _TV_Bouquets.Rows) + { + GUIListItem li = new GUIListItem(); + li.Label = row["Name"].ToString(); + facadeview.Add(li); + } + } + void ShowChannels(GUIListItem guiListItem) + { + _Url = "http://192.168.0.100/"; + _UserName = ""; + _Password = ""; + + //_ShowChannels = true; + facadeview.Clear(); + Data _DBox = new Data(_Url, _UserName, _Password); + string reference = GetChannelReference(guiListItem); + //DataTable dt = _DBox.Channels(reference).Tables[0]; + //foreach (DataRow row in dt.Rows) + { + // GUIListItem li = new GUIListItem(); + // li.Label = row["Name"].ToString(); + // facadeview.Add(li); + } + try + { + //string currentChannelName = _Dbox.CurrentChannel.Name; + //GUIPropertyManager.SetProperty("#Play.Current.File", currentChannelName); + //GUIPropertyManager.SetProperty("#Play.Current.Title", currentChannelName); + } + catch (Exception) { } + } + string GetChannelReference(GUIListItem guiListItem) + { + string reference = ""; + Data _DBox = new Data(_Url, _UserName, _Password); + DataTable dt = _DBox.UserTVBouquets.Tables[0]; + foreach (DataRow row in dt.Rows) + { + if (guiListItem.Label == row["Name"].ToString()) + { + reference = row["Ref"].ToString(); + break; + } + } + return reference; + } + #endregion + + + } + + + + +} \ No newline at end of file Added: trunk/plugins/MyDbox/Source/MyDbox/MyDbox.csproj =================================================================== --- trunk/plugins/MyDbox/Source/MyDbox/MyDbox.csproj (rev 0) +++ trunk/plugins/MyDbox/Source/MyDbox/MyDbox.csproj 2007-03-07 20:33:19 UTC (rev 165) @@ -0,0 +1,71 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>8.0.50727</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{F8CC05AA-6306-459E-BD32-40C02489EFEC}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>MyDbox</RootNamespace> + <AssemblyName>MyDbox</AssemblyName> + </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.2593.1921, Culture=neutral, processorArchitecture=MSIL" /> + <Reference Include="Dialogs, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL" /> + <Reference Include="ExternalPlayers, Version=1.0.2604.25450, Culture=neutral, processorArchitecture=MSIL" /> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml" /> + <Reference Include="Utils, Version=1.0.2593.1896, Culture=neutral, processorArchitecture=MSIL" /> + </ItemGroup> + <ItemGroup> + <Compile Include="ChannelInfo.cs" /> + <Compile Include="Data.cs" /> + <Compile Include="DboxSetupForm.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="DboxSetupForm.Designer.cs"> + <DependentUpon>DboxSetupForm.cs</DependentUpon> + </Compile> + <Compile Include="Epg.cs" /> + <Compile Include="MyDboxGui.cs" /> + <Compile Include="MyDboxPlugin.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="Request.cs" /> + <Compile Include="Zap.cs" /> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="DboxSetupForm.resx"> + <SubType>Designer</SubType> + <DependentUpon>DboxSetupForm.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/MyDbox/Source/MyDbox/MyDbox.csproj.user =================================================================== --- trunk/plugins/MyDbox/Source/MyDbox/MyDbox.csproj.user (rev 0) +++ trunk/plugins/MyDbox/Source/MyDbox/MyDbox.csproj.user 2007-03-07 20:33:19 UTC (rev 165) @@ -0,0 +1,5 @@ +<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <ProjectView>ProjectFiles</ProjectView> + </PropertyGroup> +</Project> \ No newline at end of file Added: trunk/plugins/MyDbox/Source/MyDbox/MyDboxGui.cs =================================================================== --- trunk/plugins/MyDbox/Source/MyDbox/MyDboxGui.cs (rev 0) +++ trunk/plugins/MyDbox/Source/MyDbox/MyDboxGui.cs 2007-03-07 20:33:19 UTC (rev 165) @@ -0,0 +1,630 @@ +#region Copyright (C) 2005-2007 Team MediaPortal + +/* + * Copyright (C) 2005-2007 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.ComponentModel; +using System.Collections.Generic; +using System.Collections.Specialized; +using System.Text; +using System.Text.RegularExpressions; +using MediaPortal.GUI.Library; +using MediaPortal.Player; +using MediaPortal.Dialogs; +using MediaPortal.Playlists; +using System.Xml; +using System.IO; +using System.Data; +using System.Drawing; +using MediaPortal.Util; + +namespace MediaPortal.GUI.Mydbox +{ + public class MyDboxGui : GUIWindow + { + #region SkinControlAttributes + [SkinControlAttribute(3)] + protected GUIButtonControl btnRecord = null; + [SkinControlAttribute(6)] + protected GUIButtonControl btnBouquet = null; + [SkinControlAttribute(7)] + protected GUIButtonControl btnChannel = null; + [SkinControlAttribute(8)] + protected GUIToggleButtonControl btnTVOnOff = null; + [SkinControlAttribute(11)] + protected GUIButtonControl btnRecordings = null; + [SkinControlAttribute(13)] + protected GUIButtonControl SelChannel = null; + [SkinControlAttribute(50)] + protected GUIFacadeControl facadeView = null; + [SkinControlAttribute(20)] + protected GUIProgressControl progressBar = null; + [SkinControlAttribute(99)] + protected GUIVideoControl videoWindow = null; + #endregion + + #region Private Variables + + private string _Url = ""; + private string _UserName = ""; + private string _Password = ""; + + private static PlayList playlist = new PlayList(); + + private static string server; + private static string username; + private static string password; + + private static DataTable _TV_Bouquets = null; + //private static DataTable _Radio_Bouquets = null; + private static DataTable _EPG = null; + + private static int ActBouquet = 0; + private static int ActChannelList; + + private static String ActID = ""; + + private static VirtualDirectory recDirectory = new VirtualDirectory(); + private static string vlciptvdir = Directory.GetCurrentDirectory() + @"\vlciptv"; + + private string LogPathName = Directory.GetCurrentDirectory() + @"\log\MyDbox.log"; + + private static OnActionHandler ah; + + #endregion + + #region Private Enumerations + enum Controls + { + BouquetButton = 6, + ChannelButton = 7,... [truncated message content] |
From: <an...@us...> - 2007-03-08 05:17:52
|
Revision: 167 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=167&view=rev Author: and-81 Date: 2007-03-07 21:17:49 -0800 (Wed, 07 Mar 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IgorPlugUSB/IgorPlugUSB.csproj trunk/plugins/MCEReplacement/MCEReplacement.cs trunk/plugins/MessagePlugin/MessagePlugin.cs trunk/plugins/MessagePlugin/MessagePlugin.csproj Added Paths: ----------- trunk/plugins/ComSkipLauncher/ trunk/plugins/ComSkipLauncher/AssemblyInfo.cs trunk/plugins/ComSkipLauncher/ComSkipLauncher.cs trunk/plugins/ComSkipLauncher/ComSkipLauncher.csproj Added: trunk/plugins/ComSkipLauncher/AssemblyInfo.cs =================================================================== --- trunk/plugins/ComSkipLauncher/AssemblyInfo.cs (rev 0) +++ trunk/plugins/ComSkipLauncher/AssemblyInfo.cs 2007-03-08 05:17:49 UTC (rev 167) @@ -0,0 +1,39 @@ +using System; +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("ComSkipLauncher")] +[assembly: AssemblyDescription("Launches ComSkip when a recording completes")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("For MediaPortal")] +[assembly: AssemblyProduct("ComSkipLauncher plugin by and-81")] +[assembly: AssemblyCopyright("Aaron Dinnage")] +[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)] + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion("1.0.2.0")] +[assembly: AssemblyFileVersion("1.0.2.0")] + +[assembly: CLSCompliant(true)] \ No newline at end of file Added: trunk/plugins/ComSkipLauncher/ComSkipLauncher.cs =================================================================== --- trunk/plugins/ComSkipLauncher/ComSkipLauncher.cs (rev 0) +++ trunk/plugins/ComSkipLauncher/ComSkipLauncher.cs 2007-03-08 05:17:49 UTC (rev 167) @@ -0,0 +1,88 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Text; +using System.Windows.Forms; + +using MediaPortal.GUI.Library; +using MediaPortal.TV.Database; +using MediaPortal.TV.Recording; + +namespace MediaPortal.Plugins +{ + + public class ComSkipLauncher : ISetupForm + { + + #region Members + + string _comSkipPath = "C:\\ComSkip\\ComSkip.exe"; + + #endregion Members + + #region IPlugin Members + + public void Start() + { + LoadSettings(); + Recorder.OnTvRecordingEnded += new MediaPortal.TV.Recording.Recorder.OnTvRecordingHandler(Recorder_OnTvRecordingEnded); + } + public void Stop() + { + Recorder.OnTvRecordingEnded -= new MediaPortal.TV.Recording.Recorder.OnTvRecordingHandler(Recorder_OnTvRecordingEnded); + } + + #endregion + + #region ISetupForm Members + + public string Author() { return "and-81"; } + public bool CanEnable() { return true; } + public bool DefaultEnabled() { return true; } + public string Description() { return "Launches ComSkip when a recording completes."; } + public int GetWindowId() { return 0; } + public bool HasSetup() { return true; } + public string PluginName() { return "ComSkip Launcher"; } + + public void ShowPlugin() + { + // TODO: Configuration + } + + public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) + { + strButtonText = strButtonImage = strButtonImageFocus = strPictureImage = ""; + return false; + } + + #endregion + + #region Implementation + + void Recorder_OnTvRecordingEnded(string recordingFilename, TVRecording recording, TVProgram program) + { + Process comskip = new Process(); + comskip.StartInfo = new ProcessStartInfo(); + comskip.StartInfo.Arguments = string.Format("--playnice --zpcut {0}", recordingFilename); + comskip.StartInfo.CreateNoWindow = true; + comskip.StartInfo.FileName = _comSkipPath; + //comskip.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; + comskip.StartInfo.WorkingDirectory = Path.GetDirectoryName(recordingFilename); + + comskip.Start(); + + comskip.WaitForExit(); + } + + void LoadSettings() + { + + } + + + #endregion Implementation + + } + +} Added: trunk/plugins/ComSkipLauncher/ComSkipLauncher.csproj =================================================================== --- trunk/plugins/ComSkipLauncher/ComSkipLauncher.csproj (rev 0) +++ trunk/plugins/ComSkipLauncher/ComSkipLauncher.csproj 2007-03-08 05:17:49 UTC (rev 167) @@ -0,0 +1,69 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>8.0.50727</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{35EE9B81-1774-498E-94A0-0FD47E213FB5}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>MediaPortal.Plugins</RootNamespace> + <AssemblyName>ComSkipLauncher</AssemblyName> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>false</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <UseVSHostingProcess>false</UseVSHostingProcess> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>none</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants> + </DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <UseVSHostingProcess>false</UseVSHostingProcess> + </PropertyGroup> + <ItemGroup> + <Reference Include="Core, Version=1.0.2581.1884, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\MediaPortal\Core\bin\Release\Core.dll</HintPath> + <Private>False</Private> + </Reference> + <Reference Include="Databases, Version=1.0.2623.6915, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\MediaPortal\xbmc\bin\Release\Databases.dll</HintPath> + <Private>False</Private> + </Reference> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml" /> + <Reference Include="TVCapture, Version=1.0.2623.6917, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\MediaPortal\xbmc\bin\Release\TVCapture.dll</HintPath> + <Private>False</Private> + </Reference> + </ItemGroup> + <ItemGroup> + <Compile Include="ComSkipLauncher.cs" /> + <Compile Include="AssemblyInfo.cs" /> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> + <PropertyGroup> + <PostBuildEvent>copy "*.*" "\MediaPortal Development\Plugin Releases\ComSkip Launcher\"</PostBuildEvent> + </PropertyGroup> +</Project> \ No newline at end of file Modified: trunk/plugins/IgorPlugUSB/IgorPlugUSB.csproj =================================================================== --- trunk/plugins/IgorPlugUSB/IgorPlugUSB.csproj 2007-03-07 21:29:28 UTC (rev 166) +++ trunk/plugins/IgorPlugUSB/IgorPlugUSB.csproj 2007-03-08 05:17:49 UTC (rev 167) @@ -5,7 +5,7 @@ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <ProductVersion>8.0.50727</ProductVersion> <SchemaVersion>2.0</SchemaVersion> - <ProjectGuid>{88520E4C-5C49-478A-8AFA-959B45075922}</ProjectGuid> + <ProjectGuid>{2985E855-6D03-4A36-A488-94ACDE7FE286}</ProjectGuid> <OutputType>Library</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>MediaPortal.Plugins</RootNamespace> Modified: trunk/plugins/MCEReplacement/MCEReplacement.cs =================================================================== --- trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-03-07 21:29:28 UTC (rev 166) +++ trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-03-08 05:17:49 UTC (rev 167) @@ -106,8 +106,6 @@ static bool _mpMCERemote; static string _mpSerialUirPort; - SendMessageHandler _sendMessageHandler; - int[] _mceRemoteMap = null; int[] _differentRemoteMap = null; @@ -354,10 +352,7 @@ // Register with MediaPortal to receive GUI Messages ... if (ControlExternalEnabled || EventMapperEnabled) - { - _sendMessageHandler = new SendMessageHandler(OnMessage); - GUIWindowManager.Receivers += _sendMessageHandler; - } + GUIWindowManager.Receivers += new SendMessageHandler(OnMessage); if (LogVerbose) Log.Info("MCEReplacement: Started"); @@ -372,7 +367,7 @@ MapEvent(MappedEvent.MappingEvent.MediaPortal_Stop); if (ControlExternalEnabled || EventMapperEnabled) - GUIWindowManager.Receivers -= _sendMessageHandler; + GUIWindowManager.Receivers -= new SendMessageHandler(OnMessage); _defaultInputHandler = null; Modified: trunk/plugins/MessagePlugin/MessagePlugin.cs =================================================================== --- trunk/plugins/MessagePlugin/MessagePlugin.cs 2007-03-07 21:29:28 UTC (rev 166) +++ trunk/plugins/MessagePlugin/MessagePlugin.cs 2007-03-08 05:17:49 UTC (rev 167) @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Text; - using System.Windows.Forms; using MediaPortal.GUI.Library; Modified: trunk/plugins/MessagePlugin/MessagePlugin.csproj =================================================================== --- trunk/plugins/MessagePlugin/MessagePlugin.csproj 2007-03-07 21:29:28 UTC (rev 166) +++ trunk/plugins/MessagePlugin/MessagePlugin.csproj 2007-03-08 05:17:49 UTC (rev 167) @@ -7,7 +7,7 @@ <ProjectGuid>{31589D6D-5540-413D-8D6B-ACED28727686}</ProjectGuid> <OutputType>Library</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>MessagePlugin</RootNamespace> + <RootNamespace>MediaPortal.Plugins</RootNamespace> <AssemblyName>MessagePlugin</AssemblyName> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-03-11 13:44:58
|
Revision: 181 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=181&view=rev Author: and-81 Date: 2007-03-11 06:44:57 -0700 (Sun, 11 Mar 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ComSkipLauncher TVE2/ComSkipLauncher.cs trunk/plugins/ComSkipLauncher TVE2/Configuration.Designer.cs trunk/plugins/ComSkipLauncher TVE2/Configuration.cs trunk/plugins/ComSkipLauncher TVE2/Configuration.resx trunk/plugins/ComSkipLauncher TVE3/ComSkipLauncher.cs trunk/plugins/ComSkipLauncher TVE3/Configuration.Designer.cs trunk/plugins/ComSkipLauncher TVE3/Configuration.cs trunk/plugins/ComSkipLauncher TVE3/Configuration.resx trunk/plugins/MCEReplacement/Forms/MacroEditor.cs trunk/plugins/MCEReplacement/Forms/SetupForm.cs trunk/plugins/MCEReplacement/InputMapper/InputHandler.cs trunk/plugins/MCEReplacement/MCEReplacement.cs trunk/plugins/MCEReplacementTray/Properties/AssemblyInfo.cs trunk/plugins/TV3ExtChannelChanger/AssemblyInfo.cs Added Paths: ----------- trunk/plugins/ComSkipLauncher TVE2/ trunk/plugins/ComSkipLauncher TVE3/ Removed Paths: ------------- trunk/plugins/ComSkipLauncher/ Copied: trunk/plugins/ComSkipLauncher TVE2 (from rev 180, trunk/plugins/ComSkipLauncher) Modified: trunk/plugins/ComSkipLauncher TVE2/ComSkipLauncher.cs =================================================================== --- trunk/plugins/ComSkipLauncher/ComSkipLauncher.cs 2007-03-11 10:03:18 UTC (rev 180) +++ trunk/plugins/ComSkipLauncher TVE2/ComSkipLauncher.cs 2007-03-11 13:44:57 UTC (rev 181) @@ -22,7 +22,7 @@ public static readonly string MPConfigFile = Config.GetFolder(Config.Dir.Config) + "\\MediaPortal.xml"; public static readonly string DefaultProgram = "C:\\Program Files\\ComSkip\\ComSkip.exe"; - public static readonly string DefaultParameters = "--playnice --zpcut \"{0}\""; + public static readonly string DefaultParameters = "--playnice \"{0}\""; #endregion Constants @@ -79,10 +79,15 @@ { LoadSettings(); - Configuration configuration = new Configuration( - _startProgram, _startParameters, _runAtStart, - _endProgram, _endParameters, _runAtEnd); - + Configuration configuration = new Configuration(); + configuration.RunAtStart = _runAtStart; + configuration.StartProgram = _startProgram; + configuration.StartParameters = _startParameters; + + configuration.RunAtEnd = _runAtEnd; + configuration.EndProgram = _endProgram; + configuration.EndParameters = _endParameters; + if (configuration.ShowDialog() == DialogResult.OK) { _runAtStart = configuration.RunAtStart; @@ -93,7 +98,6 @@ _endProgram = configuration.EndProgram; _endParameters = configuration.EndParameters; - SaveSettings(); } } @@ -200,6 +204,10 @@ xmlwriter.SetValueAsBool("ComSkipLauncher", "RunAtStart", _runAtStart); xmlwriter.SetValue("ComSkipLauncher", "StartProgram", _startProgram); xmlwriter.SetValue("ComSkipLauncher", "StartParameters", _startParameters); + + xmlwriter.SetValueAsBool("ComSkipLauncher", "RunAtEnd", _runAtEnd); + xmlwriter.SetValue("ComSkipLauncher", "EndProgram", _endProgram); + xmlwriter.SetValue("ComSkipLauncher", "EndParameters", _endParameters); } } catch (Exception ex) Modified: trunk/plugins/ComSkipLauncher TVE2/Configuration.Designer.cs =================================================================== --- trunk/plugins/ComSkipLauncher/Configuration.Designer.cs 2007-03-11 10:03:18 UTC (rev 180) +++ trunk/plugins/ComSkipLauncher TVE2/Configuration.Designer.cs 2007-03-11 13:44:57 UTC (rev 181) @@ -68,6 +68,7 @@ // // buttonOK // + this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonOK.Location = new System.Drawing.Point(216, 288); this.buttonOK.Name = "buttonOK"; this.buttonOK.Size = new System.Drawing.Size(56, 24); @@ -78,6 +79,7 @@ // // 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(280, 288); this.buttonCancel.Name = "buttonCancel"; @@ -93,6 +95,7 @@ // // buttonTest // + this.buttonTest.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.buttonTest.Location = new System.Drawing.Point(272, 24); this.buttonTest.Name = "buttonTest"; this.buttonTest.Size = new System.Drawing.Size(48, 20); @@ -104,6 +107,8 @@ // // textBoxTest // + this.textBoxTest.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.textBoxTest.Location = new System.Drawing.Point(8, 24); this.textBoxTest.Name = "textBoxTest"; this.textBoxTest.Size = new System.Drawing.Size(224, 20); @@ -112,6 +117,7 @@ // // buttonFindTestFile // + this.buttonFindTestFile.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.buttonFindTestFile.Location = new System.Drawing.Point(240, 24); this.buttonFindTestFile.Name = "buttonFindTestFile"; this.buttonFindTestFile.Size = new System.Drawing.Size(24, 20); @@ -139,7 +145,6 @@ this.radioButtonStartLaunch.Name = "radioButtonStartLaunch"; this.radioButtonStartLaunch.Size = new System.Drawing.Size(96, 24); this.radioButtonStartLaunch.TabIndex = 1; - this.radioButtonStartLaunch.TabStop = true; this.radioButtonStartLaunch.Text = "Launch:"; this.toolTips.SetToolTip(this.radioButtonStartLaunch, "Launch ComSkip to process the recording after it has finished"); this.radioButtonStartLaunch.UseVisualStyleBackColor = true; @@ -147,18 +152,21 @@ // // textBoxEndParameters // + this.textBoxEndParameters.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.textBoxEndParameters.Location = new System.Drawing.Point(8, 80); this.textBoxEndParameters.Name = "textBoxEndParameters"; this.textBoxEndParameters.Size = new System.Drawing.Size(256, 20); - this.textBoxEndParameters.TabIndex = 6; + this.textBoxEndParameters.TabIndex = 4; this.toolTips.SetToolTip(this.textBoxEndParameters, "Provide command line parameters for the program"); // // buttonEndParameters // + this.buttonEndParameters.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.buttonEndParameters.Location = new System.Drawing.Point(272, 80); this.buttonEndParameters.Name = "buttonEndParameters"; this.buttonEndParameters.Size = new System.Drawing.Size(24, 20); - this.buttonEndParameters.TabIndex = 7; + this.buttonEndParameters.TabIndex = 5; this.buttonEndParameters.Text = "?"; this.toolTips.SetToolTip(this.buttonEndParameters, "Click here for a list of additional command line parameters"); this.buttonEndParameters.UseVisualStyleBackColor = true; @@ -166,10 +174,11 @@ // // buttonEndProgram // + this.buttonEndProgram.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.buttonEndProgram.Location = new System.Drawing.Point(272, 40); this.buttonEndProgram.Name = "buttonEndProgram"; this.buttonEndProgram.Size = new System.Drawing.Size(24, 20); - this.buttonEndProgram.TabIndex = 4; + this.buttonEndProgram.TabIndex = 2; this.buttonEndProgram.Text = "..."; this.toolTips.SetToolTip(this.buttonEndProgram, "Locate the program you wish to launch"); this.buttonEndProgram.UseVisualStyleBackColor = true; @@ -177,14 +186,18 @@ // // textBoxEndProgram // + this.textBoxEndProgram.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.textBoxEndProgram.Location = new System.Drawing.Point(8, 40); this.textBoxEndProgram.Name = "textBoxEndProgram"; this.textBoxEndProgram.Size = new System.Drawing.Size(256, 20); - this.textBoxEndProgram.TabIndex = 3; + this.textBoxEndProgram.TabIndex = 1; this.toolTips.SetToolTip(this.textBoxEndProgram, "The full location of the program to launch"); // // textBoxStartParameters // + this.textBoxStartParameters.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.textBoxStartParameters.Location = new System.Drawing.Point(8, 80); this.textBoxStartParameters.Name = "textBoxStartParameters"; this.textBoxStartParameters.Size = new System.Drawing.Size(256, 20); @@ -193,6 +206,7 @@ // // buttonStartParameters // + this.buttonStartParameters.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.buttonStartParameters.Location = new System.Drawing.Point(272, 80); this.buttonStartParameters.Name = "buttonStartParameters"; this.buttonStartParameters.Size = new System.Drawing.Size(24, 20); @@ -204,6 +218,7 @@ // // buttonStartProgram // + this.buttonStartProgram.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.buttonStartProgram.Location = new System.Drawing.Point(272, 40); this.buttonStartProgram.Name = "buttonStartProgram"; this.buttonStartProgram.Size = new System.Drawing.Size(24, 20); @@ -215,6 +230,8 @@ // // textBoxStartProgram // + this.textBoxStartProgram.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.textBoxStartProgram.Location = new System.Drawing.Point(8, 40); this.textBoxStartProgram.Name = "textBoxStartProgram"; this.textBoxStartProgram.Size = new System.Drawing.Size(256, 20); @@ -237,13 +254,15 @@ this.radioButtonEndLaunch.Name = "radioButtonEndLaunch"; this.radioButtonEndLaunch.Size = new System.Drawing.Size(96, 24); this.radioButtonEndLaunch.TabIndex = 1; - this.radioButtonEndLaunch.TabStop = true; this.radioButtonEndLaunch.Text = "Launch:"; this.radioButtonEndLaunch.UseVisualStyleBackColor = true; this.radioButtonEndLaunch.CheckedChanged += new System.EventHandler(this.radioButtonEndLaunch_CheckedChanged); // // tabControl // + this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.tabControl.Controls.Add(this.tabPageStart); this.tabControl.Controls.Add(this.tabPageEnd); this.tabControl.Location = new System.Drawing.Point(8, 8); @@ -262,11 +281,14 @@ this.tabPageStart.Padding = new System.Windows.Forms.Padding(3); this.tabPageStart.Size = new System.Drawing.Size(320, 182); this.tabPageStart.TabIndex = 0; - this.tabPageStart.Text = "When recording starts"; + this.tabPageStart.Text = "When recording starts ..."; this.tabPageStart.UseVisualStyleBackColor = true; // // groupBoxStartProgram // + this.groupBoxStartProgram.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.groupBoxStartProgram.Controls.Add(this.labelStartParameters); this.groupBoxStartProgram.Controls.Add(this.textBoxStartParameters); this.groupBoxStartProgram.Controls.Add(this.buttonStartParameters); @@ -282,6 +304,8 @@ // // labelStartParameters // + this.labelStartParameters.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.labelStartParameters.Location = new System.Drawing.Point(8, 64); this.labelStartParameters.Name = "labelStartParameters"; this.labelStartParameters.Size = new System.Drawing.Size(256, 16); @@ -291,6 +315,8 @@ // // labelStartProgram // + this.labelStartProgram.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.labelStartProgram.Location = new System.Drawing.Point(8, 24); this.labelStartProgram.Name = "labelStartProgram"; this.labelStartProgram.Size = new System.Drawing.Size(256, 16); @@ -308,11 +334,14 @@ this.tabPageEnd.Padding = new System.Windows.Forms.Padding(3); this.tabPageEnd.Size = new System.Drawing.Size(320, 182); this.tabPageEnd.TabIndex = 1; - this.tabPageEnd.Text = "When recording ends"; + this.tabPageEnd.Text = "When recording ends ..."; this.tabPageEnd.UseVisualStyleBackColor = true; // // groupBoxEndProgram // + this.groupBoxEndProgram.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.groupBoxEndProgram.Controls.Add(this.labelEndParameters); this.groupBoxEndProgram.Controls.Add(this.textBoxEndParameters); this.groupBoxEndProgram.Controls.Add(this.buttonEndParameters); @@ -322,30 +351,36 @@ this.groupBoxEndProgram.Location = new System.Drawing.Point(8, 64); this.groupBoxEndProgram.Name = "groupBoxEndProgram"; this.groupBoxEndProgram.Size = new System.Drawing.Size(304, 112); - this.groupBoxEndProgram.TabIndex = 8; + this.groupBoxEndProgram.TabIndex = 2; this.groupBoxEndProgram.TabStop = false; this.groupBoxEndProgram.Text = "What to do"; // // labelEndParameters // + this.labelEndParameters.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.labelEndParameters.Location = new System.Drawing.Point(8, 64); this.labelEndParameters.Name = "labelEndParameters"; this.labelEndParameters.Size = new System.Drawing.Size(256, 16); - this.labelEndParameters.TabIndex = 5; + this.labelEndParameters.TabIndex = 3; this.labelEndParameters.Text = "Parameters:"; this.labelEndParameters.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // labelEndProgram // + this.labelEndProgram.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.labelEndProgram.Location = new System.Drawing.Point(8, 24); this.labelEndProgram.Name = "labelEndProgram"; this.labelEndProgram.Size = new System.Drawing.Size(256, 16); - this.labelEndProgram.TabIndex = 2; + this.labelEndProgram.TabIndex = 0; this.labelEndProgram.Text = "Program:"; this.labelEndProgram.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // groupBoxTest // + this.groupBoxTest.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.groupBoxTest.Controls.Add(this.textBoxTest); this.groupBoxTest.Controls.Add(this.buttonTest); this.groupBoxTest.Controls.Add(this.buttonFindTestFile); @@ -356,7 +391,7 @@ this.groupBoxTest.TabStop = false; this.groupBoxTest.Text = "Test"; // - // ExternalProgram + // Configuration // this.AcceptButton = this.buttonOK; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -370,7 +405,7 @@ this.MaximizeBox = false; this.MinimizeBox = false; this.MinimumSize = new System.Drawing.Size(360, 356); - this.Name = "ExternalProgram"; + this.Name = "Configuration"; this.ShowIcon = false; this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; Modified: trunk/plugins/ComSkipLauncher TVE2/Configuration.cs =================================================================== --- trunk/plugins/ComSkipLauncher/Configuration.cs 2007-03-11 10:03:18 UTC (rev 180) +++ trunk/plugins/ComSkipLauncher TVE2/Configuration.cs 2007-03-11 13:44:57 UTC (rev 181) @@ -32,50 +32,58 @@ public bool RunAtStart { - get { return radioButtonStartLaunch.Checked; } - set { radioButtonStartLaunch.Checked = value; } + get + { + return radioButtonStartLaunch.Checked; + } + set + { + radioButtonStartLaunch.Checked = value; + radioButtonStartDoNothing.Checked = !value; + } } public bool RunAtEnd { - get { return radioButtonEndLaunch.Checked; } - set { radioButtonEndLaunch.Checked = value; } + get + { + return radioButtonEndLaunch.Checked; + } + set + { + radioButtonEndLaunch.Checked = value; + radioButtonEndDoNothing.Checked = !value; + } } public string StartProgram { get { return textBoxStartProgram.Text; } + set { textBoxStartProgram.Text = value; } } public string StartParameters { get { return textBoxStartParameters.Text; } + set { textBoxStartParameters.Text = value; } } public string EndProgram { get { return textBoxEndProgram.Text; } + set { textBoxEndProgram.Text = value; } } public string EndParameters { get { return textBoxEndParameters.Text; } + set { textBoxEndParameters.Text = value; } } #endregion Properties #region Constructors - public Configuration( - string startProgram, string startParameters, bool runAtStart, - string endProgram, string endParameters, bool runAtEnd) + public Configuration() { InitializeComponent(); - - radioButtonStartLaunch.Checked = runAtStart; - textBoxStartProgram.Text = startProgram; - textBoxStartParameters.Text = startParameters; - - radioButtonEndLaunch.Checked = runAtEnd; - textBoxEndProgram.Text = endProgram; - textBoxEndParameters.Text = endParameters; } #endregion Constructors @@ -85,7 +93,6 @@ this.DialogResult = DialogResult.OK; this.Close(); } - private void buttonCancel_Click(object sender, EventArgs e) { this.DialogResult = DialogResult.Cancel; Modified: trunk/plugins/ComSkipLauncher TVE2/Configuration.resx =================================================================== --- trunk/plugins/ComSkipLauncher/Configuration.resx 2007-03-11 10:03:18 UTC (rev 180) +++ trunk/plugins/ComSkipLauncher TVE2/Configuration.resx 2007-03-11 13:44:57 UTC (rev 181) @@ -123,7 +123,4 @@ <metadata name="toolTips.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>150, 17</value> </metadata> - <metadata name="toolTips.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> - <value>150, 17</value> - </metadata> </root> \ No newline at end of file Copied: trunk/plugins/ComSkipLauncher TVE3 (from rev 180, trunk/plugins/ComSkipLauncher) Modified: trunk/plugins/ComSkipLauncher TVE3/ComSkipLauncher.cs =================================================================== --- trunk/plugins/ComSkipLauncher/ComSkipLauncher.cs 2007-03-11 10:03:18 UTC (rev 180) +++ trunk/plugins/ComSkipLauncher TVE3/ComSkipLauncher.cs 2007-03-11 13:44:57 UTC (rev 181) @@ -22,7 +22,7 @@ public static readonly string MPConfigFile = Config.GetFolder(Config.Dir.Config) + "\\MediaPortal.xml"; public static readonly string DefaultProgram = "C:\\Program Files\\ComSkip\\ComSkip.exe"; - public static readonly string DefaultParameters = "--playnice --zpcut \"{0}\""; + public static readonly string DefaultParameters = "--playnice \"{0}\""; #endregion Constants @@ -79,10 +79,15 @@ { LoadSettings(); - Configuration configuration = new Configuration( - _startProgram, _startParameters, _runAtStart, - _endProgram, _endParameters, _runAtEnd); - + Configuration configuration = new Configuration(); + configuration.RunAtStart = _runAtStart; + configuration.StartProgram = _startProgram; + configuration.StartParameters = _startParameters; + + configuration.RunAtEnd = _runAtEnd; + configuration.EndProgram = _endProgram; + configuration.EndParameters = _endParameters; + if (configuration.ShowDialog() == DialogResult.OK) { _runAtStart = configuration.RunAtStart; @@ -93,7 +98,6 @@ _endProgram = configuration.EndProgram; _endParameters = configuration.EndParameters; - SaveSettings(); } } @@ -200,6 +204,10 @@ xmlwriter.SetValueAsBool("ComSkipLauncher", "RunAtStart", _runAtStart); xmlwriter.SetValue("ComSkipLauncher", "StartProgram", _startProgram); xmlwriter.SetValue("ComSkipLauncher", "StartParameters", _startParameters); + + xmlwriter.SetValueAsBool("ComSkipLauncher", "RunAtEnd", _runAtEnd); + xmlwriter.SetValue("ComSkipLauncher", "EndProgram", _endProgram); + xmlwriter.SetValue("ComSkipLauncher", "EndParameters", _endParameters); } } catch (Exception ex) Modified: trunk/plugins/ComSkipLauncher TVE3/Configuration.Designer.cs =================================================================== --- trunk/plugins/ComSkipLauncher/Configuration.Designer.cs 2007-03-11 10:03:18 UTC (rev 180) +++ trunk/plugins/ComSkipLauncher TVE3/Configuration.Designer.cs 2007-03-11 13:44:57 UTC (rev 181) @@ -68,6 +68,7 @@ // // buttonOK // + this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonOK.Location = new System.Drawing.Point(216, 288); this.buttonOK.Name = "buttonOK"; this.buttonOK.Size = new System.Drawing.Size(56, 24); @@ -78,6 +79,7 @@ // // 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(280, 288); this.buttonCancel.Name = "buttonCancel"; @@ -93,6 +95,7 @@ // // buttonTest // + this.buttonTest.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.buttonTest.Location = new System.Drawing.Point(272, 24); this.buttonTest.Name = "buttonTest"; this.buttonTest.Size = new System.Drawing.Size(48, 20); @@ -104,6 +107,8 @@ // // textBoxTest // + this.textBoxTest.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.textBoxTest.Location = new System.Drawing.Point(8, 24); this.textBoxTest.Name = "textBoxTest"; this.textBoxTest.Size = new System.Drawing.Size(224, 20); @@ -112,6 +117,7 @@ // // buttonFindTestFile // + this.buttonFindTestFile.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.buttonFindTestFile.Location = new System.Drawing.Point(240, 24); this.buttonFindTestFile.Name = "buttonFindTestFile"; this.buttonFindTestFile.Size = new System.Drawing.Size(24, 20); @@ -139,7 +145,6 @@ this.radioButtonStartLaunch.Name = "radioButtonStartLaunch"; this.radioButtonStartLaunch.Size = new System.Drawing.Size(96, 24); this.radioButtonStartLaunch.TabIndex = 1; - this.radioButtonStartLaunch.TabStop = true; this.radioButtonStartLaunch.Text = "Launch:"; this.toolTips.SetToolTip(this.radioButtonStartLaunch, "Launch ComSkip to process the recording after it has finished"); this.radioButtonStartLaunch.UseVisualStyleBackColor = true; @@ -147,18 +152,21 @@ // // textBoxEndParameters // + this.textBoxEndParameters.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.textBoxEndParameters.Location = new System.Drawing.Point(8, 80); this.textBoxEndParameters.Name = "textBoxEndParameters"; this.textBoxEndParameters.Size = new System.Drawing.Size(256, 20); - this.textBoxEndParameters.TabIndex = 6; + this.textBoxEndParameters.TabIndex = 4; this.toolTips.SetToolTip(this.textBoxEndParameters, "Provide command line parameters for the program"); // // buttonEndParameters // + this.buttonEndParameters.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.buttonEndParameters.Location = new System.Drawing.Point(272, 80); this.buttonEndParameters.Name = "buttonEndParameters"; this.buttonEndParameters.Size = new System.Drawing.Size(24, 20); - this.buttonEndParameters.TabIndex = 7; + this.buttonEndParameters.TabIndex = 5; this.buttonEndParameters.Text = "?"; this.toolTips.SetToolTip(this.buttonEndParameters, "Click here for a list of additional command line parameters"); this.buttonEndParameters.UseVisualStyleBackColor = true; @@ -166,10 +174,11 @@ // // buttonEndProgram // + this.buttonEndProgram.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.buttonEndProgram.Location = new System.Drawing.Point(272, 40); this.buttonEndProgram.Name = "buttonEndProgram"; this.buttonEndProgram.Size = new System.Drawing.Size(24, 20); - this.buttonEndProgram.TabIndex = 4; + this.buttonEndProgram.TabIndex = 2; this.buttonEndProgram.Text = "..."; this.toolTips.SetToolTip(this.buttonEndProgram, "Locate the program you wish to launch"); this.buttonEndProgram.UseVisualStyleBackColor = true; @@ -177,14 +186,18 @@ // // textBoxEndProgram // + this.textBoxEndProgram.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.textBoxEndProgram.Location = new System.Drawing.Point(8, 40); this.textBoxEndProgram.Name = "textBoxEndProgram"; this.textBoxEndProgram.Size = new System.Drawing.Size(256, 20); - this.textBoxEndProgram.TabIndex = 3; + this.textBoxEndProgram.TabIndex = 1; this.toolTips.SetToolTip(this.textBoxEndProgram, "The full location of the program to launch"); // // textBoxStartParameters // + this.textBoxStartParameters.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.textBoxStartParameters.Location = new System.Drawing.Point(8, 80); this.textBoxStartParameters.Name = "textBoxStartParameters"; this.textBoxStartParameters.Size = new System.Drawing.Size(256, 20); @@ -193,6 +206,7 @@ // // buttonStartParameters // + this.buttonStartParameters.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.buttonStartParameters.Location = new System.Drawing.Point(272, 80); this.buttonStartParameters.Name = "buttonStartParameters"; this.buttonStartParameters.Size = new System.Drawing.Size(24, 20); @@ -204,6 +218,7 @@ // // buttonStartProgram // + this.buttonStartProgram.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.buttonStartProgram.Location = new System.Drawing.Point(272, 40); this.buttonStartProgram.Name = "buttonStartProgram"; this.buttonStartProgram.Size = new System.Drawing.Size(24, 20); @@ -215,6 +230,8 @@ // // textBoxStartProgram // + this.textBoxStartProgram.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.textBoxStartProgram.Location = new System.Drawing.Point(8, 40); this.textBoxStartProgram.Name = "textBoxStartProgram"; this.textBoxStartProgram.Size = new System.Drawing.Size(256, 20); @@ -237,13 +254,15 @@ this.radioButtonEndLaunch.Name = "radioButtonEndLaunch"; this.radioButtonEndLaunch.Size = new System.Drawing.Size(96, 24); this.radioButtonEndLaunch.TabIndex = 1; - this.radioButtonEndLaunch.TabStop = true; this.radioButtonEndLaunch.Text = "Launch:"; this.radioButtonEndLaunch.UseVisualStyleBackColor = true; this.radioButtonEndLaunch.CheckedChanged += new System.EventHandler(this.radioButtonEndLaunch_CheckedChanged); // // tabControl // + this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.tabControl.Controls.Add(this.tabPageStart); this.tabControl.Controls.Add(this.tabPageEnd); this.tabControl.Location = new System.Drawing.Point(8, 8); @@ -262,11 +281,14 @@ this.tabPageStart.Padding = new System.Windows.Forms.Padding(3); this.tabPageStart.Size = new System.Drawing.Size(320, 182); this.tabPageStart.TabIndex = 0; - this.tabPageStart.Text = "When recording starts"; + this.tabPageStart.Text = "When recording starts ..."; this.tabPageStart.UseVisualStyleBackColor = true; // // groupBoxStartProgram // + this.groupBoxStartProgram.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.groupBoxStartProgram.Controls.Add(this.labelStartParameters); this.groupBoxStartProgram.Controls.Add(this.textBoxStartParameters); this.groupBoxStartProgram.Controls.Add(this.buttonStartParameters); @@ -282,6 +304,8 @@ // // labelStartParameters // + this.labelStartParameters.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.labelStartParameters.Location = new System.Drawing.Point(8, 64); this.labelStartParameters.Name = "labelStartParameters"; this.labelStartParameters.Size = new System.Drawing.Size(256, 16); @@ -291,6 +315,8 @@ // // labelStartProgram // + this.labelStartProgram.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.labelStartProgram.Location = new System.Drawing.Point(8, 24); this.labelStartProgram.Name = "labelStartProgram"; this.labelStartProgram.Size = new System.Drawing.Size(256, 16); @@ -308,11 +334,14 @@ this.tabPageEnd.Padding = new System.Windows.Forms.Padding(3); this.tabPageEnd.Size = new System.Drawing.Size(320, 182); this.tabPageEnd.TabIndex = 1; - this.tabPageEnd.Text = "When recording ends"; + this.tabPageEnd.Text = "When recording ends ..."; this.tabPageEnd.UseVisualStyleBackColor = true; // // groupBoxEndProgram // + this.groupBoxEndProgram.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.groupBoxEndProgram.Controls.Add(this.labelEndParameters); this.groupBoxEndProgram.Controls.Add(this.textBoxEndParameters); this.groupBoxEndProgram.Controls.Add(this.buttonEndParameters); @@ -322,30 +351,36 @@ this.groupBoxEndProgram.Location = new System.Drawing.Point(8, 64); this.groupBoxEndProgram.Name = "groupBoxEndProgram"; this.groupBoxEndProgram.Size = new System.Drawing.Size(304, 112); - this.groupBoxEndProgram.TabIndex = 8; + this.groupBoxEndProgram.TabIndex = 2; this.groupBoxEndProgram.TabStop = false; this.groupBoxEndProgram.Text = "What to do"; // // labelEndParameters // + this.labelEndParameters.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.labelEndParameters.Location = new System.Drawing.Point(8, 64); this.labelEndParameters.Name = "labelEndParameters"; this.labelEndParameters.Size = new System.Drawing.Size(256, 16); - this.labelEndParameters.TabIndex = 5; + this.labelEndParameters.TabIndex = 3; this.labelEndParameters.Text = "Parameters:"; this.labelEndParameters.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // labelEndProgram // + this.labelEndProgram.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.labelEndProgram.Location = new System.Drawing.Point(8, 24); this.labelEndProgram.Name = "labelEndProgram"; this.labelEndProgram.Size = new System.Drawing.Size(256, 16); - this.labelEndProgram.TabIndex = 2; + this.labelEndProgram.TabIndex = 0; this.labelEndProgram.Text = "Program:"; this.labelEndProgram.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // groupBoxTest // + this.groupBoxTest.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.groupBoxTest.Controls.Add(this.textBoxTest); this.groupBoxTest.Controls.Add(this.buttonTest); this.groupBoxTest.Controls.Add(this.buttonFindTestFile); @@ -356,7 +391,7 @@ this.groupBoxTest.TabStop = false; this.groupBoxTest.Text = "Test"; // - // ExternalProgram + // Configuration // this.AcceptButton = this.buttonOK; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -370,7 +405,7 @@ this.MaximizeBox = false; this.MinimizeBox = false; this.MinimumSize = new System.Drawing.Size(360, 356); - this.Name = "ExternalProgram"; + this.Name = "Configuration"; this.ShowIcon = false; this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; Modified: trunk/plugins/ComSkipLauncher TVE3/Configuration.cs =================================================================== --- trunk/plugins/ComSkipLauncher/Configuration.cs 2007-03-11 10:03:18 UTC (rev 180) +++ trunk/plugins/ComSkipLauncher TVE3/Configuration.cs 2007-03-11 13:44:57 UTC (rev 181) @@ -32,50 +32,58 @@ public bool RunAtStart { - get { return radioButtonStartLaunch.Checked; } - set { radioButtonStartLaunch.Checked = value; } + get + { + return radioButtonStartLaunch.Checked; + } + set + { + radioButtonStartLaunch.Checked = value; + radioButtonStartDoNothing.Checked = !value; + } } public bool RunAtEnd { - get { return radioButtonEndLaunch.Checked; } - set { radioButtonEndLaunch.Checked = value; } + get + { + return radioButtonEndLaunch.Checked; + } + set + { + radioButtonEndLaunch.Checked = value; + radioButtonEndDoNothing.Checked = !value; + } } public string StartProgram { get { return textBoxStartProgram.Text; } + set { textBoxStartProgram.Text = value; } } public string StartParameters { get { return textBoxStartParameters.Text; } + set { textBoxStartParameters.Text = value; } } public string EndProgram { get { return textBoxEndProgram.Text; } + set { textBoxEndProgram.Text = value; } } public string EndParameters { get { return textBoxEndParameters.Text; } + set { textBoxEndParameters.Text = value; } } #endregion Properties #region Constructors - public Configuration( - string startProgram, string startParameters, bool runAtStart, - string endProgram, string endParameters, bool runAtEnd) + public Configuration() { InitializeComponent(); - - radioButtonStartLaunch.Checked = runAtStart; - textBoxStartProgram.Text = startProgram; - textBoxStartParameters.Text = startParameters; - - radioButtonEndLaunch.Checked = runAtEnd; - textBoxEndProgram.Text = endProgram; - textBoxEndParameters.Text = endParameters; } #endregion Constructors @@ -85,7 +93,6 @@ this.DialogResult = DialogResult.OK; this.Close(); } - private void buttonCancel_Click(object sender, EventArgs e) { this.DialogResult = DialogResult.Cancel; Modified: trunk/plugins/ComSkipLauncher TVE3/Configuration.resx =================================================================== --- trunk/plugins/ComSkipLauncher/Configuration.resx 2007-03-11 10:03:18 UTC (rev 180) +++ trunk/plugins/ComSkipLauncher TVE3/Configuration.resx 2007-03-11 13:44:57 UTC (rev 181) @@ -123,7 +123,4 @@ <metadata name="toolTips.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>150, 17</value> </metadata> - <metadata name="toolTips.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> - <value>150, 17</value> - </metadata> </root> \ No newline at end of file Modified: trunk/plugins/MCEReplacement/Forms/MacroEditor.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/MacroEditor.cs 2007-03-11 10:03:18 UTC (rev 180) +++ trunk/plugins/MCEReplacement/Forms/MacroEditor.cs 2007-03-11 13:44:57 UTC (rev 181) @@ -18,6 +18,25 @@ public partial class MacroEditor : Form { + #region Constants + + public const string RunProgramText = "Run Program"; + public const string PauseText = "Pause"; + public const string SerialCommandText = "Serial Command"; + public const string MessageCommandText = "Message Command"; + public const string KeystrokesCommandText = "Keystrokes Command"; + public const string GoToScreenText = "Go To Screen"; + public const string PopupMessageText = "Popup Message"; + public const string ForceBlasterPortText = "Force Blaster Port"; + public const string ForceBlasterSpeedText = "Force Blaster Speed"; + public const string SetMultiMappingText = "Set Multi-Mapping"; + public const string SetMouseModeText = "Set Mouse Mode"; + public const string ToggleInputLayerText = "Toggle Input Handler Layer"; + public const string ChangeWindowStateText = "Change Window State"; + public const string GetFocusText = "Get Focus"; + + #endregion Constants + #region Variables MceIrApi.BlasterPort _blastPort; @@ -47,15 +66,20 @@ { comboBoxCommands.Items.Clear(); - comboBoxCommands.Items.Add("Run Program"); - comboBoxCommands.Items.Add("Pause"); - comboBoxCommands.Items.Add("Serial Command"); - comboBoxCommands.Items.Add("Message Command"); - comboBoxCommands.Items.Add("Keystrokes Command"); - comboBoxCommands.Items.Add("Go To Screen"); - comboBoxCommands.Items.Add("Popup Message"); - comboBoxCommands.Items.Add("Force Blaster Port"); - comboBoxCommands.Items.Add("Force Blaster Speed"); + comboBoxCommands.Items.Add(RunProgramText); + comboBoxCommands.Items.Add(PauseText); + comboBoxCommands.Items.Add(SerialCommandText); + comboBoxCommands.Items.Add(MessageCommandText); + comboBoxCommands.Items.Add(KeystrokesCommandText); + comboBoxCommands.Items.Add(GoToScreenText); + comboBoxCommands.Items.Add(PopupMessageText); + comboBoxCommands.Items.Add(ForceBlasterPortText); + comboBoxCommands.Items.Add(ForceBlasterSpeedText); + comboBoxCommands.Items.Add(SetMultiMappingText); + comboBoxCommands.Items.Add(SetMouseModeText); + comboBoxCommands.Items.Add(ToggleInputLayerText); + comboBoxCommands.Items.Add(ChangeWindowStateText); + comboBoxCommands.Items.Add(GetFocusText); comboBoxCommands.Items.AddRange(MCEReplacement.GetIRList()); } @@ -129,6 +153,31 @@ writer.WriteAttributeString("command", "SPEED"); writer.WriteAttributeString("cmdproperty", item.Substring(MCEReplacement.SpeedCommandPrefix.Length)); } + else if (item.StartsWith(MCEReplacement.SetMapCommandPrefix)) + { + writer.WriteAttributeString("command", "MULTI_MAPPING"); + writer.WriteAttributeString("cmdproperty", item.Substring(MCEReplacement.ChangeMMCommandPrefix.Length)); + } + else if (item.StartsWith(MCEReplacement.SetMouseCommandPrefix)) + { + writer.WriteAttributeString("command", "MOUSE_MODE"); + writer.WriteAttributeString("cmdproperty", item.Substring(MCEReplacement.SetMouseCommandPrefix.Length)); + } + else if (item.StartsWith(MCEReplacement.InputLayerCommand)) + { + writer.WriteAttributeString("command", "INPUT_LAYER"); + writer.WriteAttributeString("cmdproperty", "TOGGLE"); + } + else if (item.StartsWith(MCEReplacement.WindowStateCommand)) + { + writer.WriteAttributeString("command", "WINDOW_STATE"); + writer.WriteAttributeString("cmdproperty", "TOGGLE"); + } + else if (item.StartsWith(MCEReplacement.GetFocusCommand)) + { + writer.WriteAttributeString("command", "GET_FOCUS"); + writer.WriteAttributeString("cmdproperty", ""); + } writer.WriteEndElement(); } @@ -204,6 +253,26 @@ case "SPEED": listBoxMacro.Items.Add(MCEReplacement.SpeedCommandPrefix + commandProperty); break; + + case "MULTI_MAPPING": + listBoxMacro.Items.Add(MCEReplacement.SetMapCommandPrefix + commandProperty); + break; + + case "MOUSE_MODE": + listBoxMacro.Items.Add(MCEReplacement.SetMouseCommandPrefix + commandProperty); + break; + + case "INPUT_LAYER": + listBoxMacro.Items.Add(MCEReplacement.InputLayerCommand); + break; + + case "WINDOW_STATE": + listBoxMacro.Items.Add(MCEReplacement.WindowStateCommand); + break; + + case "GET_FOCUS": + listBoxMacro.Items.Add(MCEReplacement.GetFocusCommand); + break; } } } @@ -228,7 +297,7 @@ string selected = (string)comboBoxCommands.SelectedItem; - if (selected == "Run Program") + if (selected == RunProgramText) { ExternalProgram externalProgram = new ExternalProgram(); @@ -237,7 +306,7 @@ listBoxMacro.Items.Add(MCEReplacement.RunCommandPrefix + externalProgram.CommandString); } - else if (selected == "Pause") + else if (selected == PauseText) { PauseTime pauseTime = new PauseTime(); @@ -246,7 +315,7 @@ listBoxMacro.Items.Add(MCEReplacement.PauseCommandPrefix + pauseTime.Time.ToString()); } - else if (selected == "Serial Command") + else if (selected == SerialCommandText) { SerialCommand serialCommand = new SerialCommand(); if (serialCommand.ShowDialog(this) == DialogResult.Cancel) @@ -254,7 +323,7 @@ listBoxMacro.Items.Add(MCEReplacement.SerialCommandPrefix + serialCommand.CommandString); } - else if (selected == "Message Command") + else if (selected == MessageCommandText) { MessageCommand messageCommand = new MessageCommand(); if (messageCommand.ShowDialog(this) == DialogResult.Cancel) @@ -262,7 +331,7 @@ listBoxMacro.Items.Add(MCEReplacement.MessageCommandPrefix + messageCommand.CommandString); } - else if (selected == "Keystrokes Command") + else if (selected == KeystrokesCommandText) { KeysCommand keysCommand = new KeysCommand(); if (keysCommand.ShowDialog(this) == DialogResult.Cancel) @@ -270,7 +339,7 @@ listBoxMacro.Items.Add(MCEReplacement.KeyCommandPrefix + keysCommand.CommandString); } - else if (selected == "Go To Screen") + else if (selected == GoToScreenText) { GoToScreen goToScreen = new GoToScreen(); if (goToScreen.ShowDialog(this) == DialogResult.Cancel) @@ -278,7 +347,7 @@ listBoxMacro.Items.Add(MCEReplacement.GoToCommandPrefix + goToScreen.Screen); } - else if (selected == "Popup Message") + else if (selected == PopupMessageText) { PopupMessage popupMessage = new PopupMessage(); if (popupMessage.ShowDialog(this) == DialogResult.Cancel) @@ -286,7 +355,7 @@ listBoxMacro.Items.Add(MCEReplacement.PopupCommandPrefix + popupMessage.CommandString); } - else if (selected == "Force Blaster Port") + else if (selected == ForceBlasterPortText) { SelectBlasterPort selectBlasterPort = new SelectBlasterPort(_blastPort); if (selectBlasterPort.ShowDialog(this) == DialogResult.Cancel) @@ -294,7 +363,7 @@ listBoxMacro.Items.Add(MCEReplacement.PortCommandPrefix + selectBlasterPort.CommandString); } - else if (selected == "Force Blaster Speed") + else if (selected == ForceBlasterSpeedText) { SelectBlasterSpeed selectBlasterSpeed = new SelectBlasterSpeed(_blastSpeed); if (selectBlasterSpeed.ShowDialog(this) == DialogResult.Cancel) @@ -302,6 +371,34 @@ listBoxMacro.Items.Add(MCEReplacement.SpeedCommandPrefix + selectBlasterSpeed.CommandString); } + else if (selected == SetMultiMappingText) + { + //SelectBlasterSpeed selectBlasterSpeed = new SelectBlasterSpeed(_blastSpeed); + //if (selectBlasterSpeed.ShowDialog(this) == DialogResult.Cancel) + //return; + + listBoxMacro.Items.Add(MCEReplacement.SetMapCommandPrefix + ""); + } + else if (selected == SetMouseModeText) + { + //SelectBlasterSpeed selectBlasterSpeed = new SelectBlasterSpeed(_blastSpeed); + //if (selectBlasterSpeed.ShowDialog(this) == DialogResult.Cancel) + //return; + + listBoxMacro.Items.Add(MCEReplacement.SetMouseCommandPrefix + "TOGGLE"); + } + else if (selected == ToggleInputLayerText) + { + listBoxMacro.Items.Add(MCEReplacement.InputLayerCommand); + } + else if (selected == ChangeWindowStateText) + { + listBoxMacro.Items.Add(MCEReplacement.WindowStateCommand); + } + else if (selected == GetFocusText) + { + listBoxMacro.Items.Add(MCEReplacement.GetFocusCommand); + } else { listBoxMacro.Items.Add(MCEReplacement.BlastCommandPrefix + selected); Modified: trunk/plugins/MCEReplacement/Forms/SetupForm.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/SetupForm.cs 2007-03-11 10:03:18 UTC (rev 180) +++ trunk/plugins/MCEReplacement/Forms/SetupForm.cs 2007-03-11 13:44:57 UTC (rev 181) @@ -86,12 +86,8 @@ numericUpDownButtonHeldDelay.Value = new Decimal(MCEReplacement.ButtonHeldDelay); // Multi-Mapping ... - foreach (string button in Enum.GetNames(typeof(RemoteButton))) - if (button != "None") - comboBoxMultiButton.Items.Add(button); - + comboBoxMultiButton.Items.AddRange(Enum.GetNames(typeof(RemoteButton))); comboBoxMultiButton.SelectedItem = Enum.GetName(typeof(RemoteButton), MCEReplacement.MultiMappingButton); - foreach (string map in MCEReplacement.MultiMaps) listBoxMappings.Items.Add(map); Modified: trunk/plugins/MCEReplacement/InputMapper/InputHandler.cs =================================================================== --- trunk/plugins/MCEReplacement/InputMapper/InputHandler.cs 2007-03-11 10:03:18 UTC (rev 180) +++ trunk/plugins/MCEReplacement/InputMapper/InputHandler.cs 2007-03-11 13:44:57 UTC (rev 181) @@ -58,7 +58,11 @@ /// <summary> /// Get current Layer (Multi-Layer support) /// </summary> - public int CurrentLayer { get { return _currentLayer; } } + public int CurrentLayer + { + get { return _currentLayer; } + set { _currentLayer = value; } + } /// <summary> Modified: trunk/plugins/MCEReplacement/MCEReplacement.cs =================================================================== --- trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-03-11 10:03:18 UTC (rev 180) +++ trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-03-11 13:44:57 UTC (rev 181) @@ -26,7 +26,7 @@ #region Constants - public const string PluginVersion = "MCE Replacement Plugin 1.0.2.0 for MediaPortal + SVN"; + public const string PluginVersion = "MCE Replacement Plugin 1.0.3.0 for MediaPortal + SVN"; public const int MessageModeCommand = 0x0018; @@ -37,6 +37,7 @@ public const string IRExtension = ".IR"; public const string MacroExtension = ".MACRO"; + // Macro Commands public const string RunCommandPrefix = "Run: "; public const string BlastCommandPrefix = "Blast: "; public const string PauseCommandPrefix = "Pause: "; @@ -47,6 +48,11 @@ public const string PopupCommandPrefix = "Popup: "; public const string PortCommandPrefix = "Port: "; public const string SpeedCommandPrefix = "Speed: "; + public const string SetMapCommandPrefix = "Multi-Mapping: "; + public const string SetMouseCommandPrefix = "Mouse Mode: "; + public const string InputLayerCommand = "Toggle Input Layer"; + public const string WindowStateCommand = "Toggle Window State"; + public const string GetFocusCommand = "Get Focus"; public static readonly string AppDataFolder = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + @@ -870,7 +876,28 @@ ShowNotifyDialog("Multi-Mapping", setName, 2); } + static void ChangeMultiMapping(string multiMapping) + { + for (int index = 0; index < MultiMaps.Length; index++) + { + if (MultiMaps[index] == multiMapping) + { + _multiMappingSet = index; + // Show the mapping set name on screen ... + string setName = MultiMaps[_multiMappingSet]; + + if (LogVerbose) + Log.Info("MCEReplacement: Multi-Mapping has changed to \"{0}\"", setName); + + ShowNotifyDialog("Multi-Mapping", setName, 2); + + return; + } + } + + } + static void ShowNotifyDialog(string heading, string text, int timeout) { GUIDialogNotify dlgNotify = (GUIDialogNotify)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_NOTIFY); @@ -885,7 +912,7 @@ dlgNotify.SetHeading(heading); dlgNotify.SetText(text); dlgNotify.TimeOut = timeout; - dlgNotify.DoModal(GUIWindowManager.ActiveWindow); + dlgNotify.DoModal(GUIWindowManager.ActiveWindow); } static void LoadSettings() @@ -913,7 +940,7 @@ MouseModeEnabled = xmlreader.GetValueAsBool("MCEReplacement", "MouseModeEnabled", false); MouseModeStep = xmlreader.GetValueAsInt("MCEReplacement", "MouseModeStep", 10); MouseModeAcceleration = xmlreader.GetValueAsBool("MCEReplacement", "MouseModeAcceleration", true); - + // MediaPortal settings ... _mpBasicHome = xmlreader.GetValueAsBool("general", "startbasichome", false); _mpMCERemote = xmlreader.GetValueAsBool("remote", "MCE", false); @@ -965,7 +992,7 @@ try { - using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(remoteFile)) + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(remoteFile)) { int i = 0; int codeValue; @@ -1045,44 +1072,44 @@ switch (mappedEvent.Param) { - case "Label 1": - matched = (msg.Label == paramValueString); + case "Label 1": + matched = (msg.Label == paramValueString); break; - case "Label 2": - matched = (msg.Label2 == paramValueString); + case "Label 2": + matched = (msg.Label2 == paramValueString); break; - case "Label 3": - matched = (msg.Label3 == paramValueString); + case "Label 3": + matched = (msg.Label3 == paramValueString); break; - case "Label 4": - matched = (msg.Label4 == paramValueString); + case "Label 4": + matched = (msg.Label4 == paramValueString); break; - case "Parameter 1": - matched = (msg.Param1 == paramValueInt); + case "Parameter 1": + matched = (msg.Param1 == paramValueInt); break; - case "Parameter 2": - matched = (msg.Param2 == paramValueInt); + case "Parameter 2": + matched = (msg.Param2 == paramValueInt); break; - case "Parameter 3": - matched = (msg.Param3 == paramValueInt); + case "Parameter 3": + matched = (msg.Param3 == paramValueInt); break; - case "Parameter 4": - matched = (msg.Param4 == paramValueInt); + case "Parameter 4": + matched = (msg.Param4 == paramValueInt); break; - case "Sender Control ID": - matched = (msg.SenderControlId == paramValueInt); + case "Sender Control ID": + matched = (msg.SenderControlId == paramValueInt); break; - case "Send To Target Window": - matched = (msg.SendToTargetWindow == paramValueBool); + case "Send To Target Window": + matched = (msg.SendToTargetWindow == paramValueBool); break; - case "Target Control ID": - matched = (msg.TargetControlId == paramValueInt); + case "Target Control ID": + matched = (msg.TargetControlId == paramValueInt); break; - case "Target Window ID": - matched = (msg.TargetWindowId == paramValueInt); + case "Target Window ID": + matched = (msg.TargetWindowId == paramValueInt); break; - default: - matched = false; + default: + matched = false; break; } } @@ -1118,7 +1145,7 @@ { if (mappedEvent.MatchParam) continue; - + if (LogVerbose) Log.Info("MCEReplacement: Event Mapper - Event \"{0}\"", Enum.GetName(typeof(MappedEvent.MappingEvent), eventType)); @@ -1552,9 +1579,110 @@ break; } - /* + case "MULTI_MAPPING": + { + if (InConfiguration) + MessageBox.Show(commandProperty, "Change Multi-Mapping Command", MessageBoxButtons.OK, MessageBoxIcon.Information); + else if (MultiMappingEnabled) + ChangeMultiMapping(commandProperty); + + break; + } + + case "MOUSE_MODE": + { + if (InConfiguration) + { + MessageBox.Show("Command to toggle the Mouse Mode cannot be processed in configuration.", "Mouse Mode Command", MessageBoxButtons.OK, MessageBoxIcon.Information); + break; + } + + if (!MouseModeEnabled) + break; + + switch (commandProperty) + { + case "ON": + MouseModeActive = true; + break; + + case "OFF": + MouseModeActive = false; + break; + + case "TOGGLE": + MouseModeActive = !MouseModeActive; + break; + } + + string notifyMessage; + + if (MouseModeActive... [truncated message content] |
From: <an...@us...> - 2007-03-11 15:18:17
|
Revision: 182 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=182&view=rev Author: and-81 Date: 2007-03-11 08:18:13 -0700 (Sun, 11 Mar 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ComSkipLauncher TVE2/AssemblyInfo.cs trunk/plugins/ComSkipLauncher TVE2/ComSkipLauncher.cs trunk/plugins/ComSkipLauncher TVE3/AssemblyInfo.cs trunk/plugins/ComSkipLauncher TVE3/ComSkipLauncher.cs trunk/plugins/MCEReplacement/Forms/MacroEditor.cs trunk/plugins/MCEReplacement/MCEReplacement.cs trunk/plugins/MCEReplacement/MCEReplacement.csproj trunk/plugins/TV3MceBlaster/TV3MceBlaster.cs Added Paths: ----------- trunk/plugins/ComSkipLauncher TVE2/ComSkipLauncher TVE2.csproj trunk/plugins/ComSkipLauncher TVE3/ComSkipLauncher TVE3.csproj trunk/plugins/ComSkipLauncher TVE3/PluginSetup.Designer.cs trunk/plugins/ComSkipLauncher TVE3/PluginSetup.cs trunk/plugins/ComSkipLauncher TVE3/PluginSetup.resx Removed Paths: ------------- trunk/plugins/ComSkipLauncher TVE2/ComSkipLauncher.csproj trunk/plugins/ComSkipLauncher TVE3/ComSkipLauncher.csproj trunk/plugins/ComSkipLauncher TVE3/Configuration.Designer.cs trunk/plugins/ComSkipLauncher TVE3/Configuration.cs trunk/plugins/ComSkipLauncher TVE3/Configuration.resx Modified: trunk/plugins/ComSkipLauncher TVE2/AssemblyInfo.cs =================================================================== --- trunk/plugins/ComSkipLauncher TVE2/AssemblyInfo.cs 2007-03-11 13:44:57 UTC (rev 181) +++ trunk/plugins/ComSkipLauncher TVE2/AssemblyInfo.cs 2007-03-11 15:18:13 UTC (rev 182) @@ -8,7 +8,7 @@ // set of attributes. Change these attribute values to modify the information // associated with an assembly. // -[assembly: AssemblyTitle("ComSkipLauncher")] +[assembly: AssemblyTitle("ComSkipLauncher TVE2")] [assembly: AssemblyDescription("Launches ComSkip when a recording completes")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("For MediaPortal")] Added: trunk/plugins/ComSkipLauncher TVE2/ComSkipLauncher TVE2.csproj =================================================================== --- trunk/plugins/ComSkipLauncher TVE2/ComSkipLauncher TVE2.csproj (rev 0) +++ trunk/plugins/ComSkipLauncher TVE2/ComSkipLauncher TVE2.csproj 2007-03-11 15:18:13 UTC (rev 182) @@ -0,0 +1,87 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>8.0.50727</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{35EE9B81-1774-498E-94A0-0FD47E213FB5}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>MediaPortal.Plugins</RootNamespace> + <AssemblyName>ComSkipLauncher</AssemblyName> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>false</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <UseVSHostingProcess>false</UseVSHostingProcess> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>none</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants> + </DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <UseVSHostingProcess>false</UseVSHostingProcess> + </PropertyGroup> + <ItemGroup> + <Reference Include="Core, Version=1.0.2581.1884, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\MediaPortal\Core\bin\Release\Core.dll</HintPath> + <Private>False</Private> + </Reference> + <Reference Include="Databases, Version=1.0.2623.6915, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\MediaPortal\xbmc\bin\Release\Databases.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="TVCapture, Version=1.0.2623.6917, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\MediaPortal\xbmc\bin\Release\TVCapture.dll</HintPath> + <Private>False</Private> + </Reference> + <Reference Include="Utils, Version=1.0.2622.31921, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\MediaPortal\Utils\bin\Release\Utils.dll</HintPath> + <Private>False</Private> + </Reference> + </ItemGroup> + <ItemGroup> + <Compile Include="ComSkipLauncher.cs" /> + <Compile Include="AssemblyInfo.cs" /> + <Compile Include="Configuration.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="Configuration.designer.cs"> + <DependentUpon>Configuration.cs</DependentUpon> + </Compile> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="Configuration.resx"> + <DependentUpon>Configuration.cs</DependentUpon> + <SubType>Designer</SubType> + </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> + --> + <PropertyGroup> + <PostBuildEvent>copy "*.*" "\MediaPortal Development\Plugin Releases\ComSkip Launcher TVE2\"</PostBuildEvent> + </PropertyGroup> +</Project> \ No newline at end of file Modified: trunk/plugins/ComSkipLauncher TVE2/ComSkipLauncher.cs =================================================================== --- trunk/plugins/ComSkipLauncher TVE2/ComSkipLauncher.cs 2007-03-11 13:44:57 UTC (rev 181) +++ trunk/plugins/ComSkipLauncher TVE2/ComSkipLauncher.cs 2007-03-11 15:18:13 UTC (rev 182) @@ -21,9 +21,12 @@ public static readonly string MPConfigFile = Config.GetFolder(Config.Dir.Config) + "\\MediaPortal.xml"; - public static readonly string DefaultProgram = "C:\\Program Files\\ComSkip\\ComSkip.exe"; - public static readonly string DefaultParameters = "--playnice \"{0}\""; + public static readonly string DefaultStartProgram = "\\Program Files\\ComSkip\\ComSkip.exe"; + public static readonly string DefaultStartParameters = "--playnice \"{0}\""; + public static readonly string DefaultEndProgram = "\\Program Files\\ComSkip\\ComClean.bat"; + public static readonly string DefaultEndParameters = "\"{0}\""; + #endregion Constants #region Members @@ -182,12 +185,12 @@ using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(MPConfigFile)) { _runAtStart = xmlreader.GetValueAsBool("ComSkipLauncher", "RunAtStart", false); - _startProgram = xmlreader.GetValueAsString("ComSkipLauncher", "StartProgram", DefaultProgram); - _startParameters = xmlreader.GetValueAsString("ComSkipLauncher", "StartParameters", DefaultParameters); + _startProgram = xmlreader.GetValueAsString("ComSkipLauncher", "StartProgram", DefaultStartProgram); + _startParameters = xmlreader.GetValueAsString("ComSkipLauncher", "StartParameters", DefaultStartParameters); _runAtEnd = xmlreader.GetValueAsBool("ComSkipLauncher", "RunAtEnd", false); - _endProgram = xmlreader.GetValueAsString("ComSkipLauncher", "EndProgram", DefaultProgram); - _endParameters = xmlreader.GetValueAsString("ComSkipLauncher", "EndParameters", DefaultParameters); + _endProgram = xmlreader.GetValueAsString("ComSkipLauncher", "EndProgram", DefaultEndProgram); + _endParameters = xmlreader.GetValueAsString("ComSkipLauncher", "EndParameters", DefaultEndParameters); } } catch (Exception ex) Deleted: trunk/plugins/ComSkipLauncher TVE2/ComSkipLauncher.csproj =================================================================== --- trunk/plugins/ComSkipLauncher TVE2/ComSkipLauncher.csproj 2007-03-11 13:44:57 UTC (rev 181) +++ trunk/plugins/ComSkipLauncher TVE2/ComSkipLauncher.csproj 2007-03-11 15:18:13 UTC (rev 182) @@ -1,87 +0,0 @@ -<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <PropertyGroup> - <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> - <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ProductVersion>8.0.50727</ProductVersion> - <SchemaVersion>2.0</SchemaVersion> - <ProjectGuid>{35EE9B81-1774-498E-94A0-0FD47E213FB5}</ProjectGuid> - <OutputType>Library</OutputType> - <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>MediaPortal.Plugins</RootNamespace> - <AssemblyName>ComSkipLauncher</AssemblyName> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> - <DebugSymbols>false</DebugSymbols> - <DebugType>full</DebugType> - <Optimize>false</Optimize> - <OutputPath>bin\Debug\</OutputPath> - <DefineConstants>DEBUG</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - <UseVSHostingProcess>false</UseVSHostingProcess> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <DebugType>none</DebugType> - <Optimize>true</Optimize> - <OutputPath>bin\Release\</OutputPath> - <DefineConstants> - </DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - <UseVSHostingProcess>false</UseVSHostingProcess> - </PropertyGroup> - <ItemGroup> - <Reference Include="Core, Version=1.0.2581.1884, Culture=neutral, processorArchitecture=MSIL"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\MediaPortal\Core\bin\Release\Core.dll</HintPath> - <Private>False</Private> - </Reference> - <Reference Include="Databases, Version=1.0.2623.6915, Culture=neutral, processorArchitecture=x86"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\MediaPortal\xbmc\bin\Release\Databases.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="TVCapture, Version=1.0.2623.6917, Culture=neutral, processorArchitecture=x86"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\MediaPortal\xbmc\bin\Release\TVCapture.dll</HintPath> - <Private>False</Private> - </Reference> - <Reference Include="Utils, Version=1.0.2622.31921, Culture=neutral, processorArchitecture=x86"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\MediaPortal\Utils\bin\Release\Utils.dll</HintPath> - <Private>False</Private> - </Reference> - </ItemGroup> - <ItemGroup> - <Compile Include="ComSkipLauncher.cs" /> - <Compile Include="AssemblyInfo.cs" /> - <Compile Include="Configuration.cs"> - <SubType>Form</SubType> - </Compile> - <Compile Include="Configuration.designer.cs"> - <DependentUpon>Configuration.cs</DependentUpon> - </Compile> - </ItemGroup> - <ItemGroup> - <EmbeddedResource Include="Configuration.resx"> - <DependentUpon>Configuration.cs</DependentUpon> - <SubType>Designer</SubType> - </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> - --> - <PropertyGroup> - <PostBuildEvent>copy "*.*" "\MediaPortal Development\Plugin Releases\ComSkip Launcher\"</PostBuildEvent> - </PropertyGroup> -</Project> \ No newline at end of file Modified: trunk/plugins/ComSkipLauncher TVE3/AssemblyInfo.cs =================================================================== --- trunk/plugins/ComSkipLauncher TVE3/AssemblyInfo.cs 2007-03-11 13:44:57 UTC (rev 181) +++ trunk/plugins/ComSkipLauncher TVE3/AssemblyInfo.cs 2007-03-11 15:18:13 UTC (rev 182) @@ -8,7 +8,7 @@ // set of attributes. Change these attribute values to modify the information // associated with an assembly. // -[assembly: AssemblyTitle("ComSkipLauncher")] +[assembly: AssemblyTitle("ComSkipLauncher TVE3")] [assembly: AssemblyDescription("Launches ComSkip when a recording completes")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("For MediaPortal")] Added: trunk/plugins/ComSkipLauncher TVE3/ComSkipLauncher TVE3.csproj =================================================================== --- trunk/plugins/ComSkipLauncher TVE3/ComSkipLauncher TVE3.csproj (rev 0) +++ trunk/plugins/ComSkipLauncher TVE3/ComSkipLauncher TVE3.csproj 2007-03-11 15:18:13 UTC (rev 182) @@ -0,0 +1,107 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>8.0.50727</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{AD20D519-D1AF-484E-ADDE-251F7CA912D9}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>TvEngine</RootNamespace> + <AssemblyName>ComSkipLauncher</AssemblyName> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>false</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <UseVSHostingProcess>false</UseVSHostingProcess> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>none</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants> + </DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <UseVSHostingProcess>false</UseVSHostingProcess> + </PropertyGroup> + <ItemGroup> + <Reference Include="Gentle.Common, Version=1.2.9.1285, Culture=neutral, PublicKeyToken=80b5de62e27be49b"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\TV Engine\TVLibrary\TVDatabase\bin\Release\\Gentle.Common.dll</HintPath> + <Private>False</Private> + </Reference> + <Reference Include="Gentle.Framework, Version=1.2.9.1286, Culture=neutral, PublicKeyToken=80b5de62e27be49b"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\TV Engine\TVLibrary\TVDatabase\bin\Release\\Gentle.Framework.dll</HintPath> + <Private>False</Private> + </Reference> + <Reference Include="PluginBase, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\TV Engine\TVLibrary\Plugins\PluginBase\bin\Release\PluginBase.dll</HintPath> + <Private>False</Private> + </Reference> + <Reference Include="SetupControls, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\TV Engine\TVLibrary\SetupControls\bin\Release\SetupControls.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="TvBusinessLayer, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\TV Engine\TVLibrary\TvService\bin\Release\TvBusinessLayer.dll</HintPath> + <Private>False</Private> + </Reference> + <Reference Include="TvControl, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\TV Engine\TVLibrary\TvService\bin\Release\TvControl.dll</HintPath> + <Private>False</Private> + </Reference> + <Reference Include="TVDatabase, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\TV Engine\TVLibrary\TVDatabase\bin\Release\\TVDatabase.dll</HintPath> + <Private>False</Private> + </Reference> + <Reference Include="TvLibrary.Interfaces, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\TV Engine\TVLibrary\TvLibrary.Interfaces\bin\Release\TvLibrary.Interfaces.dll</HintPath> + <Private>False</Private> + </Reference> + </ItemGroup> + <ItemGroup> + <Compile Include="ComSkipLauncher.cs" /> + <Compile Include="AssemblyInfo.cs" /> + <Compile Include="PluginSetup.cs"> + <SubType>UserControl</SubType> + </Compile> + <Compile Include="PluginSetup.Designer.cs"> + <DependentUpon>PluginSetup.cs</DependentUpon> + </Compile> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="PluginSetup.resx"> + <DependentUpon>PluginSetup.cs</DependentUpon> + <SubType>Designer</SubType> + </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> + --> + <PropertyGroup> + <PostBuildEvent>copy "*.*" "\MediaPortal Development\Plugin Releases\ComSkip Launcher TVE3\"</PostBuildEvent> + </PropertyGroup> +</Project> \ No newline at end of file Modified: trunk/plugins/ComSkipLauncher TVE3/ComSkipLauncher.cs =================================================================== --- trunk/plugins/ComSkipLauncher TVE3/ComSkipLauncher.cs 2007-03-11 13:44:57 UTC (rev 181) +++ trunk/plugins/ComSkipLauncher TVE3/ComSkipLauncher.cs 2007-03-11 15:18:13 UTC (rev 182) @@ -5,24 +5,28 @@ using System.Text; using System.Windows.Forms; -using MediaPortal.Configuration; -using MediaPortal.GUI.Library; -using MediaPortal.TV.Database; -using MediaPortal.TV.Recording; -using MediaPortal.Util; +using TvLibrary.Log; +using TvControl; +using SetupTv; +using TvEngine; +using TvEngine.Events; +using TvLibrary.Interfaces; +using TvLibrary.Implementations; +using TvDatabase; -namespace MediaPortal.Plugins +namespace TvEngine { - public class ComSkipLauncher : IPlugin, ISetupForm + public class ComSkipLauncher : ITvServerPlugin { #region Constants - public static readonly string MPConfigFile = Config.GetFolder(Config.Dir.Config) + "\\MediaPortal.xml"; + public static readonly string DefaultStartProgram = "\\Program Files\\ComSkip\\ComSkip.exe"; + public static readonly string DefaultStartParameters = "--playnice \"{0}\""; - public static readonly string DefaultProgram = "C:\\Program Files\\ComSkip\\ComSkip.exe"; - public static readonly string DefaultParameters = "--playnice \"{0}\""; + public static readonly string DefaultEndProgram = "\\Program Files\\ComSkip\\ComClean.bat"; + public static readonly string DefaultEndParameters = "\"{0}\""; #endregion Constants @@ -38,177 +42,125 @@ #endregion Members - #region IPlugin Members + #region Properties - public void Start() + /// <summary> + /// returns the name of the plugin + /// </summary> + public string Name { - Log.Info("ComSkipLauncher: Start"); - - LoadSettings(); - - if (_runAtStart) - Recorder.OnTvRecordingStarted += new Recorder.OnTvRecordingHandler(Recorder_OnTvRecordingStarted); - - if (_runAtEnd) - Recorder.OnTvRecordingEnded += new Recorder.OnTvRecordingHandler(Recorder_OnTvRecordingEnded); + get { return "ComSkipLauncher"; } } - public void Stop() + /// <summary> + /// returns the version of the plugin + /// </summary> + public string Version { - Log.Info("ComSkipLauncher: Stop"); - - if (_runAtStart) - Recorder.OnTvRecordingStarted -= new Recorder.OnTvRecordingHandler(Recorder_OnTvRecordingStarted); - - if (_runAtEnd) - Recorder.OnTvRecordingEnded -= new Recorder.OnTvRecordingHandler(Recorder_OnTvRecordingEnded); + get { return "1.0.2.0"; } } + /// <summary> + /// returns the author of the plugin + /// </summary> + public string Author + { + get { return "and-81"; } + } + /// <summary> + /// returns if the plugin should only run on the master server + /// or also on slave servers + /// </summary> + public bool MasterOnly + { + get { return false; } + } - #endregion + #endregion Properties - #region ISetupForm Members + #region IPlugin Members - public string Author() { return "and-81"; } - public bool CanEnable() { return true; } - public bool DefaultEnabled() { return true; } - public string Description() { return "Launches ComSkip when a recording completes."; } - public int GetWindowId() { return 0; } - public bool HasSetup() { return true; } - public string PluginName() { return "ComSkip Launcher"; } - - public void ShowPlugin() + [CLSCompliant(false)] + public void Start(IController controller) { + Log.Info("ComSkipLauncher: Start"); + LoadSettings(); - Configuration configuration = new Configuration(); - configuration.RunAtStart = _runAtStart; - configuration.StartProgram = _startProgram; - configuration.StartParameters = _startParameters; + if (_runAtStart || _runAtEnd) + GlobalServiceProvider.Instance.Get<ITvServerEvent>().OnTvServerEvent += new TvServerEventHandler(ComSkipLauncher_OnTvServerEvent); + } - configuration.RunAtEnd = _runAtEnd; - configuration.EndProgram = _endProgram; - configuration.EndParameters = _endParameters; + public void Stop() + { + Log.Info("ComSkipLauncher: Stop"); - if (configuration.ShowDialog() == DialogResult.OK) - { - _runAtStart = configuration.RunAtStart; - _startProgram = configuration.StartProgram; - _startParameters = configuration.StartParameters; - - _runAtEnd = configuration.RunAtEnd; - _endProgram = configuration.EndProgram; - _endParameters = configuration.EndParameters; - - SaveSettings(); - } + if (_runAtStart || _runAtEnd) + GlobalServiceProvider.Instance.Get<ITvServerEvent>().OnTvServerEvent -= new TvServerEventHandler(ComSkipLauncher_OnTvServerEvent); } - public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) + [CLSCompliant(false)] + public SetupTv.SectionSettings Setup { - strButtonText = strButtonImage = strButtonImageFocus = strPictureImage = ""; - return false; + get { return new SetupTv.Sections.PluginSetup(); } } #endregion #region Implementation - void Recorder_OnTvRecordingStarted(string recordingFilename, TVRecording recording, TVProgram program) + void ComSkipLauncher_OnTvServerEvent(object sender, EventArgs eventArgs) { - Log.Debug("ComSkipLauncher: Recorder_OnTvRecordingStarted {0}", recordingFilename); - try { - string parameters = ProcessParameters(_startParameters, recordingFilename); + TvServerEventArgs tvEvent = (TvServerEventArgs)eventArgs; + string parameters; - Log.Info( + if (tvEvent.EventType == TvServerEventType.RecordingStarted) + { + parameters = ProcessParameters(_startParameters, tvEvent.Recording.FileName); + + Log.Info( "ComSkipLauncher: Recording started ({0}), launching program ({1} {2}) ...", - recordingFilename, + tvEvent.Recording.FileName, _startProgram, parameters - ); + ); - LaunchProcess(_startProgram, parameters, Path.GetDirectoryName(recordingFilename), ProcessWindowStyle.Hidden); - } - catch (Exception ex) - { - Log.Error("ComSkipLauncher: {0}", ex.Message); - } - } - void Recorder_OnTvRecordingEnded(string recordingFilename, TVRecording recording, TVProgram program) - { - Log.Debug("ComSkipLauncher: Recorder_OnTvRecordingEnded {0}", recordingFilename); - - try - { - string fileName = String.Empty; - List<TVRecorded> recorded = new List<TVRecorded>(); - TVDatabase.GetRecordedTV(ref recorded); - foreach (TVRecorded rec in recorded) - { - if (rec.Title == recording.Title && rec.StartTime == recording.StartTime) - { - fileName = rec.FileName; - break; - } + LaunchProcess(_startProgram, parameters, Path.GetDirectoryName(tvEvent.Recording.FileName), ProcessWindowStyle.Hidden); } - - if (String.IsNullOrEmpty(fileName)) + else if (tvEvent.EventType == TvServerEventType.RecordingEnded) { - Log.Warn("ComSkipLauncher: Couldn't process recording titled {0}, no filename found.", recording.Title); - return; - } + parameters = ProcessParameters(_endParameters, tvEvent.Recording.FileName); - string parameters = ProcessParameters(_endParameters, fileName); + Log.Info( + "ComSkipLauncher: Recording ended ({0}), launching program ({1} {2}) ...", + tvEvent.Recording.FileName, + _endProgram, + parameters + ); - Log.Info( - "ComSkipLauncher: Recording ended ({0}), launching program ({1} {2}) ...", - fileName, - _endProgram, - parameters - ); - - LaunchProcess(_endProgram, parameters, Path.GetDirectoryName(fileName), ProcessWindowStyle.Hidden); + LaunchProcess(_endProgram, parameters, Path.GetDirectoryName(tvEvent.Recording.FileName), ProcessWindowStyle.Hidden); + } } catch (Exception ex) { Log.Error("ComSkipLauncher: {0}", ex.Message); } + } void LoadSettings() { try { - using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(MPConfigFile)) - { - _runAtStart = xmlreader.GetValueAsBool("ComSkipLauncher", "RunAtStart", false); - _startProgram = xmlreader.GetValueAsString("ComSkipLauncher", "StartProgram", DefaultProgram); - _startParameters = xmlreader.GetValueAsString("ComSkipLauncher", "StartParameters", DefaultParameters); + TvBusinessLayer layer = new TvBusinessLayer(); - _runAtEnd = xmlreader.GetValueAsBool("ComSkipLauncher", "RunAtEnd", false); - _endProgram = xmlreader.GetValueAsString("ComSkipLauncher", "EndProgram", DefaultProgram); - _endParameters = xmlreader.GetValueAsString("ComSkipLauncher", "EndParameters", DefaultParameters); - } - } - catch (Exception ex) - { - Log.Error("ComSkipLauncher: {0}", ex.Message); - } - } - void SaveSettings() - { - try - { - using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(MPConfigFile)) - { - xmlwriter.SetValueAsBool("ComSkipLauncher", "RunAtStart", _runAtStart); - xmlwriter.SetValue("ComSkipLauncher", "StartProgram", _startProgram); - xmlwriter.SetValue("ComSkipLauncher", "StartParameters", _startParameters); + _runAtStart = Convert.ToBoolean(layer.GetSetting("ComSkipLauncher_RunAtStart", "False").Value); + _startProgram = layer.GetSetting("ComSkipLauncher_StartProgram", DefaultStartProgram).Value; + _startParameters = layer.GetSetting("ComSkipLauncher_StartParameters", DefaultStartParameters).Value; - xmlwriter.SetValueAsBool("ComSkipLauncher", "RunAtEnd", _runAtEnd); - xmlwriter.SetValue("ComSkipLauncher", "EndProgram", _endProgram); - xmlwriter.SetValue("ComSkipLauncher", "EndParameters", _endParameters); - } + _runAtEnd = Convert.ToBoolean(layer.GetSetting("ComSkipLauncher_RunAtEnd", "False").Value); + _endProgram = layer.GetSetting("ComSkipLauncher_EndProgram", DefaultEndProgram).Value; + _endParameters = layer.GetSetting("ComSkipLauncher_EndParameters", DefaultEndParameters).Value; } catch (Exception ex) { Deleted: trunk/plugins/ComSkipLauncher TVE3/ComSkipLauncher.csproj =================================================================== --- trunk/plugins/ComSkipLauncher TVE3/ComSkipLauncher.csproj 2007-03-11 13:44:57 UTC (rev 181) +++ trunk/plugins/ComSkipLauncher TVE3/ComSkipLauncher.csproj 2007-03-11 15:18:13 UTC (rev 182) @@ -1,87 +0,0 @@ -<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <PropertyGroup> - <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> - <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ProductVersion>8.0.50727</ProductVersion> - <SchemaVersion>2.0</SchemaVersion> - <ProjectGuid>{35EE9B81-1774-498E-94A0-0FD47E213FB5}</ProjectGuid> - <OutputType>Library</OutputType> - <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>MediaPortal.Plugins</RootNamespace> - <AssemblyName>ComSkipLauncher</AssemblyName> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> - <DebugSymbols>false</DebugSymbols> - <DebugType>full</DebugType> - <Optimize>false</Optimize> - <OutputPath>bin\Debug\</OutputPath> - <DefineConstants>DEBUG</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - <UseVSHostingProcess>false</UseVSHostingProcess> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <DebugType>none</DebugType> - <Optimize>true</Optimize> - <OutputPath>bin\Release\</OutputPath> - <DefineConstants> - </DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - <UseVSHostingProcess>false</UseVSHostingProcess> - </PropertyGroup> - <ItemGroup> - <Reference Include="Core, Version=1.0.2581.1884, Culture=neutral, processorArchitecture=MSIL"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\MediaPortal\Core\bin\Release\Core.dll</HintPath> - <Private>False</Private> - </Reference> - <Reference Include="Databases, Version=1.0.2623.6915, Culture=neutral, processorArchitecture=x86"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\MediaPortal\xbmc\bin\Release\Databases.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="TVCapture, Version=1.0.2623.6917, Culture=neutral, processorArchitecture=x86"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\MediaPortal\xbmc\bin\Release\TVCapture.dll</HintPath> - <Private>False</Private> - </Reference> - <Reference Include="Utils, Version=1.0.2622.31921, Culture=neutral, processorArchitecture=x86"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\MediaPortal\Utils\bin\Release\Utils.dll</HintPath> - <Private>False</Private> - </Reference> - </ItemGroup> - <ItemGroup> - <Compile Include="ComSkipLauncher.cs" /> - <Compile Include="AssemblyInfo.cs" /> - <Compile Include="Configuration.cs"> - <SubType>Form</SubType> - </Compile> - <Compile Include="Configuration.designer.cs"> - <DependentUpon>Configuration.cs</DependentUpon> - </Compile> - </ItemGroup> - <ItemGroup> - <EmbeddedResource Include="Configuration.resx"> - <DependentUpon>Configuration.cs</DependentUpon> - <SubType>Designer</SubType> - </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> - --> - <PropertyGroup> - <PostBuildEvent>copy "*.*" "\MediaPortal Development\Plugin Releases\ComSkip Launcher\"</PostBuildEvent> - </PropertyGroup> -</Project> \ No newline at end of file Deleted: trunk/plugins/ComSkipLauncher TVE3/Configuration.Designer.cs =================================================================== --- trunk/plugins/ComSkipLauncher TVE3/Configuration.Designer.cs 2007-03-11 13:44:57 UTC (rev 181) +++ trunk/plugins/ComSkipLauncher TVE3/Configuration.Designer.cs 2007-03-11 15:18:13 UTC (rev 182) @@ -1,458 +0,0 @@ -namespace MediaPortal.Plugins -{ - partial class Configuration - { - /// <summary> - /// Required designer variable. - /// </summary> - private System.ComponentModel.IContainer components = null; - - /// <summary> - /// Clean up any resources being used. - /// </summary> - /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// <summary> - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// </summary> - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - this.buttonOK = new System.Windows.Forms.Button(); - this.buttonCancel = new System.Windows.Forms.Button(); - this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); - this.buttonTest = new System.Windows.Forms.Button(); - this.textBoxTest = new System.Windows.Forms.TextBox(); - this.buttonFindTestFile = new System.Windows.Forms.Button(); - this.radioButtonStartDoNothing = new System.Windows.Forms.RadioButton(); - this.radioButtonStartLaunch = new System.Windows.Forms.RadioButton(); - this.toolTips = new System.Windows.Forms.ToolTip(this.components); - this.textBoxEndParameters = new System.Windows.Forms.TextBox(); - this.buttonEndParameters = new System.Windows.Forms.Button(); - this.buttonEndProgram = new System.Windows.Forms.Button(); - this.textBoxEndProgram = new System.Windows.Forms.TextBox(); - this.textBoxStartParameters = new System.Windows.Forms.TextBox(); - this.buttonStartParameters = new System.Windows.Forms.Button(); - this.buttonStartProgram = new System.Windows.Forms.Button(); - this.textBoxStartProgram = new System.Windows.Forms.TextBox(); - this.radioButtonEndDoNothing = new System.Windows.Forms.RadioButton(); - this.radioButtonEndLaunch = new System.Windows.Forms.RadioButton(); - this.tabControl = new System.Windows.Forms.TabControl(); - this.tabPageStart = new System.Windows.Forms.TabPage(); - this.groupBoxStartProgram = new System.Windows.Forms.GroupBox(); - this.labelStartParameters = new System.Windows.Forms.Label(); - this.labelStartProgram = new System.Windows.Forms.Label(); - this.tabPageEnd = new System.Windows.Forms.TabPage(); - this.groupBoxEndProgram = new System.Windows.Forms.GroupBox(); - this.labelEndParameters = new System.Windows.Forms.Label(); - this.labelEndProgram = new System.Windows.Forms.Label(); - this.groupBoxTest = new System.Windows.Forms.GroupBox(); - this.tabControl.SuspendLayout(); - this.tabPageStart.SuspendLayout(); - this.groupBoxStartProgram.SuspendLayout(); - this.tabPageEnd.SuspendLayout(); - this.groupBoxEndProgram.SuspendLayout(); - this.groupBoxTest.SuspendLayout(); - this.SuspendLayout(); - // - // buttonOK - // - this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonOK.Location = new System.Drawing.Point(216, 288); - this.buttonOK.Name = "buttonOK"; - this.buttonOK.Size = new System.Drawing.Size(56, 24); - this.buttonOK.TabIndex = 2; - this.buttonOK.Text = "OK"; - this.buttonOK.UseVisualStyleBackColor = true; - this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); - // - // buttonCancel - // - this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.buttonCancel.Location = new System.Drawing.Point(280, 288); - this.buttonCancel.Name = "buttonCancel"; - this.buttonCancel.Size = new System.Drawing.Size(56, 24); - this.buttonCancel.TabIndex = 3; - this.buttonCancel.Text = "Cancel"; - this.buttonCancel.UseVisualStyleBackColor = true; - this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); - // - // openFileDialog - // - this.openFileDialog.Filter = "All files|*.*"; - // - // buttonTest - // - this.buttonTest.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonTest.Location = new System.Drawing.Point(272, 24); - this.buttonTest.Name = "buttonTest"; - this.buttonTest.Size = new System.Drawing.Size(48, 20); - this.buttonTest.TabIndex = 2; - this.buttonTest.Text = "Test"; - this.toolTips.SetToolTip(this.buttonTest, "Click here to test the above settings"); - this.buttonTest.UseVisualStyleBackColor = true; - this.buttonTest.Click += new System.EventHandler(this.buttonTest_Click); - // - // textBoxTest - // - this.textBoxTest.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.textBoxTest.Location = new System.Drawing.Point(8, 24); - this.textBoxTest.Name = "textBoxTest"; - this.textBoxTest.Size = new System.Drawing.Size(224, 20); - this.textBoxTest.TabIndex = 0; - this.toolTips.SetToolTip(this.textBoxTest, "File to test launch with"); - // - // buttonFindTestFile - // - this.buttonFindTestFile.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonFindTestFile.Location = new System.Drawing.Point(240, 24); - this.buttonFindTestFile.Name = "buttonFindTestFile"; - this.buttonFindTestFile.Size = new System.Drawing.Size(24, 20); - this.buttonFindTestFile.TabIndex = 1; - this.buttonFindTestFile.Text = "..."; - this.toolTips.SetToolTip(this.buttonFindTestFile, "Click here to locate a file to test with"); - this.buttonFindTestFile.UseVisualStyleBackColor = true; - this.buttonFindTestFile.Click += new System.EventHandler(this.buttonFindTestFile_Click); - // - // radioButtonStartDoNothing - // - this.radioButtonStartDoNothing.Location = new System.Drawing.Point(8, 8); - this.radioButtonStartDoNothing.Name = "radioButtonStartDoNothing"; - this.radioButtonStartDoNothing.Size = new System.Drawing.Size(96, 24); - this.radioButtonStartDoNothing.TabIndex = 0; - this.radioButtonStartDoNothing.Text = "Do nothing"; - this.toolTips.SetToolTip(this.radioButtonStartDoNothing, "Launch ComSkip as soon as the recording starts (this requires the LiveTV setting " + - "in comskip.ini)"); - this.radioButtonStartDoNothing.UseVisualStyleBackColor = true; - // - // radioButtonStartLaunch - // - this.radioButtonStartLaunch.Checked = true; - this.radioButtonStartLaunch.Location = new System.Drawing.Point(8, 32); - this.radioButtonStartLaunch.Name = "radioButtonStartLaunch"; - this.radioButtonStartLaunch.Size = new System.Drawing.Size(96, 24); - this.radioButtonStartLaunch.TabIndex = 1; - this.radioButtonStartLaunch.Text = "Launch:"; - this.toolTips.SetToolTip(this.radioButtonStartLaunch, "Launch ComSkip to process the recording after it has finished"); - this.radioButtonStartLaunch.UseVisualStyleBackColor = true; - this.radioButtonStartLaunch.CheckedChanged += new System.EventHandler(this.radioButtonStartLaunch_CheckedChanged); - // - // textBoxEndParameters - // - this.textBoxEndParameters.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.textBoxEndParameters.Location = new System.Drawing.Point(8, 80); - this.textBoxEndParameters.Name = "textBoxEndParameters"; - this.textBoxEndParameters.Size = new System.Drawing.Size(256, 20); - this.textBoxEndParameters.TabIndex = 4; - this.toolTips.SetToolTip(this.textBoxEndParameters, "Provide command line parameters for the program"); - // - // buttonEndParameters - // - this.buttonEndParameters.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonEndParameters.Location = new System.Drawing.Point(272, 80); - this.buttonEndParameters.Name = "buttonEndParameters"; - this.buttonEndParameters.Size = new System.Drawing.Size(24, 20); - this.buttonEndParameters.TabIndex = 5; - this.buttonEndParameters.Text = "?"; - this.toolTips.SetToolTip(this.buttonEndParameters, "Click here for a list of additional command line parameters"); - this.buttonEndParameters.UseVisualStyleBackColor = true; - this.buttonEndParameters.Click += new System.EventHandler(this.buttonParamQuestion_Click); - // - // buttonEndProgram - // - this.buttonEndProgram.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonEndProgram.Location = new System.Drawing.Point(272, 40); - this.buttonEndProgram.Name = "buttonEndProgram"; - this.buttonEndProgram.Size = new System.Drawing.Size(24, 20); - this.buttonEndProgram.TabIndex = 2; - this.buttonEndProgram.Text = "..."; - this.toolTips.SetToolTip(this.buttonEndProgram, "Locate the program you wish to launch"); - this.buttonEndProgram.UseVisualStyleBackColor = true; - this.buttonEndProgram.Click += new System.EventHandler(this.buttonEndProgram_Click); - // - // textBoxEndProgram - // - this.textBoxEndProgram.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.textBoxEndProgram.Location = new System.Drawing.Point(8, 40); - this.textBoxEndProgram.Name = "textBoxEndProgram"; - this.textBoxEndProgram.Size = new System.Drawing.Size(256, 20); - this.textBoxEndProgram.TabIndex = 1; - this.toolTips.SetToolTip(this.textBoxEndProgram, "The full location of the program to launch"); - // - // textBoxStartParameters - // - this.textBoxStartParameters.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.textBoxStartParameters.Location = new System.Drawing.Point(8, 80); - this.textBoxStartParameters.Name = "textBoxStartParameters"; - this.textBoxStartParameters.Size = new System.Drawing.Size(256, 20); - this.textBoxStartParameters.TabIndex = 4; - this.toolTips.SetToolTip(this.textBoxStartParameters, "Provide command line parameters for the program"); - // - // buttonStartParameters - // - this.buttonStartParameters.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonStartParameters.Location = new System.Drawing.Point(272, 80); - this.buttonStartParameters.Name = "buttonStartParameters"; - this.buttonStartParameters.Size = new System.Drawing.Size(24, 20); - this.buttonStartParameters.TabIndex = 5; - this.buttonStartParameters.Text = "?"; - this.toolTips.SetToolTip(this.buttonStartParameters, "Click here for a list of additional command line parameters"); - this.buttonStartParameters.UseVisualStyleBackColor = true; - this.buttonStartParameters.Click += new System.EventHandler(this.buttonParamQuestion_Click); - // - // buttonStartProgram - // - this.buttonStartProgram.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonStartProgram.Location = new System.Drawing.Point(272, 40); - this.buttonStartProgram.Name = "buttonStartProgram"; - this.buttonStartProgram.Size = new System.Drawing.Size(24, 20); - this.buttonStartProgram.TabIndex = 2; - this.buttonStartProgram.Text = "..."; - this.toolTips.SetToolTip(this.buttonStartProgram, "Locate the program you wish to launch"); - this.buttonStartProgram.UseVisualStyleBackColor = true; - this.buttonStartProgram.Click += new System.EventHandler(this.buttonStartProgram_Click); - // - // textBoxStartProgram - // - this.textBoxStartProgram.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.textBoxStartProgram.Location = new System.Drawing.Point(8, 40); - this.textBoxStartProgram.Name = "textBoxStartProgram"; - this.textBoxStartProgram.Size = new System.Drawing.Size(256, 20); - this.textBoxStartProgram.TabIndex = 1; - this.toolTips.SetToolTip(this.textBoxStartProgram, "The full location of the program to launch"); - // - // radioButtonEndDoNothing - // - this.radioButtonEndDoNothing.Location = new System.Drawing.Point(8, 8); - this.radioButtonEndDoNothing.Name = "radioButtonEndDoNothing"; - this.radioButtonEndDoNothing.Size = new System.Drawing.Size(96, 24); - this.radioButtonEndDoNothing.TabIndex = 0; - this.radioButtonEndDoNothing.Text = "Do nothing"; - this.radioButtonEndDoNothing.UseVisualStyleBackColor = true; - // - // radioButtonEndLaunch - // - this.radioButtonEndLaunch.Checked = true; - this.radioButtonEndLaunch.Location = new System.Drawing.Point(8, 32); - this.radioButtonEndLaunch.Name = "radioButtonEndLaunch"; - this.radioButtonEndLaunch.Size = new System.Drawing.Size(96, 24); - this.radioButtonEndLaunch.TabIndex = 1; - this.radioButtonEndLaunch.Text = "Launch:"; - this.radioButtonEndLaunch.UseVisualStyleBackColor = true; - this.radioButtonEndLaunch.CheckedChanged += new System.EventHandler(this.radioButtonEndLaunch_CheckedChanged); - // - // tabControl - // - this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.tabControl.Controls.Add(this.tabPageStart); - this.tabControl.Controls.Add(this.tabPageEnd); - this.tabControl.Location = new System.Drawing.Point(8, 8); - this.tabControl.Name = "tabControl"; - this.tabControl.SelectedIndex = 0; - this.tabControl.Size = new System.Drawing.Size(328, 208); - this.tabControl.TabIndex = 0; - // - // tabPageStart - // - this.tabPageStart.Controls.Add(this.groupBoxStartProgram); - this.tabPageStart.Controls.Add(this.radioButtonStartDoNothing); - this.tabPageStart.Controls.Add(this.radioButtonStartLaunch); - this.tabPageStart.Location = new System.Drawing.Point(4, 22); - this.tabPageStart.Name = "tabPageStart"; - this.tabPageStart.Padding = new System.Windows.Forms.Padding(3); - this.tabPageStart.Size = new System.Drawing.Size(320, 182); - this.tabPageStart.TabIndex = 0; - this.tabPageStart.Text = "When recording starts ..."; - this.tabPageStart.UseVisualStyleBackColor = true; - // - // groupBoxStartProgram - // - this.groupBoxStartProgram.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.groupBoxStartProgram.Controls.Add(this.labelStartParameters); - this.groupBoxStartProgram.Controls.Add(this.textBoxStartParameters); - this.groupBoxStartProgram.Controls.Add(this.buttonStartParameters); - this.groupBoxStartProgram.Controls.Add(this.labelStartProgram); - this.groupBoxStartProgram.Controls.Add(this.buttonStartProgram); - this.groupBoxStartProgram.Controls.Add(this.textBoxStartProgram); - this.groupBoxStartProgram.Location = new System.Drawing.Point(8, 64); - this.groupBoxStartProgram.Name = "groupBoxStartProgram"; - this.groupBoxStartProgram.Size = new System.Drawing.Size(304, 112); - this.groupBoxStartProgram.TabIndex = 2; - this.groupBoxStartProgram.TabStop = false; - this.groupBoxStartProgram.Text = "What to do"; - // - // labelStartParameters - // - this.labelStartParameters.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.labelStartParameters.Location = new System.Drawing.Point(8, 64); - this.labelStartParameters.Name = "labelStartParameters"; - this.labelStartParameters.Size = new System.Drawing.Size(256, 16); - this.labelStartParameters.TabIndex = 3; - this.labelStartParameters.Text = "Parameters:"; - this.labelStartParameters.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // labelStartProgram - // - this.labelStartProgram.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.labelStartProgram.Location = new System.Drawing.Point(8, 24); - this.labelStartProgram.Name = "labelStartProgram"; - this.labelStartProgram.Size = new System.Drawing.Size(256, 16); - this.labelStartProgram.TabIndex = 0; - this.labelStartProgram.Text = "Program:"; - this.labelStartProgram.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // tabPageEnd - // - this.tabPageEnd.Controls.Add(this.groupBoxEndProgram); - this.tabPageEnd.Controls.Add(this.radioButtonEndDoNothing); - this.tabPageEnd.Controls.Add(this.radioButtonEndLaunch); - this.tabPageEnd.Location = new System.Drawing.Point(4, 22); - this.tabPageEnd.Name = "tabPageEnd"; - this.tabPageEnd.Padding = new System.Windows.Forms.Padding(3); - this.tabPageEnd.Size = new System.Drawing.Size(320, 182); - this.tabPageEnd.TabIndex = 1; - this.tabPageEnd.Text = "When recording ends ..."; - this.tabPageEnd.UseVisualStyleBackColor = true; - // - // groupBoxEndProgram - // - this.groupBoxEndProgram.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.groupBoxEndProgram.Controls.Add(this.labelEndParameters); - this.groupBoxEndProgram.Controls.Add(this.textBoxEndParameters); - this.groupBoxEndProgram.Controls.Add(this.buttonEndParameters); - this.groupBoxEndProgram.Controls.Add(this.labelEndProgram); - this.groupBoxEndProgram.Controls.Add(this.buttonEndProgram); - this.groupBoxEndProgram.Controls.Add(this.textBoxEndProgram); - this.groupBoxEndProgram.Location = new System.Drawing.Point(8, 64); - this.groupBoxEndProgram.Name = "groupBoxEndProgram"; - this.groupBoxEndProgram.Size = new System.Drawing.Size(304, 112); - this.groupBoxEndProgram.TabIndex = 2; - this.groupBoxEndProgram.TabStop = false; - this.groupBoxEndProgram.Text = "What to do"; - // - // labelEndParameters - // - this.labelEndParameters.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.labelEndParameters.Location = new System.Drawing.Point(8, 64); - this.labelEndParameters.Name = "labelEndParameters"; - this.labelEndParameters.Size = new System.Drawing.Size(256, 16); - this.labelEndParameters.TabIndex = 3; - this.labelEndParameters.Text = "Parameters:"; - this.labelEndParameters.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // labelEndProgram - // - this.labelEndProgram.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.labelEndProgram.Location = new System.Drawing.Point(8, 24); - this.labelEndProgram.Name = "labelEndProgram"; - this.labelEndProgram.Size = new System.Drawing.Size(256, 16); - this.labelEndProgram.TabIndex = 0; - this.labelEndProgram.Text = "Program:"; - this.labelEndProgram.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // groupBoxTest - // - this.groupBoxTest.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.groupBoxTest.Controls.Add(this.textBoxTest); - this.groupBoxTest.Controls.Add(this.buttonTest); - this.groupBoxTest.Controls.Add(this.buttonFindTestFile); - this.groupBoxTest.Location = new System.Drawing.Point(8, 224); - this.groupBoxTest.Name = "groupBoxTest"; - this.groupBoxTest.Size = new System.Drawing.Size(328, 56); - this.groupBoxTest.TabIndex = 1; - this.groupBoxTest.TabStop = false; - this.groupBoxTest.Text = "Test"; - // - // Configuration - // - 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(344, 320); - this.Controls.Add(this.groupBoxTest); - this.Controls.Add(this.tabControl); - this.Controls.Add(this.buttonCancel); - this.Controls.Add(this.buttonOK); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.MinimumSize = new System.Drawing.Size(360, 356); - this.Name = "Configuration"; - this.ShowIcon = false; - this.ShowInTaskbar = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "ComSkip Launcher"; - this.tabControl.ResumeLayout(false); - this.tabPageStart.ResumeLayout(false); - this.groupBoxStartProgram.ResumeLayout(false); - this.groupBoxStartProgram.PerformLayout(); - this.tabPageEnd.ResumeLayout(false); - this.groupBoxEndProgram.ResumeLayout(false); - this.groupBoxEndProgram.PerformLayout(); - this.groupBoxTest.ResumeLayout(false); - this.groupBoxTest.PerformLayout(); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.Button buttonOK; - private System.Windows.Forms.Button buttonCancel; - private System.Windows.Forms.OpenFileDialog openFileDialog; - private System.Windows.Forms.Button buttonTest; - private System.Windows.Forms.TextBox textBoxTest; - private System.Windows.Forms.Button buttonFindTestFile; - private System.Windows.Forms.RadioButton radioButtonStartDoNothing; - private System.Windows.Forms.RadioButton radioButtonStartLaunch; - private System.Windows.Forms.ToolTip toolTips; - private System.Windows.Forms.TabControl tabControl; - private System.Windows.Forms.TabPage tabPageStart; - private System.Windows.Forms.TabPage tabPageEnd; - private System.Windows.Forms.GroupBox groupBoxTest; - private System.Windows.Forms.RadioButton radioButtonEndDoNothing; - private System.Windows.Forms.RadioButton radioButtonEndLaunch; - private System.Windows.Forms.Label labelEndParameters; - private System.Windows.Forms.TextBox textBoxEndParameters; - private System.Windows.Forms.Button buttonEndParameters; - private System.Windows.Forms.Label labelEndProgram; - private System.Windows.Forms.Button buttonEndProgram; - private System.Windows.Forms.TextBox textBoxEndProgram; - private System.Windows.Forms.GroupBox groupBoxEndProgram; - private System.Windows.Forms.GroupBox groupBoxStartProgram; - private System.Windows.Forms.Label labelStartParameters; - private System.Windows.Forms.TextBox textBoxStartParameters; - private System.Windows.Forms.Button buttonStartParameters; - private System.Windows.Forms.Label labelStartProgram; - private System.Windows.Forms.Button buttonStartProgram; - private System.Windows.Forms.TextBox textBoxStartProgram; - } -} \ No newline at end of file Deleted: trunk/plugins/ComSkipLauncher TVE3/Configuration.cs =================================================================== --- trunk/plugins/ComSkipLauncher TVE3/Configuration.cs 2007-03-11 13:44:57 UTC (rev 181) +++ trunk/plugins/ComSkipLauncher TVE3/Configuration.cs 2007-03-11 15:18:13 UTC (rev 182) @@ -1,176 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Diagnostics; -using System.Drawing; -using System.IO; -using System.Text; -using System.Windows.Forms; - -using MediaPortal.GUI.Library; - -namespace MediaPortal.Plugins -{ - - public partial class Configuration : Form - { - - #region Constants - - const string ParametersMessage = -@"{0} = Recorded filename (includes path) -{1} = Reco... [truncated message content] |