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] |