diff options
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels')
5 files changed, 262 insertions, 2 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/FiltersViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/FiltersViewModel.cs index 571606e1d..3b54e3295 100644 --- a/win/CS/HandBrakeWPF/ViewModels/FiltersViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/FiltersViewModel.cs @@ -9,11 +9,15 @@ namespace HandBrakeWPF.ViewModels
{
+ using System.Collections.Generic;
using System.ComponentModel.Composition;
using Caliburn.Micro;
+ using HandBrake.ApplicationServices.Functions;
+ using HandBrake.ApplicationServices.Model;
using HandBrake.ApplicationServices.Services.Interfaces;
+ using HandBrake.Interop.Model.Encoding;
using HandBrakeWPF.ViewModels.Interfaces;
@@ -23,6 +27,37 @@ namespace HandBrakeWPF.ViewModels [Export(typeof(IFiltersViewModel))]
public class FiltersViewModel : ViewModelBase, IFiltersViewModel
{
+ #region Constants and Fields
+
+ /// <summary>
+ /// Backing field for the deblock value
+ /// </summary>
+ private int deblockValue;
+
+ /// <summary>
+ /// Backing field for the selected deinterlace value
+ /// </summary>
+ private Deinterlace selectedDeInterlace;
+
+ /// <summary>
+ /// Backing field for the selected decomb value
+ /// </summary>
+ private Decomb selectedDecomb;
+
+ /// <summary>
+ /// Backing field for the selected denoise value
+ /// </summary>
+ private Denoise selectedDenoise;
+
+ /// <summary>
+ /// Backing field for the selected detelecine value
+ /// </summary>
+ private Detelecine selectedDetelecine;
+
+ #endregion
+
+ #region Constructors and Destructors
+
/// <summary>
/// Initializes a new instance of the <see cref="FiltersViewModel"/> class.
/// </summary>
@@ -34,6 +69,208 @@ namespace HandBrakeWPF.ViewModels /// </param>
public FiltersViewModel(IWindowManager windowManager, IUserSettingService userSettingService)
{
+ this.CurrentTask = new EncodeTask();
+ }
+
+ #endregion
+
+ #region Properties
+
+ /// <summary>
+ /// Gets CurrentTask.
+ /// </summary>
+ public EncodeTask CurrentTask { get; private set; }
+
+ /// <summary>
+ /// Gets DeInterlaceOptions.
+ /// </summary>
+ public IEnumerable<string> DeInterlaceOptions
+ {
+ get
+ {
+ return EnumHelper<Deinterlace>.GetEnumDisplayValues(typeof(Deinterlace));
+ }
+ }
+
+ /// <summary>
+ /// Gets DeblockText.
+ /// </summary>
+ public string DeblockText
+ {
+ get
+ {
+ return this.DeblockValue == 4 ? "Off" : this.DeblockValue.ToString();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets DeblockValue.
+ /// </summary>
+ public int DeblockValue
+ {
+ get
+ {
+ return this.deblockValue;
+ }
+ set
+ {
+ this.deblockValue = value;
+ this.NotifyOfPropertyChange("DeblockValue");
+ this.NotifyOfPropertyChange("DeblockText");
+ }
+ }
+
+ /// <summary>
+ /// Gets DecombOptions.
+ /// </summary>
+ public IEnumerable<string> DecombOptions
+ {
+ get
+ {
+ return EnumHelper<Decomb>.GetEnumDisplayValues(typeof(Decomb));
+ }
+ }
+
+ /// <summary>
+ /// Gets DenoiseOptions.
+ /// </summary>
+ public IEnumerable<string> DenoiseOptions
+ {
+ get
+ {
+ return EnumHelper<Denoise>.GetEnumDisplayValues(typeof(Denoise));
+ }
+ }
+
+ /// <summary>
+ /// Gets DetelecineOptions.
+ /// </summary>
+ public IEnumerable<string> DetelecineOptions
+ {
+ get
+ {
+ return EnumHelper<Detelecine>.GetEnumDisplayValues(typeof(Detelecine));
+ }
}
+
+ /// <summary>
+ /// Gets or sets a value indicating whether Grayscale.
+ /// </summary>
+ public bool Grayscale { get; set; }
+
+ /// <summary>
+ /// Gets or sets SelectedDeInterlace.
+ /// </summary>
+ public string SelectedDeInterlace
+ {
+ get
+ {
+ return EnumHelper<Deinterlace>.GetDisplay(this.selectedDeInterlace);
+ }
+
+ set
+ {
+ this.selectedDeInterlace = EnumHelper<Deinterlace>.GetValue(value);
+ if (this.selectedDeInterlace != Deinterlace.Off)
+ {
+ this.SelectedDecomb = EnumHelper<Decomb>.GetDisplay(Decomb.Off);
+ }
+ this.NotifyOfPropertyChange("SelectedDeInterlace");
+
+ // Show / Hide the Custom Control
+ this.ShowDeinterlaceCustom = this.selectedDeInterlace == Deinterlace.Custom;
+ this.NotifyOfPropertyChange("ShowDeinterlaceCustom");
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets SelectedDecomb.
+ /// </summary>
+ public string SelectedDecomb
+ {
+ get
+ {
+ return EnumHelper<Decomb>.GetDisplay(this.selectedDecomb);
+ }
+
+ set
+ {
+ this.selectedDecomb = EnumHelper<Decomb>.GetValue(value);
+ if (this.selectedDecomb != Decomb.Off)
+ {
+ this.SelectedDeInterlace = EnumHelper<Deinterlace>.GetDisplay(Deinterlace.Off);
+ }
+
+ this.NotifyOfPropertyChange("SelectedDecomb");
+
+ // Show / Hide the Custom Control
+ this.ShowDecombCustom = this.selectedDecomb == Decomb.Custom;
+ this.NotifyOfPropertyChange("ShowDecombCustom");
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets SelectedDenoise.
+ /// </summary>
+ public string SelectedDenoise
+ {
+ get
+ {
+ return EnumHelper<Denoise>.GetDisplay(this.selectedDenoise);
+ }
+
+ set
+ {
+ this.selectedDenoise = EnumHelper<Denoise>.GetValue(value);
+ this.NotifyOfPropertyChange("SelectedDenoise");
+
+ // Show / Hide the Custom Control
+ this.ShowDenoiseCustom = this.selectedDenoise == Denoise.Custom;
+ this.NotifyOfPropertyChange("ShowDenoiseCustom");
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets SelectedDetelecine.
+ /// </summary>
+ public string SelectedDetelecine
+ {
+ get
+ {
+ return EnumHelper<Detelecine>.GetDisplay(this.selectedDetelecine);
+ }
+
+ set
+ {
+ this.selectedDetelecine = EnumHelper<Detelecine>.GetValue(value);
+ this.NotifyOfPropertyChange("SelectedDetelecine");
+
+ // Show / Hide the Custom Control
+ this.ShowDetelecineCustom = this.selectedDetelecine == Detelecine.Custom;
+ this.NotifyOfPropertyChange("ShowDetelecineCustom");
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether ShowDecombCustom.
+ /// </summary>
+ public bool ShowDecombCustom { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether ShowDelelecineCustom.
+ /// </summary>
+ public bool ShowDeinterlaceCustom { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether ShowDenoiseCustom.
+ /// </summary>
+ public bool ShowDenoiseCustom { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether ShowDetelecineCustom.
+ /// </summary>
+ public bool ShowDetelecineCustom { get; set; }
+
+ #endregion
}
-}
+}
\ No newline at end of file diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index daf8bcce0..68b327ec1 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -1050,6 +1050,8 @@ namespace HandBrakeWPF.ViewModels this.NotifyOfPropertyChange("ScannedSource");
this.NotifyOfPropertyChange("ScannedSource.Titles");
this.SelectedTitle = this.ScannedSource.Titles.Where(t => t.MainTitle).FirstOrDefault();
+ this.JobContextService.CurrentSource = this.ScannedSource;
+ this.JobContextService.CurrentTask = this.CurrentTask;
}
this.SourceLabel = "Scan Completed";
diff --git a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs index 1f5802503..dc536855e 100644 --- a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs @@ -320,7 +320,7 @@ namespace HandBrakeWPF.ViewModels public OptionsViewModel(IWindowManager windowManager, IUserSettingService userSettingService)
{
this.Title = "Options";
- this.userSettingService = this.UserSettingService;
+ this.userSettingService = userSettingService;
this.Load();
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs index 60c6feb09..5fc397f41 100644 --- a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs @@ -13,6 +13,8 @@ namespace HandBrakeWPF.ViewModels using Caliburn.Micro;
+ using HandBrake.ApplicationServices.Model;
+ using HandBrake.ApplicationServices.Parsing;
using HandBrake.ApplicationServices.Services.Interfaces;
using HandBrakeWPF.ViewModels.Interfaces;
@@ -35,5 +37,19 @@ namespace HandBrakeWPF.ViewModels public PictureSettingsViewModel(IWindowManager windowManager, IUserSettingService userSettingService)
{
}
+
+ /// <summary>
+ /// Setup the window after a scan.
+ /// </summary>
+ /// <param name="selectedTitle">
+ /// The selected title.
+ /// </param>
+ /// <param name="currentTask">
+ /// The current task.
+ /// </param>
+ public void Setup(Title selectedTitle, EncodeTask currentTask)
+ {
+
+ }
}
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/ViewModelBase.cs b/win/CS/HandBrakeWPF/ViewModels/ViewModelBase.cs index f1766741e..dd992ef68 100644 --- a/win/CS/HandBrakeWPF/ViewModels/ViewModelBase.cs +++ b/win/CS/HandBrakeWPF/ViewModels/ViewModelBase.cs @@ -13,6 +13,7 @@ namespace HandBrakeWPF.ViewModels using HandBrake.ApplicationServices.Services.Interfaces;
+ using HandBrakeWPF.Services.Interfaces;
using HandBrakeWPF.ViewModels.Interfaces;
/// <summary>
@@ -74,6 +75,10 @@ namespace HandBrakeWPF.ViewModels /// </summary>
public IUserSettingService UserSettingService { get; set; }
+ /// <summary>
+ /// Gets or sets JobContextService.
+ /// </summary>
+ public IJobContextService JobContextService { get; set; }
#endregion
#region Public Methods
|