You can subscribe to this list here.
2007 |
Jan
(36) |
Feb
(79) |
Mar
(123) |
Apr
(95) |
May
(119) |
Jun
(172) |
Jul
(124) |
Aug
(100) |
Sep
(83) |
Oct
(52) |
Nov
(97) |
Dec
(87) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(131) |
Feb
(80) |
Mar
(163) |
Apr
(178) |
May
(73) |
Jun
(54) |
Jul
(106) |
Aug
(118) |
Sep
(50) |
Oct
(125) |
Nov
(100) |
Dec
(99) |
2009 |
Jan
(104) |
Feb
(99) |
Mar
(68) |
Apr
(81) |
May
(52) |
Jun
(87) |
Jul
(67) |
Aug
(33) |
Sep
(27) |
Oct
(37) |
Nov
(60) |
Dec
(116) |
2010 |
Jan
(82) |
Feb
(79) |
Mar
(38) |
Apr
(50) |
May
(45) |
Jun
(53) |
Jul
(23) |
Aug
(86) |
Sep
(22) |
Oct
(96) |
Nov
(97) |
Dec
(73) |
2011 |
Jan
(24) |
Feb
(45) |
Mar
(28) |
Apr
(31) |
May
(42) |
Jun
(25) |
Jul
|
Aug
(12) |
Sep
(28) |
Oct
(13) |
Nov
(43) |
Dec
(13) |
2012 |
Jan
(62) |
Feb
(28) |
Mar
(6) |
Apr
(16) |
May
(7) |
Jun
|
Jul
(16) |
Aug
(2) |
Sep
(1) |
Oct
(4) |
Nov
(1) |
Dec
(3) |
2013 |
Jan
(5) |
Feb
|
Mar
(34) |
Apr
(9) |
May
(6) |
Jun
(10) |
Jul
(32) |
Aug
(8) |
Sep
(11) |
Oct
(35) |
Nov
(24) |
Dec
(22) |
2014 |
Jan
(44) |
Feb
(9) |
Mar
(9) |
Apr
(15) |
May
(25) |
Jun
(34) |
Jul
(16) |
Aug
(11) |
Sep
(7) |
Oct
(6) |
Nov
(1) |
Dec
(12) |
2015 |
Jan
(33) |
Feb
(19) |
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(5) |
From: <nor...@us...> - 2007-08-27 23:31:19
|
Revision: 873 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=873&view=rev Author: northern_sky Date: 2007-08-27 16:31:18 -0700 (Mon, 27 Aug 2007) Log Message: ----------- Added Paths: ----------- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/skin/BlueTwo/myProgramsAlt.xml Added: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/skin/BlueTwo/myProgramsAlt.xml =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/skin/BlueTwo/myProgramsAlt.xml (rev 0) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/skin/BlueTwo/myProgramsAlt.xml 2007-08-27 23:31:18 UTC (rev 873) @@ -0,0 +1,72 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<window> + <id>3</id> + <defaultcontrol>2</defaultcontrol> + <allowoverlay>yes</allowoverlay> + <define>#header.label:#curheader</define> + <define>#header.image:programs_logo.png</define> + <define>#header.hover:hover_my programs.png</define> + <controls> + <import>common.window.xml</import> + <import>common.time.xml</import> + <control> + <description>group element</description> + <type>group</type> + <animation effect="fade" time="250">WindowOpen</animation> + <animation effect="fade" time="500">WindowClose</animation> + <animation effect="slide" time="250" start="-300,0">WindowOpen</animation> + <animation effect="slide" time="500" end="0,-300">WindowClose</animation> + <posX>60</posX> + <posY>97</posY> + <layout>StackLayout</layout> + <control> + <description>View-As</description> + <type>button</type> + <id>2</id> + <label>100</label> + <onright>50</onright> + <onup>17</onup> + </control> + <control> + <description>Sort</description> + <type>sortbutton</type> + <id>3</id> + <label>103</label> + <onright>50</onright> + </control> + <control> + <description>Switch View</description> + <type>button</type> + <id>4</id> + <label>457</label> + <onright>50</onright> + <ondown>3</ondown> + </control> + <control> + <description>Reimport</description> + <type>button</type> + <id>5</id> + <label>Reimport</label> + <onright>50</onright> + <ondown>99</ondown> + </control> + </control> + <control> + <description>Screenshot</description> + <type>image</type> + <animation effect="fade" time="250">WindowOpen</animation> + <animation effect="fade" time="500">WindowClose</animation> + <animation effect="slide" time="250" start="-300,0">WindowOpen</animation> + <animation effect="slide" time="500" end="0,-300">WindowClose</animation> + <id>6</id> + <posX>60</posX> + <posY>230</posY> + <width>190</width> + <height>190</height> + <texture /> + <align>center</align> + <keepaspectratio>yes</keepaspectratio> + </control> + <import>common.facade.xml</import> + </controls> +</window> \ 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: <nor...@us...> - 2007-08-27 23:30:35
|
Revision: 872 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=872&view=rev Author: northern_sky Date: 2007-08-27 16:30:33 -0700 (Mon, 27 Aug 2007) Log Message: ----------- cleanups Modified Paths: -------------- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesImportProgress.Designer.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesImportProgress.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsBase.Designer.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsBase.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsDirCache.Designer.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsDirCache.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGamebase.Designer.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGamebase.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGrouper.Designer.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGrouper.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsMame.Designer.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAlt.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/skin/BlueTwo/myProgramsAltFileInfo.xml Removed Paths: ------------- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/skin/BlueTwo/myProgramsAlt.xml Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesImportProgress.Designer.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesImportProgress.Designer.cs 2007-08-27 12:46:19 UTC (rev 871) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesImportProgress.Designer.cs 2007-08-27 23:30:33 UTC (rev 872) @@ -76,9 +76,9 @@ this.toolTip.SetToolTip(this.quoteCheckBox, "Quotes are usually needed to handle filenames with spaces correctly. \r\nAvoid doub" + "le quotes though!"); // - // allowRefreshCheckBox + // allowGUIImportCheckBox // - this.toolTip.SetToolTip(this.allowRefreshCheckBox, "Check this if users can run the import through the REFRESH button in MediaPortal." + + this.toolTip.SetToolTip(this.allowGUIImportCheckBox, "Check this if users can run the import through the REFRESH button in MediaPortal." + ""); // // progressBar @@ -125,7 +125,7 @@ this.Controls.SetChildIndex(this.quoteCheckBox, 0); this.Controls.SetChildIndex(this.applicationImageButton, 0); this.Controls.SetChildIndex(this.startupDirButton, 0); - this.Controls.SetChildIndex(this.allowRefreshCheckBox, 0); + this.Controls.SetChildIndex(this.allowGUIImportCheckBox, 0); this.Controls.SetChildIndex(this.informationLabel, 0); this.Controls.SetChildIndex(this.applicationExeTextBox, 0); this.Controls.SetChildIndex(this.progressBar, 0); Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesImportProgress.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesImportProgress.cs 2007-08-27 12:46:19 UTC (rev 871) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesImportProgress.cs 2007-08-27 23:30:33 UTC (rev 872) @@ -71,7 +71,7 @@ quoteCheckBox.Visible = false; - allowRefreshCheckBox.Visible = false; + allowGUIImportCheckBox.Visible = false; waitExitCheckBox.Visible = false; shellexecuteCheckBox.Visible = false; informationLabel.Visible = false; Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsBase.Designer.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsBase.Designer.cs 2007-08-27 12:46:19 UTC (rev 871) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsBase.Designer.cs 2007-08-27 23:30:33 UTC (rev 872) @@ -46,7 +46,7 @@ this.quoteCheckBox = new System.Windows.Forms.CheckBox(); this.applicationImageButton = new System.Windows.Forms.Button(); this.startupDirButton = new System.Windows.Forms.Button(); - this.allowRefreshCheckBox = new System.Windows.Forms.CheckBox(); + this.allowGUIImportCheckBox = new System.Windows.Forms.CheckBox(); this.informationLabel = new System.Windows.Forms.Label(); this.toolTip = new System.Windows.Forms.ToolTip(this.components); this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); @@ -227,15 +227,15 @@ this.startupDirButton.UseVisualStyleBackColor = true; this.startupDirButton.Click += new System.EventHandler(this.startupDirButton_Click); // - // allowRefreshCheckBox + // allowGUIImportCheckBox // - this.allowRefreshCheckBox.AutoSize = true; - this.allowRefreshCheckBox.Location = new System.Drawing.Point(5, 368); - this.allowRefreshCheckBox.Name = "allowRefreshCheckBox"; - this.allowRefreshCheckBox.Size = new System.Drawing.Size(154, 17); - this.allowRefreshCheckBox.TabIndex = 30; - this.allowRefreshCheckBox.Text = "Allow refresh in mediaportal"; - this.allowRefreshCheckBox.UseVisualStyleBackColor = true; + this.allowGUIImportCheckBox.AutoSize = true; + this.allowGUIImportCheckBox.Location = new System.Drawing.Point(5, 368); + this.allowGUIImportCheckBox.Name = "allowGUIImportCheckBox"; + this.allowGUIImportCheckBox.Size = new System.Drawing.Size(201, 17); + this.allowGUIImportCheckBox.TabIndex = 30; + this.allowGUIImportCheckBox.Text = "Allow reimport from within mediaportal"; + this.allowGUIImportCheckBox.UseVisualStyleBackColor = true; // // informationLabel // @@ -323,7 +323,7 @@ this.Controls.Add(this.startupDirComboBox); this.Controls.Add(this.applicationExeTextBox); this.Controls.Add(this.informationLabel); - this.Controls.Add(this.allowRefreshCheckBox); + this.Controls.Add(this.allowGUIImportCheckBox); this.Controls.Add(this.startupDirButton); this.Controls.Add(this.applicationImageButton); this.Controls.Add(this.quoteCheckBox); @@ -367,7 +367,7 @@ protected System.Windows.Forms.CheckBox quoteCheckBox; protected System.Windows.Forms.Button applicationImageButton; protected System.Windows.Forms.Button startupDirButton; - protected System.Windows.Forms.CheckBox allowRefreshCheckBox; + protected System.Windows.Forms.CheckBox allowGUIImportCheckBox; protected System.Windows.Forms.Label informationLabel; protected System.Windows.Forms.ToolTip toolTip; protected System.Windows.Forms.FolderBrowserDialog folderBrowserDialog; Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsBase.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsBase.cs 2007-08-27 12:46:19 UTC (rev 871) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsBase.cs 2007-08-27 23:30:33 UTC (rev 872) @@ -123,7 +123,7 @@ toolTip.SetToolTip(applicationImageTextBox, "Optional filename for an image to display in MediaPortal"); toolTip.SetToolTip(enabledCheckbox, "Only enabled items will appear in MediaPortal"); toolTip.SetToolTip(applicationExeTextBox, "Program you wish to execute, include the full path (mandatory if ShellExecute is " + "OFF)"); - toolTip.SetToolTip(allowRefreshCheckBox, "If you want to be able to run the import through the REFRESH button in MediaPortal."); + toolTip.SetToolTip(allowGUIImportCheckBox, "If you want to be able to run the import through the Reimport button in MediaPortal."); toolTip.SetToolTip(preCommandTextBox, "Configure an command to run as pre of the main filelaunching ie explorer; joy2key; etc .Separate with ;."); toolTip.SetToolTip(postCommandTextBox, "Configure an command to run as post of the main filelaunching ie explorer; joy2key; etc .Separate with ;."); toolTip.SetToolTip(waitExitCheckBox, "If you want mediaportal to wait for exit while running application."); Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsDirCache.Designer.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsDirCache.Designer.cs 2007-08-27 12:46:19 UTC (rev 871) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsDirCache.Designer.cs 2007-08-27 23:30:33 UTC (rev 872) @@ -71,9 +71,9 @@ this.toolTip.SetToolTip(this.quoteCheckBox, "Quotes are usually needed to handle filenames with spaces correctly. \r\nAvoid doub" + "le quotes though!"); // - // allowRefreshCheckBox + // allowGUIImportCheckBox // - this.toolTip.SetToolTip(this.allowRefreshCheckBox, "Check this if users can run the import through the REFRESH button in MediaPortal." + + this.toolTip.SetToolTip(this.allowGUIImportCheckBox, "Check this if users can run the import through the REFRESH button in MediaPortal." + ""); // // platformComboBox @@ -124,7 +124,7 @@ this.Controls.SetChildIndex(this.quoteCheckBox, 0); this.Controls.SetChildIndex(this.applicationImageButton, 0); this.Controls.SetChildIndex(this.startupDirButton, 0); - this.Controls.SetChildIndex(this.allowRefreshCheckBox, 0); + this.Controls.SetChildIndex(this.allowGUIImportCheckBox, 0); this.Controls.SetChildIndex(this.informationLabel, 0); this.Controls.SetChildIndex(this.applicationExeTextBox, 0); this.Controls.SetChildIndex(this.startupDirComboBox, 0); Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsDirCache.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsDirCache.cs 2007-08-27 12:46:19 UTC (rev 871) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsDirCache.cs 2007-08-27 23:30:33 UTC (rev 872) @@ -54,7 +54,7 @@ shellexecuteCheckBox.Checked = applicationItem.UseShellExecute; quoteCheckBox.Checked = applicationItem.UseQuotes; waitExitCheckBox.Checked = (applicationItem.WaitForExit); - allowRefreshCheckBox.Checked = applicationItem.RefreshGUIAllowed; + allowGUIImportCheckBox.Checked = applicationItem.RefreshGUIAllowed; if (applicationItem.PlatformId != 0) { platformComboBox.SelectedValue = applicationItem.PlatformId; @@ -76,7 +76,7 @@ curApp.UseQuotes = quoteCheckBox.Checked; curApp.WaitForExit = waitExitCheckBox.Checked; curApp.Item_Type = ItemType.DIRCACHE; - curApp.RefreshGUIAllowed = allowRefreshCheckBox.Checked; + curApp.RefreshGUIAllowed = allowGUIImportCheckBox.Checked; curApp.PlatformId = (int)platformComboBox.SelectedValue; } @@ -120,7 +120,7 @@ informationLabel.Text = "Directory Cache"; //untiil we really do something with this option in appdircache.. - allowRefreshCheckBox.Checked = false; + allowGUIImportCheckBox.Checked = false; } } Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGamebase.Designer.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGamebase.Designer.cs 2007-08-27 12:46:19 UTC (rev 871) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGamebase.Designer.cs 2007-08-27 23:30:33 UTC (rev 872) @@ -76,10 +76,10 @@ this.toolTip.SetToolTip(this.quoteCheckBox, "Quotes are usually needed to handle filenames with spaces correctly. \r\nAvoid doub" + "le quotes though!"); // - // allowRefreshCheckBox + // allowGUIImportCheckBox // - this.allowRefreshCheckBox.Location = new System.Drawing.Point(7, 366); - this.toolTip.SetToolTip(this.allowRefreshCheckBox, "Check this if users can run the import through the REFRESH button in MediaPortal." + + this.allowGUIImportCheckBox.Location = new System.Drawing.Point(7, 366); + this.toolTip.SetToolTip(this.allowGUIImportCheckBox, "Check this if users can run the import through the REFRESH button in MediaPortal." + ""); // // informationLabel Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGamebase.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGamebase.cs 2007-08-27 12:46:19 UTC (rev 871) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGamebase.cs 2007-08-27 23:30:33 UTC (rev 872) @@ -53,7 +53,7 @@ this.startupDirComboBox.Text = curApp.StartupDir; this.quoteCheckBox.Checked = true; //(applicationItem.UseQuotes); this.waitExitCheckBox.Checked = (curApp.WaitForExit); - this.allowRefreshCheckBox.Checked = curApp.RefreshGUIAllowed; + this.allowGUIImportCheckBox.Checked = curApp.RefreshGUIAllowed; } public override void SaveSettings(ApplicationItem curApp) @@ -65,7 +65,7 @@ curApp.UseQuotes = this.quoteCheckBox.Checked; curApp.WaitForExit = this.waitExitCheckBox.Checked; curApp.Item_Type = ItemType.GAMEBASE; - curApp.RefreshGUIAllowed = this.allowRefreshCheckBox.Checked; + curApp.RefreshGUIAllowed = this.allowGUIImportCheckBox.Checked; } Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGrouper.Designer.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGrouper.Designer.cs 2007-08-27 12:46:19 UTC (rev 871) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGrouper.Designer.cs 2007-08-27 23:30:33 UTC (rev 872) @@ -68,9 +68,9 @@ this.toolTip.SetToolTip(this.quoteCheckBox, "Quotes are usually needed to handle filenames with spaces correctly. \r\nAvoid doub" + "le quotes though!"); // - // allowRefreshCheckBox + // allowGUIImportCheckBox // - this.toolTip.SetToolTip(this.allowRefreshCheckBox, "Check this if users can run the import through the REFRESH button in MediaPortal." + + this.toolTip.SetToolTip(this.allowGUIImportCheckBox, "Check this if users can run the import through the REFRESH button in MediaPortal." + ""); // // AppSettingsGrouper Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGrouper.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGrouper.cs 2007-08-27 12:46:19 UTC (rev 871) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGrouper.cs 2007-08-27 23:30:33 UTC (rev 872) @@ -76,7 +76,7 @@ startupDirComboBox.Visible = false; quoteCheckBox.Visible = false; - allowRefreshCheckBox.Visible = false; + allowGUIImportCheckBox.Visible = false; waitExitCheckBox.Visible = false; shellexecuteCheckBox.Visible = false; informationLabel.Visible = false; Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsMame.Designer.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsMame.Designer.cs 2007-08-27 12:46:19 UTC (rev 871) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsMame.Designer.cs 2007-08-27 23:30:33 UTC (rev 872) @@ -74,9 +74,9 @@ this.toolTip.SetToolTip(this.quoteCheckBox, "Quotes are usually needed to handle filenames with spaces correctly. \r\nAvoid doub" + "le quotes though!"); // - // allowRefreshCheckBox + // allowGUIImportCheckBox // - this.toolTip.SetToolTip(this.allowRefreshCheckBox, "Check this if users can run the import through the REFRESH button in MediaPortal." + + this.toolTip.SetToolTip(this.allowGUIImportCheckBox, "Check this if users can run the import through the REFRESH button in MediaPortal." + ""); // // informationLabel @@ -155,7 +155,7 @@ this.Controls.SetChildIndex(this.quoteCheckBox, 0); this.Controls.SetChildIndex(this.applicationImageButton, 0); this.Controls.SetChildIndex(this.startupDirButton, 0); - this.Controls.SetChildIndex(this.allowRefreshCheckBox, 0); + this.Controls.SetChildIndex(this.allowGUIImportCheckBox, 0); this.Controls.SetChildIndex(this.groupBox1, 0); this.groupBox1.ResumeLayout(false); this.ResumeLayout(false); Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAlt.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAlt.cs 2007-08-27 12:46:19 UTC (rev 871) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAlt.cs 2007-08-27 23:30:33 UTC (rev 872) @@ -87,10 +87,10 @@ [SkinControl(4)] protected GUIButtonControl btnViews = null; [SkinControl(5)] - protected GUIButtonControl btnRefresh = null; + protected GUIButtonControl btnReimport = null; //Images [SkinControl(6)] - protected GUIImage screenShotImage = null; + protected GUIImage thumbGUIImage = null; [SkinControl(50)] protected GUIFacadeControl facadeView = null; @@ -148,30 +148,18 @@ set { currentSortMethod = value; } } - GUIListItem GetSelectedItem() + GUIListItem SelectedGUIListItem() { return facadeView.SelectedListItem; } - public int GetSelectedItemNo() + public int SelectedGUIListItemIndex() { return facadeView.SelectedListItemIndex; } - int GetCurrentFatherID() - { - if (currentApplicationItem != null) - { - return currentApplicationItem.ApplicationItemId; - } - else - { - return -1; // root - } - } - - bool ThereAreAppsToDisplay() + bool ApplicationItemSubItemsAllowed() { if (currentApplicationItem == null) { @@ -183,7 +171,7 @@ } } - bool IsCurrentApplicationItemNull() + bool IsCurrentApplicationItemNotNull() { return (currentApplicationItem != null); // all globalApplicationList can have files except the root } @@ -305,11 +293,11 @@ if (currentApplicationItem == null) { - btnRefresh.IsVisible = false; + btnReimport.IsVisible = false; } else { - btnRefresh.IsVisible = currentApplicationItem.RefreshGUIAllowed; + btnReimport.IsVisible = currentApplicationItem.RefreshGUIAllowed; } facadeView.IsVisible = true; @@ -372,31 +360,27 @@ } } - void ShowThumbPanel() + void ShouldShowThumbPanel() { - int itemIndex = facadeView.SelectedListItemIndex; - switch (CurrentLayout) { case Layout.List: facadeView.View = GUIFacadeControl.ViewMode.List; - screenShotImage.Visible = true; + thumbGUIImage.Visible = true; break; case Layout.Icons: facadeView.View = GUIFacadeControl.ViewMode.SmallIcons; - screenShotImage.Visible = false; + thumbGUIImage.Visible = false; break; case Layout.LargeIcons: facadeView.View = GUIFacadeControl.ViewMode.LargeIcons; - screenShotImage.Visible = false; + thumbGUIImage.Visible = false; break; case Layout.FilmStrip: facadeView.View = GUIFacadeControl.ViewMode.Filmstrip; - screenShotImage.Visible = false; + thumbGUIImage.Visible = false; break; } - facadeView.SelectedListItemIndex = itemIndex; - UpdateButtonStates(); } void RenderThumbnail(float timePassed) @@ -413,41 +397,35 @@ void RefreshThumbnail() { - ApplicationItem appWithImg = currentApplicationItem; - GUIListItem item = GetSelectedItem(); + GUIListItem selectedGUIListItem = SelectedGUIListItem(); // some preconditions... - if (item == null) return; - if (appWithImg == null) - { - if (item.MusicTag == null) return; - appWithImg = item.MusicTag as ApplicationItem; - if (appWithImg == null) return; - } - + if (selectedGUIListItem == null) return; + if (currentApplicationItem == null) return; + ThumbnailPath = ""; - if (item.ThumbnailImage != "" - && item.ThumbnailImage != GUIGraphicsContext.Skin + @"\media\DefaultFolderBig.png" - && item.ThumbnailImage != GUIGraphicsContext.Skin + @"\media\DefaultAlbum.png" + if (selectedGUIListItem.ThumbnailImage != "" + && selectedGUIListItem.ThumbnailImage != GUIGraphicsContext.Skin + @"\media\DefaultFolderBig.png" + && selectedGUIListItem.ThumbnailImage != GUIGraphicsContext.Skin + @"\media\DefaultAlbum.png" ) { // only show big thumb if there is really one.... - ThumbnailPath = appWithImg.GetCurThumb(item); // some modes look for thumbs differently + ThumbnailPath = currentApplicationItem.GetCurThumb(selectedGUIListItem); // some modes look for thumbs differently } - appWithImg.NextThumb(); // try to find a next thumbnail + currentApplicationItem.NextThumb(); // try to find a next thumbnail slideTime = (DateTime.Now.Ticks / 10000); // reset timer! } void UpdateListControl() { GUIControl.ClearControl(GetID, facadeView.GetID); - if (IsCurrentApplicationItemNull()) + if (IsCurrentApplicationItemNotNull()) ProgramUtils.AddBackButton(facadeView); int TotalItems = 0; - if (ThereAreAppsToDisplay()) + if (ApplicationItemSubItemsAllowed()) TotalItems += DisplayApps(); - if (IsCurrentApplicationItemNull()) + if (IsCurrentApplicationItemNotNull()) TotalItems += DisplayFiles(); if (currentApplicationItem != null) @@ -482,7 +460,7 @@ { int totalApps = 0; - foreach (ApplicationItem applicationItem in AppsOfFatherID(GetCurrentFatherID())) + foreach (ApplicationItem applicationItem in AppsOfFatherID(currentApplicationItem == null ? -1 : currentApplicationItem.ApplicationItemId)) { if (!applicationItem.Enabled) continue; @@ -491,6 +469,7 @@ // check whether to use thumbsdir or not string imgFile = String.Empty; + if (ProgramUtils.UseThumbsDir()) imgFile = ProgramUtils.GetApplicationImage(applicationItem); else @@ -511,7 +490,6 @@ } item.MusicTag = applicationItem; - //item.IsFolder = true; // pseudo-folder.... item.OnItemSelected += new GUIListItem.ItemSelectedHandler(SetItemThumb); facadeView.Add(item); } @@ -599,33 +577,8 @@ return applicationItemList; } - List<ApplicationItem> AppsOfFather(ApplicationItem father) - { - if (father == null) - { - return AppsOfFatherID(-1); // return children of root node! - } - else - { - return AppsOfFatherID(father.ApplicationItemId); - } - } - int GetMaxPosition(int fatherID) - { - int res = 0; - foreach (ApplicationItem curApp in globalApplicationList) - { - if ((curApp.FatherID == fatherID) && (curApp.Position > res)) - { - res = curApp.Position; - } - } - return res; - } - - /* public ApplicationItem CloneAppItem(ApplicationItem sourceApp) { ApplicationItem newApp = (ApplicationItem)ItemFactory.itemFactoryInstance.GetItem(sqlDB, sourceApp.Item_Type, null, 0); @@ -740,7 +693,7 @@ void ItemClicked() { - GUIListItem selectedGUIListItem = GetSelectedItem(); + GUIListItem selectedGUIListItem = SelectedGUIListItem(); if (selectedGUIListItem.MusicTag != null) { @@ -750,20 +703,18 @@ { currentApplicationItem = (ApplicationItem)item; - //SaveItemIndex(GetSelectedItemNo().ToString(), currentApplicationItem, currentApplicationItem.lastFilepath); + //SaveItemIndex(SelectedGUIListItemIndex().ToString(), currentApplicationItem, currentApplicationItem.lastFilepath); prevFilepath = currentApplicationItem.DefaultFilepath(); ViewHandler.CurrentLevel = 0; - //currentApplicationItem.ViewHandler = ViewHandler; } else if (item is FileItem) { FileItem fileItem = (FileItem)item; - selectedItemIndex = GetSelectedItemNo(); + selectedItemIndex = SelectedGUIListItemIndex(); if (currentApplicationItem != null) { - prevFilepath = currentApplicationItem.DefaultFilepath(); currentApplicationItem.LaunchFile(fileItem); } @@ -772,7 +723,6 @@ { FilterItem filterItem = (FilterItem)item; - // SaveItemIndex(GetSelectedItemNo().ToString(), currentApplicationItem, prevFilepath); ViewHandler.AddFilterItem(filterItem); if (currentApplicationItem != null) { @@ -781,7 +731,6 @@ } } - UpdateButtonStates(); UpdateListControl(); } @@ -796,6 +745,9 @@ int DisplayItemList(List<object> dbItems, GUIFacadeControl facadeView) { int totalItems = 0; + FileItem fileItem = null; + FilterItem filterItem = null; + GUIListItem guiListItem = null; foreach (object baseItem in dbItems) { @@ -803,23 +755,22 @@ if (baseItem is FileItem) { - FileItem curFile = baseItem as FileItem; - GUIListItem gli = new GUIListItem(curFile.Title); + fileItem = baseItem as FileItem; + guiListItem = new GUIListItem(fileItem.Title); - gli.MusicTag = curFile; - // gli.IsFolder = curFile.IsFolder; - gli.OnRetrieveArt += new MediaPortal.GUI.Library.GUIListItem.RetrieveCoverArtHandler(SetImageFile); - gli.OnItemSelected += new MediaPortal.GUI.Library.GUIListItem.ItemSelectedHandler(SetItemThumb); - facadeView.Add(gli); + guiListItem.MusicTag = fileItem; + // guiListItem.IsFolder = curFile.IsFolder; + guiListItem.OnRetrieveArt += new MediaPortal.GUI.Library.GUIListItem.RetrieveCoverArtHandler(SetImageFile); + guiListItem.OnItemSelected += new MediaPortal.GUI.Library.GUIListItem.ItemSelectedHandler(SetItemThumb); + facadeView.Add(guiListItem); } - if (baseItem is FilterItem) + else if (baseItem is FilterItem) { - FilterItem curFile = baseItem as FilterItem; - GUIListItem gli = new GUIListItem(curFile.Title); - gli.MusicTag = curFile; - //gli.IsFolder = false; - gli.OnItemSelected += new MediaPortal.GUI.Library.GUIListItem.ItemSelectedHandler(SetItemThumb); - facadeView.Add(gli); + filterItem = baseItem as FilterItem; + guiListItem = new GUIListItem(filterItem.Title); + guiListItem.MusicTag = filterItem; + guiListItem.OnItemSelected += new MediaPortal.GUI.Library.GUIListItem.ItemSelectedHandler(SetItemThumb); + facadeView.Add(guiListItem); } } return totalItems; @@ -855,12 +806,12 @@ void SelectSortMethod() { GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); + if (dlg == null) return; dlg.Reset(); dlg.SetHeading(495); - dlg.AddLocalizedString(268); // title dlg.AddLocalizedString(363); // filename dlg.AddLocalizedString(367); // rating @@ -921,8 +872,9 @@ if (currentApplicationItem == null) return; - selectedItemIndex = GetSelectedItemNo(); - GUIListItem item = GetSelectedItem(); + selectedItemIndex = SelectedGUIListItemIndex(); + + GUIListItem item = SelectedGUIListItem(); FileItem curFile = null; if (item.Label.Equals(ProgramUtils.cBackLabel)) return; @@ -942,19 +894,20 @@ void SetLabels() { + GUIListItem item = null; if (facadeView != null) { try { for (int i = 0; i < facadeView.Count; ++i) { - GUIListItem item = facadeView[i]; + item = facadeView[i]; ViewHandler.SetLabel(item.MusicTag as FileItem, ref item); } } catch (Exception ex) { - Log.Error("GUIMusicPlaylist: exception occured - item without Albumtag? - {0} / {1}", ex.Message, ex.StackTrace); + Log.Error("Exeption occured - item without Albumtag? - {0} / {1}", ex.Message, ex.StackTrace); } } } @@ -1024,7 +977,8 @@ } UpdateListControl(); - ShowThumbPanel(); + ShouldShowThumbPanel(); + UpdateButtonStates(); } @@ -1035,10 +989,10 @@ // make sure the selected index wasn't reseted already // and save the index only if it's non-zero // otherwise: DXDevice.Reset clears selection - int itemIndex = GetSelectedItemNo(); + int itemIndex = SelectedGUIListItemIndex(); if (itemIndex > 0) { - selectedItemIndex = GetSelectedItemNo(); + selectedItemIndex = SelectedGUIListItemIndex(); } if (dbHandlerInstance.SqlLiteConn.State == ConnectionState.Open) @@ -1098,12 +1052,11 @@ if (control == btnViewAs) { SwitchToNextViewLayout(); + ShouldShowThumbPanel(); + UpdateButtonStates(); - - ShowThumbPanel(); - } - else if (control == btnRefresh) + else if (control == btnReimport) { if (currentApplicationItem != null) { @@ -1167,7 +1120,7 @@ if (ThumbnailPath != _lastThumbnailPath) { - screenShotImage.FileName = ThumbnailPath; + thumbGUIImage.FileName = ThumbnailPath; facadeView.FilmstripView.InfoImageFileName = ThumbnailPath; facadeView.FilmstripView.NeedRefresh(); Deleted: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/skin/BlueTwo/myProgramsAlt.xml =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/skin/BlueTwo/myProgramsAlt.xml 2007-08-27 12:46:19 UTC (rev 871) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/skin/BlueTwo/myProgramsAlt.xml 2007-08-27 23:30:33 UTC (rev 872) @@ -1,72 +0,0 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<window> - <id>3</id> - <defaultcontrol>2</defaultcontrol> - <allowoverlay>yes</allowoverlay> - <define>#header.label:#curheader</define> - <define>#header.image:programs_logo.png</define> - <define>#header.hover:hover_my programs.png</define> - <controls> - <import>common.window.xml</import> - <import>common.time.xml</import> - <control> - <description>group element</description> - <type>group</type> - <animation effect="fade" time="250">WindowOpen</animation> - <animation effect="fade" time="500">WindowClose</animation> - <animation effect="slide" time="250" start="-300,0">WindowOpen</animation> - <animation effect="slide" time="500" end="0,-300">WindowClose</animation> - <posX>60</posX> - <posY>97</posY> - <layout>StackLayout</layout> - <control> - <description>View-As</description> - <type>button</type> - <id>2</id> - <label>100</label> - <onright>50</onright> - <onup>17</onup> - </control> - <control> - <description>Sort</description> - <type>sortbutton</type> - <id>3</id> - <label>103</label> - <onright>50</onright> - </control> - <control> - <description>Switch View</description> - <type>button</type> - <id>4</id> - <label>457</label> - <onright>50</onright> - <ondown>3</ondown> - </control> - <control> - <description>Refresh</description> - <type>button</type> - <id>5</id> - <label>184</label> - <onright>50</onright> - <ondown>99</ondown> - </control> - </control> - <control> - <description>Screenshot</description> - <type>image</type> - <animation effect="fade" time="250">WindowOpen</animation> - <animation effect="fade" time="500">WindowClose</animation> - <animation effect="slide" time="250" start="-300,0">WindowOpen</animation> - <animation effect="slide" time="500" end="0,-300">WindowClose</animation> - <id>6</id> - <posX>60</posX> - <posY>230</posY> - <width>190</width> - <height>190</height> - <texture /> - <align>center</align> - <keepaspectratio>yes</keepaspectratio> - </control> - <import>common.facade.xml</import> - </controls> -</window> \ No newline at end of file Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/skin/BlueTwo/myProgramsAltFileInfo.xml =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/skin/BlueTwo/myProgramsAltFileInfo.xml 2007-08-27 12:46:19 UTC (rev 871) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/skin/BlueTwo/myProgramsAltFileInfo.xml 2007-08-27 23:30:33 UTC (rev 872) @@ -63,13 +63,13 @@ <animation effect="fade" time="200">WindowClose</animation> </control> <control> - <description>Refresh</description> + <description>Refresh from AMG</description> <type>button</type> <id>5</id> <posX>60</posX> <posY>199</posY> <width>120</width> - <label>184</label> + <label>Allgame import</label> <onleft>22</onleft> <onright>22</onright> <onup>2</onup> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nor...@us...> - 2007-08-27 18:35:39
|
Revision: 866 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=866&view=rev Author: northern_sky Date: 2007-08-25 15:33:24 -0700 (Sat, 25 Aug 2007) Log Message: ----------- cleanup Modified Paths: -------------- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAlt.csproj trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ProgramUtils.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Properties/AssemblyInfo.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Properties/Resources.Designer.cs Added Paths: ----------- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAlt.cs Removed Paths: ------------- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs Deleted: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs 2007-08-25 00:37:22 UTC (rev 865) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIPrograms.cs 2007-08-25 22:33:24 UTC (rev 866) @@ -1,1519 +0,0 @@ -#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.Drawing; -using System.IO; -using System.Threading; -using System.Xml.Serialization; -using Microsoft.DirectX; -using Microsoft.DirectX.Direct3D; -using Direct3D = Microsoft.DirectX.Direct3D; - -using MediaPortal.Configuration; -using MediaPortal.Database; -using MediaPortal.Dialogs; -using MediaPortal.GUI.Library; -using MediaPortal.GUI.View; -using MediaPortal.Profile; -using MediaPortal.Util; - -using GUIPrograms.Items; -using GUIPrograms.Database; -using GUIPrograms.Design; -using System.Data.SQLite; -using System.Data; - -namespace GUIPrograms -{ - /// <summary> - /// The GUIPrograms plugin is used to list a collection of arbitrary files - /// and use them as arguments when launching external applications. - /// </summary> - /// - public class GUIPrograms : GUIWindow, ISetupForm, IShowPlugin - { - #region defaultOverrides - /// <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) - { - string strText = dbHandlerInstance.ReadSetting(ProgramUtils.cPLUGINTITLE); - if ((strText != "") && (strText != null)) - { - strButtonText = strText; - } - else - { - strButtonText = GUILocalizeStrings.Get(0); - } - strButtonImage = ""; - strButtonImageFocus = ""; - strPictureImage = ""; - return true; - } - - public string PluginName() - { - return "My Programs Alt. 0.1"; - } - public string Description() - { - return "Launches external applications"; - } - public string Author() - { - return "Reconstruct by Northern,Chefkoch,Org. by waebard"; - } - public void ShowPlugin() - { - SetupForm 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 (int)GUIWindow.Window.WINDOW_FILES; - } - - public bool DefaultEnabled() - { - return false; - } - - public bool HasSetup() - { - return true; - } - - #region IShowPlugin Members - - public bool ShowDefaultHome() - { - return false; - } - - #endregion - - #endregion defaultOverrides - - #region Serialisation - - [Serializable] - public class MapSettings - { - protected int sortMethod; - protected int viewLayout; - protected bool sortAscending; - protected int lastApplicationID; - protected int lastFileID; - protected int lastViewLevel; - protected bool overviewVisible; - - public MapSettings() - { - sortMethod = 0; //name - viewLayout = 0; //list - sortAscending = true; - overviewVisible = true; - lastApplicationID = -1; - lastFileID = -1; - lastViewLevel = 0; - } - - - [XmlElement("SortMethod")] - public int SortMethod - { - get { return sortMethod; } - set { sortMethod = value; } - } - - [XmlElement("ViewLayout")] - public int ViewLayout - { - get { return viewLayout; } - set { viewLayout = value; } - } - - [XmlElement("SortAscending")] - public bool SortAscending - { - get { return sortAscending; } - set { sortAscending = value; } - } - - [XmlElement("OverviewVisible")] - public bool OverviewVisible - { - get { return overviewVisible; } - set { overviewVisible = value; } - } - - [XmlElement("LastAppID")] - public int LastAppID - { - get { return lastApplicationID; } - set { lastApplicationID = value; } - } - - [XmlElement("LastFileID")] - public int LastFileID - { - get { return lastFileID; } - set { lastFileID = value; } - } - - [XmlElement("LastViewLevelID")] - public int LastViewLevel - { - get { return lastViewLevel; } - set { lastViewLevel = value; } - } - - - public string ViewLayoutTextName - { - get { return GetViewLayoutAsText(); } - } - - public void SwitchToNextViewLayout() - { - switch ((Layout)ViewLayout) - { - case Layout.List: - ViewLayout = (int)Layout.Icons; - - break; - case Layout.Icons: - ViewLayout = (int)Layout.LargeIcons; - - break; - case Layout.LargeIcons: - ViewLayout = (int)Layout.FilmStrip; - - break; - case Layout.FilmStrip: - ViewLayout = (int)Layout.List; - - break; - } - } - - string GetViewLayoutAsText() - { - string result = ""; - switch ((Layout)ViewLayout) - { - case Layout.List: - result = GUILocalizeStrings.Get(101); - break; - case Layout.Icons: - result = GUILocalizeStrings.Get(100); - break; - case Layout.LargeIcons: - result = GUILocalizeStrings.Get(417); - break; - case Layout.FilmStrip: - result = GUILocalizeStrings.Get(733); - break; - } - return result; - } - } - - - void SaveSettings() - { - using (Settings xmlwriter = new Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) - { - switch ((Layout)mapSettings.ViewLayout) - { - case Layout.List: - xmlwriter.SetValue("myprograms", "viewLayout", "list"); - break; - case Layout.Icons: - xmlwriter.SetValue("myprograms", "viewLayout", "icons"); - break; - case Layout.LargeIcons: - xmlwriter.SetValue("myprograms", "viewLayout", "largeicons"); - break; - case Layout.FilmStrip: - xmlwriter.SetValue("myprograms", "viewLayout", "filmstrip"); - break; - } - xmlwriter.SetValue("myprograms", "lastAppID", mapSettings.LastAppID.ToString()); - // xmlwriter.SetValue("myprograms", "lastViewLevel", mapSettings.LastViewLevel.ToString()); - xmlwriter.SetValue("myprograms", "lastViewLevel", ViewHandler.CurrentLevel); - xmlwriter.SetValue("myprograms", "sortMethod", mapSettings.SortMethod); - // avoid bool conversion...... don't wanna know why it doesn't work! :-( - if (mapSettings.SortAscending) - { - xmlwriter.SetValue("myprograms", "sortASC", "yes"); - } - else - { - xmlwriter.SetValue("myprograms", "sortASC", "no"); - } - - if (mapSettings.OverviewVisible) - { - xmlwriter.SetValue("myprograms", "overviewvisible", "yes"); - } - else - { - xmlwriter.SetValue("myprograms", "overviewvisible", "no"); - } - - xmlwriter.SetValue("myprograms", "startWindow", StartWindow.ToString()); - xmlwriter.SetValue("myprograms", "startview", (int)mapSettings.ViewLayout); - } - } - - void LoadSettings() - { - slideSpeed = ProgramUtils.GetSleepTime(); - - using (Settings xmlreader = new Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) - { - string curText = ""; - curText = xmlreader.GetValueAsString("myprograms", "viewLayout", "list"); - - if (curText == "list") mapSettings.ViewLayout = (int)Layout.List; - else if (curText == "icons") mapSettings.ViewLayout = (int)Layout.Icons; - else if (curText == "largeicons") mapSettings.ViewLayout = (int)Layout.LargeIcons; - else if (curText == "filmstrip") mapSettings.ViewLayout = (int)Layout.FilmStrip; - else mapSettings.ViewLayout = (int)Layout.List; - - CurrentSortMethod = (ProgramSort.SortMethod)xmlreader.GetValueAsInt("myprograms", "sortMethod", (int)ProgramSort.SortMethod.Title); - - mapSettings.LastAppID = xmlreader.GetValueAsInt("myprograms", "lastAppID", -1); - mapSettings.LastViewLevel = xmlreader.GetValueAsInt("myprograms", "lastViewLevel", -1); - mapSettings.SortAscending = xmlreader.GetValueAsBool("myprograms", "sortASC", true); - mapSettings.OverviewVisible = xmlreader.GetValueAsBool("myprograms", "sortASC", true); - - StartWindow = xmlreader.GetValueAsInt("myprograms", "startWindow", GetID); - } - } - - - void LoadLastAppIDFromSettings() - { - using (Settings xmlreader = new Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) - { - mapSettings.LastAppID = xmlreader.GetValueAsInt("myprograms", "lastAppID", -1); - mapSettings.LastViewLevel = xmlreader.GetValueAsInt("myprograms", "lastViewLevel", -1); - mapSettings.SortMethod = xmlreader.GetValueAsInt("myprograms", "sortMethod", 0); - mapSettings.SortAscending = xmlreader.GetValueAsBool("myprograms", "sortAsc", true); - mapSettings.OverviewVisible = xmlreader.GetValueAsBool("myprograms", "overviewvisible", true); - } - } - - void LoadFolderSettings(string directoryName) - { - if (directoryName == "") - directoryName = "root"; - object o; - FolderSettings.GetFolderSetting(directoryName, "Programs", typeof(MapSettings), out o); - if (o != null) - mapSettings = o as MapSettings; - if (mapSettings == null) - mapSettings = new MapSettings(); - } - - void SaveFolderSettings(string directoryName) - { - if (directoryName == "") - directoryName = "root"; - FolderSettings.AddFolderSetting(directoryName, "Programs", typeof(MapSettings), mapSettings); - } - - #endregion Serialisation - - #region SkinControls - - public enum Layout - { - List = 0, - Icons = 1, - LargeIcons = 2, - FilmStrip = 3, - } - - // Buttons - [SkinControl(2)] - protected GUIButtonControl btnViewAs = null; - [SkinControlAttribute(3)] - protected GUISortButtonControl btnSortBy = null; - [SkinControl(4)] - protected GUIButtonControl btnViews = null; - [SkinControl(5)] - protected GUIButtonControl btnRefresh = null; - //Images - [SkinControl(6)] - protected GUIImage screenShotImage = null; - - // FacadeView - const int facadeIDConst = 50; - [SkinControl(facadeIDConst)] - protected GUIFacadeControl facadeView = null; - - #endregion - - #region Constructor / Destructor - - public GUIPrograms() - { - dbHandlerInstance.LoadAllApplicationItems(); - globalApplicationList = dbHandlerInstance.ApplicationItemList; - GetID = (int)Window.WINDOW_FILES; - LoadSettings(); - skipInit = true; - } - - - #endregion - #region Init / DeInit - - void DeInitMyPrograms() - { - SaveSettings(); - - // make sure the selected index wasn't reseted already - // and save the index only if it's non-zero - // otherwise: DXDevice.Reset clears selection - int itemIndex = GetSelectedItemNo(); - if (itemIndex > 0) - { - selectedItemIndex = GetSelectedItemNo(); - } - - - if (dbHandlerInstance.SqlLiteConn.State == ConnectionState.Open) - { - dbHandlerInstance.SqlLiteConn.Close(); - } - } - - void InitMyPrograms() - { - LoadFolderSettings(""); - - if (skipInit) - { - mapSettings.LastAppID = -1; - } - else - { - LoadLastAppIDFromSettings(); // hacky load back the last applicationItem id, otherwise this can get lost from dx resets.... - } - lastApp = this.dbHandlerInstance.GetAppByID(mapSettings.LastAppID); - if (lastApp != null) - { - prevFilepath = lastApp.DefaultFilepath(); - this.CurrentSortAsc = mapSettings.SortAscending; - ViewHandler.CurrentLevel = mapSettings.LastViewLevel; - //lastApp.ViewHandler = this.ViewHandler; - } - else - { - prevFilepath = ""; - } - UpdateListControl(); - ShowThumbPanel(); - skipInit = false; - } - - #endregion - - #region Base & Content Variables - - - static int startWindow = (int)GUIWindow.Window.WINDOW_FILES; - protected ProgramSort.SortMethod currentSortMethod = ProgramSort.SortMethod.Title; - protected DatabaseHandler dbHandlerInstance = DatabaseHandler.DBHandlerInstance; - - bool currentSortAsc = true; - ProgramViewHandler viewHandler = ProgramViewHandler.Instance; - - List<ApplicationItem> globalApplicationList;// dbHandlerInstance.ApplicationItemList; - public MapSettings mapSettings = new MapSettings(); - DirectoryHistory itemHistory = new DirectoryHistory(); - public ApplicationItem lastApp = null; - - public string prevFilepath = ""; - public int selectedItemIndex = -1; - int slideSpeed = 3000; // speed in milliseconds between two slides - long slideTime = 0; - public Layout currentLayout = Layout.List; - - bool skipInit = false; - - static string _thumbnailPath = string.Empty; - static string _lastThumbnailPath = string.Empty; - - #endregion - - #region Properties / Helper Routines - - public ProgramViewHandler ViewHandler - { - get { return viewHandler; } - set { viewHandler = value; } - } - - public static string ThumbnailPath - { - get - { - return _thumbnailPath; - } - set - { - if (value == "") - _thumbnailPath = ""; - else if (File.Exists(value)) - _thumbnailPath = value; - } - } - - public int StartWindow - { - get { return startWindow; } - set { startWindow = value; } - } - - public virtual Layout CurrentLayout - { - get { return currentLayout; } - set { currentLayout = value; } - } - - bool CurrentSortAsc - { - get { return currentSortAsc; } - set { currentSortAsc = value; } - } - - protected virtual ProgramSort.SortMethod CurrentSortMethod - { - get { return currentSortMethod; } - set { currentSortMethod = value; } - } - - GUIListItem GetSelectedItem() - { - return facadeView.SelectedListItem; - } - - public int GetSelectedItemNo() - { - return facadeView.SelectedListItemIndex; - } - - int GetCurrentFatherID() - { - if (lastApp != null) - { - return lastApp.ApplicationItemId; - } - else - { - return -1; // root - } - } - - - bool ThereAreAppsToDisplay() - { - if (lastApp == null) - { - return true; // root has globalApplicationList - } - else - { - return lastApp.SubItemsAllowed(); // grouper items for example - } - } - - bool ThereAreFilesOrLinksToDisplay() - { - return (lastApp != null); // all globalApplicationList can have files except the root - } - - bool IsBackButtonNecessary() - { - return (lastApp != null); // always show back button except for root - } - - #endregion - - #region Overrides - - public override bool Init() - { - return Load(GUIGraphicsContext.Skin + @"\myProgramsAlt.xml"); - } - - protected override void OnPageLoad() - { - base.OnPageLoad(); - - if (btnSortBy != null) - btnSortBy.SortChanged += new SortEventHandler(SortChanged); - - InitMyPrograms(); - } - - protected override void OnPageDestroy(int newWindowId) - { - DeInitMyPrograms(); - base.OnPageDestroy(newWindowId); - } - - void SortChanged(object sender, SortEventArgs args) - { - this.CurrentSortAsc = args.Order != System.Windows.Forms.SortOrder.Descending; - - OnSort(); - UpdateButtonStates(); - } - - public override void OnAction(Action action) - { - switch (action.wID) - { - case Action.ActionType.ACTION_PARENT_DIR: - case Action.ActionType.ACTION_PREVIOUS_MENU: - // <U> keypress - BackItemClicked(); - UpdateButtonStates(); - break; - case Action.ActionType.ACTION_CLOSE_DIALOG: - SaveFolderSettings(""); - GUIWindowManager.ShowPreviousWindow(); - break; - case Action.ActionType.ACTION_SHOW_INFO: - OnInfo(); - break; - default: - base.OnAction(action); - break; - } - } - - public override bool OnMessage(GUIMessage message) - { - switch (message.Message) - { - case GUIMessage.MessageType.GUI_MSG_ITEM_FOCUS_CHANGED: - { - int iControl = message.SenderControlId; - if (iControl == facadeView.GetID) - { - if (lastApp != null) - { - lastApp.ResetThumbs(); - } - } - } - break; - } - return base.OnMessage(message); - } - - protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType) - { - base.OnClicked(controlId, control, actionType); - - if (control == btnViewAs) - { - mapSettings.SwitchToNextViewLayout(); - - - ShowThumbPanel(); - - } - else if (control == btnRefresh) - { - if (lastApp != null) - { - lastApp.Refresh(true); - prevFilepath = lastApp.DefaultFilepath(); - // todo: reset viewHandler - UpdateButtonStates(); - UpdateListControl(); - } - } - else if (control == btnViews) - { - OnShowViews(); - } - else if (control == btnSortBy) - { - OnShowSort(); - } - else if (control == facadeView) - { - // application or file-item was clicked.... - if (actionType == Action.ActionType.ACTION_SELECT_ITEM) - { - OnClick(); - } - } - } - - protected override void OnShowContextMenu() - { - GUIListItem item = facadeView.SelectedListItem; - int itemNo = facadeView.SelectedListItemIndex; - if (item == null) - return; - - GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); - if (dlg == null) - return; - dlg.Reset(); - dlg.SetHeading(498); // menu - - if (!((item.MusicTag) is ApplicationItem)) - { - dlg.AddLocalizedString(13041); //Show File Info - } - - dlg.DoModal(GetID); - if (dlg.SelectedId == -1) - return; - switch (dlg.SelectedId) - { - case 13041: // Show file info - OnInfo(); - break; - } - } - - public override void Render(float timePassed) - { - base.Render(timePassed); - - if (ThumbnailPath != _lastThumbnailPath) - { - screenShotImage.FileName = ThumbnailPath; - facadeView.FilmstripView.InfoImageFileName = ThumbnailPath; - facadeView.FilmstripView.NeedRefresh(); - - _lastThumbnailPath = ThumbnailPath; - } - RenderThumbnail(timePassed); - } - #endregion - - #region Display - - protected virtual void UpdateButtonStates() - { - string sortBy = string.Empty; - - GUIPropertyManager.SetProperty("#view", ViewHandler.LocalizedCurrentView); - - if (lastApp == null) - { - btnRefresh.IsVisible = false; - } - else - { - btnRefresh.IsVisible = lastApp.RefreshGUIAllowed; - } - - facadeView.IsVisible = true; - - GUIControl.FocusControl(GetID, facadeView.GetID); - - // display apptitle if available..... - if (lastApp != null) - { - if ((ViewHandler.CurrentView != null) && (ViewHandler.MaxLevels > 0)) - { - GUIPropertyManager.SetProperty("#curheader", ViewHandler.LocalizedCurrentView); - } - else - { - GUIPropertyManager.SetProperty("#curheader", lastApp.Title); - } - } - else - { - string strText = dbHandlerInstance.ReadSetting(ProgramUtils.cPLUGINTITLE); - if ((strText != "") && (strText != null)) - { - GUIPropertyManager.SetProperty("#curheader", strText); - } - else - { - GUIPropertyManager.SetProperty("#curheader", GUILocalizeStrings.Get(0)); - } - } - - btnViewAs.Label = mapSettings.ViewLayoutTextName; - - switch (CurrentSortMethod) - { - case ProgramSort.SortMethod.Title: - sortBy = GUILocalizeStrings.Get(268); - break; - case ProgramSort.SortMethod.Filename: - sortBy = GUILocalizeStrings.Get(363); - break; - case ProgramSort.SortMethod.Rating: - sortBy = GUILocalizeStrings.Get(367); - break; - case ProgramSort.SortMethod.LastTimeLaunched: //tmp until mapped - sortBy = "Sort by: Date launched"; - break; - case ProgramSort.SortMethod.LaunchCount: - sortBy = "Sort by: Times launchedSort by: Date launched"; //tmp - break; - case ProgramSort.SortMethod.Platform: - sortBy = "Sort by: Platform"; //tmp - break; - } - - if (btnSortBy != null) - { - btnSortBy.Label = sortBy; - btnSortBy.IsAscending = CurrentSortAsc; - } - } - - void ShowThumbPanel() - { - int itemIndex = facadeView.SelectedListItemIndex; - - switch ((Layout)mapSettings.ViewLayout) - { - case Layout.List: - facadeView.View = GUIFacadeControl.ViewMode.List; - screenShotImage.Visible = true; - break; - case Layout.Icons: - facadeView.View = GUIFacadeControl.ViewMode.SmallIcons; - screenShotImage.Visible = false; - break; - case Layout.LargeIcons: - facadeView.View = GUIFacadeControl.ViewMode.LargeIcons; - screenShotImage.Visible = false; - break; - case Layout.FilmStrip: - facadeView.View = GUIFacadeControl.ViewMode.Filmstrip; - screenShotImage.Visible = false; - break; - } - facadeView.SelectedListItemIndex = itemIndex; - UpdateButtonStates(); - } - - void RenderThumbnail(float timePassed) - { - // does the thumb needs replacing?? - long now = (DateTime.Now.Ticks / 10000); - long timeElapsed = now - slideTime; - if (timeElapsed >= (slideSpeed)) - { - RefreshThumbnail(); - // only refresh the picture, don't refresh the other data otherwise scrolling of labels is interrupted! - } - } - - void RefreshThumbnail() - { - ApplicationItem appWithImg = lastApp; - GUIListItem item = GetSelectedItem(); - - // some preconditions... - if (item == null) return; - if (appWithImg == null) - { - if (item.MusicTag == null) return; - appWithImg = item.MusicTag as ApplicationItem; - if (appWithImg == null) return; - } - - ThumbnailPath = ""; - if (item.ThumbnailImage != "" - && item.ThumbnailImage != GUIGraphicsContext.Skin + @"\media\DefaultFolderBig.png" - && item.ThumbnailImage != GUIGraphicsContext.Skin + @"\media\DefaultAlbum.png" - ) - { - // only show big thumb if there is really one.... - ThumbnailPath = appWithImg.GetCurThumb(item); // some modes look for thumbs differently - } - appWithImg.NextThumb(); // try to find a next thumbnail - slideTime = (DateTime.Now.Ticks / 10000); // reset timer! - } - - void UpdateListControl() - { - GUIControl.ClearControl(GetID, facadeView.GetID); - if (IsBackButtonNecessary()) - ProgramUtils.AddBackButton(facadeView); - - int TotalItems = 0; - if (ThereAreAppsToDisplay()) - TotalItems += DisplayApps(); - if (ThereAreFilesOrLinksToDisplay()) - TotalItems += DisplayFiles(); - - if (lastApp != null) - facadeView.Sort(new ProgramSort(CurrentSortMethod, CurrentSortAsc)); - - //set object count label - GUIPropertyManager.SetProperty("#itemcount", Utils.GetObjectCountLabel(TotalItems)); - - if (selectedItemIndex >= 0) - { - GUIControl.SelectItemControl(GetID, facadeView.GetID, selectedItemIndex); - } - SetLabels(); - } - - int DisplayFiles() - { - if (lastApp == null) return 0; - - // Refresh FileList if view has changed, while this appItem was not active - if ((lastApp.CurrentView != ViewHandler.CurrentView) || (lastApp.filesAreLoaded == false)) - { - lastApp.LoadFiles(); - lastApp.CurrentView = ViewHandler.CurrentView; - } - int totalFiles = 0; - totalFiles = totalFiles + DisplayItemList(lastApp.ItemList, facadeView); - return (totalFiles); - } - - int DisplayApps() - { - int totalApps = 0; - - foreach (ApplicationItem applicationItem in AppsOfFatherID(GetCurrentFatherID())) - { - if (!applicationItem.Enabled) continue; - - totalApps++; - GUIListItem item = new GUIListItem(applicationItem.Title); - - // check whether to use thumbsdir or not - string imgFile = String.Empty; - if (ProgramUtils.UseThumbsDir()) - imgFile = ProgramUtils.GetApplicationImage(applicationItem); - else - imgFile = applicationItem.Imagefile; - - // use skin default image if file does not exist - if (File.Exists(imgFile)) - { - item.ThumbnailImage = imgFile; - item.IconImageBig = imgFile; - item.IconImage = imgFile; - } - else - { - item.ThumbnailImage = GUIGraphicsContext.Skin + @"\media\DefaultFolderBig.png"; - item.IconImageBig = GUIGraphicsContext.Skin + @"\media\DefaultFolderBig.png"; - item.IconImage = GUIGraphicsContext.Skin + @"\media\DefaultFolderNF.png"; - } - - item.MusicTag = applicationItem; - //item.IsFolder = true; // pseudo-folder.... - item.OnItemSelected += new GUIListItem.ItemSelectedHandler(OnItemSelected); - facadeView.Add(item); - } - return (totalApps); - } - - string BuildHistoryKey(ApplicationItem app, int viewLevel, string pathSub) - { - int appID; - if (app != null) - { - appID = app.ApplicationItemId; - } - else - { - appID = 1; // root - } - return String.Format("applicationItem{0}#level{1}#sub_{2}", appID, viewLevel, pathSub); - } - - public void SaveItemIndex(string value, ApplicationItem app, string pathSub) - { - string key = BuildHistoryKey(app, ViewHandler.CurrentLevel, pathSub); - itemHistory.Set(value, key); - } - - void RestoreItemIndex(ApplicationItem app, string pathSub) - { - string key = BuildHistoryKey(app, ViewHandler.CurrentLevel, pathSub); - string itemHist = itemHistory.Get(key); - if (itemHist != "") - { - int itemIndex = ProgramUtils.StringToInteger(itemHist, -1); - if ((itemIndex >= 0) && (itemIndex <= facadeView.Count - 1)) - { - GUIControl.SelectItemControl(GetID, facadeView.GetID, itemIndex); - } - } - } - - #endregion - - #region EventHandlers - - void BackItemClicked() - { - if (lastApp != null) - { - if ((prevFilepath != null) && (prevFilepath != "") && (prevFilepath != lastApp.FileDirectory)) - { - // back item in filelist clicked - prevFilepath = Path.GetDirectoryName(prevFilepath); - } - else - { - if (ViewHandler.RemoveFilterItem()) - { - FilterItem curFilter; - // force reload, this will load the next filter-level..... - lastApp.LoadFiles(); - // auto-remove filters if there is only ONE EMPTY Filteritem - // displaying - bool doAutoRemove = ((lastApp.ItemList.Count == 1) && (ViewHandler.IsFilterQuery)); - while (doAutoRemove) - { - doAutoRemove = false; - if (lastApp.ItemList[0] is FilterItem) - { - curFilter = lastApp.ItemList[0] as FilterItem; - if ((curFilter.Title == "") && (curFilter.Title2 == "")) - { - if (ViewHandler.RemoveFilterItem()) - { - lastApp.LoadFiles(); - doAutoRemove = ((lastApp.ItemList.Count == 1) && (ViewHandler.IsFilterQuery)); - } - } - } - } - } - else - { - // back item in application list clicked - // go to father item - lastApp = this.dbHandlerInstance.GetAppByID(lastApp.FatherID); - if (lastApp != null) - { - mapSettings.LastAppID = lastApp.ApplicationItemId; - prevFilepath = lastApp.DefaultFilepath(); - } - else - { - // back to home screen..... - mapSettings.LastAppID = -1; - prevFilepath = ""; - } - } - } - UpdateButtonStates(); - UpdateListControl(); - RestoreItemIndex(lastApp, prevFilepath); - } - else - { - // from root.... go back to main menu - GUIWindowManager.ShowPreviousWindow(); - } - - - } - - public List<ApplicationItem> AppsOfFatherID(int FatherID) - { - List<ApplicationItem> applicationItemList = new List<ApplicationItem>(); - - foreach (ApplicationItem curApp in globalApplicationList) - { - if (curApp.FatherID == FatherID) - { - applicationItemList.Add(curApp); - } - } - return applicationItemList; - } - - public List<ApplicationItem> AppsOfFather(ApplicationItem father) - { - if (father == null) - { - return AppsOfFatherID(-1); // return children of root node! - } - else - { - return AppsOfFatherID(father.ApplicationItemId); - } - } - - public int GetMaxPosition(int fatherID) - { - int res = 0; - foreach (ApplicationItem curApp in globalApplicationList) - { - if ((curApp.FatherID == fatherID) && (curApp.Position > res)) - { - res = curApp.Position; - } - } - return res; - } - - - - /* public ApplicationItem CloneAppItem(ApplicationItem sourceApp) - { - ApplicationItem newApp = (ApplicationItem)ItemFactory.itemFactoryInstance.GetItem(sqlDB, sourceApp.Item_Type, null, 0); - newApp.Assign(sourceApp); - newApp.ApplicationItemId = -1; // to force a sql INSERT when written - Add(newApp); - return newApp; - }*/ - - //TO DO - //Fix this method - void ScrapeFileInfo(FileItem curFile) - { - int minRelevance = 30; - bool bSuccess = false; - ScraperSaveType saveType = ScraperSaveType.DataAndImages; - GUIDialogOK dlgOk = (GUIDialogOK)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_OK); - GUIDialogProgress dlgProgress = (GUIDialogProgress)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_PROGRESS); - dlgProgress.ShowWaitCursor = false; - dlgProgress.ShowProgressBar(false); - dlgProgress.SetHeading("Lookup Gameinfo"); - dlgProgress.SetLine(1, curFile.Title); - dlgProgress.SetLine(2, curFile.Platform); - dlgProgress.SetLine(3, ""); - dlgProgress.StartModal(GetID); - // dlgProgress.SetPercentage(60); - dlgProgress.Progress(); - bSuccess = curFile.FindFileInfo(ScraperType.ALLGAME); - if ((bSuccess && curFile.FileInfoList.Count > 0) && ((FileItemInfo)(curFile.FileInfoList[0])).RelevanceNorm >= minRelevance) - { - GUIDialogSelect pDlg = (GUIDialogSelect)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_SELECT); - if (null != pDlg) - { - pDlg.Reset(); - pDlg.SetHeading("Select Title"); - foreach (FileItemInfo item in curFile.FileInfoList) - { - if (item.RelevanceNorm >= minRelevance) - { - pDlg.Add(String.Format("{0} ({1})", item.Title, item.Platform)); - } - } - pDlg.DoModal(GetID); - - // and wait till user selects one - int iSelectedGame = pDlg.SelectedLabel; - if (iSelectedGame < 0) return; - - dlgProgress.StartModal(GetID); - dlgProgress.Progress(); - dlgProgress.ShowProgressBar(false); - curFile.FileInfoFavourite = (FileItemInfo)curFile.FileInfoList[iSelectedGame]; - - curFile.FindFileInfoDetail(lastApp, curFile.FileInfoFavourite, ScraperType.ALLGAME, saveType); - if ((saveType == ScraperSaveType.DataAndImages) || (saveType == ScraperSaveType.Data)) - { - // dlgProgress.SetPercentage(60); - dlgProgress.Progress(); - curFile.SaveFromFileInfoFavourite(false); - } - // dlgProgress.SetPercentage(100); - dlgProgress.Progress(); - dlgProgress.Close(); - dlgProgress = null; - } - OnInfo(); - } - else - { - string strMsg = ""; - if (!bSuccess) - { - strMsg = "Connection failed"; - Log.Info("myPrograms: RefreshData failed"); - } - else - { - strMsg = String.Format("No match for '{0}'", curFile.Title); - Log.Info("myPrograms: No data found for '{0}'", curFile.Title); - } - if (null != dlgOk) - { - dlgOk.SetHeading(187); - dlgOk.SetLine(1, strMsg); - dlgOk.SetLine(2, String.Empty); - dlgOk.DoModal(GetID); - } - } - } - - /* protected void OnItemSelected(GUIListItem item, GUIControl parent) - { - GUIPrograms.ThumbnailPath = ""; - if (item.ThumbnailImage != "" - && item.ThumbnailImage != GUIGraphicsContext.Skin + @"\media\DefaultFolderBig.png" - && item.ThumbnailImage != GUIGraphicsContext.Skin + @"\media\DefaultAlbum.png" - ) - { - // only show big thumb if there is really one.... - GUIPrograms.ThumbnailPath = item.ThumbnailImage; - } - }*/ - - void OnItemSelected(GUIListItem item, GUIControl parent) - { - ThumbnailPath = ""; - if (item.ThumbnailImage != "" - && item.ThumbnailImage != GUIGraphicsContext.Skin + @"\media\DefaultFolderBig.png" - && item.ThumbnailImage != GUIGraphicsContext.Skin + @"\media\DefaultAlbum.png") - { - // only show big thumb if there is really one.... - ThumbnailPath = item.ThumbnailImage; - } - - GUIFilmstripControl filmstrip = parent as GUIFilmstripControl; - if (filmstrip != null) - { - filmstrip.InfoImageFileName = ThumbnailPath; - } - } - - void OnClick() - { - GUIListItem selectedGUIListItem = GetSelectedItem(); - - if (selectedGUIListItem.MusicTag != null) - { - object item = selectedGUIListItem.MusicTag; - - if (item is ApplicationItem) - { - - lastApp = (ApplicationItem)item; - SaveItemIndex(GetSelectedItemNo().ToString(), lastApp, lastApp.lastFilepath); - mapSettings.LastAppID = lastApp.ApplicationItemId; - prevFilepath = lastApp.DefaultFilepath(); - ViewHandler.CurrentLevel = 0; - //lastApp.ViewHandler = ViewHandler; - } - else if (item is FileItem) - { - FileItem fileItem = (FileItem)item; - selectedItemIndex = GetSelectedItemNo(); - - if (lastApp != null) - { - mapSettings.LastAppID = lastApp.ApplicationItemId; - prevFilepath = lastApp.DefaultFilepath(); - lastApp.LaunchFile(fileItem); - } - } - else if (item is FilterItem) - { - FilterItem filterItem = (FilterItem)item; - - SaveItemIndex(GetSelectedItemNo().ToString(), lastApp, prevFilepath); - ViewHandler.AddFilterItem(filterItem); - if (lastApp != null) - { - // force reload, this will load the next filter-level..... - lastApp.LoadFiles(); - } - } - - - UpdateButtonStates(); - UpdateListControl(); - } - else if (selectedGUIListItem.Label.Equals(ProgramUtils.cBackLabel)) - { // folder-item clicked.... - selectedItemIndex = -1; - BackItemClicked(); - UpdateButtonStates(); - } - } - - #region moved from BaseItem - - public int DisplayItemList(List<object> dbItems, GUIFacadeControl facadeView) - { - int totalItems = 0; - - foreach (object baseItem in dbItems) - { - totalItems = totalItems + 1; - - if (baseItem is FileItem) - { - FileItem curFile = baseItem as FileItem; - GUIListItem gli = new GUIListItem(curFile.Title); - - gli.MusicTag = curFile; - // gli.IsFolder = curFile.IsFolder; - gli.OnRetrieveArt += new MediaPortal.GUI.Library.GUIListItem.RetrieveCoverArtHandler(OnRetrieveCoverArt); - gli.OnItemSelected += new MediaPortal.GUI.Library.GUIListItem.ItemSelectedHandler(OnItemSelected); - facadeView.Add(gli); - } - if (baseItem is FilterItem) - { - FilterItem curFile = baseItem as FilterItem; - GUIListItem gli = new GUIListItem(curFile.Title); - gli.MusicTag = curFile; - //gli.IsFolder = false; - gli.OnItemSelected += new MediaPortal.GUI.Library.GUIListItem.ItemSelectedHandler(OnItemSelected); - facadeView.Add(gli); - } - } - return totalItems; - } - - protected void OnRetrieveCoverArt(GUIListItem guiListItem) - { - if (guiListItem.MusicTag == null) return; - FileItem curFileItem = (FileItem)guiListItem.MusicTag; - if (curFileItem == null) return; - - string imgFile = String.Empty; - - if (ProgramUtils.UseThumbsDir()) - imgFile = ProgramUtils.GetFileImage(lastApp, curFileItem); - else - imgFile = curFileItem.Imagefile; - - if (File.Exists(imgFile)) - { - guiListItem.ThumbnailImage = imgFile; - guiListItem.IconImageBig = imgFile; - guiListItem.IconImage = imgFile; - } - else - { - guiListItem.ThumbnailImage = GUIGraphicsContext.Skin + @"\media\DefaultFolderBig.png"; - guiListItem.IconImageBig = GUIGraphicsContext.Skin + @"\media\DefaultFolderBig.png"; - guiListItem.IconImage = GUIGraphicsContext.Skin + @"\media\DefaultFolderNF.png"; - } - } - - #endregion - - protected void OnShowSort() - { - GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); - if (dlg == null) - return; - dlg.Reset(); - dlg.SetHeading(495); - - - dlg.AddLocalizedString(268); // title - dlg.AddLocalizedString(363); // filename - dlg.AddLocalizedString(367); // rating - dlg.Add("Sort by: Times launched");//"LaunchCount"//whats the mapping to these??? - dlg.Add("Sort by: Date launched"); - dlg.Add("Sort by: Platform"); - - - dlg.DoModal(GetID); - - if (dlg.SelectedLabel == -1) - return; - - switch (dlg.SelectedId) - { - case 268: - CurrentSortMethod = ProgramSort.SortMethod.Title; - break; - case 363: - CurrentSortMethod = ProgramSort.SortMethod.Filename; - break; - case 367: - CurrentSortMethod = ProgramSort.SortMethod.Rating; - break; - default: - CurrentSortMethod = ProgramSort.SortMethod.Title; - break; - } - //ToDo - //tmp fix until all mappings in place. - switch (dlg.SelectedLabelText) - { - case "Sort by: Times launched": - CurrentSortMethod = ProgramSort.SortMethod.LaunchCount; - break; - case "Sort by: Date launched": - CurrentSortMethod = ProgramSort.SortMethod.LastTimeLaunched; - break; - case "Sort by: Platform": - CurrentSortMethod = ProgramSort.SortMethod.Platform; - break; - default: - break; - } - - - OnSort(); - GUIControl.FocusControl(GetID, btnSortBy.GetID); - } - - protected virtual void OnSort() - { - SetLabels(); - facadeView.Sort(new ProgramSort(CurrentSortMethod, CurrentSortAsc)); - UpdateButtonStates(); - } - - protected void OnInfo() - { - - if (lastApp == null) return; - - selectedItemIndex = GetSelectedItemNo(); - GUIListItem item = GetSelectedItem(); - FileItem curFile = null; - - if (item.Label.Equals(ProgramUtils.cBackLabel)) return; - if (item.MusicTag == null) return; - if (item.MusicTag is ApplicationItem) return; - - if (item.MusicTag is FileItem) - { - curFile = (FileItem)item.MusicTag; - GUIProgramsAltFileInfo fileInfo = (GUIProgramsAltFileInfo)GUIWindowManager.GetWindow(9999); - fileInfo.CurrentFileItem = curFile; - fileInfo.CurrentApplicationItem = lastApp; - fileInfo.FolderForThumbs = string.Empty; - GUIWindowManager.ActivateWindow(9999); - } - } - - protected void SetLabels() - { - if (facadeView != null) - { - try - { - for (int i = 0; i < facadeView.Count; ++i) - { - GUIListItem item = facadeView[i]; - ViewHandler.SetLabel(item.MusicTag as FileItem, ref item); - } - } - catch (Exception ex) - { - Log.Error("GUIMusicPlaylist: exception occured - item without Albumtag? - {0} / {1}", ex.Message, ex.StackTrace); - } - } - } - - void OnShowViews() - { - GUIDialogMenu dlg = (GUIDialogMenu)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_MENU); - if (dlg == null) return; - dlg.Reset(); - dlg.SetHeading(499); // Actions - dlg.Add(GUILocalizeStrings.Get(100000 + GetID)); // Files - foreach (ViewDefinition view in ViewHandler.Views) - { - dlg.Add(view.LocalizedName); - } - dlg.DoModal(GetID); - if (dlg.SelectedLabel == -1) return; - if (dlg.SelectedLabel == 0) - { - int nNewWindow = (int)Window.WINDOW_FILES; - StartWindow = nNewWindow; - mapSettings.ViewLayout = (int)Layout.List; - ViewHandler.CurrentView = GUILocalizeStrings.Get(100000 + GetID);//my files - if (nNewWindow != GetID) - { - GUIWindowManager.ReplaceWindow(nNewWindow); - } - } - else - { - ViewDefinition selectedView = (ViewDefinition)ViewHandler.Views[dlg.SelectedLabel - 1]; - ViewHandler.CurrentView = selectedView.Name; - int nNewWindow = (int)Window.WINDOW_FILES; - if (GetID != nNewWindow) - { - StartWindow = nNewWindow; - if (nNewWindow != GetID) - { - GUIWindowManager.ReplaceWindow(nNewWindow); - } - } - else - { - if (facadeView.Count <= 0) - { - GUIControl.FocusControl(GetID, btnViewAs.GetID); - } - } - } - - UpdateButtonStates(); - UpdateListControl(); - } - - #endregion - } -} \ No newline at end of file Added: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAlt.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAlt.cs (rev 0) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAlt.cs 2007-08-25 22:33:24 UTC (rev 866) @@ -0,0 +1,1496 @@ +#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.Drawing; +using System.IO; +using System.Threading; +using System.Xml.Serialization; +using Microsoft.DirectX; +using Microsoft.DirectX.Direct3D; +using Direct3D = Microsoft.DirectX.Direct3D; + +using MediaPortal.Configuration; +using MediaPortal.Database; +using MediaPortal.Dialogs; +using MediaPortal.GUI.Library; +using MediaPortal.GUI.View; +using MediaPortal.Profile; +using MediaPortal.Util; + +using GUIPrograms.Items; +using GUIPrograms.Database; +using GUIPrograms.Design; +using System.Data.SQLite; +using System.Data; + +namespace GUIPrograms +{ + /// <summary> + /// The GUIProgramsAlt plugin is used to list a collection of arbitrary files + /// and use them as arguments when launching external applications. + /// </summary> + /// + public class GUIProgramsAlt : GUIWindow, ISetupForm, IShowPlugin + { + + #region Serialisation + + [Serializable] + public class MapSettings + { + protected int sortMethod; + protected int viewLayout; + protected bool sortAscending; + protected int lastApplicationID; + protected int lastFileID; + protected int lastViewLevel; + protected bool overviewVisible; + + public MapSettings() + { + sortMethod = 0; //name + viewLayout = 0; //list + sortAscending = true; + overviewVisible = true; + lastApplicationID = -1; + lastFileID = -1; + lastViewLevel = 0; + } + + + [XmlElement("SortMethod")] + public int SortMethod + { + get { return sortMethod; } + set { sortMethod = value; } + } + + [XmlElement("ViewLayout")] + public int ViewLayout + { + get { return viewLayout; } + set { viewLayout = value; } + } + + [XmlElement("SortAscending")] + public bool SortAscending + { + get { return sortAscending; } + set { sortAscending = value; } + } + + [XmlElement("OverviewVisible")] + public bool OverviewVisible + { + get { return overviewVisible; } + set { overviewVisible = value; } + } + + [XmlElement("LastAppID")] + public int LastAppID + { + get { return lastApplicationID; } + set { lastApplicationID = value; } + } + + [XmlElement("LastFileID")] + public int LastFileID + { + get { return lastFileID; } + set { lastFileID = value; } + } + + [XmlElement("LastViewLevelID")] + public int LastViewLevel + { + get { return lastViewLevel; } + set { lastViewLevel = value; } + } + + + public string ViewLayoutTextName + { + get { return GetViewLayoutAsText(); } + } + + public void SwitchToNextViewLayout() + { + switch ((Layout)ViewLayout) + { + case Layout.List: + ViewLayout = (int)Layout.Icons; + + break; + case Layout.Icons: + ViewLayout = (int)Layout.LargeIcons; + + break; + case Layout.LargeIcons: + ViewLayout = (int)Layout.FilmStrip; + + break; + case Layout.FilmStrip: + ViewLayout = (int)Layout.List; + + break; + } + } + + string GetViewLayoutAsText() + { + string result = ""; + switch ((Layout)ViewLayout) + { + case Layout.List: + result = GUILocalizeStrings.Get(101); + break; + case Layout.Icons: + result = GUILocalizeStrings.Get(100); + break; + case Layout.LargeIcons: + result = GUILocalizeStrings.Get(417); + break; + case Layout.FilmStrip: + result = GUILocalizeStrings.Get(733); + break; + } + return result; + } + } + + + void SaveSettings() + { + using (Settings xmlwriter = new Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + { + switch ((Layout)mapSettings.ViewLayout) + { + case Layout.List: + xmlwriter.SetValue("myprograms", "viewLayout", "list"); + break; + case Layout.Icons: + xmlwriter.SetValue("myprograms", "viewLayout", "icons"); + break; + case Layout.LargeIcons: + xmlwriter.SetValue("myprograms", "viewLayout", "largeicons"); + break; + case Layout.FilmStrip: + xmlwriter.SetValue("myprograms", "viewLayout", "filmstrip"); + break; + } + xmlwriter.SetValue("myprograms", "lastAppID", mapSettings.LastAppID.ToString()); + // xmlwriter.SetValue("myprograms", "lastViewLevel", mapSettings.LastViewLevel.ToString()); + xmlwriter.SetValue("myprograms", "lastViewLevel", ViewHandler.CurrentLevel); + xmlwriter.SetValue("myprograms", "sortMethod", mapSettings.SortMethod); + // avoid bool conversion...... don't wanna know why it doesn't work! :-( + if (mapSettings.SortAscending) + { + xmlwriter.SetValue("myprograms", "sortASC", "yes"); + } + else + { + xmlwriter.SetValue("myprograms", "sortASC", "no"); + } + + if (mapSettings.OverviewVisible) + { + xmlwriter.SetValue("myprograms", "overviewvisible", "yes"); + } + else + { + xmlwriter.SetValue("myprograms", "overviewvisible", "no"); + } + + xmlwriter.SetValue("myprograms", "startWindow", StartWindow.ToString()); + xmlwriter.SetValue("myprograms", "startview", (int)mapSettings.ViewLayout); + } + } + + void LoadSettings() + { + slideSpeed = ProgramUtils.GetSleepTime(); + + using (Settings xmlreader = new Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + { + string curText = ""; + curText = xmlreader.GetValueAsString("myprograms", "viewLayout", "list"); + + if (curText == "list") mapSettings.ViewLayout = (int)Layout.List; + else if (curText == "icons") mapSettings.ViewLayout = (int)Layout.Icons; + else if (curText == "largeicons") mapSettings.ViewLayout = (int)Layout.LargeIcons; + else if (curText == "filmstrip") mapSettings.ViewLayout = (int)Layout.FilmStrip; + else mapSettings.ViewLayout = (int)Layout.List; + + CurrentSortMethod = (ProgramSort.SortMethod)xmlreader.GetValueAsInt("myprograms", "sortMethod", (int)ProgramSort.SortMethod.Title); + + mapSettings.LastAppID = xmlreader.GetValueAsInt("myprograms", "lastAppID", -1); + mapSettings.LastViewLevel = xmlreader.GetValueAsInt("myprograms", "lastViewLevel", -1); + mapSettings.SortAscending = xmlreader.GetValueAsBool("myprograms", "sortASC", true); + mapSettings.OverviewVisible = xmlreader.GetValueAsBool("myprograms", "sortASC", true); + + StartWindow = xmlreader.GetValueAsInt("myprograms", "startWindow", GetID); + } + } + + + void LoadLastAppIDFromSettings() + { + using (Settings xmlreader = new Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + { + mapSettings.LastAppID = xmlreader.GetValueAsInt("myprograms", "lastAppID", -1); + mapSettings.LastViewLevel = xmlreader.GetValueAsInt("myprograms", "lastViewLevel", -1); + mapSettings.SortMethod = xmlreader.GetValueAsInt("myprograms", "sortMethod", 0); + mapSettings.SortAscending = xmlreader.GetValueAsBool("myprograms", "sortAsc", true); + mapSettings.OverviewVisible = xmlreader.GetValueAsBool("myprograms", "overviewvisible", true); + } + } + + void LoadFolderSettings(string directoryName) + { + if (directoryName == "") + directoryName = "root"; + object o; + FolderSettings.GetFolderSetting(directoryName, "Programs", typeof(MapSettings), out o); + if (o != null) + mapSettings = o as MapSettings; + if (mapSettings == null) + mapSettings = new MapSettings(); + } + + void SaveFolderSettings(string directoryName) + { + if (directoryName == "") + directoryName = "root"; + FolderSettings.AddFolderSetting(directoryName, "Programs", typeof(MapSettings), mapSettings); + } + + #endregion Serialisation + + + #region Variables + + static int startWindow = (int)GUIWindow.Window.WINDOW_FILES; + bool currentSortAsc = true; + // FacadeView + const int facadeIDConst = 50; + ProgramViewHandler viewHandler = ProgramViewHandler.Instance; + List<ApplicationItem> globalApplicationList;// dbHandlerInstance.ApplicationItemList; + DirectoryHistory itemHistory = new DirectoryHistory(); + int slideSpeed = 3000; // speed in milliseconds between two slides + long slideTime = 0; + bool skipInit = false; + static string _thumbnailPath = string.Empty; + static string _lastThumbnailPath = string.Empty; + + ProgramSort.SortMethod currentSortMethod = ProgramSort.SortMethod.Title; + DatabaseHandler dbHandlerInstance = DatabaseHandler.DBHandlerInstance; + + MapSettings mapSettings = new MapSettings(); + ApplicationItem lastApp = null; + string prevFilepath = ""; + int selectedItemIndex = -1; + Layout currentLayout = Layout.List; + + // Buttons + [SkinControl(2)] + protected GUIButtonControl btnViewAs = null; + [SkinControlAttribute(3)] + protected GUISortButtonControl btnSortBy = null; + [SkinControl(4)] + protected GUIButtonControl btnViews = null; + [SkinControl(5)] + protected GUIButtonControl btnRefresh = null; + //Images + [SkinControl(6)] + protected GUIImage screenShotImage = null; + + [SkinControl(facadeIDConst)] + protected GUIFacadeControl facadeView = null; + + + + #endregion Variables + + #region Enums + + public enum Layout + { + List = 0, + Icons = 1, + LargeIcons = 2, + FilmStrip = 3, + } + + #endregion Enums + + #region Constructor / Destructor + + public GUIProgramsAlt() + { + GetID = (int)Window.WINDOW_FILES; + } + + + + #endregion Constructor / Destructor + + + #region Properties / Helper Routines + + public ProgramViewHandler ViewHandler + { + get { return viewHandler; } + set { viewHandler = value; } + } + + public static string ThumbnailPath + { + get + { + return _thumbnailPath; + } + set + { + if (value == "") + _thumbnailPath = ""; + else if (File.Exists(value)) + _thumbnailPath = value; + } + } + + public int StartWindow + { + get { return startWindow; } + set { startWindow = value; } + } + + public virtual Layout CurrentLayout + { + get { return currentLayout; } + set { currentLayout = value; } + } + + bool CurrentSortAsc + { + get { return currentSortAsc; } + set { currentSortAsc = value; } + } + + protected virtual ProgramSort.SortMethod CurrentSortMethod + { + get { return currentSortMethod; } + set { currentSortMethod = value; } + } + + GUIListItem GetSelectedItem() + { + return facadeView.SelectedListItem; + } + + public int GetSelectedItemNo() + { + return facadeView.SelectedListItemIndex; + } + + int GetCurrentFatherID() + { + if (lastApp != null) + { + return lastApp.ApplicationItemId; + } + else + { + return -1; // root + } + } + + + bool ThereAreAppsToDisplay() + { + if (lastApp == null) + { + return true; // root has globalApplicationList + } + else + { + return lastApp.SubItemsAllowed(); // grouper items for example + } + } + + bool ThereAreFilesOrLinksToDisplay() + { + return (lastApp != null); // all globalApplicationList can have files except the root + } + + bool IsBackButtonNecessary() + { + return (lastApp != null); // always show back button except for root + } + + #endregion + + #region Private Methods + + void InitGUIProgramsAlt() + { + dbHandlerInstance.LoadAllApplicationItems(); + globalApplicationList = dbHandlerInstance.ApplicationItemList; + LoadSettings(); + skipInit = true; + } + + void SortChanged(object sender, SortEventArgs args) + { + this.CurrentSortAsc = args.Order != System.Windows.Forms.SortOrder.Descending; + SortItems(); + UpdateButtonStates(); + } + + void UpdateButtonStates() + { + string sortBy = string.Empty; + + GUIPropertyManager.SetProperty("#view", ViewHandler.LocalizedCurrentView); + + if (lastApp == null) + { + btnRefresh.IsVisible = false; + } + else + { + btnRefresh.IsVisible = lastApp.RefreshGUIAllowed; + } + + facadeView.IsVisible = true; + + GUIControl.FocusControl(GetID, facadeView.GetID); + + // di... [truncated message content] |
From: <gre...@us...> - 2007-08-27 14:36:34
|
Revision: 869 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=869&view=rev Author: gregmac45 Date: 2007-08-26 22:44:33 -0700 (Sun, 26 Aug 2007) Log Message: ----------- start of "add video detail screen for apple trailers" Modified Paths: -------------- trunk/plugins/OnlineVideos/Source/OnlineVideos/GUIOnlineVideos.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideos.csproj trunk/plugins/OnlineVideos/Source/OnlineVideos/SiteUtilBase.cs Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/GUIOnlineVideos.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/GUIOnlineVideos.cs 2007-08-26 18:25:08 UTC (rev 868) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/GUIOnlineVideos.cs 2007-08-27 05:44:33 UTC (rev 869) @@ -48,7 +48,8 @@ { home = 0, categories = 1, - videos = 2 + videos = 2, + info = 3 } public enum View { @@ -216,18 +217,21 @@ { DisplayCategories(); } - else + else if (_CurrentState == State.videos) { DisplayVideos(false); facadeView.SelectedListItemIndex = miSelectedIndex; } + else{ + DisplayVideoDetails(); + } UpdateViewSate(); //base.OnPageLoad(); } protected override void OnShowContextMenu() { int liSelected = facadeView.SelectedListItemIndex-1; - if (liSelected < 0 || msSelectedSiteId=="99" || _CurrentState!=State.videos) + if (liSelected < 0 || msSelectedSiteId=="99" || _CurrentState!=State.videos || _CurrentState!=State.info) { return; } @@ -294,6 +298,14 @@ { if (action.wID == Action.ActionType.ACTION_PREVIOUS_MENU) { + if (_CurrentState == State.info) + { + Log.Info("Set the stopDownload to true 1"); + ImageDownloader._stopDownload = true; + DisplayVideos(false); + _CurrentState = State.videos; + return; + } if (_CurrentState == State.videos) { Log.Info("Set the stopDownload to true 1"); @@ -307,7 +319,8 @@ DisplaySites(); _CurrentState = State.home; return; - } + } + } base.OnAction(action); } @@ -350,11 +363,32 @@ } else { - miSelectedIndex = facadeView.SelectedListItemIndex; + miSelectedIndex = facadeView.SelectedListItemIndex; + if(msSelectedCategory == "20"){ + DiplayVideoDetails(moCurrentVideoList[facadeView.SelectedListItemIndex - 1]); + }else{ + //play the video Play(moCurrentVideoList[facadeView.SelectedListItemIndex -1]); + } } } + else if (_CurrentState == State.info) + { + //Log.Info("Set the stopDownload to true 2"); + ImageDownloader._stopDownload = true; + if (facadeView.SelectedListItemIndex == 0) + { + DisplayVideos(false); + _CurrentState = State.videos; + } + else + { + miSelectedIndex = facadeView.SelectedListItemIndex; + //play the video + Play(moCurrentVideoList[facadeView.SelectedListItemIndex -1]); + } + } UpdateViewSate(); } else if (control == btnViewAs) @@ -367,6 +401,11 @@ } base.OnClicked(controlId, control, actionType); } + + private void DiplayVideoDetails(VideoInfo videoInfo) + { + throw new Exception("The method or operation is not implemented."); + } public override bool OnMessage(GUIMessage message) { /* @@ -791,6 +830,11 @@ GUIPropertyManager.SetProperty("#header.image","OnlineVidlogo"+msSelectedSiteId+".jpeg"); DisplayVideoInfo(null); break; + case State.info: + GUIPropertyManager.SetProperty("#header.label",String.Empty); + GUIPropertyManager.SetProperty("#header.image",String.Empty); + DisplayVideoInfo(null); + break; } } private void ChangeFacadeView(){ Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideos.csproj =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideos.csproj 2007-08-26 18:25:08 UTC (rev 868) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideos.csproj 2007-08-27 05:44:33 UTC (rev 869) @@ -37,15 +37,13 @@ <WarningLevel>4</WarningLevel> </PropertyGroup> <ItemGroup> - <Reference Include="Core, Version=0.2.2.0, Culture=neutral, processorArchitecture=x86"> + <Reference Include="Core, Version=0.2.2.9991, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\..\Mediaportal\Core\bin\Release\Core.DLL</HintPath> - <Private>False</Private> + <HintPath>C:\Program Files\Team MediaPortal\MediaPortal\Core.DLL</HintPath> </Reference> - <Reference Include="Databases"> - <HintPath>..\..\..\..\Mediaportal\Databases\bin\Debug\Databases.dll</HintPath> + <Reference Include="Databases, Version=0.2.2.9991, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> - <Private>False</Private> + <HintPath>C:\Program Files\Team MediaPortal\MediaPortal\Databases.DLL</HintPath> </Reference> <Reference Include="Dialogs, Version=0.0.0.0, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> @@ -68,14 +66,15 @@ <Reference Include="System.Xml"> <Private>False</Private> </Reference> - <Reference Include="Utils, Version=2.1.2.0, Culture=neutral, processorArchitecture=x86"> + <Reference Include="Utils, Version=0.2.2.9991, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\..\Mediaportal\Utils\bin\Release\Utils.DLL</HintPath> - <Private>False</Private> + <HintPath>C:\Program Files\Team MediaPortal\MediaPortal\Utils.DLL</HintPath> </Reference> </ItemGroup> <ItemGroup> - <Compile Include="Configuration.cs" /> + <Compile Include="Configuration.cs"> + <SubType>Form</SubType> + </Compile> <Compile Include="Configuration.Designer.cs"> <DependentUpon>Configuration.cs</DependentUpon> </Compile> @@ -124,6 +123,7 @@ <Compile Include="BreakUtil.cs" /> <EmbeddedResource Include="Configuration.resx"> <DependentUpon>Configuration.Designer.cs</DependentUpon> + <SubType>Designer</SubType> </EmbeddedResource> </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/SiteUtilBase.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/SiteUtilBase.cs 2007-08-26 18:25:08 UTC (rev 868) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/SiteUtilBase.cs 2007-08-27 05:44:33 UTC (rev 869) @@ -293,7 +293,7 @@ _workerCompleted = true; //return HTMLdownload; } - public abstract String getSiteId(); + public static abstract String getSiteId(); protected bool isPossibleVideo(string fsUrl){ string extensionFile = System.IO.Path.GetExtension(fsUrl).ToLower(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kro...@us...> - 2007-08-27 13:37:32
|
Revision: 868 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=868&view=rev Author: kroko_koenig Date: 2007-08-26 11:25:08 -0700 (Sun, 26 Aug 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/My Streamradio/Release/Radio/N-Joy.xml trunk/plugins/My Streamradio/Source/MyStreamRadio/GUIRadio.cs trunk/plugins/My Streamradio/Source/MyStreamRadio/MyStreamRadio.csproj Added Paths: ----------- trunk/plugins/My Streamradio/Release/Skin/Media/ trunk/plugins/My Streamradio/Release/Skin/Media/at.png trunk/plugins/My Streamradio/Release/Skin/Media/no.png trunk/plugins/My Streamradio/Release/Skin/Media/noPicture.png trunk/plugins/My Streamradio/Release/Skin/Media/se.png trunk/plugins/My Streamradio/Source/MyStreamRadio/Properties/ trunk/plugins/My Streamradio/Source/MyStreamRadio/Properties/AssemblyInfo.cs trunk/plugins/My Streamradio/radio2.jpg trunk/plugins/My Streamradio/radio3.jpg trunk/plugins/My Streamradio/radio4.jpg Modified: trunk/plugins/My Streamradio/Release/Radio/N-Joy.xml =================================================================== --- trunk/plugins/My Streamradio/Release/Radio/N-Joy.xml 2007-08-26 18:09:04 UTC (rev 867) +++ trunk/plugins/My Streamradio/Release/Radio/N-Joy.xml 2007-08-26 18:25:08 UTC (rev 868) @@ -29,7 +29,7 @@ <entry name="image"></entry> <entry name="title"></entry> <entry name="interpret"></entry> - <entry name="swap">no</entry> + <entry name="swap">yes</entry> </section> Added: trunk/plugins/My Streamradio/Release/Skin/Media/at.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/My Streamradio/Release/Skin/Media/at.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/My Streamradio/Release/Skin/Media/no.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/My Streamradio/Release/Skin/Media/no.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/My Streamradio/Release/Skin/Media/noPicture.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/My Streamradio/Release/Skin/Media/noPicture.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/My Streamradio/Release/Skin/Media/se.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/My Streamradio/Release/Skin/Media/se.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/plugins/My Streamradio/Source/MyStreamRadio/GUIRadio.cs =================================================================== --- trunk/plugins/My Streamradio/Source/MyStreamRadio/GUIRadio.cs 2007-08-26 18:09:04 UTC (rev 867) +++ trunk/plugins/My Streamradio/Source/MyStreamRadio/GUIRadio.cs 2007-08-26 18:25:08 UTC (rev 868) @@ -33,6 +33,7 @@ using System.Xml; using System.Threading; using System.Diagnostics; +using System.Web; using MediaPortal.Player; using MediaPortal.GUI.Library; @@ -43,7 +44,6 @@ //using MediaPortal.Music.Database; using MediaPortal.Playlists; - namespace MediaPortal.GUI.MyStreamRadio { [PluginIcons("MyStreamRadio.StreamRadio.png", "MyStreamRadio.StreamRadioDisabled.png")] @@ -102,7 +102,7 @@ string dsp_homepage = ""; string dsp_country = ""; - string dsp_url = ""; + string dsp_get = ""; string dsp_method = ""; string dsp_title = ""; @@ -341,6 +341,7 @@ //_Update.Stop(); //_Update.Dispose(); + myThread.Interrupt(); myThread.Abort(); base.OnPageDestroy(newWindowId); @@ -965,7 +966,7 @@ GUIPropertyManager.SetProperty("#logo", item.IconImage); - dsp_url = ""; + dsp_get = ""; try { @@ -989,27 +990,29 @@ GUIPropertyManager.SetProperty("#Artist", " "); GUIPropertyManager.SetProperty("#Title", " "); - dsp_method = xmlreader.GetValue("html", "method"); + dsp_method = xmlreader.GetValue("parser", "method"); - dsp_url = xmlreader.GetValue("html", "url"); - dsp_method = xmlreader.GetValue("html", "method"); - dsp_search = xmlreader.GetValue("html", "search"); - dsp_offset = xmlreader.GetValue("html", "offset"); - dsp_start = xmlreader.GetValue("html", "start"); - dsp_start2 = xmlreader.GetValue("html", "start2"); - dsp_stop = xmlreader.GetValue("html", "stop"); - dsp_devider = xmlreader.GetValue("html", "devider"); - dsp_img = xmlreader.GetValue("html", "image"); - dsp_title = xmlreader.GetValue("html", "title"); - dsp_interpret = xmlreader.GetValue("html", "interpret"); - dsp_swap = xmlreader.GetValue("html", "swap"); + dsp_get = xmlreader.GetValue("parser", "get"); + dsp_method = xmlreader.GetValue("parser", "method"); + dsp_search = xmlreader.GetValue("parser", "search"); + dsp_offset = xmlreader.GetValue("parser", "offset"); + dsp_start = xmlreader.GetValue("parser", "start"); + dsp_start2 = xmlreader.GetValue("parser", "start2"); + dsp_stop = xmlreader.GetValue("parser", "stop"); + dsp_devider = xmlreader.GetValue("parser", "devider"); + dsp_img = xmlreader.GetValue("parser", "image"); + dsp_title = xmlreader.GetValue("parser", "title"); + dsp_interpret = xmlreader.GetValue("parser", "interpret"); + dsp_swap = xmlreader.GetValue("parser", "swap"); } } } - catch + catch (Exception ex) { GUIPropertyManager.SetProperty("#Station", "xml file error"); + Debug.WriteLine("Error xml: " + ex); + //GUIPropertyManager.SetProperty("#Description", ex); // if xml file read fails... } @@ -1163,45 +1166,79 @@ //update_dsp(); } + private string convStr(string Input) + { + Input = Input.ToLower(); + String Output = ""; + bool upper = true; + + for (int i = 0; i < Input.Length; i++) + { + string s = Input[i].ToString(); + + if ((s == " ")||(s == ",")||(s == "(")) + upper = true; + + if ((upper == true) & !((s == " ") || (s == ",") || (s == "("))) + { + Output = Output + s.ToUpper(); + upper = false; + } + else + Output = Output + s; + + } + + return Output; + + } + void myStartingMethod() { while (0 != 1) { update_dsp(); - Thread.Sleep(30000); // 30s + try + { + Thread.Sleep(30000); // 30s + } + catch + { + // if interrupted + } } } void update_dsp() { - if ((dsp_url != "") && (dsp_method == "1")) + if ((dsp_get != "") && (dsp_method == "1")) { // multi rows scan html1(); } - if ((dsp_url != "") && (dsp_method == "2")) + if ((dsp_get != "") && (dsp_method == "2")) { // xml scan html2(); } - if ((dsp_url != "") && (dsp_method == "3")) + if ((dsp_get != "") && (dsp_method == "3")) { // single row scan (php) html3(); } - if ((dsp_url != "") && (dsp_method == "4")) + if ((dsp_get != "") && (dsp_method == "4")) { // xml scan html4(); } - if ((dsp_url != "") && (dsp_method == "5")) + if ((dsp_get != "") && (dsp_method == "5")) { // double row scan (html) html5(); } - if (dsp_url == "") + if (dsp_get == "") { - GUIPropertyManager.SetProperty("#Artist", "n.a."); - GUIPropertyManager.SetProperty("#Title", "n.a."); + GUIPropertyManager.SetProperty("#Artist", "no display"); + GUIPropertyManager.SetProperty("#Title", " "); } } @@ -1209,8 +1246,10 @@ { try { - Uri uri = new Uri(dsp_url); + Debug.WriteLine("Method 1"); + Uri uri = new Uri(dsp_get); + WebRequest request = WebRequest.Create(uri); request.Credentials = new NetworkCredential("", ""); request.Timeout = 10000; @@ -1227,38 +1266,70 @@ string t = ""; string p = ""; + int x = 0; + int y = 0; + int cnt = 0; + while (((line = reader.ReadLine()) != null) && (a == "")) { - int x = line.IndexOf(dsp_search); + cnt++; + line = HttpUtility.HtmlDecode(line); + line = HttpUtility.UrlDecode(line); + + x = line.IndexOf(dsp_search); + if ((x >= 0) && (dsp_search != "")) { + Debug.WriteLine("Method 1: found search " + cnt); + for (int i = 0; i < Convert.ToInt16(dsp_offset); ++i) { line = reader.ReadLine(); + cnt++; + line = HttpUtility.HtmlDecode(line); + line = HttpUtility.UrlDecode(line); } + + Debug.WriteLine("Method 1: check now " + cnt + ":" + line); + x = line.IndexOf(dsp_start); - int y = line.IndexOf(dsp_stop, x + dsp_start.Length); + if (x >= 0) + y = line.IndexOf(dsp_stop, x + dsp_start.Length); - a = line.Substring(x + dsp_start.Length, y - x - +dsp_start.Length); + if ((x >= 0) && (y >= 0) && (y > x)) + { + a = line.Substring(x + dsp_start.Length, y - x - +dsp_start.Length); + Debug.WriteLine("Method 1: found data " + a); - x = a.IndexOf(dsp_devider); + x = a.IndexOf(dsp_devider); + if (x > 0) + { + t = a.Substring(x + dsp_devider.Length); + a = a.Substring(0, x); + Debug.WriteLine("Method 1: found titel=" + t + " artist " + a); + } - t = a.Substring(x + dsp_devider.Length); - a = a.Substring(0, x); + if (dsp_img != "") + { + x = line.IndexOf(dsp_img); + if (y >= 0) + y = line.IndexOf(dsp_stop, x + dsp_img.Length); - if (dsp_img != "") + int z = line.IndexOf("\"", x + dsp_img.Length); + + if ((y == -1) || (z < y)) + y = z; + if ((x >= 0) && (y >= 0) && (y > x)) + { + p = line.Substring(x + dsp_img.Length, y - x - dsp_img.Length); + } + } + } + else { - x = line.IndexOf(dsp_img); - y = line.IndexOf(dsp_stop, x + dsp_img.Length); - int z = line.IndexOf("\"", x + dsp_img.Length); - if ((y==-1) || (z<y)) - y=z; - if ((x >= 0) && (y >= 0) && (y > x)) - { - p = line.Substring(x + dsp_img.Length, y - x - dsp_img.Length); - } - } + Debug.WriteLine("Method 1: nothing found like (" + dsp_start + "/" + dsp_stop + ")"); + } } } @@ -1278,8 +1349,10 @@ { try { - Uri uri = new Uri(dsp_url); + Debug.WriteLine("Method 2"); + Uri uri = new Uri(dsp_get); + WebRequest request = WebRequest.Create(uri); request.Credentials = new NetworkCredential("", ""); request.Timeout = 10000; @@ -1296,37 +1369,53 @@ string t = ""; string p = ""; + int x = 0; + int y = 0; + int cnt = 0; + while ((line = reader.ReadLine()) != null) { - int x = line.IndexOf(dsp_search); - - x = line.IndexOf(dsp_start); - if (x >= 0) + cnt++; + + line = HttpUtility.HtmlDecode(line); + line = HttpUtility.UrlDecode(line); + + x = line.IndexOf(dsp_start); + if (x >= 0) { - int y = line.IndexOf(dsp_stop, x + dsp_start.Length+1); - if (a=="") + Debug.WriteLine("Method 2: found start at " + cnt); + y = line.IndexOf(dsp_stop, x + dsp_start.Length+1); + if ((a=="") && (y > x)) a = line.Substring(x + dsp_start.Length, y - x - +dsp_start.Length); } - x = line.IndexOf(dsp_start2); - if (x >= 0) + + x = line.IndexOf(dsp_start2); + if (x >= 0) { - int y = line.IndexOf(dsp_stop, x + dsp_start2.Length+1); - if (t=="") + Debug.WriteLine("Method 2: found start2 at " + cnt); + y = line.IndexOf(dsp_stop, x + dsp_start2.Length+1); + if ((t=="") && (y > x)) t = line.Substring(x + dsp_start2.Length, y - x - +dsp_start2.Length); } - x = line.IndexOf(dsp_img); - if ((x >= 0) && (dsp_img!="")) + + x = line.IndexOf(dsp_img); + if ((x >= 0) && (dsp_img!="")) { - int y = line.IndexOf(dsp_stop, x + dsp_img.Length); + Debug.WriteLine("Method 2: found image at " + cnt); + y = line.IndexOf(dsp_stop, x + dsp_img.Length); p = line.Substring(x + dsp_img.Length, y - x - +dsp_img.Length); - // specual for one station + // special for one station if ((p.Length>6) && (p.Substring(p.Length -9,9)=="noimg.jpg")) p=""; } } + if (a=="") + Debug.WriteLine("Method 2: nothing found like (" + dsp_start + "/" + dsp_start2 + ")"); + + output_dsp(a,t,p); } @@ -1342,7 +1431,9 @@ { try { - Uri uri = new Uri(dsp_url); + Debug.WriteLine("Method 3"); + + Uri uri = new Uri(dsp_get); WebRequest request = WebRequest.Create(uri); request.Credentials = new NetworkCredential("", ""); request.Timeout = 10000; @@ -1359,32 +1450,50 @@ string t = ""; string p = ""; + int x = 0; + int y = 0; + int cnt = 0; + while ((line = reader.ReadLine()) != null) { + cnt++; - int x = line.IndexOf(dsp_title); - int y = line.IndexOf(dsp_stop, x + dsp_title.Length); - if ((x >= 0) && (y == -1)) - y = line.Length; - if ((x >= 0) && (y >= 0) && (y > x)) + line = HttpUtility.HtmlDecode(line); + line = HttpUtility.UrlDecode(line); + + x = line.IndexOf(dsp_title); + if (x >= 0) { - t = line.Substring(x + dsp_title.Length, y - x - dsp_title.Length); + y = line.IndexOf(dsp_stop, x + dsp_title.Length); + if ((x >= 0) && (y == -1)) + y = line.Length; + if ((x >= 0) && (y >= 0) && (y > x)) + { + Debug.WriteLine("Method 3: found title at " + cnt); + t = line.Substring(x + dsp_title.Length, y - x - dsp_title.Length); + } } - x = line.IndexOf(dsp_interpret); - y = line.IndexOf(dsp_stop, x + dsp_interpret.Length); - if ((x >= 0) && (y == -1)) - y = line.Length; - if ((x >= 0) && (y >= 0) && (y > x)) + if (x >= 0) { - a = line.Substring(x + dsp_interpret.Length, y - x - dsp_interpret.Length); + y = line.IndexOf(dsp_stop, x + dsp_interpret.Length); + if ((x >= 0) && (y == -1)) + y = line.Length; + if ((x >= 0) && (y >= 0) && (y > x)) + { + Debug.WriteLine("Method 3: found interpret at " + cnt); + a = line.Substring(x + dsp_interpret.Length, y - x - dsp_interpret.Length); + } } - x = line.IndexOf(dsp_img); - y = line.IndexOf(dsp_stop, x + dsp_img.Length); - if ((x >= 0) && (y >= 0) && (y > x) && (dsp_img != "")) + if (x >= 0) { - p = line.Substring(x + dsp_img.Length, y - x - dsp_img.Length); + y = line.IndexOf(dsp_stop, x + dsp_img.Length); + if ((x >= 0) && (y >= 0) && (y > x) && (dsp_img != "")) + { + Debug.WriteLine("Method 3: found image at " + cnt); + p = line.Substring(x + dsp_img.Length, y - x - dsp_img.Length); + } } } @@ -1402,7 +1511,9 @@ { try { - Uri uri = new Uri(dsp_url); + Debug.WriteLine("Method 4"); + + Uri uri = new Uri(dsp_get); WebRequest request = WebRequest.Create(uri); request.Credentials = new NetworkCredential("", ""); request.Timeout = 10000; @@ -1417,33 +1528,40 @@ string t = ""; string p = ""; + int cnt = 0; + string var = ""; while (!xr.EOF) { + cnt++; xr.Read(); + if (xr.NodeType == XmlNodeType.Element) { - var = var + xr.Name; + var = var + xr.Name + "/"; } if (xr.NodeType == XmlNodeType.EndElement) { - var = var.Replace(xr.Name, ""); + var = var.Replace(xr.Name + "/" , ""); } if ((xr.NodeType == XmlNodeType.CDATA) || (xr.NodeType == XmlNodeType.Text)) { if (var == dsp_interpret) { + Debug.WriteLine("Method 4: found interpret at " + cnt); if (a=="") a = xr.Value.ToString(); } if (var == dsp_title) { + Debug.WriteLine("Method 4: found title at " + cnt); if (t=="") t = xr.Value.ToString(); } if (var == dsp_img) { + Debug.WriteLine("Method 4: found image at " + cnt); p = xr.Value.ToString(); } } @@ -1464,8 +1582,10 @@ { try { - Uri uri = new Uri(dsp_url); + Debug.WriteLine("Method 5"); + Uri uri = new Uri(dsp_get); + WebRequest request = WebRequest.Create(uri); request.Credentials = new NetworkCredential("", ""); request.Timeout = 10000; @@ -1482,29 +1602,46 @@ string t = ""; string p = ""; + int x = 0; + int y = 0; + int cnt = 0; + while (((line = reader.ReadLine()) != null) && (a == "")) { - int x = line.IndexOf(dsp_search); + cnt++; + line = HttpUtility.HtmlDecode(line); + line = HttpUtility.UrlDecode(line); + + x = line.IndexOf(dsp_search); + if ((x >= 0) && (dsp_search != "")) { for (int i = 0; i < Convert.ToInt16(dsp_offset); ++i) { + cnt++; + line = reader.ReadLine(); + line = HttpUtility.HtmlDecode(line); + line = HttpUtility.UrlDecode(line); } x = line.IndexOf(dsp_start); if (x >= 0) { - int y = line.IndexOf(dsp_stop, x + dsp_start.Length + 1); + y = line.IndexOf(dsp_stop, x + dsp_start.Length + 1); if (a == "") a = line.Substring(x + dsp_start.Length, y - x - +dsp_start.Length); } + line = reader.ReadLine(); + line = HttpUtility.HtmlDecode(line); + line = HttpUtility.UrlDecode(line); + x = line.IndexOf(dsp_start2); if (x >= 0) { - int y = line.IndexOf(dsp_stop, x + dsp_start2.Length + 1); + y = line.IndexOf(dsp_stop, x + dsp_start2.Length + 1); if (t == "") t = line.Substring(x + dsp_start2.Length, y - x - +dsp_start2.Length); } @@ -1535,17 +1672,17 @@ title = tmp; } - artist = artist.Replace("%20", " "); - artist = artist.Replace("%21", "!"); - artist = artist.Replace("%26", "&"); - artist = artist.Replace("%27", "'"); - artist = artist.Replace("%28", "("); - artist = artist.Replace("%29", ")"); - artist = artist.Replace("%2B", "&"); // + - artist = artist.Replace("%2C", ","); - artist = artist.Replace("%C4", "\xC4"); - artist = artist.Replace("%D6", "\xD6"); - artist = artist.Replace("%DC", "\xDC"); + //artist = artist.Replace("%20", " "); + //artist = artist.Replace("%21", "!"); + //artist = artist.Replace("%26", "&"); + //artist = artist.Replace("%27", "'"); + //artist = artist.Replace("%28", "("); + //artist = artist.Replace("%29", ")"); + //artist = artist.Replace("%2B", "&"); // + + //artist = artist.Replace("%2C", ","); + //artist = artist.Replace("%C4", "\xC4"); + //artist = artist.Replace("%D6", "\xD6"); + //artist = artist.Replace("%DC", "\xDC"); artist = artist.Replace("+", " "); artist = artist.Replace("<", " "); artist = artist.Replace(">", " "); @@ -1553,22 +1690,23 @@ artist = artist.Replace("&", "&"); artist = artist.Replace("[", ""); artist = artist.Replace("]", ""); + artist = artist.Replace("\"", ""); if (artist.Length > 25) artist = artist.Substring(0, 25) + "..."; - title = title.Replace("%20", " "); - title = title.Replace("%21", "!"); - title = title.Replace("%26", "&"); - title = title.Replace("%27", "'"); - title = title.Replace("'", "'"); - title = title.Replace("%28", "("); - title = title.Replace("%29", ")"); - title = title.Replace("%2B", "&"); // + - title = title.Replace("%2C", ","); - title = title.Replace("%C4", "\xC4"); - title = title.Replace("%D6", "\xD6"); - title = title.Replace("%DC", "\xDC"); + //title = title.Replace("%20", " "); + //title = title.Replace("%21", "!"); + //title = title.Replace("%26", "&"); + //title = title.Replace("%27", "'"); + //title = title.Replace("'", "'"); + //title = title.Replace("%28", "("); + //title = title.Replace("%29", ")"); + //title = title.Replace("%2B", "&"); // + + //title = title.Replace("%2C", ","); + //title = title.Replace("%C4", "\xC4"); + //title = title.Replace("%D6", "\xD6"); + //title = title.Replace("%DC", "\xDC"); title = title.Replace("+", " "); title = title.Replace("<", " "); title = title.Replace(">", " "); @@ -1576,8 +1714,9 @@ title = title.Replace("&", "&"); title = title.Replace("[", ""); title = title.Replace("]", ""); + title = title.Replace("\"", ""); - Debug.WriteLine(DateTime.Now.ToLongTimeString() + " update display ->" + artist + " - " + title ); + Debug.WriteLine(DateTime.Now.ToLongTimeString() + " update display ->" + artist + " - " + title ); if (title.Length > 25) title = title.Substring(0, 25) + "..."; @@ -1589,8 +1728,8 @@ title = ""; } - GUIPropertyManager.SetProperty("#Artist", artist); - GUIPropertyManager.SetProperty("#Title", title); + GUIPropertyManager.SetProperty("#Artist", convStr (artist)); + GUIPropertyManager.SetProperty("#Title", convStr (title)); if (picture != "") { Modified: trunk/plugins/My Streamradio/Source/MyStreamRadio/MyStreamRadio.csproj =================================================================== --- trunk/plugins/My Streamradio/Source/MyStreamRadio/MyStreamRadio.csproj 2007-08-26 18:09:04 UTC (rev 867) +++ trunk/plugins/My Streamradio/Source/MyStreamRadio/MyStreamRadio.csproj 2007-08-26 18:25:08 UTC (rev 868) @@ -45,6 +45,7 @@ </Reference> <Reference Include="System" /> <Reference Include="System.Data" /> + <Reference Include="System.Web" /> <Reference Include="System.Windows.Forms" /> <Reference Include="System.Xml" /> <Reference Include="Utils, Version=2.1.2.0, Culture=neutral, processorArchitecture=x86"> Added: trunk/plugins/My Streamradio/Source/MyStreamRadio/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/My Streamradio/Source/MyStreamRadio/Properties/AssemblyInfo.cs (rev 0) +++ trunk/plugins/My Streamradio/Source/MyStreamRadio/Properties/AssemblyInfo.cs 2007-08-26 18:25:08 UTC (rev 868) @@ -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("MyStreamRadio")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("MyStreamRadio")] +[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("98eb9c4d-769d-4143-a569-61d9cf52b6e9")] + +// 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.3.0.0")] +[assembly: AssemblyFileVersion("0.3.0.0")] Added: trunk/plugins/My Streamradio/radio2.jpg =================================================================== (Binary files differ) Property changes on: trunk/plugins/My Streamradio/radio2.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/My Streamradio/radio3.jpg =================================================================== (Binary files differ) Property changes on: trunk/plugins/My Streamradio/radio3.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/My Streamradio/radio4.jpg =================================================================== (Binary files differ) Property changes on: trunk/plugins/My Streamradio/radio4.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nor...@us...> - 2007-08-27 13:37:30
|
Revision: 867 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=867&view=rev Author: northern_sky Date: 2007-08-26 11:09:04 -0700 (Sun, 26 Aug 2007) Log Message: ----------- Cleanup , moved out settings into own class Modified Paths: -------------- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Database/DatabaseHandler.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesImportProgress.Designer.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesImportProgress.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesView.Designer.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesView.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsBase.Designer.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsBase.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsDirCache.Designer.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsDirCache.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGamebase.Designer.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGamebase.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGrouper.Designer.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGrouper.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsMame.Designer.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsMame.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/FileDetailsForm.Designer.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/FileDetailsForm.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/FileInfoScraperForm.Designer.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/FileInfoScraperForm.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/FileSettingsBox.Designer.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/FileSettingsBox.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/ProgramViews.Designer.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/ProgramViews.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/SettingsBase.Designer.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/SettingsBase.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/SettingsRoot.Designer.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/SettingsRoot.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/SetupForm.Designer.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/SetupForm.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAlt.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAlt.csproj trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAltFileInfo.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/AllGameScraper.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/DirectoryImport.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/GamebaseImport.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/ImportBase.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/MameImport.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItem.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemDirectoryCache.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemFactory.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemGameBase.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemGrouper.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemMame.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/FileItem.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/FileItemInfo.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/FilelinkItem.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/FilterItem.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ProgramSort.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ProgramUtils.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ProgramViewHandler.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Properties/Resources.Designer.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Properties/Resources.resx Added Paths: ----------- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAltUserSettings.cs Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Database/DatabaseHandler.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Database/DatabaseHandler.cs 2007-08-25 22:33:24 UTC (rev 866) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Database/DatabaseHandler.cs 2007-08-26 18:09:04 UTC (rev 867) @@ -31,15 +31,15 @@ using System.IO; using System.Data; using MediaPortal.GUI.Library; -using GUIPrograms; +using GUIProgramsAlt; using MediaPortal.Database; using MediaPortal.Util; using MediaPortal.Configuration; using System.Data.SQLite; -using GUIPrograms.Items; +using GUIProgramsAlt.Items; #endregion Imports -namespace GUIPrograms.Database +namespace GUIProgramsAlt.Database { /// <summary> /// DBhandling methods Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesImportProgress.Designer.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesImportProgress.Designer.cs 2007-08-25 22:33:24 UTC (rev 866) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesImportProgress.Designer.cs 2007-08-26 18:09:04 UTC (rev 867) @@ -1,4 +1,4 @@ -namespace GUIPrograms.Design +namespace GUIProgramsAlt.Design { partial class AppSettingsFilesImportProgress { Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesImportProgress.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesImportProgress.cs 2007-08-25 22:33:24 UTC (rev 866) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesImportProgress.cs 2007-08-26 18:09:04 UTC (rev 867) @@ -31,10 +31,10 @@ using System.Text; using System.Windows.Forms; -using GUIPrograms.Items; -using GUIPrograms.Database; +using GUIProgramsAlt.Items; +using GUIProgramsAlt.Database; -namespace GUIPrograms.Design +namespace GUIProgramsAlt.Design { public partial class AppSettingsFilesImportProgress : AppSettingsBase { Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesView.Designer.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesView.Designer.cs 2007-08-25 22:33:24 UTC (rev 866) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesView.Designer.cs 2007-08-26 18:09:04 UTC (rev 867) @@ -1,4 +1,4 @@ -namespace GUIPrograms.Design +namespace GUIProgramsAlt.Design { partial class AppSettingsFilesView { Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesView.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesView.cs 2007-08-25 22:33:24 UTC (rev 866) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesView.cs 2007-08-26 18:09:04 UTC (rev 867) @@ -33,11 +33,11 @@ using System.Windows.Forms; using Core.Util; -using GUIPrograms; -using GUIPrograms.Items; -using GUIPrograms.Database; +using GUIProgramsAlt; +using GUIProgramsAlt.Items; +using GUIProgramsAlt.Database; -namespace GUIPrograms.Design +namespace GUIProgramsAlt.Design { public partial class AppSettingsFilesView : UserControl { Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsBase.Designer.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsBase.Designer.cs 2007-08-25 22:33:24 UTC (rev 866) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsBase.Designer.cs 2007-08-26 18:09:04 UTC (rev 867) @@ -1,4 +1,4 @@ -namespace GUIPrograms.Design +namespace GUIProgramsAlt.Design { partial class AppSettingsBase { @@ -100,7 +100,7 @@ // // applicationExeButton // - this.applicationExeButton.Image = global::GUIPrograms.Properties.Resources.browseButton_Image; + this.applicationExeButton.Image = global::GUIProgramsAlt.Properties.Resources.browseButtonImage; this.applicationExeButton.Location = new System.Drawing.Point(426, 96); this.applicationExeButton.Name = "applicationExeButton"; this.applicationExeButton.Size = new System.Drawing.Size(31, 23); @@ -209,7 +209,7 @@ // // applicationImageButton // - this.applicationImageButton.Image = global::GUIPrograms.Properties.Resources.browseButton_Image; + this.applicationImageButton.Image = global::GUIProgramsAlt.Properties.Resources.browseButtonImage; this.applicationImageButton.Location = new System.Drawing.Point(426, 121); this.applicationImageButton.Name = "applicationImageButton"; this.applicationImageButton.Size = new System.Drawing.Size(31, 23); @@ -219,7 +219,7 @@ // // startupDirButton // - this.startupDirButton.Image = global::GUIPrograms.Properties.Resources.browseButton_Image; + this.startupDirButton.Image = global::GUIProgramsAlt.Properties.Resources.browseButtonImage; this.startupDirButton.Location = new System.Drawing.Point(426, 201); this.startupDirButton.Name = "startupDirButton"; this.startupDirButton.Size = new System.Drawing.Size(31, 23); Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsBase.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsBase.cs 2007-08-25 22:33:24 UTC (rev 866) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsBase.cs 2007-08-26 18:09:04 UTC (rev 867) @@ -34,12 +34,12 @@ using System.Windows.Forms; using Core.Util; -using GUIPrograms; -using GUIPrograms.Items; -using GUIPrograms.Database; +using GUIProgramsAlt; +using GUIProgramsAlt.Items; +using GUIProgramsAlt.Database; using MediaPortal.Configuration; -namespace GUIPrograms.Design +namespace GUIProgramsAlt.Design { public partial class AppSettingsBase : SettingsBase { Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsDirCache.Designer.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsDirCache.Designer.cs 2007-08-25 22:33:24 UTC (rev 866) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsDirCache.Designer.cs 2007-08-26 18:09:04 UTC (rev 867) @@ -1,4 +1,4 @@ -namespace GUIPrograms.Design +namespace GUIProgramsAlt.Design { partial class AppSettingsDirCache { Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsDirCache.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsDirCache.cs 2007-08-25 22:33:24 UTC (rev 866) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsDirCache.cs 2007-08-26 18:09:04 UTC (rev 867) @@ -32,11 +32,11 @@ using System.Text; using System.Windows.Forms; -using GUIPrograms; -using GUIPrograms.Items; -using GUIPrograms.Database; +using GUIProgramsAlt; +using GUIProgramsAlt.Items; +using GUIProgramsAlt.Database; -namespace GUIPrograms.Design +namespace GUIProgramsAlt.Design { public partial class AppSettingsDirCache : AppSettingsBase { Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGamebase.Designer.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGamebase.Designer.cs 2007-08-25 22:33:24 UTC (rev 866) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGamebase.Designer.cs 2007-08-26 18:09:04 UTC (rev 867) @@ -1,4 +1,4 @@ -namespace GUIPrograms.Design +namespace GUIProgramsAlt.Design { partial class AppSettingsGamebase { Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGamebase.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGamebase.cs 2007-08-25 22:33:24 UTC (rev 866) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGamebase.cs 2007-08-26 18:09:04 UTC (rev 867) @@ -33,11 +33,11 @@ using System.Text; using System.Windows.Forms; -using GUIPrograms; -using GUIPrograms.Items; -using GUIPrograms.Database; +using GUIProgramsAlt; +using GUIProgramsAlt.Items; +using GUIProgramsAlt.Database; -namespace GUIPrograms.Design +namespace GUIProgramsAlt.Design { public partial class AppSettingsGamebase : AppSettingsBase { Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGrouper.Designer.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGrouper.Designer.cs 2007-08-25 22:33:24 UTC (rev 866) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGrouper.Designer.cs 2007-08-26 18:09:04 UTC (rev 867) @@ -1,4 +1,4 @@ -namespace GUIPrograms.Design +namespace GUIProgramsAlt.Design { partial class AppSettingsGrouper { Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGrouper.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGrouper.cs 2007-08-25 22:33:24 UTC (rev 866) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGrouper.cs 2007-08-26 18:09:04 UTC (rev 867) @@ -31,11 +31,11 @@ using System.Text; using System.Windows.Forms; -using GUIPrograms; -using GUIPrograms.Items; -using GUIPrograms.Database; +using GUIProgramsAlt; +using GUIProgramsAlt.Items; +using GUIProgramsAlt.Database; -namespace GUIPrograms.Design +namespace GUIProgramsAlt.Design { public partial class AppSettingsGrouper : AppSettingsBase { Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsMame.Designer.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsMame.Designer.cs 2007-08-25 22:33:24 UTC (rev 866) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsMame.Designer.cs 2007-08-26 18:09:04 UTC (rev 867) @@ -1,4 +1,4 @@ -namespace GUIPrograms.Design +namespace GUIProgramsAlt.Design { partial class AppSettingsMame { Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsMame.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsMame.cs 2007-08-25 22:33:24 UTC (rev 866) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsMame.cs 2007-08-26 18:09:04 UTC (rev 867) @@ -33,11 +33,11 @@ using System.Text; using System.Windows.Forms; -using GUIPrograms; -using GUIPrograms.Items; -using GUIPrograms.Database; +using GUIProgramsAlt; +using GUIProgramsAlt.Items; +using GUIProgramsAlt.Database; -namespace GUIPrograms.Design +namespace GUIProgramsAlt.Design { public partial class AppSettingsMame : AppSettingsBase { Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/FileDetailsForm.Designer.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/FileDetailsForm.Designer.cs 2007-08-25 22:33:24 UTC (rev 866) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/FileDetailsForm.Designer.cs 2007-08-26 18:09:04 UTC (rev 867) @@ -1,4 +1,4 @@ -namespace GUIPrograms.Design +namespace GUIProgramsAlt.Design { partial class FileDetailsForm { @@ -89,7 +89,7 @@ // buttonViewImg // this.buttonViewImg.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonViewImg.Image = global::GUIPrograms.Properties.Resources.previewButton_Image; + this.buttonViewImg.Image = global::GUIProgramsAlt.Properties.Resources.previewButtonImage; this.buttonViewImg.Location = new System.Drawing.Point(431, 72); this.buttonViewImg.Name = "buttonViewImg"; this.buttonViewImg.Size = new System.Drawing.Size(31, 23); @@ -324,7 +324,7 @@ // btnImageFile // this.btnImageFile.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.btnImageFile.Image = global::GUIPrograms.Properties.Resources.browseButton_Image; + this.btnImageFile.Image = global::GUIProgramsAlt.Properties.Resources.browseButtonImage; this.btnImageFile.Location = new System.Drawing.Point(468, 72); this.btnImageFile.Name = "btnImageFile"; this.btnImageFile.Size = new System.Drawing.Size(31, 23); @@ -383,7 +383,7 @@ // btnFilename // this.btnFilename.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.btnFilename.Image = global::GUIPrograms.Properties.Resources.browseButton_Image; + this.btnFilename.Image = global::GUIProgramsAlt.Properties.Resources.browseButtonImage; this.btnFilename.Location = new System.Drawing.Point(468, 45); this.btnFilename.Name = "btnFilename"; this.btnFilename.Size = new System.Drawing.Size(31, 23); Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/FileDetailsForm.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/FileDetailsForm.cs 2007-08-25 22:33:24 UTC (rev 866) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/FileDetailsForm.cs 2007-08-26 18:09:04 UTC (rev 867) @@ -31,13 +31,13 @@ using System.Windows.Forms; using Core.Util; -using GUIPrograms; -using GUIPrograms.Items; -using GUIPrograms.Database; +using GUIProgramsAlt; +using GUIProgramsAlt.Items; +using GUIProgramsAlt.Database; using System.Data.SQLite; -namespace GUIPrograms.Design +namespace GUIProgramsAlt.Design { public partial class FileDetailsForm : Form { Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/FileInfoScraperForm.Designer.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/FileInfoScraperForm.Designer.cs 2007-08-25 22:33:24 UTC (rev 866) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/FileInfoScraperForm.Designer.cs 2007-08-26 18:09:04 UTC (rev 867) @@ -1,4 +1,4 @@ -namespace GUIPrograms.Design +namespace GUIProgramsAlt.Design { partial class FileInfoScraperForm { Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/FileInfoScraperForm.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/FileInfoScraperForm.cs 2007-08-25 22:33:24 UTC (rev 866) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/FileInfoScraperForm.cs 2007-08-26 18:09:04 UTC (rev 867) @@ -34,11 +34,11 @@ using System.Windows.Forms; using System.Data.SQLite; -using GUIPrograms; -using GUIPrograms.Database; -using GUIPrograms.Items; +using GUIProgramsAlt; +using GUIProgramsAlt.Database; +using GUIProgramsAlt.Items; -namespace GUIPrograms.Design +namespace GUIProgramsAlt.Design { public partial class FileInfoScraperForm : Form { Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/FileSettingsBox.Designer.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/FileSettingsBox.Designer.cs 2007-08-25 22:33:24 UTC (rev 866) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/FileSettingsBox.Designer.cs 2007-08-26 18:09:04 UTC (rev 867) @@ -1,4 +1,4 @@ -namespace GUIPrograms.Design +namespace GUIProgramsAlt.Design { partial class FileSettingsBox { @@ -52,7 +52,7 @@ // // Button // - this.Button.Image = global::GUIPrograms.Properties.Resources.browseButton_Image; + this.Button.Image = global::GUIProgramsAlt.Properties.Resources.browseButtonImage; this.Button.Location = new System.Drawing.Point(423, 2); this.Button.Name = "Button"; this.Button.Size = new System.Drawing.Size(31, 23); Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/FileSettingsBox.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/FileSettingsBox.cs 2007-08-25 22:33:24 UTC (rev 866) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/FileSettingsBox.cs 2007-08-26 18:09:04 UTC (rev 867) @@ -5,8 +5,9 @@ using System.Data; using System.Text; using System.Windows.Forms; +using GUIProgramsAlt; -namespace GUIPrograms.Design +namespace GUIProgramsAlt.Design { public partial class FileSettingsBox : UserControl { Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/ProgramViews.Designer.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/ProgramViews.Designer.cs 2007-08-25 22:33:24 UTC (rev 866) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/ProgramViews.Designer.cs 2007-08-26 18:09:04 UTC (rev 867) @@ -1,4 +1,4 @@ -namespace GUIPrograms.Design +namespace GUIProgramsAlt.Design { partial class ProgramViews { Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/ProgramViews.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/ProgramViews.cs 2007-08-25 22:33:24 UTC (rev 866) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/ProgramViews.cs 2007-08-26 18:09:04 UTC (rev 867) @@ -37,7 +37,7 @@ using MediaPortal.GUI.View; using MediaPortal.Util; -namespace GUIPrograms.Design +namespace GUIProgramsAlt.Design { public partial class ProgramViews : UserControl { Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/SettingsBase.Designer.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/SettingsBase.Designer.cs 2007-08-25 22:33:24 UTC (rev 866) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/SettingsBase.Designer.cs 2007-08-26 18:09:04 UTC (rev 867) @@ -1,4 +1,4 @@ -namespace GUIPrograms.Design +namespace GUIProgramsAlt.Design { partial class SettingsBase { Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/SettingsBase.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/SettingsBase.cs 2007-08-25 22:33:24 UTC (rev 866) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/SettingsBase.cs 2007-08-26 18:09:04 UTC (rev 867) @@ -34,12 +34,12 @@ using System.Windows.Forms; using Core.Util; -using GUIPrograms; -using GUIPrograms.Items; -using GUIPrograms.Database; +using GUIProgramsAlt; +using GUIProgramsAlt.Items; +using GUIProgramsAlt.Database; using MediaPortal.GUI.Library; -namespace GUIPrograms.Design +namespace GUIProgramsAlt.Design { public partial class SettingsBase : UserControl { Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/SettingsRoot.Designer.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/SettingsRoot.Designer.cs 2007-08-25 22:33:24 UTC (rev 866) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/SettingsRoot.Designer.cs 2007-08-26 18:09:04 UTC (rev 867) @@ -1,4 +1,4 @@ -namespace GUIPrograms.Design +namespace GUIProgramsAlt.Design { partial class SettingsRoot { Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/SettingsRoot.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/SettingsRoot.cs 2007-08-25 22:33:24 UTC (rev 866) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/SettingsRoot.cs 2007-08-26 18:09:04 UTC (rev 867) @@ -31,11 +31,11 @@ using System.Text; using System.Windows.Forms; -using GUIPrograms; -using GUIPrograms.Items; -using GUIPrograms.Database; +using GUIProgramsAlt; +using GUIProgramsAlt.Items; +using GUIProgramsAlt.Database; -namespace GUIPrograms.Design +namespace GUIProgramsAlt.Design { public partial class SettingsRoot : SettingsBase { Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/SetupForm.Designer.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/SetupForm.Designer.cs 2007-08-25 22:33:24 UTC (rev 866) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/SetupForm.Designer.cs 2007-08-26 18:09:04 UTC (rev 867) @@ -1,4 +1,4 @@ -namespace GUIPrograms.Design +namespace GUIProgramsAlt.Design { partial class SetupForm { @@ -142,7 +142,7 @@ // // deleteApplicationToolStripMenuItem // - this.deleteApplicationToolStripMenuItem.Image = global::GUIPrograms.Properties.Resources.deleteButton_Image; + this.deleteApplicationToolStripMenuItem.Image = global::GUIProgramsAlt.Properties.Resources.deleteButtonImage; this.deleteApplicationToolStripMenuItem.Name = "deleteApplicationToolStripMenuItem"; this.deleteApplicationToolStripMenuItem.Size = new System.Drawing.Size(169, 22); this.deleteApplicationToolStripMenuItem.Text = "Delete application"; Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/SetupForm.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/SetupForm.cs 2007-08-25 22:33:24 UTC (rev 866) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/SetupForm.cs 2007-08-26 18:09:04 UTC (rev 867) @@ -14,14 +14,14 @@ using MediaPortal.Configuration; using System.IO; -using GUIPrograms.Database; -using GUIPrograms; -using GUIPrograms.Items; +using GUIProgramsAlt.Database; +using GUIProgramsAlt; +using GUIProgramsAlt.Items; #endregion -namespace GUIPrograms.Design +namespace GUIProgramsAlt.Design { public partial class SetupForm : Form { Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAlt.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAlt.cs 2007-08-25 22:33:24 UTC (rev 866) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAlt.cs 2007-08-26 18:09:04 UTC (rev 867) @@ -23,6 +23,7 @@ #endregion +#region Imports using System; using System.Collections.Generic; using System.Drawing; @@ -41,153 +42,73 @@ using MediaPortal.Profile; using MediaPortal.Util; -using GUIPrograms.Items; -using GUIPrograms.Database; -using GUIPrograms.Design; +using GUIProgramsAlt.Items; +using GUIProgramsAlt.Database; +using GUIProgramsAlt.Design; using System.Data.SQLite; using System.Data; -namespace GUIPrograms +#endregion Imports + +namespace GUIProgramsAlt { /// <summary> - /// The GUIProgramsAlt plugin is used to list a collection of arbitrary files + /// The GUIProgramsAlt plugin is used to list a collection of arbitrary files ,(focused on emulators) /// and use them as arguments when launching external applications. /// </summary> /// public class GUIProgramsAlt : GUIWindow, ISetupForm, IShowPlugin { - #region Serialisation + #region Variables - [Serializable] - public class MapSettings - { - protected int sortMethod; - protected int viewLayout; - protected bool sortAscending; - protected int lastApplicationID; - protected int lastFileID; - protected int lastViewLevel; - protected bool overviewVisible; - public MapSettings() - { - sortMethod = 0; //name - viewLayout = 0; //list - sortAscending = true; - overviewVisible = true; - lastApplicationID = -1; - lastFileID = -1; - lastViewLevel = 0; - } + bool currentSortAsc = true; + // FacadeView + const int facadeIDConst = 50; + ProgramViewHandler viewHandler = ProgramViewHandler.Instance; + List<ApplicationItem> globalApplicationList;// dbHandlerInstance.ApplicationItemList; + DirectoryHistory itemHistory = new DirectoryHistory(); + int slideSpeed = 3000; // speed in milliseconds between two slides + long slideTime = 0; + bool skipInit = false; + static string _thumbnailPath = string.Empty; + static string _lastThumbnailPath = string.Empty; + ProgramSort.SortMethod currentSortMethod = ProgramSort.SortMethod.Title; + DatabaseHandler dbHandlerInstance = DatabaseHandler.DBHandlerInstance; - [XmlElement("SortMethod")] - public int SortMethod - { - get { return sortMethod; } - set { sortMethod = value; } - } + GUIProgramsAltUserSettings userSettings = new GUIProgramsAltUserSettings(); + ApplicationItem lastApp = null; + string prevFilepath = ""; + int selectedItemIndex = -1; + Layout currentLayout = Layout.List; - [XmlElement("ViewLayout")] - public int ViewLayout - { - get { return viewLayout; } - set { viewLayout = value; } - } + // Buttons + [SkinControl(2)] + protected GUIButtonControl btnViewAs = null; + [SkinControlAttribute(3)] + protected GUISortButtonControl btnSortBy = null; + [SkinControl(4)] + protected GUIButtonControl btnViews = null; + [SkinControl(5)] + protected GUIButtonControl btnRefresh = null; + //Images + [SkinControl(6)] + protected GUIImage screenShotImage = null; - [XmlElement("SortAscending")] - public bool SortAscending - { - get { return sortAscending; } - set { sortAscending = value; } - } + [SkinControl(facadeIDConst)] + protected GUIFacadeControl facadeView = null; - [XmlElement("OverviewVisible")] - public bool OverviewVisible - { - get { return overviewVisible; } - set { overviewVisible = value; } - } + - [XmlElement("LastAppID")] - public int LastAppID - { - get { return lastApplicationID; } - set { lastApplicationID = value; } - } + #endregion Variables - [XmlElement("LastFileID")] - public int LastFileID - { - get { return lastFileID; } - set { lastFileID = value; } - } - - [XmlElement("LastViewLevelID")] - public int LastViewLevel - { - get { return lastViewLevel; } - set { lastViewLevel = value; } - } - - - public string ViewLayoutTextName - { - get { return GetViewLayoutAsText(); } - } - - public void SwitchToNextViewLayout() - { - switch ((Layout)ViewLayout) - { - case Layout.List: - ViewLayout = (int)Layout.Icons; - - break; - case Layout.Icons: - ViewLayout = (int)Layout.LargeIcons; - - break; - case Layout.LargeIcons: - ViewLayout = (int)Layout.FilmStrip; - - break; - case Layout.FilmStrip: - ViewLayout = (int)Layout.List; - - break; - } - } - - string GetViewLayoutAsText() - { - string result = ""; - switch ((Layout)ViewLayout) - { - case Layout.List: - result = GUILocalizeStrings.Get(101); - break; - case Layout.Icons: - result = GUILocalizeStrings.Get(100); - break; - case Layout.LargeIcons: - result = GUILocalizeStrings.Get(417); - break; - case Layout.FilmStrip: - result = GUILocalizeStrings.Get(733); - break; - } - return result; - } - } - - void SaveSettings() { using (Settings xmlwriter = new Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { - switch ((Layout)mapSettings.ViewLayout) + switch ((Layout)userSettings.ViewLayout) { case Layout.List: xmlwriter.SetValue("myprograms", "viewLayout", "list"); @@ -202,12 +123,12 @@ xmlwriter.SetValue("myprograms", "viewLayout", "filmstrip"); break; } - xmlwriter.SetValue("myprograms", "lastAppID", mapSettings.LastAppID.ToString()); - // xmlwriter.SetValue("myprograms", "lastViewLevel", mapSettings.LastViewLevel.ToString()); + xmlwriter.SetValue("myprograms", "lastAppID", userSettings.LastAppID.ToString()); + // xmlwriter.SetValue("myprograms", "lastViewLevel", userSettings.LastViewLevel.ToString()); xmlwriter.SetValue("myprograms", "lastViewLevel", ViewHandler.CurrentLevel); - xmlwriter.SetValue("myprograms", "sortMethod", mapSettings.SortMethod); + xmlwriter.SetValue("myprograms", "sortMethod", userSettings.SortMethod); // avoid bool conversion...... don't wanna know why it doesn't work! :-( - if (mapSettings.SortAscending) + if (userSettings.SortAscending) { xmlwriter.SetValue("myprograms", "sortASC", "yes"); } @@ -216,7 +137,7 @@ xmlwriter.SetValue("myprograms", "sortASC", "no"); } - if (mapSettings.OverviewVisible) + if (userSettings.OverviewVisible) { xmlwriter.SetValue("myprograms", "overviewvisible", "yes"); } @@ -225,8 +146,7 @@ xmlwriter.SetValue("myprograms", "overviewvisible", "no"); } - xmlwriter.SetValue("myprograms", "startWindow", StartWindow.ToString()); - xmlwriter.SetValue("myprograms", "startview", (int)mapSettings.ViewLayout); + xmlwriter.SetValue("myprograms", "startview", (int)userSettings.ViewLayout); } } @@ -239,33 +159,30 @@ string curText = ""; curText = xmlreader.GetValueAsString("myprograms", "viewLayout", "list"); - if (curText == "list") mapSettings.ViewLayout = (int)Layout.List; - else if (curText == "icons") mapSettings.ViewLayout = (int)Layout.Icons; - else if (curText == "largeicons") mapSettings.ViewLayout = (int)Layout.LargeIcons; - else if (curText == "filmstrip") mapSettings.ViewLayout = (int)Layout.FilmStrip; - else mapSettings.ViewLayout = (int)Layout.List; + if (curText == "list") userSettings.ViewLayout = (int)Layout.List; + else if (curText == "icons") userSettings.ViewLayout = (int)Layout.Icons; + else if (curText == "largeicons") userSettings.ViewLayout = (int)Layout.LargeIcons; + else if (curText == "filmstrip") userSettings.ViewLayout = (int)Layout.FilmStrip; + else userSettings.ViewLayout = (int)Layout.List; CurrentSortMethod = (ProgramSort.SortMethod)xmlreader.GetValueAsInt("myprograms", "sortMethod", (int)ProgramSort.SortMethod.Title); - mapSettings.LastAppID = xmlreader.GetValueAsInt("myprograms", "lastAppID", -1); - mapSettings.LastViewLevel = xmlreader.GetValueAsInt("myprograms", "lastViewLevel", -1); - mapSettings.SortAscending = xmlreader.GetValueAsBool("myprograms", "sortASC", true); - mapSettings.OverviewVisible = xmlreader.GetValueAsBool("myprograms", "sortASC", true); - - StartWindow = xmlreader.GetValueAsInt("myprograms", "startWindow", GetID); + userSettings.LastAppID = xmlreader.GetValueAsInt("myprograms", "lastAppID", -1); + userSettings.LastViewLevel = xmlreader.GetValueAsInt("myprograms", "lastViewLevel", -1); + userSettings.SortAscending = xmlreader.GetValueAsBool("myprograms", "sortASC", true); + userSettings.OverviewVisible = xmlreader.GetValueAsBool("myprograms", "sortASC", true); } } - void LoadLastAppIDFromSettings() { using (Settings xmlreader = new Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { - mapSettings.LastAppID = xmlreader.GetValueAsInt("myprograms", "lastAppID", -1); - mapSettings.LastViewLevel = xmlreader.GetValueAsInt("myprograms", "lastViewLevel", -1); - mapSettings.SortMethod = xmlreader.GetValueAsInt("myprograms", "sortMethod", 0); - mapSettings.SortAscending = xmlreader.GetValueAsBool("myprograms", "sortAsc", true); - mapSettings.OverviewVisible = xmlreader.GetValueAsBool("myprograms", "overviewvisible", true); + userSettings.LastAppID = xmlreader.GetValueAsInt("myprograms", "lastAppID", -1); + userSettings.LastViewLevel = xmlreader.GetValueAsInt("myprograms", "lastViewLevel", -1); + userSettings.SortMethod = xmlreader.GetValueAsInt("myprograms", "sortMethod", 0); + userSettings.SortAscending = xmlreader.GetValueAsBool("myprograms", "sortAsc", true); + userSettings.OverviewVisible = xmlreader.GetValueAsBool("myprograms", "overviewvisible", true); } } @@ -273,92 +190,34 @@ { if (directoryName == "") directoryName = "root"; + object o; - FolderSettings.GetFolderSetting(directoryName, "Programs", typeof(MapSettings), out o); + FolderSettings.GetFolderSetting(directoryName, "Programs", typeof(GUIProgramsAltUserSettings), out o); if (o != null) - mapSettings = o as MapSettings; - if (mapSettings == null) - mapSettings = new MapSettings(); + userSettings = o as GUIProgramsAltUserSettings; + if (userSettings == null) + userSettings = new GUIProgramsAltUserSettings(); } void SaveFolderSettings(string directoryName) { if (directoryName == "") directoryName = "root"; - FolderSettings.AddFolderSetting(directoryName, "Programs", typeof(MapSettings), mapSettings); + FolderSettings.AddFolderSetting(directoryName, "Programs", typeof(GUIProgramsAltUserSettings), userSettings); } - #endregion Serialisation - - - #region Variables - - static int startWindow = (int)GUIWindow.Window.WINDOW_FILES; - bool currentSortAsc = true; - // FacadeView - const int facadeIDConst = 50; - ProgramViewHandler viewHandler = ProgramViewHandler.Instance; - List<ApplicationItem> globalApplicationList;// dbHandlerInstance.ApplicationItemList; - DirectoryHistory itemHistory = new DirectoryHistory(); - int slideSpeed = 3000; // speed in milliseconds between two slides - long slideTime = 0; - bool skipInit = false; - static string _thumbnailPath = string.Empty; - static string _lastThumbnailPath = string.Empty; - - ProgramSort.SortMethod currentSortMethod = ProgramSort.SortMethod.Title; - DatabaseHandler dbHandlerInstance = DatabaseHandler.DBHandlerInstance; - - MapSettings mapSettings = new MapSettings(); - ApplicationItem lastApp = null; - string prevFilepath = ""; - int selectedItemIndex = -1; - Layout currentLayout = Layout.List; - - // Buttons - [SkinControl(2)] - protected GUIButtonControl btnViewAs = null; - [SkinControlAttribute(3)] - protected GUISortButtonControl btnSortBy = null; - [SkinControl(4)] - protected GUIButtonControl btnViews = null; - [SkinControl(5)] - protected GUIButtonControl btnRefresh = null; - //Images - [SkinControl(6)] - protected GUIImage screenShotImage = null; - - [SkinControl(facadeIDConst)] - protected GUIFacadeControl facadeView = null; - - - - #endregion Variables - - #region Enums - - public enum Layout - { - List = 0, - Icons = 1, - LargeIcons = 2, - FilmStrip = 3, - } - - #endregion Enums - #region Constructor / Destructor public GUIProgramsAlt() { - GetID = (int)Window.WINDOW_FILES; + + GetID = (int)Window.WINDOW_FILES; } #endregion Constructor / Destructor - #region Properties / Helper Routines public ProgramViewHandler ViewHandler @@ -382,12 +241,6 @@ } } - public int StartWindow - { - get { return startWindow; } - set { startWindow = value; } - } - public virtual Layout CurrentLayout { get { return currentLayout; } @@ -514,7 +367,7 @@ } } - btnViewAs.Label = mapSettings.ViewLayoutTextName; + btnViewAs.Label = userSettings.ViewLayoutTextName; switch (CurrentSortMethod) { @@ -549,7 +402,7 @@ { int itemIndex = facadeView.SelectedListItemIndex; - switch ((Layout)mapSettings.ViewLayout) + switch ((Layout)userSettings.ViewLayout) { case Layout.List: facadeView.View = GUIFacadeControl.ViewMode.List; @@ -768,13 +621,13 @@ lastApp = this.dbHandlerInstance.GetAppByID(lastApp.FatherID); if (lastApp != null) { - mapSettings.LastAppID = lastApp.ApplicationItemId; + userSettings.LastAppID = lastApp.ApplicationItemId; prevFilepath = lastApp.DefaultFilepath(); } else { // back to home screen..... - mapSettings.LastAppID = -1; + userSettings.LastAppID = -1; prevFilepath = ""; } } @@ -956,7 +809,7 @@ lastApp = (ApplicationItem)item; SaveItemIndex(GetSelectedItemNo().ToString(), lastApp, lastApp.lastFilepath); - mapSettings.LastAppID = lastApp.ApplicationItemId; + userSettings.LastAppID = lastApp.ApplicationItemId; prevFilepath = lastApp.DefaultFilepath(); ViewHandler.CurrentLevel = 0; //lastApp.ViewHandler = ViewHandler; @@ -968,7 +821,7 @@ if (lastApp != null) { - mapSettings.LastAppID = lastApp.ApplicationItemId; + userSettings.LastAppID = lastApp.ApplicationItemId; prevFilepath = lastApp.DefaultFilepath(); lastApp.LaunchFile(fileItem); } @@ -1180,35 +1033,20 @@ if (dlg.SelectedLabel == -1) return; if (dlg.SelectedLabel == 0) { - int nNewWindow = (int)Window.WINDOW_FILES; - StartWindow = nNewWindow; - mapSettings.ViewLayout = (int)Layout.List; + userSettings.ViewLayout = (int)Layout.List; ViewHandler.CurrentView = GUILocalizeStrings.Get(100000 + GetID);//my files - if (nNewWindow != GetID) - { - GUIWindowManager.ReplaceWindow(nNewWindow); - } } else { ViewDefinition selectedView = (ViewDefinition)ViewHandler.Views[dlg.SelectedLabel - 1]; ViewHandler.CurrentView = selectedView.Name; - int nNewWindow = (int)Window.WINDOW_FILES; - if (GetID != nNewWindow) - { - StartWindow = nNewWindow; - if (nNewWindow != GetID) - { - GUIWindowManager.ReplaceWindow(nNewWindow); - } - } - else - { + + if (facadeView.Count <= 0) { GUIControl.FocusControl(GetID, btnViewAs.GetID); } - } + } UpdateButtonStates(); @@ -1237,19 +1075,19 @@ if (skipInit) { - mapSettings.LastAppID = -1; + userSettings.LastAppID = -1; } else { LoadLastAppIDFromSettings(); // hacky load back the last applicationItem id, otherwise this can get lost from dx resets.... } - lastApp = this.dbHandlerInstance.GetAppByID(mapSettings.LastAppID); + lastApp = this.dbHandlerInstance.GetAppByID(userSettings.LastAppID); if (lastApp != null) { prevFilepath = lastApp.DefaultFilepath(); - this.CurrentSortAsc = mapSettings.SortAscending; - ViewHandler.CurrentLevel = mapSettings.LastViewLevel; + this.CurrentSortAsc = userSettings.SortAscending; + ViewHandler.CurrentLevel = userSettings.LastViewLevel; } else { @@ -1331,7 +1169,7 @@ if (control == btnViewAs) { - mapSettings.SwitchToNextViewLayout(); + userSettings.SwitchToNextViewLayout(); ShowThumbPanel(); Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAlt.csproj =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAlt.csproj 2007-08-25 22:33:24 UTC (rev 866) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAlt.csproj 2007-08-26 18:09:04 UTC (rev 867) @@ -7,8 +7,8 @@ <ProjectGuid>{F34EBAC9-C5B9-48FD-B82D-C6BA907F81B0}</ProjectGuid> <OutputType>Library</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>GUIPrograms</RootNamespace> - <AssemblyName>GUIPrograms</AssemblyName> + <RootNamespace>GUIProgramsAlt</RootNamespace> + <AssemblyName>GUIProgramsAlt</AssemblyName> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> @@ -142,6 +142,7 @@ </Compile> <Compile Include="GUIProgramsAlt.cs" /> <Compile Include="GUIProgramsAltFileInfo.cs" /> + <Compile Include="GUIProgramsAltUserSettings.cs" /> <Compile Include="Imports\AllGameScraper.cs" /> <Compile Include="Imports\DirectoryImport.cs" /> <Compile Include="Imports\GamebaseImport.cs" /> Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAltFileInfo.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAltFileInfo.cs 2007-08-25 22:33:24 UTC (rev 866) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAltFileInfo.cs 2007-08-26 18:09:04 UTC (rev 867) @@ -40,14 +40,14 @@ using MediaPortal.Video.Database; -using GUIPrograms.Database; +using GUIProgramsAlt.Database; using MediaPortal.Configuration; -using GUIPrograms.Items; +using GUIProgramsAlt.Items; -namespace GUIPrograms +namespace GUIProgramsAlt { /// <summary> /// Added: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAltUserSettings.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAltUserSettings.cs (rev 0) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAltUserSettings.cs 2007-08-26 18:09:04 UTC (rev 867) @@ -0,0 +1,137 @@ +using System; + +using System.Xml.Serialization; +using System.Collections.Generic; +using System.Text; + + +using MediaPortal.GUI.Library; +using MediaPortal.Util; + +namespace GUIProgramsAlt +{ + [Serializable] + public class GUIProgramsAltUserSettings + { + protected int sortMethod; + protected int viewLayout; + protected bool sortAscending; + protected int lastApplicationID; + protected int lastFileID; + protected int lastViewLevel; + protected bool overviewVisible; + + public GUIProgramsAltUserSettings() + { + sortMethod = 0; //name + viewLayout = 0; //list + sortAscending = true; + overviewVisible = true; + lastApplicationID = -1; + lastFileID = -1; + lastViewLevel = 0; + } + + [XmlElement("SortMethod")] + public int SortMethod + { + get { return sortMethod; } + set { sortMethod = value; } + } + + [XmlElement("ViewLayout")] + public int ViewLayout + { + get { return viewLayout; } + set { viewLayout = value; } + } + + [XmlElement("SortAscending")] + public bool SortAscending + { + get { return sortAscending; } + set { sortAscending = value; } + } + + [XmlElement("OverviewVisible")] + public bool OverviewVisible + { + get { return overviewVisible; } + set { overviewVisible = value; } + } + + [XmlElement("LastAppID")] + public int LastAppID + { + get { return lastApplicationID; } + set { lastApplicationID = value; } + } + + [XmlElement("LastFileID")] + public int LastFileID + { + get { return lastFileID; } + set { lastFileID = value; } + } + + [XmlElement("LastViewLevelID")] + public int LastViewLevel + { + get { return lastViewLevel; } + set { lastViewLevel = value; } + } + + + public string ViewLayoutTextName + { + get { return GetViewLayoutAsText(); } + } + + string GetViewLayoutAsText() + { + string result = ""; + switch ((Layout)ViewLayout) + { + case Layout.List: + result = GUILocalizeStrings.Get(101); + break; + case Layout.Icons: + result = GUILocalizeStrings.Get(100); + break; + case Layout.LargeIcons: + result = GUILocalizeStrings.Get(417); + break; + case Layout.FilmStrip: + result = GUILocalizeStrings.Get(733); + break; + } + return result; + } + + public void SwitchToNextViewLayout() + { + switch ((Layout)ViewLayout) + { + case Layout.List: + ViewLayout = (int)Layout.Icons; + + break; + case Layout.Icons: + ViewLayout = (int)Layout.LargeIcons; + + break; + case Layout.LargeIcons: + ViewLayout = (int)Layout.FilmStrip; + + break; + case Layout.FilmStrip: + ViewLayout = (int)Layout.List; + + break; + } + } + + + } + +} Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/AllGameScraper.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/AllGameScraper.cs 2007-08-25 22:33:24 UTC (rev 866) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/AllGameScraper.cs 2007-08-26 18:09:04 UTC (rev 867) @@ -31,12 +31,12 @@ using System.Text.RegularExpressions; using MediaPortal.Utils; -using GUIPrograms; +using GUIProgramsAlt; using MediaPortal.GUI.Library; -using GUIPrograms.Database; -using GUIPrograms.Items; +using GUIProgramsAlt.Database; +using GUIProgramsAlt.Items; -namespace GUIPrograms.Imports +namespace GUIProgramsAlt.Imports { /// <summary> /// Gets information from an AllGame WebPage Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/DirectoryImport.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/DirectoryImport.cs 2007-08-25 22:33:24 UTC (rev 866) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/DirectoryImport.cs 2007-08-26 18:09:04 UTC (rev 867) @@ -5,14 +5,14 @@ using MediaPortal.GUI.Library; -using GUIPrograms.Items; -using GUIPrograms; -using GUIPrograms.Database; +using GUIProgramsAlt.Items; +using GUIProgramsAlt; +using GUIProgramsAlt.Database; using System.Data.SQLite; using System.IO; -namespace GUIPrograms.Imports +namespace GUIProgramsAlt.Imports { public class DirectoryImport: ImportBase { Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/GamebaseImport.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/GamebaseImport.cs 2007-08-25 22:33:24 UTC (rev 866) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/GamebaseImport.cs 2007-08-26 18:09:04 UTC (rev 867) @@ -29,13 +29,13 @@ using MediaPortal.GUI.Library; -using GUIPrograms.Items; -using GUIPrograms; -using GUIPrograms.Database; +using GUIProgramsAlt.Items; +using GUIProgramsAlt; +using GUIProgramsAlt.Database; using System.Data.SQLite; -namespace GUIPrograms.Imports +namespace GUIProgramsAlt.Imports { /// <summary> /// Summary description for GamebaseImport. Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/ImportBase.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/ImportBase.cs 2007-08-25 22:33:24 UTC (rev 866) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/ImportBase.cs 2007-08-26 18:09:04 UTC (rev 867) @@ -3,9 +3,9 @@ using System.Text; using System.IO; -using GUIPrograms.Items; +using GUIProgramsAlt.Items; -namespace GUIPrograms.Imports +namespace GUIProgramsAlt.Imports { public abstract class ImportBase { Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/MameImport.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/MameImport.cs 2007-08-25 22:33:24 UTC (rev 866) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/MameImport.cs 2007-08-26 18:09:04 UTC (rev 867) @@ -35,13 +35,13 @@ using System.Text.RegularExpressions; using System.Text; -using GUIPrograms.Items; -using GUIPrograms; -using GUIPrograms.Database; +using GUIProgramsAlt.Items; +using GUIProgramsAlt; +using GUIProgramsAlt.Database; -namespace GUIPrograms.Imports +namespace GUIProgramsAlt.Imports { /// <summary> /// Summary description for MameImport. Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItem.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItem.cs 2007-08-25 22:33:24 UTC (rev 866) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItem.cs 2007-08-26 18:09:04 UTC (rev 867) @@ -40,13 +40,13 @@ using MediaPortal.Dialogs; using MediaPortal.Util; -using GUIPrograms; -using GUIPrograms.Database; -using GUIPrograms.Items; +using GUIProgramsAlt; +using GUIProgramsAlt.Database; +using GUIProgramsAlt.Items; #endregion Imports -namespace GUIPrograms.Items +namespace GUIProgramsAlt.Items { public abstract class ApplicationItem { Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemDirectoryCache.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemDirectoryCache.cs 2007-08-25 22:33:24 UTC (rev 866) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemDirectoryCache.cs 2007-08-26 18:09:04 UTC (rev 867) @@ -37,15 +37,15 @@ using MediaPortal.GUI.Library; using MediaPortal.Util; -using GUIPrograms; -using GUIPrograms.Imports; -using GUIPrograms.Database; -using GUIPrograms.Items; +using GUIProgramsAlt; +using GUIProgramsAlt.Imports; +using GUIProgramsAlt.Database; +using GUIProgramsAlt.Items; #endregion Imports -namespace GUIPrograms.Items +namespace GUIProgramsAlt.Items { /// <summary> /// Summary description for ApplicationItemDirectoryCache. Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemFactory.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemFactory.cs 2007-08-25 22:33:24 UTC (rev 866) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemFactory.cs 2007-08-26 18:09:04 UTC (rev 867) @@ -24,12 +24,12 @@ #endregion using System; -using GUIPrograms; -using GUIPrograms.Database; +using GUIProgramsAlt; +using GUIProgramsAlt.Database; using System.Data.SQLite; using System.Data; -namespace GUIPrograms.Items +namespace GUIProgramsAlt.Items { /// <summary> /// Factory like object that creates the matchin Application descendant class Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemGameBase.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemGameBase.cs 2007-08-25 22:33:24 UTC (rev 866) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemGameBase.cs 2007-08-26 18:09:04 UTC (rev 867) @@ -31,11 +31,11 @@ using MediaPortal.Dialogs; using MediaPortal.GUI.Library; -using GUIPrograms; -using GUIPrograms.Database; -using GUIPrograms.Imports; +using GUIProgramsAlt; +using GUIProgramsAlt.Database; +using GUIProgramsAlt.Imports; -namespace GUIPrograms.Items +namespace GUIProgramsAlt.Items { /// <summary> /// Summary description for ApplicationItemGameBase. Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemGrouper.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemGrouper.cs 2007-08-25 22:33:24 UTC (rev 866) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemGrouper.cs 2007-08-26 18:09:04 UTC (rev 867) @@ -26,11 +26,11 @@ using MediaPortal.GUI.Library; using System.Data.SQLite; using System.Data; -using GUIPrograms.Database; +using GUIProgramsAlt.Database; -using GUIPrograms.Items; +using GUIProgramsAlt.Items; -namespace GUIPrograms.Items +namespace GUIProgramsAlt.Items { /// <summary> /// Summary description for appFilesEdit. Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemMame.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemMame.cs 2007-08-25 22:33:24 UTC (rev 866) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemMame.cs 2007-08-26 18:09:04 UTC (rev 867) @@ -34,12 +34,12 @@ using MediaPortal.Dialogs; using MediaPortal.GUI.Library; -using GUIPrograms; -using GUIPrograms.Imports; +using GUIProgramsAlt; +using GUIProgramsAlt.Imports; #endregion Imports -namespace GUIPrograms.Items +namespace GUIProgramsAlt.Items { /// <summary> /// Summary description for ApplicationItemMame. Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/FileItem.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/FileItem.cs 2007-08-25 22:33:24 UTC (rev 866) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/FileItem.cs 2007-08-26 18:09:04 UTC (rev 867) @@ -33,12 +33,12 @@ using MediaPortal.Configuration; using MediaPortal.GUI.Library; -using GUIPrograms; -using GUIPrograms.Database; -using GUIPrograms.Items; -using GUIPrograms.Imports; +using GUIProgramsAlt; +using GUIProgramsAlt.Database; +using GUIProgramsAlt.Items; +using GUIProgramsAlt.Imports; -namespace GUIPrograms.Items +namespace GUIProgramsAlt.Items { public class FileItem { Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/FileItemInfo.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/FileItemInfo.cs 2007-08-25 22:33:24 UTC (rev 866) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/FileItemInfo.cs 2007-08-26 18:09:04 UTC (rev 867) @@ -29,12 +29,12 @@ using MediaPortal.Util; -using GUIPrograms.Items; +using GUIProgramsAlt.Items; // just 4 useMPsThumbsDirectory variable -using GUIPrograms.Database; +using GUIProgramsAlt.Database; -namespace GUIPrograms.Items +namespace GUIProgramsAlt.Items { /// <summary> /// Summary description for FileInfo. Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/FilelinkItem.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/FilelinkItem.cs 2007-08-25 22:33:24 UTC (rev 866) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/FilelinkItem.cs 2007-08-26 18:09:04 UTC (rev 867) @@ -30,10 +30,10 @@ using MediaPortal.GUI.Library; -using GUIPrograms; -using GUIPrograms.Database; +using GUIProgramsAlt; +using GUIProgramsAlt.Database; -namespace GUIPrograms.Items +namespace GUIProgramsAlt.Items { /// <summary> /// Summary description for FilelinkItem. Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/FilterItem.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/FilterItem.cs 2007-08-25 22:33:24 UTC (rev 866) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/FilterItem.cs 2007-08-26 18:09:04 UTC (rev 867) @@ -11,12 +11,12 @@ using MediaPortal.Ripper; using MediaPortal.Util; -using GUIPrograms; -using GUIPrograms... [truncated message content] |
From: <an...@us...> - 2007-08-27 13:37:18
|
Revision: 871 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=871&view=rev Author: and-81 Date: 2007-08-27 05:46:19 -0700 (Mon, 27 Aug 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs trunk/plugins/IR Server Suite/Applications/Debug Client/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/IR Blast/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs trunk/plugins/IR Server Suite/Applications/IR Server/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.Designer.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/EditProgramForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs trunk/plugins/IR Server Suite/Applications/Translator/ProgramSettings.cs trunk/plugins/IR Server Suite/Applications/Translator/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/Tray Launcher/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Common/IrssUtils/IrssUtils.csproj trunk/plugins/IR Server Suite/Common/IrssUtils/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Properties/Resources.Designer.cs trunk/plugins/IR Server Suite/Common/MPUtils/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IPC/Named Pipes/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Custom HID Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Custom HID Receiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionREMOTE Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver/Configure.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver/Configure.cs trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver/Configure.resx trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver/HcwTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver/irremote.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/IRMan Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/IRMan Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/IRTrans Transceiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/IRTransTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug USB Receiver/IgorPlug USB Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug USB Receiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/USB-UIRT Transceiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/UirtTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/Configure.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/CreateIRFile.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/CreateIRFile.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/CreateIRFile.resx trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Transceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Transceiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/Windows Message Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/Windows Message Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/X10 Transceiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/X10Transceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/XBCDRC Receiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/XBCDRC Receiver/XBCDRC Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/XBCDRC Receiver/XBCDRC Receiver.csproj trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/MPBlastZonePlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MPControlPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2BlasterPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs Added Paths: ----------- trunk/plugins/IR Server Suite/Applications/IR File Tool/ trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.Designer.cs trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.cs trunk/plugins/IR Server Suite/Applications/IR File Tool/IR File Tool.csproj trunk/plugins/IR Server Suite/Applications/IR File Tool/Program.cs trunk/plugins/IR Server Suite/Applications/IR File Tool/Properties/ trunk/plugins/IR Server Suite/Applications/IR File Tool/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/SageSetup/ trunk/plugins/IR Server Suite/Applications/SageSetup/FormMain.Designer.cs trunk/plugins/IR Server Suite/Applications/SageSetup/FormMain.cs trunk/plugins/IR Server Suite/Applications/SageSetup/FormMain.resx trunk/plugins/IR Server Suite/Applications/SageSetup/Program.cs trunk/plugins/IR Server Suite/Applications/SageSetup/Properties/ trunk/plugins/IR Server Suite/Applications/SageSetup/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/SageSetup/Sage Setup.csproj trunk/plugins/IR Server Suite/Applications/Translator/EventSchedule.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Win32ErrorCodes.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Advanced.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Advanced.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Advanced.resx trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Win32ErrorCodes.cs trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/ReceiverWindow.cs Property Changed: ---------------- trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/ Modified: trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs 2007-08-27 10:30:17 UTC (rev 870) +++ trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs 2007-08-27 12:46:19 UTC (rev 871) @@ -97,7 +97,7 @@ #region Constants - const string TempIRFile = "test.IR"; + static readonly string DebugIRFile = IrssUtils.Common.FolderIRCommands + "DebugClient.IR"; #endregion @@ -424,7 +424,7 @@ return; } - if (BlastIR(TempIRFile, comboBoxPort.SelectedItem as string)) + if (BlastIR(DebugIRFile, comboBoxPort.SelectedItem as string)) AddStatusLine("Blasting"); else AddStatusLine("Can't Blast"); @@ -443,7 +443,7 @@ return; } - if (LearnIR(TempIRFile)) + if (LearnIR(DebugIRFile)) AddStatusLine("Learning IR"); else AddStatusLine("Learn IR Busy"); Modified: trunk/plugins/IR Server Suite/Applications/Debug Client/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Debug Client/Properties/AssemblyInfo.cs 2007-08-27 10:30:17 UTC (rev 870) +++ trunk/plugins/IR Server Suite/Applications/Debug Client/Properties/AssemblyInfo.cs 2007-08-27 12:46:19 UTC (rev 871) @@ -33,7 +33,7 @@ // 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.3.3")] -[assembly: AssemblyFileVersion("1.0.3.3")] +[assembly: AssemblyVersion("1.0.3.4")] +[assembly: AssemblyFileVersion("1.0.3.4")] [assembly: CLSCompliant(true)] Modified: trunk/plugins/IR Server Suite/Applications/IR Blast/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast/Properties/AssemblyInfo.cs 2007-08-27 10:30:17 UTC (rev 870) +++ trunk/plugins/IR Server Suite/Applications/IR Blast/Properties/AssemblyInfo.cs 2007-08-27 12:46:19 UTC (rev 871) @@ -33,7 +33,7 @@ // 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.3.3")] -[assembly: AssemblyFileVersion("1.0.3.3")] +[assembly: AssemblyVersion("1.0.3.4")] +[assembly: AssemblyFileVersion("1.0.3.4")] [assembly: CLSCompliant(true)] \ No newline at end of file Modified: trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Properties/AssemblyInfo.cs 2007-08-27 10:30:17 UTC (rev 870) +++ trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Properties/AssemblyInfo.cs 2007-08-27 12:46:19 UTC (rev 871) @@ -33,7 +33,7 @@ // 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.3.3")] -[assembly: AssemblyFileVersion("1.0.3.3")] +[assembly: AssemblyVersion("1.0.3.4")] +[assembly: AssemblyFileVersion("1.0.3.4")] [assembly: CLSCompliant(true)] \ No newline at end of file Added: trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.Designer.cs (rev 0) +++ trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.Designer.cs 2007-08-27 12:46:19 UTC (rev 871) @@ -0,0 +1,39 @@ +namespace IR_File_Tool +{ + partial class FormMain + { + /// <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.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Text = "Form1"; + } + + #endregion + } +} + Added: trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.cs (rev 0) +++ trunk/plugins/IR Server Suite/Applications/IR File Tool/FormMain.cs 2007-08-27 12:46:19 UTC (rev 871) @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace IR_File_Tool +{ + public partial class FormMain : Form + { + public FormMain() + { + InitializeComponent(); + } + } +} \ No newline at end of file Added: trunk/plugins/IR Server Suite/Applications/IR File Tool/IR File Tool.csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR File Tool/IR File Tool.csproj (rev 0) +++ trunk/plugins/IR Server Suite/Applications/IR File Tool/IR File Tool.csproj 2007-08-27 12:46:19 UTC (rev 871) @@ -0,0 +1,72 @@ +<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>{B5E711A2-E6D0-4BEA-B66B-7A8B0BCA6A4D}</ProjectGuid> + <OutputType>WinExe</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>IR_File_Tool</RootNamespace> + <AssemblyName>IR File Tool</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> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> + <DebugSymbols>true</DebugSymbols> + <OutputPath>bin\x86\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <DebugType>full</DebugType> + <PlatformTarget>x86</PlatformTarget> + <ErrorReport>prompt</ErrorReport> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> + <OutputPath>bin\x86\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <Optimize>true</Optimize> + <DebugType>pdbonly</DebugType> + <PlatformTarget>x86</PlatformTarget> + <ErrorReport>prompt</ErrorReport> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Deployment" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="FormMain.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="FormMain.Designer.cs"> + <DependentUpon>FormMain.cs</DependentUpon> + </Compile> + <Compile Include="Program.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> \ No newline at end of file Added: trunk/plugins/IR Server Suite/Applications/IR File Tool/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR File Tool/Program.cs (rev 0) +++ trunk/plugins/IR Server Suite/Applications/IR File Tool/Program.cs 2007-08-27 12:46:19 UTC (rev 871) @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Windows.Forms; + +namespace IR_File_Tool +{ + static class Program + { + /// <summary> + /// The main entry point for the application. + /// </summary> + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new FormMain()); + } + } +} \ No newline at end of file Added: trunk/plugins/IR Server Suite/Applications/IR File Tool/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR File Tool/Properties/AssemblyInfo.cs (rev 0) +++ trunk/plugins/IR Server Suite/Applications/IR File Tool/Properties/AssemblyInfo.cs 2007-08-27 12:46:19 UTC (rev 871) @@ -0,0 +1,33 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("IR File Tool")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("IR File Tool")] +[assembly: AssemblyCopyright("Copyright © 2007")] +[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("74144852-ec06-4af4-925f-459e8053b2f8")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] Modified: trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-08-27 10:30:17 UTC (rev 870) +++ trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-08-27 12:46:19 UTC (rev 871) @@ -218,6 +218,8 @@ _notifyIcon.Visible = true; + SystemEvents.PowerModeChanged += new PowerModeChangedEventHandler(SystemEvents_PowerModeChanged); + IrssLog.Info("IR Server started"); return true; @@ -236,6 +238,8 @@ { IrssLog.Info("Stopping IR Server ..."); + SystemEvents.PowerModeChanged -= new PowerModeChangedEventHandler(SystemEvents_PowerModeChanged); + _notifyIcon.Visible = false; if (_mode == IRServerMode.ServerMode) @@ -268,7 +272,7 @@ } try { - if (_pluginTransmit != null) + if (_pluginTransmit != null && _pluginTransmit != _pluginReceive) _pluginTransmit.Stop(); } catch (Exception ex) @@ -609,7 +613,45 @@ } } + void SystemEvents_PowerModeChanged(object sender, PowerModeChangedEventArgs e) + { + switch (e.Mode) + { + case PowerModes.Resume: + { + IrssLog.Info("Resume from standby ..."); + if (_pluginReceive != null) + _pluginReceive.Resume(); + if (_pluginTransmit != null && _pluginTransmit != _pluginReceive) + _pluginTransmit.Resume(); + + // TODO: Inform clients + break; + } + + case PowerModes.Suspend: + { + IrssLog.Info("Enter low-power standby ..."); + + if (_pluginReceive != null) + _pluginReceive.Suspend(); + if (_pluginTransmit != null && _pluginTransmit != _pluginReceive) + _pluginTransmit.Suspend(); + + // TODO: Inform clients + /* + if (_mode == IRServerMode.ServerMode) + { + PipeMessage message = new PipeMessage(Common.ServerPipeName, Environment.MachineName, "Server Shutdown", null); + SendToAll(message); + } + */ + break; + } + } + } + void SendToAll(PipeMessage message) { IrssLog.Debug("SendToAll({0})", message.ToString()); Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs 2007-08-27 10:30:17 UTC (rev 870) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs 2007-08-27 12:46:19 UTC (rev 871) @@ -88,7 +88,7 @@ foreach (Type type in types) { - if (type.IsClass && !type.IsAbstract && type.GetInterface(typeof(IRServerPlugin).Name) == typeof(IRServerPlugin)) + if (type.IsClass && !type.IsAbstract && type.IsSubclassOf(typeof(IRServerPlugin))) { IRServerPlugin plugin = (IRServerPlugin)Activator.CreateInstance(type); if (plugin == null) Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Properties/AssemblyInfo.cs 2007-08-27 10:30:17 UTC (rev 870) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Properties/AssemblyInfo.cs 2007-08-27 12:46:19 UTC (rev 871) @@ -34,8 +34,8 @@ // 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.3.3")] -[assembly: AssemblyFileVersion("1.0.3.3")] +[assembly: AssemblyVersion("1.0.3.4")] +[assembly: AssemblyFileVersion("1.0.3.4")] [assembly: CLSCompliant(true)] Added: trunk/plugins/IR Server Suite/Applications/SageSetup/FormMain.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/SageSetup/FormMain.Designer.cs (rev 0) +++ trunk/plugins/IR Server Suite/Applications/SageSetup/FormMain.Designer.cs 2007-08-27 12:46:19 UTC (rev 871) @@ -0,0 +1,246 @@ +namespace SageSetup +{ + partial class FormMain + { + /// <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.buttonSet = new System.Windows.Forms.Button(); + this.groupBoxIRBlast = new System.Windows.Forms.GroupBox(); + this.radioButtonConsole = new System.Windows.Forms.RadioButton(); + this.radioButtonWindowless = new System.Windows.Forms.RadioButton(); + this.groupBoxSagePlugin = new System.Windows.Forms.GroupBox(); + this.radioButtonExeTuner = new System.Windows.Forms.RadioButton(); + this.radioButtonExeMultiTuner = new System.Windows.Forms.RadioButton(); + this.groupBoxIRServer = new System.Windows.Forms.GroupBox(); + this.comboBoxComputer = new System.Windows.Forms.ComboBox(); + this.groupBoxChannelFormat = new System.Windows.Forms.GroupBox(); + this.checkBoxPad = new System.Windows.Forms.CheckBox(); + this.numericUpDownPad = new System.Windows.Forms.NumericUpDown(); + this.toolTips = new System.Windows.Forms.ToolTip(this.components); + this.groupBoxIRBlast.SuspendLayout(); + this.groupBoxSagePlugin.SuspendLayout(); + this.groupBoxIRServer.SuspendLayout(); + this.groupBoxChannelFormat.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownPad)).BeginInit(); + this.SuspendLayout(); + // + // buttonSet + // + this.buttonSet.Location = new System.Drawing.Point(184, 312); + this.buttonSet.Name = "buttonSet"; + this.buttonSet.Size = new System.Drawing.Size(56, 24); + this.buttonSet.TabIndex = 4; + this.buttonSet.Text = "Set!"; + this.toolTips.SetToolTip(this.buttonSet, "Put the setttings in place"); + this.buttonSet.UseVisualStyleBackColor = true; + this.buttonSet.Click += new System.EventHandler(this.buttonSet_Click); + // + // groupBoxIRBlast + // + this.groupBoxIRBlast.Controls.Add(this.radioButtonWindowless); + this.groupBoxIRBlast.Controls.Add(this.radioButtonConsole); + this.groupBoxIRBlast.Location = new System.Drawing.Point(8, 96); + this.groupBoxIRBlast.Name = "groupBoxIRBlast"; + this.groupBoxIRBlast.Size = new System.Drawing.Size(232, 80); + this.groupBoxIRBlast.TabIndex = 1; + this.groupBoxIRBlast.TabStop = false; + this.groupBoxIRBlast.Text = "IR Blast"; + // + // radioButtonConsole + // + this.radioButtonConsole.AutoSize = true; + this.radioButtonConsole.Checked = true; + this.radioButtonConsole.Location = new System.Drawing.Point(8, 24); + this.radioButtonConsole.Name = "radioButtonConsole"; + this.radioButtonConsole.Size = new System.Drawing.Size(121, 17); + this.radioButtonConsole.TabIndex = 0; + this.radioButtonConsole.TabStop = true; + this.radioButtonConsole.Text = "Use console version"; + this.toolTips.SetToolTip(this.radioButtonConsole, "Use the console version of IR Blast"); + this.radioButtonConsole.UseVisualStyleBackColor = true; + // + // radioButtonWindowless + // + this.radioButtonWindowless.AutoSize = true; + this.radioButtonWindowless.Location = new System.Drawing.Point(8, 48); + this.radioButtonWindowless.Name = "radioButtonWindowless"; + this.radioButtonWindowless.Size = new System.Drawing.Size(138, 17); + this.radioButtonWindowless.TabIndex = 1; + this.radioButtonWindowless.Text = "Use windowless version"; + this.toolTips.SetToolTip(this.radioButtonWindowless, "Use the No Window version of IR Blast"); + this.radioButtonWindowless.UseVisualStyleBackColor = true; + // + // groupBoxSagePlugin + // + this.groupBoxSagePlugin.Controls.Add(this.radioButtonExeMultiTuner); + this.groupBoxSagePlugin.Controls.Add(this.radioButtonExeTuner); + this.groupBoxSagePlugin.Location = new System.Drawing.Point(8, 8); + this.groupBoxSagePlugin.Name = "groupBoxSagePlugin"; + this.groupBoxSagePlugin.Size = new System.Drawing.Size(232, 80); + this.groupBoxSagePlugin.TabIndex = 0; + this.groupBoxSagePlugin.TabStop = false; + this.groupBoxSagePlugin.Text = "Sage Plugin"; + // + // radioButtonExeTuner + // + this.radioButtonExeTuner.AutoSize = true; + this.radioButtonExeTuner.Checked = true; + this.radioButtonExeTuner.Location = new System.Drawing.Point(8, 24); + this.radioButtonExeTuner.Name = "radioButtonExeTuner"; + this.radioButtonExeTuner.Size = new System.Drawing.Size(96, 17); + this.radioButtonExeTuner.TabIndex = 0; + this.radioButtonExeTuner.TabStop = true; + this.radioButtonExeTuner.Text = "Use EXETuner"; + this.toolTips.SetToolTip(this.radioButtonExeTuner, "Use the Sage EXE Tuner plugin"); + this.radioButtonExeTuner.UseVisualStyleBackColor = true; + // + // radioButtonExeMultiTuner + // + this.radioButtonExeMultiTuner.AutoSize = true; + this.radioButtonExeMultiTuner.Location = new System.Drawing.Point(8, 48); + this.radioButtonExeMultiTuner.Name = "radioButtonExeMultiTuner"; + this.radioButtonExeMultiTuner.Size = new System.Drawing.Size(118, 17); + this.radioButtonExeMultiTuner.TabIndex = 1; + this.radioButtonExeMultiTuner.Text = "Use EXEMultiTuner"; + this.toolTips.SetToolTip(this.radioButtonExeMultiTuner, "Use the Sage EXE Multi Tuner plugin"); + this.radioButtonExeMultiTuner.UseVisualStyleBackColor = true; + // + // groupBoxIRServer + // + this.groupBoxIRServer.Controls.Add(this.comboBoxComputer); + this.groupBoxIRServer.Location = new System.Drawing.Point(8, 184); + this.groupBoxIRServer.Name = "groupBoxIRServer"; + this.groupBoxIRServer.Size = new System.Drawing.Size(232, 56); + this.groupBoxIRServer.TabIndex = 2; + this.groupBoxIRServer.TabStop = false; + this.groupBoxIRServer.Text = "IR Server"; + // + // comboBoxComputer + // + this.comboBoxComputer.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.comboBoxComputer.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest; + this.comboBoxComputer.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; + this.comboBoxComputer.FormattingEnabled = true; + this.comboBoxComputer.Location = new System.Drawing.Point(8, 24); + this.comboBoxComputer.Name = "comboBoxComputer"; + this.comboBoxComputer.Size = new System.Drawing.Size(216, 21); + this.comboBoxComputer.TabIndex = 0; + this.toolTips.SetToolTip(this.comboBoxComputer, "Host computer for IR Server"); + // + // groupBoxChannelFormat + // + this.groupBoxChannelFormat.Controls.Add(this.numericUpDownPad); + this.groupBoxChannelFormat.Controls.Add(this.checkBoxPad); + this.groupBoxChannelFormat.Location = new System.Drawing.Point(8, 248); + this.groupBoxChannelFormat.Name = "groupBoxChannelFormat"; + this.groupBoxChannelFormat.Size = new System.Drawing.Size(232, 56); + this.groupBoxChannelFormat.TabIndex = 3; + this.groupBoxChannelFormat.TabStop = false; + this.groupBoxChannelFormat.Text = "Channel Format"; + // + // checkBoxPad + // + this.checkBoxPad.Location = new System.Drawing.Point(8, 24); + this.checkBoxPad.Name = "checkBoxPad"; + this.checkBoxPad.Size = new System.Drawing.Size(144, 20); + this.checkBoxPad.TabIndex = 0; + this.checkBoxPad.Text = "Pad channel number"; + this.toolTips.SetToolTip(this.checkBoxPad, "Do you want to pad channel numbers?"); + this.checkBoxPad.UseVisualStyleBackColor = true; + // + // numericUpDownPad + // + this.numericUpDownPad.Location = new System.Drawing.Point(152, 24); + this.numericUpDownPad.Maximum = new decimal(new int[] { + 9, + 0, + 0, + 0}); + this.numericUpDownPad.Minimum = new decimal(new int[] { + 2, + 0, + 0, + 0}); + this.numericUpDownPad.Name = "numericUpDownPad"; + this.numericUpDownPad.Size = new System.Drawing.Size(72, 20); + this.numericUpDownPad.TabIndex = 1; + this.numericUpDownPad.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.toolTips.SetToolTip(this.numericUpDownPad, "Pad out channel numbers to this many digits"); + this.numericUpDownPad.Value = new decimal(new int[] { + 4, + 0, + 0, + 0}); + // + // FormMain + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(248, 344); + this.Controls.Add(this.groupBoxChannelFormat); + this.Controls.Add(this.groupBoxIRServer); + this.Controls.Add(this.groupBoxSagePlugin); + this.Controls.Add(this.groupBoxIRBlast); + this.Controls.Add(this.buttonSet); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "FormMain"; + this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; + this.Text = "IR Server - Sage Setup"; + this.Load += new System.EventHandler(this.FormMain_Load); + this.groupBoxIRBlast.ResumeLayout(false); + this.groupBoxIRBlast.PerformLayout(); + this.groupBoxSagePlugin.ResumeLayout(false); + this.groupBoxSagePlugin.PerformLayout(); + this.groupBoxIRServer.ResumeLayout(false); + this.groupBoxChannelFormat.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownPad)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Button buttonSet; + private System.Windows.Forms.GroupBox groupBoxIRBlast; + private System.Windows.Forms.RadioButton radioButtonWindowless; + private System.Windows.Forms.RadioButton radioButtonConsole; + private System.Windows.Forms.GroupBox groupBoxSagePlugin; + private System.Windows.Forms.RadioButton radioButtonExeMultiTuner; + private System.Windows.Forms.RadioButton radioButtonExeTuner; + private System.Windows.Forms.GroupBox groupBoxIRServer; + private System.Windows.Forms.ComboBox comboBoxComputer; + private System.Windows.Forms.GroupBox groupBoxChannelFormat; + private System.Windows.Forms.CheckBox checkBoxPad; + private System.Windows.Forms.ToolTip toolTips; + private System.Windows.Forms.NumericUpDown numericUpDownPad; + } +} + Added: trunk/plugins/IR Server Suite/Applications/SageSetup/FormMain.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/SageSetup/FormMain.cs (rev 0) +++ trunk/plugins/IR Server Suite/Applications/SageSetup/FormMain.cs 2007-08-27 12:46:19 UTC (rev 871) @@ -0,0 +1,108 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +using Microsoft.Win32; +using IrssUtils; + +namespace SageSetup +{ + + public partial class FormMain : Form + { + string _irBlastLocation = null; + + public FormMain() + { + InitializeComponent(); + } + + private void FormMain_Load(object sender, EventArgs e) + { + ArrayList networkPCs = Win32.GetNetworkComputers(); + if (networkPCs == null) + { + MessageBox.Show(this, "No server names detected.", "Network Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + Application.Exit(); + return; + } + else + { + comboBoxComputer.Items.AddRange(networkPCs.ToArray()); + } + + _irBlastLocation = SystemRegistry.GetInstallFolder(); + + if (String.IsNullOrEmpty(_irBlastLocation)) + { + MessageBox.Show(this, "IR Server Suite install location not found, please re-install IR Server Suite", "Application Location Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + Application.Exit(); + return; + } + } + + private void buttonSet_Click(object sender, EventArgs e) + { +/* +[HKEY_LOCAL_MACHINE\SOFTWARE\Sage\EXETunerPlugin] +"Command"="\"C:\\Program Files\\IR Server Suite\\IR Blast\\IRBlast.exe\" -host localhost -channel %CHANNEL%" + +[HKEY_LOCAL_MACHINE\SOFTWARE\Frey Technologies\Common\EXEMultiTunerPlugin] +"Command"="\"C:\\Program Files\\IR Server Suite\\IR Blast\\IRBlast.exe\" -host localhost -port Port_%DEVICE% -channel %CHANNEL%" +*/ + string hostComputer = comboBoxComputer.Text; + + if (String.IsNullOrEmpty(hostComputer)) + { + MessageBox.Show(this, "You must specify an IR Server host computer", "No Server Host", MessageBoxButtons.OK, MessageBoxIcon.Warning); + return; + } + + try + { + RegistryKey mainKey; + if (radioButtonExeTuner.Checked) + mainKey = Registry.LocalMachine.CreateSubKey("SOFTWARE\\Sage\\EXETunerPlugin"); + else + mainKey = Registry.LocalMachine.CreateSubKey("SOFTWARE\\Frey Technologies\\Common\\EXEMultiTunerPlugin"); + + StringBuilder command = new StringBuilder(); + command.Append("\""); + command.Append(_irBlastLocation); + command.Append("\\IR Blast\\"); + if (radioButtonConsole.Checked) + command.Append("IRBlast.exe"); + else + command.Append("IRBlast-NoWindow.exe"); + command.Append("\""); + + command.Append(" -host "); + command.Append(hostComputer); + + if (radioButtonExeMultiTuner.Checked) + command.Append(" -port Port_%DEVICE%"); + + if (checkBoxPad.Checked) + command.AppendFormat(" -pad {0}", numericUpDownPad.Value); + + command.Append(" -channel %CHANNEL%"); + + mainKey.SetValue("Command", command.ToString(), RegistryValueKind.String); + mainKey.Close(); + + MessageBox.Show(this, "Sage plugin setup complete", "Done", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + catch (Exception ex) + { + MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + } + +} Added: trunk/plugins/IR Server Suite/Applications/SageSetup/FormMain.resx =================================================================== --- trunk/plugins/IR Server Suite/Applications/SageSetup/FormMain.resx (rev 0) +++ trunk/plugins/IR Server Suite/Applications/SageSetup/FormMain.resx 2007-08-27 12:46:19 UTC (rev 871) @@ -0,0 +1,123 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <metadata name="toolTips.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>17, 17</value> + </metadata> +</root> \ No newline at end of file Added: trunk/plugins/IR Server Suite/Applications/SageSetup/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/SageSetup/Program.cs (rev 0) +++ trunk/plugins/IR Server Suite/Applications/SageSetup/Program.cs 2007-08-27 12:46:19 UTC (rev 871) @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Windows.Forms; + +namespace SageSetup +{ + + static class Program + { + + /// <summary> + /// The main entry point for the application. + /// </summary> + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new FormMain()); + } + + } + +} Added: trunk/plugins/IR Server Suite/Applications/SageSetup/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/SageSetup/Properties/AssemblyInfo.cs (rev 0) +++ trunk/plugins/IR Server Suite/Applications/SageSetup/Properties/AssemblyInfo.cs 2007-08-27 12:46:19 UTC (rev 871) @@ -0,0 +1,33 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("IR Server - Sage Setup")] +[assembly: AssemblyDescription("Setup the Sage EXE Tuner plugins for use with IR Server")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("SageSetup")] +[assembly: AssemblyCopyright("Copyright © Aaron Dinnage, 2007")] +[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("98cabc3d-5464-4122-aa78-483535991e02")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("1.0.3.4")] +[assembly: AssemblyFileVersion("1.0.3.4")] Added: trunk/plugins/IR Server Suite/Applications/SageSetup/Sage Setup.csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/SageSetup/Sage Setup.csproj (rev 0) +++ trunk/plugins/IR Server Suite/Applications/SageSetup/Sage Setup.csproj 2007-08-27 12:46:19 UTC (rev 871) @@ -0,0 +1,88 @@ +<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>{905131F8-F8AC-4A65-A722-37783902D7B8}</ProjectGuid> + <OutputType>WinExe</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>SageSetup</RootNamespace> + <AssemblyName>SageSetup</AssemblyName> + <StartupObject>SageSetup.Program</StartupObject> + <RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> + <DebugSymbols>true</DebugSymbols> + <OutputPath>bin\x86\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <DebugType>full</DebugType> + <PlatformTarget>x86</PlatformTarget> + <ErrorReport>prompt</ErrorReport> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> + <OutputPath>bin\x86\Release\</OutputPath> + <Optimize>true</Optimize> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + <DebugType>none</DebugType> + <PlatformTarget>x86</PlatformTarget> + <UseVSHostingProcess>false</UseVSHostingProcess> + <ErrorReport>prompt</ErrorReport> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <DebugType>full</DebugType> + <PlatformTarget>AnyCPU</PlatformTarget> + <ErrorReport>prompt</ErrorReport> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <OutputPath>bin\Release\</OutputPath> + <Optimize>true</Optimize> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + <DebugType>pdbonly</DebugType> + <PlatformTarget>AnyCPU</PlatformTarget> + <UseVSHostingProcess>false</UseVSHostingProcess> + <ErrorReport>prompt</ErrorReport> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Deployment" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="FormMain.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="FormMain.Designer.cs"> + <DependentUpon>FormMain.cs</DependentUpon> + </Compile> + <Compile Include="Program.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + <EmbeddedResource Include="FormMain.resx"> + <SubType>Designer</SubType> + <DependentUpon>FormMain.cs</DependentUpon> + </EmbeddedResource> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\..\Common\IrssUtils\IrssUtils.csproj"> + <Project>{CA15769C-232E-4CA7-94FD-206A06CA3ABB}</Project> + <Name>IrssUtils</Name> + </ProjectReference> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> + <PropertyGroup> + <PostBuildEvent>copy "*.*" "\MediaPortal Development\Plugin Releases\IR Server Suite\$(ProjectName)\"</PostBuildEvent> + </PropertyGroup> +</Project> \ No newline at end of file Added: trunk/plugins/IR Server Suite/Applications/Translator/EventSchedule.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/EventSchedule.cs (rev 0) +++ trunk/plugins/IR Server Suite/Applications/Translator/EventSchedule.cs 2007-08-27 12:46:19 UTC (rev 871) @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Translator +{ + + #region Enumerations + + public enum ScheduleRepeat + { + Never, + Minutes, + Hours, + Days, + Weeks, + Months, + Years, + } + + [Flags] + public enum ScheduleDays + { + None, + Monday, + Tuesday, + Wednesday, + Thursday, + Friday, + Saturday, + Sunday, + } + + [Flags] + public enum ScheduleMonths + { + None, + January, + February, + March, + April, + May, + June, + July, + August, + September, + October, + November, + December, + } + + #endregion Enumerations + + public class EventSchedule + { + //DateTime _start; + + //ScheduleRepeat _repeat = ScheduleRepeat.Never; + //ScheduleDays _days = ScheduleDays.None; + //ScheduleMonths _months = ScheduleMonths.None; + + } + +} Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.Designer.cs 2007-08-27 10:30:17 UTC (rev 870) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.Designer.cs 2007-08-27 12:46:19 UTC (rev 871) @@ -174,6 +174,7 @@ this.buttonCancel = new System.Windows.Forms.Button(); this.buttonOK = new System.Windows.Forms.Button(); this.toolTips = new System.Windows.Forms.ToolTip(this.components); + this.checkBoxForceFocus = new System.Windows.Forms.CheckBox(); this.groupBoxButton.SuspendLayout(); this.groupBoxSet.SuspendLayout(); this.tabControl.SuspendLayout(); @@ -326,7 +327,7 @@ this.tabPageBlastIR.Location = new System.Drawing.Point(4, 22); this.tabPageBlastIR.Name = "tabPageBlastIR"; this.tabPageBlastIR.Padding = new System.Windows.Forms.Padding(3); - this.tabPageBlastIR.Size = new System.Drawing.Size(432, 206); + this.tabPageBlastIR.Size = new System.Drawing.Size(440, 206); this.tabPageBlastIR.TabIndex = 0; this.tabPageBlastIR.Text = "Blast IR"; this.tabPageBlastIR.UseVisualStyleBackColor = true; @@ -389,7 +390,7 @@ this.tabPageMacro.Location = new System.Drawing.Point(4, 22); this.tabPageMacro.Name = "tabPageMacro"; this.tabPageMacro.Padding = new System.Windows.Forms.Padding(3); - this.tabPageMacro.Size = new System.Drawing.Size(432, 206); + this.tabPageMacro.Size = new System.Drawing.Size(440, 206); this.tabPageMacro.TabIndex = 1; this.tabPageMacro.Text = "Macro"; this.tabPageMacro.UseVisualStyleBackColor = true; @@ -428,6 +429,7 @@ // // tabPageProgram // + this.tabPageProgram.Controls.Add(this.checkBoxForceFocus); this.tabPageProgram.Controls.Add(this.checkBoxNoWindow); this.tabPageProgram.Controls.Add(this.checkBoxShellExecute); this.tabPageProgram.Controls.Add(this.comboBoxWindowStyle); @@ -443,14 +445,14 @@ this.tabPageProgram.Location = new System.Drawing.Point(4, 22); this.tabPageProgram.Name = "tabPageProgram"; this.tabPageProgram.Padding = new System.Windows.Forms.Padding(3); - this.tabPageProgram.Size = new System.Drawing.Size(432, 206); + this.tabPageProgram.Size = new System.Drawing.Size(440, 206); this.tabPageProgram.TabIndex = 3; this.tabPageProgram.Text = "Run"; this.tabPageProgram.UseVisualStyleBackColor = true; // // checkBoxNoWindow // - this.checkBoxNoWindow.Location = new System.Drawing.Point(216, 112); + this.checkBoxNoWindow.Location = new System.Drawing.Point(232, 112); this.checkBoxNoWindow.Name = "checkBoxNoWindow"; this.checkBoxNoWindow.Size = new System.Drawing.Size(104, 21); this.checkBoxNoWindow.TabIndex = 10; @@ -460,9 +462,10 @@ // checkBoxShellExecute // this.checkBoxShellExecute.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.checkBoxShellExecute.AutoSize = true; this.checkBoxShellExecute.Location = new System.Drawing.Point(8, 144); this.checkBoxShellExecute.Name = "checkBoxShellExecute"; - this.checkBoxShellExecute.Size = new System.Drawing.Size(168, 20); + this.checkBoxShellExecute.Size = new System.Drawing.Size(141, 17); this.checkBoxShellExecute.TabIndex = 11; this.checkBoxShellExecute.Text = "Start using ShellExecute"; this.checkBoxShellExecute.UseVisualStyleBackColor = true; @@ -575,7 +578,7 @@ this.tabPageSerial.Location = new System.Drawing.Point(4, 22); this.tabPageSerial.Name = "tabPageSerial"; this.tabPageSerial.Padding = new System.Windows.Forms.Padding(3); - this.tabPageSerial.Size = new System.Drawing.Size(432, 206); + this.tabPageSerial.Size = new System.Drawing.Size(440, 206); this.tabPageSerial.TabIndex = 2; this.tabPageSerial.Text = "Serial"; this.tabPageSerial.UseVisualStyleBackColor = true; @@ -757,7 +760,7 @@ this.tabPageMessage.Location = new System.Drawing.Point(4, 22); this.tabPageMessage.Name = "tabPageMessage"; this.tabPageMessage.Padding = new System.Windows.Forms.Padding(3); - this.tabPageMessage.Size = new System.Drawing.Size(432, 206); + this.tabPageMessage.Size = new System.Drawing.Size(440, 206); this.tabPageMessage.TabIndex = 4; this.tabPageMessage.Text = "Window Message"; this.tabPageMessage.UseVisualStyleBackColor = true; @@ -936,7 +939,7 @@ this.tabPageKeystrokes.Location = new System.Drawing.Point(4, 22); this.tabPageKeystrokes.Name = "tabPageKeystrokes"; this.tabPageKeystrokes.Padding = new System.Windows.Forms.Padding(3); - this.tabPageKeystrokes.Size = new System.Drawing.Size(432, 206); + this.tabPageKeystrokes.Size = new System.Drawing.Size(440, 206); this.tabPageKeystrokes.TabIndex = 5; this.tabPageKeystrokes.Text = "Keystrokes"; this.tabPageKeystrokes.UseVisualStyleBackColor = true; @@ -1427,7 +1430,7 @@ this.tabPageMouse.Location = new System.Drawing.Point(4, 22); this.tabPageMouse.Name = "tabPageMouse"; this.tabPageMouse.Padding = new System.Windows.Forms.Padding(3); - this.tabPageMouse.Size = new System.Drawing.Size(432, 206); + this.tabPageMouse.Size = new System.Drawing.Size(440, 206); this.tabPageMouse.TabIndex = 6; this.tabPageMouse.Text = "Mouse"; this.tabPageMouse.UseVisualStyleBackColor = true; @@ -1684,6 +1687,16 @@ this.buttonOK.UseVisualStyleBackColor = true; this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); // + // checkBoxForceFocus + // + this.checkBoxForceFocus.AutoSize = true; + this.checkBoxForceFocus.Location = new System.Drawing.Point(232, 144); + this.checkBoxForceFocus.Name = "checkBoxForceFocus"; + this.checkBoxForceFocus.Size = new System.Drawing.Size(121, 17); + this.checkBoxForceFocus.TabIndex = 12; + this.checkBoxForceFocus.Text = "Force window focus"; + this.checkBoxForceFocus.UseVisualStyleBackColor = true; + // // ButtonMappingForm // this.AcceptButton = this.buttonOK; @@ -1883,6 +1896,7 @@ private System.Windows.Forms.TabPage tabPageMisc; private System.Windows.Forms.Label labelMiscCommand; private System.Windows.Forms.ComboBox comboBoxMiscCommand; + private System.Windows.Forms.CheckBox checkBoxForceFocus; } } \ No newline at end of file Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/ButtonMappingForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications... [truncated message content] |
From: <nor...@us...> - 2007-08-27 13:37:15
|
Revision: 870 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=870&view=rev Author: northern_sky Date: 2007-08-27 03:30:17 -0700 (Mon, 27 Aug 2007) Log Message: ----------- more cleanups Modified Paths: -------------- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAlt.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAlt.csproj Removed Paths: ------------- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAltUserSettings.cs Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAlt.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAlt.cs 2007-08-27 05:44:33 UTC (rev 869) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAlt.cs 2007-08-27 10:30:17 UTC (rev 870) @@ -61,25 +61,20 @@ { #region Variables - - + bool currentSortAsc = true; - // FacadeView - const int facadeIDConst = 50; ProgramViewHandler viewHandler = ProgramViewHandler.Instance; List<ApplicationItem> globalApplicationList;// dbHandlerInstance.ApplicationItemList; DirectoryHistory itemHistory = new DirectoryHistory(); int slideSpeed = 3000; // speed in milliseconds between two slides long slideTime = 0; - bool skipInit = false; static string _thumbnailPath = string.Empty; static string _lastThumbnailPath = string.Empty; ProgramSort.SortMethod currentSortMethod = ProgramSort.SortMethod.Title; DatabaseHandler dbHandlerInstance = DatabaseHandler.DBHandlerInstance; - GUIProgramsAltUserSettings userSettings = new GUIProgramsAltUserSettings(); - ApplicationItem lastApp = null; + ApplicationItem currentApplicationItem = null; string prevFilepath = ""; int selectedItemIndex = -1; Layout currentLayout = Layout.List; @@ -97,125 +92,19 @@ [SkinControl(6)] protected GUIImage screenShotImage = null; - [SkinControl(facadeIDConst)] + [SkinControl(50)] protected GUIFacadeControl facadeView = null; #endregion Variables - void SaveSettings() - { - using (Settings xmlwriter = new Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) - { - switch ((Layout)userSettings.ViewLayout) - { - case Layout.List: - xmlwriter.SetValue("myprograms", "viewLayout", "list"); - break; - case Layout.Icons: - xmlwriter.SetValue("myprograms", "viewLayout", "icons"); - break; - case Layout.LargeIcons: - xmlwriter.SetValue("myprograms", "viewLayout", "largeicons"); - break; - case Layout.FilmStrip: - xmlwriter.SetValue("myprograms", "viewLayout", "filmstrip"); - break; - } - xmlwriter.SetValue("myprograms", "lastAppID", userSettings.LastAppID.ToString()); - // xmlwriter.SetValue("myprograms", "lastViewLevel", userSettings.LastViewLevel.ToString()); - xmlwriter.SetValue("myprograms", "lastViewLevel", ViewHandler.CurrentLevel); - xmlwriter.SetValue("myprograms", "sortMethod", userSettings.SortMethod); - // avoid bool conversion...... don't wanna know why it doesn't work! :-( - if (userSettings.SortAscending) - { - xmlwriter.SetValue("myprograms", "sortASC", "yes"); - } - else - { - xmlwriter.SetValue("myprograms", "sortASC", "no"); - } - - if (userSettings.OverviewVisible) - { - xmlwriter.SetValue("myprograms", "overviewvisible", "yes"); - } - else - { - xmlwriter.SetValue("myprograms", "overviewvisible", "no"); - } - - xmlwriter.SetValue("myprograms", "startview", (int)userSettings.ViewLayout); - } - } - - void LoadSettings() - { - slideSpeed = ProgramUtils.GetSleepTime(); - - using (Settings xmlreader = new Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) - { - string curText = ""; - curText = xmlreader.GetValueAsString("myprograms", "viewLayout", "list"); - - if (curText == "list") userSettings.ViewLayout = (int)Layout.List; - else if (curText == "icons") userSettings.ViewLayout = (int)Layout.Icons; - else if (curText == "largeicons") userSettings.ViewLayout = (int)Layout.LargeIcons; - else if (curText == "filmstrip") userSettings.ViewLayout = (int)Layout.FilmStrip; - else userSettings.ViewLayout = (int)Layout.List; - - CurrentSortMethod = (ProgramSort.SortMethod)xmlreader.GetValueAsInt("myprograms", "sortMethod", (int)ProgramSort.SortMethod.Title); - - userSettings.LastAppID = xmlreader.GetValueAsInt("myprograms", "lastAppID", -1); - userSettings.LastViewLevel = xmlreader.GetValueAsInt("myprograms", "lastViewLevel", -1); - userSettings.SortAscending = xmlreader.GetValueAsBool("myprograms", "sortASC", true); - userSettings.OverviewVisible = xmlreader.GetValueAsBool("myprograms", "sortASC", true); - } - } - - void LoadLastAppIDFromSettings() - { - using (Settings xmlreader = new Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) - { - userSettings.LastAppID = xmlreader.GetValueAsInt("myprograms", "lastAppID", -1); - userSettings.LastViewLevel = xmlreader.GetValueAsInt("myprograms", "lastViewLevel", -1); - userSettings.SortMethod = xmlreader.GetValueAsInt("myprograms", "sortMethod", 0); - userSettings.SortAscending = xmlreader.GetValueAsBool("myprograms", "sortAsc", true); - userSettings.OverviewVisible = xmlreader.GetValueAsBool("myprograms", "overviewvisible", true); - } - } - - void LoadFolderSettings(string directoryName) - { - if (directoryName == "") - directoryName = "root"; - - object o; - FolderSettings.GetFolderSetting(directoryName, "Programs", typeof(GUIProgramsAltUserSettings), out o); - if (o != null) - userSettings = o as GUIProgramsAltUserSettings; - if (userSettings == null) - userSettings = new GUIProgramsAltUserSettings(); - } - - void SaveFolderSettings(string directoryName) - { - if (directoryName == "") - directoryName = "root"; - FolderSettings.AddFolderSetting(directoryName, "Programs", typeof(GUIProgramsAltUserSettings), userSettings); - } - #region Constructor / Destructor public GUIProgramsAlt() { - - GetID = (int)Window.WINDOW_FILES; + GetID = (int)Window.WINDOW_FILES; } - - - #endregion Constructor / Destructor #region Properties / Helper Routines @@ -271,9 +160,9 @@ int GetCurrentFatherID() { - if (lastApp != null) + if (currentApplicationItem != null) { - return lastApp.ApplicationItemId; + return currentApplicationItem.ApplicationItemId; } else { @@ -284,27 +173,66 @@ bool ThereAreAppsToDisplay() { - if (lastApp == null) + if (currentApplicationItem == null) { return true; // root has globalApplicationList } else { - return lastApp.SubItemsAllowed(); // grouper items for example + return currentApplicationItem.SubItemsAllowed(); // grouper items for example } } - bool ThereAreFilesOrLinksToDisplay() + bool IsCurrentApplicationItemNull() { - return (lastApp != null); // all globalApplicationList can have files except the root + return (currentApplicationItem != null); // all globalApplicationList can have files except the root } - bool IsBackButtonNecessary() + #endregion + + string GetViewLayoutAsText() { - return (lastApp != null); // always show back button except for root + string result; + + switch (CurrentLayout) + { + case Layout.List: + result = GUILocalizeStrings.Get(101); + break; + case Layout.Icons: + result = GUILocalizeStrings.Get(100); + break; + case Layout.LargeIcons: + result = GUILocalizeStrings.Get(417); + break; + case Layout.FilmStrip: + result = GUILocalizeStrings.Get(733); + break; + default: + result = ""; + break; + } + return result; } - #endregion + public void SwitchToNextViewLayout() + { + switch (CurrentLayout) + { + case Layout.List: + CurrentLayout = Layout.Icons; + break; + case Layout.Icons: + CurrentLayout = Layout.LargeIcons; + break; + case Layout.LargeIcons: + CurrentLayout = Layout.FilmStrip; + break; + case Layout.FilmStrip: + CurrentLayout = Layout.List; + break; + } + } #region Private Methods @@ -313,9 +241,55 @@ dbHandlerInstance.LoadAllApplicationItems(); globalApplicationList = dbHandlerInstance.ApplicationItemList; LoadSettings(); - skipInit = true; } + void SaveSettings() + { + using (Settings xmlwriter = new Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + { + if (currentApplicationItem != null) + { + xmlwriter.SetValue("myProgramsAlt", "applicationItemId", currentApplicationItem.ApplicationItemId); + } + xmlwriter.SetValue("myProgramsAlt", "lastViewLevel", ViewHandler.CurrentLevel); + xmlwriter.SetValue("myProgramsAlt", "sortMethod", (int)CurrentSortMethod); + xmlwriter.SetValue("myProgramsAlt", "view", ViewHandler.CurrentView); + + // avoid bool conversion...... don't wanna know why it doesn't work! :-( + if (CurrentSortAsc) + { + xmlwriter.SetValue("myProgramsAlt", "sortASC", "yes"); + } + else + { + xmlwriter.SetValue("myProgramsAlt", "sortASC", "no"); + } + xmlwriter.SetValue("myProgramsAlt", "viewLayout", (int)CurrentLayout); + } + } + + void LoadSettings() + { + slideSpeed = ProgramUtils.GetSleepTime(); + + using (Settings xmlreader = new Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + { + CurrentSortMethod = (ProgramSort.SortMethod)xmlreader.GetValueAsInt("myProgramsAlt", "sortMethod", (int)ProgramSort.SortMethod.Title); + CurrentLayout = (Layout)xmlreader.GetValueAsInt("myProgramsAlt", "viewLayout", (int)Layout.List); + + if (currentApplicationItem == null) + {//create a fake tmpappitem so it's not null + currentApplicationItem = new ApplicationItemGrouper(); + } + currentApplicationItem.ApplicationItemId = xmlreader.GetValueAsInt("myProgramsAlt", "applicationItemId", -1); + + ViewHandler.CurrentLevel = xmlreader.GetValueAsInt("myProgramsAlt", "lastViewLevel", -1); + CurrentSortAsc = xmlreader.GetValueAsBool("myProgramsAlt", "sortASC", true); + ViewHandler.CurrentView = xmlreader.GetValueAsString("myProgramsAlt", "view", ""); + } + } + + void SortChanged(object sender, SortEventArgs args) { this.CurrentSortAsc = args.Order != System.Windows.Forms.SortOrder.Descending; @@ -329,13 +303,13 @@ GUIPropertyManager.SetProperty("#view", ViewHandler.LocalizedCurrentView); - if (lastApp == null) + if (currentApplicationItem == null) { btnRefresh.IsVisible = false; } else { - btnRefresh.IsVisible = lastApp.RefreshGUIAllowed; + btnRefresh.IsVisible = currentApplicationItem.RefreshGUIAllowed; } facadeView.IsVisible = true; @@ -343,7 +317,7 @@ GUIControl.FocusControl(GetID, facadeView.GetID); // display apptitle if available..... - if (lastApp != null) + if (currentApplicationItem != null) { if ((ViewHandler.CurrentView != null) && (ViewHandler.MaxLevels > 0)) { @@ -351,7 +325,7 @@ } else { - GUIPropertyManager.SetProperty("#curheader", lastApp.Title); + GUIPropertyManager.SetProperty("#curheader", currentApplicationItem.Title); } } else @@ -367,7 +341,7 @@ } } - btnViewAs.Label = userSettings.ViewLayoutTextName; + btnViewAs.Label = GetViewLayoutAsText(); switch (CurrentSortMethod) { @@ -402,7 +376,7 @@ { int itemIndex = facadeView.SelectedListItemIndex; - switch ((Layout)userSettings.ViewLayout) + switch (CurrentLayout) { case Layout.List: facadeView.View = GUIFacadeControl.ViewMode.List; @@ -439,7 +413,7 @@ void RefreshThumbnail() { - ApplicationItem appWithImg = lastApp; + ApplicationItem appWithImg = currentApplicationItem; GUIListItem item = GetSelectedItem(); // some preconditions... @@ -467,16 +441,16 @@ void UpdateListControl() { GUIControl.ClearControl(GetID, facadeView.GetID); - if (IsBackButtonNecessary()) + if (IsCurrentApplicationItemNull()) ProgramUtils.AddBackButton(facadeView); int TotalItems = 0; if (ThereAreAppsToDisplay()) TotalItems += DisplayApps(); - if (ThereAreFilesOrLinksToDisplay()) + if (IsCurrentApplicationItemNull()) TotalItems += DisplayFiles(); - if (lastApp != null) + if (currentApplicationItem != null) facadeView.Sort(new ProgramSort(CurrentSortMethod, CurrentSortAsc)); //set object count label @@ -491,16 +465,16 @@ int DisplayFiles() { - if (lastApp == null) return 0; + if (currentApplicationItem == null) return 0; // Refresh FileList if view has changed, while this appItem was not active - if ((lastApp.CurrentView != ViewHandler.CurrentView) || (lastApp.filesAreLoaded == false)) + if ((currentApplicationItem.CurrentView != ViewHandler.CurrentView) || (currentApplicationItem.filesAreLoaded == false)) { - lastApp.LoadFiles(); - lastApp.CurrentView = ViewHandler.CurrentView; + currentApplicationItem.LoadFiles(); + currentApplicationItem.CurrentView = ViewHandler.CurrentView; } int totalFiles = 0; - totalFiles = totalFiles + DisplayItemList(lastApp.ItemList, facadeView); + totalFiles = totalFiles + DisplayItemList(currentApplicationItem.ItemList, facadeView); return (totalFiles); } @@ -544,45 +518,13 @@ return (totalApps); } - string BuildHistoryKey(ApplicationItem app, int viewLevel, string pathSub) - { - int appID; - if (app != null) - { - appID = app.ApplicationItemId; - } - else - { - appID = 1; // root - } - return String.Format("applicationItem{0}#level{1}#sub_{2}", appID, viewLevel, pathSub); - } - public void SaveItemIndex(string value, ApplicationItem app, string pathSub) - { - string key = BuildHistoryKey(app, ViewHandler.CurrentLevel, pathSub); - itemHistory.Set(value, key); - } - void RestoreItemIndex(ApplicationItem app, string pathSub) - { - string key = BuildHistoryKey(app, ViewHandler.CurrentLevel, pathSub); - string itemHist = itemHistory.Get(key); - if (itemHist != "") - { - int itemIndex = ProgramUtils.StringToInteger(itemHist, -1); - if ((itemIndex >= 0) && (itemIndex <= facadeView.Count - 1)) - { - GUIControl.SelectItemControl(GetID, facadeView.GetID, itemIndex); - } - } - } - void BackItemClicked() { - if (lastApp != null) + if (currentApplicationItem != null) { - if ((prevFilepath != null) && (prevFilepath != "") && (prevFilepath != lastApp.FileDirectory)) + if ((prevFilepath != null) && (prevFilepath != "") && (prevFilepath != currentApplicationItem.FileDirectory)) { // back item in filelist clicked prevFilepath = Path.GetDirectoryName(prevFilepath); @@ -593,22 +535,22 @@ { FilterItem curFilter; // force reload, this will load the next filter-level..... - lastApp.LoadFiles(); + currentApplicationItem.LoadFiles(); // auto-remove filters if there is only ONE EMPTY Filteritem // displaying - bool doAutoRemove = ((lastApp.ItemList.Count == 1) && (ViewHandler.IsFilterQuery)); + bool doAutoRemove = ((currentApplicationItem.ItemList.Count == 1) && (ViewHandler.IsFilterQuery)); while (doAutoRemove) { doAutoRemove = false; - if (lastApp.ItemList[0] is FilterItem) + if (currentApplicationItem.ItemList[0] is FilterItem) { - curFilter = lastApp.ItemList[0] as FilterItem; + curFilter = currentApplicationItem.ItemList[0] as FilterItem; if ((curFilter.Title == "") && (curFilter.Title2 == "")) { if (ViewHandler.RemoveFilterItem()) { - lastApp.LoadFiles(); - doAutoRemove = ((lastApp.ItemList.Count == 1) && (ViewHandler.IsFilterQuery)); + currentApplicationItem.LoadFiles(); + doAutoRemove = ((currentApplicationItem.ItemList.Count == 1) && (ViewHandler.IsFilterQuery)); } } } @@ -618,23 +560,23 @@ { // back item in application list clicked // go to father item - lastApp = this.dbHandlerInstance.GetAppByID(lastApp.FatherID); - if (lastApp != null) + currentApplicationItem = this.dbHandlerInstance.GetAppByID(currentApplicationItem.FatherID); + if (currentApplicationItem != null) { - userSettings.LastAppID = lastApp.ApplicationItemId; - prevFilepath = lastApp.DefaultFilepath(); + //userSettings.LastAppID = currentApplicationItem.ApplicationItemId; + prevFilepath = currentApplicationItem.DefaultFilepath(); } else { // back to home screen..... - userSettings.LastAppID = -1; + //currentApplicationItem.ApplicationItemId = -1; prevFilepath = ""; } } } UpdateButtonStates(); UpdateListControl(); - RestoreItemIndex(lastApp, prevFilepath); + //RestoreItemIndex(currentApplicationItem, prevFilepath); } else { @@ -739,7 +681,7 @@ dlgProgress.ShowProgressBar(false); curFile.FileInfoFavourite = (FileItemInfo)curFile.FileInfoList[iSelectedGame]; - curFile.FindFileInfoDetail(lastApp, curFile.FileInfoFavourite, ScraperType.ALLGAME, saveType); + curFile.FindFileInfoDetail(currentApplicationItem, curFile.FileInfoFavourite, ScraperType.ALLGAME, saveType); if ((saveType == ScraperSaveType.DataAndImages) || (saveType == ScraperSaveType.Data)) { // dlgProgress.SetPercentage(60); @@ -807,35 +749,35 @@ if (item is ApplicationItem) { - lastApp = (ApplicationItem)item; - SaveItemIndex(GetSelectedItemNo().ToString(), lastApp, lastApp.lastFilepath); - userSettings.LastAppID = lastApp.ApplicationItemId; - prevFilepath = lastApp.DefaultFilepath(); + currentApplicationItem = (ApplicationItem)item; + //SaveItemIndex(GetSelectedItemNo().ToString(), currentApplicationItem, currentApplicationItem.lastFilepath); + + prevFilepath = currentApplicationItem.DefaultFilepath(); ViewHandler.CurrentLevel = 0; - //lastApp.ViewHandler = ViewHandler; + //currentApplicationItem.ViewHandler = ViewHandler; } else if (item is FileItem) { FileItem fileItem = (FileItem)item; selectedItemIndex = GetSelectedItemNo(); - if (lastApp != null) + if (currentApplicationItem != null) { - userSettings.LastAppID = lastApp.ApplicationItemId; - prevFilepath = lastApp.DefaultFilepath(); - lastApp.LaunchFile(fileItem); + + prevFilepath = currentApplicationItem.DefaultFilepath(); + currentApplicationItem.LaunchFile(fileItem); } } else if (item is FilterItem) { FilterItem filterItem = (FilterItem)item; - SaveItemIndex(GetSelectedItemNo().ToString(), lastApp, prevFilepath); + // SaveItemIndex(GetSelectedItemNo().ToString(), currentApplicationItem, prevFilepath); ViewHandler.AddFilterItem(filterItem); - if (lastApp != null) + if (currentApplicationItem != null) { // force reload, this will load the next filter-level..... - lastApp.LoadFiles(); + currentApplicationItem.LoadFiles(); } } @@ -892,7 +834,7 @@ string imgFile = String.Empty; if (ProgramUtils.UseThumbsDir()) - imgFile = ProgramUtils.GetFileImage(lastApp, curFileItem); + imgFile = ProgramUtils.GetFileImage(currentApplicationItem, curFileItem); else imgFile = curFileItem.Imagefile; @@ -977,7 +919,7 @@ void ShowInfoWindow() { - if (lastApp == null) return; + if (currentApplicationItem == null) return; selectedItemIndex = GetSelectedItemNo(); GUIListItem item = GetSelectedItem(); @@ -992,7 +934,7 @@ curFile = (FileItem)item.MusicTag; GUIProgramsAltFileInfo fileInfo = (GUIProgramsAltFileInfo)GUIWindowManager.GetWindow(9999); fileInfo.CurrentFileItem = curFile; - fileInfo.CurrentApplicationItem = lastApp; + fileInfo.CurrentApplicationItem = currentApplicationItem; fileInfo.FolderForThumbs = string.Empty; GUIWindowManager.ActivateWindow(9999); } @@ -1033,7 +975,7 @@ if (dlg.SelectedLabel == -1) return; if (dlg.SelectedLabel == 0) { - userSettings.ViewLayout = (int)Layout.List; + CurrentLayout = Layout.List; ViewHandler.CurrentView = GUILocalizeStrings.Get(100000 + GetID);//my files } else @@ -1064,39 +1006,26 @@ protected override void OnPageLoad() { - InitGUIProgramsAlt(); - base.OnPageLoad(); + InitGUIProgramsAlt(); + if (btnSortBy != null) btnSortBy.SortChanged += new SortEventHandler(SortChanged); - LoadFolderSettings(""); - - if (skipInit) + if (currentApplicationItem != null) { - userSettings.LastAppID = -1; + currentApplicationItem = this.dbHandlerInstance.GetAppByID(currentApplicationItem.ApplicationItemId); + prevFilepath = currentApplicationItem.DefaultFilepath(); } else { - LoadLastAppIDFromSettings(); // hacky load back the last applicationItem id, otherwise this can get lost from dx resets.... - } - lastApp = this.dbHandlerInstance.GetAppByID(userSettings.LastAppID); - - if (lastApp != null) - { - prevFilepath = lastApp.DefaultFilepath(); - this.CurrentSortAsc = userSettings.SortAscending; - ViewHandler.CurrentLevel = userSettings.LastViewLevel; - } - else - { prevFilepath = ""; } UpdateListControl(); ShowThumbPanel(); - skipInit = false; + } protected override void OnPageDestroy(int newWindowId) @@ -1131,7 +1060,6 @@ UpdateButtonStates(); break; case Action.ActionType.ACTION_CLOSE_DIALOG: - SaveFolderSettings(""); GUIWindowManager.ShowPreviousWindow(); break; case Action.ActionType.ACTION_SHOW_INFO: @@ -1152,9 +1080,9 @@ int iControl = message.SenderControlId; if (iControl == facadeView.GetID) { - if (lastApp != null) + if (currentApplicationItem != null) { - lastApp.ResetThumbs(); + currentApplicationItem.ResetThumbs(); } } } @@ -1169,7 +1097,7 @@ if (control == btnViewAs) { - userSettings.SwitchToNextViewLayout(); + SwitchToNextViewLayout(); ShowThumbPanel(); @@ -1177,10 +1105,10 @@ } else if (control == btnRefresh) { - if (lastApp != null) + if (currentApplicationItem != null) { - lastApp.Refresh(true); - prevFilepath = lastApp.DefaultFilepath(); + currentApplicationItem.Refresh(true); + prevFilepath = currentApplicationItem.DefaultFilepath(); // todo: reset viewHandler UpdateButtonStates(); UpdateListControl(); Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAlt.csproj =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAlt.csproj 2007-08-27 05:44:33 UTC (rev 869) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAlt.csproj 2007-08-27 10:30:17 UTC (rev 870) @@ -142,7 +142,6 @@ </Compile> <Compile Include="GUIProgramsAlt.cs" /> <Compile Include="GUIProgramsAltFileInfo.cs" /> - <Compile Include="GUIProgramsAltUserSettings.cs" /> <Compile Include="Imports\AllGameScraper.cs" /> <Compile Include="Imports\DirectoryImport.cs" /> <Compile Include="Imports\GamebaseImport.cs" /> Deleted: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAltUserSettings.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAltUserSettings.cs 2007-08-27 05:44:33 UTC (rev 869) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAltUserSettings.cs 2007-08-27 10:30:17 UTC (rev 870) @@ -1,137 +0,0 @@ -using System; - -using System.Xml.Serialization; -using System.Collections.Generic; -using System.Text; - - -using MediaPortal.GUI.Library; -using MediaPortal.Util; - -namespace GUIProgramsAlt -{ - [Serializable] - public class GUIProgramsAltUserSettings - { - protected int sortMethod; - protected int viewLayout; - protected bool sortAscending; - protected int lastApplicationID; - protected int lastFileID; - protected int lastViewLevel; - protected bool overviewVisible; - - public GUIProgramsAltUserSettings() - { - sortMethod = 0; //name - viewLayout = 0; //list - sortAscending = true; - overviewVisible = true; - lastApplicationID = -1; - lastFileID = -1; - lastViewLevel = 0; - } - - [XmlElement("SortMethod")] - public int SortMethod - { - get { return sortMethod; } - set { sortMethod = value; } - } - - [XmlElement("ViewLayout")] - public int ViewLayout - { - get { return viewLayout; } - set { viewLayout = value; } - } - - [XmlElement("SortAscending")] - public bool SortAscending - { - get { return sortAscending; } - set { sortAscending = value; } - } - - [XmlElement("OverviewVisible")] - public bool OverviewVisible - { - get { return overviewVisible; } - set { overviewVisible = value; } - } - - [XmlElement("LastAppID")] - public int LastAppID - { - get { return lastApplicationID; } - set { lastApplicationID = value; } - } - - [XmlElement("LastFileID")] - public int LastFileID - { - get { return lastFileID; } - set { lastFileID = value; } - } - - [XmlElement("LastViewLevelID")] - public int LastViewLevel - { - get { return lastViewLevel; } - set { lastViewLevel = value; } - } - - - public string ViewLayoutTextName - { - get { return GetViewLayoutAsText(); } - } - - string GetViewLayoutAsText() - { - string result = ""; - switch ((Layout)ViewLayout) - { - case Layout.List: - result = GUILocalizeStrings.Get(101); - break; - case Layout.Icons: - result = GUILocalizeStrings.Get(100); - break; - case Layout.LargeIcons: - result = GUILocalizeStrings.Get(417); - break; - case Layout.FilmStrip: - result = GUILocalizeStrings.Get(733); - break; - } - return result; - } - - public void SwitchToNextViewLayout() - { - switch ((Layout)ViewLayout) - { - case Layout.List: - ViewLayout = (int)Layout.Icons; - - break; - case Layout.Icons: - ViewLayout = (int)Layout.LargeIcons; - - break; - case Layout.LargeIcons: - ViewLayout = (int)Layout.FilmStrip; - - break; - case Layout.FilmStrip: - ViewLayout = (int)Layout.List; - - break; - } - } - - - } - -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gre...@us...> - 2007-08-25 00:37:31
|
Revision: 865 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=865&view=rev Author: gregmac45 Date: 2007-08-24 17:37:22 -0700 (Fri, 24 Aug 2007) Log Message: ----------- Fixed all videos downloaded with flv extension bug Fixed only flv videos displayed when browsing in downloaded video folder Writing user settings to mediaportal.xml instead of onlinevideosettings.xml site config now in onlinevideosites.xml Modified Paths: -------------- trunk/plugins/OnlineVideos/Source/OnlineVideos/Configuration.Designer.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/Configuration.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/Configuration.resx trunk/plugins/OnlineVideos/Source/OnlineVideos/DownloadedVideoUtil.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/GUIOnlineVideos.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/GenericSiteUtil.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideoSettings.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/SiteUtilBase.cs Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/Configuration.Designer.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/Configuration.Designer.cs 2007-08-24 16:22:01 UTC (rev 864) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/Configuration.Designer.cs 2007-08-25 00:37:22 UTC (rev 865) @@ -39,6 +39,8 @@ { this.tabControl1 = new System.Windows.Forms.TabControl(); this.General_Tab = new System.Windows.Forms.TabPage(); + this.txtDownloadDir = new System.Windows.Forms.TextBox(); + this.label3 = new System.Windows.Forms.Label(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.btnAdd = new System.Windows.Forms.Button(); this.CategoryList = new System.Windows.Forms.ListBox(); @@ -65,6 +67,7 @@ this.label2 = new System.Windows.Forms.Label(); this.txtThumbLoc = new System.Windows.Forms.TextBox(); this.label1 = new System.Windows.Forms.Label(); + this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog(); this.tabControl1.SuspendLayout(); this.General_Tab.SuspendLayout(); this.groupBox2.SuspendLayout(); @@ -74,28 +77,49 @@ // tabControl1 // this.tabControl1.Controls.Add(this.General_Tab); - this.tabControl1.Location = new System.Drawing.Point(13, 13); + this.tabControl1.Location = new System.Drawing.Point(17, 16); + this.tabControl1.Margin = new System.Windows.Forms.Padding(4); this.tabControl1.Name = "tabControl1"; this.tabControl1.SelectedIndex = 0; - this.tabControl1.Size = new System.Drawing.Size(479, 566); + this.tabControl1.Size = new System.Drawing.Size(639, 697); this.tabControl1.TabIndex = 0; // // General_Tab // + this.General_Tab.Controls.Add(this.txtDownloadDir); + this.General_Tab.Controls.Add(this.label3); this.General_Tab.Controls.Add(this.groupBox2); this.General_Tab.Controls.Add(this.groupBox1); this.General_Tab.Controls.Add(this.txtFilters); this.General_Tab.Controls.Add(this.label2); this.General_Tab.Controls.Add(this.txtThumbLoc); this.General_Tab.Controls.Add(this.label1); - this.General_Tab.Location = new System.Drawing.Point(4, 22); + this.General_Tab.Location = new System.Drawing.Point(4, 25); + this.General_Tab.Margin = new System.Windows.Forms.Padding(4); this.General_Tab.Name = "General_Tab"; - this.General_Tab.Padding = new System.Windows.Forms.Padding(3); - this.General_Tab.Size = new System.Drawing.Size(471, 540); + this.General_Tab.Padding = new System.Windows.Forms.Padding(4); + this.General_Tab.Size = new System.Drawing.Size(631, 668); this.General_Tab.TabIndex = 0; this.General_Tab.Text = "General"; this.General_Tab.UseVisualStyleBackColor = true; // + // txtDownloadDir + // + this.txtDownloadDir.Location = new System.Drawing.Point(293, 70); + this.txtDownloadDir.Margin = new System.Windows.Forms.Padding(4); + this.txtDownloadDir.Name = "txtDownloadDir"; + this.txtDownloadDir.Size = new System.Drawing.Size(227, 22); + this.txtDownloadDir.TabIndex = 20; + // + // label3 + // + this.label3.Location = new System.Drawing.Point(20, 74); + this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(143, 28); + this.label3.TabIndex = 19; + this.label3.Text = "Download Folder:"; + // // groupBox2 // this.groupBox2.Controls.Add(this.btnAdd); @@ -106,18 +130,21 @@ this.groupBox2.Controls.Add(this.label26); this.groupBox2.Controls.Add(this.txtRssName); this.groupBox2.Controls.Add(this.label25); - this.groupBox2.Location = new System.Drawing.Point(15, 295); + this.groupBox2.Location = new System.Drawing.Point(20, 363); + this.groupBox2.Margin = new System.Windows.Forms.Padding(4); this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(411, 239); + this.groupBox2.Padding = new System.Windows.Forms.Padding(4); + this.groupBox2.Size = new System.Drawing.Size(548, 294); this.groupBox2.TabIndex = 18; this.groupBox2.TabStop = false; this.groupBox2.Text = "Site Categories"; // // btnAdd // - this.btnAdd.Location = new System.Drawing.Point(87, 200); + this.btnAdd.Location = new System.Drawing.Point(116, 246); + this.btnAdd.Margin = new System.Windows.Forms.Padding(4); this.btnAdd.Name = "btnAdd"; - this.btnAdd.Size = new System.Drawing.Size(75, 23); + this.btnAdd.Size = new System.Drawing.Size(100, 28); this.btnAdd.TabIndex = 17; this.btnAdd.Text = "Add"; this.btnAdd.UseVisualStyleBackColor = true; @@ -126,17 +153,20 @@ // CategoryList // this.CategoryList.FormattingEnabled = true; - this.CategoryList.Location = new System.Drawing.Point(22, 19); + this.CategoryList.ItemHeight = 16; + this.CategoryList.Location = new System.Drawing.Point(29, 23); + this.CategoryList.Margin = new System.Windows.Forms.Padding(4); this.CategoryList.Name = "CategoryList"; - this.CategoryList.Size = new System.Drawing.Size(120, 173); + this.CategoryList.Size = new System.Drawing.Size(159, 212); this.CategoryList.TabIndex = 6; this.CategoryList.SelectedIndexChanged += new System.EventHandler(this.CategoryListSelectedIndexChanged); // // btnDeleteRss // - this.btnDeleteRss.Location = new System.Drawing.Point(6, 200); + this.btnDeleteRss.Location = new System.Drawing.Point(8, 246); + this.btnDeleteRss.Margin = new System.Windows.Forms.Padding(4); this.btnDeleteRss.Name = "btnDeleteRss"; - this.btnDeleteRss.Size = new System.Drawing.Size(75, 23); + this.btnDeleteRss.Size = new System.Drawing.Size(100, 28); this.btnDeleteRss.TabIndex = 14; this.btnDeleteRss.Text = "Delete"; this.btnDeleteRss.UseVisualStyleBackColor = true; @@ -144,16 +174,18 @@ // // txtRssUrl // - this.txtRssUrl.Location = new System.Drawing.Point(225, 69); + this.txtRssUrl.Location = new System.Drawing.Point(300, 85); + this.txtRssUrl.Margin = new System.Windows.Forms.Padding(4); this.txtRssUrl.Name = "txtRssUrl"; - this.txtRssUrl.Size = new System.Drawing.Size(180, 20); + this.txtRssUrl.Size = new System.Drawing.Size(239, 22); this.txtRssUrl.TabIndex = 16; // // btnRssSave // - this.btnRssSave.Location = new System.Drawing.Point(225, 95); + this.btnRssSave.Location = new System.Drawing.Point(300, 117); + this.btnRssSave.Margin = new System.Windows.Forms.Padding(4); this.btnRssSave.Name = "btnRssSave"; - this.btnRssSave.Size = new System.Drawing.Size(75, 23); + this.btnRssSave.Size = new System.Drawing.Size(100, 28); this.btnRssSave.TabIndex = 13; this.btnRssSave.Text = "Save"; this.btnRssSave.UseVisualStyleBackColor = true; @@ -161,24 +193,27 @@ // // label26 // - this.label26.Location = new System.Drawing.Point(148, 43); + this.label26.Location = new System.Drawing.Point(197, 53); + this.label26.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label26.Name = "label26"; - this.label26.Size = new System.Drawing.Size(71, 23); + this.label26.Size = new System.Drawing.Size(95, 28); this.label26.TabIndex = 9; this.label26.Text = "RSS Name"; // // txtRssName // - this.txtRssName.Location = new System.Drawing.Point(225, 43); + this.txtRssName.Location = new System.Drawing.Point(300, 53); + this.txtRssName.Margin = new System.Windows.Forms.Padding(4); this.txtRssName.Name = "txtRssName"; - this.txtRssName.Size = new System.Drawing.Size(180, 20); + this.txtRssName.Size = new System.Drawing.Size(239, 22); this.txtRssName.TabIndex = 15; // // label25 // - this.label25.Location = new System.Drawing.Point(148, 69); + this.label25.Location = new System.Drawing.Point(197, 85); + this.label25.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label25.Name = "label25"; - this.label25.Size = new System.Drawing.Size(71, 17); + this.label25.Size = new System.Drawing.Size(95, 21); this.label25.TabIndex = 10; this.label25.Text = "RSS URL"; // @@ -196,57 +231,65 @@ this.groupBox1.Controls.Add(this.label27); this.groupBox1.Controls.Add(this.siteList); this.groupBox1.Controls.Add(this.chkEnabled); - this.groupBox1.Location = new System.Drawing.Point(15, 86); + this.groupBox1.Location = new System.Drawing.Point(20, 106); + this.groupBox1.Margin = new System.Windows.Forms.Padding(4); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(411, 203); + this.groupBox1.Padding = new System.Windows.Forms.Padding(4); + this.groupBox1.Size = new System.Drawing.Size(548, 250); this.groupBox1.TabIndex = 17; this.groupBox1.TabStop = false; this.groupBox1.Text = "Sites"; // // txtPassword // - this.txtPassword.Location = new System.Drawing.Point(225, 120); + this.txtPassword.Location = new System.Drawing.Point(300, 148); + this.txtPassword.Margin = new System.Windows.Forms.Padding(4); this.txtPassword.Name = "txtPassword"; - this.txtPassword.Size = new System.Drawing.Size(180, 20); + this.txtPassword.Size = new System.Drawing.Size(239, 22); this.txtPassword.TabIndex = 18; // // txtUserId // - this.txtUserId.Location = new System.Drawing.Point(225, 95); + this.txtUserId.Location = new System.Drawing.Point(300, 117); + this.txtUserId.Margin = new System.Windows.Forms.Padding(4); this.txtUserId.Name = "txtUserId"; - this.txtUserId.Size = new System.Drawing.Size(180, 20); + this.txtUserId.Size = new System.Drawing.Size(239, 22); this.txtUserId.TabIndex = 17; // // chkAgeConfirm // - this.chkAgeConfirm.Location = new System.Drawing.Point(132, 146); + this.chkAgeConfirm.Location = new System.Drawing.Point(176, 180); + this.chkAgeConfirm.Margin = new System.Windows.Forms.Padding(4); this.chkAgeConfirm.Name = "chkAgeConfirm"; - this.chkAgeConfirm.Size = new System.Drawing.Size(104, 24); + this.chkAgeConfirm.Size = new System.Drawing.Size(139, 30); this.chkAgeConfirm.TabIndex = 16; this.chkAgeConfirm.Text = "Confirm Age"; this.chkAgeConfirm.UseVisualStyleBackColor = true; // // label30 // - this.label30.Location = new System.Drawing.Point(132, 123); + this.label30.Location = new System.Drawing.Point(176, 151); + this.label30.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label30.Name = "label30"; - this.label30.Size = new System.Drawing.Size(100, 23); + this.label30.Size = new System.Drawing.Size(133, 28); this.label30.TabIndex = 15; this.label30.Text = "Password"; // // label29 // - this.label29.Location = new System.Drawing.Point(132, 97); + this.label29.Location = new System.Drawing.Point(176, 119); + this.label29.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label29.Name = "label29"; - this.label29.Size = new System.Drawing.Size(100, 23); + this.label29.Size = new System.Drawing.Size(133, 28); this.label29.TabIndex = 14; this.label29.Text = "UserId"; // // btnSiteSave // - this.btnSiteSave.Location = new System.Drawing.Point(132, 176); + this.btnSiteSave.Location = new System.Drawing.Point(176, 217); + this.btnSiteSave.Margin = new System.Windows.Forms.Padding(4); this.btnSiteSave.Name = "btnSiteSave"; - this.btnSiteSave.Size = new System.Drawing.Size(75, 23); + this.btnSiteSave.Size = new System.Drawing.Size(100, 28); this.btnSiteSave.TabIndex = 13; this.btnSiteSave.Text = "Save"; this.btnSiteSave.UseVisualStyleBackColor = true; @@ -254,89 +297,101 @@ // // TxtSiteId // - this.TxtSiteId.Location = new System.Drawing.Point(225, 68); + this.TxtSiteId.Location = new System.Drawing.Point(300, 84); + this.TxtSiteId.Margin = new System.Windows.Forms.Padding(4); this.TxtSiteId.Name = "TxtSiteId"; this.TxtSiteId.ReadOnly = true; - this.TxtSiteId.Size = new System.Drawing.Size(180, 20); + this.TxtSiteId.Size = new System.Drawing.Size(239, 22); this.TxtSiteId.TabIndex = 12; // // txtSiteName // - this.txtSiteName.Location = new System.Drawing.Point(225, 43); + this.txtSiteName.Location = new System.Drawing.Point(300, 53); + this.txtSiteName.Margin = new System.Windows.Forms.Padding(4); this.txtSiteName.Name = "txtSiteName"; - this.txtSiteName.Size = new System.Drawing.Size(180, 20); + this.txtSiteName.Size = new System.Drawing.Size(239, 22); this.txtSiteName.TabIndex = 11; // // label28 // - this.label28.Location = new System.Drawing.Point(132, 69); + this.label28.Location = new System.Drawing.Point(176, 85); + this.label28.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label28.Name = "label28"; - this.label28.Size = new System.Drawing.Size(100, 23); + this.label28.Size = new System.Drawing.Size(133, 28); this.label28.TabIndex = 10; this.label28.Text = "Site ID:"; // // label27 // - this.label27.Location = new System.Drawing.Point(132, 46); + this.label27.Location = new System.Drawing.Point(176, 57); + this.label27.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label27.Name = "label27"; - this.label27.Size = new System.Drawing.Size(100, 23); + this.label27.Size = new System.Drawing.Size(133, 28); this.label27.TabIndex = 9; this.label27.Text = "Site Name:"; // // siteList // this.siteList.FormattingEnabled = true; - this.siteList.Location = new System.Drawing.Point(6, 19); + this.siteList.ItemHeight = 16; + this.siteList.Location = new System.Drawing.Point(8, 23); + this.siteList.Margin = new System.Windows.Forms.Padding(4); this.siteList.Name = "siteList"; - this.siteList.Size = new System.Drawing.Size(120, 160); + this.siteList.Size = new System.Drawing.Size(159, 196); this.siteList.TabIndex = 5; this.siteList.SelectedIndexChanged += new System.EventHandler(this.SiteListSelectedIndexChanged); // // chkEnabled // - this.chkEnabled.Location = new System.Drawing.Point(132, 19); + this.chkEnabled.Location = new System.Drawing.Point(176, 23); + this.chkEnabled.Margin = new System.Windows.Forms.Padding(4); this.chkEnabled.Name = "chkEnabled"; - this.chkEnabled.Size = new System.Drawing.Size(104, 24); + this.chkEnabled.Size = new System.Drawing.Size(139, 30); this.chkEnabled.TabIndex = 8; this.chkEnabled.Text = "Enabled"; this.chkEnabled.UseVisualStyleBackColor = true; // // txtFilters // - this.txtFilters.Location = new System.Drawing.Point(220, 35); + this.txtFilters.Location = new System.Drawing.Point(293, 43); + this.txtFilters.Margin = new System.Windows.Forms.Padding(4); this.txtFilters.Name = "txtFilters"; - this.txtFilters.Size = new System.Drawing.Size(171, 20); + this.txtFilters.Size = new System.Drawing.Size(227, 22); this.txtFilters.TabIndex = 4; // // label2 // - this.label2.Location = new System.Drawing.Point(15, 38); + this.label2.Location = new System.Drawing.Point(20, 47); + this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(199, 23); + this.label2.Size = new System.Drawing.Size(265, 28); this.label2.TabIndex = 3; this.label2.Text = "Filter out videos with these tags"; // // txtThumbLoc // - this.txtThumbLoc.Location = new System.Drawing.Point(220, 9); + this.txtThumbLoc.Location = new System.Drawing.Point(293, 11); + this.txtThumbLoc.Margin = new System.Windows.Forms.Padding(4); this.txtThumbLoc.Name = "txtThumbLoc"; - this.txtThumbLoc.Size = new System.Drawing.Size(171, 20); + this.txtThumbLoc.Size = new System.Drawing.Size(227, 22); this.txtThumbLoc.TabIndex = 2; // // label1 // - this.label1.Location = new System.Drawing.Point(15, 12); + this.label1.Location = new System.Drawing.Point(20, 15); + this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(107, 23); + this.label1.Size = new System.Drawing.Size(143, 28); this.label1.TabIndex = 1; this.label1.Text = "Thumbnail Location:"; // // Configuration // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(511, 582); + this.ClientSize = new System.Drawing.Size(681, 716); this.Controls.Add(this.tabControl1); + this.Margin = new System.Windows.Forms.Padding(4); this.Name = "Configuration"; this.Text = "Configuration"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ConfigurationFormClosing); @@ -350,6 +405,9 @@ this.groupBox1.PerformLayout(); this.ResumeLayout(false); } + private System.Windows.Forms.TextBox txtDownloadDir; + private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1; + private System.Windows.Forms.Label label3; private System.Windows.Forms.Button btnAdd; private System.Windows.Forms.TextBox txtRssUrl; private System.Windows.Forms.TextBox txtRssName; Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/Configuration.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/Configuration.cs 2007-08-24 16:22:01 UTC (rev 864) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/Configuration.cs 2007-08-25 00:37:22 UTC (rev 865) @@ -169,6 +169,7 @@ String [] lsFilterArray = lsFilter.Split(new char[] { ',' }); settings.msFilterArray = lsFilterArray; settings.msThumbLocation = txtThumbLoc.Text; + settings.msDownloadDir = txtDownloadDir.Text; settings.moSiteList.Clear(); foreach(GUIOnlineVideos.Site site in moSiteList){ settings.moSiteList.Add(site.id,site); Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/Configuration.resx =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/Configuration.resx 2007-08-24 16:22:01 UTC (rev 864) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/Configuration.resx 2007-08-25 00:37:22 UTC (rev 865) @@ -117,4 +117,7 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> + <metadata name="folderBrowserDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>17, 17</value> + </metadata> </root> \ No newline at end of file Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/DownloadedVideoUtil.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/DownloadedVideoUtil.cs 2007-08-24 16:22:01 UTC (rev 864) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/DownloadedVideoUtil.cs 2007-08-25 00:37:22 UTC (rev 865) @@ -33,16 +33,19 @@ public override List<GUIOnlineVideos.VideoInfo> getVideoList(string fsUrl) { List<GUIOnlineVideos.VideoInfo>loVideoInfoList = new List<GUIOnlineVideos.VideoInfo>(); - string[]loVideoList = Directory.GetFiles(fsUrl,"*.flv"); + string[]loVideoList = Directory.GetFiles(fsUrl); + GUIOnlineVideos.VideoInfo loVideoInfo; foreach (String lsVideo in loVideoList) { - loVideoInfo = new GUIOnlineVideos.VideoInfo(); - loVideoInfo.VideoUrl = lsVideo; + if(isPossibleVideo(lsVideo)){ + loVideoInfo = new GUIOnlineVideos.VideoInfo(); + loVideoInfo.VideoUrl = lsVideo; - loVideoInfo.Title = Utils.GetFilename(lsVideo); - loVideoInfoList.Add(loVideoInfo); + loVideoInfo.Title = Utils.GetFilename(lsVideo); + loVideoInfoList.Add(loVideoInfo); + } } return loVideoInfoList; } Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/GUIOnlineVideos.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/GUIOnlineVideos.cs 2007-08-24 16:22:01 UTC (rev 864) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/GUIOnlineVideos.cs 2007-08-25 00:37:22 UTC (rev 865) @@ -181,9 +181,9 @@ public override bool Init() { + + bool result = Load(GUIGraphicsContext.Skin + @"\myonlinevideos.xml"); LoadSettings(); - bool result = Load(GUIGraphicsContext.Skin + @"\myonlinevideos.xml"); - return result; } @@ -435,17 +435,29 @@ msThumbLocation = settings.msThumbLocation; msFilterArray = settings.msFilterArray; moSiteList= settings.moSiteList; - Site FavSite = new Site(); - FavSite.id = "100"; - FavSite.name = "Favorites"; - FavSite.enabled = true; + //create a favorites site + Site loSite = new Site(); + loSite.id = "100"; + loSite.name = "Favorites"; + loSite.enabled = true; RssLink cat = new RssLink(); cat.isDynamic = true; cat.name = "dynamic"; cat.url = "favorites"; - FavSite.RssList.Add("dynamic",cat); - moSiteList.Add("100",FavSite); - msDownloadDir = settings.msDownloadDir; + loSite.RssList.Add("dynamic",cat); + moSiteList.Add("100",loSite); + + //add a downloaded videos site + loSite = new Site(); + loSite.id = "99"; + loSite.name = "Downloaded Videos"; + loSite.enabled = true; + cat = new RssLink(); + cat.name = "All"; + cat.url = settings.msDownloadDir; + loSite.RssList.Add(cat.name,cat); + moSiteList.Add("99",loSite); + } private void DisplaySites() { @@ -707,8 +719,10 @@ WebClient loClient = new WebClient(); loClient.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)"); loClient.DownloadFileCompleted += new AsyncCompletedEventHandler(DownloadFileCompleted); - String lsFileName = msDownloadDir+foListItem.Title; - loClient.DownloadFileAsync(new Uri(lsUrl), lsFileName + ".flv", foListItem.Title); + String lsExtension = System.IO.Path.GetExtension(lsUrl); + String lsFileName = msDownloadDir+foListItem.Title+lsExtension; + + loClient.DownloadFileAsync(new Uri(lsUrl), lsFileName, foListItem.Title); } private void DownloadFileCompleted(object sender, AsyncCompletedEventArgs e) Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/GenericSiteUtil.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/GenericSiteUtil.cs 2007-08-24 16:22:01 UTC (rev 864) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/GenericSiteUtil.cs 2007-08-25 00:37:22 UTC (rev 865) @@ -23,19 +23,9 @@ /// </summary> public class GenericSiteUtil:SiteUtilBase { - ArrayList m_VideoExtensions = new ArrayList(); - public GenericSiteUtil(){ - using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) - { - String strTmp = xmlreader.GetValueAsString("movies", "extensions", ".avi,.mpg,.ogm,.mpeg,.mkv,.wmv,.ifo,.qt,.rm,.mov,.sbe,.dvr-ms,.ts"); - String [] tok = strTmp.Split( ','); - foreach (string extension in tok) - { - m_VideoExtensions.Add(extension.ToLower()); - } - } + - } + public override string getSiteId() { return "50"; @@ -97,15 +87,6 @@ } return loVideoList; } - private bool isPossibleVideo(string fsUrl){ - string extensionFile = System.IO.Path.GetExtension(fsUrl).ToLower(); - if(String.IsNullOrEmpty(extensionFile))return true; - foreach (string extension in m_VideoExtensions) - { - if (extension == extensionFile) return true; - } - return false; - - } + } } Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideoSettings.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideoSettings.cs 2007-08-24 16:22:01 UTC (rev 864) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideoSettings.cs 2007-08-25 00:37:22 UTC (rev 865) @@ -21,11 +21,16 @@ { private static OnlineVideoSettings instance = new OnlineVideoSettings(); public String msThumbLocation; + public String msDownloadDir; public String[] msFilterArray; public Dictionary<String,GUIOnlineVideos.Site> moSiteList = new Dictionary<String, GUIOnlineVideos.Site>(); - public String msDownloadDir; - private String SETTINGS_FILE = "OnlineVideoSettings.xml"; + private const String SETTINGS_FILE = "OnlineVideoSites.xml"; + private const String THUMBNAIL_DIR = "thumbDir"; + private const String DOWNLOAD_DIR = "downloadDir"; + private const String SECTION = "onlinevideos"; + private const String FILTER = "filter"; + public static OnlineVideoSettings getInstance(){ if(instance ==null){ instance = new OnlineVideoSettings(); @@ -37,49 +42,30 @@ loadSettings(); } private void loadSettings(){ - /* + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { - msThumbLocation = xmlreader.GetValueAsString("onlinevideos", "thumblocation", ""); - String lsFilter = xmlreader.GetValueAsString("onlinevideos", "filter", ""); + msThumbLocation = xmlreader.GetValueAsString(SECTION, THUMBNAIL_DIR, ""); + + msDownloadDir = xmlreader.GetValueAsString(SECTION, DOWNLOAD_DIR, ""); + String lsFilter = xmlreader.GetValueAsString(SECTION, FILTER, ""); + msFilterArray = lsFilter.Split(new char[] { ',' }); if (msFilterArray.Length == 1 && msFilterArray[0] == "") { msFilterArray = null; } } - */ + + if(String.IsNullOrEmpty(msThumbLocation)){ + msThumbLocation = Config.GetFolder(Config.Dir.Thumbs) +@"\OnlineVideos\"; + + } XmlDocument doc = new XmlDocument(); try { doc.Load(SETTINGS_FILE); - XmlNode filter = doc.SelectSingleNode("//settings/filter"); - String lsFilter = filter.InnerText; - msFilterArray = lsFilter.Split(new char[] { ',' }); - if (msFilterArray.Length == 1 && msFilterArray[0] == "") - { - msFilterArray = null; - } - XmlNode thumbNode = doc.SelectSingleNode("//settings/thumbLocation"); - msThumbLocation = thumbNode.InnerText; - if(String.IsNullOrEmpty(msThumbLocation)){ - msThumbLocation = - System.IO.Directory.GetCurrentDirectory()+@"\Thumbs\OnlineVideos\"; - } - if(System.IO.Directory.Exists(msThumbLocation)==false){ - System.IO.Directory.CreateDirectory(msThumbLocation); - } - /* - if(String.IsNullOrEmpty(msThumbLocation)){ - msThumbLocation = - System.IO.Directory.GetCurrentDirectory()+"/Thumbs/OnlineVideos/"; - } - if(System.IO.Directory.Exists(msThumbLocation)==false){ - System.IO.Directory.CreateDirectory(msThumbLocation); - } - */ - XmlNode root = doc.SelectSingleNode("//settings/sites/site"); XmlNodeList nodeList; nodeList = root.SelectNodes("//settings/sites/site"); @@ -155,6 +141,24 @@ { try { + using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + { + String lsFilterList = ""; + String [] lsFilterArray = msFilterArray; + if(lsFilterArray!=null){ + foreach (String lsFilter in lsFilterArray){ + lsFilterList+=lsFilter+","; + } + } + if((lsFilterList == ",")==false){ + xmlwriter.SetValue(SECTION, FILTER, lsFilterList); + }else{ + msFilterArray = null; + } + xmlwriter.SetValue(SECTION,THUMBNAIL_DIR,msThumbLocation); + xmlwriter.SetValue(SECTION, DOWNLOAD_DIR,msDownloadDir ); + + } Console.WriteLine(System.IO.Directory.GetCurrentDirectory()); //pick whatever filename with .xml extension string filename = SETTINGS_FILE; @@ -183,26 +187,8 @@ xmlDoc.Load(filename); } XmlNode root = xmlDoc.DocumentElement; - XmlElement filterNode = xmlDoc.CreateElement("filter"); - String lsFilterList = ""; - String [] lsFilterArray = msFilterArray; - if(lsFilterArray!=null){ - foreach (String lsFilter in lsFilterArray){ - lsFilterList+=lsFilter+","; - } - } - if((lsFilterList == ",")==false){ - filterNode.InnerText = lsFilterList; - }else{ - msFilterArray = null; - - } - root.AppendChild(filterNode); - XmlElement thumbNode = xmlDoc.CreateElement("thumbLocation"); - thumbNode.InnerText = msThumbLocation; - root.AppendChild(thumbNode); XmlElement sitesNode = xmlDoc.CreateElement("sites"); @@ -269,7 +255,7 @@ } catch(Exception ex) { - Console.WriteLine(ex.ToString()); + Log.Error(ex); } Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/SiteUtilBase.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/SiteUtilBase.cs 2007-08-24 16:22:01 UTC (rev 864) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/SiteUtilBase.cs 2007-08-25 00:37:22 UTC (rev 865) @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Collections; using System.Text; using MediaPortal.GUI.Library; //using MediaPortal.Utils.Services; @@ -10,6 +11,7 @@ using System.Xml.XPath; using System.Threading; using OnlineVideos.Database; +using MediaPortal.Configuration; namespace OnlineVideos { @@ -50,10 +52,21 @@ private static bool _workerCompleted = true; private string HTMLdownload; //protected static SiteUtilBase _Instance; + ArrayList m_VideoExtensions = new ArrayList(); + + public SiteUtilBase() { - //ServiceProvider loServices = GlobalServiceProvider.Instance; - //moLog = loServices.Get<ILog>(); + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + { + String strTmp = xmlreader.GetValueAsString("movies", "extensions", ".avi,.mpg,.ogm,.mpeg,.mkv,.wmv,.ifo,.qt,.rm,.mov,.sbe,.dvr-ms,.ts"); + String [] tok = strTmp.Split( ','); + foreach (string extension in tok) + { + m_VideoExtensions.Add(extension.ToLower()); + } + } + m_VideoExtensions.Add(".flv"); } public virtual List<GUIOnlineVideos.VideoInfo> getSiteFavorites(String fsUser){ @@ -282,6 +295,17 @@ } public abstract String getSiteId(); + protected bool isPossibleVideo(string fsUrl){ + string extensionFile = System.IO.Path.GetExtension(fsUrl).ToLower(); + if(String.IsNullOrEmpty(extensionFile))return true; + foreach (string extension in m_VideoExtensions) + { + if (extension == extensionFile) return true; + } + return false; + + } + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gre...@us...> - 2007-08-24 16:22:12
|
Revision: 864 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=864&view=rev Author: gregmac45 Date: 2007-08-24 09:22:01 -0700 (Fri, 24 Aug 2007) Log Message: ----------- Fixed AppleTrailers Removed some debug log message Modified Paths: -------------- trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesTrailerUtil.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/AppleTrailers.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/ItmsHelper.cs Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesTrailerUtil.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesTrailerUtil.cs 2007-08-24 05:58:51 UTC (rev 863) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesTrailerUtil.cs 2007-08-24 16:22:01 UTC (rev 864) @@ -57,6 +57,7 @@ loItem.ImageUrl = trailer.PosterUrl.ToString(); loItem.Tags = trailer.Genre; + loItem.Other = trailer; /* try{ ITMSClient.TrailerInfo trailerMore = AppleTrailers.ProcessTrailer(trailer); @@ -67,7 +68,7 @@ //foreach(TrailerStream stream in trailerMore.TrailerStreamCollection){ //Log.Info("Trailer stream type:{0} url:{1} size:{2}",stream.Type,stream.Uri,stream.Size); //} - //loItem.Other = trailer; + // //loItem.Length = trailer.. */ loListItems.Add(loItem); Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/AppleTrailers.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/AppleTrailers.cs 2007-08-24 05:58:51 UTC (rev 863) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/AppleTrailers.cs 2007-08-24 16:22:01 UTC (rev 864) @@ -73,11 +73,11 @@ trailers.Clear(); Uri pageUri = new Uri(xmlurl); ITMSClient.ITMSContent xmlContent = ITMSClient.ITMSHelper.GetITMSPage(pageUri); - Log.Info(xmlContent.Xml); + //Log.Info(xmlContent.Xml); if (xmlContent.IsValid) { - Log.Info("xml is valid"); + //Log.Info("xml is valid"); ITMSClient.TrailerIndex indexPage = new ITMSClient.TrailerIndex("test", xmlContent); RSSTitle = "Apple HD Trailers"; //trailers.Add(indexPage.TrailerInfoCollection.); Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/ItmsHelper.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/ItmsHelper.cs 2007-08-24 05:58:51 UTC (rev 863) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/ItmsHelper.cs 2007-08-24 16:22:01 UTC (rev 864) @@ -198,7 +198,7 @@ HttpWebResponse response = null; ITMSContent content = null; - Log.Debug("GetITMSPage: " + uri.AbsoluteUri); + //Log.Debug("GetITMSPage: " + uri.AbsoluteUri); //Log.Info("GetITMSPage: " + uri.AbsoluteUri); try { @@ -222,7 +222,7 @@ content = new ITMSContent(response, HttpUtility.HtmlDecode( sReader.ReadToEnd())); - Log.Info("created ITMSContent"); + //Log.Info("created ITMSContent"); //Log.Debug(response.LastModified); } catch (WebException ex) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gre...@us...> - 2007-08-24 05:58:53
|
Revision: 863 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=863&view=rev Author: gregmac45 Date: 2007-08-23 22:58:51 -0700 (Thu, 23 Aug 2007) Log Message: ----------- updated regex that parses session info from new youtube page Modified Paths: -------------- trunk/plugins/OnlineVideos/Source/OnlineVideos/YouTubeUtil.cs Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/YouTubeUtil.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/YouTubeUtil.cs 2007-08-24 03:45:27 UTC (rev 862) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/YouTubeUtil.cs 2007-08-24 05:58:51 UTC (rev 863) @@ -195,6 +195,7 @@ } public String getSessionId(String fsId,GUIOnlineVideos.Site foSite) { + //Log.Info("getting youtube session id"); String lsUrl; String lsNextUrl = ""; String lsPostData = ""; @@ -258,18 +259,18 @@ String session; - if(isLoggedIn()){ - loRegex = new Regex("new SWFObject\\([^&]*&video_id=.*[&]l=(.*)[&]t=([^\"]*)"); + //if(isLoggedIn()){ + // loRegex = new Regex("new SWFObject\\([^&]*&video_id=.*[&]l=(.*)[&]t=([^\"]*)"); - }else{ - loRegex = new Regex("BASE_YT_URL=[^&]*&video_id=.*[&]l=(.*)[&]t=([^\"]*)"); + //}else{ + loRegex = new Regex("BASE_YT_URL:[^,]*,video_id:.*[,]l:'(.*)'[,]t:'([^']*)"); - } + //} loMatch = loRegex.Match(lsHtml); session = loMatch.Groups[2].Value; Log.Info("Session id={0}", session); - - + + //Log.Info("finished getting youtube session id"); return session; } public bool login(String fsUser,String fsPassword){ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gre...@us...> - 2007-08-24 03:45:35
|
Revision: 862 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=862&view=rev Author: gregmac45 Date: 2007-08-23 20:45:27 -0700 (Thu, 23 Aug 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/OnlineVideos/Source/FLV Player/FlashVideoPlayer.csproj trunk/plugins/OnlineVideos/Source/FLV Player/MyFlashPlayer.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/GUIOnlineVideos.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/SiteUtilBase.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/Stage6Util.cs trunk/plugins/OnlineVideos/Source/OnlineVideos.sln Modified: trunk/plugins/OnlineVideos/Source/FLV Player/FlashVideoPlayer.csproj =================================================================== --- trunk/plugins/OnlineVideos/Source/FLV Player/FlashVideoPlayer.csproj 2007-08-23 15:02:52 UTC (rev 861) +++ trunk/plugins/OnlineVideos/Source/FLV Player/FlashVideoPlayer.csproj 2007-08-24 03:45:27 UTC (rev 862) @@ -28,7 +28,7 @@ </UpgradeBackupLocation> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> - <OutputPath>..\..\..\..\..\Program Files\Team MediaPortal\MediaPortal\Plugins\ExternalPlayers\</OutputPath> + <OutputPath>..\..\..\..\..\..\Program Files\Team MediaPortal\MediaPortal\Plugins\ExternalPlayers\</OutputPath> <AllowUnsafeBlocks>false</AllowUnsafeBlocks> <BaseAddress>285212672</BaseAddress> <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow> @@ -47,7 +47,7 @@ <ErrorReport>prompt</ErrorReport> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <OutputPath>..\MediaPortal2\xbmc\bin\Debug\plugins\ExternalPlayers\</OutputPath> + <OutputPath>..\..\..\..\..\..\Program Files\Team MediaPortal\MediaPortal\Plugins\ExternalPlayers\</OutputPath> <AllowUnsafeBlocks>false</AllowUnsafeBlocks> <BaseAddress>285212672</BaseAddress> <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow> @@ -70,15 +70,18 @@ <PlatformTarget>AnyCPU</PlatformTarget> </PropertyGroup> <ItemGroup> + <Reference Include="AxInterop.ShockwaveFlashObjects, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>bin\Debug\AxInterop.ShockwaveFlashObjects.dll</HintPath> + </Reference> <Reference Include="Core"> <HintPath>..\..\..\..\MediaPortal\Core\bin\Release\Core.DLL</HintPath> <SpecificVersion>False</SpecificVersion> <Private>False</Private> </Reference> - <Reference Include="Databases"> - <HintPath>..\..\..\MediaPortal\Databases\bin\Release\Databases.DLL</HintPath> + <Reference Include="Interop.ShockwaveFlashObjects, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <Private>False</Private> + <HintPath>bin\Debug\Interop.ShockwaveFlashObjects.dll</HintPath> </Reference> <Reference Include="System"> <Name>System</Name> @@ -96,18 +99,10 @@ <Name>System.XML</Name> </Reference> <Reference Include="Utils"> - <HintPath>..\..\..\MediaPortal\Utils\bin\Release\Utils.DLL</HintPath> + <HintPath>..\..\..\..\Mediaportal\Utils\bin\Release\Utils.DLL</HintPath> <SpecificVersion>False</SpecificVersion> <Private>False</Private> </Reference> - <COMReference Include="AxShockwaveFlashObjects"> - <Guid>{D27CDB6B-AE6D-11CF-96B8-444553540000}</Guid> - <VersionMajor>1</VersionMajor> - <VersionMinor>0</VersionMinor> - <Lcid>0</Lcid> - <WrapperTool>aximp</WrapperTool> - <Isolated>False</Isolated> - </COMReference> <COMReference Include="stdole"> <Guid>{00020430-0000-0000-C000-000000000046}</Guid> <VersionMajor>2</VersionMajor> Modified: trunk/plugins/OnlineVideos/Source/FLV Player/MyFlashPlayer.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/FLV Player/MyFlashPlayer.cs 2007-08-23 15:02:52 UTC (rev 861) +++ trunk/plugins/OnlineVideos/Source/FLV Player/MyFlashPlayer.cs 2007-08-24 03:45:27 UTC (rev 862) @@ -10,278 +10,234 @@ namespace MediaPortal.MyFLVPlayer { - public class FlvPlayerPlugin : IExternalPlayer - { - //public static bool _playerIsPaused; - string _currentFile = String.Empty; - //bool _started; - //bool _ended; - bool _notifyPlaying = false; - double _duration; - double _currentPosition; - DateTime _updateTimer; - bool _needUpdate = true; - //private string[] _supportedExtension = new string[5]; + public class FlvPlayerPlugin : IExternalPlayer + { + //public static bool _playerIsPaused; + string _currentFile = String.Empty; + //bool _started; + //bool _ended; + bool _notifyPlaying = false; + double _duration; + double _currentPosition; + DateTime _updateTimer; + bool _needUpdate = true; + //private string[] _supportedExtension = new string[5]; - bool _isFullScreen = false; - int _positionX = 10, _positionY = 10, _videoWidth = 100, _videoHeight = 100; - //protected ILog _log; + bool _isFullScreen = false; + int _positionX = 10, _positionY = 10, _videoWidth = 100, _videoHeight = 100; + //protected ILog _log; - public static FlashControl FlvControl = null; + public static FlashControl FlvControl = null; - public enum PlayState - { - Init, - Playing, - Paused, - Ended - } - PlayState _playState = PlayState.Init; - public FlvPlayerPlugin() - { - //ServiceProvider services = GlobalServiceProvider.Instance; - //_log = services.Get<ILog>(); - } + public enum PlayState + { + Init, + Playing, + Paused, + Ended + } + PlayState _playState = PlayState.Init; + public FlvPlayerPlugin() + { + //ServiceProvider services = GlobalServiceProvider.Instance; + //_log = services.Get<ILog>(); + } - public override string Description() - { - return "Flash Player"; - } + public override string Description() + { + return "Flash Player"; + } - public override string PlayerName - { - get { return "FlvPlayer"; } - } + public override string PlayerName + { + get { return "FlvPlayer"; } + } - public override string AuthorName - { - get { return "Gregmac45"; } - } + public override string AuthorName + { + get { return "Gregmac45"; } + } - public override string VersionNumber - { - get { return "0.1"; } - } + public override string VersionNumber + { + get { return "0.1"; } + } - public override string[] GetAllSupportedExtensions() + public override string[] GetAllSupportedExtensions() + { + String[] laSupported = new String[1]; + laSupported[0] = ".flv"; + return laSupported; + } + /* + public string[] GetAllSupportedStreams() { - String[] laSupported = new String[1]; - laSupported[0] = ".flv"; + String[] laSupported = new String[2]; + laSupported[0] = "http"; + laSupported[0] = "RTMP"; return laSupported; + } + */ + public override bool SupportsFile(string filename) + { + string ext = null; + int dot = filename.LastIndexOf("."); // couldn't find the dot to get the extension + if (dot == -1) return false; - public override bool SupportsFile(string filename) - { - string ext = null; - int dot = filename.LastIndexOf("."); // couldn't find the dot to get the extension - if (dot == -1) return false; + ext = filename.Substring(dot).Trim(); + if (ext.Length == 0) return false; // no extension so return false; - ext = filename.Substring(dot).Trim(); - if (ext.Length == 0) return false; // no extension so return false; + ext = ext.ToLower(); + if (".flv".Equals(ext)) { return true; }; + return false; + } - ext = ext.ToLower(); - if (".flv".Equals(ext)) { return true; }; - return false; - } + public override bool Play(string strFile) + { + Log.Info("Playing flv with FlvPlayer"); + try + { + FlvControl = new FlashControl(); + FlvControl.Player.FlashCall += new _IShockwaveFlashEvents_FlashCallEventHandler(OnFlashCall); + FlvControl.Player.LoadMovie(0, System.IO.Directory.GetCurrentDirectory()+"\\player.swf"); + + //FlvControl.Player.Movie = System.IO.Directory.GetCurrentDirectory()+"\\player.swf"; + FlvControl.Player.FlashVars = String.Format("&file={0}&autostart=true&enablejs=true&backcolor=0x000000&frontcolor=0xCCCCCC&showicons=false&showvolume=false&showdigits=false&displayheight={1}&allowfullscreen=true",strFile.Replace("&","%26"),9999); + - public override bool Play(string strFile) - { - try - { - //if (FlvControl == null) - //{ - // FlvControl.Player.u - //} - FlvControl = new FlashControl(); - //FlvControl.Player.BackgroundColor = ; - FlvControl.Player.OnReadyStateChange += new _IShockwaveFlashEvents_OnReadyStateChangeEventHandler(OnReady); - FlvControl.Player.FlashCall += new _IShockwaveFlashEvents_FlashCallEventHandler(OnFlashCall); - //FlvControl.Player.LoadMovie(0, @"C:\Dev\FlashExternalAPI\player.swf"); - //Log.Info("player path:{0}", System.IO.Directory.GetCurrentDirectory() + "\\player.swf"); - FlvControl.Player.LoadMovie(0, System.IO.Directory.GetCurrentDirectory()+"\\player.swf"); - - GUIGraphicsContext.form.Controls.Add(FlvControl); - GUIWindowManager.OnNewAction +=new OnActionHandler(OnAction2); - //} - FlvControl.Player.CallFunction("<invoke name=\"loadAndPlayVideo\" returntype=\"xml\"><arguments><string>"+strFile+"</string></arguments></invoke>"); - - //FlvControl.Player.FSCommand += new _IShockwaveFlashEvents_FSCommandEventHandler(OnFSCommand); - //FlvControl.Player.OnProgress += new _IShockwaveFlashEvents_OnProgressEventHandler(OnProgress); - //FlvControl.Player.Play(); + GUIGraphicsContext.form.Controls.Add(FlvControl); + GUIWindowManager.OnNewAction +=new OnActionHandler(OnAction2); + + GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_PLAYBACK_STARTED, 0, 0, 0, 0, 0, null); + msg.Label = strFile; + GUIWindowManager.SendThreadMessage(msg); + _notifyPlaying = true; + FlvControl.ClientSize = new Size(0, 0); + FlvControl.Visible = true; + FlvControl.Enabled = true; + _needUpdate = true; + _isFullScreen = GUIGraphicsContext.IsFullScreenVideo; + _positionX = GUIGraphicsContext.VideoWindow.Left; + _positionY = GUIGraphicsContext.VideoWindow.Top; + _videoWidth = GUIGraphicsContext.VideoWindow.Width; + _videoHeight = GUIGraphicsContext.VideoWindow.Height; - //} + _currentFile = strFile; + _duration = -1; + _currentPosition = -1; + _playState = PlayState.Playing; + _updateTimer = DateTime.Now; + SetVideoWindow(); + return true; + } + catch (Exception) + { + } + return false; + } - GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_PLAYBACK_STARTED, 0, 0, 0, 0, 0, null); - msg.Label = strFile; - GUIWindowManager.SendThreadMessage(msg); + public void OnFlashCall(object sender, _IShockwaveFlashEvents_FlashCallEvent foEvent) + { + //Log.Info("OnFlashCall reached with value request:{0},Object:{1}", foEvent.request, sender); + XmlDocument document = new XmlDocument(); + document.LoadXml(foEvent.request); - + // Get all the arguments + XmlNodeList list = document.GetElementsByTagName("invoke"); + String lsName = list[0].Attributes["name"].Value; + list = document.GetElementsByTagName("arguments"); + String lsState = list[0].FirstChild.InnerText; + if (lsName.Equals("getUpdate")) + { + switch (lsState) + { + case "state": + switch(list[0].ChildNodes[1].InnerText){ + case "0": + case "1": + if(_playState == PlayState.Playing){ + _playState = PlayState.Paused; + } + else { + _playState = PlayState.Init; + } + break; + case "2": + _playState = PlayState.Playing; + break; + case "3": + _playState = PlayState.Ended; + break; + } + + + break; + case "time": + _currentPosition = Convert.ToInt32(list[0].ChildNodes[1].InnerText); + _duration = _currentPosition+ Convert.ToInt32(list[0].ChildNodes[2].InnerText); + + break; + + } + } + } + public override bool CanSeek() + { + return true; + } + public void OnAction2(Action foAction) + { + //Log.Info("received action:"+foAction.wID); + //if (foAction.wID == Action.ActionType.ACTION_SHOW_GUI || foAction.wID == Action.ActionType.ACTION_SHOW_FULLSCREEN) + //{ + + //SetVideoWindow(); + //} + } + public override double Duration + { + get + { + return _duration; + } + } - - //_started = false; - //_ended = false; - _notifyPlaying = true; + public override double CurrentPosition + { + get + { + if (FlvControl == null) return 0.0d; + //UpdateStatus(); + //if (_started == false) return 0; + try + { + + + _updateTimer = DateTime.Now; + //return _currentPosition; + //Log.Info("Flash Player - current time {0}", _currentPosition); + + //} + } + catch (Exception e) + { + //_log.Error(e); + Log.Error(e); + } + try + { + return _currentPosition; + } + catch (Exception) + { + FlvControl = null; + return 0.0d; + } + } - - //FlvControl.Visible = true; - //FlvControl.Enabled = true; - FlvControl.ClientSize = new Size(0, 0); - FlvControl.Visible = true; - FlvControl.Enabled = true; - //GUIGraphicsContext.form.Focus(); - - _needUpdate = true; - _isFullScreen = GUIGraphicsContext.IsFullScreenVideo; - _positionX = GUIGraphicsContext.VideoWindow.Left; - _positionY = GUIGraphicsContext.VideoWindow.Top; - _videoWidth = GUIGraphicsContext.VideoWindow.Width; - _videoHeight = GUIGraphicsContext.VideoWindow.Height; - - //_started = true; - //SetWindows(); - - //_playerIsPaused = false; - _currentFile = strFile; - _duration = -1; - _currentPosition = -1; - _playState = PlayState.Playing; - _updateTimer = DateTime.Now; - SetVideoWindow(); - return true; - } - catch (Exception) - { - } - return false; - } - - public void OnReady(object sender,_IShockwaveFlashEvents_OnReadyStateChangeEvent foEvent) - { - /* - - Log.Info("OnReady2 reached with value {0}", foEvent.newState); - if (foEvent.newState == 4 && _duration <=0) - { - - String lsXml = FlvControl.Player.CallFunction("<invoke name=\"getVideoTotalTime\" returntype=\"string\"></invoke>"); - //Log.Info("flash request received with :{0}",lsXml); - XmlDocument document = new XmlDocument(); - document.LoadXml(lsXml); - XmlNodeList list = document.GetElementsByTagName("number"); - _duration = Convert.ToDouble(list[0].InnerText); - Log.Info("Duration Set to {0}",_duration); - } - * */ - - } - public void OnFlashCall(object sender, _IShockwaveFlashEvents_FlashCallEvent foEvent) - { - Log.Info("OnFlashCall reached with value request:{0},Object:{1}", foEvent.request, sender); - XmlDocument document = new XmlDocument(); - document.LoadXml(foEvent.request); - - // Get all the arguments - XmlNodeList list = document.GetElementsByTagName("invoke"); - String lsName = list[0].Attributes["name"].Value; - list = document.GetElementsByTagName("arguments"); - String lsState = list[0].FirstChild.InnerText; - //Log.Info("invoke:{0} argument:{1}",lsName,lsState); - //if (lsName.Equals("UpdateDuration")) - //{ - // Log.Info("received update duration with value {0}", lsState); - //} - if (lsName.Equals("updateStatus")) - { - switch (lsState) - { - case "stopped": - _playState = PlayState.Init; - break; - case "buffering": - if (_playState == PlayState.Playing) - { - //_playState = PlayState.Ended; - } - else - { - _playState = PlayState.Playing; - } - break; - case "playing": - _playState = PlayState.Playing; - String lsXml = FlvControl.Player.CallFunction("<invoke name=\"getVideoTotalTime\" returntype=\"string\"></invoke>"); - //Log.Info("flash request received with :{0}",lsXml); - document = new XmlDocument(); - document.LoadXml(lsXml); - list = document.GetElementsByTagName("number"); - _duration = Convert.ToDouble(list[0].InnerText); - Log.Info("Duration Set to {0}", _duration); - break; - case "paused": - _playState = PlayState.Paused; - break; - case "connectionError": - _playState = PlayState.Ended; - break; - - - } - } - } - - public void OnAction2(Action foAction) - { - } - public override double Duration - { - get - { - return _duration; - } - } - - public override double CurrentPosition - { - get - { - if (FlvControl == null) return 0.0d; - //UpdateStatus(); - //if (_started == false) return 0; - try - { - TimeSpan loTimeSinceUpdate = DateTime.Now - _updateTimer; - if (loTimeSinceUpdate.Seconds > 1) - { - //Log.Info("Flash Player - Updating Position"); - String lsXml = FlvControl.Player.CallFunction("<invoke name=\"getVideoCurrentTime\" returntype=\"string\"></invoke>"); - - XmlDocument document = new XmlDocument(); - document.LoadXml(lsXml); - XmlNodeList list = document.GetElementsByTagName("number"); - _currentPosition = Convert.ToDouble(list[0].InnerText); - _updateTimer = DateTime.Now; - //Log.Info("Flash Player - current time {0}", _currentPosition); - - } - } - catch (Exception e) - { - //_log.Error(e); - Log.Error(e); - } - try - { - return _currentPosition; - } - catch (Exception) - { - FlvControl = null; - return 0.0d; - } - } - - } - /* + } + /* public override int Speed { get @@ -342,336 +298,340 @@ } } } - * */ - public override bool Ended - { - get - { - return (_playState==PlayState.Ended); - } - } - public override bool Playing - { - get - { - try - { - if (FlvControl == null) - return false; - //UpdateStatus(); - //String lsPlaying = FlvControl.Player.CallFunction("<invoke name=\"videoPlaying\" returntype=\"xml\"></invoke>"); - //Log.Info("Flv Playing:{0}", lsPlaying); - //Log.Info("Player.playing:{0}", FlvControl.Player.Playing); - //Log.Info("control.playing:{0}", FlvControl.Playing); - //if (_started == false) - // return false; - //if (Paused) return true; - //return true; - return (_playState == PlayState.Playing || _playState == PlayState.Paused); + * */ + public override bool Ended + { + get + { + return (_playState==PlayState.Ended); + } + } + public override bool Playing + { + get + { + try + { + if (FlvControl == null) + return false; + //UpdateStatus(); + //String lsPlaying = FlvControl.Player.CallFunction("<invoke name=\"videoPlaying\" returntype=\"xml\"></invoke>"); + //Log.Info("Flv Playing:{0}", lsPlaying); + //Log.Info("Player.playing:{0}", FlvControl.Player.Playing); + //Log.Info("control.playing:{0}", FlvControl.Playing); + //if (_started == false) + // return false; + //if (Paused) return true; + //return true; + return (_playState == PlayState.Playing || _playState == PlayState.Paused); - } - catch (Exception) - { - FlvControl = null; - return false; - } + } + catch (Exception) + { + FlvControl = null; + return false; + } - } - } + } + } - public override void Pause() - { - if (FlvControl == null) return; - //UpdateStatus(); - //if (_started == false) return; - try - { - if (_playState == PlayState.Paused) - { - //FlvControl.Player.Play(); - FlvControl.Player.CallFunction("<invoke name=\"playVideo\" returntype=\"xml\"></invoke>"); - //_playerIsPaused = false; - } - else - { - FlvControl.Player.CallFunction("<invoke name=\"pauseVideo\" returntype=\"xml\"></invoke>"); - //FlvControl.Player.StopPlay(); - //_playerIsPaused = true; - } - } - catch (Exception) - { - FlvControl = null; - return; - } - } + public override void Pause() + { + if (FlvControl == null) return; + //UpdateStatus(); + //if (_started == false) return; + try + { + if (_playState == PlayState.Paused) + { + //FlvControl.Player.Play(); + //FlvControl.Player.CallFunction("<invoke name=\"playVideo\" returntype=\"xml\"></invoke>"); + //FlvControl.Player.CallFunction("<invoke name=\"playpause\" returntype=\"xml\"></invoke>"); + FlvControl.Player.CallFunction("<invoke name=\"sendEvent\" returntype=\"xml\"><arguments><string>playpause</string></arguments></invoke>"); + //_playerIsPaused = false; + } + else + { + //FlvControl.Player.CallFunction("<invoke name=\"pauseVideo\" returntype=\"xml\"></invoke>"); + //FlvControl.Player.CallFunction("<invoke name=\"playpause\" returntype=\"xml\"></invoke>"); + FlvControl.Player.CallFunction("<invoke name=\"sendEvent\" returntype=\"xml\"><arguments><string>playpause</string></arguments></invoke>"); + //FlvControl.Player.StopPlay(); + //_playerIsPaused = true; + } + } + catch (Exception) + { + FlvControl = null; + return; + } + } - public override bool Paused - { - get - { - try - { - //if (_started == false) return false; - //return _playerIsPaused; - return (_playState == PlayState.Paused); - } - catch (Exception) - { - FlvControl = null; - return false; - } - } - } + public override bool Paused + { + get + { + try + { + //if (_started == false) return false; + //return _playerIsPaused; + return (_playState == PlayState.Paused); + } + catch (Exception) + { + FlvControl = null; + return false; + } + } + } - public override string CurrentFile - { - get - { - return _currentFile; - } - } + public override string CurrentFile + { + get + { + return _currentFile; + } + } - public override void Process() - { - //Log.Info("in Process"); - //UpdateStatus(); - if (_needUpdate) - { - SetVideoWindow(); - } - if (CurrentPosition >= 10.0) - { - if (_notifyPlaying) - { - _notifyPlaying = false; - GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_PLAYING_10SEC, 0, 0, 0, 0, 0, null); - msg.Label = CurrentFile; - GUIWindowManager.SendThreadMessage(msg); - //Log.Info("Message Playing 10 sec sent"); - } - } - } - public override void SetVideoWindow() - { - //Log.Info("set video called fullscreen = {0} and grphic.Fullscreen {0}",_isFullScreen,GUIGraphicsContext.IsFullScreenVideo); - if (FlvControl == null) return; - if (GUIGraphicsContext.IsFullScreenVideo != _isFullScreen) - { - _isFullScreen = GUIGraphicsContext.IsFullScreenVideo; - _needUpdate = true; - } - if (!_needUpdate) return; - _needUpdate = false; + public override void Process() + { + //Log.Info("in Process"); + //UpdateStatus(); + if (_needUpdate) + { + SetVideoWindow(); + } + if (CurrentPosition >= 10.0) + { + if (_notifyPlaying) + { + _notifyPlaying = false; + GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_PLAYING_10SEC, 0, 0, 0, 0, 0, null); + msg.Label = CurrentFile; + GUIWindowManager.SendThreadMessage(msg); + //Log.Info("Message Playing 10 sec sent"); + } + } + } + public override void SetVideoWindow() + { + + if (FlvControl == null) return; + if (GUIGraphicsContext.IsFullScreenVideo != _isFullScreen) + { + _isFullScreen = GUIGraphicsContext.IsFullScreenVideo; + _needUpdate = true; + } + if (!_needUpdate) return; + _needUpdate = false; - if (_isFullScreen) - { - Log.Info("Flv:Fullscreen"); + if (_isFullScreen) + { + Log.Info("Flv:Fullscreen"); - _positionX = GUIGraphicsContext.OverScanLeft; - _positionY = GUIGraphicsContext.OverScanTop; - _videoWidth = GUIGraphicsContext.OverScanWidth; - _videoHeight = GUIGraphicsContext.OverScanHeight; + _positionX = GUIGraphicsContext.OverScanLeft; + _positionY = GUIGraphicsContext.OverScanTop; + _videoWidth = GUIGraphicsContext.OverScanWidth; + _videoHeight = GUIGraphicsContext.OverScanHeight; - FlvControl.Location = new Point(0, 0); - FlvControl.ClientSize = new System.Drawing.Size(GUIGraphicsContext.Width, GUIGraphicsContext.Height); - FlvControl.Size = new System.Drawing.Size(GUIGraphicsContext.Width, GUIGraphicsContext.Height); + FlvControl.Location = new Point(0, 0); + FlvControl.ClientSize = new System.Drawing.Size(GUIGraphicsContext.Width, GUIGraphicsContext.Height); + FlvControl.Size = new System.Drawing.Size(GUIGraphicsContext.Width, GUIGraphicsContext.Height); - _videoRectangle = new Rectangle(0, 0, FlvControl.ClientSize.Width, FlvControl.ClientSize.Height); - _sourceRectangle = _videoRectangle; + _videoRectangle = new Rectangle(0, 0, FlvControl.ClientSize.Width, FlvControl.ClientSize.Height); + _sourceRectangle = _videoRectangle; - //FlvControl.fullScreen=true; - //FlvControl.stretchToFit = true; - //Log.Info("FlvPlayer:done"); - return; - } - else - { + //FlvControl.fullScreen=true; + //FlvControl.stretchToFit = true; + //Log.Write("FlvPlayer:done"); + return; + } + else + { - FlvControl.ClientSize = new System.Drawing.Size(_videoWidth, _videoHeight); - FlvControl.Location = new Point(_positionX, _positionY); + FlvControl.ClientSize = new System.Drawing.Size(_videoWidth, _videoHeight); + FlvControl.Location = new Point(_positionX, _positionY); - _videoRectangle = new Rectangle(_positionX, _positionY, FlvControl.ClientSize.Width, FlvControl.ClientSize.Height); - _sourceRectangle = _videoRectangle; - //Log.Info("AudioPlayer:set window:({0},{1})-({2},{3})",_positionX,_positionY,_positionX+FlvControl.ClientSize.Width,_positionY+FlvControl.ClientSize.Height); - } - //FlvControl.uiMode = "none"; - //FlvControl.windowlessVideo = true; - //FlvControl.enableContextMenu = false; - //FlvControl.Ctlenabled = false; - GUIGraphicsContext.form.Controls[0].Enabled = false; - } + _videoRectangle = new Rectangle(_positionX, _positionY, FlvControl.ClientSize.Width, FlvControl.ClientSize.Height); + _sourceRectangle = _videoRectangle; + //Log.Write("AudioPlayer:set window:({0},{1})-({2},{3})",_positionX,_positionY,_positionX+FlvControl.ClientSize.Width,_positionY+FlvControl.ClientSize.Height); + } + + GUIGraphicsContext.form.Controls[0].Enabled = false; + } - public override void Stop() - { - if (FlvControl == null) return; - try - { - //Log.Info("before {0}", Playing); - //FlvControl.Player.Stop(); - FlvControl.Player.CallFunction("<invoke name=\"stopVideo\" returntype=\"xml\"></invoke>"); - FlvControl.Visible = false; - FlvControl.ClientSize = new Size(0, 0); - FlvControl.Dispose(); - //_playerIsPaused = false; - //_started = false; - //Playing = false; - //GUIGraphicsContext.OnNewAction -= new OnActionHandler(OnAction2); - //Log.Info("after {0}", Playing); - } - catch (Exception) - { - FlvControl = null; - } - } + public override void Stop() + { + //Log.Info("Attempting to stop..."); + if (FlvControl == null) return; + try + { + //Log.Info("before {0}", Playing); + //FlvControl.Player.Stop(); + //FlvControl.Player.CallFunction("<invoke name=\"stopVideo\" returntype=\"xml\"></invoke>"); + //FlvControl.Player.CallFunction("<invoke name=\"stop\" returntype=\"xml\"></invoke>"); + FlvControl.Player.CallFunction("<invoke name=\"sendEvent\" returntype=\"xml\"><arguments><string>stop</string></arguments></invoke>"); - public override bool HasVideo - { - get - { - return true; - } - } + FlvControl.Visible = false; + FlvControl.ClientSize = new Size(0, 0); + FlvControl.Dispose(); + //_playerIsPaused = false; + //_started = false; + //Playing = false; + //GUIGraphicsContext.OnNewAction -= new OnActionHandler(OnAction2); + //Log.Info("after {0}", Playing); + } + catch (Exception) + { + FlvControl = null; + } + } - public override bool FullScreen - { - - get - { - return _isFullScreen; - } - set - { - if (value != _isFullScreen) - { - //Log.Info("setting fullscreen to {0}", value); - _isFullScreen = value; - _needUpdate = true; - } - } - } + public override bool HasVideo + { + get + { + return true; + } + } - public override int PositionX - { - get { return _positionX; } - set - { - if (value != _positionX) - { - //Log.Info("setting position x to {0}", value); - _positionX = value; - _needUpdate = true; - } - } - } + public override bool FullScreen + { + + get + { + return _isFullScreen; + } + set + { + if (value != _isFullScreen) + { + //Log.Info("setting fullscreen to {0}", value); + _isFullScreen = value; + _needUpdate = true; + } + } + } - public override int PositionY - { - get { return _positionY; } - set - { - if (value != _positionY) - { - //Log.Info("setting position y to {0}", value); - _positionY = value; - _needUpdate = true; - } - } - } + public override int PositionX + { + get { return _positionX; } + set + { + if (value != _positionX) + { + //Log.Info("setting position x to {0}", value); + _positionX = value; + _needUpdate = true; + } + } + } - public override int RenderWidth - { - get { return _videoWidth; } - set - { - if (value != _videoWidth) - { - //Log.Info("setting width to {0}", value); - _videoWidth = value; - _needUpdate = true; - } - } - } - public override int RenderHeight - { - get { return _videoHeight; } - set - { - if (value != _videoHeight) - { - //Log.Info("setting position height to {0}", value); - _videoHeight = value; - _needUpdate = true; - } - } - } + public override int PositionY + { + get { return _positionY; } + set + { + if (value != _positionY) + { + //Log.Info("setting position y to {0}", value); + _positionY = value; + _needUpdate = true; + } + } + } + public override int RenderWidth + { + get { return _videoWidth; } + set + { + if (value != _videoWidth) + { + //Log.Info("setting width to {0}", value); + _videoWidth = value; + _needUpdate = true; + } + } + } + public override int RenderHeight + { + get { return _videoHeight; } + set + { + if (value != _videoHeight) + { + //Log.Info("setting position height to {0}", value); + _videoHeight = value; + _needUpdate = true; + } + } + } - - public override void SeekRelative(double dTime) - { - double dCurTime = CurrentPosition; - dTime = dCurTime + dTime; - if (dTime < 0.0d) dTime = 0.0d; - if (dTime < Duration) - { - SeekAbsolute(dTime); - } - } - public override void SeekAbsolute(double dTime) - { - if (dTime < 0.0d) dTime = 0.0d; - if (dTime < Duration) - { - if (FlvControl == null) return; - try - { - Log.Info("Attempting to seek..."); - FlvControl.Player.CallFunction("<invoke name=\"videoSeek\" returntype=\"xml\"><arguments><number>" + dTime + "</number></arguments></invoke>"); - //FlvControl.Player.CurrentFrame() = (int)dTime; - Log.Info("seeking complete"); - } - catch (Exception e) { - Log.Error(e); - } - } - } + + public override void SeekRelative(double dTime) + { + double dCurTime = CurrentPosition; + dTime = dCurTime + dTime; + if (dTime < 0.0d) dTime = 0.0d; + if (dTime < Duration) + { + SeekAbsolute(dTime); + } + } - public override void SeekRelativePercentage(int iPercentage) - { - double dCurrentPos = CurrentPosition; - double dDuration = Duration; + public override void SeekAbsolute(double dTime) + { + if (dTime < 0.0d) dTime = 0.0d; + if (dTime < Duration) + { + if (FlvControl == null) return; + try + { + Log.Info("Attempting to seek..."); + //FlvControl.Player.CallFunction("<invoke name=\"videoSeek\" returntype=\"xml\"><arguments><number>" + dTime + "</number></arguments></invoke>"); + //FlvControl.Player.CallFunction("<invoke name=\"scrub\" returntype=\"xml\"><arguments><number>" + dTime + "</number></arguments></invoke>"); + FlvControl.Player.CallFunction("<invoke name=\"sendEvent\" returntype=\"xml\"><arguments><string>scrub</string><number>" + dTime + "</number></arguments></invoke>"); + //FlvControl.Player.CurrentFrame() = (int)dTime; + Log.Info("seeking complete"); + } + catch (Exception e) { + Log.Error(e); + } + } + } - double fCurPercent = (dCurrentPos / Duration) * 100.0d; - double fOnePercent = Duration / 100.0d; - fCurPercent = fCurPercent + (double)iPercentage; - fCurPercent *= fOnePercent; - if (fCurPercent < 0.0d) fCurPercent = 0.0d; - if (fCurPercent < Duration) - { - SeekAbsolute(fCurPercent); - } - } + public override void SeekRelativePercentage(int iPercentage) + { + double dCurrentPos = CurrentPosition; + double dDuration = Duration; + double fCurPercent = (dCurrentPos / Duration) * 100.0d; + double fOnePercent = Duration / 100.0d; + fCurPercent = fCurPercent + (double)iPercentage; + fCurPercent *= fOnePercent; + if (fCurPercent < 0.0d) fCurPercent = 0.0d; + if (fCurPercent < Duration) + { + SeekAbsolute(fCurPercent); + } + } - public override void SeekAsolutePercentage(int iPercentage) - { - if (iPercentage < 0) iPercentage = 0; - if (iPercentage >= 100) iPercentage = 100; - double fPercent = Duration / 100.0f; - fPercent *= (double)iPercentage; - SeekAbsolute(fPercent); - } - //private void VideoEnded - //{ - //} + public override void SeekAsolutePercentage(int iPercentage) + { + if (iPercentage < 0) iPercentage = 0; + if (iPercentage >= 100) iPercentage = 100; + double fPercent = Duration / 100.0f; + fPercent *= (double)iPercentage; + SeekAbsolute(fPercent); + } + - } + } } Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/GUIOnlineVideos.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/GUIOnlineVideos.cs 2007-08-23 15:02:52 UTC (rev 861) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/GUIOnlineVideos.cs 2007-08-24 03:45:27 UTC (rev 862) @@ -238,7 +238,7 @@ if (dlgSel != null) { dlgSel.Add("Save"); // Save - Log.Info("msSelectedCategoryValue = "+msSelectedCategoryValue); + //Log.Info("msSelectedCategoryValue = "+msSelectedCategoryValue); if(msSelectedCategoryValue.StartsWith("fav:") ==false){ dlgSel.Add("Add to favorites"); } @@ -254,7 +254,7 @@ } dlgSel.DoModal(GetID); int liSelectedIdx = dlgSel.SelectedId; - Log.Info("Selected id {0}",liSelectedIdx); + //Log.Info("Selected id {0}",liSelectedIdx); switch(liSelectedIdx){ case 1: SaveVideo(moCurrentVideoList[facadeView.SelectedListItemIndex -1]); @@ -276,14 +276,14 @@ //Log.Info("Getting related videos on {0} using tags:{1}",SiteUtilFactory.getSiteUtil(msSelectedSiteId),moCurrentVideoList[liSelected].Tags); SiteUtilBase site = SiteUtilFactory.getSiteUtil(msSelectedSiteId); //Log.Info("VideoList before:"); - foreach(VideoInfo video in moCurrentVideoList){ - Log.Info(video.Title); - } + //foreach(VideoInfo video in moCurrentVideoList){ + //Log.Info(video.Title); + //} moCurrentVideoList = site.getRelatedVideos(moCurrentVideoList[liSelected].Tags); //Log.Info("VideoList after:"); - foreach(VideoInfo video in moCurrentVideoList){ - Log.Info(video.Title); - } + //foreach(VideoInfo video in moCurrentVideoList){ + // Log.Info(video.Title); + //} DisplayVideos(false); break; @@ -314,7 +314,7 @@ protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType) { //Log.Info("Onclicked action type:{0}",actionType); - if (control == facadeView) + if (control == facadeView && actionType== Action.ActionType.ACTION_SELECT_ITEM) { if (_CurrentState == State.home) @@ -659,9 +659,7 @@ DisplayVideoInfo(moCurrentVideoList[item.ItemId-1]); } } - public void OnAction2(Action foAction){ - Log.Info("MyFlashPlayer received action:"+foAction.wID); - } + private bool GetUserInputString(ref string sString) { Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/SiteUtilBase.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/SiteUtilBase.cs 2007-08-23 15:02:52 UTC (rev 861) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/SiteUtilBase.cs 2007-08-24 03:45:27 UTC (rev 862) @@ -54,7 +54,7 @@ { //ServiceProvider loServices = GlobalServiceProvider.Instance; //moLog = loServices.Get<ILog>(); - } + } public virtual List<GUIOnlineVideos.VideoInfo> getSiteFavorites(String fsUser){ return new List<GUIOnlineVideos.VideoInfo>(); @@ -78,7 +78,7 @@ Log.Info("SiteUtilBase AddFavorites."); FavoritesDatabase db = FavoritesDatabase.getInstance(); db.addFavoriteVideo(foVideo,fsSiteId); - + } public virtual bool RemoveFavorite(GUIOnlineVideos.VideoInfo foVideo){ Log.Info("SiteUtilBase removeFavorites."); @@ -93,149 +93,155 @@ public List<RssItem> getRssDataItems(String fsUrl){ - XmlDocument doc = new XmlDocument(); - XmlReaderSettings settings = new XmlReaderSettings(); - settings.ProhibitDtd = false; - //doc.Load(XmlReader.Create(fsUrl,settings)); - - WebClient client =new WebClient(); - String xml = client.DownloadString(fsUrl); - doc.LoadXml(xml); - XmlNamespaceManager expr = new XmlNamespaceManager(doc.NameTable); - expr.AddNamespace("media", "http://search.yahoo.com/mrss"); - expr.AddNamespace("exInfo","http://www.gametrailers.com/rssexplained.php"); - //Create the root XmlNode and generate an XmlNodeList from it. - XmlNode root = doc.SelectSingleNode("//rss/channel/item", expr); - XmlNodeList nodeList; - nodeList = root.SelectNodes("//rss/channel/item"); - //XmlAttributeCollection ac; List<RssItem> loRssItems = new List<RssItem>(); - RssItem loRssItem; - //GUIListItem loListItem; - MediaContent loMediaContent; - int itemCount = 0; - foreach (XmlNode chileNode in nodeList) - { - if(itemCount>=100){ - break; - } - itemCount++; - loRssItem = new RssItem(); - - for (int i = 0; i < chileNode.ChildNodes.Count; i++) + try{ + XmlDocument doc = new XmlDocument(); + XmlReaderSettings settings = new XmlReaderSettings(); + settings.ProhibitDtd = false; + //doc.Load(XmlReader.Create(fsUrl,settings)); + + WebClient client =new WebClient(); + String xml = client.DownloadString(fsUrl); + doc.LoadXml(xml); + XmlNamespaceManager expr = new XmlNamespaceManager(doc.NameTable); + expr.AddNamespace("media", "http://search.yahoo.com/mrss"); + expr.AddNamespace("exInfo","http://www.gametrailers.com/rssexplained.php"); + //Create the root XmlNode and generate an XmlNodeList from it. + XmlNode root = doc.SelectSingleNode("//rss/channel/item", expr); + XmlNodeList nodeList; + nodeList = root.SelectNodes("//rss/channel/item"); + //XmlAttributeCollection ac; + + RssItem loRssItem; + //GUIListItem loListItem; + MediaContent loMediaContent; + int itemCount = 0; + foreach (XmlNode chileNode in nodeList) { - XmlNode n = chileNode.ChildNodes[i]; + if(itemCount>=100){ + break; + } + itemCount++; + loRssItem = new RssItem(); - switch (n.Name) + for (int i = 0; i < chileNode.ChildNodes.Count; i++) { - - case "title": - loRssItem.title = n.InnerText; - break; - case "link": - loRssItem.link = n.InnerText; - break; - case "guid": - loRssItem.guid = n.InnerText; - break; - case "pubDate": - loRssItem.pubDate = n.InnerText; - break; - case "description": - loRssItem.description = n.InnerText; - break; - case "author": - loRssItem.author = n.InnerText; - break; - case "exInfo:image": - loRssItem.exInfoImage = n.InnerText; - break; - case "media:group": - - for (int j = 0; j < n.ChildNodes.Count; j++) - { - XmlNode nin = n.ChildNodes[j]; - switch (nin.Name) + XmlNode n = chileNode.ChildNodes[i]; + + switch (n.Name) + { + + case "title": + loRssItem.title = n.InnerText; + break; + case "link": + loRssItem.link = n.InnerText; + break; + case "guid": + loRssItem.guid = n.InnerText; + break; + case "pubDate": + loRssItem.pubDate = n.InnerText; + break; + case "description": + loRssItem.description = n.InnerText; + break; + case "author": + loRssItem.author = n.InnerText; + break; + case "exInfo:image": + loRssItem.exInfoImage = n.InnerText; + break; + case "media:group": + + for (int j = 0; j < n.ChildNodes.Count; j++) { - - case "media:content": - loMediaContent = new MediaContent(); - try{ - loMediaContent.url = nin.Attributes["url"].Value; - loMediaContent.type = nin.Attributes["type"].Value; - loMediaContent.medium = nin.Attributes["medium"].Value; - loMediaContent.duration = nin.Attributes["duration"].Value; - loMediaContent.height = nin.Attributes["height"].Value; - loMediaContent.width = nin.Attributes["width"].Value; - }catch(Exception){}; - loRssItem.contentList.Add(loMediaContent); - break; - case "media:description": - loRssItem.mediaDescription = n.InnerText; - break; - case "media:thumbnail": - loRssItem.mediaThumbnail = nin.Attributes["url"].Value; - break; - case "media:title": - loRssItem.mediaTitle = nin.InnerText; - break; - + XmlNode nin = n.ChildNodes[j]; + switch (nin.Name) + { + + case "media:content": + loMediaContent = new MediaContent(); + try{ + loMediaContent.url = nin.Attributes["url"].Value; + loMediaContent.type = nin.Attributes["type"].Value; + loMediaContent.medium = nin.Attributes["medium"].Value; + loMediaContent.duration = nin.Attributes["duration"].Value; + loMediaContent.height = nin.Attributes["height"].Value; + loMediaContent.width = nin.Attributes["width"].Value; + }catch(Exception){}; + loRssItem.contentList.Add(loMediaContent); + break; + case "media:description": + loRssItem.mediaDescription = n.InnerText; + break; + case "media:thumbnail": + loRssItem.mediaThumbnail = nin.Attributes["url"].Value; + break; + case "media:title": + loRssItem.mediaTitle = nin.InnerText; + break; + + } } - } - break; - case "media:content": - loMediaContent = new MediaContent(); - loMediaContent.url = n.Attributes["url"].Value; - loMediaContent.type = n.Attributes["type"].Value; - loMediaContent.medium = n.Attributes["medium"].Value; - loMediaContent.duration = n.Attributes["duration"].Value; - loMediaContent.height = n.Attributes["height"].Value; - loMediaContent.width = n.Attributes["width"].Value; - loRssItem.contentList.Add(loMediaContent); - for (int j = 0; j < n.ChildNodes.Count; j++) - { - XmlNode nin = n.ChildNodes[j]; - - switch (nin.Name) + break; + case "media:content": + loMediaContent = new MediaContent(); + loMediaContent.url = n.Attributes["url"].Value; + loMediaContent.type = n.Attributes["type"].Value; + loMediaContent.medium = n.Attributes["medium"].Value; + loMediaContent.duration = n.Attributes["duration"].Value; + loMediaContent.height = n.Attributes["height"].Value; + loMediaContent.width = n.Attributes["width"].Value; + loRssItem.contentList.Add(loMediaContent); + for (int j = 0; j < n.ChildNodes.Count; j++) { - case "media:description": - loRssItem.mediaDescription = n.InnerText; - break; - case "media:thumbnail": - loRssItem.mediaThumbnail = nin.Attributes["url"].Value; - break; - case "media:title": - loRssItem.mediaTitle = nin.InnerText; - break; - + XmlNode nin = n.ChildNodes[j]; + + switch (nin.Name) + { + case "media:description": + loRssItem.mediaDescription = n.InnerText; + break; + case "media:thumbnail": + loRssItem.mediaThumbnail = nin.Attributes["url"].Value; + break; + case "media:title": + loRssItem.mediaTitle = nin.InnerText; + break; + + } } - } - break; - case "media:description": - loRssItem.mediaDescription = n.InnerText; - break; - case "media:thumbnail": - loRssItem.mediaThumbnail = n.Attributes["url"].Value; - break; - case "media:title": - loRssItem.mediaTitle = n.InnerText; - break; - case "enclosure": - loRssItem.enclosure = n.Attributes["url"].Value; - if(n.Attributes["duration"]!=null){ - loRssItem.enclosureDuration = n.Attributes["duration"].Value; - } - - break; - case "media:category": - loRssItem.mediaCategory = n.InnerText; - break; - default: - break; + break; + case "media:description": + loRssItem.mediaDescription = n.InnerText; + break; + case "media:thumbnail": + loRssItem.mediaThumbnail = n.Attributes["url"].Value; + break; + case "media:title": + loRssItem.mediaTitle = n.InnerText; + break; + case "enclosure": + loRssItem.enclosure = n.Attributes["url"].Value; + if(n.Attributes["duration"]!=null){ + loRssItem.enclosureDuration = n.Attributes["duration"].Value; + } + + break; + case "media:category": + loRssItem.mediaCategory = n.InnerText; + break; + default: + break; + } } + loRssItems.Add(loRssItem); } - loRssItems.Add(loRssItem); - } + }catch(Exception e){ + Log.Error(e); + } + return loRssItems; } Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/Stage6Util.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/Stage6Util.cs 2007-08-23 15:02:52 UTC (rev 861) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/Stage6Util.cs 2007-08-24 03:45:27 UTC (rev 862) @@ -33,7 +33,7 @@ } protected override String getUrl(String fsId) { - return fsId; + return fsId+"&txe=.avi"; } public override List<GUIOnlineVideos.VideoInfo> getVideoList(string fsUrl) { Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos.sln =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos.sln 2007-08-23 15:02:52 UTC (rev 861) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos.sln 2007-08-24 03:45:27 UTC (rev 862) @@ -1,7 +1,7 @@ - + Microsoft Visual Studio Solution File, Format Version 9.00 # Visual Studio 2005 -# SharpDevelop 2.1.0.2429 +# SharpDevelop 2.2.0.2595 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OnlineVideos", "OnlineVideos\OnlineVideos.csproj", "{E0D9D390-CDD6-4B98-86F3-6EB04A958882}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Runner", "OnlineVideos\Runner.csproj", "{EFABB07B-B050-45AD-A93F-C5047F15512F}" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-08-23 15:02:59
|
Revision: 861 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=861&view=rev Author: and-81 Date: 2007-08-23 08:02:52 -0700 (Thu, 23 Aug 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/CreateIRFile.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Transceiver.csproj trunk/plugins/IR Server Suite/IR Server Suite.sln Modified: trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/CreateIRFile.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/CreateIRFile.Designer.cs 2007-08-23 15:02:04 UTC (rev 860) +++ trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/CreateIRFile.Designer.cs 2007-08-23 15:02:52 UTC (rev 861) @@ -28,9 +28,19 @@ /// </summary> private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); + this.SuspendLayout(); + // + // CreateIRFile + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Text = "CreateIRFile"; + this.ClientSize = new System.Drawing.Size(284, 264); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.Name = "CreateIRFile"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Create IR File"; + this.ResumeLayout(false); + } #endregion Modified: trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Transceiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Transceiver.csproj 2007-08-23 15:02:04 UTC (rev 860) +++ trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Transceiver.csproj 2007-08-23 15:02:52 UTC (rev 861) @@ -88,6 +88,10 @@ <DependentUpon>Configure.cs</DependentUpon> <SubType>Designer</SubType> </EmbeddedResource> + <EmbeddedResource Include="CreateIRFile.resx"> + <SubType>Designer</SubType> + <DependentUpon>CreateIRFile.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. Modified: trunk/plugins/IR Server Suite/IR Server Suite.sln =================================================================== --- trunk/plugins/IR Server Suite/IR Server Suite.sln 2007-08-23 15:02:04 UTC (rev 860) +++ trunk/plugins/IR Server Suite/IR Server Suite.sln 2007-08-23 15:02:52 UTC (rev 861) @@ -181,12 +181,6 @@ Release.AspNetCompiler.Debug = "False" EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinLirc Receiver", "IR Server Plugins\WinLirc Receiver\WinLirc Receiver.csproj", "{E6A68244-8C31-44A9-9F85-B4A102B5F209}" - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.Debug = "False" - EndProjectSection -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Custom HID Receiver", "IR Server Plugins\Custom HID Receiver\Custom HID Receiver.csproj", "{0F6576B4-C88E-4E79-B7E9-9480498C5A32}" ProjectSection(WebsiteProperties) = preProject Debug.AspNetCompiler.Debug = "True" @@ -229,6 +223,18 @@ Release.AspNetCompiler.Debug = "False" EndProjectSection EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HCW Transceiver", "IR Server Plugins\HCW Transceiver\HCW Transceiver.csproj", "{EE8F2C22-8BD3-4832-85F0-E6F67ED3AADB}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinLirc Transceiver", "IR Server Plugins\WinLirc Transceiver\WinLirc Transceiver.csproj", "{E6A68244-8C31-44A9-9F85-B4A102B5F209}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -435,14 +441,6 @@ {D8B3D28F-62CE-4CA7-86CE-B7EAD614A94C}.Release|Any CPU.Build.0 = Release|Any CPU {D8B3D28F-62CE-4CA7-86CE-B7EAD614A94C}.Release|x86.ActiveCfg = Release|x86 {D8B3D28F-62CE-4CA7-86CE-B7EAD614A94C}.Release|x86.Build.0 = Release|x86 - {E6A68244-8C31-44A9-9F85-B4A102B5F209}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E6A68244-8C31-44A9-9F85-B4A102B5F209}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E6A68244-8C31-44A9-9F85-B4A102B5F209}.Debug|x86.ActiveCfg = Debug|x86 - {E6A68244-8C31-44A9-9F85-B4A102B5F209}.Debug|x86.Build.0 = Debug|x86 - {E6A68244-8C31-44A9-9F85-B4A102B5F209}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E6A68244-8C31-44A9-9F85-B4A102B5F209}.Release|Any CPU.Build.0 = Release|Any CPU - {E6A68244-8C31-44A9-9F85-B4A102B5F209}.Release|x86.ActiveCfg = Release|x86 - {E6A68244-8C31-44A9-9F85-B4A102B5F209}.Release|x86.Build.0 = Release|x86 {0F6576B4-C88E-4E79-B7E9-9480498C5A32}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0F6576B4-C88E-4E79-B7E9-9480498C5A32}.Debug|x86.ActiveCfg = Debug|Any CPU {0F6576B4-C88E-4E79-B7E9-9480498C5A32}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -490,6 +488,22 @@ {B5E711A2-E6D0-4BEA-B66B-7A8B0BCA6A4D}.Release|Any CPU.Build.0 = Release|Any CPU {B5E711A2-E6D0-4BEA-B66B-7A8B0BCA6A4D}.Release|x86.ActiveCfg = Release|x86 {B5E711A2-E6D0-4BEA-B66B-7A8B0BCA6A4D}.Release|x86.Build.0 = Release|x86 + {EE8F2C22-8BD3-4832-85F0-E6F67ED3AADB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EE8F2C22-8BD3-4832-85F0-E6F67ED3AADB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EE8F2C22-8BD3-4832-85F0-E6F67ED3AADB}.Debug|x86.ActiveCfg = Debug|x86 + {EE8F2C22-8BD3-4832-85F0-E6F67ED3AADB}.Debug|x86.Build.0 = Debug|x86 + {EE8F2C22-8BD3-4832-85F0-E6F67ED3AADB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EE8F2C22-8BD3-4832-85F0-E6F67ED3AADB}.Release|Any CPU.Build.0 = Release|Any CPU + {EE8F2C22-8BD3-4832-85F0-E6F67ED3AADB}.Release|x86.ActiveCfg = Release|x86 + {EE8F2C22-8BD3-4832-85F0-E6F67ED3AADB}.Release|x86.Build.0 = Release|x86 + {E6A68244-8C31-44A9-9F85-B4A102B5F209}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E6A68244-8C31-44A9-9F85-B4A102B5F209}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E6A68244-8C31-44A9-9F85-B4A102B5F209}.Debug|x86.ActiveCfg = Debug|x86 + {E6A68244-8C31-44A9-9F85-B4A102B5F209}.Debug|x86.Build.0 = Debug|x86 + {E6A68244-8C31-44A9-9F85-B4A102B5F209}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E6A68244-8C31-44A9-9F85-B4A102B5F209}.Release|Any CPU.Build.0 = Release|Any CPU + {E6A68244-8C31-44A9-9F85-B4A102B5F209}.Release|x86.ActiveCfg = Release|x86 + {E6A68244-8C31-44A9-9F85-B4A102B5F209}.Release|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -516,8 +530,9 @@ {253FFB14-AB8E-49AB-A005-A42428C3F452} = {0D1620EE-01B9-43B5-9FAA-E983BD9EBDBD} {9FDD649E-0502-4FED-9AC1-AA0346394375} = {0D1620EE-01B9-43B5-9FAA-E983BD9EBDBD} {D8B3D28F-62CE-4CA7-86CE-B7EAD614A94C} = {0D1620EE-01B9-43B5-9FAA-E983BD9EBDBD} + {0F6576B4-C88E-4E79-B7E9-9480498C5A32} = {0D1620EE-01B9-43B5-9FAA-E983BD9EBDBD} + {EE8F2C22-8BD3-4832-85F0-E6F67ED3AADB} = {0D1620EE-01B9-43B5-9FAA-E983BD9EBDBD} {E6A68244-8C31-44A9-9F85-B4A102B5F209} = {0D1620EE-01B9-43B5-9FAA-E983BD9EBDBD} - {0F6576B4-C88E-4E79-B7E9-9480498C5A32} = {0D1620EE-01B9-43B5-9FAA-E983BD9EBDBD} {E98F1F7E-40B6-44C8-AC66-EC867B141FA1} = {0E9CCB69-CEF0-4680-816B-18E949DEA727} {077B53BB-404A-4B2F-BA17-AAE98C5E9C66} = {0E9CCB69-CEF0-4680-816B-18E949DEA727} {F4EA6055-7133-4F18-8971-E19ADEB482C1} = {0E9CCB69-CEF0-4680-816B-18E949DEA727} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-08-23 15:02:18
|
Revision: 860 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=860&view=rev Author: and-81 Date: 2007-08-23 08:02:04 -0700 (Thu, 23 Aug 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver/HCW Transceiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver/HcwTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/Configure.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/Configure.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLircServer.cs Added Paths: ----------- trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver/irremote.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/ trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/CreateIRFile.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/CreateIRFile.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/CreateIRFile.resx trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Transceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Transceiver.csproj Removed Paths: ------------- trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Receiver/ trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Receiver.csproj Modified: trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver/HCW Transceiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver/HCW Transceiver.csproj 2007-08-23 13:19:30 UTC (rev 859) +++ trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver/HCW Transceiver.csproj 2007-08-23 15:02:04 UTC (rev 860) @@ -66,6 +66,7 @@ <DependentUpon>Configure.cs</DependentUpon> </Compile> <Compile Include="HcwTransceiver.cs" /> + <Compile Include="irremote.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> </ItemGroup> <ItemGroup> Modified: trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver/HcwTransceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver/HcwTransceiver.cs 2007-08-23 13:19:30 UTC (rev 859) +++ trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver/HcwTransceiver.cs 2007-08-23 15:02:04 UTC (rev 860) @@ -20,100 +20,25 @@ #region Interop - [StructLayout(LayoutKind.Sequential)] - struct UUINFO - { - public int fwVersion; - public int protVersion; - public char fwDateDay; - public char fwDateMonth; - public char fwDateYear; - } - //Not used - //[StructLayout(LayoutKind.Sequential)] - //internal struct UUGPIO - //{ - // public byte[] irCode; - // public byte action; - // public byte duration; - //} + const int WM_ACTIVATE = 0x0006; + const int WM_POWERBROADCAST = 0x0218; + const int WA_INACTIVE = 0; + const int WA_ACTIVE = 1; + const int WA_CLICKACTIVE = 2; - [DllImport("uuirtdrv.dll")] - static extern IntPtr UUIRTOpen(); + const int PBT_APMRESUMEAUTOMATIC = 0x0012; + const int PBT_APMRESUMECRITICAL = 0x0006; - [DllImport("uuirtdrv.dll")] - [return: MarshalAs(UnmanagedType.Bool)] - static extern bool UUIRTClose( - IntPtr hHandle); - //[DllImport("uuirtdrv.dll")] - //[return: MarshalAs(UnmanagedType.Bool)] - //internal static extern bool UUIRTGetDrvInfo(ref int puDrvVersion); - //[DllImport("uuirtdrv.dll")] - //[return: MarshalAs(UnmanagedType.Bool)] - //internal static extern bool UUIRTGetUUIRTInfo( - // IntPtr hHandle, - // ref UUINFO puuInfo); - - //[DllImport("uuirtdrv.dll")] - //[return: MarshalAs(UnmanagedType.Bool)] - //internal static extern bool UUIRTGetUUIRTConfig( - // IntPtr hHandle, - // ref uint puConfig); - - //[DllImport("uuirtdrv.dll")] - //[return: MarshalAs(UnmanagedType.Bool)] - //internal static extern bool UUIRTSetUUIRTConfig( - // IntPtr hHandle, - // uint uConfig); - - [DllImport("uuirtdrv.dll")] - [return: MarshalAs(UnmanagedType.Bool)] - static extern bool UUIRTTransmitIR( - IntPtr hHandle, - string IRCode, - int codeFormat, - int repeatCount, - int inactivityWaitTime, - IntPtr hEvent, - int res1, - int res2); - - [DllImport("uuirtdrv.dll")] - [return: MarshalAs(UnmanagedType.Bool)] - static extern bool UUIRTLearnIR( - IntPtr hHandle, - int codeFormat, - [MarshalAs(UnmanagedType.LPStr)] StringBuilder ircode, - IRLearnCallbackDelegate progressProc, - int userData, - ref int pAbort, - int param1, - [MarshalAs(UnmanagedType.AsAny)] Object o, - [MarshalAs(UnmanagedType.AsAny)] Object oo); - - [DllImport("uuirtdrv.dll")] - [return: MarshalAs(UnmanagedType.Bool)] - static extern bool UUIRTSetReceiveCallback( - IntPtr hHandle, - UUIRTReceiveCallbackDelegate receiveProc, - int none); - - //[DllImport("uuirtdrv.dll")] - //static extern bool UUIRTSetUUIRTGPIOCfg(IntPtr hHandle, int index, ref UUGPIO GpioSt); - - //[DllImport("uuirtdrv.dll")] - //static extern bool UUIRTGetUUIRTGPIOCfg(IntPtr hHandle, ref int numSlots, ref uint dwPortPins, - // ref UUGPIO GpioSt); - #endregion #region Delegates - delegate void UUIRTReceiveCallbackDelegate(string irCode, IntPtr userData); - delegate void IRLearnCallbackDelegate(uint progress, uint sigQuality, ulong carrierFreq, IntPtr userData); + //Sets up callback so that other forms can catch a key press + public delegate void HCWEvent(int keypress); + public event HCWEvent HCWKeyPressed; #endregion Delegates Added: trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver/irremote.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver/irremote.cs (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver/irremote.cs 2007-08-23 15:02:04 UTC (rev 860) @@ -0,0 +1,165 @@ +#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.Runtime.InteropServices; +using Microsoft.Win32; +using MediaPortal.GUI.Library; +using System.IO; + +namespace HcwTransceiver +{ + /// <summary> + /// Wrapper class for irremote.dll + /// </summary> + public static class irremote + { + #region DLL-Imports + + /// <summary> + /// The SetDllDirectory function adds a directory to the search path used to locate DLLs for the application. + /// http://msdn.microsoft.com/library/en-us/dllproc/base/setdlldirectory.asp + /// </summary> + /// <param name="PathName">Pointer to a null-terminated string that specifies the directory to be added to the search path.</param> + /// <returns></returns> + [DllImport("kernel32.dll")] + static extern bool SetDllDirectory( + string PathName); + + /// <summary> + /// Registers window handle with Hauppauge IR driver + /// </summary> + /// <param name="WindowHandle"></param> + /// <param name="Msg"></param> + /// <param name="Verbose"></param> + /// <param name="IRPort"></param> + /// <returns></returns> + [DllImport("irremote.dll")] + static extern bool IR_Open( + int WindowHandle, + uint Msg, + bool Verbose, + ushort IRPort); + + /// <summary> + /// Gets the received key code (new version, works for PVR-150 as well) + /// </summary> + /// <param name="RepeatCount"></param> + /// <param name="RemoteCode"></param> + /// <param name="KeyCode"></param> + /// <returns></returns> + [DllImport("irremote.dll")] + static extern bool IR_GetSystemKeyCode( + out int RepeatCount, + out int RemoteCode, + out int KeyCode); + + /// <summary> + /// Unregisters window handle from Hauppauge IR driver + /// </summary> + /// <param name="WindowHandle"></param> + /// <param name="Msg"></param> + /// <returns></returns> + [DllImport("irremote.dll")] + static extern bool IR_Close( + int WindowHandle, + uint Msg); + + #endregion + + + public static string CurrentVersion = "2.49.23332"; + + public static bool IRClose(IntPtr WindowHandle, uint Msg) + { + return IR_Close((int)WindowHandle, Msg); + } + + public static bool IRGetSystemKeyCode(out int RepeatCount, out int RemoteCode, out int KeyCode) + { + RepeatCount = 0; + RemoteCode = 0; + KeyCode = 0; + bool result = false; + try + { + result = IR_GetSystemKeyCode(out RepeatCount, out RemoteCode, out KeyCode); + } + catch (AccessViolationException) + { + } + catch (Exception ex) + { + Log.Info("HCW: Exception while querying remote: {0}", ex.Message); + } + return result; + } + + public static bool IROpen(IntPtr WindowHandle, uint Msg, bool Verbose, ushort IRPort) + { + return IR_Open((int)WindowHandle, Msg, Verbose, IRPort); + } + + public static bool IRSetDllDirectory(string PathName) + { + return SetDllDirectory(PathName); + } + + /// <summary> + /// Get the Hauppauge IR components installation path from the windows registry. + /// </summary> + /// <returns>Installation path of the Hauppauge IR components</returns> + public static string GetHCWPath() + { + string dllPath = null; + using (RegistryKey rkey = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Hauppauge WinTV Infrared Remote")) + { + if (rkey != null) + { + dllPath = rkey.GetValue("UninstallString").ToString(); + if (dllPath.IndexOf("UNir32") > 0) + dllPath = dllPath.Substring(0, dllPath.IndexOf("UNir32")); + else if (dllPath.IndexOf("UNIR32") > 0) + dllPath = dllPath.Substring(0, dllPath.IndexOf("UNIR32")); + } + } + return dllPath; + } + + /// <summary> + /// Returns the path of the DLL component + /// </summary> + /// <returns>DLL path</returns> + public static string GetDllPath() + { + string dllPath = GetHCWPath(); + if (!File.Exists(dllPath + "irremote.DLL")) + { + dllPath = null; + } + return dllPath; + } + } +} Copied: trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver (from rev 859, trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Receiver) Modified: trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/Configure.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Receiver/Configure.Designer.cs 2007-08-23 13:19:30 UTC (rev 859) +++ trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/Configure.Designer.cs 2007-08-23 15:02:04 UTC (rev 860) @@ -1,4 +1,4 @@ -namespace WinLircReceiver +namespace WinLircTransceiver { partial class Configure { @@ -43,6 +43,7 @@ this.groupBoxServerDetails = new System.Windows.Forms.GroupBox(); this.labelButtonReleaseTime = new System.Windows.Forms.Label(); this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); + this.buttonCreateIRFiles = new System.Windows.Forms.Button(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownServerPort)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownButtonReleaseTime)).BeginInit(); this.groupBoxServerDetails.SuspendLayout(); @@ -51,10 +52,10 @@ // 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(104, 208); + this.buttonOK.Location = new System.Drawing.Point(104, 240); this.buttonOK.Name = "buttonOK"; this.buttonOK.Size = new System.Drawing.Size(64, 24); - this.buttonOK.TabIndex = 3; + this.buttonOK.TabIndex = 4; this.buttonOK.Text = "OK"; this.buttonOK.UseVisualStyleBackColor = true; this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); @@ -63,10 +64,10 @@ // 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(176, 208); + this.buttonCancel.Location = new System.Drawing.Point(176, 240); this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Size = new System.Drawing.Size(64, 24); - this.buttonCancel.TabIndex = 4; + this.buttonCancel.TabIndex = 5; this.buttonCancel.Text = "Cancel"; this.buttonCancel.UseVisualStyleBackColor = true; this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); @@ -187,13 +188,25 @@ this.openFileDialog.Filter = "All Files|*.*"; this.openFileDialog.Title = "Locate WinLirc server application"; // + // buttonCreateIRFiles + // + this.buttonCreateIRFiles.Location = new System.Drawing.Point(8, 208); + this.buttonCreateIRFiles.Name = "buttonCreateIRFiles"; + this.buttonCreateIRFiles.Size = new System.Drawing.Size(104, 24); + this.buttonCreateIRFiles.TabIndex = 3; + this.buttonCreateIRFiles.Text = "Create IR files"; + this.toolTips.SetToolTip(this.buttonCreateIRFiles, "Click here to make IR Command files for use with this plugin"); + this.buttonCreateIRFiles.UseVisualStyleBackColor = true; + this.buttonCreateIRFiles.Click += new System.EventHandler(this.buttonCreateIRFiles_Click); + // // Configure // 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(248, 241); + this.ClientSize = new System.Drawing.Size(248, 272); + this.Controls.Add(this.buttonCreateIRFiles); this.Controls.Add(this.numericUpDownButtonReleaseTime); this.Controls.Add(this.labelButtonReleaseTime); this.Controls.Add(this.groupBoxServerDetails); @@ -231,5 +244,6 @@ private System.Windows.Forms.Label labelButtonReleaseTime; private System.Windows.Forms.NumericUpDown numericUpDownButtonReleaseTime; private System.Windows.Forms.OpenFileDialog openFileDialog; + private System.Windows.Forms.Button buttonCreateIRFiles; } } \ No newline at end of file Modified: trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/Configure.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Receiver/Configure.cs 2007-08-23 13:19:30 UTC (rev 859) +++ trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/Configure.cs 2007-08-23 15:02:04 UTC (rev 860) @@ -7,7 +7,7 @@ using System.Net; using System.Windows.Forms; -namespace WinLircReceiver +namespace WinLircTransceiver { public partial class Configure : Form @@ -72,9 +72,13 @@ textBoxServerPath.Text = openFileDialog.FileName; } + private void buttonCreateIRFiles_Click(object sender, EventArgs e) + { + + } + #endregion Buttons - } } Added: trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/CreateIRFile.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/CreateIRFile.Designer.cs (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/CreateIRFile.Designer.cs 2007-08-23 15:02:04 UTC (rev 860) @@ -0,0 +1,38 @@ +namespace WinLircTransceiver +{ + partial class CreateIRFile + { + /// <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.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Text = "CreateIRFile"; + } + + #endregion + } +} \ No newline at end of file Added: trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/CreateIRFile.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/CreateIRFile.cs (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/CreateIRFile.cs 2007-08-23 15:02:04 UTC (rev 860) @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace WinLircTransceiver +{ + public partial class CreateIRFile : Form + { + public CreateIRFile() + { + InitializeComponent(); + } + } +} \ No newline at end of file Added: trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/CreateIRFile.resx =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/CreateIRFile.resx (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/CreateIRFile.resx 2007-08-23 15:02:04 UTC (rev 860) @@ -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 Modified: trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Receiver/Properties/AssemblyInfo.cs 2007-08-23 13:19:30 UTC (rev 859) +++ trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/Properties/AssemblyInfo.cs 2007-08-23 15:02:04 UTC (rev 860) @@ -6,11 +6,11 @@ // 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("WinLirc Receiver")] +[assembly: AssemblyTitle("WinLirc Transceiver")] [assembly: AssemblyDescription("IR Server plugin to support WinLirc")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("and-81")] -[assembly: AssemblyProduct("WinLircReceiver")] +[assembly: AssemblyProduct("WinLircTransceiver")] [assembly: AssemblyCopyright("Aaron Dinnage")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] Deleted: trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Receiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Receiver/WinLirc Receiver.cs 2007-08-23 13:19:30 UTC (rev 859) +++ trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Receiver.cs 2007-08-23 15:02:04 UTC (rev 860) @@ -1,195 +0,0 @@ -using System; -using System.Collections; -using System.ComponentModel; -using System.Diagnostics; -using System.IO; -using System.Net; -using System.Net.Sockets; -using System.Windows.Forms; -using System.Xml; - -using IRServerPluginInterface; - -namespace WinLircReceiver -{ - - public class WinLircReceiver : IRServerPlugin, IConfigure, IRemoteReceiver, ITransmitIR - { - - #region Constants - - static readonly string ConfigurationFile = - Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + - "\\IR Server Suite\\IR Server\\WinLirc Receiver.xml"; - - #endregion Constants - - #region Variables - - RemoteHandler _remoteButtonHandler = null; - WinLircServer _server; - - IPAddress _serverIP; - int _serverPort; - bool _startServer; - string _serverPath; - int _buttonReleaseTime; - - #endregion Variables - - #region Implementation - - public override string Name { get { return "WinLirc"; } } - public override string Version { get { return "1.0.3.3"; } } - public override string Author { get { return "and-81, original code for MediaPortal by Sven"; } } - public override string Description { get { return "Supports WinLirc as a reciever"; } } - - public override bool Start() - { - LoadSettings(); - - if (_startServer) - { - if (!WinLircServer.StartServer(_serverPath)) - return false; - } - - _server = new WinLircServer(_serverIP, _serverPort, TimeSpan.FromMilliseconds(_buttonReleaseTime)); - _server.CommandEvent += new WinLircServer.CommandEventHandler(CommandHandler); - - return true; - } - public override void Suspend() - { - Stop(); - } - public override void Resume() - { - Start(); - } - public override void Stop() - { - _server.CommandEvent -= new WinLircServer.CommandEventHandler(CommandHandler); - _server = null; - } - - public RemoteHandler RemoteCallback - { - get { return _remoteButtonHandler; } - set { _remoteButtonHandler = value; } - } - - public void Configure() - { - LoadSettings(); - - Configure config = new Configure(); - - config.ServerIP = _serverIP; - config.ServerPort = _serverPort; - config.StartServer = _startServer; - config.ServerPath = _serverPath; - config.ButtonReleaseTime = _buttonReleaseTime; - - if (config.ShowDialog() == DialogResult.OK) - { - _serverIP = config.ServerIP; - _serverPort = config.ServerPort; - _startServer = config.StartServer; - _serverPath = config.ServerPath; - _buttonReleaseTime = config.ButtonReleaseTime; - - SaveSettings(); - } - } - - public string[] AvailablePorts { get { return new string[] { "Default" }; } } - - public bool Transmit(string port, byte[] data) - { - string password, remoteName, buttonName, repeats; - - MemoryStream memoryStream = new MemoryStream(data); - - XmlDocument doc = new XmlDocument(); - doc.Load(memoryStream); - - password = doc.DocumentElement.Attributes["Password"].Value; - remoteName = doc.DocumentElement.Attributes["RemoteName"].Value; - buttonName = doc.DocumentElement.Attributes["ButtonName"].Value; - repeats = doc.DocumentElement.Attributes["Repeats"].Value; - - string output = String.Format("{0} {1} {2} {3}\n", password, remoteName, buttonName, repeats); - _server.Transmit(output); - - memoryStream.Close(); - - return true; - } - - void LoadSettings() - { - try - { - XmlDocument doc = new XmlDocument(); - doc.Load(ConfigurationFile); - - _serverIP = IPAddress.Parse(doc.DocumentElement.Attributes["ServerIP"].Value); - _serverPort = int.Parse(doc.DocumentElement.Attributes["ServerPort"].Value); - _startServer = bool.Parse(doc.DocumentElement.Attributes["StartServer"].Value); - _serverPath = doc.DocumentElement.Attributes["ServerPath"].Value; - _buttonReleaseTime = int.Parse(doc.DocumentElement.Attributes["ButtonReleaseTime"].Value); - } - catch (Exception ex) - { - Console.WriteLine(ex.ToString()); - - _serverIP = IPAddress.Parse("127.0.0.1"); - _serverPort = 8765; - _startServer = false; - _serverPath = "winlirc.exe"; - _buttonReleaseTime = 200; - } - } - void SaveSettings() - { - try - { - XmlTextWriter writer = new XmlTextWriter(ConfigurationFile, System.Text.Encoding.UTF8); - writer.Formatting = Formatting.Indented; - writer.Indentation = 1; - writer.IndentChar = (char)9; - writer.WriteStartDocument(true); - writer.WriteStartElement("settings"); // <settings> - - writer.WriteAttributeString("ServerIP", _serverIP.ToString()); - writer.WriteAttributeString("ServerPort", _serverPort.ToString()); - writer.WriteAttributeString("StartServer", _startServer.ToString()); - writer.WriteAttributeString("ServerPath", _serverPath); - writer.WriteAttributeString("ButtonReleaseTime", _buttonReleaseTime.ToString()); - - writer.WriteEndElement(); // </settings> - writer.WriteEndDocument(); - writer.Close(); - } - catch (Exception ex) - { - Console.WriteLine(ex.ToString()); - } - } - - void CommandHandler(WinLircServer.Command cmd) - { - if (_remoteButtonHandler == null) - return; - - string buttonCode = cmd.Remote + ": " + cmd.Button; - - _remoteButtonHandler(buttonCode); - } - - #endregion Implementation - - } - -} Deleted: trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Receiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Receiver/WinLirc Receiver.csproj 2007-08-23 13:19:30 UTC (rev 859) +++ trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Receiver.csproj 2007-08-23 15:02:04 UTC (rev 860) @@ -1,97 +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>{E6A68244-8C31-44A9-9F85-B4A102B5F209}</ProjectGuid> - <OutputType>Library</OutputType> - <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>WinLircReceiver</RootNamespace> - <AssemblyName>WinLirc Receiver</AssemblyName> - <RunPostBuildEvent>OnOutputUpdated</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> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> - <OutputPath>bin\x86\Debug\</OutputPath> - <DefineConstants>DEBUG</DefineConstants> - <TreatWarningsAsErrors>true</TreatWarningsAsErrors> - <DebugType>full</DebugType> - <PlatformTarget>x86</PlatformTarget> - <UseVSHostingProcess>false</UseVSHostingProcess> - <ErrorReport>prompt</ErrorReport> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> - <OutputPath>bin\x86\Release\</OutputPath> - <Optimize>true</Optimize> - <TreatWarningsAsErrors>true</TreatWarningsAsErrors> - <DebugType> - </DebugType> - <PlatformTarget>x86</PlatformTarget> - <UseVSHostingProcess>false</UseVSHostingProcess> - <ErrorReport>prompt</ErrorReport> - </PropertyGroup> - <ItemGroup> - <Reference Include="System" /> - <Reference Include="System.Data" /> - <Reference Include="System.Drawing" /> - <Reference Include="System.Windows.Forms" /> - <Reference Include="System.Xml" /> - </ItemGroup> - <ItemGroup> - <Compile Include="Configure.cs"> - <SubType>Form</SubType> - </Compile> - <Compile Include="Configure.Designer.cs"> - <DependentUpon>Configure.cs</DependentUpon> - </Compile> - <Compile Include="Properties\AssemblyInfo.cs" /> - <Compile Include="WinLirc Receiver.cs" /> - <Compile Include="WinLircServer.cs" /> - </ItemGroup> - <ItemGroup> - <ProjectReference Include="..\IR Server Plugin Interface\IR Server Plugin Interface.csproj"> - <Project>{D8B3D28F-62CE-4CA7-86CE-B7EAD614A94C}</Project> - <Name>IR Server Plugin Interface</Name> - <Private>False</Private> - </ProjectReference> - </ItemGroup> - <ItemGroup> - <EmbeddedResource Include="Configure.resx"> - <DependentUpon>Configure.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 "$(TargetFileName)" "\MediaPortal Development\Plugin Releases\IR Server Suite\IR Server Plugins\"</PostBuildEvent> - </PropertyGroup> -</Project> \ No newline at end of file Added: trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Transceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Transceiver.cs (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Transceiver.cs 2007-08-23 15:02:04 UTC (rev 860) @@ -0,0 +1,197 @@ +using System; +using System.Collections; +using System.ComponentModel; +using System.Diagnostics; +using System.IO; +using System.Net; +using System.Net.Sockets; +using System.Windows.Forms; +using System.Xml; + +using IRServerPluginInterface; + +namespace WinLircTransceiver +{ + + public class WinLircTransceiver : IRServerPlugin, IConfigure, IRemoteReceiver, ITransmitIR + { + + #region Constants + + static readonly string ConfigurationFile = + Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + + "\\IR Server Suite\\IR Server\\WinLirc Receiver.xml"; + + #endregion Constants + + #region Variables + + RemoteHandler _remoteButtonHandler = null; + WinLircServer _server; + + IPAddress _serverIP; + int _serverPort; + bool _startServer; + string _serverPath; + int _buttonReleaseTime; + + #endregion Variables + + #region Implementation + + public override string Name { get { return "WinLirc"; } } + public override string Version { get { return "1.0.3.3"; } } + public override string Author { get { return "and-81, original code for MediaPortal by Sven"; } } + public override string Description { get { return "Supports WinLirc as a Transciever"; } } + + public override bool Start() + { + LoadSettings(); + + if (_startServer) + { + if (!WinLircServer.StartServer(_serverPath)) + return false; + } + + _server = new WinLircServer(_serverIP, _serverPort, TimeSpan.FromMilliseconds(_buttonReleaseTime)); + _server.CommandEvent += new WinLircServer.CommandEventHandler(CommandHandler); + + return true; + } + public override void Suspend() + { + Stop(); + } + public override void Resume() + { + Start(); + } + public override void Stop() + { + _server.CommandEvent -= new WinLircServer.CommandEventHandler(CommandHandler); + _server = null; + } + + public RemoteHandler RemoteCallback + { + get { return _remoteButtonHandler; } + set { _remoteButtonHandler = value; } + } + + public void Configure() + { + LoadSettings(); + + Configure config = new Configure(); + + config.ServerIP = _serverIP; + config.ServerPort = _serverPort; + config.StartServer = _startServer; + config.ServerPath = _serverPath; + config.ButtonReleaseTime = _buttonReleaseTime; + + if (config.ShowDialog() == DialogResult.OK) + { + _serverIP = config.ServerIP; + _serverPort = config.ServerPort; + _startServer = config.StartServer; + _serverPath = config.ServerPath; + _buttonReleaseTime = config.ButtonReleaseTime; + + SaveSettings(); + } + } + + public string[] AvailablePorts { get { return new string[] { "Default" }; } } + + public bool Transmit(string port, byte[] data) + { + string password, remoteName, buttonName, repeats; + + MemoryStream memoryStream = new MemoryStream(data); + + XmlDocument doc = new XmlDocument(); + doc.Load(memoryStream); + + password = doc.DocumentElement.Attributes["Password"].Value; + remoteName = doc.DocumentElement.Attributes["RemoteName"].Value; + buttonName = doc.DocumentElement.Attributes["ButtonName"].Value; + repeats = doc.DocumentElement.Attributes["Repeats"].Value; + + string output = String.Format("{0} {1} {2} {3}\n", password, remoteName, buttonName, repeats); + + MessageBox.Show(output); + _server.Transmit(output); + + memoryStream.Close(); + + return true; + } + + void LoadSettings() + { + try + { + XmlDocument doc = new XmlDocument(); + doc.Load(ConfigurationFile); + + _serverIP = IPAddress.Parse(doc.DocumentElement.Attributes["ServerIP"].Value); + _serverPort = int.Parse(doc.DocumentElement.Attributes["ServerPort"].Value); + _startServer = bool.Parse(doc.DocumentElement.Attributes["StartServer"].Value); + _serverPath = doc.DocumentElement.Attributes["ServerPath"].Value; + _buttonReleaseTime = int.Parse(doc.DocumentElement.Attributes["ButtonReleaseTime"].Value); + } + catch (Exception ex) + { + Console.WriteLine(ex.ToString()); + + _serverIP = IPAddress.Parse("127.0.0.1"); + _serverPort = 8765; + _startServer = false; + _serverPath = "winlirc.exe"; + _buttonReleaseTime = 200; + } + } + void SaveSettings() + { + try + { + XmlTextWriter writer = new XmlTextWriter(ConfigurationFile, System.Text.Encoding.UTF8); + writer.Formatting = Formatting.Indented; + writer.Indentation = 1; + writer.IndentChar = (char)9; + writer.WriteStartDocument(true); + writer.WriteStartElement("settings"); // <settings> + + writer.WriteAttributeString("ServerIP", _serverIP.ToString()); + writer.WriteAttributeString("ServerPort", _serverPort.ToString()); + writer.WriteAttributeString("StartServer", _startServer.ToString()); + writer.WriteAttributeString("ServerPath", _serverPath); + writer.WriteAttributeString("ButtonReleaseTime", _buttonReleaseTime.ToString()); + + writer.WriteEndElement(); // </settings> + writer.WriteEndDocument(); + writer.Close(); + } + catch (Exception ex) + { + Console.WriteLine(ex.ToString()); + } + } + + void CommandHandler(WinLircServer.Command cmd) + { + if (_remoteButtonHandler == null) + return; + + string buttonCode = cmd.Remote + ": " + cmd.Button; + + _remoteButtonHandler(buttonCode); + } + + #endregion Implementation + + } + +} Added: trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Transceiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Transceiver.csproj (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLirc Transceiver.csproj 2007-08-23 15:02:04 UTC (rev 860) @@ -0,0 +1,103 @@ +<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>{E6A68244-8C31-44A9-9F85-B4A102B5F209}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>WinLircTransceiver</RootNamespace> + <AssemblyName>WinLirc Transceiver</AssemblyName> + <RunPostBuildEvent>OnOutputUpdated</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> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> + <OutputPath>bin\x86\Debug\</OutputPath> + <DefineConstants>DEBUG</DefineConstants> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + <DebugType>full</DebugType> + <PlatformTarget>x86</PlatformTarget> + <UseVSHostingProcess>false</UseVSHostingProcess> + <ErrorReport>prompt</ErrorReport> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> + <OutputPath>bin\x86\Release\</OutputPath> + <Optimize>true</Optimize> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + <DebugType> + </DebugType> + <PlatformTarget>x86</PlatformTarget> + <UseVSHostingProcess>false</UseVSHostingProcess> + <ErrorReport>prompt</ErrorReport> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Configure.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="Configure.Designer.cs"> + <DependentUpon>Configure.cs</DependentUpon> + </Compile> + <Compile Include="CreateIRFile.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="CreateIRFile.Designer.cs"> + <DependentUpon>CreateIRFile.cs</DependentUpon> + </Compile> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="WinLirc Transceiver.cs" /> + <Compile Include="WinLircServer.cs" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\IR Server Plugin Interface\IR Server Plugin Interface.csproj"> + <Project>{D8B3D28F-62CE-4CA7-86CE-B7EAD614A94C}</Project> + <Name>IR Server Plugin Interface</Name> + <Private>False</Private> + </ProjectReference> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="Configure.resx"> + <DependentUpon>Configure.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 "$(TargetFileName)" "\MediaPortal Development\Plugin Releases\IR Server Suite\IR Server Plugins\"</PostBuildEvent> + </PropertyGroup> +</Project> \ No newline at end of file Modified: trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLircServer.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Receiver/WinLircServer.cs 2007-08-23 13:19:30 UTC (rev 859) +++ trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Transceiver/WinLircServer.cs 2007-08-23 15:02:04 UTC (rev 860) @@ -31,7 +31,7 @@ using System.Net.Sockets; using System.Diagnostics; -namespace WinLircReceiver +namespace WinLircTransceiver { /// <summary> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rs...@us...> - 2007-08-23 13:19:59
|
Revision: 859 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=859&view=rev Author: rsparey Date: 2007-08-23 06:19:30 -0700 (Thu, 23 Aug 2007) Log Message: ----------- Updated radio guide.. added cd_box.png for music film strip Modified Paths: -------------- trunk/skins/Foofaraw/Development Skin/Foofaraw/Media/DefaultFolderBackBig.png trunk/skins/Foofaraw/Development Skin/Foofaraw/Media/defaultFolderBack.png trunk/skins/Foofaraw/Development Skin/Foofaraw/mymusicsongs.xml trunk/skins/Foofaraw/Development Skin/Foofaraw/myradioguide.xml trunk/skins/Foofaraw/Development Skin/Foofaraw/mytvguide.xml trunk/skins/Foofaraw/Development Skin/Foofaraw/release notes.xml Added Paths: ----------- trunk/skins/Foofaraw/Development Skin/Foofaraw/Media/cd_box.png Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/Media/DefaultFolderBackBig.png =================================================================== (Binary files differ) Added: trunk/skins/Foofaraw/Development Skin/Foofaraw/Media/cd_box.png =================================================================== (Binary files differ) Property changes on: trunk/skins/Foofaraw/Development Skin/Foofaraw/Media/cd_box.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/Media/defaultFolderBack.png =================================================================== (Binary files differ) Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/mymusicsongs.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/mymusicsongs.xml 2007-08-23 00:58:47 UTC (rev 858) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/mymusicsongs.xml 2007-08-23 13:19:30 UTC (rev 859) @@ -281,14 +281,59 @@ <onright>2</onright> <onup>2</onup> <ondown>50</ondown> - <!--<posX>60</posX> - <itemWidth>200</itemWidth> - <itemHeight>200</itemHeight> - <textureWidth>160</textureWidth> - <textureHeight>160</textureHeight> - <thumbWidth>150</thumbWidth> - <thumbHeight>100</thumbHeight>--> - <InfoImage flipY="true" diffuse="Thumb_Mask.png"/> + <itemWidth>120</itemWidth> + <itemHeight>220</itemHeight> + <textureWidth>220</textureWidth> + <textureHeight>220</textureHeight> + <thumbWidth>101</thumbWidth> + <thumbHeight>101</thumbHeight> + <thumbPosX>15</thumbPosX><!-- 10 --> + <thumbPosY>40</thumbPosY><!-- 10 --> + <imageFolder>icon_empty_nofocus_music.png</imageFolder> + <imageFolderFocus>icon_empty_focus_music.png</imageFolderFocus> + <font>-</font> + <selectedColor>ffffffff</selectedColor> + <textcolor>white</textcolor> + <colordiffuse>ffffffff</colordiffuse> + <remoteColor>ffFFA075</remoteColor> + <downloadColor>ff80ff80</downloadColor> + <suffix>|</suffix> + <textureWidthBig>100</textureWidthBig> + <textureHeightBig>100</textureHeightBig> + <itemWidthBig>100</itemWidthBig> + <itemHeightBig>100</itemHeightBig> + <thumbWidthBig>84</thumbWidthBig> + <thumbHeightBig>84</thumbHeightBig> + <thumbPosXBig>0</thumbPosXBig> + <thumbPosYBig>0</thumbPosYBig> + <background>-</background> + <backgroundx>915</backgroundx> + <backgroundy>130</backgroundy> + <backgroundwidth>320</backgroundwidth> + <backgroundheight>460</backgroundheight> + <backgrounddiffuse>60ffffff</backgrounddiffuse> + <InfoImage>-</InfoImage> + <InfoImagex>100</InfoImagex> + <InfoImagey>135</InfoImagey> + <InfoImagewidth>310</InfoImagewidth> + <InfoImageheight>450</InfoImageheight> + <InfoImagediffuse>ffffffff</InfoImagediffuse> + + + + <frame>cd_box.png</frame> + <frameFocus>cd_box.png</frameFocus> + <textureWidth>120</textureWidth> + <textureHeight>240</textureHeight> + <showFrame>yes</showFrame> + <showFolder>no</showFolder> + <showBackGround>no</showBackGround> + <showInfoImage>no</showInfoImage> + <enableFocusZoom>no</enableFocusZoom> + <thumbs flipY="true" diffuse="Thumb_Mask.png"/> + + <InfoImage flipY="true" diffuse="Thumb_Mask.png"/> + <animation effect="fade" time="500">delay="1300">WindowOpen</animation> </control> </control> Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/myradioguide.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/myradioguide.xml 2007-08-23 00:58:47 UTC (rev 858) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/myradioguide.xml 2007-08-23 13:19:30 UTC (rev 859) @@ -4,14 +4,44 @@ <defaultcontrol>2</defaultcontrol> <allowoverlay>no</allowoverlay> <controls> - - <control> - <description>BG</description> + <import>common.window.xml</import> + <import>common.time.xml</import> + + <control> <type>image</type> + <decription>mid_strip</decription> <id>1</id> - <width>1366</width> - <height>768</height> + <posX>12</posX> + <posY>186</posY> + <width>1342</width> + <height>365</height> + <texture>mid_strip.png</texture> + <animation effect="zoom" start="100,100" end="100,135" center="12,186" time="1000" acceleration ="-1" >WindowOpen</animation> + <animation effect="zoom" start="100,135" end="100,100" center="12,186" time="1000" acceleration ="-1" >WindowClose</animation> </control> + <control> + <type>image</type> + <decription>bottom_strip</decription> + <id>1</id> + <posX>12</posX> + <posY>547</posY> + <width>1342</width> + <height>18</height> + <texture>bottom_strip.png</texture> + <animation effect="slide" time="1000" start="0,0" end="0,130" acceleration="-1" >WindowOpen</animation> + <animation effect="slide" time="1000" start="0,130" end="0,0" acceleration="-1" >WindowClose</animation> + </control> + <control> + <type>image</type> + <decription>top-strip</decription> + <id>1</id> + <posX>12</posX> + <posY>155</posY> + <width>1342</width> + <height>36</height> + <texture>top-strip.png</texture> + + </control> <control> <description>icon background</description> @@ -64,13 +94,13 @@ <control> - <description>TVGUIDE Panel</description> + <description>RADIO GUIDE Panel</description> <type>image</type> <id>2</id> - <posX>113</posX> - <posY>120</posY> - <width>1140</width> - <height>440</height> + <posX>5</posX> + <posY>200</posY> + <width>1322</width> + <height>300</height> <colordiffuse>60ffffff</colordiffuse> <texture>-</texture> <animation effect="fade" time="250">WindowOpen</animation> @@ -82,11 +112,11 @@ <description>time header background image template</description> <type>image</type> <id>90</id> - <posX>352</posX> - <posY>120</posY> - <width>153</width> - <height>37</height> - <texture>button_small_settings_nofocus.png</texture> + <posX>200</posX> + <posY>155</posY> + <width>209</width> + <height>36</height> + <texture>tab_up.png</texture> <animation effect="fade" time="250">WindowOpen</animation> <animation effect="fade" time="500">WindowClose</animation> </control> @@ -94,21 +124,21 @@ <description>time header label template</description> <type>label</type> <id>40</id> - <posX>352</posX> - <posY>120</posY> + <posX>200</posX> + <posY>155</posY> <font>font13</font> <textcolor>FFB2D4F5</textcolor> <animation effect="fade" time="250">WindowOpen</animation> <animation effect="fade" time="500">WindowClose</animation> </control> - <control> + <control> <description>day spin control</description> <type>spincontrol</type> <id>6</id> <width>24</width> <height>24</height> - <posX>119</posX> - <posY>122</posY> + <posX>43</posX> + <posY>160</posY> <showrange>no</showrange> <orientation>horizontal</orientation> <align>center</align> @@ -121,33 +151,15 @@ <animation effect="fade" time="250">WindowOpen</animation> <animation effect="fade" time="500">WindowClose</animation> </control> + + <control> - <description>time interval spin control</description> - <type>spincontrol</type> - <id>8</id> - <width>24</width> - <height>24</height> - <posX>313</posX> - <posY>128</posY> - <showrange>no</showrange> - <orientation>vertical</orientation> - <align>center</align> - <textureUp>arrow_round_up_nofocus.png</textureUp> - <textureDown>arrow_round_down_nofocus.png</textureDown> - <textureUpFocus>arrow_round_up_focus.png</textureUpFocus> - <textureDownFocus>arrow_round_down_focus.png</textureDownFocus> - <onleft>6</onleft> - <onright>8</onright> - <animation effect="fade" time="250">WindowOpen</animation> - <animation effect="fade" time="500">WindowClose</animation> - </control> - <control> <description>Channel template</description> <type>image</type> <id>20</id> - <posX>117</posX> - <posY>166</posY> - <width>240</width> + <posX>50</posX> + <posY>200</posY> + <width>155</width> <height>35</height> <animation effect="fade" time="250">WindowOpen</animation> <animation effect="fade" time="500">WindowClose</animation> @@ -156,8 +168,9 @@ <description>Channel image template</description> <type>image</type> <id>7</id> - <width>42</width> - <height>42</height> + <width>36</width> + <height>32</height> + <zoom>no</zoom> <keepaspectratio>yes</keepaspectratio> <zoom>yes</zoom> <texture>defaultVideoBig.png</texture> @@ -168,7 +181,7 @@ <description>channel Label template</description> <type>label</type> <id>18</id> - <posX>66</posX> + <posX>40</posX> <posY>6</posY> <width>86</width> <height>20</height> @@ -181,8 +194,8 @@ <description>Current program title</description> <type>fadelabel</type> <id>13</id> - <posX>374</posX> - <posY>574</posY> + <posX>200</posX> + <posY>500</posY> <width>666</width> <label>#Radio.Guide.Title</label> <font>font16</font> @@ -194,8 +207,8 @@ <description>Current program time</description> <type>label</type> <id>14</id> - <posX>374</posX> - <posY>720</posY> + <posX>50</posX> + <posY>505</posY> <label>#Radio.Guide.Time</label> <align>left</align> <font>font16</font> @@ -220,9 +233,9 @@ <description>Description1</description> <type>textboxscrollup</type> <id>15</id> - <posX>374</posX> - <posY>614</posY> - <width>879</width> + <posX>50</posX> + <posY>550</posY> + <width>1300</width> <height>93</height> <seperator>----------------------------------------------------------------------------------------------</seperator> <label>#Radio.Guide.Description</label> @@ -254,9 +267,9 @@ <description>vertical timeline</description> <type>image</type> <id>25</id> - <posX>56</posX> - <posY>165</posY> - <height>381</height> + <posX>55</posX> + <posY>200</posY> + <height>280</height> <colordiffuse>c0ffffff</colordiffuse> <texture>tvguide_slider.png</texture> <animation effect="fade" time="250">WindowOpen</animation> @@ -282,43 +295,20 @@ <font>font13</font> <textcolor>FFFFFFFF</textcolor> </control> --> + <control> - <description>Horizontal scrollbar</description> - <type>hscrollbar</type> - <id>28</id> - <posX>115</posX> - <posY>550</posY> - <width>1132</width> - <height>24</height> - <visible>yes</visible> - <animation effect="fade" time="250">WindowOpen</animation> - <animation effect="fade" time="500">WindowClose</animation> - </control> - <control> - <description>Vertical scrollbar</description> - <type>vscrollbar</type> - <id>29</id> - <posX>1261</posX> - <posY>166</posY> - <width>26</width> - <height>409</height> - <visible>yes</visible> - <animation effect="fade" time="250">WindowOpen</animation> - <animation effect="fade" time="500">WindowClose</animation> - </control> - <control> <description>record pin</description> <type>image</type> <id>31</id> - <posX>834</posX> - <posY>706</posY> + <posX>20</posX> + <posY>503</posY> <texture>tvguide_record_button.png</texture> <visible>no</visible> <animation effect="fade" time="250">WindowOpen</animation> <animation effect="fade" time="500">WindowClose</animation> </control> - <import>common.time.xml</import> + </controls> </window> \ No newline at end of file Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/mytvguide.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/mytvguide.xml 2007-08-23 00:58:47 UTC (rev 858) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/mytvguide.xml 2007-08-23 13:19:30 UTC (rev 859) @@ -203,7 +203,7 @@ <id>20</id> <posX>50</posX> <posY>200</posY> - <width>240</width> + <width>155</width> <height>35</height> <animation effect="fade" time="250">WindowOpen</animation> <animation effect="fade" time="500">WindowClose</animation> @@ -223,7 +223,7 @@ <description>channel Label template</description> <type>label</type> <id>18</id> - <posX>66</posX> + <posX>40</posX> <posY>6</posY> <width>86</width> <height>20</height> Modified: trunk/skins/Foofaraw/Development Skin/Foofaraw/release notes.xml =================================================================== --- trunk/skins/Foofaraw/Development Skin/Foofaraw/release notes.xml 2007-08-23 00:58:47 UTC (rev 858) +++ trunk/skins/Foofaraw/Development Skin/Foofaraw/release notes.xml 2007-08-23 13:19:30 UTC (rev 859) @@ -9,5 +9,6 @@ updated tv genres page updated tv channels updated tv guide +Updated radio guide.. +added cd_box.png for music film strip - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gre...@us...> - 2007-08-23 00:58:49
|
Revision: 858 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=858&view=rev Author: gregmac45 Date: 2007-08-22 17:58:47 -0700 (Wed, 22 Aug 2007) Log Message: ----------- change the length to string in VideoInfo Added GenericSiteUtil to handle rss with video links Modified Paths: -------------- trunk/plugins/OnlineVideos/Source/OnlineVideos/DailyMotionUtil.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/Favorites.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/GUIOnlineVideos.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/GoogleVideoUtil.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/MetaCafeUtil.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideos.csproj trunk/plugins/OnlineVideos/Source/OnlineVideos/SiteUtilBase.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/YouTubeUtil.cs Added Paths: ----------- trunk/plugins/OnlineVideos/Source/OnlineVideos/GenericSiteUtil.cs Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/DailyMotionUtil.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/DailyMotionUtil.cs 2007-08-22 23:07:31 UTC (rev 857) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/DailyMotionUtil.cs 2007-08-23 00:58:47 UTC (rev 858) @@ -49,7 +49,7 @@ video.Description = rssItem.description; video.ImageUrl = rssItem.mediaThumbnail; video.Title = rssItem.title; - video.Length = Convert.ToInt32(rssItem.contentList[0].duration); + video.Length = rssItem.contentList[0].duration; video.VideoUrl = rssItem.guid; loVideoList.Add(video); } Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/Favorites.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/Favorites.cs 2007-08-22 23:07:31 UTC (rev 857) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/Favorites.cs 2007-08-23 00:58:47 UTC (rev 858) @@ -183,7 +183,7 @@ GUIOnlineVideos.VideoInfo video = new GUIOnlineVideos.FavoriteVideoInfo(); video.Description = DatabaseUtility.Get(loResultSet, iRow, "VDO_DESC"); video.ImageUrl = DatabaseUtility.Get(loResultSet, iRow, "VDO_IMG_URL"); - video.Length = DatabaseUtility.GetAsInt(loResultSet, iRow, "VDO_LENGTH"); + video.Length = DatabaseUtility.Get(loResultSet, iRow, "VDO_LENGTH"); video.Tags = DatabaseUtility.Get(loResultSet, iRow, "VDO_TAGS"); video.Title = DatabaseUtility.Get(loResultSet, iRow, "VDO_NM"); video.VideoUrl = DatabaseUtility.Get(loResultSet,iRow,"VDO_URL"); @@ -226,7 +226,7 @@ GUIOnlineVideos.VideoInfo video = new GUIOnlineVideos.FavoriteVideoInfo(); video.Description = DatabaseUtility.Get(loResultSet, iRow, "VDO_DESC"); video.ImageUrl = DatabaseUtility.Get(loResultSet, iRow, "VDO_IMG_URL"); - video.Length = DatabaseUtility.GetAsInt(loResultSet, iRow, "VDO_LENGTH"); + video.Length = DatabaseUtility.Get(loResultSet, iRow, "VDO_LENGTH"); video.Tags = DatabaseUtility.Get(loResultSet, iRow, "VDO_TAGS"); video.Title = DatabaseUtility.Get(loResultSet, iRow, "VDO_NM"); video.VideoUrl = DatabaseUtility.Get(loResultSet,iRow,"VDO_URL"); Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/GUIOnlineVideos.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/GUIOnlineVideos.cs 2007-08-22 23:07:31 UTC (rev 857) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/GUIOnlineVideos.cs 2007-08-23 00:58:47 UTC (rev 858) @@ -79,14 +79,14 @@ public String Description = ""; public String VideoUrl = ""; public String ImageUrl = ""; - public int Length; + public String Length; public String Tags = ""; public Object Other; public string SiteID = ""; public int VideoID; public VideoInfo() { - Length = -1; + //Length = -1; VideoID = -1; } } @@ -894,7 +894,7 @@ }else{ GUIPropertyManager.SetProperty("#tags", foVideo.Tags); } - TimeSpan t = TimeSpan.FromSeconds(foVideo.Length); + TimeSpan t = TimeSpan.FromSeconds(Convert.ToDouble(foVideo.Length)); GUIPropertyManager.SetProperty("#length", t.ToString()); if(String.IsNullOrEmpty(foVideo.Description)){ GUIPropertyManager.SetProperty("#desc", "None"); Added: trunk/plugins/OnlineVideos/Source/OnlineVideos/GenericSiteUtil.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/GenericSiteUtil.cs (rev 0) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/GenericSiteUtil.cs 2007-08-23 00:58:47 UTC (rev 858) @@ -0,0 +1,111 @@ +/* + * Created by SharpDevelop. + * User: GZamor1 + * Date: 8/22/2007 + * Time: 4:13 PM + * + * To change this template use Tools | Options | Coding | Edit Standard Headers. + */ + +using System; +using System.Collections.Generic; +using System.Collections; +using System.Xml; +using System.Text; + +using MediaPortal.GUI.Library; +using MediaPortal.Configuration; + +namespace OnlineVideos +{ + /// <summary> + /// Description of GenericSiteUtil. + /// </summary> + public class GenericSiteUtil:SiteUtilBase + { + ArrayList m_VideoExtensions = new ArrayList(); + public GenericSiteUtil(){ + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + { + String strTmp = xmlreader.GetValueAsString("movies", "extensions", ".avi,.mpg,.ogm,.mpeg,.mkv,.wmv,.ifo,.qt,.rm,.mov,.sbe,.dvr-ms,.ts"); + String [] tok = strTmp.Split( ','); + foreach (string extension in tok) + { + m_VideoExtensions.Add(extension.ToLower()); + } + } + + } + public override string getSiteId() + { + return "50"; + } + + protected override String getUrl(String fsId) + { + return fsId; + } + public override List<GUIOnlineVideos.VideoInfo> getVideoList(string fsUrl) + { + List<RssItem> loRssItemList = getRssDataItems(fsUrl); + List<GUIOnlineVideos.VideoInfo> loVideoList = new List<GUIOnlineVideos.VideoInfo>(); + GUIOnlineVideos.VideoInfo video; + foreach(RssItem rssItem in loRssItemList){ + video = new GUIOnlineVideos.VideoInfo(); + if(!String.IsNullOrEmpty(rssItem.description)){ + video.Description = rssItem.description; + }else{ + video.Description = rssItem.mediaDescription; + } + if(!String.IsNullOrEmpty(rssItem.mediaThumbnail)){ + video.ImageUrl = rssItem.mediaThumbnail; + } + else if(!String.IsNullOrEmpty(rssItem.exInfoImage)){ + video.ImageUrl = rssItem.exInfoImage; + } + //get the video + if(!String.IsNullOrEmpty(rssItem.enclosure)&& isPossibleVideo(rssItem.enclosure)){ + video.VideoUrl = rssItem.enclosure; + video.Length = rssItem.enclosureDuration; + } + else if(rssItem.contentList.Count>0){ + foreach(MediaContent content in rssItem.contentList){ + if(isPossibleVideo(content.url)){ + video.VideoUrl = content.url; + video.Length = content.duration; + break; + } + + } + + + } + //if(!String.IsNullOrEmpty()){ + + //} + //if(!String.IsNullOrEmpty()){ + + //} + + + video.Title = rssItem.title; + + if(String.IsNullOrEmpty(video.VideoUrl)==false){ + + loVideoList.Add(video); + } + } + return loVideoList; + } + private bool isPossibleVideo(string fsUrl){ + string extensionFile = System.IO.Path.GetExtension(fsUrl).ToLower(); + if(String.IsNullOrEmpty(extensionFile))return true; + foreach (string extension in m_VideoExtensions) + { + if (extension == extensionFile) return true; + } + return false; + + } + } +} Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/GoogleVideoUtil.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/GoogleVideoUtil.cs 2007-08-22 23:07:31 UTC (rev 857) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/GoogleVideoUtil.cs 2007-08-23 00:58:47 UTC (rev 858) @@ -51,7 +51,7 @@ }else if(content.type.Contains("flv")){ flvUrl = content.url; Log.Info("flv url:{0}", content.url); - video.Length = Convert.ToInt32(content.duration); + video.Length = content.duration; } else if (content.type.Contains("mp4")) { Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/MetaCafeUtil.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/MetaCafeUtil.cs 2007-08-22 23:07:31 UTC (rev 857) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/MetaCafeUtil.cs 2007-08-23 00:58:47 UTC (rev 858) @@ -47,7 +47,7 @@ video.Description = rssItem.description; video.ImageUrl = rssItem.mediaThumbnail; video.Title = rssItem.title; - video.Length = Convert.ToInt32(rssItem.contentList[0].duration); + video.Length = rssItem.contentList[0].duration; video.VideoUrl = Regex.Match(rssItem.link,@"watch/([\d]*)").Groups[1].Value; loVideoList.Add(video); Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideos.csproj =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideos.csproj 2007-08-22 23:07:31 UTC (rev 857) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideos.csproj 2007-08-23 00:58:47 UTC (rev 858) @@ -82,6 +82,7 @@ <Compile Include="Favorites.cs" /> <Compile Include="FavoriteUtil.cs" /> <Compile Include="FavoriteVideo.cs" /> + <Compile Include="GenericSiteUtil.cs" /> <Compile Include="OnlineVideoSettings.cs" /> <Compile Include="RocketboomUtil.cs" /> <Compile Include="MyVideodeUtil.cs" /> Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/SiteUtilBase.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/SiteUtilBase.cs 2007-08-22 23:07:31 UTC (rev 857) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/SiteUtilBase.cs 2007-08-23 00:58:47 UTC (rev 858) @@ -225,6 +225,7 @@ if(n.Attributes["duration"]!=null){ loRssItem.enclosureDuration = n.Attributes["duration"].Value; } + break; case "media:category": loRssItem.mediaCategory = n.InnerText; Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/YouTubeUtil.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/YouTubeUtil.cs 2007-08-22 23:07:31 UTC (rev 857) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/YouTubeUtil.cs 2007-08-23 00:58:47 UTC (rev 858) @@ -127,7 +127,7 @@ Regex loRegex2 = new Regex("http://youtube.com/[?]v=([^<]*)"); video.VideoUrl = loRegex2.Match(rssItem.link).Groups[1].Value; video.Tags = rssItem.mediaCategory; - video.Length = Convert.ToInt32(rssItem.enclosureDuration); + video.Length = rssItem.enclosureDuration; loVideoList.Add(video); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gre...@us...> - 2007-08-22 23:07:37
|
Revision: 857 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=857&view=rev Author: gregmac45 Date: 2007-08-22 16:07:31 -0700 (Wed, 22 Aug 2007) Log Message: ----------- Added search for AppleTrailers Added Remove Favorites from local db Fixed thumbnails always downloaded bug Using JW Media Player swf to play FLVs Added ability to seek when in fullscreen using the arrows Modified Paths: -------------- trunk/plugins/OnlineVideos/Source/OnlineVideos/FavoriteUtil.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/Favorites.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/GUIOnlineVideos.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/ImageDowloader.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesTrailerUtil.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/AppleTrailers.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/ItmsContent.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/ItmsHelper.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/TrailerIndex.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/Main.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/SiteUtilBase.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/YouTubeUtil.cs Added Paths: ----------- trunk/plugins/OnlineVideos/Source/OnlineVideos/Configuration.resx Added: trunk/plugins/OnlineVideos/Source/OnlineVideos/Configuration.resx =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/Configuration.resx (rev 0) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/Configuration.resx 2007-08-22 23:07:31 UTC (rev 857) @@ -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 Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/FavoriteUtil.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/FavoriteUtil.cs 2007-08-22 15:01:30 UTC (rev 856) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/FavoriteUtil.cs 2007-08-22 23:07:31 UTC (rev 857) @@ -47,7 +47,7 @@ } public override List<GUIOnlineVideos.VideoInfo> getVideoList(string fsUrl) { - + fsUrl = fsUrl.Substring(4); FavoritesDatabase db = FavoritesDatabase.getInstance(); List<GUIOnlineVideos.VideoInfo> loVideoList; if(String.IsNullOrEmpty(fsUrl)){ @@ -67,7 +67,7 @@ { GUIOnlineVideos.RssLink all = new GUIOnlineVideos.RssLink(); all.name = "All"; - all.url = ""; + all.url = "fav:"; List<OnlineVideos.GUIOnlineVideos.RssLink> cats = new List<OnlineVideos.GUIOnlineVideos.RssLink>(); cats.Add(all); @@ -80,13 +80,13 @@ loSite = loSiteList[lsSiteId]; cat = new GUIOnlineVideos.RssLink(); cat.name = loSite.name+"-Favorites"; - cat.url = loSite.id; + cat.url = "fav:"+loSite.id; cats.Add(cat); } cat = new GUIOnlineVideos.RssLink(); cat.name = "Search-Favorites"; - cat.url = "%{0}"; + cat.url = "fav:%{0}"; cats.Add(cat); //SiteUtilFactory.getSiteUtil( Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/Favorites.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/Favorites.cs 2007-08-22 15:01:30 UTC (rev 856) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/Favorites.cs 2007-08-22 23:07:31 UTC (rev 857) @@ -82,7 +82,7 @@ } try { - m_db.Execute("CREATE TABLE FAVORITE_VIDEOS(VDO_NM text,VDO_URL text,VDO_DESC text,VDO_TAGS text,VDO_LENGTH text,VDO_OTHER_NFO text,VDO_IMG_URL text,VDO_SITE_ID text)\n"); + m_db.Execute("CREATE TABLE FAVORITE_VIDEOS(VDO_ID integer primary key autoincrement,VDO_NM text,VDO_URL text,VDO_DESC text,VDO_TAGS text,VDO_LENGTH text,VDO_OTHER_NFO text,VDO_IMG_URL text,VDO_SITE_ID text)\n"); //m_db.Execute("CREATE TABLE FAVORITE(FAVORITE_ID integer primary key,FAVORITE_NM text)\n"); @@ -138,16 +138,11 @@ } - public bool removeFavoriteVideo(GUIOnlineVideos.FavoriteVideoInfo foVideo, GUIOnlineVideos.Site foSite) + public bool removeFavoriteVideo(GUIOnlineVideos.VideoInfo foVideo) { - /* - string lsSQL = String.Format("select FAVORITE_ID from FAVORITE where FAVORITE_NM='{0}'", fsFavoriteNm.Replace("'", "''")); - SQLiteResultSet loResultSet = m_db.Execute(lsSQL); - - string lsFavID = (String)loResultSet.GetColumn(0)[0]; - //Log.Info("fav id = {0}",lsFavID); - //Log.Info("song id = {0}", foVideo.songId); - lsSQL = string.Format("delete from FAVORITE_VIDEOS where SONG_ID='{0}' and FAVORITE_ID = {1}", foVideo.songId, lsFavID); + + + String lsSQL = string.Format("delete from FAVORITE_VIDEOS where VDO_ID='{0}' ", foVideo.VideoID); m_db.Execute(lsSQL); if (m_db.ChangedRows() > 0) { @@ -157,8 +152,8 @@ { return false; } - */ - return false; + + } @@ -193,7 +188,7 @@ video.Title = DatabaseUtility.Get(loResultSet, iRow, "VDO_NM"); video.VideoUrl = DatabaseUtility.Get(loResultSet,iRow,"VDO_URL"); video.SiteID = DatabaseUtility.Get(loResultSet,iRow,"VDO_SITE_ID"); - + video.VideoID = DatabaseUtility.GetAsInt(loResultSet,iRow,"VDO_ID"); Log.Info("Pulled {0} out of the database",video.Title); loFavoriteList.Add(video); Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/GUIOnlineVideos.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/GUIOnlineVideos.cs 2007-08-22 15:01:30 UTC (rev 856) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/GUIOnlineVideos.cs 2007-08-22 23:07:31 UTC (rev 857) @@ -83,9 +83,11 @@ public String Tags = ""; public Object Other; public string SiteID = ""; + public int VideoID; public VideoInfo() { Length = -1; + VideoID = -1; } } public class FavoriteVideoInfo:VideoInfo @@ -236,6 +238,7 @@ if (dlgSel != null) { dlgSel.Add("Save"); // Save + Log.Info("msSelectedCategoryValue = "+msSelectedCategoryValue); if(msSelectedCategoryValue.StartsWith("fav:") ==false){ dlgSel.Add("Add to favorites"); } @@ -265,9 +268,10 @@ siteUtil.AddFavorite(moCurrentVideoList[liSelected],msSelectedSiteId); }else{ - siteUtil.removeFavorite(moCurrentVideoList[liSelected].VideoUrl,loSite.username,loSite.password); + siteUtil.RemoveFavorite(moCurrentVideoList[liSelected]); + DisplayVideos(true); } - break; + break; case 3: //Log.Info("Getting related videos on {0} using tags:{1}",SiteUtilFactory.getSiteUtil(msSelectedSiteId),moCurrentVideoList[liSelected].Tags); SiteUtilBase site = SiteUtilFactory.getSiteUtil(msSelectedSiteId); @@ -282,7 +286,7 @@ } DisplayVideos(false); break; - + } base.OnShowContextMenu(); } @@ -304,8 +308,6 @@ _CurrentState = State.home; return; } - }else{ - Log.Info("Action:"+action.wID); } base.OnAction(action); } @@ -521,7 +523,7 @@ facadeView.Add(loListItem); //loSiteUtil.getSiteFavorites(); } - */ + */ } /* private bool isSiteFavoriteEnabled(){ @@ -529,7 +531,7 @@ SiteUtilBase loSiteUtil = SiteUtilFactory.getSiteUtil(msSelectedSiteId); return (loSiteUtil.isSiteFavoritesEnabled() && String.IsNullOrEmpty(loSite.username) == false); } - */ + */ private void DisplayVideos(bool fbRefresh) { List<VideoInfo> loListItems; @@ -657,6 +659,10 @@ DisplayVideoInfo(moCurrentVideoList[item.ItemId-1]); } } + public void OnAction2(Action foAction){ + Log.Info("MyFlashPlayer received action:"+foAction.wID); + } + private bool GetUserInputString(ref string sString) { VirtualKeyboard keyBoard = (VirtualKeyboard)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_VIRTUAL_KEYBOARD); @@ -875,17 +881,34 @@ GUIControl.HideControl(GetID,12); GUIControl.HideControl(GetID,13); GUIControl.HideControl(GetID,14); + GUIControl.HideControl(GetID,111); + GUIControl.HideControl(GetID,121); + GUIControl.HideControl(GetID,131); + GUIControl.HideControl(GetID,141); }else{ GUIPropertyManager.SetProperty("#videotitle", foVideo.Title); - GUIPropertyManager.SetProperty("#tags", foVideo.Tags); + if(String.IsNullOrEmpty(foVideo.Tags)){ + GUIPropertyManager.SetProperty("#tags", "None"); + //GUIPropertyManager. + }else{ + GUIPropertyManager.SetProperty("#tags", foVideo.Tags); + } TimeSpan t = TimeSpan.FromSeconds(foVideo.Length); GUIPropertyManager.SetProperty("#length", t.ToString()); - GUIPropertyManager.SetProperty("#desc", foVideo.Description); + if(String.IsNullOrEmpty(foVideo.Description)){ + GUIPropertyManager.SetProperty("#desc", "None"); + }else{ + GUIPropertyManager.SetProperty("#desc", foVideo.Description); + } GUIControl.ShowControl(GetID,11); GUIControl.ShowControl(GetID,12); GUIControl.ShowControl(GetID,13); GUIControl.ShowControl(GetID,14); + GUIControl.ShowControl(GetID,111); + GUIControl.ShowControl(GetID,121); + GUIControl.ShowControl(GetID,131); + GUIControl.ShowControl(GetID,141); //Log.Info(foVideo.Description); } } Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/ImageDowloader.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/ImageDowloader.cs 2007-08-22 15:01:30 UTC (rev 856) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/ImageDowloader.cs 2007-08-22 23:07:31 UTC (rev 857) @@ -9,80 +9,80 @@ using System.Net; namespace OnlineVideos { - public static class ImageDownloader - { - #region OldCode - public static bool _imagesDone = false; - public static bool _stopDownload = false; - public static List<String> _imageLocationList = new List<String>(); - - public static void DownloadImages(object sender, DoWorkEventArgs e) - { - _stopDownload = false; - _imagesDone = false; - _imageLocationList = new List<String>(); - Object [] loArguments = (Object [])e.Argument; - GUIFacadeControl facadeView = (GUIFacadeControl)loArguments[0]; - List<String> loImageUrlList = (List<String>) loArguments[1]; - String lsThumbLocation = (String)loArguments[2]; - - - Log.Info("OnlineVideos thumbnails will be saved in {0}",lsThumbLocation); - //int liSelectedIndex = Convert.ToInt32(loArguments[2]); - int liIdx = 0; - List<String> loImageFileList = new List<String>(loImageUrlList.Count); - foreach(String lsUrl in loImageUrlList){ - Log.Info("Getting image :"+lsUrl); - liIdx++; - if (lsUrl == String.Empty) - { - continue; - } - if (_stopDownload) - { - break; - } - string lsThumb = MediaPortal.Util.Utils.GetThumb(lsUrl); - //Log.Info("1)lsThumb = "+lsThumb); - lsThumb = System.IO.Path.GetFileName(lsThumb); - //Log.Info("2)lsThumb = "+lsThumb); - string lsThumbsDir = lsThumbLocation; - if (System.IO.Directory.Exists(lsThumbsDir) ==false) - { - System.IO.Directory.CreateDirectory(lsThumbsDir); - } - lsThumb =lsThumbsDir + lsThumb; - //Log.Info("3)lsThumb = "+lsThumb); - //Log.Info(lsThumb); - if (System.IO.File.Exists(lsThumb) == false) - { - //Log.Info("lsThumb doesn't exist"); - String lsFilename = System.IO.Path.GetFileName(lsThumb); - //moLog.Info("Filename will be {0}", lsFilename); - MediaPortal.Util.Utils.DownLoadImage(lsUrl, lsThumb); - System.Threading.Thread.Sleep(25); - } - if (System.IO.File.Exists(lsThumb)) - { - //Log.Info("lsThumb exist now"); - //facadeView[liIdx].IconImageBig = lsThumb; - loImageFileList.Add(lsThumb); - } - else - { - //Log.Info("lsThumb couldn't be created"); - loImageFileList.Add(""); - //facadeView[liIdx].IconImageBig = ""; - } + public static class ImageDownloader + { + #region OldCode + public static bool _imagesDone = false; + public static bool _stopDownload = false; + public static List<String> _imageLocationList = new List<String>(); + + public static void DownloadImages(object sender, DoWorkEventArgs e) + { + _stopDownload = false; + _imagesDone = false; + _imageLocationList = new List<String>(); + Object [] loArguments = (Object [])e.Argument; + GUIFacadeControl facadeView = (GUIFacadeControl)loArguments[0]; + List<String> loImageUrlList = (List<String>) loArguments[1]; + String lsThumbLocation = (String)loArguments[2]; + + + Log.Info("OnlineVideos thumbnails will be saved in {0}",lsThumbLocation); + //int liSelectedIndex = Convert.ToInt32(loArguments[2]); + int liIdx = 0; + List<String> loImageFileList = new List<String>(loImageUrlList.Count); + foreach(String lsUrl in loImageUrlList){ + Log.Info("Getting image :"+lsUrl); + liIdx++; + if (lsUrl == String.Empty) + { + continue; + } + if (_stopDownload) + { + break; + } + string lsThumb = MediaPortal.Util.Utils.GetThumb(lsUrl); + //Log.Info("1)lsThumb = "+lsThumb); + lsThumb = System.IO.Path.GetFileName(lsThumb); + //Log.Info("2)lsThumb = "+lsThumb); + string lsThumbsDir = lsThumbLocation; + if (System.IO.Directory.Exists(lsThumbsDir) ==false) + { + System.IO.Directory.CreateDirectory(lsThumbsDir); + } + lsThumb =lsThumbsDir + lsThumb; + //Log.Info("3)lsThumb = "+lsThumb); + //Log.Info(lsThumb); + if (System.IO.File.Exists(lsThumb) == false) + { + //Log.Info("lsThumb doesn't exist"); + String lsFilename = System.IO.Path.GetFileName(lsThumb); + //moLog.Info("Filename will be {0}", lsFilename); + MediaPortal.Util.Utils.DownLoadImage(lsUrl, lsThumb); + System.Threading.Thread.Sleep(25); + } + if (System.IO.File.Exists(lsThumb)) + { + //Log.Info("lsThumb exist now"); + //facadeView[liIdx].IconImageBig = lsThumb; + loImageFileList.Add(lsThumb); + } + else + { + //Log.Info("lsThumb couldn't be created"); + loImageFileList.Add(""); + //facadeView[liIdx].IconImageBig = ""; + } //facadeView[liIdx].ThumbnailImage = lsThumb; _imageLocationList.Add(lsThumb); facadeView[liIdx].ItemId = liIdx; //Log.Info("Set item {0} with image {1}", facadeView[liIdx].ItemId,facadeView[liIdx].ThumbnailImage); facadeView[liIdx].RetrieveArt = true; - facadeView[liIdx].RefreshCoverArt(); - - } - /* + facadeView[liIdx].RefreshCoverArt(); + + } + /* foreach (String lsFileName in loImageFileList) { liIdx++; @@ -90,14 +90,14 @@ facadeView[liIdx]. } - */ - _imagesDone = true; - //facadeView.SelectedListItemIndex = liSelectedIndex; - - //GUIControl.SelectItemControl(4755, facadeView.GetID, liSelectedIndex); + */ + _imagesDone = true; + //facadeView.SelectedListItemIndex = liSelectedIndex; + + //GUIControl.SelectItemControl(4755, facadeView.GetID, liSelectedIndex); - } - /* + } + /* public static String DownloadImage(String fsUrl,String fsThumbLocation){ string lsThumb = MediaPortal.Util.Utils.GetThumb(fsUrl); lsThumb = System.IO.Path.GetFileName(lsThumb); @@ -125,87 +125,88 @@ //facadeView[liIdx].IconImageBig = ""; } } - */ - #endregion - public static void getImages(List<String> imageUrlList,String ThumbLocation,GUIFacadeControl facadeView){ - Log.Info("Getting images"); - BackgroundWorker worker = new BackgroundWorker(); + */ + #endregion + public static void getImages(List<String> imageUrlList,String ThumbLocation,GUIFacadeControl facadeView){ + Log.Info("Getting images"); + BackgroundWorker worker = new BackgroundWorker(); Object[] loParms = new Object[4]; - loParms[0] = facadeView; - loParms[1] = imageUrlList; - loParms[2] = ThumbLocation; - worker.DoWork += new DoWorkEventHandler(DownloadImages2); - //_imagesDone = false; - worker.RunWorkerAsync(loParms); + loParms[0] = facadeView; + loParms[1] = imageUrlList; + loParms[2] = ThumbLocation; + worker.DoWork += new DoWorkEventHandler(DownloadImages2); + //_imagesDone = false; + worker.RunWorkerAsync(loParms); - // using (WaitCursor cursor = new WaitCursor()) - // { - // while (_imagesDone == false) - // { - // GUIWindowManager.Process(); - // } - //} - } - - public static void DownloadImages2(object sender, DoWorkEventArgs e) - { - //Log.Info("Using thumb directory:{0}", _imageDirectory); - Log.Info("Downloading images"); - _imageLocationList.Clear(); - _imagesDone = false; - _stopDownload = false; - //List<String> imageList = (List<String>)e.Argument; - //NameValueCollection imgNameUrlList = (NameValueCollection)e.Argument; - Object [] loArguments = (Object [])e.Argument; - GUIFacadeControl facadeView = (GUIFacadeControl)loArguments[0]; - List<String> loImageUrlList = (List<String>) loArguments[1]; - String lsThumbLocation = (String)loArguments[2]; - - - Log.Info("OnlineVideos thumbnails will be saved in {0}",lsThumbLocation); - //int liSelectedIndex = Convert.ToInt32(loArguments[2]); - int liIdx = 0; - //List<String> loImageFileList = new List<String>(loImageUrlList.Count); - WebClient client = new WebClient(); + // using (WaitCursor cursor = new WaitCursor()) + // { + // while (_imagesDone == false) + // { + // GUIWindowManager.Process(); + // } + //} + } + + public static void DownloadImages2(object sender, DoWorkEventArgs e) + { + //Log.Info("Using thumb directory:{0}", _imageDirectory); + Log.Info("Downloading images"); + _imageLocationList.Clear(); + _imagesDone = false; + _stopDownload = false; + //List<String> imageList = (List<String>)e.Argument; + //NameValueCollection imgNameUrlList = (NameValueCollection)e.Argument; + Object [] loArguments = (Object [])e.Argument; + GUIFacadeControl facadeView = (GUIFacadeControl)loArguments[0]; + List<String> loImageUrlList = (List<String>) loArguments[1]; + String lsThumbLocation = (String)loArguments[2]; + + + Log.Info("OnlineVideos thumbnails will be saved in {0}",lsThumbLocation); + //int liSelectedIndex = Convert.ToInt32(loArguments[2]); + int liIdx = 0; + //List<String> loImageFileList = new List<String>(loImageUrlList.Count); + WebClient client = new WebClient(); - string imageLocation; - string thumbnailLocation; - string name; - foreach(String url in loImageUrlList){ - liIdx++; - if (_stopDownload) - { - Log.Info("Received Request to stop Download"); - break; - } - Log.Info("downloading image :" + url); - name = MediaPortal.Util.Utils.GetThumb(url); - //Log.Info("1)lsThumb = "+lsThumb); - name = System.IO.Path.GetFileNameWithoutExtension(name); - imageLocation = lsThumbLocation + name + "L.jpg"; - thumbnailLocation = lsThumbLocation + name + ".jpg"; - if (System.IO.File.Exists(thumbnailLocation) == false) - { - client.DownloadFile(url, imageLocation); - if (System.IO.File.Exists(thumbnailLocation) == false) - { - //int iRotate = dbs.GetRotation(imageLocation); - MediaPortal.Util.Picture.CreateThumbnail(imageLocation, thumbnailLocation, (int)Thumbs.ThumbResolution, (int)Thumbs.ThumbResolution, 0); - System.Threading.Thread.Sleep(25); - System.IO.File.Delete(imageLocation); - } - - } - _imageLocationList.Add(thumbnailLocation); - facadeView[liIdx].RetrieveArt = true; - facadeView[liIdx].RefreshCoverArt(); - //i++; + string imageLocation; + string thumbnailLocation; + string name; + foreach(String url in loImageUrlList){ + liIdx++; + if (_stopDownload) + { + Log.Info("Received Request to stop Download"); + break; + } + + name = MediaPortal.Util.Utils.GetThumb(url); + //Log.Info("1)lsThumb = "+lsThumb); + name = System.IO.Path.GetFileNameWithoutExtension(name); + imageLocation = lsThumbLocation + name + "L.jpg"; + thumbnailLocation = lsThumbLocation + name + ".jpg"; + if (System.IO.File.Exists(thumbnailLocation) == false) + { + Log.Info("downloading image :" + url); + client.DownloadFile(url, imageLocation); + if (System.IO.File.Exists(thumbnailLocation) == false) + { + //int iRotate = dbs.GetRotation(imageLocation); + MediaPortal.Util.Picture.CreateThumbnail(imageLocation, thumbnailLocation, (int)Thumbs.ThumbResolution, (int)Thumbs.ThumbResolution, 0); + System.Threading.Thread.Sleep(25); + System.IO.File.Delete(imageLocation); + } + + } + _imageLocationList.Add(thumbnailLocation); + facadeView[liIdx].RetrieveArt = true; + facadeView[liIdx].RefreshCoverArt(); + //i++; - } - Log.Info("Setting imagesDone to true"); - _imagesDone = true; - } - - } + } + Log.Info("Setting imagesDone to true"); + _imagesDone = true; + } + + } } Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesTrailerUtil.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesTrailerUtil.cs 2007-08-22 15:01:30 UTC (rev 856) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesTrailerUtil.cs 2007-08-22 23:07:31 UTC (rev 857) @@ -25,30 +25,59 @@ } public override List<GUIOnlineVideos.VideoInfo> getVideoList(String fsUrl) { - BackgroundWorker worker = new BackgroundWorker(); - worker.DoWork += new DoWorkEventHandler(HDTrailerPlugin.AppleTrailers.GetAppleTrailersRSS); - AppleTrailers._workerCompleted = false; - worker.RunWorkerAsync(fsUrl); - using (WaitCursor cursor = new WaitCursor()) - { - while (HDTrailerPlugin.AppleTrailers._workerCompleted == false) - GUIWindowManager.Process(); - } List<GUIOnlineVideos.VideoInfo> loListItems = new List<GUIOnlineVideos.VideoInfo>(); - GUIOnlineVideos.VideoInfo loItem; - foreach (ITMSClient.TrailerInfo trailer in HDTrailerPlugin.AppleTrailers.trailers) - { - loItem = new GUIOnlineVideos.VideoInfo(); - loItem.Title = trailer.Title; - if(trailer.PosterUrl!=null) - loItem.ImageUrl = trailer.PosterUrl.ToString(); - loItem.Description = trailer.Overview; - loItem.VideoUrl = trailer.Url.ToString(); - loItem.Other = trailer; - //loItem.Length = trailer.. - loListItems.Add(loItem); + if(fsUrl.StartsWith("%")){ + if(fsUrl.Length == 1){ + loListItems = getAllTrailers(); + loListItems.Sort(delegate(GUIOnlineVideos.VideoInfo v1, GUIOnlineVideos.VideoInfo v2) { return v1.Title.CompareTo(v2.Title); }); + }else{ + fsUrl = fsUrl.Substring(1); + loListItems = search(fsUrl); + } + }else{ + /* + BackgroundWorker worker = new BackgroundWorker(); + worker.DoWork += new DoWorkEventHandler(HDTrailerPlugin.AppleTrailers.GetAppleTrailersRSS); + AppleTrailers._workerCompleted = false; + worker.RunWorkerAsync(fsUrl); + using (WaitCursor cursor = new WaitCursor()) + { + while (HDTrailerPlugin.AppleTrailers._workerCompleted == false) + GUIWindowManager.Process(); + } + */ + DownloadTrailers(fsUrl); + GUIOnlineVideos.VideoInfo loItem; + foreach (ITMSClient.TrailerInfo trailer in HDTrailerPlugin.AppleTrailers.trailers) + { + + loItem = new GUIOnlineVideos.VideoInfo(); + loItem.Title = trailer.Title; + if(trailer.PosterUrl!=null) + loItem.ImageUrl = trailer.PosterUrl.ToString(); + + loItem.Tags = trailer.Genre; + /* + try{ + ITMSClient.TrailerInfo trailerMore = AppleTrailers.ProcessTrailer(trailer); + loItem.Description = trailerMore.Overview; + Log.Info("trailer desc set="+(String.IsNullOrEmpty(loItem.Description)==false)); + + loItem.VideoUrl = trailerMore.TrailerStreamCollection[0].Uri.ToString(); + //foreach(TrailerStream stream in trailerMore.TrailerStreamCollection){ + //Log.Info("Trailer stream type:{0} url:{1} size:{2}",stream.Type,stream.Uri,stream.Size); + //} + //loItem.Other = trailer; + //loItem.Length = trailer.. + */ + loListItems.Add(loItem); + /* + }catch(Exception e){ + Log.Debug("skipped {0}. Unable to parse video url out of {1}",trailer.Title, trailer.Url); + } + */ + } } - return loListItems; } @@ -59,40 +88,36 @@ trailer = AppleTrailers.ProcessTrailer(trailer); return trailer.TrailerStreamCollection[0].Uri.ToString(); } - private List<GUIOnlineVideos.VideoInfo> search(String fsQuery){ + public List<GUIOnlineVideos.VideoInfo> getAllTrailers(){ + GUIOnlineVideos.VideoInfo loItem; Dictionary<string, GUIOnlineVideos.RssLink> loRssList= OnlineVideoSettings.getInstance().moSiteList[getSiteId()].RssList; List<GUIOnlineVideos.VideoInfo> loListItems = new List<GUIOnlineVideos.VideoInfo>(); - GUIOnlineVideos.VideoInfo loItem; foreach(GUIOnlineVideos.RssLink link in loRssList.Values){ + if(link.url.StartsWith("%")){ + continue; + } + //Log.Info("searching link:{0}",link.name); - BackgroundWorker worker = new BackgroundWorker(); - worker.DoWork += new DoWorkEventHandler(HDTrailerPlugin.AppleTrailers.GetAppleTrailersRSS); - AppleTrailers._workerCompleted = false; - worker.RunWorkerAsync(link.url); + DownloadTrailers(link.url); Dictionary<string, string> loTrailersFound = new Dictionary<string,string>(); - using (WaitCursor cursor = new WaitCursor()) - { - while (HDTrailerPlugin.AppleTrailers._workerCompleted == false) - GUIWindowManager.Process(); - } foreach (ITMSClient.TrailerInfo trailer in HDTrailerPlugin.AppleTrailers.trailers) { - if(trailer.Title.Contains(fsQuery)){ - if(loTrailersFound.ContainsKey(trailer.Title) == false){ - loTrailersFound.Add(trailer.Title, ""); - loItem = new GUIOnlineVideos.VideoInfo(); - loItem.Title = trailer.Title; - if(trailer.PosterUrl!=null){ - loItem.ImageUrl = trailer.PosterUrl.ToString(); - } - loItem.Description = trailer.Overview; - loItem.VideoUrl = trailer.Url.ToString(); - loItem.Other = trailer; - //loItem.Length = trailer.. - loListItems.Add(loItem); + + if(loTrailersFound.ContainsKey(trailer.Title) == false){ + loTrailersFound.Add(trailer.Title.ToUpper(), ""); + loItem = new GUIOnlineVideos.VideoInfo(); + loItem.Title = trailer.Title; + if(trailer.PosterUrl!=null){ + loItem.ImageUrl = trailer.PosterUrl.ToString(); } + loItem.Description = trailer.Overview; + loItem.VideoUrl = trailer.Url.ToString(); + loItem.Other = trailer; + //loItem.Length = trailer.. + loListItems.Add(loItem); } + } @@ -100,5 +125,36 @@ return loListItems; } + private List<GUIOnlineVideos.VideoInfo> search(String fsQuery){ + fsQuery = fsQuery.ToUpper(); + + List<GUIOnlineVideos.VideoInfo>loAllTrailers = getAllTrailers(); + List<GUIOnlineVideos.VideoInfo>loSearchResult = loAllTrailers.FindAll(delegate(GUIOnlineVideos.VideoInfo v1) { return v1.Title.ToUpper().Contains(fsQuery);}); + + return loSearchResult; + } + private void DownloadTrailers(String fsLink){ + + //Log.Info("getting trailers from url:"+fsLink.url); + BackgroundWorker worker = new BackgroundWorker(); + worker.DoWork += new DoWorkEventHandler(HDTrailerPlugin.AppleTrailers.GetAppleTrailersRSS); + AppleTrailers._workerCompleted = false; + + worker.RunWorkerAsync(fsLink); + DateTime startTime = DateTime.Now; + TimeSpan duration = new TimeSpan(); + using (WaitCursor cursor = new WaitCursor()) + { + + while (HDTrailerPlugin.AppleTrailers._workerCompleted == false && duration.TotalSeconds < 10){ + //Log.Info("donwload trailer duration = {0} seconds",duration.TotalSeconds); + GUIWindowManager.Process(); + duration = DateTime.Now - startTime;; + + } + } + + //Log.Info("finished getting trailers from url:"+fsLink.url); + } } } Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/AppleTrailers.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/AppleTrailers.cs 2007-08-22 15:01:30 UTC (rev 856) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/AppleTrailers.cs 2007-08-22 23:07:31 UTC (rev 857) @@ -61,22 +61,27 @@ // mediaportal.xml public static string server = string.Empty; - + public void HandleHttpError(object sender, ITMSClient.HTTPErrorEventArgs e){ + + } public static void GetAppleTrailersRSS(object sender, DoWorkEventArgs e) { _workerCompleted = false; + //.+=new ITMSClient.HTTPErrorEventHandler(HandleHttpError); + //loListItem.OnItemSelected+= new MediaPortal.GUI.Library.GUIListItem.ItemSelectedHandler(OnVideoItemSelected); string xmlurl = e.Argument.ToString(); trailers.Clear(); Uri pageUri = new Uri(xmlurl); ITMSClient.ITMSContent xmlContent = ITMSClient.ITMSHelper.GetITMSPage(pageUri); - //Console.WriteLine(xmlContent.Xml); + Log.Info(xmlContent.Xml); if (xmlContent.IsValid) { + Log.Info("xml is valid"); ITMSClient.TrailerIndex indexPage = new ITMSClient.TrailerIndex("test", xmlContent); RSSTitle = "Apple HD Trailers"; //trailers.Add(indexPage.TrailerInfoCollection.); - Log.Info("FOund {0} trailers.", indexPage.TrailerInfoCollection.Count); + //Log.Info("FOund {0} trailers.", indexPage.TrailerInfoCollection.Count); foreach (ITMSClient.TrailerInfo trailerInfo in indexPage.TrailerInfoCollection) { /* @@ -115,7 +120,7 @@ { ITMSClient.TrailerInfo trailerInfo = (ITMSClient.TrailerInfo)obj; - Log.Info("Processing Trailer {0}",trailerInfo.Title); + //Log.Info("Processing Trailer {0}",trailerInfo.Title); // Lookup the trailer in the media library string key = trailerInfo.Title.GetHashCode().ToString(); // Populate the rest of the meta data Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/ItmsContent.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/ItmsContent.cs 2007-08-22 15:01:30 UTC (rev 856) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/ItmsContent.cs 2007-08-22 23:07:31 UTC (rev 857) @@ -21,10 +21,10 @@ /// <param name="Xml">Xml.</param> public ITMSContent(HttpWebResponse response, string Xml) { - MediaPortal.GUI.Library.Log.Info("creating ITMSContent"); + //MediaPortal.GUI.Library.Log.Info("creating ITMSContent"); _webResponse = response; _xml = Xml; - MediaPortal.GUI.Library.Log.Info("Finished creating ITMSContent"); + //MediaPortal.GUI.Library.Log.Info("Finished creating ITMSContent"); } /// <summary> Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/ItmsHelper.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/ItmsHelper.cs 2007-08-22 15:01:30 UTC (rev 856) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/ItmsHelper.cs 2007-08-22 23:07:31 UTC (rev 857) @@ -47,7 +47,7 @@ /// <returns></returns> static public TrailerInfo PopulateTrailerDetails(TrailerInfo trailerInfo, ITMSClient.TrailerSize desiredSize) { - Log.Info("Populating Trailer details for {0}", trailerInfo.Title); + //Log.Info("Populating Trailer details for {0}", trailerInfo.Title); string[] MONTHS = new string[]{"January","February","March","April","May","June","July","August","September","October","November","December"}; //const string DIRECTOR = "(dir.)"; Match fields; @@ -62,7 +62,7 @@ fields = RegexParsers.moviedetailsRegex1.Match(infoPage.Xml); if (fields.Success) { - Log.Info("got the movie details for {0}",trailerInfo.Title); + //Log.Info("got the movie details for {0}",trailerInfo.Title); trailerInfo.Title = fields.Groups["title"].Value.Replace('\u0092', '\'').Replace('\u0093', '"').Replace('\u0094', '"'); trailerInfo.PosterUrl = new Uri(fields.Groups["poster"].Value); trailerInfo.Copyright = fields.Groups["copyright"].Value; @@ -139,7 +139,7 @@ { foreach (Capture url in fields.Groups["urls"].Captures) { - Log.Info("Found stream url:{0}", url); + //Log.Info("Found stream url:{0}", url); TrailerStreamCollection tsc = GetTrailerStreamCollection(new Uri(infoPage.WebResponse.ResponseUri, url.Value)); TrailerStream myStream = GetDesiredTrailerStream(tsc, desiredSize); trailerInfo.TrailerStreamCollection.Add(myStream); @@ -198,8 +198,8 @@ HttpWebResponse response = null; ITMSContent content = null; - Debug.WriteLine("GetITMSPage: " + uri.AbsoluteUri); - Log.Info("GetITMSPage: " + uri.AbsoluteUri); + Log.Debug("GetITMSPage: " + uri.AbsoluteUri); + //Log.Info("GetITMSPage: " + uri.AbsoluteUri); try { request = (HttpWebRequest) HttpWebRequest.Create(uri); @@ -211,33 +211,35 @@ if (ifModifiedSince != DateTime.MinValue) request.IfModifiedSince = ifModifiedSince; - Log.Info("getiing request response"); + //Log.Info("getiing request response"); response = (HttpWebResponse) request.GetResponse(); - Log.Info("got response"); + //Log.Info("got response"); sReader = new StreamReader(response.GetResponseStream(), System.Text.Encoding.UTF8, false, (int) Math.Abs(response.ContentLength)); - Log.Info("Got Response Stream"); + //Log.Info("Got Response Stream"); - Log.Info("Download xml"); + //Log.Info("Download xml"); content = new ITMSContent(response, HttpUtility.HtmlDecode( sReader.ReadToEnd())); Log.Info("created ITMSContent"); - //Debug.WriteLine(response.LastModified); + //Log.Debug(response.LastModified); } catch (WebException ex) { - Debug.WriteLine(ex.GetBaseException().Message); + Log.Debug(ex.GetBaseException().Message); content = new ITMSContent(ex); if (ex.Response is HttpWebResponse) { HttpWebResponse httpResponse = ex.Response as HttpWebResponse; if (httpResponse.StatusCode == HttpStatusCode.NotModified) { - Debug.WriteLine(uri.AbsoluteUri + " not modified since " + ifModifiedSince); + Log.Debug(uri.AbsoluteUri + " not modified since " + ifModifiedSince); content = new ITMSContent(response, String.Empty); } } + }catch(Exception e){ + Log.Error(e); } finally { @@ -258,7 +260,7 @@ /// <returns></returns> private static TrailerStream GetDesiredTrailerStream(TrailerStreamCollection trailerStreams, TrailerSize desiredSize) { - Log.Info("getting desired Trailer size of {0}", desiredSize); + //Log.Info("getting desired Trailer size of {0}", desiredSize); // Find the largest desired size supported by the available streams while (trailerStreams.ContainsKey(desiredSize) == false && desiredSize > 0) desiredSize = desiredSize - 1; @@ -281,7 +283,7 @@ } } */ - Log.Info("Finished getting desired trailer"); + //Log.Info("Finished getting desired trailer"); return stream; } @@ -317,9 +319,9 @@ { TrailerSize size = (TrailerSize) Enum.Parse(typeof(TrailerSize), m.Groups["size"].Value, true); - Log.Info("found size {0}",size); + //Log.Info("found size {0}",size); Uri uri = new Uri(trailerPage.WebResponse.ResponseUri, m.Groups["url"].Value); - Log.Info("found url {0}", uri.ToString()); + //Log.Info("found url {0}", uri.ToString()); TrailerStream ts = new TrailerStream(size, uri); ts.Length = length; ts.Type = type; Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/TrailerIndex.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/TrailerIndex.cs 2007-08-22 15:01:30 UTC (rev 856) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesUtils/TrailerIndex.cs 2007-08-22 23:07:31 UTC (rev 857) @@ -21,6 +21,7 @@ using System.Text.RegularExpressions; using System.Net; using System.Diagnostics; +using MediaPortal.GUI.Library; namespace ITMSClient { @@ -110,6 +111,7 @@ /// </summary> protected void ParseIndexPage() { + Log.Info("Parsing index page"); MatchCollection movieItemCollection = RegexParsers.indexDetailsRegex.Matches(Content.Xml); _trailers = new TrailerInfoCollection(movieItemCollection.Count); Debug.Assert(movieItemCollection.Count > 0, "No movies found in index page xml"); Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/Main.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/Main.cs 2007-08-22 15:01:30 UTC (rev 856) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/Main.cs 2007-08-22 23:07:31 UTC (rev 857) @@ -30,9 +30,11 @@ - SiteUtilBase loUtil = new YouTubeUtil(); + //SiteUtilBase loUtil = new YouTubeUtil(); //List<GUIOnlineVideos.VideoInfo> loList = loUtil.getVideoList("http://youtube.com/rss/global/top_rated.rss"); + SiteUtilBase loUtil = new ItunesTrailerUtil(); + List<GUIOnlineVideos.VideoInfo> loList = loUtil.getVideoList("%transformers"); /* @@ -84,9 +86,9 @@ List<GUIOnlineVideos.VideoInfo> loList = loUtil.getVideoList("http://stage6.divx.com/rss/videos/order:rating"); */ //Console.WriteLine(loUtil.getUrl(loList[0].VideoUrl)); - //foreach(GUIOnlineVideos.VideoInfo loVideoInfo in loList){ -// Console.WriteLine("title:{0} \nurl:{1} \nimage:{2}",loVideoInfo.Title,loVideoInfo.VideoUrl, loVideoInfo.ImageUrl); -// } + foreach(GUIOnlineVideos.VideoInfo loVideoInfo in loList){ + Console.WriteLine("title:{0} \nurl:{1} \nimage:{2}",loVideoInfo.Title,loVideoInfo.VideoUrl, loVideoInfo.ImageUrl); + } //YouTubeUtil youtube = new YouTubeUtil(); //youtube.username = "MepoPlugin"; //youtube.password = "mepo"; Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/SiteUtilBase.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/SiteUtilBase.cs 2007-08-22 15:01:30 UTC (rev 856) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/SiteUtilBase.cs 2007-08-22 23:07:31 UTC (rev 857) @@ -80,8 +80,10 @@ db.addFavoriteVideo(foVideo,fsSiteId); } - public virtual bool removeFavorite(String fsId,String fsUserName,String fsPassword){ - return false; + public virtual bool RemoveFavorite(GUIOnlineVideos.VideoInfo foVideo){ + Log.Info("SiteUtilBase removeFavorites."); + FavoritesDatabase db = FavoritesDatabase.getInstance(); + return db.removeFavoriteVideo(foVideo); } public virtual String getUrl(GUIOnlineVideos.VideoInfo video,GUIOnlineVideos.Site foSite) @@ -111,8 +113,13 @@ RssItem loRssItem; //GUIListItem loListItem; MediaContent loMediaContent; + int itemCount = 0; foreach (XmlNode chileNode in nodeList) { + if(itemCount>=100){ + break; + } + itemCount++; loRssItem = new RssItem(); for (int i = 0; i < chileNode.ChildNodes.Count; i++) Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/YouTubeUtil.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/YouTubeUtil.cs 2007-08-22 15:01:30 UTC (rev 856) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/YouTubeUtil.cs 2007-08-22 23:07:31 UTC (rev 857) @@ -392,6 +392,7 @@ return token; } + /* public override bool removeFavorite(string fsVideoId, string fsUserName, string fsPassword) { if (isLoggedIn()==false){ @@ -421,13 +422,16 @@ RequestStream.Write(PostData, 0, PostData.Length); RequestStream.Close(); */ + /* HttpWebResponse response = (HttpWebResponse)Request.GetResponse(); StreamReader Reader = new StreamReader(response.GetResponseStream()); String lsResponse = Reader.ReadToEnd(); Console.WriteLine(lsResponse); response.Close(); return true; + } + */ public override string getSiteId() { return "1"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-08-22 15:01:36
|
Revision: 856 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=856&view=rev Author: and-81 Date: 2007-08-22 08:01:30 -0700 (Wed, 22 Aug 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver/Properties/AssemblyInfo.cs Added Paths: ----------- trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver/ trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver/HCW Transceiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver/HcwTransceiver.cs Removed Paths: ------------- trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver/USB-UIRT Transceiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver/UirtTransceiver.cs Copied: trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver (from rev 853, trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver) Added: trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver/HCW Transceiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver/HCW Transceiver.csproj (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver/HCW Transceiver.csproj 2007-08-22 15:01:30 UTC (rev 856) @@ -0,0 +1,95 @@ +<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>{EE8F2C22-8BD3-4832-85F0-E6F67ED3AADB}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>HcwTransceiver</RootNamespace> + <AssemblyName>HCW Transceiver</AssemblyName> + <RunPostBuildEvent>OnOutputUpdated</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>true</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> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> + <OutputPath>bin\x86\Debug\</OutputPath> + <DefineConstants>DEBUG</DefineConstants> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + <DebugType>full</DebugType> + <PlatformTarget>x86</PlatformTarget> + <ErrorReport>prompt</ErrorReport> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> + <OutputPath>bin\x86\Release\</OutputPath> + <Optimize>true</Optimize> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + <DebugType> + </DebugType> + <PlatformTarget>x86</PlatformTarget> + <UseVSHostingProcess>false</UseVSHostingProcess> + <ErrorReport>prompt</ErrorReport> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Configure.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="Configure.Designer.cs"> + <DependentUpon>Configure.cs</DependentUpon> + </Compile> + <Compile Include="HcwTransceiver.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="Configure.resx"> + <DependentUpon>Configure.cs</DependentUpon> + <SubType>Designer</SubType> + </EmbeddedResource> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\IR Server Plugin Interface\IR Server Plugin Interface.csproj"> + <Project>{D8B3D28F-62CE-4CA7-86CE-B7EAD614A94C}</Project> + <Name>IR Server Plugin Interface</Name> + <Private>False</Private> + </ProjectReference> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> + <PropertyGroup> + <PostBuildEvent>copy "$(TargetFileName)" "\MediaPortal Development\Plugin Releases\IR Server Suite\IR Server Plugins\"</PostBuildEvent> + </PropertyGroup> +</Project> \ No newline at end of file Added: trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver/HcwTransceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver/HcwTransceiver.cs (rev 0) +++ trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver/HcwTransceiver.cs 2007-08-22 15:01:30 UTC (rev 856) @@ -0,0 +1,438 @@ +using System; +using System.Diagnostics; +using System.IO; +using System.Runtime.InteropServices; +using System.Text; +using System.Windows.Forms; +using System.Xml; + +using Microsoft.Win32.SafeHandles; + +using IRServerPluginInterface; + +namespace HcwTransceiver +{ + + [CLSCompliant(false)] + public class HcwTransceiver : + IRServerPlugin, IConfigure, ITransmitIR, ILearnIR, IRemoteReceiver, IDisposable + { + + #region Interop + + [StructLayout(LayoutKind.Sequential)] + struct UUINFO + { + public int fwVersion; + public int protVersion; + public char fwDateDay; + public char fwDateMonth; + public char fwDateYear; + } + + //Not used + //[StructLayout(LayoutKind.Sequential)] + //internal struct UUGPIO + //{ + // public byte[] irCode; + // public byte action; + // public byte duration; + //} + + [DllImport("uuirtdrv.dll")] + static extern IntPtr UUIRTOpen(); + + [DllImport("uuirtdrv.dll")] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool UUIRTClose( + IntPtr hHandle); + + //[DllImport("uuirtdrv.dll")] + //[return: MarshalAs(UnmanagedType.Bool)] + //internal static extern bool UUIRTGetDrvInfo(ref int puDrvVersion); + + //[DllImport("uuirtdrv.dll")] + //[return: MarshalAs(UnmanagedType.Bool)] + //internal static extern bool UUIRTGetUUIRTInfo( + // IntPtr hHandle, + // ref UUINFO puuInfo); + + //[DllImport("uuirtdrv.dll")] + //[return: MarshalAs(UnmanagedType.Bool)] + //internal static extern bool UUIRTGetUUIRTConfig( + // IntPtr hHandle, + // ref uint puConfig); + + //[DllImport("uuirtdrv.dll")] + //[return: MarshalAs(UnmanagedType.Bool)] + //internal static extern bool UUIRTSetUUIRTConfig( + // IntPtr hHandle, + // uint uConfig); + + [DllImport("uuirtdrv.dll")] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool UUIRTTransmitIR( + IntPtr hHandle, + string IRCode, + int codeFormat, + int repeatCount, + int inactivityWaitTime, + IntPtr hEvent, + int res1, + int res2); + + [DllImport("uuirtdrv.dll")] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool UUIRTLearnIR( + IntPtr hHandle, + int codeFormat, + [MarshalAs(UnmanagedType.LPStr)] StringBuilder ircode, + IRLearnCallbackDelegate progressProc, + int userData, + ref int pAbort, + int param1, + [MarshalAs(UnmanagedType.AsAny)] Object o, + [MarshalAs(UnmanagedType.AsAny)] Object oo); + + [DllImport("uuirtdrv.dll")] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool UUIRTSetReceiveCallback( + IntPtr hHandle, + UUIRTReceiveCallbackDelegate receiveProc, + int none); + + //[DllImport("uuirtdrv.dll")] + //static extern bool UUIRTSetUUIRTGPIOCfg(IntPtr hHandle, int index, ref UUGPIO GpioSt); + + //[DllImport("uuirtdrv.dll")] + //static extern bool UUIRTGetUUIRTGPIOCfg(IntPtr hHandle, ref int numSlots, ref uint dwPortPins, + // ref UUGPIO GpioSt); + + #endregion + + #region Delegates + + delegate void UUIRTReceiveCallbackDelegate(string irCode, IntPtr userData); + delegate void IRLearnCallbackDelegate(uint progress, uint sigQuality, ulong carrierFreq, IntPtr userData); + + #endregion Delegates + + #region Constants + + static readonly string ConfigurationFile = + Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + + "\\IR Server Suite\\IR Server\\USB-UIRT Transceiver.xml"; + + const int UUIRTDRV_IRFMT_UUIRT = 0x0000; + const int UUIRTDRV_IRFMT_PRONTO = 0x0010; + const int UUIRTDRV_IRFMT_LEARN_FORCERAW = 0x0100; + const int UUIRTDRV_IRFMT_LEARN_FORCESTRUC = 0x0200; + const int UUIRTDRV_IRFMT_LEARN_FORCEFREQ = 0x0400; + const int UUIRTDRV_IRFMT_LEARN_FREQDETECT = 0x0800; + + static readonly string[] Ports = new string[] { "Default", "Port 1", "Port 2", "Port 3" }; + + const int AbortLearn = -1; + const int AllowLearn = 0; + + #endregion Constants + + #region Variables + + RemoteHandler _remoteButtonHandler = null; + + string _blastPort = Ports[0]; + + int _repeatDelay; + int _blastRepeats; + int _learnTimeout; + + //ulong _learnCarrierFreq; + + string _lastCode = String.Empty; + DateTime _lastCodeTime = DateTime.Now; + + // ------- + + int _abortLearn = AllowLearn; + bool _learnTimedOut; + UUIRTReceiveCallbackDelegate _receiveCallback = null; + bool _isUsbUirtLoaded = false; + IntPtr _usbUirtHandle = IntPtr.Zero; + bool _disposed = false; + + #endregion Variables + + #region Deconstructor + + ~HcwTransceiver() + { + Dispose(false); + } + + #endregion Deconstructor + + #region IDisposable Members + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + private void Dispose(bool disposeManagedResources) + { + if (!_disposed) + { + _disposed = true; + + if (disposeManagedResources) + { + // Dispose any managed resources. + } + + if (_isUsbUirtLoaded && _usbUirtHandle != new IntPtr(-1) && _usbUirtHandle != IntPtr.Zero) + { + UUIRTClose(_usbUirtHandle); + _usbUirtHandle = IntPtr.Zero; + _isUsbUirtLoaded = false; + } + } + } + + #endregion IDisposable Members + + #region Implementation + + public override string Name { get { return "USB-UIRT"; } } + public override string Version { get { return "1.0.3.3"; } } + public override string Author { get { return "and-81"; } } + public override string Description { get { return "Support for the USB-UIRT transceiver"; } } + + public override bool Start() + { + LoadSettings(); + + _usbUirtHandle = UUIRTOpen(); + + if (_usbUirtHandle != new IntPtr(-1)) + { + _isUsbUirtLoaded = true; + + // Setup callack to receive IR messages + _receiveCallback = new UUIRTReceiveCallbackDelegate(UUIRTReceiveCallback); + UUIRTSetReceiveCallback(_usbUirtHandle, _receiveCallback, 0); + } + + return _isUsbUirtLoaded; + } + public override void Suspend() + { + Stop(); + } + public override void Resume() + { + Start(); + } + public override void Stop() + { + UUIRTClose(_usbUirtHandle); + + _usbUirtHandle = IntPtr.Zero; + _isUsbUirtLoaded = false; + } + + public void Configure() + { + LoadSettings(); + + Configure config = new Configure(); + + config.RepeatDelay = _repeatDelay; + config.BlastRepeats = _blastRepeats; + config.LearnTimeout = _learnTimeout; + + if (config.ShowDialog() == DialogResult.OK) + { + _repeatDelay = config.RepeatDelay; + _blastRepeats = config.BlastRepeats; + _learnTimeout = config.LearnTimeout; + + SaveSettings(); + } + } + + public RemoteHandler RemoteCallback + { + get { return _remoteButtonHandler; } + set { _remoteButtonHandler = value; } + } + + public string[] AvailablePorts { get { return Ports; } } + + public bool Transmit(string port, byte[] data) + { + bool result = false; + + string irCode = Encoding.ASCII.GetString(data); + + // Set blaster port ... + if (port.Equals(Ports[1], StringComparison.InvariantCultureIgnoreCase)) + irCode = "Z1" + irCode; + else if (port.Equals(Ports[2], StringComparison.InvariantCultureIgnoreCase)) + irCode = "Z2" + irCode; + else if (port.Equals(Ports[3], StringComparison.InvariantCultureIgnoreCase)) + irCode = "Z3" + irCode; + + result = UUIRTTransmitIR( + _usbUirtHandle, // Handle to USB-UIRT + irCode, // IR Code + UUIRTDRV_IRFMT_PRONTO, // Code Format + _blastRepeats, // Repeat Count + 0, // Inactivity Wait Time + IntPtr.Zero, // hEvent + 0, // reserved1 + 0 // reserved2 + ); + + return result; + } + public LearnStatus Learn(out byte[] data) + { + bool result = false; + + data = null; + + StringBuilder irCode = new StringBuilder("1", 2048); + _abortLearn = AllowLearn; + _learnTimedOut = false; + + //_learnCarrierFreq = 0; + + Timer timer = new Timer(); + timer.Interval = _learnTimeout; + timer.Tick += new EventHandler(timer_Tick); + timer.Enabled = true; + timer.Start(); + + //IRLearnCallbackDelegate learnCallback = new IRLearnCallbackDelegate(UUIRTLearnCallback); + + result = UirtTransceiver.UUIRTLearnIR( + _usbUirtHandle, // Handle to USB-UIRT + UirtTransceiver.UUIRTDRV_IRFMT_PRONTO | UirtTransceiver.UUIRTDRV_IRFMT_LEARN_FREQDETECT, // | UirtTransceiver.UUIRTDRV_IRFMT_LEARN_FORCERAW + irCode, // Where to put the IR Code + null, // Learn status callback + 0, // User data + ref _abortLearn, // Abort flag? + 0, + null, + null); + + timer.Stop(); + + //MessageBox.Show(_learnCarrierFreq.ToString()); + + if (_learnTimedOut) + { + return LearnStatus.Timeout; + } + else if (result) + { + data = Encoding.ASCII.GetBytes(irCode.ToString()); + + return LearnStatus.Success; + } + else + { + return LearnStatus.Failure; + } + } + + void LoadSettings() + { + try + { + XmlDocument doc = new XmlDocument(); + doc.Load(ConfigurationFile); + + _repeatDelay = int.Parse(doc.DocumentElement.Attributes["RepeatDelay"].Value); + _blastRepeats = int.Parse(doc.DocumentElement.Attributes["BlastRepeats"].Value); + _learnTimeout = int.Parse(doc.DocumentElement.Attributes["LearnTimeout"].Value); + } + catch (Exception ex) + { + Console.WriteLine(ex.ToString()); + + _repeatDelay = 500; + _blastRepeats = 4; + _learnTimeout = 10000; + } + } + void SaveSettings() + { + try + { + XmlTextWriter writer = new XmlTextWriter(ConfigurationFile, System.Text.Encoding.UTF8); + writer.Formatting = Formatting.Indented; + writer.Indentation = 1; + writer.IndentChar = (char)9; + writer.WriteStartDocument(true); + writer.WriteStartElement("settings"); // <settings> + + writer.WriteAttributeString("RepeatDelay", _repeatDelay.ToString()); + writer.WriteAttributeString("BlastRepeats", _blastRepeats.ToString()); + writer.WriteAttributeString("LearnTimeout", _learnTimeout.ToString()); + + writer.WriteEndElement(); // </settings> + writer.WriteEndDocument(); + writer.Close(); + } + catch (Exception ex) + { + Console.WriteLine(ex.ToString()); + } + } + + void UUIRTReceiveCallback(string keyCode, IntPtr userData) + { + if (_remoteButtonHandler == null) + return; + + TimeSpan timeSpan = DateTime.Now - _lastCodeTime; + + if (keyCode == _lastCode) // Repeated button + { + if (timeSpan.Milliseconds > _repeatDelay) + { + _remoteButtonHandler(keyCode); + _lastCodeTime = DateTime.Now; + } + } + else + { + _remoteButtonHandler(keyCode); + _lastCodeTime = DateTime.Now; + } + + _lastCode = keyCode; + } + /* + void UUIRTLearnCallback(uint progress, uint sigQuality, ulong carrierFreq, IntPtr userData) + { + _learnCarrierFreq = carrierFreq; + //MessageBox.Show(_learnCarrierFreq.ToString()); + } + */ + void timer_Tick(object sender, EventArgs e) + { + _abortLearn = AbortLearn; + _learnTimedOut = true; + + ((Timer)sender).Stop(); + } + + #endregion Implementation + + } + +} Modified: trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/Properties/AssemblyInfo.cs 2007-08-22 05:26:54 UTC (rev 853) +++ trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver/Properties/AssemblyInfo.cs 2007-08-22 15:01:30 UTC (rev 856) @@ -6,11 +6,11 @@ // 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("USB-UIRT Transceiver")] -[assembly: AssemblyDescription("IR Server plugin to support the USB-UIRT transceiver")] +[assembly: AssemblyTitle("HCW Transceiver")] +[assembly: AssemblyDescription("IR Server plugin to support the HCW transceiver")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("UirtTransceiver")] +[assembly: AssemblyProduct("HcwTransceiver")] [assembly: AssemblyCopyright("Aaron Dinnage")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] Deleted: trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver/USB-UIRT Transceiver.csproj =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/USB-UIRT Transceiver.csproj 2007-08-22 05:26:54 UTC (rev 853) +++ trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver/USB-UIRT Transceiver.csproj 2007-08-22 15:01:30 UTC (rev 856) @@ -1,95 +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>{99B5CA78-3E0B-477F-A7D3-EE1B65E85DE4}</ProjectGuid> - <OutputType>Library</OutputType> - <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>UirtTransceiver</RootNamespace> - <AssemblyName>USB-UIRT Transceiver</AssemblyName> - <RunPostBuildEvent>OnOutputUpdated</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>true</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> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> - <OutputPath>bin\x86\Debug\</OutputPath> - <DefineConstants>DEBUG</DefineConstants> - <TreatWarningsAsErrors>true</TreatWarningsAsErrors> - <DebugType>full</DebugType> - <PlatformTarget>x86</PlatformTarget> - <ErrorReport>prompt</ErrorReport> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> - <OutputPath>bin\x86\Release\</OutputPath> - <Optimize>true</Optimize> - <TreatWarningsAsErrors>true</TreatWarningsAsErrors> - <DebugType> - </DebugType> - <PlatformTarget>x86</PlatformTarget> - <UseVSHostingProcess>false</UseVSHostingProcess> - <ErrorReport>prompt</ErrorReport> - </PropertyGroup> - <ItemGroup> - <Reference Include="System" /> - <Reference Include="System.Data" /> - <Reference Include="System.Drawing" /> - <Reference Include="System.Windows.Forms" /> - <Reference Include="System.Xml" /> - </ItemGroup> - <ItemGroup> - <Compile Include="Configure.cs"> - <SubType>Form</SubType> - </Compile> - <Compile Include="Configure.Designer.cs"> - <DependentUpon>Configure.cs</DependentUpon> - </Compile> - <Compile Include="UirtTransceiver.cs" /> - <Compile Include="Properties\AssemblyInfo.cs" /> - </ItemGroup> - <ItemGroup> - <EmbeddedResource Include="Configure.resx"> - <DependentUpon>Configure.cs</DependentUpon> - <SubType>Designer</SubType> - </EmbeddedResource> - </ItemGroup> - <ItemGroup> - <ProjectReference Include="..\IR Server Plugin Interface\IR Server Plugin Interface.csproj"> - <Project>{D8B3D28F-62CE-4CA7-86CE-B7EAD614A94C}</Project> - <Name>IR Server Plugin Interface</Name> - <Private>False</Private> - </ProjectReference> - </ItemGroup> - <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> - <!-- To modify your build process, add your task inside one of the targets below and uncomment it. - Other similar extension points exist, see Microsoft.Common.targets. - <Target Name="BeforeBuild"> - </Target> - <Target Name="AfterBuild"> - </Target> - --> - <PropertyGroup> - <PostBuildEvent>copy "$(TargetFileName)" "\MediaPortal Development\Plugin Releases\IR Server Suite\IR Server Plugins\"</PostBuildEvent> - </PropertyGroup> -</Project> \ No newline at end of file Deleted: trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver/UirtTransceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/UirtTransceiver.cs 2007-08-22 05:26:54 UTC (rev 853) +++ trunk/plugins/IR Server Suite/IR Server Plugins/HCW Transceiver/UirtTransceiver.cs 2007-08-22 15:01:30 UTC (rev 856) @@ -1,465 +0,0 @@ -using System; -using System.Diagnostics; -using System.IO; -using System.Runtime.InteropServices; -using System.Text; -using System.Windows.Forms; -using System.Xml; - -using Microsoft.Win32.SafeHandles; - -using IRServerPluginInterface; - -namespace UirtTransceiver -{ - - [CLSCompliant(false)] - public class UirtTransceiver : IIRServerPlugin, IDisposable - { - - #region Interop - - [StructLayout(LayoutKind.Sequential)] - struct UUINFO - { - public int fwVersion; - public int protVersion; - public char fwDateDay; - public char fwDateMonth; - public char fwDateYear; - } - - //Not used - //[StructLayout(LayoutKind.Sequential)] - //internal struct UUGPIO - //{ - // public byte[] irCode; - // public byte action; - // public byte duration; - //} - - [DllImport("uuirtdrv.dll")] - static extern IntPtr UUIRTOpen(); - - [DllImport("uuirtdrv.dll")] - [return: MarshalAs(UnmanagedType.Bool)] - static extern bool UUIRTClose( - IntPtr hHandle); - - //[DllImport("uuirtdrv.dll")] - //[return: MarshalAs(UnmanagedType.Bool)] - //internal static extern bool UUIRTGetDrvInfo(ref int puDrvVersion); - - //[DllImport("uuirtdrv.dll")] - //[return: MarshalAs(UnmanagedType.Bool)] - //internal static extern bool UUIRTGetUUIRTInfo( - // IntPtr hHandle, - // ref UUINFO puuInfo); - - //[DllImport("uuirtdrv.dll")] - //[return: MarshalAs(UnmanagedType.Bool)] - //internal static extern bool UUIRTGetUUIRTConfig( - // IntPtr hHandle, - // ref uint puConfig); - - //[DllImport("uuirtdrv.dll")] - //[return: MarshalAs(UnmanagedType.Bool)] - //internal static extern bool UUIRTSetUUIRTConfig( - // IntPtr hHandle, - // uint uConfig); - - [DllImport("uuirtdrv.dll")] - [return: MarshalAs(UnmanagedType.Bool)] - static extern bool UUIRTTransmitIR( - IntPtr hHandle, - string IRCode, - int codeFormat, - int repeatCount, - int inactivityWaitTime, - IntPtr hEvent, - int res1, - int res2); - - [DllImport("uuirtdrv.dll")] - [return: MarshalAs(UnmanagedType.Bool)] - static extern bool UUIRTLearnIR( - IntPtr hHandle, - int codeFormat, - [MarshalAs(UnmanagedType.LPStr)] StringBuilder ircode, - IRLearnCallbackDelegate progressProc, - int userData, - ref int pAbort, - int param1, - [MarshalAs(UnmanagedType.AsAny)] Object o, - [MarshalAs(UnmanagedType.AsAny)] Object oo); - - [DllImport("uuirtdrv.dll")] - [return: MarshalAs(UnmanagedType.Bool)] - static extern bool UUIRTSetReceiveCallback( - IntPtr hHandle, - UUIRTReceiveCallbackDelegate receiveProc, - int none); - - //[DllImport("uuirtdrv.dll")] - //static extern bool UUIRTSetUUIRTGPIOCfg(IntPtr hHandle, int index, ref UUGPIO GpioSt); - - //[DllImport("uuirtdrv.dll")] - //static extern bool UUIRTGetUUIRTGPIOCfg(IntPtr hHandle, ref int numSlots, ref uint dwPortPins, - // ref UUGPIO GpioSt); - - #endregion - - #region Delegates - - delegate void UUIRTReceiveCallbackDelegate(string irCode, IntPtr userData); - delegate void IRLearnCallbackDelegate(uint progress, uint sigQuality, ulong carrierFreq, IntPtr userData); - - #endregion Delegates - - #region Constants - - static readonly string ConfigurationFile = - Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + - "\\IR Server Suite\\IR Server\\USB-UIRT Transceiver.xml"; - - const int UUIRTDRV_IRFMT_UUIRT = 0x0000; - const int UUIRTDRV_IRFMT_PRONTO = 0x0010; - const int UUIRTDRV_IRFMT_LEARN_FORCERAW = 0x0100; - const int UUIRTDRV_IRFMT_LEARN_FORCESTRUC = 0x0200; - const int UUIRTDRV_IRFMT_LEARN_FORCEFREQ = 0x0400; - const int UUIRTDRV_IRFMT_LEARN_FREQDETECT = 0x0800; - - static readonly string[] Ports = new string[] { "Default", "Port 1", "Port 2", "Port 3" }; - - const int AbortLearn = -1; - const int AllowLearn = 0; - - #endregion Constants - - #region Variables - - RemoteHandler _remoteButtonHandler = null; - - string _blastPort = Ports[0]; - - int _repeatDelay; - int _blastRepeats; - int _learnTimeout; - - //ulong _learnCarrierFreq; - - string _lastCode = String.Empty; - DateTime _lastCodeTime = DateTime.Now; - - // ------- - - int _abortLearn = AllowLearn; - bool _learnTimedOut; - UUIRTReceiveCallbackDelegate _receiveCallback = null; - bool _isUsbUirtLoaded = false; - IntPtr _usbUirtHandle = IntPtr.Zero; - bool _disposed = false; - - #endregion Variables - - #region Deconstructor - - ~UirtTransceiver() - { - Dispose(false); - } - - #endregion Deconstructor - - #region IDisposable Members - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool disposeManagedResources) - { - if (!_disposed) - { - _disposed = true; - - if (disposeManagedResources) - { - // Dispose any managed resources. - } - - if (_isUsbUirtLoaded && _usbUirtHandle != new IntPtr(-1) && _usbUirtHandle != IntPtr.Zero) - { - UUIRTClose(_usbUirtHandle); - _usbUirtHandle = IntPtr.Zero; - _isUsbUirtLoaded = false; - } - } - } - - #endregion - - #region IIRServerPlugin Members - - public string Name { get { return "USB-UIRT"; } } - public string Version { get { return "1.0.3.3"; } } - public string Author { get { return "and-81"; } } - public string Description { get { return "Support for the USB-UIRT transceiver"; } } - public bool CanReceive { get { return true; } } - public bool CanTransmit { get { return true; } } - public bool CanLearn { get { return true; } } - public bool CanConfigure { get { return true; } } - - public RemoteHandler RemoteCallback - { - get { return _remoteButtonHandler; } - set { _remoteButtonHandler = value; } - } - - public KeyboardHandler KeyboardCallback { get { return null; } set { } } - - public MouseHandler MouseCallback { get { return null; } set { } } - - public string[] AvailablePorts { get { return Ports; } } - - public void Configure() - { - LoadSettings(); - - Configure config = new Configure(); - - config.RepeatDelay = _repeatDelay; - config.BlastRepeats = _blastRepeats; - config.LearnTimeout = _learnTimeout; - - if (config.ShowDialog() == DialogResult.OK) - { - _repeatDelay = config.RepeatDelay; - _blastRepeats = config.BlastRepeats; - _learnTimeout = config.LearnTimeout; - - SaveSettings(); - } - } - public bool Start() - { - LoadSettings(); - - _usbUirtHandle = UUIRTOpen(); - - if (_usbUirtHandle != new IntPtr(-1)) - { - _isUsbUirtLoaded = true; - - // Setup callack to receive IR messages - _receiveCallback = new UUIRTReceiveCallbackDelegate(UUIRTReceiveCallback); - UUIRTSetReceiveCallback(_usbUirtHandle, _receiveCallback, 0); - } - - return _isUsbUirtLoaded; - } - public void Suspend() { } - public void Resume() { } - public void Stop() - { - UUIRTClose(_usbUirtHandle); - - _usbUirtHandle = IntPtr.Zero; - _isUsbUirtLoaded = false; - } - - public bool Transmit(string file) - { - bool result = false; - - try - { - StreamReader streamReader = new StreamReader(file); - string irCode = streamReader.ReadToEnd(); - streamReader.Close(); - - // Set blaster port ... - if (_blastPort == Ports[1]) - irCode = "Z1" + irCode; - else if (_blastPort == Ports[2]) - irCode = "Z2" + irCode; - else if (_blastPort == Ports[3]) - irCode = "Z3" + irCode; - - result = UUIRTTransmitIR( - _usbUirtHandle, // Handle to USB-UIRT - irCode, // IR Code - UUIRTDRV_IRFMT_PRONTO, // Code Format - _blastRepeats, // Repeat Count - 0, // Inactivity Wait Time - IntPtr.Zero, // hEvent - 0, // reserved1 - 0 // reserved2 - ); - } - catch - { - result = false; - } - - return result; - } - public LearnStatus Learn(out byte[] data) - { - bool result = false; - - data = null; - - StringBuilder irCode = new StringBuilder("1", 2048); - _abortLearn = AllowLearn; - _learnTimedOut = false; - - //_learnCarrierFreq = 0; - - Timer timer = new Timer(); - timer.Interval = _learnTimeout; - timer.Tick += new EventHandler(timer_Tick); - timer.Enabled = true; - timer.Start(); - - //IRLearnCallbackDelegate learnCallback = new IRLearnCallbackDelegate(UUIRTLearnCallback); - - result = UirtTransceiver.UUIRTLearnIR( - _usbUirtHandle, // Handle to USB-UIRT - UirtTransceiver.UUIRTDRV_IRFMT_PRONTO | UirtTransceiver.UUIRTDRV_IRFMT_LEARN_FREQDETECT, // | UirtTransceiver.UUIRTDRV_IRFMT_LEARN_FORCERAW - irCode, // Where to put the IR Code - null, // Learn status callback - 0, // User data - ref _abortLearn, // Abort flag? - 0, - null, - null); - - timer.Stop(); - - //MessageBox.Show(_learnCarrierFreq.ToString()); - - if (_learnTimedOut) - { - return LearnStatus.Timeout; - } - else if (result) - { - data = Encoding.ASCII.GetBytes(irCode.ToString()); - - return LearnStatus.Success; - } - else - { - return LearnStatus.Failure; - } - } - - public bool SetPort(string port) - { - foreach (string availablePort in Ports) - { - if (port == availablePort) - { - _blastPort = availablePort; - return true; - } - } - - return false; - } - - #endregion IIRServerPlugin Members - - #region Implementation - - void LoadSettings() - { - try - { - XmlDocument doc = new XmlDocument(); - doc.Load(ConfigurationFile); - - _repeatDelay = int.Parse(doc.DocumentElement.Attributes["RepeatDelay"].Value); - _blastRepeats = int.Parse(doc.DocumentElement.Attributes["BlastRepeats"].Value); - _learnTimeout = int.Parse(doc.DocumentElement.Attributes["LearnTimeout"].Value); - } - catch (Exception ex) - { - Console.WriteLine(ex.ToString()); - - _repeatDelay = 500; - _blastRepeats = 4; - _learnTimeout = 10000; - } - } - void SaveSettings() - { - try - { - XmlTextWriter writer = new XmlTextWriter(ConfigurationFile, System.Text.Encoding.UTF8); - writer.Formatting = Formatting.Indented; - writer.Indentation = 1; - writer.IndentChar = (char)9; - writer.WriteStartDocument(true); - writer.WriteStartElement("settings"); // <settings> - - writer.WriteAttributeString("RepeatDelay", _repeatDelay.ToString()); - writer.WriteAttributeString("BlastRepeats", _blastRepeats.ToString()); - writer.WriteAttributeString("LearnTimeout", _learnTimeout.ToString()); - - writer.WriteEndElement(); // </settings> - writer.WriteEndDocument(); - writer.Close(); - } - catch (Exception ex) - { - Console.WriteLine(ex.ToString()); - } - } - - void UUIRTReceiveCallback(string keyCode, IntPtr userData) - { - if (_remoteButtonHandler == null) - return; - - TimeSpan timeSpan = DateTime.Now - _lastCodeTime; - - if (keyCode == _lastCode) // Repeated button - { - if (timeSpan.Milliseconds > _repeatDelay) - { - _remoteButtonHandler(keyCode); - _lastCodeTime = DateTime.Now; - } - } - else - { - _remoteButtonHandler(keyCode); - _lastCodeTime = DateTime.Now; - } - - _lastCode = keyCode; - } - /* - void UUIRTLearnCallback(uint progress, uint sigQuality, ulong carrierFreq, IntPtr userData) - { - _learnCarrierFreq = carrierFreq; - //MessageBox.Show(_learnCarrierFreq.ToString()); - } - */ - void timer_Tick(object sender, EventArgs e) - { - _abortLearn = AbortLearn; - _learnTimedOut = true; - - ((Timer)sender).Stop(); - } - - #endregion Implementation - - } - -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-08-22 14:37:57
|
Revision: 855 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=855&view=rev Author: and-81 Date: 2007-08-22 07:37:54 -0700 (Wed, 22 Aug 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/EditProgramForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Program.cs trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/ExternalProgram.cs trunk/plugins/IR Server Suite/Common/IrssUtils/IrssUtils.csproj trunk/plugins/IR Server Suite/Common/MPUtils/ExternalChannelConfig.cs trunk/plugins/IR Server Suite/Common/MPUtils/MPCommands.cs trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IRServerPluginInterface.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/IRMan Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/IRTransTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/UirtTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Receiver/WinLirc Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/WinLirc Receiver/WinLircServer.cs trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/Windows Message Receiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/Windows Message Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/X10Transceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/XBCDRC Receiver/XBCDRC Receiver.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/MPBlastZonePlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/SetupForm.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MPControlPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MappedEvent.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MappedKeyCode.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2BlasterPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs Added Paths: ----------- trunk/plugins/IR Server Suite/Common/IrssUtils/IRServerInfo.cs Removed Paths: ------------- trunk/plugins/IR Server Suite/Common/IrssUtils/TransceiverInfo.cs Modified: trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs 2007-08-22 11:31:52 UTC (rev 854) +++ trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs 2007-08-22 14:37:54 UTC (rev 855) @@ -110,7 +110,7 @@ //static bool _keepAlive = true; static int _echoID = -1; - TransceiverInfo _transceiverInfo = new TransceiverInfo(); + IRServerInfo _irServerInfo = new IRServerInfo(); #endregion Variables @@ -184,10 +184,10 @@ case "Register Success": { - _transceiverInfo = TransceiverInfo.FromBytes(received.Data); + _irServerInfo = IRServerInfo.FromBytes(received.Data); comboBoxPort.Items.Clear(); - comboBoxPort.Items.AddRange(_transceiverInfo.Ports); + comboBoxPort.Items.AddRange(_irServerInfo.Ports); comboBoxPort.SelectedIndex = 0; return; } @@ -418,9 +418,9 @@ return; } - if (!_transceiverInfo.CanTransmit) + if (!_irServerInfo.CanTransmit) { - AddStatusLine(String.Format("Transceiver: \"{0}\" doesn't blast.", _transceiverInfo.Name)); + AddStatusLine("IR Server is not setup to blast"); return; } @@ -437,9 +437,9 @@ return; } - if (!_transceiverInfo.CanLearn) + if (!_irServerInfo.CanLearn) { - AddStatusLine(String.Format("Transceiver: \"{0}\" doesn't support learning", _transceiverInfo.Name)); + AddStatusLine("IR Server is not setup to support learning"); return; } @@ -556,7 +556,7 @@ return; } - int keyCode = (int)Enum.Parse(typeof(MceButton), comboBoxRemoteButtons.SelectedItem.ToString()); + int keyCode = (int)Enum.Parse(typeof(MceButton), comboBoxRemoteButtons.SelectedItem.ToString(), true); if (keyCode == -1) keyCode = Decimal.ToInt32(numericUpDownButton.Value); Modified: trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs 2007-08-22 11:31:52 UTC (rev 854) +++ trunk/plugins/IR Server Suite/Applications/IR Blast/Program.cs 2007-08-22 14:37:54 UTC (rev 855) @@ -464,7 +464,7 @@ { Info("Registered to IR Server"); _registered = true; - //_transceiverInfo = TransceiverInfo.FromBytes(received.Data); + //_irServerInfo = TransceiverInfo.FromBytes(received.Data); break; } Modified: trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs 2007-08-22 11:31:52 UTC (rev 854) +++ trunk/plugins/IR Server Suite/Applications/IR Blast (No Window)/Program.cs 2007-08-22 14:37:54 UTC (rev 855) @@ -426,7 +426,7 @@ { IrssLog.Info("Registered to IR Server"); _registered = true; - //_transceiverInfo = TransceiverInfo.FromBytes(received.Data); + //_irServerInfo = TransceiverInfo.FromBytes(received.Data); break; } Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs 2007-08-22 11:31:52 UTC (rev 854) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs 2007-08-22 14:37:54 UTC (rev 855) @@ -20,7 +20,7 @@ #region Variables - IIRServerPlugin[] _transceivers; + IRServerPlugin[] _transceivers; #endregion Variables @@ -185,7 +185,7 @@ row++; - foreach (IIRServerPlugin transceiver in _transceivers) + foreach (IRServerPlugin transceiver in _transceivers) { gridPlugins.Rows.Insert(row); @@ -200,7 +200,7 @@ gridPlugins[row, 0] = nameCell; - if (transceiver.CanReceive) + if (transceiver is IRemoteReceiver) { SourceGrid.Cells.CheckBox checkbox = new SourceGrid.Cells.CheckBox(); @@ -213,7 +213,7 @@ else gridPlugins[row, 1] = new SourceGrid.Cells.Cell(); - if (transceiver.CanTransmit) + if (transceiver is ITransmitIR) { SourceGrid.Cells.CheckBox checkbox = new SourceGrid.Cells.CheckBox(); @@ -226,7 +226,7 @@ else gridPlugins[row, 2] = new SourceGrid.Cells.Cell(); - if (transceiver.CanConfigure) + if (transceiver is IConfigure) { SourceGrid.Cells.Button button = new SourceGrid.Cells.Button("Configure"); @@ -282,9 +282,9 @@ string plugin = gridPlugins[cell.Row.Index, 0].DisplayText; - foreach (IIRServerPlugin transceiver in _transceivers) + foreach (IRServerPlugin transceiver in _transceivers) if (transceiver.Name == plugin) - transceiver.Configure(); + (transceiver as IConfigure).Configure(); } private void ReceiveChanged(object sender, EventArgs e) Modified: trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-08-22 11:31:52 UTC (rev 854) +++ trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-08-22 14:37:54 UTC (rev 855) @@ -69,10 +69,10 @@ bool _registered = false; string _pluginNameReceive = String.Empty; - IIRServerPlugin _pluginReceive = null; + IRServerPlugin _pluginReceive = null; string _pluginNameTransmit = String.Empty; - IIRServerPlugin _pluginTransmit = null; + IRServerPlugin _pluginTransmit = null; bool _inConfiguration = false; @@ -204,11 +204,16 @@ } } - if (_pluginReceive != null && _pluginReceive.CanReceive) + if (_pluginReceive != null) { - _pluginReceive.RemoteCallback += new RemoteHandler(RemoteHandlerCallback); - _pluginReceive.KeyboardCallback += new KeyboardHandler(KeyboardHandlerCallback); - _pluginReceive.MouseCallback += new MouseHandler(MouseHandlerCallback); + if (_pluginReceive is IRemoteReceiver) + (_pluginReceive as IRemoteReceiver).RemoteCallback += new RemoteHandler(RemoteHandlerCallback); + + if (_pluginReceive is IKeyboardReceiver) + (_pluginReceive as IKeyboardReceiver).KeyboardCallback += new KeyboardHandler(KeyboardHandlerCallback); + + if (_pluginReceive is IMouseReceiver) + (_pluginReceive as IMouseReceiver).MouseCallback += new MouseHandler(MouseHandlerCallback); } _notifyIcon.Visible = true; @@ -239,11 +244,16 @@ SendToAll(message); } - if (_pluginReceive != null && _pluginReceive.CanReceive) + if (_pluginReceive != null) { - _pluginReceive.RemoteCallback -= new RemoteHandler(RemoteHandlerCallback); - _pluginReceive.KeyboardCallback -= new KeyboardHandler(KeyboardHandlerCallback); - _pluginReceive.MouseCallback -= new MouseHandler(MouseHandlerCallback); + if (_pluginReceive is IRemoteReceiver) + (_pluginReceive as IRemoteReceiver).RemoteCallback -= new RemoteHandler(RemoteHandlerCallback); + + if (_pluginReceive is IKeyboardReceiver) + (_pluginReceive as IKeyboardReceiver).KeyboardCallback -= new KeyboardHandler(KeyboardHandlerCallback); + + if (_pluginReceive is IMouseReceiver) + (_pluginReceive as IMouseReceiver).MouseCallback -= new MouseHandler(MouseHandlerCallback); } // Stop Plugin(s) @@ -301,7 +311,7 @@ } } - bool Configure() + void Configure() { _inConfiguration = true; @@ -315,14 +325,23 @@ if (config.ShowDialog() == DialogResult.OK) { - _mode = config.Mode; - _hostComputer = config.HostComputer; - _pluginNameReceive = config.PluginReceive; - _pluginNameTransmit = config.PluginTransmit; + if ((_mode != config.Mode) || + (_hostComputer != config.HostComputer) || + (_pluginNameReceive != config.PluginReceive) || + (_pluginNameTransmit != config.PluginTransmit) ) + { + Stop(); // Shut down communications - _inConfiguration = false; + // Change settings ... + _mode = config.Mode; + _hostComputer = config.HostComputer; + _pluginNameReceive = config.PluginReceive; + _pluginNameTransmit = config.PluginTransmit; - return true; + SaveSettings(); // Save Settings + + Start(); // Restart communications + } } } catch (Exception ex) @@ -331,8 +350,6 @@ } _inConfiguration = false; - - return false; } void StartMessageQueue() @@ -843,42 +860,31 @@ { IrssLog.Debug("Blast IR"); - if (_pluginTransmit == null || !_pluginTransmit.CanTransmit) + if (_pluginTransmit == null || !(_pluginTransmit is ITransmitIR)) return false; + string port = "Default"; + int portLen = BitConverter.ToInt32(data, 0); if (portLen > 0) - _pluginTransmit.SetPort(Encoding.ASCII.GetString(data, 4, portLen)); + port = Encoding.ASCII.GetString(data, 4, portLen); - byte[] fileData = new byte[data.Length - (4 + portLen)]; - for (int index = 4 + portLen; index < data.Length; index++) - fileData[index - (4 + portLen)] = data[index]; + byte[] codeData = new byte[data.Length - (4 + portLen)]; + Array.Copy(data, 4 + portLen, codeData, 0, codeData.Length); - string tempFile = Path.GetTempFileName(); - - FileStream fileStream = new FileStream(tempFile, FileMode.Create, FileAccess.ReadWrite, FileShare.None); - fileStream.Write(fileData, 0, fileData.Length); - fileStream.Flush(); - fileStream.Close(); - - bool result = _pluginTransmit.Transmit(tempFile); - - File.Delete(tempFile); - - return result; + return (_pluginTransmit as ITransmitIR).Transmit(port, codeData); } catch (Exception ex) { IrssLog.Error(ex.ToString()); + return false; } - - return false; } byte[] LearnIR() { IrssLog.Debug("Learn IR"); - if (_pluginTransmit == null || !_pluginTransmit.CanLearn) + if (_pluginTransmit == null || !(_pluginTransmit is ILearnIR)) { IrssLog.Debug("Active transceiver doesn't support learn"); return null; @@ -890,7 +896,7 @@ try { - LearnStatus status = _pluginTransmit.Learn(out data); + LearnStatus status = (_pluginTransmit as ILearnIR).Learn(out data); switch (status) { case LearnStatus.Success: @@ -1064,23 +1070,19 @@ { response.Name = received.Name + " Success"; - TransceiverInfo transceiverInfo = new TransceiverInfo(); + IRServerInfo irServerInfo = new IRServerInfo(); if (_pluginReceive != null) - { - transceiverInfo.Name = _pluginReceive.Name; - transceiverInfo.CanReceive = _pluginReceive.CanReceive; - } + irServerInfo.CanReceive = true; if (_pluginTransmit != null) { - transceiverInfo.Name = _pluginTransmit.Name; - transceiverInfo.Ports = _pluginTransmit.AvailablePorts; - transceiverInfo.CanLearn = _pluginTransmit.CanLearn; - transceiverInfo.CanTransmit = _pluginTransmit.CanTransmit; - } + irServerInfo.CanLearn = (_pluginTransmit is ILearnIR); + irServerInfo.CanTransmit = true; + irServerInfo.Ports = (_pluginTransmit as ITransmitIR).AvailablePorts; + } - response.Data = TransceiverInfo.ToBytes(transceiverInfo); + response.Data = irServerInfo.ToBytes(); } SendTo(received.FromPipe, received.FromServer, response); @@ -1157,14 +1159,9 @@ if (_inConfiguration) return; - Stop(); - IrssLog.Info("Setup"); - if (Configure()) - SaveSettings(); - - Start(); + Configure(); } void ClickQuit(object sender, EventArgs e) { @@ -1184,7 +1181,7 @@ XmlDocument doc = new XmlDocument(); doc.Load(ConfigurationFile); - _mode = (IRServerMode)Enum.Parse(typeof(IRServerMode), doc.DocumentElement.Attributes["Mode"].Value); + _mode = (IRServerMode)Enum.Parse(typeof(IRServerMode), doc.DocumentElement.Attributes["Mode"].Value, true); _hostComputer = doc.DocumentElement.Attributes["HostComputer"].Value; _pluginNameReceive = doc.DocumentElement.Attributes["PluginReceive"].Value; _pluginNameTransmit = doc.DocumentElement.Attributes["PluginTransmit"].Value; Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs 2007-08-22 11:31:52 UTC (rev 854) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs 2007-08-22 14:37:54 UTC (rev 855) @@ -20,10 +20,7 @@ [STAThread] static void Main() { - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - - // Check for multiple instances + // Check for multiple instances ... try { if (Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName).Length != 1) @@ -35,6 +32,9 @@ return; } + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + // TODO: Change log level to info for release. IrssLog.LogLevel = IrssLog.Level.Debug; IrssLog.Open(Common.FolderIrssLogs + "IR Server.log"); @@ -66,11 +66,11 @@ /// Retreives a list of available IR Server plugins. /// </summary> /// <returns>Array of plugin instances.</returns> - internal static IIRServerPlugin[] AvailablePlugins() + internal static IRServerPlugin[] AvailablePlugins() { try { - List<IIRServerPlugin> plugins = new List<IIRServerPlugin>(); + List<IRServerPlugin> plugins = new List<IRServerPlugin>(); string installFolder = SystemRegistry.GetInstallFolder(); if (String.IsNullOrEmpty(installFolder)) @@ -88,9 +88,9 @@ foreach (Type type in types) { - if (type.IsClass && !type.IsAbstract && type.GetInterface(typeof(IIRServerPlugin).Name) == typeof(IIRServerPlugin)) + if (type.IsClass && !type.IsAbstract && type.GetInterface(typeof(IRServerPlugin).Name) == typeof(IRServerPlugin)) { - IIRServerPlugin plugin = (IIRServerPlugin)Activator.CreateInstance(type); + IRServerPlugin plugin = (IRServerPlugin)Activator.CreateInstance(type); if (plugin == null) continue; @@ -122,16 +122,16 @@ /// </summary> /// <param name="pluginName">Name of plugin to instantiate.</param> /// <returns>Plugin instance.</returns> - internal static IIRServerPlugin GetPlugin(string pluginName) + internal static IRServerPlugin GetPlugin(string pluginName) { if (String.IsNullOrEmpty(pluginName)) return null; - IIRServerPlugin[] serverPlugins = AvailablePlugins(); + IRServerPlugin[] serverPlugins = AvailablePlugins(); if (serverPlugins == null) return null; - foreach (IIRServerPlugin plugin in serverPlugins) + foreach (IRServerPlugin plugin in serverPlugins) if (plugin.Name.Equals(pluginName, StringComparison.InvariantCultureIgnoreCase)) return plugin; Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/EditProgramForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/EditProgramForm.cs 2007-08-22 11:31:52 UTC (rev 854) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/EditProgramForm.cs 2007-08-22 14:37:54 UTC (rev 855) @@ -41,7 +41,7 @@ } public ProcessWindowStyle StartState { - get { return (ProcessWindowStyle)Enum.Parse(typeof(ProcessWindowStyle), comboBoxWindowStyle.SelectedItem as string); } + get { return (ProcessWindowStyle)Enum.Parse(typeof(ProcessWindowStyle), comboBoxWindowStyle.SelectedItem as string, true); } set { comboBoxWindowStyle.SelectedItem = Enum.GetName(typeof(ProcessWindowStyle), value); } } public bool UseShellExecute Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs 2007-08-22 11:31:52 UTC (rev 854) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs 2007-08-22 14:37:54 UTC (rev 855) @@ -290,7 +290,7 @@ { try { - eventType = (MappingEvent)Enum.Parse(typeof(MappingEvent), item.SubItems[0].Text); + eventType = (MappingEvent)Enum.Parse(typeof(MappingEvent), item.SubItems[0].Text, true); command = item.SubItems[1].Text; Program.Config.Events.Add(new MappedEvent(eventType, command)); @@ -459,7 +459,7 @@ string description = String.Empty; try { - MceButton temp = (MceButton)Enum.Parse(typeof(MceButton), keyCode); + MceButton temp = (MceButton)Enum.Parse(typeof(MceButton), keyCode, true); description = Enum.GetName(typeof(MceButton), temp); } catch Modified: trunk/plugins/IR Server Suite/Applications/Translator/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2007-08-22 11:31:52 UTC (rev 854) +++ trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2007-08-22 14:37:54 UTC (rev 855) @@ -45,7 +45,7 @@ static bool _inConfiguration; - static TransceiverInfo _transceiverInfo = new TransceiverInfo(); + static IRServerInfo _irServerInfo = new IRServerInfo(); //static Thread _focusWatcher; static IntPtr _currentForegroundWindow = IntPtr.Zero; @@ -66,9 +66,9 @@ set { _handleMessage = value; } } - internal static TransceiverInfo TransceiverInformation + internal static IRServerInfo TransceiverInformation { - get { return _transceiverInfo; } + get { return _irServerInfo; } } #endregion Properties @@ -949,7 +949,7 @@ { IrssLog.Info("Registered to IR Server"); _registered = true; - _transceiverInfo = TransceiverInfo.FromBytes(received.Data); + _irServerInfo = IRServerInfo.FromBytes(received.Data); break; } Modified: trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs 2007-08-22 11:31:52 UTC (rev 854) +++ trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs 2007-08-22 14:37:54 UTC (rev 855) @@ -423,7 +423,7 @@ { IrssLog.Info("Registered to IR Server"); _registered = true; - //_transceiverInfo = TransceiverInfo.FromBytes(received.Data); + //_irServerInfo = TransceiverInfo.FromBytes(received.Data); break; } Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.cs 2007-08-22 11:31:52 UTC (rev 854) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.cs 2007-08-22 14:37:54 UTC (rev 855) @@ -107,7 +107,7 @@ try { key = item.Attributes["shortcut"].Value; - temp.Shortcut = (Keys)Enum.Parse(typeof(Keys), key); + temp.Shortcut = (Keys)Enum.Parse(typeof(Keys), key, true); } catch (ArgumentException) { Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs 2007-08-22 11:31:52 UTC (rev 854) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs 2007-08-22 14:37:54 UTC (rev 855) @@ -486,7 +486,7 @@ { IrssLog.Info("Registered to IR Server"); _registered = true; - //_transceiverInfo = TransceiverInfo.FromBytes(received.Data); + //_irServerInfo = TransceiverInfo.FromBytes(received.Data); break; } Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs 2007-08-22 11:31:52 UTC (rev 854) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs 2007-08-22 14:37:54 UTC (rev 855) @@ -310,7 +310,7 @@ 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.WindowStyle = (ProcessWindowStyle)Enum.Parse(typeof(ProcessWindowStyle), commands[3], true); process.StartInfo.CreateNoWindow = bool.Parse(commands[4]); process.StartInfo.UseShellExecute = bool.Parse(commands[5]); @@ -352,9 +352,9 @@ string comPort = commands[1]; int baudRate = int.Parse(commands[2]); - Parity parity = (Parity)Enum.Parse(typeof(Parity), commands[3]); + Parity parity = (Parity)Enum.Parse(typeof(Parity), commands[3], true); int dataBits = int.Parse(commands[4]); - StopBits stopBits = (StopBits)Enum.Parse(typeof(StopBits), commands[5]); + StopBits stopBits = (StopBits)Enum.Parse(typeof(StopBits), commands[5], true); bool waitForResponse = bool.Parse(commands[6]); SerialPort serialPort = new SerialPort(comPort, baudRate, parity, dataBits, stopBits); Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/ExternalProgram.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/ExternalProgram.cs 2007-08-22 11:31:52 UTC (rev 854) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/ExternalProgram.cs 2007-08-22 14:37:54 UTC (rev 855) @@ -80,7 +80,7 @@ checkBoxWaitForExit.Checked = bool.Parse(commands[6]); checkBoxForceFocus.Checked = bool.Parse(commands[7]); - comboBoxWindowStyle.SelectedItem = ((ProcessWindowStyle)Enum.Parse(typeof(ProcessWindowStyle), commands[3])).ToString(); + comboBoxWindowStyle.SelectedItem = ((ProcessWindowStyle)Enum.Parse(typeof(ProcessWindowStyle), commands[3], true)).ToString(); } else { @@ -156,7 +156,7 @@ process.StartInfo.FileName = textBoxProgram.Text; process.StartInfo.WorkingDirectory = textBoxStartup.Text; process.StartInfo.Arguments = textBoxParameters.Text; - process.StartInfo.WindowStyle = (ProcessWindowStyle)Enum.Parse(typeof(ProcessWindowStyle), comboBoxWindowStyle.SelectedItem as string); + process.StartInfo.WindowStyle = (ProcessWindowStyle)Enum.Parse(typeof(ProcessWindowStyle), comboBoxWindowStyle.SelectedItem as string, true); process.StartInfo.CreateNoWindow = checkBoxNoWindow.Checked; process.StartInfo.UseShellExecute = checkBoxShellExecute.Checked; Added: trunk/plugins/IR Server Suite/Common/IrssUtils/IRServerInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/IRServerInfo.cs (rev 0) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/IRServerInfo.cs 2007-08-22 14:37:54 UTC (rev 855) @@ -0,0 +1,148 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace IrssUtils +{ + + /// <summary> + /// Holds data on an the current capabilities of the IR Server. + /// This class is used to pass information about the IR Server's current capabilities on to the clients. + /// </summary> + public class IRServerInfo + { + + #region Variables + + bool _canLearn; + bool _canReceive; + bool _canTransmit; + + string[] _ports; + + #endregion Variables + + #region Properties + + /// <summary> + /// Can the IR Server learn IR Commands. + /// </summary> + public bool CanLearn + { + get { return _canLearn; } + set { _canLearn = value; } + } + + /// <summary> + /// Can the IR Server receive IR commands. + /// </summary> + public bool CanReceive + { + get { return _canReceive; } + set { _canReceive = value; } + } + + /// <summary> + /// Can the IR Server transmit IR Commands. + /// </summary> + public bool CanTransmit + { + get { return _canTransmit; } + set { _canTransmit = value; } + } + + /// <summary> + /// Available IR transmit ports. + /// </summary> + public string[] Ports + { + get { return _ports; } + set { _ports = value; } + } + + #endregion Properties + + #region Constructors + + public IRServerInfo() + { + _canLearn = false; + _canReceive = false; + _canTransmit = false; + + _ports = new string[] { "None" }; + } + + #endregion Construcors + + #region Methods + + /// <summary> + /// This method returns the byte array representation of this instance. + /// </summary> + /// <returns>Byte array of serialized IRServerInfo object.</returns> + public byte[] ToBytes() + { + try + { + StringBuilder ports = new StringBuilder(); + for (int index = 0; index < _ports.Length; index++) + { + ports.Append(_ports[index]); + if (index < _ports.Length - 1) + ports.Append(','); + } + + string data = String.Format("{0},{1},{2},{3},{4}", + _canLearn, // 0 + _canReceive, // 1 + _canTransmit, // 2 + _ports.Length, // 3 + ports.ToString() // 4 + ); + + return Encoding.ASCII.GetBytes(data); + } + catch + { + return null; + } + } + + /// <summary> + /// Given a byte array this method returns the deserialized IRServerInfo object. + /// </summary> + /// <param name="dataBytes">Byte array of serialized IRServerInfo object.</param> + /// <returns>IRServerInfo object.</returns> + public static IRServerInfo FromBytes(byte[] dataBytes) + { + try + { + string dataString = Encoding.ASCII.GetString(dataBytes); + + string[] data = dataString.Split(new char[] { ',' }); + + IRServerInfo irServerInfo = new IRServerInfo(); + irServerInfo.CanLearn = bool.Parse(data[0]); + irServerInfo.CanReceive = bool.Parse(data[1]); + irServerInfo.CanTransmit = bool.Parse(data[2]); + + int portIndex = 3; + int portCount = int.Parse(data[portIndex]); + irServerInfo.Ports = new string[portCount]; + for (int index = portIndex + 1; index <= portIndex + portCount; index++) + irServerInfo.Ports[index - (portIndex + 1)] = data[index]; + + return irServerInfo; + } + catch + { + return null; + } + } + + #endregion Methods + + } + +} Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/IrssUtils.csproj =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/IrssUtils.csproj 2007-08-22 11:31:52 UTC (rev 854) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/IrssUtils.csproj 2007-08-22 14:37:54 UTC (rev 855) @@ -135,7 +135,7 @@ <DependentUpon>Resources.resx</DependentUpon> </Compile> <Compile Include="SystemRegistry.cs" /> - <Compile Include="TransceiverInfo.cs" /> + <Compile Include="IRServerInfo.cs" /> <Compile Include="Win32.cs" /> <Compile Include="XML.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> Deleted: trunk/plugins/IR Server Suite/Common/IrssUtils/TransceiverInfo.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/TransceiverInfo.cs 2007-08-22 11:31:52 UTC (rev 854) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/TransceiverInfo.cs 2007-08-22 14:37:54 UTC (rev 855) @@ -1,161 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace IrssUtils -{ - - /// <summary> - /// Holds data on an IR Transceiver Device. - /// </summary> - public class TransceiverInfo - { - - #region Variables - - string[] _ports; - - string _name; - bool _canLearn; - bool _canReceive; - bool _canTransmit; - - #endregion Variables - - #region Properties - - /// <summary> - /// Available transmit ports. - /// </summary> - public string[] Ports - { - get { return _ports; } - set { _ports = value; } - } - - /// <summary> - /// Transceiver name. - /// </summary> - public string Name - { - get { return _name; } - set { _name = value; } - } - - /// <summary> - /// Can this transceiver learn IR Commands. - /// </summary> - public bool CanLearn - { - get { return _canLearn; } - set { _canLearn = value; } - } - - /// <summary> - /// Can this transceiver receive button presses. - /// </summary> - public bool CanReceive - { - get { return _canReceive; } - set { _canReceive = value; } - } - - /// <summary> - /// Can this transceiver transmit IR Commands. - /// </summary> - public bool CanTransmit - { - get { return _canTransmit; } - set { _canTransmit = value; } - } - - #endregion Properties - - #region Constructors - - public TransceiverInfo() - { - _ports = new string[] { "None" }; - - _name = "None"; - _canLearn = false; - _canReceive = false; - _canTransmit = false; - } - - #endregion Construcors - - #region Static Methods - - /// <summary> - /// Given a TransceiverInfo object this method returns the byte array representation. - /// </summary> - /// <param name="transceiverInfo">TransceiverInfo object to convert.</param> - /// <returns>Byte array of serialized TransceiverInfo object.</returns> - public static byte[] ToBytes(TransceiverInfo transceiverInfo) - { - try - { - StringBuilder ports = new StringBuilder(); - for (int index = 0; index < transceiverInfo.Ports.Length; index++) - { - ports.Append(transceiverInfo.Ports[index]); - if (index < transceiverInfo.Ports.Length - 1) - ports.Append(','); - } - - string data = String.Format("{0},{1},{2},{3},{4},{5}", - transceiverInfo.Name, // 0 - transceiverInfo.CanLearn, // 1 - transceiverInfo.CanReceive, // 2 - transceiverInfo.CanTransmit, // 3 - transceiverInfo.Ports.Length, // 4 - ports.ToString() // 5 - ); - - return Encoding.ASCII.GetBytes(data); - } - catch - { - return null; - } - } - - /// <summary> - /// Given a byte array this method returns the deserialized TransceiverInfo object. - /// </summary> - /// <param name="dataBytes">Byte array of serialized TransceiverInfo object.</param> - /// <returns>TransceiverInfo object.</returns> - public static TransceiverInfo FromBytes(byte[] dataBytes) - { - try - { - string dataString = Encoding.ASCII.GetString(dataBytes); - - string[] data = dataString.Split(new char[] { ',' }); - - TransceiverInfo transceiverInfo = new TransceiverInfo(); - transceiverInfo.Name = data[0]; - transceiverInfo.CanLearn = bool.Parse(data[1]); - transceiverInfo.CanReceive = bool.Parse(data[2]); - transceiverInfo.CanTransmit = bool.Parse(data[3]); - - int portIndex = 4; - int portCount = int.Parse(data[portIndex]); - transceiverInfo.Ports = new string[portCount]; - for (int index = portIndex + 1; index <= portIndex + portCount; index++) - transceiverInfo.Ports[index - (portIndex + 1)] = data[index]; - - return transceiverInfo; - } - catch - { - return null; - } - } - - #endregion Static Methods - - } - -} Modified: trunk/plugins/IR Server Suite/Common/MPUtils/ExternalChannelConfig.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/MPUtils/ExternalChannelConfig.cs 2007-08-22 11:31:52 UTC (rev 854) +++ trunk/plugins/IR Server Suite/Common/MPUtils/ExternalChannelConfig.cs 2007-08-22 14:37:54 UTC (rev 855) @@ -149,16 +149,16 @@ writer.WriteStartDocument(true); writer.WriteStartElement("config"); // <config> - writer.WriteElementString("PauseTime", PauseTime.ToString()); - writer.WriteElementString("UsePreChangeCommand", UsePreChangeCommand.ToString()); - writer.WriteElementString("SendSelect", SendSelect.ToString()); - writer.WriteElementString("DoubleChannelSelect", DoubleChannelSelect.ToString()); - writer.WriteElementString("ChannelDigits", ChannelDigits.ToString()); - writer.WriteElementString("RepeatChannelCommands", RepeatChannelCommands.ToString()); - writer.WriteElementString("RepeatDelay", RepeatPauseTime.ToString()); + writer.WriteElementString("PauseTime", PauseTime.ToString()); + writer.WriteElementString("UsePreChangeCommand", UsePreChangeCommand.ToString()); + writer.WriteElementString("SendSelect", SendSelect.ToString()); + writer.WriteElementString("DoubleChannelSelect", DoubleChannelSelect.ToString()); + writer.WriteElementString("ChannelDigits", ChannelDigits.ToString()); + writer.WriteElementString("RepeatChannelCommands", RepeatChannelCommands.ToString()); + writer.WriteElementString("RepeatDelay", RepeatPauseTime.ToString()); - writer.WriteElementString("SelectCommand", SelectCommand); - writer.WriteElementString("PreChangeCommand", PreChangeCommand); + writer.WriteElementString("SelectCommand", SelectCommand); + writer.WriteElementString("PreChangeCommand", PreChangeCommand); for (int i = 0; i < 10; i++) writer.WriteElementString("Digit" + i.ToString(), Digits[i]); @@ -217,19 +217,19 @@ XmlDocument doc = new XmlDocument(); doc.Load(fileName); - newECC.PauseTime = GetInt(doc, "PauseTime", DefaultPauseTime); - newECC.UsePreChangeCommand = GetBool(doc, "UsePreChangeCommand", DefaultUsePreChangeCommand); - newECC.SendSelect = GetBool(doc, "SendSelect", DefaultSendSelect); - newECC.DoubleChannelSelect = GetBool(doc, "DoubleChannelSelect", DefaultDoubleChannelSelect); - newECC.RepeatChannelCommands = GetInt(doc, "RepeatChannelCommands", DefaultRepeatChannelCommands); - newECC.ChannelDigits = GetInt(doc, "ChannelDigits", DefaultChannelDigits); - newECC.RepeatPauseTime = GetInt(doc, "RepeatDelay", DefaultRepeatPauseTime); + newECC.PauseTime = GetInt(doc, "PauseTime", DefaultPauseTime); + newECC.UsePreChangeCommand = GetBool(doc, "UsePreChangeCommand", DefaultUsePreChangeCommand); + newECC.SendSelect = GetBool(doc, "SendSelect", DefaultSendSelect); + newECC.DoubleChannelSelect = GetBool(doc, "DoubleChannelSelect", DefaultDoubleChannelSelect); + newECC.RepeatChannelCommands = GetInt(doc, "RepeatChannelCommands", DefaultRepeatChannelCommands); + newECC.ChannelDigits = GetInt(doc, "ChannelDigits", DefaultChannelDigits); + newECC.RepeatPauseTime = GetInt(doc, "RepeatDelay", DefaultRepeatPauseTime); - newECC.SelectCommand = GetString(doc, "SelectCommand", String.Empty); - newECC.PreChangeCommand = GetString(doc, "PreChangeCommand", String.Empty); + newECC.SelectCommand = GetString(doc, "SelectCommand", String.Empty); + newECC.PreChangeCommand = GetString(doc, "PreChangeCommand", String.Empty); for (int index = 0; index < 10; index++) - newECC.Digits[index] = GetString(doc, "Digit" + index.ToString(), String.Empty); + newECC.Digits[index] = GetString(doc, "Digit" + index.ToString(), String.Empty); return newECC; } Modified: trunk/plugins/IR Server Suite/Common/MPUtils/MPCommands.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/MPUtils/MPCommands.cs 2007-08-22 11:31:52 UTC (rev 854) +++ trunk/plugins/IR Server Suite/Common/MPUtils/MPCommands.cs 2007-08-22 14:37:54 UTC (rev 855) @@ -48,7 +48,7 @@ try { - window = (int)Enum.Parse(typeof(GUIWindow.Window), "WINDOW_" + screen); + window = (int)Enum.Parse(typeof(GUIWindow.Window), "WINDOW_" + screen, true); } catch { Modified: trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs 2007-08-22 11:31:52 UTC (rev 854) +++ trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/FusionRemoteReceiver.cs 2007-08-22 14:37:54 UTC (rev 855) @@ -17,13 +17,7 @@ namespace FusionRemoteReceiver { - #region Delegates - - delegate void RemoteEventHandler(byte[] data); - - #endregion Delegates - - public class FusionRemoteReceiver : IIRServerPlugin + public class FusionRemoteReceiver : IRServerPlugin, IRemoteReceiver { #region Constants @@ -32,8 +26,6 @@ Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\IR Server Suite\\IR Server\\FusionRemote Receiver.xml"; - static readonly string[] Ports = new string[] { "None" }; - const string DeviceID = "VID_0FE9&PID_9010"; const UInt32 DIGCF_ALLCLASSES = 0x00000004; @@ -51,7 +43,7 @@ #region Interop - [DllImport("kernel32", SetLastError = true, CharSet = CharSet.Auto)] + [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)] static extern SafeFileHandle CreateFile( [MarshalAs(UnmanagedType.LPTStr)] string fileName, uint fileAccess, @@ -62,12 +54,12 @@ [MarshalAs(UnmanagedType.U4)] EFileAttributes flags, IntPtr templateFile); - [DllImport("kernel32")] + [DllImport("kernel32.dll")] [return: MarshalAs(UnmanagedType.Bool)] static extern bool CancelIo(SafeFileHandle handle); [Flags] - public enum EFileShares + enum EFileShares { None = 0x00000000, Read = 0x00000001, @@ -75,7 +67,7 @@ Delete = 0x00000004, } - public enum ECreationDisposition + enum ECreationDisposition { New = 1, CreateAlways = 2, @@ -140,25 +132,25 @@ public string DevicePath; } - [DllImport("hid")] + [DllImport("hid.dll")] static extern void HidD_GetHidGuid( ref Guid guid); - [DllImport("setupapi", CharSet = CharSet.Auto)] + [DllImport("setupapi.dll", CharSet = CharSet.Auto)] static extern IntPtr SetupDiGetClassDevs( ref Guid ClassGuid, [MarshalAs(UnmanagedType.LPTStr)] string Enumerator, IntPtr hwndParent, UInt32 Flags); - [DllImport("setupapi", SetLastError = true)] + [DllImport("setupapi.dll", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] static extern bool SetupDiEnumDeviceInfo( IntPtr handle, int Index, ref DeviceInfoData deviceInfoData); - [DllImport("setupapi", SetLastError = true)] + [DllImport("setupapi.dll", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] static extern bool SetupDiEnumDeviceInterfaces( IntPtr handle, @@ -167,7 +159,7 @@ int MemberIndex, ref DeviceInterfaceData deviceInterfaceData); - [DllImport("setupapi", SetLastError = true)] + [DllImport("setupapi.dll", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] static extern bool SetupDiGetDeviceInterfaceDetail( IntPtr handle, @@ -177,7 +169,7 @@ ref uint requiredSize, IntPtr unused3); - [DllImport("setupapi", SetLastError = true)] + [DllImport("setupapi.dll", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] static extern bool SetupDiGetDeviceInterfaceDetail( IntPtr handle, @@ -187,7 +179,7 @@ IntPtr unused1, IntPtr unused2); - [DllImport("setupapi")] + [DllImport("setupapi.dll")] [return: MarshalAs(UnmanagedType.Bool)] static extern bool SetupDiDestroyDeviceInfoList(IntPtr handle); @@ -202,36 +194,16 @@ static DateTime _lastCodeTime = DateTime.Now; #endregion Variables - - #region IIRServerPlugin Members - public string Name { get { return "FusionREMOTE"; } } - public string Version { get { return "1.0.3.3"; } } - public string Author { get { return "and-81"; } } - public string Description { get { return "DViCO FusionREMOTE Receiver"; } } - public bool CanReceive { get { return true; } } - public bool CanTransmit { get { return false; } } - public bool CanLearn { get { return false; } } - public bool CanConfigure { get { return false; } } + #region Implementation - public RemoteHandler RemoteCallback - { - get { return _remoteButtonHandler; } - set { _remoteButtonHandler = value; } - } + public override string Name { get { return "FusionREMOTE"; } } + public override string Version { get { return "1.0.3.3"; } } + public override string Author { get { return "and-81"; } } + public override string Description { get { return "DViCO FusionREMOTE Receiver"; } } - public KeyboardHandler KeyboardCallback { get { return null; } set { } } - - public MouseHandler MouseCallback { get { return null; } set { } } - - public string[] AvailablePorts + public override bool Start() { - get { return Ports; } - } - - public void Configure() { } - public bool Start() - { try { OpenDevice(); @@ -248,10 +220,16 @@ return false; } } - public void Suspend() { } - public void Resume() { } - public void Stop() + public override void Suspend() { + Stop(); + } + public override void Resume() + { + Start(); + } + public override void Stop() + { try { _deviceStream.Close(); @@ -263,25 +241,12 @@ } } - public bool Transmit(string file) + public RemoteHandler RemoteCallback { - return false; + get { return _remoteButtonHandler; } + set { _remoteButtonHandler = value; } } - public LearnStatus Learn(out byte[] data) - { - data = null; - return LearnStatus.Failure; - } - public bool SetPort(string port) - { - return true; - } - - #endregion - - #region Implementation - static void OpenDevice() { Guid hidGuid = new Guid(); Modified: trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IRServerPluginInterface.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IRServerPluginInterface.cs 2007-08-22 11:31:52 UTC (rev 854) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IRServerPluginInterface.cs 2007-08-22 14:37:54 UTC (rev 855) @@ -1,9 +1,7 @@ namespace IRServerPluginInterface { - // TODO: Break out Transmit and Receive interfaces into new Interface classes. // TODO: Implement Async learning with callbacks (LearnStart, LearnStatus, LearnDone) or... - // TODO: Implement Learning dialog in each IR Server plugin #region Delegates @@ -54,10 +52,7 @@ #endregion Enumerations - /// <summary> - /// Interface for IR Server plugins to interact with the IR Server. - /// </summary> - public interface IIRServerPlugin + public abstract class IRServerPlugin { #region Properties @@ -65,100 +60,82 @@ /// <summary> /// Name of the IR Server plugin. /// </summary> - string Name { get; } + public abstract string Name { get; } /// <summary> /// IR Server plugin version. /// </summary> - string Version { get; } + public abstract string Version { get; } /// <summary> /// The IR Server plugin's author. /// </summary> - string Author { get; } + public abstract string Author { get; } /// <summary> /// A description of the IR Server plugin. /// </summary> - string Description { get; } + public abstract string Description { get; } - /// <summary> - /// Can this IR Server plugin receive remote button presses. - /// </summary> - bool CanReceive { get; } + #endregion Properties - /// <summary> - /// Can this IR Server plugin transmit infrared commands. - /// </summary> - bool CanTransmit { get; } - - /// <summary> - /// Can this IR Server plugin learn infrared commands. - /// </summary> - bool CanLearn { get; } + #region Methods /// <summary> - /// Does this IR Server plugin have configuration options. + /// Start the IR Server plugin. /// </summary> - bool CanConfigure { get; } + /// <returns>Success.</returns> + public abstract bool Start(); /// <summary> - /// Callback for remote button presses. + /// Suspend the IR Server plugin when computer enters standby. /// </summary> - RemoteHandler RemoteCallback { get; set; } + public abstract void Suspend(); /// <summary> - /// Callback for keyboard presses. + /// Resume the IR Server plugin when the computer returns from standby. /// </summary> - KeyboardHandler KeyboardCallback { get; set; } + public abstract void Resume(); /// <summary> - /// Callback for mouse events. + /// Stop the IR Server plugin. /// </summary> - MouseHandler MouseCallback { get; set; } + public abstract void Stop(); - /// <summary> - /// Lists the available blaster ports. - /// </summary> - string[] AvailablePorts { get; } + #endregion Methods - #endregion + } - #region Interface + public interface IConfigure + { /// <summary> /// Configure the IR Server plugin. /// </summary> void Configure(); - /// <summary> - /// Start the IR Server plugin. - /// </summary> - /// <returns>Success.</returns> - bool Start(); + } - /// <summary> - /// Suspend the IR Server plugin when computer enters standby. - /// </summary> - void Suspend(); + public interface ITransmitIR + { /// <summary> - /// Resume the IR Server plugin when the computer returns from standby. + /// Lists the available blaster ports. /// </summary> - void Resume(); + string[] AvailablePorts { get; } /// <summary> - /// Stop the IR Server plugin. - /// </summary> - void Stop(); - - /// <summary> /// Transmit an infrared command. /// </summary> /// <param name="file">Infrared command file.</param> /// <returns>Success.</returns> - bool Transmit(string file); + bool Transmit(string port, byte[] data); + } + + public interface ILearnIR + { + /// <summary> /// Learn an infrared command. /// </summary> @@ -166,48 +143,36 @@ /// <returns>Tells the calling code if the learn was Successful, Failed or Timed Out.</returns> LearnStatus Learn(out byte[] data); - /// <summary> - /// Set the transmit port to use for infrared command output. - /// </summary> - /// <param name="port">Port to use.</param> - /// <returns>Success.</returns> - bool SetPort(string port); - - #endregion Interface - } - /* - - public interface IConfigurable + public interface IRemoteReceiver { - } + /// <summary> + /// Callback for remote button presses. + /// </summary> + RemoteHandler RemoteCallback { get; set; } - public interface ITransmitIR - { - } - public interface ILearnIR + public interface IKeyboardReceiver { - } + /// <summary> + /// Callback for keyboard presses. + /// </summary> + KeyboardHandler KeyboardCallback { get; set; } - public interface IRemoteReceiver - { - } - public interface IKeyboardReceiver - { - - } - public interface IMouseReceiver { + /// <summary> + /// Callback for mouse events. + /// </summary> + MouseHandler MouseCallback { get; set; } + } - */ } Modified: trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/IRMan Receiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/IRMan Receiver.cs 2007-08-22 11:31:52 UTC (rev 854) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/IRMan Receiver.cs 2007-08-22 14:37:54 UTC (rev 855) @@ -13,7 +13,7 @@ namespace IRManReceiver { - public class IRManReceiver : IIRServerPlugin + public class IRManReceiver : IRServerPlugin, IConfigure, IRemoteReceiver { #region Constants @@ -22,8 +22,6 @@ Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\IR Server Suite\\IR Server\\IRMan Receiver.xml"; - static readonly string[] Ports = new string[] { "None" }; - const int DeviceBufferSize = 6; #endregion Constants @@ -45,50 +43,17 @@ #endregion Variables - #region IIRServerPlugin Members + #region Implementation - public string Name { get { return "IRMan"; } } - public string Version { get { return "1.0.3.3"; } } - public string Author { get { return "and-81"; } } - public string Description { get { return "Receiver support for the Serial IRMan device"; } } - public bool CanReceive { get { return true; } } - public bool CanTransmit { get { return false; } } - public bool CanLearn { get { return false; } } - public bool CanConfigure { get { return true; } } + public override string Name { get { return "IRMan"; } } + public override string Version { get { return "1.0.3.3"; } } + public override string Author { get { return "and-81"; } } + public override string Description { get { return "Receiver support for the Serial IRMan device"; } } - public RemoteHandler RemoteCallback + public override bool Start() { - get { return _remoteButtonHandler; } - set { _remoteButtonHandler = value; } - } - - public KeyboardHandler KeyboardCallback { get { return null; } set { } } - - public MouseHandler MouseCallback { get { return null; } set { } } - - public string[] AvailablePorts { get { return Ports; } } - - public void Configure() - { LoadSettings(); - Configure config = new Configure(); - - config.RepeatDelay = _repeatDelay; - config.CommPort = _serialPortName; - - if (config.ShowDialog() == DialogResult.OK) - { - _repeatDelay = config.RepeatDelay; - _serialPortName = config.CommPort; - - SaveSettings(); - } - } - public bool Start() - { - LoadSettings(); - _deviceBuffer = new byte[DeviceBufferSize]; _serialPort = new SerialPort(_serialPortName, 9600, Parity.None, 8, StopBits.One); @@ -118,10 +83,16 @@ return false; } - public void Suspend() { } - public void Resume() { } - public void Stop() + public override void Suspend() { + Stop(); + } + public override void Resume() + { + Start(); + } + public override void Stop() + { if (_serialPort == null) return; @@ -135,19 +106,30 @@ _serialPort = null; } - public bool Transmit(string file) { return false; } - public LearnStatus Learn(out byte[] data) + public RemoteHandler RemoteCallback { - data = null; - return LearnStatus.Failure; + get { return _remoteButtonHandler; } + set { _remoteButtonHandler = value; } } - public bool SetPort(string port) { return true; } + public void Configure() + { + LoadSettings(); - #endregion IIRServerPlugin Members + Configure config = new Configure(); - #region Implementation + config.RepeatDelay = _repeatDelay; + config.CommPort = _serialPortName; + if (config.ShowDialog() == DialogResult.OK) + { + _repeatDelay = config.RepeatDelay; + _serialPortName = config.CommPort; + + SaveSettings(); + } + } + void SerialPort_DataReceived(object sender, SerialDataReceivedEventArgs e) { try @@ -210,14 +192,14 @@ XmlDocument doc = new XmlDocument(); doc.Load(ConfigurationFile); - _repeatDelay = int.Parse(doc.DocumentElement.Attributes["RepeatDelay"].Value); + _repeatDelay = int.Parse(doc.DocumentElement.Attributes["RepeatDelay"].Value); _serialPortName = doc.DocumentElement.Attributes["SerialPortName"].Value; } catch (Exception ex) { Console.WriteLine(ex.ToString()); - _repeatDelay = 500; + _repeatDelay = 500; _serialPortName = "COM1"; } } Modified: trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/IRTransTransceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/IRTransTransceiver.cs 2007-08-22 11:31:52 UTC (rev 854) +++ trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/IRTransTransceiver.cs 2007-08-22 14:37:54 UTC (rev 855) @@ -18,12 +18,6 @@ namespace IRTransTransceiver { - #region Delegates - - delegate void RemoteEventHandler(byte[] data); - - #endregion Delegates - #region Enumerations public enum IrTransStatus @@ -181,7 +175,7 @@ */ #endregion Interop Structures - public class IRTransTransceiver : IIRServerPlugin + public class IRTransTransceiver : IRServerPlugin, IConfigure, IRemoteReceiver { #region Constants @@ -190,8 +184,6 @@ Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\IR Server Suite\\IR Server\\IRTrans Transceiver.xml"; - static readonly string[] Ports = new string[] { "Default" }; - const string DefaultRemoteModel = "mediacenter"; const string DefaultServerAddress = "localhost"; const int DefaultServerPort = 21000; @@ -205,8 +197,6 @@ static RemoteHandler _remoteButtonHandler = null; - static string _blasterPort = Ports[0]; - static Socket _socket; static IAsyncResult _asynResult; static AsyncCallback _pfnCallBack; @@ -215,56 +205,18 @@ static int _irTransServerPort; #endregion Variables - - #region IIRServerPlugin Members - public string Name { get { return "IRTrans (Experimental)"; } } - public string Version { get { return "1.0.3.3"; } } - public string Author { get { return "and-81"; } } - public string Description { get { return "IRTra... [truncated message content] |
From: <lk...@us...> - 2007-08-22 11:31:56
|
Revision: 854 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=854&view=rev Author: lkuech Date: 2007-08-22 04:31:52 -0700 (Wed, 22 Aug 2007) Log Message: ----------- On the way to v0.3. Implementatio of a FallbackRule! Modified Paths: -------------- trunk/plugins/ViewModeSwitcher/PlugInBase.cs trunk/plugins/ViewModeSwitcher/Settings.cs trunk/plugins/ViewModeSwitcher/ViewModeSwitcher.cs trunk/plugins/ViewModeSwitcher/ViewModeSwitcherConfig.Designer.cs trunk/plugins/ViewModeSwitcher/ViewModeSwitcherConfig.cs trunk/plugins/ViewModeSwitcher/ViewModeSwitcherConfig.resx trunk/plugins/ViewModeSwitcher/ViewModeSwitcherHelper.suo trunk/plugins/ViewModeSwitcher/ViewModeSwitcherHelperTV02/Properties/AssemblyInfo.cs trunk/plugins/ViewModeSwitcher/ViewModeSwitcherHelperTV02/ViewModeSwitcherHelper.suo trunk/plugins/ViewModeSwitcher/ViewModeSwitcherHelperTV02/ViewModeSwitcherHelperTVE2.csproj trunk/plugins/ViewModeSwitcher/ViewModeSwitcherHelperTV03/Properties/AssemblyInfo.cs trunk/plugins/ViewModeSwitcher/ViewModeSwitcherHelperTV03/ViewModeSwitcherHelper.sln trunk/plugins/ViewModeSwitcher/ViewModeSwitcherHelperTV03/ViewModeSwitcherHelper.suo trunk/plugins/ViewModeSwitcher/ViewModeSwitcherHelperTV03/ViewModeSwitcherHelperTVE3.csproj trunk/plugins/ViewModeSwitcher/ViewModeSwitcherRuleDetail.cs Modified: trunk/plugins/ViewModeSwitcher/PlugInBase.cs =================================================================== --- trunk/plugins/ViewModeSwitcher/PlugInBase.cs 2007-08-22 05:26:54 UTC (rev 853) +++ trunk/plugins/ViewModeSwitcher/PlugInBase.cs 2007-08-22 11:31:52 UTC (rev 854) @@ -55,7 +55,7 @@ public int GetWindowId() { - return 4711667; + return -1; } public bool CanEnable() Modified: trunk/plugins/ViewModeSwitcher/Settings.cs =================================================================== --- trunk/plugins/ViewModeSwitcher/Settings.cs 2007-08-22 05:26:54 UTC (rev 853) +++ trunk/plugins/ViewModeSwitcher/Settings.cs 2007-08-22 11:31:52 UTC (rev 854) @@ -32,6 +32,8 @@ public bool verboseLog = false; public bool ShowSwitchMsg = false; public bool SuppressInitialMsg = false; + public bool UseFallbackRule = false; + public Geometry.Type FallBackViewMode = Geometry.Type.Normal; public bool DisableLBGlobaly = false; public int LBCheckInterval = 3000; public bool UpperBoxEnabled = true; @@ -59,6 +61,8 @@ string ParmRulePrefix = "parmrule"; string ParmShowSwitchMsg = "parmshowswitchmsg"; string ParmSuppressInitalMsg = "parmsuppressinitialmsg"; + string ParmUseFallbackRule = "parmusefallbackrule"; + string ParmFallbackViewMode = "parmfallbackviewmode"; string ParmDisableLBGlobaly = "parmdisablelbglobaly"; string ParmLBCheckInterval = "parmlbcheckinterval"; string ParmUpBoxEnabled = "parmupboxenabled"; @@ -79,7 +83,31 @@ string ParmVOffset14_9 = "parmvoffset149"; string ParmVOffsetWide14_9 = "parmvoffsetwide149"; public static string ParmTVChannelPrefix = "parmtvchannelprefix"; - + + public static Geometry.Type StringToViewMode(string strViewmode) + { + Geometry.Type ret = Geometry.Type.Normal; + + switch (strViewmode) + { + case "Zoom": ret = Geometry.Type.Zoom; + break; + case "Normal": ret = Geometry.Type.Normal; + break; + case "Stretch": ret = Geometry.Type.Stretch; + break; + case "Original": ret = Geometry.Type.Original; + break; + case "LetterBox43": ret = Geometry.Type.LetterBox43; + break; + case "PanScan43": ret = Geometry.Type.PanScan43; + break; + case "Zoom14to9": ret = Geometry.Type.Zoom14to9; + break; + } + return ret; + } + /// <summary> /// load settings from MediaPortal configuration /// </summary> @@ -105,24 +133,7 @@ tmpRule.MaxHeight = Convert.ToInt16(reader.GetValueAsString(ViewModeSwitcherSectionName, ParmRulePrefix + i.ToString() + "MaxHeight", "0")); tmpRule.ChangeAR = reader.GetValueAsBool(ViewModeSwitcherSectionName, ParmRulePrefix + i.ToString() + "ChangeAR", true); String tmpViewMode = reader.GetValueAsString(ViewModeSwitcherSectionName, ParmRulePrefix + i.ToString() + "ViewMode", "Normal"); - - switch (tmpViewMode) - { - case "Zoom": tmpRule.ViewMode = Geometry.Type.Zoom; - break; - case "Normal": tmpRule.ViewMode = Geometry.Type.Normal; - break; - case "Stretch": tmpRule.ViewMode = Geometry.Type.Stretch; - break; - case "Original": tmpRule.ViewMode = Geometry.Type.Original; - break; - case "LetterBox43": tmpRule.ViewMode = Geometry.Type.LetterBox43; - break; - case "PanScan43": tmpRule.ViewMode = Geometry.Type.PanScan43; - break; - case "Zoom14to9": tmpRule.ViewMode = Geometry.Type.Zoom14to9; - break; - } + tmpRule.ViewMode = StringToViewMode(tmpViewMode); tmpRule.ChangeOs = reader.GetValueAsBool(ViewModeSwitcherSectionName, ParmRulePrefix + i.ToString() + "ChangeOS", true); tmpRule.OverScan = Convert.ToInt16(reader.GetValueAsString(ViewModeSwitcherSectionName, ParmRulePrefix + i.ToString() + "Overscan", "0")); tmpRule.EnableLBDetection = reader.GetValueAsBool(ViewModeSwitcherSectionName, ParmRulePrefix + i.ToString() + "EnableLBDetection", false); @@ -136,6 +147,9 @@ verboseLog = reader.GetValueAsBool(ViewModeSwitcherSectionName, ParmVerboselog, false); ShowSwitchMsg = reader.GetValueAsBool(ViewModeSwitcherSectionName, ParmShowSwitchMsg, false); SuppressInitialMsg = reader.GetValueAsBool(ViewModeSwitcherSectionName, ParmSuppressInitalMsg, false); + UseFallbackRule = reader.GetValueAsBool(ViewModeSwitcherSectionName, ParmUseFallbackRule, false); + String tmpFallbackViewMode = reader.GetValueAsString(ViewModeSwitcherSectionName, ParmFallbackViewMode, "Normal"); + FallBackViewMode = StringToViewMode(tmpFallbackViewMode); DisableLBGlobaly = reader.GetValueAsBool(ViewModeSwitcherSectionName, ParmDisableLBGlobaly, false); LBCheckInterval = reader.GetValueAsInt(ViewModeSwitcherSectionName, ParmLBCheckInterval, 3000); @@ -173,6 +187,9 @@ xmlwriter.SetValueAsBool(ViewModeSwitcherSectionName, ParmVerboselog, verboseLog); xmlwriter.SetValueAsBool(ViewModeSwitcherSectionName, ParmShowSwitchMsg, ShowSwitchMsg); xmlwriter.SetValueAsBool(ViewModeSwitcherSectionName, ParmSuppressInitalMsg, SuppressInitialMsg); + xmlwriter.SetValueAsBool(ViewModeSwitcherSectionName, ParmUseFallbackRule, UseFallbackRule); + xmlwriter.SetValue(ViewModeSwitcherSectionName, ParmFallbackViewMode, FallBackViewMode.ToString()); + // write ruleset xmlwriter.SetValue(ViewModeSwitcherSectionName, ParmRuleCount, ViewModeRules.Count.ToString()); Modified: trunk/plugins/ViewModeSwitcher/ViewModeSwitcher.cs =================================================================== --- trunk/plugins/ViewModeSwitcher/ViewModeSwitcher.cs 2007-08-22 05:26:54 UTC (rev 853) +++ trunk/plugins/ViewModeSwitcher/ViewModeSwitcher.cs 2007-08-22 11:31:52 UTC (rev 854) @@ -134,7 +134,8 @@ { if (MenuShown) return; MenuShown = true; - RecentGuiWindowID = GUIWindowManager.ActiveWindow; + //RecentGuiWindowID = GUIWindowManager.RoutedWindow; + //Debug.WriteLine("Rooted: " + RecentGuiWindowID.ToString()); #region MainMenu @@ -168,6 +169,8 @@ #endregion + //Debug.WriteLine("After MainMenu: " + GUIWindowManager.RoutedWindow); + if (Menu.SelectedLabel == -1) return; switch (Menu.SelectedLabel) @@ -260,7 +263,7 @@ private void ShowMenu_WorkCompleted(object sender, System.ComponentModel.RunWorkerCompletedEventArgs e) { backgroundMenuWorker.Dispose(); - if (RecentGuiWindowID != 0) GUIWindowManager.RouteToWindow(RecentGuiWindowID); + //if (RecentGuiWindowID != 0) GUIWindowManager.RouteToWindow(RecentGuiWindowID); MenuShown = false; } @@ -438,6 +441,7 @@ && height >= tmpRule.MinHeight && height <= tmpRule.MaxHeight) { + CurrentRule = i; if (AspectRatio != LastSwitchedAspectRatio) { Log.Info("Rule \"" + tmpRule.Name + "\" fits conditions."); @@ -475,11 +479,47 @@ LetterboxActive = false; continue; } - CurrentRule = i; + break; // do not process any additional rule after a rule fits (better for offset function) } } + //process the fallback rule if no other rule has fitted + if (currentSettings.UseFallbackRule && CurrentRule == -1 && height != 100 && width != 100) + { + Log.Info("Processing the fallback rule!"); + if (AspectRatio != LastSwitchedAspectRatio) + { + CropSettings tmpCropSettings = new CropSettings(0, 0, 0, 0); + SetCropMode(tmpCropSettings); + SetAspectRatio("Fallback rule", currentSettings.FallBackViewMode); + LastSwitchedAspectRatio = AspectRatio; + } + } + + // Do something after the rules have been scanned + if (curZoomMode != GUIGraphicsContext.ARType) + { + curZoomMode = GUIGraphicsContext.ARType; + if (currentSettings.verboseLog) Log.Info("The viewmode has been change to {0}", curZoomMode); + SetZoomModeOffset(curZoomMode); + } + + if (TVstatusWrapper.IsViewingTV()) + { + string tmpChannelName = TVstatusWrapper.GetChannelName(); + if (curTVChannelName != tmpChannelName) + { + curTVChannelName = tmpChannelName; + if (currentSettings.verboseLog) Log.Info("The TV channel is now: {0}", curTVChannelName); + + LastSwitchedAspectRatio = 0f; + LastLetterboxDetectionResult = false; + LBDetections = 0; + } + } + else curTVChannelName = ""; + } /// <summary> @@ -730,6 +770,7 @@ msg.Message = GUIMessage.MessageType.GUI_MSG_PLANESCENE_CROP; msg.Object = newCropSettings; GUIWindowManager.SendMessage(msg); + } /// <summary> @@ -799,36 +840,8 @@ { ProcessRules(ARCalc, g_Player.Width, g_Player.Height); // check if a rule fits the conditions and process it } - //else Thread.Sleep(2500); + else Thread.Sleep(2500); - // Do something after the rules have been scanned - if (curZoomMode != GUIGraphicsContext.ARType) - { - curZoomMode = GUIGraphicsContext.ARType; - if (currentSettings.verboseLog) Log.Info("The viewmode has been change to {0}", curZoomMode); - SetZoomModeOffset(curZoomMode); - } - - if (TVstatusWrapper.IsViewingTV()) - { - string tmpChannelName = TVstatusWrapper.GetChannelName(); - if (curTVChannelName != tmpChannelName) - { - curTVChannelName = tmpChannelName; - if (currentSettings.verboseLog) Log.Info("The TV channel is now: {0}", curTVChannelName); - - LastSwitchedAspectRatio = 0f; - LastLetterboxDetectionResult = false; - LBDetections = 0; - - if (IsCurrentChannelViewSpecial()) - { - if (currentSettings.verboseLog) Log.Info("There is a special offset defined for {0} and {1}",curTVChannelName,GUIGraphicsContext.ARType); - SetVisibleWindowPos(GetSpecialChannelOffset(curTVChannelName, GUIGraphicsContext.ARType)); - } - } - } - else curTVChannelName = ""; } PlaybackJustStarted = false; Thread.Sleep(500); @@ -999,8 +1012,13 @@ } } - if (!(LetterboxActive && currentSettings.LBOverScanEnabled && zoomMode == Geometry.Type.Zoom) ) + if (IsCurrentChannelViewSpecial()) { + if (currentSettings.verboseLog) Log.Info("There is a special offset defined for {0} and {1}", curTVChannelName, zoomMode); + tmpOffset = GetSpecialChannelOffset(curTVChannelName, zoomMode); + } + else if(!(LetterboxActive && currentSettings.LBOverScanEnabled && zoomMode == Geometry.Type.Zoom) ) + { if (currentSettings.verboseLog) Log.Info("The offset for zoom mode {0} is {1}", zoomMode, tmpOffset); SetVisibleWindowPos(tmpOffset); } Modified: trunk/plugins/ViewModeSwitcher/ViewModeSwitcherConfig.Designer.cs =================================================================== --- trunk/plugins/ViewModeSwitcher/ViewModeSwitcherConfig.Designer.cs 2007-08-22 05:26:54 UTC (rev 853) +++ trunk/plugins/ViewModeSwitcher/ViewModeSwitcherConfig.Designer.cs 2007-08-22 11:31:52 UTC (rev 854) @@ -57,6 +57,19 @@ this.bDelete = new System.Windows.Forms.Button(); this.button1 = new System.Windows.Forms.Button(); this.dg_RuleSets = new System.Windows.Forms.DataGridView(); + this.ColEnabled = new System.Windows.Forms.DataGridViewCheckBoxColumn(); + this.ColRuleName = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.ColARFrom = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.ColARTo = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.ColMinWidth = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.ColMaxWidth = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.ColMinHeight = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.ColMaxHeight = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.ColChangeAR = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.ColViewMode = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.ColChangeOS = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.ColOverscan = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.ColEnableLBDetect = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.bCancel = new System.Windows.Forms.Button(); this.cbVerboseLog = new System.Windows.Forms.CheckBox(); this.linkLabelForum = new System.Windows.Forms.LinkLabel(); @@ -97,19 +110,8 @@ this.label16 = new System.Windows.Forms.Label(); this.label17 = new System.Windows.Forms.Label(); this.label19 = new System.Windows.Forms.Label(); - this.ColEnabled = new System.Windows.Forms.DataGridViewCheckBoxColumn(); - this.ColRuleName = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.ColARFrom = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.ColARTo = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.ColMinWidth = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.ColMaxWidth = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.ColMinHeight = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.ColMaxHeight = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.ColChangeAR = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.ColViewMode = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.ColChangeOS = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.ColOverscan = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.ColEnableLBDetect = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.cbUseFallbackRule = new System.Windows.Forms.CheckBox(); + this.cmbViewMode = new System.Windows.Forms.ComboBox(); this.groupBox1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dg_RuleSets)).BeginInit(); this.groupBox2.SuspendLayout(); @@ -119,7 +121,7 @@ // bOK // this.bOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.bOK.Location = new System.Drawing.Point(738, 435); + this.bOK.Location = new System.Drawing.Point(738, 452); this.bOK.Name = "bOK"; this.bOK.Size = new System.Drawing.Size(44, 23); this.bOK.TabIndex = 1; @@ -131,6 +133,8 @@ // this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); + this.groupBox1.Controls.Add(this.cmbViewMode); + this.groupBox1.Controls.Add(this.cbUseFallbackRule); this.groupBox1.Controls.Add(this.label1); this.groupBox1.Controls.Add(this.cbSuppressInitialMsg); this.groupBox1.Controls.Add(this.cbShowSwitchMsg); @@ -140,7 +144,7 @@ this.groupBox1.Controls.Add(this.dg_RuleSets); this.groupBox1.Location = new System.Drawing.Point(12, 35); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(770, 243); + this.groupBox1.Size = new System.Drawing.Size(770, 273); this.groupBox1.TabIndex = 1; this.groupBox1.TabStop = false; // @@ -149,7 +153,7 @@ this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.label1.AutoSize = true; this.label1.ForeColor = System.Drawing.Color.Red; - this.label1.Location = new System.Drawing.Point(3, 219); + this.label1.Location = new System.Drawing.Point(3, 249); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(568, 13); this.label1.TabIndex = 7; @@ -237,10 +241,114 @@ this.dg_RuleSets.Size = new System.Drawing.Size(758, 150); this.dg_RuleSets.TabIndex = 0; // + // ColEnabled + // + this.ColEnabled.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; + this.ColEnabled.HeaderText = "Enabled"; + this.ColEnabled.Name = "ColEnabled"; + this.ColEnabled.ReadOnly = true; + this.ColEnabled.Width = 52; + // + // ColRuleName + // + this.ColRuleName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; + this.ColRuleName.HeaderText = "Name"; + this.ColRuleName.Name = "ColRuleName"; + this.ColRuleName.ReadOnly = true; + this.ColRuleName.Width = 60; + // + // ColARFrom + // + this.ColARFrom.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; + this.ColARFrom.HeaderText = "AR From"; + this.ColARFrom.Name = "ColARFrom"; + this.ColARFrom.ReadOnly = true; + this.ColARFrom.Width = 73; + // + // ColARTo + // + this.ColARTo.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; + this.ColARTo.HeaderText = "AR To"; + this.ColARTo.Name = "ColARTo"; + this.ColARTo.ReadOnly = true; + this.ColARTo.Width = 63; + // + // ColMinWidth + // + this.ColMinWidth.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; + this.ColMinWidth.HeaderText = "MinWidth"; + this.ColMinWidth.Name = "ColMinWidth"; + this.ColMinWidth.ReadOnly = true; + this.ColMinWidth.Width = 77; + // + // ColMaxWidth + // + this.ColMaxWidth.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; + this.ColMaxWidth.HeaderText = "MaxWidth"; + this.ColMaxWidth.Name = "ColMaxWidth"; + this.ColMaxWidth.ReadOnly = true; + this.ColMaxWidth.Width = 80; + // + // ColMinHeight + // + this.ColMinHeight.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; + this.ColMinHeight.HeaderText = "MinHeight"; + this.ColMinHeight.Name = "ColMinHeight"; + this.ColMinHeight.ReadOnly = true; + this.ColMinHeight.Width = 80; + // + // ColMaxHeight + // + this.ColMaxHeight.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; + this.ColMaxHeight.HeaderText = "MaxHeight"; + this.ColMaxHeight.Name = "ColMaxHeight"; + this.ColMaxHeight.ReadOnly = true; + this.ColMaxHeight.Width = 83; + // + // ColChangeAR + // + this.ColChangeAR.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; + this.ColChangeAR.HeaderText = "ChangeAR"; + this.ColChangeAR.Name = "ColChangeAR"; + this.ColChangeAR.ReadOnly = true; + this.ColChangeAR.Width = 84; + // + // ColViewMode + // + this.ColViewMode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; + this.ColViewMode.HeaderText = "ViewMode"; + this.ColViewMode.Name = "ColViewMode"; + this.ColViewMode.ReadOnly = true; + this.ColViewMode.Width = 82; + // + // ColChangeOS + // + this.ColChangeOS.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; + this.ColChangeOS.HeaderText = "ChangeOS"; + this.ColChangeOS.Name = "ColChangeOS"; + this.ColChangeOS.ReadOnly = true; + this.ColChangeOS.Width = 84; + // + // ColOverscan + // + this.ColOverscan.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; + this.ColOverscan.HeaderText = "Overscan"; + this.ColOverscan.Name = "ColOverscan"; + this.ColOverscan.ReadOnly = true; + this.ColOverscan.Width = 78; + // + // ColEnableLBDetect + // + this.ColEnableLBDetect.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; + this.ColEnableLBDetect.HeaderText = "LB Detection"; + this.ColEnableLBDetect.Name = "ColEnableLBDetect"; + this.ColEnableLBDetect.ReadOnly = true; + this.ColEnableLBDetect.Width = 94; + // // bCancel // this.bCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.bCancel.Location = new System.Drawing.Point(682, 435); + this.bCancel.Location = new System.Drawing.Point(682, 452); this.bCancel.Name = "bCancel"; this.bCancel.Size = new System.Drawing.Size(50, 23); this.bCancel.TabIndex = 0; @@ -303,7 +411,7 @@ this.groupBox2.Controls.Add(this.label9); this.groupBox2.Controls.Add(this.label8); this.groupBox2.Controls.Add(this.cbLBOverScan); - this.groupBox2.Location = new System.Drawing.Point(12, 294); + this.groupBox2.Location = new System.Drawing.Point(12, 314); this.groupBox2.Name = "groupBox2"; this.groupBox2.Size = new System.Drawing.Size(770, 133); this.groupBox2.TabIndex = 8; @@ -613,7 +721,7 @@ // this.label16.AutoSize = true; this.label16.ForeColor = System.Drawing.Color.Red; - this.label16.Location = new System.Drawing.Point(27, 432); + this.label16.Location = new System.Drawing.Point(27, 452); this.label16.Name = "label16"; this.label16.Size = new System.Drawing.Size(177, 13); this.label16.TabIndex = 32; @@ -623,7 +731,7 @@ // this.label17.AutoSize = true; this.label17.ForeColor = System.Drawing.Color.Red; - this.label17.Location = new System.Drawing.Point(27, 448); + this.label17.Location = new System.Drawing.Point(27, 468); this.label17.Name = "label17"; this.label17.Size = new System.Drawing.Size(73, 13); this.label17.TabIndex = 33; @@ -634,121 +742,38 @@ this.label19.AutoSize = true; this.label19.Font = new System.Drawing.Font("Microsoft Sans Serif", 28F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label19.ForeColor = System.Drawing.Color.Red; - this.label19.Location = new System.Drawing.Point(10, 424); + this.label19.Location = new System.Drawing.Point(10, 444); this.label19.Name = "label19"; this.label19.Size = new System.Drawing.Size(32, 44); this.label19.TabIndex = 34; this.label19.Text = "!"; // - // ColEnabled + // cbUseFallbackRule // - this.ColEnabled.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; - this.ColEnabled.HeaderText = "Enabled"; - this.ColEnabled.Name = "ColEnabled"; - this.ColEnabled.ReadOnly = true; - this.ColEnabled.Width = 52; + this.cbUseFallbackRule.AutoSize = true; + this.cbUseFallbackRule.Location = new System.Drawing.Point(6, 220); + this.cbUseFallbackRule.Name = "cbUseFallbackRule"; + this.cbUseFallbackRule.Size = new System.Drawing.Size(430, 17); + this.cbUseFallbackRule.TabIndex = 8; + this.cbUseFallbackRule.Text = "Automatically use the following viewmode if non of the above mentioned rules does" + + " fit:"; + this.cbUseFallbackRule.UseVisualStyleBackColor = true; + this.cbUseFallbackRule.CheckedChanged += new System.EventHandler(this.cbUseFallbackRule_CheckedChanged); // - // ColRuleName + // cmbViewMode // - this.ColRuleName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; - this.ColRuleName.HeaderText = "Name"; - this.ColRuleName.Name = "ColRuleName"; - this.ColRuleName.ReadOnly = true; - this.ColRuleName.Width = 60; + this.cmbViewMode.Enabled = false; + this.cmbViewMode.FormattingEnabled = true; + this.cmbViewMode.Location = new System.Drawing.Point(450, 218); + this.cmbViewMode.Name = "cmbViewMode"; + this.cmbViewMode.Size = new System.Drawing.Size(121, 21); + this.cmbViewMode.TabIndex = 9; // - // ColARFrom - // - this.ColARFrom.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; - this.ColARFrom.HeaderText = "AR From"; - this.ColARFrom.Name = "ColARFrom"; - this.ColARFrom.ReadOnly = true; - this.ColARFrom.Width = 73; - // - // ColARTo - // - this.ColARTo.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; - this.ColARTo.HeaderText = "AR To"; - this.ColARTo.Name = "ColARTo"; - this.ColARTo.ReadOnly = true; - this.ColARTo.Width = 63; - // - // ColMinWidth - // - this.ColMinWidth.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; - this.ColMinWidth.HeaderText = "MinWidth"; - this.ColMinWidth.Name = "ColMinWidth"; - this.ColMinWidth.ReadOnly = true; - this.ColMinWidth.Width = 77; - // - // ColMaxWidth - // - this.ColMaxWidth.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; - this.ColMaxWidth.HeaderText = "MaxWidth"; - this.ColMaxWidth.Name = "ColMaxWidth"; - this.ColMaxWidth.ReadOnly = true; - this.ColMaxWidth.Width = 80; - // - // ColMinHeight - // - this.ColMinHeight.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; - this.ColMinHeight.HeaderText = "MinHeight"; - this.ColMinHeight.Name = "ColMinHeight"; - this.ColMinHeight.ReadOnly = true; - this.ColMinHeight.Width = 80; - // - // ColMaxHeight - // - this.ColMaxHeight.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; - this.ColMaxHeight.HeaderText = "MaxHeight"; - this.ColMaxHeight.Name = "ColMaxHeight"; - this.ColMaxHeight.ReadOnly = true; - this.ColMaxHeight.Width = 83; - // - // ColChangeAR - // - this.ColChangeAR.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; - this.ColChangeAR.HeaderText = "ChangeAR"; - this.ColChangeAR.Name = "ColChangeAR"; - this.ColChangeAR.ReadOnly = true; - this.ColChangeAR.Width = 84; - // - // ColViewMode - // - this.ColViewMode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; - this.ColViewMode.HeaderText = "ViewMode"; - this.ColViewMode.Name = "ColViewMode"; - this.ColViewMode.ReadOnly = true; - this.ColViewMode.Width = 82; - // - // ColChangeOS - // - this.ColChangeOS.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; - this.ColChangeOS.HeaderText = "ChangeOS"; - this.ColChangeOS.Name = "ColChangeOS"; - this.ColChangeOS.ReadOnly = true; - this.ColChangeOS.Width = 84; - // - // ColOverscan - // - this.ColOverscan.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; - this.ColOverscan.HeaderText = "Overscan"; - this.ColOverscan.Name = "ColOverscan"; - this.ColOverscan.ReadOnly = true; - this.ColOverscan.Width = 78; - // - // ColEnableLBDetect - // - this.ColEnableLBDetect.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; - this.ColEnableLBDetect.HeaderText = "LB Detection"; - this.ColEnableLBDetect.Name = "ColEnableLBDetect"; - this.ColEnableLBDetect.ReadOnly = true; - this.ColEnableLBDetect.Width = 94; - // // ViewModeSwitcherConfig // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(794, 470); + this.ClientSize = new System.Drawing.Size(794, 487); this.Controls.Add(this.groupBox2); this.Controls.Add(this.label17); this.Controls.Add(this.label16); @@ -762,6 +787,7 @@ this.Name = "ViewModeSwitcherConfig"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "ViewModeSwitcherConfig - V0.3"; + this.Load += new System.EventHandler(this.ViewModeSwitcherConfig_Load); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.dg_RuleSets)).EndInit(); @@ -837,5 +863,7 @@ private System.Windows.Forms.DataGridViewTextBoxColumn ColChangeOS; private System.Windows.Forms.DataGridViewTextBoxColumn ColOverscan; private System.Windows.Forms.DataGridViewTextBoxColumn ColEnableLBDetect; + private System.Windows.Forms.CheckBox cbUseFallbackRule; + private System.Windows.Forms.ComboBox cmbViewMode; } } \ No newline at end of file Modified: trunk/plugins/ViewModeSwitcher/ViewModeSwitcherConfig.cs =================================================================== --- trunk/plugins/ViewModeSwitcher/ViewModeSwitcherConfig.cs 2007-08-22 05:26:54 UTC (rev 853) +++ trunk/plugins/ViewModeSwitcher/ViewModeSwitcherConfig.cs 2007-08-22 11:31:52 UTC (rev 854) @@ -48,6 +48,8 @@ this.cbVerboseLog.Checked = currentSettings.verboseLog; this.cbShowSwitchMsg.Checked = currentSettings.ShowSwitchMsg; this.cbSuppressInitialMsg.Checked = currentSettings.SuppressInitialMsg; + cbUseFallbackRule.Checked = currentSettings.UseFallbackRule; + cmbViewMode.Text = currentSettings.FallBackViewMode.ToString(); ReBuildDataGrid(); @@ -81,6 +83,8 @@ currentSettings.verboseLog = cbVerboseLog.Checked; currentSettings.ShowSwitchMsg = cbShowSwitchMsg.Checked; currentSettings.SuppressInitialMsg = cbSuppressInitialMsg.Checked; + currentSettings.UseFallbackRule = cbUseFallbackRule.Checked; + currentSettings.FallBackViewMode = ViewModeswitcherSettings.StringToViewMode(cmbViewMode.Text); currentSettings.DisableLBGlobaly = cbDisableLBGlobaly.Checked; currentSettings.LBCheckInterval = (int)uadLBCeckInterval.Value; @@ -199,6 +203,47 @@ } } + private void ViewModeSwitcherConfig_Load(object sender, EventArgs e) + { + cmbViewMode.Items.Clear(); + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + { + if (xmlreader.GetValueAsBool("mytv", "allowarzoom", true)) + { + cmbViewMode.Items.Add(MediaPortal.GUI.Library.Geometry.Type.Zoom.ToString()); + } + if (xmlreader.GetValueAsBool("mytv", "allowarstretch", true)) + { + cmbViewMode.Items.Add(MediaPortal.GUI.Library.Geometry.Type.Stretch.ToString()); + } + if (xmlreader.GetValueAsBool("mytv", "allowarnormal", true)) + { + cmbViewMode.Items.Add(MediaPortal.GUI.Library.Geometry.Type.Normal.ToString()); + } + if (xmlreader.GetValueAsBool("mytv", "allowaroriginal", true)) + { + cmbViewMode.Items.Add(MediaPortal.GUI.Library.Geometry.Type.Original.ToString()); + } + if (xmlreader.GetValueAsBool("mytv", "allowarletterbox", true)) + { + cmbViewMode.Items.Add(MediaPortal.GUI.Library.Geometry.Type.LetterBox43.ToString()); + } + if (xmlreader.GetValueAsBool("mytv", "allowarpanscan", true)) + { + cmbViewMode.Items.Add(MediaPortal.GUI.Library.Geometry.Type.PanScan43.ToString()); + } + if (xmlreader.GetValueAsBool("mytv", "allowarzoom149", true)) + { + cmbViewMode.Items.Add(MediaPortal.GUI.Library.Geometry.Type.Zoom14to9.ToString()); + } + } + } + private void cbUseFallbackRule_CheckedChanged(object sender, EventArgs e) + { + cmbViewMode.Enabled = cbUseFallbackRule.Checked; + } + + } } \ No newline at end of file Modified: trunk/plugins/ViewModeSwitcher/ViewModeSwitcherConfig.resx =================================================================== --- trunk/plugins/ViewModeSwitcher/ViewModeSwitcherConfig.resx 2007-08-22 05:26:54 UTC (rev 853) +++ trunk/plugins/ViewModeSwitcher/ViewModeSwitcherConfig.resx 2007-08-22 11:31:52 UTC (rev 854) @@ -156,4 +156,43 @@ <metadata name="ColEnableLBDetect.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>True</value> </metadata> + <metadata name="ColEnabled.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>True</value> + </metadata> + <metadata name="ColRuleName.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>True</value> + </metadata> + <metadata name="ColARFrom.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>True</value> + </metadata> + <metadata name="ColARTo.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>True</value> + </metadata> + <metadata name="ColMinWidth.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>True</value> + </metadata> + <metadata name="ColMaxWidth.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>True</value> + </metadata> + <metadata name="ColMinHeight.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>True</value> + </metadata> + <metadata name="ColMaxHeight.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>True</value> + </metadata> + <metadata name="ColChangeAR.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>True</value> + </metadata> + <metadata name="ColViewMode.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>True</value> + </metadata> + <metadata name="ColChangeOS.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>True</value> + </metadata> + <metadata name="ColOverscan.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>True</value> + </metadata> + <metadata name="ColEnableLBDetect.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>True</value> + </metadata> </root> \ No newline at end of file Modified: trunk/plugins/ViewModeSwitcher/ViewModeSwitcherHelper.suo =================================================================== (Binary files differ) Modified: trunk/plugins/ViewModeSwitcher/ViewModeSwitcherHelperTV02/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/ViewModeSwitcher/ViewModeSwitcherHelperTV02/Properties/AssemblyInfo.cs 2007-08-22 05:26:54 UTC (rev 853) +++ trunk/plugins/ViewModeSwitcher/ViewModeSwitcherHelperTV02/Properties/AssemblyInfo.cs 2007-08-22 11:31:52 UTC (rev 854) @@ -6,7 +6,7 @@ // Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, // die mit einer Assembly verknüpft sind. [assembly: AssemblyTitle("ViewModeSwitcherHelper")] -[assembly: AssemblyDescription("")] +[assembly: AssemblyDescription("Helper based on TVE2")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("ViewModeSwitcherHelper")] Modified: trunk/plugins/ViewModeSwitcher/ViewModeSwitcherHelperTV02/ViewModeSwitcherHelper.suo =================================================================== (Binary files differ) Modified: trunk/plugins/ViewModeSwitcher/ViewModeSwitcherHelperTV02/ViewModeSwitcherHelperTVE2.csproj =================================================================== --- trunk/plugins/ViewModeSwitcher/ViewModeSwitcherHelperTV02/ViewModeSwitcherHelperTVE2.csproj 2007-08-22 05:26:54 UTC (rev 853) +++ trunk/plugins/ViewModeSwitcher/ViewModeSwitcherHelperTV02/ViewModeSwitcherHelperTVE2.csproj 2007-08-22 11:31:52 UTC (rev 854) @@ -28,16 +28,16 @@ <WarningLevel>4</WarningLevel> </PropertyGroup> <ItemGroup> - <Reference Include="Core, Version=0.2.2.0, Culture=neutral, processorArchitecture=x86"> + <Reference Include="Core, Version=0.2.2.9991, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\xbmc\bin\Release\Core.dll</HintPath> + <HintPath>..\..\Core\bin\Release\Core.dll</HintPath> </Reference> <Reference Include="System" /> <Reference Include="System.Data" /> <Reference Include="System.Xml" /> - <Reference Include="TVCapture, Version=0.2.2.0, Culture=neutral, processorArchitecture=x86"> + <Reference Include="TVCapture, Version=0.2.2.9991, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\xbmc\bin\Release\TVCapture.dll</HintPath> + <HintPath>..\..\TVCapture\bin\Release\TVCapture.dll</HintPath> </Reference> </ItemGroup> <ItemGroup> Modified: trunk/plugins/ViewModeSwitcher/ViewModeSwitcherHelperTV03/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/ViewModeSwitcher/ViewModeSwitcherHelperTV03/Properties/AssemblyInfo.cs 2007-08-22 05:26:54 UTC (rev 853) +++ trunk/plugins/ViewModeSwitcher/ViewModeSwitcherHelperTV03/Properties/AssemblyInfo.cs 2007-08-22 11:31:52 UTC (rev 854) @@ -6,7 +6,7 @@ // Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, // die mit einer Assembly verknüpft sind. [assembly: AssemblyTitle("ViewModeSwitcherHelper")] -[assembly: AssemblyDescription("")] +[assembly: AssemblyDescription("Helper based on TVE3")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("ViewModeSwitcherHelper")] Modified: trunk/plugins/ViewModeSwitcher/ViewModeSwitcherHelperTV03/ViewModeSwitcherHelper.sln =================================================================== --- trunk/plugins/ViewModeSwitcher/ViewModeSwitcherHelperTV03/ViewModeSwitcherHelper.sln 2007-08-22 05:26:54 UTC (rev 853) +++ trunk/plugins/ViewModeSwitcher/ViewModeSwitcherHelperTV03/ViewModeSwitcherHelper.sln 2007-08-22 11:31:52 UTC (rev 854) @@ -1,7 +1,7 @@ Microsoft Visual Studio Solution File, Format Version 9.00 # Visual Studio 2005 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ViewModeSwitcherHelperTVE3", "ViewModeSwitcherHelperTVE3.csproj", "{27A85D00-8872-45AE-91D4-E41E0EF1C7B4}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ViewModeSwitcherHelperTVE3", "ViewModeSwitcherHelperTVE3.csproj", "{EBFA5141-09F5-43AB-8B96-9DAA8B725284}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -9,10 +9,10 @@ Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {27A85D00-8872-45AE-91D4-E41E0EF1C7B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {27A85D00-8872-45AE-91D4-E41E0EF1C7B4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {27A85D00-8872-45AE-91D4-E41E0EF1C7B4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {27A85D00-8872-45AE-91D4-E41E0EF1C7B4}.Release|Any CPU.Build.0 = Release|Any CPU + {EBFA5141-09F5-43AB-8B96-9DAA8B725284}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EBFA5141-09F5-43AB-8B96-9DAA8B725284}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EBFA5141-09F5-43AB-8B96-9DAA8B725284}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EBFA5141-09F5-43AB-8B96-9DAA8B725284}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE Modified: trunk/plugins/ViewModeSwitcher/ViewModeSwitcherHelperTV03/ViewModeSwitcherHelper.suo =================================================================== (Binary files differ) Modified: trunk/plugins/ViewModeSwitcher/ViewModeSwitcherHelperTV03/ViewModeSwitcherHelperTVE3.csproj =================================================================== --- trunk/plugins/ViewModeSwitcher/ViewModeSwitcherHelperTV03/ViewModeSwitcherHelperTVE3.csproj 2007-08-22 05:26:54 UTC (rev 853) +++ trunk/plugins/ViewModeSwitcher/ViewModeSwitcherHelperTV03/ViewModeSwitcherHelperTVE3.csproj 2007-08-22 11:31:52 UTC (rev 854) @@ -28,16 +28,16 @@ <WarningLevel>4</WarningLevel> </PropertyGroup> <ItemGroup> - <Reference Include="Core, Version=0.2.2.0, Culture=neutral, processorArchitecture=x86"> + <Reference Include="Core, Version=0.2.2.9991, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\xbmc\bin\Release\Core.dll</HintPath> + <HintPath>..\..\Core\bin\Release\Core.dll</HintPath> </Reference> <Reference Include="System" /> <Reference Include="System.Data" /> <Reference Include="System.Xml" /> <Reference Include="TvPlugin, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\TV Server 3\TVLibrary\TvPlugin\TvPlugin\bin\Debug\TvPlugin.dll</HintPath> + <HintPath>C:\MediaPortal\MediaPortal\Plugins\Windows\TvPlugin.dll</HintPath> </Reference> </ItemGroup> <ItemGroup> Modified: trunk/plugins/ViewModeSwitcher/ViewModeSwitcherRuleDetail.cs =================================================================== --- trunk/plugins/ViewModeSwitcher/ViewModeSwitcherRuleDetail.cs 2007-08-22 05:26:54 UTC (rev 853) +++ trunk/plugins/ViewModeSwitcher/ViewModeSwitcherRuleDetail.cs 2007-08-22 11:31:52 UTC (rev 854) @@ -112,24 +112,9 @@ currentRule.ChangeAR = cbViewModeSwitchEnabled.Checked; String tmpViewMode = cmbViewMode.Text; - switch (tmpViewMode) - { - case "Zoom": currentRule.ViewMode = Geometry.Type.Zoom; - break; - case "Normal": currentRule.ViewMode = Geometry.Type.Normal; - break; - case "Stretch": currentRule.ViewMode = Geometry.Type.Stretch; - break; - case "Original": currentRule.ViewMode = Geometry.Type.Original; - break; - case "LetterBox43": currentRule.ViewMode = Geometry.Type.LetterBox43; - break; - case "PanScan43": currentRule.ViewMode = Geometry.Type.PanScan43; - break; - case "Zoom14to9": currentRule.ViewMode = Geometry.Type.Zoom14to9; - break; - } + currentRule.ViewMode = ViewModeswitcherSettings.StringToViewMode(tmpViewMode); + currentRule.ChangeOs = cbOverScanEnabled.Checked; currentRule.OverScan = Convert.ToInt16(txbOverScan.Text); currentRule.EnableLBDetection = cb_EnableLBDetection.Checked; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <i-...@us...> - 2007-08-22 05:26:57
|
Revision: 853 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=853&view=rev Author: i-loop Date: 2007-08-21 22:26:54 -0700 (Tue, 21 Aug 2007) Log Message: ----------- synced with latest BlueTwo changes Modified Paths: -------------- trunk/skins/BlueTwoBig/Development Version/wizard_general.xml trunk/skins/BlueTwoBig/Development Version/wizard_remote_control.xml trunk/skins/BlueTwoBig/Development Version/wizard_tvcards_detected.xml Modified: trunk/skins/BlueTwoBig/Development Version/wizard_general.xml =================================================================== --- trunk/skins/BlueTwoBig/Development Version/wizard_general.xml 2007-08-21 23:03:01 UTC (rev 852) +++ trunk/skins/BlueTwoBig/Development Version/wizard_general.xml 2007-08-22 05:26:54 UTC (rev 853) @@ -113,6 +113,7 @@ <ondown>4</ondown> <label>200007</label> <width>96</width> + <hyperlink>615</hyperlink> </control> <control> <type>image</type> Modified: trunk/skins/BlueTwoBig/Development Version/wizard_remote_control.xml =================================================================== --- trunk/skins/BlueTwoBig/Development Version/wizard_remote_control.xml 2007-08-21 23:03:01 UTC (rev 852) +++ trunk/skins/BlueTwoBig/Development Version/wizard_remote_control.xml 2007-08-22 05:26:54 UTC (rev 853) @@ -101,6 +101,7 @@ <ondown>4</ondown> <label>200007</label> <width>96</width> + <hyperlink>636</hyperlink> </control> <control> <type>label</type> Modified: trunk/skins/BlueTwoBig/Development Version/wizard_tvcards_detected.xml =================================================================== --- trunk/skins/BlueTwoBig/Development Version/wizard_tvcards_detected.xml 2007-08-21 23:03:01 UTC (rev 852) +++ trunk/skins/BlueTwoBig/Development Version/wizard_tvcards_detected.xml 2007-08-22 05:26:54 UTC (rev 853) @@ -21,6 +21,7 @@ <ondown>25</ondown> <label>200007</label> <width>96</width> + <hyperlink>634</hyperlink> </control> <control> <type>label</type> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nor...@us...> - 2007-08-21 23:03:06
|
Revision: 852 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=852&view=rev Author: northern_sky Date: 2007-08-21 16:03:01 -0700 (Tue, 21 Aug 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/myGUIProgramsAlt/README.txt Modified: trunk/plugins/myGUIProgramsAlt/README.txt =================================================================== --- trunk/plugins/myGUIProgramsAlt/README.txt 2007-08-21 23:00:30 UTC (rev 851) +++ trunk/plugins/myGUIProgramsAlt/README.txt 2007-08-21 23:03:01 UTC (rev 852) @@ -10,8 +10,9 @@ Copy skin to relevant folder. There will possibly be db-changes and xml-changes between versions, so always make sure that you have a clean install between updates. -So far: +Done so far: + Code/GUI restructure.. Now using the excellent ADO.NET opensource wrapper for System.Data.SQLite.It rocks! @@ -24,6 +25,8 @@ Mame, Gamebase support partially rewritten. Some new options: Skip mahjong games,etc ++ other stuff + ---------------- .: To-do next :. ---------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <nor...@us...> - 2007-08-21 23:00:32
|
Revision: 851 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=851&view=rev Author: northern_sky Date: 2007-08-21 16:00:30 -0700 (Tue, 21 Aug 2007) Log Message: ----------- Code cleanups, bugfixes,Dynamic filesettings added Modified Paths: -------------- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesImportProgress.Designer.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesView.Designer.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesView.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesView.resx trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsBase.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsDirCache.Designer.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGamebase.Designer.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGrouper.Designer.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsMame.Designer.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/FileDetailsForm.Designer.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/FileDetailsForm.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/FileInfoScraperForm.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/SetupForm.Designer.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/SetupForm.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/GUIProgramsAlt.csproj trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/AllGameScraper.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/DirectoryImport.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/GamebaseImport.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Imports/MameImport.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItem.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemDirectoryCache.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemFactory.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemGameBase.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/ApplicationItemMame.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/FileItem.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Items/FilelinkItem.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/ProgramUtils.cs trunk/plugins/myGUIProgramsAlt/README.txt Added Paths: ----------- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/FileSettingsBox.Designer.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/FileSettingsBox.cs trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/FileSettingsBox.resx Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesImportProgress.Designer.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesImportProgress.Designer.cs 2007-08-21 18:41:02 UTC (rev 850) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesImportProgress.Designer.cs 2007-08-21 23:00:30 UTC (rev 851) @@ -42,7 +42,7 @@ // // shellexecuteCheckBox // - this.toolTip.SetToolTip(this.shellexecuteCheckBox, "Enable this if you want to run a program that is associated with a specific file-" + + this.toolTip.SetToolTip(this.shellexecuteCheckBox, "Enable this if you want to run a program that is associated with a specific fileItem-" + "extension.\r\nYou can omit the \"Launching Application\" in this case."); // // applicationArgumentsLabel @@ -69,7 +69,7 @@ // startupDirTextBox // this.toolTip.SetToolTip(this.startupDirComboBox, "Optional path that is passed as the launch-directory \r\n\r\n(advanced hint: Use %FIL" + - "EDIR% if you want to use the directory where the launched file is stored)"); + "EDIR% if you want to use the directory where the launched fileItem is stored)"); // // quoteCheckBox // Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesView.Designer.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesView.Designer.cs 2007-08-21 18:41:02 UTC (rev 850) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesView.Designer.cs 2007-08-21 23:00:30 UTC (rev 851) @@ -43,27 +43,14 @@ this.updateDatabaseButton = new System.Windows.Forms.Button(); this.contextFavouritesMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components); this.grouperToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.fileExtensionsTextBox = new System.Windows.Forms.TextBox(); - this.imageDirsTextBox = new System.Windows.Forms.TextBox(); - this.fileDirTextBox = new System.Windows.Forms.TextBox(); - this.fileDirButton = new System.Windows.Forms.Button(); - this.fileExtensionsbutton = new System.Windows.Forms.Button(); - this.imageDirButton = new System.Windows.Forms.Button(); - this.fileExtensionsLabel = new System.Windows.Forms.Label(); - this.imageDirsLabel = new System.Windows.Forms.Label(); - this.fileDirLabel = new System.Windows.Forms.Label(); this.filesGroupBox = new System.Windows.Forms.GroupBox(); this.importOptionsCheckedListBox = new System.Windows.Forms.CheckedListBox(); - this.FileSettingsGroupBox = new System.Windows.Forms.GroupBox(); - this.gamebaseDBTextBox = new System.Windows.Forms.TextBox(); - this.gamebaseLabel = new System.Windows.Forms.Label(); - this.gamebaseDBButton = new System.Windows.Forms.Button(); this.toolTip = new System.Windows.Forms.ToolTip(this.components); this.folderBrowserDialog = new System.Windows.Forms.FolderBrowserDialog(); this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); + this.filesettingsPanel = new System.Windows.Forms.Panel(); this.contextFavouritesMenuStrip.SuspendLayout(); this.filesGroupBox.SuspendLayout(); - this.FileSettingsGroupBox.SuspendLayout(); this.SuspendLayout(); // // fileListView @@ -92,7 +79,7 @@ this.smallImageList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("smallImageList.ImageStream"))); this.smallImageList.TransparentColor = System.Drawing.Color.Transparent; this.smallImageList.Images.SetKeyName(0, "folder.ico"); - this.smallImageList.Images.SetKeyName(1, "file.ico"); + this.smallImageList.Images.SetKeyName(1, "fileItem.ico"); this.smallImageList.Images.SetKeyName(2, "shortcut.ico"); // // newButton @@ -189,87 +176,6 @@ this.grouperToolStripMenuItem.Size = new System.Drawing.Size(117, 22); this.grouperToolStripMenuItem.Text = "Grouper"; // - // fileExtensionsTextBox - // - this.fileExtensionsTextBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.fileExtensionsTextBox.Location = new System.Drawing.Point(85, 71); - this.fileExtensionsTextBox.Name = "fileExtensionsTextBox"; - this.fileExtensionsTextBox.Size = new System.Drawing.Size(330, 20); - this.fileExtensionsTextBox.TabIndex = 28; - // - // imageDirsTextBox - // - this.imageDirsTextBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.imageDirsTextBox.Location = new System.Drawing.Point(85, 45); - this.imageDirsTextBox.Name = "imageDirsTextBox"; - this.imageDirsTextBox.Size = new System.Drawing.Size(330, 20); - this.imageDirsTextBox.TabIndex = 27; - // - // fileDirTextBox - // - this.fileDirTextBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.fileDirTextBox.Location = new System.Drawing.Point(85, 19); - this.fileDirTextBox.Name = "fileDirTextBox"; - this.fileDirTextBox.Size = new System.Drawing.Size(330, 20); - this.fileDirTextBox.TabIndex = 26; - // - // fileDirButton - // - this.fileDirButton.Image = global::GUIPrograms.Properties.Resources.browseButton_Image; - this.fileDirButton.Location = new System.Drawing.Point(426, 16); - this.fileDirButton.Name = "fileDirButton"; - this.fileDirButton.Size = new System.Drawing.Size(31, 23); - this.fileDirButton.TabIndex = 39; - this.fileDirButton.UseVisualStyleBackColor = true; - this.fileDirButton.Click += new System.EventHandler(this.fileDirButton_Click); - // - // fileExtensionsbutton - // - this.fileExtensionsbutton.Image = global::GUIPrograms.Properties.Resources.searchButton_Image; - this.fileExtensionsbutton.Location = new System.Drawing.Point(426, 68); - this.fileExtensionsbutton.Name = "fileExtensionsbutton"; - this.fileExtensionsbutton.Size = new System.Drawing.Size(31, 23); - this.fileExtensionsbutton.TabIndex = 38; - this.fileExtensionsbutton.UseVisualStyleBackColor = true; - this.fileExtensionsbutton.Click += new System.EventHandler(this.fileExtensionsbutton_Click); - // - // imageDirButton - // - this.imageDirButton.Image = global::GUIPrograms.Properties.Resources.browseButton_Image; - this.imageDirButton.Location = new System.Drawing.Point(426, 42); - this.imageDirButton.Name = "imageDirButton"; - this.imageDirButton.Size = new System.Drawing.Size(31, 23); - this.imageDirButton.TabIndex = 37; - this.imageDirButton.UseVisualStyleBackColor = true; - this.imageDirButton.Click += new System.EventHandler(this.imageDirButton_Click); - // - // fileExtensionsLabel - // - this.fileExtensionsLabel.Location = new System.Drawing.Point(2, 71); - this.fileExtensionsLabel.Name = "fileExtensionsLabel"; - this.fileExtensionsLabel.Size = new System.Drawing.Size(93, 20); - this.fileExtensionsLabel.TabIndex = 36; - this.fileExtensionsLabel.Text = "Fileextensions:"; - this.fileExtensionsLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // imageDirsLabel - // - this.imageDirsLabel.Location = new System.Drawing.Point(2, 43); - this.imageDirsLabel.Name = "imageDirsLabel"; - this.imageDirsLabel.Size = new System.Drawing.Size(93, 20); - this.imageDirsLabel.TabIndex = 35; - this.imageDirsLabel.Text = "Image Dir:"; - this.imageDirsLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // fileDirLabel - // - this.fileDirLabel.Location = new System.Drawing.Point(2, 19); - this.fileDirLabel.Name = "fileDirLabel"; - this.fileDirLabel.Size = new System.Drawing.Size(93, 20); - this.fileDirLabel.TabIndex = 34; - this.fileDirLabel.Text = "File Directory(s):"; - this.fileDirLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // // filesGroupBox // this.filesGroupBox.BackColor = System.Drawing.SystemColors.Control; @@ -305,73 +211,30 @@ this.importOptionsCheckedListBox.Sorted = true; this.importOptionsCheckedListBox.TabIndex = 88; // - // FileSettingsGroupBox - // - this.FileSettingsGroupBox.BackColor = System.Drawing.SystemColors.Control; - this.FileSettingsGroupBox.Controls.Add(this.fileDirTextBox); - this.FileSettingsGroupBox.Controls.Add(this.gamebaseDBTextBox); - this.FileSettingsGroupBox.Controls.Add(this.gamebaseLabel); - this.FileSettingsGroupBox.Controls.Add(this.fileDirLabel); - this.FileSettingsGroupBox.Controls.Add(this.gamebaseDBButton); - this.FileSettingsGroupBox.Controls.Add(this.fileDirButton); - this.FileSettingsGroupBox.Controls.Add(this.fileExtensionsbutton); - this.FileSettingsGroupBox.Controls.Add(this.imageDirsTextBox); - this.FileSettingsGroupBox.Controls.Add(this.imageDirButton); - this.FileSettingsGroupBox.Controls.Add(this.fileExtensionsTextBox); - this.FileSettingsGroupBox.Controls.Add(this.fileExtensionsLabel); - this.FileSettingsGroupBox.Controls.Add(this.imageDirsLabel); - this.FileSettingsGroupBox.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.FileSettingsGroupBox.Location = new System.Drawing.Point(6, 397); - this.FileSettingsGroupBox.Name = "FileSettingsGroupBox"; - this.FileSettingsGroupBox.Size = new System.Drawing.Size(478, 150); - this.FileSettingsGroupBox.TabIndex = 41; - this.FileSettingsGroupBox.TabStop = false; - this.FileSettingsGroupBox.Text = "Filesettings"; - // - // gamebaseDBTextBox - // - this.gamebaseDBTextBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.gamebaseDBTextBox.Location = new System.Drawing.Point(85, 96); - this.gamebaseDBTextBox.Name = "gamebaseDBTextBox"; - this.gamebaseDBTextBox.Size = new System.Drawing.Size(330, 20); - this.gamebaseDBTextBox.TabIndex = 89; - this.toolTip.SetToolTip(this.gamebaseDBTextBox, "Select a gamebase (*.mdb) file to import\r\n"); - // - // gamebaseLabel - // - this.gamebaseLabel.Location = new System.Drawing.Point(2, 96); - this.gamebaseLabel.Name = "gamebaseLabel"; - this.gamebaseLabel.Size = new System.Drawing.Size(93, 20); - this.gamebaseLabel.TabIndex = 88; - this.gamebaseLabel.Text = "Gamebase DB"; - // - // gamebaseDBButton - // - this.gamebaseDBButton.Image = global::GUIPrograms.Properties.Resources.browseButton_Image; - this.gamebaseDBButton.Location = new System.Drawing.Point(426, 93); - this.gamebaseDBButton.Name = "gamebaseDBButton"; - this.gamebaseDBButton.Size = new System.Drawing.Size(31, 23); - this.gamebaseDBButton.TabIndex = 90; - this.gamebaseDBButton.UseVisualStyleBackColor = true; - this.gamebaseDBButton.Click += new System.EventHandler(this.gamebaseDBButton_Click); - // // openFileDialog // this.openFileDialog.FileName = "openFileDialog1"; // + // filesettingsPanel + // + this.filesettingsPanel.AutoScroll = true; + this.filesettingsPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.filesettingsPanel.Location = new System.Drawing.Point(3, 397); + this.filesettingsPanel.Name = "filesettingsPanel"; + this.filesettingsPanel.Size = new System.Drawing.Size(481, 162); + this.filesettingsPanel.TabIndex = 42; + // // AppSettingsFilesView // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.FileSettingsGroupBox); + this.Controls.Add(this.filesettingsPanel); this.Controls.Add(this.filesGroupBox); this.Name = "AppSettingsFilesView"; this.Size = new System.Drawing.Size(521, 574); this.Load += new System.EventHandler(this.AppFilesView_Load); this.contextFavouritesMenuStrip.ResumeLayout(false); this.filesGroupBox.ResumeLayout(false); - this.FileSettingsGroupBox.ResumeLayout(false); - this.FileSettingsGroupBox.PerformLayout(); this.ResumeLayout(false); } @@ -391,23 +254,11 @@ private System.Windows.Forms.ContextMenuStrip contextFavouritesMenuStrip; private System.Windows.Forms.ToolStripMenuItem grouperToolStripMenuItem; private System.Windows.Forms.ImageList smallImageList; - protected System.Windows.Forms.TextBox fileExtensionsTextBox; - protected System.Windows.Forms.TextBox imageDirsTextBox; - protected System.Windows.Forms.TextBox fileDirTextBox; - protected System.Windows.Forms.Button fileDirButton; - protected System.Windows.Forms.Button fileExtensionsbutton; - protected System.Windows.Forms.Button imageDirButton; - protected System.Windows.Forms.Label fileExtensionsLabel; - protected System.Windows.Forms.Label imageDirsLabel; - protected System.Windows.Forms.Label fileDirLabel; private System.Windows.Forms.GroupBox filesGroupBox; - private System.Windows.Forms.GroupBox FileSettingsGroupBox; private System.Windows.Forms.ToolTip toolTip; private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog; - private System.Windows.Forms.TextBox gamebaseDBTextBox; - private System.Windows.Forms.Label gamebaseLabel; - private System.Windows.Forms.Button gamebaseDBButton; private System.Windows.Forms.OpenFileDialog openFileDialog; private System.Windows.Forms.CheckedListBox importOptionsCheckedListBox; + private System.Windows.Forms.Panel filesettingsPanel; } } \ No newline at end of file Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesView.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesView.cs 2007-08-21 18:41:02 UTC (rev 850) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesView.cs 2007-08-21 23:00:30 UTC (rev 851) @@ -32,6 +32,7 @@ using System.Text; using System.Windows.Forms; +using Core.Util; using GUIPrograms; using GUIPrograms.Items; using GUIPrograms.Database; @@ -42,11 +43,18 @@ { private List<ApplicationItem> apps = DatabaseHandler.DBHandlerInstance.ApplicationItemList; public event EventHandler OnRefreshClick; - private ApplicationItem currentApplication = null; + private ApplicationItem currentApplicationItem = null; public event EventHandler OnImageFolderSearch; + private ConditionChecker conditionChecker = new ConditionChecker(); - + //globals,, should match enum fileSettings! + TextBox fileDirTextBox = null; + TextBox imageDirsTextBox = null; + TextBox gamebaseDBTextBox = null; + TextBox fileExtensionsTextBox = null; + + public string ImportOptionToString(ImportOption importOption) { switch (importOption) @@ -93,25 +101,24 @@ { if (curApp == null) return; - currentApplication = curApp; - if (!currentApplication.filesAreLoaded) + currentApplicationItem = curApp; + if (!currentApplicationItem.filesAreLoaded) { - currentApplication.LoadFiles(); + currentApplicationItem.LoadFiles(); } SyncListView(); } private void SyncListView() { - if (currentApplication == null) return; - - fileListView.BeginUpdate(); + if (currentApplicationItem == null) return; + try { + fileListView.BeginUpdate(); fileListView.Items.Clear(); - - foreach (object item in currentApplication.ItemList) + foreach (object item in currentApplicationItem.ItemList) { // add all filelinks, // or add all files @@ -123,19 +130,14 @@ curItem.ImageIndex = 2; fileListView.Items.Add(curItem); } - else if(item is FileItem) + else if (item is FileItem) { FileItem file = (FileItem)item; ListViewItem curItem = new ListViewItem(file.Title); curItem.Tag = file; - /* if (file.IsFolder) - { - curItem.ImageIndex = 0; - } - else - {*/ - curItem.ImageIndex = 1; - // } + + curItem.ImageIndex = 1; + fileListView.Items.Add(curItem); } } @@ -147,7 +149,7 @@ } SetupFileView(); SyncListViewButtons(); - SyncFilePath(); + SetFileSettingsTextBoxes(); } private void SyncListViewButtons() @@ -162,13 +164,14 @@ if (fileListView.SelectedItems.Count == 1) { FileItem file = (FileItem)fileListView.SelectedItems[0].Tag; + if (file != null) { - // if (!file.IsFolder) + // if (!file.IsFolder) //{ - editButton.Enabled = true; - deleteButton.Enabled = true; - launchButton.Enabled = (file.Filename != ""); + editButton.Enabled = true; + deleteButton.Enabled = true; + launchButton.Enabled = (file.Filename != ""); //} } } @@ -178,108 +181,85 @@ } - if (currentApplication != null) + if (currentApplicationItem != null) { - newButton.Enabled = currentApplication.FileAddAllowed(); - addFavouriteButton.Enabled = currentApplication.FilesCanBeFavourites() && (fileListView.SelectedItems.Count > 0); - + newButton.Enabled = currentApplicationItem.FileAddAllowed(); + addFavouriteButton.Enabled = currentApplicationItem.FilesCanBeFavourites() && (fileListView.SelectedItems.Count > 0); } } - private void SyncFilePath() + private void SetFileSettingsTextBoxes() { - this.fileDirTextBox.Text = currentApplication.FileDirectory; + if (fileDirTextBox != null) + { + fileDirTextBox.Text = currentApplicationItem.FileDirectory; + } - if (ProgramUtils.UseThumbsDir()) + if(imageDirsTextBox != null) { - ProgramUtils.GetApplicationImageFolder(currentApplication); + if (ProgramUtils.UseThumbsDir()) + { + ProgramUtils.GetApplicationImageFolder(currentApplicationItem); } else { - string imageDirectorys = string.Join(";", currentApplication.ImageDirsSplitted); - this.imageDirsTextBox.Text = imageDirectorys; + imageDirsTextBox.Text = currentApplicationItem.ImageDirectory; } - - this.fileExtensionsTextBox.Text = currentApplication.ValidExtensions; - // filePathsLabel.Text = currentApplication.CurrentFilePath().Replace("&", "&&"); + } + if (fileExtensionsTextBox != null) + { + fileExtensionsTextBox.Text = currentApplicationItem.ValidExtensions; + } + if (gamebaseDBTextBox != null) + { + gamebaseDBTextBox.Text = currentApplicationItem.ApplicationItemSource; + } + + //filePathsLabel.Text = currentApplicationItem.CurrentFilePath().Replace("&", "&&"); } public string FileExtensionsText { - get { return fileExtensionsTextBox.Text; } - set { fileExtensionsTextBox.Text = value; } + get { return fileExtensionsTextBox.Text; } + set { fileExtensionsTextBox.Text = value; } } - public bool EntriesOK() - {//to do - return true; - - /* string error = "The following entries are invalid: \r\n\r\n"; - bool isOk = true; - - if(this.fileDirTextBox.Text == "") - { - error += System.Environment.NewLine + "No filedirectory entered!"; - isOk = false; - } - if (FileExtensionsText == "") - { - error += System.Environment.NewLine + "No file extensions entered!"; - isOk = false; - } - - if ((gamebaseDBTextBox.Text == "") && (gamebaseDBTextBox.Visible)) - { - error += System.Environment.NewLine + "No sourcefile entered!"; - isOk = false; - } - - - if (!isOk) - { - string strFooter = "\r\n\r\n(Click DELETE to remove this item)"; - MessageBox.Show(error + strFooter, "Invalid Entries"); - } - return isOk; - */ - } - private void AddItem() { - FileItem file = new FileItem(); - file.AppID = currentApplication.ApplicationItemId; // CRUCIAL!! :-) - FileDetailsForm frmFileDetails = new FileDetailsForm(); - frmFileDetails.CurApp = currentApplication; - frmFileDetails.CurFile = file; - DialogResult dialogResult = frmFileDetails.ShowDialog(this); + FileItem fileItem = new FileItem(); + fileItem.ApplicationItemId = currentApplicationItem.ApplicationItemId; + + FileDetailsForm fileDetailsForm = new FileDetailsForm(); + fileDetailsForm.CurrentApplicationItem = currentApplicationItem; + fileDetailsForm.CurrentFileItem = fileItem; + DialogResult dialogResult = fileDetailsForm.ShowDialog(this); if (dialogResult == DialogResult.OK) { - file.Write(); - currentApplication.LoadFiles(); + fileItem.Write(); + currentApplicationItem.LoadFiles(); SyncListView(); } } - private void EditItem() { if (fileListView.SelectedItems.Count == 1) { - FileItem file = (FileItem)fileListView.SelectedItems[0].Tag; - if (file != null) + FileItem fileItem = (FileItem)fileListView.SelectedItems[0].Tag; + + if (fileItem != null) { - FileDetailsForm frmFileDetails = new FileDetailsForm(); - frmFileDetails.CurApp = currentApplication; - frmFileDetails.CurFile = file; - DialogResult dialogResult = frmFileDetails.ShowDialog(this); + FileDetailsForm fileDetailsForm = new FileDetailsForm(); + fileDetailsForm.CurrentApplicationItem = currentApplicationItem; + fileDetailsForm.CurrentFileItem = fileItem; + DialogResult dialogResult = fileDetailsForm.ShowDialog(this); if (dialogResult == DialogResult.OK) { - file.Write(); - currentApplication.LoadFiles(); + fileItem.Write(); + currentApplicationItem.LoadFiles(); SyncListView(); } } - } } @@ -287,13 +267,15 @@ { if (fileListView.SelectedItems.Count == 1) { - FileItem file = (FileItem)fileListView.SelectedItems[0].Tag; - if (file != null) + FileItem fileItem = (FileItem)fileListView.SelectedItems[0].Tag; + + if (fileItem != null) { - currentApplication.LaunchFile(file, false); //launch in non-blocking mode - if ((currentApplication.LaunchErrorMsg != null) && (currentApplication.LaunchErrorMsg != "")) + currentApplicationItem.LaunchFile(fileItem, false); //launch in non-blocking mode + + if ((currentApplicationItem.LaunchErrorMsg != null) && (currentApplicationItem.LaunchErrorMsg != "")) { - MessageBox.Show(currentApplication.LaunchErrorMsg, "Launch Error: (check LOG for details)"); + MessageBox.Show(currentApplicationItem.LaunchErrorMsg, "Launch Error: (check LOG for details)"); } } } @@ -307,10 +289,11 @@ MessageBoxIcon.Question); if (dialogResult == DialogResult.Yes) { - foreach (ListViewItem curItem in fileListView.SelectedItems) - if (curItem.Tag is FilelinkItem) + foreach (ListViewItem listViewItem in fileListView.SelectedItems) + + if (listViewItem.Tag is FilelinkItem) { - FilelinkItem filelink = (FilelinkItem)curItem.Tag; + FilelinkItem filelink = (FilelinkItem)listViewItem.Tag; if (filelink != null) { filelink.Delete(); @@ -318,7 +301,7 @@ } else { - FileItem file = (FileItem)curItem.Tag; + FileItem file = (FileItem)listViewItem.Tag; if (file != null) { file.Delete(); @@ -326,7 +309,7 @@ } } } - currentApplication.LoadFiles(); + currentApplicationItem.LoadFiles(); SyncListView(); } @@ -339,29 +322,33 @@ this.addFavouriteButton.Enabled = enabled; this.internetSearchButton.Enabled = enabled; this.updateDatabaseButton.Enabled = enabled; - } public bool FirstImageDirectoryValid() { if (ProgramUtils.UseThumbsDir()) return true; - if (this.imageDirsTextBox.Text.Length == 0) + if (imageDirsTextBox != null) { - return false; - } - else - { - string firstDirectory = (this.imageDirsTextBox.Text.Split(';'))[0]; - if (firstDirectory == "") + if (imageDirsTextBox.Text.Length == 0) { return false; } else { - return System.IO.Directory.Exists(firstDirectory); + string firstDirectory = (this.imageDirsTextBox.Text.Split(';'))[0]; + if (firstDirectory == "") + { + return false; + } + else + { + return System.IO.Directory.Exists(firstDirectory); + } } } + else + return false; } //scans all files in the fileviewlist @@ -383,81 +370,71 @@ { OnImageFolderSearch(this, null); } - //get all imagedirs - /* for (int i = 0; i < currentApplication.imageDirsSplitted.Length; i++) - { - if (!currentApplication.imageDirsSplitted[i].ToString().Equals("")) - { - imageDirsList.Add(currentApplication.imageDirsSplitted[i]); - } - } - */ - if (this.imageDirsTextBox.Text != string.Empty) - { - string[] imageDirs = this.imageDirsTextBox.Text.Split(';'); - //get all imagedirs - for (int i = 0; i < imageDirs.Length; i++) - { - if (!imageDirs[i].ToString().Equals("")) - { - imageDirsList.Add(imageDirs[i]); - } - } + { + string[] imageDirs = this.imageDirsTextBox.Text.Split(';'); + //get all imagedirs + for (int i = 0; i < imageDirs.Length; i++) + { + if (!imageDirs[i].ToString().Equals("")) + { + imageDirsList.Add(imageDirs[i]); + } + } + + try + { + //if any imagedirs given + if (imageDirsList.Count > 0) + { + //for every dir fiven... + foreach (string directory in imageDirsList) + { - try - { - //if any imagedirs given - if (imageDirsList.Count > 0) - { - //for every dir fiven... - foreach (string directory in imageDirsList) - { + DirectoryInfo directoryInfo = new DirectoryInfo(directory); + //and for each file in dir + if (directoryInfo.Exists) + { + System.IO.FileInfo[] files = directoryInfo.GetFiles(); - DirectoryInfo directoryInfo = new DirectoryInfo(directory); - //and for each file in dir - if (directoryInfo.Exists) - { - System.IO.FileInfo[] files = directoryInfo.GetFiles(); + for (int z = 0; z < currentApplicationItem.ItemList.Count; z++) + { + bool imageFound = false; + string foundImagePath = string.Empty; + FileItem fileItem = (FileItem)currentApplicationItem.ItemList[z]; + string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(fileItem.Filename); - for (int z = 0; z < currentApplication.ItemList.Count; z++) - { - bool imageFound = false; - string foundImagePath = string.Empty; - FileItem fileItem = (FileItem)currentApplication.ItemList[z]; - string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(fileItem.Filename); + //check all files if same name can be found + int i = 0; + while ((imageFound == false) && (i < files.Length)) + { + if (fileNameWithoutExtension.Equals(Path.GetFileNameWithoutExtension(files[i].ToString()))) + { + //found + imageFound = true; + foundImagePath = Path.Combine(directory, files[i].ToString()); + } + i++; + } - //check all files if same name can be found - int i = 0; - while ((imageFound == false) && (i < files.Length)) - { - if (fileNameWithoutExtension.Equals(Path.GetFileNameWithoutExtension(files[i].ToString()))) - { - //found - imageFound = true; - foundImagePath = Path.Combine(directory, files[i].ToString()); - } - i++; - } + // if an image with same name as file was found + if (foundImagePath != string.Empty) + { + fileItem.Imagefile = foundImagePath; + fileItem.Write(); - // if an image with same name as file was found - if (foundImagePath != string.Empty) - { - fileItem.Imagefile = foundImagePath; - fileItem.Write(); - - } - } - } - } - } - } - catch (Exception ee) - { - MessageBox.Show(ee.ToString()); - SetEnabledComponents(true); - } + } + } + } + } + } + } + catch (Exception ee) + { + MessageBox.Show(ee.ToString()); + SetEnabledComponents(true); + } } scanImageDirsButton.Enabled = true; @@ -485,7 +462,7 @@ if (FirstImageDirectoryValid()) { FileInfoScraperForm frmScraper = new FileInfoScraperForm(); - frmScraper.CurApp = currentApplication; + frmScraper.CurApp = currentApplicationItem; frmScraper.Setup(); frmScraper.ShowDialog(this); SyncListView(); @@ -525,13 +502,13 @@ FileItem file = (FileItem)fileListView.SelectedItems[0].Tag; if (file != null) { - // if (file.IsFolder) + // if (file.IsFolder) //{ - //ChangeFilePath(file.Executable); // executable becomes filepath in next view... :) + //ChangeFilePath(file.Executable); // executable becomes filepath in next view... :) //} //else //{ - EditItem(); + EditItem(); //} } } @@ -539,7 +516,7 @@ private void FavouriteGrouperItem_Click(object sender, EventArgs e) { - if (currentApplication == null) + if (currentApplicationItem == null) { return; } @@ -552,19 +529,19 @@ // 'MAME' : targetAppID // 'r-type': fileid // 'top 20 shooters': GrouperAppID; - newLink.AppID = GrouperAppID; // the applicationItem where the link belongs + newLink.ApplicationItemId = GrouperAppID; // the applicationItem where the link belongs newLink.FileID = curFile.FileID; - newLink.TargetAppID = curFile.AppID; // the applicationItem where the launch will effectively happen.... + newLink.TargetAppID = curFile.ApplicationItemId; // the applicationItem where the launch will effectively happen.... newLink.Filename = curFile.Filename; newLink.Write(); - // Log.Info("Add to Favourites groupAppID:{0} Title:{1} fileID:{2} appID:{3}", GrouperAppID, currentFileItem.Title, currentFileItem.FileID, currentFileItem.applicationId); + // Log.Info("Add to Favourites groupAppID:{0} Title:{1} fileID:{2} applicationItemId:{3}", GrouperAppID, currentFileItem.Title, currentFileItem.FileID, currentFileItem.applicationId); } foreach (object app in apps) { if (app is ApplicationItemGrouper) { - ApplicationItemGrouper appi = (ApplicationItemGrouper) app; + ApplicationItemGrouper appi = (ApplicationItemGrouper)app; if (appi.ApplicationItemId == GrouperAppID) { appi.LoadFiles(); @@ -595,7 +572,6 @@ { if (itemString == item.ToString()) { - return true; } } @@ -606,12 +582,12 @@ { if (applicationItem.ImportValidImagesOnly) { - importOptionsCheckedListBox.SetItemChecked(importOptionsCheckedListBox.Items.IndexOf(ImportOptionToString(ImportOption.OnlyImportValidImages)),true); + importOptionsCheckedListBox.SetItemChecked(importOptionsCheckedListBox.Items.IndexOf(ImportOptionToString(ImportOption.OnlyImportValidImages)), true); } if (applicationItem.ImportMameMahjong) { importOptionsCheckedListBox.SetItemChecked(importOptionsCheckedListBox.Items.IndexOf(ImportOptionToString(ImportOption.ImportMahjongGames)), true); - + } if (applicationItem.ImportMamePlaychoice10) { @@ -625,7 +601,6 @@ } } - } public void FillApplicationItem(ApplicationItem applicationItem) @@ -634,29 +609,24 @@ if (!ProgramUtils.UseThumbsDir()) { - applicationItem.ImageDirectory = imageDirsTextBox.Text; + applicationItem.ImageDirectory = (imageDirsTextBox == null) ? "" : imageDirsTextBox.Text; } - applicationItem.FileDirectory = fileDirTextBox.Text; - applicationItem.ValidExtensions = fileExtensionsTextBox.Text; + applicationItem.FileDirectory = (fileDirTextBox == null) ? "" : fileDirTextBox.Text; + applicationItem.ValidExtensions = (fileExtensionsTextBox == null) ? "" : fileExtensionsTextBox.Text; - - if ((currentApplication is ApplicationItemMame) || ((currentApplication is ApplicationItemGameBase))) - { - applicationItem.ImportValidImagesOnly = IsItemChecked(ImportOptionToString(ImportOption.OnlyImportValidImages)); - } + applicationItem.ApplicationItemSource = (gamebaseDBTextBox == null) ? "" : gamebaseDBTextBox.Text; - if ((currentApplication is ApplicationItemMame)) + + applicationItem.ImportValidImagesOnly = IsItemChecked(ImportOptionToString(ImportOption.OnlyImportValidImages)); + + if ((currentApplicationItem is ApplicationItemMame)) { ((ApplicationItemMame)applicationItem).ImportOriginalsOnly = IsItemChecked(ImportOptionToString(ImportOption.OnlyImportOriginals)); applicationItem.ImportMameMahjong = IsItemChecked(ImportOptionToString(ImportOption.ImportMahjongGames)); applicationItem.ImportMamePlaychoice10 = IsItemChecked(ImportOptionToString(ImportOption.ImportPlaychoiceGames)); } - if ((currentApplication is ApplicationItemGameBase)) - { - applicationItem.ApplicationItemSource = this.gamebaseDBTextBox.Text; - } - + } private void AppFilesView_Load(object sender, EventArgs e) @@ -665,13 +635,18 @@ toolTip.SetToolTip(fileDirTextBox, "Directorys where to look for files ,seperate with ; \r\n(mandatory)"); toolTip.SetToolTip(fileExtensionsTextBox, "Only files with matching extensions will be displayed. \r\nSeparate several extension" + "s by a ; (.zip;.txt)\r\n(mandatory)"); + toolTip.SetToolTip(imageDirsTextBox, "Optional directory where MediaPortal searches for matching images. \r\n MediaPort" + "al will cycle through all the directories and display a mini-slideshow of all matching images.Separate with a ;"); + + if(gamebaseDBTextBox != null) + { + toolTip.SetToolTip(gamebaseDBTextBox, "Set the path to your gamebaseDB here"); + } } protected void imageDirButton_Click(object sender, EventArgs e) { - if (imageDirsTextBox.Text != "") { folderBrowserDialog.SelectedPath = imageDirsTextBox.Lines[0]; @@ -696,76 +671,109 @@ public void SetupFileView() { - //by default "dont show these... - - this.gamebaseDBTextBox.Visible = false; - this.gamebaseDBButton.Visible = false; - this.gamebaseLabel.Visible = false; - - //but these.. - + //by default show these... this.scanImageDirsButton.Visible = true; - this.FileSettingsGroupBox.Visible = true; + this.filesettingsPanel.Visible = true; - if (currentApplication != null) + if (currentApplicationItem != null) { - if (ProgramUtils.UseThumbsDir()) - imageDirsTextBox.Text = ProgramUtils.GetApplicationImageFolder(currentApplication); - else - imageDirsTextBox.Text = currentApplication.ImageDirectory; - imageDirsTextBox.ReadOnly = ProgramUtils.UseThumbsDir(); - imageDirButton.Visible = !ProgramUtils.UseThumbsDir(); - - fileDirTextBox.Text = currentApplication.FileDirectory; - fileExtensionsTextBox.Text = currentApplication.ValidExtensions; - - - if ((currentApplication.ImportOptionList != null) && (currentApplication.ImportOptionList.Count > 0)) + //fill import options + if ((currentApplicationItem.ImportOptionList != null) && (currentApplicationItem.ImportOptionList.Count > 0)) { importOptionsCheckedListBox.Items.Clear(); importOptionsCheckedListBox.Visible = true; - foreach (ImportOption importOption in currentApplication.ImportOptionList) + foreach (ImportOption importOption in currentApplicationItem.ImportOptionList) { importOptionsCheckedListBox.Items.Add(ImportOptionToString(importOption)); } - CheckImportOption(currentApplication); + CheckImportOption(currentApplicationItem); } else { importOptionsCheckedListBox.Visible = false; } - if ((currentApplication is ApplicationItemGameBase)) + //fill filesettings// just add them + int yPosition = 10; + if ((currentApplicationItem.FileSettingList != null) && (currentApplicationItem.FileSettingList.Count > 0)) { - this.gamebaseDBTextBox.Visible = true; - this.gamebaseDBButton.Visible = true; - this.gamebaseLabel.Visible = true; - this.gamebaseDBTextBox.Text = currentApplication.ApplicationItemSource; + filesettingsPanel.Controls.Clear(); + filesettingsPanel.Visible = true; + + foreach (FileSettingOption fileSetting in currentApplicationItem.FileSettingList) + { + FileSettingsBox fileSettingBox = new FileSettingsBox(fileSetting); + fileSettingBox.Location = new Point(0, yPosition); + this.filesettingsPanel.Controls.Add(fileSettingBox); + yPosition += 32; + } + SetUpFileSettingsBoxButtonEvents(); } + else + { + filesettingsPanel.Visible = false; + } - if ((currentApplication is ApplicationItemGrouper)) + if (ProgramUtils.UseThumbsDir()) { + imageDirsTextBox.Text = ProgramUtils.GetApplicationImageFolder(currentApplicationItem); + ((FileSettingsBox)imageDirsTextBox.Parent).Button.Visible = !ProgramUtils.UseThumbsDir(); + } + else + imageDirsTextBox.Text = currentApplicationItem.ImageDirectory; + + fileDirTextBox.Text = currentApplicationItem.FileDirectory; + fileExtensionsTextBox.Text = currentApplicationItem.ValidExtensions; + + if ((currentApplicationItem is ApplicationItemGrouper)) + { this.scanImageDirsButton.Visible = false; - this.FileSettingsGroupBox.Visible = false; + this.filesettingsPanel.Visible = false; } + } + } + private void SetUpFileSettingsBoxButtonEvents() + { + foreach (FileSettingsBox fileSettingBox in filesettingsPanel.Controls) + { + switch (fileSettingBox.Button.Name) + { + case "Filefolder(s)" + "Button": + fileDirTextBox = fileSettingBox.TextBox; + fileSettingBox.Button.Click += new EventHandler(fileDirButton_Click); + break; + case "Fileextension(s)" + "Button": + fileExtensionsTextBox = fileSettingBox.TextBox; + fileSettingBox.Button.Click += new EventHandler(this.fileExtensionsbutton_Click); + break; + case "Gamebase DB" + "Button": + gamebaseDBTextBox = fileSettingBox.TextBox; + fileSettingBox.Button.Click += new EventHandler(this.gamebaseDBButton_Click); + break; + case "Imagefolder(s)" + "Button": + imageDirsTextBox = fileSettingBox.TextBox; + fileSettingBox.Button.Click += new EventHandler(this.imageDirButton_Click); + break; + default: + break; + } } - } protected void fileDirButton_Click(object sender, EventArgs e) { - folderBrowserDialog.SelectedPath = this.fileDirTextBox.Text; + folderBrowserDialog.SelectedPath = fileDirTextBox.Text; + if (folderBrowserDialog.ShowDialog(null) == DialogResult.OK) { if (fileDirTextBox.Text == "") { - this.fileDirTextBox.Text = folderBrowserDialog.SelectedPath; - + fileDirTextBox.Text = folderBrowserDialog.SelectedPath; } else { - this.fileDirTextBox.Text = fileDirTextBox.Text + ";" + folderBrowserDialog.SelectedPath; + fileDirTextBox.Text = fileDirTextBox.Text + ";" + folderBrowserDialog.SelectedPath; } } } @@ -828,13 +836,11 @@ List<string> pathIniList = new List<string>(); string line; - if (File.Exists(this.gamebaseDBTextBox.Text)) + if (File.Exists(gamebaseDBTextBox.Text)) { string pathIniFile = Path.GetDirectoryName(gamebaseDBTextBox.Text) + "\\Paths.ini"; if (File.Exists(pathIniFile)) { - - using (StreamReader streamReader = File.OpenText(pathIniFile)) { while ((line = streamReader.ReadLine()) != null) @@ -911,8 +917,8 @@ { gamebaseDBTextBox.Text = openFileDialog.FileName; } + SetSourceDirectories(); - } } } \ No newline at end of file Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesView.resx =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesView.resx 2007-08-21 18:41:02 UTC (rev 850) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppFilesView.resx 2007-08-21 23:00:30 UTC (rev 851) @@ -175,13 +175,13 @@ <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>353, 17</value> </metadata> - <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> - <value>353, 17</value> - </metadata> <metadata name="folderBrowserDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>443, 17</value> </metadata> <metadata name="openFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>606, 17</value> </metadata> + <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>52</value> + </metadata> </root> \ No newline at end of file Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsBase.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsBase.cs 2007-08-21 18:41:02 UTC (rev 850) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsBase.cs 2007-08-21 23:00:30 UTC (rev 851) @@ -112,21 +112,21 @@ // set tooltip-stuff..... toolTip.SetToolTip(titleTextBox, "This text will appear in the listitem of MediaPortal\r\n(mandatory)"); - toolTip.SetToolTip(shellexecuteCheckBox, "Enable this if you want to run a program that is associated with a specific file-" + + toolTip.SetToolTip(shellexecuteCheckBox, "Enable this if you want to run a program that is associated with a specific fileItem-" + "extension.\r\n Omit the \"Launching Application\" in this case."); toolTip.SetToolTip(quoteCheckBox, "Quotes are usually needed to handle filenames with spaces correctly. \r\nAvoid double" + " quotes though!"); toolTip.SetToolTip(startupDirComboBox, "Optional path that is passed as the launch-directory \r\n\r\n(advanced hint: Use %FILEDIR" + - "% if you want to use the directory where the launched file is stored)"); + "% if you want to use the directory where the launched fileItem is stored)"); toolTip.SetToolTip(winStyleComboBox, "Appearance of the launched program. \r\nTry HIDDEN or MINIMIZED for a seamless integr" + "ation in MediaPortal"); toolTip.SetToolTip(applicationArgumentsTextBox, "Optional arguments that are needed to launch the program \r\n\r\n(advanced hint: Use %FIL" + "E% if the filename needs to be placed in some specific place between several arg" + "uments)"); toolTip.SetToolTip(applicationImageTextBox, "Optional filename for an image to display in MediaPortal"); toolTip.SetToolTip(enabledCheckbox, "Only enabled items will appear in MediaPortal"); toolTip.SetToolTip(applicationExeTextBox, "Program you wish to execute, include the full path (mandatory if ShellExecute is " + "OFF)"); - toolTip.SetToolTip(allowRefreshCheckBox, "Check this if users can run the import through the REFRESH button in MediaPortal."); - toolTip.SetToolTip(this.preCommandTextBox, "Configure an command to run as pre of the main filelaunching ie explorer; joy2key; etc .Separate with ;."); + toolTip.SetToolTip(allowRefreshCheckBox, "If you want to be able to run the import through the REFRESH button in MediaPortal."); + toolTip.SetToolTip(preCommandTextBox, "Configure an command to run as pre of the main filelaunching ie explorer; joy2key; etc .Separate with ;."); toolTip.SetToolTip(postCommandTextBox, "Configure an command to run as post of the main filelaunching ie explorer; joy2key; etc .Separate with ;."); - + toolTip.SetToolTip(waitExitCheckBox, "If you want mediaportal to wait for exit while running application."); } Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsDirCache.Designer.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsDirCache.Designer.cs 2007-08-21 18:41:02 UTC (rev 850) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsDirCache.Designer.cs 2007-08-21 23:00:30 UTC (rev 851) @@ -42,7 +42,7 @@ // // shellexecuteCheckBox // - this.toolTip.SetToolTip(this.shellexecuteCheckBox, "Enable this if you want to run a program that is associated with a specific file-" + + this.toolTip.SetToolTip(this.shellexecuteCheckBox, "Enable this if you want to run a program that is associated with a specific fileItem-" + "extension.\r\nYou can omit the \"Launching Application\" in this case."); // // applicationArgumentsLabel Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGamebase.Designer.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGamebase.Designer.cs 2007-08-21 18:41:02 UTC (rev 850) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGamebase.Designer.cs 2007-08-21 23:00:30 UTC (rev 851) @@ -42,7 +42,7 @@ // shellexecuteCheckBox // this.shellexecuteCheckBox.Location = new System.Drawing.Point(7, 338); - this.toolTip.SetToolTip(this.shellexecuteCheckBox, "Enable this if you want to run a program that is associated with a specific file-" + + this.toolTip.SetToolTip(this.shellexecuteCheckBox, "Enable this if you want to run a program that is associated with a specific fileItem-" + "extension.\r\nYou can omit the \"Launching Application\" in this case."); // // waitExitCheckBox Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGrouper.Designer.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGrouper.Designer.cs 2007-08-21 18:41:02 UTC (rev 850) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsGrouper.Designer.cs 2007-08-21 23:00:30 UTC (rev 851) @@ -40,7 +40,7 @@ // // shellexecuteCheckBox // - this.toolTip.SetToolTip(this.shellexecuteCheckBox, "Enable this if you want to run a program that is associated with a specific file-" + + this.toolTip.SetToolTip(this.shellexecuteCheckBox, "Enable this if you want to run a program that is associated with a specific fileItem-" + "extension.\r\nYou can omit the \"Launching Application\" in this case."); // // applicationArgumentsLabel @@ -61,7 +61,7 @@ // startupDirTextBox // this.toolTip.SetToolTip(this.startupDirComboBox, "Optional path that is passed as the launch-directory \r\n\r\n(advanced hint: Use %FIL" + - "EDIR% if you want to use the directory where the launched file is stored)"); + "EDIR% if you want to use the directory where the launched fileItem is stored)"); // // quoteCheckBox // Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsMame.Designer.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsMame.Designer.cs 2007-08-21 18:41:02 UTC (rev 850) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/AppSettingsMame.Designer.cs 2007-08-21 23:00:30 UTC (rev 851) @@ -45,7 +45,7 @@ // // shellexecuteCheckBox // - this.toolTip.SetToolTip(this.shellexecuteCheckBox, "Enable this if you want to run a program that is associated with a specific file-" + + this.toolTip.SetToolTip(this.shellexecuteCheckBox, "Enable this if you want to run a program that is associated with a specific fileItem-" + "extension.\r\nYou can omit the \"Launching Application\" in this case."); // // applicationArgumentsLabel Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/FileDetailsForm.Designer.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/FileDetailsForm.Designer.cs 2007-08-21 18:41:02 UTC (rev 850) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/FileDetailsForm.Designer.cs 2007-08-21 23:00:30 UTC (rev 851) @@ -94,7 +94,7 @@ this.buttonViewImg.Name = "buttonViewImg"; this.buttonViewImg.Size = new System.Drawing.Size(31, 23); this.buttonViewImg.TabIndex = 64; - this.toolTip1.SetToolTip(this.buttonViewImg, "View the default image for this file"); + this.toolTip1.SetToolTip(this.buttonViewImg, "View the default image for this fileItem"); this.buttonViewImg.UseVisualStyleBackColor = true; this.buttonViewImg.Click += new System.EventHandler(this.buttonViewImg_Click); // Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/FileDetailsForm.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/FileDetailsForm.cs 2007-08-21 18:41:02 UTC (rev 850) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/FileDetailsForm.cs 2007-08-21 23:00:30 UTC (rev 851) @@ -46,13 +46,13 @@ private ConditionChecker conditionChecker; - public ApplicationItem CurApp + public ApplicationItem CurrentApplicationItem { get { return m_CurApp; } set { m_CurApp = value; } } - public FileItem CurFile + public FileItem CurrentFileItem { get { return m_CurFile; } set { m_CurFile = value; } @@ -68,13 +68,13 @@ private void updateDisplay() { - gbFileDetails.Text = CurApp.Title + ": " + CurFile.Title; + gbFileDetails.Text = CurrentApplicationItem.Title + ": " + CurrentFileItem.Title; txtTitle.Text = m_CurFile.Title; txtFilename.Text = m_CurFile.Filename; if (ProgramUtils.UseThumbsDir()) { - txtImageFile.Text = ProgramUtils.GetFileImage(CurApp, CurFile); + txtImageFile.Text = ProgramUtils.GetFileImage(CurrentApplicationItem, CurrentFileItem); } else { @@ -82,7 +82,7 @@ } FileItemToGenre(); - manufacturerComboBox.SelectedValue = CurFile.ManufacturerId; + manufacturerComboBox.SelectedValue = CurrentFileItem.ManufacturerId; //txtManufacturer.Text = m_CurFile.Manufacturer; txtYear.Text = m_CurFile.Year.ToString(); @@ -215,7 +215,7 @@ private bool EntriesOK() { conditionChecker.Clear(); - conditionChecker.DoCheck(CurFile.Title != "", "No title entered!"); + conditionChecker.DoCheck(CurrentFileItem.Title != "", "No title entered!"); //01.04.05 no executable is FINE :-) conditionChecker.DoCheck(CurFile.Executable != "", "No executable entered!"); if (!conditionChecker.IsOk) { @@ -228,29 +228,29 @@ void FileItemToGenre() { - genreComboBox.SelectedValue = CurFile.GenreId; - genreStyleComboBox.SelectedValue = CurFile.GenreStyleId; - manufacturerComboBox.SelectedValue = CurFile.ManufacturerId; - systemComboBox.SelectedValue = CurFile.PlatformId; + genreComboBox.SelectedValue = CurrentFileItem.GenreId; + genreStyleComboBox.SelectedValue = CurrentFileItem.GenreStyleId; + manufacturerComboBox.SelectedValue = CurrentFileItem.ManufacturerId; + systemComboBox.SelectedValue = CurrentFileItem.PlatformId; } private void btnOk_Click(object sender, EventArgs e) { - CurFile.Title = txtTitle.Text; - CurFile.Filename = txtFilename.Text; + CurrentFileItem.Title = txtTitle.Text; + CurrentFileItem.Filename = txtFilename.Text; if (!ProgramUtils.UseThumbsDir()) - CurFile.Imagefile = txtImageFile.Text; + CurrentFileItem.Imagefile = txtImageFile.Text; // CurFile.Genre = genreComboBox.SelectedText; - CurFile.GenreId = (int)genreComboBox.SelectedValue; + CurrentFileItem.GenreId = (int)genreComboBox.SelectedValue; //CurFile.GenreStyle = genreStyleComboBox.SelectedText; - CurFile.GenreStyleId = (int)genreStyleComboBox.SelectedValue; - CurFile.ManufacturerId = (int)manufacturerComboBox.SelectedValue; - CurFile.Year = ProgramUtils.StringToInteger(txtYear.Text, -1); - CurFile.Rating = cbRating.SelectedIndex; - CurFile.Country = txtCountry.Text; - CurFile.PlatformId = (int)systemComboBox.SelectedValue; - CurFile.Overview = txtOverview.Text; - CurFile.GameInfoURL = this.gameinfoURLTextBox.Text; + CurrentFileItem.GenreStyleId = (int)genreStyleComboBox.SelectedValue; + CurrentFileItem.ManufacturerId = (int)manufacturerComboBox.SelectedValue; + CurrentFileItem.Year = ProgramUtils.StringToInteger(txtYear.Text, -1); + CurrentFileItem.Rating = cbRating.SelectedIndex; + CurrentFileItem.Country = txtCountry.Text; + CurrentFileItem.PlatformId = (int)systemComboBox.SelectedValue; + CurrentFileItem.Overview = txtOverview.Text; + CurrentFileItem.GameInfoURL = this.gameinfoURLTextBox.Text; if (EntriesOK()) { this.DialogResult = DialogResult.OK; Modified: trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/FileInfoScraperForm.cs =================================================================== --- trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/FileInfoScraperForm.cs 2007-08-21 18:41:02 UTC (rev 850) +++ trunk/plugins/myGUIProgramsAlt/GUIProgramsAlt/Design/FileInfoScraperForm.cs 2007-08-21 23:00:30 UTC (rev 851) @@ -347,7 +347,7 @@ strTimeRemaining = String.Format(" ({0}m {1}s remaining)", nMinutesRemaining, nSecondsRemaining); } - toolStripStatusLabel... [truncated message content] |
From: <gib...@us...> - 2007-08-21 18:41:41
|
Revision: 850 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=850&view=rev Author: gibman_dk Date: 2007-08-21 11:41:02 -0700 (Tue, 21 Aug 2007) Log Message: ----------- skinchanger plugin added. making it possible to change skins on the fly. it reacts on ; ACTION_SKIN_NEXT=9989, ACTION_SKIN_PREVIOUS=9990 Added Paths: ----------- trunk/plugins/SkinChanger/ trunk/plugins/SkinChanger/SkinChanger/ trunk/plugins/SkinChanger/SkinChanger/SkinChanger.cs trunk/plugins/SkinChanger/SkinChanger/SkinChanger.csproj trunk/plugins/SkinChanger/SkinChanger/bin/ trunk/plugins/SkinChanger/SkinChanger/bin/Debug/ trunk/plugins/SkinChanger/SkinChanger/bin/Release/ trunk/plugins/SkinChanger/SkinChanger/obj/ trunk/plugins/SkinChanger/SkinChanger.sln trunk/plugins/SkinChanger/SkinChanger.suo Added: trunk/plugins/SkinChanger/SkinChanger/SkinChanger.cs =================================================================== --- trunk/plugins/SkinChanger/SkinChanger/SkinChanger.cs (rev 0) +++ trunk/plugins/SkinChanger/SkinChanger/SkinChanger.cs 2007-08-21 18:41:02 UTC (rev 850) @@ -0,0 +1,238 @@ +using System; +using System.Collections; +using System.IO; +using MediaPortal.GUI.Library; +using MediaPortal.Configuration; +using System.Windows.Forms; + +namespace MediaPortal.GUI.SkinChanger +{ + public class SkinChanger : ISetupForm, IPluginReceiver + { + + private string _originalSkin; + private ArrayList _skins = new ArrayList(); + private int _activeSkinIndex = -1; + + + public SkinChanger() + { + } + + #region ISetupForm Members + + public bool CanEnable() + { + return true; + } + + public string Description() + { + return "Making it possible to change skin by input device."; + } + + public bool DefaultEnabled() + { + return false; + } + + public int GetWindowId() + { + return 0; + } + + public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) + { + strButtonText = null; + strButtonImage = null; + strButtonImageFocus = null; + strPictureImage = null; + return false; + } + + public string Author() + { + return "gibman"; + } + + public string PluginName() + { + return "SkinChanger"; + } + + public bool HasSetup() + { + return false; + } + + public void ShowPlugin() + { + } + + #endregion + + #region IPluginReceiver Members + + public bool WndProc(ref System.Windows.Forms.Message msg) + { + return false; + } + + #endregion + + #region IPlugin Members + + public void Start() + { + //System.Diagnostics.Debugger.Launch(); + SetSkins(); + GUIWindowManager.OnNewAction += new OnActionHandler(OnNewAction); + } + + public void Stop() + { + GUIWindowManager.OnNewAction -= new OnActionHandler(OnNewAction); + } + + #endregion + + #region OnGlobalMessage routines + private void OnGlobalMessage(GUIMessage message) + { + } + + + + #endregion + + #region MediaPortal events + + void OnNewAction(Action action) + { + if (action.wID == Action.ActionType.ACTION_SKIN_NEXT) + { + SwitchToNextSkin(); + } + + if (action.wID == Action.ActionType.ACTION_SKIN_PREVIOUS) + { + SwitchToPrevSkin(); + } + } + + #endregion + + #region Private Methods + + void SaveSettings() + { + using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + { + xmlwriter.SetValue("skin", "name", GUIGraphicsContext.Skin); + } + } + + private void SetSkins() + { + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + { + _originalSkin = xmlreader.GetValueAsString("skin", "name", "BlueTwo"); + } + + DirectoryInfo skinFolder = new DirectoryInfo(Config.GetFolder(Config.Dir.Skin)); + if (skinFolder.Exists) + { + DirectoryInfo[] skinDirList = skinFolder.GetDirectories(); + foreach (DirectoryInfo skinDir in skinDirList) + { + // + // Check if we have a home.xml located in the directory, if so we consider it as a + // valid skin directory + // + FileInfo refFile = new FileInfo(Config.GetFile(Config.Dir.Skin, skinDir.Name, "references.xml")); + if (refFile.Exists) + { + _skins.Add(skinDir.Name); + if (skinDir.FullName == GUIGraphicsContext.Skin) + { + _activeSkinIndex = _skins.Count-1; + } + } + } + } + } + + private void SwitchToNextSkin() + { + + if (_activeSkinIndex == -1 || _skins.Count == 0) + { + return; + } + string newSkin = _originalSkin; + + if (_activeSkinIndex + 1 == _skins.Count) + { + newSkin = (string)_skins[0]; + _activeSkinIndex = 0; + } + else + { + newSkin = (string)_skins[_activeSkinIndex + 1]; + _activeSkinIndex++; + } + + SwitchToSkin(newSkin); + + } + + private void SwitchToPrevSkin() + { + + if (_activeSkinIndex == -1 || _skins.Count == 0) + { + return; + } + string newSkin = _originalSkin; + + if (_activeSkinIndex - 1 == -1) + { + newSkin = (string)_skins[_skins.Count - 1]; + _activeSkinIndex = _skins.Count - 1; + } + else + { + newSkin = (string)_skins[_activeSkinIndex - 1]; + _activeSkinIndex--; + } + SwitchToSkin(newSkin); + + } + + private void SwitchToSkin(string newSkin) + { + + + // Set the skin to the selected skin and reload GUI + GUIGraphicsContext.Skin = newSkin; + SaveSettings(); + GUITextureManager.Clear(); + GUITextureManager.Init(); + GUIFontManager.LoadFonts(GUIGraphicsContext.Skin + @"\fonts.xml"); + GUIFontManager.InitializeDeviceObjects(); + GUIControlFactory.ClearReferences(); + GUIControlFactory.LoadReferences(GUIGraphicsContext.Skin + @"\references.xml"); + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + { + xmlreader.SetValue("general", "skinobsoletecount", 0); + bool autosize = xmlreader.GetValueAsBool("general", "autosize", true); + if (autosize && !GUIGraphicsContext.Fullscreen) + Form.ActiveForm.Size = new System.Drawing.Size(GUIGraphicsContext.SkinSize.Width, GUIGraphicsContext.SkinSize.Height); + } + GUIWindowManager.OnResize(); + } + + #endregion + + } +} Added: trunk/plugins/SkinChanger/SkinChanger/SkinChanger.csproj =================================================================== --- trunk/plugins/SkinChanger/SkinChanger/SkinChanger.csproj (rev 0) +++ trunk/plugins/SkinChanger/SkinChanger/SkinChanger.csproj 2007-08-21 18:41:02 UTC (rev 850) @@ -0,0 +1,59 @@ +<?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>{05B44048-280D-4BED-B64E-6F0A248503B2}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>SkinChanger</RootNamespace> + <AssemblyName>SkinChanger</AssemblyName> + <StartupObject> + </StartupObject> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <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> + <Reference Include="Core, Version=0.2.2.9991, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\..\MediaPortal\Core\bin\Release\Core.dll</HintPath> + </Reference> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml" /> + <Reference Include="Utils, Version=2.2.1.0, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\..\mediaportal\Core\bin\Release\Utils.dll</HintPath> + </Reference> + </ItemGroup> + <ItemGroup> + <Compile Include="SkinChanger.cs" /> + </ItemGroup> +</Project> \ No newline at end of file Added: trunk/plugins/SkinChanger/SkinChanger.sln =================================================================== --- trunk/plugins/SkinChanger/SkinChanger.sln (rev 0) +++ trunk/plugins/SkinChanger/SkinChanger.sln 2007-08-21 18:41:02 UTC (rev 850) @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SkinChanger", "SkinChanger\SkinChanger.csproj", "{05B44048-280D-4BED-B64E-6F0A248503B2}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {05B44048-280D-4BED-B64E-6F0A248503B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {05B44048-280D-4BED-B64E-6F0A248503B2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {05B44048-280D-4BED-B64E-6F0A248503B2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {05B44048-280D-4BED-B64E-6F0A248503B2}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal Added: trunk/plugins/SkinChanger/SkinChanger.suo =================================================================== (Binary files differ) Property changes on: trunk/plugins/SkinChanger/SkinChanger.suo ___________________________________________________________________ Name: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-08-21 07:08:18
|
Revision: 849 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=849&view=rev Author: and-81 Date: 2007-08-21 00:08:08 -0700 (Tue, 21 Aug 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs trunk/plugins/IR Server Suite/Applications/Translator/Program.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/LearnIR.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/MPBlastZonePlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/LearnIR.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MPControlPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/LearnIR.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2BlasterPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/LearnIR.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs Modified: trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs 2007-08-20 08:53:11 UTC (rev 848) +++ trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs 2007-08-21 07:08:08 UTC (rev 849) @@ -171,7 +171,6 @@ { case "Blast Success": case "Blast Failure": - case "Start Learn": case "Keyboard Event": case "Mouse Event": return; Modified: trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-08-20 08:53:11 UTC (rev 848) +++ trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-08-21 07:08:08 UTC (rev 849) @@ -878,14 +878,14 @@ { IrssLog.Debug("Learn IR"); - Thread.Sleep(500); - if (_pluginTransmit == null || !_pluginTransmit.CanLearn) { IrssLog.Debug("Active transceiver doesn't support learn"); return null; } + Thread.Sleep(500); + byte[] data = null; try @@ -902,7 +902,7 @@ break; case LearnStatus.Timeout: - IrssLog.Error("IR Code learn timed out"); + IrssLog.Warn("IR Code learn timed out"); break; } } @@ -1026,13 +1026,6 @@ break; } - // Pause half a second before instructing the client to start the IR learning ... - Thread.Sleep(500); - - // Send back a "Start Learn" trigger ... - PipeMessage trigger = new PipeMessage(Common.ServerPipeName, Environment.MachineName, "Start Learn", null); - SendTo(received.FromPipe, received.FromServer, trigger); - // Prepare response ... PipeMessage response = new PipeMessage(Common.ServerPipeName, Environment.MachineName, received.Name + " Failure", null); Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs 2007-08-20 08:53:11 UTC (rev 848) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs 2007-08-21 07:08:08 UTC (rev 849) @@ -104,7 +104,7 @@ } catch (Exception ex) { - MessageBox.Show(ex.ToString(), "IR Server Unexpected Error"); + MessageBox.Show(ex.ToString(), "IR Server Plugin Error"); } } Modified: trunk/plugins/IR Server Suite/Applications/Translator/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2007-08-20 08:53:11 UTC (rev 848) +++ trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2007-08-21 07:08:08 UTC (rev 849) @@ -912,7 +912,6 @@ { switch (received.Name) { - case "Start Learn": case "Blast Success": break; Modified: trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs =================================================================== --- trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs 2007-08-20 08:53:11 UTC (rev 848) +++ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs 2007-08-21 07:08:08 UTC (rev 849) @@ -106,12 +106,12 @@ int _remoteFirstRepeat = 400; int _remoteHeldRepeats = 250; - bool _enableKeyboardInput = true; + bool _enableKeyboardInput = false; int _keyboardFirstRepeat = 350; int _keyboardHeldRepeats = 0; bool _handleKeyboardLocally = true; - bool _enableMouseInput = true; + bool _enableMouseInput = false; bool _handleMouseLocally = true; double _mouseSensitivity = 1.0d; @@ -315,31 +315,20 @@ Thread.Sleep(100); } - LearnStatus status = LearnStatus.Failure; - if (_learning) { _learning = false; - try - { - DeviceAccess.CancelDeviceIo(_readStream.SafeFileHandle); - } - catch { } - - status = LearnStatus.Timeout; + return LearnStatus.Timeout; } else if (_learnedNativeData != null && _learnedNativeData.Count > 0) { data = _learnedNativeData.ToArray(); - status = LearnStatus.Success; + return LearnStatus.Success; } - - // Start a new read ... - _readStream.BeginRead(_deviceBuffer, 0, _deviceBuffer.Length, new AsyncCallback(OnReadComplete), null); - return status; + return LearnStatus.Failure; } public bool SetPort(string port) @@ -469,17 +458,6 @@ catch { } } - // Try Vista eHome driver ... - /*if (devicePath == null) - { - deviceClass = new Guid(0x36fc9e60, 0xc465, 0x11cf, 0x80, 0x56, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00); - try - { - devicePath = DeviceAccess.FindDevice(deviceClass); - } - catch { } - }*/ - if (devicePath == null) throw new Exception("No MCE Transceiver detected"); Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/LearnIR.cs =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/LearnIR.cs 2007-08-20 08:53:11 UTC (rev 848) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/LearnIR.cs 2007-08-21 07:08:08 UTC (rev 849) @@ -101,6 +101,8 @@ } } + #region Buttons + private void buttonLearn_Click(object sender, EventArgs e) { string command = textBoxName.Text.Trim(); @@ -164,6 +166,8 @@ } } + #endregion Buttons + } } Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/MPBlastZonePlugin.cs =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/MPBlastZonePlugin.cs 2007-08-20 08:53:11 UTC (rev 848) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/MPBlastZonePlugin.cs 2007-08-21 07:08:08 UTC (rev 849) @@ -563,7 +563,6 @@ { switch (received.Name) { - case "Start Learn": case "Blast Success": case "Remote Event": case "Keyboard Event": Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/LearnIR.cs =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/LearnIR.cs 2007-08-20 08:53:11 UTC (rev 848) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/LearnIR.cs 2007-08-21 07:08:08 UTC (rev 849) @@ -101,6 +101,8 @@ } } + #region Buttons + private void buttonLearn_Click(object sender, EventArgs e) { string command = textBoxName.Text.Trim(); @@ -153,9 +155,18 @@ if (command.Length == 0) return; - MPControlPlugin.BlastIR(Common.FolderIRCommands + command + Common.FileExtensionIR, - comboBoxPort.SelectedItem as string); + try + { + MPControlPlugin.BlastIR(Common.FolderIRCommands + command + Common.FileExtensionIR, + comboBoxPort.SelectedItem as string); + } + catch (Exception ex) + { + MessageBox.Show(this, ex.Message, "Test failed", MessageBoxButtons.OK, MessageBoxIcon.Error); + } } + + #endregion Buttons } Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MPControlPlugin.cs =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MPControlPlugin.cs 2007-08-20 08:53:11 UTC (rev 848) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MPControlPlugin.cs 2007-08-21 07:08:08 UTC (rev 849) @@ -823,7 +823,6 @@ { switch (received.Name) { - case "Start Learn": case "Blast Success": case "Keyboard Event": case "Mouse Event": @@ -1538,7 +1537,7 @@ BitConverter.GetBytes(port.Length).CopyTo(outData, 0); Encoding.ASCII.GetBytes(port).CopyTo(outData, 4); - file.Read(outData, 8 + port.Length, (int)file.Length); + file.Read(outData, 4 + port.Length, (int)file.Length); file.Close(); PipeMessage message = new PipeMessage(_localPipeName, Environment.MachineName, "Blast", outData); Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/LearnIR.cs =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/LearnIR.cs 2007-08-20 08:53:11 UTC (rev 848) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/LearnIR.cs 2007-08-21 07:08:08 UTC (rev 849) @@ -101,6 +101,8 @@ } } + #region Buttons + private void buttonLearn_Click(object sender, EventArgs e) { string command = textBoxName.Text.Trim(); @@ -164,6 +166,8 @@ } } + #endregion Buttons + } } Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2BlasterPlugin.cs =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2BlasterPlugin.cs 2007-08-20 08:53:11 UTC (rev 848) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2BlasterPlugin.cs 2007-08-21 07:08:08 UTC (rev 849) @@ -436,7 +436,6 @@ { switch (received.Name) { - case "Start Learn": case "Blast Success": case "Remote Event": case "Keyboard Event": Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/LearnIR.cs =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/LearnIR.cs 2007-08-20 08:53:11 UTC (rev 848) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/LearnIR.cs 2007-08-21 07:08:08 UTC (rev 849) @@ -101,6 +101,8 @@ } } + #region Buttons + private void buttonLearn_Click(object sender, EventArgs e) { string command = textBoxName.Text.Trim(); @@ -164,6 +166,8 @@ } } + #endregion Buttons + } } Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs 2007-08-20 08:53:11 UTC (rev 848) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs 2007-08-21 07:08:08 UTC (rev 849) @@ -413,7 +413,6 @@ { switch (received.Name) { - case "Start Learn": case "Blast Success": case "Remote Event": case "Keyboard Event": This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |