// -------------------------------------------------------------------------------------------------------------------- // // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // // // The Meta Data Tab // // -------------------------------------------------------------------------------------------------------------------- namespace HandBrakeWPF.ViewModels { using Caliburn.Micro; using HandBrakeWPF.Services.Encode.Model; using HandBrakeWPF.Services.Encode.Model.Models; using HandBrakeWPF.Services.Interfaces; using HandBrakeWPF.Services.Presets.Model; using HandBrakeWPF.Services.Scan.Model; using HandBrakeWPF.ViewModels.Interfaces; /// /// The meta data view model. /// public class MetaDataViewModel : ViewModelBase, IMetaDataViewModel { private EncodeTask task; private MetaData metaData; /// /// Initializes a new instance of the class. /// /// /// The window Manager. /// /// /// The user Setting Service. /// public MetaDataViewModel(IWindowManager windowManager, IUserSettingService userSettingService) { this.Task = new EncodeTask(); } /// /// The Current Job /// public EncodeTask Task { get { return this.task; } set { this.task = value; if (this.task != null) { this.MetaData = this.task.MetaData; } this.NotifyOfPropertyChange(() => this.Task); } } /// /// Gets or sets the meta data. /// public MetaData MetaData { get { return this.metaData; } set { this.metaData = value; this.NotifyOfPropertyChange(() => this.MetaData); } } /// /// Setup the window after a scan. /// /// /// The source. /// /// /// The selected title. /// /// /// The Current preset /// /// /// The task. /// public void SetSource(Source source, Title selectedTitle, Preset currentPreset, EncodeTask encodeTask) { this.Task = encodeTask; } /// /// Set the selected preset /// /// /// The preset. /// /// /// The task. /// public void SetPreset(Preset preset, EncodeTask encodeTask) { this.Task = encodeTask; } /// /// Update all the UI controls based on the encode task passed in. /// /// /// The task. /// public void UpdateTask(EncodeTask encodeTask) { this.Task = encodeTask; } } }