// -------------------------------------------------------------------------------------------------------------------- // // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // // // The Advanced View Model // // -------------------------------------------------------------------------------------------------------------------- namespace HandBrakeWPF.ViewModels { using System.ComponentModel.Composition; using Caliburn.Micro; using HandBrake.ApplicationServices.Model; using HandBrake.ApplicationServices.Services.Interfaces; using HandBrake.Interop.Model.Encoding.x264; using HandBrakeWPF.ViewModels.Interfaces; /// /// The Advanced View Model /// [Export(typeof(IAdvancedViewModel))] public class AdvancedViewModel : ViewModelBase, IAdvancedViewModel { #region Constants and Fields /// /// The query. /// private string query; /// /// The x264 preset. /// private x264Preset x264Preset; /// /// The x264 profile. /// private x264Profile x264Profile; /// /// The x264 tune. /// private x264Tune x264Tune; #endregion #region Constructors and Destructors /// /// Initializes a new instance of the class. /// /// /// The window manager. /// /// /// The user Setting Service. /// public AdvancedViewModel(IWindowManager windowManager, IUserSettingService userSettingService) { } #endregion #region Public Properties /// /// Gets or sets State. /// public string Query { get { return this.query; } set { this.query = value; this.NotifyOfPropertyChange(() => this.Query); } } /// /// Gets or sets X264Preset. /// public x264Preset X264Preset { get { return this.x264Preset; } set { this.x264Preset = value; this.NotifyOfPropertyChange(() => this.X264Preset); } } /// /// Gets or sets X264Profile. /// public x264Profile X264Profile { get { return this.x264Profile; } set { this.x264Profile = value; this.NotifyOfPropertyChange(() => this.X264Profile); } } /// /// Gets or sets X264Tune. /// public x264Tune X264Tune { get { return this.x264Tune; } set { this.x264Tune = value; this.NotifyOfPropertyChange(() => this.X264Tune); } } #endregion #region Public Methods /// /// Set the selected preset /// /// /// The preset. /// public void SetPreset(Preset preset) { this.Query = preset.Task.AdvancedEncoderOptions; this.X264Preset = preset.Task.x264Preset; this.X264Profile = preset.Task.x264Profile; this.X264Tune = preset.Task.X264Tune; } #endregion } }