summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrake.ApplicationServices
diff options
context:
space:
mode:
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices')
-rw-r--r--win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj1
-rw-r--r--win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs25
-rw-r--r--win/CS/HandBrake.ApplicationServices/Model/ModelBase.cs22
-rw-r--r--win/CS/HandBrake.ApplicationServices/Utilities/QueryParserUtility.cs8
4 files changed, 54 insertions, 2 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj b/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj
index 48a1eb08a..7f4592241 100644
--- a/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj
+++ b/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj
@@ -116,6 +116,7 @@
<Compile Include="Model\Encoding\VideoEncodeRateMode.cs" />
<Compile Include="Model\General\UpdateCheckInformation.cs" />
<Compile Include="Model\General\UpdateCheckResult.cs" />
+ <Compile Include="Model\ModelBase.cs" />
<Compile Include="Model\Preset.cs" />
<Compile Include="Model\QueueTask.cs" />
<Compile Include="Model\Encoding\SubtitleType.cs" />
diff --git a/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs b/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs
index 6e47d3421..a6db51572 100644
--- a/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs
+++ b/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs
@@ -8,8 +8,15 @@ namespace HandBrake.ApplicationServices.Model.Encoding
/// <summary>
/// An Audio Track for the Audio Panel
/// </summary>
- public class AudioTrack
+ public class AudioTrack : ModelBase
{
+ #region Private Variables
+ /// <summary>
+ /// The gain value
+ /// </summary>
+ private int gain;
+ #endregion
+
/// <summary>
/// Initializes a new instance of the <see cref="AudioTrack"/> class.
/// </summary>
@@ -97,6 +104,20 @@ namespace HandBrake.ApplicationServices.Model.Encoding
/// <summary>
/// Gets or sets the Gain for the audio track
/// </summary>
- public int Gain { get; set; }
+ public int Gain
+ {
+ get
+ {
+ return this.gain;
+ }
+ set
+ {
+ if (!object.Equals(value, this.gain))
+ {
+ this.gain = value;
+ this.OnPropertyChanged("Gain");
+ }
+ }
+ }
}
} \ No newline at end of file
diff --git a/win/CS/HandBrake.ApplicationServices/Model/ModelBase.cs b/win/CS/HandBrake.ApplicationServices/Model/ModelBase.cs
new file mode 100644
index 000000000..041b18eb3
--- /dev/null
+++ b/win/CS/HandBrake.ApplicationServices/Model/ModelBase.cs
@@ -0,0 +1,22 @@
+/* ModelBase.cs $
+ This file is part of the HandBrake source code.
+ Homepage: <http://handbrake.fr>.
+ It may be used under the terms of the GNU General Public License. */
+
+namespace HandBrake.ApplicationServices.Model
+{
+ using System.ComponentModel;
+
+ public class ModelBase : INotifyPropertyChanged
+ {
+ public event PropertyChangedEventHandler PropertyChanged;
+
+ protected virtual void OnPropertyChanged(string propertyName)
+ {
+ if (null != PropertyChanged)
+ {
+ PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
+ }
+ }
+ }
+}
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/QueryParserUtility.cs b/win/CS/HandBrake.ApplicationServices/Utilities/QueryParserUtility.cs
index 4d34ac937..62de5d6d6 100644
--- a/win/CS/HandBrake.ApplicationServices/Utilities/QueryParserUtility.cs
+++ b/win/CS/HandBrake.ApplicationServices/Utilities/QueryParserUtility.cs
@@ -98,6 +98,7 @@ namespace HandBrake.ApplicationServices.Utilities
Match audioBitrates = Regex.Match(input, @"-B ([0-9a-zA-Z,]*)"); // Auto = a-z
Match audioSampleRates = Regex.Match(input, @"-R ([0-9a-zA-Z.,]*)"); // Auto = a-z
Match drcValues = Regex.Match(input, @"-D ([0-9.,]*)");
+ Match gainValues = Regex.Match(input, @"--gain=([0-9.,-]*)");
// Chapters Tab
Match chapterMarkers = Regex.Match(input, @" -m");
@@ -338,6 +339,7 @@ namespace HandBrake.ApplicationServices.Utilities
string[] trackBitrates = null;
string[] trackSamplerates = null;
string[] trackDRCvalues = null;
+ string[] trackGainValues = null;
if (audioTracks.Success)
trackData = audioTracks.ToString().Replace("-a ", string.Empty).Split(',');
@@ -351,6 +353,8 @@ namespace HandBrake.ApplicationServices.Utilities
trackSamplerates = audioSampleRates.ToString().Replace("-R ", string.Empty).Split(',');
if (drcValues.Success)
trackDRCvalues = drcValues.ToString().Replace("-D ", string.Empty).Split(',');
+ if (gainValues.Success)
+ trackGainValues = gainValues.ToString().Replace("--gain=", string.Empty).Split(',');
// Create new Audio Track Classes and store them in the ArrayList
List<AudioTrack> allAudioTrackInfo = new List<AudioTrack>();
@@ -381,6 +385,10 @@ namespace HandBrake.ApplicationServices.Utilities
if (trackDRCvalues.Length >= (x + 1)) // Audio DRC Values
track.DRC = double.Parse(trackDRCvalues[x].Trim(), Culture);
+ if (trackGainValues != null)
+ if (trackGainValues.Length >= (x + 1)) // Audio DRC Values
+ track.Gain = int.Parse(trackGainValues[x].Trim());
+
allAudioTrackInfo.Add(track);
}