- 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
hbproc.Dispose();\r
hbproc.Close();\r
}\r
hbproc.Dispose();\r
hbproc.Close();\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
/// <summary>\r
/// This function takes in a Query which has been parsed by QueryParser and\r
/// set's all the GUI widgets correctly.\r
#region Audio\r
\r
// Handle Track 1\r
#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
\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
mainWindow.drp_audenc_2.Enabled = true;\r
mainWindow.drp_audbit_2.Enabled = true;\r
mainWindow.drp_audsr_2.Text = "48";\r
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
}\r
else if (presetQuery.AudioTrack2 == "None")\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
\r
/// <summary>\r
/// Generates a CLI query based on the GUI widgets.\r
query += generateTabbedComponentsQuery(mainWindow, mainWindow.text_source.Text);\r
return query;\r
}\r
query += generateTabbedComponentsQuery(mainWindow, mainWindow.text_source.Text);\r
return query;\r
}\r
/// <summary>\r
/// Generates a CLI query for the preview function.\r
/// This basically forces a shortened version of the encdode.\r
/// <summary>\r
/// Generates a CLI query for the preview function.\r
/// This basically forces a shortened version of the encdode.\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
private string generateTabbedComponentsQuery(frmMain mainWindow, string source)\r
{\r
string query = "";\r
query += " -a " + tempSub[0];\r
}\r
\r
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
{\r
string[] tempSub;\r
tempSub = track2.Split(' ');\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
private string getMixDown(string selectedAudio)\r
{\r
switch (selectedAudio)\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
private string getAudioEncoder(string selectedEncoder)\r
{\r
switch (selectedEncoder)\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
private Boolean chapterCSVSave(frmMain mainWindow, string file_path_name)\r
{\r
try\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
\r
/// <summary>\r
/// Select the longest title in the DVD title dropdown menu on frmMain\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
/// <summary>\r
/// Checks for updates and returns true if an update is available.\r
/// </summary>\r
/// <summary>\r
/// Get's HandBrakes version data from the CLI.\r
/// </summary>\r
/// <summary>\r
/// Get's HandBrakes version data from the CLI.\r
/// </summary>\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
/// <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
</DocumentationFile>\r
</PropertyGroup>\r
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
</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
<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
<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
</PropertyGroup>\r
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">\r
<PlatformTarget>x86</PlatformTarget>\r
\r
text_an_path.Text = Properties.Settings.Default.autoNamePath;\r
\r
\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
text_an_path.Text = "Click 'Browse' to set the default location"; \r
}\r
\r
\r
private void text_an_path_TextChanged(object sender, EventArgs e)\r
{\r
\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
{\r
Properties.Settings.Default.autoNamePath = "";\r
text_an_path.Text = "Click 'Browse' to set the default location";\r
{\r
string fullQuery = '"' + Application.StartupPath.ToString() + "\\HandBrakeCLI.exe" + '"' + query_item;\r
\r
{\r
string fullQuery = '"' + Application.StartupPath.ToString() + "\\HandBrakeCLI.exe" + '"' + query_item;\r
\r
+ if (queries == string.Empty)\r
queries = queries + fullQuery;\r
else\r
queries = queries + " && " + fullQuery;\r
queries = queries + fullQuery;\r
else\r
queries = queries + " && " + fullQuery;\r