diff options
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Model')
-rw-r--r-- | win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs | 250 | ||||
-rw-r--r-- | win/CS/HandBrake.ApplicationServices/Model/Encoding/SubtitleTrack.cs | 105 |
2 files changed, 248 insertions, 107 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 diff --git a/win/CS/HandBrake.ApplicationServices/Model/Encoding/SubtitleTrack.cs b/win/CS/HandBrake.ApplicationServices/Model/Encoding/SubtitleTrack.cs index f69abed7d..fa7dfd10e 100644 --- a/win/CS/HandBrake.ApplicationServices/Model/Encoding/SubtitleTrack.cs +++ b/win/CS/HandBrake.ApplicationServices/Model/Encoding/SubtitleTrack.cs @@ -1,82 +1,123 @@ -/* SubtitleTrack.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="SubtitleTrack.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>
+// Subtitle Information
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
namespace HandBrake.ApplicationServices.Model.Encoding
{
+ using System;
using System.Windows.Forms;
+ using HandBrake.ApplicationServices.Parsing;
+
/// <summary>
/// Subtitle Information
/// </summary>
- public class SubtitleTrack
+ public class SubtitleTrack : ModelBase
{
- /// <summary>
- /// Gets or sets Track.
- /// </summary>
- public string Track { get; set; }
+ #region Constants and Fields
/// <summary>
- /// Gets or sets a value indicating whether Forced.
+ /// The source track.
/// </summary>
- public bool Forced { get; set; }
+ private Subtitle sourceTrack;
+
+ #endregion
+
+ #region Public Properties
/// <summary>
- /// Gets or sets a value indicating whether Burned.
+ /// Gets or sets a value indicating whether Burned.
/// </summary>
public bool Burned { get; set; }
/// <summary>
- /// Gets or sets a value indicating whether Default.
+ /// Gets or sets a value indicating whether Default.
/// </summary>
public bool Default { get; set; }
- #region SRT Specific Options
+ /// <summary>
+ /// Gets or sets a value indicating whether Forced.
+ /// </summary>
+ public bool Forced { get; set; }
/// <summary>
- /// Gets or sets the SRT Language
+ /// Gets a value indicating whether this is an SRT subtitle.
/// </summary>
- public string SrtLang { get; set; }
+ public bool IsSrtSubtitle
+ {
+ get
+ {
+ return this.SrtFileName != "-";
+ }
+ }
/// <summary>
- /// Gets or sets the SRT Character Code
+ /// Gets or sets Track.
/// </summary>
- public string SrtCharCode { get; set; }
+ [Obsolete("Use SourceTrack Instead")]
+ public string Track { get; set; }
+
/// <summary>
- /// Gets or sets the SRT Offset
+ /// Gets or sets SourceTrack.
/// </summary>
- public int SrtOffset { get; set; }
+ public Subtitle SourceTrack
+ {
+ get
+ {
+ return this.sourceTrack;
+ }
+
+ set
+ {
+ this.sourceTrack = value;
+ this.OnPropertyChanged("SourceTrack");
+ if (this.sourceTrack != null)
+ {
+ this.Track = this.sourceTrack.ToString();
+ }
+ }
+ }
/// <summary>
- /// Gets or sets the Path to the SRT file
+ /// Gets or sets the SRT Character Code
/// </summary>
- public string SrtPath { get; set; }
+ public string SrtCharCode { get; set; }
/// <summary>
- /// Gets or sets the SRT Filename
+ /// Gets or sets the SRT Filename
/// </summary>
public string SrtFileName { get; set; }
/// <summary>
- /// Gets a value indicating whether this is an SRT subtitle.
+ /// Gets or sets the SRT Language
/// </summary>
- public bool IsSrtSubtitle
- {
- get { return this.SrtFileName != "-"; }
- }
+ public string SrtLang { get; set; }
- #endregion
+ /// <summary>
+ /// Gets or sets the SRT Offset
+ /// </summary>
+ public int SrtOffset { get; set; }
/// <summary>
- /// Gets or sets the type of the subtitle
+ /// Gets or sets the Path to the SRT file
+ /// </summary>
+ public string SrtPath { get; set; }
+
+ /// <summary>
+ /// Gets or sets the type of the subtitle
/// </summary>
public SubtitleType SubtitleType { get; set; }
/// <summary>
- /// Gets A ListViewItem Containing information about this subitlte
+ /// Gets A ListViewItem Containing information about this subitlte
/// </summary>
+ [Obsolete("Used only for the old forms gui. Will be removed.")]
public ListViewItem ListView
{
get
@@ -91,5 +132,7 @@ namespace HandBrake.ApplicationServices.Model.Encoding return listTrack;
}
}
+
+ #endregion
}
}
\ No newline at end of file |