summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrake.ApplicationServices/Utilities
diff options
context:
space:
mode:
authorsr55 <[email protected]>2012-08-05 15:02:10 +0000
committersr55 <[email protected]>2012-08-05 15:02:10 +0000
commit7617bc4c41c7d79e1676e7edadd0ba71579c7ce3 (patch)
treea418ade8fd322997cd7ccc94dd96fdd91928796e /win/CS/HandBrake.ApplicationServices/Utilities
parent2418ee8d40fe9adde205a51dbe67bfb2b7cd660d (diff)
WinGui: Add Audio Track Name option back in. For now, I've used a toggle button on the audio track to expand the row to show hidden audio options.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4890 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Utilities')
-rw-r--r--win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs27
1 files changed, 27 insertions, 0 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs b/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs
index a3c84f089..c22ef6926 100644
--- a/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs
+++ b/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs
@@ -494,6 +494,7 @@ namespace HandBrake.ApplicationServices.Utilities
List<int> bitrates = new List<int>();
List<double> drcs = new List<double>();
List<double> gains = new List<double>();
+ List<string> trackNames = new List<string>();
// No Audio
if (audioTracks.Count == 0)
@@ -526,6 +527,9 @@ namespace HandBrake.ApplicationServices.Utilities
// Gain (--gain)
gains.Add(track.IsPassthru ? 0 : track.Gain);
+
+ // Audio Track Name (--aname)
+ trackNames.Add(track.TrackName);
}
// Audio Track (-a)
@@ -645,6 +649,29 @@ namespace HandBrake.ApplicationServices.Utilities
if (audioItems.Trim() != String.Empty)
query += " --gain " + audioItems;
+ audioItems = string.Empty; // Reset for another pass.
+ firstLoop = true;
+
+ // Audio Track Names (--aname)
+ bool foundTrackName = false;
+ foreach (string trackName in trackNames)
+ {
+ if (!string.IsNullOrEmpty(trackName))
+ {
+ foundTrackName = true;
+ }
+
+ if (firstLoop)
+ {
+ audioItems = string.IsNullOrEmpty(trackName) ? "\"\"" : string.Format("\"{0}\"", trackName.Trim());
+ firstLoop = false;
+ }
+ else
+ audioItems += "," + (string.IsNullOrEmpty(trackName) ? "\"\"" : string.Format("\"{0}\"", trackName.Trim()));
+ }
+ if (foundTrackName)
+ query += string.Format(" --aname={0}", audioItems);
+
// Passthru Settings
if (task.AllowedPassthruOptions != null)
{