OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Fri, 23 Apr 2010 21:01:57 +0000 (21:01 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Fri, 23 Apr 2010 21:01:57 +0000 (21:01 +0000)
- Quality Slider tooltip fixed.
- More stylecop warnings cleaned up.

git-svn-id: svn://localhost/HandBrake/trunk@3255 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/C#/Controls/AudioPanel.cs
win/C#/Controls/Subtitles.cs
win/C#/Controls/x264Panel.cs
win/C#/Functions/Win32.cs
win/C#/HandBrakeCS.5.0.ReSharper
win/C#/Services/Encode.cs
win/C#/Services/Queue.cs
win/C#/Settings.StyleCop
win/C#/frmMain.Designer.cs
win/C#/frmMain.cs

index d66305c..b3b2eaa 100644 (file)
@@ -14,14 +14,12 @@ namespace Handbrake.Controls
     using Presets;\r
     using AudioTrack = Model.AudioTrack;\r
 \r
+    /// <summary>\r
+    /// The AudioPanel Control\r
+    /// </summary>\r
     public partial class AudioPanel : UserControl\r
     {\r
         /// <summary>\r
-        /// The audio list has changed\r
-        /// </summary>\r
-        public event EventHandler AudioListChanged;\r
-\r
-        /// <summary>\r
         /// Initializes a new instance of the <see cref="AudioPanel"/> class. \r
         /// Create a new instance of the Audio Panel\r
         /// </summary>\r
@@ -33,6 +31,11 @@ namespace Handbrake.Controls
         }\r
 \r
         /// <summary>\r
+        /// The audio list has changed\r
+        /// </summary>\r
+        public event EventHandler AudioListChanged;\r
+\r
+        /// <summary>\r
         /// Get the audio panel\r
         /// </summary>\r
         /// <returns>A listview containing the audio tracks</returns>\r
@@ -44,7 +47,9 @@ namespace Handbrake.Controls
         /// <summary>\r
         /// Set the File Container. This funciton is used to limit the available options for each file container.\r
         /// </summary>\r
-        /// <param name="path"></param>\r
+        /// <param name="path">\r
+        /// the file path\r
+        /// </param>\r
         public void SetContainer(string path)\r
         {\r
             string oldval = drp_audioEncoder.Text;\r
@@ -84,7 +89,7 @@ namespace Handbrake.Controls
         /// <summary>\r
         /// Checks if the settings used required the .m4v (rather than .mp4) extension\r
         /// </summary>\r
-        /// <returns></returns>\r
+        /// <returns>True if m4v is required</returns>\r
         public bool RequiresM4V()\r
         {\r
             return lv_audioList.Items.Cast<ListViewItem>().Any(item => item.SubItems[2].Text.Contains("AC3"));\r
@@ -93,7 +98,7 @@ namespace Handbrake.Controls
         /// <summary>\r
         /// Load an arraylist of AudioTrack items into the list.\r
         /// </summary>\r
-        /// <param name="audioTracks"></param>\r
+        /// <param name="audioTracks">List of audio tracks</param>\r
         public void LoadTracks(ArrayList audioTracks)\r
         {\r
             ClearAudioList();\r
@@ -118,7 +123,8 @@ namespace Handbrake.Controls
         /// <summary>\r
         /// Set the Track list dropdown from the parsed title captured during the scan\r
         /// </summary>\r
-        /// <param name="selectedTitle"></param>\r
+        /// <param name="selectedTitle">The selected title</param>\r
+        /// <param name="preset">A preset</param>\r
         public void SetTrackList(Title selectedTitle, Preset preset)\r
         {\r
             if (selectedTitle.AudioTracks.Count == 0)\r
@@ -129,28 +135,25 @@ namespace Handbrake.Controls
                 drp_audioTrack.SelectedIndex = 0;\r
                 return;\r
             }\r
-            else\r
-            {\r
-                drp_audioTrack.Items.Clear();\r
-                drp_audioTrack.Items.Add("Automatic");\r
-                drp_audioTrack.Items.AddRange(selectedTitle.AudioTracks.ToArray());\r
 \r
-                if (lv_audioList.Items.Count == 0 && preset != null)\r
+            drp_audioTrack.Items.Clear();\r
+            drp_audioTrack.Items.Add("Automatic");\r
+            drp_audioTrack.Items.AddRange(selectedTitle.AudioTracks.ToArray());\r
+\r
+            if (lv_audioList.Items.Count == 0 && preset != null)\r
+            {\r
+                QueryParser parsed = QueryParser.Parse(preset.Query);\r
+                foreach (AudioTrack audioTrack in parsed.AudioInformation)\r
                 {\r
-                    QueryParser parsed = QueryParser.Parse(preset.Query);\r
-                    foreach (AudioTrack audioTrack in parsed.AudioInformation)\r
-                    {\r
-                        ListViewItem newTrack = new ListViewItem(GetNewID().ToString());\r
-                        newTrack.SubItems.Add(audioTrack.Track);\r
-                        newTrack.SubItems.Add(audioTrack.Encoder);\r
-                        newTrack.SubItems.Add(audioTrack.MixDown);\r
-                        newTrack.SubItems.Add(audioTrack.SampleRate);\r
-                        newTrack.SubItems.Add(audioTrack.Bitrate);\r
-                        newTrack.SubItems.Add(audioTrack.DRC.ToString());\r
-                        lv_audioList.Items.Add(newTrack);\r
-                    }\r
+                    ListViewItem newTrack = new ListViewItem(GetNewID().ToString());\r
+                    newTrack.SubItems.Add(audioTrack.Track);\r
+                    newTrack.SubItems.Add(audioTrack.Encoder);\r
+                    newTrack.SubItems.Add(audioTrack.MixDown);\r
+                    newTrack.SubItems.Add(audioTrack.SampleRate);\r
+                    newTrack.SubItems.Add(audioTrack.Bitrate);\r
+                    newTrack.SubItems.Add(audioTrack.DRC);\r
+                    lv_audioList.Items.Add(newTrack);\r
                 }\r
-\r
             }\r
 \r
             // Handle Native Language and "Dub Foreign language audio" and "Use Foreign language audio and Subtitles" Options\r
@@ -190,6 +193,16 @@ namespace Handbrake.Controls
         }\r
 \r
         // Control and ListView\r
+\r
+        /// <summary>\r
+        /// one of the controls has changed. Event handler\r
+        /// </summary>\r
+        /// <param name="sender">\r
+        /// The sender.\r
+        /// </param>\r
+        /// <param name="e">\r
+        /// The e.\r
+        /// </param>\r
         private void controlChanged(object sender, EventArgs e)\r
         {\r
             Control ctl = (Control)sender;\r
@@ -261,6 +274,15 @@ namespace Handbrake.Controls
             lv_audioList.Select();\r
         }\r
 \r
+        /// <summary>\r
+        /// The Audio List selected index changed event handler\r
+        /// </summary>\r
+        /// <param name="sender">\r
+        /// The sender.\r
+        /// </param>\r
+        /// <param name="e">\r
+        /// The e.\r
+        /// </param>\r
         private void lv_audioList_SelectedIndexChanged(object sender, EventArgs e)\r
         {\r
             // Set the dropdown controls based on the selected item in the Audio List.\r
@@ -288,12 +310,25 @@ namespace Handbrake.Controls
         }\r
 \r
         // Track Controls\r
+\r
+        /// <summary>\r
+        /// The Add Audio Track button event handler\r
+        /// </summary>\r
+        /// <param name="sender">\r
+        /// The sender.\r
+        /// </param>\r
+        /// <param name="e">\r
+        /// The e.\r
+        /// </param>\r
         private void btn_addAudioTrack_Click(object sender, EventArgs e)\r
         {\r
             if (drp_audioTrack.Text == "None Found")\r
             {\r
-                MessageBox.Show("Your source appears to have no audio tracks that HandBrake supports.", "Warning",\r
-                                MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
+                MessageBox.Show(\r
+                    "Your source appears to have no audio tracks that HandBrake supports.",\r
+                    "Warning",\r
+                    MessageBoxButtons.OK,\r
+                    MessageBoxIcon.Warning);\r
                 return;\r
             }\r
 \r
@@ -320,28 +355,72 @@ namespace Handbrake.Controls
             lv_audioList.Select();\r
         }\r
 \r
+        /// <summary>\r
+        /// The Remove Track button event handler\r
+        /// </summary>\r
+        /// <param name="sender">\r
+        /// The sender.\r
+        /// </param>\r
+        /// <param name="e">\r
+        /// The e.\r
+        /// </param>\r
         private void btn_RemoveAudioTrack_Click(object sender, EventArgs e)\r
         {\r
             RemoveTrack();\r
         }\r
 \r
         // Audio List Menu\r
+\r
+        /// <summary>\r
+        /// The Audio List Move Up menu item\r
+        /// </summary>\r
+        /// <param name="sender">\r
+        /// The sender.\r
+        /// </param>\r
+        /// <param name="e">\r
+        /// The e.\r
+        /// </param>\r
         private void audioList_moveup_Click(object sender, EventArgs e)\r
         {\r
             MoveTrack(true);\r
         }\r
 \r
+        /// <summary>\r
+        /// The audio list move down menu item\r
+        /// </summary>\r
+        /// <param name="sender">\r
+        /// The sender.\r
+        /// </param>\r
+        /// <param name="e">\r
+        /// The e.\r
+        /// </param>\r
         private void audioList_movedown_Click(object sender, EventArgs e)\r
         {\r
             MoveTrack(false);\r
         }\r
 \r
+        /// <summary>\r
+        /// The audio list remove menu item\r
+        /// </summary>\r
+        /// <param name="sender">\r
+        /// The sender.\r
+        /// </param>\r
+        /// <param name="e">\r
+        /// The e.\r
+        /// </param>\r
         private void audioList_remove_Click(object sender, EventArgs e)\r
         {\r
             RemoveTrack();\r
         }\r
 \r
         // Public Functions\r
+\r
+        /// <summary>\r
+        /// Add track for preset\r
+        /// </summary>\r
+        /// <param name="item">\r
+        /// The item.\r
+        /// </param>\r
         private void AddTrackForPreset(ListViewItem item)\r
         {\r
             lv_audioList.Items.Add(item);\r
@@ -349,6 +428,9 @@ namespace Handbrake.Controls
                 this.AudioListChanged(this, new EventArgs());\r
         }\r
 \r
+        /// <summary>\r
+        /// Clear the audio list\r
+        /// </summary>\r
         private void ClearAudioList()\r
         {\r
             lv_audioList.Items.Clear();\r
@@ -356,11 +438,20 @@ namespace Handbrake.Controls
                 this.AudioListChanged(this, new EventArgs());\r
         }\r
 \r
+        /// <summary>\r
+        /// Get a new ID for the next audio track\r
+        /// </summary>\r
+        /// <returns>\r
+        /// an int\r
+        /// </returns>\r
         private int GetNewID()\r
         {\r
             return lv_audioList.Items.Count + 1;\r
         }\r
 \r
+        /// <summary>\r
+        /// Remove an audio track from the list\r
+        /// </summary>\r
         private void RemoveTrack()\r
         {\r
             // Remove the Item and reselect the control if the following conditions are met.\r
@@ -390,6 +481,12 @@ namespace Handbrake.Controls
             }\r
         }\r
 \r
+        /// <summary>\r
+        /// Move an audio track up or down the audio list\r
+        /// </summary>\r
+        /// <param name="up">\r
+        /// The up.\r
+        /// </param>\r
         private void MoveTrack(bool up)\r
         {\r
             if (lv_audioList.SelectedIndices.Count == 0) return;\r
@@ -409,6 +506,9 @@ namespace Handbrake.Controls
             }\r
         }\r
 \r
+        /// <summary>\r
+        /// Regenerate all the audio track id's on the audio list\r
+        /// </summary>\r
         private void ReGenerateListIDs()\r
         {\r
             int i = 1;\r
@@ -419,6 +519,9 @@ namespace Handbrake.Controls
             }\r
         }\r
 \r
+        /// <summary>\r
+        /// Set the bitrate dropdown\r
+        /// </summary>\r
         private void SetBitrate()\r
         {\r
             int max = 0;\r
@@ -473,10 +576,13 @@ namespace Handbrake.Controls
                 drp_audioBitrate.Items.Add("768");\r
             }\r
 \r
-             if (drp_audioBitrate.SelectedItem == null)\r
+            if (drp_audioBitrate.SelectedItem == null)\r
                 drp_audioBitrate.SelectedIndex = drp_audioBitrate.Items.Count - 1;\r
         }\r
 \r
+        /// <summary>\r
+        /// Set the mixdown dropdown\r
+        /// </summary>\r
         private void SetMixDown()\r
         {\r
             drp_audioMix.Items.Clear();\r
index c511133..3326ee7 100644 (file)
@@ -1,5 +1,4 @@
 /*  Subtitles.cs $\r
-       \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
index bc715f4..4b943e3 100644 (file)
@@ -1,8 +1,7 @@
 /*  x264Panel.cs $\r
-       \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
+    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.Controls\r
 {\r
@@ -335,9 +334,9 @@ namespace Handbrake.Controls
                                 int val, val2;\r
 \r
                                 // default psy-rd = 1 (10 for the slider)\r
-                                psyrd = double.TryParse(x[0], out psyrd) ? psyrd*10 : 10.0;\r
+                                psyrd = double.TryParse(x[0], out psyrd) ? psyrd * 10 : 10.0;\r
                                 // default psy-trellis = 0\r
-                                psytrellis = double.TryParse(x[1], out psytrellis) ? psytrellis*10 : 0.0;\r
+                                psytrellis = double.TryParse(x[1], out psytrellis) ? psytrellis * 10 : 0.0;\r
 \r
                                 int.TryParse(psyrd.ToString(), out val);\r
                                 int.TryParse(psytrellis.ToString(), out val2);\r
index 4b35017..e7da9d5 100644 (file)
@@ -112,8 +112,19 @@ namespace Handbrake.Functions
         /// </summary>\r
         public enum ConsoleCtrlEvent\r
         {\r
+            /// <summary>\r
+            /// Ctrl - C\r
+            /// </summary>\r
             CTRL_C = 0,\r
+\r
+            /// <summary>\r
+            /// Ctrl - Break\r
+            /// </summary>\r
             CTRL_BREAK = 1,\r
+\r
+            /// <summary>\r
+            /// Ctrl - Close\r
+            /// </summary>\r
             CTRL_CLOSE = 2,\r
         }\r
     }\r
index a3d96d8..9826bd3 100644 (file)
@@ -81,7 +81,7 @@
     </XML>\r
     <FileHeader><![CDATA[/*  file.cs$\r
         This file is part of the HandBrake source code.\r
-        Homepage: <http://handbrake.fr/>.\r
+        Homepage: <http://handbrake.fr/>\r
         It may be used under the terms of the GNU General Public License. */]]></FileHeader>\r
     <GenerateMemberBody />\r
     <Naming2>\r
