summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrake.ApplicationServices/Utilities
diff options
context:
space:
mode:
authorsr55 <[email protected]>2011-04-08 19:34:20 +0000
committersr55 <[email protected]>2011-04-08 19:34:20 +0000
commit5f692a69a63f106cabe9dad4dfc85cc5c6d93cb9 (patch)
tree8f9762b3f7a4ad797ba7e8016d1d25bc9f94f709 /win/CS/HandBrake.ApplicationServices/Utilities
parent122c93f2b05790907e79c9a292342b3763399948 (diff)
WinGui: AudioPanel refactored.
- Switch the Audio panel to use DataBinding to a BindingList collection leading to much cleaner code. - Added gain support (--gain=3,4) to the services library. (UI has not been done yet) git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3911 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Utilities')
-rw-r--r--win/CS/HandBrake.ApplicationServices/Utilities/PlistUtility.cs8
-rw-r--r--win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs9
-rw-r--r--win/CS/HandBrake.ApplicationServices/Utilities/QueryParserUtility.cs2
3 files changed, 12 insertions, 7 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/PlistUtility.cs b/win/CS/HandBrake.ApplicationServices/Utilities/PlistUtility.cs
index 0a8aa72ec..752141bf0 100644
--- a/win/CS/HandBrake.ApplicationServices/Utilities/PlistUtility.cs
+++ b/win/CS/HandBrake.ApplicationServices/Utilities/PlistUtility.cs
@@ -68,7 +68,7 @@ namespace HandBrake.ApplicationServices.Utilities
track.SampleRate = double.Parse(value);
break;
case "AudioTrack":
- track.Track = int.Parse(value);
+ track.SourceTrack = value;
break;
case "AudioTrackDRCSlider":
track.DRC = double.Parse(value);
@@ -528,7 +528,7 @@ namespace HandBrake.ApplicationServices.Utilities
// Video Settings
AddEncodeElement(xmlWriter, "VideoAvgBitrate", "string", parsed.VideoBitrate.ToString());
- AddEncodeElement(xmlWriter, "VideoEncoder", "string", EnumHelper.GetDescription(parsed.VideoEncoder));
+ AddEncodeElement(xmlWriter, "VideoEncoder", "string", EnumHelper<Enum>.GetDescription(parsed.VideoEncoder));
AddEncodeElement(xmlWriter, "VideoFramerate", "string", parsed.Framerate.ToString());
AddEncodeElement(xmlWriter, "VideFrameratePFR", "integer", parsed.FramerateMode == FramerateMode.PFR ? "1" : "0");
AddEncodeElement(xmlWriter, "VideoGrayScale", "integer", parsed.Grayscale ? "1" : "0");
@@ -636,10 +636,10 @@ namespace HandBrake.ApplicationServices.Utilities
xmlWriter.WriteElementString("string", audioTrack.Bitrate.ToString());
xmlWriter.WriteElementString("key", "AudioEncoder");
- xmlWriter.WriteElementString("string", EnumHelper.GetDescription(audioTrack.Encoder));
+ xmlWriter.WriteElementString("string", EnumHelper<Enum>.GetDescription(audioTrack.Encoder));
xmlWriter.WriteElementString("key", "AudioMixdown");
- xmlWriter.WriteElementString("string", EnumHelper.GetDescription(audioTrack.MixDown));
+ xmlWriter.WriteElementString("string", EnumHelper<Enum>.GetDescription(audioTrack.MixDown));
xmlWriter.WriteElementString("key", "AudioSamplerate");
xmlWriter.WriteElementString("string", audioTrack.SampleRate.ToString());
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs b/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs
index ce963188f..bd75880b9 100644
--- a/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs
+++ b/win/CS/HandBrake.ApplicationServices/Utilities/QueryGeneratorUtility.cs
@@ -136,7 +136,7 @@ namespace HandBrake.ApplicationServices.Utilities
{
string query = string.Empty;
- query += string.Format(" -f {0} ", EnumHelper.GetDescription(task.OutputFormat).ToLower());
+ query += string.Format(" -f {0} ", EnumHelper<Enum>.GetDescription(task.OutputFormat).ToLower());
// These are output settings features
if (task.LargeFile)
@@ -373,7 +373,12 @@ namespace HandBrake.ApplicationServices.Utilities
// Gather information about each audio track and store them in the declared lists.
foreach (AudioTrack track in audioTracks)
{
- tracks.Add(track.Track);
+ if (track.Track == null)
+ {
+ continue;
+ }
+
+ tracks.Add(track.Track.Value);
// Audio Codec (-E)
codecs.Add(track.Encoder);
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/QueryParserUtility.cs b/win/CS/HandBrake.ApplicationServices/Utilities/QueryParserUtility.cs
index 856114bb0..4d34ac937 100644
--- a/win/CS/HandBrake.ApplicationServices/Utilities/QueryParserUtility.cs
+++ b/win/CS/HandBrake.ApplicationServices/Utilities/QueryParserUtility.cs
@@ -359,7 +359,7 @@ namespace HandBrake.ApplicationServices.Utilities
AudioTrack track = new AudioTrack();
if (trackData != null)
if (trackData.Length >= (x + 1)) // Audio Track
- track.Track = int.Parse(trackData[x].Trim());
+ track.SourceTrack = trackData[x].Trim();
if (trackMixes != null)
if (trackMixes.Length >= (x + 1)) // Audio Mix