// --------------------------------------------------------------------------------------------------------------------
//
// 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 HandBrake.ApplicationServices.Interop.Model.Encoding;
using HandBrakeWPF.Services.Presets.Model;
using HandBrakeWPF.Services.Scan.Model;
using HandBrakeWPF.ViewModels.Interfaces;
using EncodeTask = HandBrakeWPF.Services.Encode.Model.EncodeTask;
///
/// The Advanced View Model
///
public class AdvancedViewModel : ViewModelBase, IAdvancedViewModel
{
#region Constants and Fields
///
/// The show x 264 panel.
///
private bool showX264Panel;
#endregion
///
/// Initializes a new instance of the class.
///
///
/// The x 264 view model.
///
public AdvancedViewModel(IX264ViewModel x264ViewModel)
{
this.X264ViewModel = x264ViewModel;
}
#region Properties
///
/// Gets or sets the x 264 view model.
///
public IX264ViewModel X264ViewModel { get; set; }
///
/// Gets or sets a value indicating whether show x 264 panel.
///
public bool ShowX264Panel
{
get
{
return this.showX264Panel;
}
set
{
this.showX264Panel = value;
this.NotifyOfPropertyChange(() => this.ShowX264Panel);
}
}
#endregion
#region Implemented Interfaces
///
/// The set encoder.
///
///
/// The encoder.
///
public void SetEncoder(VideoEncoder encoder)
{
this.X264ViewModel.SetEncoder(encoder);
this.ShowX264Panel = encoder == VideoEncoder.X264 || encoder == VideoEncoder.X264_10;
}
///
/// The clear.
///
public void Clear()
{
this.X264ViewModel.Clear();
}
///
/// Setup this tab for the specified preset.
///
///
/// The preset.
///
///
/// The task.
///
public void SetPreset(Preset preset, EncodeTask task)
{
this.X264ViewModel.SetPreset(preset, task);
}
///
/// Update all the UI controls based on the encode task passed in.
///
///
/// The task.
///
public void UpdateTask(EncodeTask task)
{
this.X264ViewModel.UpdateTask(task);
this.SetEncoder(task.VideoEncoder);
}
///
/// Setup this window for a new source
///
///
/// The source.
///
///
/// The title.
///
///
/// The preset.
///
///
/// The task.
///
public void SetSource(Source source, Title title, Preset preset, EncodeTask task)
{
this.X264ViewModel.SetSource(source, title, preset, task);
}
#endregion
}
}