this.progressBar = new System.Windows.Forms.ProgressBar();\r
this.lbl_progress = new System.Windows.Forms.Label();\r
this.btn_play = new System.Windows.Forms.Button();\r
+ this.defaultPlayer = new System.Windows.Forms.CheckBox();\r
this.SuspendLayout();\r
// \r
// startPoint\r
this.btn_play.UseVisualStyleBackColor = true;\r
this.btn_play.Click += new System.EventHandler(this.btn_play_Click);\r
// \r
+ // defaultPlayer\r
+ // \r
+ this.defaultPlayer.AutoSize = true;\r
+ this.defaultPlayer.Location = new System.Drawing.Point(12, 62);\r
+ this.defaultPlayer.Name = "defaultPlayer";\r
+ this.defaultPlayer.Size = new System.Drawing.Size(151, 17);\r
+ this.defaultPlayer.TabIndex = 45;\r
+ this.defaultPlayer.Text = "Use system default player";\r
+ this.defaultPlayer.UseVisualStyleBackColor = true;\r
+ this.defaultPlayer.CheckedChanged += new System.EventHandler(this.DefaultPlayerCheckedChanged);\r
+ // \r
// frmPreview\r
// \r
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\r
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\r
this.ClientSize = new System.Drawing.Size(369, 91);\r
+ this.Controls.Add(this.defaultPlayer);\r
this.Controls.Add(this.btn_play);\r
this.Controls.Add(this.lbl_progress);\r
this.Controls.Add(this.progressBar);\r
private System.Windows.Forms.ProgressBar progressBar;\r
private System.Windows.Forms.Label lbl_progress;\r
private System.Windows.Forms.Button btn_play;\r
+ private System.Windows.Forms.CheckBox defaultPlayer;\r
\r
}\r
}
\ No newline at end of file
\r
encodeQueue.EncodeStarted += this.EncodeQueueEncodeStarted;\r
encodeQueue.EncodeCompleted += this.EncodeQueueEncodeEnded;\r
+\r
+ defaultPlayer.Checked = Properties.Settings.Default.defaultPlayer;\r
}\r
\r
#region Event Handlers\r
lbl_progress.Text = e.PercentComplete + "%";\r
progressBar.Value = (int)Math.Round(e.PercentComplete);\r
}\r
+\r
+ private void DefaultPlayerCheckedChanged(object sender, EventArgs e)\r
+ {\r
+ Properties.Settings.Default.defaultPlayer = defaultPlayer.Checked;\r
+ Properties.Settings.Default.Save();\r
+ }\r
#endregion\r
\r
#region Encode Sample\r
{\r
if (File.Exists(this.currentlyPlaying))\r
{\r
- // Attempt to find VLC if it doesn't exist in the default set location.\r
- string vlcPath;\r
+ string args = "\"" + this.currentlyPlaying + "\"";\r
\r
- if (8 == IntPtr.Size ||\r
- (!String.IsNullOrEmpty(Environment.GetEnvironmentVariable("PROCESSOR_ARCHITEW6432"))))\r
- vlcPath = Environment.GetEnvironmentVariable("ProgramFiles(x86)");\r
+ if (defaultPlayer.Checked)\r
+ {\r
+ Process.Start(args);\r
+ }\r
else\r
- vlcPath = Environment.GetEnvironmentVariable("ProgramFiles");\r
-\r
- \r
- if (!File.Exists(Properties.Settings.Default.VLC_Path))\r
{\r
- if (File.Exists(vlcPath))\r
+\r
+ // Attempt to find VLC if it doesn't exist in the default set location.\r
+ string vlcPath;\r
+\r
+ if (8 == IntPtr.Size ||\r
+ (!String.IsNullOrEmpty(Environment.GetEnvironmentVariable("PROCESSOR_ARCHITEW6432")))) vlcPath = Environment.GetEnvironmentVariable("ProgramFiles(x86)");\r
+ else vlcPath = Environment.GetEnvironmentVariable("ProgramFiles");\r
+\r
+\r
+ if (!File.Exists(Properties.Settings.Default.VLC_Path))\r
{\r
- Properties.Settings.Default.VLC_Path = "C:\\Program Files (x86)\\VideoLAN\\VLC\\vlc.exe";\r
- Properties.Settings.Default.Save(); // Save this new path if it does\r
+ if (File.Exists(vlcPath))\r
+ {\r
+ Properties.Settings.Default.VLC_Path = "C:\\Program Files (x86)\\VideoLAN\\VLC\\vlc.exe";\r
+ Properties.Settings.Default.Save(); // Save this new path if it does\r
+ }\r
+ else\r
+ {\r
+ MessageBox.Show(\r
+ this,\r
+ "Unable to detect VLC Player. \nPlease make sure VLC is installed and the directory specified in HandBrake's options is correct. (See: \"Tools Menu > Options > Picture Tab\") ",\r
+ "VLC",\r
+ MessageBoxButtons.OK,\r
+ MessageBoxIcon.Warning);\r
+ }\r
}\r
- else\r
+\r
+ if (File.Exists(Properties.Settings.Default.VLC_Path))\r
{\r
- MessageBox.Show(this,\r
- "Unable to detect VLC Player. \nPlease make sure VLC is installed and the directory specified in HandBrake's options is correct. (See: \"Tools Menu > Options > Picture Tab\") ",\r
- "VLC", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
+ ProcessStartInfo vlc = new ProcessStartInfo(Properties.Settings.Default.VLC_Path, args);\r
+ Process.Start(vlc);\r
}\r
}\r
-\r
- if (File.Exists(Properties.Settings.Default.VLC_Path))\r
- {\r
- string args = "\"" + this.currentlyPlaying + "\"";\r
- ProcessStartInfo vlc = new ProcessStartInfo(Properties.Settings.Default.VLC_Path, args);\r
- Process.Start(vlc);\r
- }\r
}\r
else\r
MessageBox.Show(this,\r