summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/Model/Subtitles
diff options
context:
space:
mode:
authorsr55 <[email protected]>2015-01-04 20:54:02 +0000
committersr55 <[email protected]>2015-01-04 20:54:02 +0000
commitd9b030c21a0b104fb85400d9fc1526e6dc31acc0 (patch)
treed098751658d8949021664e3618069c149974ae5f /win/CS/HandBrakeWPF/Model/Subtitles
parent7856f5760bda5c33e86ad48c78bcc473f9597f96 (diff)
WinGui: Refracting some of the modelling around the Encode Services
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6685 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/Model/Subtitles')
-rw-r--r--win/CS/HandBrakeWPF/Model/Subtitles/SubtitleBehaviourModes.cs28
-rw-r--r--win/CS/HandBrakeWPF/Model/Subtitles/SubtitleBehaviours.cs166
2 files changed, 194 insertions, 0 deletions
diff --git a/win/CS/HandBrakeWPF/Model/Subtitles/SubtitleBehaviourModes.cs b/win/CS/HandBrakeWPF/Model/Subtitles/SubtitleBehaviourModes.cs
new file mode 100644
index 000000000..004190a5f
--- /dev/null
+++ b/win/CS/HandBrakeWPF/Model/Subtitles/SubtitleBehaviourModes.cs
@@ -0,0 +1,28 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="SubtitleBehaviourModes.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>
+// The subtitle behaviours modes.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.Model.Subtitles
+{
+ using System.ComponentModel.DataAnnotations;
+
+ /// <summary>
+ /// The subtitle behaviours modes.
+ /// </summary>
+ public enum SubtitleBehaviourModes
+ {
+ [Display(Name = "None")]
+ None = 0,
+
+ [Display(Name = "First Matching Selected Language")]
+ FirstMatch,
+
+ [Display(Name = "All Matching Selected Languages")]
+ AllMatching,
+ }
+}
diff --git a/win/CS/HandBrakeWPF/Model/Subtitles/SubtitleBehaviours.cs b/win/CS/HandBrakeWPF/Model/Subtitles/SubtitleBehaviours.cs
new file mode 100644
index 000000000..8bf58fb60
--- /dev/null
+++ b/win/CS/HandBrakeWPF/Model/Subtitles/SubtitleBehaviours.cs
@@ -0,0 +1,166 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="SubtitleBehaviours.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>
+// A class to track the behaviours of audio track selection
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.Model.Subtitles
+{
+ using System.ComponentModel;
+
+ using Caliburn.Micro;
+
+ /// <summary>
+ /// A class to track the behaviours of audio track selection
+ /// </summary>
+ public class SubtitleBehaviours : PropertyChangedBase
+ {
+ /// <summary>
+ /// The selected behaviour.
+ /// </summary>
+ private SubtitleBehaviourModes selectedBehaviour;
+
+ /// <summary>
+ /// The selected langauges.
+ /// </summary>
+ private BindingList<string> selectedLangauges;
+
+ /// <summary>
+ /// The add foreign audio scan track.
+ /// </summary>
+ private bool addForeignAudioScanTrack;
+
+ /// <summary>
+ /// The add closed captions.
+ /// </summary>
+ private bool addClosedCaptions;
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="SubtitleBehaviours"/> class.
+ /// </summary>
+ public SubtitleBehaviours()
+ {
+ this.SelectedBehaviour = SubtitleBehaviourModes.None;
+ this.SelectedLangauges = new BindingList<string>();
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="SubtitleBehaviours"/> class.
+ /// </summary>
+ /// <param name="behaviours">
+ /// The behaviours.
+ /// </param>
+ public SubtitleBehaviours(SubtitleBehaviours behaviours)
+ {
+ this.SelectedBehaviour = behaviours.selectedBehaviour;
+ this.SelectedLangauges = new BindingList<string>(behaviours.SelectedLangauges);
+ }
+
+ /// <summary>
+ /// Gets or sets the selected behaviour.
+ /// </summary>
+ public SubtitleBehaviourModes SelectedBehaviour
+ {
+ get
+ {
+ return this.selectedBehaviour;
+ }
+ set
+ {
+ if (value == this.selectedBehaviour)
+ {
+ return;
+ }
+ this.selectedBehaviour = value;
+ this.NotifyOfPropertyChange(() => this.SelectedBehaviour);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the selected langages.
+ /// </summary>
+ public BindingList<string> SelectedLangauges
+ {
+ get
+ {
+ return this.selectedLangauges;
+ }
+ set
+ {
+ if (Equals(value, this.selectedLangauges))
+ {
+ return;
+ }
+ this.selectedLangauges = value;
+ this.NotifyOfPropertyChange(() => this.SelectedLangauges);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether add foreign audio scan track.
+ /// </summary>
+ public bool AddForeignAudioScanTrack
+ {
+ get
+ {
+ return this.addForeignAudioScanTrack;
+ }
+ set
+ {
+ if (value.Equals(this.addForeignAudioScanTrack))
+ {
+ return;
+ }
+ this.addForeignAudioScanTrack = value;
+ this.NotifyOfPropertyChange(() => this.AddForeignAudioScanTrack);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether add closed captions.
+ /// </summary>
+ public bool AddClosedCaptions
+ {
+ get
+ {
+ return this.addClosedCaptions;
+ }
+ set
+ {
+ if (value.Equals(this.addClosedCaptions))
+ {
+ return;
+ }
+ this.addClosedCaptions = value;
+ this.NotifyOfPropertyChange(() => this.AddClosedCaptions);
+ }
+ }
+
+ /// <summary>
+ /// Clone this object
+ /// </summary>
+ /// <returns>
+ /// The <see cref="object"/>.
+ /// </returns>
+ public SubtitleBehaviours Clone()
+ {
+ SubtitleBehaviours cloned = new SubtitleBehaviours
+ {
+ SelectedBehaviour = this.selectedBehaviour,
+ SelectedLangauges = new BindingList<string>(),
+ AddClosedCaptions = this.addClosedCaptions,
+ AddForeignAudioScanTrack = this.addForeignAudioScanTrack,
+ };
+
+ foreach (var item in this.SelectedLangauges)
+ {
+ cloned.SelectedLangauges.Add(item);
+ }
+
+ return cloned;
+ }
+ }
+}