summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF
diff options
context:
space:
mode:
authorsr55 <[email protected]>2016-12-13 19:35:02 +0000
committersr55 <[email protected]>2016-12-13 19:35:10 +0000
commit35130882b828ff6af96fafa2a24a8b9afc898f0d (patch)
tree2a96438e8fe0c3ba915b447847829bef1f862ac7 /win/CS/HandBrakeWPF
parent1f418c2cf9e74f907311b0f5e77d84342e570e35 (diff)
WinGui: Advanced Tab Changes
1. Strip out a lot of the old advanced tab infrastructure as it is no longer needed. Only the deprecated X264 Advacned Panel is left. All other encoders use the Video tab now. 2. Changed Option to "Allow use of 'Advanced Tab'" and only show the tab if the checkbox on the video tab is checked. It will no longer show based on the perference alone. 3. Fix the one-way communication from Video Tab to X264 Tab so preset options are reflected ont he X264 Tab. The reverse is not supported but it will retain the previous options.
Diffstat (limited to 'win/CS/HandBrakeWPF')
-rw-r--r--win/CS/HandBrakeWPF/Commands/AdvancedEncoderOptionsCommand.cs40
-rw-r--r--win/CS/HandBrakeWPF/Commands/Interfaces/IAdvancedEncoderOptionsCommand.cs27
-rw-r--r--win/CS/HandBrakeWPF/HandBrakeWPF.csproj11
-rw-r--r--win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs2
-rw-r--r--win/CS/HandBrakeWPF/Properties/ResourcesUI.resx2
-rw-r--r--win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeFactory.cs16
-rw-r--r--win/CS/HandBrakeWPF/Startup/AppBootstrapper.cs4
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs141
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/Interfaces/IAdvancedViewModel.cs32
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/Interfaces/IVideoViewModel.cs5
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs6
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs51
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/X264ViewModel.cs29
-rw-r--r--win/CS/HandBrakeWPF/Views/AdvancedView.xaml31
-rw-r--r--win/CS/HandBrakeWPF/Views/AdvancedView.xaml.cs27
-rw-r--r--win/CS/HandBrakeWPF/Views/MainView.xaml2
-rw-r--r--win/CS/HandBrakeWPF/Views/VideoView.xaml2
17 files changed, 29 insertions, 399 deletions
diff --git a/win/CS/HandBrakeWPF/Commands/AdvancedEncoderOptionsCommand.cs b/win/CS/HandBrakeWPF/Commands/AdvancedEncoderOptionsCommand.cs
deleted file mode 100644
index bb78e1c3c..000000000
--- a/win/CS/HandBrakeWPF/Commands/AdvancedEncoderOptionsCommand.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-// --------------------------------------------------------------------------------------------------------------------
-// <copyright file="AdvancedEncoderOptionsCommand.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 for resetting the video / advnaced tabs encoder options.
-// </summary>
-// --------------------------------------------------------------------------------------------------------------------
-
-namespace HandBrakeWPF.Commands
-{
- using Caliburn.Micro;
-
- using HandBrakeWPF.Commands.Interfaces;
- using HandBrakeWPF.ViewModels.Interfaces;
-
- /// <summary>
- /// A Command for resetting the video / advnaced tabs encoder options.
- /// </summary>
- public class AdvancedEncoderOptionsCommand : IAdvancedEncoderOptionsCommand
- {
- /// <summary>
- /// Clear out the advanced options
- /// </summary>
- public void ExecuteClearAdvanced()
- {
- IAdvancedViewModel advancedViewModel = IoC.Get<IAdvancedViewModel>();
- advancedViewModel.Clear();
- }
-
- /// <summary>
- /// Clear the advanced encoder options out on the video tab.
- /// </summary>
- public void ExecuteClearVideo()
- {
- IVideoViewModel videoViewModel = IoC.Get<IVideoViewModel>();
- videoViewModel.ClearAdvancedSettings();
- }
- }
-}
diff --git a/win/CS/HandBrakeWPF/Commands/Interfaces/IAdvancedEncoderOptionsCommand.cs b/win/CS/HandBrakeWPF/Commands/Interfaces/IAdvancedEncoderOptionsCommand.cs
deleted file mode 100644
index 5f0c96fb2..000000000
--- a/win/CS/HandBrakeWPF/Commands/Interfaces/IAdvancedEncoderOptionsCommand.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-// --------------------------------------------------------------------------------------------------------------------
-// <copyright file="IAdvancedEncoderOptionsCommand.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 AdvancedEncoderOptionsCommand interface.
-// </summary>
-// --------------------------------------------------------------------------------------------------------------------
-
-namespace HandBrakeWPF.Commands.Interfaces
-{
- /// <summary>
- /// The AdvancedEncoderOptionsCommand interface.
- /// </summary>
- public interface IAdvancedEncoderOptionsCommand
- {
- /// <summary>
- /// Clear out the advanced options
- /// </summary>
- void ExecuteClearAdvanced();
-
- /// <summary>
- /// Clear the advanced encoder options out on the video tab.
- /// </summary>
- void ExecuteClearVideo();
- }
-} \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj
index 8425d7314..71584b1b0 100644
--- a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj
+++ b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj
@@ -134,14 +134,12 @@
<Compile Include="AttachedProperties\MenuItemExtensions.cs" />
<Compile Include="Collections\SerializableDictionary.cs" />
<Compile Include="Commands\InputBindingTrigger.cs" />
- <Compile Include="Commands\Interfaces\IAdvancedEncoderOptionsCommand.cs" />
<Compile Include="Commands\Menu\QueueCommandParams.cs" />
<Compile Include="Commands\Menu\QueueCommands.cs" />
<Compile Include="Commands\OpenOptionsScreenCommand.cs" />
<Compile Include="Commands\PresetMenuSelectCommand.cs" />
<Compile Include="Commands\ProcessShortcutCommand.cs" />
<Compile Include="Commands\SourceMenuCommand.cs" />
- <Compile Include="Commands\AdvancedEncoderOptionsCommand.cs" />
<Compile Include="Constants.cs" />
<Compile Include="Controls\SplitButton\SplitMenuButton.cs" />
<Compile Include="Controls\AlertPanel.xaml.cs">
@@ -330,13 +328,9 @@
<Compile Include="Services\Interfaces\IPrePostActionService.cs" />
<Compile Include="Services\UpdateService.cs" />
<Compile Include="Services\PrePostActionService.cs" />
- <Compile Include="ViewModels\AdvancedViewModel.cs" />
<Compile Include="ViewModels\Interfaces\IX264ViewModel.cs" />
<Compile Include="ViewModels\Interfaces\IQueueSelectionViewModel.cs" />
<Compile Include="ViewModels\QueueSelectionViewModel.cs" />
- <Compile Include="Views\AdvancedView.xaml.cs">
- <DependentUpon>AdvancedView.xaml</DependentUpon>
- </Compile>
<Compile Include="Views\QueueSelectionView.xaml.cs">
<DependentUpon>QueueSelectionView.xaml</DependentUpon>
</Compile>
@@ -384,7 +378,6 @@
<Compile Include="ViewModels\ChaptersViewModel.cs" />
<Compile Include="ViewModels\PictureSettingsViewModel.cs" />
<Compile Include="ViewModels\ErrorViewModel.cs" />
- <Compile Include="ViewModels\Interfaces\IAdvancedViewModel.cs" />
<Compile Include="ViewModels\Interfaces\ISubtitlesViewModel.cs" />
<Compile Include="ViewModels\Interfaces\IChaptersViewModel.cs" />
<Compile Include="ViewModels\Interfaces\IPictureSettingsViewModel.cs" />
@@ -536,10 +529,6 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
- <Page Include="Views\AdvancedView.xaml">
- <Generator>MSBuild:Compile</Generator>
- <SubType>Designer</SubType>
- </Page>
<Page Include="Views\QueueSelectionView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
diff --git a/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs b/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs
index 91ef97c49..f5b473e78 100644
--- a/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs
+++ b/win/CS/HandBrakeWPF/Properties/ResourcesUI.Designer.cs
@@ -1015,7 +1015,7 @@ namespace HandBrakeWPF.Properties {
}
/// <summary>
- /// Looks up a localized string similar to Show Advanced Encoder Options Tab (Deprecated).
+ /// Looks up a localized string similar to Allow use of &apos;Advanced&apos; Tab for x264 options. (Deprecated).
/// </summary>
public static string Options_AdvancedTab {
get {
diff --git a/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx b/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx
index 36b8473ff..6e0be7892 100644
--- a/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx
+++ b/win/CS/HandBrakeWPF/Properties/ResourcesUI.resx
@@ -688,7 +688,7 @@
<value>Advanced Options</value>
</data>
<data name="Options_AdvancedTab" xml:space="preserve">
- <value>Show Advanced Encoder Options Tab (Deprecated)</value>
+ <value>Allow use of 'Advanced' Tab for x264 options. (Deprecated)</value>
</data>
<data name="Options_Arguments" xml:space="preserve">
<value>Arguments:</value>
diff --git a/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeFactory.cs b/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeFactory.cs
index 9eba5c684..9e1a82966 100644
--- a/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeFactory.cs
+++ b/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeFactory.cs
@@ -282,6 +282,14 @@ namespace HandBrakeWPF.Services.Encode.Factories
video.Options = job.ExtraAdvancedArguments;
video.Preset = job.VideoPreset != null ? job.VideoPreset.ShortName : null;
video.Profile = job.VideoProfile != null ? job.VideoProfile.ShortName : null;
+
+ if (job.VideoTunes != null && job.VideoTunes.Count > 0)
+ {
+ foreach (var item in job.VideoTunes)
+ {
+ video.Tune += string.IsNullOrEmpty(video.Tune) ? item.ShortName : "," + item.ShortName;
+ }
+ }
}
if (job.VideoEncodeRateType == VideoEncodeRateType.ConstantQuality) video.Quality = job.Quality;
@@ -292,14 +300,6 @@ namespace HandBrakeWPF.Services.Encode.Factories
video.Turbo = job.TurboFirstPass;
}
- if (job.VideoTunes != null && job.VideoTunes.Count > 0)
- {
- foreach (var item in job.VideoTunes)
- {
- video.Tune += string.IsNullOrEmpty(video.Tune) ? item.ShortName : "," + item.ShortName;
- }
- }
-
video.OpenCL = configuration.ScalingMode == VideoScaler.BicubicCl;
video.QSV.Decode = !configuration.DisableQuickSyncDecoding;
diff --git a/win/CS/HandBrakeWPF/Startup/AppBootstrapper.cs b/win/CS/HandBrakeWPF/Startup/AppBootstrapper.cs
index 1e4a8a8ad..7163b26cd 100644
--- a/win/CS/HandBrakeWPF/Startup/AppBootstrapper.cs
+++ b/win/CS/HandBrakeWPF/Startup/AppBootstrapper.cs
@@ -14,8 +14,6 @@ namespace HandBrakeWPF.Startup
using Caliburn.Micro;
- using HandBrakeWPF.Commands;
- using HandBrakeWPF.Commands.Interfaces;
using HandBrakeWPF.Services;
using HandBrakeWPF.Services.Interfaces;
using HandBrakeWPF.Services.Presets;
@@ -65,7 +63,6 @@ namespace HandBrakeWPF.Startup
this.container.Singleton<IQueueProcessor, QueueProcessor>();
// Commands
- this.container.Singleton<IAdvancedEncoderOptionsCommand, AdvancedEncoderOptionsCommand>();
// Services and Shell Components
this.container.Singleton<IErrorService, ErrorService>();
@@ -86,7 +83,6 @@ namespace HandBrakeWPF.Startup
// Tab Components
this.container.Singleton<IAudioViewModel, AudioViewModel>();
this.container.Singleton<IX264ViewModel, X264ViewModel>();
- this.container.Singleton<IAdvancedViewModel, AdvancedViewModel>();
this.container.Singleton<IPictureSettingsViewModel, PictureSettingsViewModel>();
this.container.Singleton<IChaptersViewModel, ChaptersViewModel>();
this.container.Singleton<ISubtitlesViewModel, SubtitlesViewModel>();
diff --git a/win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs
deleted file mode 100644
index 746d457ef..000000000
--- a/win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs
+++ /dev/null
@@ -1,141 +0,0 @@
-// --------------------------------------------------------------------------------------------------------------------
-// <copyright file="AdvancedViewModel.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 Advanced View Model
-// </summary>
-// --------------------------------------------------------------------------------------------------------------------
-
-namespace HandBrakeWPF.ViewModels
-{
- using HandBrake.ApplicationServices.Interop.Model.Encoding;
-
- using HandBrakeWPF.Services.Presets.Model;
- using HandBrakeWPF.Services.Scan.Model;
- using HandBrakeWPF.ViewModels.Interfaces;
-
- using EncodeTask = HandBrakeWPF.Services.Encode.Model.EncodeTask;
-
- /// <summary>
- /// The Advanced View Model
- /// </summary>
- public class AdvancedViewModel : ViewModelBase, IAdvancedViewModel
- {
- #region Constants and Fields
-
- /// <summary>
- /// The show x 264 panel.
- /// </summary>
- private bool showX264Panel;
-
- #endregion
-
- /// <summary>
- /// Initializes a new instance of the <see cref="AdvancedViewModel"/> class.
- /// </summary>
- /// <param name="x264ViewModel">
- /// The x 264 view model.
- /// </param>
- public AdvancedViewModel(IX264ViewModel x264ViewModel)
- {
- this.X264ViewModel = x264ViewModel;
- }
-
- #region Properties
-
- /// <summary>
- /// Gets or sets the x 264 view model.
- /// </summary>
- public IX264ViewModel X264ViewModel { get; set; }
-
- /// <summary>
- /// Gets or sets a value indicating whether show x 264 panel.
- /// </summary>
- public bool ShowX264Panel
- {
- get
- {
- return this.showX264Panel;
- }
- set
- {
- this.showX264Panel = value;
- this.NotifyOfPropertyChange(() => this.ShowX264Panel);
- }
- }
-
- #endregion
-
- #region Implemented Interfaces
-
- /// <summary>
- /// The set encoder.
- /// </summary>
- /// <param name="encoder">
- /// The encoder.
- /// </param>
- public void SetEncoder(VideoEncoder encoder)
- {
- this.X264ViewModel.SetEncoder(encoder);
- this.ShowX264Panel = encoder == VideoEncoder.X264 || encoder == VideoEncoder.X264_10;
- }
-
- /// <summary>
- /// The clear.
- /// </summary>
- public void Clear()
- {
- this.X264ViewModel.Clear();
- }
-
- /// <summary>
- /// Setup this tab for the specified preset.
- /// </summary>
- /// <param name="preset">
- /// The preset.
- /// </param>
- /// <param name="task">
- /// The task.
- /// </param>
- public void SetPreset(Preset preset, EncodeTask task)
- {
- this.X264ViewModel.SetPreset(preset, task);
- }
-
- /// <summary>
- /// Update all the UI controls based on the encode task passed in.
- /// </summary>
- /// <param name="task">
- /// The task.
- /// </param>
- public void UpdateTask(EncodeTask task)
- {
- this.X264ViewModel.UpdateTask(task);
-
- this.SetEncoder(task.VideoEncoder);
- }
-
- /// <summary>
- /// Setup this window for a new source
- /// </summary>
- /// <param name="source">
- /// The source.
- /// </param>
- /// <param name="title">
- /// The title.
- /// </param>
- /// <param name="preset">
- /// The preset.
- /// </param>
- /// <param name="task">
- /// The task.
- /// </param>
- public void SetSource(Source source, Title title, Preset preset, EncodeTask task)
- {
- this.X264ViewModel.SetSource(source, title, preset, task);
- }
-
- #endregion
- }
-} \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IAdvancedViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IAdvancedViewModel.cs
deleted file mode 100644
index acbcb7d02..000000000
--- a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IAdvancedViewModel.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-// --------------------------------------------------------------------------------------------------------------------
-// <copyright file="IAdvancedViewModel.cs" company="HandBrake Project (http://handbrake.fr)">
-// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
-// </copyright>
-// <summary>
-// Defines the IAdvancedViewModel type.
-// </summary>
-// --------------------------------------------------------------------------------------------------------------------
-
-namespace HandBrakeWPF.ViewModels.Interfaces
-{
- using HandBrake.ApplicationServices.Interop.Model.Encoding;
-
- /// <summary>
- /// The Advanced View Model Interface
- /// </summary>
- public interface IAdvancedViewModel : ITabInterface
- {
- /// <summary>
- /// Set the currently selected encoder.
- /// </summary>
- /// <param name="encoder">
- /// The Video Encoder.
- /// </param>
- void SetEncoder(VideoEncoder encoder);
-
- /// <summary>
- /// Clear out the settings.
- /// </summary>
- void Clear();
- }
-}
diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IVideoViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IVideoViewModel.cs
index d3602e5e5..d3b162501 100644
--- a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IVideoViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IVideoViewModel.cs
@@ -18,10 +18,5 @@ namespace HandBrakeWPF.ViewModels.Interfaces
/// Trigger a Notify Property Changed on the Task to force various UI elements to update.
/// </summary>
void RefreshTask();
-
- /// <summary>
- /// Clear the advanced x264 options.
- /// </summary>
- void ClearAdvancedSettings();
}
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
index 957ce4d29..359301296 100644
--- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
@@ -161,8 +161,8 @@ namespace HandBrakeWPF.ViewModels
public MainViewModel(IUserSettingService userSettingService, IScan scanService, IEncode encodeService, IPresetService presetService,
IErrorService errorService, IUpdateService updateService,
IPrePostActionService whenDoneService, IWindowManager windowManager, IPictureSettingsViewModel pictureSettingsViewModel, IVideoViewModel videoViewModel,
- IFiltersViewModel filtersViewModel, IAudioViewModel audioViewModel, ISubtitlesViewModel subtitlesViewModel,
- IAdvancedViewModel advancedViewModel, IChaptersViewModel chaptersViewModel, IStaticPreviewViewModel staticPreviewViewModel,
+ IFiltersViewModel filtersViewModel, IAudioViewModel audioViewModel, ISubtitlesViewModel subtitlesViewModel,
+ IX264ViewModel advancedViewModel, IChaptersViewModel chaptersViewModel, IStaticPreviewViewModel staticPreviewViewModel,
IQueueViewModel queueViewModel, IMetaDataViewModel metaDataViewModel)
{
this.scanService = scanService;
@@ -260,7 +260,7 @@ namespace HandBrakeWPF.ViewModels
/// <summary>
/// Gets or sets AdvancedViewModel.
/// </summary>
- public IAdvancedViewModel AdvancedViewModel { get; set; }
+ public IX264ViewModel AdvancedViewModel { get; set; }
/// <summary>
/// Gets or sets VideoViewModel.
diff --git a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs
index 55a679ea7..7b3cf7813 100644
--- a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs
@@ -20,7 +20,6 @@ namespace HandBrakeWPF.ViewModels
using HandBrake.ApplicationServices.Interop;
using HandBrake.ApplicationServices.Interop.Model.Encoding;
- using HandBrakeWPF.Commands.Interfaces;
using HandBrakeWPF.Properties;
using HandBrakeWPF.Services.Interfaces;
using HandBrakeWPF.Services.Presets.Model;
@@ -51,14 +50,12 @@ namespace HandBrakeWPF.ViewModels
private const string SameAsSource = "Same as source";
private readonly IUserSettingService userSettingService;
- private readonly IAdvancedEncoderOptionsCommand advancedEncoderOptionsCommand;
private bool displayOptimiseOptions;
private int qualityMax;
private int qualityMin;
private bool showPeakFramerate;
private int rf;
- private bool canClear;
private bool displayTurboFirstPass;
private int videoPresetMaxValue;
private int videoPresetValue;
@@ -82,11 +79,10 @@ namespace HandBrakeWPF.ViewModels
/// <param name="advancedEncoderOptionsCommand">
/// The advanced Encoder Options Command.
/// </param>
- public VideoViewModel(IUserSettingService userSettingService, IAdvancedEncoderOptionsCommand advancedEncoderOptionsCommand)
+ public VideoViewModel(IUserSettingService userSettingService)
{
this.Task = new EncodeTask { VideoEncoder = VideoEncoder.X264 };
this.userSettingService = userSettingService;
- this.advancedEncoderOptionsCommand = advancedEncoderOptionsCommand;
this.QualityMin = 0;
this.QualityMax = 51;
this.IsConstantQuantity = true;
@@ -112,7 +108,7 @@ namespace HandBrakeWPF.ViewModels
/// <summary>
/// Gets a value indicating whether show advanced tab.
/// </summary>
- public bool ShowAdvancedTab
+ public bool IsAdvancedTabOptionEnabled
{
get
{
@@ -124,6 +120,7 @@ namespace HandBrakeWPF.ViewModels
if (this.SelectedVideoEncoder != VideoEncoder.X264 && this.SelectedVideoEncoder != VideoEncoder.X264_10)
{
+ this.UseAdvancedTab = false;
return false;
}
@@ -146,8 +143,8 @@ namespace HandBrakeWPF.ViewModels
{
// Set the Advanced Tab up with the current settings, if we can.
this.Task.AdvancedEncoderOptions = value ? this.GetActualx264Query() : string.Empty;
-
this.Task.ShowAdvancedTab = value;
+
this.NotifyOfPropertyChange(() => this.UseAdvancedTab);
}
}
@@ -673,7 +670,6 @@ namespace HandBrakeWPF.ViewModels
this.NotifyOfPropertyChange(() => this.FastDecode);
this.NotifyOfPropertyChange(() => this.FullOptionsTooltip);
- this.ResetAdvancedTab();
}
}
@@ -691,7 +687,6 @@ namespace HandBrakeWPF.ViewModels
this.Task.VideoPreset = value;
this.NotifyOfPropertyChange(() => this.VideoPreset);
this.NotifyOfPropertyChange(() => this.FullOptionsTooltip);
- this.ResetAdvancedTab();
}
}
@@ -772,7 +767,6 @@ namespace HandBrakeWPF.ViewModels
this.NotifyOfPropertyChange(() => this.VideoTune);
this.NotifyOfPropertyChange(() => this.FullOptionsTooltip);
- this.ResetAdvancedTab();
}
}
@@ -790,7 +784,6 @@ namespace HandBrakeWPF.ViewModels
this.Task.VideoProfile = value;
this.NotifyOfPropertyChange(() => this.VideoProfile);
this.NotifyOfPropertyChange(() => this.FullOptionsTooltip);
- this.ResetAdvancedTab();
}
}
@@ -808,7 +801,6 @@ namespace HandBrakeWPF.ViewModels
this.Task.VideoLevel = value;
this.NotifyOfPropertyChange(() => this.VideoLevel);
this.NotifyOfPropertyChange(() => this.FullOptionsTooltip);
- this.ResetAdvancedTab();
}
}
@@ -954,7 +946,7 @@ namespace HandBrakeWPF.ViewModels
}
this.ExtraArguments = preset.Task.ExtraAdvancedArguments;
- this.UseAdvancedTab = (!string.IsNullOrEmpty(preset.Task.AdvancedEncoderOptions) && this.ShowAdvancedTab) || preset.Task.ShowAdvancedTab;
+ this.UseAdvancedTab = (!string.IsNullOrEmpty(preset.Task.AdvancedEncoderOptions) && this.IsAdvancedTabOptionEnabled) || preset.Task.ShowAdvancedTab;
}
}
@@ -1018,23 +1010,6 @@ namespace HandBrakeWPF.ViewModels
}
/// <summary>
- /// Clear advanced settings.
- /// </summary>
- public void ClearAdvancedSettings()
- {
- this.canClear = false;
- this.FastDecode = false;
- this.VideoTune = null;
- this.VideoProfile = new VideoProfile("auto", "auto");
- this.VideoPreset = null;
- this.VideoPresetValue = 1;
- this.VideoLevel = new VideoLevel("auto", "auto");
-
- this.ExtraArguments = string.Empty;
- this.canClear = true;
- }
-
- /// <summary>
/// The copy query.
/// </summary>
public void CopyQuery()
@@ -1080,16 +1055,6 @@ namespace HandBrakeWPF.ViewModels
}
}
- /// <summary>
- /// Reset advanced tab.
- /// </summary>
- private void ResetAdvancedTab()
- {
- if (canClear)
- {
- this.advancedEncoderOptionsCommand.ExecuteClearAdvanced();
- }
- }
/// <summary>
/// The get actualx 264 query.
@@ -1156,7 +1121,7 @@ namespace HandBrakeWPF.ViewModels
{
if (e.Key == UserSettingConstants.ShowAdvancedTab)
{
- this.NotifyOfPropertyChange(() => this.ShowAdvancedTab);
+ this.NotifyOfPropertyChange(() => this.IsAdvancedTabOptionEnabled);
}
}
@@ -1310,7 +1275,7 @@ namespace HandBrakeWPF.ViewModels
}
// Tell the Advanced Panel off the change
- IAdvancedViewModel advancedViewModel = IoC.Get<IAdvancedViewModel>();
+ IX264ViewModel advancedViewModel = IoC.Get<IX264ViewModel>();
advancedViewModel.SetEncoder(this.Task.VideoEncoder);
// Update the Quality Slider. Make sure the bounds are up to date with the users settings.
@@ -1337,7 +1302,7 @@ namespace HandBrakeWPF.ViewModels
// Refresh Display
this.NotifyOfPropertyChange(() => this.Rfqp);
- this.NotifyOfPropertyChange(() => this.ShowAdvancedTab);
+ this.NotifyOfPropertyChange(() => this.IsAdvancedTabOptionEnabled);
this.NotifyOfPropertyChange(() => this.HighQualityLabel);
// Handle some quicksync specific options.
diff --git a/win/CS/HandBrakeWPF/ViewModels/X264ViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/X264ViewModel.cs
index 5b2694cd9..ac92b760f 100644
--- a/win/CS/HandBrakeWPF/ViewModels/X264ViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/X264ViewModel.cs
@@ -16,7 +16,6 @@ namespace HandBrakeWPF.ViewModels
using HandBrake.ApplicationServices.Interop.Model.Encoding;
- using HandBrakeWPF.Commands.Interfaces;
using HandBrakeWPF.Helpers;
using HandBrakeWPF.Model;
using HandBrakeWPF.Services.Presets.Model;
@@ -30,11 +29,6 @@ namespace HandBrakeWPF.ViewModels
/// </summary>
public class X264ViewModel : ViewModelBase, IX264ViewModel
{
- /// <summary>
- /// The advanced encoder options command.
- /// </summary>
- private readonly IAdvancedEncoderOptionsCommand advancedEncoderOptionsCommand;
-
#region Constants and Fields
/// <summary>
@@ -164,12 +158,8 @@ namespace HandBrakeWPF.ViewModels
/// <summary>
/// Initializes a new instance of the <see cref="X264ViewModel"/> class.
/// </summary>
- /// <param name="advancedEncoderOptionsCommand">
- /// The advanced Encoder Options Command.
- /// </param>
- public X264ViewModel(IAdvancedEncoderOptionsCommand advancedEncoderOptionsCommand)
+ public X264ViewModel()
{
- this.advancedEncoderOptionsCommand = advancedEncoderOptionsCommand;
this.Task = new EncodeTask();
this.UpdateUIFromAdvancedOptions();
}
@@ -190,6 +180,11 @@ namespace HandBrakeWPF.ViewModels
ShowX264AdvancedOptions = this.Task.ShowAdvancedTab;
this.NotifyOfPropertyChange(() => ShowX264AdvancedOptions);
this.NotifyOfPropertyChange(() => this.AdvancedOptionsString);
+
+ if (ShowX264AdvancedOptions)
+ {
+ this.UpdateUIFromAdvancedOptions();
+ }
}
}
@@ -253,12 +248,6 @@ namespace HandBrakeWPF.ViewModels
this.Task.AdvancedEncoderOptions = value;
this.UpdateUIFromAdvancedOptions();
this.NotifyOfPropertyChange(() => this.AdvancedOptionsString);
-
- // Reset the video tab if the user is using this tab.
- if (!string.IsNullOrEmpty(this.Task.AdvancedEncoderOptions))
- {
- this.advancedEncoderOptionsCommand.ExecuteClearVideo();
- }
}
}
@@ -1154,12 +1143,6 @@ namespace HandBrakeWPF.ViewModels
this.Task.AdvancedEncoderOptions = string.Join(":", newOptions);
this.NotifyOfPropertyChange(() => this.AdvancedOptionsString);
-
- // Reset the video tab if the user is using this tab.
- if (!string.IsNullOrEmpty(this.Task.AdvancedEncoderOptions))
- {
- this.advancedEncoderOptionsCommand.ExecuteClearVideo();
- }
}
#endregion
diff --git a/win/CS/HandBrakeWPF/Views/AdvancedView.xaml b/win/CS/HandBrakeWPF/Views/AdvancedView.xaml
deleted file mode 100644
index a4fa3ca27..000000000
--- a/win/CS/HandBrakeWPF/Views/AdvancedView.xaml
+++ /dev/null
@@ -1,31 +0,0 @@
-<UserControl x:Class="HandBrakeWPF.Views.AdvancedView"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- 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"
- x:Name="advancedView"
- mc:Ignorable="d"
- >
- <UserControl.Resources>
- <Converters:BooleanToVisibilityConverter x:Key="BooleanVisibilityConverter" />
-
- </UserControl.Resources>
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- </Grid.RowDefinitions>
-
- <ContentControl x:Name="X264ViewModel"
- Visibility="{Binding ShowX264Panel, Converter={StaticResource BooleanVisibilityConverter}}" />
-
- <TextBlock Text="{x:Static Properties:Resources.Advanced_NoOptionsPaneAvailable}" Grid.Row="0"
- TextWrapping="Wrap" Width="480" Margin="0, 100, 0, 0" FontSize="12"
- Visibility="{Binding ShowX264Panel, Converter={StaticResource BooleanVisibilityConverter}, ConverterParameter=true}" />
-
-
- </Grid>
-</UserControl> \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/Views/AdvancedView.xaml.cs b/win/CS/HandBrakeWPF/Views/AdvancedView.xaml.cs
deleted file mode 100644
index a47bf3efd..000000000
--- a/win/CS/HandBrakeWPF/Views/AdvancedView.xaml.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-// --------------------------------------------------------------------------------------------------------------------
-// <copyright file="AdvancedView.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 AdvancedView.xaml
-// </summary>
-// --------------------------------------------------------------------------------------------------------------------
-
-namespace HandBrakeWPF.Views
-{
- using System.Windows.Controls;
-
- /// <summary>
- /// Interaction logic for AdvancedView.xaml
- /// </summary>
- public partial class AdvancedView : UserControl
- {
- /// <summary>
- /// Initializes a new instance of the <see cref="AdvancedView"/> class.
- /// </summary>
- public AdvancedView()
- {
- InitializeComponent();
- }
- }
-}
diff --git a/win/CS/HandBrakeWPF/Views/MainView.xaml b/win/CS/HandBrakeWPF/Views/MainView.xaml
index 1959c9bfe..c08ece4d6 100644
--- a/win/CS/HandBrakeWPF/Views/MainView.xaml
+++ b/win/CS/HandBrakeWPF/Views/MainView.xaml
@@ -481,7 +481,7 @@
<TabItem Name="chaptersTab" Header="{x:Static Properties:ResourcesUI.MainView_ChaptersTab}">
<ContentControl x:Name="ChaptersViewModel" />
</TabItem>
- <TabItem Name="advancedTab" Header="{x:Static Properties:ResourcesUI.MainView_AdvancedTab}" Visibility="{Binding ShowAdvancedTab, Converter={StaticResource boolToVisConverter}}">
+ <TabItem Name="advancedTab" Header="{x:Static Properties:ResourcesUI.MainView_AdvancedTab}" Visibility="{Binding CurrentTask.ShowAdvancedTab, Converter={StaticResource boolToVisConverter}}">
<ContentControl x:Name="AdvancedViewModel" />
</TabItem>
</TabControl>
diff --git a/win/CS/HandBrakeWPF/Views/VideoView.xaml b/win/CS/HandBrakeWPF/Views/VideoView.xaml
index e8319b785..bc6e1881e 100644
--- a/win/CS/HandBrakeWPF/Views/VideoView.xaml
+++ b/win/CS/HandBrakeWPF/Views/VideoView.xaml
@@ -131,7 +131,7 @@
<TextBlock Text="{x:Static Properties:ResourcesUI.VideoView_OptimiseVideo}" Margin="0,0,0,0" Grid.Row="0" Grid.ColumnSpan="2" FontWeight="Bold" VerticalAlignment="Center" />
<CheckBox Content="{x:Static Properties:ResourcesUI.VideoView_UseAdvancedTab}" Grid.Row="1" IsChecked="{Binding UseAdvancedTab}" Margin="0,5,0,0"
- Visibility="{Binding ShowAdvancedTab, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}"
+ Visibility="{Binding IsAdvancedTabOptionEnabled, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}"
ToolTip="{x:Static Properties:ResourcesTooltips.Video_AdvancedOptions}" />
<Grid Grid.Row="2" Margin="0,8,0,0" IsEnabled="{Binding UseAdvancedTab, Converter={StaticResource inverseConverter}}">