diff options
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs')
-rw-r--r-- | win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs | 250 |
1 files changed, 174 insertions, 76 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs b/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs index 9a92eab80..3ef786629 100644 --- a/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs +++ b/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs @@ -1,7 +1,11 @@ -/* AudioTrack.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. */
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="AudioTrack.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// An Audio Track for the Audio Panel
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
namespace HandBrake.ApplicationServices.Model.Encoding
{
@@ -17,27 +21,56 @@ namespace HandBrake.ApplicationServices.Model.Encoding /// </summary>
public class AudioTrack : ModelBase
{
- #region Private Variables
+ #region Constants and Fields
+
/// <summary>
- /// The gain value
+ /// The bitrate.
/// </summary>
- private int gain;
+ private int bitrate;
/// <summary>
- /// The DRC Value
+ /// The DRC Value
/// </summary>
private double drc;
/// <summary>
- /// The Scanned Audio Track
+ /// The encoder.
+ /// </summary>
+ private AudioEncoder encoder;
+
+ /// <summary>
+ /// The gain value
+ /// </summary>
+ private int gain;
+
+ /// <summary>
+ /// The mix down.
+ /// </summary>
+ private Mixdown mixDown;
+
+ /// <summary>
+ /// The sample rate.
+ /// </summary>
+ private double sampleRate;
+
+ /// <summary>
+ /// The Scanned Audio Track
/// </summary>
[NonSerialized]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
private Audio scannedTrack;
+
+ /// <summary>
+ /// The track name.
+ /// </summary>
+ private string trackName;
+
#endregion
+ #region Constructors and Destructors
+
/// <summary>
- /// Initializes a new instance of the <see cref="AudioTrack"/> class.
+ /// Initializes a new instance of the <see cref = "AudioTrack" /> class.
/// </summary>
public AudioTrack()
{
@@ -50,166 +83,231 @@ namespace HandBrake.ApplicationServices.Model.Encoding this.ScannedTrack = new Audio();
}
+ #endregion
+
+ #region Public Properties
+
/// <summary>
- /// Gets the Audio Track Name
+ /// Gets AudioEncoderDisplayValue.
/// </summary>
- public int? Track
+ public string AudioEncoderDisplayValue
{
get
{
- if (this.ScannedTrack != null)
+ return EnumHelper<AudioEncoder>.GetDisplay(this.Encoder);
+ }
+ }
+
+ /// <summary>
+ /// Gets AudioMixdownDisplayValue.
+ /// </summary>
+ public string AudioMixdownDisplayValue
+ {
+ get
+ {
+ return EnumHelper<Mixdown>.GetDisplay(this.MixDown);
+ }
+ }
+
+ /// <summary>
+ /// Gets the The UI display value for bit rate
+ /// </summary>
+ public string BitRateDisplayValue
+ {
+ get
+ {
+ if (this.Encoder == AudioEncoder.Ac3Passthrough || this.Encoder == AudioEncoder.DtsPassthrough
+ || this.Encoder == AudioEncoder.DtsHDPassthrough)
{
- return this.ScannedTrack.TrackNumber;
+ return "Auto";
}
- return null;
+ return this.Bitrate.ToString();
}
}
/// <summary>
- /// Gets or sets the Scanned Audio Tracks
+ /// Gets or sets Audio Bitrate
/// </summary>
- [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
- public Audio ScannedTrack
+ public int Bitrate
{
get
{
- return this.scannedTrack;
+ return this.bitrate;
}
set
{
- this.scannedTrack = value;
- this.OnPropertyChanged("ScannedTrack");
- this.OnPropertyChanged("TrackDisplay");
+ this.bitrate = value;
+ this.OnPropertyChanged("Bitrate");
}
}
/// <summary>
- /// Gets the Display Value for this model.
+ /// Gets or sets Dynamic Range Compression
/// </summary>
- public string TrackDisplay
+ public double DRC
{
get
{
- return this.ScannedTrack == null ? string.Empty : this.ScannedTrack.ToString();
+ return this.drc;
+ }
+
+ set
+ {
+ if (!object.Equals(value, this.drc))
+ {
+ this.drc = value;
+ this.OnPropertyChanged("DRC");
+ }
}
}
/// <summary>
- /// Gets the The UI display value for sample rate
+ /// Gets or sets Audio Encoder
/// </summary>
- public string SampleRateDisplayValue
+ public AudioEncoder Encoder
{
get
{
- return this.SampleRate == 0 ? "Auto" : this.SampleRate.ToString();
+ return this.encoder;
+ }
+
+ set
+ {
+ this.encoder = value;
+ this.OnPropertyChanged("Encoder");
}
}
/// <summary>
- /// Gets the The UI display value for bit rate
+ /// Gets or sets the Gain for the audio track
/// </summary>
- public string BitRateDisplayValue
+ public int Gain
{
get
{
- if (this.Encoder == AudioEncoder.Ac3Passthrough || this.Encoder == AudioEncoder.DtsPassthrough ||
- this.Encoder == AudioEncoder.DtsHDPassthrough)
+ return this.gain;
+ }
+
+ set
+ {
+ if (!object.Equals(value, this.gain))
{
- return "Auto";
+ this.gain = value;
+ this.OnPropertyChanged("Gain");
}
-
- return this.Bitrate.ToString();
}
}
/// <summary>
- /// Gets AudioEncoderDisplayValue.
+ /// Gets or sets Audio Mixdown
/// </summary>
- public string AudioEncoderDisplayValue
+ public Mixdown MixDown
{
get
{
- return EnumHelper<AudioEncoder>.GetDisplay(this.Encoder);
+ return this.mixDown;
+ }
+
+ set
+ {
+ this.mixDown = value;
+ this.OnPropertyChanged("MixDown");
}
}
/// <summary>
- /// Gets AudioMixdownDisplayValue.
+ /// Gets or sets Audio SampleRate
/// </summary>
- public string AudioMixdownDisplayValue
+ public double SampleRate
{
get
{
- return EnumHelper<Mixdown>.GetDisplay(this.MixDown);
+ return this.sampleRate;
}
- }
+ set
+ {
+ this.sampleRate = value;
+ this.OnPropertyChanged("SampleRate");
+ }
+ }
/// <summary>
- /// Gets or sets Audio Mixdown
+ /// Gets the The UI display value for sample rate
/// </summary>
- public Mixdown MixDown { get; set; }
+ public string SampleRateDisplayValue
+ {
+ get
+ {
+ return this.SampleRate == 0 ? "Auto" : this.SampleRate.ToString();
+ }
+ }
/// <summary>
- /// Gets or sets Audio Encoder
+ /// Gets or sets the Scanned Audio Tracks
/// </summary>
- public AudioEncoder Encoder { get; set; }
+ [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+ public Audio ScannedTrack
+ {
+ get
+ {
+ return this.scannedTrack;
+ }
- /// <summary>
- /// Gets or sets Audio Bitrate
- /// </summary>
- public int Bitrate { get; set; }
+ set
+ {
+ this.scannedTrack = value;
+ this.OnPropertyChanged("ScannedTrack");
+ this.OnPropertyChanged("TrackDisplay");
+ }
+ }
/// <summary>
- /// Gets or sets Audio SampleRate
+ /// Gets the Audio Track Name
/// </summary>
- public double SampleRate { get; set; }
+ public int? Track
+ {
+ get
+ {
+ if (this.ScannedTrack != null)
+ {
+ return this.ScannedTrack.TrackNumber;
+ }
- /// <summary>
- /// Gets or sets TrackName.
- /// </summary>
- public string TrackName { get; set; }
+ return null;
+ }
+ }
/// <summary>
- /// Gets or sets Dynamic Range Compression
+ /// Gets the Display Value for this model.
/// </summary>
- public double DRC
+ public string TrackDisplay
{
get
{
- return this.drc;
- }
-
- set
- {
- if (!object.Equals(value, this.drc))
- {
- this.drc = value;
- this.OnPropertyChanged("DRC");
- }
+ return this.ScannedTrack == null ? string.Empty : this.ScannedTrack.ToString();
}
}
/// <summary>
- /// Gets or sets the Gain for the audio track
+ /// Gets or sets TrackName.
/// </summary>
- public int Gain
+ public string TrackName
{
get
{
- return this.gain;
+ return this.trackName;
}
set
{
- if (!object.Equals(value, this.gain))
- {
- this.gain = value;
- this.OnPropertyChanged("Gain");
- }
+ this.trackName = value;
+ this.OnPropertyChanged("TrackName");
}
}
+
+ #endregion
}
}
\ No newline at end of file |