diff options
author | sr55 <[email protected]> | 2015-01-04 20:54:02 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2015-01-04 20:54:02 +0000 |
commit | d9b030c21a0b104fb85400d9fc1526e6dc31acc0 (patch) | |
tree | d098751658d8949021664e3618069c149974ae5f /win/CS/HandBrakeWPF/Model/Audio | |
parent | 7856f5760bda5c33e86ad48c78bcc473f9597f96 (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/Audio')
-rw-r--r-- | win/CS/HandBrakeWPF/Model/Audio/AudioBehaviourModes.cs | 28 | ||||
-rw-r--r-- | win/CS/HandBrakeWPF/Model/Audio/AudioBehaviours.cs | 115 |
2 files changed, 143 insertions, 0 deletions
diff --git a/win/CS/HandBrakeWPF/Model/Audio/AudioBehaviourModes.cs b/win/CS/HandBrakeWPF/Model/Audio/AudioBehaviourModes.cs new file mode 100644 index 000000000..811ba154b --- /dev/null +++ b/win/CS/HandBrakeWPF/Model/Audio/AudioBehaviourModes.cs @@ -0,0 +1,28 @@ +// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="AudioBehaviourModes.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 audio behaviours.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.Model.Audio
+{
+ using System.ComponentModel.DataAnnotations;
+
+ /// <summary>
+ /// The audio behaviours.
+ /// </summary>
+ public enum AudioBehaviourModes
+ {
+ [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/Audio/AudioBehaviours.cs b/win/CS/HandBrakeWPF/Model/Audio/AudioBehaviours.cs new file mode 100644 index 000000000..e6bb5a398 --- /dev/null +++ b/win/CS/HandBrakeWPF/Model/Audio/AudioBehaviours.cs @@ -0,0 +1,115 @@ +// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="AudioBehaviours.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>
+// Audio Behaviours
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.Model.Audio
+{
+ using System.ComponentModel;
+
+ using Caliburn.Micro;
+
+ /// <summary>
+ /// Audio Behaviours
+ /// </summary>
+ public class AudioBehaviours : PropertyChangedBase
+ {
+ /// <summary>
+ /// The selected behaviour.
+ /// </summary>
+ private AudioBehaviourModes selectedBehaviour;
+
+ /// <summary>
+ /// The selected langauges.
+ /// </summary>
+ private BindingList<string> selectedLangauges;
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="AudioBehaviours"/> class.
+ /// </summary>
+ public AudioBehaviours()
+ {
+ this.SelectedBehaviour = AudioBehaviourModes.None;
+ this.SelectedLangauges = new BindingList<string>();
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="AudioBehaviours"/> class.
+ /// </summary>
+ /// <param name="behaviours">
+ /// The behaviours.
+ /// </param>
+ public AudioBehaviours(AudioBehaviours behaviours)
+ {
+ this.SelectedBehaviour = behaviours.SelectedBehaviour;
+ this.SelectedLangauges = new BindingList<string>(behaviours.selectedLangauges);
+ }
+
+ /// <summary>
+ /// Gets or sets the selected behaviour.
+ /// </summary>
+ public AudioBehaviourModes SelectedBehaviour
+ {
+ get
+ {
+ return this.selectedBehaviour;
+ }
+
+ set
+ {
+ if (value == this.selectedBehaviour)
+ {
+ return;
+ }
+ this.selectedBehaviour = value;
+ this.NotifyOfPropertyChange(() => this.SelectedBehaviour);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the selected langauges.
+ /// </summary>
+ public BindingList<string> SelectedLangauges
+ {
+ get
+ {
+ return this.selectedLangauges;
+ }
+ set
+ {
+ if (Equals(value, this.selectedLangauges))
+ {
+ return;
+ }
+ this.selectedLangauges = value;
+ this.NotifyOfPropertyChange(() => this.SelectedLangauges);
+ }
+ }
+
+ /// <summary>
+ /// Clone this object
+ /// </summary>
+ /// <returns>
+ /// The <see cref="object"/>.
+ /// </returns>
+ public AudioBehaviours Clone()
+ {
+ AudioBehaviours cloned = new AudioBehaviours
+ {
+ SelectedBehaviour = this.selectedBehaviour,
+ SelectedLangauges = new BindingList<string>()
+ };
+
+ foreach (var item in this.SelectedLangauges)
+ {
+ cloned.SelectedLangauges.Add(item);
+ }
+
+ return cloned;
+ }
+ }
+}
|