summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsr55 <[email protected]>2008-09-05 14:46:56 +0000
committersr55 <[email protected]>2008-09-05 14:46:56 +0000
commit2d4587713e70ea729e5e4f20e4d72407e7a66633 (patch)
tree53fa5d99836e10622d7c764c5036516bab02e777
parent52482a772acdb03a8b77d4d605f3c7678de20e11 (diff)
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
-rw-r--r--win/C#/Functions/Common.cs62
-rw-r--r--win/C#/HandBrakeCS.csproj7
-rw-r--r--win/C#/frmOptions.cs4
-rw-r--r--win/C#/frmQueue.cs2
4 files changed, 47 insertions, 28 deletions
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();
}
+
/// <summary>
/// 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
/// <summary>
/// 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;
}
+
/// <summary>
/// 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.
+ /// <summary>
+ /// Generates part of the CLI query, for the tabbed components only.
+ /// </summary>
+ /// <param name="mainWindow"></param>
+ /// <param name="source"></param>
+ /// <returns></returns>
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.
+
+ /// <summary>
+ /// Get the CLI equive of the audio mixdown from the widget name.
+ /// </summary>
+ /// <param name="selectedAudio"></param>
+ /// <returns></returns>
+ ///
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.
+
+ /// <summary>
+ /// Get the CLI equiv of the audio encoder from the widget name.
+ /// </summary>
+ /// <param name="selectedEncoder"></param>
+ /// <returns></returns>
+ ///
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
+
+ /// <summary>
+ /// 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
+ /// </summary>
+ /// <param name="mainWindow"></param>
+ /// <param name="file_path_name"></param>
+ /// <returns></returns>
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
/// <summary>
/// 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
-
/// <summary>
/// Checks for updates and returns true if an update is available.
/// </summary>
@@ -1192,6 +1209,7 @@ namespace Handbrake.Functions
return false;
}
}
+
/// <summary>
/// Get's HandBrakes version data from the CLI.
/// </summary>
@@ -1231,9 +1249,6 @@ namespace Handbrake.Functions
return null;
}
- #endregion
-
- #region Queue
/// <summary>
/// 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 @@
</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
+ <DebugType>full</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<UseVSHostingProcess>false</UseVSHostingProcess>
<DocumentationFile>
</DocumentationFile>
+ <CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
+ <NoStdLib>false</NoStdLib>
+ <DebugSymbols>true</DebugSymbols>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
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;