diff options
Diffstat (limited to 'win/CS/frmPreview.cs')
-rw-r--r-- | win/CS/frmPreview.cs | 64 |
1 files changed, 41 insertions, 23 deletions
diff --git a/win/CS/frmPreview.cs b/win/CS/frmPreview.cs index 96404e6f2..5572cda23 100644 --- a/win/CS/frmPreview.cs +++ b/win/CS/frmPreview.cs @@ -77,6 +77,8 @@ namespace Handbrake encodeQueue.EncodeStarted += this.EncodeQueueEncodeStarted;
encodeQueue.EncodeCompleted += this.EncodeQueueEncodeEnded;
+
+ defaultPlayer.Checked = Properties.Settings.Default.defaultPlayer;
}
#region Event Handlers
@@ -154,6 +156,12 @@ namespace Handbrake lbl_progress.Text = e.PercentComplete + "%";
progressBar.Value = (int)Math.Round(e.PercentComplete);
}
+
+ private void DefaultPlayerCheckedChanged(object sender, EventArgs e)
+ {
+ Properties.Settings.Default.defaultPlayer = defaultPlayer.Checked;
+ Properties.Settings.Default.Save();
+ }
#endregion
#region Encode Sample
@@ -219,37 +227,47 @@ namespace Handbrake {
if (File.Exists(this.currentlyPlaying))
{
- // Attempt to find VLC if it doesn't exist in the default set location.
- string vlcPath;
+ string args = "\"" + this.currentlyPlaying + "\"";
- if (8 == IntPtr.Size ||
- (!String.IsNullOrEmpty(Environment.GetEnvironmentVariable("PROCESSOR_ARCHITEW6432"))))
- vlcPath = Environment.GetEnvironmentVariable("ProgramFiles(x86)");
+ if (defaultPlayer.Checked)
+ {
+ Process.Start(args);
+ }
else
- vlcPath = Environment.GetEnvironmentVariable("ProgramFiles");
-
-
- if (!File.Exists(Properties.Settings.Default.VLC_Path))
{
- if (File.Exists(vlcPath))
+
+ // Attempt to find VLC if it doesn't exist in the default set location.
+ string vlcPath;
+
+ if (8 == IntPtr.Size ||
+ (!String.IsNullOrEmpty(Environment.GetEnvironmentVariable("PROCESSOR_ARCHITEW6432")))) vlcPath = Environment.GetEnvironmentVariable("ProgramFiles(x86)");
+ else vlcPath = Environment.GetEnvironmentVariable("ProgramFiles");
+
+
+ if (!File.Exists(Properties.Settings.Default.VLC_Path))
{
- Properties.Settings.Default.VLC_Path = "C:\\Program Files (x86)\\VideoLAN\\VLC\\vlc.exe";
- Properties.Settings.Default.Save(); // Save this new path if it does
+ if (File.Exists(vlcPath))
+ {
+ Properties.Settings.Default.VLC_Path = "C:\\Program Files (x86)\\VideoLAN\\VLC\\vlc.exe";
+ Properties.Settings.Default.Save(); // Save this new path if it does
+ }
+ else
+ {
+ MessageBox.Show(
+ this,
+ "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\") ",
+ "VLC",
+ MessageBoxButtons.OK,
+ MessageBoxIcon.Warning);
+ }
}
- else
+
+ if (File.Exists(Properties.Settings.Default.VLC_Path))
{
- MessageBox.Show(this,
- "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\") ",
- "VLC", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+ ProcessStartInfo vlc = new ProcessStartInfo(Properties.Settings.Default.VLC_Path, args);
+ Process.Start(vlc);
}
}
-
- if (File.Exists(Properties.Settings.Default.VLC_Path))
- {
- string args = "\"" + this.currentlyPlaying + "\"";
- ProcessStartInfo vlc = new ProcessStartInfo(Properties.Settings.Default.VLC_Path, args);
- Process.Start(vlc);
- }
}
else
MessageBox.Show(this,
|