summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorsr55 <[email protected]>2010-05-19 20:13:53 +0000
committersr55 <[email protected]>2010-05-19 20:13:53 +0000
commitf6b620012c27bc2858ea0ad198bd3edf34965ca3 (patch)
tree558aa1a7dfecb8ed69bca9e59ef1c93897ea9d8b /win
parent7fda78b54bdc920653ca3d9d2da0be56712c0a77 (diff)
WinGui:
- In-Gui encode status is now own by default. - Added a progress bar and tidied up the appearance of the status text. - Tweaked the preview window design. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3307 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win')
-rw-r--r--win/C#/Properties/Settings.Designer.cs4
-rw-r--r--win/C#/Properties/Settings.settings4
-rw-r--r--win/C#/app.config4
-rw-r--r--win/C#/frmMain.Designer.cs139
-rw-r--r--win/C#/frmMain.cs23
-rw-r--r--win/C#/frmPreview.Designer.cs18
-rw-r--r--win/C#/frmPreview.cs35
7 files changed, 111 insertions, 116 deletions
diff --git a/win/C#/Properties/Settings.Designer.cs b/win/C#/Properties/Settings.Designer.cs
index 2833adc56..32232208e 100644
--- a/win/C#/Properties/Settings.Designer.cs
+++ b/win/C#/Properties/Settings.Designer.cs
@@ -313,7 +313,7 @@ namespace Handbrake.Properties {
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("False")]
+ [global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool enocdeStatusInGui {
get {
return ((bool)(this["enocdeStatusInGui"]));
@@ -491,7 +491,7 @@ namespace Handbrake.Properties {
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("True")]
+ [global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool showCliForInGuiEncodeStatus {
get {
return ((bool)(this["showCliForInGuiEncodeStatus"]));
diff --git a/win/C#/Properties/Settings.settings b/win/C#/Properties/Settings.settings
index 7fa5698e2..e6f6778f2 100644
--- a/win/C#/Properties/Settings.settings
+++ b/win/C#/Properties/Settings.settings
@@ -75,7 +75,7 @@
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="enocdeStatusInGui" Type="System.Boolean" Scope="User">
- <Value Profile="(Default)">False</Value>
+ <Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="trayIconAlerts" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
@@ -120,7 +120,7 @@
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="showCliForInGuiEncodeStatus" Type="System.Boolean" Scope="User">
- <Value Profile="(Default)">True</Value>
+ <Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="AutoNameTitleCase" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
diff --git a/win/C#/app.config b/win/C#/app.config
index 66908a1b5..b2fa2f2ce 100644
--- a/win/C#/app.config
+++ b/win/C#/app.config
@@ -81,7 +81,7 @@
<value>False</value>
</setting>
<setting name="enocdeStatusInGui" serializeAs="String">
- <value>False</value>
+ <value>True</value>
</setting>
<setting name="trayIconAlerts" serializeAs="String">
<value>True</value>
@@ -126,7 +126,7 @@
<value>False</value>
</setting>
<setting name="showCliForInGuiEncodeStatus" serializeAs="String">
- <value>True</value>
+ <value>False</value>
</setting>
<setting name="AutoNameTitleCase" serializeAs="String">
<value>False</value>
diff --git a/win/C#/frmMain.Designer.cs b/win/C#/frmMain.Designer.cs
index 50d850eeb..69ae88415 100644
--- a/win/C#/frmMain.Designer.cs
+++ b/win/C#/frmMain.Designer.cs
@@ -39,7 +39,7 @@ namespace Handbrake
this.components = new System.ComponentModel.Container();
System.Windows.Forms.ContextMenuStrip notifyIconMenu;
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmMain));
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
this.btn_restore = new System.Windows.Forms.ToolStripMenuItem();
this.DVD_Save = new System.Windows.Forms.SaveFileDialog();
this.ToolTip = new System.Windows.Forms.ToolTip(this.components);
@@ -87,6 +87,7 @@ namespace Handbrake
this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator();
this.btn_new_preset = new System.Windows.Forms.ToolStripMenuItem();
this.mnu_importMacPreset = new System.Windows.Forms.ToolStripMenuItem();
+ this.mnu_exportMacPreset = new System.Windows.Forms.ToolStripMenuItem();
this.mnu_SelectDefault = new System.Windows.Forms.ToolStripMenuItem();
this.HelpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.mnu_user_guide = new System.Windows.Forms.ToolStripMenuItem();
@@ -99,7 +100,6 @@ namespace Handbrake
this.Label47 = new System.Windows.Forms.Label();
this.Label3 = new System.Windows.Forms.Label();
this.tab_audio = new System.Windows.Forms.TabPage();
- this.AudioSettings = new Handbrake.Controls.AudioPanel();
this.AudioMenuRowHeightHack = new System.Windows.Forms.ImageList(this.components);
this.tab_video = new System.Windows.Forms.TabPage();
this.radio_cq = new System.Windows.Forms.RadioButton();
@@ -111,17 +111,13 @@ namespace Handbrake
this.lbl_SliderValue = new System.Windows.Forms.Label();
this.Label46 = new System.Windows.Forms.Label();
this.tab_picture = new System.Windows.Forms.TabPage();
- this.PictureSettings = new Handbrake.Controls.PictureSettings();
this.Check_ChapterMarkers = new System.Windows.Forms.CheckBox();
this.tabs_panel = new System.Windows.Forms.TabControl();
this.tab_filters = new System.Windows.Forms.TabPage();
- this.Filters = new Handbrake.Controls.Filters();
this.tab_subtitles = new System.Windows.Forms.TabPage();
- this.Subtitles = new Handbrake.Controls.Subtitles();
this.tab_chapters = new System.Windows.Forms.TabPage();
this.label31 = new System.Windows.Forms.Label();
this.tab_advanced = new System.Windows.Forms.TabPage();
- this.x264Panel = new Handbrake.Controls.x264Panel();
this.tab_query = new System.Windows.Forms.TabPage();
this.btn_clear = new System.Windows.Forms.Button();
this.label34 = new System.Windows.Forms.Label();
@@ -173,7 +169,12 @@ namespace Handbrake
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.openPreset = new System.Windows.Forms.OpenFileDialog();
this.File_ChapterImport = new System.Windows.Forms.OpenFileDialog();
- this.mnu_exportMacPreset = new System.Windows.Forms.ToolStripMenuItem();
+ this.ProgressBarStatus = new System.Windows.Forms.ToolStripProgressBar();
+ this.PictureSettings = new Handbrake.Controls.PictureSettings();
+ this.Filters = new Handbrake.Controls.Filters();
+ this.AudioSettings = new Handbrake.Controls.AudioPanel();
+ this.Subtitles = new Handbrake.Controls.Subtitles();
+ this.x264Panel = new Handbrake.Controls.x264Panel();
notifyIconMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
notifyIconMenu.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.slider_videoQuality)).BeginInit();
@@ -401,9 +402,9 @@ namespace Handbrake
//
// number
//
- dataGridViewCellStyle2.Format = "N0";
- dataGridViewCellStyle2.NullValue = null;
- this.number.DefaultCellStyle = dataGridViewCellStyle2;
+ dataGridViewCellStyle1.Format = "N0";
+ dataGridViewCellStyle1.NullValue = null;
+ this.number.DefaultCellStyle = dataGridViewCellStyle1;
this.number.Frozen = true;
this.number.HeaderText = "Chapter Number";
this.number.MaxInputLength = 3;
@@ -703,6 +704,13 @@ namespace Handbrake
this.mnu_importMacPreset.Text = "Import";
this.mnu_importMacPreset.Click += new System.EventHandler(this.mnu_importMacPreset_Click);
//
+ // mnu_exportMacPreset
+ //
+ this.mnu_exportMacPreset.Name = "mnu_exportMacPreset";
+ this.mnu_exportMacPreset.Size = new System.Drawing.Size(194, 22);
+ this.mnu_exportMacPreset.Text = "Export";
+ this.mnu_exportMacPreset.Click += new System.EventHandler(this.mnu_exportMacPreset_Click);
+ //
// mnu_SelectDefault
//
this.mnu_SelectDefault.Name = "mnu_SelectDefault";
@@ -815,15 +823,6 @@ namespace Handbrake
this.tab_audio.Text = "Audio";
this.tab_audio.UseVisualStyleBackColor = true;
//
- // AudioSettings
- //
- this.AudioSettings.BackColor = System.Drawing.Color.Transparent;
- this.AudioSettings.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.AudioSettings.Location = new System.Drawing.Point(0, 0);
- this.AudioSettings.Name = "AudioSettings";
- this.AudioSettings.Size = new System.Drawing.Size(715, 310);
- this.AudioSettings.TabIndex = 0;
- //
// AudioMenuRowHeightHack
//
this.AudioMenuRowHeightHack.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
@@ -961,18 +960,6 @@ namespace Handbrake
this.tab_picture.Text = "Picture";
this.tab_picture.UseVisualStyleBackColor = true;
//
- // PictureSettings
- //
- this.PictureSettings.BackColor = System.Drawing.Color.Transparent;
- this.PictureSettings.CurrentlySelectedPreset = null;
- this.PictureSettings.Enabled = false;
- this.PictureSettings.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.PictureSettings.Location = new System.Drawing.Point(0, 0);
- this.PictureSettings.Name = "PictureSettings";
- this.PictureSettings.PresetMaximumResolution = new System.Drawing.Size(0, 0);
- this.PictureSettings.Size = new System.Drawing.Size(666, 279);
- this.PictureSettings.TabIndex = 0;
- //
// Check_ChapterMarkers
//
this.Check_ChapterMarkers.AutoSize = true;
@@ -1012,15 +999,6 @@ namespace Handbrake
this.tab_filters.Text = "Video Filters";
this.tab_filters.UseVisualStyleBackColor = true;
//
- // Filters
- //
- this.Filters.BackColor = System.Drawing.Color.Transparent;
- this.Filters.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.Filters.Location = new System.Drawing.Point(0, 0);
- this.Filters.Name = "Filters";
- this.Filters.Size = new System.Drawing.Size(713, 310);
- this.Filters.TabIndex = 0;
- //
// tab_subtitles
//
this.tab_subtitles.Controls.Add(this.Subtitles);
@@ -1032,15 +1010,6 @@ namespace Handbrake
this.tab_subtitles.Text = "Subtitles";
this.tab_subtitles.UseVisualStyleBackColor = true;
//
- // Subtitles
- //
- this.Subtitles.BackColor = System.Drawing.Color.Transparent;
- this.Subtitles.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.Subtitles.Location = new System.Drawing.Point(0, 0);
- this.Subtitles.Name = "Subtitles";
- this.Subtitles.Size = new System.Drawing.Size(722, 310);
- this.Subtitles.TabIndex = 0;
- //
// tab_chapters
//
this.tab_chapters.BackColor = System.Drawing.Color.Transparent;
@@ -1079,16 +1048,6 @@ namespace Handbrake
this.tab_advanced.Text = "Advanced";
this.tab_advanced.UseVisualStyleBackColor = true;
//
- // x264Panel
- //
- this.x264Panel.BackColor = System.Drawing.Color.Transparent;
- this.x264Panel.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.x264Panel.Location = new System.Drawing.Point(0, 0);
- this.x264Panel.Name = "x264Panel";
- this.x264Panel.Size = new System.Drawing.Size(720, 306);
- this.x264Panel.TabIndex = 0;
- this.x264Panel.X264Query = "";
- //
// tab_query
//
this.tab_query.Controls.Add(this.btn_clear);
@@ -1405,10 +1364,12 @@ namespace Handbrake
// StatusStrip
//
this.StatusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.ProgressBarStatus,
this.lbl_encode,
this.lbl_updateCheck});
this.StatusStrip.Location = new System.Drawing.Point(0, 561);
this.StatusStrip.Name = "StatusStrip";
+ this.StatusStrip.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional;
this.StatusStrip.Size = new System.Drawing.Size(1002, 22);
this.StatusStrip.SizingGrip = false;
this.StatusStrip.TabIndex = 7;
@@ -1646,12 +1607,61 @@ namespace Handbrake
//
this.File_ChapterImport.Filter = "CSV Files|*.csv";
//
- // mnu_exportMacPreset
+ // ProgressBarStatus
//
- this.mnu_exportMacPreset.Name = "mnu_exportMacPreset";
- this.mnu_exportMacPreset.Size = new System.Drawing.Size(194, 22);
- this.mnu_exportMacPreset.Text = "Export";
- this.mnu_exportMacPreset.Click += new System.EventHandler(this.mnu_exportMacPreset_Click);
+ this.ProgressBarStatus.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
+ this.ProgressBarStatus.Name = "ProgressBarStatus";
+ this.ProgressBarStatus.Size = new System.Drawing.Size(100, 16);
+ this.ProgressBarStatus.Visible = false;
+ //
+ // PictureSettings
+ //
+ this.PictureSettings.BackColor = System.Drawing.Color.Transparent;
+ this.PictureSettings.CurrentlySelectedPreset = null;
+ this.PictureSettings.Enabled = false;
+ this.PictureSettings.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.PictureSettings.Location = new System.Drawing.Point(0, 0);
+ this.PictureSettings.Name = "PictureSettings";
+ this.PictureSettings.PresetMaximumResolution = new System.Drawing.Size(0, 0);
+ this.PictureSettings.Size = new System.Drawing.Size(666, 279);
+ this.PictureSettings.TabIndex = 0;
+ //
+ // Filters
+ //
+ this.Filters.BackColor = System.Drawing.Color.Transparent;
+ this.Filters.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.Filters.Location = new System.Drawing.Point(0, 0);
+ this.Filters.Name = "Filters";
+ this.Filters.Size = new System.Drawing.Size(713, 310);
+ this.Filters.TabIndex = 0;
+ //
+ // AudioSettings
+ //
+ this.AudioSettings.BackColor = System.Drawing.Color.Transparent;
+ this.AudioSettings.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.AudioSettings.Location = new System.Drawing.Point(0, 0);
+ this.AudioSettings.Name = "AudioSettings";
+ this.AudioSettings.Size = new System.Drawing.Size(715, 310);
+ this.AudioSettings.TabIndex = 0;
+ //
+ // Subtitles
+ //
+ this.Subtitles.BackColor = System.Drawing.Color.Transparent;
+ this.Subtitles.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.Subtitles.Location = new System.Drawing.Point(0, 0);
+ this.Subtitles.Name = "Subtitles";
+ this.Subtitles.Size = new System.Drawing.Size(722, 310);
+ this.Subtitles.TabIndex = 0;
+ //
+ // x264Panel
+ //
+ this.x264Panel.BackColor = System.Drawing.Color.Transparent;
+ this.x264Panel.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.x264Panel.Location = new System.Drawing.Point(0, 0);
+ this.x264Panel.Name = "x264Panel";
+ this.x264Panel.Size = new System.Drawing.Size(720, 306);
+ this.x264Panel.TabIndex = 0;
+ this.x264Panel.X264Query = "";
//
// frmMain
//
@@ -1855,5 +1865,6 @@ namespace Handbrake
private DataGridViewTextBoxColumn number;
private DataGridViewTextBoxColumn name;
private ToolStripMenuItem mnu_exportMacPreset;
+ private ToolStripProgressBar ProgressBarStatus;
}
} \ No newline at end of file
diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs
index 61efc879c..72790bd09 100644
--- a/win/C#/frmMain.cs
+++ b/win/C#/frmMain.cs
@@ -42,6 +42,7 @@ namespace Handbrake
private DVD currentSource;
private ScanService SourceScan = new ScanService();
private List<DriveInformation> drives;
+ private Thread encodeMonitor;
// Delegates **********************************************************
private delegate void UpdateWindowHandler();
@@ -351,8 +352,8 @@ namespace Handbrake
// Experimental HBProc Process Monitoring.
if (Properties.Settings.Default.enocdeStatusInGui)
{
- Thread encodeMon = new Thread(EncodeMonitorThread);
- encodeMon.Start();
+ encodeMonitor = new Thread(EncodeMonitorThread);
+ encodeMonitor.Start();
}
}
@@ -821,9 +822,6 @@ namespace Handbrake
{
encodeQueue.SafelyClose();
}
-
- // Update the GUI
- SetEncodeFinished();
}
}
else
@@ -1868,6 +1866,7 @@ namespace Handbrake
}
lbl_encode.Text = "Encoding Finished";
+ ProgressBarStatus.Visible = false;
btn_start.Text = "Start";
btn_start.ToolTipText = "Start the encoding process";
btn_start.Image = Properties.Resources.Play;
@@ -1898,8 +1897,9 @@ namespace Handbrake
BeginInvoke(new UpdateWindowHandler(SetEncodeStarted));
return;
}
-
lbl_encode.Visible = true;
+ ProgressBarStatus.Value = 0;
+ ProgressBarStatus.Visible = true;
lbl_encode.Text = "Encoding with " + encodeQueue.Count + " encode(s) pending";
btn_start.Text = "Stop";
btn_start.ToolTipText = "Stop the encoding process.";
@@ -2052,6 +2052,8 @@ namespace Handbrake
encode.OnEncodeProgress += EncodeOnEncodeProgress;
while (!encode.EndOfStream)
encode.ReadEncodeStatus();
+
+ SetEncodeFinished();
}
catch (Exception exc)
{
@@ -2079,7 +2081,14 @@ namespace Handbrake
return;
}
lbl_encode.Text =
- string.Format("Encode Progress: {0}%, FPS: {1}, Avg FPS: {2}, Time Remaining: {3} ", PercentComplete, CurrentFps, AverageFps, TimeRemaining);
+ string.Format(
+ "{0:00.00}%, FPS: {1:000.0}, Avg FPS: {2:000.0}, Time Remaining: {3}",
+ PercentComplete,
+ CurrentFps,
+ AverageFps,
+ TimeRemaining);
+
+ ProgressBarStatus.Value = (int)Math.Round(PercentComplete);
}
#endregion
diff --git a/win/C#/frmPreview.Designer.cs b/win/C#/frmPreview.Designer.cs
index 2816e0016..775630358 100644
--- a/win/C#/frmPreview.Designer.cs
+++ b/win/C#/frmPreview.Designer.cs
@@ -41,7 +41,6 @@
this.btn_playVLC = new System.Windows.Forms.ToolStripButton();
this.QTControl = new AxQTOControlLib.AxQTControl();
this.panel1 = new System.Windows.Forms.Panel();
- this.lbl_status = new System.Windows.Forms.Label();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.ProgressBarStatus = new System.Windows.Forms.ToolStripProgressBar();
this.lbl_encodeStatus = new System.Windows.Forms.ToolStripLabel();
@@ -159,7 +158,6 @@
//
// panel1
//
- this.panel1.Controls.Add(this.lbl_status);
this.panel1.Controls.Add(this.QTControl);
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(0, 25);
@@ -167,20 +165,6 @@
this.panel1.Size = new System.Drawing.Size(772, 481);
this.panel1.TabIndex = 40;
//
- // lbl_status
- //
- this.lbl_status.AutoSize = true;
- this.lbl_status.BackColor = System.Drawing.Color.Transparent;
- this.lbl_status.Dock = System.Windows.Forms.DockStyle.Top;
- this.lbl_status.Font = new System.Drawing.Font("Tahoma", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.lbl_status.ForeColor = System.Drawing.Color.White;
- this.lbl_status.Location = new System.Drawing.Point(0, 0);
- this.lbl_status.Name = "lbl_status";
- this.lbl_status.Size = new System.Drawing.Size(51, 25);
- this.lbl_status.TabIndex = 40;
- this.lbl_status.Text = "{0}";
- this.lbl_status.Visible = false;
- //
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
@@ -216,7 +200,6 @@
this.toolBar.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.QTControl)).EndInit();
this.panel1.ResumeLayout(false);
- this.panel1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
@@ -233,7 +216,6 @@
private System.Windows.Forms.ToolStripComboBox cb_duration;
private System.Windows.Forms.ToolStripButton btn_playVLC;
private System.Windows.Forms.Panel panel1;
- private System.Windows.Forms.Label lbl_status;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.ToolStripProgressBar ProgressBarStatus;
private System.Windows.Forms.ToolStripLabel lbl_encodeStatus;
diff --git a/win/C#/frmPreview.cs b/win/C#/frmPreview.cs
index 03b569883..0be644f9f 100644
--- a/win/C#/frmPreview.cs
+++ b/win/C#/frmPreview.cs
@@ -1,4 +1,7 @@
-using Handbrake.Parsing;
+/* frmPreview.cs $
+ This file is part of the HandBrake source code.
+ Homepage: <http://handbrake.fr/>.
+ It may be used under the terms of the GNU General Public License. */
namespace Handbrake
{
@@ -12,17 +15,17 @@ namespace Handbrake
using QTOControlLib;
using QTOLibrary;
using Services;
+ using Parsing;
public partial class frmPreview : Form
{
- private readonly Queue Process = new Queue();
-
- private delegate void UpdateUIHandler();
-
private string CurrentlyPlaying = string.Empty;
private readonly frmMain MainWindow;
private Thread Player;
private readonly bool NoQT;
+ private readonly Queue Process = new Queue();
+ private delegate void UpdateUIHandler();
+ private bool playWithVLC;
public frmPreview(frmMain mw)
{
@@ -45,7 +48,6 @@ namespace Handbrake
Process.EncodeStarted += new EventHandler(Process_EncodeStarted);
}
-
private void Process_EncodeStarted(object sender, EventArgs e)
{
Thread encodeMon = new Thread(EncodeMonitorThread);
@@ -56,10 +58,10 @@ namespace Handbrake
private void btn_playVLC_Click(object sender, EventArgs e)
{
- lbl_status.Visible = true;
ProgressBarStatus.Visible = true;
ProgressBarStatus.Value = 0;
lbl_encodeStatus.Visible = true;
+ playWithVLC = true;
try
{
@@ -77,7 +79,7 @@ namespace Handbrake
btn_playQT.Enabled = false;
btn_playVLC.Enabled = false;
- lbl_status.Text = "Encoding Sample for (VLC) ...";
+ this.Text += " (Encoding)";
int duration;
int.TryParse(cb_duration.Text, out duration);
string query = QueryGenerator.GenerateCliQuery(MainWindow, 3, duration, cb_preview.Text);
@@ -86,6 +88,7 @@ namespace Handbrake
private void btn_playQT_Click(object sender, EventArgs e)
{
+ playWithVLC = false;
if (NoQT)
{
MessageBox.Show(this,
@@ -101,7 +104,6 @@ namespace Handbrake
}
else
{
- lbl_status.Visible = true;
ProgressBarStatus.Visible = true;
ProgressBarStatus.Value = 0;
lbl_encodeStatus.Visible = true;
@@ -120,7 +122,7 @@ namespace Handbrake
btn_playQT.Enabled = false;
btn_playVLC.Enabled = false;
- lbl_status.Text = "Encoding Sample for (QT) ...";
+ this.Text += " (Encoding)";
int duration;
int.TryParse(cb_duration.Text, out duration);
string query = QueryGenerator.GenerateCliQuery(MainWindow, 3, duration, cb_preview.Text);
@@ -194,25 +196,19 @@ namespace Handbrake
btn_playQT.Enabled = true;
btn_playVLC.Enabled = true;
- // Decide which Player to use.
- string playerSelection = lbl_status.Text.Contains("QT") ? "QT" : "VLC";
-
- lbl_status.Text = "Loading Clip ...";
+ this.Text = this.Text.Replace(" (Encoding)", string.Empty);
// Get the sample filename
if (MainWindow.text_destination.Text != string.Empty)
CurrentlyPlaying =
MainWindow.text_destination.Text.Replace(".mp4", "_sample.mp4").Replace(".m4v", "_sample.m4v").
Replace(".mkv", "_sample.mkv");
- ;
// Play back in QT or VLC
- if (playerSelection == "QT")
+ if (!playWithVLC)
Play();
else
PlayVLC();
-
- lbl_status.Text = string.Empty;
}
catch (Exception exc)
{
@@ -232,7 +228,6 @@ namespace Handbrake
{
Player = new Thread(OpenMovie) {IsBackground = true};
Player.Start();
- lbl_status.Visible = false;
}
/// <summary>
@@ -278,7 +273,6 @@ namespace Handbrake
string args = "\"" + CurrentlyPlaying + "\"";
ProcessStartInfo vlc = new ProcessStartInfo(Properties.Settings.Default.VLC_Path, args);
System.Diagnostics.Process.Start(vlc);
- lbl_status.Text = "VLC will now launch.";
}
}
else
@@ -286,7 +280,6 @@ namespace Handbrake
"Unable to find the preview file. Either the file was deleted or the encode failed. Check the activity log for details.",
"VLC", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
- lbl_status.Visible = false;
}
/// <summary>