OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Wed, 19 May 2010 20:13:53 +0000 (20:13 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Wed, 19 May 2010 20:13:53 +0000 (20:13 +0000)
- 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://localhost/HandBrake/trunk@3307 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/C#/Properties/Settings.Designer.cs
win/C#/Properties/Settings.settings
win/C#/app.config
win/C#/frmMain.Designer.cs
win/C#/frmMain.cs
win/C#/frmPreview.Designer.cs
win/C#/frmPreview.cs

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