OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Fri, 5 Sep 2008 14:46:56 +0000 (14:46 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Fri, 5 Sep 2008 14:46:56 +0000 (14:46 +0000)
- Code Cleanup
- Bugfix: PresetLoader incorrectly loading audio track number with user presets.

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

win/C#/Functions/Common.cs
win/C#/HandBrakeCS.csproj
win/C#/frmOptions.cs
win/C#/frmQueue.cs

index 6a61ae7..179da77 100644 (file)
@@ -38,6 +38,7 @@ namespace Handbrake.Functions
             hbproc.Dispose();\r
             hbproc.Close();\r
         }\r
+\r
         /// <summary>\r
         /// This function takes in a Query which has been parsed by QueryParser and\r
         /// set's all the GUI widgets correctly.\r
@@ -235,10 +236,7 @@ namespace Handbrake.Functions
             #region Audio\r
 \r
             // Handle Track 1\r
-            if (presetQuery.AudioTrack1 == string.Empty)\r
-                mainWindow.drp_track1Audio.Text = "Automatic";\r
-            else\r
-                mainWindow.drp_track1Audio.Text = presetQuery.AudioTrack1;\r
+            mainWindow.drp_track1Audio.Text = "Automatic";\r
 \r
             // Handle Track 2\r
             if (presetQuery.AudioEncoder2 != null)  // Fix for loading in built in presets. Where 2 encoders but no tracks in the preset.\r
@@ -249,10 +247,7 @@ namespace Handbrake.Functions
                 mainWindow.drp_audenc_2.Enabled = true;\r
                 mainWindow.drp_audbit_2.Enabled = true;\r
                 mainWindow.drp_audsr_2.Text = "48";\r
-                if ((presetQuery.AudioTrack2 != null) && (presetQuery.AudioTrack2 != "None"))\r
-                    mainWindow.drp_track2Audio.Text = presetQuery.AudioTrack2;\r
-                else\r
-                    mainWindow.drp_track2Audio.Text = "Automatic";\r
+                mainWindow.drp_track2Audio.Text = "Automatic";\r
             }\r
             else if (presetQuery.AudioTrack2 == "None")\r
             {\r
@@ -410,7 +405,7 @@ namespace Handbrake.Functions
 \r
         #endregion\r
 \r
-        #region Query Generator & Chapter CSV Creation\r
+        #region Query Generator Functions\r
 \r
         /// <summary>\r
         /// Generates a CLI query based on the GUI widgets.\r
@@ -450,6 +445,7 @@ namespace Handbrake.Functions
             query += generateTabbedComponentsQuery(mainWindow, mainWindow.text_source.Text);\r
             return query;\r
         }\r
+\r
         /// <summary>\r
         /// Generates a CLI query for the preview function.\r
         /// This basically forces a shortened version of the encdode.\r
@@ -485,7 +481,12 @@ namespace Handbrake.Functions
             return query;\r
         }\r
 \r
-        // Generates part of the CLI query, for the tabbed components only.\r
+        /// <summary>\r
+        /// Generates part of the CLI query, for the tabbed components only.\r
+        /// </summary>\r
+        /// <param name="mainWindow"></param>\r
+        /// <param name="source"></param>\r
+        /// <returns></returns>\r
         private string generateTabbedComponentsQuery(frmMain mainWindow, string source)\r
         {\r
             string query = "";\r
@@ -695,7 +696,9 @@ namespace Handbrake.Functions
                 query += " -a " + tempSub[0];\r
             }\r
 \r
-            if (track2 != "None")\r
+            if (track2 == "Automatic")\r
+                query += ",1";\r
+            else if (track2 != "None")\r
             {\r
                 string[] tempSub;\r
                 tempSub = track2.Split(' ');\r
@@ -927,7 +930,13 @@ namespace Handbrake.Functions
 \r
             return query;\r
         }\r
-        // Get the CLI equive of the audio mixdown from the widget name.\r
+\r
+        /// <summary>\r
+        /// Get the CLI equive of the audio mixdown from the widget name.\r
+        /// </summary>\r
+        /// <param name="selectedAudio"></param>\r
+        /// <returns></returns>\r
+        /// \r
         private string getMixDown(string selectedAudio)\r
         {\r
             switch (selectedAudio)\r
@@ -948,7 +957,13 @@ namespace Handbrake.Functions
                     return "dpl2";\r
             }\r
         }\r
-        // Get the CLI equiv of the audio encoder from the widget name.\r
+\r
+        /// <summary>\r
+        /// Get the CLI equiv of the audio encoder from the widget name.\r
+        /// </summary>\r
+        /// <param name="selectedEncoder"></param>\r
+        /// <returns></returns>\r
+        /// \r
         private string getAudioEncoder(string selectedEncoder)\r
         {\r
             switch (selectedEncoder)\r
@@ -965,8 +980,14 @@ namespace Handbrake.Functions
                     return "";\r
             }\r
         }\r
-        // This function saves the data in the chapters tab, dataGridView into a CSV file called chapters.csv\r
-        // in a directory specified by file_path_name\r
+\r
+        /// <summary>\r
+        /// This function saves the data in the chapters tab, dataGridView into a CSV file called chapters.csv\r
+        /// in a directory specified by file_path_name\r
+        /// </summary>\r
+        /// <param name="mainWindow"></param>\r
+        /// <param name="file_path_name"></param>\r
+        /// <returns></returns>\r
         private Boolean chapterCSVSave(frmMain mainWindow, string file_path_name)\r
         {\r
             try\r
@@ -996,7 +1017,7 @@ namespace Handbrake.Functions
 \r
         #endregion\r
 \r
-        #region frmMain Actions\r
+        #region Actions, Versioning etc\r
 \r
         /// <summary>\r
         /// Select the longest title in the DVD title dropdown menu on frmMain\r
@@ -1157,10 +1178,6 @@ namespace Handbrake.Functions
             }\r
         }\r
 \r
-        #endregion\r
-\r
-        #region Version and Update Checking\r
-\r
         /// <summary>\r
         /// Checks for updates and returns true if an update is available.\r
         /// </summary>\r
@@ -1192,6 +1209,7 @@ namespace Handbrake.Functions
                 return false;\r
             }\r
         }\r
+\r
         /// <summary>\r
         /// Get's HandBrakes version data from the CLI.\r
         /// </summary>\r
@@ -1231,9 +1249,6 @@ namespace Handbrake.Functions
             return null;\r
         }\r
 \r
-        #endregion\r
-\r
-        #region Queue\r
         /// <summary>\r
         /// Check if the queue recovery file contains records.\r
         /// If it does, it means the last queue did not complete before HandBrake closed.\r
@@ -1267,6 +1282,7 @@ namespace Handbrake.Functions
                 return false;\r
             }\r
         }\r
+\r
         #endregion\r
 \r
     }\r
index f290dd6..d643bbb 100644 (file)
     </DocumentationFile>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
-    <DebugType>pdbonly</DebugType>\r
+    <DebugType>full</DebugType>\r
     <Optimize>true</Optimize>\r
     <OutputPath>bin\Release\</OutputPath>\r
-    <DefineConstants>TRACE</DefineConstants>\r
+    <DefineConstants>DEBUG;TRACE</DefineConstants>\r
     <ErrorReport>prompt</ErrorReport>\r
     <WarningLevel>4</WarningLevel>\r
     <TreatWarningsAsErrors>false</TreatWarningsAsErrors>\r
     <UseVSHostingProcess>false</UseVSHostingProcess>\r
     <DocumentationFile>\r
     </DocumentationFile>\r
+    <CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>\r
+    <NoStdLib>false</NoStdLib>\r
+    <DebugSymbols>true</DebugSymbols>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">\r
     <PlatformTarget>x86</PlatformTarget>\r
index fb48f80..2a7695f 100644 (file)
@@ -65,7 +65,7 @@ namespace Handbrake
 \r
             text_an_path.Text = Properties.Settings.Default.autoNamePath;\r
 \r
-            if (text_an_path.Text == "")\r
+            if (text_an_path.Text == string.Empty)\r
                 text_an_path.Text = "Click 'Browse' to set the default location";              \r
         }\r
 \r
@@ -139,7 +139,7 @@ namespace Handbrake
 \r
         private void text_an_path_TextChanged(object sender, EventArgs e)\r
         {\r
-            if (text_an_path.Text == "")\r
+            if (text_an_path.Text == string.Empty)\r
             {\r
                 Properties.Settings.Default.autoNamePath = "";\r
                 text_an_path.Text = "Click 'Browse' to set the default location";\r
index e331b70..1cf2930 100644 (file)
@@ -314,7 +314,7 @@ namespace Handbrake
             {\r
                 string fullQuery = '"' + Application.StartupPath.ToString() + "\\HandBrakeCLI.exe" + '"' + query_item;\r
 \r
-                if (queries == "")\r
+                if (queries == string.Empty)\r
                     queries = queries + fullQuery;\r
                 else\r
                     queries = queries + " && " + fullQuery;\r