diff options
Diffstat (limited to 'win')
22 files changed, 1280 insertions, 74 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs b/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs index da9be176b..7c6192636 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs @@ -98,7 +98,7 @@ namespace HandBrake.ApplicationServices.Services {
get
{
- string noLog = "No log data available... Log data will show where after you scan a source. \n\nOpen the log file directory to get previous log files.";
+ string noLog = "No log data available... Log data will show here after you scan a source. \n\nOpen the log file directory to get previous log files.";
return string.IsNullOrEmpty(this.logBuffer.ToString()) ? this.header + noLog : this.header + this.logBuffer.ToString();
}
}
diff --git a/win/CS/HandBrakeWPF/Converters/BooleanConverter.cs b/win/CS/HandBrakeWPF/Converters/BooleanConverter.cs new file mode 100644 index 000000000..a01b3bf67 --- /dev/null +++ b/win/CS/HandBrakeWPF/Converters/BooleanConverter.cs @@ -0,0 +1,78 @@ +// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="BooleanConverter.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// Defines the BooleanConverter type.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.Converters
+{
+ using System.Globalization;
+ using System.Windows.Data;
+ using System;
+
+ /// <summary>
+ /// Boolean to Visibility Converter
+ /// </summary>
+ public sealed class BooleanConverter : IValueConverter
+ {
+ /// <summary>
+ /// Convert a boolean to visibility property.
+ /// </summary>
+ /// <param name="value">
+ /// The value.
+ /// </param>
+ /// <param name="targetType">
+ /// The target type.
+ /// </param>
+ /// <param name="parameter">
+ /// The parameter. (A boolean which inverts the output)
+ /// </param>
+ /// <param name="culture">
+ /// The culture.
+ /// </param>
+ /// <returns>
+ /// Visibility property
+ /// </returns>
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ // Paramater is a boolean which inverts the output.
+ var param = System.Convert.ToBoolean(parameter, CultureInfo.InvariantCulture);
+
+ if (value is Boolean)
+ {
+ return param ? !(bool)value : value;
+ }
+
+ return value;
+ }
+
+ /// <summary>
+ /// Convert Back for the IValueConverter Interface. Not used!
+ /// </summary>
+ /// <param name="value">
+ /// The value.
+ /// </param>
+ /// <param name="targetType">
+ /// The target type.
+ /// </param>
+ /// <param name="parameter">
+ /// The parameter.
+ /// </param>
+ /// <param name="culture">
+ /// The culture.
+ /// </param>
+ /// <returns>
+ /// Nothing
+ /// </returns>
+ /// <exception cref="NotImplementedException">
+ /// This method is not used!
+ /// </exception>
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return this.Convert(value, targetType, parameter, culture);
+ }
+ }
+}
diff --git a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj index 17c12b9a2..86bb02532 100644 --- a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj +++ b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj @@ -81,6 +81,7 @@ <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
+ <Compile Include="Converters\BooleanConverter.cs" />
<Compile Include="Converters\BooleanToVisibilityConverter.cs" />
<Compile Include="Helpers\AutoNameHelper.cs" />
<Compile Include="Helpers\ListBoxHelper.cs" />
diff --git a/win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs index 9b50acc5c..a11f2a8e8 100644 --- a/win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs @@ -13,7 +13,9 @@ namespace HandBrakeWPF.ViewModels using Caliburn.Micro;
+ using HandBrake.ApplicationServices.Model;
using HandBrake.ApplicationServices.Services.Interfaces;
+ using HandBrake.Interop.Model.Encoding.x264;
using HandBrakeWPF.ViewModels.Interfaces;
@@ -23,6 +25,32 @@ namespace HandBrakeWPF.ViewModels [Export(typeof(IAdvancedViewModel))]
public class AdvancedViewModel : ViewModelBase, IAdvancedViewModel
{
+ #region Constants and Fields
+
+ /// <summary>
+ /// The query.
+ /// </summary>
+ private string query;
+
+ /// <summary>
+ /// The x264 preset.
+ /// </summary>
+ private x264Preset x264Preset;
+
+ /// <summary>
+ /// The x264 profile.
+ /// </summary>
+ private x264Profile x264Profile;
+
+ /// <summary>
+ /// The x264 tune.
+ /// </summary>
+ private x264Tune x264Tune;
+
+ #endregion
+
+ #region Constructors and Destructors
+
/// <summary>
/// Initializes a new instance of the <see cref="AdvancedViewModel"/> class.
/// </summary>
@@ -36,9 +64,92 @@ namespace HandBrakeWPF.ViewModels {
}
+ #endregion
+
+ #region Public Properties
+
/// <summary>
/// Gets or sets State.
/// </summary>
- public string Query { get; set; }
+ public string Query
+ {
+ get
+ {
+ return this.query;
+ }
+ set
+ {
+ this.query = value;
+ this.NotifyOfPropertyChange(() => this.Query);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets X264Preset.
+ /// </summary>
+ public x264Preset X264Preset
+ {
+ get
+ {
+ return this.x264Preset;
+ }
+ set
+ {
+ this.x264Preset = value;
+ this.NotifyOfPropertyChange(() => this.X264Preset);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets X264Profile.
+ /// </summary>
+ public x264Profile X264Profile
+ {
+ get
+ {
+ return this.x264Profile;
+ }
+ set
+ {
+ this.x264Profile = value;
+ this.NotifyOfPropertyChange(() => this.X264Profile);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets X264Tune.
+ /// </summary>
+ public x264Tune X264Tune
+ {
+ get
+ {
+ return this.x264Tune;
+ }
+ set
+ {
+ this.x264Tune = value;
+ this.NotifyOfPropertyChange(() => this.X264Tune);
+ }
+ }
+
+ #endregion
+
+ #region Public Methods
+
+ /// <summary>
+ /// Set the selected preset
+ /// </summary>
+ /// <param name="preset">
+ /// The preset.
+ /// </param>
+ 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
}
-}
+}
\ No newline at end of file diff --git a/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs index d8e4c194d..e20e3ae95 100644 --- a/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs @@ -14,6 +14,7 @@ namespace HandBrakeWPF.ViewModels using Caliburn.Micro;
+ using HandBrake.ApplicationServices.Model;
using HandBrake.ApplicationServices.Model.Encoding;
using HandBrake.ApplicationServices.Services.Interfaces;
@@ -58,5 +59,15 @@ namespace HandBrakeWPF.ViewModels public void Remove()
{
}
+
+ /// <summary>
+ /// Set the selected preset.
+ /// </summary>
+ /// <param name="preset">
+ /// The preset.
+ /// </param>
+ public void SetPreset(Preset preset)
+ {
+ }
}
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs index 672082b51..262d6585d 100644 --- a/win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs @@ -18,6 +18,7 @@ namespace HandBrakeWPF.ViewModels using Caliburn.Micro;
using HandBrake.ApplicationServices.Exceptions;
+ using HandBrake.ApplicationServices.Model;
using HandBrake.ApplicationServices.Model.Encoding;
using HandBrake.ApplicationServices.Parsing;
using HandBrake.ApplicationServices.Services.Interfaces;
@@ -32,10 +33,16 @@ namespace HandBrakeWPF.ViewModels [Export(typeof(IChaptersViewModel))]
public class ChaptersViewModel : ViewModelBase, IChaptersViewModel
{
+ #region Constants and Fields
+
/// <summary>
- /// Gets or sets SourceChapterList.
+ /// The include chapter markers.
/// </summary>
- private ObservableCollection<Chapter> SourceChapterList { get; set; }
+ private bool includeChapterMarkers;
+
+ #endregion
+
+ #region Constructors and Destructors
/// <summary>
/// Initializes a new instance of the <see cref="ChaptersViewModel"/> class.
@@ -51,6 +58,10 @@ namespace HandBrakeWPF.ViewModels this.Chapters = new ObservableCollection<ChapterMarker>();
}
+ #endregion
+
+ #region Public Properties
+
/// <summary>
/// Gets or sets State.
/// </summary>
@@ -59,25 +70,45 @@ namespace HandBrakeWPF.ViewModels /// <summary>
/// Gets or sets a value indicating whether chapter markers are enabled.
/// </summary>
- public bool IncludeChapterMarkers { get; set; }
+ public bool IncludeChapterMarkers
+ {
+ get
+ {
+ return this.includeChapterMarkers;
+ }
+ set
+ {
+ this.includeChapterMarkers = value;
+ this.NotifyOfPropertyChange(() => this.IncludeChapterMarkers);
+ }
+ }
+
+ #endregion
+
+ #region Properties
/// <summary>
- /// Set the Source Chapters List
+ /// Gets or sets SourceChapterList.
/// </summary>
- /// <param name="sourceChapters">
- /// The source chapters.
- /// </param>
- public void SetSourceChapters(IEnumerable<Chapter> sourceChapters)
- {
- // Cache the chapters in this screen
- this.SourceChapterList = new ObservableCollection<Chapter>(sourceChapters);
- this.Chapters.Clear();
+ private ObservableCollection<Chapter> SourceChapterList { get; set; }
- // Then Add new Chapter Markers.
- foreach (Chapter chapter in SourceChapterList)
+ #endregion
+
+ #region Public Methods
+
+ /// <summary>
+ /// Export a CSV file.
+ /// </summary>
+ public void Export()
+ {
+ var saveFileDialog = new VistaSaveFileDialog
+ {
+ Filter = "Csv File|*.csv", DefaultExt = "csv", CheckPathExists = true
+ };
+ saveFileDialog.ShowDialog();
+ if (!string.IsNullOrEmpty(saveFileDialog.FileName))
{
- ChapterMarker marker = new ChapterMarker(chapter.ChapterNumber, chapter.ChapterName);
- this.Chapters.Add(marker);
+ this.ExportChaptersToCSV(saveFileDialog.FileName);
}
}
@@ -103,23 +134,26 @@ namespace HandBrakeWPF.ViewModels csv += row.ChapterName.Replace(",", "\\,");
csv += Environment.NewLine;
}
- StreamWriter file = new StreamWriter(filename);
+ var file = new StreamWriter(filename);
file.Write(csv);
file.Close();
file.Dispose();
}
catch (Exception exc)
{
- throw new GeneralApplicationException("Unable to save Chapter Makrers file! ", "Chapter marker names will NOT be saved in your encode.", exc);
+ throw new GeneralApplicationException(
+ "Unable to save Chapter Makrers file! ",
+ "Chapter marker names will NOT be saved in your encode.",
+ exc);
}
}
/// <summary>
/// Import a CSV file
/// </summary>
- private void Import()
+ public void Import()
{
- VistaOpenFileDialog dialog = new VistaOpenFileDialog { Filter = "CSV files (*.csv)|*.csv", CheckFileExists = true };
+ var dialog = new VistaOpenFileDialog { Filter = "CSV files (*.csv)|*.csv", CheckFileExists = true };
dialog.ShowDialog();
string filename = dialog.FileName;
@@ -131,7 +165,7 @@ namespace HandBrakeWPF.ViewModels IDictionary<int, string> chapterMap = new Dictionary<int, string>();
try
{
- StreamReader sr = new StreamReader(filename);
+ var sr = new StreamReader(filename);
string csv = sr.ReadLine();
while (csv != null)
{
@@ -152,26 +186,51 @@ namespace HandBrakeWPF.ViewModels }
// Now iterate over each chatper we have, and set it's name
- foreach (ChapterMarker item in Chapters)
+ foreach (ChapterMarker item in this.Chapters)
{
string chapterName;
chapterMap.TryGetValue(item.ChapterNumber, out chapterName);
item.ChapterName = chapterName;
+
// TODO force a fresh of this property
}
}
/// <summary>
- /// Export a CSV file.
+ /// The set preset.
/// </summary>
- private void Export()
+ /// <param name="preset">
+ /// The preset.
+ /// </param>
+ /// <param name="currentTitle">
+ /// The current Title.
+ /// </param>
+ public void Setup(Preset preset, Title currentTitle)
{
- VistaSaveFileDialog saveFileDialog = new VistaSaveFileDialog { Filter = "Csv File|*.csv", DefaultExt = "csv", CheckPathExists = true };
- saveFileDialog.ShowDialog();
- if (!string.IsNullOrEmpty(saveFileDialog.FileName))
+ this.IncludeChapterMarkers = preset.Task.IncludeChapterMarkers;
+ this.SetSourceChapters(currentTitle.Chapters);
+ }
+
+ /// <summary>
+ /// Set the Source Chapters List
+ /// </summary>
+ /// <param name="sourceChapters">
+ /// The source chapters.
+ /// </param>
+ public void SetSourceChapters(IEnumerable<Chapter> sourceChapters)
+ {
+ // Cache the chapters in this screen
+ this.SourceChapterList = new ObservableCollection<Chapter>(sourceChapters);
+ this.Chapters.Clear();
+
+ // Then Add new Chapter Markers.
+ foreach (Chapter chapter in this.SourceChapterList)
{
- this.ExportChaptersToCSV(saveFileDialog.FileName);
+ var marker = new ChapterMarker(chapter.ChapterNumber, chapter.ChapterName);
+ this.Chapters.Add(marker);
}
}
+
+ #endregion
}
-}
+}
\ No newline at end of file diff --git a/win/CS/HandBrakeWPF/ViewModels/FiltersViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/FiltersViewModel.cs index 3b54e3295..2b4c9a08c 100644 --- a/win/CS/HandBrakeWPF/ViewModels/FiltersViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/FiltersViewModel.cs @@ -54,6 +54,26 @@ namespace HandBrakeWPF.ViewModels /// </summary>
private Detelecine selectedDetelecine;
+ /// <summary>
+ /// Backing field for the custom decomb value
+ /// </summary>
+ private string customDeinterlace;
+
+ /// <summary>
+ /// Backing field for the custom debcomb value
+ /// </summary>
+ private string customDecomb;
+
+ /// <summary>
+ /// Backing field for the custom detelecine value
+ /// </summary>
+ private string customDetelecine;
+
+ /// <summary>
+ /// Backing field for the custom denoise value
+ /// </summary>
+ private string customDenoise;
+
#endregion
#region Constructors and Destructors
@@ -271,6 +291,96 @@ namespace HandBrakeWPF.ViewModels /// </summary>
public bool ShowDetelecineCustom { get; set; }
+ /// <summary>
+ /// Gets or sets CustomDeinterlace.
+ /// </summary>
+ public string CustomDeinterlace
+ {
+ get
+ {
+ return this.customDeinterlace;
+ }
+ set
+ {
+ this.customDeinterlace = value;
+ this.NotifyOfPropertyChange(() => this.CustomDeinterlace);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets CustomDecomb.
+ /// </summary>
+ public string CustomDecomb
+ {
+ get
+ {
+ return this.customDecomb;
+ }
+ set
+ {
+ this.customDecomb = value;
+ this.NotifyOfPropertyChange(() => this.CustomDecomb);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets CustomDetelecine.
+ /// </summary>
+ public string CustomDetelecine
+ {
+ get
+ {
+ return this.customDetelecine;
+ }
+ set
+ {
+ this.customDetelecine = value;
+ this.NotifyOfPropertyChange(() => this.CustomDetelecine);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets CustomDenoise.
+ /// </summary>
+ public string CustomDenoise
+ {
+ get
+ {
+ return this.customDenoise;
+ }
+ set
+ {
+ this.customDenoise = value;
+ this.NotifyOfPropertyChange(() => this.CustomDenoise);
+ }
+ }
+
#endregion
+
+ /// <summary>
+ /// Setup a selected preset.
+ /// </summary>
+ /// <param name="preset">
+ /// The Current Preset.
+ /// </param>
+ public void SetPreset(Preset preset)
+ {
+ if (preset != null)
+ {
+ // Properties
+ this.SelectedDenoise = EnumHelper<Denoise>.GetDisplay(preset.Task.Denoise);
+ this.SelectedDecomb = EnumHelper<Decomb>.GetDisplay(preset.Task.Decomb);
+ this.SelectedDeInterlace = EnumHelper<Deinterlace>.GetDisplay(preset.Task.Deinterlace);
+ this.SelectedDetelecine = EnumHelper<Detelecine>.GetDisplay(preset.Task.Detelecine);
+ this.Grayscale = preset.Task.Grayscale;
+ this.DeblockValue = preset.Task.Deblock;
+
+ // Custom Values
+ this.CustomDecomb = preset.Task.CustomDecomb;
+ this.CustomDeinterlace = preset.Task.CustomDeinterlace;
+ this.CustomDetelecine = preset.Task.CustomDetelecine;
+ this.CustomDenoise = preset.Task.CustomDenoise;
+ }
+ }
}
}
\ No newline at end of file diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IAdvancedViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IAdvancedViewModel.cs index 1ffb86c96..199c10ff9 100644 --- a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IAdvancedViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IAdvancedViewModel.cs @@ -9,10 +9,19 @@ namespace HandBrakeWPF.ViewModels.Interfaces
{
+ using HandBrake.ApplicationServices.Model;
+
/// <summary>
/// The Advanced View Model Interface
/// </summary>
public interface IAdvancedViewModel
{
+ /// <summary>
+ /// Set the selected preset
+ /// </summary>
+ /// <param name="preset">
+ /// The preset.
+ /// </param>
+ void SetPreset(Preset preset);
}
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IAudioViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IAudioViewModel.cs index bd13345db..d29242625 100644 --- a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IAudioViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IAudioViewModel.cs @@ -9,10 +9,19 @@ namespace HandBrakeWPF.ViewModels.Interfaces
{
+ using HandBrake.ApplicationServices.Model;
+
/// <summary>
/// The Audio View Model Interface
/// </summary>
public interface IAudioViewModel
{
+ /// <summary>
+ /// Set the selected preset
+ /// </summary>
+ /// <param name="preset">
+ /// The preset.
+ /// </param>
+ void SetPreset(Preset preset);
}
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IChaptersViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IChaptersViewModel.cs index 8e9710d74..494e1aaa6 100644 --- a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IChaptersViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IChaptersViewModel.cs @@ -9,10 +9,23 @@ namespace HandBrakeWPF.ViewModels.Interfaces
{
+ using HandBrake.ApplicationServices.Model;
+ using HandBrake.ApplicationServices.Parsing;
+
/// <summary>
/// The Chapters View Model Interface
/// </summary>
public interface IChaptersViewModel
{
+ /// <summary>
+ /// Set the selected preset
+ /// </summary>
+ /// <param name="preset">
+ /// The preset.
+ /// </param>
+ /// <param name="currentTitle">
+ /// The current Title.
+ /// </param>
+ void Setup(Preset preset, Title currentTitle);
}
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IFiltersViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IFiltersViewModel.cs index 24662f946..3390b328b 100644 --- a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IFiltersViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IFiltersViewModel.cs @@ -9,10 +9,19 @@ namespace HandBrakeWPF.ViewModels.Interfaces
{
+ using HandBrake.ApplicationServices.Model;
+
/// <summary>
/// The Filters View Model Interface
/// </summary>
public interface IFiltersViewModel
{
+ /// <summary>
+ /// Setup a selected preset.
+ /// </summary>
+ /// <param name="preset">
+ /// The Current Preset.
+ /// </param>
+ void SetPreset(Preset preset);
}
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IPictureSettingsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IPictureSettingsViewModel.cs index 35a8e4eaf..ef816de5f 100644 --- a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IPictureSettingsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IPictureSettingsViewModel.cs @@ -9,10 +9,26 @@ namespace HandBrakeWPF.ViewModels.Interfaces
{
+ using HandBrake.ApplicationServices.Model;
+ using HandBrake.ApplicationServices.Parsing;
+
/// <summary>
/// The Picture Settings View Model Interface
/// </summary>
public interface IPictureSettingsViewModel
{
+ /// <summary>
+ /// Setup the window after a scan.
+ /// </summary>
+ /// <param name="selectedTitle">
+ /// The selected title.
+ /// </param>
+ /// <param name="currentTask">
+ /// The current task.
+ /// </param>
+ /// <param name="currentPreset">
+ /// The Current preset
+ /// </param>
+ void Setup(Title selectedTitle, EncodeTask currentTask, Preset currentPreset);
}
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/ISubtitlesViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/ISubtitlesViewModel.cs index 2a490c274..d0ff210b2 100644 --- a/win/CS/HandBrakeWPF/ViewModels/Interfaces/ISubtitlesViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/Interfaces/ISubtitlesViewModel.cs @@ -9,10 +9,19 @@ namespace HandBrakeWPF.ViewModels.Interfaces
{
+ using HandBrake.ApplicationServices.Model;
+
/// <summary>
/// The Subtiles View Model Interface
/// </summary>
public interface ISubtitlesViewModel
{
+ /// <summary>
+ /// Set the selected preset
+ /// </summary>
+ /// <param name="preset">
+ /// The preset.
+ /// </param>
+ void SetPreset(Preset preset);
}
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IVideoViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IVideoViewModel.cs index 7690b87a9..4a6c01c43 100644 --- a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IVideoViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IVideoViewModel.cs @@ -9,10 +9,19 @@ namespace HandBrakeWPF.ViewModels.Interfaces
{
+ using HandBrake.ApplicationServices.Model;
+
/// <summary>
/// The Video View Model Interface
/// </summary>
public interface IVideoViewModel
{
+ /// <summary>
+ /// Set the selected preset
+ /// </summary>
+ /// <param name="preset">
+ /// The preset.
+ /// </param>
+ void SetPreset(Preset preset);
}
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index 68b327ec1..8899ece9d 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -1016,6 +1016,21 @@ namespace HandBrakeWPF.ViewModels this.NotifyOfPropertyChange("CurrentTask");
}
+ /// <summary>
+ /// Setup the UI tabs. Passes in any relevant models for setup.
+ /// </summary>
+ private void SetupTabs()
+ {
+ // Setup the Tabs
+ this.PictureSettingsViewModel.Setup(this.SelectedTitle, this.CurrentTask, this.SelectedPreset);
+ this.VideoViewModel.SetPreset(this.SelectedPreset);
+ this.FiltersViewModel.SetPreset(this.SelectedPreset);
+ this.AudioViewModel.SetPreset(this.SelectedPreset);
+ this.SubtitleViewModel.SetPreset(this.SelectedPreset);
+ this.ChaptersViewModel.Setup(this.SelectedPreset, this.SelectedTitle);
+ this.AdvancedViewModel.SetPreset(this.SelectedPreset);
+ }
+
#endregion
#region Event Handlers
@@ -1052,6 +1067,7 @@ namespace HandBrakeWPF.ViewModels this.SelectedTitle = this.ScannedSource.Titles.Where(t => t.MainTitle).FirstOrDefault();
this.JobContextService.CurrentSource = this.ScannedSource;
this.JobContextService.CurrentTask = this.CurrentTask;
+ this.SetupTabs();
}
this.SourceLabel = "Scan Completed";
diff --git a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs index 5fc397f41..f7ca69f6c 100644 --- a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs @@ -9,6 +9,7 @@ namespace HandBrakeWPF.ViewModels
{
+ using System.Collections.Generic;
using System.ComponentModel.Composition;
using Caliburn.Micro;
@@ -16,6 +17,7 @@ namespace HandBrakeWPF.ViewModels using HandBrake.ApplicationServices.Model;
using HandBrake.ApplicationServices.Parsing;
using HandBrake.ApplicationServices.Services.Interfaces;
+ using HandBrake.Interop.Model.Encoding;
using HandBrakeWPF.ViewModels.Interfaces;
@@ -25,6 +27,87 @@ namespace HandBrakeWPF.ViewModels [Export(typeof(IPictureSettingsViewModel))]
public class PictureSettingsViewModel : ViewModelBase, IPictureSettingsViewModel
{
+ #region Constants and Fields
+
+ /// <summary>
+ /// The crop bottom.
+ /// </summary>
+ private int cropBottom;
+
+ /// <summary>
+ /// The crop left.
+ /// </summary>
+ private int cropLeft;
+
+ /// <summary>
+ /// The crop right.
+ /// </summary>
+ private int cropRight;
+
+ /// <summary>
+ /// The crop top.
+ /// </summary>
+ private int cropTop;
+
+ /// <summary>
+ /// The display size.
+ /// </summary>
+ private string displaySize;
+
+ /// <summary>
+ /// The display width.
+ /// </summary>
+ private int displayWidth;
+
+ /// <summary>
+ /// The height.
+ /// </summary>
+ private int height;
+
+ /// <summary>
+ /// The is custom crop.
+ /// </summary>
+ private bool isCustomCrop;
+
+ /// <summary>
+ /// The maintain aspect ratio.
+ /// </summary>
+ private bool maintainAspectRatio;
+
+ /// <summary>
+ /// The par height.
+ /// </summary>
+ private int parHeight;
+
+ /// <summary>
+ /// The par width.
+ /// </summary>
+ private int parWidth;
+
+ /// <summary>
+ /// The selected anamorphic mode.
+ /// </summary>
+ private Anamorphic selectedAnamorphicMode;
+
+ /// <summary>
+ /// The selected modulus
+ /// </summary>
+ private int selectedModulus;
+
+ /// <summary>
+ /// The source info.
+ /// </summary>
+ private string sourceInfo;
+
+ /// <summary>
+ /// The width.
+ /// </summary>
+ private int width;
+
+ #endregion
+
+ #region Constructors and Destructors
+
/// <summary>
/// Initializes a new instance of the <see cref="HandBrakeWPF.ViewModels.PictureSettingsViewModel"/> class.
/// </summary>
@@ -36,9 +119,280 @@ namespace HandBrakeWPF.ViewModels /// </param>
public PictureSettingsViewModel(IWindowManager windowManager, IUserSettingService userSettingService)
{
+ this.SelectedModulus = 16;
+ }
+
+ #endregion
+
+ #region Public Properties
+
+ /// <summary>
+ /// Gets AnamorphicModes.
+ /// </summary>
+ public IEnumerable<Anamorphic> AnamorphicModes
+ {
+ get
+ {
+ return new List<Anamorphic> { Anamorphic.None, Anamorphic.Strict, Anamorphic.Loose, Anamorphic.Custom };
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets CropBottom.
+ /// </summary>
+ public int CropBottom
+ {
+ get
+ {
+ return this.cropBottom;
+ }
+ set
+ {
+ this.cropBottom = value;
+ this.NotifyOfPropertyChange(() => this.CropBottom);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets CropLeft.
+ /// </summary>
+ public int CropLeft
+ {
+ get
+ {
+ return this.cropLeft;
+ }
+ set
+ {
+ this.cropLeft = value;
+ this.NotifyOfPropertyChange(() => this.CropLeft);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets CropRight.
+ /// </summary>
+ public int CropRight
+ {
+ get
+ {
+ return this.cropRight;
+ }
+ set
+ {
+ this.cropRight = value;
+ this.NotifyOfPropertyChange(() => this.CropRight);
+ }
}
/// <summary>
+ /// Gets or sets CropTop.
+ /// </summary>
+ public int CropTop
+ {
+ get
+ {
+ return this.cropTop;
+ }
+ set
+ {
+ this.cropTop = value;
+ this.NotifyOfPropertyChange(() => this.CropTop);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets DisplaySize.
+ /// </summary>
+ public string DisplaySize
+ {
+ get
+ {
+ return this.displaySize;
+ }
+ set
+ {
+ this.displaySize = value;
+ this.NotifyOfPropertyChange(() => this.DisplaySize);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets DisplayWidth.
+ /// </summary>
+ public int DisplayWidth
+ {
+ get
+ {
+ return this.displayWidth;
+ }
+ set
+ {
+ this.displayWidth = value;
+ this.NotifyOfPropertyChange(() => this.DisplayWidth);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets Height.
+ /// </summary>
+ public int Height
+ {
+ get
+ {
+ return this.height;
+ }
+ set
+ {
+ this.height = value;
+ this.NotifyOfPropertyChange(() => this.Height);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether IsCustomCrop.
+ /// </summary>
+ public bool IsCustomCrop
+ {
+ get
+ {
+ return this.isCustomCrop;
+ }
+ set
+ {
+ this.isCustomCrop = value;
+ this.NotifyOfPropertyChange(() => this.IsCustomCrop);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether MaintainAspectRatio.
+ /// </summary>
+ public bool MaintainAspectRatio
+ {
+ get
+ {
+ return this.maintainAspectRatio;
+ }
+ set
+ {
+ this.maintainAspectRatio = value;
+ this.NotifyOfPropertyChange(() => this.MaintainAspectRatio);
+ }
+ }
+
+ /// <summary>
+ /// Gets ModulusValues.
+ /// </summary>
+ public IEnumerable<int> ModulusValues
+ {
+ get
+ {
+ return new List<int> { 16, 8, 4, 2 };
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets ParHeight.
+ /// </summary>
+ public int ParHeight
+ {
+ get
+ {
+ return this.parHeight;
+ }
+ set
+ {
+ this.parHeight = value;
+ this.NotifyOfPropertyChange(() => this.ParHeight);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets ParWidth.
+ /// </summary>
+ public int ParWidth
+ {
+ get
+ {
+ return this.parWidth;
+ }
+ set
+ {
+ this.parWidth = value;
+ this.NotifyOfPropertyChange(() => this.ParWidth);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets SelectedAnamorphicMode.
+ /// </summary>
+ public Anamorphic SelectedAnamorphicMode
+ {
+ get
+ {
+ return this.selectedAnamorphicMode;
+ }
+ set
+ {
+ this.selectedAnamorphicMode = value;
+ this.NotifyOfPropertyChange(() => this.SelectedAnamorphicMode);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets SelectedModulus.
+ /// </summary>
+ public int SelectedModulus
+ {
+ get
+ {
+ return this.selectedModulus;
+ }
+ set
+ {
+ this.selectedModulus = value;
+ this.NotifyOfPropertyChange(() => this.SelectedModulus);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets SourceInfo.
+ /// </summary>
+ public string SourceInfo
+ {
+ get
+ {
+ return this.sourceInfo;
+ }
+ set
+ {
+ this.sourceInfo = value;
+ this.NotifyOfPropertyChange(() => this.SourceInfo);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets Width.
+ /// </summary>
+ public int Width
+ {
+ get
+ {
+ return this.width;
+ }
+ set
+ {
+ this.width = value;
+ this.NotifyOfPropertyChange(() => this.Width);
+ }
+ }
+
+ #endregion
+
+ #region Public Methods
+
+ /// <summary>
/// Setup the window after a scan.
/// </summary>
/// <param name="selectedTitle">
@@ -47,9 +401,13 @@ namespace HandBrakeWPF.ViewModels /// <param name="currentTask">
/// The current task.
/// </param>
- public void Setup(Title selectedTitle, EncodeTask currentTask)
+ /// <param name="currentPreset">
+ /// The Current preset
+ /// </param>
+ public void Setup(Title selectedTitle, EncodeTask currentTask, Preset currentPreset)
{
-
}
+
+ #endregion
}
-}
+}
\ No newline at end of file diff --git a/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs index d57f19fb9..81a9c07db 100644 --- a/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs @@ -20,6 +20,8 @@ namespace HandBrakeWPF.ViewModels using HandBrakeWPF.ViewModels.Interfaces;
+ using HandBrake.ApplicationServices.Model;
+
/// <summary>
/// The Subtitles View Model
/// </summary>
@@ -46,6 +48,16 @@ namespace HandBrakeWPF.ViewModels public ObservableCollection<SubtitleTrack> SubtitleTracks { get; set; }
/// <summary>
+ /// Set the currently selected preset.
+ /// </summary>
+ /// <param name="preset">
+ /// The preset.
+ /// </param>
+ public void SetPreset(Preset preset)
+ {
+ }
+
+ /// <summary>
/// Add a new Track
/// </summary>
public void Add()
diff --git a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs index 59b6a98f5..0368c781c 100644 --- a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.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,77 @@ namespace HandBrakeWPF.ViewModels [Export(typeof(IVideoViewModel))]
public class VideoViewModel : ViewModelBase, IVideoViewModel
{
+ #region Constants and Fields
+
+ /// <summary>
+ /// The average bitrate.
+ /// </summary>
+ private int averageBitrate;
+
+ /// <summary>
+ /// The is constant framerate.
+ /// </summary>
+ private bool isConstantFramerate;
+
+ /// <summary>
+ /// The is constant quantity.
+ /// </summary>
+ private bool isConstantQuantity;
+
+ /// <summary>
+ /// The is peak framerate.
+ /// </summary>
+ private bool isPeakFramerate;
+
+ /// <summary>
+ /// The is turbo first pass.
+ /// </summary>
+ private bool isTurboFirstPass;
+
+ /// <summary>
+ /// The is two pass.
+ /// </summary>
+ private bool isTwoPass;
+
+ /// <summary>
+ /// The is variable framerate.
+ /// </summary>
+ private bool isVariableFramerate;
+
+ /// <summary>
+ /// The quality max.
+ /// </summary>
+ private int qualityMax;
+
+ /// <summary>
+ /// The quality min.
+ /// </summary>
+ private int qualityMin;
+
+ /// <summary>
+ /// The rf.
+ /// </summary>
+ private int rf;
+
+ /// <summary>
+ /// The selected framerate.
+ /// </summary>
+ private double? selectedFramerate;
+
+ /// <summary>
+ /// The selected video encoder.
+ /// </summary>
+ private VideoEncoder selectedVideoEncoder;
+
+ /// <summary>
+ /// The show peak framerate.
+ /// </summary>
+ private bool showPeakFramerate;
+
+ #endregion
+
+ #region Constructors and Destructors
+
/// <summary>
/// Initializes a new instance of the <see cref="VideoViewModel"/> class.
/// </summary>
@@ -34,6 +109,295 @@ namespace HandBrakeWPF.ViewModels /// </param>
public VideoViewModel(IWindowManager windowManager, IUserSettingService userSettingService)
{
+ this.QualityMin = 0;
+ this.QualityMax = 51;
+ this.IsConstantQuantity = true;
}
+
+ #endregion
+
+ #region Public Properties
+
+ /// <summary>
+ /// Gets or sets AverageBitrate.
+ /// </summary>
+ public string AverageBitrate
+ {
+ get
+ {
+ return this.averageBitrate.ToString();
+ }
+ set
+ {
+ if (value != null)
+ {
+ this.averageBitrate = int.Parse(value);
+ }
+ this.NotifyOfPropertyChange(() => this.AverageBitrate);
+ }
+ }
+
+ /// <summary>
+ /// Gets Framerates.
+ /// </summary>
+ public IEnumerable<string> Framerates
+ {
+ get
+ {
+ return new List<string> { "Same as source", "5", "10", "12", "15", "23.976", "24", "25", "29.97`" };
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether IsConstantFramerate.
+ /// </summary>
+ public bool IsConstantFramerate
+ {
+ get
+ {
+ return this.isConstantFramerate;
+ }
+ set
+ {
+ this.isConstantFramerate = value;
+ if (value)
+ {
+ this.IsVariableFramerate = false;
+ this.IsPeakFramerate = false;
+ }
+
+ this.NotifyOfPropertyChange(() => this.IsConstantFramerate);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether IsConstantQuantity.
+ /// </summary>
+ public bool IsConstantQuantity
+ {
+ get
+ {
+ return this.isConstantQuantity;
+ }
+ set
+ {
+ this.isConstantQuantity = value;
+ this.NotifyOfPropertyChange(() => this.IsConstantQuantity);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether IsPeakFramerate.
+ /// </summary>
+ public bool IsPeakFramerate
+ {
+ get
+ {
+ return this.isPeakFramerate;
+ }
+ set
+ {
+ this.isPeakFramerate = value;
+ if (value)
+ {
+ this.IsVariableFramerate = false;
+ this.IsConstantFramerate = false;
+ }
+
+ this.NotifyOfPropertyChange(() => this.IsPeakFramerate);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether IsTurboFirstPass.
+ /// </summary>
+ public bool IsTurboFirstPass
+ {
+ get
+ {
+ return this.isTurboFirstPass;
+ }
+ set
+ {
+ this.isTurboFirstPass = value;
+ this.NotifyOfPropertyChange(() => this.IsTurboFirstPass);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether IsTwoPass.
+ /// </summary>
+ public bool IsTwoPass
+ {
+ get
+ {
+ return this.isTwoPass;
+ }
+ set
+ {
+ this.isTwoPass = value;
+ this.NotifyOfPropertyChange(() => this.IsTwoPass);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether IsVariableFramerate.
+ /// </summary>
+ public bool IsVariableFramerate
+ {
+ get
+ {
+ return this.isVariableFramerate;
+ }
+ set
+ {
+ this.isVariableFramerate = value;
+ if (value)
+ {
+ this.IsPeakFramerate = false;
+ this.IsConstantFramerate = false;
+ }
+
+ this.NotifyOfPropertyChange(() => this.IsVariableFramerate);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets QualityMax.
+ /// </summary>
+ public int QualityMax
+ {
+ get
+ {
+ return this.qualityMax;
+ }
+ set
+ {
+ this.qualityMax = value;
+ this.NotifyOfPropertyChange(() => this.QualityMax);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets QualityMin.
+ /// </summary>
+ public int QualityMin
+ {
+ get
+ {
+ return this.qualityMin;
+ }
+ set
+ {
+ this.qualityMin = value;
+ this.NotifyOfPropertyChange(() => this.QualityMin);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets RF.
+ /// </summary>
+ public int RF
+ {
+ get
+ {
+ return this.rf;
+ }
+ set
+ {
+ this.rf = value;
+ this.NotifyOfPropertyChange(() => this.RF);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets SelectedFramerate.
+ /// </summary>
+ public string SelectedFramerate
+ {
+ get
+ {
+ if (this.selectedFramerate == null)
+ {
+ return "Same as source";
+ }
+
+ return this.selectedFramerate.ToString();
+ }
+ set
+ {
+ if (value == "Same as source")
+ {
+ this.selectedFramerate = null;
+ this.ShowPeakFramerate = false;
+ }
+ else
+ {
+ this.ShowPeakFramerate = true;
+ this.selectedFramerate = double.Parse(value);
+ }
+
+ this.NotifyOfPropertyChange(() => this.SelectedFramerate);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets SelectedVideoEncoder.
+ /// </summary>
+ public string SelectedVideoEncoder
+ {
+ get
+ {
+ return EnumHelper<VideoEncoder>.GetDisplay(this.selectedVideoEncoder);
+ }
+ set
+ {
+ this.selectedVideoEncoder = EnumHelper<VideoEncoder>.GetValue(value);
+ this.NotifyOfPropertyChange(() => this.SelectedVideoEncoder);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether ShowPeakFramerate.
+ /// </summary>
+ public bool ShowPeakFramerate
+ {
+ get
+ {
+ return this.showPeakFramerate;
+ }
+ set
+ {
+ this.showPeakFramerate = value;
+ this.NotifyOfPropertyChange(() => this.ShowPeakFramerate);
+ }
+ }
+
+ /// <summary>
+ /// Gets VideoEncoders.
+ /// </summary>
+ public IEnumerable<string> VideoEncoders
+ {
+ get
+ {
+ return EnumHelper<VideoEncoder>.GetEnumDisplayValues(typeof(VideoEncoder));
+ }
+ }
+
+ #endregion
+
+ #region Public Methods
+
+ /// <summary>
+ /// Set the currently selected preset.
+ /// </summary>
+ /// <param name="preset">
+ /// The preset.
+ /// </param>
+ public void SetPreset(Preset preset)
+ {
+ }
+
+ #endregion
}
-}
+}
\ No newline at end of file diff --git a/win/CS/HandBrakeWPF/Views/ChaptersView.xaml b/win/CS/HandBrakeWPF/Views/ChaptersView.xaml index 9166dcf80..1c46e57ee 100644 --- a/win/CS/HandBrakeWPF/Views/ChaptersView.xaml +++ b/win/CS/HandBrakeWPF/Views/ChaptersView.xaml @@ -33,8 +33,6 @@ <DataGridTextColumn Header="Chapter Name" Width="*" Binding="{Binding ChapterName}" IsReadOnly="False" />
</DataGrid.Columns>
</DataGrid>
-
-
-
+
</Grid>
</UserControl>
diff --git a/win/CS/HandBrakeWPF/Views/FiltersView.xaml b/win/CS/HandBrakeWPF/Views/FiltersView.xaml index 1460e8f16..53e75a6b0 100644 --- a/win/CS/HandBrakeWPF/Views/FiltersView.xaml +++ b/win/CS/HandBrakeWPF/Views/FiltersView.xaml @@ -35,22 +35,22 @@ <TextBlock Text="Detelecine:" Grid.Row="0" Grid.Column="0" Margin="0,0,0,10" />
<ComboBox Width="120" Grid.Row="0" ItemsSource="{Binding DetelecineOptions}" SelectedItem="{Binding SelectedDetelecine}" Grid.Column="1" Margin="0,0,0,10"/>
- <TextBox Width="120" Grid.Row="0" Grid.Column="2" Margin="0,0,0,10"
+ <TextBox Width="120" Grid.Row="0" Grid.Column="2" Margin="0,0,0,10" Text="{Binding CustomDetelecine}"
Visibility="{Binding ShowDetelecineCustom, Converter={StaticResource boolToVisConverter}}"/>
<TextBlock Text="Decomb:" Grid.Row="1" Grid.Column="0" Margin="0,0,0,10"/>
<ComboBox Width="120" Grid.Row="1" ItemsSource="{Binding DecombOptions}" SelectedItem="{Binding SelectedDecomb}" Grid.Column="1" Margin="0,0,0,10"/>
- <TextBox Width="120" Grid.Row="1" Grid.Column="2" Margin="0,0,0,10"
+ <TextBox Width="120" Grid.Row="1" Grid.Column="2" Margin="0,0,0,10" Text="{Binding CustomDecomb}"
Visibility="{Binding ShowDecombCustom, Converter={StaticResource boolToVisConverter}}" />
<TextBlock Text="Deinterlace:" Grid.Row="2" Grid.Column="0" Margin="0,0,0,10"/>
<ComboBox Width="120" Grid.Row="2" ItemsSource="{Binding DeInterlaceOptions}" SelectedItem="{Binding SelectedDeInterlace}" Grid.Column="1" Margin="0,0,0,10"/>
- <TextBox Width="120" Grid.Row="2" Grid.Column="2" Margin="0,0,0,10"
+ <TextBox Width="120" Grid.Row="2" Grid.Column="2" Margin="0,0,0,10" Text="{Binding CustomDeinterlace}"
Visibility="{Binding ShowDeinterlaceCustom, Converter={StaticResource boolToVisConverter}}" />
<TextBlock Text="Denoise:" Grid.Row="3" Grid.Column="0" Margin="0,0,0,10"/>
<ComboBox Width="120" Grid.Row="3" ItemsSource="{Binding DenoiseOptions}" SelectedItem="{Binding SelectedDenoise}" Grid.Column="1" Margin="0,0,0,10"/>
- <TextBox Width="120" Grid.Row="3" Grid.Column="2" Margin="0,0,0,10"
+ <TextBox Width="120" Grid.Row="3" Grid.Column="2" Margin="0,0,0,10" Text="{Binding CustomDenoise}"
Visibility="{Binding ShowDenoiseCustom, Converter={StaticResource boolToVisConverter}}" />
<TextBlock Text="Deblock:" Grid.Row="4" Grid.Column="0" Margin="0,0,0,10"/>
diff --git a/win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml b/win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml index 4bc306ddf..5ebe36b33 100644 --- a/win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml +++ b/win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml @@ -1,7 +1,12 @@ <UserControl x:Class="HandBrakeWPF.Views.PictureSettingsView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:NumericUpDown="clr-namespace:EagleBoost.Wpf.Presentation.Controls.NumericUpDown;assembly=EagleBoost.Wpf.Presentation">
+ xmlns:NumericUpDown="clr-namespace:EagleBoost.Wpf.Presentation.Controls.NumericUpDown;assembly=EagleBoost.Wpf.Presentation"
+ xmlns:Converters="clr-namespace:HandBrakeWPF.Converters">
+
+ <UserControl.Resources>
+ <Converters:BooleanConverter x:Key="boolConverter" />
+ </UserControl.Resources>
<StackPanel Orientation="Horizontal" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
@@ -12,16 +17,16 @@ <!-- Row 1-->
<StackPanel Orientation="Horizontal" Margin="5,0,5,0">
<Label Content="Source" Grid.Row="0" Grid.Column="0" />
- <Label Content="---" Name="sourceResolution" Grid.Row="0" Grid.Column="1" />
+ <Label Content="{Binding SourceInfo}" Name="sourceResolution" Grid.Row="0" Grid.Column="1" />
</StackPanel>
<!-- Row 2-->
<StackPanel Orientation="Horizontal" Margin="5,0,5,0">
<Label Content="Width:" Grid.Row="1" Grid.Column="0" />
- <NumericUpDown:NumericUpDown Name="width" Minimum="0" Grid.Row="1" Grid.Column="1" Width="45" />
+ <NumericUpDown:NumericUpDown Value="{Binding Width}" Minimum="0" Grid.Row="1" Grid.Column="1" Width="45" />
<Label Content="Height:" Grid.Row="1" Grid.Column="2" />
- <NumericUpDown:NumericUpDown Name="height" Minimum="0" Grid.Row="1" Grid.Column="3" Width="45" />
- <CheckBox Content="Keep Aspect Ratio" VerticalAlignment="Center" Margin="5,0,0,0" />
+ <NumericUpDown:NumericUpDown Value="{Binding Height}" Minimum="0" Grid.Row="1" Grid.Column="3" Width="45" />
+ <CheckBox Content="Keep Aspect Ratio" IsChecked="{Binding MaintainAspectRatio}" VerticalAlignment="Center" Margin="5,0,0,0" />
</StackPanel>
<!-- Row 3-->
@@ -47,20 +52,20 @@ <Label Content="PAR Height:" Grid.Row="4" Grid.Column="0" />
<Label Content="Display Size:" Grid.Row="5" Grid.Column="0" />
- <ComboBox Width="110" Grid.Row="0" Grid.Column="1" HorizontalAlignment="Left" Margin="0,0,0,5" />
- <ComboBox Width="110" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Left" Margin="0,0,0,5" />
- <NumericUpDown:NumericUpDown Width="45" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Left" Margin="0,0,0,5" />
- <NumericUpDown:NumericUpDown Width="45" Grid.Row="3" Grid.Column="1" HorizontalAlignment="Left" Margin="0,0,0,5" />
- <NumericUpDown:NumericUpDown Width="45" Grid.Row="4" Grid.Column="1" HorizontalAlignment="Left" Margin="0,0,0,5" />
- <Label Content="---" Grid.Row="5" Grid.Column="1" HorizontalAlignment="Left" Margin="0,0,0,5" />
+ <ComboBox Width="110" Grid.Row="0" ItemsSource="{Binding AnamorphicModes}" SelectedItem="{Binding SelectedAnamorphicMode}" Grid.Column="1" HorizontalAlignment="Left" Margin="0,0,0,5" />
+ <ComboBox Width="110" Grid.Row="1" ItemsSource="{Binding ModulusValues}" SelectedItem="{Binding SelectedModulus}" Grid.Column="1" HorizontalAlignment="Left" Margin="0,0,0,5" />
+ <NumericUpDown:NumericUpDown Width="45" Value="{Binding DisplayWidth}" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Left" Margin="0,0,0,5" />
+ <NumericUpDown:NumericUpDown Width="45" Value="{Binding ParWidth}" Grid.Row="3" Grid.Column="1" HorizontalAlignment="Left" Margin="0,0,0,5" />
+ <NumericUpDown:NumericUpDown Width="45" Value="{Binding ParHeight}" Grid.Row="4" Grid.Column="1" HorizontalAlignment="Left" Margin="0,0,0,5" />
+ <Label Content="{Binding DisplaySize}" Grid.Row="5" Grid.Column="1" HorizontalAlignment="Left" Margin="0,0,0,5" />
</Grid>
</StackPanel>
<StackPanel Name="CropPanel" Margin="50,0,0,0" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<Label Content="Cropping" FontWeight="Bold" />
- <RadioButton Content="Automatic" Margin="10,0,0,0"/>
- <RadioButton Content="Custom" Margin="10,0,0,0" />
+ <RadioButton Content="Automatic" IsChecked="{Binding IsCustomCrop, Converter={StaticResource boolConverter}, ConverterParameter=true}" Margin="10,0,0,0"/>
+ <RadioButton Content="Custom" IsChecked="{Binding IsCustomCrop}" Margin="10,0,0,0" />
<Grid Margin="0,10,0,0">
<Grid.RowDefinitions>
@@ -84,10 +89,10 @@ <Label Content="Left" Grid.Row="2" Grid.Column="0" HorizontalAlignment="Center" />
<Label Content="Right" Grid.Row="2" Grid.Column="4" HorizontalAlignment="Center" />
- <NumericUpDown:NumericUpDown Width="45" Grid.Row="1" Grid.Column="2" HorizontalAlignment="Left" Margin="0,0,0,5" />
- <NumericUpDown:NumericUpDown Width="45" Grid.Row="3" Grid.Column="2" HorizontalAlignment="Left" Margin="0,0,0,5" />
- <NumericUpDown:NumericUpDown Width="45" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Left" Margin="0,0,0,5" />
- <NumericUpDown:NumericUpDown Width="45" Grid.Row="2" Grid.Column="3" HorizontalAlignment="Left" Margin="0,0,0,5" />
+ <NumericUpDown:NumericUpDown Width="45" Value="{Binding CropTop}" Grid.Row="1" Grid.Column="2" HorizontalAlignment="Left" Margin="0,0,0,5" />
+ <NumericUpDown:NumericUpDown Width="45" Value="{Binding CropBottom}" Grid.Row="3" Grid.Column="2" HorizontalAlignment="Left" Margin="0,0,0,5" />
+ <NumericUpDown:NumericUpDown Width="45" Value="{Binding CropLeft}" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Left" Margin="0,0,0,5" />
+ <NumericUpDown:NumericUpDown Width="45" Value="{Binding CropRight}" Grid.Row="2" Grid.Column="3" HorizontalAlignment="Left" Margin="0,0,0,5" />
</Grid>
diff --git a/win/CS/HandBrakeWPF/Views/VideoView.xaml b/win/CS/HandBrakeWPF/Views/VideoView.xaml index d06255b71..ada69e02e 100644 --- a/win/CS/HandBrakeWPF/Views/VideoView.xaml +++ b/win/CS/HandBrakeWPF/Views/VideoView.xaml @@ -2,8 +2,14 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- mc:Ignorable="d" >
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:Converters="clr-namespace:HandBrakeWPF.Converters" mc:Ignorable="d" >
+
+ <UserControl.Resources>
+ <Converters:BooleanConverter x:Key="boolConverter" />
+ <Converters:BooleanToVisibilityConverter x:Key="boolToVisConverter" />
+ </UserControl.Resources>
+
<Grid Margin="10,5,0,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
@@ -23,16 +29,16 @@ <StackPanel Orientation="Horizontal" Margin="0,0,0,10" >
<TextBlock Text="Video Codec:" Width="100" />
- <ComboBox Width="120"/>
+ <ComboBox Width="120" ItemsSource="{Binding VideoEncoders}" SelectedItem="{Binding SelectedVideoEncoder}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Franerate (FPS):" Width="100"/>
<StackPanel Orientation="Vertical">
- <ComboBox Width="120" />
- <RadioButton Content="Constant Framerate" />
- <RadioButton Content="Variable Framerate" />
- <RadioButton Content="Peak Framerate" />
+ <ComboBox Width="120" ItemsSource="{Binding Framerates}" SelectedItem="{Binding SelectedFramerate}" />
+ <RadioButton Content="Constant Framerate" IsChecked="{Binding IsConstantFramerate}" />
+ <RadioButton Content="Variable Framerate" IsChecked="{Binding IsVariableFramerate}" Visibility="{Binding ShowPeakFramerate, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}" />
+ <RadioButton Content="Peak Framerate" IsChecked="{Binding IsPeakFramerate}" Visibility="{Binding ShowPeakFramerate, Converter={StaticResource boolToVisConverter}, ConverterParameter=true}" />
</StackPanel>
</StackPanel>
</StackPanel>
@@ -42,21 +48,24 @@ <TextBlock Text="Quality" FontWeight="Bold" Margin="0,0,0,10"/>
<StackPanel Orientation="Horizontal" Margin="0,0,0,10" >
- <RadioButton Content="Constant Quality:" Margin="0,0,10,0"/>
- <TextBlock Text="0" Width="25" />
+ <RadioButton Content="Constant Quality:" IsChecked="{Binding IsConstantQuantity}" Margin="0,0,10,0"/>
+ <TextBlock Text="{Binding RF}" Width="25" />
<TextBlock Text="RF" FontWeight="Bold" />
</StackPanel>
- <Slider Width="240" Margin="0,0,0,20" />
+ <Slider Width="240" Value="{Binding RF}" Maximum="{Binding QualityMax}" Minimum="{Binding QualityMin}"
+ IsEnabled="{Binding IsConstantQuantity}" Margin="0,0,0,20" />
<StackPanel Orientation="Horizontal" Margin="0,0,0,10">
- <RadioButton Content="Avg Bitrate (kbps):" Margin="0,0,10,0"/>
- <TextBox Width="75" />
+ <RadioButton Content="Avg Bitrate (kbps):" IsChecked="{Binding IsConstantQuantity, Converter={StaticResource boolConverter}, ConverterParameter=true}" Margin="0,0,10,0"/>
+ <TextBox Width="75" Text="{Binding AverageBitrate}" IsEnabled="{Binding IsConstantQuantity, Converter={StaticResource boolConverter}, ConverterParameter=true}" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="30,0,0,0">
- <CheckBox Content="2-Pass Encoding" Margin="0,0,10,0" />
- <CheckBox Content="Turbo first pass" />
+ <CheckBox Content="2-Pass Encoding" IsEnabled="{Binding IsConstantQuantity, Converter={StaticResource boolConverter}, ConverterParameter=true}"
+ IsChecked="{Binding IsTwoPass}" Margin="0,0,10,0" />
+ <CheckBox Content="Turbo first pass" IsEnabled="{Binding IsConstantQuantity, Converter={StaticResource boolConverter}, ConverterParameter=true}"
+ IsChecked="{Binding IsTurboFirstPass}" />
</StackPanel>
</StackPanel>
|