From: <an...@us...> - 2007-03-14 13:31:06
|
Revision: 186 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=186&view=rev Author: and-81 Date: 2007-03-14 06:30:54 -0700 (Wed, 14 Mar 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ComSkipLauncher TVE2/AssemblyInfo.cs trunk/plugins/ComSkipLauncher TVE2/ComSkipLauncher.cs trunk/plugins/ComSkipLauncher TVE2/Configuration.Designer.cs trunk/plugins/ComSkipLauncher TVE2/Configuration.cs trunk/plugins/ComSkipLauncher TVE3/AssemblyInfo.cs trunk/plugins/ComSkipLauncher TVE3/ComSkipLauncher.cs trunk/plugins/ComSkipLauncher TVE3/PluginSetup.Designer.cs trunk/plugins/ComSkipLauncher TVE3/PluginSetup.cs Modified: trunk/plugins/ComSkipLauncher TVE2/AssemblyInfo.cs =================================================================== --- trunk/plugins/ComSkipLauncher TVE2/AssemblyInfo.cs 2007-03-13 20:14:54 UTC (rev 185) +++ trunk/plugins/ComSkipLauncher TVE2/AssemblyInfo.cs 2007-03-14 13:30:54 UTC (rev 186) @@ -9,7 +9,7 @@ // associated with an assembly. // [assembly: AssemblyTitle("ComSkipLauncher TVE2")] -[assembly: AssemblyDescription("Launches ComSkip when a recording completes")] +[assembly: AssemblyDescription("Launches ComSkip on recordings")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("For MediaPortal")] [assembly: AssemblyProduct("ComSkipLauncher plugin by and-81")] Modified: trunk/plugins/ComSkipLauncher TVE2/ComSkipLauncher.cs =================================================================== --- trunk/plugins/ComSkipLauncher TVE2/ComSkipLauncher.cs 2007-03-13 20:14:54 UTC (rev 185) +++ trunk/plugins/ComSkipLauncher TVE2/ComSkipLauncher.cs 2007-03-14 13:30:54 UTC (rev 186) @@ -21,24 +21,17 @@ public static readonly string MPConfigFile = Config.GetFolder(Config.Dir.Config) + "\\MediaPortal.xml"; - public static readonly string DefaultStartProgram = "\\Program Files\\ComSkip\\ComSkip.exe"; - public static readonly string DefaultStartParameters = "--playnice \"{0}\""; + public static readonly string DefaultProgram = "\\Program Files\\ComSkip\\ComSkip.exe"; + public static readonly string DefaultParameters = "--playnice \"{0}\""; - public static readonly string DefaultEndProgram = "\\Program Files\\ComSkip\\ComClean.bat"; - public static readonly string DefaultEndParameters = "\"{0}\""; - #endregion Constants #region Members bool _runAtStart; - string _startProgram; - string _startParameters; + string _program; + string _parameters; - bool _runAtEnd; - string _endProgram; - string _endParameters; - #endregion Members #region IPlugin Members @@ -51,8 +44,7 @@ if (_runAtStart) Recorder.OnTvRecordingStarted += new Recorder.OnTvRecordingHandler(Recorder_OnTvRecordingStarted); - - if (_runAtEnd) + else Recorder.OnTvRecordingEnded += new Recorder.OnTvRecordingHandler(Recorder_OnTvRecordingEnded); } public void Stop() @@ -61,8 +53,7 @@ if (_runAtStart) Recorder.OnTvRecordingStarted -= new Recorder.OnTvRecordingHandler(Recorder_OnTvRecordingStarted); - - if (_runAtEnd) + else Recorder.OnTvRecordingEnded -= new Recorder.OnTvRecordingHandler(Recorder_OnTvRecordingEnded); } @@ -73,7 +64,7 @@ public string Author() { return "and-81"; } public bool CanEnable() { return true; } public bool DefaultEnabled() { return true; } - public string Description() { return "Launches ComSkip when a recording completes."; } + public string Description() { return "Launches ComSkip on recordings."; } public int GetWindowId() { return 0; } public bool HasSetup() { return true; } public string PluginName() { return "ComSkip Launcher"; } @@ -84,23 +75,15 @@ Configuration configuration = new Configuration(); configuration.RunAtStart = _runAtStart; - configuration.StartProgram = _startProgram; - configuration.StartParameters = _startParameters; + configuration.Program = _program; + configuration.Parameters = _parameters; - configuration.RunAtEnd = _runAtEnd; - configuration.EndProgram = _endProgram; - configuration.EndParameters = _endParameters; - if (configuration.ShowDialog() == DialogResult.OK) { _runAtStart = configuration.RunAtStart; - _startProgram = configuration.StartProgram; - _startParameters = configuration.StartParameters; + _program = configuration.Program; + _parameters = configuration.Parameters; - _runAtEnd = configuration.RunAtEnd; - _endProgram = configuration.EndProgram; - _endParameters = configuration.EndParameters; - SaveSettings(); } } @@ -121,16 +104,16 @@ try { - string parameters = ProcessParameters(_startParameters, recordingFilename); + string parameters = ProcessParameters(_parameters, recordingFilename); Log.Info( "ComSkipLauncher: Recording started ({0}), launching program ({1} {2}) ...", recordingFilename, - _startProgram, + _program, parameters ); - LaunchProcess(_startProgram, parameters, Path.GetDirectoryName(recordingFilename), ProcessWindowStyle.Hidden); + LaunchProcess(_program, parameters, Path.GetDirectoryName(recordingFilename), ProcessWindowStyle.Hidden); } catch (Exception ex) { @@ -161,16 +144,16 @@ return; } - string parameters = ProcessParameters(_endParameters, fileName); + string parameters = ProcessParameters(_parameters, fileName); Log.Info( "ComSkipLauncher: Recording ended ({0}), launching program ({1} {2}) ...", fileName, - _endProgram, + _program, parameters ); - LaunchProcess(_endProgram, parameters, Path.GetDirectoryName(fileName), ProcessWindowStyle.Hidden); + LaunchProcess(_program, parameters, Path.GetDirectoryName(fileName), ProcessWindowStyle.Hidden); } catch (Exception ex) { @@ -185,12 +168,8 @@ using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(MPConfigFile)) { _runAtStart = xmlreader.GetValueAsBool("ComSkipLauncher", "RunAtStart", false); - _startProgram = xmlreader.GetValueAsString("ComSkipLauncher", "StartProgram", DefaultStartProgram); - _startParameters = xmlreader.GetValueAsString("ComSkipLauncher", "StartParameters", DefaultStartParameters); - - _runAtEnd = xmlreader.GetValueAsBool("ComSkipLauncher", "RunAtEnd", false); - _endProgram = xmlreader.GetValueAsString("ComSkipLauncher", "EndProgram", DefaultEndProgram); - _endParameters = xmlreader.GetValueAsString("ComSkipLauncher", "EndParameters", DefaultEndParameters); + _program = xmlreader.GetValueAsString("ComSkipLauncher", "Program", DefaultProgram); + _parameters = xmlreader.GetValueAsString("ComSkipLauncher", "Parameters", DefaultParameters); } } catch (Exception ex) @@ -205,12 +184,8 @@ using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(MPConfigFile)) { xmlwriter.SetValueAsBool("ComSkipLauncher", "RunAtStart", _runAtStart); - xmlwriter.SetValue("ComSkipLauncher", "StartProgram", _startProgram); - xmlwriter.SetValue("ComSkipLauncher", "StartParameters", _startParameters); - - xmlwriter.SetValueAsBool("ComSkipLauncher", "RunAtEnd", _runAtEnd); - xmlwriter.SetValue("ComSkipLauncher", "EndProgram", _endProgram); - xmlwriter.SetValue("ComSkipLauncher", "EndParameters", _endParameters); + xmlwriter.SetValue("ComSkipLauncher", "Program", _program); + xmlwriter.SetValue("ComSkipLauncher", "Parameters", _parameters); } } catch (Exception ex) Modified: trunk/plugins/ComSkipLauncher TVE2/Configuration.Designer.cs =================================================================== --- trunk/plugins/ComSkipLauncher TVE2/Configuration.Designer.cs 2007-03-13 20:14:54 UTC (rev 185) +++ trunk/plugins/ComSkipLauncher TVE2/Configuration.Designer.cs 2007-03-14 13:30:54 UTC (rev 186) @@ -35,41 +35,27 @@ this.buttonTest = new System.Windows.Forms.Button(); this.textBoxTest = new System.Windows.Forms.TextBox(); this.buttonFindTestFile = new System.Windows.Forms.Button(); - this.radioButtonStartDoNothing = new System.Windows.Forms.RadioButton(); - this.radioButtonStartLaunch = new System.Windows.Forms.RadioButton(); + this.radioButtonStart = new System.Windows.Forms.RadioButton(); + this.radioButtonEnd = new System.Windows.Forms.RadioButton(); this.toolTips = new System.Windows.Forms.ToolTip(this.components); - this.textBoxEndParameters = new System.Windows.Forms.TextBox(); - this.buttonEndParameters = new System.Windows.Forms.Button(); - this.buttonEndProgram = new System.Windows.Forms.Button(); - this.textBoxEndProgram = new System.Windows.Forms.TextBox(); - this.textBoxStartParameters = new System.Windows.Forms.TextBox(); - this.buttonStartParameters = new System.Windows.Forms.Button(); - this.buttonStartProgram = new System.Windows.Forms.Button(); - this.textBoxStartProgram = new System.Windows.Forms.TextBox(); - this.radioButtonEndDoNothing = new System.Windows.Forms.RadioButton(); - this.radioButtonEndLaunch = new System.Windows.Forms.RadioButton(); - this.tabControl = new System.Windows.Forms.TabControl(); - this.tabPageStart = new System.Windows.Forms.TabPage(); - this.groupBoxStartProgram = new System.Windows.Forms.GroupBox(); - this.labelStartParameters = new System.Windows.Forms.Label(); - this.labelStartProgram = new System.Windows.Forms.Label(); - this.tabPageEnd = new System.Windows.Forms.TabPage(); - this.groupBoxEndProgram = new System.Windows.Forms.GroupBox(); - this.labelEndParameters = new System.Windows.Forms.Label(); - this.labelEndProgram = new System.Windows.Forms.Label(); + this.textBoxParameters = new System.Windows.Forms.TextBox(); + this.buttonParameters = new System.Windows.Forms.Button(); + this.buttonProgram = new System.Windows.Forms.Button(); + this.textBoxProgram = new System.Windows.Forms.TextBox(); + this.groupBoxWhat = new System.Windows.Forms.GroupBox(); + this.labelParameters = new System.Windows.Forms.Label(); + this.labelProgram = new System.Windows.Forms.Label(); this.groupBoxTest = new System.Windows.Forms.GroupBox(); - this.tabControl.SuspendLayout(); - this.tabPageStart.SuspendLayout(); - this.groupBoxStartProgram.SuspendLayout(); - this.tabPageEnd.SuspendLayout(); - this.groupBoxEndProgram.SuspendLayout(); + this.groupBoxWhen = new System.Windows.Forms.GroupBox(); + this.groupBoxWhat.SuspendLayout(); this.groupBoxTest.SuspendLayout(); + this.groupBoxWhen.SuspendLayout(); this.SuspendLayout(); // // buttonOK // this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonOK.Location = new System.Drawing.Point(216, 288); + this.buttonOK.Location = new System.Drawing.Point(216, 248); this.buttonOK.Name = "buttonOK"; this.buttonOK.Size = new System.Drawing.Size(56, 24); this.buttonOK.TabIndex = 2; @@ -81,7 +67,7 @@ // this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.buttonCancel.Location = new System.Drawing.Point(280, 288); + this.buttonCancel.Location = new System.Drawing.Point(280, 248); this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Size = new System.Drawing.Size(56, 24); this.buttonCancel.TabIndex = 3; @@ -127,256 +113,114 @@ this.buttonFindTestFile.UseVisualStyleBackColor = true; this.buttonFindTestFile.Click += new System.EventHandler(this.buttonFindTestFile_Click); // - // radioButtonStartDoNothing + // radioButtonStart // - this.radioButtonStartDoNothing.Location = new System.Drawing.Point(8, 8); - this.radioButtonStartDoNothing.Name = "radioButtonStartDoNothing"; - this.radioButtonStartDoNothing.Size = new System.Drawing.Size(96, 24); - this.radioButtonStartDoNothing.TabIndex = 0; - this.radioButtonStartDoNothing.Text = "Do nothing"; - this.toolTips.SetToolTip(this.radioButtonStartDoNothing, "Launch ComSkip as soon as the recording starts (this requires the LiveTV setting " + + this.radioButtonStart.Enabled = false; + this.radioButtonStart.Location = new System.Drawing.Point(8, 16); + this.radioButtonStart.Name = "radioButtonStart"; + this.radioButtonStart.Size = new System.Drawing.Size(120, 24); + this.radioButtonStart.TabIndex = 0; + this.radioButtonStart.Text = "Recording Start"; + this.toolTips.SetToolTip(this.radioButtonStart, "Launch ComSkip as soon as the recording starts (this requires the LiveTV setting " + "in comskip.ini)"); - this.radioButtonStartDoNothing.UseVisualStyleBackColor = true; + this.radioButtonStart.UseVisualStyleBackColor = true; // - // radioButtonStartLaunch + // radioButtonEnd // - this.radioButtonStartLaunch.Checked = true; - this.radioButtonStartLaunch.Location = new System.Drawing.Point(8, 32); - this.radioButtonStartLaunch.Name = "radioButtonStartLaunch"; - this.radioButtonStartLaunch.Size = new System.Drawing.Size(96, 24); - this.radioButtonStartLaunch.TabIndex = 1; - this.radioButtonStartLaunch.Text = "Launch:"; - this.toolTips.SetToolTip(this.radioButtonStartLaunch, "Launch ComSkip to process the recording after it has finished"); - this.radioButtonStartLaunch.UseVisualStyleBackColor = true; - this.radioButtonStartLaunch.CheckedChanged += new System.EventHandler(this.radioButtonStartLaunch_CheckedChanged); + this.radioButtonEnd.Checked = true; + this.radioButtonEnd.Location = new System.Drawing.Point(144, 16); + this.radioButtonEnd.Name = "radioButtonEnd"; + this.radioButtonEnd.Size = new System.Drawing.Size(120, 24); + this.radioButtonEnd.TabIndex = 1; + this.radioButtonEnd.TabStop = true; + this.radioButtonEnd.Text = "Recording End"; + this.toolTips.SetToolTip(this.radioButtonEnd, "Launch ComSkip to process the recording after it has finished"); + this.radioButtonEnd.UseVisualStyleBackColor = true; // - // textBoxEndParameters + // textBoxParameters // - this.textBoxEndParameters.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.textBoxParameters.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.textBoxEndParameters.Location = new System.Drawing.Point(8, 80); - this.textBoxEndParameters.Name = "textBoxEndParameters"; - this.textBoxEndParameters.Size = new System.Drawing.Size(256, 20); - this.textBoxEndParameters.TabIndex = 4; - this.toolTips.SetToolTip(this.textBoxEndParameters, "Provide command line parameters for the program"); + this.textBoxParameters.Location = new System.Drawing.Point(8, 80); + this.textBoxParameters.Name = "textBoxParameters"; + this.textBoxParameters.Size = new System.Drawing.Size(280, 20); + this.textBoxParameters.TabIndex = 4; + this.toolTips.SetToolTip(this.textBoxParameters, "Provide command line parameters for the program"); // - // buttonEndParameters + // buttonParameters // - this.buttonEndParameters.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonEndParameters.Location = new System.Drawing.Point(272, 80); - this.buttonEndParameters.Name = "buttonEndParameters"; - this.buttonEndParameters.Size = new System.Drawing.Size(24, 20); - this.buttonEndParameters.TabIndex = 5; - this.buttonEndParameters.Text = "?"; - this.toolTips.SetToolTip(this.buttonEndParameters, "Click here for a list of additional command line parameters"); - this.buttonEndParameters.UseVisualStyleBackColor = true; - this.buttonEndParameters.Click += new System.EventHandler(this.buttonParamQuestion_Click); + this.buttonParameters.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.buttonParameters.Location = new System.Drawing.Point(296, 80); + this.buttonParameters.Name = "buttonParameters"; + this.buttonParameters.Size = new System.Drawing.Size(24, 20); + this.buttonParameters.TabIndex = 5; + this.buttonParameters.Text = "?"; + this.toolTips.SetToolTip(this.buttonParameters, "Click here for a list of additional command line parameters"); + this.buttonParameters.UseVisualStyleBackColor = true; + this.buttonParameters.Click += new System.EventHandler(this.buttonParamQuestion_Click); // - // buttonEndProgram + // buttonProgram // - this.buttonEndProgram.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonEndProgram.Location = new System.Drawing.Point(272, 40); - this.buttonEndProgram.Name = "buttonEndProgram"; - this.buttonEndProgram.Size = new System.Drawing.Size(24, 20); - this.buttonEndProgram.TabIndex = 2; - this.buttonEndProgram.Text = "..."; - this.toolTips.SetToolTip(this.buttonEndProgram, "Locate the program you wish to launch"); - this.buttonEndProgram.UseVisualStyleBackColor = true; - this.buttonEndProgram.Click += new System.EventHandler(this.buttonEndProgram_Click); + this.buttonProgram.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.buttonProgram.Location = new System.Drawing.Point(296, 40); + this.buttonProgram.Name = "buttonProgram"; + this.buttonProgram.Size = new System.Drawing.Size(24, 20); + this.buttonProgram.TabIndex = 2; + this.buttonProgram.Text = "..."; + this.toolTips.SetToolTip(this.buttonProgram, "Locate the program you wish to launch"); + this.buttonProgram.UseVisualStyleBackColor = true; + this.buttonProgram.Click += new System.EventHandler(this.buttonProgram_Click); // - // textBoxEndProgram + // textBoxProgram // - this.textBoxEndProgram.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.textBoxProgram.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.textBoxEndProgram.Location = new System.Drawing.Point(8, 40); - this.textBoxEndProgram.Name = "textBoxEndProgram"; - this.textBoxEndProgram.Size = new System.Drawing.Size(256, 20); - this.textBoxEndProgram.TabIndex = 1; - this.toolTips.SetToolTip(this.textBoxEndProgram, "The full location of the program to launch"); + this.textBoxProgram.Location = new System.Drawing.Point(8, 40); + this.textBoxProgram.Name = "textBoxProgram"; + this.textBoxProgram.Size = new System.Drawing.Size(280, 20); + this.textBoxProgram.TabIndex = 1; + this.toolTips.SetToolTip(this.textBoxProgram, "The full location of the program to launch"); // - // textBoxStartParameters + // groupBoxWhat // - this.textBoxStartParameters.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.textBoxStartParameters.Location = new System.Drawing.Point(8, 80); - this.textBoxStartParameters.Name = "textBoxStartParameters"; - this.textBoxStartParameters.Size = new System.Drawing.Size(256, 20); - this.textBoxStartParameters.TabIndex = 4; - this.toolTips.SetToolTip(this.textBoxStartParameters, "Provide command line parameters for the program"); - // - // buttonStartParameters - // - this.buttonStartParameters.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonStartParameters.Location = new System.Drawing.Point(272, 80); - this.buttonStartParameters.Name = "buttonStartParameters"; - this.buttonStartParameters.Size = new System.Drawing.Size(24, 20); - this.buttonStartParameters.TabIndex = 5; - this.buttonStartParameters.Text = "?"; - this.toolTips.SetToolTip(this.buttonStartParameters, "Click here for a list of additional command line parameters"); - this.buttonStartParameters.UseVisualStyleBackColor = true; - this.buttonStartParameters.Click += new System.EventHandler(this.buttonParamQuestion_Click); - // - // buttonStartProgram - // - this.buttonStartProgram.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonStartProgram.Location = new System.Drawing.Point(272, 40); - this.buttonStartProgram.Name = "buttonStartProgram"; - this.buttonStartProgram.Size = new System.Drawing.Size(24, 20); - this.buttonStartProgram.TabIndex = 2; - this.buttonStartProgram.Text = "..."; - this.toolTips.SetToolTip(this.buttonStartProgram, "Locate the program you wish to launch"); - this.buttonStartProgram.UseVisualStyleBackColor = true; - this.buttonStartProgram.Click += new System.EventHandler(this.buttonStartProgram_Click); - // - // textBoxStartProgram - // - this.textBoxStartProgram.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.textBoxStartProgram.Location = new System.Drawing.Point(8, 40); - this.textBoxStartProgram.Name = "textBoxStartProgram"; - this.textBoxStartProgram.Size = new System.Drawing.Size(256, 20); - this.textBoxStartProgram.TabIndex = 1; - this.toolTips.SetToolTip(this.textBoxStartProgram, "The full location of the program to launch"); - // - // radioButtonEndDoNothing - // - this.radioButtonEndDoNothing.Location = new System.Drawing.Point(8, 8); - this.radioButtonEndDoNothing.Name = "radioButtonEndDoNothing"; - this.radioButtonEndDoNothing.Size = new System.Drawing.Size(96, 24); - this.radioButtonEndDoNothing.TabIndex = 0; - this.radioButtonEndDoNothing.Text = "Do nothing"; - this.radioButtonEndDoNothing.UseVisualStyleBackColor = true; - // - // radioButtonEndLaunch - // - this.radioButtonEndLaunch.Checked = true; - this.radioButtonEndLaunch.Location = new System.Drawing.Point(8, 32); - this.radioButtonEndLaunch.Name = "radioButtonEndLaunch"; - this.radioButtonEndLaunch.Size = new System.Drawing.Size(96, 24); - this.radioButtonEndLaunch.TabIndex = 1; - this.radioButtonEndLaunch.Text = "Launch:"; - this.radioButtonEndLaunch.UseVisualStyleBackColor = true; - this.radioButtonEndLaunch.CheckedChanged += new System.EventHandler(this.radioButtonEndLaunch_CheckedChanged); - // - // tabControl - // - this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + this.groupBoxWhat.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.tabControl.Controls.Add(this.tabPageStart); - this.tabControl.Controls.Add(this.tabPageEnd); - this.tabControl.Location = new System.Drawing.Point(8, 8); - this.tabControl.Name = "tabControl"; - this.tabControl.SelectedIndex = 0; - this.tabControl.Size = new System.Drawing.Size(328, 208); - this.tabControl.TabIndex = 0; + this.groupBoxWhat.Controls.Add(this.labelParameters); + this.groupBoxWhat.Controls.Add(this.textBoxParameters); + this.groupBoxWhat.Controls.Add(this.buttonParameters); + this.groupBoxWhat.Controls.Add(this.labelProgram); + this.groupBoxWhat.Controls.Add(this.buttonProgram); + this.groupBoxWhat.Controls.Add(this.textBoxProgram); + this.groupBoxWhat.Location = new System.Drawing.Point(8, 64); + this.groupBoxWhat.Name = "groupBoxWhat"; + this.groupBoxWhat.Size = new System.Drawing.Size(328, 112); + this.groupBoxWhat.TabIndex = 2; + this.groupBoxWhat.TabStop = false; + this.groupBoxWhat.Text = "What to launch"; // - // tabPageStart + // labelParameters // - this.tabPageStart.Controls.Add(this.groupBoxStartProgram); - this.tabPageStart.Controls.Add(this.radioButtonStartDoNothing); - this.tabPageStart.Controls.Add(this.radioButtonStartLaunch); - this.tabPageStart.Location = new System.Drawing.Point(4, 22); - this.tabPageStart.Name = "tabPageStart"; - this.tabPageStart.Padding = new System.Windows.Forms.Padding(3); - this.tabPageStart.Size = new System.Drawing.Size(320, 182); - this.tabPageStart.TabIndex = 0; - this.tabPageStart.Text = "When recording starts ..."; - this.tabPageStart.UseVisualStyleBackColor = true; - // - // groupBoxStartProgram - // - this.groupBoxStartProgram.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) + this.labelParameters.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.groupBoxStartProgram.Controls.Add(this.labelStartParameters); - this.groupBoxStartProgram.Controls.Add(this.textBoxStartParameters); - this.groupBoxStartProgram.Controls.Add(this.buttonStartParameters); - this.groupBoxStartProgram.Controls.Add(this.labelStartProgram); - this.groupBoxStartProgram.Controls.Add(this.buttonStartProgram); - this.groupBoxStartProgram.Controls.Add(this.textBoxStartProgram); - this.groupBoxStartProgram.Location = new System.Drawing.Point(8, 64); - this.groupBoxStartProgram.Name = "groupBoxStartProgram"; - this.groupBoxStartProgram.Size = new System.Drawing.Size(304, 112); - this.groupBoxStartProgram.TabIndex = 2; - this.groupBoxStartProgram.TabStop = false; - this.groupBoxStartProgram.Text = "What to do"; + this.labelParameters.Location = new System.Drawing.Point(8, 64); + this.labelParameters.Name = "labelParameters"; + this.labelParameters.Size = new System.Drawing.Size(280, 16); + this.labelParameters.TabIndex = 3; + this.labelParameters.Text = "Parameters:"; + this.labelParameters.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // - // labelStartParameters + // labelProgram // - this.labelStartParameters.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.labelProgram.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.labelStartParameters.Location = new System.Drawing.Point(8, 64); - this.labelStartParameters.Name = "labelStartParameters"; - this.labelStartParameters.Size = new System.Drawing.Size(256, 16); - this.labelStartParameters.TabIndex = 3; - this.labelStartParameters.Text = "Parameters:"; - this.labelStartParameters.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.labelProgram.Location = new System.Drawing.Point(8, 24); + this.labelProgram.Name = "labelProgram"; + this.labelProgram.Size = new System.Drawing.Size(280, 16); + this.labelProgram.TabIndex = 0; + this.labelProgram.Text = "Program:"; + this.labelProgram.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // - // labelStartProgram - // - this.labelStartProgram.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.labelStartProgram.Location = new System.Drawing.Point(8, 24); - this.labelStartProgram.Name = "labelStartProgram"; - this.labelStartProgram.Size = new System.Drawing.Size(256, 16); - this.labelStartProgram.TabIndex = 0; - this.labelStartProgram.Text = "Program:"; - this.labelStartProgram.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // tabPageEnd - // - this.tabPageEnd.Controls.Add(this.groupBoxEndProgram); - this.tabPageEnd.Controls.Add(this.radioButtonEndDoNothing); - this.tabPageEnd.Controls.Add(this.radioButtonEndLaunch); - this.tabPageEnd.Location = new System.Drawing.Point(4, 22); - this.tabPageEnd.Name = "tabPageEnd"; - this.tabPageEnd.Padding = new System.Windows.Forms.Padding(3); - this.tabPageEnd.Size = new System.Drawing.Size(320, 182); - this.tabPageEnd.TabIndex = 1; - this.tabPageEnd.Text = "When recording ends ..."; - this.tabPageEnd.UseVisualStyleBackColor = true; - // - // groupBoxEndProgram - // - this.groupBoxEndProgram.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.groupBoxEndProgram.Controls.Add(this.labelEndParameters); - this.groupBoxEndProgram.Controls.Add(this.textBoxEndParameters); - this.groupBoxEndProgram.Controls.Add(this.buttonEndParameters); - this.groupBoxEndProgram.Controls.Add(this.labelEndProgram); - this.groupBoxEndProgram.Controls.Add(this.buttonEndProgram); - this.groupBoxEndProgram.Controls.Add(this.textBoxEndProgram); - this.groupBoxEndProgram.Location = new System.Drawing.Point(8, 64); - this.groupBoxEndProgram.Name = "groupBoxEndProgram"; - this.groupBoxEndProgram.Size = new System.Drawing.Size(304, 112); - this.groupBoxEndProgram.TabIndex = 2; - this.groupBoxEndProgram.TabStop = false; - this.groupBoxEndProgram.Text = "What to do"; - // - // labelEndParameters - // - this.labelEndParameters.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.labelEndParameters.Location = new System.Drawing.Point(8, 64); - this.labelEndParameters.Name = "labelEndParameters"; - this.labelEndParameters.Size = new System.Drawing.Size(256, 16); - this.labelEndParameters.TabIndex = 3; - this.labelEndParameters.Text = "Parameters:"; - this.labelEndParameters.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // labelEndProgram - // - this.labelEndProgram.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.labelEndProgram.Location = new System.Drawing.Point(8, 24); - this.labelEndProgram.Name = "labelEndProgram"; - this.labelEndProgram.Size = new System.Drawing.Size(256, 16); - this.labelEndProgram.TabIndex = 0; - this.labelEndProgram.Text = "Program:"; - this.labelEndProgram.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // // groupBoxTest // this.groupBoxTest.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) @@ -384,41 +228,51 @@ this.groupBoxTest.Controls.Add(this.textBoxTest); this.groupBoxTest.Controls.Add(this.buttonTest); this.groupBoxTest.Controls.Add(this.buttonFindTestFile); - this.groupBoxTest.Location = new System.Drawing.Point(8, 224); + this.groupBoxTest.Location = new System.Drawing.Point(8, 184); this.groupBoxTest.Name = "groupBoxTest"; this.groupBoxTest.Size = new System.Drawing.Size(328, 56); this.groupBoxTest.TabIndex = 1; this.groupBoxTest.TabStop = false; - this.groupBoxTest.Text = "Test"; + this.groupBoxTest.Text = "Test launch"; // + // groupBoxWhen + // + this.groupBoxWhen.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBoxWhen.Controls.Add(this.radioButtonStart); + this.groupBoxWhen.Controls.Add(this.radioButtonEnd); + this.groupBoxWhen.Location = new System.Drawing.Point(8, 8); + this.groupBoxWhen.Name = "groupBoxWhen"; + this.groupBoxWhen.Size = new System.Drawing.Size(328, 48); + this.groupBoxWhen.TabIndex = 4; + this.groupBoxWhen.TabStop = false; + this.groupBoxWhen.Text = "When to launch"; + // // Configuration // this.AcceptButton = this.buttonOK; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.buttonCancel; - this.ClientSize = new System.Drawing.Size(344, 320); + this.ClientSize = new System.Drawing.Size(352, 289); + this.Controls.Add(this.groupBoxWhen); + this.Controls.Add(this.groupBoxWhat); this.Controls.Add(this.groupBoxTest); - this.Controls.Add(this.tabControl); this.Controls.Add(this.buttonCancel); this.Controls.Add(this.buttonOK); this.MaximizeBox = false; this.MinimizeBox = false; - this.MinimumSize = new System.Drawing.Size(360, 356); + this.MinimumSize = new System.Drawing.Size(360, 316); this.Name = "Configuration"; this.ShowIcon = false; this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "ComSkip Launcher"; - this.tabControl.ResumeLayout(false); - this.tabPageStart.ResumeLayout(false); - this.groupBoxStartProgram.ResumeLayout(false); - this.groupBoxStartProgram.PerformLayout(); - this.tabPageEnd.ResumeLayout(false); - this.groupBoxEndProgram.ResumeLayout(false); - this.groupBoxEndProgram.PerformLayout(); + this.groupBoxWhat.ResumeLayout(false); + this.groupBoxWhat.PerformLayout(); this.groupBoxTest.ResumeLayout(false); this.groupBoxTest.PerformLayout(); + this.groupBoxWhen.ResumeLayout(false); this.ResumeLayout(false); } @@ -431,28 +285,17 @@ private System.Windows.Forms.Button buttonTest; private System.Windows.Forms.TextBox textBoxTest; private System.Windows.Forms.Button buttonFindTestFile; - private System.Windows.Forms.RadioButton radioButtonStartDoNothing; - private System.Windows.Forms.RadioButton radioButtonStartLaunch; + private System.Windows.Forms.RadioButton radioButtonStart; + private System.Windows.Forms.RadioButton radioButtonEnd; private System.Windows.Forms.ToolTip toolTips; - private System.Windows.Forms.TabControl tabControl; - private System.Windows.Forms.TabPage tabPageStart; - private System.Windows.Forms.TabPage tabPageEnd; private System.Windows.Forms.GroupBox groupBoxTest; - private System.Windows.Forms.RadioButton radioButtonEndDoNothing; - private System.Windows.Forms.RadioButton radioButtonEndLaunch; - private System.Windows.Forms.Label labelEndParameters; - private System.Windows.Forms.TextBox textBoxEndParameters; - private System.Windows.Forms.Button buttonEndParameters; - private System.Windows.Forms.Label labelEndProgram; - private System.Windows.Forms.Button buttonEndProgram; - private System.Windows.Forms.TextBox textBoxEndProgram; - private System.Windows.Forms.GroupBox groupBoxEndProgram; - private System.Windows.Forms.GroupBox groupBoxStartProgram; - private System.Windows.Forms.Label labelStartParameters; - private System.Windows.Forms.TextBox textBoxStartParameters; - private System.Windows.Forms.Button buttonStartParameters; - private System.Windows.Forms.Label labelStartProgram; - private System.Windows.Forms.Button buttonStartProgram; - private System.Windows.Forms.TextBox textBoxStartProgram; + private System.Windows.Forms.GroupBox groupBoxWhat; + private System.Windows.Forms.Label labelParameters; + private System.Windows.Forms.TextBox textBoxParameters; + private System.Windows.Forms.Button buttonParameters; + private System.Windows.Forms.Label labelProgram; + private System.Windows.Forms.Button buttonProgram; + private System.Windows.Forms.TextBox textBoxProgram; + private System.Windows.Forms.GroupBox groupBoxWhen; } } \ No newline at end of file Modified: trunk/plugins/ComSkipLauncher TVE2/Configuration.cs =================================================================== --- trunk/plugins/ComSkipLauncher TVE2/Configuration.cs 2007-03-13 20:14:54 UTC (rev 185) +++ trunk/plugins/ComSkipLauncher TVE2/Configuration.cs 2007-03-14 13:30:54 UTC (rev 186) @@ -34,49 +34,25 @@ { get { - return radioButtonStartLaunch.Checked; + return radioButtonStart.Checked; } set { - radioButtonStartLaunch.Checked = value; - radioButtonStartDoNothing.Checked = !value; + radioButtonEnd.Checked = value; + radioButtonStart.Checked = !value; } } - public bool RunAtEnd + public string Program { - get - { - return radioButtonEndLaunch.Checked; - } - set - { - radioButtonEndLaunch.Checked = value; - radioButtonEndDoNothing.Checked = !value; - } + get { return textBoxProgram.Text; } + set { textBoxProgram.Text = value; } } - - public string StartProgram + public string Parameters { - get { return textBoxStartProgram.Text; } - set { textBoxStartProgram.Text = value; } + get { return textBoxParameters.Text; } + set { textBoxParameters.Text = value; } } - public string StartParameters - { - get { return textBoxStartParameters.Text; } - set { textBoxStartParameters.Text = value; } - } - public string EndProgram - { - get { return textBoxEndProgram.Text; } - set { textBoxEndProgram.Text = value; } - } - public string EndParameters - { - get { return textBoxEndParameters.Text; } - set { textBoxEndParameters.Text = value; } - } - #endregion Properties #region Constructors @@ -106,20 +82,9 @@ private void buttonTest_Click(object sender, EventArgs e) { - string program; - string param; + string program = textBoxProgram.Text.Trim(); + string param = textBoxParameters.Text; - if (tabControl.SelectedTab == tabPageStart) - { - program = textBoxStartProgram.Text.Trim(); - param = textBoxStartParameters.Text; - } - else - { - program = textBoxEndProgram.Text.Trim(); - param = textBoxEndParameters.Text; - } - if (program.Length == 0) { MessageBox.Show(this, "You must specify a program to run", "Missing program name", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); @@ -149,27 +114,12 @@ textBoxTest.Text = openFileDialog.FileName; } - private void radioButtonStartLaunch_CheckedChanged(object sender, EventArgs e) + private void buttonProgram_Click(object sender, EventArgs e) { - groupBoxStartProgram.Enabled = radioButtonStartLaunch.Checked; - } - private void radioButtonEndLaunch_CheckedChanged(object sender, EventArgs e) - { - groupBoxEndProgram.Enabled = radioButtonEndLaunch.Checked; - } - - private void buttonStartProgram_Click(object sender, EventArgs e) - { openFileDialog.Title = "Select Program To Execute"; if (openFileDialog.ShowDialog(this) == DialogResult.OK) - textBoxStartProgram.Text = openFileDialog.FileName; + textBoxProgram.Text = openFileDialog.FileName; } - private void buttonEndProgram_Click(object sender, EventArgs e) - { - openFileDialog.Title = "Select Program To Execute"; - if (openFileDialog.ShowDialog(this) == DialogResult.OK) - textBoxEndProgram.Text = openFileDialog.FileName; - } } Modified: trunk/plugins/ComSkipLauncher TVE3/AssemblyInfo.cs =================================================================== --- trunk/plugins/ComSkipLauncher TVE3/AssemblyInfo.cs 2007-03-13 20:14:54 UTC (rev 185) +++ trunk/plugins/ComSkipLauncher TVE3/AssemblyInfo.cs 2007-03-14 13:30:54 UTC (rev 186) @@ -9,7 +9,7 @@ // associated with an assembly. // [assembly: AssemblyTitle("ComSkipLauncher TVE3")] -[assembly: AssemblyDescription("Launches ComSkip when a recording completes")] +[assembly: AssemblyDescription("Launches ComSkip on recordings")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("For MediaPortal")] [assembly: AssemblyProduct("ComSkipLauncher plugin by and-81")] Modified: trunk/plugins/ComSkipLauncher TVE3/ComSkipLauncher.cs =================================================================== --- trunk/plugins/ComSkipLauncher TVE3/ComSkipLauncher.cs 2007-03-13 20:14:54 UTC (rev 185) +++ trunk/plugins/ComSkipLauncher TVE3/ComSkipLauncher.cs 2007-03-14 13:30:54 UTC (rev 186) @@ -1,4 +1,5 @@ using System; +using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; @@ -22,24 +23,17 @@ #region Constants - public static readonly string DefaultStartProgram = "\\Program Files\\ComSkip\\ComSkip.exe"; - public static readonly string DefaultStartParameters = "--playnice \"{0}\""; + public static readonly string DefaultProgram = "\\Program Files\\ComSkip\\ComSkip.exe"; + public static readonly string DefaultParameters = "\"{0}\""; - public static readonly string DefaultEndProgram = "\\Program Files\\ComSkip\\ComClean.bat"; - public static readonly string DefaultEndParameters = "\"{0}\""; - #endregion Constants #region Members bool _runAtStart; - string _startProgram; - string _startParameters; + string _program; + string _parameters; - bool _runAtEnd; - string _endProgram; - string _endParameters; - #endregion Members #region Properties @@ -85,16 +79,14 @@ LoadSettings(); - if (_runAtStart || _runAtEnd) - GlobalServiceProvider.Instance.Get<ITvServerEvent>().OnTvServerEvent += new TvServerEventHandler(ComSkipLauncher_OnTvServerEvent); + GlobalServiceProvider.Instance.Get<ITvServerEvent>().OnTvServerEvent += new TvServerEventHandler(ComSkipLauncher_OnTvServerEvent); } public void Stop() { Log.Info("ComSkipLauncher: Stop"); - if (_runAtStart || _runAtEnd) - GlobalServiceProvider.Instance.Get<ITvServerEvent>().OnTvServerEvent -= new TvServerEventHandler(ComSkipLauncher_OnTvServerEvent); + GlobalServiceProvider.Instance.Get<ITvServerEvent>().OnTvServerEvent -= new TvServerEventHandler(ComSkipLauncher_OnTvServerEvent); } [CLSCompliant(false)] @@ -114,38 +106,27 @@ TvServerEventArgs tvEvent = (TvServerEventArgs)eventArgs; string parameters; - if (tvEvent.EventType == TvServerEventType.RecordingStarted) + if (tvEvent.EventType == TvServerEventType.RecordingStarted && _runAtStart) { - parameters = ProcessParameters(_startParameters, tvEvent.Recording.FileName); + parameters = ProcessParameters(_parameters, tvEvent.Recording.FileName); - Log.Info( - "ComSkipLauncher: Recording started ({0}), launching program ({1} {2}) ...", - tvEvent.Recording.FileName, - _startProgram, - parameters - ); + Log.Info("ComSkipLauncher: Recording started ({0}), launching program ({1} {2}) ...", tvEvent.Recording.FileName, _program, parameters); - LaunchProcess(_startProgram, parameters, Path.GetDirectoryName(tvEvent.Recording.FileName), ProcessWindowStyle.Hidden); + LaunchProcess(_program, parameters, Path.GetDirectoryName(tvEvent.Recording.FileName), ProcessWindowStyle.Hidden); } - else if (tvEvent.EventType == TvServerEventType.RecordingEnded) + else if (tvEvent.EventType == TvServerEventType.RecordingEnded && !_runAtStart) { - parameters = ProcessParameters(_endParameters, tvEvent.Recording.FileName); + parameters = ProcessParameters(_parameters, tvEvent.Recording.FileName); - Log.Info( - "ComSkipLauncher: Recording ended ({0}), launching program ({1} {2}) ...", - tvEvent.Recording.FileName, - _endProgram, - parameters - ); + Log.Info("ComSkipLauncher: Recording ended ({0}), launching program ({1} {2}) ...", tvEvent.Recording.FileName, _program, parameters); - LaunchProcess(_endProgram, parameters, Path.GetDirectoryName(tvEvent.Recording.FileName), ProcessWindowStyle.Hidden); + LaunchProcess(_program, parameters, Path.GetDirectoryName(tvEvent.Recording.FileName), ProcessWindowStyle.Hidden); } } catch (Exception ex) { - Log.Error("ComSkipLauncher: {0}", ex.Message); + Log.Error("ComSkipLauncher - ComSkipLauncher_OnTvServerEvent(): {0}", ex.Message); } - } void LoadSettings() @@ -154,30 +135,33 @@ { TvBusinessLayer layer = new TvBusinessLayer(); - _runAtStart = Convert.ToBoolean(layer.GetSetting("ComSkipLauncher_RunAtStart", "False").Value); - _startProgram = layer.GetSetting("ComSkipLauncher_StartProgram", DefaultStartProgram).Value; - _startParameters = layer.GetSetting("ComSkipLauncher_StartParameters", DefaultStartParameters).Value; - - _runAtEnd = Convert.ToBoolean(layer.GetSetting("ComSkipLauncher_RunAtEnd", "False").Value); - _endProgram = layer.GetSetting("ComSkipLauncher_EndProgram", DefaultEndProgram).Value; - _endParameters = layer.GetSetting("ComSkipLauncher_EndParameters", DefaultEndParameters).Value; + _runAtStart = Convert.ToBoolean(layer.GetSetting("ComSkipLauncher_RunAtStart", "False").Value); + _program = layer.GetSetting("ComSkipLauncher_Program", DefaultProgram).Value; + _parameters = layer.GetSetting("ComSkipLauncher_Parameters", DefaultParameters).Value; } catch (Exception ex) { - Log.Error("ComSkipLauncher: {0}", ex.Message); + Log.Error("ComSkipLauncher - LoadSettings(): {0}", ex.Message); } } void LaunchProcess(string program, string parameters, string workingFolder, ProcessWindowStyle windowStyle) { - Process process = new Process(); - process.StartInfo = new ProcessStartInfo(); - process.StartInfo.Arguments = parameters; - process.StartInfo.FileName = program; - process.StartInfo.WindowStyle = windowStyle; - process.StartInfo.WorkingDirectory = workingFolder; + try + { + Process process = new Process(); + process.StartInfo = new ProcessStartInfo(); + process.StartInfo.Arguments = parameters; + process.StartInfo.FileName = program; + process.StartInfo.WindowStyle = windowStyle; + process.StartInfo.WorkingDirectory = workingFolder; - process.Start(); + process.Start(); + } + catch (Exception ex) + { + Log.Error("ComSkipLauncher - LaunchProcess(): {0}", ex.Message); + } } internal static string ProcessParameters(string input, string fileName) @@ -198,7 +182,7 @@ } catch (Exception ex) { - Log.Error("ComSkipLauncher: {0}", ex.Message); + Log.Error("ComSkipLauncher - ProcessParameters(): {0}", ex.Message); } return output; Modified: trunk/plugins/ComSkipLauncher TVE3/PluginSetup.Designer.cs =================================================================== --- trunk/plugins/ComSkipLauncher TVE3/PluginSetup.Designer.cs 2007-03-13 20:14:54 UTC (rev 185) +++ trunk/plugins/ComSkipLauncher TVE3/PluginSetup.Designer.cs 2007-03-14 13:30:54 UTC (rev 186) @@ -33,34 +33,20 @@ this.textBoxTest = new System.Windows.Forms.TextBox(); this.buttonTest = new System.Windows.Forms.Button(); this.buttonFindTestFile = new System.Windows.Forms.Button(); - this.tabControl = new System.Windows.Forms.TabControl(); - this.tabPageStart = new System.Windows.Forms.TabPage(); - this.groupBoxStartProgram = new System.Windows.Forms.GroupBox(); - this.labelStartParameters = new System.Windows.Forms.Label(); - this.textBoxStartParameters = new System.Windows.Forms.TextBox(); - this.buttonStartParameters = new System.Windows.Forms.Button(); - this.labelStartProgram = new System.Windows.Forms.Label(); - this.buttonStartProgram = new System.Windows.Forms.Button(); - this.textBoxStartProgram = new System.Windows.Forms.TextBox(); - this.radioButtonStartDoNothing = new System.Windows.Forms.RadioButton(); - this.radioButtonStartLaunch = new System.Windows.Forms.RadioButton(); - this.tabPageEnd = new System.Windows.Forms.TabPage(); - this.groupBoxEndProgram = new System.Windows.Forms.GroupBox(); - this.labelEndParameters = new System.Windows.Forms.Label(); - this.textBoxEndParameters = new System.Windows.Forms.TextBox(); - this.buttonEndParameters = new System.Windows.Forms.Button(); - this.labelEndProgram = new System.Windows.Forms.Label(); - this.buttonEndProgram = new System.Windows.Forms.Button(); - this.textBoxEndProgram = new System.Windows.Forms.TextBox(); - this.radioButtonEndDoNothing = new System.Windows.Forms.RadioButton(); - this.radioButtonEndLaunch = new System.Windows.Forms.RadioButton(); this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); + this.groupBoxWhen = new System.Windows.Forms.GroupBox(); + this.radioButtonStart = new System.Windows.Forms.RadioButton(); + this.radioButtonEnd = new System.Windows.Forms.RadioButton(); + this.groupBoxWhat = new System.Windows.Forms.GroupBox(); + this.labelParameters = new System.Windows.Forms.Label(); + this.textBoxParameters = new System.Windows.Forms.TextBox(); + this.buttonParameters = new System.Windows.Forms.Button(); + this.labelProgram = new System.Windows.Forms.Label(); + this.buttonProgram = new System.Windows.Forms.Button(); + this.textBoxProgram = new System.Windows.Forms.TextBox(); this.groupBoxTest.SuspendLayout(); - this.tabControl.SuspendLayout(); - this.tabPageStart.SuspendLayout(); - this.groupBoxStartProgram.SuspendLayout(); - this.tabPageEnd.SuspendLayout(); - this.groupBoxEndProgram.SuspendLayout(); + this.groupBoxWhen.SuspendLayout(); + this.groupBoxWhat.SuspendLayout(); this.SuspendLayout(); // // groupBoxTest @@ -68,7 +54,7 @@ this.groupBoxTest.Controls.Add(this.textBoxTest); this.groupBoxTest.Controls.Add(this.buttonTest); this.groupBoxTest.Controls.Add(this.buttonFindTestFile); - this.groupBoxTest.Location = new System.Drawing.Point(8, 224); + this.groupBoxTest.Location = new System.Drawing.Point(8, 184); this.groupBoxTest.Name = "groupBoxTest"; this.groupBoxTest.Size = new System.Drawing.Size(328, 56); this.groupBoxTest.TabIndex = 1; @@ -106,264 +92,131 @@ this.buttonFindTestFile.UseVisualStyleBackColor = true; this.buttonFindTestFile.Click += new System.EventHandler(this.buttonFindTestFile_Click); // - // tabControl + // openFileDialog // - this.tabControl.Controls.Add(this.tabPageStart); - this.tabControl.Controls.Add(this.tabPageEnd); - this.tabControl.Location = new System.Drawing.Point(8, 8); - this.tabControl.Name = "tabControl"; - this.tabControl.SelectedIndex = 0; - this.tabControl.Size = new System.Drawing.Size(328, 208); - this.tabControl.TabIndex = 0; + this.openFileDialog.Filter = "All files|*.*"; // - // tabPageStart + // groupBoxWhen // - this.tabPageStart.Controls.Add(this.groupBoxStartProgram); - this.tabPageStart.Controls.Add(this.radioButtonStartDoNothing); - this.tabPageStart.Controls.Add(this.radioButtonStartLaunch); - this.tabPageStart.Location = new System.Drawing.Point(4, 22); - this.tabPageStart.Name = "tabPageStart"; - this.tabPageStart.Padding = new System.Windows.Forms.Padding(3); - this.tabPageStart.Size = new System.Drawing.Size(320, 182); - this.tabPageStart.TabIndex = 0; - this.tabPageStart.Text = "When recording starts ..."; - this.tabPageStart.UseVisualStyleBackColor = true; + this.groupBoxWhen.Controls.Add(this.radioButtonStart); + this.groupBoxWhen.Controls.Add(this.radioButtonEnd); + this.groupBoxWhen.Location = new System.Drawing.Point(8, 8); + this.groupBoxWhen.Name = "groupBoxWhen"; + this.groupBoxWhen.Size = new System.Drawing.Size(328, 48); + this.groupBoxWhen.TabIndex = 6; + this.groupBoxWhen.TabStop = false; + this.groupBoxWhen.Text = "When to launch"; // - // groupBoxStartProgram + // radioButtonStart // - this.groupBoxStartProgram.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.groupBoxStartProgram.Controls.Add(this.labelStartParameters); - this.groupBoxStartProgram.Controls.Add(this.textBoxStartParameters); - this.groupBoxStartProgram.Controls.Add(this.buttonStartParameters); - this.groupBoxStartProgram.Controls.Add(this.labelStartProgram); - this.groupBoxStartProgram.Controls.Add(this.buttonStartProgram); - this.groupBoxStartProgram.Controls.Add(this.textBoxStartProgram); - this.groupBoxStartProgram.Location = new System.Drawing.Point(8, 64); - this.groupBoxStartProgram.Name = "groupBoxStartProgram"; - this.groupBoxStartProgram.Size = new System.Drawing.Size(304, 112); - this.groupBoxStartProgram.TabIndex = 2; - this.groupBoxStartProgram.TabStop = false; - this.groupBoxStartProgram.Text = "What to do"; + this.radioButtonStart.Location = new System.Drawing.Point(8, 16); + this.radioButtonStart.Name = "radioButtonStart"; + this.radioButtonStart.Size = new System.Drawing.Size(120, 24); + this.radioButtonStart.TabIndex = 0; + this.radioButtonStart.Text = "Recording Start"; + this.radioButtonStart.UseVisualStyleBackColor = true; // - // labelStartParameters + // radioButtonEnd // - this.labelStartParameters.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.labelStartParameters.Location = new System.Drawing.Point(8, 64); - this.labelStartParameters.Name = "labelStartParameters"; - this.labelStartParameters.Size = new System.Drawing.Size(256, 16); - this.labelStartParameters.TabIndex = 3; - this.labelStartParameters.Text = "Parameters:"; - this.labelStartParameters.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.radioButtonEnd.Checked = true; + this.radioButtonEnd.Location = new System.Drawing.Point(144, 16); + this.radioButtonEnd.Name = "radioButtonEnd"; + this.radioButtonEnd.Size = new System.Drawing.Size(120, 24); + this.radioButtonEnd.TabIndex = 1; + this.radioButtonEnd.TabStop = true; + this.radioButtonEnd.Text = "Recording End"; + this.radioButtonEnd.UseVisualStyleBackColor = true; // - // textBoxStartParameters + // groupBoxWhat // - this.textBoxStartParameters.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.textBoxStartParameters.Location = new System.Drawing.Point(8, 80); - this.textBoxStartParameters.Name = "textBoxStartParameters"; - this.textBoxStartParameters.Size = new System.Drawing.Size(256, 20); - this.textBoxStartParameters.TabIndex = 4; + this.groupBoxWhat.Controls.Add(this.labelParameters); + this.groupBoxWhat.Controls.Add(this.textBoxParameters); + this.groupBoxWhat.Controls.Add(this.buttonParameters); + this.groupBoxWhat.Controls.Add(this.labelProgram); + this.groupBoxWhat.Controls.Add(this.buttonProgram); + this.groupBoxWhat.Controls.Add(this.textBoxProgram); + this.groupBoxWhat.Location = new System.Drawing.Point(8, 64); + this.groupBoxWhat.Name = "groupBoxWhat"; + this.groupBoxWhat.Size = new System.Drawing.Size(328, 112); + this.groupBoxWhat.TabIndex = 5; + this.groupBoxWhat.TabStop = false; + this.groupBoxWhat.Text = "What to launch"; // - // buttonStartParameters + // labelParameters // - this.buttonStartParameters.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.buttonStartParameters.Location = new System.Drawing.Point(272, 80); - this.buttonStartParameters.Name = "buttonStartParameters"; - this.buttonStartParameters.Size = new System.Drawing.Size(24, 20); - this.buttonStartParameters.TabIndex = 5; - this.buttonStartParameters.Text = "?"; - this.buttonStartParameters.UseVisualStyleBackColor = true; - this.buttonStartParameters.Click += new System.EventHandler(this.buttonParamQuestion_Click); - // - // labelStartProgram - // - this.labelStartProgram.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms... [truncated message content] |
From: <an...@us...> - 2007-03-14 13:51:49
|
Revision: 187 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=187&view=rev Author: and-81 Date: 2007-03-14 06:51:47 -0700 (Wed, 14 Mar 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ComSkipLauncher TVE2/Configuration.Designer.cs trunk/plugins/ComSkipLauncher TVE3/PluginSetup.Designer.cs Modified: trunk/plugins/ComSkipLauncher TVE2/Configuration.Designer.cs =================================================================== --- trunk/plugins/ComSkipLauncher TVE2/Configuration.Designer.cs 2007-03-14 13:30:54 UTC (rev 186) +++ trunk/plugins/ComSkipLauncher TVE2/Configuration.Designer.cs 2007-03-14 13:51:47 UTC (rev 187) @@ -47,6 +47,8 @@ this.labelProgram = new System.Windows.Forms.Label(); this.groupBoxTest = new System.Windows.Forms.GroupBox(); this.groupBoxWhen = new System.Windows.Forms.GroupBox(); + this.labelComSkip = new System.Windows.Forms.Label(); + this.linkLabel = new System.Windows.Forms.LinkLabel(); this.groupBoxWhat.SuspendLayout(); this.groupBoxTest.SuspendLayout(); this.groupBoxWhen.SuspendLayout(); @@ -55,10 +57,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(216, 248); + this.buttonOK.Location = new System.Drawing.Point(216, 304); this.buttonOK.Name = "buttonOK"; this.buttonOK.Size = new System.Drawing.Size(56, 24); - this.buttonOK.TabIndex = 2; + this.buttonOK.TabIndex = 5; this.buttonOK.Text = "OK"; this.buttonOK.UseVisualStyleBackColor = true; this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); @@ -67,10 +69,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(280, 248); + this.buttonCancel.Location = new System.Drawing.Point(280, 304); this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Size = new System.Drawing.Size(56, 24); - this.buttonCancel.TabIndex = 3; + this.buttonCancel.TabIndex = 6; this.buttonCancel.Text = "Cancel"; this.buttonCancel.UseVisualStyleBackColor = true; this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); @@ -195,7 +197,7 @@ this.groupBoxWhat.Location = new System.Drawing.Point(8, 64); this.groupBoxWhat.Name = "groupBoxWhat"; this.groupBoxWhat.Size = new System.Drawing.Size(328, 112); - this.groupBoxWhat.TabIndex = 2; + this.groupBoxWhat.TabIndex = 1; this.groupBoxWhat.TabStop = false; this.groupBoxWhat.Text = "What to launch"; // @@ -231,7 +233,7 @@ this.groupBoxTest.Location = new System.Drawing.Point(8, 184); this.groupBoxTest.Name = "groupBoxTest"; this.groupBoxTest.Size = new System.Drawing.Size(328, 56); - this.groupBoxTest.TabIndex = 1; + this.groupBoxTest.TabIndex = 2; this.groupBoxTest.TabStop = false; this.groupBoxTest.Text = "Test launch"; // @@ -244,17 +246,42 @@ this.groupBoxWhen.Location = new System.Drawing.Point(8, 8); this.groupBoxWhen.Name = "groupBoxWhen"; this.groupBoxWhen.Size = new System.Drawing.Size(328, 48); - this.groupBoxWhen.TabIndex = 4; + this.groupBoxWhen.TabIndex = 0; this.groupBoxWhen.TabStop = false; this.groupBoxWhen.Text = "When to launch"; // + // labelComSkip + // + this.labelComSkip.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.labelComSkip.Location = new System.Drawing.Point(8, 248); + this.labelComSkip.Name = "labelComSkip"; + this.labelComSkip.Size = new System.Drawing.Size(328, 16); + this.labelComSkip.TabIndex = 3; + this.labelComSkip.Text = "Get ComSkip here:"; + this.labelComSkip.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // linkLabel + // + this.linkLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.linkLabel.Location = new System.Drawing.Point(8, 272); + this.linkLabel.Name = "linkLabel"; + this.linkLabel.Size = new System.Drawing.Size(328, 16); + this.linkLabel.TabIndex = 4; + this.linkLabel.TabStop = true; + this.linkLabel.Text = "http://www.kaashoek.com/comskip/"; + this.linkLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // // Configuration // this.AcceptButton = this.buttonOK; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.buttonCancel; - this.ClientSize = new System.Drawing.Size(352, 289); + this.ClientSize = new System.Drawing.Size(352, 345); + this.Controls.Add(this.labelComSkip); + this.Controls.Add(this.linkLabel); this.Controls.Add(this.groupBoxWhen); this.Controls.Add(this.groupBoxWhat); this.Controls.Add(this.groupBoxTest); @@ -262,7 +289,7 @@ this.Controls.Add(this.buttonOK); this.MaximizeBox = false; this.MinimizeBox = false; - this.MinimumSize = new System.Drawing.Size(360, 316); + this.MinimumSize = new System.Drawing.Size(360, 372); this.Name = "Configuration"; this.ShowIcon = false; this.ShowInTaskbar = false; @@ -297,5 +324,7 @@ private System.Windows.Forms.Button buttonProgram; private System.Windows.Forms.TextBox textBoxProgram; private System.Windows.Forms.GroupBox groupBoxWhen; + private System.Windows.Forms.Label labelComSkip; + private System.Windows.Forms.LinkLabel linkLabel; } } \ No newline at end of file Modified: trunk/plugins/ComSkipLauncher TVE3/PluginSetup.Designer.cs =================================================================== --- trunk/plugins/ComSkipLauncher TVE3/PluginSetup.Designer.cs 2007-03-14 13:30:54 UTC (rev 186) +++ trunk/plugins/ComSkipLauncher TVE3/PluginSetup.Designer.cs 2007-03-14 13:51:47 UTC (rev 187) @@ -44,6 +44,8 @@ this.labelProgram = new System.Windows.Forms.Label(); this.buttonProgram = new System.Windows.Forms.Button(); this.textBoxProgram = new System.Windows.Forms.TextBox(); + this.linkLabel = new System.Windows.Forms.LinkLabel(); + this.labelComSkip = new System.Windows.Forms.Label(); this.groupBoxTest.SuspendLayout(); this.groupBoxWhen.SuspendLayout(); this.groupBoxWhat.SuspendLayout(); @@ -57,7 +59,7 @@ this.groupBoxTest.Location = new System.Drawing.Point(8, 184); this.groupBoxTest.Name = "groupBoxTest"; this.groupBoxTest.Size = new System.Drawing.Size(328, 56); - this.groupBoxTest.TabIndex = 1; + this.groupBoxTest.TabIndex = 2; this.groupBoxTest.TabStop = false; this.groupBoxTest.Text = "Test"; // @@ -103,7 +105,7 @@ this.groupBoxWhen.Location = new System.Drawing.Point(8, 8); this.groupBoxWhen.Name = "groupBoxWhen"; this.groupBoxWhen.Size = new System.Drawing.Size(328, 48); - this.groupBoxWhen.TabIndex = 6; + this.groupBoxWhen.TabIndex = 0; this.groupBoxWhen.TabStop = false; this.groupBoxWhen.Text = "When to launch"; // @@ -138,7 +140,7 @@ this.groupBoxWhat.Location = new System.Drawing.Point(8, 64); this.groupBoxWhat.Name = "groupBoxWhat"; this.groupBoxWhat.Size = new System.Drawing.Size(328, 112); - this.groupBoxWhat.TabIndex = 5; + this.groupBoxWhat.TabIndex = 1; this.groupBoxWhat.TabStop = false; this.groupBoxWhat.Text = "What to launch"; // @@ -204,14 +206,35 @@ this.textBoxProgram.Size = new System.Drawing.Size(280, 20); this.textBoxProgram.TabIndex = 1; // + // linkLabel + // + this.linkLabel.Location = new System.Drawing.Point(8, 272); + this.linkLabel.Name = "linkLabel"; + this.linkLabel.Size = new System.Drawing.Size(328, 16); + this.linkLabel.TabIndex = 4; + this.linkLabel.TabStop = true; + this.linkLabel.Text = "http://www.kaashoek.com/comskip/"; + this.linkLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // labelComSkip + // + this.labelComSkip.Location = new System.Drawing.Point(8, 248); + this.labelComSkip.Name = "labelComSkip"; + this.labelComSkip.Size = new System.Drawing.Size(328, 16); + this.labelComSkip.TabIndex = 3; + this.labelComSkip.Text = "Get ComSkip here:"; + this.labelComSkip.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // // PluginSetup // + this.Controls.Add(this.labelComSkip); + this.Controls.Add(this.linkLabel); this.Controls.Add(this.groupBoxWhen); this.Controls.Add(this.groupBoxWhat); this.Controls.Add(this.groupBoxTest); - this.MinimumSize = new System.Drawing.Size(346, 250); + this.MinimumSize = new System.Drawing.Size(346, 298); this.Name = "PluginSetup"; - this.Size = new System.Drawing.Size(346, 250); + this.Size = new System.Drawing.Size(346, 298); this.groupBoxTest.ResumeLayout(false); this.groupBoxTest.PerformLayout(); this.groupBoxWhen.ResumeLayout(false); @@ -238,6 +261,8 @@ private System.Windows.Forms.Label labelProgram; private System.Windows.Forms.Button buttonProgram; private System.Windows.Forms.TextBox textBoxProgram; + private System.Windows.Forms.LinkLabel linkLabel; + private System.Windows.Forms.Label labelComSkip; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-03-18 12:13:41
|
Revision: 194 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=194&view=rev Author: and-81 Date: 2007-03-17 05:10:29 -0700 (Sat, 17 Mar 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ComSkipLauncher TVE2/ComSkipLauncher.cs trunk/plugins/ComSkipLauncher TVE2/Configuration.cs trunk/plugins/ComSkipLauncher TVE3/ComSkipLauncher.cs trunk/plugins/ComSkipLauncher TVE3/PluginSetup.Designer.cs trunk/plugins/ComSkipLauncher TVE3/PluginSetup.cs Modified: trunk/plugins/ComSkipLauncher TVE2/ComSkipLauncher.cs =================================================================== --- trunk/plugins/ComSkipLauncher TVE2/ComSkipLauncher.cs 2007-03-17 06:59:36 UTC (rev 193) +++ trunk/plugins/ComSkipLauncher TVE2/ComSkipLauncher.cs 2007-03-17 12:10:29 UTC (rev 194) @@ -126,34 +126,16 @@ try { - string fileName = String.Empty; - List<TVRecorded> recorded = new List<TVRecorded>(); - TVDatabase.GetRecordedTV(ref recorded); - foreach (TVRecorded rec in recorded) - { - if (rec.Title == recording.Title && rec.StartTime == recording.StartTime) - { - fileName = rec.FileName; - break; - } - } + string parameters = ProcessParameters(_parameters, recordingFilename); - if (String.IsNullOrEmpty(fileName)) - { - Log.Warn("ComSkipLauncher: Couldn't process recording titled {0}, no filename found.", recording.Title); - return; - } - - string parameters = ProcessParameters(_parameters, fileName); - Log.Info( "ComSkipLauncher: Recording ended ({0}), launching program ({1} {2}) ...", - fileName, + recordingFilename, _program, parameters ); - LaunchProcess(_program, parameters, Path.GetDirectoryName(fileName), ProcessWindowStyle.Hidden); + LaunchProcess(_program, parameters, Path.GetDirectoryName(recordingFilename), ProcessWindowStyle.Hidden); } catch (Exception ex) { @@ -194,18 +176,6 @@ } } - void LaunchProcess(string program, string parameters, string workingFolder, ProcessWindowStyle windowStyle) - { - Process process = new Process(); - process.StartInfo = new ProcessStartInfo(); - process.StartInfo.Arguments = parameters; - process.StartInfo.FileName = program; - process.StartInfo.WindowStyle = windowStyle; - process.StartInfo.WorkingDirectory = workingFolder; - - process.Start(); - } - internal static string ProcessParameters(string input, string fileName) { string output = String.Empty; @@ -229,7 +199,18 @@ return output; } + internal static void LaunchProcess(string program, string parameters, string workingFolder, ProcessWindowStyle windowStyle) + { + Process process = new Process(); + process.StartInfo = new ProcessStartInfo(); + process.StartInfo.Arguments = parameters; + process.StartInfo.FileName = program; + process.StartInfo.WindowStyle = windowStyle; + process.StartInfo.WorkingDirectory = workingFolder; + process.Start(); + } + #endregion Implementation } Modified: trunk/plugins/ComSkipLauncher TVE2/Configuration.cs =================================================================== --- trunk/plugins/ComSkipLauncher TVE2/Configuration.cs 2007-03-17 06:59:36 UTC (rev 193) +++ trunk/plugins/ComSkipLauncher TVE2/Configuration.cs 2007-03-17 12:10:29 UTC (rev 194) @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Diagnostics; @@ -79,7 +78,6 @@ { MessageBox.Show(this, ParametersMessage, "Parameters", MessageBoxButtons.OK, MessageBoxIcon.Information); } - private void buttonTest_Click(object sender, EventArgs e) { string program = textBoxProgram.Text.Trim(); @@ -95,12 +93,7 @@ { string parameters = ComSkipLauncher.ProcessParameters(param, textBoxTest.Text); - Process process = new Process(); - process.StartInfo.Arguments = parameters; - process.StartInfo.FileName = program; - process.StartInfo.WorkingDirectory = Path.GetDirectoryName(program); - - process.Start(); + ComSkipLauncher.LaunchProcess(program, parameters, Path.GetDirectoryName(program), ProcessWindowStyle.Normal); } catch (Exception ex) { @@ -113,7 +106,6 @@ if (openFileDialog.ShowDialog(this) == DialogResult.OK) textBoxTest.Text = openFileDialog.FileName; } - private void buttonProgram_Click(object sender, EventArgs e) { openFileDialog.Title = "Select Program To Execute"; Modified: trunk/plugins/ComSkipLauncher TVE3/ComSkipLauncher.cs =================================================================== --- trunk/plugins/ComSkipLauncher TVE3/ComSkipLauncher.cs 2007-03-17 06:59:36 UTC (rev 193) +++ trunk/plugins/ComSkipLauncher TVE3/ComSkipLauncher.cs 2007-03-17 12:10:29 UTC (rev 194) @@ -145,25 +145,6 @@ } } - void LaunchProcess(string program, string parameters, string workingFolder, ProcessWindowStyle windowStyle) - { - try - { - Process process = new Process(); - process.StartInfo = new ProcessStartInfo(); - process.StartInfo.Arguments = parameters; - process.StartInfo.FileName = program; - process.StartInfo.WindowStyle = windowStyle; - process.StartInfo.WorkingDirectory = workingFolder; - - process.Start(); - } - catch (Exception ex) - { - Log.Error("ComSkipLauncher - LaunchProcess(): {0}", ex.Message); - } - } - internal static string ProcessParameters(string input, string fileName) { string output = String.Empty; @@ -188,6 +169,25 @@ return output; } + internal static void LaunchProcess(string program, string parameters, string workingFolder, ProcessWindowStyle windowStyle) + { + try + { + Process process = new Process(); + process.StartInfo = new ProcessStartInfo(); + process.StartInfo.Arguments = parameters; + process.StartInfo.FileName = program; + process.StartInfo.WindowStyle = windowStyle; + process.StartInfo.WorkingDirectory = workingFolder; + + process.Start(); + } + catch (Exception ex) + { + Log.Error("ComSkipLauncher - LaunchProcess(): {0}", ex.Message); + } + } + #endregion Implementation } Modified: trunk/plugins/ComSkipLauncher TVE3/PluginSetup.Designer.cs =================================================================== --- trunk/plugins/ComSkipLauncher TVE3/PluginSetup.Designer.cs 2007-03-17 06:59:36 UTC (rev 193) +++ trunk/plugins/ComSkipLauncher TVE3/PluginSetup.Designer.cs 2007-03-17 12:10:29 UTC (rev 194) @@ -111,21 +111,21 @@ // // radioButtonStart // + this.radioButtonStart.Checked = true; this.radioButtonStart.Location = new System.Drawing.Point(8, 16); this.radioButtonStart.Name = "radioButtonStart"; this.radioButtonStart.Size = new System.Drawing.Size(120, 24); this.radioButtonStart.TabIndex = 0; + this.radioButtonStart.TabStop = true; this.radioButtonStart.Text = "Recording Start"; this.radioButtonStart.UseVisualStyleBackColor = true; // // radioButtonEnd // - this.radioButtonEnd.Checked = true; this.radioButtonEnd.Location = new System.Drawing.Point(144, 16); this.radioButtonEnd.Name = "radioButtonEnd"; this.radioButtonEnd.Size = new System.Drawing.Size(120, 24); this.radioButtonEnd.TabIndex = 1; - this.radioButtonEnd.TabStop = true; this.radioButtonEnd.Text = "Recording End"; this.radioButtonEnd.UseVisualStyleBackColor = true; // Modified: trunk/plugins/ComSkipLauncher TVE3/PluginSetup.cs =================================================================== --- trunk/plugins/ComSkipLauncher TVE3/PluginSetup.cs 2007-03-17 06:59:36 UTC (rev 193) +++ trunk/plugins/ComSkipLauncher TVE3/PluginSetup.cs 2007-03-17 12:10:29 UTC (rev 194) @@ -1,14 +1,11 @@ using System; -using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Diagnostics; using System.Drawing; using System.IO; using System.Text; -using System.Threading; using System.Windows.Forms; -using System.Xml; using TvLibrary.Log; using TvEngine; @@ -112,15 +109,11 @@ { MessageBox.Show(this, ParametersMessage, "Parameters", MessageBoxButtons.OK, MessageBoxIcon.Information); } - private void buttonTest_Click(object sender, EventArgs e) { - string program; - string param; + string program = textBoxProgram.Text.Trim(); + string param = textBoxParameters.Text; - program = textBoxProgram.Text.Trim(); - param = textBoxParameters.Text; - if (program.Length == 0) { MessageBox.Show(this, "You must specify a program to run", "Missing program name", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); @@ -131,12 +124,7 @@ { string parameters = ComSkipLauncher.ProcessParameters(param, textBoxTest.Text); - Process process = new Process(); - process.StartInfo.Arguments = parameters; - process.StartInfo.FileName = program; - process.StartInfo.WorkingDirectory = Path.GetDirectoryName(program); - - process.Start(); + ComSkipLauncher.LaunchProcess(program, parameters, Path.GetDirectoryName(program), ProcessWindowStyle.Normal); } catch (Exception ex) { @@ -149,7 +137,6 @@ if (openFileDialog.ShowDialog(this) == DialogResult.OK) textBoxTest.Text = openFileDialog.FileName; } - private void buttonProgram_Click(object sender, EventArgs e) { openFileDialog.Title = "Select Program To Execute"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mab...@us...> - 2007-03-21 17:59:41
|
Revision: 206 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=206&view=rev Author: mablebee Date: 2007-03-21 10:53:54 -0700 (Wed, 21 Mar 2007) Log Message: ----------- Added Paths: ----------- trunk/plugins/autostart/ trunk/plugins/autostart/AutoStart.cs trunk/plugins/autostart/AutoStart.csproj trunk/plugins/autostart/AutoStartConfig.Designer.cs trunk/plugins/autostart/AutoStartConfig.cs trunk/plugins/autostart/AutoStartConfig.resx trunk/plugins/autostart/Properties/ trunk/plugins/autostart/Properties/AssemblyInfo.cs trunk/plugins/autostart/Properties/Resources.Designer.cs trunk/plugins/autostart/Properties/Resources.resx trunk/plugins/autostart/Resources/ trunk/plugins/autostart/Resources/mplogo.gif trunk/plugins/autostart/bin/ trunk/plugins/autostart/bin/Debug/ trunk/plugins/autostart/bin/Debug/AutoStart.dll trunk/plugins/autostart/bin/Debug/AutoStart.pdb trunk/plugins/autostart/bin/Debug/AxInterop.WMPLib.dll trunk/plugins/autostart/bin/Debug/Bass.Net.dll trunk/plugins/autostart/bin/Debug/BassRegistration.dll trunk/plugins/autostart/bin/Debug/Core.DLL trunk/plugins/autostart/bin/Debug/DirectShowLib.dll trunk/plugins/autostart/bin/Debug/ICSharpCode.SharpZipLib.dll trunk/plugins/autostart/bin/Debug/Interop.WMPLib.dll trunk/plugins/autostart/bin/Debug/MediaPortal.Support.dll trunk/plugins/autostart/bin/Debug/MediaPortal.Support.pdb trunk/plugins/autostart/bin/Debug/Microsoft.DirectX.Direct3D.dll trunk/plugins/autostart/bin/Debug/Microsoft.DirectX.Direct3DX.dll trunk/plugins/autostart/bin/Debug/Microsoft.DirectX.dll trunk/plugins/autostart/bin/Debug/Utils.DLL trunk/plugins/autostart/bin/Debug/edtftpnet-1.2.2.dll trunk/plugins/autostart/bin/Release/ trunk/plugins/autostart/bin/Release/AutoStart.dll trunk/plugins/autostart/bin/Release/AutoStart.pdb trunk/plugins/autostart/bin/Release/AxInterop.WMPLib.dll trunk/plugins/autostart/bin/Release/Bass.Net.dll trunk/plugins/autostart/bin/Release/BassRegistration.dll trunk/plugins/autostart/bin/Release/Core.DLL trunk/plugins/autostart/bin/Release/DirectShowLib.dll trunk/plugins/autostart/bin/Release/ICSharpCode.SharpZipLib.dll trunk/plugins/autostart/bin/Release/Interop.WMPLib.dll trunk/plugins/autostart/bin/Release/MediaPortal.Support.dll trunk/plugins/autostart/bin/Release/MediaPortal.Support.pdb trunk/plugins/autostart/bin/Release/Microsoft.DirectX.Direct3D.dll trunk/plugins/autostart/bin/Release/Microsoft.DirectX.Direct3DX.dll trunk/plugins/autostart/bin/Release/Microsoft.DirectX.dll trunk/plugins/autostart/bin/Release/Utils.dll trunk/plugins/autostart/bin/Release/edtftpnet-1.2.2.dll trunk/plugins/autostart/obj/ trunk/plugins/autostart/obj/AutoStart.csproj.FileList.txt trunk/plugins/autostart/obj/Debug/ trunk/plugins/autostart/obj/Debug/AutoStart.csproj.GenerateResource.Cache trunk/plugins/autostart/obj/Debug/AutoStart.dll trunk/plugins/autostart/obj/Debug/AutoStart.pdb trunk/plugins/autostart/obj/Debug/AutoStartConfig.ConfigAutoStart.resources trunk/plugins/autostart/obj/Debug/TempPE/ trunk/plugins/autostart/obj/Release/ trunk/plugins/autostart/obj/Release/AutoStart.csproj.GenerateResource.Cache trunk/plugins/autostart/obj/Release/AutoStart.dll trunk/plugins/autostart/obj/Release/AutoStart.pdb trunk/plugins/autostart/obj/Release/AutoStartConfig.ConfigAutoStart.resources trunk/plugins/autostart/obj/Release/ClassLibrary1.Properties.Resources.resources trunk/plugins/autostart/obj/Release/Refactor/ trunk/plugins/autostart/obj/Release/ResolveAssemblyReference.cache trunk/plugins/autostart/obj/Release/TempPE/ trunk/plugins/autostart/obj/Release/TempPE/Properties.Resources.Designer.cs.dll Added: trunk/plugins/autostart/AutoStart.cs =================================================================== --- trunk/plugins/autostart/AutoStart.cs (rev 0) +++ trunk/plugins/autostart/AutoStart.cs 2007-03-21 17:53:54 UTC (rev 206) @@ -0,0 +1,175 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading; +using System.Windows.Forms; +using MediaPortal.Util; +using MediaPortal.Profile; +using MediaPortal.Services; +using MediaPortal.Configuration; +using MediaPortal.GUI.Library; +using MediaPortal.Player; +using AutoStartConfig; + +/* AutoStart Generation II + * + * Author: Martin Werner + * + * Version 1.0: 2007-03-19 + * ------------------------- + * Basic functionallity as Process Plugin + * Startup-Choices (TV, Weather, Audio, Video, ...) from available window handles + * Configuration Dialog and settings via mediaportal.xml + * + * Version 1.1: 2007-03-20 + * ------------------------- + * Code cleanup, commenting for better readability + * + *--------------------------------------------------------------------------- + * + * 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 + * + */ + +namespace AutoStart +{ + public class AutoStart : IPlugin, ISetupForm + { + #region vars + + ILog _epgLog; + String l_startwhat = ""; + + #endregion + + #region Ctor + public AutoStart() + { + } + #endregion + + #region IPlugin members + + public void Stop() + { + } + + public void Start() + { + // setup logging + ServiceProvider services = GlobalServiceProvider.Instance; + _epgLog = services.Get<ILog>(); + + // load settings + using (Settings reader = new Settings(Config.GetFile(Config.Dir.Config, "mediaportal.xml"))) + { + l_startwhat = reader.GetValue("autostart", "startscreen"); + } + + Log.Info("AutoStart: started"); + + // Let's see if we could read out something from settings - if so let's try to launch it + if (l_startwhat.Length > 0) + { + Log.Info("AutoStart: Enumerating Windows {0}", l_startwhat); + + Array nativeWindowsList = Enum.GetValues(typeof(GUIWindow.Window)); + foreach (GUIWindow.Window wnd in nativeWindowsList) + { + if (String.Compare(l_startwhat,wnd.ToString()) == 0) + { + // Yep, is a valid window we can try to launch :-) + + // if (Recorder.IsRecording()) <-- maybe we'll need to take care of this sometime... + + GUIWindowManager.ActivateWindow((int)wnd); + Log.Info("AutoStart: Launching Window {0}", (int)wnd); + } + } + } + } + + #endregion + + #region ISetupForm Members + + public string PluginName() + { + return "AutoStart"; + } + + public string Description() + { + return "AutoStart Plugin for MediaPortal"; + } + + public string Author() + { + return "mablebee"; + } + + public void ShowPlugin() + { + // Configure this plugin + ConfigAutoStart l_form = new ConfigAutoStart(); + l_form.Show(); + } + + public bool DefaultEnabled() + { + return false; + } + + public bool CanEnable() + { + return true; + } + + public int GetWindowId() + { + return 47110815; + } + + public bool HasSetup() + { + return true; + } + + /// <summary> + /// If the plugin should have it's own button on the main menu of MediaPortal then it + /// should return true to this method, otherwise if it should not be on home + /// it should return false + /// </summary> + /// <param name="strButtonText">text the button should have</param> + /// <param name="strButtonImage">image for the button, or empty for default</param> + /// <param name="strButtonImageFocus">image for the button, or empty for default</param> + /// <param name="strPictureImage">subpicture for the button or empty for none</param> + /// <returns>true : plugin needs it's own button on home + /// false : plugin does not need it's own button on home</returns> + + public bool GetHome(out string strButtonText, out string strButtonImage, + out string strButtonImageFocus, out string strPictureImage) + { + strButtonText = String.Empty; + strButtonImage = String.Empty; + strButtonImageFocus = String.Empty; + strPictureImage = String.Empty; + return false; + } + + #endregion + } +} Added: trunk/plugins/autostart/AutoStart.csproj =================================================================== --- trunk/plugins/autostart/AutoStart.csproj (rev 0) +++ trunk/plugins/autostart/AutoStart.csproj 2007-03-21 17:53:54 UTC (rev 206) @@ -0,0 +1,82 @@ +<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>{9A71624D-ABAE-4D49-B05D-F1C83DE77C07}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>ClassLibrary1</RootNamespace> + <AssemblyName>AutoStart</AssemblyName> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="Core, Version=1.0.2634.1793, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\..\..\..\..\..\Programme\Team MediaPortal\MediaPortal\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.1.2634.1787, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\..\..\..\..\..\Programme\Team MediaPortal\MediaPortal\Utils.DLL</HintPath> + </Reference> + </ItemGroup> + <ItemGroup> + <Compile Include="AutoStart.cs" /> + <Compile Include="AutoStartConfig.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="AutoStartConfig.Designer.cs"> + <DependentUpon>AutoStartConfig.cs</DependentUpon> + </Compile> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="Properties\Resources.Designer.cs"> + <AutoGen>True</AutoGen> + <DesignTime>True</DesignTime> + <DependentUpon>Resources.resx</DependentUpon> + </Compile> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="AutoStartConfig.resx"> + <SubType>Designer</SubType> + <DependentUpon>AutoStartConfig.cs</DependentUpon> + </EmbeddedResource> + <EmbeddedResource Include="Properties\Resources.resx"> + <SubType>Designer</SubType> + <Generator>ResXFileCodeGenerator</Generator> + <LastGenOutput>Resources.Designer.cs</LastGenOutput> + </EmbeddedResource> + </ItemGroup> + <ItemGroup> + <None Include="Resources\mplogo.gif" /> + </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/autostart/AutoStartConfig.Designer.cs =================================================================== --- trunk/plugins/autostart/AutoStartConfig.Designer.cs (rev 0) +++ trunk/plugins/autostart/AutoStartConfig.Designer.cs 2007-03-21 17:53:54 UTC (rev 206) @@ -0,0 +1,121 @@ +namespace AutoStartConfig +{ + partial class ConfigAutoStart + { + /// <summary> + /// Erforderliche Designervariable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Verwendete Ressourcen bereinigen. + /// </summary> + /// <param name="disposing">True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Vom Windows Form-Designer generierter Code + + /// <summary> + /// Erforderliche Methode für die Designerunterstützung. + /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. + /// </summary> + private void InitializeComponent() + { + this.label1 = new System.Windows.Forms.Label(); + this.buttonOK = new System.Windows.Forms.Button(); + this.butCancel = new System.Windows.Forms.Button(); + this.f_combobox = new System.Windows.Forms.ComboBox(); + this.pictureBox1 = new System.Windows.Forms.PictureBox(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.BackColor = System.Drawing.SystemColors.Window; + this.label1.Location = new System.Drawing.Point(12, 9); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(66, 13); + this.label1.TabIndex = 0; + this.label1.Text = "Startup with:"; + // + // buttonOK + // + this.buttonOK.Location = new System.Drawing.Point(142, 142); + this.buttonOK.Name = "buttonOK"; + this.buttonOK.Size = new System.Drawing.Size(75, 23); + this.buttonOK.TabIndex = 2; + this.buttonOK.Text = "&OK"; + this.buttonOK.UseVisualStyleBackColor = true; + this.buttonOK.Click += new System.EventHandler(this.button1_Click); + // + // butCancel + // + this.butCancel.Location = new System.Drawing.Point(61, 142); + this.butCancel.Name = "butCancel"; + this.butCancel.Size = new System.Drawing.Size(75, 23); + this.butCancel.TabIndex = 3; + this.butCancel.Text = "&Cancel"; + this.butCancel.UseVisualStyleBackColor = true; + this.butCancel.Click += new System.EventHandler(this.butCancel_Click); + // + // f_combobox + // + this.f_combobox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.f_combobox.FormattingEnabled = true; + this.f_combobox.Items.AddRange(new object[] { + "DVD", + "Radio", + "TV", + "Videos"}); + this.f_combobox.Location = new System.Drawing.Point(84, 6); + this.f_combobox.Name = "f_combobox"; + this.f_combobox.Size = new System.Drawing.Size(192, 21); + this.f_combobox.Sorted = true; + this.f_combobox.TabIndex = 4; + // + // pictureBox1 + // + this.pictureBox1.Image = global::ClassLibrary1.Properties.Resources.mplogo; + this.pictureBox1.Location = new System.Drawing.Point(-33, -17); + this.pictureBox1.Name = "pictureBox1"; + this.pictureBox1.Size = new System.Drawing.Size(420, 290); + this.pictureBox1.TabIndex = 6; + this.pictureBox1.TabStop = false; + // + // ConfigAutoStart + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.SystemColors.Window; + this.ClientSize = new System.Drawing.Size(288, 185); + this.Controls.Add(this.f_combobox); + this.Controls.Add(this.butCancel); + this.Controls.Add(this.buttonOK); + this.Controls.Add(this.label1); + this.Controls.Add(this.pictureBox1); + this.Name = "ConfigAutoStart"; + this.Text = "AutoStart Configuration"; + this.Load += new System.EventHandler(this.AutoStartConfig_Load); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Button buttonOK; + private System.Windows.Forms.Button butCancel; + private System.Windows.Forms.ComboBox f_combobox; + private System.Windows.Forms.PictureBox pictureBox1; + } +} \ No newline at end of file Added: trunk/plugins/autostart/AutoStartConfig.cs =================================================================== --- trunk/plugins/autostart/AutoStartConfig.cs (rev 0) +++ trunk/plugins/autostart/AutoStartConfig.cs 2007-03-21 17:53:54 UTC (rev 206) @@ -0,0 +1,95 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using MediaPortal.Util; +using MediaPortal.Profile; +using MediaPortal.UserInterface.Controls; +using MediaPortal.Services; +using MediaPortal.Configuration; +using MediaPortal.GUI.Library; + +namespace AutoStartConfig +{ + public partial class ConfigAutoStart : Form + { + ILog _epgLog; + + public ConfigAutoStart() + { + InitializeComponent(); + + // setup logging + ServiceProvider services = GlobalServiceProvider.Instance; + _epgLog = services.Get<ILog>(); + + Array nativeWindowsList = Enum.GetValues(typeof(GUIWindow.Window)); + + f_combobox.Items.Clear(); + + foreach (GUIWindow.Window wnd in nativeWindowsList) + { + String l_itemtoadd; + + l_itemtoadd = wnd.ToString().Substring(7); + + // Lets get rid of some unneeded windows for the combobox + if (((l_itemtoadd.IndexOf("SETTINGS") != -1) || + (l_itemtoadd.IndexOf("STATUS") != -1) || + (l_itemtoadd.IndexOf("_") != -1) || + (l_itemtoadd.IndexOf("INVALID") != -1) || + (l_itemtoadd.IndexOf("DIALOG") != -1) || + (l_itemtoadd.IndexOf("WIZARD") != -1)) == false) + { + // Add Windows Handles to List + f_combobox.Items.Add(l_itemtoadd); + //Log.Info("AutoStartConfig: Found Windows {0}", wnd.ToString()); + } + } + } + + private void AutoStartConfig_Load(object sender, EventArgs e) + { + LoadSettings(); + } + + private void SaveSettings() + { + // save settings + using (Settings writer = new Settings(Config.GetFile(Config.Dir.Config, "mediaportal.xml"))) + { + writer.SetValue("autostart","startscreen","WINDOW_"+f_combobox.SelectedItem.ToString()); + } + } + + + private void LoadSettings() + { + // load settings + using (Settings reader = new Settings(Config.GetFile(Config.Dir.Config, "mediaportal.xml"))) + { + String l_setting = reader.GetValue("autostart", "startscreen"); + Log.Info("AutoStartConfig: Loaded Config-Value {0}", l_setting); + + f_combobox.SelectedIndex = f_combobox.FindString(l_setting.Substring(7)); + + } + } + private void button1_Click(object sender, EventArgs e) + { + SaveSettings(); + Close(); + } + + private void butCancel_Click(object sender, EventArgs e) + { + // Closing without saving... + Close(); + } + + + } +} \ No newline at end of file Added: trunk/plugins/autostart/AutoStartConfig.resx =================================================================== --- trunk/plugins/autostart/AutoStartConfig.resx (rev 0) +++ trunk/plugins/autostart/AutoStartConfig.resx 2007-03-21 17:53:54 UTC (rev 206) @@ -0,0 +1,120 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> +</root> \ No newline at end of file Added: trunk/plugins/autostart/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/autostart/Properties/AssemblyInfo.cs (rev 0) +++ trunk/plugins/autostart/Properties/AssemblyInfo.cs 2007-03-21 17:53:54 UTC (rev 206) @@ -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("ClassLibrary1")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("ClassLibrary1")] +[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("3aa97c20-f35a-4ded-b3f1-3bb3236339ca")] + +// 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("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] Added: trunk/plugins/autostart/Properties/Resources.Designer.cs =================================================================== --- trunk/plugins/autostart/Properties/Resources.Designer.cs (rev 0) +++ trunk/plugins/autostart/Properties/Resources.Designer.cs 2007-03-21 17:53:54 UTC (rev 206) @@ -0,0 +1,70 @@ +//------------------------------------------------------------------------------ +// <auto-generated> +// Dieser Code wurde von einem Tool generiert. +// Laufzeitversion:2.0.50727.42 +// +// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn +// der Code erneut generiert wird. +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace ClassLibrary1.Properties { + using System; + + + /// <summary> + /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. + /// </summary> + // Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert + // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert. + // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen + // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// <summary> + /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. + /// </summary> + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ClassLibrary1.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// <summary> + /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle + /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. + /// </summary> + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + internal static System.Drawing.Bitmap mplogo { + get { + object obj = ResourceManager.GetObject("mplogo", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} Added: trunk/plugins/autostart/Properties/Resources.resx =================================================================== --- trunk/plugins/autostart/Properties/Resources.resx (rev 0) +++ trunk/plugins/autostart/Properties/Resources.resx 2007-03-21 17:53:54 UTC (rev 206) @@ -0,0 +1,124 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> + <data name="mplogo" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Resources\mplogo.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> +</root> \ No newline at end of file Added: trunk/plugins/autostart/Resources/mplogo.gif =================================================================== (Binary files differ) Property changes on: trunk/plugins/autostart/Resources/mplogo.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/autostart/bin/Debug/AutoStart.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/autostart/bin/Debug/AutoStart.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/autostart/bin/Debug/AutoStart.pdb =================================================================== (Binary files differ) Property changes on: trunk/plugins/autostart/bin/Debug/AutoStart.pdb ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/autostart/bin/Debug/AxInterop.WMPLib.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/autostart/bin/Debug/AxInterop.WMPLib.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/autostart/bin/Debug/Bass.Net.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/autostart/bin/Debug/Bass.Net.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/autostart/bin/Debug/BassRegistration.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/autostart/bin/Debug/BassRegistration.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/autostart/bin/Debug/Core.DLL =================================================================== (Binary files differ) Property changes on: trunk/plugins/autostart/bin/Debug/Core.DLL ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/autostart/bin/Debug/DirectShowLib.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/autostart/bin/Debug/DirectShowLib.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/autostart/bin/Debug/ICSharpCode.SharpZipLib.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/autostart/bin/Debug/ICSharpCode.SharpZipLib.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/autostart/bin/Debug/Interop.WMPLib.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/autostart/bin/Debug/Interop.WMPLib.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/autostart/bin/Debug/MediaPortal.Support.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/autostart/bin/Debug/MediaPortal.Support.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/autostart/bin/Debug/MediaPortal.Support.pdb =================================================================== (Binary files differ) Property changes on: trunk/plugins/autostart/bin/Debug/MediaPortal.Support.pdb ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/autostart/bin/Debug/Microsoft.DirectX.Direct3D.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/autostart/bin/Debug/Microsoft.DirectX.Direct3D.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/autostart/bin/Debug/Microsoft.DirectX.Direct3DX.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/autostart/bin/Debug/Microsoft.DirectX.Direct3DX.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/autostart/bin/Debug/Microsoft.DirectX.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/autostart/bin/Debug/Microsoft.DirectX.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/autostart/bin/Debug/Utils.DLL =================================================================== (Binary files differ) Property changes on: trunk/plugins/autostart/bin/Debug/Utils.DLL ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/autostart/bin/Debug/edtftpnet-1.2.2.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/autostart/bin/Debug/edtftpnet-1.2.2.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/autostart/bin/Release/AutoStart.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/autostart/bin/Release/AutoStart.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/autostart/bin/Release/AutoStart.pdb =================================================================== (Binary files differ) Property changes on: trunk/plugins/autostart/bin/Release/AutoStart.pdb ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/autostart/bin/Release/AxInterop.WMPLib.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/autostart/bin/Release/AxInterop.WMPLib.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/autostart/bin/Release/Bass.Net.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/autostart/bin/Release/Bass.Net.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/autostart/bin/Release/BassRegistration.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/autostart/bin/Release/BassRegistration.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/autostart/bin/Release/Core.DLL =================================================================== (Binary files differ) Property changes on: trunk/plugins/autostart/bin/Release/Core.DLL ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/autostart/bin/Release/DirectShowLib.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/autostart/bin/Release/DirectShowLib.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/autostart/bin/Release/ICSharpCode.SharpZipLib.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/autostart/bin/Release/ICSharpCode.SharpZipLib.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/autostart/bin/Release/Interop.WMPLib.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/autostart/bin/Release/Interop.WMPLib.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/autostart/bin/Release/MediaPortal.Support.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/autostart/bin/Release/MediaPortal.Support.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/autostart/bin/Release/MediaPortal.Support.pdb =================================================================== (Binary files differ) Property changes on: trunk/plugins/autostart/bin/Release/MediaPortal.Support.pdb ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/autostart/bin/Release/Microsoft.DirectX.Direct3D.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/autostart/bin/Release/Microsoft.DirectX.Direct3D.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/autostart/bin/Release/Microsoft.DirectX.Direct3DX.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/autostart/bin/Release/Microsoft.DirectX.Direct3DX.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/autostart/bin/Release/Microsoft.DirectX.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/autostart/bin/Release/Microsoft.DirectX.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/autostart/bin/Release/Utils.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/autostart/bin/Release/Utils.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/autostart/bin/Release/edtftpnet-1.2.2.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/autostart/bin/Release/edtftpnet-1.2.2.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/autostart/obj/AutoStart.csproj.FileList.txt =================================================================== --- trunk/plugins/autostart/obj/AutoStart.csproj.FileList.txt (rev 0) +++ trunk/plugins/autostart/obj/AutoStart.csproj.FileList.txt 2007-03-21 17:53:54 UTC (rev 206) @@ -0,0 +1,43 @@ +obj\Release\ResolveAssemblyReference.cache +bin\Release\AutoStart.dll +bin\Release\AutoStart.pdb +bin\Release\Core.DLL +bin\Release\Microsoft.DirectX.Direct3DX.dll +bin\Release\Microsoft.DirectX.Direct3D.dll +bin\Release\Microsoft.DirectX.dll +bin\Release\DirectShowLib.dll +bin\Release\Utils.dll +bin\Release\edtftpnet-1.2.2.dll +bin\Release\Interop.WMPLib.dll +bin\Release\MediaPortal.Support.dll +bin\Release\ICSharpCode.SharpZipLib.dll +bin\Release\BassRegistration.dll +bin\Release\Bass.Net.dll +bin\Release\AxInterop.WMPLib.dll +bin\Release\MediaPortal.Support.pdb +obj\Release\AutoStart.dll +obj\Release\AutoStart.pdb +obj\Release\AutoStart.csproj.GenerateResource.Cache +obj\Release\AutoStartConfig.ConfigAutoStart.resources +bin\Debug\AutoStart.dll +bin\Debug\AutoStart.pdb +bin\Debug\Core.DLL +bin\Debug\Utils.DLL +bin\Debug\Microsoft.DirectX.Direct3DX.dll +bin\Debug\Microsoft.DirectX.dll +bin\Debug\DirectShowLib.dll +bin\Debug\Microsoft.DirectX.Direct3D.dll +bin\Debug\edtftpnet-1.2.2.dll +bin\Debug\Interop.WMPLib.dll +bin\Debug\MediaPortal.Support.dll +bin\Debug\ICSharpCode.SharpZipLib.dll +bin\Debug\BassRegistration.dll +bin\Debug\Bass.Net.dll +bin\Debug\AxInterop.WMPLib.dll +bin\Debug\MediaPortal.Support.pdb +obj\Debug\ResolveAssemblyReference.cache +obj\Debug\AutoStartConfig.ConfigAutoStart.resources +obj\Debug\AutoStart.csproj.GenerateResource.Cache +obj\Debug\AutoStart.dll +obj\Debug\AutoStart.pdb +obj\Release\ClassLibrary1.Properties.Resources.resources Added: trunk/plugins/autostart/obj/Debug/AutoStart.csproj.GenerateResource.Cache =================================================================== (Binary files differ) Property changes on: trunk/plugins/autostart/obj/Debug/AutoStart.csproj.GenerateResource.Cache ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/autostart/obj/Debug/AutoStart.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/autostart/obj/Debug/AutoStart.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/autostart/obj/Debug/AutoStart.pdb =================================================================== (Binary files differ) Property changes on: trunk/plugins/autostart/obj/Debug/AutoStart.pdb ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/autostart/obj/Debug/AutoStartConfig.ConfigAutoStart.resources =================================================================== (Binary files differ) Property changes on: trunk/plugins/autostart/obj/Debug/AutoStartConfig.ConfigAutoStart.resources ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/autostart/obj/Release/AutoStart.csproj.GenerateResource.Cache =================================================================== (Binary files differ) Property changes on: trunk/plugins/autostart/obj/Release/AutoStart.csproj.GenerateResource.Cache ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/autostart/obj/Release/AutoStart.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/autostart/obj/Release/AutoStart.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/autostart/obj/Release/AutoStart.pdb =================================================================== (Binary files differ) Property changes on: trunk/plugins/autostart/obj/Release/AutoStart.pdb ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/autostart/obj/Release/AutoStartConfig.ConfigAutoStart.resources =================================================================== (Binary files differ) Property changes on: trunk/plugins/autostart/obj/Release/AutoStartConfig.ConfigAutoStart.resources ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/autostart/obj/Release/ClassLibrary1.Properties.Resources.resources =================================================================== (Binary files differ) Property changes on: trunk/plugins/autostart/obj/Release/ClassLibrary1.Properties.Resources.resources ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/autostart/obj/Release/ResolveAssemblyReference.cache =================================================================== (Binary files differ) Property changes on: trunk/plugins/autostart/obj/Release/ResolveAssemblyReference.cache ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/autostart/obj/Release/TempPE/Properties.Resources.Designer.cs.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/autostart/obj/Release/TempPE/Properties.Resources.Designer.cs.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-03-23 13:29:46
|
Revision: 213 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=213&view=rev Author: and-81 Date: 2007-03-23 06:29:45 -0700 (Fri, 23 Mar 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ComSkipLauncher TVE2/ComSkipLauncher.cs trunk/plugins/ComSkipLauncher TVE2/Configuration.cs trunk/plugins/ComSkipLauncher TVE3/ComSkipLauncher.cs trunk/plugins/ComSkipLauncher TVE3/PluginSetup.cs Modified: trunk/plugins/ComSkipLauncher TVE2/ComSkipLauncher.cs =================================================================== --- trunk/plugins/ComSkipLauncher TVE2/ComSkipLauncher.cs 2007-03-23 04:43:45 UTC (rev 212) +++ trunk/plugins/ComSkipLauncher TVE2/ComSkipLauncher.cs 2007-03-23 13:29:45 UTC (rev 213) @@ -28,9 +28,9 @@ #region Members - bool _runAtStart; - string _program; - string _parameters; + bool _runAtStart = false; + string _program = DefaultProgram; + string _parameters = DefaultParameters; #endregion Members @@ -42,19 +42,15 @@ LoadSettings(); - if (_runAtStart) - Recorder.OnTvRecordingStarted += new Recorder.OnTvRecordingHandler(Recorder_OnTvRecordingStarted); - else - Recorder.OnTvRecordingEnded += new Recorder.OnTvRecordingHandler(Recorder_OnTvRecordingEnded); + Recorder.OnTvRecordingStarted += new Recorder.OnTvRecordingHandler(Recorder_OnTvRecordingStarted); + Recorder.OnTvRecordingEnded += new Recorder.OnTvRecordingHandler(Recorder_OnTvRecordingEnded); } public void Stop() { Log.Info("ComSkipLauncher: Stop"); - if (_runAtStart) - Recorder.OnTvRecordingStarted -= new Recorder.OnTvRecordingHandler(Recorder_OnTvRecordingStarted); - else - Recorder.OnTvRecordingEnded -= new Recorder.OnTvRecordingHandler(Recorder_OnTvRecordingEnded); + Recorder.OnTvRecordingStarted -= new Recorder.OnTvRecordingHandler(Recorder_OnTvRecordingStarted); + Recorder.OnTvRecordingEnded -= new Recorder.OnTvRecordingHandler(Recorder_OnTvRecordingEnded); } #endregion @@ -74,15 +70,15 @@ LoadSettings(); Configuration configuration = new Configuration(); - configuration.RunAtStart = _runAtStart; - configuration.Program = _program; - configuration.Parameters = _parameters; + configuration.RunAtStart = _runAtStart; + configuration.Program = _program; + configuration.Parameters = _parameters; if (configuration.ShowDialog() == DialogResult.OK) { - _runAtStart = configuration.RunAtStart; - _program = configuration.Program; - _parameters = configuration.Parameters; + _runAtStart = configuration.RunAtStart; + _program = configuration.Program; + _parameters = configuration.Parameters; SaveSettings(); } @@ -102,13 +98,17 @@ { Log.Debug("ComSkipLauncher: Recorder_OnTvRecordingStarted {0}", recordingFilename); + if (!_runAtStart) + return; + try { - string parameters = ProcessParameters(_parameters, recordingFilename); + string parameters = ProcessParameters(_parameters, recordingFilename, recording.Channel); Log.Info( - "ComSkipLauncher: Recording started ({0}), launching program ({1} {2}) ...", + "ComSkipLauncher: Recording started ({0} on {1}), launching program ({2} {3}) ...", recordingFilename, + recording.Channel, _program, parameters ); @@ -124,13 +124,17 @@ { Log.Debug("ComSkipLauncher: Recorder_OnTvRecordingEnded {0}", recordingFilename); + if (_runAtStart) + return; + try { - string parameters = ProcessParameters(_parameters, recordingFilename); + string parameters = ProcessParameters(_parameters, recordingFilename, recording.Channel); Log.Info( - "ComSkipLauncher: Recording ended ({0}), launching program ({1} {2}) ...", + "ComSkipLauncher: Recording ended ({0} on {1}), launching program ({2} {3}) ...", recordingFilename, + recording.Channel, _program, parameters ); @@ -156,6 +160,10 @@ } catch (Exception ex) { + _runAtStart = false; + _program = DefaultProgram; + _parameters = DefaultParameters; + Log.Error("ComSkipLauncher: {0}", ex.Message); } } @@ -176,7 +184,7 @@ } } - internal static string ProcessParameters(string input, string fileName) + internal static string ProcessParameters(string input, string fileName, string channel) { string output = String.Empty; @@ -189,7 +197,8 @@ Path.GetFileNameWithoutExtension(fileName), // {2} = Recorded filename (w/o path or extension) Path.GetDirectoryName(fileName), // {3} = Recorded file path DateTime.Now.ToShortDateString(), // {4} = Current date - DateTime.Now.ToShortTimeString() // {5} = Current time + DateTime.Now.ToShortTimeString(), // {5} = Current time + channel // {6} = Channel name ); } catch (Exception ex) Modified: trunk/plugins/ComSkipLauncher TVE2/Configuration.cs =================================================================== --- trunk/plugins/ComSkipLauncher TVE2/Configuration.cs 2007-03-23 04:43:45 UTC (rev 212) +++ trunk/plugins/ComSkipLauncher TVE2/Configuration.cs 2007-03-23 13:29:45 UTC (rev 213) @@ -91,7 +91,7 @@ try { - string parameters = ComSkipLauncher.ProcessParameters(param, textBoxTest.Text); + string parameters = ComSkipLauncher.ProcessParameters(param, textBoxTest.Text, "test"); ComSkipLauncher.LaunchProcess(program, parameters, Path.GetDirectoryName(program), ProcessWindowStyle.Normal); } Modified: trunk/plugins/ComSkipLauncher TVE3/ComSkipLauncher.cs =================================================================== --- trunk/plugins/ComSkipLauncher TVE3/ComSkipLauncher.cs 2007-03-23 04:43:45 UTC (rev 212) +++ trunk/plugins/ComSkipLauncher TVE3/ComSkipLauncher.cs 2007-03-23 13:29:45 UTC (rev 213) @@ -30,9 +30,9 @@ #region Members - bool _runAtStart; - string _program; - string _parameters; + bool _runAtStart = true; + string _program = DefaultProgram; + string _parameters = DefaultParameters; #endregion Members @@ -104,22 +104,18 @@ try { TvServerEventArgs tvEvent = (TvServerEventArgs)eventArgs; - string parameters; + string parameters = ProcessParameters(_parameters, tvEvent.Recording.FileName, tvEvent.channel.Name); if (tvEvent.EventType == TvServerEventType.RecordingStarted && _runAtStart) { - parameters = ProcessParameters(_parameters, tvEvent.Recording.FileName); + Log.Info("ComSkipLauncher: Recording started ({0} on {1}), launching program ({2} {3}) ...", tvEvent.Recording.FileName, tvEvent.channel.Name, _program, parameters); - Log.Info("ComSkipLauncher: Recording started ({0}), launching program ({1} {2}) ...", tvEvent.Recording.FileName, _program, parameters); - LaunchProcess(_program, parameters, Path.GetDirectoryName(tvEvent.Recording.FileName), ProcessWindowStyle.Hidden); } else if (tvEvent.EventType == TvServerEventType.RecordingEnded && !_runAtStart) { - parameters = ProcessParameters(_parameters, tvEvent.Recording.FileName); + Log.Info("ComSkipLauncher: Recording ended ({0} on {1}), launching program ({2} {3}) ...", tvEvent.Recording.FileName, tvEvent.channel.Name, _program, parameters); - Log.Info("ComSkipLauncher: Recording ended ({0}), launching program ({1} {2}) ...", tvEvent.Recording.FileName, _program, parameters); - LaunchProcess(_program, parameters, Path.GetDirectoryName(tvEvent.Recording.FileName), ProcessWindowStyle.Hidden); } } @@ -141,11 +137,15 @@ } catch (Exception ex) { + _runAtStart = true; + _program = DefaultProgram; + _parameters = DefaultParameters; + Log.Error("ComSkipLauncher - LoadSettings(): {0}", ex.Message); } } - internal static string ProcessParameters(string input, string fileName) + internal static string ProcessParameters(string input, string fileName, string channel) { string output = String.Empty; @@ -158,7 +158,8 @@ Path.GetFileNameWithoutExtension(fileName), // {2} = Recorded filename (w/o path or extension) Path.GetDirectoryName(fileName), // {3} = Recorded file path DateTime.Now.ToShortDateString(), // {4} = Current date - DateTime.Now.ToShortTimeString() // {5} = Current time + DateTime.Now.ToShortTimeString(), // {5} = Current time + channel // {6} = Channel name ); } catch (Exception ex) Modified: trunk/plugins/ComSkipLauncher TVE3/PluginSetup.cs =================================================================== --- trunk/plugins/ComSkipLauncher TVE3/PluginSetup.cs 2007-03-23 04:43:45 UTC (rev 212) +++ trunk/plugins/ComSkipLauncher TVE3/PluginSetup.cs 2007-03-23 13:29:45 UTC (rev 213) @@ -122,7 +122,7 @@ try { - string parameters = ComSkipLauncher.ProcessParameters(param, textBoxTest.Text); + string parameters = ComSkipLauncher.ProcessParameters(param, textBoxTest.Text, "test"); ComSkipLauncher.LaunchProcess(program, parameters, Path.GetDirectoryName(program), ProcessWindowStyle.Normal); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-03-24 03:36:17
|
Revision: 215 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=215&view=rev Author: and-81 Date: 2007-03-23 20:36:12 -0700 (Fri, 23 Mar 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ComSkipLauncher TVE2/Configuration.cs trunk/plugins/ComSkipLauncher TVE3/PluginSetup.cs Modified: trunk/plugins/ComSkipLauncher TVE2/Configuration.cs =================================================================== --- trunk/plugins/ComSkipLauncher TVE2/Configuration.cs 2007-03-23 15:15:17 UTC (rev 214) +++ trunk/plugins/ComSkipLauncher TVE2/Configuration.cs 2007-03-24 03:36:12 UTC (rev 215) @@ -23,7 +23,8 @@ {2} = Recorded filename (w/o path or extension) {3} = Recorded file path {4} = Current date -{5} = Current time"; +{5} = Current time +{6} = Channel name"; #endregion Constants Modified: trunk/plugins/ComSkipLauncher TVE3/PluginSetup.cs =================================================================== --- trunk/plugins/ComSkipLauncher TVE3/PluginSetup.cs 2007-03-23 15:15:17 UTC (rev 214) +++ trunk/plugins/ComSkipLauncher TVE3/PluginSetup.cs 2007-03-24 03:36:12 UTC (rev 215) @@ -27,7 +27,8 @@ {2} = Recorded filename (w/o path or extension) {3} = Recorded file path {4} = Current date -{5} = Current time"; +{5} = Current time +{6} = Channel name"; #endregion Constants This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mab...@us...> - 2007-03-26 17:22:54
|
Revision: 224 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=224&view=rev Author: mablebee Date: 2007-03-26 10:22:50 -0700 (Mon, 26 Mar 2007) Log Message: ----------- Added Paths: ----------- trunk/plugins/AutoStart/ trunk/plugins/AutoStart/AutoStart.cs trunk/plugins/AutoStart/AutoStart.csproj trunk/plugins/AutoStart/AutoStartConfig.Designer.cs trunk/plugins/AutoStart/AutoStartConfig.cs trunk/plugins/AutoStart/AutoStartConfig.resx trunk/plugins/AutoStart/Properties/ trunk/plugins/AutoStart/Properties/AssemblyInfo.cs trunk/plugins/AutoStart/Properties/Resources.Designer.cs trunk/plugins/AutoStart/Properties/Resources.resx trunk/plugins/AutoStart/Resources/ trunk/plugins/AutoStart/Resources/mplogo.gif trunk/plugins/AutoStart/bin/ trunk/plugins/AutoStart/bin/Debug/ trunk/plugins/AutoStart/bin/Debug/AutoStart.dll trunk/plugins/AutoStart/bin/Debug/AutoStart.pdb trunk/plugins/AutoStart/bin/Debug/AxInterop.WMPLib.dll trunk/plugins/AutoStart/bin/Debug/Bass.Net.dll trunk/plugins/AutoStart/bin/Debug/BassRegistration.dll trunk/plugins/AutoStart/bin/Debug/Core.DLL trunk/plugins/AutoStart/bin/Debug/DirectShowLib.dll trunk/plugins/AutoStart/bin/Debug/ICSharpCode.SharpZipLib.dll trunk/plugins/AutoStart/bin/Debug/Interop.WMPLib.dll trunk/plugins/AutoStart/bin/Debug/MediaPortal.Support.dll trunk/plugins/AutoStart/bin/Debug/MediaPortal.Support.pdb trunk/plugins/AutoStart/bin/Debug/Microsoft.DirectX.Direct3D.dll trunk/plugins/AutoStart/bin/Debug/Microsoft.DirectX.Direct3DX.dll trunk/plugins/AutoStart/bin/Debug/Microsoft.DirectX.dll trunk/plugins/AutoStart/bin/Debug/Utils.DLL trunk/plugins/AutoStart/bin/Debug/edtftpnet-1.2.2.dll trunk/plugins/AutoStart/bin/Release/ trunk/plugins/AutoStart/bin/Release/AutoStart.dll trunk/plugins/AutoStart/bin/Release/AutoStart.pdb trunk/plugins/AutoStart/bin/Release/AxInterop.WMPLib.dll trunk/plugins/AutoStart/bin/Release/Bass.Net.dll trunk/plugins/AutoStart/bin/Release/BassRegistration.dll trunk/plugins/AutoStart/bin/Release/Core.DLL trunk/plugins/AutoStart/bin/Release/DirectShowLib.dll trunk/plugins/AutoStart/bin/Release/ICSharpCode.SharpZipLib.dll trunk/plugins/AutoStart/bin/Release/Interop.WMPLib.dll trunk/plugins/AutoStart/bin/Release/MediaPortal.Support.dll trunk/plugins/AutoStart/bin/Release/MediaPortal.Support.pdb trunk/plugins/AutoStart/bin/Release/Microsoft.DirectX.Direct3D.dll trunk/plugins/AutoStart/bin/Release/Microsoft.DirectX.Direct3DX.dll trunk/plugins/AutoStart/bin/Release/Microsoft.DirectX.dll trunk/plugins/AutoStart/bin/Release/Utils.dll trunk/plugins/AutoStart/bin/Release/edtftpnet-1.2.2.dll trunk/plugins/AutoStart/obj/ trunk/plugins/AutoStart/obj/AutoStart.csproj.FileList.txt trunk/plugins/AutoStart/obj/Debug/ trunk/plugins/AutoStart/obj/Debug/AutoStart.csproj.GenerateResource.Cache trunk/plugins/AutoStart/obj/Debug/AutoStart.dll trunk/plugins/AutoStart/obj/Debug/AutoStart.pdb trunk/plugins/AutoStart/obj/Debug/AutoStartConfig.ConfigAutoStart.resources trunk/plugins/AutoStart/obj/Debug/TempPE/ trunk/plugins/AutoStart/obj/Release/ trunk/plugins/AutoStart/obj/Release/AutoStart.csproj.GenerateResource.Cache trunk/plugins/AutoStart/obj/Release/AutoStart.dll trunk/plugins/AutoStart/obj/Release/AutoStart.pdb trunk/plugins/AutoStart/obj/Release/AutoStartConfig.ConfigAutoStart.resources trunk/plugins/AutoStart/obj/Release/ClassLibrary1.Properties.Resources.resources trunk/plugins/AutoStart/obj/Release/Refactor/ trunk/plugins/AutoStart/obj/Release/ResolveAssemblyReference.cache trunk/plugins/AutoStart/obj/Release/TempPE/ trunk/plugins/AutoStart/obj/Release/TempPE/Properties.Resources.Designer.cs.dll trunk/plugins/AutoStart.sln trunk/plugins/AutoStart.suo Added: trunk/plugins/AutoStart/AutoStart.cs =================================================================== --- trunk/plugins/AutoStart/AutoStart.cs (rev 0) +++ trunk/plugins/AutoStart/AutoStart.cs 2007-03-26 17:22:50 UTC (rev 224) @@ -0,0 +1,175 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading; +using System.Windows.Forms; +using MediaPortal.Util; +using MediaPortal.Profile; +using MediaPortal.Services; +using MediaPortal.Configuration; +using MediaPortal.GUI.Library; +using MediaPortal.Player; +using AutoStartConfig; + +/* AutoStart Generation II + * + * Author: Martin Werner + * + * Version 1.0: 2007-03-19 + * ------------------------- + * Basic functionallity as Process Plugin + * Startup-Choices (TV, Weather, Audio, Video, ...) from available window handles + * Configuration Dialog and settings via mediaportal.xml + * + * Version 1.1: 2007-03-20 + * ------------------------- + * Code cleanup, commenting for better readability + * + *--------------------------------------------------------------------------- + * + * 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 + * + */ + +namespace AutoStart +{ + public class AutoStart : IPlugin, ISetupForm + { + #region vars + + ILog _epgLog; + String l_startwhat = ""; + + #endregion + + #region Ctor + public AutoStart() + { + } + #endregion + + #region IPlugin members + + public void Stop() + { + } + + public void Start() + { + // setup logging + ServiceProvider services = GlobalServiceProvider.Instance; + _epgLog = services.Get<ILog>(); + + // load settings + using (Settings reader = new Settings(Config.GetFile(Config.Dir.Config, "mediaportal.xml"))) + { + l_startwhat = reader.GetValue("autostart", "startscreen"); + } + + Log.Info("AutoStart: started"); + + // Let's see if we could read out something from settings - if so let's try to launch it + if (l_startwhat.Length > 0) + { + Log.Info("AutoStart: Enumerating Windows {0}", l_startwhat); + + Array nativeWindowsList = Enum.GetValues(typeof(GUIWindow.Window)); + foreach (GUIWindow.Window wnd in nativeWindowsList) + { + if (String.Compare(l_startwhat,wnd.ToString()) == 0) + { + // Yep, is a valid window we can try to launch :-) + + // if (Recorder.IsRecording()) <-- maybe we'll need to take care of this sometime... + + GUIWindowManager.ActivateWindow((int)wnd); + Log.Info("AutoStart: Launching Window {0}", (int)wnd); + } + } + } + } + + #endregion + + #region ISetupForm Members + + public string PluginName() + { + return "AutoStart"; + } + + public string Description() + { + return "AutoStart Plugin for MediaPortal"; + } + + public string Author() + { + return "mablebee"; + } + + public void ShowPlugin() + { + // Configure this plugin + ConfigAutoStart l_form = new ConfigAutoStart(); + l_form.Show(); + } + + public bool DefaultEnabled() + { + return false; + } + + public bool CanEnable() + { + return true; + } + + public int GetWindowId() + { + return 47110815; + } + + public bool HasSetup() + { + return true; + } + + /// <summary> + /// If the plugin should have it's own button on the main menu of MediaPortal then it + /// should return true to this method, otherwise if it should not be on home + /// it should return false + /// </summary> + /// <param name="strButtonText">text the button should have</param> + /// <param name="strButtonImage">image for the button, or empty for default</param> + /// <param name="strButtonImageFocus">image for the button, or empty for default</param> + /// <param name="strPictureImage">subpicture for the button or empty for none</param> + /// <returns>true : plugin needs it's own button on home + /// false : plugin does not need it's own button on home</returns> + + public bool GetHome(out string strButtonText, out string strButtonImage, + out string strButtonImageFocus, out string strPictureImage) + { + strButtonText = String.Empty; + strButtonImage = String.Empty; + strButtonImageFocus = String.Empty; + strPictureImage = String.Empty; + return false; + } + + #endregion + } +} Added: trunk/plugins/AutoStart/AutoStart.csproj =================================================================== --- trunk/plugins/AutoStart/AutoStart.csproj (rev 0) +++ trunk/plugins/AutoStart/AutoStart.csproj 2007-03-26 17:22:50 UTC (rev 224) @@ -0,0 +1,82 @@ +<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>{9A71624D-ABAE-4D49-B05D-F1C83DE77C07}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>ClassLibrary1</RootNamespace> + <AssemblyName>AutoStart</AssemblyName> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="Core, Version=1.0.2634.1793, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\..\..\..\..\..\Programme\Team MediaPortal\MediaPortal\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.1.2634.1787, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\..\..\..\..\..\Programme\Team MediaPortal\MediaPortal\Utils.DLL</HintPath> + </Reference> + </ItemGroup> + <ItemGroup> + <Compile Include="AutoStart.cs" /> + <Compile Include="AutoStartConfig.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="AutoStartConfig.Designer.cs"> + <DependentUpon>AutoStartConfig.cs</DependentUpon> + </Compile> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="Properties\Resources.Designer.cs"> + <AutoGen>True</AutoGen> + <DesignTime>True</DesignTime> + <DependentUpon>Resources.resx</DependentUpon> + </Compile> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="AutoStartConfig.resx"> + <SubType>Designer</SubType> + <DependentUpon>AutoStartConfig.cs</DependentUpon> + </EmbeddedResource> + <EmbeddedResource Include="Properties\Resources.resx"> + <SubType>Designer</SubType> + <Generator>ResXFileCodeGenerator</Generator> + <LastGenOutput>Resources.Designer.cs</LastGenOutput> + </EmbeddedResource> + </ItemGroup> + <ItemGroup> + <None Include="Resources\mplogo.gif" /> + </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/AutoStart/AutoStartConfig.Designer.cs =================================================================== --- trunk/plugins/AutoStart/AutoStartConfig.Designer.cs (rev 0) +++ trunk/plugins/AutoStart/AutoStartConfig.Designer.cs 2007-03-26 17:22:50 UTC (rev 224) @@ -0,0 +1,121 @@ +namespace AutoStartConfig +{ + partial class ConfigAutoStart + { + /// <summary> + /// Erforderliche Designervariable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Verwendete Ressourcen bereinigen. + /// </summary> + /// <param name="disposing">True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Vom Windows Form-Designer generierter Code + + /// <summary> + /// Erforderliche Methode für die Designerunterstützung. + /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. + /// </summary> + private void InitializeComponent() + { + this.label1 = new System.Windows.Forms.Label(); + this.buttonOK = new System.Windows.Forms.Button(); + this.butCancel = new System.Windows.Forms.Button(); + this.f_combobox = new System.Windows.Forms.ComboBox(); + this.pictureBox1 = new System.Windows.Forms.PictureBox(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.BackColor = System.Drawing.SystemColors.Window; + this.label1.Location = new System.Drawing.Point(12, 9); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(66, 13); + this.label1.TabIndex = 0; + this.label1.Text = "Startup with:"; + // + // buttonOK + // + this.buttonOK.Location = new System.Drawing.Point(142, 142); + this.buttonOK.Name = "buttonOK"; + this.buttonOK.Size = new System.Drawing.Size(75, 23); + this.buttonOK.TabIndex = 2; + this.buttonOK.Text = "&OK"; + this.buttonOK.UseVisualStyleBackColor = true; + this.buttonOK.Click += new System.EventHandler(this.button1_Click); + // + // butCancel + // + this.butCancel.Location = new System.Drawing.Point(61, 142); + this.butCancel.Name = "butCancel"; + this.butCancel.Size = new System.Drawing.Size(75, 23); + this.butCancel.TabIndex = 3; + this.butCancel.Text = "&Cancel"; + this.butCancel.UseVisualStyleBackColor = true; + this.butCancel.Click += new System.EventHandler(this.butCancel_Click); + // + // f_combobox + // + this.f_combobox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.f_combobox.FormattingEnabled = true; + this.f_combobox.Items.AddRange(new object[] { + "DVD", + "Radio", + "TV", + "Videos"}); + this.f_combobox.Location = new System.Drawing.Point(84, 6); + this.f_combobox.Name = "f_combobox"; + this.f_combobox.Size = new System.Drawing.Size(192, 21); + this.f_combobox.Sorted = true; + this.f_combobox.TabIndex = 4; + // + // pictureBox1 + // + this.pictureBox1.Image = global::ClassLibrary1.Properties.Resources.mplogo; + this.pictureBox1.Location = new System.Drawing.Point(-33, -17); + this.pictureBox1.Name = "pictureBox1"; + this.pictureBox1.Size = new System.Drawing.Size(420, 290); + this.pictureBox1.TabIndex = 6; + this.pictureBox1.TabStop = false; + // + // ConfigAutoStart + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.SystemColors.Window; + this.ClientSize = new System.Drawing.Size(288, 185); + this.Controls.Add(this.f_combobox); + this.Controls.Add(this.butCancel); + this.Controls.Add(this.buttonOK); + this.Controls.Add(this.label1); + this.Controls.Add(this.pictureBox1); + this.Name = "ConfigAutoStart"; + this.Text = "AutoStart Configuration"; + this.Load += new System.EventHandler(this.AutoStartConfig_Load); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Button buttonOK; + private System.Windows.Forms.Button butCancel; + private System.Windows.Forms.ComboBox f_combobox; + private System.Windows.Forms.PictureBox pictureBox1; + } +} \ No newline at end of file Added: trunk/plugins/AutoStart/AutoStartConfig.cs =================================================================== --- trunk/plugins/AutoStart/AutoStartConfig.cs (rev 0) +++ trunk/plugins/AutoStart/AutoStartConfig.cs 2007-03-26 17:22:50 UTC (rev 224) @@ -0,0 +1,97 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using MediaPortal.Util; +using MediaPortal.Profile; +using MediaPortal.UserInterface.Controls; +using MediaPortal.Services; +using MediaPortal.Configuration; +using MediaPortal.GUI.Library; + +namespace AutoStartConfig +{ + public partial class ConfigAutoStart : Form + { + ILog _epgLog; + + public ConfigAutoStart() + { + InitializeComponent(); + + // setup logging + ServiceProvider services = GlobalServiceProvider.Instance; + _epgLog = services.Get<ILog>(); + + Array nativeWindowsList = Enum.GetValues(typeof(GUIWindow.Window)); + + f_combobox.Items.Clear(); + + foreach (GUIWindow.Window wnd in nativeWindowsList) + { + String l_itemtoadd; + + l_itemtoadd = wnd.ToString().Substring(7); + + // Lets get rid of some unneeded windows for the combobox + if (((l_itemtoadd.IndexOf("SETTINGS") != -1) || + (l_itemtoadd.IndexOf("STATUS") != -1) || + (l_itemtoadd.IndexOf("_") != -1) || + (l_itemtoadd.IndexOf("INVALID") != -1) || + (l_itemtoadd.IndexOf("DIALOG") != -1) || + (l_itemtoadd.IndexOf("WIZARD") != -1)) == false) + { + // Add Windows Handles to List + f_combobox.Items.Add(l_itemtoadd); + //Log.Info("AutoStartConfig: Found Windows {0}", wnd.ToString()); + } + } + } + + private void AutoStartConfig_Load(object sender, EventArgs e) + { + LoadSettings(); + } + + private void SaveSettings() + { + // save settings + using (Settings writer = new Settings(Config.GetFile(Config.Dir.Config, "mediaportal.xml"))) + { + writer.SetValue("autostart","startscreen","WINDOW_"+f_combobox.SelectedItem.ToString()); + } + } + + + private void LoadSettings() + { + // load settings + using (Settings reader = new Settings(Config.GetFile(Config.Dir.Config, "mediaportal.xml"))) + { + String l_setting = reader.GetValue("autostart", "startscreen"); + Log.Info("AutoStartConfig: Loaded Config-Value {0}", l_setting); + + if (l_setting.Length > 0) + { + f_combobox.SelectedIndex = f_combobox.FindString(l_setting.Substring(7)); + } + } + } + private void button1_Click(object sender, EventArgs e) + { + SaveSettings(); + Close(); + } + + private void butCancel_Click(object sender, EventArgs e) + { + // Closing without saving... + Close(); + } + + + } +} \ No newline at end of file Added: trunk/plugins/AutoStart/AutoStartConfig.resx =================================================================== --- trunk/plugins/AutoStart/AutoStartConfig.resx (rev 0) +++ trunk/plugins/AutoStart/AutoStartConfig.resx 2007-03-26 17:22:50 UTC (rev 224) @@ -0,0 +1,120 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> +</root> \ No newline at end of file Added: trunk/plugins/AutoStart/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/AutoStart/Properties/AssemblyInfo.cs (rev 0) +++ trunk/plugins/AutoStart/Properties/AssemblyInfo.cs 2007-03-26 17:22:50 UTC (rev 224) @@ -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("ClassLibrary1")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("ClassLibrary1")] +[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("3aa97c20-f35a-4ded-b3f1-3bb3236339ca")] + +// 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("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] Added: trunk/plugins/AutoStart/Properties/Resources.Designer.cs =================================================================== --- trunk/plugins/AutoStart/Properties/Resources.Designer.cs (rev 0) +++ trunk/plugins/AutoStart/Properties/Resources.Designer.cs 2007-03-26 17:22:50 UTC (rev 224) @@ -0,0 +1,70 @@ +//------------------------------------------------------------------------------ +// <auto-generated> +// Dieser Code wurde von einem Tool generiert. +// Laufzeitversion:2.0.50727.42 +// +// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn +// der Code erneut generiert wird. +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace ClassLibrary1.Properties { + using System; + + + /// <summary> + /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. + /// </summary> + // Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert + // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert. + // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen + // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// <summary> + /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. + /// </summary> + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ClassLibrary1.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// <summary> + /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle + /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. + /// </summary> + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + internal static System.Drawing.Bitmap mplogo { + get { + object obj = ResourceManager.GetObject("mplogo", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} Added: trunk/plugins/AutoStart/Properties/Resources.resx =================================================================== --- trunk/plugins/AutoStart/Properties/Resources.resx (rev 0) +++ trunk/plugins/AutoStart/Properties/Resources.resx 2007-03-26 17:22:50 UTC (rev 224) @@ -0,0 +1,124 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> + <data name="mplogo" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Resources\mplogo.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> +</root> \ No newline at end of file Added: trunk/plugins/AutoStart/Resources/mplogo.gif =================================================================== (Binary files differ) Property changes on: trunk/plugins/AutoStart/Resources/mplogo.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/AutoStart/bin/Debug/AutoStart.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/AutoStart/bin/Debug/AutoStart.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/AutoStart/bin/Debug/AutoStart.pdb =================================================================== (Binary files differ) Property changes on: trunk/plugins/AutoStart/bin/Debug/AutoStart.pdb ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/AutoStart/bin/Debug/AxInterop.WMPLib.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/AutoStart/bin/Debug/AxInterop.WMPLib.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/AutoStart/bin/Debug/Bass.Net.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/AutoStart/bin/Debug/Bass.Net.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/AutoStart/bin/Debug/BassRegistration.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/AutoStart/bin/Debug/BassRegistration.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/AutoStart/bin/Debug/Core.DLL =================================================================== (Binary files differ) Property changes on: trunk/plugins/AutoStart/bin/Debug/Core.DLL ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/AutoStart/bin/Debug/DirectShowLib.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/AutoStart/bin/Debug/DirectShowLib.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/AutoStart/bin/Debug/ICSharpCode.SharpZipLib.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/AutoStart/bin/Debug/ICSharpCode.SharpZipLib.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/AutoStart/bin/Debug/Interop.WMPLib.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/AutoStart/bin/Debug/Interop.WMPLib.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/AutoStart/bin/Debug/MediaPortal.Support.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/AutoStart/bin/Debug/MediaPortal.Support.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/AutoStart/bin/Debug/MediaPortal.Support.pdb =================================================================== (Binary files differ) Property changes on: trunk/plugins/AutoStart/bin/Debug/MediaPortal.Support.pdb ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/AutoStart/bin/Debug/Microsoft.DirectX.Direct3D.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/AutoStart/bin/Debug/Microsoft.DirectX.Direct3D.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/AutoStart/bin/Debug/Microsoft.DirectX.Direct3DX.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/AutoStart/bin/Debug/Microsoft.DirectX.Direct3DX.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/AutoStart/bin/Debug/Microsoft.DirectX.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/AutoStart/bin/Debug/Microsoft.DirectX.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/AutoStart/bin/Debug/Utils.DLL =================================================================== (Binary files differ) Property changes on: trunk/plugins/AutoStart/bin/Debug/Utils.DLL ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/AutoStart/bin/Debug/edtftpnet-1.2.2.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/AutoStart/bin/Debug/edtftpnet-1.2.2.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/AutoStart/bin/Release/AutoStart.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/AutoStart/bin/Release/AutoStart.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/AutoStart/bin/Release/AutoStart.pdb =================================================================== (Binary files differ) Property changes on: trunk/plugins/AutoStart/bin/Release/AutoStart.pdb ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/AutoStart/bin/Release/AxInterop.WMPLib.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/AutoStart/bin/Release/AxInterop.WMPLib.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/AutoStart/bin/Release/Bass.Net.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/AutoStart/bin/Release/Bass.Net.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/AutoStart/bin/Release/BassRegistration.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/AutoStart/bin/Release/BassRegistration.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/AutoStart/bin/Release/Core.DLL =================================================================== (Binary files differ) Property changes on: trunk/plugins/AutoStart/bin/Release/Core.DLL ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/AutoStart/bin/Release/DirectShowLib.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/AutoStart/bin/Release/DirectShowLib.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/AutoStart/bin/Release/ICSharpCode.SharpZipLib.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/AutoStart/bin/Release/ICSharpCode.SharpZipLib.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/AutoStart/bin/Release/Interop.WMPLib.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/AutoStart/bin/Release/Interop.WMPLib.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/AutoStart/bin/Release/MediaPortal.Support.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/AutoStart/bin/Release/MediaPortal.Support.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/AutoStart/bin/Release/MediaPortal.Support.pdb =================================================================== (Binary files differ) Property changes on: trunk/plugins/AutoStart/bin/Release/MediaPortal.Support.pdb ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/AutoStart/bin/Release/Microsoft.DirectX.Direct3D.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/AutoStart/bin/Release/Microsoft.DirectX.Direct3D.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/AutoStart/bin/Release/Microsoft.DirectX.Direct3DX.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/AutoStart/bin/Release/Microsoft.DirectX.Direct3DX.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/AutoStart/bin/Release/Microsoft.DirectX.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/AutoStart/bin/Release/Microsoft.DirectX.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/AutoStart/bin/Release/Utils.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/AutoStart/bin/Release/Utils.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/AutoStart/bin/Release/edtftpnet-1.2.2.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/AutoStart/bin/Release/edtftpnet-1.2.2.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/AutoStart/obj/AutoStart.csproj.FileList.txt =================================================================== --- trunk/plugins/AutoStart/obj/AutoStart.csproj.FileList.txt (rev 0) +++ trunk/plugins/AutoStart/obj/AutoStart.csproj.FileList.txt 2007-03-26 17:22:50 UTC (rev 224) @@ -0,0 +1,43 @@ +obj\Release\ResolveAssemblyReference.cache +bin\Release\AutoStart.dll +bin\Release\AutoStart.pdb +bin\Release\Core.DLL +bin\Release\Microsoft.DirectX.Direct3DX.dll +bin\Release\Microsoft.DirectX.Direct3D.dll +bin\Release\Microsoft.DirectX.dll +bin\Release\DirectShowLib.dll +bin\Release\Utils.dll +bin\Release\edtftpnet-1.2.2.dll +bin\Release\Interop.WMPLib.dll +bin\Release\MediaPortal.Support.dll +bin\Release\ICSharpCode.SharpZipLib.dll +bin\Release\BassRegistration.dll +bin\Release\Bass.Net.dll +bin\Release\AxInterop.WMPLib.dll +bin\Release\MediaPortal.Support.pdb +obj\Release\AutoStart.dll +obj\Release\AutoStart.pdb +obj\Release\AutoStart.csproj.GenerateResource.Cache +obj\Release\AutoStartConfig.ConfigAutoStart.resources +bin\Debug\AutoStart.dll +bin\Debug\AutoStart.pdb +bin\Debug\Core.DLL +bin\Debug\Utils.DLL +bin\Debug\Microsoft.DirectX.Direct3DX.dll +bin\Debug\Microsoft.DirectX.dll +bin\Debug\DirectShowLib.dll +bin\Debug\Microsoft.DirectX.Direct3D.dll +bin\Debug\edtftpnet-1.2.2.dll +bin\Debug\Interop.WMPLib.dll +bin\Debug\MediaPortal.Support.dll +bin\Debug\ICSharpCode.SharpZipLib.dll +bin\Debug\BassRegistration.dll +bin\Debug\Bass.Net.dll +bin\Debug\AxInterop.WMPLib.dll +bin\Debug\MediaPortal.Support.pdb +obj\Debug\ResolveAssemblyReference.cache +obj\Debug\AutoStartConfig.ConfigAutoStart.resources +obj\Debug\AutoStart.csproj.GenerateResource.Cache +obj\Debug\AutoStart.dll +obj\Debug\AutoStart.pdb +obj\Release\ClassLibrary1.Properties.Resources.resources Added: trunk/plugins/AutoStart/obj/Debug/AutoStart.csproj.GenerateResource.Cache =================================================================== (Binary files differ) Property changes on: trunk/plugins/AutoStart/obj/Debug/AutoStart.csproj.GenerateResource.Cache ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/AutoStart/obj/Debug/AutoStart.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/AutoStart/obj/Debug/AutoStart.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/AutoStart/obj/Debug/AutoStart.pdb =================================================================== (Binary files differ) Property changes on: trunk/plugins/AutoStart/obj/Debug/AutoStart.pdb ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/AutoStart/obj/Debug/AutoStartConfig.ConfigAutoStart.resources =================================================================== (Binary files differ) Property changes on: trunk/plugins/AutoStart/obj/Debug/AutoStartConfig.ConfigAutoStart.resources ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/AutoStart/obj/Release/AutoStart.csproj.GenerateResource.Cache =================================================================== (Binary files differ) Property changes on: trunk/plugins/AutoStart/obj/Release/AutoStart.csproj.GenerateResource.Cache ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/AutoStart/obj/Release/AutoStart.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/AutoStart/obj/Release/AutoStart.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/AutoStart/obj/Release/AutoStart.pdb =================================================================== (Binary files differ) Property changes on: trunk/plugins/AutoStart/obj/Release/AutoStart.pdb ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/AutoStart/obj/Release/AutoStartConfig.ConfigAutoStart.resources =================================================================== (Binary files differ) Property changes on: trunk/plugins/AutoStart/obj/Release/AutoStartConfig.ConfigAutoStart.resources ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/AutoStart/obj/Release/ClassLibrary1.Properties.Resources.resources =================================================================== (Binary files differ) Property changes on: trunk/plugins/AutoStart/obj/Release/ClassLibrary1.Properties.Resources.resources ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/AutoStart/obj/Release/ResolveAssemblyReference.cache =================================================================== (Binary files differ) Property changes on: trunk/plugins/AutoStart/obj/Release/ResolveAssemblyReference.cache ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/AutoStart/obj/Release/TempPE/Properties.Resources.Designer.cs.dll =================================================================== (Binary files differ) Property changes on: trunk/plugins/AutoStart/obj/Release/TempPE/Properties.Resources.Designer.cs.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/AutoStart.sln =================================================================== --- trunk/plugins/AutoStart.sln (rev 0) +++ trunk/plugins/AutoStart.sln 2007-03-26 17:22:50 UTC (rev 224) @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual C# Express 2005 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoStart", "AutoStart\AutoStart.csproj", "{9A71624D-ABAE-4D49-B05D-F1C83DE77C07}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {9A71624D-ABAE-4D49-B05D-F1C83DE77C07}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9A71624D-ABAE-4D49-B05D-F1C83DE77C07}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9A71624D-ABAE-4D49-B05D-F1C83DE77C07}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9A71624D-ABAE-4D49-B05D-F1C83DE77C07}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal Added: trunk/plugins/AutoStart.suo =================================================================== (Binary files differ) Property changes on: trunk/plugins/AutoStart.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: <pb...@us...> - 2007-03-27 09:05:34
|
Revision: 230 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=230&view=rev Author: pbb72 Date: 2007-03-27 02:05:32 -0700 (Tue, 27 Mar 2007) Log Message: ----------- Documentation plugin to browse MP wiki from within MediaPortal. Based on Wikipedia plugin. Added Paths: ----------- trunk/plugins/Documentation.cs trunk/plugins/Documentation.csproj trunk/plugins/DocumentationImage.cs trunk/plugins/DocumentationPage.cs Added: trunk/plugins/Documentation.cs =================================================================== --- trunk/plugins/Documentation.cs (rev 0) +++ trunk/plugins/Documentation.cs 2007-03-27 09:05:32 UTC (rev 230) @@ -0,0 +1,407 @@ +#region Copyright (C) 2005-2007 Team MediaPortal + +/* + * Copyright (C) 2005-2007 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.ComponentModel; +using System.Windows.Forms; +using System.Net; +using System.IO; +using System.Text; +using System.Threading; +using System.Collections; +using MediaPortal.GUI.Library; +using MediaPortal.Dialogs; +using MediaPortal.Util; +using MediaPortal.Configuration; + +namespace Wikipedia +{ + /// <summary> + /// Windowplugin to search in Wikipedia and display articles using the MP Wikipedia Classes. + /// </summary> + public class GUIWikipedia : GUIWindow, ISetupForm + { + #region SkinControls + [SkinControlAttribute(10)] + protected GUIButtonControl buttonSearch = null; + [SkinControlAttribute(11)] + protected GUIButtonControl buttonLocal = null; + [SkinControlAttribute(14)] + protected GUIButtonControl buttonBack = null; + [SkinControlAttribute(12)] + protected GUIButtonControl buttonLinks = null; + [SkinControlAttribute(13)] + protected GUIButtonControl buttonImages = null; + + [SkinControlAttribute(4)] + protected GUILabelControl searchtermLabel = null; + [SkinControlAttribute(5)] + protected GUILabelControl imagedescLabel = null; + [SkinControlAttribute(20)] + protected GUITextControl txtArticle = null; + + [SkinControlAttribute(25)] + protected GUIImage imageControl = null; + #endregion + + private string language = "Default"; + private string articletext = string.Empty; + private ArrayList linkArray = new ArrayList(); + private ArrayList imagenameArray = new ArrayList(); + private ArrayList imagedescArray = new ArrayList(); + + + public GUIWikipedia() + { + GetID = (int)GUIWindow.Window.WINDOW_WIKIPEDIA; + } + #region ISetupForm Members + + // Returns the name of the plugin which is shown in the plugin menu + public string PluginName() + { + return "Wikipedia"; + } + + // Returns the description of the plugin is shown in the plugin menu + public string Description() + { + return "A Plugin to search in Wikipedia"; + } + + // Returns the author of the plugin which is shown in the plugin menu + public string Author() + { + return "Maschine"; + } + + // show the setup dialog + public void ShowPlugin() + { + MessageBox.Show("Edit the wikipedia.xml file in MP's root directory to add new sites."); + } + + // Indicates whether plugin can be enabled/disabled + public bool CanEnable() + { + return true; + } + + // get ID of windowplugin belonging to this setup + public int GetWindowId() + { + return 4711; + } + + // Indicates if plugin is enabled by default; + public bool DefaultEnabled() + { + return false; + } + + // indicates if a plugin has its own setup screen + public bool HasSetup() + { + return false; + } + + /// <summary> + /// If the plugin should have its own button on the main menu of Media Portal then it + /// should return true to this method, otherwise if it should not be on home + /// it should return false + /// </summary> + /// <param name="strButtonText">text the button should have</param> + /// <param name="strButtonImage">image for the button, or empty for default</param> + /// <param name="strButtonImageFocus">image for the button, or empty for default</param> + /// <param name="strPictureImage">subpicture for the button or empty for none</param> + /// <returns>true : plugin needs its own button on home + /// false : plugin does not need its own button on home</returns> + public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) + { + strButtonText = GUILocalizeStrings.Get(2516); + strButtonImage = ""; + strButtonImageFocus = ""; + strPictureImage = ""; + return true; + } + #endregion + + public override bool Init() + { + return Load(GUIGraphicsContext.Skin + @"\wikipedia.xml"); + } + + protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType) + { + // we don't want the user to start another search while one is already active + if (_workerCompleted == false) + return; + + // Here we want to open the OSD Keyboard to enter the searchstring + if (control == buttonSearch) + { + // If the search Button was clicked we need to bring up the search keyboard. + VirtualKeyboard keyboard = (VirtualKeyboard)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_VIRTUAL_KEYBOARD); + if (null == keyboard) return; + string searchterm = string.Empty; + keyboard.IsSearchKeyboard = true; + keyboard.Reset(); + keyboard.Text = ""; + keyboard.DoModal(GetID); // show it... + + Log.Info("Wikipedia: OSD keyboard loaded!"); + + // If input is finished, the string is saved to the searchterm var. + if (keyboard.IsConfirmed) + searchterm = keyboard.Text; + + // If there was a string entered try getting the article. + if (searchterm != "") + { + Log.Info("Wikipedia: Searchterm gotten from OSD keyboard: {0}", searchterm); + GetAndDisplayArticle(searchterm); + } + // Else display an error dialog. + else + { + GUIDialogOK dlg = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK); + dlg.SetHeading(GUILocalizeStrings.Get(257)); // Error + dlg.SetLine(1, GUILocalizeStrings.Get(2500)); // No searchterm entered! + dlg.SetLine(2, String.Empty); + dlg.SetLine(3, GUILocalizeStrings.Get(2501)); // Please enter a valid searchterm! + dlg.DoModal(GUIWindowManager.ActiveWindow); + } + } + // This is the control to select the local Wikipedia site. + if (control == buttonLocal) + { + // Create a new selection dialog. + GUIDialogMenu pDlgOK = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); + if (pDlgOK != null) + { + pDlgOK.Reset(); + pDlgOK.SetHeading(GUILocalizeStrings.Get(2502)); //Select your local Wikipedia: + + // Add all the local sites we want to be displayed starting with int 0. + MediaPortal.Profile.Settings langreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "wikipedia.xml")); + String allsites = langreader.GetValueAsString("Allsites", "sitenames", ""); + Log.Info("Wikipedia: available sites: " + allsites); + String[] siteArray = allsites.Split(','); + for (int i = 0; i < siteArray.Length; i++) + { + int stringno = langreader.GetValueAsInt(siteArray[i], "string", 2006); + pDlgOK.Add(GUILocalizeStrings.Get(stringno)); //English, German, French ... + } + + pDlgOK.DoModal(GetID); + if (pDlgOK.SelectedLabel >= 0) + { + SelectLocalWikipedia(pDlgOK.SelectedLabel, siteArray); + } + } + } + // The Button holding the Links to other articles + if (control == buttonLinks) + { + if (linkArray.Count > 0) + { + // Create a new selection dialog. + GUIDialogMenu pDlgOK = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); + if (pDlgOK != null) + { + pDlgOK.Reset(); + pDlgOK.SetHeading(GUILocalizeStrings.Get(2505)); //Links to other articles: + + // Add all the links from the linkarray. + foreach (string link in linkArray) + { + pDlgOK.Add(link); + } + pDlgOK.DoModal(GetID); + if (pDlgOK.SelectedLabel >= 0) + { + Log.Info("Wikipedia: new search from the links array: {0}", pDlgOK.SelectedLabelText); + GetAndDisplayArticle(pDlgOK.SelectedLabelText); + } + } + } + else + { + GUIDialogOK dlg = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK); + dlg.SetHeading(GUILocalizeStrings.Get(257)); // Error + dlg.SetLine(1, GUILocalizeStrings.Get(2506)); // No Links from this article. + dlg.DoModal(GUIWindowManager.ActiveWindow); + } + + } + // The Button containing a list of all images from the article + if (control == buttonImages) + { + if (imagedescArray.Count > 0) + { + // Create a new selection dialog. + GUIDialogMenu pDlgOK = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); + if (pDlgOK != null) + { + pDlgOK.Reset(); + pDlgOK.SetHeading(GUILocalizeStrings.Get(2507)); //Images from this article + + // Add all the images from the imagearray. + foreach (string image in imagedescArray) + { + pDlgOK.Add(image); + } + pDlgOK.DoModal(GetID); + if (pDlgOK.SelectedLabel >= 0) + { + Log.Info("Wikipedia: new search from the image array: {0}", imagedescArray[pDlgOK.SelectedId - 1]); + GetAndDisplayImage(imagenameArray[pDlgOK.SelectedId - 1].ToString(), imagedescArray[pDlgOK.SelectedId - 1].ToString()); + } + } + } + else + { + GUIDialogOK dlg = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK); + dlg.SetHeading(GUILocalizeStrings.Get(257)); // Error + dlg.SetLine(1, GUILocalizeStrings.Get(2508)); // No Images referenced in this article. + dlg.DoModal(GUIWindowManager.ActiveWindow); + } + } + // Back to the text button to switch from image view + if (control == buttonBack) + { + if (!txtArticle.IsVisible) + GUIControl.ShowControl(GetID, txtArticle.GetID); + if (imageControl.IsVisible) + GUIControl.HideControl(GetID, imageControl.GetID); + if (!searchtermLabel.IsVisible) + GUIControl.ShowControl(GetID, searchtermLabel.GetID); + if (imagedescLabel.IsVisible) + GUIControl.HideControl(GetID, imagedescLabel.GetID); + if (buttonBack.IsVisible) + GUIControl.HideControl(GetID, buttonBack.GetID); + } + base.OnClicked(controlId, control, actionType); + } + + // Depending on which Entry was selected from the listbox we chose the language here. + private void SelectLocalWikipedia(int labelnumber, String[] siteArray) + { + MediaPortal.Profile.Settings langreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "wikipedia.xml")); + language = siteArray[labelnumber]; + + if (searchtermLabel.Label != string.Empty && searchtermLabel.Label != "Wikipedia") + { + Log.Info("Wikipedia: language changed to {0}. Display article {1} again.", language, searchtermLabel.Label); + GetAndDisplayArticle(searchtermLabel.Label); + } + } + + private void GetAndDisplayImage(string imagename, string imagedesc) + { + WikipediaImage image = new WikipediaImage(imagename, language); + string imagefilename = image.GetImageFilename(); + Log.Info("Wikipedia: Trying to display image file: {0}", imagefilename); + + if (imagefilename != string.Empty && System.IO.File.Exists(imagefilename)) + { + if (txtArticle.IsVisible) + GUIControl.HideControl(GetID, txtArticle.GetID); + if (!imageControl.IsVisible) + GUIControl.ShowControl(GetID, imageControl.GetID); + if (searchtermLabel.IsVisible) + GUIControl.HideControl(GetID, searchtermLabel.GetID); + if (!imagedescLabel.IsVisible) + GUIControl.ShowControl(GetID, imagedescLabel.GetID); + if (!buttonBack.IsVisible) + GUIControl.ShowControl(GetID, buttonBack.GetID); + imagedescLabel.Label = imagedesc; + imageControl.SetFileName(imagefilename); + } + else + { + GUIDialogOK dlg = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK); + dlg.SetHeading(GUILocalizeStrings.Get(257)); // Error + dlg.SetLine(1, GUILocalizeStrings.Get(2512)); // Can't display image. + dlg.SetLine(2, GUILocalizeStrings.Get(2513)); // Please have a look at the logfile. + dlg.DoModal(GUIWindowManager.ActiveWindow); + } + } + + // The main function. + void GetAndDisplayArticle(string searchterm) + { + BackgroundWorker worker = new BackgroundWorker(); + + worker.DoWork += new DoWorkEventHandler(DownloadWorker); + worker.RunWorkerAsync(searchterm); + + while (_workerCompleted == false) + GUIWindowManager.Process(); + } + + // All kind of stuff because of the wait cursor ;-) + void DownloadWorker(object sender, DoWorkEventArgs e) + { + _workerCompleted = false; + + using (WaitCursor cursor = new WaitCursor()) + lock (this) + { + if (!txtArticle.IsVisible) + GUIControl.ShowControl(GetID, txtArticle.GetID); + if (imageControl.IsVisible) + GUIControl.HideControl(GetID, imageControl.GetID); + if (!searchtermLabel.IsVisible) + GUIControl.ShowControl(GetID, searchtermLabel.GetID); + if (imagedescLabel.IsVisible) + GUIControl.HideControl(GetID, imagedescLabel.GetID); + if (buttonBack.IsVisible) + GUIControl.HideControl(GetID, buttonBack.GetID); + linkArray.Clear(); + imagenameArray.Clear(); + imagedescArray.Clear(); + searchtermLabel.Label = e.Argument.ToString(); + WikipediaArticle article = new WikipediaArticle(e.Argument.ToString(), language); + articletext = article.GetArticleText(); + linkArray = article.GetLinkArray(); + imagenameArray = article.GetImageArray(); + imagedescArray = article.GetImagedescArray(); + language = article.GetLanguage(); + + if (articletext == "REDIRECT") + txtArticle.Label = GUILocalizeStrings.Get(2509) + "\n" + GUILocalizeStrings.Get(2510); //This page is only a redirect. Please chose the redirect aim from the link list. + else if (articletext == string.Empty) + txtArticle.Label = GUILocalizeStrings.Get(2504); //Sorry, no Article was found for your searchterm... + else + txtArticle.Label = articletext; + } + + _workerCompleted = true; + } + + volatile bool _workerCompleted = true; + } +} \ No newline at end of file Added: trunk/plugins/Documentation.csproj =================================================================== --- trunk/plugins/Documentation.csproj (rev 0) +++ trunk/plugins/Documentation.csproj 2007-03-27 09:05:32 UTC (rev 230) @@ -0,0 +1,52 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>8.0.50727</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{B3A735EA-AE81-430A-AB33-214D11F5BE6E}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>Documentation</RootNamespace> + <AssemblyName>Documentation</AssemblyName> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="Core, Version=1.0.2588.17924, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>D:\Apps\Desktop\MediaPortal\Core.DLL</HintPath> + </Reference> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Class1.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/DocumentationImage.cs =================================================================== --- trunk/plugins/DocumentationImage.cs (rev 0) +++ trunk/plugins/DocumentationImage.cs 2007-03-27 09:05:32 UTC (rev 230) @@ -0,0 +1,196 @@ +#region Copyright (C) 2005-2007 Team MediaPortal + +/* + * Copyright (C) 2005-2007 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.ComponentModel; +using System.Windows.Forms; +using System.Net; +using System.IO; +using System.Text; +using System.Threading; +using System.Collections; +using MediaPortal.GUI.Library; +using MediaPortal.Util; +using MediaPortal.Configuration; + +namespace Wikipedia +{ + /// <summary> + /// This class holds all the logic to get an image from Wikipedia for further using in MP. + /// </summary> + public class WikipediaImage + { + #region vars + private string WikipediaURL = "http://en.wikipedia.org/wiki/Special:Export/"; + private string imagename = string.Empty; + private string imagedesc = string.Empty; + private string imageurl = string.Empty; + private string imagelocal = string.Empty; + + #endregion + + #region constructors + /// <summary>This constructor creates a new WikipediaImage</summary> + /// <summary>The name of the image and language need to be given</summary> + /// <param name="imagename">The internal name of the image like "Bild_478.jpg" in "http://de.wikipedia.org/wiki/Bild:Bild_478.jpg"</param> + /// <param name="language">Language of the Wikipedia page</param> + public WikipediaImage(string imagename, string language) + { + SetLanguage(language); + this.imagename = imagename; + GetImageUrl(); + GetImageFile(); + } + + /// <summary>This constructor creates a new WikipediaArticle.</summary> + /// <summary>Only called with a title string, language set to default.</summary> + /// <param name="title">The article's title</param> + public WikipediaImage(string imagename) + : this(imagename, "Default") + { + } + + /// <summary>This constructor creates a new WikipediaArticle if no parameter is given.</summary> + /// <summary>Uses an empty searchterm and the default language.</summary> + public WikipediaImage() + : this(string.Empty, "Default") + { + } + #endregion + + #region class methods + /// <summary>Gets the current MP language from mediaportal.xml and sets the Wikipedia URL accordingly</summary> + private void SetLanguage(string language) + { + if (language == "Default") + { + MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")); + language = xmlreader.GetValueAsString("skin", "language", "English"); + } + + MediaPortal.Profile.Settings detailxmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "wikipedia.xml")); + this.WikipediaURL = detailxmlreader.GetValueAsString(language, "imageurl", "http://en.wikipedia.org/wiki/Image:"); + Log.Info("Wikipedia: Image language set to " + language + "."); + } + + /// <summary>Get the local filename of the downloaded image.</summary> + /// <returns>String: filename of the downloaded image.</returns> + public string GetImageFilename() + { + string imagelocal = Config.GetFile(Config.Dir.Thumbs, @"wikipedia\" + imagename); + return imagelocal; + } + + /// <summary>Getting the link to the full-size image.</summary> + /// <returns>String: parsed article</returns> + private void GetImageUrl() + { + string imagepage = string.Empty; + + // Build the URL to the Image page + System.Uri url = new System.Uri(WikipediaURL + this.imagename); + Log.Info("Wikipedia: Trying to get following Image page: {0}", url.ToString()); + + // Here we get the content from the web and put it to a string + try + { + WebClient client = new WebClient(); + client.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)"); + Stream data = client.OpenRead(url); + StreamReader reader = new StreamReader(data); + imagepage = reader.ReadToEnd(); + reader.Close(); + Log.Info("Wikipedia: Success! Downloaded all data from the image page."); + } + catch (Exception e) + { + Log.Info("Wikipedia: Exception during downloading image page:"); + Log.Info(e.ToString()); + } + + //We're searching for something like this: + //<div class="fullImageLink" id="file"><a href="http://upload.wikimedia.org/wikipedia/commons/7/7d/Bild_478.jpg"> + if (imagepage.IndexOf("class=\"fullImageLink\"") >= 0) + { + Log.Info("Wikipedia: Extracting link to full-size image."); + int iStart = imagepage.IndexOf("class=\"fullImageLink\""); + imagepage = imagepage.Substring(iStart, 1000); + + iStart = imagepage.IndexOf("href") + 6; + int iEnd = imagepage.IndexOf("\"", iStart); + + this.imageurl = imagepage.Substring(iStart, iEnd - iStart); + Log.Info("Wikipedia: URL of full-size image extracted."); + Log.Info(imageurl); + } + else + this.imageurl = string.Empty; + } + + /// <summary>Downloads the full-size image from the wikipedia page</summary> + private void GetImageFile() + { + if (imageurl != "") + { + //Check if we already have the file. + string thumbspath = Config.GetSubFolder(Config.Dir.Thumbs, @"wikipedia\"); + + //Create the wikipedia subdir in thumbs when it not exists. + if (!System.IO.Directory.Exists(thumbspath)) + System.IO.Directory.CreateDirectory(thumbspath); + + if (!System.IO.File.Exists(thumbspath + imagename)) + { + + Log.Info("Wikipedia: Trying to get following URL: {0}", imageurl); + // Here we get the image from the web and save it to disk + try + { + WebClient client = new WebClient(); + client.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)"); + client.DownloadFile(imageurl, thumbspath + imagename); + Log.Info("Wikipedia: Success! Image downloaded."); + } + catch (Exception e) + { + Log.Info("Wikipedia: Exception during downloading:"); + Log.Info(e.ToString()); + } + } + else + { + Log.Info("Wikipedia: Image exists, no need to redownload!"); + } + } + else + { + Log.Info("Wikipedia: No imageurl. Can't download file."); + } + } + + #endregion + } + +} \ No newline at end of file Added: trunk/plugins/DocumentationPage.cs =================================================================== --- trunk/plugins/DocumentationPage.cs (rev 0) +++ trunk/plugins/DocumentationPage.cs 2007-03-27 09:05:32 UTC (rev 230) @@ -0,0 +1,553 @@ +#region Copyright (C) 2005-2007 Team MediaPortal + +/* + * Copyright (C) 2005-2007 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.ComponentModel; +using System.Windows.Forms; +using System.Net; +using System.IO; +using System.Text; +using System.Threading; +using System.Collections; +using MediaPortal.GUI.Library; +using MediaPortal.Util; +using MediaPortal.Configuration; + +namespace Wikipedia +{ + /// <summary> + /// This class holds all the logic to get info from Wikipedia and parse it for further using in MP. + /// </summary> + public class WikipediaArticle + { + #region vars + private string WikipediaURL = "http://en.wikipedia.org/wiki/Special:Export/"; + private string imagePattern = "Image"; + private string title = string.Empty; + private string unparsedArticle = string.Empty; + private string parsedArticle = string.Empty; + private string language = "Default"; + private ArrayList linkArray = new ArrayList(); + private ArrayList imageArray = new ArrayList(); + private ArrayList imagedescArray = new ArrayList(); + #endregion + + #region constructors + /// <summary>This constructor creates a new WikipediaArticle</summary> + /// <summary>Searchterm and language need to be given</summary> + /// <param name="title">The article's title</param> + /// <param name="language">Language of the Wikipedia page</param> + public WikipediaArticle(string title, string language) + { + SetLanguage(language); + this.title = title; + GetWikipediaXML(); + ParseWikipediaArticle(); + ParseLinksAndImages(); + } + + /// <summary>This constructor creates a new WikipediaArticle.</summary> + /// <summary>Only called with a title string, language set to default.</summary> + /// <param name="title">The article's title</param> + public WikipediaArticle(string title) + : this(title, "Default") + { + } + + /// <summary>This constructor creates a new WikipediaArticle if no parameter is given.</summary> + /// <summary>Uses an empty searchterm and the default language.</summary> + public WikipediaArticle() + : this(string.Empty, "Default") + { + } + #endregion + + /// <summary>Gets the current MP language from mediaportal.xml and sets the Wikipedia URL accordingly</summary> + private void SetLanguage(string language) + { + if (language == "Default") + { + MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")); + language = xmlreader.GetValueAsString("skin", "language", "English"); + } + + this.language = language; + + MediaPortal.Profile.Settings detailxmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "wikipedia.xml")); + this.WikipediaURL = detailxmlreader.GetValueAsString(language, "url", "http://en.wikipedia.org/wiki/Special:Export/"); + this.imagePattern = detailxmlreader.GetValueAsString(language, "imagepattern", "Image"); + Log.Info("Wikipedia: Language set to " + language + "."); + } + + /// <summary>Returns the parsed article text.</summary> + /// <returns>String: parsed article</returns> + public string GetArticleText() + { + return parsedArticle; + } + + /// <summary>Returns the title of the article. Can differ from the passed parameter on redirects for example.</summary> + /// <returns>String: title of the article</returns> + public string GetTitle() + { + return title; + } + + /// <summary>Returns all names of images.</summary> + /// <returns>StringArray: images used in this article</returns> + public ArrayList GetImageArray() + { + return imageArray; + } + + /// <summary>Returns all descriptions of images.</summary> + /// <returns>StringArray: images used in this article</returns> + public ArrayList GetImagedescArray() + { + return imagedescArray; + } + + /// <summary>Returns the titles of all linked articles.</summary> + /// <returns>StringArray: titles of linked (internal) Wikipedia articles</returns> + public ArrayList GetLinkArray() + { + return linkArray; + } + + /// <summary>Returns the currently active language.</summary> + /// <returns>String: language</returns> + public string GetLanguage() + { + return language; + } + + /// <summary>Downloads the xml content from Wikipedia and cuts metadata like version info.</summary> + private void GetWikipediaXML() + { + string wikipediaXML = string.Empty; + // Build the URL to the Wikipedia page + System.Uri url = new System.Uri(WikipediaURL + this.title); + Log.Info("Wikipedia: Trying to get following URL: {0}", url.ToString()); + + // Here we get the content from the web and put it to a string + try + { + WebClient client = new WebClient(); + client.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)"); + Stream data = client.OpenRead(url); + StreamReader reader = new StreamReader(data); + wikipediaXML = reader.ReadToEnd(); + reader.Close(); + Log.Info("Wikipedia: Success! Downloaded all data."); + } + catch (Exception e) + { + Log.Info("Wikipedia: Exception during downloading:"); + Log.Info(e.ToString()); + } + + if (wikipediaXML.IndexOf("<text xml:space=\"preserve\">") > 0) + { + Log.Info("Wikipedia: Extracting unparsed string."); + int iStart = 0; + int iEnd = wikipediaXML.Length; + // Start of the Entry + iStart = wikipediaXML.IndexOf("<text xml:space=\"preserve\">") + 27; + // End of the Entry + iEnd = wikipediaXML.IndexOf("</text>"); + // Extract the Text and update the var + this.unparsedArticle = wikipediaXML.Substring(iStart, iEnd - iStart); + Log.Info("Wikipedia: Unparsed string extracted."); + } + else + this.unparsedArticle = string.Empty; + } + + /// <summary>Cuts all special wiki syntax from the article to display plain text</summary> + private void ParseWikipediaArticle() + { + string tempParsedArticle = this.unparsedArticle; + + // Check if the article is empty, if so do not parse. + if (tempParsedArticle == string.Empty) + { + Log.Info("Wikipedia: Empty article found. Try another Searchterm."); + this.unparsedArticle = string.Empty; + } + // Here we check if there is only a redirect as article to handle it as a special article type + else if (tempParsedArticle.IndexOf("#REDIRECT") == 0) + { + Log.Info("Wikipedia: #REDIRECT found."); + int iStart = tempParsedArticle.IndexOf("[[") + 2; + int iEnd = tempParsedArticle.IndexOf("]]", iStart); + // Extract the Text + string keyword = tempParsedArticle.Substring(iStart, iEnd - iStart); + this.unparsedArticle = string.Empty; + this.title = keyword; + GetWikipediaXML(); + ParseWikipediaArticle(); + } + // Finally a well-formed article ;-) + else + { + Log.Info("Wikipedia: Starting parsing."); + StringBuilder builder = new StringBuilder(tempParsedArticle); + int iStart = 0; + int iEnd = 0; + + // Remove HTML comments + Log.Debug("Wikipedia: Remove HTML comments."); + while (tempParsedArticle.IndexOf("<!--") >= 0) + { + builder = new StringBuilder(tempParsedArticle); + iStart = tempParsedArticle.IndexOf("<!--"); + iEnd = tempParsedArticle.IndexOf("-->", iStart) + 6; + + try + { + builder.Remove(iStart, iEnd - iStart); + } + catch (Exception e) + { + Log.Error(e.ToString()); + Log.Error(builder.ToString()); + } + tempParsedArticle = builder.ToString(); + } + + // surrounded by {{ and }} is (atm) unusable stuff. + //Log.Debug("Wikipedia: Remove stuff between {{ and }}."); + while (tempParsedArticle.IndexOf("{{") >= 0) + { + builder = new StringBuilder(tempParsedArticle); + iStart = tempParsedArticle.IndexOf("{{"); + int iStart2 = iStart; + iEnd = tempParsedArticle.IndexOf("}}") + 2; + + // Between {{ and }} we can again have inner sets of {{ and }} + while (tempParsedArticle.IndexOf("{{", iStart2 + 2) >= 0 && tempParsedArticle.IndexOf("{{", iStart2 + 2) < iEnd) + { + iStart2 = tempParsedArticle.IndexOf("{{", iStart2 + 2); + iEnd = tempParsedArticle.IndexOf("}}", iStart2) + 2; + iEnd = tempParsedArticle.IndexOf("}}", iEnd) + 2; + } + + try + { + builder.Remove(iStart, iEnd - iStart); + } + catch (Exception e) + { + Log.Error(e.ToString()); + Log.Error(builder.ToString()); + } + + tempParsedArticle = builder.ToString(); + } + + // surrounded by {| and |} is (atm) unusable stuff. + //Log.Debug("Wikipedia: Remove stuff between {| and |}."); + while (tempParsedArticle.IndexOf("{|") >= 0) + { + builder = new StringBuilder(tempParsedArticle); + iStart = tempParsedArticle.IndexOf("{|"); + iEnd = tempParsedArticle.IndexOf("|}") + 2; + + try + { + builder.Remove(iStart, iEnd - iStart); + } + catch (Exception e) + { + Log.Error(e.ToString()); + Log.Error(builder.ToString()); + } + + tempParsedArticle = builder.ToString(); + } + + // Remove audio links. + Log.Debug("Wikipedia: Remove audio links."); + while (tempParsedArticle.IndexOf("<span") >= 0) + { + builder = new StringBuilder(tempParsedArticle); + iStart = tempParsedArticle.IndexOf("<span"); + iEnd = tempParsedArticle.IndexOf("</span>") + 13; + + try + { + builder.Remove(iStart, iEnd - iStart); + } + catch (Exception e) + { + Log.Error(e.ToString()); + Log.Error(builder.ToString()); + } + + tempParsedArticle = builder.ToString(); + } + + // Remove web references. + Log.Debug("Wikipedia: Remove web references."); + while (tempParsedArticle.IndexOf("<ref>") >= 0) + { + builder = new StringBuilder(tempParsedArticle); + iStart = tempParsedArticle.IndexOf("<ref"); + iEnd = tempParsedArticle.IndexOf("</ref>") + 12; + + try + { + builder.Remove(iStart, iEnd - iStart); + } + catch (Exception e) + { + Log.Error(e.ToString()); + Log.Error(builder.ToString()); + } + + tempParsedArticle = builder.ToString(); + } + + // Remove <br /> + Log.Debug("Wikipedia: Remove <br />."); + builder.Replace("<br />", "\n"); + builder.Replace("<br style="clear:both"/>", "\n"); + builder.Replace("<br style="clear:left"/>", "\n"); + builder.Replace("<br style="clear:right"/>", "\n"); + + // Remove <sup> + Log.Debug("Wikipedia: Remove <sup>."); + builder.Replace("<sup>", "^"); + builder.Replace("</sup>", ""); + + // surrounded by ''' and ''' is bold text, atm also unusable. + Log.Debug("Wikipedia: Remove \'\'\'."); + builder.Replace("'''", ""); + + // surrounded by '' and '' is italic text, atm also unusable. + Log.Debug("Wikipedia: Remove \'\'."); + builder.Replace("''", ""); + + // Display === as newlines (meaning new line for every ===). + Log.Debug("Wikipedia: Display === as 1 newlines."); + builder.Replace("===", "\n"); + + // Display == as newlines (meaning new line for every ==). + Log.Debug("Wikipedia: Display == as 1 newline."); + builder.Replace("==", "\n"); + + // Display * as list (meaning new line for every *). + Log.Debug("Wikipedia: Display * as list."); + builder.Replace("*", "\n +"); + + // Remove HTML whitespace. + Log.Debug("Wikipedia: Remove HTML whitespace."); + builder.Replace(" ", " "); + + // Display " as ". + Log.Debug("Wikipedia: Remove Quotations."); + builder.Replace(""", "\""); + + // Display — as -. + Log.Debug("Wikipedia: Remove —."); + builder.Replace("—", "-"); + + // Remove gallery tags. + Log.Debug("Wikipedia: Remove gallery tags."); + builder.Replace("<gallery>", ""); + builder.Replace("</gallery>", ""); + + // Remove gallery tags. + Log.Debug("Wikipedia: Remove &."); + builder.Replace("&", "&"); + + // Remove (too many) newlines + Log.Debug("Wikipedia: Remove (too many) newlines."); + builder.Replace("\n\n\n\n", "\n"); + builder.Replace("\n\n\n", "\n"); + builder.Replace("\n\n", "\n"); + + // Remove (too many) newlines + Log.Debug("Wikipedia: Remove (too many) whitespaces."); + builder.Replace(" ", " "); + builder.Replace(" ", " "); + builder.Replace(" ", " "); + + tempParsedArticle = builder.ToString(); + + // The text shouldn't start with a newline. + if (tempParsedArticle.IndexOf("\n") == 0) + tempParsedArticle.Remove(0, 2); + + // For Debug purposes it is nice to see how the whole article text is parsed until here + //Log.Debug(tempParsedArticle); + + Log.Info("Wikipedia: Finished parsing."); + this.unparsedArticle = tempParsedArticle; + } + } + + /// <summary>Gets Links out of the article. External links are thrown away, links to other wikipedia articles get into the link array, images to the image array</summary> + private void ParseLinksAndImages() + { + Log.Info("Wikipedia: Starting parsing of links and images."); + string tempParsedArticle = this.unparsedArticle; + int iStart = 0, iEnd = 0, iPipe = 0; + + // Surrounded by [[IMAGEPATTERN: and ]] are the links to IMAGES. + // We need to check for the localized image keyword but also for the English as this is commonly used in some local sites. + // Example: [[Bild:H_NeuesRathaus1.jpg|left|thumb|Das [[Neues Rathaus (Hannover)|Neue Rathaus]] mit Maschteich]] + while ((iStart = tempParsedArticle.IndexOf("[[" + imagePattern + ":", iStart)) >= 0 || (iStart = tempParsedArticle.IndexOf("[[Image:")) >= 0) + { + iEnd = tempParsedArticle.IndexOf("]]", (iStart + 2)) + 2; + int disturbingLink = iStart; + + // Descriptions of images can contain links! + // [[Bild:Hannover Merian.png|thumb|[[Matth?us Merian|Merian]]-Kupferstich um 1650, im Vordergrund Windm?hle auf dem [[Lindener Berg]]]] + while (tempParsedArticle.IndexOf("[[", disturbingLink + 2) >= 0 && tempParsedArticle.IndexOf("[[", disturbingLink + 2) < iEnd) + { + disturbingLink = tempParsedArticle.IndexOf("[[", disturbingLink + 2); + iEnd = tempParsedArticle.IndexOf("]]", disturbingLink) + 2; + iEnd = tempParsedArticle.IndexOf("]]", iEnd) + 2; + } + // Extract the Text + string keyword = tempParsedArticle.Substring(iStart, iEnd - iStart); + + //Remove all links from the image description. + while (keyword.IndexOf("[[", 2) >= 0) + { + int iStartlink = keyword.IndexOf("[[", 2); + int iEndlink = keyword.IndexOf("]]", iStartlink) + 2; + // Extract the Text + string linkkeyword = keyword.Substring(iStartlink, iEndlink - iStartlink); + + // Parse Links to other keywords. + // 1st type of keywords is like [[article|displaytext]] + // for the 2nd the article and displayed text are equal [[article]]. + if (linkkeyword.IndexOf("|") > 0) + linkkeyword = linkkeyword.Substring(linkkeyword.IndexOf("|") + 1, linkkeyword.IndexOf("]]") - linkkeyword.IndexOf("|") - 1); + else + linkkeyword = linkkeyword.Substring(linkkeyword.IndexOf("[[") + 2, linkkeyword.IndexOf("]]") - linkkeyword.IndexOf("[[") - 2); + + keyword = keyword.Substring(0, iStartlink) + linkkeyword + keyword.Substring(iEndlink, keyword.Length - iEndlink); + } + + int iStartname = keyword.IndexOf(":") + 1; + int iEndname = keyword.IndexOf("|"); + string imagename = keyword.Substring(iStartname, iEndname - iStartname); + + //Image names must not contain spaces! + imagename = imagename.Replace(" ", "_"); + + int iStartdesc = keyword.LastIndexOf("|") + 1; + int iEnddesc = keyword.LastIndexOf("]]"); + string imagedesc = keyword.Substring(iStartdesc, iEnddesc - iStartdesc); ; + + this.imageArray.Add(imagename); + this.imagedescArray.Add(imagedesc); + Log.Debug("Wikipedia: Image added: {0}, {1}", imagedesc, imagename); + + tempParsedArticle = tempParsedArticle.Substring(0, iStart) + tempParsedArticle.Substring(iEnd, tempParsedArticle.Length - iEnd); + } + + // surrounded by [[ and ]] are the links to other articles. + Log.Debug("Wikipedia: Starting Link parsing."); + string parsedKeyword, parsedLink; + iStart = iEnd = 0; + try + { + while ((iStart = tempParsedArticle.IndexOf("[[", iStart)) >= 0) + { + iEnd = tempParsedArticle.IndexOf("]]") + 2; + // Extract the Text + string keyword = tempParsedArticle.Substring(iStart, iEnd - iStart); + + // Parse Links to other keywords. + // 1st type of keywords is like [[article|displaytext]] + if ((iPipe = keyword.IndexOf("|")) > 0) + { + parsedKeyword = keyword.Substring(iPipe + 1, keyword.Length - iPipe - 3); + parsedLink = keyword.Substring(2, iPipe - 2); + if (!this.linkArray.Contains(parsedLink)) + { + this.linkArray.Add(parsedLink); + //Log.Debug("Wikipedia: Link added: {0}, {1}", parsedLink, parsedKeyword); + } + } + else if (keyword.IndexOf(":") > 0) + { + // for the 2nd a ":" is a link to the article in another language. + // TODO Add links to other languages!!! + parsedKeyword = String.Empty; + } + else + { + // for the 3rd the article and displayed text are equal [[article]]. + parsedKeyword = keyword.Substring(2, keyword.Length - 4); + if (!this.linkArray.Contains(parsedKeyword)) + { + this.linkArray.Add(parsedKeyword); + //Log.Debug("Wikipedia: Link added: {0}", parsedKeyword); + } + } + + StringBuilder builder = new StringBuilder(tempParsedArticle); + builder.Remove(iStart, iEnd - iStart); + builder.Insert(iStart, parsedKeyword); + tempParsedArticle = builder.ToString(); + } + } + catch (Exception e) + { + Log.Error("Wikipedia: {0}", e.ToString()); + Log.Error("Wikipedia: tempArticle: {0}", tempParsedArticle); + } + Log.Debug("Wikipedia: Finished Link parsing: {0} Links added.", linkArray.Count); + + // surrounded by [ and ] are external Links. Need to be removed. + Log.Debug("Wikipedia: Removing external links"); + iStart = -1; + try + { + while ((iStart = tempParsedArticle.IndexOf("[")) >= 0) + { + iEnd = tempParsedArticle.IndexOf("]") + 1; + + StringBuilder builder = new StringBuilder(tempParsedArticle); + builder.Remove(iStart, iEnd - iStart); + tempParsedArticle = builder.ToString(); + } + } + catch (Exception e) + { + Log.Error("Wikipedia: {0}", e.ToString()); + Log.Error("Parsing Error: " + tempParsedArticle + "\nSTART: " + iStart + "\nEND: " + iEnd); + } + + Log.Info("Wikipedia: Finished parsing of links and images."); + this.parsedArticle = tempParsedArticle; + } + } +} \ 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: <pb...@us...> - 2007-03-27 09:06:40
|
Revision: 231 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=231&view=rev Author: pbb72 Date: 2007-03-27 02:06:39 -0700 (Tue, 27 Mar 2007) Log Message: ----------- Sorry, meant to put them in subfolder... Removed Paths: ------------- trunk/plugins/Documentation.cs trunk/plugins/Documentation.csproj trunk/plugins/DocumentationImage.cs trunk/plugins/DocumentationPage.cs Deleted: trunk/plugins/Documentation.cs =================================================================== --- trunk/plugins/Documentation.cs 2007-03-27 09:05:32 UTC (rev 230) +++ trunk/plugins/Documentation.cs 2007-03-27 09:06:39 UTC (rev 231) @@ -1,407 +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.ComponentModel; -using System.Windows.Forms; -using System.Net; -using System.IO; -using System.Text; -using System.Threading; -using System.Collections; -using MediaPortal.GUI.Library; -using MediaPortal.Dialogs; -using MediaPortal.Util; -using MediaPortal.Configuration; - -namespace Wikipedia -{ - /// <summary> - /// Windowplugin to search in Wikipedia and display articles using the MP Wikipedia Classes. - /// </summary> - public class GUIWikipedia : GUIWindow, ISetupForm - { - #region SkinControls - [SkinControlAttribute(10)] - protected GUIButtonControl buttonSearch = null; - [SkinControlAttribute(11)] - protected GUIButtonControl buttonLocal = null; - [SkinControlAttribute(14)] - protected GUIButtonControl buttonBack = null; - [SkinControlAttribute(12)] - protected GUIButtonControl buttonLinks = null; - [SkinControlAttribute(13)] - protected GUIButtonControl buttonImages = null; - - [SkinControlAttribute(4)] - protected GUILabelControl searchtermLabel = null; - [SkinControlAttribute(5)] - protected GUILabelControl imagedescLabel = null; - [SkinControlAttribute(20)] - protected GUITextControl txtArticle = null; - - [SkinControlAttribute(25)] - protected GUIImage imageControl = null; - #endregion - - private string language = "Default"; - private string articletext = string.Empty; - private ArrayList linkArray = new ArrayList(); - private ArrayList imagenameArray = new ArrayList(); - private ArrayList imagedescArray = new ArrayList(); - - - public GUIWikipedia() - { - GetID = (int)GUIWindow.Window.WINDOW_WIKIPEDIA; - } - #region ISetupForm Members - - // Returns the name of the plugin which is shown in the plugin menu - public string PluginName() - { - return "Wikipedia"; - } - - // Returns the description of the plugin is shown in the plugin menu - public string Description() - { - return "A Plugin to search in Wikipedia"; - } - - // Returns the author of the plugin which is shown in the plugin menu - public string Author() - { - return "Maschine"; - } - - // show the setup dialog - public void ShowPlugin() - { - MessageBox.Show("Edit the wikipedia.xml file in MP's root directory to add new sites."); - } - - // Indicates whether plugin can be enabled/disabled - public bool CanEnable() - { - return true; - } - - // get ID of windowplugin belonging to this setup - public int GetWindowId() - { - return 4711; - } - - // Indicates if plugin is enabled by default; - public bool DefaultEnabled() - { - return false; - } - - // indicates if a plugin has its own setup screen - public bool HasSetup() - { - return false; - } - - /// <summary> - /// If the plugin should have its own button on the main menu of Media Portal then it - /// should return true to this method, otherwise if it should not be on home - /// it should return false - /// </summary> - /// <param name="strButtonText">text the button should have</param> - /// <param name="strButtonImage">image for the button, or empty for default</param> - /// <param name="strButtonImageFocus">image for the button, or empty for default</param> - /// <param name="strPictureImage">subpicture for the button or empty for none</param> - /// <returns>true : plugin needs its own button on home - /// false : plugin does not need its own button on home</returns> - public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) - { - strButtonText = GUILocalizeStrings.Get(2516); - strButtonImage = ""; - strButtonImageFocus = ""; - strPictureImage = ""; - return true; - } - #endregion - - public override bool Init() - { - return Load(GUIGraphicsContext.Skin + @"\wikipedia.xml"); - } - - protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType) - { - // we don't want the user to start another search while one is already active - if (_workerCompleted == false) - return; - - // Here we want to open the OSD Keyboard to enter the searchstring - if (control == buttonSearch) - { - // If the search Button was clicked we need to bring up the search keyboard. - VirtualKeyboard keyboard = (VirtualKeyboard)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_VIRTUAL_KEYBOARD); - if (null == keyboard) return; - string searchterm = string.Empty; - keyboard.IsSearchKeyboard = true; - keyboard.Reset(); - keyboard.Text = ""; - keyboard.DoModal(GetID); // show it... - - Log.Info("Wikipedia: OSD keyboard loaded!"); - - // If input is finished, the string is saved to the searchterm var. - if (keyboard.IsConfirmed) - searchterm = keyboard.Text; - - // If there was a string entered try getting the article. - if (searchterm != "") - { - Log.Info("Wikipedia: Searchterm gotten from OSD keyboard: {0}", searchterm); - GetAndDisplayArticle(searchterm); - } - // Else display an error dialog. - else - { - GUIDialogOK dlg = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK); - dlg.SetHeading(GUILocalizeStrings.Get(257)); // Error - dlg.SetLine(1, GUILocalizeStrings.Get(2500)); // No searchterm entered! - dlg.SetLine(2, String.Empty); - dlg.SetLine(3, GUILocalizeStrings.Get(2501)); // Please enter a valid searchterm! - dlg.DoModal(GUIWindowManager.ActiveWindow); - } - } - // This is the control to select the local Wikipedia site. - if (control == buttonLocal) - { - // Create a new selection dialog. - GUIDialogMenu pDlgOK = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); - if (pDlgOK != null) - { - pDlgOK.Reset(); - pDlgOK.SetHeading(GUILocalizeStrings.Get(2502)); //Select your local Wikipedia: - - // Add all the local sites we want to be displayed starting with int 0. - MediaPortal.Profile.Settings langreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "wikipedia.xml")); - String allsites = langreader.GetValueAsString("Allsites", "sitenames", ""); - Log.Info("Wikipedia: available sites: " + allsites); - String[] siteArray = allsites.Split(','); - for (int i = 0; i < siteArray.Length; i++) - { - int stringno = langreader.GetValueAsInt(siteArray[i], "string", 2006); - pDlgOK.Add(GUILocalizeStrings.Get(stringno)); //English, German, French ... - } - - pDlgOK.DoModal(GetID); - if (pDlgOK.SelectedLabel >= 0) - { - SelectLocalWikipedia(pDlgOK.SelectedLabel, siteArray); - } - } - } - // The Button holding the Links to other articles - if (control == buttonLinks) - { - if (linkArray.Count > 0) - { - // Create a new selection dialog. - GUIDialogMenu pDlgOK = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); - if (pDlgOK != null) - { - pDlgOK.Reset(); - pDlgOK.SetHeading(GUILocalizeStrings.Get(2505)); //Links to other articles: - - // Add all the links from the linkarray. - foreach (string link in linkArray) - { - pDlgOK.Add(link); - } - pDlgOK.DoModal(GetID); - if (pDlgOK.SelectedLabel >= 0) - { - Log.Info("Wikipedia: new search from the links array: {0}", pDlgOK.SelectedLabelText); - GetAndDisplayArticle(pDlgOK.SelectedLabelText); - } - } - } - else - { - GUIDialogOK dlg = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK); - dlg.SetHeading(GUILocalizeStrings.Get(257)); // Error - dlg.SetLine(1, GUILocalizeStrings.Get(2506)); // No Links from this article. - dlg.DoModal(GUIWindowManager.ActiveWindow); - } - - } - // The Button containing a list of all images from the article - if (control == buttonImages) - { - if (imagedescArray.Count > 0) - { - // Create a new selection dialog. - GUIDialogMenu pDlgOK = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); - if (pDlgOK != null) - { - pDlgOK.Reset(); - pDlgOK.SetHeading(GUILocalizeStrings.Get(2507)); //Images from this article - - // Add all the images from the imagearray. - foreach (string image in imagedescArray) - { - pDlgOK.Add(image); - } - pDlgOK.DoModal(GetID); - if (pDlgOK.SelectedLabel >= 0) - { - Log.Info("Wikipedia: new search from the image array: {0}", imagedescArray[pDlgOK.SelectedId - 1]); - GetAndDisplayImage(imagenameArray[pDlgOK.SelectedId - 1].ToString(), imagedescArray[pDlgOK.SelectedId - 1].ToString()); - } - } - } - else - { - GUIDialogOK dlg = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK); - dlg.SetHeading(GUILocalizeStrings.Get(257)); // Error - dlg.SetLine(1, GUILocalizeStrings.Get(2508)); // No Images referenced in this article. - dlg.DoModal(GUIWindowManager.ActiveWindow); - } - } - // Back to the text button to switch from image view - if (control == buttonBack) - { - if (!txtArticle.IsVisible) - GUIControl.ShowControl(GetID, txtArticle.GetID); - if (imageControl.IsVisible) - GUIControl.HideControl(GetID, imageControl.GetID); - if (!searchtermLabel.IsVisible) - GUIControl.ShowControl(GetID, searchtermLabel.GetID); - if (imagedescLabel.IsVisible) - GUIControl.HideControl(GetID, imagedescLabel.GetID); - if (buttonBack.IsVisible) - GUIControl.HideControl(GetID, buttonBack.GetID); - } - base.OnClicked(controlId, control, actionType); - } - - // Depending on which Entry was selected from the listbox we chose the language here. - private void SelectLocalWikipedia(int labelnumber, String[] siteArray) - { - MediaPortal.Profile.Settings langreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "wikipedia.xml")); - language = siteArray[labelnumber]; - - if (searchtermLabel.Label != string.Empty && searchtermLabel.Label != "Wikipedia") - { - Log.Info("Wikipedia: language changed to {0}. Display article {1} again.", language, searchtermLabel.Label); - GetAndDisplayArticle(searchtermLabel.Label); - } - } - - private void GetAndDisplayImage(string imagename, string imagedesc) - { - WikipediaImage image = new WikipediaImage(imagename, language); - string imagefilename = image.GetImageFilename(); - Log.Info("Wikipedia: Trying to display image file: {0}", imagefilename); - - if (imagefilename != string.Empty && System.IO.File.Exists(imagefilename)) - { - if (txtArticle.IsVisible) - GUIControl.HideControl(GetID, txtArticle.GetID); - if (!imageControl.IsVisible) - GUIControl.ShowControl(GetID, imageControl.GetID); - if (searchtermLabel.IsVisible) - GUIControl.HideControl(GetID, searchtermLabel.GetID); - if (!imagedescLabel.IsVisible) - GUIControl.ShowControl(GetID, imagedescLabel.GetID); - if (!buttonBack.IsVisible) - GUIControl.ShowControl(GetID, buttonBack.GetID); - imagedescLabel.Label = imagedesc; - imageControl.SetFileName(imagefilename); - } - else - { - GUIDialogOK dlg = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK); - dlg.SetHeading(GUILocalizeStrings.Get(257)); // Error - dlg.SetLine(1, GUILocalizeStrings.Get(2512)); // Can't display image. - dlg.SetLine(2, GUILocalizeStrings.Get(2513)); // Please have a look at the logfile. - dlg.DoModal(GUIWindowManager.ActiveWindow); - } - } - - // The main function. - void GetAndDisplayArticle(string searchterm) - { - BackgroundWorker worker = new BackgroundWorker(); - - worker.DoWork += new DoWorkEventHandler(DownloadWorker); - worker.RunWorkerAsync(searchterm); - - while (_workerCompleted == false) - GUIWindowManager.Process(); - } - - // All kind of stuff because of the wait cursor ;-) - void DownloadWorker(object sender, DoWorkEventArgs e) - { - _workerCompleted = false; - - using (WaitCursor cursor = new WaitCursor()) - lock (this) - { - if (!txtArticle.IsVisible) - GUIControl.ShowControl(GetID, txtArticle.GetID); - if (imageControl.IsVisible) - GUIControl.HideControl(GetID, imageControl.GetID); - if (!searchtermLabel.IsVisible) - GUIControl.ShowControl(GetID, searchtermLabel.GetID); - if (imagedescLabel.IsVisible) - GUIControl.HideControl(GetID, imagedescLabel.GetID); - if (buttonBack.IsVisible) - GUIControl.HideControl(GetID, buttonBack.GetID); - linkArray.Clear(); - imagenameArray.Clear(); - imagedescArray.Clear(); - searchtermLabel.Label = e.Argument.ToString(); - WikipediaArticle article = new WikipediaArticle(e.Argument.ToString(), language); - articletext = article.GetArticleText(); - linkArray = article.GetLinkArray(); - imagenameArray = article.GetImageArray(); - imagedescArray = article.GetImagedescArray(); - language = article.GetLanguage(); - - if (articletext == "REDIRECT") - txtArticle.Label = GUILocalizeStrings.Get(2509) + "\n" + GUILocalizeStrings.Get(2510); //This page is only a redirect. Please chose the redirect aim from the link list. - else if (articletext == string.Empty) - txtArticle.Label = GUILocalizeStrings.Get(2504); //Sorry, no Article was found for your searchterm... - else - txtArticle.Label = articletext; - } - - _workerCompleted = true; - } - - volatile bool _workerCompleted = true; - } -} \ No newline at end of file Deleted: trunk/plugins/Documentation.csproj =================================================================== --- trunk/plugins/Documentation.csproj 2007-03-27 09:05:32 UTC (rev 230) +++ trunk/plugins/Documentation.csproj 2007-03-27 09:06:39 UTC (rev 231) @@ -1,52 +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>{B3A735EA-AE81-430A-AB33-214D11F5BE6E}</ProjectGuid> - <OutputType>Library</OutputType> - <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>Documentation</RootNamespace> - <AssemblyName>Documentation</AssemblyName> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> - <DebugSymbols>true</DebugSymbols> - <DebugType>full</DebugType> - <Optimize>false</Optimize> - <OutputPath>bin\Debug\</OutputPath> - <DefineConstants>DEBUG;TRACE</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <DebugType>pdbonly</DebugType> - <Optimize>true</Optimize> - <OutputPath>bin\Release\</OutputPath> - <DefineConstants>TRACE</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - </PropertyGroup> - <ItemGroup> - <Reference Include="Core, Version=1.0.2588.17924, Culture=neutral, processorArchitecture=MSIL"> - <SpecificVersion>False</SpecificVersion> - <HintPath>D:\Apps\Desktop\MediaPortal\Core.DLL</HintPath> - </Reference> - <Reference Include="System" /> - <Reference Include="System.Data" /> - <Reference Include="System.Windows.Forms" /> - <Reference Include="System.Xml" /> - </ItemGroup> - <ItemGroup> - <Compile Include="Class1.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 Deleted: trunk/plugins/DocumentationImage.cs =================================================================== --- trunk/plugins/DocumentationImage.cs 2007-03-27 09:05:32 UTC (rev 230) +++ trunk/plugins/DocumentationImage.cs 2007-03-27 09:06:39 UTC (rev 231) @@ -1,196 +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.ComponentModel; -using System.Windows.Forms; -using System.Net; -using System.IO; -using System.Text; -using System.Threading; -using System.Collections; -using MediaPortal.GUI.Library; -using MediaPortal.Util; -using MediaPortal.Configuration; - -namespace Wikipedia -{ - /// <summary> - /// This class holds all the logic to get an image from Wikipedia for further using in MP. - /// </summary> - public class WikipediaImage - { - #region vars - private string WikipediaURL = "http://en.wikipedia.org/wiki/Special:Export/"; - private string imagename = string.Empty; - private string imagedesc = string.Empty; - private string imageurl = string.Empty; - private string imagelocal = string.Empty; - - #endregion - - #region constructors - /// <summary>This constructor creates a new WikipediaImage</summary> - /// <summary>The name of the image and language need to be given</summary> - /// <param name="imagename">The internal name of the image like "Bild_478.jpg" in "http://de.wikipedia.org/wiki/Bild:Bild_478.jpg"</param> - /// <param name="language">Language of the Wikipedia page</param> - public WikipediaImage(string imagename, string language) - { - SetLanguage(language); - this.imagename = imagename; - GetImageUrl(); - GetImageFile(); - } - - /// <summary>This constructor creates a new WikipediaArticle.</summary> - /// <summary>Only called with a title string, language set to default.</summary> - /// <param name="title">The article's title</param> - public WikipediaImage(string imagename) - : this(imagename, "Default") - { - } - - /// <summary>This constructor creates a new WikipediaArticle if no parameter is given.</summary> - /// <summary>Uses an empty searchterm and the default language.</summary> - public WikipediaImage() - : this(string.Empty, "Default") - { - } - #endregion - - #region class methods - /// <summary>Gets the current MP language from mediaportal.xml and sets the Wikipedia URL accordingly</summary> - private void SetLanguage(string language) - { - if (language == "Default") - { - MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")); - language = xmlreader.GetValueAsString("skin", "language", "English"); - } - - MediaPortal.Profile.Settings detailxmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "wikipedia.xml")); - this.WikipediaURL = detailxmlreader.GetValueAsString(language, "imageurl", "http://en.wikipedia.org/wiki/Image:"); - Log.Info("Wikipedia: Image language set to " + language + "."); - } - - /// <summary>Get the local filename of the downloaded image.</summary> - /// <returns>String: filename of the downloaded image.</returns> - public string GetImageFilename() - { - string imagelocal = Config.GetFile(Config.Dir.Thumbs, @"wikipedia\" + imagename); - return imagelocal; - } - - /// <summary>Getting the link to the full-size image.</summary> - /// <returns>String: parsed article</returns> - private void GetImageUrl() - { - string imagepage = string.Empty; - - // Build the URL to the Image page - System.Uri url = new System.Uri(WikipediaURL + this.imagename); - Log.Info("Wikipedia: Trying to get following Image page: {0}", url.ToString()); - - // Here we get the content from the web and put it to a string - try - { - WebClient client = new WebClient(); - client.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)"); - Stream data = client.OpenRead(url); - StreamReader reader = new StreamReader(data); - imagepage = reader.ReadToEnd(); - reader.Close(); - Log.Info("Wikipedia: Success! Downloaded all data from the image page."); - } - catch (Exception e) - { - Log.Info("Wikipedia: Exception during downloading image page:"); - Log.Info(e.ToString()); - } - - //We're searching for something like this: - //<div class="fullImageLink" id="file"><a href="http://upload.wikimedia.org/wikipedia/commons/7/7d/Bild_478.jpg"> - if (imagepage.IndexOf("class=\"fullImageLink\"") >= 0) - { - Log.Info("Wikipedia: Extracting link to full-size image."); - int iStart = imagepage.IndexOf("class=\"fullImageLink\""); - imagepage = imagepage.Substring(iStart, 1000); - - iStart = imagepage.IndexOf("href") + 6; - int iEnd = imagepage.IndexOf("\"", iStart); - - this.imageurl = imagepage.Substring(iStart, iEnd - iStart); - Log.Info("Wikipedia: URL of full-size image extracted."); - Log.Info(imageurl); - } - else - this.imageurl = string.Empty; - } - - /// <summary>Downloads the full-size image from the wikipedia page</summary> - private void GetImageFile() - { - if (imageurl != "") - { - //Check if we already have the file. - string thumbspath = Config.GetSubFolder(Config.Dir.Thumbs, @"wikipedia\"); - - //Create the wikipedia subdir in thumbs when it not exists. - if (!System.IO.Directory.Exists(thumbspath)) - System.IO.Directory.CreateDirectory(thumbspath); - - if (!System.IO.File.Exists(thumbspath + imagename)) - { - - Log.Info("Wikipedia: Trying to get following URL: {0}", imageurl); - // Here we get the image from the web and save it to disk - try - { - WebClient client = new WebClient(); - client.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)"); - client.DownloadFile(imageurl, thumbspath + imagename); - Log.Info("Wikipedia: Success! Image downloaded."); - } - catch (Exception e) - { - Log.Info("Wikipedia: Exception during downloading:"); - Log.Info(e.ToString()); - } - } - else - { - Log.Info("Wikipedia: Image exists, no need to redownload!"); - } - } - else - { - Log.Info("Wikipedia: No imageurl. Can't download file."); - } - } - - #endregion - } - -} \ No newline at end of file Deleted: trunk/plugins/DocumentationPage.cs =================================================================== --- trunk/plugins/DocumentationPage.cs 2007-03-27 09:05:32 UTC (rev 230) +++ trunk/plugins/DocumentationPage.cs 2007-03-27 09:06:39 UTC (rev 231) @@ -1,553 +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.ComponentModel; -using System.Windows.Forms; -using System.Net; -using System.IO; -using System.Text; -using System.Threading; -using System.Collections; -using MediaPortal.GUI.Library; -using MediaPortal.Util; -using MediaPortal.Configuration; - -namespace Wikipedia -{ - /// <summary> - /// This class holds all the logic to get info from Wikipedia and parse it for further using in MP. - /// </summary> - public class WikipediaArticle - { - #region vars - private string WikipediaURL = "http://en.wikipedia.org/wiki/Special:Export/"; - private string imagePattern = "Image"; - private string title = string.Empty; - private string unparsedArticle = string.Empty; - private string parsedArticle = string.Empty; - private string language = "Default"; - private ArrayList linkArray = new ArrayList(); - private ArrayList imageArray = new ArrayList(); - private ArrayList imagedescArray = new ArrayList(); - #endregion - - #region constructors - /// <summary>This constructor creates a new WikipediaArticle</summary> - /// <summary>Searchterm and language need to be given</summary> - /// <param name="title">The article's title</param> - /// <param name="language">Language of the Wikipedia page</param> - public WikipediaArticle(string title, string language) - { - SetLanguage(language); - this.title = title; - GetWikipediaXML(); - ParseWikipediaArticle(); - ParseLinksAndImages(); - } - - /// <summary>This constructor creates a new WikipediaArticle.</summary> - /// <summary>Only called with a title string, language set to default.</summary> - /// <param name="title">The article's title</param> - public WikipediaArticle(string title) - : this(title, "Default") - { - } - - /// <summary>This constructor creates a new WikipediaArticle if no parameter is given.</summary> - /// <summary>Uses an empty searchterm and the default language.</summary> - public WikipediaArticle() - : this(string.Empty, "Default") - { - } - #endregion - - /// <summary>Gets the current MP language from mediaportal.xml and sets the Wikipedia URL accordingly</summary> - private void SetLanguage(string language) - { - if (language == "Default") - { - MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")); - language = xmlreader.GetValueAsString("skin", "language", "English"); - } - - this.language = language; - - MediaPortal.Profile.Settings detailxmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "wikipedia.xml")); - this.WikipediaURL = detailxmlreader.GetValueAsString(language, "url", "http://en.wikipedia.org/wiki/Special:Export/"); - this.imagePattern = detailxmlreader.GetValueAsString(language, "imagepattern", "Image"); - Log.Info("Wikipedia: Language set to " + language + "."); - } - - /// <summary>Returns the parsed article text.</summary> - /// <returns>String: parsed article</returns> - public string GetArticleText() - { - return parsedArticle; - } - - /// <summary>Returns the title of the article. Can differ from the passed parameter on redirects for example.</summary> - /// <returns>String: title of the article</returns> - public string GetTitle() - { - return title; - } - - /// <summary>Returns all names of images.</summary> - /// <returns>StringArray: images used in this article</returns> - public ArrayList GetImageArray() - { - return imageArray; - } - - /// <summary>Returns all descriptions of images.</summary> - /// <returns>StringArray: images used in this article</returns> - public ArrayList GetImagedescArray() - { - return imagedescArray; - } - - /// <summary>Returns the titles of all linked articles.</summary> - /// <returns>StringArray: titles of linked (internal) Wikipedia articles</returns> - public ArrayList GetLinkArray() - { - return linkArray; - } - - /// <summary>Returns the currently active language.</summary> - /// <returns>String: language</returns> - public string GetLanguage() - { - return language; - } - - /// <summary>Downloads the xml content from Wikipedia and cuts metadata like version info.</summary> - private void GetWikipediaXML() - { - string wikipediaXML = string.Empty; - // Build the URL to the Wikipedia page - System.Uri url = new System.Uri(WikipediaURL + this.title); - Log.Info("Wikipedia: Trying to get following URL: {0}", url.ToString()); - - // Here we get the content from the web and put it to a string - try - { - WebClient client = new WebClient(); - client.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)"); - Stream data = client.OpenRead(url); - StreamReader reader = new StreamReader(data); - wikipediaXML = reader.ReadToEnd(); - reader.Close(); - Log.Info("Wikipedia: Success! Downloaded all data."); - } - catch (Exception e) - { - Log.Info("Wikipedia: Exception during downloading:"); - Log.Info(e.ToString()); - } - - if (wikipediaXML.IndexOf("<text xml:space=\"preserve\">") > 0) - { - Log.Info("Wikipedia: Extracting unparsed string."); - int iStart = 0; - int iEnd = wikipediaXML.Length; - // Start of the Entry - iStart = wikipediaXML.IndexOf("<text xml:space=\"preserve\">") + 27; - // End of the Entry - iEnd = wikipediaXML.IndexOf("</text>"); - // Extract the Text and update the var - this.unparsedArticle = wikipediaXML.Substring(iStart, iEnd - iStart); - Log.Info("Wikipedia: Unparsed string extracted."); - } - else - this.unparsedArticle = string.Empty; - } - - /// <summary>Cuts all special wiki syntax from the article to display plain text</summary> - private void ParseWikipediaArticle() - { - string tempParsedArticle = this.unparsedArticle; - - // Check if the article is empty, if so do not parse. - if (tempParsedArticle == string.Empty) - { - Log.Info("Wikipedia: Empty article found. Try another Searchterm."); - this.unparsedArticle = string.Empty; - } - // Here we check if there is only a redirect as article to handle it as a special article type - else if (tempParsedArticle.IndexOf("#REDIRECT") == 0) - { - Log.Info("Wikipedia: #REDIRECT found."); - int iStart = tempParsedArticle.IndexOf("[[") + 2; - int iEnd = tempParsedArticle.IndexOf("]]", iStart); - // Extract the Text - string keyword = tempParsedArticle.Substring(iStart, iEnd - iStart); - this.unparsedArticle = string.Empty; - this.title = keyword; - GetWikipediaXML(); - ParseWikipediaArticle(); - } - // Finally a well-formed article ;-) - else - { - Log.Info("Wikipedia: Starting parsing."); - StringBuilder builder = new StringBuilder(tempParsedArticle); - int iStart = 0; - int iEnd = 0; - - // Remove HTML comments - Log.Debug("Wikipedia: Remove HTML comments."); - while (tempParsedArticle.IndexOf("<!--") >= 0) - { - builder = new StringBuilder(tempParsedArticle); - iStart = tempParsedArticle.IndexOf("<!--"); - iEnd = tempParsedArticle.IndexOf("-->", iStart) + 6; - - try - { - builder.Remove(iStart, iEnd - iStart); - } - catch (Exception e) - { - Log.Error(e.ToString()); - Log.Error(builder.ToString()); - } - tempParsedArticle = builder.ToString(); - } - - // surrounded by {{ and }} is (atm) unusable stuff. - //Log.Debug("Wikipedia: Remove stuff between {{ and }}."); - while (tempParsedArticle.IndexOf("{{") >= 0) - { - builder = new StringBuilder(tempParsedArticle); - iStart = tempParsedArticle.IndexOf("{{"); - int iStart2 = iStart; - iEnd = tempParsedArticle.IndexOf("}}") + 2; - - // Between {{ and }} we can again have inner sets of {{ and }} - while (tempParsedArticle.IndexOf("{{", iStart2 + 2) >= 0 && tempParsedArticle.IndexOf("{{", iStart2 + 2) < iEnd) - { - iStart2 = tempParsedArticle.IndexOf("{{", iStart2 + 2); - iEnd = tempParsedArticle.IndexOf("}}", iStart2) + 2; - iEnd = tempParsedArticle.IndexOf("}}", iEnd) + 2; - } - - try - { - builder.Remove(iStart, iEnd - iStart); - } - catch (Exception e) - { - Log.Error(e.ToString()); - Log.Error(builder.ToString()); - } - - tempParsedArticle = builder.ToString(); - } - - // surrounded by {| and |} is (atm) unusable stuff. - //Log.Debug("Wikipedia: Remove stuff between {| and |}."); - while (tempParsedArticle.IndexOf("{|") >= 0) - { - builder = new StringBuilder(tempParsedArticle); - iStart = tempParsedArticle.IndexOf("{|"); - iEnd = tempParsedArticle.IndexOf("|}") + 2; - - try - { - builder.Remove(iStart, iEnd - iStart); - } - catch (Exception e) - { - Log.Error(e.ToString()); - Log.Error(builder.ToString()); - } - - tempParsedArticle = builder.ToString(); - } - - // Remove audio links. - Log.Debug("Wikipedia: Remove audio links."); - while (tempParsedArticle.IndexOf("<span") >= 0) - { - builder = new StringBuilder(tempParsedArticle); - iStart = tempParsedArticle.IndexOf("<span"); - iEnd = tempParsedArticle.IndexOf("</span>") + 13; - - try - { - builder.Remove(iStart, iEnd - iStart); - } - catch (Exception e) - { - Log.Error(e.ToString()); - Log.Error(builder.ToString()); - } - - tempParsedArticle = builder.ToString(); - } - - // Remove web references. - Log.Debug("Wikipedia: Remove web references."); - while (tempParsedArticle.IndexOf("<ref>") >= 0) - { - builder = new StringBuilder(tempParsedArticle); - iStart = tempParsedArticle.IndexOf("<ref"); - iEnd = tempParsedArticle.IndexOf("</ref>") + 12; - - try - { - builder.Remove(iStart, iEnd - iStart); - } - catch (Exception e) - { - Log.Error(e.ToString()); - Log.Error(builder.ToString()); - } - - tempParsedArticle = builder.ToString(); - } - - // Remove <br /> - Log.Debug("Wikipedia: Remove <br />."); - builder.Replace("<br />", "\n"); - builder.Replace("<br style="clear:both"/>", "\n"); - builder.Replace("<br style="clear:left"/>", "\n"); - builder.Replace("<br style="clear:right"/>", "\n"); - - // Remove <sup> - Log.Debug("Wikipedia: Remove <sup>."); - builder.Replace("<sup>", "^"); - builder.Replace("</sup>", ""); - - // surrounded by ''' and ''' is bold text, atm also unusable. - Log.Debug("Wikipedia: Remove \'\'\'."); - builder.Replace("'''", ""); - - // surrounded by '' and '' is italic text, atm also unusable. - Log.Debug("Wikipedia: Remove \'\'."); - builder.Replace("''", ""); - - // Display === as newlines (meaning new line for every ===). - Log.Debug("Wikipedia: Display === as 1 newlines."); - builder.Replace("===", "\n"); - - // Display == as newlines (meaning new line for every ==). - Log.Debug("Wikipedia: Display == as 1 newline."); - builder.Replace("==", "\n"); - - // Display * as list (meaning new line for every *). - Log.Debug("Wikipedia: Display * as list."); - builder.Replace("*", "\n +"); - - // Remove HTML whitespace. - Log.Debug("Wikipedia: Remove HTML whitespace."); - builder.Replace(" ", " "); - - // Display " as ". - Log.Debug("Wikipedia: Remove Quotations."); - builder.Replace(""", "\""); - - // Display — as -. - Log.Debug("Wikipedia: Remove —."); - builder.Replace("—", "-"); - - // Remove gallery tags. - Log.Debug("Wikipedia: Remove gallery tags."); - builder.Replace("<gallery>", ""); - builder.Replace("</gallery>", ""); - - // Remove gallery tags. - Log.Debug("Wikipedia: Remove &."); - builder.Replace("&", "&"); - - // Remove (too many) newlines - Log.Debug("Wikipedia: Remove (too many) newlines."); - builder.Replace("\n\n\n\n", "\n"); - builder.Replace("\n\n\n", "\n"); - builder.Replace("\n\n", "\n"); - - // Remove (too many) newlines - Log.Debug("Wikipedia: Remove (too many) whitespaces."); - builder.Replace(" ", " "); - builder.Replace(" ", " "); - builder.Replace(" ", " "); - - tempParsedArticle = builder.ToString(); - - // The text shouldn't start with a newline. - if (tempParsedArticle.IndexOf("\n") == 0) - tempParsedArticle.Remove(0, 2); - - // For Debug purposes it is nice to see how the whole article text is parsed until here - //Log.Debug(tempParsedArticle); - - Log.Info("Wikipedia: Finished parsing."); - this.unparsedArticle = tempParsedArticle; - } - } - - /// <summary>Gets Links out of the article. External links are thrown away, links to other wikipedia articles get into the link array, images to the image array</summary> - private void ParseLinksAndImages() - { - Log.Info("Wikipedia: Starting parsing of links and images."); - string tempParsedArticle = this.unparsedArticle; - int iStart = 0, iEnd = 0, iPipe = 0; - - // Surrounded by [[IMAGEPATTERN: and ]] are the links to IMAGES. - // We need to check for the localized image keyword but also for the English as this is commonly used in some local sites. - // Example: [[Bild:H_NeuesRathaus1.jpg|left|thumb|Das [[Neues Rathaus (Hannover)|Neue Rathaus]] mit Maschteich]] - while ((iStart = tempParsedArticle.IndexOf("[[" + imagePattern + ":", iStart)) >= 0 || (iStart = tempParsedArticle.IndexOf("[[Image:")) >= 0) - { - iEnd = tempParsedArticle.IndexOf("]]", (iStart + 2)) + 2; - int disturbingLink = iStart; - - // Descriptions of images can contain links! - // [[Bild:Hannover Merian.png|thumb|[[Matth?us Merian|Merian]]-Kupferstich um 1650, im Vordergrund Windm?hle auf dem [[Lindener Berg]]]] - while (tempParsedArticle.IndexOf("[[", disturbingLink + 2) >= 0 && tempParsedArticle.IndexOf("[[", disturbingLink + 2) < iEnd) - { - disturbingLink = tempParsedArticle.IndexOf("[[", disturbingLink + 2); - iEnd = tempParsedArticle.IndexOf("]]", disturbingLink) + 2; - iEnd = tempParsedArticle.IndexOf("]]", iEnd) + 2; - } - // Extract the Text - string keyword = tempParsedArticle.Substring(iStart, iEnd - iStart); - - //Remove all links from the image description. - while (keyword.IndexOf("[[", 2) >= 0) - { - int iStartlink = keyword.IndexOf("[[", 2); - int iEndlink = keyword.IndexOf("]]", iStartlink) + 2; - // Extract the Text - string linkkeyword = keyword.Substring(iStartlink, iEndlink - iStartlink); - - // Parse Links to other keywords. - // 1st type of keywords is like [[article|displaytext]] - // for the 2nd the article and displayed text are equal [[article]]. - if (linkkeyword.IndexOf("|") > 0) - linkkeyword = linkkeyword.Substring(linkkeyword.IndexOf("|") + 1, linkkeyword.IndexOf("]]") - linkkeyword.IndexOf("|") - 1); - else - linkkeyword = linkkeyword.Substring(linkkeyword.IndexOf("[[") + 2, linkkeyword.IndexOf("]]") - linkkeyword.IndexOf("[[") - 2); - - keyword = keyword.Substring(0, iStartlink) + linkkeyword + keyword.Substring(iEndlink, keyword.Length - iEndlink); - } - - int iStartname = keyword.IndexOf(":") + 1; - int iEndname = keyword.IndexOf("|"); - string imagename = keyword.Substring(iStartname, iEndname - iStartname); - - //Image names must not contain spaces! - imagename = imagename.Replace(" ", "_"); - - int iStartdesc = keyword.LastIndexOf("|") + 1; - int iEnddesc = keyword.LastIndexOf("]]"); - string imagedesc = keyword.Substring(iStartdesc, iEnddesc - iStartdesc); ; - - this.imageArray.Add(imagename); - this.imagedescArray.Add(imagedesc); - Log.Debug("Wikipedia: Image added: {0}, {1}", imagedesc, imagename); - - tempParsedArticle = tempParsedArticle.Substring(0, iStart) + tempParsedArticle.Substring(iEnd, tempParsedArticle.Length - iEnd); - } - - // surrounded by [[ and ]] are the links to other articles. - Log.Debug("Wikipedia: Starting Link parsing."); - string parsedKeyword, parsedLink; - iStart = iEnd = 0; - try - { - while ((iStart = tempParsedArticle.IndexOf("[[", iStart)) >= 0) - { - iEnd = tempParsedArticle.IndexOf("]]") + 2; - // Extract the Text - string keyword = tempParsedArticle.Substring(iStart, iEnd - iStart); - - // Parse Links to other keywords. - // 1st type of keywords is like [[article|displaytext]] - if ((iPipe = keyword.IndexOf("|")) > 0) - { - parsedKeyword = keyword.Substring(iPipe + 1, keyword.Length - iPipe - 3); - parsedLink = keyword.Substring(2, iPipe - 2); - if (!this.linkArray.Contains(parsedLink)) - { - this.linkArray.Add(parsedLink); - //Log.Debug("Wikipedia: Link added: {0}, {1}", parsedLink, parsedKeyword); - } - } - else if (keyword.IndexOf(":") > 0) - { - // for the 2nd a ":" is a link to the article in another language. - // TODO Add links to other languages!!! - parsedKeyword = String.Empty; - } - else - { - // for the 3rd the article and displayed text are equal [[article]]. - parsedKeyword = keyword.Substring(2, keyword.Length - 4); - if (!this.linkArray.Contains(parsedKeyword)) - { - this.linkArray.Add(parsedKeyword); - //Log.Debug("Wikipedia: Link added: {0}", parsedKeyword); - } - } - - StringBuilder builder = new StringBuilder(tempParsedArticle); - builder.Remove(iStart, iEnd - iStart); - builder.Insert(iStart, parsedKeyword); - tempParsedArticle = builder.ToString(); - } - } - catch (Exception e) - { - Log.Error("Wikipedia: {0}", e.ToString()); - Log.Error("Wikipedia: tempArticle: {0}", tempParsedArticle); - } - Log.Debug("Wikipedia: Finished Link parsing: {0} Links added.", linkArray.Count); - - // surrounded by [ and ] are external Links. Need to be removed. - Log.Debug("Wikipedia: Removing external links"); - iStart = -1; - try - { - while ((iStart = tempParsedArticle.IndexOf("[")) >= 0) - { - iEnd = tempParsedArticle.IndexOf("]") + 1; - - StringBuilder builder = new StringBuilder(tempParsedArticle); - builder.Remove(iStart, iEnd - iStart); - tempParsedArticle = builder.ToString(); - } - } - catch (Exception e) - { - Log.Error("Wikipedia: {0}", e.ToString()); - Log.Error("Parsing Error: " + tempParsedArticle + "\nSTART: " + iStart + "\nEND: " + iEnd); - } - - Log.Info("Wikipedia: Finished parsing of links and images."); - this.parsedArticle = tempParsedArticle; - } - } -} \ 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: <pb...@us...> - 2007-03-27 09:07:34
|
Revision: 232 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=232&view=rev Author: pbb72 Date: 2007-03-27 02:07:31 -0700 (Tue, 27 Mar 2007) Log Message: ----------- Documentation plugin to browse MP wiki from within MediaPortal. Based on Wikipedia plugin. Added Paths: ----------- trunk/plugins/Documentation plugin/ trunk/plugins/Documentation plugin/Documentation.cs trunk/plugins/Documentation plugin/Documentation.csproj trunk/plugins/Documentation plugin/DocumentationImage.cs trunk/plugins/Documentation plugin/DocumentationPage.cs Added: trunk/plugins/Documentation plugin/Documentation.cs =================================================================== --- trunk/plugins/Documentation plugin/Documentation.cs (rev 0) +++ trunk/plugins/Documentation plugin/Documentation.cs 2007-03-27 09:07:31 UTC (rev 232) @@ -0,0 +1,407 @@ +#region Copyright (C) 2005-2007 Team MediaPortal + +/* + * Copyright (C) 2005-2007 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.ComponentModel; +using System.Windows.Forms; +using System.Net; +using System.IO; +using System.Text; +using System.Threading; +using System.Collections; +using MediaPortal.GUI.Library; +using MediaPortal.Dialogs; +using MediaPortal.Util; +using MediaPortal.Configuration; + +namespace Wikipedia +{ + /// <summary> + /// Windowplugin to search in Wikipedia and display articles using the MP Wikipedia Classes. + /// </summary> + public class GUIWikipedia : GUIWindow, ISetupForm + { + #region SkinControls + [SkinControlAttribute(10)] + protected GUIButtonControl buttonSearch = null; + [SkinControlAttribute(11)] + protected GUIButtonControl buttonLocal = null; + [SkinControlAttribute(14)] + protected GUIButtonControl buttonBack = null; + [SkinControlAttribute(12)] + protected GUIButtonControl buttonLinks = null; + [SkinControlAttribute(13)] + protected GUIButtonControl buttonImages = null; + + [SkinControlAttribute(4)] + protected GUILabelControl searchtermLabel = null; + [SkinControlAttribute(5)] + protected GUILabelControl imagedescLabel = null; + [SkinControlAttribute(20)] + protected GUITextControl txtArticle = null; + + [SkinControlAttribute(25)] + protected GUIImage imageControl = null; + #endregion + + private string language = "Default"; + private string articletext = string.Empty; + private ArrayList linkArray = new ArrayList(); + private ArrayList imagenameArray = new ArrayList(); + private ArrayList imagedescArray = new ArrayList(); + + + public GUIWikipedia() + { + GetID = (int)GUIWindow.Window.WINDOW_WIKIPEDIA; + } + #region ISetupForm Members + + // Returns the name of the plugin which is shown in the plugin menu + public string PluginName() + { + return "Wikipedia"; + } + + // Returns the description of the plugin is shown in the plugin menu + public string Description() + { + return "A Plugin to search in Wikipedia"; + } + + // Returns the author of the plugin which is shown in the plugin menu + public string Author() + { + return "Maschine"; + } + + // show the setup dialog + public void ShowPlugin() + { + MessageBox.Show("Edit the wikipedia.xml file in MP's root directory to add new sites."); + } + + // Indicates whether plugin can be enabled/disabled + public bool CanEnable() + { + return true; + } + + // get ID of windowplugin belonging to this setup + public int GetWindowId() + { + return 4711; + } + + // Indicates if plugin is enabled by default; + public bool DefaultEnabled() + { + return false; + } + + // indicates if a plugin has its own setup screen + public bool HasSetup() + { + return false; + } + + /// <summary> + /// If the plugin should have its own button on the main menu of Media Portal then it + /// should return true to this method, otherwise if it should not be on home + /// it should return false + /// </summary> + /// <param name="strButtonText">text the button should have</param> + /// <param name="strButtonImage">image for the button, or empty for default</param> + /// <param name="strButtonImageFocus">image for the button, or empty for default</param> + /// <param name="strPictureImage">subpicture for the button or empty for none</param> + /// <returns>true : plugin needs its own button on home + /// false : plugin does not need its own button on home</returns> + public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) + { + strButtonText = GUILocalizeStrings.Get(2516); + strButtonImage = ""; + strButtonImageFocus = ""; + strPictureImage = ""; + return true; + } + #endregion + + public override bool Init() + { + return Load(GUIGraphicsContext.Skin + @"\wikipedia.xml"); + } + + protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType) + { + // we don't want the user to start another search while one is already active + if (_workerCompleted == false) + return; + + // Here we want to open the OSD Keyboard to enter the searchstring + if (control == buttonSearch) + { + // If the search Button was clicked we need to bring up the search keyboard. + VirtualKeyboard keyboard = (VirtualKeyboard)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_VIRTUAL_KEYBOARD); + if (null == keyboard) return; + string searchterm = string.Empty; + keyboard.IsSearchKeyboard = true; + keyboard.Reset(); + keyboard.Text = ""; + keyboard.DoModal(GetID); // show it... + + Log.Info("Wikipedia: OSD keyboard loaded!"); + + // If input is finished, the string is saved to the searchterm var. + if (keyboard.IsConfirmed) + searchterm = keyboard.Text; + + // If there was a string entered try getting the article. + if (searchterm != "") + { + Log.Info("Wikipedia: Searchterm gotten from OSD keyboard: {0}", searchterm); + GetAndDisplayArticle(searchterm); + } + // Else display an error dialog. + else + { + GUIDialogOK dlg = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK); + dlg.SetHeading(GUILocalizeStrings.Get(257)); // Error + dlg.SetLine(1, GUILocalizeStrings.Get(2500)); // No searchterm entered! + dlg.SetLine(2, String.Empty); + dlg.SetLine(3, GUILocalizeStrings.Get(2501)); // Please enter a valid searchterm! + dlg.DoModal(GUIWindowManager.ActiveWindow); + } + } + // This is the control to select the local Wikipedia site. + if (control == buttonLocal) + { + // Create a new selection dialog. + GUIDialogMenu pDlgOK = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); + if (pDlgOK != null) + { + pDlgOK.Reset(); + pDlgOK.SetHeading(GUILocalizeStrings.Get(2502)); //Select your local Wikipedia: + + // Add all the local sites we want to be displayed starting with int 0. + MediaPortal.Profile.Settings langreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "wikipedia.xml")); + String allsites = langreader.GetValueAsString("Allsites", "sitenames", ""); + Log.Info("Wikipedia: available sites: " + allsites); + String[] siteArray = allsites.Split(','); + for (int i = 0; i < siteArray.Length; i++) + { + int stringno = langreader.GetValueAsInt(siteArray[i], "string", 2006); + pDlgOK.Add(GUILocalizeStrings.Get(stringno)); //English, German, French ... + } + + pDlgOK.DoModal(GetID); + if (pDlgOK.SelectedLabel >= 0) + { + SelectLocalWikipedia(pDlgOK.SelectedLabel, siteArray); + } + } + } + // The Button holding the Links to other articles + if (control == buttonLinks) + { + if (linkArray.Count > 0) + { + // Create a new selection dialog. + GUIDialogMenu pDlgOK = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); + if (pDlgOK != null) + { + pDlgOK.Reset(); + pDlgOK.SetHeading(GUILocalizeStrings.Get(2505)); //Links to other articles: + + // Add all the links from the linkarray. + foreach (string link in linkArray) + { + pDlgOK.Add(link); + } + pDlgOK.DoModal(GetID); + if (pDlgOK.SelectedLabel >= 0) + { + Log.Info("Wikipedia: new search from the links array: {0}", pDlgOK.SelectedLabelText); + GetAndDisplayArticle(pDlgOK.SelectedLabelText); + } + } + } + else + { + GUIDialogOK dlg = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK); + dlg.SetHeading(GUILocalizeStrings.Get(257)); // Error + dlg.SetLine(1, GUILocalizeStrings.Get(2506)); // No Links from this article. + dlg.DoModal(GUIWindowManager.ActiveWindow); + } + + } + // The Button containing a list of all images from the article + if (control == buttonImages) + { + if (imagedescArray.Count > 0) + { + // Create a new selection dialog. + GUIDialogMenu pDlgOK = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); + if (pDlgOK != null) + { + pDlgOK.Reset(); + pDlgOK.SetHeading(GUILocalizeStrings.Get(2507)); //Images from this article + + // Add all the images from the imagearray. + foreach (string image in imagedescArray) + { + pDlgOK.Add(image); + } + pDlgOK.DoModal(GetID); + if (pDlgOK.SelectedLabel >= 0) + { + Log.Info("Wikipedia: new search from the image array: {0}", imagedescArray[pDlgOK.SelectedId - 1]); + GetAndDisplayImage(imagenameArray[pDlgOK.SelectedId - 1].ToString(), imagedescArray[pDlgOK.SelectedId - 1].ToString()); + } + } + } + else + { + GUIDialogOK dlg = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK); + dlg.SetHeading(GUILocalizeStrings.Get(257)); // Error + dlg.SetLine(1, GUILocalizeStrings.Get(2508)); // No Images referenced in this article. + dlg.DoModal(GUIWindowManager.ActiveWindow); + } + } + // Back to the text button to switch from image view + if (control == buttonBack) + { + if (!txtArticle.IsVisible) + GUIControl.ShowControl(GetID, txtArticle.GetID); + if (imageControl.IsVisible) + GUIControl.HideControl(GetID, imageControl.GetID); + if (!searchtermLabel.IsVisible) + GUIControl.ShowControl(GetID, searchtermLabel.GetID); + if (imagedescLabel.IsVisible) + GUIControl.HideControl(GetID, imagedescLabel.GetID); + if (buttonBack.IsVisible) + GUIControl.HideControl(GetID, buttonBack.GetID); + } + base.OnClicked(controlId, control, actionType); + } + + // Depending on which Entry was selected from the listbox we chose the language here. + private void SelectLocalWikipedia(int labelnumber, String[] siteArray) + { + MediaPortal.Profile.Settings langreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "wikipedia.xml")); + language = siteArray[labelnumber]; + + if (searchtermLabel.Label != string.Empty && searchtermLabel.Label != "Wikipedia") + { + Log.Info("Wikipedia: language changed to {0}. Display article {1} again.", language, searchtermLabel.Label); + GetAndDisplayArticle(searchtermLabel.Label); + } + } + + private void GetAndDisplayImage(string imagename, string imagedesc) + { + WikipediaImage image = new WikipediaImage(imagename, language); + string imagefilename = image.GetImageFilename(); + Log.Info("Wikipedia: Trying to display image file: {0}", imagefilename); + + if (imagefilename != string.Empty && System.IO.File.Exists(imagefilename)) + { + if (txtArticle.IsVisible) + GUIControl.HideControl(GetID, txtArticle.GetID); + if (!imageControl.IsVisible) + GUIControl.ShowControl(GetID, imageControl.GetID); + if (searchtermLabel.IsVisible) + GUIControl.HideControl(GetID, searchtermLabel.GetID); + if (!imagedescLabel.IsVisible) + GUIControl.ShowControl(GetID, imagedescLabel.GetID); + if (!buttonBack.IsVisible) + GUIControl.ShowControl(GetID, buttonBack.GetID); + imagedescLabel.Label = imagedesc; + imageControl.SetFileName(imagefilename); + } + else + { + GUIDialogOK dlg = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK); + dlg.SetHeading(GUILocalizeStrings.Get(257)); // Error + dlg.SetLine(1, GUILocalizeStrings.Get(2512)); // Can't display image. + dlg.SetLine(2, GUILocalizeStrings.Get(2513)); // Please have a look at the logfile. + dlg.DoModal(GUIWindowManager.ActiveWindow); + } + } + + // The main function. + void GetAndDisplayArticle(string searchterm) + { + BackgroundWorker worker = new BackgroundWorker(); + + worker.DoWork += new DoWorkEventHandler(DownloadWorker); + worker.RunWorkerAsync(searchterm); + + while (_workerCompleted == false) + GUIWindowManager.Process(); + } + + // All kind of stuff because of the wait cursor ;-) + void DownloadWorker(object sender, DoWorkEventArgs e) + { + _workerCompleted = false; + + using (WaitCursor cursor = new WaitCursor()) + lock (this) + { + if (!txtArticle.IsVisible) + GUIControl.ShowControl(GetID, txtArticle.GetID); + if (imageControl.IsVisible) + GUIControl.HideControl(GetID, imageControl.GetID); + if (!searchtermLabel.IsVisible) + GUIControl.ShowControl(GetID, searchtermLabel.GetID); + if (imagedescLabel.IsVisible) + GUIControl.HideControl(GetID, imagedescLabel.GetID); + if (buttonBack.IsVisible) + GUIControl.HideControl(GetID, buttonBack.GetID); + linkArray.Clear(); + imagenameArray.Clear(); + imagedescArray.Clear(); + searchtermLabel.Label = e.Argument.ToString(); + WikipediaArticle article = new WikipediaArticle(e.Argument.ToString(), language); + articletext = article.GetArticleText(); + linkArray = article.GetLinkArray(); + imagenameArray = article.GetImageArray(); + imagedescArray = article.GetImagedescArray(); + language = article.GetLanguage(); + + if (articletext == "REDIRECT") + txtArticle.Label = GUILocalizeStrings.Get(2509) + "\n" + GUILocalizeStrings.Get(2510); //This page is only a redirect. Please chose the redirect aim from the link list. + else if (articletext == string.Empty) + txtArticle.Label = GUILocalizeStrings.Get(2504); //Sorry, no Article was found for your searchterm... + else + txtArticle.Label = articletext; + } + + _workerCompleted = true; + } + + volatile bool _workerCompleted = true; + } +} \ No newline at end of file Added: trunk/plugins/Documentation plugin/Documentation.csproj =================================================================== --- trunk/plugins/Documentation plugin/Documentation.csproj (rev 0) +++ trunk/plugins/Documentation plugin/Documentation.csproj 2007-03-27 09:07:31 UTC (rev 232) @@ -0,0 +1,52 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>8.0.50727</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{B3A735EA-AE81-430A-AB33-214D11F5BE6E}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>Documentation</RootNamespace> + <AssemblyName>Documentation</AssemblyName> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="Core, Version=1.0.2588.17924, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>D:\Apps\Desktop\MediaPortal\Core.DLL</HintPath> + </Reference> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Class1.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/Documentation plugin/DocumentationImage.cs =================================================================== --- trunk/plugins/Documentation plugin/DocumentationImage.cs (rev 0) +++ trunk/plugins/Documentation plugin/DocumentationImage.cs 2007-03-27 09:07:31 UTC (rev 232) @@ -0,0 +1,196 @@ +#region Copyright (C) 2005-2007 Team MediaPortal + +/* + * Copyright (C) 2005-2007 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.ComponentModel; +using System.Windows.Forms; +using System.Net; +using System.IO; +using System.Text; +using System.Threading; +using System.Collections; +using MediaPortal.GUI.Library; +using MediaPortal.Util; +using MediaPortal.Configuration; + +namespace Wikipedia +{ + /// <summary> + /// This class holds all the logic to get an image from Wikipedia for further using in MP. + /// </summary> + public class WikipediaImage + { + #region vars + private string WikipediaURL = "http://en.wikipedia.org/wiki/Special:Export/"; + private string imagename = string.Empty; + private string imagedesc = string.Empty; + private string imageurl = string.Empty; + private string imagelocal = string.Empty; + + #endregion + + #region constructors + /// <summary>This constructor creates a new WikipediaImage</summary> + /// <summary>The name of the image and language need to be given</summary> + /// <param name="imagename">The internal name of the image like "Bild_478.jpg" in "http://de.wikipedia.org/wiki/Bild:Bild_478.jpg"</param> + /// <param name="language">Language of the Wikipedia page</param> + public WikipediaImage(string imagename, string language) + { + SetLanguage(language); + this.imagename = imagename; + GetImageUrl(); + GetImageFile(); + } + + /// <summary>This constructor creates a new WikipediaArticle.</summary> + /// <summary>Only called with a title string, language set to default.</summary> + /// <param name="title">The article's title</param> + public WikipediaImage(string imagename) + : this(imagename, "Default") + { + } + + /// <summary>This constructor creates a new WikipediaArticle if no parameter is given.</summary> + /// <summary>Uses an empty searchterm and the default language.</summary> + public WikipediaImage() + : this(string.Empty, "Default") + { + } + #endregion + + #region class methods + /// <summary>Gets the current MP language from mediaportal.xml and sets the Wikipedia URL accordingly</summary> + private void SetLanguage(string language) + { + if (language == "Default") + { + MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")); + language = xmlreader.GetValueAsString("skin", "language", "English"); + } + + MediaPortal.Profile.Settings detailxmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "wikipedia.xml")); + this.WikipediaURL = detailxmlreader.GetValueAsString(language, "imageurl", "http://en.wikipedia.org/wiki/Image:"); + Log.Info("Wikipedia: Image language set to " + language + "."); + } + + /// <summary>Get the local filename of the downloaded image.</summary> + /// <returns>String: filename of the downloaded image.</returns> + public string GetImageFilename() + { + string imagelocal = Config.GetFile(Config.Dir.Thumbs, @"wikipedia\" + imagename); + return imagelocal; + } + + /// <summary>Getting the link to the full-size image.</summary> + /// <returns>String: parsed article</returns> + private void GetImageUrl() + { + string imagepage = string.Empty; + + // Build the URL to the Image page + System.Uri url = new System.Uri(WikipediaURL + this.imagename); + Log.Info("Wikipedia: Trying to get following Image page: {0}", url.ToString()); + + // Here we get the content from the web and put it to a string + try + { + WebClient client = new WebClient(); + client.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)"); + Stream data = client.OpenRead(url); + StreamReader reader = new StreamReader(data); + imagepage = reader.ReadToEnd(); + reader.Close(); + Log.Info("Wikipedia: Success! Downloaded all data from the image page."); + } + catch (Exception e) + { + Log.Info("Wikipedia: Exception during downloading image page:"); + Log.Info(e.ToString()); + } + + //We're searching for something like this: + //<div class="fullImageLink" id="file"><a href="http://upload.wikimedia.org/wikipedia/commons/7/7d/Bild_478.jpg"> + if (imagepage.IndexOf("class=\"fullImageLink\"") >= 0) + { + Log.Info("Wikipedia: Extracting link to full-size image."); + int iStart = imagepage.IndexOf("class=\"fullImageLink\""); + imagepage = imagepage.Substring(iStart, 1000); + + iStart = imagepage.IndexOf("href") + 6; + int iEnd = imagepage.IndexOf("\"", iStart); + + this.imageurl = imagepage.Substring(iStart, iEnd - iStart); + Log.Info("Wikipedia: URL of full-size image extracted."); + Log.Info(imageurl); + } + else + this.imageurl = string.Empty; + } + + /// <summary>Downloads the full-size image from the wikipedia page</summary> + private void GetImageFile() + { + if (imageurl != "") + { + //Check if we already have the file. + string thumbspath = Config.GetSubFolder(Config.Dir.Thumbs, @"wikipedia\"); + + //Create the wikipedia subdir in thumbs when it not exists. + if (!System.IO.Directory.Exists(thumbspath)) + System.IO.Directory.CreateDirectory(thumbspath); + + if (!System.IO.File.Exists(thumbspath + imagename)) + { + + Log.Info("Wikipedia: Trying to get following URL: {0}", imageurl); + // Here we get the image from the web and save it to disk + try + { + WebClient client = new WebClient(); + client.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)"); + client.DownloadFile(imageurl, thumbspath + imagename); + Log.Info("Wikipedia: Success! Image downloaded."); + } + catch (Exception e) + { + Log.Info("Wikipedia: Exception during downloading:"); + Log.Info(e.ToString()); + } + } + else + { + Log.Info("Wikipedia: Image exists, no need to redownload!"); + } + } + else + { + Log.Info("Wikipedia: No imageurl. Can't download file."); + } + } + + #endregion + } + +} \ No newline at end of file Added: trunk/plugins/Documentation plugin/DocumentationPage.cs =================================================================== --- trunk/plugins/Documentation plugin/DocumentationPage.cs (rev 0) +++ trunk/plugins/Documentation plugin/DocumentationPage.cs 2007-03-27 09:07:31 UTC (rev 232) @@ -0,0 +1,553 @@ +#region Copyright (C) 2005-2007 Team MediaPortal + +/* + * Copyright (C) 2005-2007 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.ComponentModel; +using System.Windows.Forms; +using System.Net; +using System.IO; +using System.Text; +using System.Threading; +using System.Collections; +using MediaPortal.GUI.Library; +using MediaPortal.Util; +using MediaPortal.Configuration; + +namespace Wikipedia +{ + /// <summary> + /// This class holds all the logic to get info from Wikipedia and parse it for further using in MP. + /// </summary> + public class WikipediaArticle + { + #region vars + private string WikipediaURL = "http://en.wikipedia.org/wiki/Special:Export/"; + private string imagePattern = "Image"; + private string title = string.Empty; + private string unparsedArticle = string.Empty; + private string parsedArticle = string.Empty; + private string language = "Default"; + private ArrayList linkArray = new ArrayList(); + private ArrayList imageArray = new ArrayList(); + private ArrayList imagedescArray = new ArrayList(); + #endregion + + #region constructors + /// <summary>This constructor creates a new WikipediaArticle</summary> + /// <summary>Searchterm and language need to be given</summary> + /// <param name="title">The article's title</param> + /// <param name="language">Language of the Wikipedia page</param> + public WikipediaArticle(string title, string language) + { + SetLanguage(language); + this.title = title; + GetWikipediaXML(); + ParseWikipediaArticle(); + ParseLinksAndImages(); + } + + /// <summary>This constructor creates a new WikipediaArticle.</summary> + /// <summary>Only called with a title string, language set to default.</summary> + /// <param name="title">The article's title</param> + public WikipediaArticle(string title) + : this(title, "Default") + { + } + + /// <summary>This constructor creates a new WikipediaArticle if no parameter is given.</summary> + /// <summary>Uses an empty searchterm and the default language.</summary> + public WikipediaArticle() + : this(string.Empty, "Default") + { + } + #endregion + + /// <summary>Gets the current MP language from mediaportal.xml and sets the Wikipedia URL accordingly</summary> + private void SetLanguage(string language) + { + if (language == "Default") + { + MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")); + language = xmlreader.GetValueAsString("skin", "language", "English"); + } + + this.language = language; + + MediaPortal.Profile.Settings detailxmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "wikipedia.xml")); + this.WikipediaURL = detailxmlreader.GetValueAsString(language, "url", "http://en.wikipedia.org/wiki/Special:Export/"); + this.imagePattern = detailxmlreader.GetValueAsString(language, "imagepattern", "Image"); + Log.Info("Wikipedia: Language set to " + language + "."); + } + + /// <summary>Returns the parsed article text.</summary> + /// <returns>String: parsed article</returns> + public string GetArticleText() + { + return parsedArticle; + } + + /// <summary>Returns the title of the article. Can differ from the passed parameter on redirects for example.</summary> + /// <returns>String: title of the article</returns> + public string GetTitle() + { + return title; + } + + /// <summary>Returns all names of images.</summary> + /// <returns>StringArray: images used in this article</returns> + public ArrayList GetImageArray() + { + return imageArray; + } + + /// <summary>Returns all descriptions of images.</summary> + /// <returns>StringArray: images used in this article</returns> + public ArrayList GetImagedescArray() + { + return imagedescArray; + } + + /// <summary>Returns the titles of all linked articles.</summary> + /// <returns>StringArray: titles of linked (internal) Wikipedia articles</returns> + public ArrayList GetLinkArray() + { + return linkArray; + } + + /// <summary>Returns the currently active language.</summary> + /// <returns>String: language</returns> + public string GetLanguage() + { + return language; + } + + /// <summary>Downloads the xml content from Wikipedia and cuts metadata like version info.</summary> + private void GetWikipediaXML() + { + string wikipediaXML = string.Empty; + // Build the URL to the Wikipedia page + System.Uri url = new System.Uri(WikipediaURL + this.title); + Log.Info("Wikipedia: Trying to get following URL: {0}", url.ToString()); + + // Here we get the content from the web and put it to a string + try + { + WebClient client = new WebClient(); + client.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)"); + Stream data = client.OpenRead(url); + StreamReader reader = new StreamReader(data); + wikipediaXML = reader.ReadToEnd(); + reader.Close(); + Log.Info("Wikipedia: Success! Downloaded all data."); + } + catch (Exception e) + { + Log.Info("Wikipedia: Exception during downloading:"); + Log.Info(e.ToString()); + } + + if (wikipediaXML.IndexOf("<text xml:space=\"preserve\">") > 0) + { + Log.Info("Wikipedia: Extracting unparsed string."); + int iStart = 0; + int iEnd = wikipediaXML.Length; + // Start of the Entry + iStart = wikipediaXML.IndexOf("<text xml:space=\"preserve\">") + 27; + // End of the Entry + iEnd = wikipediaXML.IndexOf("</text>"); + // Extract the Text and update the var + this.unparsedArticle = wikipediaXML.Substring(iStart, iEnd - iStart); + Log.Info("Wikipedia: Unparsed string extracted."); + } + else + this.unparsedArticle = string.Empty; + } + + /// <summary>Cuts all special wiki syntax from the article to display plain text</summary> + private void ParseWikipediaArticle() + { + string tempParsedArticle = this.unparsedArticle; + + // Check if the article is empty, if so do not parse. + if (tempParsedArticle == string.Empty) + { + Log.Info("Wikipedia: Empty article found. Try another Searchterm."); + this.unparsedArticle = string.Empty; + } + // Here we check if there is only a redirect as article to handle it as a special article type + else if (tempParsedArticle.IndexOf("#REDIRECT") == 0) + { + Log.Info("Wikipedia: #REDIRECT found."); + int iStart = tempParsedArticle.IndexOf("[[") + 2; + int iEnd = tempParsedArticle.IndexOf("]]", iStart); + // Extract the Text + string keyword = tempParsedArticle.Substring(iStart, iEnd - iStart); + this.unparsedArticle = string.Empty; + this.title = keyword; + GetWikipediaXML(); + ParseWikipediaArticle(); + } + // Finally a well-formed article ;-) + else + { + Log.Info("Wikipedia: Starting parsing."); + StringBuilder builder = new StringBuilder(tempParsedArticle); + int iStart = 0; + int iEnd = 0; + + // Remove HTML comments + Log.Debug("Wikipedia: Remove HTML comments."); + while (tempParsedArticle.IndexOf("<!--") >= 0) + { + builder = new StringBuilder(tempParsedArticle); + iStart = tempParsedArticle.IndexOf("<!--"); + iEnd = tempParsedArticle.IndexOf("-->", iStart) + 6; + + try + { + builder.Remove(iStart, iEnd - iStart); + } + catch (Exception e) + { + Log.Error(e.ToString()); + Log.Error(builder.ToString()); + } + tempParsedArticle = builder.ToString(); + } + + // surrounded by {{ and }} is (atm) unusable stuff. + //Log.Debug("Wikipedia: Remove stuff between {{ and }}."); + while (tempParsedArticle.IndexOf("{{") >= 0) + { + builder = new StringBuilder(tempParsedArticle); + iStart = tempParsedArticle.IndexOf("{{"); + int iStart2 = iStart; + iEnd = tempParsedArticle.IndexOf("}}") + 2; + + // Between {{ and }} we can again have inner sets of {{ and }} + while (tempParsedArticle.IndexOf("{{", iStart2 + 2) >= 0 && tempParsedArticle.IndexOf("{{", iStart2 + 2) < iEnd) + { + iStart2 = tempParsedArticle.IndexOf("{{", iStart2 + 2); + iEnd = tempParsedArticle.IndexOf("}}", iStart2) + 2; + iEnd = tempParsedArticle.IndexOf("}}", iEnd) + 2; + } + + try + { + builder.Remove(iStart, iEnd - iStart); + } + catch (Exception e) + { + Log.Error(e.ToString()); + Log.Error(builder.ToString()); + } + + tempParsedArticle = builder.ToString(); + } + + // surrounded by {| and |} is (atm) unusable stuff. + //Log.Debug("Wikipedia: Remove stuff between {| and |}."); + while (tempParsedArticle.IndexOf("{|") >= 0) + { + builder = new StringBuilder(tempParsedArticle); + iStart = tempParsedArticle.IndexOf("{|"); + iEnd = tempParsedArticle.IndexOf("|}") + 2; + + try + { + builder.Remove(iStart, iEnd - iStart); + } + catch (Exception e) + { + Log.Error(e.ToString()); + Log.Error(builder.ToString()); + } + + tempParsedArticle = builder.ToString(); + } + + // Remove audio links. + Log.Debug("Wikipedia: Remove audio links."); + while (tempParsedArticle.IndexOf("<span") >= 0) + { + builder = new StringBuilder(tempParsedArticle); + iStart = tempParsedArticle.IndexOf("<span"); + iEnd = tempParsedArticle.IndexOf("</span>") + 13; + + try + { + builder.Remove(iStart, iEnd - iStart); + } + catch (Exception e) + { + Log.Error(e.ToString()); + Log.Error(builder.ToString()); + } + + tempParsedArticle = builder.ToString(); + } + + // Remove web references. + Log.Debug("Wikipedia: Remove web references."); + while (tempParsedArticle.IndexOf("<ref>") >= 0) + { + builder = new StringBuilder(tempParsedArticle); + iStart = tempParsedArticle.IndexOf("<ref"); + iEnd = tempParsedArticle.IndexOf("</ref>") + 12; + + try + { + builder.Remove(iStart, iEnd - iStart); + } + catch (Exception e) + { + Log.Error(e.ToString()); + Log.Error(builder.ToString()); + } + + tempParsedArticle = builder.ToString(); + } + + // Remove <br /> + Log.Debug("Wikipedia: Remove <br />."); + builder.Replace("<br />", "\n"); + builder.Replace("<br style="clear:both"/>", "\n"); + builder.Replace("<br style="clear:left"/>", "\n"); + builder.Replace("<br style="clear:right"/>", "\n"); + + // Remove <sup> + Log.Debug("Wikipedia: Remove <sup>."); + builder.Replace("<sup>", "^"); + builder.Replace("</sup>", ""); + + // surrounded by ''' and ''' is bold text, atm also unusable. + Log.Debug("Wikipedia: Remove \'\'\'."); + builder.Replace("'''", ""); + + // surrounded by '' and '' is italic text, atm also unusable. + Log.Debug("Wikipedia: Remove \'\'."); + builder.Replace("''", ""); + + // Display === as newlines (meaning new line for every ===). + Log.Debug("Wikipedia: Display === as 1 newlines."); + builder.Replace("===", "\n"); + + // Display == as newlines (meaning new line for every ==). + Log.Debug("Wikipedia: Display == as 1 newline."); + builder.Replace("==", "\n"); + + // Display * as list (meaning new line for every *). + Log.Debug("Wikipedia: Display * as list."); + builder.Replace("*", "\n +"); + + // Remove HTML whitespace. + Log.Debug("Wikipedia: Remove HTML whitespace."); + builder.Replace(" ", " "); + + // Display " as ". + Log.Debug("Wikipedia: Remove Quotations."); + builder.Replace(""", "\""); + + // Display — as -. + Log.Debug("Wikipedia: Remove —."); + builder.Replace("—", "-"); + + // Remove gallery tags. + Log.Debug("Wikipedia: Remove gallery tags."); + builder.Replace("<gallery>", ""); + builder.Replace("</gallery>", ""); + + // Remove gallery tags. + Log.Debug("Wikipedia: Remove &."); + builder.Replace("&", "&"); + + // Remove (too many) newlines + Log.Debug("Wikipedia: Remove (too many) newlines."); + builder.Replace("\n\n\n\n", "\n"); + builder.Replace("\n\n\n", "\n"); + builder.Replace("\n\n", "\n"); + + // Remove (too many) newlines + Log.Debug("Wikipedia: Remove (too many) whitespaces."); + builder.Replace(" ", " "); + builder.Replace(" ", " "); + builder.Replace(" ", " "); + + tempParsedArticle = builder.ToString(); + + // The text shouldn't start with a newline. + if (tempParsedArticle.IndexOf("\n") == 0) + tempParsedArticle.Remove(0, 2); + + // For Debug purposes it is nice to see how the whole article text is parsed until here + //Log.Debug(tempParsedArticle); + + Log.Info("Wikipedia: Finished parsing."); + this.unparsedArticle = tempParsedArticle; + } + } + + /// <summary>Gets Links out of the article. External links are thrown away, links to other wikipedia articles get into the link array, images to the image array</summary> + private void ParseLinksAndImages() + { + Log.Info("Wikipedia: Starting parsing of links and images."); + string tempParsedArticle = this.unparsedArticle; + int iStart = 0, iEnd = 0, iPipe = 0; + + // Surrounded by [[IMAGEPATTERN: and ]] are the links to IMAGES. + // We need to check for the localized image keyword but also for the English as this is commonly used in some local sites. + // Example: [[Bild:H_NeuesRathaus1.jpg|left|thumb|Das [[Neues Rathaus (Hannover)|Neue Rathaus]] mit Maschteich]] + while ((iStart = tempParsedArticle.IndexOf("[[" + imagePattern + ":", iStart)) >= 0 || (iStart = tempParsedArticle.IndexOf("[[Image:")) >= 0) + { + iEnd = tempParsedArticle.IndexOf("]]", (iStart + 2)) + 2; + int disturbingLink = iStart; + + // Descriptions of images can contain links! + // [[Bild:Hannover Merian.png|thumb|[[Matth?us Merian|Merian]]-Kupferstich um 1650, im Vordergrund Windm?hle auf dem [[Lindener Berg]]]] + while (tempParsedArticle.IndexOf("[[", disturbingLink + 2) >= 0 && tempParsedArticle.IndexOf("[[", disturbingLink + 2) < iEnd) + { + disturbingLink = tempParsedArticle.IndexOf("[[", disturbingLink + 2); + iEnd = tempParsedArticle.IndexOf("]]", disturbingLink) + 2; + iEnd = tempParsedArticle.IndexOf("]]", iEnd) + 2; + } + // Extract the Text + string keyword = tempParsedArticle.Substring(iStart, iEnd - iStart); + + //Remove all links from the image description. + while (keyword.IndexOf("[[", 2) >= 0) + { + int iStartlink = keyword.IndexOf("[[", 2); + int iEndlink = keyword.IndexOf("]]", iStartlink) + 2; + // Extract the Text + string linkkeyword = keyword.Substring(iStartlink, iEndlink - iStartlink); + + // Parse Links to other keywords. + // 1st type of keywords is like [[article|displaytext]] + // for the 2nd the article and displayed text are equal [[article]]. + if (linkkeyword.IndexOf("|") > 0) + linkkeyword = linkkeyword.Substring(linkkeyword.IndexOf("|") + 1, linkkeyword.IndexOf("]]") - linkkeyword.IndexOf("|") - 1); + else + linkkeyword = linkkeyword.Substring(linkkeyword.IndexOf("[[") + 2, linkkeyword.IndexOf("]]") - linkkeyword.IndexOf("[[") - 2); + + keyword = keyword.Substring(0, iStartlink) + linkkeyword + keyword.Substring(iEndlink, keyword.Length - iEndlink); + } + + int iStartname = keyword.IndexOf(":") + 1; + int iEndname = keyword.IndexOf("|"); + string imagename = keyword.Substring(iStartname, iEndname - iStartname); + + //Image names must not contain spaces! + imagename = imagename.Replace(" ", "_"); + + int iStartdesc = keyword.LastIndexOf("|") + 1; + int iEnddesc = keyword.LastIndexOf("]]"); + string imagedesc = keyword.Substring(iStartdesc, iEnddesc - iStartdesc); ; + + this.imageArray.Add(imagename); + this.imagedescArray.Add(imagedesc); + Log.Debug("Wikipedia: Image added: {0}, {1}", imagedesc, imagename); + + tempParsedArticle = tempParsedArticle.Substring(0, iStart) + tempParsedArticle.Substring(iEnd, tempParsedArticle.Length - iEnd); + } + + // surrounded by [[ and ]] are the links to other articles. + Log.Debug("Wikipedia: Starting Link parsing."); + string parsedKeyword, parsedLink; + iStart = iEnd = 0; + try + { + while ((iStart = tempParsedArticle.IndexOf("[[", iStart)) >= 0) + { + iEnd = tempParsedArticle.IndexOf("]]") + 2; + // Extract the Text + string keyword = tempParsedArticle.Substring(iStart, iEnd - iStart); + + // Parse Links to other keywords. + // 1st type of keywords is like [[article|displaytext]] + if ((iPipe = keyword.IndexOf("|")) > 0) + { + parsedKeyword = keyword.Substring(iPipe + 1, keyword.Length - iPipe - 3); + parsedLink = keyword.Substring(2, iPipe - 2); + if (!this.linkArray.Contains(parsedLink)) + { + this.linkArray.Add(parsedLink); + //Log.Debug("Wikipedia: Link added: {0}, {1}", parsedLink, parsedKeyword); + } + } + else if (keyword.IndexOf(":") > 0) + { + // for the 2nd a ":" is a link to the article in another language. + // TODO Add links to other languages!!! + parsedKeyword = String.Empty; + } + else + { + // for the 3rd the article and displayed text are equal [[article]]. + parsedKeyword = keyword.Substring(2, keyword.Length - 4); + if (!this.linkArray.Contains(parsedKeyword)) + { + this.linkArray.Add(parsedKeyword); + //Log.Debug("Wikipedia: Link added: {0}", parsedKeyword); + } + } + + StringBuilder builder = new StringBuilder(tempParsedArticle); + builder.Remove(iStart, iEnd - iStart); + builder.Insert(iStart, parsedKeyword); + tempParsedArticle = builder.ToString(); + } + } + catch (Exception e) + { + Log.Error("Wikipedia: {0}", e.ToString()); + Log.Error("Wikipedia: tempArticle: {0}", tempParsedArticle); + } + Log.Debug("Wikipedia: Finished Link parsing: {0} Links added.", linkArray.Count); + + // surrounded by [ and ] are external Links. Need to be removed. + Log.Debug("Wikipedia: Removing external links"); + iStart = -1; + try + { + while ((iStart = tempParsedArticle.IndexOf("[")) >= 0) + { + iEnd = tempParsedArticle.IndexOf("]") + 1; + + StringBuilder builder = new StringBuilder(tempParsedArticle); + builder.Remove(iStart, iEnd - iStart); + tempParsedArticle = builder.ToString(); + } + } + catch (Exception e) + { + Log.Error("Wikipedia: {0}", e.ToString()); + Log.Error("Parsing Error: " + tempParsedArticle + "\nSTART: " + iStart + "\nEND: " + iEnd); + } + + Log.Info("Wikipedia: Finished parsing of links and images."); + this.parsedArticle = tempParsedArticle; + } + } +} \ 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: <mp...@us...> - 2007-03-30 10:01:11
|
Revision: 262 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=262&view=rev Author: mpod_sf Date: 2007-03-30 03:01:07 -0700 (Fri, 30 Mar 2007) Log Message: ----------- Initial check-in of the My Refresh Plugin (works with MP SVN Build 13639 and higher) Added Paths: ----------- trunk/plugins/My Refresh/ trunk/plugins/My Refresh/MyRefresh.cs trunk/plugins/My Refresh/MyRefresh.csproj Added: trunk/plugins/My Refresh/MyRefresh.cs =================================================================== --- trunk/plugins/My Refresh/MyRefresh.cs (rev 0) +++ trunk/plugins/My Refresh/MyRefresh.cs 2007-03-30 10:01:07 UTC (rev 262) @@ -0,0 +1,144 @@ +namespace MediaPortal.Plugins +{ + using MediaPortal.GUI.Library; + using MediaPortal.Configuration; + using System; + using System.IO; + using System.Windows.Forms; + + public class MyRefresh : IPluginReceiver, IPlugin, ISetupForm + { + private string _language = string.Empty; + private string _refreshHotkeys = "Rr"; + + public string Author() + { + return "Smirnoff"; + } + + public bool CanEnable() + { + return true; + } + + public bool DefaultEnabled() + { + return true; + } + + public string Description() + { + return "Plugin to allow skinners to view skin changes without the need to restart, Press F5"; + } + + public bool GetHome(out string buttonText, out string buttonImage, out string buttonImageFocused, out string hoverImage) + { + string text; + hoverImage = text = ""; + buttonImageFocused = text; + buttonText = buttonImage = text; + return false; + } + + public int GetWindowId() + { + return 0; + } + + public bool HasSetup() + { + return false; + } + + private void OnAction(Action action) + { + if ((action.wID == Action.ActionType.ACTION_KEY_PRESSED) && (this._refreshHotkeys.IndexOf((char)action.m_key.KeyChar, 0) != -1)) + { + this.Refresh(false); + } + if ((action.wID == Action.ActionType.ACTION_KEY_PRESSED) && (this._refreshHotkeys.IndexOf('a', 0) != -1)) + { + this.Refresh(true); + } + } + + public string PluginName() + { + return "My Refresh"; + } + + private void Refresh(bool refreshEverything) + { + if (refreshEverything && File.Exists(GUIGraphicsContext.SkinCacheFolder + @"\packedgfx2.bxml")) + { + File.Delete(GUIGraphicsContext.SkinCacheFolder + @"\packedgfx2.bxml"); + } + if (refreshEverything) + { + GUITextureManager.Clear(); + GUITextureManager.Init(); + } + if (refreshEverything) + { + //GUILocalizeStrings.Clear(); + GUILocalizeStrings.Load(@"language\" + this._language + @"\strings.xml"); + } + if (refreshEverything) + { + GUIFontManager.LoadFonts(@"skin\" + GUIGraphicsContext.Skin + @"\fonts.xml"); + GUIFontManager.InitializeDeviceObjects(); + } + GUIControlFactory.ClearReferences(); + GUIControlFactory.LoadReferences(GUIGraphicsContext.Skin + @"\references.xml"); + GUIWindowManager.OnResize(); + GUIWindow window = GUIWindowManager.GetWindow(GUIWindowManager.ActiveWindow); + if (GUIWindowManager.IsRouted) + { + window = GUIWindowManager.GetWindow(GUIWindowManager.RoutedWindow); + } + if (window != null) + { + window.Restore(); + GUIWindowManager.ActivateWindow(window.GetID); + } + } + + public void ShowPlugin() + { + } + + public void Start() + { + Log.Info("MyRefresh: Plugin started", new object[0]); + using (MediaPortal.Profile.Settings settings = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + { + this._language = settings.GetValueAsString("skin", "language", string.Empty); + } + if (this._language == string.Empty) + { + this._language = "English"; + } + GUIWindowManager.OnNewAction += new OnActionHandler(this.OnAction); + } + + public void Stop() + { + GUIWindowManager.OnNewAction -= new OnActionHandler(this.OnAction); + } + + public bool WndProc(ref Message msg) + { + if (msg.Msg != 0x101) + { + return false; + } + if (msg.WParam != ((IntPtr)0x74)) + { + return false; + } + this.Refresh((Control.ModifierKeys & Keys.Control) != Keys.None); + return true; + } + } +} + Added: trunk/plugins/My Refresh/MyRefresh.csproj =================================================================== --- trunk/plugins/My Refresh/MyRefresh.csproj (rev 0) +++ trunk/plugins/My Refresh/MyRefresh.csproj 2007-03-30 10:01:07 UTC (rev 262) @@ -0,0 +1,122 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <ProjectType>Local</ProjectType> + <ProductVersion>8.0.50727</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{0F2811BE-6B64-42B6-B374-B4ED04648825}</ProjectGuid> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ApplicationIcon> + </ApplicationIcon> + <AssemblyKeyContainerName> + </AssemblyKeyContainerName> + <AssemblyName>MyRefresh</AssemblyName> + <AssemblyOriginatorKeyFile> + </AssemblyOriginatorKeyFile> + <DefaultClientScript>JScript</DefaultClientScript> + <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout> + <DefaultTargetSchema>IE50</DefaultTargetSchema> + <DelaySign>false</DelaySign> + <OutputType>Library</OutputType> + <RootNamespace>MyRefresh</RootNamespace> + <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent> + <StartupObject> + </StartupObject> + <FileUpgradeFlags> + </FileUpgradeFlags> + <UpgradeBackupLocation> + </UpgradeBackupLocation> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <OutputPath>bin\Debug\</OutputPath> + <AllowUnsafeBlocks>false</AllowUnsafeBlocks> + <BaseAddress>285212672</BaseAddress> + <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow> + <ConfigurationOverrideFile> + </ConfigurationOverrideFile> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <DocumentationFile> + </DocumentationFile> + <DebugSymbols>true</DebugSymbols> + <FileAlignment>4096</FileAlignment> + <NoStdLib>false</NoStdLib> + <NoWarn> + </NoWarn> + <Optimize>false</Optimize> + <RegisterForComInterop>false</RegisterForComInterop> + <RemoveIntegerChecks>false</RemoveIntegerChecks> + <TreatWarningsAsErrors>false</TreatWarningsAsErrors> + <WarningLevel>4</WarningLevel> + <DebugType>full</DebugType> + <ErrorReport>prompt</ErrorReport> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <OutputPath>bin\Release\</OutputPath> + <AllowUnsafeBlocks>false</AllowUnsafeBlocks> + <BaseAddress>285212672</BaseAddress> + <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow> + <ConfigurationOverrideFile> + </ConfigurationOverrideFile> + <DefineConstants>TRACE</DefineConstants> + <DocumentationFile> + </DocumentationFile> + <DebugSymbols>false</DebugSymbols> + <FileAlignment>4096</FileAlignment> + <NoStdLib>false</NoStdLib> + <NoWarn> + </NoWarn> + <Optimize>true</Optimize> + <RegisterForComInterop>false</RegisterForComInterop> + <RemoveIntegerChecks>false</RemoveIntegerChecks> + <TreatWarningsAsErrors>false</TreatWarningsAsErrors> + <WarningLevel>4</WarningLevel> + <DebugType>none</DebugType> + <ErrorReport>prompt</ErrorReport> + <PlatformTarget>x86</PlatformTarget> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> + <DebugSymbols>true</DebugSymbols> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <BaseAddress>285212672</BaseAddress> + <DebugType>full</DebugType> + <PlatformTarget>x86</PlatformTarget> + <ErrorReport>prompt</ErrorReport> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <BaseAddress>285212672</BaseAddress> + <Optimize>true</Optimize> + <DebugType> + </DebugType> + <PlatformTarget>x86</PlatformTarget> + <ErrorReport>prompt</ErrorReport> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + <Reference Include="System.Windows.Forms" /> + </ItemGroup> + <ItemGroup> + <Compile Include="MyRefresh.cs"> + <SubType>Code</SubType> + </Compile> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\..\..\Documents\Coding\Mediaportal Check\Core\Core.csproj"> + <Project>{02FFFC1F-2555-4B99-8B01-3432D0673855}</Project> + <Name>Core</Name> + </ProjectReference> + <ProjectReference Include="..\..\..\Documents\Coding\Mediaportal Check\Utils\Utils.csproj"> + <Project>{6DA0E4DF-6230-4642-98B5-E690BB6942BB}</Project> + <Name>Utils</Name> + </ProjectReference> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <PropertyGroup> + <PreBuildEvent> + </PreBuildEvent> + <PostBuildEvent> + </PostBuildEvent> + </PropertyGroup> +</Project> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-04-02 12:54:51
|
Revision: 276 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=276&view=rev Author: and-81 Date: 2007-04-02 05:54:44 -0700 (Mon, 02 Apr 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MCEReplacement/AssemblyInfo.cs trunk/plugins/MCEReplacement/MCEReplacement.cs trunk/plugins/MCEReplacement/MCEReplacement.csproj trunk/plugins/TV3MceBlaster/AssemblyInfo.cs Modified: trunk/plugins/MCEReplacement/AssemblyInfo.cs =================================================================== --- trunk/plugins/MCEReplacement/AssemblyInfo.cs 2007-04-02 10:08:23 UTC (rev 275) +++ trunk/plugins/MCEReplacement/AssemblyInfo.cs 2007-04-02 12:54:44 UTC (rev 276) @@ -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.2.0")] -[assembly: AssemblyFileVersionAttribute("1.0.2.0")] +[assembly: AssemblyVersion("1.0.3.0")] +[assembly: AssemblyFileVersionAttribute("1.0.3.0")] // // In order to sign your assembly you must specify a key to use. Refer to the Modified: trunk/plugins/MCEReplacement/MCEReplacement.cs =================================================================== --- trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-04-02 10:08:23 UTC (rev 275) +++ trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-04-02 12:54:44 UTC (rev 276) @@ -26,7 +26,7 @@ #region Constants - public const string PluginVersion = "MCE Replacement Plugin 1.0.3.0 for MediaPortal + SVN"; + public const string PluginVersion = "MCE Replacement Plugin 1.0.3.0 for MediaPortal 0.2.1.0"; public const int MessageModeCommand = 0x0018; Modified: trunk/plugins/MCEReplacement/MCEReplacement.csproj =================================================================== --- trunk/plugins/MCEReplacement/MCEReplacement.csproj 2007-04-02 10:08:23 UTC (rev 275) +++ trunk/plugins/MCEReplacement/MCEReplacement.csproj 2007-04-02 12:54:44 UTC (rev 276) @@ -152,29 +152,28 @@ <Compile Include="Win32.cs" /> </ItemGroup> <ItemGroup> - <Reference Include="Core, Version=1.0.2581.1884, Culture=neutral, processorArchitecture=MSIL"> + <Reference Include="Core, Version=1.0.2485.22312, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\MediaPortal\Core\bin\Release\Core.dll</HintPath> + <HintPath>..\..\MediaPortal 0.2.1.0\Core.DLL</HintPath> <Private>False</Private> </Reference> - <Reference Include="Databases, Version=1.0.2581.1890, Culture=neutral, processorArchitecture=MSIL"> + <Reference Include="Databases, Version=1.0.2485.22313, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\MediaPortal\Databases\bin\Release\Databases.dll</HintPath> + <HintPath>..\..\MediaPortal 0.2.1.0\Databases.DLL</HintPath> <Private>False</Private> </Reference> - <Reference Include="Dialogs, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL"> + <Reference Include="Dialogs, Version=0.0.0.0, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\MediaPortal\Dialogs\bin\Release\Dialogs.dll</HintPath> + <HintPath>..\..\MediaPortal 0.2.1.0\Dialogs.DLL</HintPath> <Private>False</Private> </Reference> <Reference Include="Microsoft.DirectX.Direct3D, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\MediaPortal\xbmc\bin\Release\Microsoft.DirectX.Direct3D.dll</HintPath> - <Private>False</Private> + <HintPath>..\..\MediaPortal 0.2.1.0\Microsoft.DirectX.Direct3D.dll</HintPath> </Reference> - <Reference Include="RemotePlugins, Version=1.0.2581.1913, Culture=neutral, processorArchitecture=MSIL"> + <Reference Include="RemotePlugins, Version=1.0.2485.22315, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\MediaPortal\RemotePlugins\bin\Release\RemotePlugins.dll</HintPath> + <HintPath>..\..\MediaPortal 0.2.1.0\RemotePlugins.DLL</HintPath> <Private>False</Private> </Reference> <Reference Include="System" /> @@ -182,16 +181,11 @@ <Reference Include="System.Drawing" /> <Reference Include="System.Windows.Forms" /> <Reference Include="System.Xml" /> - <Reference Include="TVCapture, Version=1.0.2581.1894, Culture=neutral, processorArchitecture=MSIL"> + <Reference Include="TVCapture, Version=1.0.2485.22314, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\MediaPortal\TVCapture\bin\Release\TVCapture.dll</HintPath> + <HintPath>..\..\MediaPortal 0.2.1.0\TVCapture.DLL</HintPath> <Private>False</Private> </Reference> - <Reference Include="Utils, Version=1.0.2581.1867, Culture=neutral, processorArchitecture=MSIL"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\MediaPortal\Utils\bin\Release\Utils.dll</HintPath> - <Private>False</Private> - </Reference> </ItemGroup> <ItemGroup> <EmbeddedResource Include="Forms\ExternalChannels.resx"> Modified: trunk/plugins/TV3MceBlaster/AssemblyInfo.cs =================================================================== --- trunk/plugins/TV3MceBlaster/AssemblyInfo.cs 2007-04-02 10:08:23 UTC (rev 275) +++ trunk/plugins/TV3MceBlaster/AssemblyInfo.cs 2007-04-02 12:54:44 UTC (rev 276) @@ -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.2.0")] -[assembly: AssemblyFileVersionAttribute("1.0.2.0")] +[assembly: AssemblyVersion("1.0.3.0")] +[assembly: AssemblyFileVersionAttribute("1.0.3.0")] // // In order to sign your assembly you must specify a key to use. Refer to the This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gre...@us...> - 2007-04-14 00:36:09
|
Revision: 318 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=318&view=rev Author: gregmac45 Date: 2007-04-13 17:36:06 -0700 (Fri, 13 Apr 2007) Log Message: ----------- Initial Import Added Paths: ----------- trunk/plugins/OnlineVideoSettings.xml trunk/plugins/Skin/ trunk/plugins/Skin/BlueTwo/ trunk/plugins/Skin/BlueTwo/myonlinevideos.xml trunk/plugins/Source/ trunk/plugins/Source/AbcUtil.cs trunk/plugins/Source/AssemblyInfo.cs trunk/plugins/Source/BlipTvUtil.cs trunk/plugins/Source/BreakUtil.cs trunk/plugins/Source/CbsUtil.cs trunk/plugins/Source/DailyMotionUtil.cs trunk/plugins/Source/DownloadedVideoUtil.cs trunk/plugins/Source/FlashVideoScreen.cs trunk/plugins/Source/GUIOnlineVideos.cs trunk/plugins/Source/GameTrailersUtil.cs trunk/plugins/Source/GoogleVideoUtil.cs trunk/plugins/Source/GrouperUtil.cs trunk/plugins/Source/GubaUtil.cs trunk/plugins/Source/ImageDowloader.cs trunk/plugins/Source/ItunesTrailerUtil.cs trunk/plugins/Source/ItunesUtils/ trunk/plugins/Source/ItunesUtils/AppleTrailers.cs trunk/plugins/Source/ItunesUtils/GUIQTTrailers.cs trunk/plugins/Source/ItunesUtils/HDHelper.cs trunk/plugins/Source/ItunesUtils/HttpReader.cs trunk/plugins/Source/ItunesUtils/ItmsContent.cs trunk/plugins/Source/ItunesUtils/ItmsHelper.cs trunk/plugins/Source/ItunesUtils/RegexParsers.cs trunk/plugins/Source/ItunesUtils/TrailerIndex.cs trunk/plugins/Source/ItunesUtils/TrailerInfo.cs trunk/plugins/Source/ItunesUtils/TrailerInfoCollection.cs trunk/plugins/Source/ItunesUtils/TrailerStream.cs trunk/plugins/Source/ItunesUtils/TrailerStreamCollection.cs trunk/plugins/Source/Main.cs trunk/plugins/Source/MetaCafeUtil.cs trunk/plugins/Source/OnlineVideos.csproj trunk/plugins/Source/OnlineVideos.csproj.user trunk/plugins/Source/OnlineVideos.sln trunk/plugins/Source/OnlineVideos.suo trunk/plugins/Source/Properties/ trunk/plugins/Source/Properties/AssemblyInfo.cs trunk/plugins/Source/Runner.csproj trunk/plugins/Source/SiteUtilBase.cs trunk/plugins/Source/SiteUtilFactory.cs trunk/plugins/Source/SoapBoxUtil.cs trunk/plugins/Source/VideoJugUtil.cs trunk/plugins/Source/VidiLifeUtil.cs trunk/plugins/Source/YouTubeUtil.cs trunk/plugins/Source/bin/ trunk/plugins/Source/bin/Debug/ trunk/plugins/Source/obj/ trunk/plugins/Source/obj/Debug/ Added: trunk/plugins/OnlineVideoSettings.xml =================================================================== --- trunk/plugins/OnlineVideoSettings.xml (rev 0) +++ trunk/plugins/OnlineVideoSettings.xml 2007-04-14 00:36:06 UTC (rev 318) @@ -0,0 +1,191 @@ +<settings> +<filter></filter><!-- comma delimited example: <filter>dog,cat,snake</filter> --> +<thumbLocation>C:\OnlineVideoThumbnails\</thumbLocation> +<sites> +<site> +<name>YouTube</name> +<id>1</id> +<!-- set the user if you wish to able to see youtube favorites --> +<user></user> +<!-- set the password if you wish to add/delete favorites to youtube --> +<password></password> +<!-- set the confirmAge to yes if you wish to confirm your age to view certain videos --> +<confirmAge>no</confirmAge> +<rss name="Top Rated"><![CDATA[http://youtube.com/rss/global/top_rated.rss]]></rss> +<rss name="Recently Added"><![CDATA[http://youtube.com/rss/global/recently_added.rss]]></rss> +<rss name="Recently Featured"><![CDATA[http://youtube.com/rss/global/recently_featured.rss]]></rss> +<rss name="Top Favorites"><![CDATA[http://youtube.com/rss/global/top_favorites.rss]]></rss> +<rss name="Top Viewed"><![CDATA[http://youtube.com/rss/global/top_viewed.rss]]></rss> +<rss name="Top Viewed:Today"><![CDATA[http://youtube.com/rss/global/top_viewed_today.rss]]></rss> +<rss name="Top Viewed:This Week"><![CDATA[http://youtube.com/rss/global/top_viewed_week.rss]]></rss> +<rss name="Top Viewed:This Month"><![CDATA[http://youtube.com/rss/global/top_viewed_month.rss]]></rss> +<rss name="Most Discussed:Today"><![CDATA[http://youtube.com/rss/global/most_discussed_today.rss]]></rss> +<rss name="Most Discussed:This Week"><![CDATA[http://youtube.com/rss/global/most_discussed_week.rss]]></rss> +<rss name="Most Discussed:This Month"><![CDATA[http://youtube.com/rss/global/most_discussed_month.rss]]></rss> +<rss name="Search"><![CDATA[http://www.youtube.com/rss/tag/{0}.rss]]></rss> +</site> +<site> +<name>Google Video</name> +<id>2</id> +<rss name="Popular"><![CDATA[http://video.google.com/videofeed?type=popular&num=100&output=rss]]></rss> +<rss name="Random"><![CDATA[http://video.google.com/videofeed?type=random&num=100&output=rss]]></rss> +<rss name="Comedy"><![CDATA[http://video.google.com/videofeed?type=search&q=genre:comedy&so=1&num=50]]></rss> +<rss name="Music Video"><![CDATA[http://video.google.com/videofeed?type=search&q=type:music_video&so=1&num=50]]></rss> +<rss name="Movie Trailer"><![CDATA[http://video.google.com/videofeed?type=search&q=type:movie_trailer&so=1&num=50]]></rss> +<rss name="TV Show"><![CDATA[http://video.google.com/videofeed?type=search&q=type:tvshow&so=1&num=50]]></rss> +<rss name="Sports"><![CDATA[http://video.google.com/videofeed?type=search&q=type:sports%20OR%20genre:sports&so=1&num=50]]></rss> +<rss name="Educational"><![CDATA[http://video.google.com/videofeed?type=search&q=genre:educational&so=1&num=50]]></rss> +<rss name="Google Picks"><![CDATA[http://video.google.com/videofeed?type=search&q=type:gpick&so=1&num=50]]></rss> +<rss name="Search"><![CDATA[http://video.google.com/videofeed?type=search&q={0}&so=1&num=50]]></rss> +</site> +<site> +<name>Grouper</name> +<id>3</id> +<rss name="Featured"><![CDATA[http://grouper.com/rss/media.ashx?o=0&t=1&fx=&fp=1]]></rss> +<rss name="Newest"><![CDATA[http://www.grouper.com/rss/media.ashx?o=0&fx=]]></rss> +<rss name="Most Viewed"><![CDATA[http://www.grouper.com/rss/media.ashx?o=1&t=1&fx=]]></rss> +<rss name="Most Discussed"><![CDATA[http://www.grouper.com/rss/media.ashx?o=4&t=1&fx=]]></rss> +<rss name="Highest Rated"><![CDATA[http://www.grouper.com/rss/media.ashx?o=3&fx=]]></rss> +<rss name="Most Viral"><![CDATA[http://www.grouper.com/rss/media.ashx?o=6&fx=]]></rss> +</site> +<!-- NOT WORKING CURRENTLY. Videos don't always play. +<site> +<name>Guba</name> +<id>4</id> +<rss name="Action"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=562&o=0&set=5]]></rss> +<rss name="Animation"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=457&o=0&set=5]]></rss> +<rss name="Classics"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=807&o=0&set=5]]></rss> +<rss name="Comedy"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=456&o=0&set=5]]></rss> +<rss name="Documentary"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=460&o=0&set=5]]></rss> +<rss name="Drama"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=459&o=0&set=5]]></rss> +<rss name="Educational"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=513&o=0&set=5]]></rss> +<rss name="Family"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=514&o=0&set=5]]></rss> +<rss name="Foreign"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=463&o=0&set=5]]></rss> +<rss name="Independent"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=515&o=0&set=5]]></rss> +<rss name="Miscellaneous"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=458&o=0&set=5]]></rss> +<rss name="Music Videos"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=462&o=0&set=5]]></rss> +<rss name="Romance"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=516&o=0&set=5]]></rss> +<rss name="Sports"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=461&o=0&set=5]]></rss> +<rss name="TV Shows"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=806&o=0&set=5]]></rss> +<rss name="Thriller"><![CDATA[http://www.guba.com/rss_feed/rss.pcast?type=itunes&category_id=517&o=0&set=5]]></rss> +</site> +--> +<site> +<name>MetaCafe</name> +<id>5</id> +<rss name="New Videos"><![CDATA[http://www.metacafe.com/rss/new_videos.rss]]></rss> +</site> +<site> +<name>DailyMotion</name> +<id>6</id> +<rss name="Font Page"><![CDATA[http://www.dailymotion.com/rss]]></rss> +<rss name="Ads"><![CDATA[http://www.dailymotion.com/rss/cluster/ads]]></rss> +<rss name="Animals"><![CDATA[http://www.dailymotion.com/rss/cluster/animals]]></rss> +<rss name="Fun"><![CDATA[http://www.dailymotion.com/rss/cluster/fun]]></rss> +<rss name="Auto"><![CDATA[http://www.dailymotion.com/rss/cluster/auto]]></rss> +<rss name="Street"><![CDATA[http://www.dailymotion.com/rss/cluster/street]]></rss> +<rss name="Creation"><![CDATA[http://www.dailymotion.com/rss/cluster/creation]]></rss> +<rss name="Short Films"><![CDATA[http://www.dailymotion.com/rss/cluster/shortfilms]]></rss> +<rss name="Business"><![CDATA[http://www.dailymotion.com/rss/cluster/business]]></rss> +<rss name="Tech"><![CDATA[http://www.dailymotion.com/rss/cluster/tech]]></rss> +<rss name="Sport"><![CDATA[http://www.dailymotion.com/rss/cluster/sport]]></rss> +<rss name="Extreme"><![CDATA[http://www.dailymotion.com/rss/cluster/extreme]]></rss> +<rss name="Events"><![CDATA[http://www.dailymotion.com/rss/cluster/events]]></rss> +<rss name="Family"><![CDATA[http://www.dailymotion.com/rss/cluster/family]]></rss> +<rss name="Music"><![CDATA[http://www.dailymotion.com/rss/cluster/music]]></rss> +<rss name="News"><![CDATA[http://www.dailymotion.com/rss/cluster/news]]></rss> +<rss name="Parties"><![CDATA[http://www.dailymotion.com/rss/cluster/parties]]></rss> +<rss name="School"><![CDATA[http://www.dailymotion.com/rss/cluster/school]]></rss> +<rss name="Travel"><![CDATA[http://www.dailymotion.com/rss/cluster/travel]]></rss> +<rss name="Video Games"><![CDATA[http://www.dailymotion.com/rss/cluster/videogames]]></rss> +<rss name="Blog"><![CDATA[http://www.dailymotion.com/rss/cluster/blog]]></rss> +<rss name="3D"><![CDATA[http://www.dailymotion.com/rss/cluster/3D]]></rss> +<rss name="Dating"><![CDATA[http://www.dailymotion.com/rss/cluster/dating]]></rss> +<rss name="Search"><![CDATA[http://www.dailymotion.com/rss/relevance/search/{0}]]></rss> +</site> +<!-- +<site> +<name>ABC Online</name> +<id>8</id> +<rss name="videos" dynamic="yes"><![CDATA[http://ll.static.abc.com/streaming/s/catalog?aff=&isIE=true]]></rss> +</site> +--> +<site> +<name>BlipTV</name> +<id>9</id> +<rss name="videos"><![CDATA[http://blip.tv/?1=1&search=soccer;page=1;s=posts&skin=rss]]></rss> +</site> +<!-- +<site> +<name>CBS Innertube</name> +<id>10</id> +<rss name="videos" dynamic="yes"><![CDATA[http://www.cbs.com/xml2/browseMenu/76.xml]]></rss> +</site> +--> +<site> +<name>GameTrailers</name> +<id>11</id> +<rss name="videos"><![CDATA[http://www.gametrailers.com/rss/newest.xml]]></rss> +</site> +<!-- +<site> +<name>MSN SoapBox</name> +<id>12</id> +<rss name="videos"><![CDATA[http://soapbox.msn.com/rss.aspx?listId=mostpopular&categoryId=8118b646-92c6-4051-a1eb-40ef4ee49ec1]]></rss> +</site> +--> +<site> +<name>Video Jug</name> +<id>13</id> +<rss name="videos"><![CDATA[http://www.videojug.com/rss]]></rss> +</site> +<site> +<name>VidiLife</name> +<id>14</id> +<rss name="videos"><![CDATA[http://rss.vidilife.com/rss.aspx]]></rss> +</site> +<site> +<name>Apple Trailers</name> +<id>15</id> +<rss name="New Trailers"><![CDATA[http://www.apple.com/moviesxml/h/view1_all.xml]]></rss> +<rss name="Action and Adventure"><![CDATA[http://movies.apple.com/moviesxml/g/action_and_adventure_1.xml]]></rss> +<rss name="Comedy"><![CDATA[http://movies.apple.com/moviesxml/g/comedy_1.xml]]></rss> +<rss name="Documentary"><![CDATA[http://movies.apple.com/moviesxml/g/documentary_1.xml]]></rss> +<rss name="Drama"><![CDATA[http://movies.apple.com/moviesxml/g/drama_1.xml]]></rss> +<rss name="Family"><![CDATA[http://movies.apple.com/moviesxml/g/family_1.xml]]></rss> +<rss name="Foreign"><![CDATA[http://movies.apple.com/moviesxml/g/fantasy_1.xml]]></rss> +<rss name="Horror"><![CDATA[http://movies.apple.com/moviesxml/g/horror_1.xml]]></rss> +<rss name="Musical"><![CDATA[http://movies.apple.com/moviesxml/g/musical_1.xml]]></rss> +<rss name="Romance"><![CDATA[http://movies.apple.com/moviesxml/g/romance_1.xml]]></rss> +<rss name="Sience Fiction"><![CDATA[http://movies.apple.com/moviesxml/g/science_fiction_1.xml]]></rss> +<rss name="Thriller"><![CDATA[http://movies.apple.com/moviesxml/g/thriller_1.xml]]></rss> +<rss name="20th Century Fox"><![CDATA[http://movies.apple.com/moviesxml/s/fox/index_1.xml]]></rss> +<rss name="DreamWorks S.K.G"><![CDATA[http://movies.apple.com/moviesxml/s/dreamworks/index_1.xml]]></rss> +<rss name="Focus Features / Rogue Pictures"><![CDATA[http://movies.apple.com/moviesxml/s/focus_features/index_1.xml]]></rss> +<rss name="Fox Searchlight Pictures"><![CDATA[http://movies.apple.com/moviesxml/s/fox_searchlight/index_1.xml]]></rss> +<rss name="Independent"><![CDATA[http://movies.apple.com/moviesxml/s/independent/index_1.xml]]></rss> +<rss name="Lionsgate"><![CDATA[http://movies.apple.com/moviesxml/s/lions_gate/index_1.xml]]></rss> +<rss name="MGM Studios"><![CDATA[http://movies.apple.com/moviesxml/s/mgm/index_1.xml]]></rss> +<rss name="Magnolia Pictures"><![CDATA[http://movies.apple.com/moviesxml/s/magnolia/index_1.xml]]></rss> +<rss name="Miramax Films"><![CDATA[http://movies.apple.com/moviesxml/s/miramax/index_1.xml]]></rss> +<rss name="New Line Cinema"><![CDATA[http://movies.apple.com/moviesxml/s/newline/index_1.xml]]></rss> +<rss name="Paramount Pictures"><![CDATA[http://movies.apple.com/moviesxml/s/paramount/index_1.xml]]></rss> +<rss name="Paramount Vantage"><![CDATA[http://movies.apple.com/moviesxml/s/paramount_vantage/index_1.xml]]></rss> +<rss name="Picturehouse"><![CDATA[http://movies.apple.com/moviesxml/s/picturehouse/index_1.xml]]></rss> +<rss name="Rogue Pictures"><![CDATA[http://movies.apple.com/moviesxml/s/rogue_pictures/index_1.xml]]></rss> +<rss name="Sony Pictures"><![CDATA[http://movies.apple.com/moviesxml/s/sony_pictures/index_1.xml]]></rss> +<rss name="Sony Pictures Classics"><![CDATA[http://movies.apple.com/moviesxml/s/sony/index_1.xml]]></rss> +<rss name="Touchstone Pictures"><![CDATA[http://movies.apple.com/moviesxml/s/touchstone/index_1.xml]]></rss> +<rss name="Universal Pictures"><![CDATA[http://movies.apple.com/moviesxml/s/universal/index_1.xml]]></rss> +<rss name="Walt Disney Pictures"><![CDATA[http://movies.apple.com/moviesxml/s/disney/index_1.xml]]></rss> +<rss name="Warner Bros. Pictures"><![CDATA[http://movies.apple.com/moviesxml/s/wb/index_1.xml]]></rss> +<rss name="Warner Independent Pictures"><![CDATA[http://movies.apple.com/moviesxml/s/warner_independent_pictures/index_1.xml]]></rss> +<rss name="Weinstein"><![CDATA[http://movies.apple.com/moviesxml/s/weinstein/index_1.xml]]></rss> +</site> +<site> +<id>99</id> +<name>Downloaded Videos</name> +<rss name="Downloads"><![CDATA[C:\FlashVideos\]]></rss> +</site> +</sites> +</settings> \ No newline at end of file Added: trunk/plugins/Skin/BlueTwo/myonlinevideos.xml =================================================================== --- trunk/plugins/Skin/BlueTwo/myonlinevideos.xml (rev 0) +++ trunk/plugins/Skin/BlueTwo/myonlinevideos.xml 2007-04-14 00:36:06 UTC (rev 318) @@ -0,0 +1,22 @@ +<window> + <id>4755</id> + <defaultcontrol>50</defaultcontrol> + <allowoverlay>yes</allowoverlay> + <define>#header.label:MyOnlineVideos</define> + <controls> + <import>common.window.xml</import> + <import>common.facade.xml</import> + <control> + <type>button</type> + <description>View button</description> + <id>2</id> + <posX>60</posX> + <posY>97</posY> + <onleft>4</onleft> + <onright>50</onright> + <onup>3</onup> + <ondown>2</ondown> + <label>101</label> + </control> + </controls> +</window> \ No newline at end of file Added: trunk/plugins/Source/AbcUtil.cs =================================================================== --- trunk/plugins/Source/AbcUtil.cs (rev 0) +++ trunk/plugins/Source/AbcUtil.cs 2007-04-14 00:36:06 UTC (rev 318) @@ -0,0 +1,131 @@ +using System; +using MediaPortal.GUI.Library; +using System.Text.RegularExpressions; +using System.Net; +using System.Text; +using MediaPortal.Player; +using System.Collections.Generic; +//using MediaPortal.Utils.Services; +using MediaPortal.GUI.View ; +using MediaPortal.Dialogs; +using System.Xml; +using System.Xml.XPath; +using System.ComponentModel; +using System.Threading; + + + +namespace OnlineVideos +{ + public class AbcUtil:SiteUtilBase + { + //private String msXmlLink; + public override List<GUIOnlineVideos.VideoInfo> getSiteFavorites() + { + throw new Exception("The method or operation is not implemented."); + } + public override bool isSiteFavoritesEnabled() + { + return false; + } + + public 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(); + video.Description = rssItem.mediaDescription; + video.ImageUrl = rssItem.mediaThumbnail; + video.Title = rssItem.title; + foreach(MediaContent content in rssItem.contentList){ + if(content.type.Contains("flv")){ + video.VideoUrl = content.url; + break; + } + } + loVideoList.Add(video); + } + return loVideoList; + } + /* + public List<GUIOnlineVideos.VideoInfo> getRssData(String fsUrl) + { + + + XmlDocument doc = new XmlDocument(); + //XPathDocument doc = new XPathDocument(fsUrl); + + doc.Load(XmlReader.Create("http://ll.static.abc.com/streaming/s/catalog?aff=&isIE=true")); + XmlNamespaceManager expr = new XmlNamespaceManager(doc.NameTable); + expr.AddNamespace("media", "http://search.yahoo.com/mrss"); + XmlNode StreamServerNode = doc.SelectSingleNode("//config/streamServer"); + String lsStreamServer = "RTMP://"+StreamServerNode.InnerText; + Console.WriteLine("Stream Server ={0} ",lsStreamServer); + + //Create the root XmlNode and generate an XmlNodeList from it. + XmlNode root = doc.SelectSingleNode("//streaming/catalog/channel", expr); + XmlNodeList nodeList; + nodeList = root.SelectNodes("//streaming/catalog/channel[title='Six Degrees']/episode"); + //Console.WriteLine(nodeList.Count); + + + //RssItem loRssItem = new RssItem(); + //loRssItem. + //This loops through each node found in the nodeList and adds the + //Node data to the DataTable. + //XmlAttributeCollection ac; + List<GUIOnlineVideos.VideoInfo> loRssItems = new List<GUIOnlineVideos.VideoInfo>(); + GUIOnlineVideos.VideoInfo loRssItem; + //GUIListItem loListItem; + foreach (XmlNode chileNode in nodeList) + { + loRssItem = new GUIOnlineVideos.VideoInfo(); + + XmlNode node = chileNode.SelectSingleNode("title"); + loRssItem.Title = node.InnerText; + + //node = chileNode.SelectSingleNode("link"); + //loRssItem.link = node.InnerText; + + node = chileNode.SelectSingleNode("description"); + loRssItem.Description = node.InnerText; + + node = chileNode.SelectSingleNode("screenShot", expr); + if (node != null) + { + //ac = node.Attributes; + loRssItem.ImageUrl = node.InnerText; + } + + + XmlNodeList SegNodeList = chileNode.SelectNodes("segment/HighStreamURL", expr); + loRssItem.VideoUrl = ""; + foreach(XmlNode SegNode in SegNodeList ) + { + //ac = node.Attributes; + loRssItem.VideoUrl = loRssItem.VideoUrl+lsStreamServer+SegNode.InnerText+","; + } + //Console.WriteLine(loRssItem.VideoUrl.ToString()); + + //Log.Write(loRssItem.ToString()); + //loListItem = new GUIListItem(loRssItem.title); + //loListItem.Path = loRssItem.videoUrl; + loRssItems.Add(loRssItem); + + + } + return loRssItems; + } + + */ + + } +} Added: trunk/plugins/Source/AssemblyInfo.cs =================================================================== --- trunk/plugins/Source/AssemblyInfo.cs (rev 0) +++ trunk/plugins/Source/AssemblyInfo.cs 2007-04-14 00:36:06 UTC (rev 318) @@ -0,0 +1,31 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// Information about this assembly is defined by the following +// attributes. +// +// change them to the information which is associated with the assembly +// you compile. + +[assembly: AssemblyTitle("Runner")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Runner")] +[assembly: AssemblyCopyright("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// This sets the default COM visibility of types in the assembly to invisible. +// If you need to expose a type to COM, use [ComVisible(true)] on that type. +[assembly: ComVisible(false)] + +// The assembly version has following format : +// +// Major.Minor.Build.Revision +// +// You can specify all values by your own or you can build default build and revision +// numbers with the '*' character (the default): + +[assembly: AssemblyVersion("1.0.*")] Added: trunk/plugins/Source/BlipTvUtil.cs =================================================================== --- trunk/plugins/Source/BlipTvUtil.cs (rev 0) +++ trunk/plugins/Source/BlipTvUtil.cs 2007-04-14 00:36:06 UTC (rev 318) @@ -0,0 +1,115 @@ +using System; +using MediaPortal.GUI.Library; +using System.Text.RegularExpressions; +using System.Net; +using System.Text; +using MediaPortal.Player; +using System.Collections.Generic; +//using MediaPortal.Utils.Services; +using MediaPortal.GUI.View ; +using MediaPortal.Dialogs; +using System.Xml; +using System.Xml.XPath; +using System.ComponentModel; +using System.Threading; + + + +namespace OnlineVideos +{ + public class BlipTvUtil:SiteUtilBase + { + + + public override String getUrl(String fsId) + { + + return fsId + "&txe=.flv"; + } + + 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(); + video.Description = rssItem.mediaDescription; + video.ImageUrl = rssItem.mediaThumbnail; + video.Title = rssItem.title; + foreach(MediaContent content in rssItem.contentList){ + if(content.type.Contains("flv")){ + video.VideoUrl = content.url; + break; + } + } + loVideoList.Add(video); + } + return loVideoList; + } + public List<GUIOnlineVideos.VideoInfo> getRssData(String fsUrl) + { + + XmlDocument doc = new XmlDocument(); + //XPathDocument doc = new XPathDocument(fsUrl); + + doc.Load(XmlReader.Create(fsUrl)); + XmlNamespaceManager expr = new XmlNamespaceManager(doc.NameTable); + expr.AddNamespace("media", "http://search.yahoo.com/mrss"); + + //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"); + //RssItem loRssItem = new RssItem(); + //loRssItem. + //This loops through each node found in the nodeList and adds the + //Node data to the DataTable. + XmlAttributeCollection ac; + List<GUIOnlineVideos.VideoInfo> loRssItems = new List<GUIOnlineVideos.VideoInfo>(); + GUIOnlineVideos.VideoInfo loRssItem; + //GUIListItem loListItem; + foreach (XmlNode chileNode in nodeList) + { + loRssItem = new GUIOnlineVideos.VideoInfo(); + + XmlNode node = chileNode.SelectSingleNode("title"); + loRssItem.Title = node.InnerText; + + //node = chileNode.SelectSingleNode("link"); + //loRssItem.link = node.InnerText; + + node = chileNode.SelectSingleNode("description"); + loRssItem.Description = node.InnerText; + + node = chileNode.SelectSingleNode("media:thumbnail", expr); + if (node != null) + { + ac = node.Attributes; + loRssItem.ImageUrl = ac["url"].InnerText; + } + + + node = chileNode.SelectSingleNode("media:group/media:content[@type=\"video/x-flv\"]", expr); + if (node != null) + { + ac = node.Attributes; + loRssItem.VideoUrl = ac["url"].InnerText; + } + + //Log.Write(loRssItem.ToString()); + //loListItem = new GUIListItem(loRssItem.title); + //loListItem.Path = loRssItem.videoUrl; + loRssItems.Add(loRssItem); + + + } + return loRssItems; + } + + + + + + } +} Added: trunk/plugins/Source/BreakUtil.cs =================================================================== --- trunk/plugins/Source/BreakUtil.cs (rev 0) +++ trunk/plugins/Source/BreakUtil.cs 2007-04-14 00:36:06 UTC (rev 318) @@ -0,0 +1,115 @@ +using System; +using MediaPortal.GUI.Library; +using System.Text.RegularExpressions; +using System.Net; +using System.Text; +using MediaPortal.Player; +using System.Collections.Generic; +//using MediaPortal.Utils.Services; +using MediaPortal.GUI.View ; +using MediaPortal.Dialogs; +using System.Xml; +using System.Xml.XPath; +using System.ComponentModel; +using System.Threading; + + + +namespace OnlineVideos +{ + public class BreakUtil:SiteUtilBase + { + + public override String getUrl(String fsId) + { + String lsHtml = getHTMLData(fsId); + //Log.Write("html to parse to get url = \n{0}",lsHtml); + Regex loPathRegex = new Regex("sGlobalFileName='([^']*)';[^;]*;sGlobalContentFilePath='([^']*)'"); + Regex loUrlRegex = new Regex("so.addVariable\\('sVidLoc', '([^']*)"); + + String lsUrl = loUrlRegex.Match(lsHtml).Groups[1].Value; + Match loMatch = loPathRegex.Match(lsHtml); + String lsFileName = loMatch.Groups[1].Value; + String lsPathName = loMatch.Groups[2].Value; + lsUrl = lsUrl+lsPathName+"/"+lsFileName+".flv"; + Log.Write("break flv url = {0}",lsUrl); + return lsUrl; + } + 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(); + video.Description = rssItem.description; + video.ImageUrl = rssItem.enclosure; + video.Title = rssItem.title; + //foreach(MediaContent content in rssItem.contentList){ + // if(content.type.Contains("flv")){ + video.VideoUrl = rssItem.link; + // break; + // } + loVideoList.Add(video); + } + return loVideoList; + } + /* + public List<GUIOnlineVideos.VideoInfo> getRssData(String fsUrl) + { + + XmlDocument doc = new XmlDocument(); + //XPathDocument doc = new XPathDocument(fsUrl); + + doc.Load(XmlReader.Create(fsUrl)); + //XmlNamespaceManager expr = new XmlNamespaceManager(doc.NameTable); + //expr.AddNamespace("", "http://search.yahoo.com/mrss"); + //Console.WriteLine(doc.InnerXml); + //Create the root XmlNode and generate an XmlNodeList from it. + XmlNode root = doc.SelectSingleNode("//rss/channel/item"); + if(root==null){ + Console.WriteLine(root); + + } + XmlNodeList nodeList; + nodeList = root.SelectNodes("//rss/channel/item"); + //RssItem loRssItem = new RssItem(); + //loRssItem. + //This loops through each node found in the nodeList and adds the + //Node data to the DataTable. + XmlAttributeCollection ac; + List<GUIOnlineVideos.VideoInfo> loRssItems = new List<GUIOnlineVideos.VideoInfo>(); + GUIOnlineVideos.VideoInfo loRssItem; + //GUIListItem loListItem; + foreach (XmlNode chileNode in nodeList) + { + loRssItem = new GUIOnlineVideos.VideoInfo(); + + XmlNode node = chileNode.SelectSingleNode("title"); + loRssItem.Title = node.InnerText; + + node = chileNode.SelectSingleNode("link"); + loRssItem.VideoUrl = node.InnerText; + + node = chileNode.SelectSingleNode("description"); + loRssItem.Description = node.InnerText; + + node = chileNode.SelectSingleNode("enclosure"); + if (node != null) + { + ac = node.Attributes; + loRssItem.ImageUrl = ac["url"].InnerText; + } + loRssItems.Add(loRssItem); + + + } + + return loRssItems; + } + */ + + + + } +} Added: trunk/plugins/Source/CbsUtil.cs =================================================================== --- trunk/plugins/Source/CbsUtil.cs (rev 0) +++ trunk/plugins/Source/CbsUtil.cs 2007-04-14 00:36:06 UTC (rev 318) @@ -0,0 +1,125 @@ +using System; +using MediaPortal.GUI.Library; +using System.Text.RegularExpressions; +using System.Net; +using System.Text; +using MediaPortal.Player; +using System.Collections.Generic; +//using MediaPortal.Utils.Services; +using MediaPortal.GUI.View ; +using MediaPortal.Dialogs; +using System.Xml; +using System.Xml.XPath; +using System.ComponentModel; +using System.Threading; + + + +namespace OnlineVideos +{ + public class CbsUtil:SiteUtilBase + { + + + + public override String getUrl(String fsId) + { + return "http://video.cgi.cbs.com/vplayer3/play.pl?id="+fsId; + + } + public override List<GUIOnlineVideos.VideoInfo> getVideoList(string fsUrl) + { + return getRssData(fsUrl); + } + public List<GUIOnlineVideos.VideoInfo> getRssData(String fsUrl) + { + + XmlDocument doc = new XmlDocument(); + //XPathDocument doc = new XPathDocument(fsUrl); + + doc.Load(XmlReader.Create("http://www.cbs.com/innertube/xmlProxy.php?type=videoList&id="+fsUrl)); + XmlNamespaceManager expr = new XmlNamespaceManager(doc.NameTable); + expr.AddNamespace("media", "http://search.yahoo.com/mrss"); + + //Create the root XmlNode and generate an XmlNodeList from it. + XmlNode root = doc.SelectSingleNode("//videoList/list/video", expr); + XmlNodeList nodeList; + nodeList = root.SelectNodes("//videoList/list/video"); + //RssItem loRssItem = new RssItem(); + //loRssItem. + //This loops through each node found in the nodeList and adds the + //Node data to the DataTable. + XmlAttributeCollection ac; + List<GUIOnlineVideos.VideoInfo> loRssItems = new List<GUIOnlineVideos.VideoInfo>(); + GUIOnlineVideos.VideoInfo loRssItem; + //GUIListItem loListItem; + foreach (XmlNode childNode in nodeList) + { + loRssItem = new GUIOnlineVideos.VideoInfo(); + ac = childNode.Attributes; + + //XmlNode node = chileNode.SelectSingleNode("title"); + loRssItem.Title = ac["show"].InnerText; + loRssItem.Description = ac["summary"].InnerText; + loRssItem.ImageUrl = "http://www.cbs.com"+ac["image"].InnerText; + loRssItem.VideoUrl = ac["videoID"].InnerText; + + + //Log.Write(loRssItem.ToString()); + //loListItem = new GUIListItem(loRssItem.title); + //loListItem.Path = loRssItem.videoUrl; + loRssItems.Add(loRssItem); + + + } + return loRssItems; + } + public List<GUIOnlineVideos.VideoInfo> getCategories(String fsUrl) + { + + XmlDocument doc = new XmlDocument(); + //XPathDocument doc = new XPathDocument(fsUrl); + + doc.Load(XmlReader.Create(fsUrl)); + XmlNamespaceManager expr = new XmlNamespaceManager(doc.NameTable); + expr.AddNamespace("media", "http://search.yahoo.com/mrss"); + + //Create the root XmlNode and generate an XmlNodeList from it. + XmlNode root = doc.SelectSingleNode("//browseMenu/primary/secondary", expr); + XmlNodeList nodeList; + nodeList = root.SelectNodes("//browseMenu/primary/secondary"); + //RssItem loRssItem = new RssItem(); + //loRssItem. + //This loops through each node found in the nodeList and adds the + //Node data to the DataTable. + XmlAttributeCollection ac; + List<GUIOnlineVideos.VideoInfo> loRssItems = new List<GUIOnlineVideos.VideoInfo>(); + GUIOnlineVideos.VideoInfo loRssItem; + //GUIListItem loListItem; + foreach (XmlNode chileNode in nodeList) + { + loRssItem = new GUIOnlineVideos.VideoInfo(); + + XmlNode node = chileNode.SelectSingleNode("name"); + loRssItem.Title = node.InnerText; + + //node = chileNode.SelectSingleNode("link"); + //loRssItem.link = node.InnerText; + + node = chileNode.SelectSingleNode("id"); + loRssItem.VideoUrl = node.InnerText; + + //node = chileNode.SelectSingleNode("media:group/media:thumbnail", expr); + //get the description and images for the categories + + + loRssItems.Add(loRssItem); + + + } + return loRssItems; + } + + + } +} Added: trunk/plugins/Source/DailyMotionUtil.cs =================================================================== --- trunk/plugins/Source/DailyMotionUtil.cs (rev 0) +++ trunk/plugins/Source/DailyMotionUtil.cs 2007-04-14 00:36:06 UTC (rev 318) @@ -0,0 +1,112 @@ +using System; +using MediaPortal.GUI.Library; +using System.Text.RegularExpressions; +using System.Net; +using System.Text; +using MediaPortal.Player; +using System.Collections.Generic; +//using MediaPortal.Utils.Services; +using MediaPortal.GUI.View ; +using MediaPortal.Dialogs; +using System.Xml; +using System.Xml.XPath; +using System.ComponentModel; +using System.Threading; + + + +namespace OnlineVideos +{ + public class DailyMotionUtil:SiteUtilBase + { + + + public 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(); + video.Description = rssItem.description; + video.ImageUrl = rssItem.mediaThumbnail; + video.Title = rssItem.title; + foreach(MediaContent content in rssItem.contentList){ + if(content.type.Contains("flv")){ + video.VideoUrl = content.url; + break; + } + } + loVideoList.Add(video); + } + return loVideoList; + } + public List<GUIOnlineVideos.VideoInfo> getRssData(String fsUrl) + { + + XmlDocument doc = new XmlDocument(); + + doc.Load(XmlReader.Create(fsUrl)); + XmlNamespaceManager expr = new XmlNamespaceManager(doc.NameTable); + expr.AddNamespace("media", "http://search.yahoo.com/mrss"); + + //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<GUIOnlineVideos.VideoInfo> loRssItems = new List<GUIOnlineVideos.VideoInfo>(); + //RssItem loRssItem; + //GUIListItem loListItem; + GUIOnlineVideos.VideoInfo loVideoInfo; + foreach (XmlNode chileNode in nodeList) + { + //loRssItem = new RssItem(); + loVideoInfo = new GUIOnlineVideos.VideoInfo(); + XmlNode node = chileNode.SelectSingleNode("title"); + //loRssItem.title = node.InnerText; + loVideoInfo.Title = node.InnerText; + + //node = chileNode.SelectSingleNode("link"); + //loRssItem.link = node.InnerText; + + + node = chileNode.SelectSingleNode("description"); + //loRssItem.description = node.InnerText; + loVideoInfo.Description = node.InnerText; + + node = chileNode.SelectSingleNode("media:thumbnail", expr); + if (node != null) + { + ac = node.Attributes; + //loRssItem.imageUrl = ac["url"].InnerText; + loVideoInfo.ImageUrl = ac["url"].InnerText; + } + + + node = chileNode.SelectSingleNode("media:group/media:content[@type=\"video/x-flv\"]", expr); + if (node != null) + { + ac = node.Attributes; + //loRssItem.videoUrl = ac["url"].InnerText; + loVideoInfo.VideoUrl = ac["url"].InnerText; + + } + + //Log.Write(loRssItem.ToString()); + //loListItem = new GUIListItem(loRssItem.title); + //loListItem.Path = loRssItem.videoUrl; + loRssItems.Add(loVideoInfo); + + + } + return loRssItems; + } + } +} Added: trunk/plugins/Source/DownloadedVideoUtil.cs =================================================================== --- trunk/plugins/Source/DownloadedVideoUtil.cs (rev 0) +++ trunk/plugins/Source/DownloadedVideoUtil.cs 2007-04-14 00:36:06 UTC (rev 318) @@ -0,0 +1,48 @@ +using System; +using MediaPortal.GUI.Library; +using System.Text.RegularExpressions; +using System.IO; +using System.Text; +using MediaPortal.Player; +using System.Collections.Generic; +//using MediaPortal.Utils.Services; +using MediaPortal.GUI.View ; +using MediaPortal.Dialogs; +using MediaPortal.Util; +using System.Xml; +using System.Xml.XPath; +using System.ComponentModel; +using System.Threading; + + + +namespace OnlineVideos +{ + public class DownloadedVideoUtil:SiteUtilBase + { + + + public override String getUrl(String fsId) + { + + return fsId; + } + public override List<GUIOnlineVideos.VideoInfo> getVideoList(string fsUrl) + { + List<GUIOnlineVideos.VideoInfo>loVideoInfoList = new List<GUIOnlineVideos.VideoInfo>(); + string[]loVideoList = Directory.GetFiles(fsUrl,"*.flv"); + + GUIOnlineVideos.VideoInfo loVideoInfo; + foreach (String lsVideo in loVideoList) + { + loVideoInfo = new GUIOnlineVideos.VideoInfo(); + loVideoInfo.VideoUrl = lsVideo; + + loVideoInfo.Title = Utils.GetFilename(lsVideo); + loVideoInfoList.Add(loVideoInfo); + } + return loVideoInfoList; + } + + } +} Added: trunk/plugins/Source/FlashVideoScreen.cs =================================================================== --- trunk/plugins/Source/FlashVideoScreen.cs (rev 0) +++ trunk/plugins/Source/FlashVideoScreen.cs 2007-04-14 00:36:06 UTC (rev 318) @@ -0,0 +1,303 @@ +using System; +using MediaPortal.GUI.Library; +using System.Text.RegularExpressions; +using System.Net; +using System.Text; +using MediaPortal.Player; +using MediaPortal.Playlists; +using System.Collections.Generic; +//using MediaPortal.Utils.Services; +using MediaPortal.GUI.View; +using MediaPortal.Dialogs; +using System.Xml; +using System.Xml.XPath; +using System.ComponentModel; +using System.Threading; + + + +namespace GoogleVideos +{ + public class FlashVideoScreen : GUIWindow + { + + [SkinControlAttribute(2)] + protected GUIButtonControl btnBack = null; + [SkinControlAttribute(3)] + protected GUIButtonControl btnPlay = null; + [SkinControlAttribute(4)] + protected GUIButtonControl btnPause = null; + [SkinControlAttribute(5)] + protected GUIButtonControl btnStop = null; + [SkinControlAttribute(6)] + protected GUIButtonControl btnForward = null; + [SkinControlAttribute(7)] + protected GUIButtonControl btnBackward = null; + + [SkinControlAttribute(20)] + protected GUIProgressControl progress = null; + + //private Log moLog; + private String _CurrentFile = String.Empty; + private String _CurrentDescription = String.Empty; + //private List<OnlineVideo> moVideoList = new List<OnlineVideo>(); + + + public FlashVideoScreen() + { + //ServiceProvider loServices = GlobalServiceProvider.Instance; + //moLog = loServices.Get<ILog>(); + } + /* + public string PluginName() + { + + return "GoogleVideo"; + + } + + // Returns the description of the plugin is shown in the plugin menu + + public string Description() + { + + return "Google Video Plugin"; + + } + + // Returns the author of the plugin which is shown in the plugin menu + + public string Author() + { + + return "GregMac45"; + + } + + // show the setup dialog + + public void ShowPlugin() + { + + //MessageBox.Show("Nothing to configure, this is just an example"); + + } + + // Indicates whether plugin can be enabled/disabled + + public bool CanEnable() + { + + return true; + + } + * */ + + // get ID of windowplugin belonging to this setup + + public int GetWindowId() + { + + return GetID; + + } + + // Indicates if plugin is enabled by default; + + public bool DefaultEnabled() + { + + return true; + + } + + // indicates if a plugin has its own setup screen + + //public bool HasSetup() + //{ + + // return false; + + //} + public override int GetID + { + + get + { + + return 4760; + + } + + set + { + + } + + } + + public override bool Init() + { + + return Load(GUIGraphicsContext.Skin + @"\flashvideoscreen.xml"); + + } + /* + public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) + { + + strButtonText = PluginName(); + + strButtonImage = String.Empty; + + strButtonImageFocus = String.Empty; + + strPictureImage = String.Empty; + + return true; + + } + * */ + protected override void OnPageLoad() + { + base.OnPageLoad(); + //if(g_Player.Playing){ + // _CurrentFile = g_Player.CurrentFile; + // } + } + protected override void OnPreviousWindow() + { + g_Player.Stop(); + base.OnPreviousWindow(); + } + public override bool OnMessage(GUIMessage message) + { + + if (message.Message == GUIMessage.MessageType.GUI_MSG_PLAYBACK_STARTED) + { + bool lbPlayFullscreen = false; + //_log.Info("Playback message received from sender:{0}", message.SenderControlId); + if (message.SenderControlId == 4750) + { + if(message.Object!=null){ + String [] loParms = (String []) message.Object; + if(loParms[0].Equals("1")){ + lbPlayFullscreen = true; + } + Log.Info("object:{0}",message.Object); + } + + //label = source + //label2 = title + //label3= description + //label4 = link + //_log.Info("label = {0}", message.Label); + _CurrentFile = message.Label4; + //if (_CurrentFile.EndsWith(".flv") == false) + //{ + + //} + //_log.Info("label2 = {0}", message.Label2); + _CurrentDescription = message.Label3; + + GUIPropertyManager.SetProperty("#TV.View.description", _CurrentDescription); + GUIPropertyManager.SetProperty("#TV.View.title", message.Label2); + //GUIPropertyManager.SetProperty("#TV.View.channel", message.Label); + if(_CurrentFile.IndexOf(',')>0){ + PlayListPlayer loPlayer = PlayListPlayer.SingletonPlayer; + char[] seps = { ',' }; + String[] values = _CurrentFile.Split(seps); + //_CurrentFile.Split(seps); + + PlayList loPlayList = loPlayer.GetPlaylist(PlayListType.PLAYLIST_VIDEO); + foreach(String url in values){ + loPlayList.Add(new PlayListItem("",url)); + } + loPlayer.CurrentPlaylistType = PlayListType.PLAYLIST_VIDEO; + loPlayer.Play(0); + }else{ + g_Player.Play(_CurrentFile); + } + if(lbPlayFullscreen){ + GUIGraphicsContext.IsFullScreenVideo = true; + GUIWindowManager.ActivateWindow((int)GUIWindow.Window.WINDOW_FULLSCREEN_VIDEO); + } + //g_Player.StepNow(); + //g_Player.StepNow(); + //g_Player.StepNow(); + } + } + return base.OnMessage(message); + } + protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType) + { + base.OnClicked(controlId, control, actionType); + + + if (control == btnBack) + { + g_Player.Stop(); + GUIWindowManager.ShowPreviousWindow(); + } + else if (control == btnPause) + { + g_Player.Pause(); + } + else if (control == btnStop) + { + g_Player.Stop(); + } + else if (control == btnForward) + { + g_Player.SeekRelativePercentage(10); + } + else if (control == btnBackward) + { + g_Player.SeekRelativePercentage(-10); + } + else if (control == btnPlay) + { + if (_CurrentFile != String.Empty) + { + if (g_Player.Paused) + { + g_Player.Pause(); + } + if (g_Player.Playing == false) + { + if(_CurrentFile.IndexOf(",")>0){ + PlayListPlayer.SingletonPlayer.Play(0); + }else{ + g_Player.Play(_CurrentFile); + } + + } + + } + } + + } + public override void Process() + { + if (g_Player.Playing) + { + //_log.Info("Screen requesting current duration"); + double iTotalSecs = g_Player.Duration; + //_log.Info("Screen received duration:{0}", iTotalSecs); + if (iTotalSecs > 0) + { + //_log.Info("Screen requesting current position"); + double iCurSecs = g_Player.CurrentPosition; + //_log.Info("Screen received position:{0}", iCurSecs); + double fPercent = ((double)iCurSecs) / ((double)iTotalSecs); + fPercent *= 100.0d; + //_log.Info("progress percent:{0}", fPercent); + + GUIPropertyManager.SetProperty("#TV.View.Percentage", ((int)fPercent).ToString()); + //_log.Info("progress percent:{0}", GUIPropertyManager.GetProperty("#TV.View.Percentage")); + } + } + base.Process(); + } + } +} Added: trunk/plugins/Source/GUIOnlineVideos.cs =================================================================== --- trunk/plugins/Source/GUIOnlineVideos.cs (rev 0) +++ trunk/plugins/Source/GUIOnlineVideos.cs 2007-04-14 00:36:06 UTC (rev 318) @@ -0,0 +1,721 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Xml; +using System.Xml.XPath; +using System.ComponentModel; +using System.Net; +using System.Web; +using System.IO; +using System.Text.RegularExpressions; +using MediaPortal.GUI.Library; +using MediaPortal.Dialogs; +//using MediaPortal.Utils.Services; +using MediaPortal.Utils; +using MediaPortal.Player; + +namespace OnlineVideos +{ + public class GUIOnlineVideos : GUIWindow, ISetupForm + { + [SkinControlAttribute(2)] + protected GUIButtonControl btnViewAs = null; + [SkinControlAttribute(50)] + protected GUIFacadeControl facadeView = null; + //private ILog moLog; + protected View currentView = View.List; + private Dictionary<String, Site> moSiteList = new Dictionary<String, Site>(); + private String msSelectedSiteId; + private String msSelectedCategory; + private State _CurrentState = State.home; + private String msDownloadDir = Directory.GetCurrentDirectory()+"\\"; + private List<VideoInfo> moCurrentVideoList = new List<VideoInfo>(); + private String []msFilterArray; + private String msThumbLocation; + private int miSelectedIndex = 0; + private bool mbPlayFullscreen = true; + public enum State + { + home = 0, + categories = 1, + videos = 2 + } + public enum View + { + List = 0, + Icons = 1, + LargeIcons = 2, + FilmStrip = 3 + } + public class Site + { + public String name; + public String id; + public string username; + public string password; + public bool confirmAge; + public Dictionary<String, RssLink> RssList = new Dictionary<String, RssLink>(); + } + public class RssLink + { + public String name; + public Boolean isDynamic = false; + public String url; + } + public class VideoInfo + { + public String Title; + public String Description; + public String VideoUrl; + public String ImageUrl; + public int Length; + public String Tags; + public Object Other; + public VideoInfo() + { + Length = -1; + } + } + + public GUIOnlineVideos() + { + //ServiceProvider loServices = GlobalServiceProvider.Instance; + //moLog = loServices.Get<ILog>(); + } + public string PluginName() + { + + return "Online Videos"; + + } + + // Returns the description of the plugin is shown in the plugin menu + + public string Description() + { + + return "Youtube Plugin"; + + } + + // Returns the author of the plugin which is shown in the plugin menu + + public string Author() + { + + return "GregMac45"; + + } + + // show the setup dialog + + public void ShowPlugin() + { + + //MessageBox.Show("Nothing to configure, this is just an example"); + + } + + // Indicates whether plugin can be enabled/disabled + + public bool CanEnable() + { + + return true; + + } + + // get ID of windowplugin belonging to this setup + + public int GetWindowId() + { + + return GetID; + + } + + // Indicates if plugin is enabled by default; + + public bool DefaultEnabled() + { + + return true; + + } + + // indicates if a plugin has its own setup screen + + public bool HasSetup() + { + + return false; + + } + public override int GetID + { + get + { + return 4755; + } + set + { + } + } + + public override bool Init() + { + LoadSettings(); + return Load(GUIGraphicsContext.Skin + @"\myonlinevideos.xml"); + + } + public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) + { + strButtonText = PluginName(); + + strButtonImage = String.Empty; + + strButtonImageFocus = String.Empty; + + strPictureImage = String.Empty; + + return true; + } + public bool ShowDefaultHome() + { + return true; + } + protected override void OnPageLoad() + { + if (_CurrentState == State.home) + { + //_log.Info("onPageLoad state home"); + GUIPropertyManager.SetProperty("#header.label","Online Videos"); + DisplaySites(); + } + else if (_CurrentState == State.categories) + { + GUIPropertyManager.SetProperty("#header.label", moSiteList[msSelectedSiteId].name); + DisplayCategories(); + } + else + { + GUIPropertyManager.SetProperty("#header.label", moSiteList[msSelectedSiteId].name); + DisplayVideos(false); + facadeView.SelectedListItemIndex = miSelectedIndex; + } + base.OnPageLoad(); + } + protected override void OnShowContextMenu() + { + int liSelected = facadeView.SelectedListItemIndex-1; + if (liSelected < 0 || msSelectedSiteId=="99" || _CurrentState!=State.videos) + { + return; + } + + GUIListItem loListItem = facadeView.SelectedListItem; + GUIDialogMenu dlgSel = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); + dlgSel.Reset(); + if (dlgSel != null) + { + dlgSel.Add("Save"); // Save + if(msSelectedSiteId=="1"){ + dlgSel.Add("Related Videos"); // Related Videos + } + if(isSiteFavoriteEnabled()){ + if(msSelectedCategory.StartsWith("fav:") ==false){ + dlgSel.Add("Add to favorites"); + } + else{ + dlgSel.Add("Remove from favorites"); + } + } + } + dlgSel.DoModal(GetID); + int liSelectedIdx = dlgSel.SelectedId; + Log.Info("Selected id {0}",liSelectedIdx); + switch(liSelectedIdx){ + case 1: + SaveVideo(loListItem); + break; + case 2: + 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); + } + moCurrentVideoList = site.getRelatedVideos(moCurrentVideoList[liSelected].Tags); + Log.Info("VideoList after:"); + foreach(VideoInfo video in moCurrentVideoList){ + Log.Info(video.Title); + } + DisplayVideos(false); + break; + case 3: + SiteUtilBase siteUtil = SiteUtilFactory.getSiteUtil(msSelectedSiteId); + Site loSite = moSiteList [msSelectedSiteId]; + if(msSelectedCategory.StartsWith("fav:") == false){ + siteUtil.addFavorite(moCurrentVideoList[liSelected].VideoUrl,loSite.username,loSite.password); + }else{ + siteUtil.removeFavorite(moCurrentVideoList[liSelected].VideoUrl,loSite.username,loSite.password); + } + break; + } + base.OnShowContextMenu(); + } + public override void OnAction(Action action) + { + if (action.wID == Action.ActionType.ACTION_PREVIOUS_MENU) + { + if (_CurrentState == State.videos) + { + DisplayCategories(); + _CurrentState = State.categories; + return; + } + else if (_CurrentState == State.categories) + { + DisplaySites(); + _CurrentState = State.home; + return; + } + } + base.OnAction(action); + } + protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType) + { + Log.Info("Onclicked action type:{0}",actionType); + if (control == facadeView) + { + + if (_CurrentState == State.home) + { + msSelectedSiteId = facadeView.SelectedListItem.Path; + GUIPropertyManager.SetProperty("#header.label", moSiteList[msSelectedSiteId].name); + DisplayCategories(); + _CurrentState = State.categories; + } + else if (_CurrentState == State.categories) + { + if (facadeView.SelectedListItemIndex == 0) + { + DisplaySites(); + _CurrentState = State.home; + } + else + { + msSelectedCategory = facadeView.SelectedListItem.Path; + DisplayVideos(true); + _CurrentState = State.videos; + } + } + else if (_CurrentState == State.videos) + { + ImageDownloader._stopDownload = true; + if (facadeView.SelectedListItemIndex == 0) + { + DisplayCategories(); + _CurrentState = State.categories; + } + else + { + miSelectedIndex = facadeView.SelectedListItemIndex; + //play the video + Play(moCurrentVideoList[facadeView.SelectedListItemIndex -1]); + } + } + } + else if (control == btnViewAs) + { + //bool shouldContinue = false; + //do + //{ + //shouldContinue = false; + switch (currentView) + { + case View.List: + currentView = View.Icons; + //if (!AllowView(CurrentView) || facadeView.ThumbnailView == null) + // shouldContinue = true; + //else + facadeView.View = GUIFacadeControl.ViewMode.SmallIcons; + break; + case View.Icons: + currentView = View.LargeIcons; + //if (!AllowView(CurrentView) || facadeView.ThumbnailView == null) + // shouldContinue = true; + //else + facadeView.View = GUIFacadeControl.ViewMode.LargeIcons; + //facadeView. + break; + case View.LargeIcons: + currentView = View.FilmStrip; + //if (!AllowView(CurrentView) || facadeView.FilmstripView == null) + // shouldContinue = true; + //else + facadeView.View = GUIFacadeControl.ViewMode.Filmstrip; + break; + ... [truncated message content] |
From: <fa...@us...> - 2007-04-18 22:15:13
|
Revision: 341 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=341&view=rev Author: falkyre Date: 2007-04-18 15:14:47 -0700 (Wed, 18 Apr 2007) Log Message: ----------- Added Paths: ----------- trunk/plugins/MyShowTimes/ trunk/plugins/MyShowTimes/MediaPortal ShowTimes Plugins Suite.doc trunk/plugins/MyShowTimes/ShowTimesGUI/ trunk/plugins/MyShowTimes/ShowTimesGUI/AssemblyInfo.cs trunk/plugins/MyShowTimes/ShowTimesGUI/MovieInfo.cs trunk/plugins/MyShowTimes/ShowTimesGUI/PluginSettings.cs trunk/plugins/MyShowTimes/ShowTimesGUI/ShowTimesGUI.cs trunk/plugins/MyShowTimes/ShowTimesGUI/ShowTimesGUI.csproj trunk/plugins/MyShowTimes/ShowTimesGUI/ShowTimesGUI.csproj.user trunk/plugins/MyShowTimes/ShowTimesGUI/ShowTimesGUI.sln trunk/plugins/MyShowTimes/ShowTimesGUI/ShowTimesGUI.suo trunk/plugins/MyShowTimes/ShowTimesGUI/TheaterInfo.cs trunk/plugins/MyShowTimes/ShowTimesGUI/skin/ trunk/plugins/MyShowTimes/ShowTimesGUI/skin/Blue Two/ trunk/plugins/MyShowTimes/ShowTimesGUI/skin/Blue Two/ShowTimesGUI.xml trunk/plugins/MyShowTimes/ShowTimesGUI/skin/MePo Wide/ trunk/plugins/MyShowTimes/ShowTimesGUI/skin/MePo Wide/ShowTimesGUI.xml trunk/plugins/MyShowTimes/ShowTimesGrabber/ trunk/plugins/MyShowTimes/ShowTimesGrabber/ShowTimes/ trunk/plugins/MyShowTimes/ShowTimesGrabber/ShowTimes/PluginSettings.cs trunk/plugins/MyShowTimes/ShowTimesGrabber/ShowTimes/PluginSetup.cs trunk/plugins/MyShowTimes/ShowTimesGrabber/ShowTimes/Properties/ trunk/plugins/MyShowTimes/ShowTimesGrabber/ShowTimes/Properties/AssemblyInfo.cs trunk/plugins/MyShowTimes/ShowTimesGrabber/ShowTimes/ShowTimes.csproj trunk/plugins/MyShowTimes/ShowTimesGrabber/ShowTimes/showtimes.cs trunk/plugins/MyShowTimes/ShowTimesGrabber/ShowTimes/showtimesSetup.Designer.cs trunk/plugins/MyShowTimes/ShowTimesGrabber/ShowTimes/showtimesSetup.cs trunk/plugins/MyShowTimes/ShowTimesGrabber/ShowTimes/showtimesSetup.resx trunk/plugins/MyShowTimes/ShowTimesGrabber/ShowTimes.sln trunk/plugins/MyShowTimes/ShowTimesGrabber/ShowTimes.suo Added: trunk/plugins/MyShowTimes/MediaPortal ShowTimes Plugins Suite.doc =================================================================== (Binary files differ) Property changes on: trunk/plugins/MyShowTimes/MediaPortal ShowTimes Plugins Suite.doc ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/MyShowTimes/ShowTimesGUI/AssemblyInfo.cs =================================================================== --- trunk/plugins/MyShowTimes/ShowTimesGUI/AssemblyInfo.cs (rev 0) +++ trunk/plugins/MyShowTimes/ShowTimesGUI/AssemblyInfo.cs 2007-04-18 22:14:47 UTC (rev 341) @@ -0,0 +1,58 @@ +using System.Reflection; +using System.Runtime.CompilerServices; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly: AssemblyTitle("ShowTimesGUI")] +[assembly: AssemblyDescription("GUI for the ShowTimes Grabber")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion("1.0.*")] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory which is +// %Project Directory%\obj\<configuration>. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("")] +[assembly: AssemblyKeyName("")] Added: trunk/plugins/MyShowTimes/ShowTimesGUI/MovieInfo.cs =================================================================== --- trunk/plugins/MyShowTimes/ShowTimesGUI/MovieInfo.cs (rev 0) +++ trunk/plugins/MyShowTimes/ShowTimesGUI/MovieInfo.cs 2007-04-18 22:14:47 UTC (rev 341) @@ -0,0 +1,256 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Xml; +using MediaPortal.GUI.Library; + +namespace ShowTimesGUI +{ + class MovieInfo + { + public static string[] Movies = new string[200]; //strings for all movies + public static int NumMovies; //number of movies + + public static string GetMovieName(int index) + { + + string nodeselect = String.Format("/MediaLibrary/Media[MediaID=\"{0}\"]/Name", index.ToString()); + + //XmlDocument XmlDoc = new XmlDocument(); + + //XmlDoc.Load(ShowTimesGUI.MOVIEDATA); + + XmlNode MovieName = ShowTimesGUI.movieXML.SelectSingleNode(nodeselect); + + if (MovieName == null) + return "NA"; + else + return MovieName.InnerText; + } + + public static int GetMovieID(string MovieName) + { + + string nodeselect = String.Format("/MediaLibrary/Media[contains(Name,\"{0}\")]/MediaID", MovieName); + + XmlNode MovieID = ShowTimesGUI.movieXML.SelectSingleNode(nodeselect); + + if (MovieID == null) + return -1; + else + return int.Parse(MovieID.InnerText); + } + + public static void GetAllMovies() + { + int i = 0; + + Array.Resize(ref Movies, 200); + + XmlNodeList MovieNames = ShowTimesGUI.movieXML.SelectNodes("/MediaLibrary/Media/Name"); + + NumMovies = MovieNames.Count; + + if (PluginSettings.DebugMode) + Log.Debug("Number of movies found = {0}", NumMovies); + + //Create list of Movies + foreach (XmlNode node in MovieNames) + { + // Do anything with node + Movies[i] = node.InnerText; + i++; + } + + Movies[i] = null; + + Array.Resize(ref Movies, i); + Movies = ShowTimesGUI.RemoveDups(Movies, true); + if (PluginSettings.DebugMode) + Log.Debug("GetAllMovies::Num Movies = {0} after dup = {1}", NumMovies,Movies.Length); + //Array.Resize(ref Movies, i); + + } + + + public static string GetPosterImage(string MovieName) + { + string nodeselect; + + //XmlDocument XmlDoc = new XmlDocument(); + + //XmlDoc.Load(ShowTimesGUI.MOVIEDATA); + + nodeselect = String.Format("/MediaLibrary/Media[contains(Name,\"{0}\")]/image", MovieName); + + XmlNode PosterImage = ShowTimesGUI.movieXML.SelectSingleNode(nodeselect); + + if (PluginSettings.DebugMode) + { + if (PosterImage != null) + Log.Debug("Poster Image = {0}", PosterImage.InnerText); + else + Log.Debug("Poster Image = Not found"); + } + + if (PosterImage == null) + return "NA"; + else + return PosterImage.InnerText; + } + + public static string GetRating(string MovieName) + { + string nodeselect; + + //XmlDocument XmlDoc = new XmlDocument(); + + //XmlDoc.Load(ShowTimesGUI.MOVIEDATA); + + nodeselect = String.Format("/MediaLibrary/Media[contains(Name,\"{0}\")]/Rating", MovieName); + + XmlNode Rating = ShowTimesGUI.movieXML.SelectSingleNode(nodeselect); + + if (Rating == null) + return "NA"; + else + return Rating.InnerText; + } + + public static string GetRunTime(string MovieName) + { + string nodeselect; + + //XmlDocument XmlDoc = new XmlDocument(); + + //XmlDoc.Load(ShowTimesGUI.MOVIEDATA); + + nodeselect = String.Format("/MediaLibrary/Media[contains(Name,\"{0}\")]/Runtime", MovieName); + + XmlNode RunTime = ShowTimesGUI.movieXML.SelectSingleNode(nodeselect); + + if (RunTime == null) + return "NA"; + else + return RunTime.InnerText; + } + + public static string GetIMDBRating(string MovieName) + { + string nodeselect; + + nodeselect = String.Format("/MediaLibrary/Media[contains(Name,\"{0}\")]/ImdbUserReview", MovieName); + + XmlNode IMDB = ShowTimesGUI.movieXML.SelectSingleNode(nodeselect); + + if (IMDB == null) + return "NA"; + else + return IMDB.InnerText; + } + + public static string GetReleaseDate(string MovieName) + { + string nodeselect; + + //XmlDocument XmlDoc = new XmlDocument(); + + //XmlDoc.Load(ShowTimesGUI.MOVIEDATA); + + nodeselect = String.Format("/MediaLibrary/Media[contains(Name,\"{0}\")]/ReleaseDate", MovieName); + + XmlNode ReleaseDate = ShowTimesGUI.movieXML.SelectSingleNode(nodeselect); + + if (ReleaseDate == null) + return "NA"; + else + return ReleaseDate.InnerText; + } + + public static string GetActors(string MovieName) + { + string nodeselect; + + nodeselect = String.Format("/MediaLibrary/Media[contains(Name,\"{0}\")]/Actors", MovieName); + + XmlNode Actors = ShowTimesGUI.movieXML.SelectSingleNode(nodeselect); + + if (Actors == null) + return "NA"; + else + return Actors.InnerText; + } + + public static string GetDirector(string MovieName) + { + string nodeselect; + + nodeselect = String.Format("/MediaLibrary/Media[contains(Name,\"{0}\")]/Director", MovieName); + + XmlNode Director = ShowTimesGUI.movieXML.SelectSingleNode(nodeselect); + + if (Director == null) + return "NA"; + else + return Director.InnerText; + } + + public static string GetPlot(string MovieName) + { + string nodeselect; + + nodeselect = String.Format("/MediaLibrary/Media[contains(Name,\"{0}\")]/PlotSummary", MovieName); + + XmlNode Plot = ShowTimesGUI.movieXML.SelectSingleNode(nodeselect); + + if (Plot == null) + return "NA"; + else + return Plot.InnerText; + } + + public static string GetGenre(string MovieName) + { + string nodeselect; + + nodeselect = String.Format("/MediaLibrary/Media[contains(Name,\"{0}\")]/Genre", MovieName); + + XmlNode Genre = ShowTimesGUI.movieXML.SelectSingleNode(nodeselect); + + if (Genre == null) + return "NA"; + else + return Genre.InnerText; + } + + public static string GetTrailerExists(string MovieName) + { + string nodeselect; + + nodeselect = String.Format("/MediaLibrary/Media[contains(Name,\"{0}\")]/Trailer", MovieName); + + XmlNode Trailers = ShowTimesGUI.movieXML.SelectSingleNode(nodeselect); + + if (Trailers == null) + return "NA"; + else + return Trailers.InnerText; + } + + public static string GetTrailerLoc(string MovieName) + { + string nodeselect; + + nodeselect = String.Format("/MediaLibrary/Media[contains(Name,\"{0}\")]/location", MovieName); + + XmlNode TrailerLoc = ShowTimesGUI.movieXML.SelectSingleNode(nodeselect); + + if (TrailerLoc == null) + return "NA"; + else + return TrailerLoc.InnerText; + } + + + } +} Added: trunk/plugins/MyShowTimes/ShowTimesGUI/PluginSettings.cs =================================================================== --- trunk/plugins/MyShowTimes/ShowTimesGUI/PluginSettings.cs (rev 0) +++ trunk/plugins/MyShowTimes/ShowTimesGUI/PluginSettings.cs 2007-04-18 22:14:47 UTC (rev 341) @@ -0,0 +1,95 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Text; +using System.Reflection; +using System.Threading; +using System.Windows.Forms; +using MediaPortal.GUI.Library; + +namespace ShowTimesGUI +{ + public static class PluginSettings + { + // The Cached MediaPortal Settings Configuration file + static private MediaPortal.Profile.Settings mpSettings = new MediaPortal.Profile.Settings("MediaPortal.xml", true); + + + #region Configuration Properties + + /// <summary> + /// Gets or sets the next poll time. + /// </summary> + /// <value>The next poll.</value> + static public DateTime NextPoll + { + get { return DateTime.Parse(mpSettings.GetValueAsString(ShowTimesGUI.PLUGIN_NAME, "NextPoll", DateTime.Now.ToString("s"))); } + set { mpSettings.SetValue(ShowTimesGUI.PLUGIN_NAME, "NextPoll", value.ToString("s")); } + } + + /// <summary> + /// Gets or sets the location of the grabber (mtsa.exe) config.xml. + /// </summary> + /// <value>full path of the mtsa.exe config.xml file</value> + static public string grabberCfgXml + { + get { return mpSettings.GetValueAsString(ShowTimesGUI.PLUGIN_NAME, "grabberCfgXml", System.IO.Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath) + "\\config.xml"); } + set { mpSettings.SetValue(ShowTimesGUI.PLUGIN_NAME, "grabberCfgXml", value); } + } + + + /// <summary> + /// Gets or sets the number of days between downloads of showtimes. + /// </summary> + /// <value>The update days.</value> + static public int UpdateDays + { + get { return mpSettings.GetValueAsInt(ShowTimesGUI.PLUGIN_NAME, "UpdateDays", 5); } + set { mpSettings.SetValue(ShowTimesGUI.PLUGIN_NAME, "UpdateDays", value); } + } + + /// <summary> + /// Gets or sets the location of the grabber (mtsa.exe) files. + /// </summary> + /// <value>full path of the directory to be used by mtsa.exe</value> + static public string grabberFiles + { + get { return mpSettings.GetValueAsString(ShowTimesGUI.PLUGIN_NAME, "grabberFiles", System.IO.Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath)); } + set { mpSettings.SetValue(ShowTimesGUI.PLUGIN_NAME, "grabberFiles", value); } + } + + + /// <summary> + /// Gets or sets a value indicating whether debug mode is enabled. + /// </summary> + /// <value><c>true</c> if [debug mode]; otherwise, <c>false</c>.</value> + static public bool DebugMode + { + get { return mpSettings.GetValueAsBool(ShowTimesGUI.PLUGIN_NAME, "DebugMode", false); } + set { mpSettings.SetValueAsBool(ShowTimesGUI.PLUGIN_NAME, "DebugMode", value); } + } + + + /// <summary> + /// Gets or sets a value indicating whether the user wants to be notified when the import is complete. + /// </summary> + /// <value><c>true</c> if [notify on completion]; otherwise, <c>false</c>.</value> + static public bool NotifyOnCompletion + { + get { return mpSettings.GetValueAsBool(ShowTimesGUI.PLUGIN_NAME, "NotifyOnCompletion", true); } + set { mpSettings.SetValueAsBool(ShowTimesGUI.PLUGIN_NAME, "NotifyOnCompletion", value); } + } + + /// <summary> + /// Gets or sets a value indicating whether the user wants to force update on MP start. + /// </summary> + /// <value><c>true</c> if [force on start]; otherwise, <c>false</c>.</value> + static public bool ForceUpdate + { + get { return mpSettings.GetValueAsBool(ShowTimesGUI.PLUGIN_NAME, "ForceUpdate", true); } + set { mpSettings.SetValueAsBool(ShowTimesGUI.PLUGIN_NAME, "ForceUpdate", value); } + } + + #endregion + } +} Added: trunk/plugins/MyShowTimes/ShowTimesGUI/ShowTimesGUI.cs =================================================================== --- trunk/plugins/MyShowTimes/ShowTimesGUI/ShowTimesGUI.cs (rev 0) +++ trunk/plugins/MyShowTimes/ShowTimesGUI/ShowTimesGUI.cs 2007-04-18 22:14:47 UTC (rev 341) @@ -0,0 +1,1270 @@ +#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.Windows.Forms; +using System.Collections; +using MediaPortal.GUI.Library; +using MediaPortal.Dialogs; +using MediaPortal.Player; +using System.Xml; +using System.Xml.Serialization; + + + +namespace ShowTimesGUI +{ + /// <summary> + /// GUI for the ShowTimes process plugin to show information and showtimes on movies playing in your local theater. + /// </summary> + public class ShowTimesGUI : GUIWindow, ISetupForm, IPlugin + { + + #region MapSettings class + [Serializable] + public class MapSettings + { + protected int _SortBy; + protected int _ViewAs; + protected bool _SortAscending; + + public MapSettings() + { + // Set default view + _SortBy = (int)SortMethod.Name; + _ViewAs = (int)View.BigIcons; + _SortAscending = true; + } + + [XmlElement("SortBy")] + public int SortBy + { + get { return _SortBy; } + set { _SortBy = value; } + } + + [XmlElement("ViewAs")] + public int ViewAs + { + get { return _ViewAs; } + set { _ViewAs = value; } + } + + [XmlElement("SortAscending")] + public bool SortAscending + { + get { return _SortAscending; } + set { _SortAscending = value; } + } + } + + enum SortMethod + { + Name = 0, + Date = 1, + Size = 2 + } + + enum View + { + List = 0, + Icons = 1, + BigIcons = 2, + Albums = 3, + Filmstrip = 4, + MovieDates = 5, + } + #endregion + + #region SkinControlAttributes + + + + [SkinControlAttribute(2)] + protected GUIButtonControl buttonOne = null; + [SkinControlAttribute(3)] + protected GUIButtonControl btnMovieTheaters = null; + + [SkinControlAttribute(0)] protected GUIImage posterBorder = null; + [SkinControlAttribute(24)] protected GUIImage poster = null; + [SkinControlAttribute(25)] protected GUILabelControl RatingCtrl = null; + [SkinControlAttribute(26)] protected GUILabelControl RunTimeCtrl = null; + [SkinControlAttribute(27)] protected GUILabelControl TrailerCtrl = null; + [SkinControlAttribute(28)] protected GUILabelControl StarringLabel = null; + [SkinControlAttribute(29)] protected GUITextControl StarringCtrl = null; + [SkinControlAttribute(30)] protected GUILabelControl DirectorLabel = null; + [SkinControlAttribute(31)] protected GUITextControl DirectorCtrl = null; + [SkinControlAttribute(32)] protected GUILabelControl IMDBCtrl = null; + [SkinControlAttribute(33)] protected GUILabelControl PlotLabel = null; + [SkinControlAttribute(34)] protected GUITextScrollUpControl plotarea = null; + [SkinControlAttribute(35)] protected GUILabelControl GenreLabel = null; + [SkinControlAttribute(36)] protected GUIFadeLabel GenreCtrl = null; + [SkinControlAttribute(44)] protected GUIFadeLabel SelectedTheaterCtrl = null; + + [SkinControlAttribute(40)] protected GUIButtonControl btnShowTimes = null; + [SkinControlAttribute(41)] protected GUIButtonControl btnPlayTrailer = null; + [SkinControlAttribute(42)] protected GUIButtonControl btnNextMovie = null; + [SkinControlAttribute(43)] protected GUIButtonControl btnPreviousMovie = null; + [SkinControlAttribute(45)] protected GUILabelControl NextRefreshLabel = null; + + + [SkinControlAttribute(50)] protected GUIFacadeControl facadeView = null; + + #endregion + + #region Variables + + internal const string PLUGIN_NAME = "ShowTimes Grabber"; + internal const string GUI_PLUGIN_NAME = "ShowTimes GUI"; + public static string POSTER_LOC; + public static string TRAILER_LOC; + public static string LOCFILE; + public static string MOVIEDATA; + public static XmlDocument movieXML; + private static bool xmlLoaded = false; + private static bool movOrTheater = false; + private static bool theaterDatesShown = false; + private static bool showMoviesForTheater = false; + private static bool getShowTimes = false; + public static int selectedItem = 0; + public static string selectedMovieName; + public static string selectedTheaterName; + public static string selectedMovieDate; + + + //string backgroundposter = null; + + MapSettings mapSettings = new MapSettings(); + #endregion + + + public ShowTimesGUI() + { + // + // TODO: Add constructor logic here + // + + + } + #region IPlugin Members + public void Start() + { + + } + + public void Stop() + { + + } + + #endregion + + #region ISetupForm Members + + // Returns the name of the plugin which is shown in the plugin menu + public string PluginName() + { + return "My ShowTimes"; + } + + // Returns the description of the plugin is shown in the plugin menu + public string Description() + { + return "ShowTimes GUI"; + } + + // Returns the author of the plugin which is shown in the plugin menu + public string Author() + { + return "Falkyre"; + } + + // show the setup dialog + public void ShowPlugin() + { + MessageBox.Show("Configuration done using the ShowTimes Grabber Plugin"); + } + + // Indicates whether plugin can be enabled/disabled + public bool CanEnable() + { + return true; + } + + // get ID of windowplugin belonging to this setup + public int GetWindowId() + { + return 7111992; + } + + // Indicates if plugin is enabled by default; + public bool DefaultEnabled() + { + return true; + } + // indicates if a plugin has its own setup screen + public bool HasSetup() + { + return true; + } + + /// <summary> + /// If the plugin should have its own button on the main menu of Mediaportal then it + /// should return true to this method, otherwise if it should not be on home + /// it should return false + /// </summary> + /// <param name="strButtonText">text the button should have</param> + /// <param name="strButtonImage">image for the button, or empty for default</param> + /// <param name="strButtonImageFocus">image for the button, or empty for default</param> + /// <param name="strPictureImage">subpicture for the button or empty for none</param> + /// <returns>true : plugin needs its own button on home + /// false : plugin does not need its own button on home</returns> + public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) + { + //strButtonText = PluginName(); + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("MediaPortal.xml")) + { + strButtonText = ((string)xmlreader.GetValueAsString("ShowTimes Grabber", "pluginName", PluginName())).ToString(); + } + strButtonImage = String.Empty; + strButtonImageFocus = String.Empty; + strPictureImage = "hover_my trailers.png"; + return true; + } + + + public override int GetID + { + get + { + return 7111992; + } + set + { + } + } + #endregion + + public override bool Init() + { + GUIPropertyManager.OnPropertyChanged += new GUIPropertyManager.OnPropertyChangedHandler(OnPropertyChanged); + loadXML(true); + + return Load(GUIGraphicsContext.Skin + @"\ShowTimesGUI.xml"); + + } + + protected override void OnPreviousWindow() + { + if (PluginSettings.DebugMode) + { + Log.Debug("OnPageDestroy::Selected {0},{1},{2},{3}", selectedItem, selectedMovieName, selectedMovieDate, selectedTheaterName); + Log.Debug("OnPageDestroy::Properties {0},{1},{2},{3}", selectedItem, GUIPropertyManager.GetProperty("#st_title"), GUIPropertyManager.GetProperty("#st_theater"), GUIPropertyManager.GetProperty("#st_moviedate")); + Log.Debug("OnPageDestroy::Selected movOrTheater={0},theaterDatesShown={1},showMoviesForTheater={2},getShowTimes={3}", movOrTheater, theaterDatesShown, showMoviesForTheater, getShowTimes); + Log.Debug("OnPageDestroy::mapSettings.ViewAs = {0}", mapSettings.ViewAs); + + } + + if (g_Player.Playing) + { + Log.Debug("in OnPreviousWindow and g_player is playing"); + } + + //Store movie name in property so we can reset + + GUIPropertyManager.SetProperty("#st_title",selectedMovieName); + GUIPropertyManager.SetProperty("#st_theater",selectedTheaterName); + GUIPropertyManager.SetProperty("#st_moviedate", selectedMovieDate); + + //reset the values if we were selecting theaters so that we always go back to all the movies + /* + if (showMoviesForTheater || theaterDatesShown || getShowTimes) + { + showMoviesForTheater = false; + theaterDatesShown = false; + getShowTimes = false; + movOrTheater = true; + }*/ + + base.OnPreviousWindow(); + } + + protected override void OnPageLoad() + { + base.OnPageLoad(); + + //loadXML(false); + //check the current date and see if it is greater than the PluginSettings.NextPoll date + //if it is, run mtsa.exe (this will handle situations where the computer is in hibernation + //and the grabber plugin missed its update time) + //The grabber checks the same thing upon MP start, this checks while MP is running + + TimeSpan numdays = DateTime.Now - PluginSettings.NextPoll; + + if (numdays.Days > PluginSettings.UpdateDays + 1) + { + if ((GUIPropertyManager.GetProperty("#showtimes_grabber_running") == "no" || String.IsNullOrEmpty(GUIPropertyManager.GetProperty("#showtimes_grabber_running")))) + GUIPropertyManager.SetProperty("#showtimes_update","true"); + + } + + GUIPropertyManager.SetProperty("#currentmodule", "ShowTimesGUI"); + + if (PluginSettings.DebugMode) + { + Log.Debug("OnPageLoad::Selected {0},{1},{2},{3}", selectedItem, selectedMovieName, selectedMovieDate, selectedTheaterName); + Log.Debug("OnPageLoad::Properties {0},{1},{2},{3}", selectedItem, GUIPropertyManager.GetProperty("#st_title"), GUIPropertyManager.GetProperty("#st_theater"), GUIPropertyManager.GetProperty("#st_moviedate")); + Log.Debug("OnPageLoad::Selected movOrTheater={0},theaterDatesShown={1},showMoviesForTheater={2},getShowTimes={3}", movOrTheater, theaterDatesShown, showMoviesForTheater, getShowTimes); + } + + if (xmlLoaded) + { + + if (!String.IsNullOrEmpty(GUIPropertyManager.GetProperty("#st_title"))) + selectedMovieName = GUIPropertyManager.GetProperty("#st_title"); + + if (getShowTimes) + { + if (!String.IsNullOrEmpty(GUIPropertyManager.GetProperty("#st_theater"))) + selectedTheaterName = GUIPropertyManager.GetProperty("#st_theater"); + + if (!String.IsNullOrEmpty(GUIPropertyManager.GetProperty("#st_moviedate"))) + selectedMovieDate = GUIPropertyManager.GetProperty("#st_moviedate"); + } + + TheaterInfo.GetTheaters(); + MovieInfo.GetAllMovies(); + + //HideMovieControls(); + + //if (theaterDatesShown && getShowTimes && showMoviesForTheater) + // showMoviesForTheater = false; + + + //We selected Show Theaters and a theater, then when back to home, re display the dates + if (!movOrTheater && theaterDatesShown && !getShowTimes && showMoviesForTheater) + { + //movOrTheater=False,theaterDatesShown=True,showMoviesForTheater=True,getShowTimes=False + if (PluginSettings.DebugMode) + Log.Debug("OnPageLoad::Calling OnMovieTheaters"); + //movOrTheater=False,theaterDatesShown=False,showMoviesForTheater=True,getShowTimes=False + theaterDatesShown = false; + getShowTimes = false; + + //OnMovieTheaters(); + //get_ShowTimes(); + OnClick(selectedItem); + } + else if (!movOrTheater && !theaterDatesShown && !getShowTimes && showMoviesForTheater) + { + //movOrTheater=False,theaterDatesShown=False,showMoviesForTheater=True,getShowTimes=False + showMoviesForTheater = false; + //getShowTimes = true; + movOrTheater = true; + if (PluginSettings.DebugMode) + Log.Debug("OnPageLoad::Calling get_ShowTimes for theaters"); + + //get_ShowTimes(); + //OnClick(selectedItem); + OnMovieTheaters(); + } + else if (movOrTheater && !theaterDatesShown && !getShowTimes && showMoviesForTheater) + { + if (PluginSettings.DebugMode) + Log.Debug("OnPageLoad::Calling OnClick mapSettings.ViewAs = {0}",mapSettings.ViewAs); + + //To display theaters after date selection + //before pagedestroy + //movOrTheater=False,theaterDatesShown=True,showMoviesForTheater=True,getShowTimes=False + //after page destroy + //movOrTheater=True,theaterDatesShown=False,showMoviesForTheater=True,getShowTimes=False + if (mapSettings.ViewAs != 5) + movOrTheater = false; + theaterDatesShown = true; + //showMoviesForTheater = false; + //getShowTimes = true; + + OnClick(selectedItem); + } + else if (!movOrTheater && !theaterDatesShown && getShowTimes && !showMoviesForTheater) + { + //movOrTheater=False,theaterDatesShown=False,showMoviesForTheater=False,getShowTimes=True + if (PluginSettings.DebugMode) + Log.Debug("OnPageLoad::Calling get_ShowTimes"); + + get_ShowTimes(); + } + else if (!movOrTheater && theaterDatesShown && getShowTimes && !showMoviesForTheater) + { + //movOrTheater=False,theaterDatesShown=True,showMoviesForTheater=False,getShowTimes=True + if (PluginSettings.DebugMode) + Log.Debug("OnPageLoad::Calling OnClick to get the movie dates to pick for {0}", selectedTheaterName); + + theaterDatesShown = false; + + OnClick(selectedItem); + } + else if (!movOrTheater && theaterDatesShown && getShowTimes && showMoviesForTheater) + { + //movOrTheater=False,theaterDatesShown=True,showMoviesForTheater=True,getShowTimes=True + //We already have all of the information, change to only view the movie + if (PluginSettings.DebugMode) + Log.Debug("OnPageLoad::Calling OnClick to view the movie data for {0},{1},{2}", selectedMovieName,selectedTheaterName,selectedMovieDate); + showMoviesForTheater = false; + OnClick(selectedItem); + } + else if (movOrTheater && !theaterDatesShown && !getShowTimes && !showMoviesForTheater) + { + HideMovieControls(true); + + GUIControl.ShowControl(GetID, buttonOne.GetID); + GUIControl.ShowControl(GetID, btnMovieTheaters.GetID); + GUIControl.ShowControl(GetID, NextRefreshLabel.GetID); + + GUIControl.EnableControl(GetID, buttonOne.GetID); + GUIControl.EnableControl(GetID, btnMovieTheaters.GetID); + GUIControl.SetControlLabel(GetID, btnMovieTheaters.GetID, "Show Theaters"); + + GUIControl.ShowControl(GetID, facadeView.GetID); + ShowListView(MovieInfo.Movies, true); + + GUIControl.SetControlLabel(GetID, buttonOne.GetID, "View:Big Icons"); + if (!String.IsNullOrEmpty(GUIPropertyManager.GetProperty("#showtimes_nextupdate"))) + GUIControl.SetControlLabel(GetID, NextRefreshLabel.GetID, GUIPropertyManager.GetProperty("#showtimes_nextupdate")); + else + GUIControl.SetControlLabel(GetID, NextRefreshLabel.GetID, "Next ShowTimes Refresh\n" + PluginSettings.NextPoll.ToLongDateString() + "\n@" + PluginSettings.NextPoll.ToShortTimeString()); + + facadeView.View = GUIFacadeControl.ViewMode.SmallIcons; + mapSettings.ViewAs = 1; + GUIControl.FocusControl(GetID, facadeView.GetID); + } + + else + { + GUIPropertyManager.SetProperty("#selecteditem", selectedMovieName); + GUIPropertyManager.SetProperty("#st_title", selectedMovieName); + + + /*if (!showMoviesForTheater) + { + movOrTheater = true; + getShowTimes = true; + } + if (showMoviesForTheater) + { + //Start the process of selecting the theaters again + movOrTheater = true; + OnMovieTheaters(); + } + else + { + movOrTheater = true; + OnClick(selectedItem); + }*/ + movOrTheater = true; + OnClick(selectedItem); + } + + } + else + { + if (PluginSettings.DebugMode) + Log.Info("OnPageLoad::Missing XML files {0} {1} {2}", PluginSettings.grabberCfgXml, LOCFILE,MOVIEDATA); + //Display dialog stating that we can't load the xml files + + okDialog("Unable to load some required XML files", "Can't load " + PluginSettings.grabberCfgXml, "or " + LOCFILE,"or " + MOVIEDATA); + + } + + + } + + + protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType) + { + + if (control == buttonOne) + OnButtonOne(); + + if (control == btnMovieTheaters) + OnMovieTheaters(); + + if (control == btnPlayTrailer) + + OnPlayTrailer(selectedMovieName); + + if (control == btnNextMovie) + { + movOrTheater = true; + + if (showMoviesForTheater && getShowTimes == false) + { + if (selectedItem < TheaterInfo.NumMovies - 1) + selectedItem++; + else + selectedItem = 0; + + selectedMovieName = TheaterInfo.Movies[selectedItem]; + } + else + { + getShowTimes = false; + theaterDatesShown = false; + showMoviesForTheater = false; + + selectedItem = Array.IndexOf(MovieInfo.Movies, selectedMovieName); + if (selectedItem < MovieInfo.NumMovies - 1) + selectedItem++; + else + selectedItem = 0; + + selectedMovieName = MovieInfo.Movies[selectedItem]; + } + + GUIPropertyManager.SetProperty("#selecteditem", selectedMovieName); + GUIPropertyManager.SetProperty("#st_title", selectedMovieName); + + OnClick(selectedItem); + } + + if (control == btnPreviousMovie) + { + movOrTheater = true; + + if (showMoviesForTheater && getShowTimes == false) + { + if (selectedItem > 0) + selectedItem--; + else + selectedItem = TheaterInfo.NumMovies - 1; + + selectedMovieName = TheaterInfo.Movies[selectedItem]; + + } + else + { + getShowTimes = false; + theaterDatesShown = false; + showMoviesForTheater = false; + + selectedItem = Array.IndexOf(MovieInfo.Movies, selectedMovieName); + + if (selectedItem > 0) + selectedItem--; + else + selectedItem = MovieInfo.NumMovies - 1; + + selectedMovieName = MovieInfo.Movies[selectedItem]; + } + + GUIPropertyManager.SetProperty("#selecteditem", selectedMovieName); + GUIPropertyManager.SetProperty("#st_title", selectedMovieName); + + OnClick(selectedItem); + } + + //Display showtimes for selected movie and all theaters + if (control == btnShowTimes) + { + get_ShowTimes(); + } + + if (control == facadeView) + { + GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_ITEM_SELECTED, GetID, 0, controlId, 0, 0, null); + OnMessage(msg); + + int itemIndex = (int)msg.Param1; + + if (actionType == Action.ActionType.ACTION_SELECT_ITEM) + { + GUIListItem item = GUIControl.GetSelectedListItem(GetID, controlId); + + selectedItem = itemIndex; + + if (movOrTheater) + selectedMovieName = item.Label; + + //if (getShowTimes) + // selectedTheaterName = item.Label; + + if (theaterDatesShown) + selectedMovieDate = item.Label; + + if (PluginSettings.DebugMode) + { + Log.Debug("facadeView::Selected {0},{1},{2},{3}", selectedItem, selectedMovieName, selectedMovieDate, selectedTheaterName); + Log.Debug("facadeView::Selected movOrTheater={0},theaterDatesShown={1},showMoviesForTheater={2},getShowTimes={3}", movOrTheater,theaterDatesShown,showMoviesForTheater,getShowTimes); + } + + OnClick(itemIndex); + } + } + + base.OnClicked(controlId, control, actionType); + } + + private void OnClick(int itemindex) //When something is pressed in the listview + { + + if (PluginSettings.DebugMode) + { + Log.Debug("OnClick::Movie = {0}; Theater = {1}, Date = {2}", selectedMovieName, selectedTheaterName, selectedMovieDate); + Log.Debug("OnClick::Selected movOrTheater={0},theaterDatesShown={1},showMoviesForTheater={2},getShowTimes={3}", movOrTheater, theaterDatesShown, showMoviesForTheater, getShowTimes); + } + + if (getShowTimes && theaterDatesShown) + { + movOrTheater = true; + showMoviesForTheater = true; + } + + if (movOrTheater) + { + //Hide facadeView + GUIControl.HideControl(GetID, facadeView.GetID); + + //Hide the Movie Theater name + if (!showMoviesForTheater) + GUIControl.HideControl(GetID, SelectedTheaterCtrl.GetID); + + //Disable View button + GUIControl.DisableControl(GetID, buttonOne.GetID); + GUIControl.SetControlLabel(GetID, btnMovieTheaters.GetID, "Show All Movies"); + + //Get Filename of currently selected item + string posterFileName = MovieInfo.GetPosterImage(selectedMovieName); + //Show Poster Image + if (posterFileName.Equals("NA")) + poster.SetFileName(GUIGraphicsContext.Skin + @"\media\defaultvideobig.png"); + else + poster.SetFileName(posterFileName); + + //Get Rating + GUIControl.SetControlLabel(GetID,RatingCtrl.GetID,"Rating: " + MovieInfo.GetRating(selectedMovieName)); + + //Get Runtime + GUIControl.SetControlLabel(GetID, RunTimeCtrl.GetID, "Runtime: " + MovieInfo.GetRunTime(selectedMovieName)); + + //Get the Genre + GUIControl.SetControlLabel(GetID, GenreCtrl.GetID, MovieInfo.GetGenre(selectedMovieName)); + + string playtrailer = MovieInfo.GetTrailerExists(selectedMovieName); + //Get Trailer + //GUIControl.SetControlLabel(GetID, TrailerCtrl.GetID, "Trailer: " + playtrailer); + + //Disable Play Trailer button if no trailer available or reenable if one available + if (playtrailer.Equals("No")) + GUIControl.DisableControl(GetID, btnPlayTrailer.GetID); + else + GUIControl.EnableControl(GetID, btnPlayTrailer.GetID); + + //Get the Actors + GUIControl.SetControlLabel(GetID, StarringCtrl.GetID, MovieInfo.GetActors(selectedMovieName)); + + //Get the Director + GUIControl.SetControlLabel(GetID, DirectorCtrl.GetID, MovieInfo.GetDirector(selectedMovieName)); + + //Get the IMDB + GUIControl.SetControlLabel(GetID, IMDBCtrl.GetID, "IMDB Rating: " + MovieInfo.GetIMDBRating(selectedMovieName)); + + //Get the Plot + GUIControl.SetControlLabel(GetID, plotarea.GetID, MovieInfo.GetPlot(selectedMovieName)); + + ShowMovieControls(); + + if (showMoviesForTheater || getShowTimes) + { + SelectedTheaterCtrl.Label = selectedTheaterName; + GUIControl.ShowControl(GetID, SelectedTheaterCtrl.GetID); + GUIPropertyManager.SetProperty("#selecteditem", selectedMovieName + " " + selectedMovieDate + "@" + TheaterInfo.GetShowTimes(selectedMovieName, selectedTheaterName, selectedMovieDate)); + TheaterInfo.GetMoviesByTheater(selectedTheaterName,selectedMovieDate); + GUIPropertyManager.SetProperty("#st_theater", selectedTheaterName); + /*if (getShowTimes) + { + showMoviesForTheater = false; + getShowTimes = false; + theaterDatesShown = false; + }*/ + //Hide next/previous and disable get showtimes button + if (getShowTimes) + { + if (PluginSettings.DebugMode) + Log.Debug("OnClick::Hide Next/Prev movOrTheater={0},theaterDatesShown={1},showMoviesForTheater={2},getShowTimes={3}", movOrTheater, theaterDatesShown, showMoviesForTheater, getShowTimes); + GUIControl.HideControl(GetID, btnNextMovie.GetID); + GUIControl.HideControl(GetID, btnPreviousMovie.GetID); + GUIControl.DisableControl(GetID, btnShowTimes.GetID); + } + mapSettings.ViewAs = 5; + } + + if (!showMoviesForTheater) + movOrTheater = false; + + } + else + { + if (theaterDatesShown) + { + //We have a list of dates, display the movies for the theater on the date selected + + if (facadeView.Focus) + { + if (PluginSettings.DebugMode) + Log.Debug("OnClick::Getting movies for {0} on date {1}", selectedTheaterName, selectedMovieDate); + selectedMovieDate = facadeView.ListView.SelectedListItem.Label; + GUIPropertyManager.SetProperty("#st_moviedate", selectedMovieDate); + } + + if (PluginSettings.DebugMode) + Log.Debug("Getting movies for {0} on date {1}", selectedTheaterName, selectedMovieDate); + + TheaterInfo.GetMoviesByTheater(selectedTheaterName,selectedMovieDate); + + GUIControl.SetControlLabel(GetID, buttonOne.GetID, "View:Big Icons"); + facadeView.View = GUIFacadeControl.ViewMode.SmallIcons; + mapSettings.ViewAs = 1; + + GUIControl.EnableControl(GetID, buttonOne.GetID); + GUIControl.EnableControl(GetID, btnMovieTheaters.GetID); + + theaterDatesShown = false; + showMoviesForTheater = true; + movOrTheater = true; + + + ShowTheaterMoviesView(); + + //OnClick(selectedItem); + + + } + else + { + //We have a list of Theaters, display the dates we have to allow the user to see what's playing on that date + + if (PluginSettings.DebugMode) + Log.Debug("OnClick::Selecting dates for {1} at theater {0}", selectedTheaterName, selectedMovieName); + + + if (facadeView.Focus) + { + if (PluginSettings.DebugMode) + Log.Debug("OnClick::Getting movies for {0} on date {1}", selectedTheaterName, selectedMovieDate); + + selectedTheaterName = facadeView.ListView.SelectedListItem.Label; + GUIPropertyManager.SetProperty("#st_theater", selectedTheaterName); + } else + Log.Debug("facadeView::Not loaded"); + + if (PluginSettings.DebugMode) + Log.Debug("Theater item index {0} selected {1}", itemindex, selectedTheaterName); + + //selectedTheaterName = TheaterInfo.Theaters[itemindex]; + + + SelectedTheaterCtrl.Label = selectedTheaterName; + GUIControl.ShowControl(GetID, SelectedTheaterCtrl.GetID); + + //GUIControl.SetControlLabel(GetID, buttonOne.GetID, "View:List"); + facadeView.View = GUIFacadeControl.ViewMode.List; + //mapSettings.ViewAs = 0; + + + ShowTheaterDatesView(TheaterInfo.GetUniqueShowDates(TheaterInfo.Theaters[itemindex])); + + + //GUIControl.EnableControl(GetID, buttonOne.GetID); + GUIControl.SetControlLabel(GetID, btnMovieTheaters.GetID, "Show All Movies"); + + theaterDatesShown = true; + //movOrTheater = true; + } + + } + + } + + private void HideMovieControls(bool hideposter) + { + + if (hideposter) + { + GUIControl.HideControl(GetID, poster.GetID); + GUIControl.HideControl(GetID, posterBorder.GetID); + } + + GUIControl.HideControl(GetID, RatingCtrl.GetID); + GUIControl.HideControl(GetID, RunTimeCtrl.GetID); + //GUIControl.HideControl(GetID, TrailerCtrl.GetID); + GUIControl.HideControl(GetID, GenreLabel.GetID); + GUIControl.HideControl(GetID, GenreCtrl.GetID); + GUIControl.HideControl(GetID, StarringLabel.GetID); + GUIControl.HideControl(GetID, StarringCtrl.GetID); + GUIControl.HideControl(GetID, DirectorLabel.GetID); + GUIControl.HideControl(GetID, DirectorCtrl.GetID); + GUIControl.HideControl(GetID, IMDBCtrl.GetID); + GUIControl.HideControl(GetID, PlotLabel.GetID); + GUIControl.HideControl(GetID, plotarea.GetID); + GUIControl.HideControl(GetID, btnShowTimes.GetID); + GUIControl.HideControl(GetID, btnPlayTrailer.GetID); + GUIControl.HideControl(GetID, btnNextMovie.GetID); + GUIControl.HideControl(GetID, btnPreviousMovie.GetID); + GUIControl.HideControl(GetID, SelectedTheaterCtrl.GetID); + } + + private void ShowMovieControls() + { + GUIControl.ShowControl(GetID, poster.GetID); + GUIControl.ShowControl(GetID, posterBorder.GetID); + GUIControl.ShowControl(GetID, RatingCtrl.GetID); + GUIControl.ShowControl(GetID, RunTimeCtrl.GetID); + //GUIControl.ShowControl(GetID, TrailerCtrl.GetID); + GUIControl.ShowControl(GetID, GenreLabel.GetID); + GUIControl.ShowControl(GetID, GenreCtrl.GetID); + GUIControl.ShowControl(GetID, StarringLabel.GetID); + GUIControl.ShowControl(GetID, StarringCtrl.GetID); + GUIControl.ShowControl(GetID, DirectorLabel.GetID); + GUIControl.ShowControl(GetID, DirectorCtrl.GetID); + GUIControl.ShowControl(GetID, IMDBCtrl.GetID); + //GUIControl.ShowControl(GetID, PlotLabel.GetID); + GUIControl.ShowControl(GetID, plotarea.GetID); + GUIControl.ShowControl(GetID, btnShowTimes .GetID); + GUIControl.ShowControl(GetID, btnPlayTrailer.GetID); + GUIControl.ShowControl(GetID, btnNextMovie.GetID); + GUIControl.ShowControl(GetID, btnPreviousMovie.GetID); + } + + + private void OnButtonOne() + { + if (mapSettings.ViewAs == 1) + { + GUIControl.SetControlLabel(GetID, buttonOne.GetID, "View:List"); + facadeView.View = GUIFacadeControl.ViewMode.LargeIcons; + mapSettings.ViewAs = 2; + } + else if (mapSettings.ViewAs == 2) + { + GUIControl.SetControlLabel(GetID, buttonOne.GetID, "View:Small Icons"); + facadeView.View = GUIFacadeControl.ViewMode.List; + mapSettings.ViewAs = 0; + } + else + { + GUIControl.SetControlLabel(GetID, buttonOne.GetID, "View:Big Icons"); + facadeView.View = GUIFacadeControl.ViewMode.SmallIcons; + mapSettings.ViewAs = 1; + } + } + + private void OnMovieTheaters() + { + HideMovieControls(true); + + + if (showMoviesForTheater) + movOrTheater = false; + + if (movOrTheater) + { + facadeView.View = GUIFacadeControl.ViewMode.List; + GUIControl.SetControlLabel(GetID, btnMovieTheaters.GetID, "Show All Movies"); + GUIControl.DisableControl(GetID, btnMovieTheaters.GetID); + GUIControl.DisableControl(GetID, buttonOne.GetID); + GUIControl.DisableControl(GetID, btnShowTimes.GetID); + GUIControl.FocusControl(GetID, facadeView.GetID); + + ShowTheatersView(TheaterInfo.Theaters); + + if (PluginSettings.DebugMode) + Log.Debug("Movies Changed to Theaters"); + + getShowTimes = false; + showMoviesForTheater = true; + movOrTheater = false; + + } + else + { + + GUIControl.EnableControl(GetID, buttonOne.GetID); + GUIControl.EnableControl(GetID, btnShowTimes.GetID); + GUIControl.SetControlLabel(GetID, btnMovieTheaters.GetID, "Show Theaters"); + + if (mapSettings.ViewAs == 5) mapSettings.ViewAs = 1; + + if (mapSettings.ViewAs == 0) + { + GUIControl.SetControlLabel(GetID, buttonOne.GetID, "View:Small Icons"); + facadeView.View = GUIFacadeControl.ViewMode.List; + mapSettings.ViewAs = 0; + } + else if (mapSettings.ViewAs == 1) + { + GUIControl.SetControlLabel(GetID, buttonOne.GetID, "View:Big Icons"); + facadeView.View = GUIFacadeControl.ViewMode.SmallIcons; + mapSettings.ViewAs = 1; + } + else + { + GUIControl.SetControlLabel(GetID, buttonOne.GetID, "View:List"); + facadeView.View = GUIFacadeControl.ViewMode.LargeIcons; + mapSettings.ViewAs = 2; + } + + MovieInfo.GetAllMovies(); + + + + //GUIControl.HideControl(GetID, SelectedTheaterCtrl.GetID); + + movOrTheater = true; + + selectedMovieDate = String.Empty; + selectedMovieName = String.Empty; + selectedTheaterName = String.Empty; + + theaterDatesShown = false; + getShowTimes = false; + showMoviesForTheater = false; + + ShowListView(MovieInfo.Movies, false); + + if (PluginSettings.DebugMode) + Log.Debug("Theaters Changed to Movies"); + } + + } + + private void OnPlayTrailer(string MovieName) + { + //Get the trailer location (can be a URL or location on disk) + GUIGraphicsContext.IsFullScreenVideo = true; + GUIWindowManager.ActivateWindow((int)GUIWindow.Window.WINDOW_FULLSCREEN_VIDEO); + g_Player.FullScreen = true; + + g_Player.Play(MovieInfo.GetTrailerLoc(MovieName),g_Player.MediaType.Video); + //If we are downloading a stream and dont't have an actual file to play + //g_Player.Play(@"http://movies.apple.com/movies/mgm/arthurandtheinvisibles/arthurandtheinvisibles_h320.mov"); + + + } + + public void ShowListView(string[] _List, bool show_poster) + { + int i = 0; + if (show_poster == false) + //poster.SetFileName(GUIGraphicsContext.Skin + @"\media\" + backgroundposter); + + GUIControl.ClearControl(GetID, facadeView.GetID); + + if (PluginSettings.DebugMode) + Log.Debug("ShowListView::List size {0}", _List.Length.ToString()); + + //while (_List[i] != null) + while (i<_List.Length) + { + GUIListItem item = new GUIListItem(); + + item.Label = _List[i]; + item.OnRetrieveArt += new MediaPortal.GUI.Library.GUIListItem.RetrieveCoverArtHandler(OnRetrieveCoverArt); + facadeView.Add(item); + if (PluginSettings.DebugMode) + Log.Debug("Adding {0} to facadeView", _List[i]); + i++; + } + + } + + public void ShowTheatersView(string[] _Theaters) + { + GUIControl.ClearControl(GetID, facadeView.GetID); + + if (PluginSettings.DebugMode) + Log.Debug("Theater List size {0}", _Theaters.Length.ToString()); + + ... [truncated message content] |
From: <an...@us...> - 2007-05-04 17:08:46
|
Revision: 375 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=375&view=rev Author: and-81 Date: 2007-05-04 10:08:44 -0700 (Fri, 04 May 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/TV3ExtChannelChanger/Win32.cs trunk/plugins/TV3MceBlaster/TV3MceBlaster.cs trunk/plugins/TV3MceBlaster/Win32.cs Added Paths: ----------- trunk/plugins/TV3UuirtBlaster/ trunk/plugins/TV3UuirtBlaster/AssemblyInfo.cs trunk/plugins/TV3UuirtBlaster/ExternalChannelConfig.cs trunk/plugins/TV3UuirtBlaster/Forms/ trunk/plugins/TV3UuirtBlaster/Forms/BlastCommand.cs trunk/plugins/TV3UuirtBlaster/Forms/BlastCommand.designer.cs trunk/plugins/TV3UuirtBlaster/Forms/BlastCommand.resx trunk/plugins/TV3UuirtBlaster/Forms/ExternalChannels.cs trunk/plugins/TV3UuirtBlaster/Forms/ExternalChannels.designer.cs trunk/plugins/TV3UuirtBlaster/Forms/ExternalChannels.resx trunk/plugins/TV3UuirtBlaster/Forms/ExternalProgram.Designer.cs trunk/plugins/TV3UuirtBlaster/Forms/ExternalProgram.cs trunk/plugins/TV3UuirtBlaster/Forms/ExternalProgram.resx trunk/plugins/TV3UuirtBlaster/Forms/KeysCommand.Designer.cs trunk/plugins/TV3UuirtBlaster/Forms/KeysCommand.cs trunk/plugins/TV3UuirtBlaster/Forms/KeysCommand.resx trunk/plugins/TV3UuirtBlaster/Forms/LearnIR.Designer.cs trunk/plugins/TV3UuirtBlaster/Forms/LearnIR.cs trunk/plugins/TV3UuirtBlaster/Forms/LearnIR.resx trunk/plugins/TV3UuirtBlaster/Forms/MacroEditor.Designer.cs trunk/plugins/TV3UuirtBlaster/Forms/MacroEditor.cs trunk/plugins/TV3UuirtBlaster/Forms/MacroEditor.resx trunk/plugins/TV3UuirtBlaster/Forms/MessageCommand.Designer.cs trunk/plugins/TV3UuirtBlaster/Forms/MessageCommand.cs trunk/plugins/TV3UuirtBlaster/Forms/MessageCommand.resx trunk/plugins/TV3UuirtBlaster/Forms/PauseTime.Designer.cs trunk/plugins/TV3UuirtBlaster/Forms/PauseTime.cs trunk/plugins/TV3UuirtBlaster/Forms/PauseTime.resx trunk/plugins/TV3UuirtBlaster/Forms/PluginSetup.Designer.cs trunk/plugins/TV3UuirtBlaster/Forms/PluginSetup.cs trunk/plugins/TV3UuirtBlaster/Forms/PluginSetup.resx trunk/plugins/TV3UuirtBlaster/Forms/SelectBlasterPort.Designer.cs trunk/plugins/TV3UuirtBlaster/Forms/SelectBlasterPort.cs trunk/plugins/TV3UuirtBlaster/Forms/SelectBlasterPort.resx trunk/plugins/TV3UuirtBlaster/Forms/SerialCommand.Designer.cs trunk/plugins/TV3UuirtBlaster/Forms/SerialCommand.cs trunk/plugins/TV3UuirtBlaster/Forms/SerialCommand.resx trunk/plugins/TV3UuirtBlaster/Forms/StbSetup.Designer.cs trunk/plugins/TV3UuirtBlaster/Forms/StbSetup.cs trunk/plugins/TV3UuirtBlaster/Forms/StbSetup.resx trunk/plugins/TV3UuirtBlaster/TV3UuirtBlaster.cs trunk/plugins/TV3UuirtBlaster/TV3UuirtBlaster.csproj trunk/plugins/TV3UuirtBlaster/Util.cs trunk/plugins/TV3UuirtBlaster/Win32.cs Modified: trunk/plugins/TV3ExtChannelChanger/Win32.cs =================================================================== --- trunk/plugins/TV3ExtChannelChanger/Win32.cs 2007-05-04 13:55:10 UTC (rev 374) +++ trunk/plugins/TV3ExtChannelChanger/Win32.cs 2007-05-04 17:08:44 UTC (rev 375) @@ -35,11 +35,14 @@ #region Interop [DllImport("user32")] - public static extern IntPtr GetForegroundWindow(); + internal static extern IntPtr GetForegroundWindow(); [DllImport("user32", SetLastError = false)] - public static extern IntPtr SendMessage(IntPtr windowHandle, int msg, IntPtr wordParam, IntPtr longParam); + internal static extern IntPtr SendMessage(IntPtr windowHandle, int msg, IntPtr wordParam, IntPtr longParam); + [DllImport("user32", SetLastError = true)] + internal static extern IntPtr FindWindow(string lpClassName, string lpWindowName); + #endregion Interop } Modified: trunk/plugins/TV3MceBlaster/TV3MceBlaster.cs =================================================================== --- trunk/plugins/TV3MceBlaster/TV3MceBlaster.cs 2007-05-04 13:55:10 UTC (rev 374) +++ trunk/plugins/TV3MceBlaster/TV3MceBlaster.cs 2007-05-04 17:08:44 UTC (rev 375) @@ -25,7 +25,7 @@ #region Constants - public const string PluginVersion = "TV3 MCE Blaster Plugin 1.0.2.0"; + public const string PluginVersion = "TV3 MCE Blaster Plugin 1.0.3.0"; public const int LearnIRTimeout = 4000; // Milliseconds @@ -67,32 +67,20 @@ /// <summary> /// returns the name of the plugin /// </summary> - public string Name - { - get { return "TV3MceBlaster"; } - } + public string Name { get { return "TV3MceBlaster"; } } /// <summary> /// returns the version of the plugin /// </summary> - public string Version - { - get { return "1.0.2.0"; } - } + public string Version { get { return "1.0.3.0"; } } /// <summary> /// returns the author of the plugin /// </summary> - public string Author - { - get { return "and-81"; } - } + public string Author { get { return "and-81"; } } /// <summary> /// returns if the plugin should only run on the master server /// or also on slave servers /// </summary> - public bool MasterOnly - { - get { return false; } - } + public bool MasterOnly { get { return false; } } public static MceIrApi.BlasterType BlastType { @@ -379,7 +367,9 @@ /// Process the supplied Macro file. /// </summary> /// <param name="fileName">Macro file to process.</param> - /// <returns>Sucess.</returns> + /// <param name="port">Initial blaster port.</param> + /// <param name="speed">Initial blaster speed.</param> + /// <returns></returns> public static bool ProcessMacro(string fileName, MceIrApi.BlasterPort port, MceIrApi.BlasterSpeed speed) { FileStream file = null; Modified: trunk/plugins/TV3MceBlaster/Win32.cs =================================================================== --- trunk/plugins/TV3MceBlaster/Win32.cs 2007-05-04 13:55:10 UTC (rev 374) +++ trunk/plugins/TV3MceBlaster/Win32.cs 2007-05-04 17:08:44 UTC (rev 375) @@ -35,11 +35,14 @@ #region Interop [DllImport("user32")] - public static extern IntPtr GetForegroundWindow(); + internal static extern IntPtr GetForegroundWindow(); [DllImport("user32", SetLastError = false)] - public static extern IntPtr SendMessage(IntPtr windowHandle, int msg, IntPtr wordParam, IntPtr longParam); + internal static extern IntPtr SendMessage(IntPtr windowHandle, int msg, IntPtr wordParam, IntPtr longParam); + [DllImport("user32", SetLastError = true)] + internal static extern IntPtr FindWindow(string lpClassName, string lpWindowName); + #endregion Interop } Added: trunk/plugins/TV3UuirtBlaster/AssemblyInfo.cs =================================================================== --- trunk/plugins/TV3UuirtBlaster/AssemblyInfo.cs (rev 0) +++ trunk/plugins/TV3UuirtBlaster/AssemblyInfo.cs 2007-05-04 17:08:44 UTC (rev 375) @@ -0,0 +1,71 @@ +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Security.Permissions; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly: AssemblyTitle("TV3 USB-UIRT Blaster Plugin")] +[assembly: AssemblyDescription("USB-UIRT Blaster for TV Engine 3")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("and-81")] +[assembly: AssemblyProduct("MediaPortal")] +[assembly: AssemblyCopyright("Aaron Dinnage")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion("1.0.3.0")] +[assembly: AssemblyFileVersionAttribute("1.0.3.0")] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory which is +// %Project Directory%\obj\<configuration>. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("")] +[assembly: AssemblyKeyName("")] + +[assembly: CLSCompliant(true)] + +[assembly: SecurityPermission(SecurityAction.RequestMinimum, UnmanagedCode = true)] Added: trunk/plugins/TV3UuirtBlaster/ExternalChannelConfig.cs =================================================================== --- trunk/plugins/TV3UuirtBlaster/ExternalChannelConfig.cs (rev 0) +++ trunk/plugins/TV3UuirtBlaster/ExternalChannelConfig.cs 2007-05-04 17:08:44 UTC (rev 375) @@ -0,0 +1,198 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Xml; + +using TvLibrary.Log; + +namespace TvEngine +{ + + public class ExternalChannelConfig + { + + #region Variables + + string _fileName; + + int _cardID = -1; + + int _pauseTime = 250; + bool _sendSelect = false; + bool _doubleChannelSelect = false; + int _repeatChannelCommands = 0; + int _channelDigits = 0; + int _repeatPauseTime = 1000; + bool _usePreChangeCommand = false; + + string _selectCommand = ""; + string _preChangeCommand = ""; + string[] _digits = new string[10]; + + #endregion Variables + + #region Properties + + public string FileName + { + get { return _fileName; } + } + + public int CardId + { + get { return _cardID; } + set { _cardID = value; } + } + + public int PauseTime + { + get { return _pauseTime; } + set { _pauseTime = value; } + } + public bool SendSelect + { + get { return _sendSelect; } + set { _sendSelect = value; } + } + public bool DoubleChannelSelect + { + get { return _doubleChannelSelect; } + set { _doubleChannelSelect = value; } + } + public int RepeatChannelCommands + { + get { return _repeatChannelCommands; } + set { _repeatChannelCommands = value; } + } + public int ChannelDigits + { + get { return _channelDigits; } + set { _channelDigits = value; } + } + public int RepeatPauseTime + { + get { return _repeatPauseTime; } + set { _repeatPauseTime = value; } + } + public bool UsePreChangeCommand + { + get { return _usePreChangeCommand; } + set { _usePreChangeCommand = value; } + } + + public string[] Digits + { + get { return _digits; } + set { _digits = value; } + } + public string SelectCommand + { + get { return _selectCommand; } + set { _selectCommand = value; } + } + public string PreChangeCommand + { + get { return _preChangeCommand; } + set { _preChangeCommand = value; } + } + + #endregion Properties + + #region Constructor + + public ExternalChannelConfig(int cardId, string fileName) + { + _fileName = fileName; + + _cardID = cardId; + + if (!File.Exists(_fileName)) + { + for (int i = 0; i < 10; i++) + Digits[i] = ""; + + return; + } + + FileStream file = null; + + try + { + file = new FileStream(_fileName, FileMode.Open, FileAccess.Read, FileShare.Read); + + XmlDocument doc = new XmlDocument(); + doc.Load(file); + + XmlNodeList nodeList = doc.DocumentElement.ChildNodes; + + PauseTime = Util.GetXmlInt(nodeList, "PauseTime", PauseTime); + UsePreChangeCommand = Util.GetXmlBool(nodeList, "UsePreChangeCommand", UsePreChangeCommand); + SendSelect = Util.GetXmlBool(nodeList, "SendSelect", SendSelect); + DoubleChannelSelect = Util.GetXmlBool(nodeList, "DoubleChannelSelect", DoubleChannelSelect); + RepeatChannelCommands = Util.GetXmlInt(nodeList, "RepeatChannelCommands", RepeatChannelCommands); + ChannelDigits = Util.GetXmlInt(nodeList, "ChannelDigits", ChannelDigits); + RepeatPauseTime = Util.GetXmlInt(nodeList, "RepeatDelay", RepeatPauseTime); + + SelectCommand = Util.GetXmlString(nodeList, "SelectCommand", SelectCommand); + PreChangeCommand = Util.GetXmlString(nodeList, "PreChangeCommand", PreChangeCommand); + + for (int i = 0; i < 10; i++) + Digits[i] = Util.GetXmlString(nodeList, "Digit" + i.ToString(), ""); + } + catch (Exception ex) + { + Log.Error("TV3UuirtBlaster: ExternalChannelConfig() {0}", ex.Message); + } + + if (file != null) + file.Close(); + } + + #endregion Constructor + + public void SaveExternalChannelConfig() + { + FileStream file = null; + + try + { + file = new FileStream(_fileName, FileMode.Create, FileAccess.Write, FileShare.Read); + + XmlTextWriter writer = new XmlTextWriter(file, System.Text.Encoding.UTF8); + writer.Formatting = Formatting.Indented; + writer.Indentation = 1; + writer.IndentChar = (char)9; + 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("SelectCommand", SelectCommand); + writer.WriteElementString("PreChangeCommand", PreChangeCommand); + + for (int i = 0; i < 10; i++) + writer.WriteElementString("Digit" + i.ToString(), Digits[i]); + + writer.WriteEndElement(); // </config> + writer.WriteEndDocument(); + writer.Close(); + } + catch (Exception ex) + { + Log.Error("TV3UuirtBlaster: SaveExternalChannelConfig() {0}", ex.Message); + } + + if (file != null) + file.Close(); + } + + } + +} Added: trunk/plugins/TV3UuirtBlaster/Forms/BlastCommand.cs =================================================================== --- trunk/plugins/TV3UuirtBlaster/Forms/BlastCommand.cs (rev 0) +++ trunk/plugins/TV3UuirtBlaster/Forms/BlastCommand.cs 2007-05-04 17:08:44 UTC (rev 375) @@ -0,0 +1,84 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace TvEngine +{ + + public partial class BlastCommand : Form + { + + #region Properties + + public string CommandString + { + get + { + return string.Format("{0}|{1}", + labelIRCommandFile.Text, + (string)comboBoxPort.SelectedItem); + } + } + + #endregion Properties + + #region Constructors + + public BlastCommand(string file) + { + InitializeComponent(); + + labelIRCommandFile.Text = file; + + comboBoxPort.Items.AddRange(Enum.GetNames(typeof(BlasterPort))); + comboBoxPort.SelectedIndex = 0; + } + public BlastCommand(string[] commands) + { + InitializeComponent(); + + if (commands == null) + return; + + labelIRCommandFile.Text = commands[0]; + + comboBoxPort.Items.AddRange(Enum.GetNames(typeof(BlasterPort))); + comboBoxPort.SelectedItem = commands[1]; + } + + #endregion Constructors + + #region Buttons + + private void buttonOK_Click(object sender, EventArgs e) + { + this.DialogResult = DialogResult.OK; + this.Close(); + } + + private void buttonCancel_Click(object sender, EventArgs e) + { + this.DialogResult = DialogResult.Cancel; + this.Close(); + } + + private void buttonTest_Click(object sender, EventArgs e) + { + string fileName = labelIRCommandFile.Text.Trim(); + + if (fileName.Length == 0) + return; + + TV3UuirtBlaster.BlastIR(TV3UuirtBlaster.AppDataFolder + TV3UuirtBlaster.IRFolder + fileName + TV3UuirtBlaster.IRExtension, + (BlasterPort)Enum.Parse(typeof(BlasterPort), (string)comboBoxPort.SelectedItem)); + } + + #endregion Buttons + + } + +} Added: trunk/plugins/TV3UuirtBlaster/Forms/BlastCommand.designer.cs =================================================================== --- trunk/plugins/TV3UuirtBlaster/Forms/BlastCommand.designer.cs (rev 0) +++ trunk/plugins/TV3UuirtBlaster/Forms/BlastCommand.designer.cs 2007-05-04 17:08:44 UTC (rev 375) @@ -0,0 +1,152 @@ +namespace TvEngine +{ + + partial class BlastCommand + { + /// <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.labelIRFile = new System.Windows.Forms.Label(); + this.labelBlasterPort = new System.Windows.Forms.Label(); + this.comboBoxPort = new System.Windows.Forms.ComboBox(); + this.labelIRCommandFile = new System.Windows.Forms.Label(); + this.buttonTest = new System.Windows.Forms.Button(); + this.buttonOK = new System.Windows.Forms.Button(); + this.buttonCancel = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // labelIRFile + // + this.labelIRFile.Location = new System.Drawing.Point(8, 8); + this.labelIRFile.Name = "labelIRFile"; + this.labelIRFile.Size = new System.Drawing.Size(88, 20); + this.labelIRFile.TabIndex = 0; + this.labelIRFile.Text = "IR Command:"; + this.labelIRFile.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // labelBlasterPort + // + this.labelBlasterPort.Location = new System.Drawing.Point(8, 40); + this.labelBlasterPort.Name = "labelBlasterPort"; + this.labelBlasterPort.Size = new System.Drawing.Size(88, 21); + this.labelBlasterPort.TabIndex = 2; + this.labelBlasterPort.Text = "Blaster port:"; + this.labelBlasterPort.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // comboBoxPort + // + this.comboBoxPort.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBoxPort.FormattingEnabled = true; + this.comboBoxPort.Location = new System.Drawing.Point(96, 40); + this.comboBoxPort.Name = "comboBoxPort"; + this.comboBoxPort.Size = new System.Drawing.Size(104, 21); + this.comboBoxPort.TabIndex = 3; + // + // labelIRCommandFile + // + this.labelIRCommandFile.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.labelIRCommandFile.AutoEllipsis = true; + this.labelIRCommandFile.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; + this.labelIRCommandFile.Location = new System.Drawing.Point(96, 8); + this.labelIRCommandFile.Name = "labelIRCommandFile"; + this.labelIRCommandFile.Size = new System.Drawing.Size(184, 20); + this.labelIRCommandFile.TabIndex = 1; + this.labelIRCommandFile.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // buttonTest + // + this.buttonTest.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.buttonTest.Location = new System.Drawing.Point(8, 72); + this.buttonTest.Name = "buttonTest"; + this.buttonTest.Size = new System.Drawing.Size(56, 24); + this.buttonTest.TabIndex = 4; + this.buttonTest.Text = "Test"; + this.buttonTest.UseVisualStyleBackColor = true; + this.buttonTest.Click += new System.EventHandler(this.buttonTest_Click); + // + // 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(160, 72); + this.buttonOK.Name = "buttonOK"; + this.buttonOK.Size = new System.Drawing.Size(56, 24); + this.buttonOK.TabIndex = 5; + this.buttonOK.Text = "OK"; + this.buttonOK.UseVisualStyleBackColor = true; + this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); + // + // buttonCancel + // + this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.buttonCancel.Location = new System.Drawing.Point(224, 72); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.Size = new System.Drawing.Size(56, 24); + this.buttonCancel.TabIndex = 6; + this.buttonCancel.Text = "Cancel"; + this.buttonCancel.UseVisualStyleBackColor = true; + this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); + // + // BlastCommand + // + 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(288, 104); + this.Controls.Add(this.buttonOK); + this.Controls.Add(this.buttonCancel); + this.Controls.Add(this.buttonTest); + this.Controls.Add(this.labelIRCommandFile); + this.Controls.Add(this.labelBlasterPort); + this.Controls.Add(this.comboBoxPort); + this.Controls.Add(this.labelIRFile); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.MinimumSize = new System.Drawing.Size(294, 136); + this.Name = "BlastCommand"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Blast Command"; + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Label labelIRFile; + private System.Windows.Forms.Label labelBlasterPort; + private System.Windows.Forms.ComboBox comboBoxPort; + private System.Windows.Forms.Label labelIRCommandFile; + private System.Windows.Forms.Button buttonTest; + private System.Windows.Forms.Button buttonOK; + private System.Windows.Forms.Button buttonCancel; + } + +} Added: trunk/plugins/TV3UuirtBlaster/Forms/BlastCommand.resx =================================================================== --- trunk/plugins/TV3UuirtBlaster/Forms/BlastCommand.resx (rev 0) +++ trunk/plugins/TV3UuirtBlaster/Forms/BlastCommand.resx 2007-05-04 17:08:44 UTC (rev 375) @@ -0,0 +1,120 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> +</root> \ No newline at end of file Added: trunk/plugins/TV3UuirtBlaster/Forms/ExternalChannels.cs =================================================================== --- trunk/plugins/TV3UuirtBlaster/Forms/ExternalChannels.cs (rev 0) +++ trunk/plugins/TV3UuirtBlaster/Forms/ExternalChannels.cs 2007-05-04 17:08:44 UTC (rev 375) @@ -0,0 +1,253 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Diagnostics; +using System.Drawing; +using System.IO; +using System.Text; +using System.Threading; +using System.Windows.Forms; +using System.Xml; + +namespace TvEngine +{ + + public partial class ExternalChannels : Form + { + + #region Variables + + StbSetup[] _tvCardStbSetups; + + #endregion Variables + + #region Constructor + + public ExternalChannels() + { + InitializeComponent(); + } + + #endregion Constructor + + private void ExternalChannels_Load(object sender, EventArgs e) + { + IList cards = TvDatabase.Card.ListAll(); + + _tvCardStbSetups = new StbSetup[cards.Count]; + + comboBoxCopyFrom.Items.Clear(); + + TabPage tempPage; + int index = 0; + + foreach (TvDatabase.Card card in cards) + { + comboBoxCopyFrom.Items.Add(card.IdCard); + + _tvCardStbSetups[index] = new StbSetup(card.IdCard); + _tvCardStbSetups[index].Name = string.Format("StbSetup{0}", index); + _tvCardStbSetups[index].Dock = DockStyle.Fill; + _tvCardStbSetups[index].TabIndex = 0; + + tempPage = new TabPage(string.Format("TV Card {0}", index + 1)); + tempPage.Controls.Add(_tvCardStbSetups[index]); + + this.tabControlTVCards.TabPages.Add(tempPage); + + index++; + } + + comboBoxCopyFrom.SelectedIndex = 0; + + // Setup quick setup combo box + string[] quickSetupFiles = Directory.GetFiles(TV3UuirtBlaster.AppDataFolder + TV3UuirtBlaster.STBFolder, "*.xml", SearchOption.TopDirectoryOnly); + foreach (string file in quickSetupFiles) + comboBoxQuickSetup.Items.Add(Path.GetFileNameWithoutExtension(file)); + + comboBoxQuickSetup.Items.Add("Clear all"); + } + + static bool ProcessExternalChannelProgram(string runCommand, int currentChannelDigit, string fullChannelString) + { + string[] commands = TV3UuirtBlaster.SplitRunCommand(runCommand); + + if (commands == null) + return false; + + commands[2] = commands[2].Replace("%1", currentChannelDigit.ToString()); + commands[2] = commands[2].Replace("%2", fullChannelString); + + return TV3UuirtBlaster.ProcessRunCommand(commands); + } + + static bool ProcessSerialCommand(string serialCommand, int currentChannelDigit, string fullChannelString) + { + string[] commands = TV3UuirtBlaster.SplitSerialCommand(serialCommand); + + if (commands == null) + return false; + + commands[0] = commands[0].Replace("%1", currentChannelDigit.ToString()); + commands[0] = commands[0].Replace("%2", fullChannelString); + + return TV3UuirtBlaster.ProcessSerialCommand(commands); + + } + + #region Buttons + + private void buttonOK_Click(object sender, EventArgs e) + { + foreach (StbSetup setup in _tvCardStbSetups) + { + setup.Save(); + TV3UuirtBlaster.GetExternalChannelConfig(setup.CardId).SaveExternalChannelConfig(); + } + + this.DialogResult = DialogResult.OK; + this.Close(); + } + + private void buttonTest_Click(object sender, EventArgs e) + { + StbSetup setup = _tvCardStbSetups[tabControlTVCards.SelectedIndex]; + + int channelTest = Decimal.ToInt32(numericUpDownTest.Value); + string channel; + switch (setup.ChannelDigits) + { + case 2: + channel = channelTest.ToString("00"); + break; + + case 3: + channel = channelTest.ToString("000"); + break; + + case 4: + channel = channelTest.ToString("0000"); + break; + + default: + channel = channelTest.ToString(); + break; + } + + try + { + int charVal; + string command; + + for (int repeatCount = 0; repeatCount <= setup.RepeatChannelCommands; repeatCount++) + { + if (repeatCount > 0 && setup.RepeatPauseTime > 0) + Thread.Sleep(setup.RepeatPauseTime); + + if (setup.UsePreChangeCommand && !String.IsNullOrEmpty(setup.PreChangeCommand)) + { + if (setup.PreChangeCommand.StartsWith(TV3UuirtBlaster.RunCommandPrefix)) + ProcessExternalChannelProgram(setup.PreChangeCommand.Substring(TV3UuirtBlaster.RunCommandPrefix.Length), -1, channel); + else if (setup.PreChangeCommand.StartsWith(TV3UuirtBlaster.SerialCommandPrefix)) + ProcessSerialCommand(setup.PreChangeCommand.Substring(TV3UuirtBlaster.SerialCommandPrefix.Length), -1, channel); + else + TV3UuirtBlaster.ProcessCommand(setup.PreChangeCommand); + + if (setup.PauseTime > 0) + Thread.Sleep(setup.PauseTime); + } + + foreach (char digit in channel) + { + charVal = digit - 48; + + command = setup.Digits[charVal]; + if (!String.IsNullOrEmpty(command)) + { + if (command.StartsWith(TV3UuirtBlaster.RunCommandPrefix)) + ProcessExternalChannelProgram(command.Substring(TV3UuirtBlaster.RunCommandPrefix.Length), charVal, channel); + else if (command.StartsWith(TV3UuirtBlaster.SerialCommandPrefix)) + ProcessSerialCommand(command.Substring(TV3UuirtBlaster.SerialCommandPrefix.Length), charVal, channel); + else + TV3UuirtBlaster.ProcessCommand(command); + + if (setup.PauseTime > 0) + Thread.Sleep(setup.PauseTime); + } + } + + if (setup.SendSelect && !String.IsNullOrEmpty(setup.SelectCommand)) + { + if (setup.SelectCommand.StartsWith(TV3UuirtBlaster.RunCommandPrefix)) + { + ProcessExternalChannelProgram(setup.SelectCommand.Substring(TV3UuirtBlaster.RunCommandPrefix.Length), -1, channel); + + if (setup.DoubleChannelSelect) + { + if (setup.PauseTime > 0) + Thread.Sleep(setup.PauseTime); + + ProcessExternalChannelProgram(setup.SelectCommand.Substring(TV3UuirtBlaster.RunCommandPrefix.Length), -1, channel); + } + } + else if (setup.SelectCommand.StartsWith(TV3UuirtBlaster.SerialCommandPrefix)) + { + ProcessSerialCommand(setup.SelectCommand.Substring(TV3UuirtBlaster.SerialCommandPrefix.Length), -1, channel); + + if (setup.DoubleChannelSelect) + { + if (setup.PauseTime > 0) + Thread.Sleep(setup.PauseTime); + + ProcessSerialCommand(setup.SelectCommand.Substring(TV3UuirtBlaster.SerialCommandPrefix.Length), -1, channel); + } + } + else + { + TV3UuirtBlaster.ProcessCommand(setup.SelectCommand); + + if (setup.DoubleChannelSelect) + { + if (setup.PauseTime > 0) + Thread.Sleep(setup.PauseTime); + + TV3UuirtBlaster.ProcessCommand(setup.SelectCommand); + } + } + } + } + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Failed to test external channel", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void buttonQuickSet_Click(object sender, EventArgs e) + { + string quickSetup = comboBoxQuickSetup.Text; + + if (String.IsNullOrEmpty(quickSetup)) + return; + + _tvCardStbSetups[tabControlTVCards.SelectedIndex].SetToXml(quickSetup); + } + + private void buttonCopyFrom_Click(object sender, EventArgs e) + { + _tvCardStbSetups[tabControlTVCards.SelectedIndex].SetToCard((int)comboBoxCopyFrom.SelectedItem); + } + + private void buttonCancel_Click(object sender, EventArgs e) + { + this.DialogResult = DialogResult.Cancel; + this.Close(); + } + + #endregion Buttons + + } + +} Added: trunk/plugins/TV3UuirtBlaster/Forms/ExternalChannels.designer.cs =================================================================== --- trunk/plugins/TV3UuirtBlaster/Forms/ExternalChannels.designer.cs (rev 0) +++ trunk/plugins/TV3UuirtBlaster/Forms/ExternalChannels.designer.cs 2007-05-04 17:08:44 UTC (rev 375) @@ -0,0 +1,233 @@ +namespace TvEngine +{ + partial class ExternalChannels + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + this.buttonOK = new System.Windows.Forms.Button(); + this.groupBoxQuickSetup = new System.Windows.Forms.GroupBox(); + this.buttonQuickSet = new System.Windows.Forms.Button(); + this.comboBoxQuickSetup = new System.Windows.Forms.ComboBox(); + this.groupBoxTest = new System.Windows.Forms.GroupBox(); + this.labelCh = new System.Windows.Forms.Label(); + this.buttonTest = new System.Windows.Forms.Button(); + this.numericUpDownTest = new System.Windows.Forms.NumericUpDown(); + this.buttonCopyFrom = new System.Windows.Forms.Button(); + this.comboBoxCopyFrom = new System.Windows.Forms.ComboBox(); + this.tabControlTVCards = new System.Windows.Forms.TabControl(); + this.buttonCancel = new System.Windows.Forms.Button(); + this.groupBoxQuickSetup.SuspendLayout(); + this.groupBoxTest.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownTest)).BeginInit(); + this.SuspendLayout(); + // + // buttonOK + // + this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonOK.Location = new System.Drawing.Point(400, 416); + this.buttonOK.Name = "buttonOK"; + this.buttonOK.Size = new System.Drawing.Size(56, 24); + this.buttonOK.TabIndex = 5; + this.buttonOK.Text = "OK"; + this.buttonOK.UseVisualStyleBackColor = true; + this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); + // + // groupBoxQuickSetup + // + this.groupBoxQuickSetup.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBoxQuickSetup.Controls.Add(this.buttonQuickSet); + this.groupBoxQuickSetup.Controls.Add(this.comboBoxQuickSetup); + this.groupBoxQuickSetup.Location = new System.Drawing.Point(8, 360); + this.groupBoxQuickSetup.Name = "groupBoxQuickSetup"; + this.groupBoxQuickSetup.Size = new System.Drawing.Size(288, 48); + this.groupBoxQuickSetup.TabIndex = 1; + this.groupBoxQuickSetup.TabStop = false; + this.groupBoxQuickSetup.Text = "Quick Setup"; + // + // buttonQuickSet + // + this.buttonQuickSet.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.buttonQuickSet.Location = new System.Drawing.Point(232, 16); + this.buttonQuickSet.Name = "buttonQuickSet"; + this.buttonQuickSet.Size = new System.Drawing.Size(48, 21); + this.buttonQuickSet.TabIndex = 1; + this.buttonQuickSet.Text = "Set"; + this.buttonQuickSet.UseVisualStyleBackColor = true; + this.buttonQuickSet.Click += new System.EventHandler(this.buttonQuickSet_Click); + // + // comboBoxQuickSetup + // + this.comboBoxQuickSetup.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.comboBoxQuickSetup.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBoxQuickSetup.FormattingEnabled = true; + this.comboBoxQuickSetup.Location = new System.Drawing.Point(8, 16); + this.comboBoxQuickSetup.Name = "comboBoxQuickSetup"; + this.comboBoxQuickSetup.Size = new System.Drawing.Size(216, 21); + this.comboBoxQuickSetup.TabIndex = 0; + // + // groupBoxTest + // + this.groupBoxTest.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.groupBoxTest.Controls.Add(this.labelCh); + this.groupBoxTest.Controls.Add(this.buttonTest); + this.groupBoxTest.Controls.Add(this.numericUpDownTest); + this.groupBoxTest.Location = new System.Drawing.Point(304, 360); + this.groupBoxTest.Name = "groupBoxTest"; + this.groupBoxTest.Size = new System.Drawing.Size(216, 48); + this.groupBoxTest.TabIndex = 2; + this.groupBoxTest.TabStop = false; + this.groupBoxTest.Text = "Test"; + // + // labelCh + // + this.labelCh.Location = new System.Drawing.Point(8, 16); + this.labelCh.Name = "labelCh"; + this.labelCh.Size = new System.Drawing.Size(64, 20); + this.labelCh.TabIndex = 0; + this.labelCh.Text = "Channel:"; + this.labelCh.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // buttonTest + // + this.buttonTest.Location = new System.Drawing.Point(152, 16); + this.buttonTest.Name = "buttonTest"; + this.buttonTest.Size = new System.Drawing.Size(56, 20); + this.buttonTest.TabIndex = 2; + this.buttonTest.Text = "Test"; + this.buttonTest.UseVisualStyleBackColor = true; + this.buttonTest.Click += new System.EventHandler(this.buttonTest_Click); + // + // numericUpDownTest + // + this.numericUpDownTest.Location = new System.Drawing.Point(72, 16); + this.numericUpDownTest.Maximum = new decimal(new int[] { + 9999, + 0, + 0, + 0}); + this.numericUpDownTest.Name = "numericUpDownTest"; + this.numericUpDownTest.Size = new System.Drawing.Size(72, 20); + this.numericUpDownTest.TabIndex = 1; + this.numericUpDownTest.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.numericUpDownTest.Value = new decimal(new int[] { + 1, + 0, + 0, + 0}); + // + // buttonCopyFrom + // + this.buttonCopyFrom.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.buttonCopyFrom.Location = new System.Drawing.Point(8, 416); + this.buttonCopyFrom.Name = "buttonCopyFrom"; + this.buttonCopyFrom.Size = new System.Drawing.Size(144, 21); + this.buttonCopyFrom.TabIndex = 3; + this.buttonCopyFrom.Text = "Copy from saved config:"; + this.buttonCopyFrom.UseVisualStyleBackColor = true; + this.buttonCopyFrom.Click += new System.EventHandler(this.buttonCopyFrom_Click); + // + // comboBoxCopyFrom + // + this.comboBoxCopyFrom.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.comboBoxCopyFrom.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBoxCopyFrom.FormattingEnabled = true; + this.comboBoxCopyFrom.Location = new System.Drawing.Point(160, 416); + this.comboBoxCopyFrom.Name = "comboBoxCopyFrom"; + this.comboBoxCopyFrom.Size = new System.Drawing.Size(120, 21); + this.comboBoxCopyFrom.TabIndex = 4; + // + // tabControlTVCards + // + this.tabControlTVCards.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.tabControlTVCards.Location = new System.Drawing.Point(8, 8); + this.tabControlTVCards.Name = "tabControlTVCards"; + this.tabControlTVCards.SelectedIndex = 0; + this.tabControlTVCards.Size = new System.Drawing.Size(512, 344); + this.tabControlTVCards.TabIndex = 0; + // + // buttonCancel + // + this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.buttonCancel.Location = new System.Drawing.Point(464, 416); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.Size = new System.Drawing.Size(56, 24); + this.buttonCancel.TabIndex = 6; + this.buttonCancel.Text = "Cancel"; + this.buttonCancel.UseVisualStyleBackColor = true; + this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); + // + // ExternalChannels + // + 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(528, 447); + this.Controls.Add(this.buttonCancel); + this.Controls.Add(this.tabControlTVCards); + this.Controls.Add(this.comboBoxCopyFrom); + this.Controls.Add(this.buttonCopyFrom); + this.Controls.Add(this.groupBoxTest); + this.Controls.Add(this.groupBoxQuickSetup); + this.Controls.Add(this.buttonOK); + this.MinimizeBox = false; + this.MinimumSize = new System.Drawing.Size(536, 474); + this.Name = "ExternalChannels"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "External Channel Changing"; + this.Load += new System.EventHandler(this.ExternalChannels_Load); + this.groupBoxQuickSetup.ResumeLayout(false); + this.groupBoxTest.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownTest)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Button buttonOK; + private System.Windows.Forms.GroupBox groupBoxQuickSetup; + private System.Windows.Forms.ComboBox comboBoxQuickSetup; + private System.Windows.Forms.GroupBox groupBoxTest; + private System.Windows.Forms.NumericUpDown numericUpDownTest; + private System.Windows.Forms.Button buttonTest; + private System.Windows.Forms.Button buttonQuickSet; + private System.Windows.Forms.Label labelCh; + private System.Windows.Forms.Button buttonCopyFrom; + private System.Windows.Forms.ComboBox comboBoxCopyFrom; + private System.Windows.Forms.TabControl tabControlTVCards; + private System.Windows.Forms.Button buttonCancel; + + } +} \ No newline at end of file Added: trunk/plugins/TV3UuirtBlaster/Forms/ExternalChannels.resx =================================================================== --- trunk/plugins/TV3UuirtBlaster/Forms/ExternalChannels.resx (rev 0) +++ trunk/plugins/TV3UuirtBlaster/Forms/ExternalChannels.resx 2007-05-04 17:08:44 UTC (rev 375) @@ -0,0 +1,120 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> +</root> \ No newline at end of file Added: trunk/plugins/TV3UuirtBlaster/Forms/ExternalProgram.Designer.cs =================================================================== --- trunk/plugins/TV3UuirtBlaster/Forms/ExternalProgram.Designer.cs (rev 0) +++ trunk/plugins/TV3UuirtBlaster/Forms/ExternalProgram.Designer.cs 2007-05-04 17:08:44 UTC (rev 375) @@ -0,0 +1,294 @@ +namespace TvEngine +{ + partial class ExternalProgram + { + /// <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.textBoxProgram = new System.Windows.Forms.TextBox(); + this.labelProgram = new System.Windows.Forms.Label(); + this.buttonProgam = new System.Windows.Forms.Button(); + this.buttonStartup = new System.Windows.Forms.Button(); + this.labelStartup = new System.Windows.Forms.Label(); + this.textBoxStartup = new System.Windows.Forms.TextBox(); + this.buttonOK = new System.Windows.Forms.Button(); + this.buttonCancel = new System.Windows.Forms.Button(); + this.labelParameters = new System.Windows.Forms.Label(); + this.textBoxParameters = new System.Windows.Forms.TextBox(); + this.openFileDialog = new System.Windows.Forms.OpenFileDialog(); + this.folderBrowserDialog = new System.Windows.Forms.FolderBrowserDialog(); + this.buttonParamQuestion = new System.Windows.Forms.Button(); + this.checkBoxShellExecute = new System.Windows.Forms.CheckBox(); + this.buttonTest = new System.Windows.Forms.Button(); + this.checkBoxNoWindow = new System.Windows.Forms.CheckBox(); + this.checkBoxWaitForExit = new System.Windows.Forms.CheckBox(); + this.comboBoxWindowStyle = new System.Windows.Forms.ComboBox(); + this.labelWindowStyle = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // textBoxProgram + // + this.textBoxProgram.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBoxProgram.Location = new System.Drawing.Point(8, 24); + this.textBoxProgram.Name = "textBoxProgram"; + this.textBoxProgram.Size = new System.Drawing.Size(288, 20); + this.textBoxProgram.TabIndex = 1; + // + // labelProgram + // + this.labelProgram.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windo... [truncated message content] |
From: <du...@us...> - 2007-05-11 21:31:18
|
Revision: 397 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=397&view=rev Author: dukus Date: 2007-05-11 14:31:08 -0700 (Fri, 11 May 2007) Log Message: ----------- Initial import Added Paths: ----------- trunk/plugins/mypoker/ trunk/plugins/mypoker/AssemblyInfo.cs trunk/plugins/mypoker/Properties/ trunk/plugins/mypoker/cards.cs trunk/plugins/mypoker/mypoker.cs trunk/plugins/mypoker/mypoker.csproj trunk/plugins/mypoker/mypoker.csproj.user trunk/plugins/mypoker/mypoker.sln trunk/plugins/mypoker/mypoker.suo trunk/plugins/mypoker/mypoketwin.cs trunk/plugins/mypoker/skin/ trunk/plugins/mypoker/skin/MCE/ trunk/plugins/mypoker/skin/MCE/media/ trunk/plugins/mypoker/skin/MCE/media/mypoker.xml trunk/plugins/mypoker/skin/MCE/media/mypokerwin.xml trunk/plugins/mypoker/skin/MCE/media/poker/ trunk/plugins/mypoker/skin/MCE/media/poker/card1.png trunk/plugins/mypoker/skin/MCE/media/poker/card10.png trunk/plugins/mypoker/skin/MCE/media/poker/card11.png trunk/plugins/mypoker/skin/MCE/media/poker/card12.png trunk/plugins/mypoker/skin/MCE/media/poker/card13.png trunk/plugins/mypoker/skin/MCE/media/poker/card14.png trunk/plugins/mypoker/skin/MCE/media/poker/card15.png trunk/plugins/mypoker/skin/MCE/media/poker/card16.png trunk/plugins/mypoker/skin/MCE/media/poker/card17.png trunk/plugins/mypoker/skin/MCE/media/poker/card18.png trunk/plugins/mypoker/skin/MCE/media/poker/card19.png trunk/plugins/mypoker/skin/MCE/media/poker/card2.png trunk/plugins/mypoker/skin/MCE/media/poker/card20.png trunk/plugins/mypoker/skin/MCE/media/poker/card21.png trunk/plugins/mypoker/skin/MCE/media/poker/card22.png trunk/plugins/mypoker/skin/MCE/media/poker/card23.png trunk/plugins/mypoker/skin/MCE/media/poker/card24.png trunk/plugins/mypoker/skin/MCE/media/poker/card25.png trunk/plugins/mypoker/skin/MCE/media/poker/card26.png trunk/plugins/mypoker/skin/MCE/media/poker/card27.png trunk/plugins/mypoker/skin/MCE/media/poker/card28.png trunk/plugins/mypoker/skin/MCE/media/poker/card29.png trunk/plugins/mypoker/skin/MCE/media/poker/card3.png trunk/plugins/mypoker/skin/MCE/media/poker/card30.png trunk/plugins/mypoker/skin/MCE/media/poker/card31.png trunk/plugins/mypoker/skin/MCE/media/poker/card32.png trunk/plugins/mypoker/skin/MCE/media/poker/card33.png trunk/plugins/mypoker/skin/MCE/media/poker/card34.png trunk/plugins/mypoker/skin/MCE/media/poker/card35.png trunk/plugins/mypoker/skin/MCE/media/poker/card36.png trunk/plugins/mypoker/skin/MCE/media/poker/card37.png trunk/plugins/mypoker/skin/MCE/media/poker/card38.png trunk/plugins/mypoker/skin/MCE/media/poker/card39.png trunk/plugins/mypoker/skin/MCE/media/poker/card4.png trunk/plugins/mypoker/skin/MCE/media/poker/card40.png trunk/plugins/mypoker/skin/MCE/media/poker/card41.png trunk/plugins/mypoker/skin/MCE/media/poker/card42.png trunk/plugins/mypoker/skin/MCE/media/poker/card43.png trunk/plugins/mypoker/skin/MCE/media/poker/card44.png trunk/plugins/mypoker/skin/MCE/media/poker/card45.png trunk/plugins/mypoker/skin/MCE/media/poker/card46.png trunk/plugins/mypoker/skin/MCE/media/poker/card47.png trunk/plugins/mypoker/skin/MCE/media/poker/card48.png trunk/plugins/mypoker/skin/MCE/media/poker/card49.png trunk/plugins/mypoker/skin/MCE/media/poker/card5.png trunk/plugins/mypoker/skin/MCE/media/poker/card50.png trunk/plugins/mypoker/skin/MCE/media/poker/card51.png trunk/plugins/mypoker/skin/MCE/media/poker/card52.png trunk/plugins/mypoker/skin/MCE/media/poker/card6.png trunk/plugins/mypoker/skin/MCE/media/poker/card7.png trunk/plugins/mypoker/skin/MCE/media/poker/card8.png trunk/plugins/mypoker/skin/MCE/media/poker/card9.png trunk/plugins/mypoker/skin/MCE/media/poker/deck_background.png trunk/plugins/mypoker/skin/MCE/media/poker/old/ trunk/plugins/mypoker/skin/MCE/media/poker/old/card1.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card10.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card11.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card12.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card13.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card14.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card15.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card16.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card17.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card18.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card19.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card2.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card20.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card21.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card22.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card23.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card24.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card25.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card26.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card27.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card28.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card29.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card3.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card30.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card31.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card32.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card33.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card34.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card35.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card36.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card37.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card38.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card39.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card4.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card40.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card41.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card42.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card43.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card44.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card45.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card46.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card47.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card48.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card49.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card5.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card50.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card51.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card52.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card6.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card7.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card8.png trunk/plugins/mypoker/skin/MCE/media/poker/old/card9.png trunk/plugins/mypoker/skin/MCE/media/poker/old/deck_background.png trunk/plugins/mypoker/skin/MCE/media/poker/old/play.wav trunk/plugins/mypoker/skin/MCE/media/poker/play.wav Added: trunk/plugins/mypoker/AssemblyInfo.cs =================================================================== --- trunk/plugins/mypoker/AssemblyInfo.cs (rev 0) +++ trunk/plugins/mypoker/AssemblyInfo.cs 2007-05-11 21:31:08 UTC (rev 397) @@ -0,0 +1,60 @@ +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("")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion("1.0.*")] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory which is +// %Project Directory%\obj\<configuration>. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("")] +[assembly: AssemblyKeyName("")] +[assembly: ComVisibleAttribute(false)] Added: trunk/plugins/mypoker/cards.cs =================================================================== --- trunk/plugins/mypoker/cards.cs (rev 0) +++ trunk/plugins/mypoker/cards.cs 2007-05-11 21:31:08 UTC (rev 397) @@ -0,0 +1,287 @@ +using System; +using System.IO; +using System.Collections; +using MediaPortal.GUI.Library; + +namespace GUIPoker +{ + public class Tcardsgame + { + protected int[] _cards = new int[52]; + protected bool[] _iscardmoved = new bool[52]; + public Tcardsgame() + { + } + + public void init() + { + int i; + for (i = 0; i < 52; i++) + { + _cards[i] = i+1; + _iscardmoved[i] = false; + } + + } + public bool isRed(int card) + { + int suit = getSuit(card); + if (suit == 1 || suit == 2) return true; + else return false; + } + + public bool isBlack(int card) + { + int suit = getSuit(card); + if (suit == 0 || suit == 3) return true; + else return false; + } + public void suffle() + { + int i,j; + int rand1; + int rand2; + Random r = new Random(); + init (); + for (i = 1; i < 53*2; i++) + { + rand1 = r.Next(51); + rand2 = r.Next(51); + j = _cards[rand1]; + _cards[rand1] = _cards[rand2]; + _cards[rand2] = j; + + } + + } + + public int getCard() + { + int i=0; + try + { + bool canExit=false; + Random r = new Random(); + while (!canExit) + { + i = r.Next(51) ; + if (!_iscardmoved[i]) { + canExit = true; + _iscardmoved[i] = true; + } + + } + } + catch (System.IndexOutOfRangeException ex) + { + Log.Write(" Index out :{0}, {1}, i= {2} ", ex.Message, ex.StackTrace, i.ToString()); + } + + return i+1; + } + + public int getSuit(int card) + { + int suit = (card-1) / 13; + return suit; + } + + public int getFace(int card) + { + int face = (card) % 13; + if (face == 1) face = 14; + if (face == 0) face = 13; + return face; + } + public string getScorToString(int scor) + { + string strScor = ""; + if (scor == 10) { strScor = "royal flush"; } + if (scor == 9) { strScor = "straight flush"; } + if (scor == 7) { strScor = "four of a kind"; } + if (scor == 6) { strScor = "full house"; } + if (scor == 5) { strScor = "flush"; } + if (scor == 4) { strScor = "straight"; } + if (scor == 3) { strScor = "three of a kind"; } + if (scor == 2) { strScor = "two pair"; } + if (scor == 1) { strScor = "jacks or better"; } + return strScor; + } + + //calcScore() comes from this site: + //http://www.codeproject.com/books/1930110197_3.asp#34054 + //it was modified a little. + public int calcScore(int[] index) + { + + + // are cards all of the same suit? + int score = 0; + bool isFlush = true; + int s = getSuit(index[0]); + for (int i = 1; i < 5; i++) + { + if (s != getSuit(index[i])) + { + isFlush = false; + break; + } + } + // sort card values... + int[] sortedValues = new int[5]; + + for (int i = 0; i < 5; i++) + sortedValues[i] = getFace(index[i]); + Array.Sort(sortedValues); + + // are cards all of the same suit? + // do we have a straight? + bool isStraight = true; + for (int i = 0; i < 4; i++) + { + if (sortedValues[i] + 1 != sortedValues[i + 1]) + { + isStraight = false; + break; + } + } + + // is it a straight to the ace? + bool isTopStraight = (isStraight && sortedValues[4] == 14); + // maybe it is a straight from the ace (i.e. A, 2, 3, 4, 5) + if (!isStraight) + if (sortedValues[0] == 2 && + sortedValues[1] == 3 && + sortedValues[2] == 4 && + sortedValues[3] == 5 && + sortedValues[4] == 14) // ace on top + isStraight = true; + // now calculate score... + // royal flush... + if (isTopStraight && isFlush) + { + score = 10; + return score; + } + // straight flush... + if (isStraight && isFlush) + { + score = 9; + return score; + } + // four of a kind... + if (sortedValues[0] == sortedValues[1] && + sortedValues[1] == sortedValues[2] && + sortedValues[2] == sortedValues[3]) + { + score = 7; + return score; + } + if (sortedValues[1] == sortedValues[2] && + sortedValues[2] == sortedValues[3] && + sortedValues[3] == sortedValues[4]) + { + score = 7; + return score; + } + // full house... + if (sortedValues[0] == sortedValues[1] && + sortedValues[1] == sortedValues[2] && + sortedValues[3] == sortedValues[4]) + { + score = 6; + return score; + } + if (sortedValues[0] == sortedValues[1] && + sortedValues[2] == sortedValues[3] && + sortedValues[3] == sortedValues[4]) + { + score = 6; + return score; + } + // flush... + if (isFlush) + { + score = 5; + return score; + } + // straight... + if (isStraight) + { + score = 4; + return score; + } + // three of a kind... + if (sortedValues[0] == sortedValues[1] && + sortedValues[1] == sortedValues[2]) + { + score = 3; + return score; + } + if (sortedValues[1] == sortedValues[2] && + sortedValues[2] == sortedValues[3]) + { + score = 3; + return score; + } + if (sortedValues[2] == sortedValues[3] && + sortedValues[3] == sortedValues[4]) + { + score = 3; + return score; + } + // two pair... + if (sortedValues[0] == sortedValues[1] && + sortedValues[2] == sortedValues[3]) + { + score = 2; + return score; + } + if (sortedValues[0] == sortedValues[1] && + sortedValues[3] == sortedValues[4]) + { + score = 2; + return score; + } + if (sortedValues[1] == sortedValues[2] && + sortedValues[3] == sortedValues[4]) + { + score = 2; + return score; + } + // jacks or better... + if (sortedValues[0] > 9 && + sortedValues[0] == sortedValues[1]) + { + score = 1; + return score; + } + if (sortedValues[1] > 9 && + sortedValues[1] == sortedValues[2]) + { + score = 1; + return score; + } + if (sortedValues[2] > 9 && + sortedValues[2] == sortedValues[3]) + { + score = 1; + return score; + } + if (sortedValues[3] > 9 && + sortedValues[3] == sortedValues[4]) + { + score = 1; + return score; + } + + score = -1; + return score; + + + } + + + + } +} Added: trunk/plugins/mypoker/mypoker.cs =================================================================== --- trunk/plugins/mypoker/mypoker.cs (rev 0) +++ trunk/plugins/mypoker/mypoker.cs 2007-05-11 21:31:08 UTC (rev 397) @@ -0,0 +1,400 @@ +using System; +using System.Collections; +using System.Windows.Forms; +using MediaPortal.GUI.Library; +using MediaPortal.Util; +using MediaPortal.Dialogs; +using SQLite.NET; + + +namespace GUIPoker +{ + /// <summary> + /// Summary description for MyPoker. + /// </summary> + public class MyPoker : GUIWindow, ISetupForm + { + + float timeCount = 0; + int curentCard = 0; + int bet = 0; + int money = 100; + int turn_left = 100; + bool canDraw = false; + bool _isStarted = false; + bool _isfirsttime = true; + bool _isdrawfinish = true; + bool _iswin = false; + bool[] heldCards = new bool[5] { false, false, false, false, false }; + int[] deckCards = new int[5] { 0, 0, 0, 0, 0 }; + Tcardsgame pokercards= new Tcardsgame(); + enum Controls : int + { + btn_play = 2, + btn_deal = 3, + btn_bet = 4, + card1 = 24, + card2 = 25, + card3 = 26, + card4 = 27, + card5 = 28, + txtheld1 = 29, + txtheld2 = 30, + txtheld3 = 31, + txtheld4 = 32, + txtheld5 = 33, + btnheld1 = 34, + btnheld2 = 35, + btnheld3 = 36, + btnheld4 = 37, + btnheld5 = 38 + } + enum Option : int + { + waitTime = 100 + } + public MyPoker() + { + + // + // TODO: Add constructor logic here + // + } + #region ISetupForm Members + + // Returns the name of the plugin which is shown in the plugin menu + public string PluginName() + { + return "My Poker"; + } + + // Returns the description of the plugin is shown in the plugin menu + public string Description() + { + return "My Poker"; + } + + // Returns the author of the plugin which is shown in the plugin menu + public string Author() + { + return "Dukus"; + } + + // show the setup dialog + public void ShowPlugin() + { + MessageBox.Show("Nothing to configure"); + } + + // Indicates whether plugin can be enabled/disabled + public bool CanEnable() + { + return true; + } + + // get ID of windowplugin belonging to this setup + public int GetWindowId() + { + return 7178; + } + + // Indicates if plugin is enabled by default; + public bool DefaultEnabled() + { + return true; + } + // indicates if a plugin has its own setup screen + public bool HasSetup() + { + return true; + } + + /// <summary> + /// If the plugin should have its own button on the main menu of Mediaportal then it + /// should return true to this method, otherwise if it should not be on home + /// it should return false + /// </summary> + /// <param name="strButtonText">text the button should have</param> + /// <param name="strButtonImage">image for the button, or empty for default</param> + /// <param name="strButtonImageFocus">image for the button, or empty for default</param> + /// <param name="strPictureImage">subpicture for the button or empty for none</param> + /// <returns>true : plugin needs its own button on home + /// false : plugin does not need its own button on home</returns> + public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) + { + strButtonText=PluginName(); + strButtonImage=String.Empty; + strButtonImageFocus=String.Empty; + strPictureImage=String.Empty; + return true; + } + + + public override int GetID + { + get + { + return 7178; + } + set + { + } + } + + public override bool Init() + { + return Load(GUIGraphicsContext.Skin+@"\mypoker.xml"); + } + #endregion + + protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType) + { + base.OnClicked (controlId, control, actionType); + } + protected override void OnPageLoad() + { + } + + private void setCard(int cardNum, int cardType, bool playSound ) + { + GUIImage image = (GUIImage)GetControl((int)Controls.card1-1+cardNum); + if (cardType == 0) image.SetFileName(GUIGraphicsContext.Skin + @"\media\poker\deck_background.png"); + if (cardType > 0) + { + string strFileNumber=cardType.ToString().Trim(); + image.SetFileName(GUIGraphicsContext.Skin + string.Format("\\media\\poker\\card{0}.png",strFileNumber )); + + if (playSound)Utils.PlaySound(GUIGraphicsContext.Skin + @"\media\poker\play.wav", false, true); + } + } + + public override void Render(float timePassed) + { +// System.Windows.Forms.MessageBox.Show(Environment.TickCount.ToString()); + if (canDraw && !_isdrawfinish) renderCards(); + base.Render(timePassed); + } + + public override void OnAction(Action action) + { + if(_isdrawfinish&&_isStarted) +// System.Windows.Forms.MessageBox.Show(action.wID.ToString()); + + { + if (action.wID == Action.ActionType.REMOTE_0 && _isdrawfinish) drawGame(); + if (action.wID == Action.ActionType.REMOTE_1) togleHeld(0); + if (action.wID == Action.ActionType.REMOTE_2) togleHeld(1); + if (action.wID == Action.ActionType.REMOTE_3) togleHeld(2); + if (action.wID == Action.ActionType.REMOTE_4) togleHeld(3); + if (action.wID == Action.ActionType.REMOTE_5) togleHeld(4); + } + base.OnAction(action); + } + + private void renderCards() + { + if ((Environment.TickCount - timeCount) > 200) + { + timeCount = Environment.TickCount; + curentCard++; + if (curentCard > 0 && curentCard < 6) + { + setCard(curentCard, deckCards[curentCard - 1], true); + } + if (curentCard > 5) + { + _isdrawfinish = true; + testDrawState(); + } + } + + } + private bool testIFWin() + { + int score = pokercards.calcScore(deckCards); + + if (score>0) + { +// System.Windows.Forms.MessageBox.Show(pokercards.getScorToString(score)); + + //System.Windows.Forms.MessageBox.Show(string.Format("{0},{1},{2},{3},{4}", + // pokercards.getFace(deckCards[0]), + // pokercards.getFace(deckCards[1]), + // pokercards.getFace(deckCards[2]), + // pokercards.getFace(deckCards[3]), + // pokercards.getFace(deckCards[4]) + // )); + MediaPortal.Profile.XmlSettingsProvider xmlwriter = new MediaPortal.Profile.XmlSettingsProvider("myPoker.xml"); + xmlwriter.SetValue("myPoker", "score", score.ToString()); + xmlwriter.SetValue("myPoker", "bet", bet.ToString()); + xmlwriter.Save(); + _iswin = true; + GUIWindowManager.ActivateWindow(7179); + }; + + return false; + } + private void testDrawState() + { + if (_isfirsttime) + { + _isfirsttime = false; + } + else + { + _isfirsttime = true; + int i; + for (i = 0; i < 5; i++) + { + GUIControl.HideControl(GetID, (int)Controls.txtheld1 + i); + heldCards[i] = false; + } + testIFWin(); + } + } + + private void newGame() + { + int i; + for (i = 0; i < 5; i++) + { + GUIControl.ShowControl(GetID, (int)Controls.btnheld1 + i); + setCard(i + 1, 0, false); + } + GUIControl.ShowControl(GetID, (int)Controls.btn_deal); + GUIControl.EnableControl(GetID, (int)Controls.btn_deal); + GUIControl.ShowControl(GetID, (int)Controls.btn_bet); + GUIPropertyManager.SetProperty("#txtsco", "Score"); + GUIPropertyManager.SetProperty("#txtbet", "Bet "); + GUIPropertyManager.SetProperty("#txtturn", "Turn left "); + bet = 1; + money = 100; + turn_left = 100; + showScore(); + pokercards.suffle(); + } + + private void testEndGame() + { + if(money<1||turn_left<1) + { + GUIControl.DisableControl(GetID, (int)Controls.btn_deal); + } + + } + + private void showScore() + { + GUIPropertyManager.SetProperty("#b", bet.ToString()); + GUIPropertyManager.SetProperty("#sco", money.ToString()); + GUIPropertyManager.SetProperty("#turn", turn_left.ToString()); + } + private void drawGame() + { + int i; + if (_isfirsttime) + { + pokercards.suffle(); + money -= bet; + turn_left--; + for (i = 0; i < 5; i++) + { + deckCards[i] = pokercards.getCard(); + setCard(i + 1, 0, false); + GUIControl.EnableControl(GetID, (int)Controls.btnheld1 + i); + } + } + else + { + for (i = 0; i < 5; i++) + { + if (!heldCards[i]) deckCards[i] = pokercards.getCard(); + GUIControl.DisableControl(GetID, (int)Controls.btnheld1+i); + } + } + testEndGame(); + canDraw = true; + _isdrawfinish = false; + curentCard = 0; + showScore(); + } + + + public override bool OnMessage(GUIMessage message) + { +// System.Windows.Forms.MessageBox.Show(message.Message.ToString()); + switch (message.Message) + { + case GUIMessage.MessageType.GUI_MSG_WINDOW_INIT: + base.OnMessage(message); + return OnInit(); + case GUIMessage.MessageType.GUI_MSG_CLICKED: + int iControl = message.SenderControlId; + if (iControl == (int)Controls.btn_play && _isdrawfinish) newGame(); + if (iControl == (int)Controls.btn_deal && _isdrawfinish) drawGame(); + if (iControl == (int)Controls.btn_bet && _isdrawfinish) { + bet++; + if (bet > 9) bet = 1; + showScore(); + } + int i; + for (i = 0; i < 5; ++i) + if (iControl == (int)Controls.btnheld1 + i) togleHeld(i); + break; + + } + return base.OnMessage(message); + } + private void togleHeld(int index) + { + if (!heldCards[index]) + { + GUIControl.ShowControl(GetID, (int)Controls.txtheld1 + index); + heldCards[index] = !heldCards[index]; + } + else + { + GUIControl.HideControl(GetID, (int)Controls.txtheld1 + index); + heldCards[index] = !heldCards[index]; + } + + } + private bool OnInit() + { + if (_iswin) + { + _iswin = false; + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("myPoker.xml")) + { + int winscore = int.Parse((string)xmlreader.GetValue("myPoker", "money")); + money += winscore; + showScore(); + } + } + if (!_isStarted) + { + + int i; + for (i = 0; i < 5; i++) + { + GUIControl.HideControl(GetID, (int)Controls.txtheld1 + i); + GUIControl.HideControl(GetID, (int)Controls.btnheld1 + i); + } + GUIControl.HideControl(GetID, (int)Controls.btn_deal); + GUIControl.HideControl(GetID, (int)Controls.btn_bet); + GUIPropertyManager.SetProperty("#txtsco", " "); + GUIPropertyManager.SetProperty("#txtbet", " "); + GUIPropertyManager.SetProperty("#txtturn", " "); + bet = 1 ; + + _isStarted = true ; + + } + return true; + } + +// + } + + +} Added: trunk/plugins/mypoker/mypoker.csproj =================================================================== --- trunk/plugins/mypoker/mypoker.csproj (rev 0) +++ trunk/plugins/mypoker/mypoker.csproj 2007-05-11 21:31:08 UTC (rev 397) @@ -0,0 +1,122 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <ProjectType>Local</ProjectType> + <ProductVersion>8.0.50727</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{5527BB4D-C0E1-4F42-B1F7-9E68E411AD4D}</ProjectGuid> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ApplicationIcon> + </ApplicationIcon> + <AssemblyKeyContainerName> + </AssemblyKeyContainerName> + <AssemblyName>MyPoker</AssemblyName> + <AssemblyOriginatorKeyFile> + </AssemblyOriginatorKeyFile> + <DefaultClientScript>JScript</DefaultClientScript> + <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout> + <DefaultTargetSchema>IE50</DefaultTargetSchema> + <DelaySign>false</DelaySign> + <OutputType>Library</OutputType> + <RootNamespace>MyPoker</RootNamespace> + <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent> + <StartupObject> + </StartupObject> + <FileUpgradeFlags> + </FileUpgradeFlags> + <UpgradeBackupLocation> + </UpgradeBackupLocation> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <OutputPath>bin\Debug\</OutputPath> + <AllowUnsafeBlocks>false</AllowUnsafeBlocks> + <BaseAddress>285212672</BaseAddress> + <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow> + <ConfigurationOverrideFile> + </ConfigurationOverrideFile> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <DocumentationFile> + </DocumentationFile> + <DebugSymbols>true</DebugSymbols> + <FileAlignment>4096</FileAlignment> + <NoStdLib>false</NoStdLib> + <NoWarn> + </NoWarn> + <Optimize>false</Optimize> + <RegisterForComInterop>false</RegisterForComInterop> + <RemoveIntegerChecks>false</RemoveIntegerChecks> + <TreatWarningsAsErrors>false</TreatWarningsAsErrors> + <WarningLevel>4</WarningLevel> + <DebugType>full</DebugType> + <ErrorReport>prompt</ErrorReport> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <OutputPath>bin\Release\</OutputPath> + <AllowUnsafeBlocks>false</AllowUnsafeBlocks> + <BaseAddress>285212672</BaseAddress> + <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow> + <ConfigurationOverrideFile> + </ConfigurationOverrideFile> + <DefineConstants>TRACE</DefineConstants> + <DocumentationFile> + </DocumentationFile> + <DebugSymbols>false</DebugSymbols> + <FileAlignment>4096</FileAlignment> + <NoStdLib>false</NoStdLib> + <NoWarn> + </NoWarn> + <Optimize>true</Optimize> + <RegisterForComInterop>false</RegisterForComInterop> + <RemoveIntegerChecks>false</RemoveIntegerChecks> + <TreatWarningsAsErrors>false</TreatWarningsAsErrors> + <WarningLevel>4</WarningLevel> + <DebugType>none</DebugType> + <ErrorReport>prompt</ErrorReport> + </PropertyGroup> + <ItemGroup> + <Reference Include="Core, Version=1.0.2201.1843, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>G:\Program Files\Team MediaPortal\MediaPortal\Core.dll</HintPath> + </Reference> + <Reference Include="Databases, Version=1.0.2201.1848, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>G:\Program Files\Team MediaPortal\MediaPortal\Databases.dll</HintPath> + </Reference> + <Reference Include="Dialogs, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>G:\Program Files\Team MediaPortal\MediaPortal\plugins\windows\Dialogs.dll</HintPath> + </Reference> + <Reference Include="System"> + <Name>System</Name> + </Reference> + <Reference Include="System.Data"> + <Name>System.Data</Name> + </Reference> + <Reference Include="System.Windows.Forms"> + <Name>System.Windows.Forms</Name> + </Reference> + <Reference Include="System.XML"> + <Name>System.XML</Name> + </Reference> + </ItemGroup> + <ItemGroup> + <Compile Include="AssemblyInfo.cs"> + <SubType>Code</SubType> + </Compile> + <Compile Include="cards.cs" /> + <Compile Include="mypoker.cs"> + <SubType>Code</SubType> + </Compile> + <Compile Include="mypoketwin.cs" /> + </ItemGroup> + <ItemGroup> + <Folder Include="Properties\" /> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <PropertyGroup> + <PreBuildEvent> + </PreBuildEvent> + <PostBuildEvent> + </PostBuildEvent> + </PropertyGroup> +</Project> \ No newline at end of file Added: trunk/plugins/mypoker/mypoker.csproj.user =================================================================== --- trunk/plugins/mypoker/mypoker.csproj.user (rev 0) +++ trunk/plugins/mypoker/mypoker.csproj.user 2007-05-11 21:31:08 UTC (rev 397) @@ -0,0 +1,57 @@ +<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <LastOpenVersion>7.10.3077</LastOpenVersion> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ReferencePath>C:\erwin\mediaportal\xbmc\bin\Release\;C:\erwin\mediaportal\xbmc\bin\Release\plugins\windows\</ReferencePath> + <CopyProjectDestinationFolder> + </CopyProjectDestinationFolder> + <CopyProjectUncPath> + </CopyProjectUncPath> + <CopyProjectOption>0</CopyProjectOption> + <ProjectView>ProjectFiles</ProjectView> + <ProjectTrust>0</ProjectTrust> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <EnableASPDebugging>false</EnableASPDebugging> + <EnableASPXDebugging>false</EnableASPXDebugging> + <EnableUnmanagedDebugging>false</EnableUnmanagedDebugging> + <EnableSQLServerDebugging>false</EnableSQLServerDebugging> + <RemoteDebugEnabled>false</RemoteDebugEnabled> + <RemoteDebugMachine> + </RemoteDebugMachine> + <StartAction>Project</StartAction> + <StartArguments> + </StartArguments> + <StartPage> + </StartPage> + <StartProgram> + </StartProgram> + <StartURL> + </StartURL> + <StartWorkingDirectory> + </StartWorkingDirectory> + <StartWithIE>false</StartWithIE> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <EnableASPDebugging>false</EnableASPDebugging> + <EnableASPXDebugging>false</EnableASPXDebugging> + <EnableUnmanagedDebugging>false</EnableUnmanagedDebugging> + <EnableSQLServerDebugging>false</EnableSQLServerDebugging> + <RemoteDebugEnabled>false</RemoteDebugEnabled> + <RemoteDebugMachine> + </RemoteDebugMachine> + <StartAction>Project</StartAction> + <StartArguments> + </StartArguments> + <StartPage> + </StartPage> + <StartProgram> + </StartProgram> + <StartURL> + </StartURL> + <StartWorkingDirectory> + </StartWorkingDirectory> + <StartWithIE>true</StartWithIE> + </PropertyGroup> +</Project> \ No newline at end of file Added: trunk/plugins/mypoker/mypoker.sln =================================================================== --- trunk/plugins/mypoker/mypoker.sln (rev 0) +++ trunk/plugins/mypoker/mypoker.sln 2007-05-11 21:31:08 UTC (rev 397) @@ -0,0 +1,19 @@ +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual C# Express 2005 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "mypoker", "mypoker.csproj", "{5527BB4D-C0E1-4F42-B1F7-9E68E411AD4D}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {5527BB4D-C0E1-4F42-B1F7-9E68E411AD4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5527BB4D-C0E1-4F42-B1F7-9E68E411AD4D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5527BB4D-C0E1-4F42-B1F7-9E68E411AD4D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5527BB4D-C0E1-4F42-B1F7-9E68E411AD4D}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal Added: trunk/plugins/mypoker/mypoker.suo =================================================================== (Binary files differ) Property changes on: trunk/plugins/mypoker/mypoker.suo ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/mypoker/mypoketwin.cs =================================================================== --- trunk/plugins/mypoker/mypoketwin.cs (rev 0) +++ trunk/plugins/mypoker/mypoketwin.cs 2007-05-11 21:31:08 UTC (rev 397) @@ -0,0 +1,152 @@ +using System; +using System.Windows.Forms; +using MediaPortal.GUI.Library; +using MediaPortal.Dialogs; +using MediaPortal.Util; + +namespace GUIPoker +{ + /// <summary> + /// Summary description for Class1. + /// </summary> + public class Class1 : GUIWindow + { + int bet=0; + int score=0; + int winscore = 0; + int turn = 0; + Tcardsgame pokercards = new Tcardsgame(); + int[] deckCards = new int[5] { 0, 0, 0, 0, 0 }; + enum Controls : int + { + btn_done = 4, + btn_black = 5, + btn_red = 6, + card1 = 24, + card2 = 25, + card3 = 26, + card4 = 27, + card5 = 28, + + } + public Class1() + { + // + // TODO: Add constructor logic here + // + } + + + + public override int GetID + { + get + { + return 7179; + } + set + { + } + } + + public override bool Init() + { + return Load(GUIGraphicsContext.Skin + @"\mypokerwin.xml"); + + } + + protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType) + { + } + public override bool OnMessage(GUIMessage message) + { + switch (message.Message) + { + case GUIMessage.MessageType.GUI_MSG_WINDOW_INIT: + base.OnMessage(message); + onInit(); + return true; + + case GUIMessage.MessageType.GUI_MSG_CLICKED: + int iControl = message.SenderControlId; + if (iControl == (int)Controls.btn_done) GUIWindowManager.ShowPreviousWindow(); + if (turn <= 5) + { + if (iControl == (int)Controls.btn_black) testCard(1); + if (iControl == (int)Controls.btn_red) testCard(2); + } + + break; + case GUIMessage.MessageType.GUI_MSG_WINDOW_DEINIT: + //System.Windows.Forms.MessageBox.Show(message.Message.ToString()); + + using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings("myPoker.xml")) + { + xmlwriter.SetValue("myPoker", "money", winscore.ToString()); + } + break; + } + return base.OnMessage(message); + + } + + public bool testCard(int type) + { + turn++; + bool score = false; + setCard(turn, deckCards[turn - 1], true); + //System.Windows.Forms.MessageBox.Show(pokercards.getSuit(deckCards[turn - 1]).ToString()); + + if (type == 1 && pokercards.isBlack(deckCards[turn - 1])) score=true; + if (type == 2 && pokercards.isRed(deckCards[turn - 1])) score=true; + if (score) + { + winscore = winscore * 2; + } + else + { + GUIControl.HideControl(GetID, (int)Controls.btn_black); + GUIControl.HideControl(GetID, (int)Controls.btn_red); + winscore = 0; + GUIPropertyManager.SetProperty("#wintxt", "You lose"); + } + GUIPropertyManager.SetProperty("#winsum", winscore.ToString()); + return score; + } + + public void onInit() + { + MediaPortal.Profile.XmlSettingsProvider xmlreader = new MediaPortal.Profile.XmlSettingsProvider("myPoker.xml"); + bet = int.Parse((string)xmlreader.GetValue("myPoker", "bet")); + score = int.Parse((string)xmlreader.GetValue("myPoker", "score")); + winscore = bet * score; + GUIPropertyManager.SetProperty("#wintxt", pokercards.getScorToString(score)); + GUIPropertyManager.SetProperty("#winsum", winscore.ToString()); + GUIControl.ShowControl(GetID, (int)Controls.btn_black); + GUIControl.ShowControl(GetID, (int)Controls.btn_red); + + pokercards.suffle(); + turn = 0; + for (int i = 1; i < 6; i++) + { + setCard(i, 0, false); + deckCards[i-1]=pokercards.getCard(); + } + } + + private void setCard(int cardNum, int cardType, bool playSound) + { + GUIImage image = (GUIImage)GetControl((int)Controls.card1 - 1 + cardNum); + if (cardType == 0) image.SetFileName(GUIGraphicsContext.Skin + @"\media\poker\deck_background.png"); + if (cardType > 0) + { + string strFileNumber = cardType.ToString().Trim(); + image.SetFileName(GUIGraphicsContext.Skin + string.Format("\\media\\poker\\card{0}.png", strFileNumber)); + + if (playSound) Utils.PlaySound(GUIGraphicsContext.Skin + @"\media\poker\play.wav", false, true); + } + } + + } + +} Added: trunk/plugins/mypoker/skin/MCE/media/mypoker.xml =================================================================== --- trunk/plugins/mypoker/skin/MCE/media/mypoker.xml (rev 0) +++ trunk/plugins/mypoker/skin/MCE/media/mypoker.xml 2007-05-11 21:31:08 UTC (rev 397) @@ -0,0 +1,230 @@ +<window> + <id>7178</id> + <defaultcontrol>0</defaultcontrol> + <allowoverlay>yes</allowoverlay> + <controls> + <control> + <type>image</type> + <id>1</id> + <posX>0</posX> + <posY>0</posY> + <texture>background.png</texture> + </control> + <control> + <type>button</type> + <id>4</id> + <posX>488</posX> + <posY>24</posY> + <label>Bet</label> + </control> + <control> + <type>button</type> + <id>38</id> + <posX>608</posX> + <posY>136</posY> + <label>Hold</label> + <width>64</width> + <height>32</height> + </control> + <control> + <type>button</type> + <id>37</id> + <posX>472</posX> + <posY>136</posY> + <label>Hold</label> + <width>64</width> + <height>32</height> + </control> + <control> + <type>button</type> + <id>36</id> + <posX>336</posX> + <posY>136</posY> + <label>Hold</label> + <width>64</width> + <height>32</height> + </control> + <control> + <type>button</type> + <id>35</id> + <posX>208</posX> + <posY>136</posY> + <label>Hold</label> + <width>64</width> + <height>32</height> + </control> + <control> + <type>fadelabel</type> + <id>33</id> + <posX>624</posX> + <posY>336</posY> + <label>HELD</label> + <textcolor>ff90ee90</textcolor> + <disabledcolor>ff808080</disabledcolor> + </control> + <control> + <type>fadelabel</type> + <id>32</id> + <posX>488</posX> + <posY>336</posY> + <label>HELD</label> + <textcolor>ff90ee90</textcolor> + <disabledcolor>ff808080</disabledcolor> + </control> + <control> + <type>fadelabel</type> + <id>31</id> + <posX>352</posX> + <posY>336</posY> + <label>HELD</label> + <textcolor>ff90ee90</textcolor> + <disabledcolor>ff808080</disabledcolor> + </control> + <control> + <type>fadelabel</type> + <id>30</id> + <posX>216</posX> + <posY>336</posY> + <label>HELD</label> + <textcolor>ff90ee90</textcolor> + <disabledcolor>ff556b2f</disabledcolor> + </control> + <control> + <type>image</type> + <id>28</id> + <posX>592</posX> + <posY>176</posY> + <width>100</width> + <height>150</height> + <texture>background.png</texture> + </control> + <control> + <type>image</type> + <id>27</id> + <posX>456</posX> + <posY>176</posY> + <width>100</width> + <height>150</height> + <texture>background.png</texture> + </control> + <control> + <type>image</type> + <id>26</id> + <posX>320</posX> + <posY>176</posY> + <width>100</width> + <height>150</height> + <texture>background.png</texture> + </control> + <control> + <type>image</type> + <id>25</id> + <posX>184</posX> + <posY>176</posY> + <width>100</width> + <height>150</height> + <texture>background.png</texture> + </control> + <control> + <type>image</type> + <id>24</id> + <posX>48</posX> + <posY>176</posY> + <width>100</width> + <height>150</height> + <texture>background.png</texture> + <filtered>no</filtered> + </control> + <control> + <type>button</type> + <id>2</id> + <posX>48</posX> + <posY>24</posY> + <label>19002</label> + <width>184</width> + <height>32</height> + </control> + <control> + <type>button</type> + <id>3</id> + <posX>264</posX> + <posY>24</posY> + <label>Deal</label> + </control> + <control> + <type>fadelabel</type> + <id>29</id> + <posX>72</posX> + <posY>336</posY> + <label>HELD</label> + <textcolor>ff90ee90</textcolor> + <disabledcolor>ff808080</disabledcolor> + </control> + <control> + <type>button</type> + <id>34</id> + <posX>64</posX> + <posY>136</posY> + <label>Hold</label> + <width>64</width> + <height>32</height> + </control> + <control> + <type>fadelabel</type> + <id>40</id> + <posX>696</posX> + <posY>368</posY> + <label>#b</label> + <font>font32</font> + <align>right</align> + <disabledcolor>ff808080</disabledcolor> + </control> + <control> + <type>fadelabel</type> + <id>41</id> + <posX>472</posX> + <posY>384</posY> + <label>#txtbet</label> + <font>font18</font> + <disabledcolor>ff808080</disabledcolor> + </control> + <control> + <type>fadelabel</type> + <id>42</id> + <posX>472</posX> + <posY>435</posY> + <label>#txtsco</label> + <font>font18</font> + <disabledcolor>ff808080</disabledcolor> + </control> + <control> + <type>fadelabel</type> + <id>43</id> + <posX>696</posX> + <posY>425</posY> + <label>#sco</label> + <font>font32</font> + <align>right</align> + <disabledcolor>ff808080</disabledcolor> + </control> + <control> + <type>fadelabel</type> + <id>39</id> + <posX>472</posX> + <posY>496</posY> + <label>#txtturn</label> + <font>font18</font> + <disabledcolor>ff808080</disabledcolor> + </control> + <control> + <type>fadelabel</type> + <id>44</id> + <posX>696</posX> + <posY>480</posY> + <label>#turn</label> + <font>font32</font> + <align>right</align> + <disabledcolor>ff808080</disabledcolor> + </control> + </controls> +</window> \ No newline at end of file Added: trunk/plugins/mypoker/skin/MCE/media/mypokerwin.xml =================================================================== --- trunk/plugins/mypoker/skin/MCE/media/mypokerwin.xml (rev 0) +++ trunk/plugins/mypoker/skin/MCE/media/mypokerwin.xml 2007-05-11 21:31:08 UTC (rev 397) @@ -0,0 +1,99 @@ +<window> + <id>7179</id> + <defaultcontrol>0</defaultcontrol> + <allowoverlay>yes</allowoverlay> + <controls> + <control> + <type>image</type> + <id>1</id> + <posX>0</posX> + <posY>0</posY> + <texture>background.png</texture> + </control> + <control> + <type>button</type> + <id>4</id> + <posX>520</posX> + <posY>16</posY> + <label>Done</label> + </control> + <control> + <type>fadelabel</type> + <id>60</id> + <posX>48</posX> + <posY>72</posY> + <label>#wintxt</label> + <font>font18</font> + <disabledcolor>ff808080</disabledcolor> + </control> + <control> + <type>image</type> + <id>28</id> + <posX>592</posX> + <posY>176</posY> + <width>100</width> + <height>150</height> + <texture>background.png</texture> + </control> + <control> + <type>image</type> + <id>27</id> + <posX>456</posX> + <posY>176</posY> + <width>100</width> + <height>150</height> + <texture>background.png</texture> + </control> + <control> + <type>image</type> + <id>26</id> + <posX>320</posX> + <posY>176</posY> + <width>100</width> + <height>150</height> + <texture>background.png</texture> + </control> + <control> + <type>image</type> + <id>25</id> + <posX>184</posX> + <posY>176</posY> + <width>100</width> + <height>150</height> + <texture>background.png</texture> + </control> + <control> + <type>image</type> + <id>24</id> + <posX>48</posX> + <posY>176</posY> + <width>100</width> + <height>150</height> + <texture>background.png</texture> + <filtered>no</filtered> + </control> + <control> + <type>fadelabel</type> + <id>56</id> + <posX>48</posX> + <posY>100</posY> + <label>#winsum</label> + <font>font18</font> + <disabledcolor>ff808080</disabledcolor> + </control> + <control> + <type>button</type> + <id>5</id> + <posX>507</posX> + <posY>397</posY> + <label>Black</label> + </control> + <control> + <type>button</type> + <id>6</id> + <posX>507</posX> + <posY>451</posY> + <label>Red</label> + </control> + </controls> +</window> \ No newline at end of file Added: trunk/plugins/mypoker/skin/MCE/media/poker/card1.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/mypoker/skin/MCE/media/poker/card1.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/mypoker/skin/MCE/media/poker/card10.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/mypoker/skin/MCE/media/poker/card10.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/mypoker/skin/MCE/media/poker/card11.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/mypoker/skin/MCE/media/poker/card11.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/mypoker/skin/MCE/media/poker/card12.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/mypoker/skin/MCE/media/poker/card12.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/mypoker/skin/MCE/media/poker/card13.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/mypoker/skin/MCE/media/poker/card13.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/mypoker/skin/MCE/media/poker/card14.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/mypoker/skin/MCE/media/poker/card14.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/mypoker/skin/MCE/media/poker/card15.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/mypoker/skin/MCE/media/poker/card15.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/mypoker/skin/MCE/media/poker/card16.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/mypoker/skin/MCE/media/poker/card16.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/mypoker/skin/MCE/media/poker/card17.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/mypoker/skin/MCE/media/poker/card17.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/mypoker/skin/MCE/media/poker/card18.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/mypoker/skin/MCE/media/poker/card18.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/mypoker/skin/MCE/media/poker/card19.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/mypoker/skin/MCE/media/poker/card19.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/mypoker/skin/MCE/media/poker/card2.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/mypoker/skin/MCE/media/poker/card2.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/mypoker/skin/MCE/media/poker/card20.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/mypoker/skin/MCE/media/poker/card20.png ____________________________... [truncated message content] |
From: <an...@us...> - 2007-05-15 06:03:45
|
Revision: 401 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=401&view=rev Author: and-81 Date: 2007-05-14 23:03:42 -0700 (Mon, 14 May 2007) Log Message: ----------- IR Server Suite Added Paths: ----------- trunk/plugins/IR Server Suite/ trunk/plugins/IR Server Suite/Applications/ trunk/plugins/IR Server Suite/Applications/Debug Client/ trunk/plugins/IR Server Suite/Applications/Debug Client/Debug Client.csproj trunk/plugins/IR Server Suite/Applications/Debug Client/Icon.ico trunk/plugins/IR Server Suite/Applications/Debug Client/Icon16.ico trunk/plugins/IR Server Suite/Applications/Debug Client/Icon32.ico trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.Designer.cs trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.cs trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.resx trunk/plugins/IR Server Suite/Applications/Debug Client/Program.cs trunk/plugins/IR Server Suite/Applications/Debug Client/Properties/ trunk/plugins/IR Server Suite/Applications/Debug Client/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/IR Server/ trunk/plugins/IR Server Suite/Applications/IR Server/Client.cs trunk/plugins/IR Server Suite/Applications/IR Server/Config.Designer.cs trunk/plugins/IR Server Suite/Applications/IR Server/Config.cs trunk/plugins/IR Server Suite/Applications/IR Server/Config.resx trunk/plugins/IR Server Suite/Applications/IR Server/IR Server.csproj trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs trunk/plugins/IR Server Suite/Applications/IR Server/Icon.ico trunk/plugins/IR Server Suite/Applications/IR Server/Icon16.ico trunk/plugins/IR Server Suite/Applications/IR Server/Icon32.ico trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs trunk/plugins/IR Server Suite/Applications/IR Server/Properties/ trunk/plugins/IR Server Suite/Applications/IR Server/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/IR Server/Properties/Resources.Designer.cs trunk/plugins/IR Server Suite/Applications/IR Server/Properties/Resources.resx trunk/plugins/IR Server Suite/Applications/Translator/ trunk/plugins/IR Server Suite/Applications/Translator/ButtonMapping.cs trunk/plugins/IR Server Suite/Applications/Translator/Configuration.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/ trunk/plugins/IR Server Suite/Applications/Translator/Forms/BlastCommand.Designer.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/BlastCommand.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/BlastCommand.resx 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/ButtonMappingForm.resx trunk/plugins/IR Server Suite/Applications/Translator/Forms/EditProgramForm.Designer.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/EditProgramForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/EditProgramForm.resx trunk/plugins/IR Server Suite/Applications/Translator/Forms/GetKeyCodeForm.Designer.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/GetKeyCodeForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/GetKeyCodeForm.resx trunk/plugins/IR Server Suite/Applications/Translator/Forms/LearnIR.Designer.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/LearnIR.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/LearnIR.resx trunk/plugins/IR Server Suite/Applications/Translator/Forms/MacroEditor.Designer.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/MacroEditor.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/MacroEditor.resx trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.Designer.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.resx trunk/plugins/IR Server Suite/Applications/Translator/Icon.ico trunk/plugins/IR Server Suite/Applications/Translator/Icon16.ico trunk/plugins/IR Server Suite/Applications/Translator/Icon16Connecting.ico trunk/plugins/IR Server Suite/Applications/Translator/Icon32.ico trunk/plugins/IR Server Suite/Applications/Translator/MappedEvent.cs trunk/plugins/IR Server Suite/Applications/Translator/Program.cs trunk/plugins/IR Server Suite/Applications/Translator/ProgramSettings.cs trunk/plugins/IR Server Suite/Applications/Translator/Properties/ trunk/plugins/IR Server Suite/Applications/Translator/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/Translator/Properties/Resources.Designer.cs trunk/plugins/IR Server Suite/Applications/Translator/Properties/Resources.resx trunk/plugins/IR Server Suite/Applications/Translator/Translator.csproj trunk/plugins/IR Server Suite/Applications/Tray Launcher/ trunk/plugins/IR Server Suite/Applications/Tray Launcher/GetKeyCodeForm.Designer.cs trunk/plugins/IR Server Suite/Applications/Tray Launcher/GetKeyCodeForm.cs trunk/plugins/IR Server Suite/Applications/Tray Launcher/GetKeyCodeForm.resx trunk/plugins/IR Server Suite/Applications/Tray Launcher/Icon.ico trunk/plugins/IR Server Suite/Applications/Tray Launcher/Icon16.ico trunk/plugins/IR Server Suite/Applications/Tray Launcher/Icon16Connecting.ico trunk/plugins/IR Server Suite/Applications/Tray Launcher/Icon32.ico trunk/plugins/IR Server Suite/Applications/Tray Launcher/Program.cs trunk/plugins/IR Server Suite/Applications/Tray Launcher/Properties/ trunk/plugins/IR Server Suite/Applications/Tray Launcher/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/Tray Launcher/Properties/Resources.Designer.cs trunk/plugins/IR Server Suite/Applications/Tray Launcher/Properties/Resources.resx trunk/plugins/IR Server Suite/Applications/Tray Launcher/Setup.Designer.cs trunk/plugins/IR Server Suite/Applications/Tray Launcher/Setup.cs trunk/plugins/IR Server Suite/Applications/Tray Launcher/Setup.resx trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray Launcher.csproj trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote/ trunk/plugins/IR Server Suite/Applications/Virtual Remote/Icon.ico trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.Designer.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.resx trunk/plugins/IR Server Suite/Applications/Virtual Remote/Program.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote/Properties/ trunk/plugins/IR Server Suite/Applications/Virtual Remote/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote/RemoteButton.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote/Virtual Remote.csproj trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/ trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/Icon.ico trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.Designer.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/MainForm.resx trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/Program.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/Properties/ trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Applications/Virtual Remote Skin Editor/Virtual Remote Skin Editor.csproj trunk/plugins/IR Server Suite/Common/ trunk/plugins/IR Server Suite/Common/IrssUtils/ trunk/plugins/IR Server Suite/Common/IrssUtils/CDRom.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/ trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/ExternalProgram.Designer.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/ExternalProgram.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/ExternalProgram.resx trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/KeysCommand.Designer.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/KeysCommand.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/KeysCommand.resx trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/MessageCommand.Designer.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/MessageCommand.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/MessageCommand.resx trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/PauseTime.Designer.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/PauseTime.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/PauseTime.resx trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/PopupMessage.Designer.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/PopupMessage.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/PopupMessage.resx trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/SerialCommand.Designer.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/SerialCommand.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/SerialCommand.resx trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/ServerAddress.Designer.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/ServerAddress.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Forms/ServerAddress.resx trunk/plugins/IR Server Suite/Common/IrssUtils/IrssLog.cs trunk/plugins/IR Server Suite/Common/IrssUtils/IrssUtils.csproj trunk/plugins/IR Server Suite/Common/IrssUtils/Mouse.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Properties/ trunk/plugins/IR Server Suite/Common/IrssUtils/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/Common/IrssUtils/TransceiverInfo.cs trunk/plugins/IR Server Suite/Common/IrssUtils/Win32.cs trunk/plugins/IR Server Suite/Common/IrssUtils/XML.cs trunk/plugins/IR Server Suite/Common/MPUtils/ trunk/plugins/IR Server Suite/Common/MPUtils/ExternalChannelConfig.cs trunk/plugins/IR Server Suite/Common/MPUtils/Forms/ trunk/plugins/IR Server Suite/Common/MPUtils/Forms/GoToScreen.Designer.cs trunk/plugins/IR Server Suite/Common/MPUtils/Forms/GoToScreen.cs trunk/plugins/IR Server Suite/Common/MPUtils/Forms/GoToScreen.resx trunk/plugins/IR Server Suite/Common/MPUtils/MPCommands.cs trunk/plugins/IR Server Suite/Common/MPUtils/MPUtils.csproj trunk/plugins/IR Server Suite/Common/MPUtils/Properties/ trunk/plugins/IR Server Suite/Common/MPUtils/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IPC/ trunk/plugins/IR Server Suite/IPC/AppModule.InterProcessComm/ trunk/plugins/IR Server Suite/IPC/AppModule.InterProcessComm/AppModule.InterProcessComm.csproj trunk/plugins/IR Server Suite/IPC/AppModule.InterProcessComm/IChannelManager.cs trunk/plugins/IR Server Suite/IPC/AppModule.InterProcessComm/IClientChannel.cs trunk/plugins/IR Server Suite/IPC/AppModule.InterProcessComm/IInterProcessConnection.cs trunk/plugins/IR Server Suite/IPC/AppModule.InterProcessComm/InterProcessConnectionState.cs trunk/plugins/IR Server Suite/IPC/AppModule.InterProcessComm/InterProcessIOException.cs trunk/plugins/IR Server Suite/IPC/AppModule.InterProcessComm/Properties/ trunk/plugins/IR Server Suite/IPC/AppModule.InterProcessComm/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IPC/AppModule.NamedPipes/ trunk/plugins/IR Server Suite/IPC/AppModule.NamedPipes/APipeConnection.cs trunk/plugins/IR Server Suite/IPC/AppModule.NamedPipes/AppModule.NamedPipes.csproj trunk/plugins/IR Server Suite/IPC/AppModule.NamedPipes/ClientPipeConnection.cs trunk/plugins/IR Server Suite/IPC/AppModule.NamedPipes/NamedPipeIOException.cs trunk/plugins/IR Server Suite/IPC/AppModule.NamedPipes/NamedPipeNative.cs trunk/plugins/IR Server Suite/IPC/AppModule.NamedPipes/NamedPipeWrapper.cs trunk/plugins/IR Server Suite/IPC/AppModule.NamedPipes/PipeHandle.cs trunk/plugins/IR Server Suite/IPC/AppModule.NamedPipes/Properties/ trunk/plugins/IR Server Suite/IPC/AppModule.NamedPipes/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IPC/AppModule.NamedPipes/ServerPipeConnection.cs trunk/plugins/IR Server Suite/IPC/Named Pipes/ trunk/plugins/IR Server Suite/IPC/Named Pipes/Named Pipes.csproj trunk/plugins/IR Server Suite/IPC/Named Pipes/PipeAccess.cs trunk/plugins/IR Server Suite/IPC/Named Pipes/PipeManager.cs trunk/plugins/IR Server Suite/IPC/Named Pipes/PipeMessage.cs trunk/plugins/IR Server Suite/IPC/Named Pipes/Properties/ trunk/plugins/IR Server Suite/IPC/Named Pipes/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IPC/Named Pipes/ServerNamedPipe.cs trunk/plugins/IR Server Suite/IR Server Plugins/ trunk/plugins/IR Server Suite/IR Server Plugins/Dummy Transceiver/ trunk/plugins/IR Server Suite/IR Server Plugins/Dummy Transceiver/Dummy Transceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Dummy Transceiver/Dummy Transceiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Dummy Transceiver/Properties/ trunk/plugins/IR Server Suite/IR Server Plugins/Dummy Transceiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/ 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/ trunk/plugins/IR Server Suite/IR Server Plugins/FusionRemote Receiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/ trunk/plugins/IR Server Suite/IR Server Plugins/IR Server Plugin Interface/IR Server Plugin Interface.csproj 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/Properties/ 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/ trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/Configure.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/Configure.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/Configure.resx 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/ trunk/plugins/IR Server Suite/IR Server Plugins/IRMan Receiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/ trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/CSocketPacket.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/Configure.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/Configure.cs trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/Configure.resx 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/ trunk/plugins/IR Server Suite/IR Server Plugins/IRTrans Transceiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug USB Receiver/ 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/IgorPlug USB Receiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug USB Receiver/IgorPlug.dll trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug USB Receiver/Properties/ trunk/plugins/IR Server Suite/IR Server Plugins/IgorPlug USB Receiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/MCE Replacement Transceiver/ trunk/plugins/IR Server Suite/IR Server Plugins/MCE Replacement Transceiver/Configure.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/MCE Replacement Transceiver/Configure.cs trunk/plugins/IR Server Suite/IR Server Plugins/MCE Replacement Transceiver/Configure.resx trunk/plugins/IR Server Suite/IR Server Plugins/MCE Replacement Transceiver/MCE Replacement Transceiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/MCE Replacement Transceiver/MceIrApi.cs trunk/plugins/IR Server Suite/IR Server Plugins/MCE Replacement Transceiver/MceReplacementTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/MCE Replacement Transceiver/Properties/ trunk/plugins/IR Server Suite/IR Server Plugins/MCE Replacement Transceiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Configure.resx trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Microsoft MCE Transceiver.csproj trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/MicrosoftMceTransceiver.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/NotifyWindow.cs trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Properties/ trunk/plugins/IR Server Suite/IR Server Plugins/Microsoft MCE Transceiver/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/ trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/Configure.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/Configure.cs trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/Configure.resx trunk/plugins/IR Server Suite/IR Server Plugins/USB-UIRT Transceiver/Properties/ 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/USB-UIRT Transceiver/uuirtdrv.dll trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/ trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/Configure.Designer.cs trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/Configure.cs trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/Configure.resx trunk/plugins/IR Server Suite/IR Server Plugins/Windows Message Receiver/Properties/ 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/ trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/Interop.X10.dll trunk/plugins/IR Server Suite/IR Server Plugins/X10 Transceiver/Properties/ 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/ trunk/plugins/IR Server Suite/IR Server Plugins/XBCDRC Receiver/Properties/ 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/IR Server Suite.sln trunk/plugins/IR Server Suite/MediaPortal Plugins/ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/BlastCommand.Designer.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/BlastCommand.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/BlastCommand.resx trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/LearnIR.Designer.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/Forms/LearnIR.resx trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/MacroEditor.Designer.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/MacroEditor.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/MacroEditor.resx trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/SetupForm.Designer.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/SetupForm.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/SetupForm.resx trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Graphics/ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Graphics/Delete.png trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Graphics/DeleteAll.png trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Graphics/Edit.png trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Graphics/MoveBottom.png trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Graphics/MoveDown.png trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Graphics/MoveTop.png trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Graphics/MoveUp.png trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Graphics/Plus.png trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/MP Blast Zone Plugin.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/Menu.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Properties/ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Properties/Resources.Designer.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Properties/Resources.resx trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Skin/ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Skin/BlastZone.xml trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Skin/Media/ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Skin/Media/blastzone_logo.png trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Skin/Media/hover_blastzone.png trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/BlastCommand.Designer.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/BlastCommand.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/BlastCommand.resx trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/ExternalProgram.cs.bak trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/LearnIR.Designer.cs 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.resx trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/MacroEditor.Designer.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/MacroEditor.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/MacroEditor.resx trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/MultiMapNameBox.Designer.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/MultiMapNameBox.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/MultiMapNameBox.resx trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/SetupForm.Designer.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/SetupForm.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/SetupForm.resx trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/InputMapper/ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/InputMapper/InputHandler.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/InputMapper/InputMappingForm.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/InputMapper/InputMappingForm.resx trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MP Control Plugin.csproj 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/MP Control Plugin/Properties/ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/ trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/ trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/BlastCommand.Designer.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/BlastCommand.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/BlastCommand.resx trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/ExternalChannels.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/ExternalChannels.designer.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/ExternalChannels.resx trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/ExternalProgram.cs.bak trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/LearnIR.Designer.cs 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.resx trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/MacroEditor.Designer.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/MacroEditor.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/MacroEditor.resx trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/SetupForm.Designer.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/SetupForm.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/SetupForm.resx trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/StbSetup.Designer.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/StbSetup.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Forms/StbSetup.resx trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Properties/ trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2 Blaster Plugin.csproj trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2BlasterPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/ trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/ trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/BlastCommand.Designer.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/BlastCommand.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/BlastCommand.resx trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/ExternalChannels.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/ExternalChannels.designer.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/ExternalChannels.resx trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/LearnIR.Designer.cs 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.resx trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/MacroEditor.Designer.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/MacroEditor.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/MacroEditor.resx trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/PluginSetup.Designer.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/PluginSetup.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/PluginSetup.resx trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/StbSetup.Designer.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/StbSetup.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/StbSetup.resx trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Properties/ trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Properties/AssemblyInfo.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3 Blaster Plugin.csproj trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs Added: trunk/plugins/IR Server Suite/Applications/Debug Client/Debug Client.csproj =================================================================== --- trunk/plugins/IR Server Suite/Applications/Debug Client/Debug Client.csproj (rev 0) +++ trunk/plugins/IR Server Suite/Applications/Debug Client/Debug Client.csproj 2007-05-15 06:03:42 UTC (rev 401) @@ -0,0 +1,83 @@ +<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>{4CD051F4-F2B5-47B3-8647-F47C2E4DC131}</ProjectGuid> + <OutputType>WinExe</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>DebugClient</RootNamespace> + <AssemblyName>DebugClient</AssemblyName> + <StartupObject>DebugClient.Program</StartupObject> + <ApplicationIcon>Icon.ico</ApplicationIcon> + <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> + </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> + </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="MainForm.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="MainForm.Designer.cs"> + <DependentUpon>MainForm.cs</DependentUpon> + </Compile> + <Compile Include="Program.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="MainForm.resx"> + <DependentUpon>MainForm.cs</DependentUpon> + <SubType>Designer</SubType> + </EmbeddedResource> + </ItemGroup> + <ItemGroup> + <Content Include="Icon.ico" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\..\Common\irssUtils\IrssUtils.csproj"> + <Project>{CA15769C-232E-4CA7-94FD-206A06CA3ABB}</Project> + <Name>IrssUtils</Name> + </ProjectReference> + <ProjectReference Include="..\..\IPC\Named Pipes\Named Pipes.csproj"> + <Project>{F4EA6055-7133-4F18-8971-E19ADEB482C1}</Project> + <Name>Named Pipes</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/Debug Client/Icon.ico =================================================================== (Binary files differ) Property changes on: trunk/plugins/IR Server Suite/Applications/Debug Client/Icon.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/IR Server Suite/Applications/Debug Client/Icon16.ico =================================================================== (Binary files differ) Property changes on: trunk/plugins/IR Server Suite/Applications/Debug Client/Icon16.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/IR Server Suite/Applications/Debug Client/Icon32.ico =================================================================== (Binary files differ) Property changes on: trunk/plugins/IR Server Suite/Applications/Debug Client/Icon32.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.Designer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.Designer.cs (rev 0) +++ trunk/plugins/IR Server Suite/Applications/Debug Client/MainForm.Designer.cs 2007-05-15 06:03:42 UTC (rev 401) @@ -0,0 +1,437 @@ +namespace DebugClient +{ + partial class MainForm + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); + this.buttonBlast = new System.Windows.Forms.Button(); + this.buttonLearnIR = new System.Windows.Forms.Button(); + this.labelServerAddress = new System.Windows.Forms.Label(); + this.buttonConnect = new System.Windows.Forms.Button(); + this.buttonDisconnect = new System.Windows.Forms.Button(); + this.buttonShutdownServer = new System.Windows.Forms.Button(); + this.listBoxStatus = new System.Windows.Forms.ListBox(); + this.buttonCrash = new System.Windows.Forms.Button(); + this.buttonListConnected = new System.Windows.Forms.Button(); + this.buttonPing = new System.Windows.Forms.Button(); + this.groupBoxGenerateMessage = new System.Windows.Forms.GroupBox(); + this.textBoxCustom = new System.Windows.Forms.TextBox(); + this.buttonSendCustom = new System.Windows.Forms.Button(); + this.groupBoxStatus = new System.Windows.Forms.GroupBox(); + this.groupBoxRemoteButton = new System.Windows.Forms.GroupBox(); + this.labelCustomButton = new System.Windows.Forms.Label(); + this.numericUpDownButton = new System.Windows.Forms.NumericUpDown(); + this.comboBoxRemoteButtons = new System.Windows.Forms.ComboBox(); + this.buttonSendRemoteButton = new System.Windows.Forms.Button(); + this.groupBoxSetup = new System.Windows.Forms.GroupBox(); + this.comboBoxComputer = new System.Windows.Forms.ComboBox(); + this.groupBoxCommands = new System.Windows.Forms.GroupBox(); + this.comboBoxSpeed = new System.Windows.Forms.ComboBox(); + this.comboBoxPort = new System.Windows.Forms.ComboBox(); + this.toolTip = new System.Windows.Forms.ToolTip(this.components); + this.buttonHelp = new System.Windows.Forms.Button(); + this.groupBoxGenerateMessage.SuspendLayout(); + this.groupBoxStatus.SuspendLayout(); + this.groupBoxRemoteButton.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownButton)).BeginInit(); + this.groupBoxSetup.SuspendLayout(); + this.groupBoxCommands.SuspendLayout(); + this.SuspendLayout(); + // + // buttonBlast + // + this.buttonBlast.Location = new System.Drawing.Point(8, 48); + this.buttonBlast.Name = "buttonBlast"; + this.buttonBlast.Size = new System.Drawing.Size(64, 24); + this.buttonBlast.TabIndex = 2; + this.buttonBlast.Text = "Blast IR"; + this.toolTip.SetToolTip(this.buttonBlast, "Blast learned IR code"); + this.buttonBlast.UseVisualStyleBackColor = true; + this.buttonBlast.Click += new System.EventHandler(this.buttonBlast_Click); + // + // buttonLearnIR + // + this.buttonLearnIR.Location = new System.Drawing.Point(8, 16); + this.buttonLearnIR.Name = "buttonLearnIR"; + this.buttonLearnIR.Size = new System.Drawing.Size(64, 24); + this.buttonLearnIR.TabIndex = 0; + this.buttonLearnIR.Text = "Learn IR"; + this.toolTip.SetToolTip(this.buttonLearnIR, "Learn an IR code"); + this.buttonLearnIR.UseVisualStyleBackColor = true; + this.buttonLearnIR.Click += new System.EventHandler(this.buttonLearnIR_Click); + // + // labelServerAddress + // + this.labelServerAddress.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.labelServerAddress.Location = new System.Drawing.Point(8, 16); + this.labelServerAddress.Name = "labelServerAddress"; + this.labelServerAddress.Size = new System.Drawing.Size(240, 16); + this.labelServerAddress.TabIndex = 0; + this.labelServerAddress.Text = "IR Server host computer:"; + // + // buttonConnect + // + this.buttonConnect.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonConnect.Location = new System.Drawing.Point(264, 32); + this.buttonConnect.Name = "buttonConnect"; + this.buttonConnect.Size = new System.Drawing.Size(80, 24); + this.buttonConnect.TabIndex = 2; + this.buttonConnect.Text = "Connect"; + this.toolTip.SetToolTip(this.buttonConnect, "Connect to server"); + this.buttonConnect.UseVisualStyleBackColor = true; + this.buttonConnect.Click += new System.EventHandler(this.buttonConnect_Click); + // + // buttonDisconnect + // + this.buttonDisconnect.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonDisconnect.Location = new System.Drawing.Point(352, 32); + this.buttonDisconnect.Name = "buttonDisconnect"; + this.buttonDisconnect.Size = new System.Drawing.Size(80, 24); + this.buttonDisconnect.TabIndex = 3; + this.buttonDisconnect.Text = "Disconnect"; + this.toolTip.SetToolTip(this.buttonDisconnect, "Disconnect from server"); + this.buttonDisconnect.UseVisualStyleBackColor = true; + this.buttonDisconnect.Click += new System.EventHandler(this.buttonDisconnect_Click); + // + // buttonShutdownServer + // + this.buttonShutdownServer.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.buttonShutdownServer.Location = new System.Drawing.Point(296, 16); + this.buttonShutdownServer.Name = "buttonShutdownServer"; + this.buttonShutdownServer.Size = new System.Drawing.Size(64, 24); + this.buttonShutdownServer.TabIndex = 5; + this.buttonShutdownServer.Text = "Shutdown"; + this.toolTip.SetToolTip(this.buttonShutdownServer, "Shutdown server"); + this.buttonShutdownServer.UseVisualStyleBackColor = true; + this.buttonShutdownServer.Click += new System.EventHandler(this.buttonShutdownServer_Click); + // + // listBoxStatus + // + this.listBoxStatus.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.listBoxStatus.FormattingEnabled = true; + this.listBoxStatus.HorizontalScrollbar = true; + this.listBoxStatus.IntegralHeight = false; + this.listBoxStatus.Location = new System.Drawing.Point(8, 16); + this.listBoxStatus.Name = "listBoxStatus"; + this.listBoxStatus.ScrollAlwaysVisible = true; + this.listBoxStatus.Size = new System.Drawing.Size(424, 192); + this.listBoxStatus.TabIndex = 0; + this.toolTip.SetToolTip(this.listBoxStatus, "Status messages"); + // + // buttonCrash + // + this.buttonCrash.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.buttonCrash.Location = new System.Drawing.Point(368, 16); + this.buttonCrash.Name = "buttonCrash"; + this.buttonCrash.Size = new System.Drawing.Size(64, 24); + this.buttonCrash.TabIndex = 6; + this.buttonCrash.Text = "Crash"; + this.toolTip.SetToolTip(this.buttonCrash, "Crash this program"); + this.buttonCrash.UseVisualStyleBackColor = true; + this.buttonCrash.Click += new System.EventHandler(this.buttonCrash_Click); + // + // buttonListConnected + // + this.buttonListConnected.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.buttonListConnected.Location = new System.Drawing.Point(368, 48); + this.buttonListConnected.Name = "buttonListConnected"; + this.buttonListConnected.Size = new System.Drawing.Size(64, 24); + this.buttonListConnected.TabIndex = 8; + this.buttonListConnected.Text = "# clients"; + this.toolTip.SetToolTip(this.buttonListConnected, "Get client count from server"); + this.buttonListConnected.UseVisualStyleBackColor = true; + this.buttonListConnected.Click += new System.EventHandler(this.buttonListConnected_Click); + // + // buttonPing + // + this.buttonPing.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.buttonPing.Location = new System.Drawing.Point(296, 48); + this.buttonPing.Name = "buttonPing"; + this.buttonPing.Size = new System.Drawing.Size(64, 24); + this.buttonPing.TabIndex = 7; + this.buttonPing.Text = "Ping"; + this.toolTip.SetToolTip(this.buttonPing, "Ping the server"); + this.buttonPing.UseVisualStyleBackColor = true; + this.buttonPing.Click += new System.EventHandler(this.buttonPing_Click); + // + // groupBoxGenerateMessage + // + this.groupBoxGenerateMessage.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBoxGenerateMessage.Controls.Add(this.textBoxCustom); + this.groupBoxGenerateMessage.Controls.Add(this.buttonSendCustom); + this.groupBoxGenerateMessage.Location = new System.Drawing.Point(8, 224); + this.groupBoxGenerateMessage.Name = "groupBoxGenerateMessage"; + this.groupBoxGenerateMessage.Size = new System.Drawing.Size(440, 80); + this.groupBoxGenerateMessage.TabIndex = 3; + this.groupBoxGenerateMessage.TabStop = false; + this.groupBoxGenerateMessage.Text = "Generate message"; + // + // textBoxCustom + // + this.textBoxCustom.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBoxCustom.Location = new System.Drawing.Point(8, 16); + this.textBoxCustom.Multiline = true; + this.textBoxCustom.Name = "textBoxCustom"; + this.textBoxCustom.Size = new System.Drawing.Size(352, 56); + this.textBoxCustom.TabIndex = 0; + this.toolTip.SetToolTip(this.textBoxCustom, "Create a custom message to send to the server"); + // + // buttonSendCustom + // + this.buttonSendCustom.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonSendCustom.Location = new System.Drawing.Point(376, 48); + this.buttonSendCustom.Name = "buttonSendCustom"; + this.buttonSendCustom.Size = new System.Drawing.Size(56, 24); + this.buttonSendCustom.TabIndex = 1; + this.buttonSendCustom.Text = "Send"; + this.toolTip.SetToolTip(this.buttonSendCustom, "Send custom message to server"); + this.buttonSendCustom.UseVisualStyleBackColor = true; + this.buttonSendCustom.Click += new System.EventHandler(this.buttonSendCustom_Click); + // + // groupBoxStatus + // + this.groupBoxStatus.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBoxStatus.Controls.Add(this.listBoxStatus); + this.groupBoxStatus.Location = new System.Drawing.Point(8, 312); + this.groupBoxStatus.Name = "groupBoxStatus"; + this.groupBoxStatus.Size = new System.Drawing.Size(440, 216); + this.groupBoxStatus.TabIndex = 4; + this.groupBoxStatus.TabStop = false; + this.groupBoxStatus.Text = "Status"; + // + // groupBoxRemoteButton + // + this.groupBoxRemoteButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBoxRemoteButton.Controls.Add(this.labelCustomButton); + this.groupBoxRemoteButton.Controls.Add(this.numericUpDownButton); + this.groupBoxRemoteButton.Controls.Add(this.comboBoxRemoteButtons); + this.groupBoxRemoteButton.Controls.Add(this.buttonSendRemoteButton); + this.groupBoxRemoteButton.Location = new System.Drawing.Point(8, 168); + this.groupBoxRemoteButton.Name = "groupBoxRemoteButton"; + this.groupBoxRemoteButton.Size = new System.Drawing.Size(440, 48); + this.groupBoxRemoteButton.TabIndex = 2; + this.groupBoxRemoteButton.TabStop = false; + this.groupBoxRemoteButton.Text = "Remote button"; + // + // labelCustomButton + // + this.labelCustomButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.labelCustomButton.Location = new System.Drawing.Point(136, 16); + this.labelCustomButton.Name = "labelCustomButton"; + this.labelCustomButton.Size = new System.Drawing.Size(144, 20); + this.labelCustomButton.TabIndex = 1; + this.labelCustomButton.Text = "Custom button key code:"; + this.labelCustomButton.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // numericUpDownButton + // + this.numericUpDownButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.numericUpDownButton.Location = new System.Drawing.Point(288, 16); + this.numericUpDownButton.Maximum = new decimal(new int[] { + 32768, + 0, + 0, + 0}); + this.numericUpDownButton.Name = "numericUpDownButton"; + this.numericUpDownButton.Size = new System.Drawing.Size(72, 20); + this.numericUpDownButton.TabIndex = 2; + this.numericUpDownButton.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.numericUpDownButton.ThousandsSeparator = true; + this.toolTip.SetToolTip(this.numericUpDownButton, "Specify a custom button code to forward to the server"); + // + // comboBoxRemoteButtons + // + this.comboBoxRemoteButtons.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.comboBoxRemoteButtons.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBoxRemoteButtons.FormattingEnabled = true; + this.comboBoxRemoteButtons.Location = new System.Drawing.Point(8, 16); + this.comboBoxRemoteButtons.Name = "comboBoxRemoteButtons"; + this.comboBoxRemoteButtons.Size = new System.Drawing.Size(120, 21); + this.comboBoxRemoteButtons.TabIndex = 0; + this.toolTip.SetToolTip(this.comboBoxRemoteButtons, "Choose a remote control button to forward to the server"); + this.comboBoxRemoteButtons.SelectedIndexChanged += new System.EventHandler(this.comboBoxRemoteButtons_SelectedIndexChanged); + // + // buttonSendRemoteButton + // + this.buttonSendRemoteButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.buttonSendRemoteButton.Location = new System.Drawing.Point(376, 16); + this.buttonSendRemoteButton.Name = "buttonSendRemoteButton"; + this.buttonSendRemoteButton.Size = new System.Drawing.Size(56, 24); + this.buttonSendRemoteButton.TabIndex = 3; + this.buttonSendRemoteButton.Text = "Send"; + this.buttonSendRemoteButton.UseVisualStyleBackColor = true; + this.buttonSendRemoteButton.Click += new System.EventHandler(this.buttonSendRemoteButton_Click); + // + // groupBoxSetup + // + this.groupBoxSetup.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBoxSetup.Controls.Add(this.comboBoxComputer); + this.groupBoxSetup.Controls.Add(this.labelServerAddress); + this.groupBoxSetup.Controls.Add(this.buttonConnect); + this.groupBoxSetup.Controls.Add(this.buttonDisconnect); + this.groupBoxSetup.Location = new System.Drawing.Point(8, 8); + this.groupBoxSetup.Name = "groupBoxSetup"; + this.groupBoxSetup.Size = new System.Drawing.Size(440, 64); + this.groupBoxSetup.TabIndex = 0; + this.groupBoxSetup.TabStop = false; + this.groupBoxSetup.Text = "Setup"; + // + // 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, 32); + this.comboBoxComputer.Name = "comboBoxComputer"; + this.comboBoxComputer.Size = new System.Drawing.Size(240, 21); + this.comboBoxComputer.TabIndex = 5; + // + // groupBoxCommands + // + this.groupBoxCommands.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBoxCommands.Controls.Add(this.comboBoxSpeed); + this.groupBoxCommands.Controls.Add(this.comboBoxPort); + this.groupBoxCommands.Controls.Add(this.buttonCrash); + this.groupBoxCommands.Controls.Add(this.buttonBlast); + this.groupBoxCommands.Controls.Add(this.buttonLearnIR); + this.groupBoxCommands.Controls.Add(this.buttonShutdownServer); + this.groupBoxCommands.Controls.Add(this.buttonListConnected); + this.groupBoxCommands.Controls.Add(this.buttonPing); + this.groupBoxCommands.Location = new System.Drawing.Point(8, 80); + this.groupBoxCommands.Name = "groupBoxCommands"; + this.groupBoxCommands.Size = new System.Drawing.Size(440, 80); + this.groupBoxCommands.TabIndex = 1; + this.groupBoxCommands.TabStop = false; + this.groupBoxCommands.Text = "Commands"; + // + // comboBoxSpeed + // + this.comboBoxSpeed.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBoxSpeed.FormattingEnabled = true; + this.comboBoxSpeed.Location = new System.Drawing.Point(168, 50); + this.comboBoxSpeed.Name = "comboBoxSpeed"; + this.comboBoxSpeed.Size = new System.Drawing.Size(80, 21); + this.comboBoxSpeed.TabIndex = 4; + this.toolTip.SetToolTip(this.comboBoxSpeed, "Speed to blast IR at"); + // + // comboBoxPort + // + this.comboBoxPort.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBoxPort.FormattingEnabled = true; + this.comboBoxPort.Location = new System.Drawing.Point(80, 50); + this.comboBoxPort.Name = "comboBoxPort"; + this.comboBoxPort.Size = new System.Drawing.Size(80, 21); + this.comboBoxPort.TabIndex = 3; + this.toolTip.SetToolTip(this.comboBoxPort, "Port for blasting IR"); + // + // buttonHelp + // + this.buttonHelp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.buttonHelp.Location = new System.Drawing.Point(8, 536); + this.buttonHelp.Name = "buttonHelp"; + this.buttonHelp.Size = new System.Drawing.Size(56, 24); + this.buttonHelp.TabIndex = 5; + this.buttonHelp.Text = "Help"; + this.buttonHelp.UseVisualStyleBackColor = true; + this.buttonHelp.Click += new System.EventHandler(this.buttonHelp_Click); + // + // MainForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(456, 566); + this.Controls.Add(this.buttonHelp); + this.Controls.Add(this.groupBoxCommands); + this.Controls.Add(this.groupBoxSetup); + this.Controls.Add(this.groupBoxRemoteButton); + this.Controls.Add(this.groupBoxStatus); + this.Controls.Add(this.groupBoxGenerateMessage); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.MinimumSize = new System.Drawing.Size(464, 600); + this.Name = "MainForm"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "Debug Client"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing); + this.Load += new System.EventHandler(this.MainForm_Load); + this.groupBoxGenerateMessage.ResumeLayout(false); + this.groupBoxGenerateMessage.PerformLayout(); + this.groupBoxStatus.ResumeLayout(false); + this.groupBoxRemoteButton.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownButton)).EndInit(); + this.groupBoxSetup.ResumeLayout(false); + this.groupBoxCommands.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Button buttonBlast; + private System.Windows.Forms.Button buttonLearnIR; + private System.Windows.Forms.Label labelServerAddress; + private System.Windows.Forms.Button buttonConnect; + private System.Windows.Forms.Button buttonDisconnect; + private System.Windows.Forms.Button buttonShutdownServer; + private System.Windows.Forms.ListBox listBoxStatus; + private System.Windows.Forms.Button buttonCrash; + private System.Windows.Forms.Button buttonListConnected; + private System.Windows.Forms.Button buttonPing; + private System.Windows.Forms.GroupBox groupBoxGenerateMessage; + private System.Windows.Forms.TextBox textBoxCustom; + private System.Windows.Forms.Button buttonSendCustom; + private System.Windows.Forms.GroupBox groupBoxStatus; + private System.Wind... [truncated message content] |
From: <an...@us...> - 2007-05-19 06:39:12
|
Revision: 407 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=407&view=rev Author: and-81 Date: 2007-05-18 23:39:06 -0700 (Fri, 18 May 2007) Log Message: ----------- Fixed GoToScreen.cs not storing the screen number Modified Paths: -------------- trunk/plugins/IR Server Suite/Common/MPUtils/Forms/GoToScreen.cs trunk/plugins/MCEReplacement/Forms/GoToScreen.cs Modified: trunk/plugins/IR Server Suite/Common/MPUtils/Forms/GoToScreen.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/MPUtils/Forms/GoToScreen.cs 2007-05-18 18:02:50 UTC (rev 406) +++ trunk/plugins/IR Server Suite/Common/MPUtils/Forms/GoToScreen.cs 2007-05-19 06:39:06 UTC (rev 407) @@ -16,7 +16,7 @@ public string Screen { - get { return comboBoxScreen.SelectedItem as string; } + get { return comboBoxScreen.SelectedText; } } #endregion Properties @@ -33,7 +33,7 @@ if (String.IsNullOrEmpty(selected)) comboBoxScreen.SelectedIndex = 0; else - comboBoxScreen.SelectedItem = selected; + comboBoxScreen.SelectedText = selected; } #endregion Constructors Modified: trunk/plugins/MCEReplacement/Forms/GoToScreen.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/GoToScreen.cs 2007-05-18 18:02:50 UTC (rev 406) +++ trunk/plugins/MCEReplacement/Forms/GoToScreen.cs 2007-05-19 06:39:06 UTC (rev 407) @@ -16,14 +16,14 @@ public string Screen { - get { return (string)comboBoxScreen.SelectedItem; } + get { return comboBoxScreen.SelectedText; } } #endregion Properties #region Constructors - public GoToScreen() : this("") { } + public GoToScreen() : this(String.Empty) { } public GoToScreen(string selected) { InitializeComponent(); @@ -33,7 +33,7 @@ if (String.IsNullOrEmpty(selected)) comboBoxScreen.SelectedIndex = 0; else - comboBoxScreen.SelectedItem = selected; + comboBoxScreen.SelectedText = selected; } #endregion Constructors This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-05-19 06:45:45
|
Revision: 408 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=408&view=rev Author: and-81 Date: 2007-05-18 23:45:44 -0700 (Fri, 18 May 2007) Log Message: ----------- Fixed GoToScreen.cs not storing screen number. Modified Paths: -------------- trunk/plugins/IR Server Suite/Common/MPUtils/Forms/GoToScreen.cs trunk/plugins/MCEReplacement/Forms/GoToScreen.cs Modified: trunk/plugins/IR Server Suite/Common/MPUtils/Forms/GoToScreen.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/MPUtils/Forms/GoToScreen.cs 2007-05-19 06:39:06 UTC (rev 407) +++ trunk/plugins/IR Server Suite/Common/MPUtils/Forms/GoToScreen.cs 2007-05-19 06:45:44 UTC (rev 408) @@ -16,7 +16,7 @@ public string Screen { - get { return comboBoxScreen.SelectedText; } + get { return comboBoxScreen.Text; } } #endregion Properties @@ -33,7 +33,7 @@ if (String.IsNullOrEmpty(selected)) comboBoxScreen.SelectedIndex = 0; else - comboBoxScreen.SelectedText = selected; + comboBoxScreen.Text = selected; } #endregion Constructors Modified: trunk/plugins/MCEReplacement/Forms/GoToScreen.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/GoToScreen.cs 2007-05-19 06:39:06 UTC (rev 407) +++ trunk/plugins/MCEReplacement/Forms/GoToScreen.cs 2007-05-19 06:45:44 UTC (rev 408) @@ -16,7 +16,7 @@ public string Screen { - get { return comboBoxScreen.SelectedText; } + get { return comboBoxScreen.Text; } } #endregion Properties @@ -33,7 +33,7 @@ if (String.IsNullOrEmpty(selected)) comboBoxScreen.SelectedIndex = 0; else - comboBoxScreen.SelectedText = selected; + comboBoxScreen.Text = selected; } #endregion Constructors This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <an...@us...> - 2007-05-19 16:14:36
|
Revision: 409 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=409&view=rev Author: and-81 Date: 2007-05-19 09:14:30 -0700 (Sat, 19 May 2007) Log Message: ----------- Modified Paths: -------------- 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/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/Common/MPUtils/ExternalChannelConfig.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/MacroEditor.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/MacroEditor.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/SetupForm.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/InputMapper/InputMappingForm.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/TV2 Blaster Plugin/TV2BlasterPlugin.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/MacroEditor.cs trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs trunk/plugins/MCEReplacement/Forms/SetupForm.cs trunk/plugins/MCEReplacement/InputMapper/InputMappingForm.cs trunk/plugins/MCEReplacement/MCEReplacement.cs trunk/plugins/MCEReplacement/MappedEvent.cs Modified: trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-05-19 06:45:44 UTC (rev 408) +++ trunk/plugins/IR Server Suite/Applications/IR Server/IRServer.cs 2007-05-19 16:14:30 UTC (rev 409) @@ -446,7 +446,7 @@ void RemoteButtonPressed(string keyCode) { - IrssLog.Info("Remote Button Pressed: {0}", keyCode); + IrssLog.Debug("Remote Button Pressed: {0}", keyCode); byte[] bytes = Encoding.ASCII.GetBytes(keyCode); @@ -468,7 +468,7 @@ case IRServerMode.RepeaterMode: { - IrssLog.Info("Remote button press ignored, IR Server is in Repeater Mode."); + IrssLog.Debug("Remote button press ignored, IR Server is in Repeater Mode."); break; } } @@ -478,8 +478,6 @@ { IrssLog.Debug("SendToAll({0})", message.ToString()); - IrssLog.Info("Message out: {0}", message.Name); - List<Client> unregister = new List<Client>(); lock (_registeredClients) @@ -512,8 +510,6 @@ { IrssLog.Debug("SendToAllExcept({0}, {1}, {2})", exceptPipe, exceptServer, message.ToString()); - IrssLog.Info("Message out: {0}", message.Name); - List<Client> unregister = new List<Client>(); lock (_registeredClients) @@ -549,8 +545,6 @@ { IrssLog.Debug("SendTo({0}, {1}, {2})", pipe, server, message.ToString()); - IrssLog.Info("Message out: {0}", message.Name); - try { PipeAccess.SendMessage(pipe, server, message.ToString()); @@ -567,8 +561,6 @@ { IrssLog.Debug("SendToRepeaters({0})", message.ToString()); - IrssLog.Info("Message out: {0}", message.Name); - List<Client> unregister = new List<Client>(); lock (_registeredRepeaters) @@ -828,8 +820,6 @@ { IrssLog.Debug("Message received from client \\\\{0}\\pipe\\{1} = {2}", received.FromServer, received.FromPipe, received.ToString()); - IrssLog.Info("Message in: {0}", received.Name); - try { switch (received.Name) @@ -929,6 +919,8 @@ case "Shutdown": { + IrssLog.Info("Shutdown command received"); + if (_mode == IRServerMode.ServerMode) { PipeMessage response = new PipeMessage(Common.ServerPipeName, Environment.MachineName, "Server Shutdown", null); @@ -995,6 +987,7 @@ case "Server Shutdown": { + IrssLog.Info("Host server shut down"); _registered = false; break; } Modified: trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs 2007-05-19 06:45:44 UTC (rev 408) +++ trunk/plugins/IR Server Suite/Applications/IR Server/Program.cs 2007-05-19 16:14:30 UTC (rev 409) @@ -17,7 +17,7 @@ { [STAThread] - static int Main(string[] args) + static int Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Modified: trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs 2007-05-19 06:45:44 UTC (rev 408) +++ trunk/plugins/IR Server Suite/Applications/Translator/Forms/MainForm.cs 2007-05-19 16:14:30 UTC (rev 409) @@ -664,7 +664,7 @@ } private void buttonSetCommand_Click(object sender, EventArgs e) { - if (comboBoxCommands.SelectedIndex == -1) + if (comboBoxCommands.SelectedIndex == -1 || listViewEventMap.SelectedItems.Count == 0) return; string selected = comboBoxCommands.SelectedItem as string; Modified: trunk/plugins/IR Server Suite/Applications/Translator/Program.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2007-05-19 06:45:44 UTC (rev 408) +++ trunk/plugins/IR Server Suite/Applications/Translator/Program.cs 2007-05-19 16:14:30 UTC (rev 409) @@ -511,8 +511,6 @@ while (_keepAlive && _registered && !reconnect) { - IrssLog.Info("Ping ({0})", _config.ServerHost); - int pingID = random.Next(); long pingTime = DateTime.Now.Ticks; @@ -547,15 +545,13 @@ if (receivedEcho) // Received ping echo ... { - IrssLog.Info("Echo received"); - // Wait 60 seconds before re-pinging ... for (int sleeps = 0; sleeps < 60 && _keepAlive && _registered; sleeps++) Thread.Sleep(1000); } else // Didn't receive ping echo ... { - IrssLog.Warn("No echo, attempting to reconnect ..."); + IrssLog.Warn("No echo to ping, attempting to reconnect ..."); // Break out of pinging cycle ... _registered = false; Modified: trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs 2007-05-19 06:45:44 UTC (rev 408) +++ trunk/plugins/IR Server Suite/Applications/Tray Launcher/Tray.cs 2007-05-19 16:14:30 UTC (rev 409) @@ -86,7 +86,9 @@ bool didSetup = false; if (String.IsNullOrEmpty(_programFile) || String.IsNullOrEmpty(_serverHost)) { - ClickSetup(null, null); + if (!Configure()) + return false; + didSetup = true; } @@ -349,8 +351,6 @@ while (_keepAlive && _registered && !reconnect) { - IrssLog.Info("Ping ({0})", _serverHost); - int pingID = random.Next(); long pingTime = DateTime.Now.Ticks; @@ -385,15 +385,13 @@ if (receivedEcho) // Received ping echo ... { - IrssLog.Info("Echo received"); - // Wait 60 seconds before re-pinging ... for (int sleeps = 0; sleeps < 60 && _keepAlive && _registered; sleeps++) Thread.Sleep(1000); } else // Didn't receive ping echo ... { - IrssLog.Warn("No echo, attempting to reconnect ..."); + IrssLog.Warn("No echo to ping, attempting to reconnect ..."); // Break out of pinging cycle ... _registered = false; @@ -411,7 +409,7 @@ { PipeMessage received = PipeMessage.FromString(message); - IrssLog.Info(received.Name); + IrssLog.Debug("Received Message \"{0}\"", received.Name); try { @@ -483,23 +481,18 @@ ClickLaunch(null, null); } - void ClickSetup(object sender, EventArgs e) + bool Configure() { - IrssLog.Info("Setup"); - Setup setup = new Setup(); setup.AutoRun = _autoRun; setup.ServerHost = _serverHost; setup.ProgramFile = _programFile; setup.LaunchOnLoad = _launchOnLoad; - setup.LaunchKeyCode = _launchKeyCode; + setup.LaunchKeyCode = _launchKeyCode; - if (setup.ShowDialog() == DialogResult.OK) + if (setup.ShowDialog(this) == DialogResult.OK) { - if (PipeAccess.ServerRunning && _serverHost != setup.ServerHost) - MessageBox.Show(this, "Changes to the server host address may not take effect until you restart Tray Launcher", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); - _autoRun = setup.AutoRun; _serverHost = setup.ServerHost; _programFile = setup.ProgramFile; @@ -507,8 +500,24 @@ _launchKeyCode = setup.LaunchKeyCode; SaveSettings(); + + return true; } + + return false; } + + void ClickSetup(object sender, EventArgs e) + { + IrssLog.Info("Setup"); + + if (Configure()) + { + Stop(); + Thread.Sleep(500); + Start(); + } + } void ClickLaunch(object sender, EventArgs e) { IrssLog.Info("Launch"); Modified: trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.cs =================================================================== --- trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.cs 2007-05-19 06:45:44 UTC (rev 408) +++ trunk/plugins/IR Server Suite/Applications/Virtual Remote/MainForm.cs 2007-05-19 16:14:30 UTC (rev 409) @@ -21,7 +21,7 @@ #region Constants - const string DefaultSkin = "MCE"; + const string DefaultSkin = "MCE"; public static readonly string ConfigurationFile = Common.FolderAppData + "Virtual Remote\\Virtual Remote.xml"; @@ -172,7 +172,7 @@ writer.WriteStartElement("settings"); // <settings> writer.WriteAttributeString("ServerHost", _serverHost); - writer.WriteAttributeString("Skin", _remoteSkin); + writer.WriteAttributeString("RemoteSkin", _remoteSkin); writer.WriteEndElement(); // </settings> writer.WriteEndDocument(); @@ -473,8 +473,6 @@ while (_keepAlive && _registered && !reconnect) { - IrssLog.Info("Ping ({0})", _serverHost); - int pingID = random.Next(); long pingTime = DateTime.Now.Ticks; @@ -509,15 +507,13 @@ if (receivedEcho) // Received ping echo ... { - IrssLog.Info("Echo received"); - // Wait 60 seconds before re-pinging ... for (int sleeps = 0; sleeps < 60 && _keepAlive && _registered; sleeps++) Thread.Sleep(1000); } else // Didn't receive ping echo ... { - IrssLog.Warn("No echo, attempting to reconnect ..."); + IrssLog.Warn("No echo to ping, attempting to reconnect ..."); // Break out of pinging cycle ... _registered = false; Modified: trunk/plugins/IR Server Suite/Common/MPUtils/ExternalChannelConfig.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/MPUtils/ExternalChannelConfig.cs 2007-05-19 06:45:44 UTC (rev 408) +++ trunk/plugins/IR Server Suite/Common/MPUtils/ExternalChannelConfig.cs 2007-05-19 16:14:30 UTC (rev 409) @@ -113,8 +113,10 @@ #region Constructor - public ExternalChannelConfig() + public ExternalChannelConfig(string fileName) { + _fileName = fileName; + _cardID = DefaultCardID; _pauseTime = DefaultPauseTime; @@ -207,8 +209,7 @@ public static ExternalChannelConfig Load(string fileName) { - ExternalChannelConfig newECC = new ExternalChannelConfig(); - newECC._fileName = fileName; + ExternalChannelConfig newECC = new ExternalChannelConfig(fileName); XmlDocument doc = new XmlDocument(); doc.Load(newECC._fileName); Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/MacroEditor.cs =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/MacroEditor.cs 2007-05-19 06:45:44 UTC (rev 408) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/Forms/MacroEditor.cs 2007-05-19 16:14:30 UTC (rev 409) @@ -36,7 +36,10 @@ textBoxName.Enabled = newMacro; if (!newMacro) - ReadFromFile(name); + { + string fileName = MPBlastZonePlugin.FolderMacros + name + Common.FileExtensionMacro; + ReadFromFile(fileName); + } } #endregion Constructor @@ -70,7 +73,7 @@ /// <param name="fileName">Name of Macro to write (macro name, not file path).</param> void WriteToFile(string fileName) { - XmlTextWriter writer = new XmlTextWriter(MPBlastZonePlugin.FolderMacros + fileName + Common.FileExtensionMacro, System.Text.Encoding.UTF8); + XmlTextWriter writer = new XmlTextWriter(fileName, System.Text.Encoding.UTF8); writer.Formatting = Formatting.Indented; writer.Indentation = 1; writer.IndentChar = (char)9; @@ -169,7 +172,7 @@ void ReadFromFile(string fileName) { XmlDocument doc = new XmlDocument(); - doc.Load(MPBlastZonePlugin.FolderMacros + fileName + Common.FileExtensionMacro); + doc.Load(fileName); listBoxMacro.Items.Clear(); @@ -370,6 +373,8 @@ return; } + fileName = MPBlastZonePlugin.FolderMacros + fileName + Common.FileExtensionMacro; + WriteToFile(fileName); try @@ -398,6 +403,8 @@ return; } + fileName = MPBlastZonePlugin.FolderMacros + fileName + Common.FileExtensionMacro; + WriteToFile(fileName); this.DialogResult = DialogResult.OK; 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-05-19 06:45:44 UTC (rev 408) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Blast Zone Plugin/MPBlastZonePlugin.cs 2007-05-19 16:14:30 UTC (rev 409) @@ -496,8 +496,6 @@ while (_keepAlive && _registered && !reconnect) { - Log.Debug("MPBlastZonePlugin: Ping ({0})", _serverHost); - int pingID = random.Next(); long pingTime = DateTime.Now.Ticks; @@ -532,15 +530,13 @@ if (receivedEcho) // Received ping echo ... { - Log.Debug("MPBlastZonePlugin: Echo received"); - // Wait 60 seconds before re-pinging ... for (int sleeps = 0; sleeps < 60 && _keepAlive && _registered; sleeps++) Thread.Sleep(1000); } else // Didn't receive ping echo ... { - Log.Warn("MPBlastZonePlugin: No echo, attempting to reconnect ..."); + Log.Warn("MPBlastZonePlugin: No echo to ping, attempting to reconnect ..."); // Break out of pinging cycle ... _registered = false; @@ -559,7 +555,7 @@ PipeMessage received = PipeMessage.FromString(message); if (LogVerbose) - Log.Info("MPBlastZonePlugin: Received Message \"{0}\"", received.Name); + Log.Debug("MPBlastZonePlugin: Received Message \"{0}\"", received.Name); try { Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/MacroEditor.cs =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/MacroEditor.cs 2007-05-19 06:45:44 UTC (rev 408) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/MacroEditor.cs 2007-05-19 16:14:30 UTC (rev 409) @@ -33,7 +33,7 @@ if (!newMacro) { string fileName = MPControlPlugin.FolderMacros + name + Common.FileExtensionMacro; - ReadFromFile(name); + ReadFromFile(fileName); } } @@ -481,6 +481,8 @@ return; } + fileName = MPControlPlugin.FolderMacros + fileName + Common.FileExtensionMacro; + WriteToFile(fileName); this.DialogResult = DialogResult.OK; Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/SetupForm.cs =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/SetupForm.cs 2007-05-19 06:45:44 UTC (rev 408) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/Forms/SetupForm.cs 2007-05-19 16:14:30 UTC (rev 409) @@ -74,13 +74,7 @@ listBoxMappings.Items.Add(map); // Event Mapper ... - comboBoxCommands.Items.Clear(); - comboBoxCommands.Items.Add(Common.UITextRun); - comboBoxCommands.Items.Add(Common.UITextSerial); - comboBoxCommands.Items.Add(Common.UITextMessage); - comboBoxCommands.Items.Add(Common.UITextKeys); - comboBoxCommands.Items.Add(Common.UITextGoto); - comboBoxCommands.Items.AddRange(MPControlPlugin.GetFileList(true)); + RefreshEventMapperCommands(); comboBoxEvents.Items.Clear(); foreach (string eventType in Enum.GetNames(typeof(MappedEvent.MappingEvent))) @@ -254,6 +248,17 @@ listBoxMacro.Items.AddRange(MPControlPlugin.GetMacroList(false)); } + void RefreshEventMapperCommands() + { + comboBoxCommands.Items.Clear(); + comboBoxCommands.Items.Add(Common.UITextRun); + comboBoxCommands.Items.Add(Common.UITextSerial); + comboBoxCommands.Items.Add(Common.UITextMessage); + comboBoxCommands.Items.Add(Common.UITextKeys); + comboBoxCommands.Items.Add(Common.UITextGoto); + comboBoxCommands.Items.AddRange(MPControlPlugin.GetFileList(true)); + } + void EditIR() { if (listBoxIR.SelectedIndex != -1) @@ -270,6 +275,7 @@ { MessageBox.Show(this, "File not found: " + fileName, "File missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); RefreshIRList(); + RefreshEventMapperCommands(); } } } @@ -289,6 +295,7 @@ { MessageBox.Show(this, "File not found: " + fileName, "File missing", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); RefreshMacroList(); + RefreshEventMapperCommands(); } } } @@ -378,6 +385,7 @@ learnIR.ShowDialog(this); RefreshIRList(); + RefreshEventMapperCommands(); } private void buttonEditIR_Click(object sender, EventArgs e) { @@ -400,6 +408,7 @@ } RefreshIRList(); + RefreshEventMapperCommands(); } } @@ -409,6 +418,7 @@ macroEditor.ShowDialog(this); RefreshMacroList(); + RefreshEventMapperCommands(); } private void buttonEditMacro_Click(object sender, EventArgs e) { @@ -431,6 +441,7 @@ } RefreshMacroList(); + RefreshEventMapperCommands(); } } private void buttonTestMacro_Click(object sender, EventArgs e) Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/InputMapper/InputMappingForm.cs =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/InputMapper/InputMappingForm.cs 2007-05-19 06:45:44 UTC (rev 408) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/InputMapper/InputMappingForm.cs 2007-05-19 16:14:30 UTC (rev 409) @@ -586,6 +586,7 @@ this.comboBoxCmdProperty.Sorted = true; this.comboBoxCmdProperty.TabIndex = 7; this.comboBoxCmdProperty.SelectionChangeCommitted += new System.EventHandler(this.comboBoxCmdProperty_SelectionChangeCommitted); + this.comboBoxCmdProperty.KeyUp += new System.Windows.Forms.KeyEventHandler(this.comboBoxCmdProperty_KeyUp); // // groupBoxCondition // @@ -663,6 +664,7 @@ this.comboBoxCondProperty.Sorted = true; this.comboBoxCondProperty.TabIndex = 4; this.comboBoxCondProperty.SelectionChangeCommitted += new System.EventHandler(this.comboBoxCondProperty_SelectionChangeCommitted); + this.comboBoxCondProperty.KeyUp += new System.Windows.Forms.KeyEventHandler(this.comboBoxCondProperty_KeyUp); // // groupBoxLayer // @@ -824,8 +826,11 @@ switch (condition) { case "WINDOW": - conditionString = GetFriendlyName(Enum.GetName(typeof(GUIWindow.Window), Convert.ToInt32(conProperty))); - break; + { + try { conditionString = GetFriendlyName(Enum.GetName(typeof(GUIWindow.Window), Convert.ToInt32(conProperty))); } + catch { conditionString = conProperty; } + break; + } case "FULLSCREEN": if (conProperty == "TRUE") conditionString = "Fullscreen"; @@ -852,8 +857,11 @@ commandString = "Key \"" + cmdProperty + "\""; break; case "WINDOW": - commandString = "Window \"" + GetFriendlyName(Enum.GetName(typeof(GUIWindow.Window), Convert.ToInt32(cmdProperty))) + "\""; - break; + { + try { commandString = "Window \"" + GetFriendlyName(Enum.GetName(typeof(GUIWindow.Window), Convert.ToInt32(cmdProperty))) + "\""; } + catch { commandString = "Window \"" + cmdProperty + "\""; } + break; + } case "TOGGLE": commandString = "Toggle Layer"; break; @@ -896,7 +904,7 @@ TreeNode soundNode = new TreeNode(sound); soundNode.Tag = new Data("SOUND", null, sound); - if (sound == String.Empty) + if (String.IsNullOrEmpty(sound)) soundNode.Text = "No Sound"; soundNode.ForeColor = Color.DarkRed; conditionNode.Nodes.Add(soundNode); @@ -1009,7 +1017,7 @@ writer.WriteAttributeString("cmdproperty", cmdProperty); if (cmdProperty == Convert.ToInt32(Action.ActionType.ACTION_KEY_PRESSED).ToString()) { - if (cmdKeyChar != String.Empty) + if (!String.IsNullOrEmpty(cmdKeyChar)) { writer.WriteAttributeString("cmdkeychar", cmdKeyChar); } @@ -1017,7 +1025,7 @@ { writer.WriteAttributeString("cmdkeychar", "0"); } - if (cmdKeyCode != String.Empty) + if (!String.IsNullOrEmpty(cmdKeyCode)) { writer.WriteAttributeString("cmdkeycode", cmdKeyCode); } @@ -1027,7 +1035,7 @@ } } - if (sound != String.Empty) + if (!String.IsNullOrEmpty(sound)) writer.WriteAttributeString("sound", sound); if (focus) writer.WriteAttributeString("focus", focus.ToString()); @@ -1187,11 +1195,21 @@ switch ((string)data.Parameter) { case "WINDOW": - radioButtonWindow.Checked = true; - comboBoxCondProperty.Enabled = true; - UpdateCombo(ref comboBoxCondProperty, windowsList, GetFriendlyName(Enum.GetName(typeof(GUIWindow.Window), Convert.ToInt32(data.Value)))); - break; + { + comboBoxCondProperty.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDown; + + radioButtonWindow.Checked = true; + comboBoxCondProperty.Enabled = true; + + string friendlyName; + try { friendlyName = GetFriendlyName(Enum.GetName(typeof(GUIWindow.Window), Convert.ToInt32(data.Value))); } + catch { friendlyName = Convert.ToInt32(data.Value).ToString(); } + UpdateCombo(ref comboBoxCondProperty, windowsList, friendlyName); + break; + } case "FULLSCREEN": + comboBoxCondProperty.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + radioButtonFullscreen.Checked = true; comboBoxCondProperty.Enabled = true; if (Convert.ToBoolean(data.Value)) @@ -1200,11 +1218,15 @@ UpdateCombo(ref comboBoxCondProperty, fullScreenList, "No Fullscreen"); break; case "PLAYER": + comboBoxCondProperty.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + radioButtonPlaying.Checked = true; comboBoxCondProperty.Enabled = true; UpdateCombo(ref comboBoxCondProperty, playerList, playerList[Array.IndexOf(nativePlayerList, (string)data.Value)]); break; case "*": + comboBoxCondProperty.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + comboBoxCondProperty.Text = "none"; radioButtonNoCondition.Checked = true; comboBoxCondProperty.Enabled = false; @@ -1217,7 +1239,7 @@ switch (data.Type) { case "SOUND": - if ((string)data.Value != String.Empty) + if (!String.IsNullOrEmpty(data.Value as string)) comboBoxSound.SelectedItem = data.Value; else comboBoxSound.SelectedItem = "none"; @@ -1245,14 +1267,20 @@ UpdateCombo(ref comboBoxCmdProperty, actionList, "Key Pressed"); break; case "WINDOW": - comboBoxCmdProperty.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - radioButtonActWindow.Checked = true; - comboBoxSound.Enabled = true; - comboBoxCmdProperty.Enabled = true; - textBoxKeyChar.Enabled = textBoxKeyCode.Enabled = false; - textBoxKeyChar.Text = textBoxKeyCode.Text = String.Empty; - UpdateCombo(ref comboBoxCmdProperty, windowsListFiltered, GetFriendlyName(Enum.GetName(typeof(GUIWindow.Window), Convert.ToInt32(data.Value)))); - break; + { + comboBoxCmdProperty.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDown; + radioButtonActWindow.Checked = true; + comboBoxSound.Enabled = true; + comboBoxCmdProperty.Enabled = true; + textBoxKeyChar.Enabled = textBoxKeyCode.Enabled = false; + textBoxKeyChar.Text = textBoxKeyCode.Text = String.Empty; + + string friendlyName; + try { friendlyName = GetFriendlyName(Enum.GetName(typeof(GUIWindow.Window), Convert.ToInt32(data.Value))); } + catch { friendlyName = Convert.ToInt32(data.Value).ToString(); } + UpdateCombo(ref comboBoxCmdProperty, windowsListFiltered, friendlyName); + break; + } case "TOGGLE": radioButtonToggle.Checked = true; comboBoxSound.Enabled = true; @@ -1269,7 +1297,6 @@ comboBoxCmdProperty.Enabled = true; textBoxKeyChar.Enabled = textBoxKeyCode.Enabled = false; textBoxKeyChar.Text = textBoxKeyCode.Text = String.Empty; - string friendlyName = String.Empty; UpdateCombo(ref comboBoxCmdProperty, powerList, powerList[Array.IndexOf(nativePowerList, (string)data.Value)]); break; case "PROCESS": @@ -1299,7 +1326,7 @@ } } - void UpdateCombo(ref MediaPortal.UserInterface.Controls.MPComboBox comboBox, Array list, string hilight) + static void UpdateCombo(ref MediaPortal.UserInterface.Controls.MPComboBox comboBox, Array list, string hilight) { comboBox.Items.Clear(); foreach (object item in list) @@ -1309,12 +1336,12 @@ comboBox.Enabled = true; } - void UpdateCombo(ref MediaPortal.UserInterface.Controls.MPComboBox comboBox, ArrayList list, string hilight) + static void UpdateCombo(ref MediaPortal.UserInterface.Controls.MPComboBox comboBox, ArrayList list, string hilight) { UpdateCombo(ref comboBox, list.ToArray(), hilight); } - string GetFriendlyName(string name) + static string GetFriendlyName(string name) { if ((name.IndexOf("ACTION") != -1) || (name.IndexOf("WINDOW") != -1)) name = name.Substring(7); @@ -1355,12 +1382,12 @@ return newName; } - string GetWindowName(string friendlyName) + static string GetWindowName(string friendlyName) { return "WINDOW_" + friendlyName.Replace(' ', '_').ToUpper(); } - string GetActionName(string friendlyName) + static string GetActionName(string friendlyName) { string actionName = String.Empty; @@ -1384,7 +1411,7 @@ } - void CleanAbbreviation(ref string name, string abbreviation) + static void CleanAbbreviation(ref string name, string abbreviation) { int index = name.ToUpper().IndexOf(abbreviation.ToUpper()); if (index != -1) @@ -1393,6 +1420,7 @@ private void radioButtonWindow_Click(object sender, System.EventArgs e) { + comboBoxCondProperty.DropDownStyle = ComboBoxStyle.DropDown; comboBoxCondProperty.Enabled = true; TreeNode node = getNode("CONDITION"); node.Tag = new Data("CONDITION", "WINDOW", "0"); @@ -1403,6 +1431,7 @@ private void radioButtonFullscreen_Click(object sender, System.EventArgs e) { + comboBoxCondProperty.DropDownStyle = ComboBoxStyle.DropDownList; comboBoxCondProperty.Enabled = true; TreeNode node = getNode("CONDITION"); node.Tag = new Data("CONDITION", "FULLSCREEN", "true"); @@ -1413,6 +1442,7 @@ private void radioButtonPlaying_Click(object sender, System.EventArgs e) { + comboBoxCondProperty.DropDownStyle = ComboBoxStyle.DropDownList; comboBoxCondProperty.Enabled = true; TreeNode node = getNode("CONDITION"); node.Tag = new Data("CONDITION", "PLAYER", "TV"); @@ -1423,6 +1453,7 @@ private void radioButtonNoCondition_Click(object sender, System.EventArgs e) { + comboBoxCondProperty.DropDownStyle = ComboBoxStyle.DropDownList; comboBoxCondProperty.Enabled = false; comboBoxCondProperty.Items.Clear(); comboBoxCondProperty.Text = "none"; @@ -1450,14 +1481,19 @@ private void radioButtonActWindow_Click(object sender, System.EventArgs e) { - comboBoxCmdProperty.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + comboBoxCmdProperty.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDown; comboBoxSound.Enabled = true; comboBoxCmdProperty.Enabled = true; TreeNode node = getNode("COMMAND"); Data data = new Data("COMMAND", "WINDOW", "0"); node.Tag = data; - UpdateCombo(ref comboBoxCmdProperty, windowsListFiltered, GetFriendlyName(Enum.GetName(typeof(GUIWindow.Window), Convert.ToInt32(data.Value)))); - node.Text = "Window \"" + (string)comboBoxCmdProperty.SelectedItem + "\""; + + string friendlyName; + try { friendlyName = GetFriendlyName(Enum.GetName(typeof(GUIWindow.Window), Convert.ToInt32(data.Value))); } + catch { friendlyName = Convert.ToInt32(data.Value).ToString(); } + UpdateCombo(ref comboBoxCmdProperty, windowsListFiltered, friendlyName); + + node.Text = "Window \"" + comboBoxCmdProperty.Text + "\""; ((Data)node.Tag).Focus = checkBoxGainFocus.Checked; changedSettings = true; } @@ -1699,81 +1735,14 @@ private void comboBoxCondProperty_SelectionChangeCommitted(object sender, EventArgs e) { - TreeNode node = getNode("CONDITION"); - Data data = (Data)node.Tag; - switch ((string)data.Parameter) - { - case "WINDOW": - node.Tag = new Data("CONDITION", "WINDOW", (int)Enum.Parse(typeof(GUIWindow.Window), GetWindowName((string)comboBoxCondProperty.SelectedItem))); - node.Text = (string)comboBoxCondProperty.SelectedItem; - break; - case "FULLSCREEN": - if ((string)comboBoxCondProperty.SelectedItem == "Fullscreen") - node.Tag = new Data("CONDITION", "FULLSCREEN", "true"); - else - node.Tag = new Data("CONDITION", "FULLSCREEN", "false"); - node.Text = (string)comboBoxCondProperty.SelectedItem; - break; - case "PLAYER": - { - node.Tag = new Data("CONDITION", "PLAYER", nativePlayerList[Array.IndexOf(playerList, (string)comboBoxCondProperty.SelectedItem)]); - node.Text = (string)comboBoxCondProperty.SelectedItem; - break; - } - case "*": - break; - } - changedSettings = true; + if (comboBoxCondProperty.DropDownStyle == ComboBoxStyle.DropDownList) + ConditionPropChanged(); } private void comboBoxCmdProperty_SelectionChangeCommitted(object sender, EventArgs e) { - if ((string)comboBoxCmdProperty.SelectedItem == "Key Pressed") - textBoxKeyChar.Enabled = textBoxKeyCode.Enabled = true; - else - { - textBoxKeyChar.Enabled = textBoxKeyCode.Enabled = false; - textBoxKeyChar.Text = textBoxKeyCode.Text = String.Empty; - } - - TreeNode node = getNode("COMMAND"); - Data data = (Data)node.Tag; - switch ((string)data.Parameter) - { - case "ACTION": - if ((string)comboBoxCmdProperty.SelectedItem != "Key Pressed") - { - node.Tag = new Data("COMMAND", "ACTION", (int)Enum.Parse(typeof(Action.ActionType), GetActionName((string)comboBoxCmdProperty.SelectedItem))); - node.Text = "Action \"" + (string)comboBoxCmdProperty.SelectedItem + "\""; - } - else - { - textBoxKeyChar.Text = "0"; - textBoxKeyCode.Text = "0"; - Key key = new Key(Convert.ToInt32(textBoxKeyChar.Text), Convert.ToInt32(textBoxKeyCode.Text)); - node.Tag = new Data("COMMAND", "KEY", key); - node.Text = String.Format("Key Pressed: {0} [{1}]", textBoxKeyChar.Text, textBoxKeyCode.Text); - } - break; - case "WINDOW": - node.Tag = new Data("COMMAND", "WINDOW", (int)Enum.Parse(typeof(GUIWindow.Window), GetWindowName((string)comboBoxCmdProperty.SelectedItem))); - node.Text = "Window \"" + (string)comboBoxCmdProperty.SelectedItem + "\""; - break; - case "POWER": - node.Tag = new Data("COMMAND", "POWER", nativePowerList[Array.IndexOf(powerList, (string)comboBoxCmdProperty.SelectedItem)]); - node.Text = (string)comboBoxCmdProperty.SelectedItem; - break; - case "PROCESS": - node.Tag = new Data("COMMAND", "PROCESS", nativeProcessList[Array.IndexOf(processList, (string)comboBoxCmdProperty.SelectedItem)]); - node.Text = (string)comboBoxCmdProperty.SelectedItem; - break; - case "BLAST": - node.Tag = new Data("COMMAND", "BLAST", (string)comboBoxCmdProperty.SelectedItem); - node.Text = "Blast IR: \"" + (string)comboBoxCmdProperty.SelectedItem + "\""; - break; - } - ((Data)node.Tag).Focus = checkBoxGainFocus.Checked; - changedSettings = true; + if (comboBoxCmdProperty.DropDownStyle == ComboBoxStyle.DropDownList) + CommandPropChanged(); } private void comboBoxSound_SelectionChangeCommitted(object sender, EventArgs e) @@ -1795,9 +1764,9 @@ string keyChar = textBoxKeyChar.Text; string keyCode = textBoxKeyCode.Text; TreeNode node = getNode("COMMAND"); - if (keyChar == String.Empty) + if (String.IsNullOrEmpty(keyChar)) keyChar = "0"; - if (keyCode == String.Empty) + if (String.IsNullOrEmpty(keyCode)) keyCode = "0"; Key key = new Key(Convert.ToInt32(keyChar), Convert.ToInt32(keyCode)); node.Tag = new Data("COMMAND", "KEY", key); @@ -1842,6 +1811,109 @@ changedSettings = true; } + private void comboBoxCondProperty_KeyUp(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.Enter && comboBoxCondProperty.DropDownStyle == ComboBoxStyle.DropDown) + ConditionPropChanged(); + } + + private void comboBoxCmdProperty_KeyUp(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.Enter && comboBoxCmdProperty.DropDownStyle == ComboBoxStyle.DropDown) + CommandPropChanged(); + } + + private void CommandPropChanged() + { + if ((string)comboBoxCmdProperty.SelectedItem == "Key Pressed") + textBoxKeyChar.Enabled = textBoxKeyCode.Enabled = true; + else + { + textBoxKeyChar.Enabled = textBoxKeyCode.Enabled = false; + textBoxKeyChar.Text = textBoxKeyCode.Text = String.Empty; + } + + TreeNode node = getNode("COMMAND"); + Data data = (Data)node.Tag; + switch ((string)data.Parameter) + { + case "ACTION": + if ((string)comboBoxCmdProperty.SelectedItem != "Key Pressed") + { + node.Tag = new Data("COMMAND", "ACTION", (int)Enum.Parse(typeof(Action.ActionType), GetActionName((string)comboBoxCmdProperty.SelectedItem))); + node.Text = "Action \"" + (string)comboBoxCmdProperty.SelectedItem + "\""; + } + else + { + textBoxKeyChar.Text = "0"; + textBoxKeyCode.Text = "0"; + Key key = new Key(Convert.ToInt32(textBoxKeyChar.Text), Convert.ToInt32(textBoxKeyCode.Text)); + node.Tag = new Data("COMMAND", "KEY", key); + node.Text = String.Format("Key Pressed: {0} [{1}]", textBoxKeyChar.Text, textBoxKeyCode.Text); + } + break; + case "WINDOW": + { + int windowID; + try { windowID = (int)Enum.Parse(typeof(GUIWindow.Window), GetWindowName(comboBoxCmdProperty.Text)); } + catch { windowID = Convert.ToInt32(comboBoxCmdProperty.Text); } + + node.Tag = new Data("COMMAND", "WINDOW", windowID); + node.Text = "Window \"" + comboBoxCmdProperty.Text + "\""; + break; + } + case "POWER": + node.Tag = new Data("COMMAND", "POWER", nativePowerList[Array.IndexOf(powerList, (string)comboBoxCmdProperty.SelectedItem)]); + node.Text = (string)comboBoxCmdProperty.SelectedItem; + break; + case "PROCESS": + node.Tag = new Data("COMMAND", "PROCESS", nativeProcessList[Array.IndexOf(processList, (string)comboBoxCmdProperty.SelectedItem)]); + node.Text = (string)comboBoxCmdProperty.SelectedItem; + break; + case "BLAST": + node.Tag = new Data("COMMAND", "BLAST", (string)comboBoxCmdProperty.SelectedItem); + node.Text = "Blast IR: \"" + (string)comboBoxCmdProperty.SelectedItem + "\""; + break; + } + ((Data)node.Tag).Focus = checkBoxGainFocus.Checked; + changedSettings = true; + } + + private void ConditionPropChanged() + { + TreeNode node = getNode("CONDITION"); + Data data = (Data)node.Tag; + switch ((string)data.Parameter) + { + case "WINDOW": + { + int windowID; + try { windowID = (int)Enum.Parse(typeof(GUIWindow.Window), GetWindowName(comboBoxCondProperty.Text)); } + catch { windowID = Convert.ToInt32(comboBoxCondProperty.Text); } + + node.Tag = new Data("CONDITION", "WINDOW", windowID); + node.Text = comboBoxCondProperty.Text; + break; + } + case "FULLSCREEN": + if ((string)comboBoxCondProperty.SelectedItem == "Fullscreen") + node.Tag = new Data("CONDITION", "FULLSCREEN", "true"); + else + node.Tag = new Data("CONDITION", "FULLSCREEN", "false"); + node.Text = (string)comboBoxCondProperty.SelectedItem; + break; + case "PLAYER": + { + node.Tag = new Data("CONDITION", "PLAYER", nativePlayerList[Array.IndexOf(playerList, (string)comboBoxCondProperty.SelectedItem)]); + node.Text = (string)comboBoxCondProperty.SelectedItem; + break; + } + case "*": + break; + } + changedSettings = true; + } + // private TreeNode tn; // // private void treeMapping_ItemDrag(object sender, System.Windows.Forms.ItemDragEventArgs e) 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-05-19 06:45:44 UTC (rev 408) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MPControlPlugin.cs 2007-05-19 16:14:30 UTC (rev 409) @@ -52,7 +52,6 @@ internal static readonly string MultiMappingFile = Common.FolderAppData + "MP Control Plugin\\MultiMapping.xml"; internal static readonly string EventMappingFile = Common.FolderAppData + "MP Control Plugin\\EventMapping.xml"; - internal static readonly string ExtCfgFolder = Common.FolderAppData + "MP Control Plugin\\"; internal static readonly string RemotePresetsFolder = Common.FolderAppData + "MP Control Plugin\\Remote Presets\\"; #endregion Constants @@ -111,11 +110,6 @@ #region Properties - internal static bool IsRegistered - { - get { return _registered; } - } - internal static string ServerHost { get { return _serverHost; } @@ -762,8 +756,6 @@ while (_keepAlive && _registered && !reconnect) { - Log.Debug("MPControlPlugin: Ping ({0})", _serverHost); - int pingID = random.Next(); long pingTime = DateTime.Now.Ticks; @@ -798,15 +790,13 @@ if (receivedEcho) // Received ping echo ... { - Log.Debug("MPControlPlugin: Echo received"); - // Wait 60 seconds before re-pinging ... for (int sleeps = 0; sleeps < 60 && _keepAlive && _registered; sleeps++) Thread.Sleep(1000); } else // Didn't receive ping echo ... { - Log.Warn("MPControlPlugin: No echo, attempting to reconnect ..."); + Log.Warn("MPControlPlugin: No echo to ping, attempting to reconnect ..."); // Break out of pinging cycle ... _registered = false; @@ -825,7 +815,7 @@ PipeMessage received = PipeMessage.FromString(message); if (LogVerbose) - Log.Info("MPControlPlugin: Received Message \"{0}\"", received.Name); + Log.Debug("MPControlPlugin: Received Message \"{0}\"", received.Name); try { @@ -949,6 +939,14 @@ } static void ChangeMultiMapping(string multiMapping) { + Log.Debug("ChangeMultiMapping: {0}", multiMapping); + + if (multiMapping == "TOGGLE") + { + ChangeMultiMapping(); + return; + } + for (int index = 0; index < MultiMaps.Length; index++) { if (MultiMaps[index] == multiMapping) @@ -1087,6 +1085,8 @@ static void MapEvent(GUIMessage msg) { MappedEvent.MappingEvent eventType = MappedEvent.GetEventType(msg.Message); + if (eventType == MappedEvent.MappingEvent.None) + return; foreach (MappedEvent mappedEvent in EventMappings) { @@ -1104,45 +1104,22 @@ switch (mappedEvent.Param) { - case "Label 1": - matched = (msg.Label == paramValueString); + case "Label 1": matched = (msg.Label == paramValueString); break; + case "Label 2": matched = (msg.Label2 == paramValueString); break; + case "Label 3": matched = (msg.Label3 == paramValueString); break; + case "Label 4": matched = (msg.Label4 == paramValueString); break; + case "Parameter 1": matched = (msg.Param1 == paramValueInt); break; + case "Parameter 2": matched = (msg.Param2 == paramValueInt); break; + case "Parameter 3": matched = (msg.Param3 == paramValueInt); break; + case "Parameter 4": matched = (msg.Param4 == paramValueInt); break; + case "Sender Control ID": matched = (msg.SenderControlId == paramValueInt); break; + case "Send To Target Window": matched = (msg.SendToTargetWindow == paramValueBool); break; + case "Target Control ID": matched = (msg.TargetControlId == paramValueInt); break; + case "Target Window ID": matched = (msg.TargetWindowId == paramValueInt); break; + + default: + matched = false; break; - case "Label 2": - matched = (msg.Label2 == paramValueString); - break; - case "Label 3": - matched = (msg.Label3 == paramValueString); - break; - case "Label 4": - matched = (msg.Label4 == paramValueString); - break; - case "Parameter 1": - matched = (msg.Param1 == paramValueInt); - break; - case "Parameter 2": - matched = (msg.Param2 == paramValueInt); - break; - case "Parameter 3": - matched = (msg.Param3 == paramValueInt); - break; - case "Parameter 4": - matched = (msg.Param4 == paramValueInt); - break; - case "Sender Control ID": - matched = (msg.SenderControlId == paramValueInt); - break; - case "Send To Target Window": - matched = (msg.SendToTargetWindow == paramValueBool); - break; - case "Target Control ID": - matched = (msg.TargetControlId == paramValueInt); - break; - case "Target Window ID": - matched = (msg.TargetWindowId == paramValueInt); - break; - default: - matched = false; - break; } } Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MappedEvent.cs =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MappedEvent.cs 2007-05-19 06:45:44 UTC (rev 408) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/MP Control Plugin/MappedEvent.cs 2007-05-19 16:14:30 UTC (rev 409) @@ -58,6 +58,7 @@ Tune_External_Channel, Clicked, Item_Selected, + Go_To_Window, } @@ -119,70 +120,39 @@ { switch (messageType) { - case GUIMessage.MessageType.GUI_MSG_CD_INSERTED: - return MappingEvent.CD_Inserted; - case GUIMessage.MessageType.GUI_MSG_CD_REMOVED: - return MappingEvent.CD_Ejected; - case GUIMessage.MessageType.GUI_MSG_FILE_DOWNLOADED: - return MappingEvent.File_Downloaded; - case GUIMessage.MessageType.GUI_MSG_FILE_DOWNLOADING: - return MappingEvent.File_Downloading; - case GUIMessage.MessageType.GUI_MSG_LOSTFOCUS: - return MappingEvent.Focus_Lost; - case GUIMessage.MessageType.GUI_MSG_MSN_CLOSECONVERSATION: - return MappingEvent.MSN_Close_Conversation; - case GUIMessage.MessageType.GUI_MSG_MSN_MESSAGE: - return MappingEvent.MSN_Message; - case GUIMessage.MessageType.GUI_MSG_MSN_STATUS_MESSAGE: - return MappingEvent.MSN_Status_Message; - case GUIMessage.MessageType.GUI_MSG_PLAY_AUDIO_CD: - return MappingEvent.Play_Audio_CD; - case GUIMessage.MessageType.GUI_MSG_PLAY_FILE: - return MappingEvent.Play_File; - case GUIMessage.MessageType.GUI_MSG_PLAY_ITEM: - return MappingEvent.Play_Item; - case GUIMessage.MessageType.GUI_MSG_PLAY_RADIO_STATION: - return MappingEvent.Play_Radio_Station; - case GUIMessage.MessageType.GUI_MSG_PLAYBACK_ENDED: - return MappingEvent.Playback_Ended; - case GUIMessage.MessageType.GUI_MSG_PLAYBACK_STARTED: - return MappingEvent.Playback_Started; - case GUIMessage.MessageType.GUI_MSG_PLAYBACK_STOPPED: - return MappingEvent.Playback_Stopped; - case GUIMessage.MessageType.GUI_MSG_RECORD: - return MappingEvent.Record; - case GUIMessage.MessageType.GUI_MSG_RECORDER_ABOUT_TO_START_RECORDING: - return MappingEvent.About_To_Record; - case GUIMessage.MessageType.GUI_MSG_RECORDER_START: - return MappingEvent.Recorder_Start; - case GUIMessage.MessageType.GUI_MSG_RECORDER_STOP: - return MappingEvent.Recorder_Stop; - case GUIMessage.MessageType.GUI_MSG_RECORDER_STOP_RADIO: - return MappingEvent.Recorder_Stop_Radio; - case GUIMessage.MessageType.GUI_MSG_RECORDER_STOP_TIMESHIFT: - return MappingEvent.Recorder_Stop_Timeshift; - case GUIMessage.MessageType.GUI_MSG_RECORDER_STOP_TV: - return MappingEvent.Recorder_Stop_TV; - case GUIMessage.MessageType.GUI_MSG_RECORDER_STOP_VIEWING: - return MappingEvent.Recorder_Stop_Viewing; - case GUIMessage.MessageType.GUI_MSG_RECORDER_TUNE_RADIO: - return MappingEvent.Recorder_Tune_Radio; - case GUIMessage.MessageType.GUI_MSG_RECORDER_VIEW_CHANNEL: - return MappingEvent.Recorder_View_Channel; - case GUIMessage.MessageType.GUI_MSG_RESUME_TV: - return MappingEvent.Resume_TV; - case GUIMessage.MessageType.GUI_MSG_START_SLIDESHOW: - return MappingEvent.Slideshow_Start; - case GUIMessage.MessageType.GUI_MSG_STOP_FILE: - return MappingEvent.File_Stop; - case GUIMessage.MessageType.GUI_MSG_SWITCH_FULL_WINDOWED: - return MappingEvent.Switch_Full_Windowed; - case GUIMessage.MessageType.GUI_MSG_TUNE_EXTERNAL_CHANNEL: - return MappingEvent.Tune_External_Channel; - case GUIMessage.MessageType.GUI_MSG_CLICKED: - return MappingEvent.Clicked; - case GUIMessage.MessageType.GUI_MSG_ITEM_SELECTED: - return MappingEvent.Item_Selected; + case GUIMessage.MessageType.GUI_MSG_CD_INSERTED: return MappingEvent.CD_Inserted; + case GUIMessage.MessageType.GUI_MSG_CD_REMOVED: return MappingEvent.CD_Ejected; + case GUIMessage.MessageType.GUI_MSG_FILE_DOWNLOADED: return MappingEvent.File_Downloaded; + case GUIMessage.MessageType.GUI_MSG_FILE_DOWNLOADING: return MappingEvent.File_Downloading; + case GUIMessage.MessageType.GUI_MSG_LOSTFOCUS: return MappingEvent.Focus_Lost; + case GUIMessage.MessageType.GUI_MSG_MSN_CLOSECONVERSATION: return MappingEvent.MSN_Close_Conversation; + case GUIMessage.MessageType.GUI_MSG_MSN_MESSAGE: return MappingEvent.MSN_Message; + case GUIMessage.MessageType.GUI_MSG_MSN_STATUS_MESSAGE: return MappingEvent.MSN_Status_Message; + case GUIMessage.MessageType.GUI_MSG_PLAY_AUDIO_CD: return MappingEvent.Play_Audio_CD; + case GUIMessage.MessageType.GUI_MSG_PLAY_FILE: return MappingEvent.Play_File; + case GUIMessage.MessageType.GUI_MSG_PLAY_ITEM: return MappingEvent.Play_Item; + case GUIMessage.MessageType.GUI_MSG_PLAY_RADIO_STATION: return MappingEvent.Play_Radio_Station; + case GUIMessage.MessageType.GUI_MSG_PLAYBACK_ENDED: return MappingEvent.Playback_Ended; + case GUIMessage.MessageType.GUI_MSG_PLAYBACK_STARTED: return MappingEvent.Playback_Started; + case GUIMessage.MessageType.GUI_MSG_PLAYBACK_STOPPED: return MappingEvent.Playback_Stopped; + case GUIMessage.MessageType.GUI_MSG_RECORD: return MappingEvent.Record; + case GUIMessage.MessageType.GUI_MSG_RECORDER_ABOUT_TO_START_RECORDING: return MappingEvent.About_To_Record; + case GUIMessage.MessageType.GUI_MSG_RECORDER_START: return MappingEvent.Recorder_Start; + case GUIMessage.MessageType.GUI_MSG_RECORDER_STOP: return MappingEvent.Recorder_Stop; + case GUIMessage.MessageType.GUI_MSG_RECORDER_STOP_RADIO: return MappingEvent.Recorder_Stop_Radio; + case GUIMessage.MessageType.GUI_MSG_RECORDER_STOP_TIMESHIFT: return MappingEvent.Recorder_Stop_Timeshift; + case GUIMessage.MessageType.GUI_MSG_RECORDER_STOP_TV: return MappingEvent.Recorder_Stop_TV; + case GUIMessage.MessageType.GUI_MSG_RECORDER_STOP_VIEWING: return MappingEvent.Recorder_Stop_Viewing; + case GUIMessage.MessageType.GUI_MSG_RECORDER_TUNE_RADIO: return MappingEvent.Recorder_Tune_Radio; + case GUIMessage.MessageType.GUI_MSG_RECORDER_VIEW_CHANNEL: return MappingEvent.Recorder_View_Channel; + case GUIMessage.MessageType.GUI_MSG_RESUME_TV: return MappingEvent.Resume_TV; + case GUIMessage.MessageType.GUI_MSG_START_SLIDESHOW: return MappingEvent.Slideshow_Start; + case GUIMessage.MessageType.GUI_MSG_STOP_FILE: return MappingEvent.File_Stop; + case GUIMessage.MessageType.GUI_MSG_SWITCH_FULL_WINDOWED: return MappingEvent.Switch_Full_Windowed; + case GUIMessage.MessageType.GUI_MSG_TUNE_EXTERNAL_CHANNEL: return MappingEvent.Tune_External_Channel; + case GUIMessage.MessageType.GUI_MSG_CLICKED: return MappingEvent.Clicked; + case GUIMessage.MessageType.GUI_MSG_ITEM_SELECTED: return MappingEvent.Item_Selected; + case GUIMessage.MessageType.GUI_MSG_GOTO_WINDOW: return MappingEvent.Go_To_Window; default: return MappingEvent.None; 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-05-19 06:45:44 UTC (rev 408) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/TV2 Blaster Plugin/TV2BlasterPlugin.cs 2007-05-19 16:14:30 UTC (rev 409) @@ -368,8 +368,6 @@ while (_keepAlive && _registered && !reconnect) { - Log.Debug("TV2BlasterPlugin: Ping ({0})", _serverHost); - int pingID = random.Next(); long pingTime = DateTime.Now.Ticks; @@ -404,15 +402,13 @@ if (receivedEcho) // Received ping echo ... { - Log.Debug("TV2BlasterPlugin: Echo received"); - // Wait 60 seconds before re-pinging ... for (int sleeps = 0; sleeps < 60 && _keepAlive && _registered; sleeps++) Thread.Sleep(1000); } else // Didn't receive ping echo ... { - Log.Warn("TV2BlasterPlugin: No echo, attempting to reconnect ..."); + Log.Warn("TV2BlasterPlugin: No echo to ping, attempting to reconnect ..."); // Break out of pinging cycle ... _registered = false; @@ -431,7 +427,7 @@ PipeMessage received = PipeMessage.FromString(message); if (LogVerbose) - Log.Info("TV2BlasterPlugin: Received Message \"{0}\"", received.Name); + Log.Debug("TV2BlasterPlugin: Received Message \"{0}\"", received.Name); try { @@ -558,7 +554,7 @@ } catch (Exception ex) { - ExternalChannelConfigs[index] = new ExternalChannelConfig(); + ExternalChannelConfigs[index] = new ExternalChannelConfig(fileName); Log.Error(ex); } } Modified: trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/MacroEditor.cs =================================================================== --- trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/MacroEditor.cs 2007-05-19 06:45:44 UTC (rev 408) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/Forms/MacroEditor.cs 2007-05-19 16:14:30 UTC (rev 409) @@ -290,6 +290,8 @@ return; } + fileName = TV3BlasterPlugin.FolderMacros + fileName + Common.FileExtensionMacro; + WriteToFile(fileName); this.DialogResult = DialogResult.OK; 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-05-19 06:45:44 UTC (rev 408) +++ trunk/plugins/IR Server Suite/MediaPortal Plugins/TV3 Blaster Plugin/TV3BlasterPlugin.cs 2007-05-19 16:14:30 UTC (rev 409) @@ -345,8 +345,6 @@ while (_keepAlive && _registered && !reconnect) { - Log.Debug("TV3BlasterPlugin: Ping ({0})", _serverHost); - int pingID = random.Next(); long pingTime = DateTime.Now.Ticks; @@ -381,15 +379,13 @@ if (receivedEcho) // Received ping echo ... { - Log.Debug("TV3BlasterPlugin: Echo received"); - // Wait 60 seconds before re-pinging ... for (int sleeps = 0; sleeps < 60 && _keepAlive && _registered; sleeps++) Thread.Sleep(1000); } else // Didn't receive ping echo ... { - Log.Error("TV3BlasterPlugin: No echo, attempting to reconnect ..."); + Log.Error("TV3BlasterPlugin: No echo to ping, attempting to reconnect ..."); // Break out of pinging cycle ... _registered = false; @@ -408,7 +404,7 @@ PipeMessage received =... [truncated message content] |
From: <an...@us...> - 2007-05-22 06:26:06
|
Revision: 412 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=412&view=rev Author: and-81 Date: 2007-05-21 23:26:03 -0700 (Mon, 21 May 2007) Log Message: ----------- Adds a status icon for TV Server to the system tray (shows TV Cards status) Added Paths: ----------- trunk/plugins/TVServerStatus/ trunk/plugins/TVServerStatus/Graphics/ trunk/plugins/TVServerStatus/Graphics/Blue.png trunk/plugins/TVServerStatus/Graphics/Green.png trunk/plugins/TVServerStatus/Graphics/Red.png trunk/plugins/TVServerStatus/Graphics/Yellow.png trunk/plugins/TVServerStatus/PluginSetup.Designer.cs trunk/plugins/TVServerStatus/PluginSetup.cs trunk/plugins/TVServerStatus/PluginSetup.resx trunk/plugins/TVServerStatus/Properties/ trunk/plugins/TVServerStatus/Properties/AssemblyInfo.cs trunk/plugins/TVServerStatus/Properties/Resources.Designer.cs trunk/plugins/TVServerStatus/Properties/Resources.resx trunk/plugins/TVServerStatus/TVServerStatus.cs trunk/plugins/TVServerStatus/TVServerStatus.csproj Added: trunk/plugins/TVServerStatus/Graphics/Blue.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/TVServerStatus/Graphics/Blue.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/TVServerStatus/Graphics/Green.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/TVServerStatus/Graphics/Green.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/TVServerStatus/Graphics/Red.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/TVServerStatus/Graphics/Red.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/TVServerStatus/Graphics/Yellow.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/TVServerStatus/Graphics/Yellow.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/TVServerStatus/PluginSetup.Designer.cs =================================================================== --- trunk/plugins/TVServerStatus/PluginSetup.Designer.cs (rev 0) +++ trunk/plugins/TVServerStatus/PluginSetup.Designer.cs 2007-05-22 06:26:03 UTC (rev 412) @@ -0,0 +1,143 @@ +namespace SetupTv.Sections +{ + + [System.CLSCompliant(false)] + partial class PluginSetup + { + /// <summary> + /// Required designer variable. + /// </summary> + private new 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.labelIdleIcon = new System.Windows.Forms.Label(); + this.labelEPGIcon = new System.Windows.Forms.Label(); + this.labelTSIcon = new System.Windows.Forms.Label(); + this.labelRecIcon = new System.Windows.Forms.Label(); + this.labelIdleText = new System.Windows.Forms.Label(); + this.labelEPGText = new System.Windows.Forms.Label(); + this.labelTSText = new System.Windows.Forms.Label(); + this.labelRecText = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // labelIdleIcon + // + this.labelIdleIcon.Image = global::TvEngine.Properties.Resources.Blue; + this.labelIdleIcon.Location = new System.Drawing.Point(8, 8); + this.labelIdleIcon.Name = "labelIdleIcon"; + this.labelIdleIcon.Size = new System.Drawing.Size(24, 24); + this.labelIdleIcon.TabIndex = 0; + // + // labelEPGIcon + // + this.labelEPGIcon.Image = global::TvEngine.Properties.Resources.Yellow; + this.labelEPGIcon.Location = new System.Drawing.Point(8, 40); + this.labelEPGIcon.Name = "labelEPGIcon"; + this.labelEPGIcon.Size = new System.Drawing.Size(24, 24); + this.labelEPGIcon.TabIndex = 2; + // + // labelTSIcon + // + this.labelTSIcon.Image = global::TvEngine.Properties.Resources.Green; + this.labelTSIcon.Location = new System.Drawing.Point(8, 72); + this.labelTSIcon.Name = "labelTSIcon"; + this.labelTSIcon.Size = new System.Drawing.Size(24, 24); + this.labelTSIcon.TabIndex = 4; + // + // labelRecIcon + // + this.labelRecIcon.Image = global::TvEngine.Properties.Resources.Red; + this.labelRecIcon.Location = new System.Drawing.Point(8, 104); + this.labelRecIcon.Name = "labelRecIcon"; + this.labelRecIcon.Size = new System.Drawing.Size(24, 24); + this.labelRecIcon.TabIndex = 6; + // + // labelIdleText + // + this.labelIdleText.Location = new System.Drawing.Point(40, 8); + this.labelIdleText.Name = "labelIdleText"; + this.labelIdleText.Size = new System.Drawing.Size(88, 24); + this.labelIdleText.TabIndex = 1; + this.labelIdleText.Text = "Idle"; + this.labelIdleText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // labelEPGText + // + this.labelEPGText.Location = new System.Drawing.Point(40, 40); + this.labelEPGText.Name = "labelEPGText"; + this.labelEPGText.Size = new System.Drawing.Size(88, 24); + this.labelEPGText.TabIndex = 3; + this.labelEPGText.Text = "Grabbing EPG"; + this.labelEPGText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // labelTSText + // + this.labelTSText.Location = new System.Drawing.Point(40, 72); + this.labelTSText.Name = "labelTSText"; + this.labelTSText.Size = new System.Drawing.Size(88, 24); + this.labelTSText.TabIndex = 5; + this.labelTSText.Text = "Timeshifting"; + this.labelTSText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // labelRecText + // + this.labelRecText.Location = new System.Drawing.Point(40, 104); + this.labelRecText.Name = "labelRecText"; + this.labelRecText.Size = new System.Drawing.Size(88, 24); + this.labelRecText.TabIndex = 7; + this.labelRecText.Text = "Recording"; + this.labelRecText.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // PluginSetup + // + this.Controls.Add(this.labelRecText); + this.Controls.Add(this.labelTSText); + this.Controls.Add(this.labelEPGText); + this.Controls.Add(this.labelIdleText); + this.Controls.Add(this.labelRecIcon); + this.Controls.Add(this.labelTSIcon); + this.Controls.Add(this.labelEPGIcon); + this.Controls.Add(this.labelIdleIcon); + this.Name = "PluginSetup"; + this.Size = new System.Drawing.Size(138, 138); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Label labelIdleIcon; + private System.Windows.Forms.Label labelEPGIcon; + private System.Windows.Forms.Label labelTSIcon; + private System.Windows.Forms.Label labelRecIcon; + private System.Windows.Forms.Label labelIdleText; + private System.Windows.Forms.Label labelEPGText; + private System.Windows.Forms.Label labelTSText; + private System.Windows.Forms.Label labelRecText; + + + + + } + +} Added: trunk/plugins/TVServerStatus/PluginSetup.cs =================================================================== --- trunk/plugins/TVServerStatus/PluginSetup.cs (rev 0) +++ trunk/plugins/TVServerStatus/PluginSetup.cs 2007-05-22 06:26:03 UTC (rev 412) @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +using TvLibrary.Log; +using TvEngine; +using TvControl; +using TvDatabase; + +namespace SetupTv.Sections +{ + + public partial class PluginSetup : SetupTv.SectionSettings + { + + #region Constructor + + public PluginSetup() + { + InitializeComponent(); + } + + #endregion Constructor + + #region SetupTv.SectionSettings + + public override void OnSectionDeActivated() + { + Log.Info("TVServerStatus: Configuration deactivated"); + + base.OnSectionDeActivated(); + } + public override void OnSectionActivated() + { + Log.Info("TVServerStatus: Configuration activated"); + + base.OnSectionActivated(); + } + + #endregion SetupTv.SectionSettings + + } + +} Added: trunk/plugins/TVServerStatus/PluginSetup.resx =================================================================== --- trunk/plugins/TVServerStatus/PluginSetup.resx (rev 0) +++ trunk/plugins/TVServerStatus/PluginSetup.resx 2007-05-22 06:26:03 UTC (rev 412) @@ -0,0 +1,120 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> +</root> \ No newline at end of file Added: trunk/plugins/TVServerStatus/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/TVServerStatus/Properties/AssemblyInfo.cs (rev 0) +++ trunk/plugins/TVServerStatus/Properties/AssemblyInfo.cs 2007-05-22 06:26:03 UTC (rev 412) @@ -0,0 +1,71 @@ +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Security.Permissions; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly: AssemblyTitle("TV Server Status Plugin")] +[assembly: AssemblyDescription("Creates a system tray status icon for the TV Server")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("and-81")] +[assembly: AssemblyProduct("MediaPortal TV Server")] +[assembly: AssemblyCopyright("Aaron Dinnage")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion("1.0.3.0")] +[assembly: AssemblyFileVersionAttribute("1.0.3.0")] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory which is +// %Project Directory%\obj\<configuration>. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("")] +[assembly: AssemblyKeyName("")] + +[assembly: CLSCompliant(true)] + +//[assembly: SecurityPermission(SecurityAction.RequestMinimum, UnmanagedCode = true)] Added: trunk/plugins/TVServerStatus/Properties/Resources.Designer.cs =================================================================== --- trunk/plugins/TVServerStatus/Properties/Resources.Designer.cs (rev 0) +++ trunk/plugins/TVServerStatus/Properties/Resources.Designer.cs 2007-05-22 06:26:03 UTC (rev 412) @@ -0,0 +1,91 @@ +//------------------------------------------------------------------------------ +// <auto-generated> +// This code was generated by a tool. +// Runtime Version:2.0.50727.42 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// </auto-generated> +//------------------------------------------------------------------------------ + +namespace TvEngine.Properties { + using System; + + + /// <summary> + /// A strongly-typed resource class, for looking up localized strings, etc. + /// </summary> + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// <summary> + /// Returns the cached ResourceManager instance used by this class. + /// </summary> + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("TvEngine.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// <summary> + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// </summary> + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + internal static System.Drawing.Bitmap Blue { + get { + object obj = ResourceManager.GetObject("Blue", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap Green { + get { + object obj = ResourceManager.GetObject("Green", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap Red { + get { + object obj = ResourceManager.GetObject("Red", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + internal static System.Drawing.Bitmap Yellow { + get { + object obj = ResourceManager.GetObject("Yellow", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} Added: trunk/plugins/TVServerStatus/Properties/Resources.resx =================================================================== --- trunk/plugins/TVServerStatus/Properties/Resources.resx (rev 0) +++ trunk/plugins/TVServerStatus/Properties/Resources.resx 2007-05-22 06:26:03 UTC (rev 412) @@ -0,0 +1,133 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> + <data name="Red" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Graphics\Red.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="Yellow" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Graphics\Yellow.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="Blue" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Graphics\Blue.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> + <data name="Green" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Graphics\Green.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + </data> +</root> \ No newline at end of file Added: trunk/plugins/TVServerStatus/TVServerStatus.cs =================================================================== --- trunk/plugins/TVServerStatus/TVServerStatus.cs (rev 0) +++ trunk/plugins/TVServerStatus/TVServerStatus.cs 2007-05-22 06:26:03 UTC (rev 412) @@ -0,0 +1,201 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Drawing; +using System.Text; +using System.Threading; +using System.Windows.Forms; + +using TvLibrary.Log; +using TvControl; +using SetupTv; +using TvEngine.Events; +using TvLibrary.Streaming; +using TvLibrary.Helper; +using TvLibrary.Interfaces; +using TvLibrary.Implementations; +using TvDatabase; + +namespace TvEngine +{ + + public class TVServerStatus : ITvServerPlugin + { + + #region Variables + + IController _controller; + + NotifyIcon _notifyIcon; + Thread _updateThread; + + int _cards; + int[] _cardIDs; + + #endregion Variables + + #region Properties + + /// <summary> + /// returns the name of the plugin + /// </summary> + public string Name { get { return "TVServerStatus"; } } + /// <summary> + /// returns the version of the plugin + /// </summary> + public string Version { get { return "1.0.3.0"; } } + /// <summary> + /// returns the author of the plugin + /// </summary> + public string Author { get { return "and-81"; } } + /// <summary> + /// returns if the plugin should only run on the master server + /// or also on slave servers + /// </summary> + public bool MasterOnly { get { return false; } } + + #endregion Properties + + #region Plugin methods + + [CLSCompliant(false)] + public void Start(IController controller) + { + //TvBusinessLayer layer = new TvBusinessLayer(); + //LogVerbose = Convert.ToBoolean(layer.GetSetting("TVServerStatus_Setting", "False").Value); + + _controller = controller; + + _cards = _controller.Cards; + _cardIDs = new int[_cards]; + for (int index = 0; index < _cards; index++) + _cardIDs[index] = _controller.CardId(index); + + CreateIcon(); + UpdateIcon(); + ShowIcon(); + + _updateThread = new Thread(new ThreadStart(UpdateThread)); + _updateThread.Start(); + } + + public void Stop() + { + try + { + _updateThread.Abort(); + } + catch { } + + HideIcon(); + } + + [CLSCompliant(false)] + public SetupTv.SectionSettings Setup + { + get { return new SetupTv.Sections.PluginSetup(); } + } + + #endregion Plugin methods + + #region Private Methods + + void UpdateThread() + { + while (true) + { + Thread.Sleep(5000); + UpdateIcon(); + } + } + + void CreateIcon() + { + _notifyIcon = new NotifyIcon(); + _notifyIcon.Text = "TV Server"; + } + void UpdateIcon() + { + List<int> recordingChannels = new List<int>(); + List<int> timeshiftingChannels = new List<int>(); + _controller.GetAllRecordingChannels(out recordingChannels, out timeshiftingChannels); + + if (recordingChannels.Count > 0) + { + _notifyIcon.Icon = Icon.FromHandle(Properties.Resources.Red.GetHicon()); + } + else if (timeshiftingChannels.Count > 0) + { + _notifyIcon.Icon = Icon.FromHandle(Properties.Resources.Green.GetHicon()); + } + else + { + foreach (int cardID in _cardIDs) + { + if (!_controller.Enabled(cardID)) + continue; + + if (_controller.IsGrabbingEpg(cardID)) + { + _notifyIcon.Icon = Icon.FromHandle(Properties.Resources.Yellow.GetHicon()); + return; + } + } + + _notifyIcon.Icon = Icon.FromHandle(Properties.Resources.Blue.GetHicon()); + } + + string status = "TV Server" + StatusText(); + if (status.Length > 64) + status = status.Substring(0, 60) + " ..."; + + _notifyIcon.Text = status; + } + void ShowIcon() + { + _notifyIcon.Visible = true; + } + void HideIcon() + { + _notifyIcon.Visible = false; + } + + string StatusText() + { + StringBuilder outputString = new StringBuilder(); + string overallStatus = String.Empty; + + foreach (int cardID in _cardIDs) + { + if (!_controller.Enabled(cardID)) + continue; + + outputString.Append("\r\n"); + outputString.Append(cardID.ToString()); + outputString.Append(" - "); + + User user; + + if (_controller.IsScanning(cardID)) + outputString.Append("Scanning"); + else if (_controller.IsGrabbingEpg(cardID)) + outputString.Append("Grabbing EPG"); + else if (_controller.IsCardInUse(cardID, out user)) + { + if (_controller.IsRecording(ref user)) + outputString.Append(String.Format("Recording")); + else if (_controller.IsTimeShifting(ref user)) + outputString.Append(String.Format("Timeshifting")); + } + else + outputString.Append("Idle"); + } + + return outputString.ToString(); + } + + #endregion Private Methods + + } + +} Added: trunk/plugins/TVServerStatus/TVServerStatus.csproj =================================================================== --- trunk/plugins/TVServerStatus/TVServerStatus.csproj (rev 0) +++ trunk/plugins/TVServerStatus/TVServerStatus.csproj 2007-05-22 06:26:03 UTC (rev 412) @@ -0,0 +1,186 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <ProjectType>Local</ProjectType> + <ProductVersion>8.0.50727</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{C17FD89A-D510-4395-A292-54A17E31AB93}</ProjectGuid> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ApplicationIcon> + </ApplicationIcon> + <AssemblyKeyContainerName> + </AssemblyKeyContainerName> + <AssemblyName>TVServerStatus</AssemblyName> + <AssemblyOriginatorKeyFile> + </AssemblyOriginatorKeyFile> + <DefaultClientScript>JScript</DefaultClientScript> + <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout> + <DefaultTargetSchema>IE50</DefaultTargetSchema> + <DelaySign>false</DelaySign> + <OutputType>Library</OutputType> + <RootNamespace>TvEngine</RootNamespace> + <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent> + <StartupObject> + </StartupObject> + <FileUpgradeFlags> + </FileUpgradeFlags> + <UpgradeBackupLocation> + </UpgradeBackupLocation> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <OutputPath>bin\Debug\</OutputPath> + <AllowUnsafeBlocks>false</AllowUnsafeBlocks> + <BaseAddress>285212672</BaseAddress> + <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow> + <ConfigurationOverrideFile> + </ConfigurationOverrideFile> + <DefineConstants>DEBUG</DefineConstants> + <DocumentationFile> + </DocumentationFile> + <DebugSymbols>true</DebugSymbols> + <FileAlignment>4096</FileAlignment> + <NoStdLib>false</NoStdLib> + <NoWarn> + </NoWarn> + <Optimize>false</Optimize> + <RegisterForComInterop>false</RegisterForComInterop> + <RemoveIntegerChecks>false</RemoveIntegerChecks> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + <WarningLevel>4</WarningLevel> + <DebugType>full</DebugType> + <ErrorReport>prompt</ErrorReport> + <UseVSHostingProcess>false</UseVSHostingProcess> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <OutputPath>bin\Release\</OutputPath> + <AllowUnsafeBlocks>false</AllowUnsafeBlocks> + <BaseAddress>285212672</BaseAddress> + <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow> + <ConfigurationOverrideFile> + </ConfigurationOverrideFile> + <DefineConstants> + </DefineConstants> + <DocumentationFile> + </DocumentationFile> + <DebugSymbols>false</DebugSymbols> + <FileAlignment>4096</FileAlignment> + <NoStdLib>false</NoStdLib> + <NoWarn> + </NoWarn> + <Optimize>true</Optimize> + <RegisterForComInterop>false</RegisterForComInterop> + <RemoveIntegerChecks>false</RemoveIntegerChecks> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + <WarningLevel>4</WarningLevel> + <DebugType>none</DebugType> + <ErrorReport>prompt</ErrorReport> + <UseVSHostingProcess>false</UseVSHostingProcess> + </PropertyGroup> + <ItemGroup> + <Reference Include="Gentle.Common, Version=1.2.9.1285, Culture=neutral, PublicKeyToken=80b5de62e27be49b"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\TV Engine\TVLibrary\TVDatabase\references\Gentle.Common.dll</HintPath> + <Private>False</Private> + </Reference> + <Reference Include="Gentle.Framework, Version=1.2.9.1286, Culture=neutral, PublicKeyToken=80b5de62e27be49b"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\TV Engine\TVLibrary\TVDatabase\references\Gentle.Framework.dll</HintPath> + <Private>False</Private> + </Reference> + <Reference Include="PluginBase, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\TV Engine\TVLibrary\Plugins\PluginBase\bin\Release\PluginBase.dll</HintPath> + <Private>False</Private> + </Reference> + <Reference Include="SetupControls, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\TV Engine\TVLibrary\SetupControls\bin\Release\SetupControls.dll</HintPath> + <Private>False</Private> + </Reference> + <Reference Include="System"> + <Name>System</Name> + </Reference> + <Reference Include="System.Data"> + <Name>System.Data</Name> + </Reference> + <Reference Include="System.Drawing"> + <Name>System.Drawing</Name> + </Reference> + <Reference Include="System.ServiceProcess" /> + <Reference Include="System.Windows.Forms"> + <Name>System.Windows.Forms</Name> + </Reference> + <Reference Include="System.Xml" /> + <Reference Include="TvBusinessLayer, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\TV Engine\TVLibrary\TvService\bin\Release\TvBusinessLayer.dll</HintPath> + <Private>False</Private> + </Reference> + <Reference Include="TvControl, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\TV Engine\TVLibrary\TvControl\bin\Release\TvControl.dll</HintPath> + <Private>False</Private> + </Reference> + <Reference Include="TVDatabase, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\TV Engine\TVLibrary\TVDatabase\bin\Release\TVDatabase.dll</HintPath> + <Private>False</Private> + </Reference> + <Reference Include="TVLibrary, Version=1.0.0.1, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\TV Engine\TVLibrary\TVLibrary\bin\Release\TVLibrary.dll</HintPath> + <Private>False</Private> + </Reference> + <Reference Include="TvLibrary.Interfaces, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\TV Engine\TVLibrary\TvLibrary.Interfaces\bin\Release\TvLibrary.Interfaces.dll</HintPath> + <Private>False</Private> + </Reference> + </ItemGroup> + <ItemGroup> + <Compile Include="PluginSetup.cs"> + <SubType>UserControl</SubType> + </Compile> + <Compile Include="PluginSetup.designer.cs"> + <DependentUpon>PluginSetup.cs</DependentUpon> + </Compile> + <Compile Include="Properties\AssemblyInfo.cs"> + <SubType>Code</SubType> + </Compile> + <Compile Include="Properties\Resources.Designer.cs"> + <AutoGen>True</AutoGen> + <DesignTime>True</DesignTime> + <DependentUpon>Resources.resx</DependentUpon> + </Compile> + <Compile Include="TVServerStatus.cs" /> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="PluginSetup.resx"> + <DependentUpon>PluginSetup.cs</DependentUpon> + <SubType>Designer</SubType> + </EmbeddedResource> + <EmbeddedResource Include="Properties\Resources.resx"> + <SubType>Designer</SubType> + <Generator>ResXFileCodeGenerator</Generator> + <LastGenOutput>Resources.Designer.cs</LastGenOutput> + </EmbeddedResource> + </ItemGroup> + <ItemGroup> + <None Include="Graphics\Red.png" /> + </ItemGroup> + <ItemGroup> + <None Include="Graphics\Yellow.png" /> + </ItemGroup> + <ItemGroup> + <None Include="Graphics\Blue.png" /> + </ItemGroup> + <ItemGroup> + <None Include="Graphics\Green.png" /> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <PropertyGroup> + <PreBuildEvent> + </PreBuildEvent> + <PostBuildEvent>copy "$(TargetPath)" "\MediaPortal Development\Plugin Releases\TVServerStatus\"</PostBuildEvent> + </PropertyGroup> +</Project> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2007-05-23 15:30:49
|
Revision: 416 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=416&view=rev Author: saamand Date: 2007-05-23 08:30:36 -0700 (Wed, 23 May 2007) Log Message: ----------- Added Paths: ----------- trunk/plugins/README.txt trunk/plugins/conf/ trunk/plugins/conf/authz trunk/plugins/conf/passwd trunk/plugins/conf/svnserve.conf trunk/plugins/dav/ trunk/plugins/db/ trunk/plugins/db/current trunk/plugins/db/format trunk/plugins/db/fs-type trunk/plugins/db/revprops/ trunk/plugins/db/revprops/0 trunk/plugins/db/revs/ trunk/plugins/db/revs/0 trunk/plugins/db/transactions/ trunk/plugins/db/uuid trunk/plugins/db/write-lock trunk/plugins/format trunk/plugins/hooks/ trunk/plugins/hooks/post-commit.tmpl trunk/plugins/hooks/post-lock.tmpl trunk/plugins/hooks/post-revprop-change.tmpl trunk/plugins/hooks/post-unlock.tmpl trunk/plugins/hooks/pre-commit.tmpl trunk/plugins/hooks/pre-lock.tmpl trunk/plugins/hooks/pre-revprop-change.tmpl trunk/plugins/hooks/pre-unlock.tmpl trunk/plugins/hooks/start-commit.tmpl trunk/plugins/locks/ trunk/plugins/locks/db-logs.lock trunk/plugins/locks/db.lock Added: trunk/plugins/README.txt =================================================================== --- trunk/plugins/README.txt (rev 0) +++ trunk/plugins/README.txt 2007-05-23 15:30:36 UTC (rev 416) @@ -0,0 +1,5 @@ +This is a Subversion repository; use the 'svnadmin' tool to examine +it. Do not add, delete, or modify files here unless you know how +to avoid corrupting the repository. + +Visit http://subversion.tigris.org/ for more information. Added: trunk/plugins/conf/authz =================================================================== --- trunk/plugins/conf/authz (rev 0) +++ trunk/plugins/conf/authz 2007-05-23 15:30:36 UTC (rev 416) @@ -0,0 +1,21 @@ +### This file is an example authorization file for svnserve. +### Its format is identical to that of mod_authz_svn authorization +### files. +### As shown below each section defines authorizations for the path and +### (optional) repository specified by the section name. +### The authorizations follow. An authorization line can refer to a +### single user, to a group of users defined in a special [groups] +### section, or to anyone using the '*' wildcard. Each definition can +### grant read ('r') access, read-write ('rw') access, or no access +### (''). + +[groups] +# harry_and_sally = harry,sally + +# [/foo/bar] +# harry = rw +# * = + +# [repository:/baz/fuz] +# @harry_and_sally = rw +# * = r Added: trunk/plugins/conf/passwd =================================================================== --- trunk/plugins/conf/passwd (rev 0) +++ trunk/plugins/conf/passwd 2007-05-23 15:30:36 UTC (rev 416) @@ -0,0 +1,8 @@ +### This file is an example password file for svnserve. +### Its format is similar to that of svnserve.conf. As shown in the +### example below it contains one section labelled [users]. +### The name and password for each user follow, one account per line. + +[users] +# harry = harryssecret +# sally = sallyssecret Added: trunk/plugins/conf/svnserve.conf =================================================================== --- trunk/plugins/conf/svnserve.conf (rev 0) +++ trunk/plugins/conf/svnserve.conf 2007-05-23 15:30:36 UTC (rev 416) @@ -0,0 +1,30 @@ +### This file controls the configuration of the svnserve daemon, if you +### use it to allow access to this repository. (If you only allow +### access through http: and/or file: URLs, then this file is +### irrelevant.) + +### Visit http://subversion.tigris.org/ for more information. + +[general] +### These options control access to the repository for unauthenticated +### and authenticated users. Valid values are "write", "read", +### and "none". The sample settings below are the defaults. +# anon-access = read +# auth-access = write +### The password-db option controls the location of the password +### database file. Unless you specify a path starting with a /, +### the file's location is relative to the conf directory. +### Uncomment the line below to use the default password file. +# password-db = passwd +### The authz-db option controls the location of the authorization +### rules for path-based access control. Unless you specify a path +### starting with a /, the file's location is relative to the conf +### directory. If you don't specify an authz-db, no path-based access +### control is done. +### Uncomment the line below to use the default authorization file. +# authz-db = authz +### This option specifies the authentication realm of the repository. +### If two repositories have the same authentication realm, they should +### have the same password database, and vice versa. The default realm +### is repository's uuid. +# realm = My First Repository Added: trunk/plugins/db/current =================================================================== --- trunk/plugins/db/current (rev 0) +++ trunk/plugins/db/current 2007-05-23 15:30:36 UTC (rev 416) @@ -0,0 +1 @@ +0 1 1 Added: trunk/plugins/db/format =================================================================== --- trunk/plugins/db/format (rev 0) +++ trunk/plugins/db/format 2007-05-23 15:30:36 UTC (rev 416) @@ -0,0 +1 @@ +2 Added: trunk/plugins/db/fs-type =================================================================== --- trunk/plugins/db/fs-type (rev 0) +++ trunk/plugins/db/fs-type 2007-05-23 15:30:36 UTC (rev 416) @@ -0,0 +1 @@ +fsfs Added: trunk/plugins/db/revprops/0 =================================================================== --- trunk/plugins/db/revprops/0 (rev 0) +++ trunk/plugins/db/revprops/0 2007-05-23 15:30:36 UTC (rev 416) @@ -0,0 +1,5 @@ +K 8 +svn:date +V 27 +2007-05-23T15:29:51.468750Z +END Added: trunk/plugins/db/revs/0 =================================================================== --- trunk/plugins/db/revs/0 (rev 0) +++ trunk/plugins/db/revs/0 2007-05-23 15:30:36 UTC (rev 416) @@ -0,0 +1,11 @@ +PLAIN +END +ENDREP +id: 0.0.r0/17 +type: dir +count: 0 +text: 0 0 4 4 2d2977d1c96f487abe4a1e202dd03b4e +cpath: / + + +17 107 Added: trunk/plugins/db/uuid =================================================================== --- trunk/plugins/db/uuid (rev 0) +++ trunk/plugins/db/uuid 2007-05-23 15:30:36 UTC (rev 416) @@ -0,0 +1 @@ +6c8b92d6-5249-d34a-a8da-dab726210609 Added: trunk/plugins/db/write-lock =================================================================== Added: trunk/plugins/format =================================================================== --- trunk/plugins/format (rev 0) +++ trunk/plugins/format 2007-05-23 15:30:36 UTC (rev 416) @@ -0,0 +1 @@ +5 Added: trunk/plugins/hooks/post-commit.tmpl =================================================================== --- trunk/plugins/hooks/post-commit.tmpl (rev 0) +++ trunk/plugins/hooks/post-commit.tmpl 2007-05-23 15:30:36 UTC (rev 416) @@ -0,0 +1,51 @@ +#!/bin/sh + +# POST-COMMIT HOOK +# +# The post-commit hook is invoked after a commit. Subversion runs +# this hook by invoking a program (script, executable, binary, etc.) +# named 'post-commit' (for which this file is a template) with the +# following ordered arguments: +# +# [1] REPOS-PATH (the path to this repository) +# [2] REV (the number of the revision just committed) +# +# The default working directory for the invocation is undefined, so +# the program should set one explicitly if it cares. +# +# Because the commit has already completed and cannot be undone, +# the exit code of the hook program is ignored. The hook program +# can use the 'svnlook' utility to help it examine the +# newly-committed tree. +# +# On a Unix system, the normal procedure is to have 'post-commit' +# invoke other programs to do the real work, though it may do the +# work itself too. +# +# Note that 'post-commit' must be executable by the user(s) who will +# invoke it (typically the user httpd runs as), and that user must +# have filesystem-level permission to access the repository. +# +# On a Windows system, you should name the hook program +# 'post-commit.bat' or 'post-commit.exe', +# but the basic idea is the same. +# +# The hook program typically does not inherit the environment of +# its parent process. For example, a common problem is for the +# PATH environment variable to not be set to its usual value, so +# that subprograms fail to launch unless invoked via absolute path. +# If you're having unexpected problems with a hook program, the +# culprit may be unusual (or missing) environment variables. +# +# Here is an example hook script, for a Unix /bin/sh interpreter. +# For more examples and pre-written hooks, see those in +# the Subversion repository at +# http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/ and +# http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/ + + +REPOS="$1" +REV="$2" + +commit-email.pl "$REPOS" "$REV" com...@ex... +log-commit.py --repository "$REPOS" --revision "$REV" Added: trunk/plugins/hooks/post-lock.tmpl =================================================================== --- trunk/plugins/hooks/post-lock.tmpl (rev 0) +++ trunk/plugins/hooks/post-lock.tmpl 2007-05-23 15:30:36 UTC (rev 416) @@ -0,0 +1,44 @@ +#!/bin/sh + +# POST-LOCK HOOK +# +# The post-lock hook is run after a path is locked. Subversion runs +# this hook by invoking a program (script, executable, binary, etc.) +# named 'post-lock' (for which this file is a template) with the +# following ordered arguments: +# +# [1] REPOS-PATH (the path to this repository) +# [2] USER (the user who created the lock) +# +# The paths that were just locked are passed to the hook via STDIN (as +# of Subversion 1.2, only one path is passed per invocation, but the +# plan is to pass all locked paths at once, so the hook program +# should be written accordingly). +# +# The default working directory for the invocation is undefined, so +# the program should set one explicitly if it cares. +# +# Because the lock has already been created and cannot be undone, +# the exit code of the hook program is ignored. The hook program +# can use the 'svnlook' utility to help it examine the +# newly-created lock. +# +# On a Unix system, the normal procedure is to have 'post-lock' +# invoke other programs to do the real work, though it may do the +# work itself too. +# +# Note that 'post-lock' must be executable by the user(s) who will +# invoke it (typically the user httpd runs as), and that user must +# have filesystem-level permission to access the repository. +# +# On a Windows system, you should name the hook program +# 'post-lock.bat' or 'post-lock.exe', +# but the basic idea is the same. +# +# Here is an example hook script, for a Unix /bin/sh interpreter: + +REPOS="$1" +USER="$2" + +# Send email to interested parties, let them know a lock was created: +mailer.py lock "$REPOS" "$USER" /path/to/mailer.conf Added: trunk/plugins/hooks/post-revprop-change.tmpl =================================================================== --- trunk/plugins/hooks/post-revprop-change.tmpl (rev 0) +++ trunk/plugins/hooks/post-revprop-change.tmpl 2007-05-23 15:30:36 UTC (rev 416) @@ -0,0 +1,56 @@ +#!/bin/sh + +# POST-REVPROP-CHANGE HOOK +# +# The post-revprop-change hook is invoked after a revision property +# has been added, modified or deleted. Subversion runs this hook by +# invoking a program (script, executable, binary, etc.) named +# 'post-revprop-change' (for which this file is a template), with the +# following ordered arguments: +# +# [1] REPOS-PATH (the path to this repository) +# [2] REV (the revision that was tweaked) +# [3] USER (the username of the person tweaking the property) +# [4] PROPNAME (the property that was changed) +# [5] ACTION (the property was 'A'dded, 'M'odified, or 'D'eleted) +# +# [STDIN] PROPVAL ** the old property value is passed via STDIN. +# +# Because the propchange has already completed and cannot be undone, +# the exit code of the hook program is ignored. The hook program +# can use the 'svnlook' utility to help it examine the +# new property value. +# +# On a Unix system, the normal procedure is to have 'post-revprop-change' +# invoke other programs to do the real work, though it may do the +# work itself too. +# +# Note that 'post-revprop-change' must be executable by the user(s) who will +# invoke it (typically the user httpd runs as), and that user must +# have filesystem-level permission to access the repository. +# +# On a Windows system, you should name the hook program +# 'post-revprop-change.bat' or 'post-revprop-change.exe', +# but the basic idea is the same. +# +# The hook program typically does not inherit the environment of +# its parent process. For example, a common problem is for the +# PATH environment variable to not be set to its usual value, so +# that subprograms fail to launch unless invoked via absolute path. +# If you're having unexpected problems with a hook program, the +# culprit may be unusual (or missing) environment variables. +# +# Here is an example hook script, for a Unix /bin/sh interpreter. +# For more examples and pre-written hooks, see those in +# the Subversion repository at +# http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/ and +# http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/ + + +REPOS="$1" +REV="$2" +USER="$3" +PROPNAME="$4" +ACTION="$5" + +propchange-email.pl "$REPOS" "$REV" "$USER" "$PROPNAME" wat...@ex... Added: trunk/plugins/hooks/post-unlock.tmpl =================================================================== --- trunk/plugins/hooks/post-unlock.tmpl (rev 0) +++ trunk/plugins/hooks/post-unlock.tmpl 2007-05-23 15:30:36 UTC (rev 416) @@ -0,0 +1,42 @@ +#!/bin/sh + +# POST-UNLOCK HOOK +# +# The post-unlock hook runs after a path is unlocked. Subversion runs +# this hook by invoking a program (script, executable, binary, etc.) +# named 'post-unlock' (for which this file is a template) with the +# following ordered arguments: +# +# [1] REPOS-PATH (the path to this repository) +# [2] USER (the user who destroyed the lock) +# +# The paths that were just unlocked are passed to the hook via STDIN +# (as of Subversion 1.2, only one path is passed per invocation, but +# the plan is to pass all unlocked paths at once, so the hook program +# should be written accordingly). +# +# The default working directory for the invocation is undefined, so +# the program should set one explicitly if it cares. +# +# Because the lock has already been destroyed and cannot be undone, +# the exit code of the hook program is ignored. +# +# On a Unix system, the normal procedure is to have 'post-unlock' +# invoke other programs to do the real work, though it may do the +# work itself too. +# +# Note that 'post-unlock' must be executable by the user(s) who will +# invoke it (typically the user httpd runs as), and that user must +# have filesystem-level permission to access the repository. +# +# On a Windows system, you should name the hook program +# 'post-unlock.bat' or 'post-unlock.exe', +# but the basic idea is the same. +# +# Here is an example hook script, for a Unix /bin/sh interpreter: + +REPOS="$1" +USER="$2" + +# Send email to interested parties, let them know a lock was removed: +mailer.py unlock "$REPOS" "$USER" /path/to/mailer.conf Added: trunk/plugins/hooks/pre-commit.tmpl =================================================================== --- trunk/plugins/hooks/pre-commit.tmpl (rev 0) +++ trunk/plugins/hooks/pre-commit.tmpl 2007-05-23 15:30:36 UTC (rev 416) @@ -0,0 +1,70 @@ +#!/bin/sh + +# PRE-COMMIT HOOK +# +# The pre-commit hook is invoked before a Subversion txn is +# committed. Subversion runs this hook by invoking a program +# (script, executable, binary, etc.) named 'pre-commit' (for which +# this file is a template), with the following ordered arguments: +# +# [1] REPOS-PATH (the path to this repository) +# [2] TXN-NAME (the name of the txn about to be committed) +# +# The default working directory for the invocation is undefined, so +# the program should set one explicitly if it cares. +# +# If the hook program exits with success, the txn is committed; but +# if it exits with failure (non-zero), the txn is aborted, no commit +# takes place, and STDERR is returned to the client. The hook +# program can use the 'svnlook' utility to help it examine the txn. +# +# On a Unix system, the normal procedure is to have 'pre-commit' +# invoke other programs to do the real work, though it may do the +# work itself too. +# +# *** NOTE: THE HOOK PROGRAM MUST NOT MODIFY THE TXN, EXCEPT *** +# *** FOR REVISION PROPERTIES (like svn:log or svn:author). *** +# +# This is why we recommend using the read-only 'svnlook' utility. +# In the future, Subversion may enforce the rule that pre-commit +# hooks should not modify the versioned data in txns, or else come +# up with a mechanism to make it safe to do so (by informing the +# committing client of the changes). However, right now neither +# mechanism is implemented, so hook writers just have to be careful. +# +# Note that 'pre-commit' must be executable by the user(s) who will +# invoke it (typically the user httpd runs as), and that user must +# have filesystem-level permission to access the repository. +# +# On a Windows system, you should name the hook program +# 'pre-commit.bat' or 'pre-commit.exe', +# but the basic idea is the same. +# +# The hook program typically does not inherit the environment of +# its parent process. For example, a common problem is for the +# PATH environment variable to not be set to its usual value, so +# that subprograms fail to launch unless invoked via absolute path. +# If you're having unexpected problems with a hook program, the +# culprit may be unusual (or missing) environment variables. +# +# Here is an example hook script, for a Unix /bin/sh interpreter. +# For more examples and pre-written hooks, see those in +# the Subversion repository at +# http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/ and +# http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/ + + +REPOS="$1" +TXN="$2" + +# Make sure that the log message contains some text. +SVNLOOK=/usr/local/bin/svnlook +$SVNLOOK log -t "$TXN" "$REPOS" | \ + grep "[a-zA-Z0-9]" > /dev/null || exit 1 + +# Check that the author of this commit has the rights to perform +# the commit on the files and directories being modified. +commit-access-control.pl "$REPOS" "$TXN" commit-access-control.cfg || exit 1 + +# All checks passed, so allow the commit. +exit 0 Added: trunk/plugins/hooks/pre-lock.tmpl =================================================================== --- trunk/plugins/hooks/pre-lock.tmpl (rev 0) +++ trunk/plugins/hooks/pre-lock.tmpl 2007-05-23 15:30:36 UTC (rev 416) @@ -0,0 +1,64 @@ +#!/bin/sh + +# PRE-LOCK HOOK +# +# The pre-lock hook is invoked before an exclusive lock is +# created. Subversion runs this hook by invoking a program +# (script, executable, binary, etc.) named 'pre-lock' (for which +# this file is a template), with the following ordered arguments: +# +# [1] REPOS-PATH (the path to this repository) +# [2] PATH (the path in the repository about to be locked) +# [3] USER (the user creating the lock) +# +# The default working directory for the invocation is undefined, so +# the program should set one explicitly if it cares. +# +# If the hook program exits with success, the lock is created; but +# if it exits with failure (non-zero), the lock action is aborted +# and STDERR is returned to the client. + +# On a Unix system, the normal procedure is to have 'pre-lock' +# invoke other programs to do the real work, though it may do the +# work itself too. +# +# Note that 'pre-lock' must be executable by the user(s) who will +# invoke it (typically the user httpd runs as), and that user must +# have filesystem-level permission to access the repository. +# +# On a Windows system, you should name the hook program +# 'pre-lock.bat' or 'pre-lock.exe', +# but the basic idea is the same. +# +# Here is an example hook script, for a Unix /bin/sh interpreter: + +REPOS="$1" +PATH="$2" +USER="$3" + +# If a lock exists and is owned by a different person, don't allow it +# to be stolen (e.g., with 'svn lock --force ...'). + +# (Maybe this script could send email to the lock owner?) +SVNLOOK=/usr/local/bin/svnlook +GREP=/bin/grep +SED=/bin/sed + +LOCK_OWNER=`$SVNLOOK lock "$REPOS" "$PATH" | \ + $GREP '^Owner: ' | $SED 's/Owner: //'` + +# If we get no result from svnlook, there's no lock, allow the lock to +# happen: +if [ "$LOCK_OWNER" = "" ]; then + exit 0 +fi + +# If the person locking matches the lock's owner, allow the lock to +# happen: +if [ "$LOCK_OWNER" = "$USER" ]; then + exit 0 +fi + +# Otherwise, we've got an owner mismatch, so return failure: +echo "Error: $PATH already locked by ${LOCK_OWNER}." 1>&2 +exit 1 Added: trunk/plugins/hooks/pre-revprop-change.tmpl =================================================================== --- trunk/plugins/hooks/pre-revprop-change.tmpl (rev 0) +++ trunk/plugins/hooks/pre-revprop-change.tmpl 2007-05-23 15:30:36 UTC (rev 416) @@ -0,0 +1,66 @@ +#!/bin/sh + +# PRE-REVPROP-CHANGE HOOK +# +# The pre-revprop-change hook is invoked before a revision property +# is added, modified or deleted. Subversion runs this hook by invoking +# a program (script, executable, binary, etc.) named 'pre-revprop-change' +# (for which this file is a template), with the following ordered +# arguments: +# +# [1] REPOS-PATH (the path to this repository) +# [2] REVISION (the revision being tweaked) +# [3] USER (the username of the person tweaking the property) +# [4] PROPNAME (the property being set on the revision) +# [5] ACTION (the property is being 'A'dded, 'M'odified, or 'D'eleted) +# +# [STDIN] PROPVAL ** the new property value is passed via STDIN. +# +# If the hook program exits with success, the propchange happens; but +# if it exits with failure (non-zero), the propchange doesn't happen. +# The hook program can use the 'svnlook' utility to examine the +# existing value of the revision property. +# +# WARNING: unlike other hooks, this hook MUST exist for revision +# properties to be changed. If the hook does not exist, Subversion +# will behave as if the hook were present, but failed. The reason +# for this is that revision properties are UNVERSIONED, meaning that +# a successful propchange is destructive; the old value is gone +# forever. We recommend the hook back up the old value somewhere. +# +# On a Unix system, the normal procedure is to have 'pre-revprop-change' +# invoke other programs to do the real work, though it may do the +# work itself too. +# +# Note that 'pre-revprop-change' must be executable by the user(s) who will +# invoke it (typically the user httpd runs as), and that user must +# have filesystem-level permission to access the repository. +# +# On a Windows system, you should name the hook program +# 'pre-revprop-change.bat' or 'pre-revprop-change.exe', +# but the basic idea is the same. +# +# The hook program typically does not inherit the environment of +# its parent process. For example, a common problem is for the +# PATH environment variable to not be set to its usual value, so +# that subprograms fail to launch unless invoked via absolute path. +# If you're having unexpected problems with a hook program, the +# culprit may be unusual (or missing) environment variables. +# +# Here is an example hook script, for a Unix /bin/sh interpreter. +# For more examples and pre-written hooks, see those in +# the Subversion repository at +# http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/ and +# http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/ + + +REPOS="$1" +REV="$2" +USER="$3" +PROPNAME="$4" +ACTION="$5" + +if [ "$ACTION" = "M" -a "$PROPNAME" = "svn:log" ]; then exit 0; fi + +echo "Changing revision properties other than svn:log is prohibited" >&2 +exit 1 Added: trunk/plugins/hooks/pre-unlock.tmpl =================================================================== --- trunk/plugins/hooks/pre-unlock.tmpl (rev 0) +++ trunk/plugins/hooks/pre-unlock.tmpl 2007-05-23 15:30:36 UTC (rev 416) @@ -0,0 +1,60 @@ +#!/bin/sh + +# PRE-UNLOCK HOOK +# +# The pre-unlock hook is invoked before an exclusive lock is +# destroyed. Subversion runs this hook by invoking a program +# (script, executable, binary, etc.) named 'pre-unlock' (for which +# this file is a template), with the following ordered arguments: +# +# [1] REPOS-PATH (the path to this repository) +# [2] PATH (the path in the repository about to be unlocked) +# [3] USER (the user destroying the lock) +# +# The default working directory for the invocation is undefined, so +# the program should set one explicitly if it cares. +# +# If the hook program exits with success, the lock is destroyed; but +# if it exits with failure (non-zero), the unlock action is aborted +# and STDERR is returned to the client. + +# On a Unix system, the normal procedure is to have 'pre-unlock' +# invoke other programs to do the real work, though it may do the +# work itself too. +# +# Note that 'pre-unlock' must be executable by the user(s) who will +# invoke it (typically the user httpd runs as), and that user must +# have filesystem-level permission to access the repository. +# +# On a Windows system, you should name the hook program +# 'pre-unlock.bat' or 'pre-unlock.exe', +# but the basic idea is the same. +# +# Here is an example hook script, for a Unix /bin/sh interpreter: + +REPOS="$1" +PATH="$2" +USER="$3" + +# If a lock is owned by a different person, don't allow it be broken. +# (Maybe this script could send email to the lock owner?) + +SVNLOOK=/usr/local/bin/svnlook +GREP=/bin/grep +SED=/bin/sed + +LOCK_OWNER=`$SVNLOOK lock "$REPOS" "$PATH" | \ + $GREP '^Owner: ' | $SED 's/Owner: //'` + +# If we get no result from svnlook, there's no lock, return success: +if [ "$LOCK_OWNER" = "" ]; then + exit 0 +fi +# If the person unlocking matches the lock's owner, return success: +if [ "$LOCK_OWNER" = "$USER" ]; then + exit 0 +fi + +# Otherwise, we've got an owner mismatch, so return failure: +echo "Error: $PATH locked by ${LOCK_OWNER}." 1>&2 +exit 1 Added: trunk/plugins/hooks/start-commit.tmpl =================================================================== --- trunk/plugins/hooks/start-commit.tmpl (rev 0) +++ trunk/plugins/hooks/start-commit.tmpl 2007-05-23 15:30:36 UTC (rev 416) @@ -0,0 +1,54 @@ +#!/bin/sh + +# START-COMMIT HOOK +# +# The start-commit hook is invoked before a Subversion txn is created +# in the process of doing a commit. Subversion runs this hook +# by invoking a program (script, executable, binary, etc.) named +# 'start-commit' (for which this file is a template) +# with the following ordered arguments: +# +# [1] REPOS-PATH (the path to this repository) +# [2] USER (the authenticated user attempting to commit) +# +# The default working directory for the invocation is undefined, so +# the program should set one explicitly if it cares. +# +# If the hook program exits with success, the commit continues; but +# if it exits with failure (non-zero), the commit is stopped before +# a Subversion txn is created, and STDERR is returned to the client. +# +# On a Unix system, the normal procedure is to have 'start-commit' +# invoke other programs to do the real work, though it may do the +# work itself too. +# +# Note that 'start-commit' must be executable by the user(s) who will +# invoke it (typically the user httpd runs as), and that user must +# have filesystem-level permission to access the repository. +# +# On a Windows system, you should name the hook program +# 'start-commit.bat' or 'start-commit.exe', +# but the basic idea is the same. +# +# The hook program typically does not inherit the environment of +# its parent process. For example, a common problem is for the +# PATH environment variable to not be set to its usual value, so +# that subprograms fail to launch unless invoked via absolute path. +# If you're having unexpected problems with a hook program, the +# culprit may be unusual (or missing) environment variables. +# +# Here is an example hook script, for a Unix /bin/sh interpreter. +# For more examples and pre-written hooks, see those in +# the Subversion repository at +# http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/ and +# http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/ + + +REPOS="$1" +USER="$2" + +commit-allower.pl --repository "$REPOS" --user "$USER" || exit 1 +special-auth-check.py --user "$USER" --auth-level 3 || exit 1 + +# All checks passed, so allow the commit. +exit 0 Added: trunk/plugins/locks/db-logs.lock =================================================================== --- trunk/plugins/locks/db-logs.lock (rev 0) +++ trunk/plugins/locks/db-logs.lock 2007-05-23 15:30:36 UTC (rev 416) @@ -0,0 +1,3 @@ +This file is not used by Subversion 1.3.x or later. +However, its existence is required for compatibility with +Subversion 1.2.x or earlier. Added: trunk/plugins/locks/db.lock =================================================================== --- trunk/plugins/locks/db.lock (rev 0) +++ trunk/plugins/locks/db.lock 2007-05-23 15:30:36 UTC (rev 416) @@ -0,0 +1,3 @@ +This file is not used by Subversion 1.3.x or later. +However, its existence is required for compatibility with +Subversion 1.2.x or earlier. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2007-05-23 15:44:14
|
Revision: 418 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=418&view=rev Author: saamand Date: 2007-05-23 08:44:03 -0700 (Wed, 23 May 2007) Log Message: ----------- Removed file/folder Removed Paths: ------------- trunk/plugins/conf/ trunk/plugins/dav/ trunk/plugins/db/ trunk/plugins/hooks/ trunk/plugins/locks/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sa...@us...> - 2007-05-23 15:45:02
|
Revision: 419 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=419&view=rev Author: saamand Date: 2007-05-23 08:44:40 -0700 (Wed, 23 May 2007) Log Message: ----------- Removed file/folder Removed Paths: ------------- trunk/plugins/README.txt trunk/plugins/format Deleted: trunk/plugins/README.txt =================================================================== --- trunk/plugins/README.txt 2007-05-23 15:44:03 UTC (rev 418) +++ trunk/plugins/README.txt 2007-05-23 15:44:40 UTC (rev 419) @@ -1,5 +0,0 @@ -This is a Subversion repository; use the 'svnadmin' tool to examine -it. Do not add, delete, or modify files here unless you know how -to avoid corrupting the repository. - -Visit http://subversion.tigris.org/ for more information. Deleted: trunk/plugins/format =================================================================== --- trunk/plugins/format 2007-05-23 15:44:03 UTC (rev 418) +++ trunk/plugins/format 2007-05-23 15:44:40 UTC (rev 419) @@ -1 +0,0 @@ -5 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <che...@us...> - 2007-05-24 19:27:15
|
Revision: 428 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=428&view=rev Author: chef_koch Date: 2007-05-24 12:27:07 -0700 (Thu, 24 May 2007) Log Message: ----------- folder cleanup Modified Paths: -------------- trunk/plugins/My Connect4/Source/MyConnect4.suo trunk/plugins/mypoker/mypoker.csproj trunk/plugins/mypoker/mypoker.sln trunk/plugins/mypoker/mypoker.suo Added Paths: ----------- trunk/plugins/MyClickmania/ trunk/plugins/MyExplorer/ trunk/plugins/MyRecipes/ trunk/plugins/MyStatus/ Removed Paths: ------------- trunk/plugins/My Explorer/ trunk/plugins/My Recipes/ trunk/plugins/My Status/ trunk/plugins/My clickmania/ Modified: trunk/plugins/My Connect4/Source/MyConnect4.suo =================================================================== (Binary files differ) Copied: trunk/plugins/MyClickmania (from rev 425, trunk/plugins/My clickmania) Copied: trunk/plugins/MyExplorer (from rev 425, trunk/plugins/My Explorer) Copied: trunk/plugins/MyRecipes (from rev 425, trunk/plugins/My Recipes) Copied: trunk/plugins/MyStatus (from rev 425, trunk/plugins/My Status) Modified: trunk/plugins/mypoker/mypoker.csproj =================================================================== --- trunk/plugins/mypoker/mypoker.csproj 2007-05-24 16:58:25 UTC (rev 427) +++ trunk/plugins/mypoker/mypoker.csproj 2007-05-24 19:27:07 UTC (rev 428) @@ -51,7 +51,7 @@ <ErrorReport>prompt</ErrorReport> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <OutputPath>..\mediaportal\xbmc\bin\Release\plugins\windows\</OutputPath> + <OutputPath>.\</OutputPath> <AllowUnsafeBlocks>false</AllowUnsafeBlocks> <BaseAddress>285212672</BaseAddress> <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow> @@ -76,17 +76,17 @@ <ItemGroup> <Reference Include="Core, Version=0.2.2.0, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\mediaportal\xbmc\bin\Release\Core.dll</HintPath> + <HintPath>..\..\mediaportal\xbmc\bin\Release\Core.dll</HintPath> <Private>False</Private> </Reference> <Reference Include="Databases, Version=0.2.2.0, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\mediaportal\xbmc\bin\Release\Databases.dll</HintPath> + <HintPath>..\..\mediaportal\xbmc\bin\Release\Databases.dll</HintPath> <Private>False</Private> </Reference> <Reference Include="Dialogs, Version=0.0.0.0, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\mediaportal\xbmc\bin\Release\plugins\windows\Dialogs.dll</HintPath> + <HintPath>..\..\mediaportal\xbmc\bin\Release\plugins\Windows\Dialogs.dll</HintPath> <Private>False</Private> </Reference> <Reference Include="System"> @@ -103,7 +103,7 @@ </Reference> <Reference Include="Utils, Version=2.1.2.0, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\mediaportal\xbmc\bin\Release\Utils.dll</HintPath> + <HintPath>..\..\mediaportal\xbmc\bin\Release\Utils.dll</HintPath> <Private>False</Private> </Reference> </ItemGroup> Modified: trunk/plugins/mypoker/mypoker.sln =================================================================== --- trunk/plugins/mypoker/mypoker.sln 2007-05-24 16:58:25 UTC (rev 427) +++ trunk/plugins/mypoker/mypoker.sln 2007-05-24 19:27:07 UTC (rev 428) @@ -1,5 +1,5 @@ Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual C# Express 2005 +# Visual Studio 2005 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "mypoker", "mypoker.csproj", "{5527BB4D-C0E1-4F42-B1F7-9E68E411AD4D}" EndProject Global Modified: trunk/plugins/mypoker/mypoker.suo =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |