From: sr55 Date: Fri, 5 Sep 2008 14:46:56 +0000 (+0000) Subject: WinGui: X-Git-Tag: 0.9.3~278 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2d4587713e70ea729e5e4f20e4d72407e7a66633;p=handbrake WinGui: - Code Cleanup - Bugfix: PresetLoader incorrectly loading audio track number with user presets. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1666 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- diff --git a/win/C#/Functions/Common.cs b/win/C#/Functions/Common.cs index 6a61ae735..179da7719 100644 --- a/win/C#/Functions/Common.cs +++ b/win/C#/Functions/Common.cs @@ -38,6 +38,7 @@ namespace Handbrake.Functions hbproc.Dispose(); hbproc.Close(); } + /// /// This function takes in a Query which has been parsed by QueryParser and /// set's all the GUI widgets correctly. @@ -235,10 +236,7 @@ namespace Handbrake.Functions #region Audio // Handle Track 1 - if (presetQuery.AudioTrack1 == string.Empty) - mainWindow.drp_track1Audio.Text = "Automatic"; - else - mainWindow.drp_track1Audio.Text = presetQuery.AudioTrack1; + mainWindow.drp_track1Audio.Text = "Automatic"; // Handle Track 2 if (presetQuery.AudioEncoder2 != null) // Fix for loading in built in presets. Where 2 encoders but no tracks in the preset. @@ -249,10 +247,7 @@ namespace Handbrake.Functions mainWindow.drp_audenc_2.Enabled = true; mainWindow.drp_audbit_2.Enabled = true; mainWindow.drp_audsr_2.Text = "48"; - if ((presetQuery.AudioTrack2 != null) && (presetQuery.AudioTrack2 != "None")) - mainWindow.drp_track2Audio.Text = presetQuery.AudioTrack2; - else - mainWindow.drp_track2Audio.Text = "Automatic"; + mainWindow.drp_track2Audio.Text = "Automatic"; } else if (presetQuery.AudioTrack2 == "None") { @@ -410,7 +405,7 @@ namespace Handbrake.Functions #endregion - #region Query Generator & Chapter CSV Creation + #region Query Generator Functions /// /// Generates a CLI query based on the GUI widgets. @@ -450,6 +445,7 @@ namespace Handbrake.Functions query += generateTabbedComponentsQuery(mainWindow, mainWindow.text_source.Text); return query; } + /// /// Generates a CLI query for the preview function. /// This basically forces a shortened version of the encdode. @@ -485,7 +481,12 @@ namespace Handbrake.Functions return query; } - // Generates part of the CLI query, for the tabbed components only. + /// + /// Generates part of the CLI query, for the tabbed components only. + /// + /// + /// + /// private string generateTabbedComponentsQuery(frmMain mainWindow, string source) { string query = ""; @@ -695,7 +696,9 @@ namespace Handbrake.Functions query += " -a " + tempSub[0]; } - if (track2 != "None") + if (track2 == "Automatic") + query += ",1"; + else if (track2 != "None") { string[] tempSub; tempSub = track2.Split(' '); @@ -927,7 +930,13 @@ namespace Handbrake.Functions return query; } - // Get the CLI equive of the audio mixdown from the widget name. + + /// + /// Get the CLI equive of the audio mixdown from the widget name. + /// + /// + /// + /// private string getMixDown(string selectedAudio) { switch (selectedAudio) @@ -948,7 +957,13 @@ namespace Handbrake.Functions return "dpl2"; } } - // Get the CLI equiv of the audio encoder from the widget name. + + /// + /// Get the CLI equiv of the audio encoder from the widget name. + /// + /// + /// + /// private string getAudioEncoder(string selectedEncoder) { switch (selectedEncoder) @@ -965,8 +980,14 @@ namespace Handbrake.Functions return ""; } } - // This function saves the data in the chapters tab, dataGridView into a CSV file called chapters.csv - // in a directory specified by file_path_name + + /// + /// This function saves the data in the chapters tab, dataGridView into a CSV file called chapters.csv + /// in a directory specified by file_path_name + /// + /// + /// + /// private Boolean chapterCSVSave(frmMain mainWindow, string file_path_name) { try @@ -996,7 +1017,7 @@ namespace Handbrake.Functions #endregion - #region frmMain Actions + #region Actions, Versioning etc /// /// Select the longest title in the DVD title dropdown menu on frmMain @@ -1157,10 +1178,6 @@ namespace Handbrake.Functions } } - #endregion - - #region Version and Update Checking - /// /// Checks for updates and returns true if an update is available. /// @@ -1192,6 +1209,7 @@ namespace Handbrake.Functions return false; } } + /// /// Get's HandBrakes version data from the CLI. /// @@ -1231,9 +1249,6 @@ namespace Handbrake.Functions return null; } - #endregion - - #region Queue /// /// Check if the queue recovery file contains records. /// If it does, it means the last queue did not complete before HandBrake closed. @@ -1267,6 +1282,7 @@ namespace Handbrake.Functions return false; } } + #endregion } diff --git a/win/C#/HandBrakeCS.csproj b/win/C#/HandBrakeCS.csproj index f290dd62f..d643bbb53 100644 --- a/win/C#/HandBrakeCS.csproj +++ b/win/C#/HandBrakeCS.csproj @@ -50,16 +50,19 @@ - pdbonly + full true bin\Release\ - TRACE + DEBUG;TRACE prompt 4 false false + true + false + true x86 diff --git a/win/C#/frmOptions.cs b/win/C#/frmOptions.cs index fb48f803d..2a7695fab 100644 --- a/win/C#/frmOptions.cs +++ b/win/C#/frmOptions.cs @@ -65,7 +65,7 @@ namespace Handbrake text_an_path.Text = Properties.Settings.Default.autoNamePath; - if (text_an_path.Text == "") + if (text_an_path.Text == string.Empty) text_an_path.Text = "Click 'Browse' to set the default location"; } @@ -139,7 +139,7 @@ namespace Handbrake private void text_an_path_TextChanged(object sender, EventArgs e) { - if (text_an_path.Text == "") + if (text_an_path.Text == string.Empty) { Properties.Settings.Default.autoNamePath = ""; text_an_path.Text = "Click 'Browse' to set the default location"; diff --git a/win/C#/frmQueue.cs b/win/C#/frmQueue.cs index e331b70f6..1cf293033 100644 --- a/win/C#/frmQueue.cs +++ b/win/C#/frmQueue.cs @@ -314,7 +314,7 @@ namespace Handbrake { string fullQuery = '"' + Application.StartupPath.ToString() + "\\HandBrakeCLI.exe" + '"' + query_item; - if (queries == "") + if (queries == string.Empty) queries = queries + fullQuery; else queries = queries + " && " + fullQuery;