// --------------------------------------------------------------------------------------------------------------------
//
// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
//
//
// A Preset for encoding with.
//
// --------------------------------------------------------------------------------------------------------------------
namespace HandBrake.ApplicationServices.Model
{
using Caliburn.Micro;
using HandBrake.ApplicationServices.Model.Audio;
using HandBrake.ApplicationServices.Model.Subtitle;
///
/// A Preset for encoding with.
///
public class Preset : PropertyChangedBase
{
#region Constants and Fields
///
/// The is default.
///
private bool isDefault;
#endregion
#region Properties
///
/// Gets or sets the category which the preset resides under
///
public string Category { get; set; }
///
/// Gets or sets the Description for the preset
///
public string Description { get; set; }
///
/// Gets or sets a value indicating whether this is a built in preset
///
public bool IsBuildIn { get; set; }
///
/// Gets or sets a value indicating whether IsDefault.
///
public bool IsDefault
{
get
{
return this.isDefault;
}
set
{
this.isDefault = value;
this.NotifyOfPropertyChange(() => this.IsDefault);
}
}
///
/// Gets or sets the preset name
///
public string Name { get; set; }
///
/// Gets or sets PictureSettingsMode.
/// Source Maximum, Custom or None
///
public PresetPictureSettingsMode PictureSettingsMode { get; set; }
///
/// Gets or sets a value indicating whether use deinterlace.
///
public bool UseDeinterlace { get; set; }
///
/// Gets or sets task.
///
public EncodeTask Task { get; set; }
///
/// Gets or sets a value indicating whether Picture Filters are used with this preset.
///
public bool UsePictureFilters { get; set; }
///
/// Gets or sets The version number which associates this preset with a HB build
///
public string Version { get; set; }
///
/// Gets or sets the audio track behaviours.
///
public AudioBehaviours AudioTrackBehaviours { get; set; }
///
/// Gets or sets the subtitle track behaviours.
///
public SubtitleBehaviours SubtitleTrackBehaviours { get; set; }
#endregion
#region Public Methods
///
/// Update this preset.
/// The given parameters should be copy-constructed.
///
///
/// The task.
///
///
/// The audio behaviours.
///
///
/// The subtitle behaviours.
///
public void Update(EncodeTask task, AudioBehaviours audioBehaviours, SubtitleBehaviours subtitleBehaviours)
{
// Copy over Max Width / Height for the following picture settings modes.
if (this.PictureSettingsMode == PresetPictureSettingsMode.Custom
|| this.PictureSettingsMode == PresetPictureSettingsMode.SourceMaximum)
{
task.MaxWidth = this.Task.MaxWidth;
task.MaxHeight = this.Task.MaxHeight;
}
this.Task = task;
this.AudioTrackBehaviours = audioBehaviours;
this.SubtitleTrackBehaviours = subtitleBehaviours;
}
///
/// Override the ToString Method
///
///
/// The Preset Name
///
public override string ToString()
{
return this.Name;
}
#endregion
}
}