index 61dd511..ba19f18 100644 (file)
@@ -3,7 +3,6 @@
     Homepage: <http://handbrake.fr/>.\r
     It may be used under the terms of the GNU General Public License. */\r
 \r
-\r
 namespace Handbrake.Services\r
 {\r
     using System;\r
@@ -94,8 +93,7 @@ namespace Handbrake.Services
         /// </param>\r
         public void CreatePreviewSample(string query)\r
         {\r
-            Job job = new Job {Query = query};\r
-            this.Run(job);\r
+            this.Run(new Job {Query = query});\r
         }\r
 \r
         /// <summary>\r
@@ -178,7 +176,6 @@ namespace Handbrake.Services
                 if (this.EncodeStarted != null)\r
                     this.EncodeStarted(this, new EventArgs());\r
 \r
-\r
                 if (this.HbProcess != null)\r
                     this.ProcessHandle = this.HbProcess.MainWindowHandle; // Set the process Handle\r
 \r
index 525fd75..4aba977 100644 (file)
@@ -3,7 +3,6 @@
     Homepage: <http://handbrake.fr/>.\r
     It may be used under the terms of the GNU General Public License. */\r
 \r
-\r
 namespace Handbrake.Services\r
 {\r
     using System;\r
@@ -22,14 +21,14 @@ namespace Handbrake.Services
     public class Queue : Encode\r
     {\r
         /// <summary>\r
-        /// An XML Serializer\r
+        /// The Queue Job List\r
         /// </summary>\r
-        private static XmlSerializer serializer;\r
+        private readonly List<Job> queue = new List<Job>();\r
 \r
         /// <summary>\r
-        /// The Queue Job List\r
+        /// An XML Serializer\r
         /// </summary>\r
-        private readonly List<Job> queue = new List<Job>();\r
+        private static XmlSerializer serializer;\r
 \r
         /// <summary>\r
         /// The Next Job ID\r
@@ -85,6 +84,9 @@ namespace Handbrake.Services
         /// <param name="query">\r
         /// The query that will be passed to the HandBrake CLI.\r
         /// </param>\r
+        /// <param name="title">\r
+        /// The title.\r
+        /// </param>\r
         /// <param name="source">\r
         /// The location of the source video.\r
         /// </param>\r
index d6aed59..25f6771 100644 (file)
             <BooleanProperty Name="Enabled">False</BooleanProperty>\r
           </RuleSettings>\r
         </Rule>\r
+        <Rule Name="ElementsMustBeSeparatedByBlankLine">\r
+          <RuleSettings>\r
+            <BooleanProperty Name="Enabled">False</BooleanProperty>\r
+          </RuleSettings>\r
+        </Rule>\r
       </Rules>\r
       <AnalyzerSettings />\r
     </Analyzer>\r
             <BooleanProperty Name="Enabled">False</BooleanProperty>\r
           </RuleSettings>\r
         </Rule>\r
+        <Rule Name="ParametersMustBeOnSameLineOrSeparateLines">\r
+          <RuleSettings>\r
+            <BooleanProperty Name="Enabled">False</BooleanProperty>\r
+          </RuleSettings>\r
+        </Rule>\r
+        <Rule Name="ParameterMustFollowComma">\r
+          <RuleSettings>\r
+            <BooleanProperty Name="Enabled">False</BooleanProperty>\r
+          </RuleSettings>\r
+        </Rule>\r
+        <Rule Name="SplitParametersMustStartOnLineAfterDeclaration">\r
+          <RuleSettings>\r
+            <BooleanProperty Name="Enabled">False</BooleanProperty>\r
+          </RuleSettings>\r
+        </Rule>\r
+        <Rule Name="UseBuiltInTypeAlias">\r
+          <RuleSettings>\r
+            <BooleanProperty Name="Enabled">False</BooleanProperty>\r
+          </RuleSettings>\r
+        </Rule>\r
       </Rules>\r
       <AnalyzerSettings />\r
     </Analyzer>\r
index da7d433..74d68e6 100644 (file)
@@ -274,7 +274,7 @@ namespace Handbrake
             this.check_turbo.Enabled = false;\r
             this.check_turbo.Location = new System.Drawing.Point(146, 123);\r
             this.check_turbo.Name = "check_turbo";\r
-            this.check_turbo.Size = new System.Drawing.Size(99, 17);\r
+            this.check_turbo.Size = new System.Drawing.Size(101, 17);\r
             this.check_turbo.TabIndex = 7;\r
             this.check_turbo.Text = "Turbo first Pass";\r
             this.ToolTip.SetToolTip(this.check_turbo, "Makes the first pass of a 2 pass encode faster.");\r
@@ -311,8 +311,7 @@ namespace Handbrake
             this.slider_videoQuality.Size = new System.Drawing.Size(322, 45);\r
             this.slider_videoQuality.TabIndex = 14;\r
             this.slider_videoQuality.TickFrequency = 17;\r
-            this.ToolTip.SetToolTip(this.slider_videoQuality, "Set the quality level of the video. Typical sane values are between 59~63%. \r\n>70" +\r
-                    "% will likely result in the output file being larger than the input file.");\r
+            this.ToolTip.SetToolTip(this.slider_videoQuality, "Set the quality level of the video. ");\r
             this.slider_videoQuality.ValueChanged += new System.EventHandler(this.slider_videoQuality_Scroll);\r
             // \r
             // text_filesize\r
@@ -841,7 +840,7 @@ namespace Handbrake
             this.radio_cq.BackColor = System.Drawing.Color.Transparent;\r
             this.radio_cq.Location = new System.Drawing.Point(336, 97);\r
             this.radio_cq.Name = "radio_cq";\r
-            this.radio_cq.Size = new System.Drawing.Size(105, 17);\r
+            this.radio_cq.Size = new System.Drawing.Size(110, 17);\r
             this.radio_cq.TabIndex = 18;\r
             this.radio_cq.Text = "Constant Quality:";\r
             this.radio_cq.UseVisualStyleBackColor = false;\r
@@ -854,7 +853,7 @@ namespace Handbrake
             this.radio_avgBitrate.Checked = true;\r
             this.radio_avgBitrate.Location = new System.Drawing.Point(336, 64);\r
             this.radio_avgBitrate.Name = "radio_avgBitrate";\r
-            this.radio_avgBitrate.Size = new System.Drawing.Size(112, 17);\r
+            this.radio_avgBitrate.Size = new System.Drawing.Size(116, 17);\r
             this.radio_avgBitrate.TabIndex = 17;\r
             this.radio_avgBitrate.TabStop = true;\r
             this.radio_avgBitrate.Text = "Avg Bitrate (kbps):";\r
@@ -867,7 +866,7 @@ namespace Handbrake
             this.radio_targetFilesize.BackColor = System.Drawing.Color.Transparent;\r
             this.radio_targetFilesize.Location = new System.Drawing.Point(336, 37);\r
             this.radio_targetFilesize.Name = "radio_targetFilesize";\r
-            this.radio_targetFilesize.Size = new System.Drawing.Size(107, 17);\r
+            this.radio_targetFilesize.Size = new System.Drawing.Size(108, 17);\r
             this.radio_targetFilesize.TabIndex = 16;\r
             this.radio_targetFilesize.Text = "Target Size (MB):";\r
             this.radio_targetFilesize.UseVisualStyleBackColor = false;\r
@@ -890,7 +889,7 @@ namespace Handbrake
             this.check_2PassEncode.BackColor = System.Drawing.Color.Transparent;\r
             this.check_2PassEncode.Location = new System.Drawing.Point(125, 100);\r
             this.check_2PassEncode.Name = "check_2PassEncode";\r
-            this.check_2PassEncode.Size = new System.Drawing.Size(106, 17);\r
+            this.check_2PassEncode.Size = new System.Drawing.Size(104, 17);\r
             this.check_2PassEncode.TabIndex = 6;\r
             this.check_2PassEncode.Text = "2-Pass Encoding";\r
             this.check_2PassEncode.UseVisualStyleBackColor = false;\r
@@ -958,7 +957,7 @@ namespace Handbrake
             this.Check_ChapterMarkers.BackColor = System.Drawing.Color.Transparent;\r
             this.Check_ChapterMarkers.Location = new System.Drawing.Point(16, 32);\r
             this.Check_ChapterMarkers.Name = "Check_ChapterMarkers";\r
-            this.Check_ChapterMarkers.Size = new System.Drawing.Size(136, 17);\r
+            this.Check_ChapterMarkers.Size = new System.Drawing.Size(140, 17);\r
             this.Check_ChapterMarkers.TabIndex = 1;\r
             this.Check_ChapterMarkers.Text = "Create chapter markers";\r
             this.Check_ChapterMarkers.UseVisualStyleBackColor = false;\r
index 6c4a2ed..0894d6a 100644 (file)
@@ -1628,18 +1628,8 @@ namespace Handbrake
         {\r
             // Setup the GUI components for the scan.\r
             sourcePath = filename;\r
-            foreach (Control ctrl in Controls)\r
-                if (!(ctrl is StatusStrip || ctrl is MenuStrip || ctrl is ToolStrip))\r
-                    ctrl.Enabled = false;\r
 \r
-            lbl_encode.Visible = true;\r
-            lbl_encode.Text = "Scanning ...";\r
-            btn_source.Enabled = false;\r
-            btn_start.Enabled = false;\r
-            btn_showQueue.Enabled = false;\r
-            btn_add2Queue.Enabled = false;\r
-            tb_preview.Enabled = false;\r
-            mnu_killCLI.Visible = true;\r
+            this.DisableGUI();\r
 \r
             if (ActivityWindow != null)\r
                 ActivityWindow.SetMode(ActivityLogMode.Scan);\r
@@ -1756,6 +1746,22 @@ namespace Handbrake
             }\r
         }\r
 \r
+        private void DisableGUI()\r
+        {\r
+            foreach (Control ctrl in Controls)\r
+                if (!(ctrl is StatusStrip || ctrl is MenuStrip || ctrl is ToolStrip))\r
+                    ctrl.Enabled = false;\r
+\r
+            lbl_encode.Visible = true;\r
+            lbl_encode.Text = "Scanning ...";\r
+            btn_source.Enabled = false;\r
+            btn_start.Enabled = false;\r
+            btn_showQueue.Enabled = false;\r
+            btn_add2Queue.Enabled = false;\r
+            tb_preview.Enabled = false;\r
+            mnu_killCLI.Visible = true;\r
+        }\r
+\r
         private void KillScan()\r
         {\r
             try\r
@@ -2032,22 +2038,17 @@ namespace Handbrake
         /// <param name="CurrentFps"></param>\r
         /// <param name="AverageFps"></param>\r
         /// <param name="TimeRemaining"></param>\r
-        private void EncodeOnEncodeProgress(object Sender, int CurrentTask, int TaskCount, float PercentComplete,\r
-                                            float CurrentFps, float AverageFps, TimeSpan TimeRemaining)\r
+        private void EncodeOnEncodeProgress(object Sender, int CurrentTask, int TaskCount, float PercentComplete, float CurrentFps, float AverageFps, TimeSpan TimeRemaining)\r
         {\r
             if (this.InvokeRequired)\r
             {\r
-                this.BeginInvoke(new EncodeProgressEventHandler(EncodeOnEncodeProgress),\r
-                                 new[]\r
-                                     {\r
-                                         Sender, CurrentTask, TaskCount, PercentComplete, CurrentFps, AverageFps, \r
-                                         TimeRemaining\r
-                                     });\r
+                this.BeginInvoke(\r
+                    new EncodeProgressEventHandler(EncodeOnEncodeProgress),\r
+                    new[] { Sender, CurrentTask, TaskCount, PercentComplete, CurrentFps, AverageFps, TimeRemaining });\r
                 return;\r
             }\r
             lbl_encode.Text =\r
-                string.Format("Encode Progress: {0}%,       FPS: {1},       Avg FPS: {2},       Time Remaining: {3} ",\r
-                              PercentComplete, CurrentFps, AverageFps, TimeRemaining);\r
+                string.Format("Encode Progress: {0}%,       FPS: {1},       Avg FPS: {2},       Time Remaining: {3} ", PercentComplete, CurrentFps, AverageFps, TimeRemaining);\r
         }\r
 \r
         #endregion\r