summaryrefslogtreecommitdiffstats
path: root/win/CS
diff options
context:
space:
mode:
authorsr55 <[email protected]>2013-01-16 19:29:50 +0000
committersr55 <[email protected]>2013-01-16 19:29:50 +0000
commit9518d3be2e8e1368131b90dce3bfd452199c35a9 (patch)
treea0f494ab220a694ad2b47a96a3538eceeafde3c6 /win/CS
parent201ded15dac6aed5ed1089f6d7e78497fd791c03 (diff)
Merging trunk into opencl branch. This includes an update to libav-9.1
git-svn-id: svn://svn.handbrake.fr/HandBrake/branches/opencl@5177 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS')
-rw-r--r--win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs2
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/Encode.cs4
-rw-r--r--win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/AudioEncoder.cs3
-rw-r--r--win/CS/HandBrakeWPF/Commands/OpenOptionsScreenCommand.cs62
-rw-r--r--win/CS/HandBrakeWPF/Controls/NumberBox.xaml175
-rw-r--r--win/CS/HandBrakeWPF/Controls/NumberBox.xaml.cs655
-rw-r--r--win/CS/HandBrakeWPF/Controls/RefireControl.cs134
-rw-r--r--win/CS/HandBrakeWPF/Converters/Options/OptionsTabConverter.cs27
-rw-r--r--win/CS/HandBrakeWPF/Converters/Options/OptionsTabNameConverter.cs71
-rw-r--r--win/CS/HandBrakeWPF/HandBrakeWPF.csproj15
-rw-r--r--win/CS/HandBrakeWPF/Model/OptionsTab.cs37
-rw-r--r--win/CS/HandBrakeWPF/Properties/Resources.Designer.cs70
-rw-r--r--win/CS/HandBrakeWPF/Properties/Resources.resx44
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs55
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs152
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/Interfaces/IOptionsViewModel.cs9
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs38
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs44
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs14
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs93
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs26
-rw-r--r--win/CS/HandBrakeWPF/Views/AboutView.xaml55
-rw-r--r--win/CS/HandBrakeWPF/Views/AboutView.xaml.cs4
-rw-r--r--win/CS/HandBrakeWPF/Views/AddPresetView.xaml20
-rw-r--r--win/CS/HandBrakeWPF/Views/AdvancedView.xaml287
-rw-r--r--win/CS/HandBrakeWPF/Views/AudioView.xaml7
-rw-r--r--win/CS/HandBrakeWPF/Views/FiltersView.xaml2
-rw-r--r--win/CS/HandBrakeWPF/Views/OptionsView.xaml45
-rw-r--r--win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml37
-rw-r--r--win/CS/HandBrakeWPF/Views/ShellView.xaml4
-rw-r--r--win/CS/HandBrakeWPF/Views/SubtitlesView.xaml2
-rw-r--r--win/CS/HandBrakeWPF/Views/VideoView.xaml5
32 files changed, 1735 insertions, 463 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs b/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs
index 051052e47..c8238927f 100644
--- a/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs
+++ b/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs
@@ -260,7 +260,7 @@ namespace HandBrake.ApplicationServices.Model.Encoding
}
/// <summary>
- /// Gets the The UI display value for sample rate
+ /// Gets or sets the The UI display value for sample rate
/// </summary>
public string SampleRateDisplayValue
{
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Encode.cs b/win/CS/HandBrake.ApplicationServices/Services/Encode.cs
index ce75267c5..c136c18ee 100644
--- a/win/CS/HandBrake.ApplicationServices/Services/Encode.cs
+++ b/win/CS/HandBrake.ApplicationServices/Services/Encode.cs
@@ -118,7 +118,7 @@ namespace HandBrake.ApplicationServices.Services
if (this.userSettingService.GetUserSetting<bool>(ASUserSettingConstants.PreventSleep))
{
- // Win32.PreventSleep();
+ Win32.PreventSleep();
}
// Make sure the path exists, attempt to create it if it doesn't
@@ -143,7 +143,7 @@ namespace HandBrake.ApplicationServices.Services
ProcessStartInfo cliStart = new ProcessStartInfo(handbrakeCLIPath, query)
{
RedirectStandardOutput = true,
- RedirectStandardError = enableLogging ? true : false,
+ RedirectStandardError = enableLogging,
UseShellExecute = false,
CreateNoWindow = true
};
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/AudioEncoder.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/AudioEncoder.cs
index 570597176..c8877e6d6 100644
--- a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/AudioEncoder.cs
+++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Encoding/AudioEncoder.cs
@@ -2,6 +2,9 @@
// <copyright file="AudioEncoder.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>
+// The audio encoder enumeration
+// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace HandBrake.Interop.Model.Encoding
diff --git a/win/CS/HandBrakeWPF/Commands/OpenOptionsScreenCommand.cs b/win/CS/HandBrakeWPF/Commands/OpenOptionsScreenCommand.cs
new file mode 100644
index 000000000..30a473d90
--- /dev/null
+++ b/win/CS/HandBrakeWPF/Commands/OpenOptionsScreenCommand.cs
@@ -0,0 +1,62 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="OpenOptionsScreen.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>
+// A Command to display the options window.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.Commands
+{
+ using System;
+ using System.Windows.Input;
+
+ using Caliburn.Micro;
+
+ using HandBrakeWPF.Model;
+ using HandBrakeWPF.ViewModels.Interfaces;
+
+ /// <summary>
+ /// A Command to display the options window.
+ /// </summary>
+ public class OpenOptionsScreenCommand : ICommand
+ {
+ /// <summary>
+ /// The can execute changed.
+ /// </summary>
+ public event EventHandler CanExecuteChanged;
+
+ /// <summary>
+ /// The can execute.
+ /// </summary>
+ /// <param name="parameter">
+ /// The parameter.
+ /// </param>
+ /// <returns>
+ /// The <see cref="bool"/>.
+ /// </returns>
+ public bool CanExecute(object parameter)
+ {
+ return true;
+ }
+
+ /// <summary>
+ /// The execute.
+ /// </summary>
+ /// <param name="parameter">
+ /// The parameter.
+ /// </param>
+ public void Execute(object parameter)
+ {
+ var shellViewModel = IoC.Get<IShellViewModel>();
+ shellViewModel.DisplayWindow(ShellWindow.OptionsWindow);
+
+ if (parameter != null && parameter.GetType() == typeof(OptionsTab))
+ {
+ var optionsViewModel = IoC.Get<IOptionsViewModel>();
+ optionsViewModel.GotoTab((OptionsTab)parameter);
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/Controls/NumberBox.xaml b/win/CS/HandBrakeWPF/Controls/NumberBox.xaml
new file mode 100644
index 000000000..d8248d4e1
--- /dev/null
+++ b/win/CS/HandBrakeWPF/Controls/NumberBox.xaml
@@ -0,0 +1,175 @@
+<UserControl x:Class="HandBrakeWPF.Controls.NumberBox"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ Loaded="UserControl_Loaded">
+ <UserControl.Resources>
+ <Style x:Key="Arrow" TargetType="Polygon">
+ <Setter Property="Fill" Value="#333" />
+ </Style>
+ <!-- UpButton and DownButton are identical except for the border radius in the control template.
+ We can't pass that through so we need to duplicate the template. After a change is made from one button
+ template it should be copied to the other. -->
+ <Style x:Key="UpButton" TargetType="Button">
+ <Setter Property="Margin" Value="0"/>
+ <Setter Property="Background" >
+ <Setter.Value>
+ <LinearGradientBrush StartPoint="0,0" EndPoint="0,1" >
+ <GradientStop Color="#EEE" Offset="0.4"/>
+ <GradientStop Color="#BBB" Offset="1"/>
+ </LinearGradientBrush>
+ </Setter.Value>
+ </Setter>
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="Button">
+ <Border
+ Name="border"
+ BorderThickness="1"
+ BorderBrush="#888"
+ CornerRadius="0,2,0,0"
+ Background="{TemplateBinding Background}">
+ <ContentPresenter
+ Name="content"
+ HorizontalAlignment="Center" VerticalAlignment="Center" />
+ </Border>
+ <ControlTemplate.Triggers>
+ <Trigger Property="IsMouseOver" Value="True">
+ <Setter TargetName="border" Property="BorderBrush" Value="#FF4788c8" />
+ <Setter Property="Foreground" Value="#FF4788c8" />
+ </Trigger>
+ <Trigger Property="IsPressed" Value="True">
+ <Setter Property="Background" >
+ <Setter.Value>
+ <LinearGradientBrush StartPoint="0,0" EndPoint="0,1" >
+ <GradientStop Color="#CCC" Offset="0.4"/>
+ <GradientStop Color="#999" Offset="1"/>
+ </LinearGradientBrush>
+ </Setter.Value>
+ </Setter>
+ <Setter TargetName="content" Property="RenderTransform" >
+ <Setter.Value>
+ <TranslateTransform Y="1.0" />
+ </Setter.Value>
+ </Setter>
+ </Trigger>
+ <Trigger Property="IsDefaulted" Value="True">
+ <Setter TargetName="border" Property="BorderBrush" Value="#FF282828" />
+ </Trigger>
+ <Trigger Property="IsFocused" Value="True">
+ <Setter TargetName="border" Property="BorderBrush" Value="#FF282828" />
+ </Trigger>
+ <Trigger Property="IsEnabled" Value="False">
+ <Setter TargetName="border" Property="Opacity" Value="0.7" />
+ <Setter Property="Foreground" Value="Gray" />
+ </Trigger>
+ </ControlTemplate.Triggers>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+ <Style x:Key="DownButton" TargetType="Button">
+ <Setter Property="Margin" Value="0"/>
+ <Setter Property="Background" >
+ <Setter.Value>
+ <LinearGradientBrush StartPoint="0,0" EndPoint="0,1" >
+ <GradientStop Color="#EEE" Offset="0.4"/>
+ <GradientStop Color="#BBB" Offset="1"/>
+ </LinearGradientBrush>
+ </Setter.Value>
+ </Setter>
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="Button">
+ <Border
+ Name="border"
+ BorderThickness="1"
+ BorderBrush="#888"
+ CornerRadius="0,0,2,0"
+ Background="{TemplateBinding Background}">
+ <ContentPresenter
+ Name="content"
+ HorizontalAlignment="Center" VerticalAlignment="Center" />
+ </Border>
+ <ControlTemplate.Triggers>
+ <Trigger Property="IsMouseOver" Value="True">
+ <Setter TargetName="border" Property="BorderBrush" Value="#FF4788c8" />
+ <Setter Property="Foreground" Value="#FF4788c8" />
+ </Trigger>
+ <Trigger Property="IsPressed" Value="True">
+ <Setter Property="Background" >
+ <Setter.Value>
+ <LinearGradientBrush StartPoint="0,0" EndPoint="0,1" >
+ <GradientStop Color="#CCC" Offset="0.4"/>
+ <GradientStop Color="#999" Offset="1"/>
+ </LinearGradientBrush>
+ </Setter.Value>
+ </Setter>
+ <Setter TargetName="content" Property="RenderTransform" >
+ <Setter.Value>
+ <TranslateTransform Y="1.0" />
+ </Setter.Value>
+ </Setter>
+ </Trigger>
+ <Trigger Property="IsDefaulted" Value="True">
+ <Setter TargetName="border" Property="BorderBrush" Value="#FF282828" />
+ </Trigger>
+ <Trigger Property="IsFocused" Value="True">
+ <Setter TargetName="border" Property="BorderBrush" Value="#FF282828" />
+ </Trigger>
+ <Trigger Property="IsEnabled" Value="False">
+ <Setter TargetName="border" Property="Opacity" Value="0.7" />
+ <Setter Property="Foreground" Value="Gray" />
+ </Trigger>
+ </ControlTemplate.Triggers>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+ </UserControl.Resources>
+ <Grid>
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="*" />
+ <ColumnDefinition Width="Auto" />
+ </Grid.ColumnDefinitions>
+ <TextBox
+ Name="numberBox"
+ Grid.Column="0"
+ GotFocus="NumberBoxGotFocus"
+ LostFocus="NumberBoxLostFocus"
+ PreviewTextInput="NumberBoxPreviewTextInput"
+ PreviewKeyDown="NumberBoxPreviewKeyDown"
+ PreviewMouseDown="NumberBoxPreviewMouseDown"
+ PreviewMouseUp="NumberBoxPreviewMouseUp"
+ TextChanged="NumberBoxTextChanged"
+ VerticalContentAlignment="Center"/>
+ <Grid
+ Name="incrementButtonsGrid"
+ Grid.Column="1"
+ Width="16">
+ <Grid.RowDefinitions>
+ <RowDefinition Height="*" />
+ <RowDefinition Height="*" />
+ </Grid.RowDefinitions>
+ <Button
+ Style="{StaticResource UpButton}"
+ Grid.Row="0"
+ FontSize="4"
+ PreviewMouseLeftButtonDown="UpButtonMouseLeftButtonDown"
+ PreviewMouseLeftButtonUp="UpButtonMouseLeftButtonUp">
+ <Polygon
+ Style="{StaticResource Arrow}"
+ Points="4,0 0,4 8,4" />
+ </Button>
+ <Button
+ Style="{StaticResource DownButton}"
+ Grid.Row="1"
+ FontSize="4"
+ PreviewMouseLeftButtonDown="DownButtonMouseLeftButtonDown"
+ PreviewMouseLeftButtonUp="DownButtonMouseLeftButtonUp">
+ <Polygon
+ Style="{StaticResource Arrow}"
+ Points="0,0 8,0 4,4" />
+ </Button>
+ </Grid>
+ </Grid>
+</UserControl>
diff --git a/win/CS/HandBrakeWPF/Controls/NumberBox.xaml.cs b/win/CS/HandBrakeWPF/Controls/NumberBox.xaml.cs
new file mode 100644
index 000000000..7a8fc7519
--- /dev/null
+++ b/win/CS/HandBrakeWPF/Controls/NumberBox.xaml.cs
@@ -0,0 +1,655 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="NumberBox.xaml.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>
+// Interaction logic for NumberBox.xaml
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.Controls
+{
+ using System;
+ using System.Globalization;
+ using System.Linq;
+ using System.Windows;
+ using System.Windows.Controls;
+ using System.Windows.Input;
+ using System.Windows.Media;
+
+ /// <summary>
+ /// Interaction logic for NumberBox.xaml
+ /// </summary>
+ public partial class NumberBox
+ {
+ #region Constants and Fields
+
+ /// <summary>
+ /// The maximum property name.
+ /// </summary>
+ public const string MaximumPropertyName = "Maximum";
+
+ /// <summary>
+ /// The minimum property name.
+ /// </summary>
+ public const string MinimumPropertyName = "Minimum";
+
+ /// <summary>
+ /// The modulus property name.
+ /// </summary>
+ public const string ModulusPropertyName = "Modulus";
+
+ /// <summary>
+ /// The allow empty property.
+ /// </summary>
+ public static readonly DependencyProperty AllowEmptyProperty = DependencyProperty.Register(
+ "AllowEmpty", typeof(bool), typeof(NumberBox), new PropertyMetadata(true, OnAllowEmptyChanged));
+
+ /// <summary>
+ /// The maximum property.
+ /// </summary>
+ public static readonly DependencyProperty MaximumProperty = DependencyProperty.Register(
+ MaximumPropertyName, typeof(double), typeof(NumberBox), new UIPropertyMetadata(double.MaxValue));
+
+ /// <summary>
+ /// The minimum property.
+ /// </summary>
+ public static readonly DependencyProperty MinimumProperty = DependencyProperty.Register(
+ MinimumPropertyName, typeof(double), typeof(NumberBox), new UIPropertyMetadata(double.MinValue));
+
+ /// <summary>
+ /// The modulus property.
+ /// </summary>
+ public static readonly DependencyProperty ModulusProperty = DependencyProperty.Register(
+ ModulusPropertyName, typeof(double), typeof(NumberBox), new UIPropertyMetadata(0.0));
+
+ /// <summary>
+ /// The number property.
+ /// </summary>
+ public static readonly DependencyProperty NumberProperty = DependencyProperty.Register(
+ "Number", typeof(double), typeof(NumberBox), new PropertyMetadata(OnNumberChanged));
+
+ /// <summary>
+ /// The select all threshold.
+ /// </summary>
+ private static readonly TimeSpan SelectAllThreshold = TimeSpan.FromMilliseconds(500);
+
+ /// <summary>
+ /// The has focus.
+ /// </summary>
+ private bool hasFocus;
+
+ /// <summary>
+ /// The last focus mouse down.
+ /// </summary>
+ private DateTime lastFocusMouseDown;
+
+ /// <summary>
+ /// The none caption.
+ /// </summary>
+ private string noneCaption;
+
+ /// <summary>
+ /// The refire control.
+ /// </summary>
+ private RefireControl refireControl;
+
+ /// <summary>
+ /// The suppress refresh.
+ /// </summary>
+ private bool suppressRefresh;
+
+ #endregion
+
+ #region Constructors and Destructors
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="NumberBox"/> class.
+ /// </summary>
+ public NumberBox()
+ {
+ this.noneCaption = "(none)";
+ this.UpdateBindingOnTextChange = true;
+ this.ShowIncrementButtons = true;
+ this.SelectAllOnClick = true;
+
+ this.InitializeComponent();
+
+ this.RefreshNumberBox();
+ }
+
+ #endregion
+
+ #region Properties
+
+ /// <summary>
+ /// Gets or sets a value indicating whether allow empty.
+ /// </summary>
+ public bool AllowEmpty
+ {
+ get
+ {
+ return (bool)this.GetValue(AllowEmptyProperty);
+ }
+
+ set
+ {
+ this.SetValue(AllowEmptyProperty, value);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the maximum.
+ /// </summary>
+ public double Maximum
+ {
+ get
+ {
+ return (double)this.GetValue(MaximumProperty);
+ }
+ set
+ {
+ this.SetValue(MaximumProperty, value);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the minimum.
+ /// </summary>
+ public double Minimum
+ {
+ get
+ {
+ return (double)this.GetValue(MinimumProperty);
+ }
+ set
+ {
+ this.SetValue(MinimumProperty, value);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the modulus.
+ /// </summary>
+ public double Modulus
+ {
+ get
+ {
+ return (double)this.GetValue(ModulusProperty);
+ }
+ set
+ {
+ this.SetValue(ModulusProperty, value);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the none caption.
+ /// </summary>
+ public string NoneCaption
+ {
+ get
+ {
+ return this.noneCaption;
+ }
+
+ set
+ {
+ this.noneCaption = value;
+ this.RefreshNumberBox();
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the number.
+ /// </summary>
+ public double Number
+ {
+ get
+ {
+ return (double)this.GetValue(NumberProperty);
+ }
+
+ set
+ {
+ this.SetValue(NumberProperty, value);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether select all on click.
+ /// </summary>
+ public bool SelectAllOnClick { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether show increment buttons.
+ /// </summary>
+ public bool ShowIncrementButtons { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether update binding on text change.
+ /// </summary>
+ public bool UpdateBindingOnTextChange { get; set; }
+
+ /// <summary>
+ /// Gets the increment.
+ /// </summary>
+ private double Increment
+ {
+ get
+ {
+ return this.Modulus > 0 ? this.Modulus : 1;
+ }
+ }
+
+ #endregion
+
+ #region Methods
+
+ /// <summary>
+ /// The on allow empty changed.
+ /// </summary>
+ /// <param name="dependencyObject">
+ /// The dependency object.
+ /// </param>
+ /// <param name="eventArgs">
+ /// The event args.
+ /// </param>
+ private static void OnAllowEmptyChanged(
+ DependencyObject dependencyObject, DependencyPropertyChangedEventArgs eventArgs)
+ {
+ var numBox = dependencyObject as NumberBox;
+ if (numBox != null)
+ {
+ numBox.RefreshNumberBox();
+ }
+ }
+
+ /// <summary>
+ /// The on number changed.
+ /// </summary>
+ /// <param name="dependencyObject">
+ /// The dependency object.
+ /// </param>
+ /// <param name="eventArgs">
+ /// The event args.
+ /// </param>
+ private static void OnNumberChanged(
+ DependencyObject dependencyObject, DependencyPropertyChangedEventArgs eventArgs)
+ {
+ if (eventArgs.NewValue != eventArgs.OldValue)
+ {
+ var numBox = dependencyObject as NumberBox;
+
+ if (!numBox.suppressRefresh)
+ {
+ numBox.RefreshNumberBox();
+ }
+ }
+ }
+
+ /// <summary>
+ /// The decrement number.
+ /// </summary>
+ private void DecrementNumber()
+ {
+ double newNumber;
+ if (this.AllowEmpty && this.Number == 0)
+ {
+ newNumber = Math.Min(this.Maximum, -this.Increment);
+ }
+ else
+ {
+ newNumber = this.Number - this.Increment;
+ }
+
+ if (newNumber < this.Minimum)
+ {
+ newNumber = this.Minimum;
+ }
+
+ if (newNumber != this.Number)
+ {
+ this.Number = newNumber;
+ }
+ }
+
+ /// <summary>
+ /// The down button mouse left button down.
+ /// </summary>
+ /// <param name="sender">
+ /// The sender.
+ /// </param>
+ /// <param name="e">
+ /// The e.
+ /// </param>
+ private void DownButtonMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+ {
+ this.refireControl = new RefireControl(this.DecrementNumber);
+ this.refireControl.Begin();
+ }
+
+ /// <summary>
+ /// The down button mouse left button up.
+ /// </summary>
+ /// <param name="sender">
+ /// The sender.
+ /// </param>
+ /// <param name="e">
+ /// The e.
+ /// </param>
+ private void DownButtonMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
+ {
+ this.refireControl.Stop();
+ }
+
+ /// <summary>
+ /// The get nearest value.
+ /// </summary>
+ /// <param name="number">
+ /// The number.
+ /// </param>
+ /// <param name="modulus">
+ /// The modulus.
+ /// </param>
+ /// <returns>
+ /// The <see cref="double"/>.
+ /// </returns>
+ private double GetNearestValue(double number, double modulus)
+ {
+ double remainder = number % modulus;
+
+ if (remainder == 0)
+ {
+ return number;
+ }
+
+ return remainder >= (modulus / 2) ? number + (modulus - remainder) : number - remainder;
+ }
+
+ /// <summary>
+ /// The increment number.
+ /// </summary>
+ private void IncrementNumber()
+ {
+ double newNumber;
+ if (this.AllowEmpty && this.Number == 0)
+ {
+ newNumber = Math.Max(this.Minimum, this.Increment);
+ }
+ else
+ {
+ newNumber = this.Number + this.Increment;
+ }
+
+ if (newNumber > this.Maximum)
+ {
+ newNumber = this.Maximum;
+ }
+
+ if (newNumber != this.Number)
+ {
+ this.Number = newNumber;
+ }
+ }
+
+ /// <summary>
+ /// The number box got focus.
+ /// </summary>
+ /// <param name="sender">
+ /// The sender.
+ /// </param>
+ /// <param name="e">
+ /// The e.
+ /// </param>
+ private void NumberBoxGotFocus(object sender, RoutedEventArgs e)
+ {
+ this.hasFocus = true;
+
+ if (this.AllowEmpty)
+ {
+ if (this.Number == 0)
+ {
+ this.numberBox.Text = string.Empty;
+ }
+
+ this.numberBox.Foreground = new SolidColorBrush(Colors.Black);
+ }
+ }
+
+ /// <summary>
+ /// The number box lost focus.
+ /// </summary>
+ /// <param name="sender">
+ /// The sender.
+ /// </param>
+ /// <param name="e">
+ /// The e.
+ /// </param>
+ private void NumberBoxLostFocus(object sender, RoutedEventArgs e)
+ {
+ this.hasFocus = false;
+
+ if (this.AllowEmpty && this.numberBox.Text == string.Empty)
+ {
+ this.Number = 0;
+ this.RefreshNumberBox();
+ return;
+ }
+
+ this.UpdateNumberBindingFromBox();
+ this.RefreshNumberBox();
+ }
+
+ /// <summary>
+ /// The number box preview key down.
+ /// </summary>
+ /// <param name="sender">
+ /// The sender.
+ /// </param>
+ /// <param name="e">
+ /// The e.
+ /// </param>
+ private void NumberBoxPreviewKeyDown(object sender, KeyEventArgs e)
+ {
+ if (e.Key == Key.Space)
+ {
+ e.Handled = true;
+ }
+ }
+
+ /// <summary>
+ /// The number box preview mouse down.
+ /// </summary>
+ /// <param name="sender">
+ /// The sender.
+ /// </param>
+ /// <param name="e">
+ /// The e.
+ /// </param>
+ private void NumberBoxPreviewMouseDown(object sender, MouseButtonEventArgs e)
+ {
+ if (!this.hasFocus)
+ {
+ this.lastFocusMouseDown = DateTime.Now;
+ }
+ }
+
+ /// <summary>
+ /// The number box preview mouse up.
+ /// </summary>
+ /// <param name="sender">
+ /// The sender.
+ /// </param>
+ /// <param name="e">
+ /// The e.
+ /// </param>
+ private void NumberBoxPreviewMouseUp(object sender, MouseButtonEventArgs e)
+ {
+ // If this mouse up is soon enough after an initial click on the box, select all.
+ if (this.SelectAllOnClick && DateTime.Now - this.lastFocusMouseDown < SelectAllThreshold)
+ {
+ this.Dispatcher.BeginInvoke(new Action(() => this.numberBox.SelectAll()));
+ }
+ }
+
+ /// <summary>
+ /// The number box preview text input.
+ /// </summary>
+ /// <param name="sender">
+ /// The sender.
+ /// </param>
+ /// <param name="e">
+ /// The e.
+ /// </param>
+ private void NumberBoxPreviewTextInput(object sender, TextCompositionEventArgs e)
+ {
+ if (e.Text.Any(c => !char.IsNumber(c) && c != '.' && (this.Minimum >= 0 || c != '-')))
+ {
+ e.Handled = true;
+ }
+ }
+
+ /// <summary>
+ /// The number box text changed.
+ /// </summary>
+ /// <param name="sender">
+ /// The sender.
+ /// </param>
+ /// <param name="e">
+ /// The e.
+ /// </param>
+ private void NumberBoxTextChanged(object sender, TextChangedEventArgs e)
+ {
+ if (this.UpdateBindingOnTextChange)
+ {
+ if (this.AllowEmpty && this.numberBox.Text == string.Empty)
+ {
+ this.Number = 0;
+ return;
+ }
+
+ this.UpdateNumberBindingFromBox();
+ }
+
+ this.RefreshNumberBoxColor();
+ }
+
+ /// <summary>
+ /// The number is valid.
+ /// </summary>
+ /// <param name="number">
+ /// The number.
+ /// </param>
+ /// <returns>
+ /// The <see cref="bool"/>.
+ /// </returns>
+ private bool NumberIsValid(double number)
+ {
+ return number >= this.Minimum && number <= this.Maximum;
+ }
+
+ /// <summary>
+ /// The refresh number box.
+ /// </summary>
+ private void RefreshNumberBox()
+ {
+ if (this.AllowEmpty && this.Number == 0)
+ {
+ this.numberBox.Text = this.hasFocus ? string.Empty : this.NoneCaption;
+
+ // this.numberBox.Foreground = new SolidColorBrush(Colors.Gray);
+ }
+ else
+ {
+ this.numberBox.Text = this.Number.ToString(CultureInfo.InvariantCulture);
+
+ // this.numberBox.Foreground = new SolidColorBrush(Colors.Black);
+ }
+
+ this.RefreshNumberBoxColor();
+ }
+
+ /// <summary>
+ /// The refresh number box color.
+ /// </summary>
+ private void RefreshNumberBoxColor()
+ {
+ this.numberBox.Foreground = this.numberBox.Text == this.NoneCaption ? new SolidColorBrush(Colors.Gray) : new SolidColorBrush(Colors.Black);
+ }
+
+ /// <summary>
+ /// The up button mouse left button down.
+ /// </summary>
+ /// <param name="sender">
+ /// The sender.
+ /// </param>
+ /// <param name="e">
+ /// The e.
+ /// </param>
+ private void UpButtonMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+ {
+ this.refireControl = new RefireControl(this.IncrementNumber);
+ this.refireControl.Begin();
+ }
+
+ /// <summary>
+ /// The up button mouse left button up.
+ /// </summary>
+ /// <param name="sender">
+ /// The sender.
+ /// </param>
+ /// <param name="e">
+ /// The e.
+ /// </param>
+ private void UpButtonMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
+ {
+ this.refireControl.Stop();
+ }
+
+ /// <summary>
+ /// The update number binding from box.
+ /// </summary>
+ private void UpdateNumberBindingFromBox()
+ {
+ double newNumber;
+ if (double.TryParse(this.numberBox.Text, out newNumber))
+ {
+ if (this.NumberIsValid(newNumber))
+ {
+ if (this.Modulus != 0)
+ {
+ newNumber = this.GetNearestValue(newNumber, this.Modulus);
+ }
+
+ if (newNumber != this.Number)
+ {
+ // While updating the binding we don't need to react to the change.
+ this.suppressRefresh = true;
+ this.Number = newNumber;
+ this.suppressRefresh = false;
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// The user control_ loaded.
+ /// </summary>
+ /// <param name="sender">
+ /// The sender.
+ /// </param>
+ /// <param name="e">
+ /// The e.
+ /// </param>
+ private void UserControl_Loaded(object sender, RoutedEventArgs e)
+ {
+ if (!this.ShowIncrementButtons)
+ {
+ this.incrementButtonsGrid.Visibility = Visibility.Collapsed;
+ }
+ }
+
+ #endregion
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/Controls/RefireControl.cs b/win/CS/HandBrakeWPF/Controls/RefireControl.cs
new file mode 100644
index 000000000..e32f3b589
--- /dev/null
+++ b/win/CS/HandBrakeWPF/Controls/RefireControl.cs
@@ -0,0 +1,134 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="RefireControl.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>
+// The refire control.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.Controls
+{
+ using System;
+ using System.Collections.Generic;
+ using System.Diagnostics;
+ using System.Threading;
+ using System.Windows;
+
+ /// <summary>
+ /// The refire control.
+ /// </summary>
+ public class RefireControl
+ {
+ #region Constants and Fields
+
+ /// <summary>
+ /// How long stages last.
+ /// </summary>
+ private const int StageDurationMsec = 900;
+
+ /// <summary>
+ /// The delays. At each stage the refire rate increases.
+ /// </summary>
+ private static readonly List<int> Delays = new List<int> { 500, 200, 100, 50, 20 };
+
+ /// <summary>
+ /// The refire action.
+ /// </summary>
+ private readonly Action refireAction;
+
+ /// <summary>
+ /// The refire sync.
+ /// </summary>
+ private readonly object refireSync = new object();
+
+ /// <summary>
+ /// The refire timer.
+ /// </summary>
+ private Timer refireTimer;
+
+ /// <summary>
+ /// The running.
+ /// </summary>
+ private bool running;
+
+ /// <summary>
+ /// The stopwatch.
+ /// </summary>
+ private Stopwatch stopwatch;
+
+ #endregion
+
+ #region Constructors and Destructors
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="RefireControl"/> class.
+ /// </summary>
+ /// <param name="refireAction">
+ /// The refire action.
+ /// </param>
+ public RefireControl(Action refireAction)
+ {
+ this.refireAction = refireAction;
+ }
+
+ #endregion
+
+ #region Public Methods
+
+ /// <summary>
+ /// The begin.
+ /// </summary>
+ public void Begin()
+ {
+ lock (this.refireSync)
+ {
+ this.stopwatch = Stopwatch.StartNew();
+ this.running = true;
+
+ // Fire once immediately.
+ this.refireAction();
+
+ this.refireTimer = new Timer(
+ obj =>
+ {
+ lock (this.refireSync)
+ {
+ if (this.running)
+ {
+ var stage = (int)(this.stopwatch.ElapsedMilliseconds / StageDurationMsec);
+
+ int newDelay = stage >= Delays.Count ? Delays[Delays.Count - 1] : Delays[stage];
+
+ Application.Current.Dispatcher.BeginInvoke(this.refireAction);
+
+ this.refireTimer.Change(newDelay, newDelay);
+ }
+ }
+ },
+ null,
+ Delays[0],
+ Delays[0]);
+ }
+ }
+
+ /// <summary>
+ /// The stop.
+ /// </summary>
+ public void Stop()
+ {
+ lock (this.refireSync)
+ {
+ this.stopwatch.Stop();
+ this.running = false;
+
+ if (this.refireTimer != null)
+ {
+ this.refireTimer.Dispose();
+ }
+ }
+ }
+
+ #endregion
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/Converters/Options/OptionsTabConverter.cs b/win/CS/HandBrakeWPF/Converters/Options/OptionsTabConverter.cs
index 9c561e549..128596f3f 100644
--- a/win/CS/HandBrakeWPF/Converters/Options/OptionsTabConverter.cs
+++ b/win/CS/HandBrakeWPF/Converters/Options/OptionsTabConverter.cs
@@ -15,6 +15,8 @@ namespace HandBrakeWPF.Converters.Options
using System.Windows;
using System.Windows.Data;
+ using HandBrakeWPF.Model;
+
/// <summary>
/// The Options Tab Converter. Controls which tab is dispalyed.
/// </summary>
@@ -31,22 +33,25 @@ namespace HandBrakeWPF.Converters.Options
{
if (value != null && parameter != null)
{
- switch (value.ToString())
+ switch ((OptionsTab)value)
{
- case "General":
- if (parameter.ToString() == "General") return Visibility.Visible;
+ case OptionsTab.General:
+ if ((OptionsTab)parameter == OptionsTab.General) return Visibility.Visible;
+ break;
+ case OptionsTab.OutputFiles:
+ if ((OptionsTab)parameter == OptionsTab.OutputFiles) return Visibility.Visible;
break;
- case "Output Files":
- if (parameter.ToString() == "Output Files") return Visibility.Visible;
+ case OptionsTab.AudioAndSubtitles:
+ if ((OptionsTab)parameter == OptionsTab.AudioAndSubtitles) return Visibility.Visible;
break;
- case "Audio and Subtitles":
- if (parameter.ToString() == "Audio and Subtitles") return Visibility.Visible;
+ case OptionsTab.Advanced:
+ if ((OptionsTab)parameter == OptionsTab.Advanced) return Visibility.Visible;
break;
- case "Advanced":
- if (parameter.ToString() == "Advanced") return Visibility.Visible;
+ case OptionsTab.Updates:
+ if ((OptionsTab)parameter == OptionsTab.Updates) return Visibility.Visible;
break;
- case "Updates":
- if (parameter.ToString() == "Updates") return Visibility.Visible;
+ case OptionsTab.About:
+ if ((OptionsTab)parameter == OptionsTab.About) return Visibility.Visible;
break;
}
}
diff --git a/win/CS/HandBrakeWPF/Converters/Options/OptionsTabNameConverter.cs b/win/CS/HandBrakeWPF/Converters/Options/OptionsTabNameConverter.cs
new file mode 100644
index 000000000..beddd18be
--- /dev/null
+++ b/win/CS/HandBrakeWPF/Converters/Options/OptionsTabNameConverter.cs
@@ -0,0 +1,71 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="OptionsTabNameConverter.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>
+// A Converter to get the Display Name of each options tab.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.Converters.Options
+{
+ using System;
+ using System.Globalization;
+ using System.Windows.Data;
+
+ using HandBrake.ApplicationServices.Utilities;
+
+ using HandBrakeWPF.Model;
+
+ /// <summary>
+ /// A Converter to get the Display Name of each options tab.
+ /// </summary>
+ public class OptionsTabNameConverter : IValueConverter
+ {
+ /// <summary>
+ /// The convert.
+ /// </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>
+ /// The <see cref="object"/>.
+ /// </returns>
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return EnumHelper<OptionsTab>.GetDisplay((OptionsTab)value);
+ }
+
+ /// <summary>
+ /// The convert back.
+ /// </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>
+ /// The <see cref="object"/>.
+ /// </returns>
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return EnumHelper<OptionsTab>.GetValue(value.ToString());
+ }
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj
index 4b3afd937..e11f8e8f9 100644
--- a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj
+++ b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj
@@ -81,7 +81,8 @@
<Reference Include="Castle.Windsor">
<HintPath>..\libraries\caliburn\Castle.Windsor.dll</HintPath>
</Reference>
- <Reference Include="EagleBoost.Wpf.Presentation">
+ <Reference Include="EagleBoost.Wpf.Presentation, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
<HintPath>..\libraries\EagleBoost.Wpf.Presentation.dll</HintPath>
</Reference>
<Reference Include="GongSolutions.Wpf.DragDrop">
@@ -100,6 +101,7 @@
</Reference>
<Reference Include="PresentationFramework" />
<Reference Include="System" />
+ <Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Drawing" />
<Reference Include="System.Management" />
<Reference Include="System.Runtime.Serialization" />
@@ -123,12 +125,17 @@
<Compile Include="AttachedProperties\MenuItemExtensions.cs" />
<Compile Include="Commands\CancelScanCommand.cs" />
<Compile Include="Commands\Interfaces\IAdvancedEncoderOptionsCommand.cs" />
+ <Compile Include="Commands\OpenOptionsScreenCommand.cs" />
<Compile Include="Commands\ProcessShortcutCommand.cs" />
<Compile Include="Commands\SourceMenuCommand.cs" />
<Compile Include="Commands\AdvancedEncoderOptionsCommand.cs" />
<Compile Include="Controls\Loading.xaml.cs">
<DependentUpon>Loading.xaml</DependentUpon>
</Compile>
+ <Compile Include="Controls\NumberBox.xaml.cs">
+ <DependentUpon>NumberBox.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Controls\RefireControl.cs" />
<Compile Include="Controls\StatusPanel.xaml.cs">
<DependentUpon>StatusPanel.xaml</DependentUpon>
</Compile>
@@ -137,10 +144,12 @@
<Compile Include="Converters\Audio\AudioQueueDisplayConverter.cs" />
<Compile Include="Converters\BooleanToHiddenVisibilityConverter.cs" />
<Compile Include="Converters\Options\OptionsTabConverter.cs" />
+ <Compile Include="Converters\Options\OptionsTabNameConverter.cs" />
<Compile Include="Converters\Subtitles\SubtitlesQueueDisplayConverter.cs" />
<Compile Include="Converters\Video\VideoEncoderConverter.cs" />
<Compile Include="Helpers\GrayscaleImage.cs" />
<Compile Include="Helpers\GrowlCommunicator.cs" />
+ <Compile Include="Model\OptionsTab.cs" />
<Compile Include="Services\DriveDetectService.cs" />
<Compile Include="Services\EncodeServiceWrapper.cs" />
<Compile Include="Services\Interfaces\IDriveDetectService.cs" />
@@ -299,6 +308,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
+ <Page Include="Controls\NumberBox.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
<Page Include="Controls\StatusPanel.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
diff --git a/win/CS/HandBrakeWPF/Model/OptionsTab.cs b/win/CS/HandBrakeWPF/Model/OptionsTab.cs
new file mode 100644
index 000000000..93692d13d
--- /dev/null
+++ b/win/CS/HandBrakeWPF/Model/OptionsTab.cs
@@ -0,0 +1,37 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="OptionsTab.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>
+// A enum representing each tab on the options screen.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.Model
+{
+ using System.ComponentModel.DataAnnotations;
+
+ /// <summary>
+ /// A enum representing each tab on the options screen.
+ /// </summary>
+ public enum OptionsTab
+ {
+ [Display(Name = "General")]
+ General = 0,
+
+ [Display(Name = "Output Files")]
+ OutputFiles,
+
+ [Display(Name = "Audio and Subtitles")]
+ AudioAndSubtitles,
+
+ [Display(Name = "Advanced")]
+ Advanced,
+
+ [Display(Name = "Updates")]
+ Updates,
+
+ [Display(Name = "About HandBrake")]
+ About,
+ }
+}
diff --git a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs
index ba0031cc6..5adc38011 100644
--- a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs
+++ b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs
@@ -61,6 +61,40 @@ namespace HandBrakeWPF.Properties {
}
/// <summary>
+ /// Looks up a localized string similar to Copyright (C) 2003-2013 The HandBrake Team
+ ///
+ ///This program is free software; you can redistribute it and/or
+ ///modify it under the terms of the GNU General Public License
+ ///as published by the Free Software Foundation; either version 2
+ ///of the License, or (at your option) any later version.
+ ///
+ ///This program is distributed in the hope that it will be useful,
+ ///but WITHOUT ANY WARRANTY; without even the implied warranty of
+ ///MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ ///GNU General Public License f [rest of string was truncated]&quot;;.
+ /// </summary>
+ public static string About_GPL {
+ get {
+ return ResourceManager.GetString("About_GPL", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to You can optionally store a maximum resolution for encodes that use this preset. There are 3 modes:
+ ///
+ ///None: There is no maximum resolution for encodes using this preset. They will always use the source resolution minus any cropping that may be applied.
+ ///
+ ///Custom: You can optionally set a Maximum width and height. When doing this an encode will be less than or equal to these values.
+ ///
+ ///Source Maximum: Similar to custom, but the resolution of your current source is used as the Max width and Height values in [rest of string was truncated]&quot;;.
+ /// </summary>
+ public static string AddPreset_PictureSizeMode {
+ get {
+ return ResourceManager.GetString("AddPreset_PictureSizeMode", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to x264 has a variety of algorithms to decide when to use B-frames and how many to use.
///
///Fast mode takes roughly the same amount of time no matter how many B-frames you specify. However, while fast, its decisions are often suboptimal.
@@ -153,6 +187,17 @@ namespace HandBrakeWPF.Properties {
}
/// <summary>
+ /// Looks up a localized string similar to The options passed to the x264 encoder.
+ ///The above controls are only a subset of useful x264 parameters.
+ ///This box allows you to add or modify additional or current parameters as desired. .
+ /// </summary>
+ public static string Advanced_EncoderOptions {
+ get {
+ return ResourceManager.GetString("Advanced_EncoderOptions", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to Controls the motion estimation method. Motion estimation is how the encoder estimates how each block of pixels in a frame has moved.
///A better motion search method improves compression at the cost of speed.
///
@@ -287,6 +332,31 @@ namespace HandBrakeWPF.Properties {
}
/// <summary>
+ /// Looks up a localized string similar to Warning: RF 0 is Lossless!.
+ /// </summary>
+ public static string Video_LosslessWarning {
+ get {
+ return ResourceManager.GetString("Video_LosslessWarning", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to A value of 0 means lossless and will result in a file size that is larger than the original source,
+ ///unless the source was also lossless.
+ ///
+ ///x264&apos;s scale is logarithmic and lower values correspond to higher quality.
+ ///
+ ///So small increases in value will result in progressively larger increases in the resulting file size.
+ ///
+ ///Suggested values are: 18 to 20 for Standard Definition and 20 to 23 for High Definition..
+ /// </summary>
+ public static string Video_LosslessWarningTooltip {
+ get {
+ return ResourceManager.GetString("Video_LosslessWarningTooltip", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to Set the desired quality factor. The encoder targets a certain quality.
///The scale used by each video encoder is different.
///
diff --git a/win/CS/HandBrakeWPF/Properties/Resources.resx b/win/CS/HandBrakeWPF/Properties/Resources.resx
index 6265c3fc9..6148d29c6 100644
--- a/win/CS/HandBrakeWPF/Properties/Resources.resx
+++ b/win/CS/HandBrakeWPF/Properties/Resources.resx
@@ -277,4 +277,48 @@ Suggested values are: 18 to 20 for Standard Definition and 20 to 23 for High Def
FFMpeg's and Theora's scale is more linear. These encoders do not have a lossless mode.</value>
</data>
+ <data name="Video_LosslessWarning" xml:space="preserve">
+ <value>Warning: RF 0 is Lossless!</value>
+ </data>
+ <data name="Video_LosslessWarningTooltip" xml:space="preserve">
+ <value>A value of 0 means lossless and will result in a file size that is larger than the original source,
+unless the source was also lossless.
+
+x264's scale is logarithmic and lower values correspond to higher quality.
+
+So small increases in value will result in progressively larger increases in the resulting file size.
+
+Suggested values are: 18 to 20 for Standard Definition and 20 to 23 for High Definition.</value>
+ </data>
+ <data name="AddPreset_PictureSizeMode" xml:space="preserve">
+ <value>You can optionally store a maximum resolution for encodes that use this preset. There are 3 modes:
+
+None: There is no maximum resolution for encodes using this preset. They will always use the source resolution minus any cropping that may be applied.
+
+Custom: You can optionally set a Maximum width and height. When doing this an encode will be less than or equal to these values.
+
+Source Maximum: Similar to custom, but the resolution of your current source is used as the Max width and Height values instead.</value>
+ </data>
+ <data name="Advanced_EncoderOptions" xml:space="preserve">
+ <value>The options passed to the x264 encoder.
+The above controls are only a subset of useful x264 parameters.
+This box allows you to add or modify additional or current parameters as desired. </value>
+ </data>
+ <data name="About_GPL" xml:space="preserve">
+ <value>Copyright (C) 2003-2013 The HandBrake Team
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.</value>
+ </data>
</root> \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs
index 29b4bed48..741f31876 100644
--- a/win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs
@@ -98,7 +98,7 @@ namespace HandBrakeWPF.ViewModels
/// <summary>
/// The motion estimation range.
/// </summary>
- private AdvancedChoice motionEstimationRange;
+ private int motionEstimationRange;
/// <summary>
/// The no dct decimate.
@@ -418,7 +418,13 @@ namespace HandBrakeWPF.ViewModels
{
this.motionEstimationMethod = value;
this.NotifyOfPropertyChange(() => this.MotionEstimationMethod);
- this.NotifyOfPropertyChange(() => this.MotionEstimationRangeVisible);
+
+ if ((MotionEstimationMethod.Value == "hex" || MotionEstimationMethod.Value == "dia") && (motionEstimationRange > 16))
+ {
+ this.motionEstimationRange = 16;
+ this.NotifyOfPropertyChange(() => this.MotionEstimationRange);
+ }
+
this.UpdateOptionsString();
}
}
@@ -426,7 +432,7 @@ namespace HandBrakeWPF.ViewModels
/// <summary>
/// Gets or sets MotionEstimationRange.
/// </summary>
- public AdvancedChoice MotionEstimationRange
+ public int MotionEstimationRange
{
get
{
@@ -435,25 +441,25 @@ namespace HandBrakeWPF.ViewModels
set
{
- this.motionEstimationRange = value;
+ if ((MotionEstimationMethod.Value == "hex" || MotionEstimationMethod.Value == "dia") && (value > 16))
+ {
+ this.motionEstimationRange = 16;
+ }
+ else if (value < 4)
+ {
+ this.motionEstimationRange = 4;
+ }
+ else
+ {
+ this.motionEstimationRange = value;
+ }
+
this.NotifyOfPropertyChange(() => this.MotionEstimationRange);
this.UpdateOptionsString();
}
}
/// <summary>
- /// Gets a value indicating whether MotionEstimationRangeVisible.
- /// </summary>
- public bool MotionEstimationRangeVisible
- {
- get
- {
- string motionMethod = this.MotionEstimationMethod.Value;
- return motionMethod == "umh" || motionMethod == "esa" || motionMethod == "tesa";
- }
- }
-
- /// <summary>
/// Gets or sets a value indicating whether NoDctDecimate.
/// </summary>
public bool NoDctDecimate
@@ -772,13 +778,7 @@ namespace HandBrakeWPF.ViewModels
case "merange":
if (int.TryParse(optionValue, out parseInt))
{
- newChoice =
- AdvancedChoicesHelper.MotionEstimationRange.SingleOrDefault(
- choice => choice.Value == parseInt.ToString(CultureInfo.InvariantCulture));
- if (newChoice != null)
- {
- this.MotionEstimationRange = newChoice;
- }
+ this.MotionEstimationRange = parseInt;
}
break;
@@ -1015,8 +1015,7 @@ namespace HandBrakeWPF.ViewModels
AdvancedChoicesHelper.MotionEstimationMethod.SingleOrDefault(choice => choice.IsDefault);
this.SubpixelMotionEstimation =
AdvancedChoicesHelper.SubpixelMotionEstimation.SingleOrDefault(choice => choice.IsDefault);
- this.MotionEstimationRange =
- AdvancedChoicesHelper.MotionEstimationRange.SingleOrDefault(choice => choice.IsDefault);
+ this.MotionEstimationRange = 16;
this.Analysis = AdvancedChoicesHelper.Analysis.SingleOrDefault(choice => choice.IsDefault);
this.EightByEightDct = true;
this.CabacEntropyCoding = true;
@@ -1107,11 +1106,9 @@ namespace HandBrakeWPF.ViewModels
newOptions.Add("subme=" + this.SubpixelMotionEstimation.Value);
}
- string motionEstimation = this.MotionEstimationMethod.Value;
- if ((motionEstimation == "umh" || motionEstimation == "esa" || motionEstimation == "tesa") &&
- !this.MotionEstimationRange.IsDefault)
+ if (this.MotionEstimationRange != 16)
{
- newOptions.Add("merange=" + this.MotionEstimationRange.Value);
+ newOptions.Add("merange=" + this.MotionEstimationRange);
}
if (!this.Analysis.IsDefault)
diff --git a/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs
index 8f7cbbc01..516fc7642 100644
--- a/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs
@@ -23,6 +23,8 @@ namespace HandBrakeWPF.ViewModels
using HandBrake.ApplicationServices.Utilities;
using HandBrake.Interop.Model.Encoding;
+ using HandBrakeWPF.Commands;
+ using HandBrakeWPF.Model;
using HandBrakeWPF.ViewModels.Interfaces;
/// <summary>
@@ -167,6 +169,15 @@ namespace HandBrakeWPF.ViewModels
}
}
+ /// <summary>
+ /// Open the options screen to the Audio and Subtitles tab.
+ /// </summary>
+ public void SetDefaultBehaviour()
+ {
+ OpenOptionsScreenCommand command = new OpenOptionsScreenCommand();
+ command.Execute(OptionsTab.AudioAndSubtitles);
+ }
+
#endregion
#region Implemented Interfaces
@@ -259,7 +270,7 @@ namespace HandBrakeWPF.ViewModels
{
if (this.SourceTracks != null)
{
- Audio track = sourceTrack ?? this.SourceTracks.FirstOrDefault();
+ Audio track = sourceTrack ?? this.GetPreferredAudioTrack();
if (track != null)
{
this.Task.AudioTracks.Add(new AudioTrack { ScannedTrack = track });
@@ -272,11 +283,20 @@ namespace HandBrakeWPF.ViewModels
/// </summary>
private void AddAllRemainingTracks()
{
+ // For all the source audio tracks
foreach (Audio sourceTrack in this.SourceTracks)
{
- bool found = this.Task.AudioTracks.Any(audioTrack => audioTrack.ScannedTrack == sourceTrack);
+ // Step 1: If "Add only One per language" is turned on, check to see if this language is already added.
+ if (this.CanSkipSourceTrack(sourceTrack))
+ {
+ continue;
+ }
+
+ // Step 2: Check if the track list already contrains this track
+ bool found = this.Task.AudioTracks.Any(audioTrack => Equals(audioTrack.ScannedTrack, sourceTrack));
if (!found)
{
+ // If it doesn't, add it.
this.Add(sourceTrack);
}
}
@@ -287,24 +307,20 @@ namespace HandBrakeWPF.ViewModels
/// </summary>
public void AddAllRemainingForSelectedLanguages()
{
- // Figure out the source tracks we want to add
- List<Audio> trackList = new List<Audio>();
- foreach (
- string language in
- this.UserSettingService.GetUserSetting<StringCollection>(
- UserSettingConstants.SelectedLanguages))
- {
- // TODO add support for "Add only 1 per language"
- trackList.AddRange(this.SourceTracks.Where(source => source.Language.Trim() == language));
- }
-
// Add them if they are not already added.
- foreach (Audio sourceTrack in trackList)
+ foreach (Audio sourceTrack in this.GetSelectedLanguagesTracks())
{
- bool found = this.Task.AudioTracks.Any(audioTrack => audioTrack.ScannedTrack == sourceTrack);
+ // Step 1: If "Add only One per language" is turned on, check to see if this language is already added.
+ if (this.CanSkipSourceTrack(sourceTrack))
+ {
+ continue;
+ }
+ // Step 2: Check if the track list already contrains this track
+ bool found = this.Task.AudioTracks.Any(audioTrack => Equals(audioTrack.ScannedTrack, sourceTrack));
if (!found)
{
+ // If it doesn't, add it.
this.Add(sourceTrack);
}
}
@@ -321,18 +337,10 @@ namespace HandBrakeWPF.ViewModels
// Clear out the old tracks
this.Task.AudioTracks.Clear();
- // Get the preferred Language
- IEnumerable<Audio> preferredAudioTracks =
- this.SourceTracks.Where(
- item =>
- item.Language.Contains(
- this.UserSettingService.GetUserSetting<string>(UserSettingConstants.NativeLanguage)));
- Audio preferred = preferredAudioTracks.FirstOrDefault() ?? this.SourceTracks.FirstOrDefault();
-
// Add the preset audio tracks with the preferred language
foreach (AudioTrack track in preset.Task.AudioTracks)
{
- this.Task.AudioTracks.Add(new AudioTrack(track) { ScannedTrack = preferred });
+ this.Task.AudioTracks.Add(new AudioTrack(track) { ScannedTrack = this.GetPreferredAudioTrack() });
}
}
@@ -341,44 +349,24 @@ namespace HandBrakeWPF.ViewModels
/// </summary>
private void AutomaticTrackSelection()
{
- List<Audio> trackList = new List<Audio>();
if (!this.SourceTracks.Any())
{
+ // Clear out the old tracks
+ this.Task.AudioTracks.Clear();
+
return;
}
- // Step 1: Fetch all the Preferred Language settings
- if (this.UserSettingService.GetUserSetting<string>(UserSettingConstants.NativeLanguage) == "Any")
- {
- // If we have Any as the preferred Language, just set the first track to all audio tracks.
- trackList.Add(this.SourceTracks.FirstOrDefault());
- }
- else
+ // Default all the language tracks to the preferred or first language of this source.
+ foreach (AudioTrack track in this.Task.AudioTracks)
{
- // Otherwise, fetch the preferred language.
- foreach (
- Audio item in
- this.SourceTracks.Where(
- item =>
- item.Language.Contains(
- this.UserSettingService.GetUserSetting<string>(UserSettingConstants.NativeLanguage))))
- {
- trackList.Add(item);
- break;
- }
+ track.ScannedTrack = this.GetPreferredAudioTrack();
}
- // Step 2: Handle "All Remaining Tracks" and "All for Selected Languages" or use the default behaviour
+ // Handle the default selection behaviour.
int mode = this.UserSettingService.GetUserSetting<int>(UserSettingConstants.DubModeAudio);
-
switch (mode)
{
- default: // Default by setting all existing tracks to a preferred or first source track.
- foreach (AudioTrack track in this.Task.AudioTracks)
- {
- track.ScannedTrack = trackList.FirstOrDefault() ?? this.SourceTracks.FirstOrDefault();
- }
- break;
case 1: // Adding all remaining audio tracks
this.AddAllRemaining();
break;
@@ -389,35 +377,59 @@ namespace HandBrakeWPF.ViewModels
}
/// <summary>
- /// The get language tracks.
+ /// The get preferred audio track, or the first if none available.
+ /// </summary>
+ /// <returns>
+ /// The users preferred language, or the first if none available.
+ /// </returns>
+ private Audio GetPreferredAudioTrack()
+ {
+ // Get the preferred Language
+ IEnumerable<Audio> preferredAudioTracks =
+ this.SourceTracks.Where(
+ item =>
+ item.Language.Contains(
+ this.UserSettingService.GetUserSetting<string>(UserSettingConstants.NativeLanguage)));
+ return preferredAudioTracks.FirstOrDefault() ?? this.SourceTracks.FirstOrDefault();
+ }
+
+ /// <summary>
+ /// Gets a list of source tracks for the users selected languages.
/// </summary>
/// <returns>
- /// The Users desired audio tracks
+ /// A list of source audio tracks.
/// </returns>
- private List<Audio> GetLanguageTracks()
+ private IEnumerable<Audio> GetSelectedLanguagesTracks()
{
List<Audio> trackList = new List<Audio>();
- if (this.UserSettingService.GetUserSetting<string>(UserSettingConstants.NativeLanguage) == "Any")
+ foreach (string language in this.UserSettingService.GetUserSetting<StringCollection>(UserSettingConstants.SelectedLanguages))
{
- // If we have Any as the preferred Language, just set the first track to all audio tracks.
- trackList.Add(this.SourceTracks.FirstOrDefault());
+ trackList.AddRange(this.SourceTracks.Where(source => source.Language.Trim() == language));
}
- else
+
+ return trackList;
+ }
+
+ /// <summary>
+ /// Checks to see if we can skip over the given source audio track.
+ /// True when the user has set "Add only one per language" feature AND the language is contained in the track list.
+ /// </summary>
+ /// <param name="sourceTrack">
+ /// The source track.
+ /// </param>
+ /// <returns>
+ /// True when the user has set "Add only one per language" feature AND the language is contained in the track list
+ /// </returns>
+ private bool CanSkipSourceTrack(Audio sourceTrack)
+ {
+ bool addOnlyOnePerLanguage = this.UserSettingService.GetUserSetting<bool>(UserSettingConstants.AddOnlyOneAudioPerLanguage);
+ bool sourceTrackLanguageFound = this.Task.AudioTracks.Any(audioTrack => audioTrack.ScannedTrack != null && sourceTrack.Language == audioTrack.ScannedTrack.Language);
+ if (addOnlyOnePerLanguage && sourceTrackLanguageFound)
{
- // Otherwise, fetch the preferred language.
- foreach (
- Audio item in
- this.SourceTracks.Where(
- item =>
- item.Language.Contains(
- this.UserSettingService.GetUserSetting<string>(UserSettingConstants.NativeLanguage))))
- {
- trackList.Add(item);
- break;
- }
+ return true; // This track can be skipped.
}
- return trackList;
+ return false;
}
#endregion
diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IOptionsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IOptionsViewModel.cs
index 7805aea63..c2d48f8e5 100644
--- a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IOptionsViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IOptionsViewModel.cs
@@ -9,10 +9,19 @@
namespace HandBrakeWPF.ViewModels.Interfaces
{
+ using HandBrakeWPF.Model;
+
/// <summary>
/// The Options Screen View Model Interface
/// </summary>
public interface IOptionsViewModel
{
+ /// <summary>
+ /// The goto tab.
+ /// </summary>
+ /// <param name="tab">
+ /// The tab.
+ /// </param>
+ void GotoTab(OptionsTab tab);
}
} \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
index 6d2e736a3..e814e897c 100644
--- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
@@ -938,16 +938,8 @@ namespace HandBrakeWPF.ViewModels
/// </summary>
public void OpenAboutApplication()
{
- Window window = Application.Current.Windows.Cast<Window>().FirstOrDefault(x => x.GetType() == typeof(AboutView));
-
- if (window != null)
- {
- window.Activate();
- }
- else
- {
- this.WindowManager.ShowWindow(IoC.Get<IAboutViewModel>());
- }
+ OpenOptionsScreenCommand command = new OpenOptionsScreenCommand();
+ command.Execute(OptionsTab.About);
}
/// <summary>
@@ -1025,8 +1017,8 @@ namespace HandBrakeWPF.ViewModels
/// </summary>
public void CheckForUpdates()
{
- this.ProgramStatusLabel = "Checking for Updates ...";
- this.updateService.CheckForUpdates(this.HandleManualUpdateCheckResults);
+ OpenOptionsScreenCommand command = new OpenOptionsScreenCommand();
+ command.Execute(OptionsTab.Updates);
}
/// <summary>
@@ -1656,27 +1648,6 @@ namespace HandBrakeWPF.ViewModels
this.ProgramStatusLabel = "A New Update is Available. Goto Tools Menu > Options to Install";
}
}
-
- /// <summary>
- /// Handle Update Check Results
- /// </summary>
- /// <param name="information">
- /// The information.
- /// </param>
- private void HandleManualUpdateCheckResults(UpdateCheckInformation information)
- {
- if (information.NewVersionAvailable)
- {
- MessageBox.Show("A New Version is available. Goto Tools Menu > Options to Install or visit http://handbrake.fr for details.", "Update Available", MessageBoxButton.OK, MessageBoxImage.Information);
- }
- else
- {
- MessageBox.Show("There is no new updates at this time.", "No Update Available", MessageBoxButton.OK, MessageBoxImage.Information);
- }
-
- this.ProgramStatusLabel = "Ready";
- }
-
#endregion
#region Event Handlers
@@ -1715,7 +1686,6 @@ namespace HandBrakeWPF.ViewModels
this.NotifyOfPropertyChange(() => this.ScannedSource.Titles);
this.SelectedTitle = this.ScannedSource.Titles.FirstOrDefault(t => t.MainTitle)
?? this.ScannedSource.Titles.FirstOrDefault();
- this.SetupTabs();
}
if (e.Successful && this.selectedTitle != null)
{
diff --git a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs
index 82c0daa3c..36fa35985 100644
--- a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs
@@ -309,7 +309,7 @@ namespace HandBrakeWPF.ViewModels
/// <summary>
/// The options tab that is selected.
/// </summary>
- private string selectedTab;
+ private OptionsTab selectedTab;
/// <summary>
/// Update Message
@@ -380,7 +380,7 @@ namespace HandBrakeWPF.ViewModels
this.updateService = updateService;
this.OnLoad();
- this.SelectedTab = "General";
+ this.SelectedTab = OptionsTab.General;
this.UpdateMessage = "Click 'Check for Updates' to check for new versions";
}
@@ -389,20 +389,9 @@ namespace HandBrakeWPF.ViewModels
#region Window Properties
/// <summary>
- /// Gets OptionTabs.
- /// </summary>
- public IEnumerable<string> OptionTabs
- {
- get
- {
- return new List<string> { "General", "Output Files", "Audio and Subtitles", "Advanced", "Updates" };
- }
- }
-
- /// <summary>
/// Gets or sets SelectedTab.
/// </summary>
- public string SelectedTab
+ public OptionsTab SelectedTab
{
get
{
@@ -415,6 +404,12 @@ namespace HandBrakeWPF.ViewModels
this.NotifyOfPropertyChange(() => this.SelectedTab);
}
}
+
+ /// <summary>
+ /// Gets or sets the about view model.
+ /// </summary>
+ public IAboutViewModel AboutViewModel { get; set; }
+
#endregion
#region Properties
@@ -800,7 +795,7 @@ namespace HandBrakeWPF.ViewModels
set
{
this.selectedPreferredLangauge = value;
- this.NotifyOfPropertyChange("SelectedPreferreedLangauge");
+ this.NotifyOfPropertyChange(() => SelectedPreferredLangauge);
}
}
@@ -817,7 +812,7 @@ namespace HandBrakeWPF.ViewModels
set
{
this.selectedPreferredSubtitleLangauge = value;
- this.NotifyOfPropertyChange("SelectedPreferredSubtitleLangauge");
+ this.NotifyOfPropertyChange(() => SelectedPreferredSubtitleLangauge);
}
}
@@ -1344,7 +1339,7 @@ namespace HandBrakeWPF.ViewModels
}
/// <summary>
- /// Enable Debugging features in the UI.
+ /// Gets or sets a value indicating whether debug features are enabled.
/// </summary>
public bool EnableDebugFeatures
{
@@ -1731,7 +1726,7 @@ namespace HandBrakeWPF.ViewModels
/// <summary>
/// Audio List Move Left
/// </summary>
- public void LanguageMoveLeft()
+ public void LanguageMoveRight()
{
if (this.SelectedAvailableToMove.Count > 0)
{
@@ -1749,7 +1744,7 @@ namespace HandBrakeWPF.ViewModels
/// <summary>
/// Audio List Move Right
/// </summary>
- public void LanguageMoveRight()
+ public void LanguageMoveLeft()
{
if (this.SelectedLangaugesToMove.Count > 0)
{
@@ -1962,5 +1957,16 @@ namespace HandBrakeWPF.ViewModels
Process.Start(Path.Combine(Path.GetTempPath(), "handbrake-setup.exe"));
Application.Current.Shutdown();
}
+
+ /// <summary>
+ /// The goto tab.
+ /// </summary>
+ /// <param name="tab">
+ /// The tab.
+ /// </param>
+ public void GotoTab(OptionsTab tab)
+ {
+ this.SelectedTab = tab;
+ }
}
} \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs
index db8e7ebe8..4c01f8f35 100644
--- a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs
@@ -53,11 +53,6 @@ namespace HandBrakeWPF.ViewModels
private bool showCustomAnamorphicControls;
/// <summary>
- /// The source aspect ratio.
- /// </summary>
- private double sourceAspectRatio;
-
- /// <summary>
/// The source info.
/// </summary>
private string sourceInfo;
@@ -148,7 +143,7 @@ namespace HandBrakeWPF.ViewModels
set
{
- this.Task.Cropping.Bottom = this.CorrectForModulus(this.Task.Cropping.Bottom, value);
+ this.Task.Cropping.Bottom = value;
this.NotifyOfPropertyChange(() => this.CropBottom);
this.SetDisplaySize();
}
@@ -166,7 +161,7 @@ namespace HandBrakeWPF.ViewModels
set
{
- this.Task.Cropping.Left = this.CorrectForModulus(this.Task.Cropping.Left, value);
+ this.Task.Cropping.Left = value;
this.NotifyOfPropertyChange(() => this.CropLeft);
this.SetDisplaySize();
}
@@ -184,7 +179,7 @@ namespace HandBrakeWPF.ViewModels
set
{
- this.Task.Cropping.Right = this.CorrectForModulus(this.Task.Cropping.Right, value);
+ this.Task.Cropping.Right = value;
this.NotifyOfPropertyChange(() => this.CropRight);
this.SetDisplaySize();
}
@@ -202,7 +197,7 @@ namespace HandBrakeWPF.ViewModels
set
{
- this.Task.Cropping.Top = this.CorrectForModulus(this.Task.Cropping.Top, value);
+ this.Task.Cropping.Top = value;
this.NotifyOfPropertyChange(() => this.CropTop);
this.SetDisplaySize();
}
@@ -701,7 +696,6 @@ namespace HandBrakeWPF.ViewModels
if (title != null)
{
// Set cached info
- this.sourceAspectRatio = title.AspectRatio;
this.sourceParValues = title.ParVal;
this.sourceResolution = title.Resolution;
diff --git a/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs
index 446fab6cf..3fcca18aa 100644
--- a/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs
@@ -22,6 +22,8 @@ namespace HandBrakeWPF.ViewModels
using HandBrake.ApplicationServices.Services.Interfaces;
using HandBrake.ApplicationServices.Utilities;
+ using HandBrakeWPF.Commands;
+ using HandBrakeWPF.Model;
using HandBrakeWPF.ViewModels.Interfaces;
using Ookii.Dialogs.Wpf;
@@ -120,13 +122,10 @@ namespace HandBrakeWPF.ViewModels
/// </summary>
public void AddAllClosedCaptions()
{
- if (this.UserSettingService.GetUserSetting<bool>(UserSettingConstants.UseClosedCaption))
+
+ foreach (Subtitle subtitle in this.SourceTitlesSubset(null).Where(s => s.SubtitleType == SubtitleType.CC))
{
- foreach (
- Subtitle subtitle in this.SourceTitlesSubset(null).Where(s => s.SubtitleType == SubtitleType.CC))
- {
- this.Add(subtitle);
- }
+ this.Add(subtitle);
}
}
@@ -161,38 +160,6 @@ namespace HandBrakeWPF.ViewModels
}
/// <summary>
- /// Automatic Subtitle Selection based on user preferences.
- /// </summary>
- public void AutomaticSubtitleSelection()
- {
- this.Task.SubtitleTracks.Clear();
-
- // New DUB Settings
- int mode = this.UserSettingService.GetUserSetting<int>(UserSettingConstants.DubModeSubtitle);
- switch (mode)
- {
- case 1: // Adding all remaining subtitle tracks
- this.AddAllRemaining();
- break;
- case 2: // Adding only the first or preferred first subtitle track.
- this.Add();
- break;
- case 3: // Selected Languages Only
- this.AddAllRemainingForSelectedLanguages();
- break;
- case 4: // Prefered Only
- this.AddForPreferredLanaguages(true);
- break;
- case 5: // Prefered Only All
- this.AddForPreferredLanaguages(false);
- break;
- }
-
- // Add all closed captions if enabled.
- this.AddAllClosedCaptions();
- }
-
- /// <summary>
/// Import an SRT File.
/// </summary>
public void Import()
@@ -279,6 +246,50 @@ namespace HandBrakeWPF.ViewModels
this.NotifyOfPropertyChange(() => this.Task);
}
+ /// <summary>
+ /// Automatic Subtitle Selection based on user preferences.
+ /// </summary>
+ public void AutomaticSubtitleSelection()
+ {
+ this.Task.SubtitleTracks.Clear();
+
+ // New DUB Settings
+ int mode = this.UserSettingService.GetUserSetting<int>(UserSettingConstants.DubModeSubtitle);
+ switch (mode)
+ {
+ case 1: // Adding all remaining subtitle tracks
+ this.AddAllRemaining();
+ break;
+ case 2: // Adding only the first or preferred first subtitle track.
+ this.Add();
+ break;
+ case 3: // Selected Languages Only
+ this.AddAllRemainingForSelectedLanguages();
+ break;
+ case 4: // Prefered Only
+ this.AddForPreferredLanaguages(true);
+ break;
+ case 5: // Prefered Only All
+ this.AddForPreferredLanaguages(false);
+ break;
+ }
+
+ // Add all closed captions if enabled.
+ if (this.UserSettingService.GetUserSetting<bool>(UserSettingConstants.UseClosedCaption))
+ {
+ this.AddAllClosedCaptions();
+ }
+ }
+
+ /// <summary>
+ /// Open the options screen to the Audio and Subtitles tab.
+ /// </summary>
+ public void SetDefaultBehaviour()
+ {
+ OpenOptionsScreenCommand command = new OpenOptionsScreenCommand();
+ command.Execute(OptionsTab.AudioAndSubtitles);
+ }
+
#endregion
#region Implemented Interfaces
@@ -419,10 +430,8 @@ namespace HandBrakeWPF.ViewModels
private IEnumerable<Subtitle> SourceTitlesSubset(IEnumerable<Subtitle> subtitles)
{
return subtitles != null
- ? subtitles.Where(
- subtitle => !this.Task.SubtitleTracks.Any(track => track.SourceTrack == subtitle)).ToList()
- : this.SourceTracks.Where(
- subtitle => !this.Task.SubtitleTracks.Any(track => track.SourceTrack == subtitle)).ToList();
+ ? subtitles.Where(subtitle => !this.Task.SubtitleTracks.Any(track => Equals(track.SourceTrack, subtitle))).ToList()
+ : this.SourceTracks.Where(subtitle => !this.Task.SubtitleTracks.Any(track => Equals(track.SourceTrack, subtitle))).ToList();
}
#endregion
diff --git a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs
index b0b46b760..6164e3603 100644
--- a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs
@@ -23,12 +23,10 @@ namespace HandBrakeWPF.ViewModels
using HandBrake.ApplicationServices.Services.Interfaces;
using HandBrake.ApplicationServices.Utilities;
using HandBrake.Interop;
- using HandBrake.Interop.HbLib;
using HandBrake.Interop.Model.Encoding;
using HandBrake.Interop.Model.Encoding.x264;
using HandBrakeWPF.Commands.Interfaces;
- using HandBrakeWPF.Properties;
using HandBrakeWPF.ViewModels.Interfaces;
/// <summary>
@@ -241,6 +239,17 @@ namespace HandBrakeWPF.ViewModels
}
/// <summary>
+ /// Gets a value indicating whether is lossless.
+ /// </summary>
+ public bool IsLossless
+ {
+ get
+ {
+ return 51.Equals(this.RF);
+ }
+ }
+
+ /// <summary>
/// Gets or sets QualityMax.
/// </summary>
public int QualityMax
@@ -303,8 +312,6 @@ namespace HandBrakeWPF.ViewModels
double rfValue = 51.0 - value * cqStep;
rfValue = Math.Round(rfValue, 2);
this.Task.Quality = rfValue;
-
- // TODO: Lossless warning.
break;
case VideoEncoder.Theora:
Task.Quality = value;
@@ -313,6 +320,7 @@ namespace HandBrakeWPF.ViewModels
this.NotifyOfPropertyChange(() => this.RF);
this.NotifyOfPropertyChange(() => this.DisplayRF);
+ this.NotifyOfPropertyChange(() => this.IsLossless);
}
}
@@ -327,6 +335,14 @@ namespace HandBrakeWPF.ViewModels
}
}
+ public string Rfqp
+ {
+ get
+ {
+ return this.SelectedVideoEncoder == VideoEncoder.X264 ? "RF" : "QP";
+ }
+ }
+
/// <summary>
/// Gets or sets SelectedFramerate.
/// </summary>
@@ -391,6 +407,8 @@ namespace HandBrakeWPF.ViewModels
// Hide the x264 controls when not needed.
this.DisplayX264Options = value == VideoEncoder.X264;
+
+ this.NotifyOfPropertyChange(() => this.Rfqp);
}
}
diff --git a/win/CS/HandBrakeWPF/Views/AboutView.xaml b/win/CS/HandBrakeWPF/Views/AboutView.xaml
index a9e7e4319..d7b63c08b 100644
--- a/win/CS/HandBrakeWPF/Views/AboutView.xaml
+++ b/win/CS/HandBrakeWPF/Views/AboutView.xaml
@@ -1,13 +1,7 @@
-<Window x:Class="HandBrakeWPF.Views.AboutView"
+<UserControl x:Class="HandBrakeWPF.Views.AboutView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:Micro="clr-namespace:Caliburn.Micro;assembly=Caliburn.Micro"
- Title="{Binding Title}"
- Width="600"
- Height="320"
- ResizeMode="NoResize"
- TextOptions.TextFormattingMode="Display"
- WindowStartupLocation="CenterScreen">
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Properties="clr-namespace:HandBrakeWPF.Properties"
+ TextOptions.TextFormattingMode="Display">
<Grid>
<Grid.RowDefinitions>
@@ -34,54 +28,23 @@
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<StackPanel Grid.Row="0"
Margin="5,10,0,0"
Orientation="Horizontal">
- <TextBlock Margin="0,0,5,0"
- FontSize="14"
- FontWeight="Bold"
- Text="HandBrake" />
- <TextBlock Margin="0,0,0,1"
- VerticalAlignment="Bottom"
- Text="{Binding Version}" />
+ <TextBlock Margin="0,0,5,0" FontSize="12" FontWeight="Bold" Text="HandBrake " />
+ <TextBlock Margin="0,0,0,1" FontSize="12" VerticalAlignment="Bottom" Text="{Binding Version}" />
</StackPanel>
- <TextBlock Grid.Row="1"
- Margin="5,0,0,0 "
- Text="Copyright 2003-2013 HandBrake Team" />
+ <TextBlock Grid.Row="1" Margin="5,10,0,5" Text="License: " />
- <TextBlock Grid.Row="2"
- Margin="5,10,0,5"
- Text="License:" />
- <TextBox Grid.Row="3"
- Margin="10,0,10,10"
- HorizontalAlignment="Stretch"
- VerticalAlignment="Stretch"
- IsReadOnly="True"
- TextWrapping="Wrap"
- VerticalScrollBarVisibility="Auto">
- This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
- This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
- You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- </TextBox>
+ <TextBox Text="{x:Static Properties:Resources.About_GPL}" Grid.Row="2" Margin="10,0,10,10" HorizontalAlignment="Stretch"
+ VerticalAlignment="Stretch" IsReadOnly="True" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto" />
</Grid>
</Grid>
- <StackPanel Grid.Row="1"
- HorizontalAlignment="Stretch"
- Background="LightGray">
- <Button Margin="0,5,10,5"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Content="Close"
- IsDefault="True"
- Micro:Message.Attach="[Event Click] = [Action Close]"
- Padding="12,2" />
- </StackPanel>
</Grid>
-</Window>
+</UserControl>
diff --git a/win/CS/HandBrakeWPF/Views/AboutView.xaml.cs b/win/CS/HandBrakeWPF/Views/AboutView.xaml.cs
index 55665fc8b..2be3fd009 100644
--- a/win/CS/HandBrakeWPF/Views/AboutView.xaml.cs
+++ b/win/CS/HandBrakeWPF/Views/AboutView.xaml.cs
@@ -9,12 +9,12 @@
namespace HandBrakeWPF.Views
{
- using System.Windows;
+ using System.Windows.Controls;
/// <summary>
/// Interaction logic for AboutView.xaml
/// </summary>
- public partial class AboutView : Window
+ public partial class AboutView : UserControl
{
/// <summary>
/// Initializes a new instance of the <see cref="AboutView"/> class.
diff --git a/win/CS/HandBrakeWPF/Views/AddPresetView.xaml b/win/CS/HandBrakeWPF/Views/AddPresetView.xaml
index d6f6cb7e0..3e7a3fd7b 100644
--- a/win/CS/HandBrakeWPF/Views/AddPresetView.xaml
+++ b/win/CS/HandBrakeWPF/Views/AddPresetView.xaml
@@ -5,6 +5,7 @@
xmlns:Converters="clr-namespace:HandBrakeWPF.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:Properties="clr-namespace:HandBrakeWPF.Properties"
Title="{Binding Title}"
Width="350"
ResizeMode="NoResize"
@@ -16,6 +17,11 @@
<Window.Resources>
<Converters:BooleanToVisibilityConverter x:Key="boolToVisConverter" />
<Converters:EnumComboConverter x:Key="enumComboConverter" />
+
+ <Style x:Key="LongToolTipHolder" TargetType="FrameworkElement">
+ <Setter Property="ToolTipService.ShowDuration" Value="20000" />
+ <Setter Property="Margin" Value="0,2,0,2" />
+ </Style>
</Window.Resources>
<Grid HorizontalAlignment="Stretch"
@@ -80,11 +86,15 @@
<TextBlock Grid.Row="2"
Grid.Column="0"
- Text="Use Picture Size:" />
+ Style="{StaticResource LongToolTipHolder}"
+ ToolTip="{x:Static Properties:Resources.AddPreset_PictureSizeMode}"
+ Text="Picture Size:" />
<ComboBox Grid.Row="2"
Grid.Column="1"
Width="125"
HorizontalAlignment="Left"
+ Style="{StaticResource LongToolTipHolder}"
+ ToolTip="{x:Static Properties:Resources.AddPreset_PictureSizeMode}"
ItemsSource="{Binding PictureSettingsModes,
Converter={StaticResource enumComboConverter}}"
SelectedItem="{Binding SelectedPictureSettingMode,
@@ -104,18 +114,18 @@
</StackPanel>
<CheckBox Grid.Row="4"
- Grid.Column="1"
+ Grid.Column="0" Grid.ColumnSpan="2"
Margin="0,10,0,0"
- Content="Use Picture Filters"
+ Content="Save Video Filter Settings"
IsChecked="{Binding Preset.UsePictureFilters}" />
<!-- Description -->
<TextBlock Grid.Row="5"
Grid.Column="0"
- FontWeight="Bold"
+ FontWeight="Bold" Margin="0,10,0,0"
Text="Description:" />
<TextBox Grid.Row="6"
- Grid.ColumnSpan="2"
+ Grid.ColumnSpan="2" Margin="0,10,0,0"
HorizontalAlignment="Stretch"
Text="{Binding Preset.Description}" />
</Grid>
diff --git a/win/CS/HandBrakeWPF/Views/AdvancedView.xaml b/win/CS/HandBrakeWPF/Views/AdvancedView.xaml
index a05b41bff..785102cd2 100644
--- a/win/CS/HandBrakeWPF/Views/AdvancedView.xaml
+++ b/win/CS/HandBrakeWPF/Views/AdvancedView.xaml
@@ -6,6 +6,7 @@
xmlns:Helpers="clr-namespace:HandBrakeWPF.Helpers"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:Properties="clr-namespace:HandBrakeWPF.Properties"
+ xmlns:controls="clr-namespace:HandBrakeWPF.Controls"
x:Name="advancedView"
mc:Ignorable="d"
>
@@ -31,13 +32,25 @@
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<!-- X264 Query -->
- <TextBox Grid.Row="2"
+
+ <TextBlock Grid.Row="2" Margin="10,5,10,0"
+ VerticalAlignment="Center"
+ FontWeight="Bold"
+ Text="x264 Encoder Options:"
+ Visibility="{Binding DisplayX264Options, Converter={StaticResource BooleanVisibilityConverter}, ConverterParameter=false}"
+ />
+
+ <TextBox Grid.Row="3"
+ Margin="10,2,10, 2"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
+ Style="{StaticResource LongToolTipHolder}"
+ ToolTip="{x:Static Properties:Resources.Advanced_EncoderOptions}"
Text="{Binding AdvancedOptionsString,
UpdateSourceTrigger=PropertyChanged}"
TextWrapping="Wrap"
@@ -75,7 +88,6 @@
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<!-- Left Column -->
@@ -219,47 +231,23 @@
</ComboBox>
</Grid>
</StackPanel>
-
- <!-- Psychvisual -->
- <StackPanel Orientation="Vertical">
- <TextBlock Grid.Row="0"
- Margin="10,5,0,0"
- FontWeight="Bold"
- Text="Psychovisual: "
- />
- <StackPanel Orientation="Horizontal">
- <Label Width="110"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- HorizontalContentAlignment="Right"
- Content="No DCT-Decimate:"
- />
- <CheckBox HorizontalAlignment="Left"
- VerticalAlignment="Center"
- IsChecked="{Binding NoDctDecimate}"
- Style="{StaticResource LongToolTipHolder}"
- >
- <CheckBox.ToolTip>
- <TextBlock Style="{StaticResource LongToolTip}" Text="{x:Static Properties:Resources.Advanced_NoDctDecimateToolTip}" />
- </CheckBox.ToolTip>
- </CheckBox>
-
- </StackPanel>
- </StackPanel>
-
</StackPanel>
- <!-- Analysis (Center Column) -->
- <StackPanel Grid.Row="0"
- Grid.Column="1"
- Orientation="Vertical"
- >
- <TextBlock Grid.Row="0"
- Margin="10,5,0,0"
- FontWeight="Bold"
- Text="Analysis: "
- />
- <Grid HorizontalAlignment="Left" VerticalAlignment="Top">
+ <!-- Right Column -->
+ <Grid Grid.Row="0" Grid.Column="1">
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="*" />
+ </Grid.RowDefinitions>
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto" />
+ </Grid.ColumnDefinitions>
+
+ <!-- Analysis -->
+ <TextBlock Text="Analysis: " Grid.Row="0" Margin="10,5,0,0" FontWeight="Bold" />
+ <Grid Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Top">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
@@ -269,7 +257,9 @@
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="*" MinWidth="100" />
+ <ColumnDefinition Width="Auto" MinWidth="100" />
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Label Content="Adaptive B-Frames:"
@@ -360,29 +350,63 @@
<Label Grid.Row="4"
Grid.Column="0"
Content="Motion Est Range:"
- Style="{StaticResource AdvancedLabel}"
- Visibility="{Binding MotionEstimationRangeVisible,
- Converter={StaticResource VisibilityConverter}}"
+ Style="{StaticResource AdvancedLabel}" />
+ <controls:NumberBox Grid.Row="4"
+ Grid.Column="1"
+ Width="120"
+ Height="22"
+ MaxWidth="120"
+ Minimum="4" Maximum="64"
+ Number="{Binding MotionEstimationRange, Mode=TwoWay}"
+ ToolTip="{x:Static Properties:Resources.Advanced_MotionEstimationRangeToolTip}"
+ />
+
+
+ <!-- Column 2 -->
+ <Label Grid.Row="0" Grid.Column="2"
+ Height="28"
+ HorizontalAlignment="Right"
+ VerticalAlignment="Top"
+ Content="Partition Type:"
/>
- <ComboBox Grid.Row="4"
- Grid.Column="1"
- Width="120"
- Height="22"
- MaxWidth="120"
+ <ComboBox Grid.Row="0" Grid.Column="3"
+ Width="100"
+ Height="23"
+ MaxWidth="100"
+ HorizontalAlignment="Right"
+ VerticalAlignment="Top"
DisplayMemberPath="Label"
- ItemsSource="{x:Static Helpers:AdvancedChoicesHelper.MotionEstimationRange}"
- SelectedItem="{Binding MotionEstimationRange}"
+ ItemsSource="{x:Static Helpers:AdvancedChoicesHelper.Analysis}"
+ SelectedItem="{Binding Analysis}"
Style="{StaticResource LongToolTipHolder}"
- Visibility="{Binding MotionEstimationRangeVisible,
- Converter={StaticResource VisibilityConverter}}" Margin="0,0,0,2" VerticalAlignment="Bottom">
+ >
<ComboBox.ToolTip>
- <TextBlock Style="{StaticResource LongToolTip}" Text="{x:Static Properties:Resources.Advanced_MotionEstimationRangeToolTip}" />
+ <TextBlock Style="{StaticResource LongToolTip}" Text="{x:Static Properties:Resources.Advanced_AnalysisToolTip}" />
</ComboBox.ToolTip>
</ComboBox>
- </Grid>
- <Grid Width="300"
- Height="80"
+ <Label Grid.Row="1" Grid.Column="2" Height="28" HorizontalAlignment="Right" VerticalAlignment="Top" Content="Trellis:" />
+ <ComboBox Grid.Row="1"
+ Grid.Column="3"
+ Width="100"
+ Height="23"
+ MaxWidth="100"
+ HorizontalAlignment="Right"
+ VerticalAlignment="Top"
+ DisplayMemberPath="Label"
+ ItemsSource="{x:Static Helpers:AdvancedChoicesHelper.Trellis}"
+ SelectedItem="{Binding Trellis}"
+ Style="{StaticResource LongToolTipHolder}">
+ <ComboBox.ToolTip>
+ <TextBlock Style="{StaticResource LongToolTip}" Text="{x:Static Properties:Resources.Advanced_TrellisToolTip}" />
+ </ComboBox.ToolTip>
+ </ComboBox>
+ </Grid>
+
+ <!-- PhysoVisual -->
+ <TextBlock Text="Psychovisual: " Grid.Row="2" Margin="10,5,0,0" FontWeight="Bold" />
+ <Grid Grid.Row="3"
+ Height="90"
HorizontalAlignment="Left"
VerticalAlignment="Top"
>
@@ -393,19 +417,20 @@
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="*" MinWidth="100" />
+ <ColumnDefinition Width="Auto" MinWidth="100" />
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
- <Label Grid.Row="0"
- Grid.Column="0"
+ <Label Grid.Row="0" Grid.Column="0"
Content="Adaptive Quant Strength:"
Style="{StaticResource AdvancedLabel}"
/>
- <Slider Grid.Row="0"
- Grid.Column="1"
+ <Slider Grid.Row="0" Grid.Column="1"
IsSnapToTickEnabled="True"
LargeChange="0.2"
Maximum="2.0"
+ Width="150"
Minimum="0.0"
SmallChange="0.1"
Style="{StaticResource LongToolTipHolder}"
@@ -418,19 +443,18 @@
</Slider.ToolTip>
</Slider>
- <Label Grid.Row="1"
- Grid.Column="0"
- Content="Psychovisual Rate Distortion:"
+ <Label Grid.Row="1" Grid.Column="0"
+ Content="Rate Distortion:"
Style="{StaticResource AdvancedLabel}"
Visibility="{Binding PsychovisualRateDistortionVisible,
Converter={StaticResource VisibilityConverter}}"
/>
- <Slider Grid.Row="1"
- Grid.Column="1"
+ <Slider Grid.Row="1" Grid.Column="1"
IsSnapToTickEnabled="True"
LargeChange="0.2"
Maximum="2.0"
Minimum="0.0"
+ Width="150"
SmallChange="0.1"
Style="{StaticResource LongToolTipHolder}"
TickFrequency="0.1"
@@ -444,19 +468,18 @@
</Slider.ToolTip>
</Slider>
- <Label Grid.Row="2"
- Grid.Column="0"
+ <Label Grid.Row="2" Grid.Column="0"
Content="Psychovisual Trellis:"
Style="{StaticResource AdvancedLabel}"
Visibility="{Binding PsychovisualTrellisVisible,
Converter={StaticResource VisibilityConverter}}"
/>
- <Slider Grid.Row="2"
- Grid.Column="1"
+ <Slider Grid.Row="2" Grid.Column="1"
IsSnapToTickEnabled="True"
LargeChange="0.2"
Maximum="1.0"
Minimum="0.0"
+ Width="150"
SmallChange="0.05"
Style="{StaticResource LongToolTipHolder}"
TickFrequency="0.05"
@@ -469,85 +492,35 @@
<TextBlock Style="{StaticResource LongToolTip}" Text="{x:Static Properties:Resources.Advanced_PsychovisualTrellisToolTip}" />
</Slider.ToolTip>
</Slider>
- </Grid>
- </StackPanel>
-
- <!-- Analysis (Right Column) -->
- <StackPanel Grid.Row="0"
- Grid.Column="2"
- Orientation="Vertical"
- >
- <Grid Margin="0,20,0,0">
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="*" MinWidth="100" />
- </Grid.ColumnDefinitions>
- <Label Grid.Column="0"
- Height="28"
- HorizontalAlignment="Right"
- VerticalAlignment="Top"
- Content="Partition Type:"
- />
- <ComboBox Grid.Column="1"
- Width="100"
- Height="23"
- MaxWidth="100"
- HorizontalAlignment="Right"
- VerticalAlignment="Top"
- DisplayMemberPath="Label"
- ItemsSource="{x:Static Helpers:AdvancedChoicesHelper.Analysis}"
- SelectedItem="{Binding Analysis}"
- Style="{StaticResource LongToolTipHolder}"
- >
- <ComboBox.ToolTip>
- <TextBlock Style="{StaticResource LongToolTip}" Text="{x:Static Properties:Resources.Advanced_AnalysisToolTip}" />
- </ComboBox.ToolTip>
- </ComboBox>
+ <Label Grid.Row="0" Grid.Column="2" Width="110"
+ HorizontalAlignment="Left"
+ VerticalAlignment="Center"
+ HorizontalContentAlignment="Right"
+ Content="No DCT-Decimate:"
+ />
+ <CheckBox Grid.Row="0" Grid.Column="3" HorizontalAlignment="Left"
+ VerticalAlignment="Center"
+ IsChecked="{Binding NoDctDecimate}"
+ Style="{StaticResource LongToolTipHolder}"
+ >
+ <CheckBox.ToolTip>
+ <TextBlock Style="{StaticResource LongToolTip}" Text="{x:Static Properties:Resources.Advanced_NoDctDecimateToolTip}" />
+ </CheckBox.ToolTip>
+ </CheckBox>
<Label Grid.Row="1"
- Grid.Column="0"
- Height="28"
- HorizontalAlignment="Right"
- VerticalAlignment="Top"
- Content="Trellis:"
- />
- <ComboBox Grid.Row="1"
- Grid.Column="1"
- Width="100"
- Height="23"
- MaxWidth="100"
- HorizontalAlignment="Right"
- VerticalAlignment="Top"
- DisplayMemberPath="Label"
- ItemsSource="{x:Static Helpers:AdvancedChoicesHelper.Trellis}"
- SelectedItem="{Binding Trellis}"
- Style="{StaticResource LongToolTipHolder}"
- >
- <ComboBox.ToolTip>
- <TextBlock Style="{StaticResource LongToolTip}" Text="{x:Static Properties:Resources.Advanced_TrellisToolTip}" />
- </ComboBox.ToolTip>
- </ComboBox>
-
-
- <Label Grid.Row="2"
- Grid.Column="0"
+ Grid.Column="2"
Height="28"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Content="Deblocking:"
/>
- <ComboBox Grid.Row="2"
- Grid.Column="1"
- Width="100"
+ <StackPanel Orientation="Vertical" Grid.Row="1" Grid.Column="3" Grid.RowSpan="2">
+ <ComboBox
+ Width="85"
Height="23"
- MaxWidth="100"
+ MaxWidth="85"
HorizontalAlignment="Right"
VerticalAlignment="Top"
DisplayMemberPath="Label"
@@ -555,15 +528,15 @@
SelectedItem="{Binding DeblockingStrength}"
Style="{StaticResource LongToolTipHolder}"
>
- <ComboBox.ToolTip>
- <TextBlock Style="{StaticResource LongToolTip}" Text="{x:Static Properties:Resources.Advanced_DeblockingToolTip}" />
- </ComboBox.ToolTip>
- </ComboBox>
- <ComboBox Grid.Row="3"
- Grid.Column="1"
- Width="100"
+ <ComboBox.ToolTip>
+ <TextBlock Style="{StaticResource LongToolTip}" Text="{x:Static Properties:Resources.Advanced_DeblockingToolTip}" />
+ </ComboBox.ToolTip>
+ </ComboBox>
+ <ComboBox
+ Width="85"
Height="23"
- MaxWidth="100"
+ MaxWidth="85"
+ Margin="0,5,0,0"
HorizontalAlignment="Right"
VerticalAlignment="Top"
DisplayMemberPath="Label"
@@ -571,12 +544,16 @@
SelectedItem="{Binding DeblockingThreshold}"
Style="{StaticResource LongToolTipHolder}"
>
- <ComboBox.ToolTip>
- <TextBlock Style="{StaticResource LongToolTip}" Text="{x:Static Properties:Resources.Advanced_DeblockingToolTip}" />
- </ComboBox.ToolTip>
- </ComboBox>
+ <ComboBox.ToolTip>
+ <TextBlock Style="{StaticResource LongToolTip}" Text="{x:Static Properties:Resources.Advanced_DeblockingToolTip}" />
+ </ComboBox.ToolTip>
+ </ComboBox>
+ </StackPanel>
+
</Grid>
- </StackPanel>
+
+ </Grid>
+
</Grid>
</StackPanel>
diff --git a/win/CS/HandBrakeWPF/Views/AudioView.xaml b/win/CS/HandBrakeWPF/Views/AudioView.xaml
index d90e5643f..af5b81514 100644
--- a/win/CS/HandBrakeWPF/Views/AudioView.xaml
+++ b/win/CS/HandBrakeWPF/Views/AudioView.xaml
@@ -111,15 +111,14 @@
<MenuItem Header="Add All Remaining Selected Languages" cal:Message.Attach="[Event Click] = [Action AddAllRemainingForSelectedLanguages]" />
<Separator />
<MenuItem Header="Clear All" cal:Message.Attach="[Event Click] = [Action Clear]" />
+ <Separator />
+ <MenuItem Header="Configure Default Behaviours" cal:Message.Attach="[Event Click] = [Action SetDefaultBehaviour]" />
</ContextMenu>
</ListBox.ContextMenu>
<ListBox.ItemTemplate>
<DataTemplate>
-
-
-
-
+
<Grid HorizontalAlignment="Stretch">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
diff --git a/win/CS/HandBrakeWPF/Views/FiltersView.xaml b/win/CS/HandBrakeWPF/Views/FiltersView.xaml
index a27deb617..9c46aeabd 100644
--- a/win/CS/HandBrakeWPF/Views/FiltersView.xaml
+++ b/win/CS/HandBrakeWPF/Views/FiltersView.xaml
@@ -59,7 +59,7 @@
Visibility="{Binding ShowDenoiseCustom, Converter={StaticResource boolToVisConverter}}" />
<TextBlock Text="Deblock:" Grid.Row="4" Grid.Column="0" Margin="0,0,0,10"/>
- <Slider Width="120" Value="{Binding DeblockValue}" Minimum="4" Maximum="15" Grid.Row="4" Grid.Column="1" Margin="0,0,0,10"/>
+ <Slider Width="120" Value="{Binding DeblockValue}" TickPlacement="BottomRight" Minimum="4" Maximum="15" Grid.Row="4" Grid.Column="1" Margin="0,0,0,10"/>
<TextBlock Text="{Binding DeblockText}" Grid.Row="4" Grid.Column="2" Margin="0,0,0,10"/>
<CheckBox Content="Grayscale" IsChecked="{Binding Grayscale}" Grid.Row="5" Grid.Column="1" Margin="0,0,0,10"/>
diff --git a/win/CS/HandBrakeWPF/Views/OptionsView.xaml b/win/CS/HandBrakeWPF/Views/OptionsView.xaml
index c5d5d3e60..99d857bdc 100644
--- a/win/CS/HandBrakeWPF/Views/OptionsView.xaml
+++ b/win/CS/HandBrakeWPF/Views/OptionsView.xaml
@@ -3,7 +3,8 @@
xmlns:Helpers="clr-namespace:HandBrakeWPF.Helpers"
xmlns:Options="clr-namespace:HandBrakeWPF.Converters.Options"
xmlns:dd="clr-namespace:GongSolutions.Wpf.DragDrop;assembly=GongSolutions.Wpf.DragDrop"
- xmlns:Converters="clr-namespace:HandBrakeWPF.Converters" Background="White">
+ xmlns:Converters="clr-namespace:HandBrakeWPF.Converters" xmlns:local="clr-namespace:HandBrakeWPF.Model"
+ Background="White">
<UserControl.Resources>
<Style TargetType="Button">
@@ -30,7 +31,17 @@
</Style>
<Options:OptionsTabConverter x:Key="tabConverter" />
+ <Options:OptionsTabNameConverter x:Key="tabNameConverter" />
+
<Converters:BooleanToVisibilityConverter x:Key="boolToVisConverter" />
+
+ <ObjectDataProvider MethodName="GetValues"
+ ObjectType="{x:Type local:OptionsTab}"
+ x:Key="OptionTabsList">
+ <ObjectDataProvider.MethodParameters>
+ <x:Type TypeName="local:OptionsTab" />
+ </ObjectDataProvider.MethodParameters>
+ </ObjectDataProvider>
</UserControl.Resources>
<Grid>
@@ -44,14 +55,18 @@
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
-
<StackPanel Orientation="Vertical" Grid.Column="0" Margin="10,10,0,0">
<Border BorderThickness="0 0 0 1" BorderBrush="LightGray" Margin="0,0,0,10">
<TextBlock Text="Preferences" FontSize="16" />
</Border>
- <ListBox ItemsSource="{Binding OptionTabs}" SelectedItem="{Binding SelectedTab}"
+ <ListBox ItemsSource="{Binding Source={StaticResource OptionTabsList}}" SelectedItem="{Binding SelectedTab}"
BorderThickness="0" Background="Transparent">
+ <ListBox.ItemTemplate>
+ <DataTemplate>
+ <TextBlock Text="{Binding Converter={StaticResource tabNameConverter}}"/>
+ </DataTemplate>
+ </ListBox.ItemTemplate>
</ListBox>
</StackPanel>
@@ -60,7 +75,7 @@
<StackPanel Orientation="Vertical">
<StackPanel Name="General" Orientation="Vertical" Margin="10,10,0,0"
- Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter='General'}">
+ Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter={x:Static local:OptionsTab.General}}">
<Border BorderThickness="0 0 0 1" BorderBrush="LightGray">
<TextBlock Text="General" FontSize="16" />
@@ -121,7 +136,7 @@
</StackPanel>
<StackPanel Name="Output" Orientation="Vertical" Margin="10,10,0,0"
- Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter='Output Files'}">
+ Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter={x:Static local:OptionsTab.OutputFiles}}">
<Border BorderThickness="0 0 0 1" BorderBrush="LightGray">
<TextBlock Text="Output Files" FontSize="16" />
@@ -161,7 +176,7 @@
</StackPanel>
<StackPanel Name="Audio" Orientation="Vertical" Margin="10,10,0,0"
- Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter='Audio and Subtitles'}">
+ Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter={x:Static local:OptionsTab.AudioAndSubtitles}}">
<Border BorderThickness="0 0 0 1" BorderBrush="LightGray">
@@ -236,8 +251,8 @@
<DockPanel Grid.Column="1" Margin="10,0,10,0">
<StackPanel Orientation="Vertical" VerticalAlignment="Center">
- <Button Content="Move Left" VerticalAlignment="Center" Margin="0,0,0,5" cal:Message.Attach="[Event Click] = [Action LanguageMoveLeft]" Width="80" />
<Button Content="Move Right" VerticalAlignment="Center" Margin="0,0,0,5" cal:Message.Attach="[Event Click] = [Action LanguageMoveRight]" Width="80" />
+ <Button Content="Move Left" VerticalAlignment="Center" Margin="0,0,0,5" cal:Message.Attach="[Event Click] = [Action LanguageMoveLeft]" Width="80" />
<Button Content="Clear" VerticalAlignment="Center" Margin="0,0,0,5" cal:Message.Attach="[Event Click] = [Action LanguageClearAll]" Width="80"/>
</StackPanel>
</DockPanel>
@@ -263,7 +278,7 @@
</StackPanel>
<StackPanel Name="Advanced" Orientation="Vertical" Margin="10,10,0,0"
- Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter='Advanced'}">
+ Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter={x:Static local:OptionsTab.Advanced}}">
<Border BorderThickness="0 0 0 1" BorderBrush="LightGray">
<TextBlock Text="Advanced" FontSize="16" />
@@ -364,7 +379,7 @@
</StackPanel>
<StackPanel Name="Updates" Orientation="Vertical" Margin="10,10,0,0"
- Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter='Updates'}">
+ Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter={x:Static local:OptionsTab.Updates}}">
<Border BorderThickness="0 0 0 1" BorderBrush="LightGray">
@@ -398,6 +413,18 @@
</StackPanel>
</StackPanel>
+
+ <StackPanel Name="About" Orientation="Vertical" Margin="10,10,0,0"
+ Visibility="{Binding SelectedTab, Converter={StaticResource tabConverter}, ConverterParameter={x:Static local:OptionsTab.About}}">
+
+
+ <Border BorderThickness="0 0 0 1" BorderBrush="LightGray">
+ <TextBlock Text="About HandBrake" FontSize="16" />
+ </Border>
+
+ <ContentControl x:Name="AboutViewModel" />
+
+ </StackPanel>
</StackPanel>
</ScrollViewer>
diff --git a/win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml b/win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml
index c68a54e72..e7f5bbb35 100644
--- a/win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml
+++ b/win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml
@@ -1,12 +1,15 @@
<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:Converters="clr-namespace:HandBrakeWPF.Converters">
+ xmlns:Converters="clr-namespace:HandBrakeWPF.Converters"
+ xmlns:controls="clr-namespace:HandBrakeWPF.Controls">
<UserControl.Resources>
<Converters:BooleanConverter x:Key="boolConverter" />
<Converters:BooleanToVisibilityConverter x:Key="boolToVisConverter" />
+ <Style TargetType="controls:NumberBox">
+ <Setter Property="Height" Value="24" />
+ </Style>
</UserControl.Resources>
<StackPanel Orientation="Horizontal" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
@@ -24,10 +27,10 @@
<!-- Row 2-->
<StackPanel Orientation="Horizontal" Margin="5,0,5,0">
<Label Content="Width:" Grid.Row="1" Grid.Column="0" />
- <NumericUpDown:NumericUpDown Value="{Binding Width, Mode=TwoWay}" IsEnabled="{Binding WidthControlEnabled}" SmallChange="{Binding SelectedModulus, Mode=OneWay}"
+ <controls:NumberBox Number="{Binding Width, Mode=TwoWay}" IsEnabled="{Binding WidthControlEnabled}" Modulus="{Binding SelectedModulus, Mode=OneWay}"
Minimum="0" Grid.Row="1" Grid.Column="1" Width="60" />
<Label Content="Height:" Grid.Row="1" Grid.Column="2" />
- <NumericUpDown:NumericUpDown Value="{Binding Height, Mode=TwoWay}" IsEnabled="{Binding HeightControlEnabled}" SmallChange="{Binding SelectedModulus, Mode=OneWay}"
+ <controls:NumberBox Number="{Binding Height, Mode=TwoWay}" IsEnabled="{Binding HeightControlEnabled}" Modulus="{Binding SelectedModulus, Mode=OneWay}"
Minimum="0" Grid.Row="1" Grid.Column="3" Width="60" />
<CheckBox Content="Keep Aspect Ratio" IsChecked="{Binding MaintainAspectRatio}" VerticalAlignment="Center" Margin="5,0,0,0" />
</StackPanel>
@@ -71,10 +74,11 @@
<Label Content="PAR Width:" Grid.Row="1" Grid.Column="0" />
<Label Content="PAR Height:" Grid.Row="5" Grid.Column="0" />
- <NumericUpDown:NumericUpDown Width="60" Value="{Binding DisplayWidth, Mode=TwoWay}" Grid.Row="0" Grid.Column="1" HorizontalAlignment="Left" Margin="0,0,0,5" />
- <NumericUpDown:NumericUpDown Width="60" Value="{Binding ParWidth, Mode=TwoWay}" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Left"
+ <controls:NumberBox Width="60" Number="{Binding DisplayWidth, Mode=TwoWay}" Grid.Row="0" Grid.Column="1" HorizontalAlignment="Left" Margin="0,0,0,5"
+ AllowEmpty="False" />
+ <controls:NumberBox Width="60" Number="{Binding ParWidth, Mode=TwoWay}" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Left" AllowEmpty="False"
IsEnabled="{Binding MaintainAspectRatio, Converter={StaticResource boolConverter}, ConverterParameter=true}" Margin="0,0,0,5" />
- <NumericUpDown:NumericUpDown Width="60" Value="{Binding ParHeight, Mode=TwoWay}" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Left"
+ <controls:NumberBox Width="60" Number="{Binding ParHeight, Mode=TwoWay}" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Left" AllowEmpty="False"
IsEnabled="{Binding MaintainAspectRatio, Converter={StaticResource boolConverter}, ConverterParameter=true}" Margin="0,0,0,5" />
</Grid>
@@ -125,14 +129,17 @@
<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="60" Value="{Binding CropTop, Mode=TwoWay, UpdateSourceTrigger=LostFocus}" IsEnabled="{Binding IsCustomCrop}" Grid.Row="1" Grid.Column="2"
- HorizontalAlignment="Left" Margin="0,0,0,5" />
- <NumericUpDown:NumericUpDown Width="60" Value="{Binding CropBottom, Mode=TwoWay, UpdateSourceTrigger=LostFocus}" IsEnabled="{Binding IsCustomCrop}" Grid.Row="3" Grid.Column="2"
- HorizontalAlignment="Left" Margin="0,0,0,5" />
- <NumericUpDown:NumericUpDown Width="60" Value="{Binding CropLeft, Mode=TwoWay, UpdateSourceTrigger=LostFocus}" IsEnabled="{Binding IsCustomCrop}" Grid.Row="2" Grid.Column="1"
- HorizontalAlignment="Left" Margin="0,0,0,5" />
- <NumericUpDown:NumericUpDown Width="60" Value="{Binding CropRight, Mode=TwoWay, UpdateSourceTrigger=LostFocus}" IsEnabled="{Binding IsCustomCrop}" Grid.Row="2" Grid.Column="3"
- HorizontalAlignment="Left" Margin="0,0,0,5" />
+ <controls:NumberBox Width="60" HorizontalAlignment="Left" Margin="0,0,0,5" IsEnabled="{Binding IsCustomCrop}" Grid.Row="1" Grid.Column="2"
+ Minimum="0" Modulus="2" Number="{Binding CropTop, Mode=TwoWay}" UpdateBindingOnTextChange="True" ShowIncrementButtons="True" AllowEmpty="False" />
+
+ <controls:NumberBox Width="60" HorizontalAlignment="Left" Margin="0,0,0,5" IsEnabled="{Binding IsCustomCrop}" Grid.Row="3" Grid.Column="2"
+ Minimum="0" Modulus="2" Number="{Binding CropBottom, Mode=TwoWay}" UpdateBindingOnTextChange="True" ShowIncrementButtons="True" AllowEmpty="False" />
+
+ <controls:NumberBox Width="60" HorizontalAlignment="Left" Margin="0,0,0,5" IsEnabled="{Binding IsCustomCrop}" Grid.Row="2" Grid.Column="1"
+ Minimum="0" Modulus="2" Number="{Binding CropLeft, Mode=TwoWay}" UpdateBindingOnTextChange="True" ShowIncrementButtons="True" AllowEmpty="False" />
+
+ <controls:NumberBox Width="60" HorizontalAlignment="Left" Margin="0,0,0,5" IsEnabled="{Binding IsCustomCrop}" Grid.Row="2" Grid.Column="3"
+ Minimum="0" Modulus="2" Number="{Binding CropRight, Mode=TwoWay}" UpdateBindingOnTextChange="True" ShowIncrementButtons="True" AllowEmpty="False" />
</Grid>
diff --git a/win/CS/HandBrakeWPF/Views/ShellView.xaml b/win/CS/HandBrakeWPF/Views/ShellView.xaml
index b6f3cc9eb..9bfee4bc1 100644
--- a/win/CS/HandBrakeWPF/Views/ShellView.xaml
+++ b/win/CS/HandBrakeWPF/Views/ShellView.xaml
@@ -4,9 +4,9 @@
xmlns:Data="clr-namespace:System.Windows.Data;assembly=PresentationFramework"
xmlns:Converters="clr-namespace:HandBrakeWPF.Converters" Title="{Data:Binding Path=WindowTitle}"
Width="1015"
- Height="652"
+ Height="670"
MinWidth="1015"
- MinHeight="652"
+ MinHeight="670"
AllowDrop="True"
Background="#FFF0F0F0"
FontSize="11"
diff --git a/win/CS/HandBrakeWPF/Views/SubtitlesView.xaml b/win/CS/HandBrakeWPF/Views/SubtitlesView.xaml
index 83dabf50f..362734851 100644
--- a/win/CS/HandBrakeWPF/Views/SubtitlesView.xaml
+++ b/win/CS/HandBrakeWPF/Views/SubtitlesView.xaml
@@ -69,6 +69,8 @@
<MenuItem Header="Add All Remaining Selected Languages" cal:Message.Attach="[Event Click] = [Action AddAllRemainingForSelectedLanguages]" />
<Separator />
<MenuItem Header="Clear All" cal:Message.Attach="[Event Click] = [Action Clear]" />
+ <Separator />
+ <MenuItem Header="Configure Default Behaviours" cal:Message.Attach="[Event Click] = [Action SetDefaultBehaviour]" />
</ContextMenu>
</ListBox.ContextMenu>
diff --git a/win/CS/HandBrakeWPF/Views/VideoView.xaml b/win/CS/HandBrakeWPF/Views/VideoView.xaml
index 78186238d..c9b125abe 100644
--- a/win/CS/HandBrakeWPF/Views/VideoView.xaml
+++ b/win/CS/HandBrakeWPF/Views/VideoView.xaml
@@ -79,7 +79,10 @@
<StackPanel Orientation="Horizontal" Margin="0,0,0,10" >
<RadioButton Content="Constant Quality:" IsChecked="{Binding IsConstantQuantity}" Margin="0,0,10,0"/>
<TextBlock Text="{Binding DisplayRF}" Width="25" />
- <TextBlock Text="RF" FontWeight="Bold" />
+ <TextBlock Text="{Binding Rfqp}" FontWeight="Bold" />
+
+ <TextBlock Text="{x:Static Properties:Resources.Video_LosslessWarning}" Visibility="{Binding IsLossless, Converter={StaticResource boolToVisConverter}}"
+ Margin="10,0,0,0" ToolTip="{x:Static Properties:Resources.Video_LosslessWarningTooltip}" FontWeight="Bold" />
</StackPanel>
<Slider Width="280" Value="{Binding RF}" HorizontalAlignment="Left" Maximum="{Binding QualityMax}" Minimum="{Binding QualityMin}"