diff options
author | sr55 <[email protected]> | 2015-03-29 15:57:53 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2015-03-29 15:57:53 +0000 |
commit | 168ce686fd837de7fbf20266df31af2ac00c8db1 (patch) | |
tree | 1feb3e16046babb4bee15b7554a04ca383e13206 | |
parent | 476eb6ccaa4e655c43d85d8111f27451aa0a8f8f (diff) |
WinGui: Add TrueHD, Flac and EAC3 Passthru, and EAC3 encoder options. Fixed No Audio Behaviour. Misc other experimental UX/UI code.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7027 b64f7644-9d1e-0410-96f1-a4d463321fa5
24 files changed, 869 insertions, 210 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/AudioEncoder.cs b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/AudioEncoder.cs index 7b18aaa03..3aef81c38 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/AudioEncoder.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/AudioEncoder.cs @@ -46,6 +46,10 @@ namespace HandBrake.ApplicationServices.Interop.Model.Encoding [ShortName("copy:ac3")]
Ac3Passthrough,
+ [Display(Name = "E-AC3 Passthru")]
+ [ShortName("copy:eac3")]
+ EAc3Passthrough,
+
[Display(Name = "DTS Passthru")]
[ShortName("copy:dts")]
DtsPassthrough,
@@ -54,6 +58,10 @@ namespace HandBrake.ApplicationServices.Interop.Model.Encoding [ShortName("copy:dtshd")]
DtsHDPassthrough,
+ [Display(Name = "TrueHD Passthru")]
+ [ShortName("copy:truehd")]
+ TrueHDPassthrough,
+
[Display(Name = "AAC Passthru")]
[ShortName("copy:aac")]
AacPassthru,
@@ -73,5 +81,9 @@ namespace HandBrake.ApplicationServices.Interop.Model.Encoding [Display(Name = "FLAC 24-bit")]
[ShortName("flac24")]
ffflac24,
+
+ [Display(Name = "FLAC Passthru")]
+ [ShortName("copy:flac")]
+ FlacPassthru,
}
}
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/AllowedPassthru.cs b/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/AllowedPassthru.cs index 9a6f61810..d2ac4d5ac 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/AllowedPassthru.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/AllowedPassthru.cs @@ -16,35 +16,6 @@ namespace HandBrake.ApplicationServices.Services.Encode.Model.Models /// </summary>
public class AllowedPassthru
{
- #region Constants and Fields
-
- /// <summary>
- /// The audio allow aac pass.
- /// </summary>
- private bool? audioAllowAACPass;
-
- /// <summary>
- /// The audio allow a c 3 pass.
- /// </summary>
- private bool? audioAllowAC3Pass;
-
- /// <summary>
- /// The audio allow dtshd pass.
- /// </summary>
- private bool? audioAllowDTSHDPass;
-
- /// <summary>
- /// The audio allow dts pass.
- /// </summary>
- private bool? audioAllowDTSPass;
-
- /// <summary>
- /// The audio allow m p 3 pass.
- /// </summary>
- private bool? audioAllowMP3Pass;
-
- #endregion
-
#region Constructors and Destructors
/// <summary>
@@ -57,6 +28,9 @@ namespace HandBrake.ApplicationServices.Services.Encode.Model.Models this.AudioAllowDTSHDPass = true;
this.AudioAllowDTSPass = true;
this.AudioAllowMP3Pass = true;
+ this.AudioAllowEAC3Pass = true;
+ this.AudioAllowTrueHDPass = true;
+ this.AudioAllowFlacPass = true;
this.AudioEncoderFallback = AudioEncoder.Ac3;
}
@@ -66,13 +40,16 @@ namespace HandBrake.ApplicationServices.Services.Encode.Model.Models /// <param name="initialValue">
/// The initial Value.
/// </param>
- public AllowedPassthru(bool? initialValue)
+ public AllowedPassthru(bool initialValue)
{
this.AudioAllowAACPass = initialValue;
this.AudioAllowAC3Pass = initialValue;
this.AudioAllowDTSHDPass = initialValue;
this.AudioAllowDTSPass = initialValue;
this.AudioAllowMP3Pass = initialValue;
+ this.AudioAllowEAC3Pass = initialValue;
+ this.AudioAllowTrueHDPass = initialValue;
+ this.AudioAllowFlacPass = initialValue;
this.AudioEncoderFallback = AudioEncoder.Ac3;
}
@@ -90,6 +67,9 @@ namespace HandBrake.ApplicationServices.Services.Encode.Model.Models this.AudioAllowDTSHDPass = initialValue.AudioAllowDTSHDPass;
this.AudioAllowDTSPass = initialValue.AudioAllowDTSPass;
this.AudioAllowMP3Pass = initialValue.AudioAllowMP3Pass;
+ this.AudioAllowEAC3Pass = initialValue.AudioAllowEAC3Pass;
+ this.AudioAllowTrueHDPass = initialValue.AudioAllowTrueHDPass;
+ this.AudioAllowFlacPass = initialValue.AudioAllowFlacPass;
this.AudioEncoderFallback = initialValue.AudioEncoderFallback;
}
@@ -100,77 +80,42 @@ namespace HandBrake.ApplicationServices.Services.Encode.Model.Models /// <summary>
/// Gets or sets a value indicating whether AudioAllowAACPass.
/// </summary>
- public bool? AudioAllowAACPass
- {
- get
- {
- return this.audioAllowAACPass ?? true;
- }
- set
- {
- this.audioAllowAACPass = value;
- }
- }
+ public bool AudioAllowAACPass { get; set; }
/// <summary>
/// Gets or sets a value indicating whether AudioAllowAC3Pass.
/// </summary>
- public bool? AudioAllowAC3Pass
- {
- get
- {
- return this.audioAllowAC3Pass ?? true;
- }
- set
- {
- this.audioAllowAC3Pass = value;
- }
- }
+ public bool AudioAllowAC3Pass { get; set; }
/// <summary>
/// Gets or sets a value indicating whether AudioAllowDTSHDPass.
/// </summary>
- public bool? AudioAllowDTSHDPass
- {
- get
- {
- return this.audioAllowDTSHDPass ?? true;
- }
- set
- {
- this.audioAllowDTSHDPass = value;
- }
- }
+ public bool AudioAllowDTSHDPass { get; set; }
/// <summary>
/// Gets or sets a value indicating whether AudioAllowDTSPass.
/// </summary>
- public bool? AudioAllowDTSPass
- {
- get
- {
- return this.audioAllowDTSPass ?? true;
- }
- set
- {
- this.audioAllowDTSPass = value;
- }
- }
+ public bool AudioAllowDTSPass { get; set; }
/// <summary>
/// Gets or sets a value indicating whether AudioAllowMP3Pass.
/// </summary>
- public bool? AudioAllowMP3Pass
- {
- get
- {
- return this.audioAllowMP3Pass ?? true;
- }
- set
- {
- this.audioAllowMP3Pass = value;
- }
- }
+ public bool AudioAllowMP3Pass { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether audio allow true hd pass.
+ /// </summary>
+ public bool AudioAllowTrueHDPass { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether audio allow flac pass.
+ /// </summary>
+ public bool AudioAllowFlacPass { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether audio allow ea c 3 pass.
+ /// </summary>
+ public bool AudioAllowEAC3Pass { get; set; }
/// <summary>
/// Gets or sets AudioEncoderFallback.
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/AudioTrack.cs b/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/AudioTrack.cs index 34a81a27f..f2a454729 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/AudioTrack.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Encode/Model/Models/AudioTrack.cs @@ -344,7 +344,9 @@ namespace HandBrake.ApplicationServices.Services.Encode.Model.Models {
if (this.Encoder == AudioEncoder.Ac3Passthrough || this.Encoder == AudioEncoder.DtsPassthrough
|| this.Encoder == AudioEncoder.DtsHDPassthrough || this.Encoder == AudioEncoder.AacPassthru
- || this.Encoder == AudioEncoder.Mp3Passthru || this.Encoder == AudioEncoder.Passthrough)
+ || this.Encoder == AudioEncoder.Mp3Passthru || this.Encoder == AudioEncoder.Passthrough ||
+ this.Encoder == AudioEncoder.EAc3Passthrough || this.Encoder == AudioEncoder.TrueHDPassthrough
+ || this.Encoder == AudioEncoder.FlacPassthru)
{
return true;
}
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/Converters.cs b/win/CS/HandBrake.ApplicationServices/Utilities/Converters.cs index 5b39a23d6..d681106e0 100644 --- a/win/CS/HandBrake.ApplicationServices/Utilities/Converters.cs +++ b/win/CS/HandBrake.ApplicationServices/Utilities/Converters.cs @@ -154,52 +154,7 @@ namespace HandBrake.ApplicationServices.Utilities }
}
- /// <summary>
- /// Get the GUI equiv to a CLI audio encoder
- /// </summary>
- /// <param name="audioEnc">The Audio Encoder</param>
- /// <returns>The GUI representation of that audio encoder</returns>
- public static AudioEncoder GetAudioEncoderFromCliString(string audioEnc)
- {
- switch (audioEnc)
- {
- case "faac":
- case "ffaac":
- return AudioEncoder.ffaac;
- case "fdk_aac":
- return AudioEncoder.fdkaac;
- case "fdk_haac":
- return AudioEncoder.fdkheaac;
- case "mp3":
- case "lame":
- return AudioEncoder.Lame;
- case "vorbis":
- return AudioEncoder.Vorbis;
- case "ac3":
- case "ffac3":
- return AudioEncoder.Ac3;
- case "flac16":
- case "ffflac":
- return AudioEncoder.ffflac;
- case "flac24":
- case "ffflac24":
- return AudioEncoder.ffflac24;
- case "copy:ac3":
- return AudioEncoder.Ac3Passthrough;
- case "copy:dts":
- return AudioEncoder.DtsPassthrough;
- case "copy:dtshd":
- return AudioEncoder.DtsHDPassthrough;
- case "copy:mp3":
- return AudioEncoder.Mp3Passthru;
- case "copy:aac":
- return AudioEncoder.AacPassthru;
- case "copy":
- return AudioEncoder.Passthrough;
- default:
- return AudioEncoder.ffaac;
- }
- }
+
/// <summary>
/// Get the GUI equiv to a GUI audio encoder string
@@ -246,6 +201,12 @@ namespace HandBrake.ApplicationServices.Utilities case "FLAC (24-bit)":
case "FLAC 24-bit":
return AudioEncoder.ffflac24;
+ case "TrueHD Passthru":
+ return AudioEncoder.TrueHDPassthrough;
+ case "E-AC3 Passthru":
+ return AudioEncoder.EAc3Passthrough;
+ case "FLAC Passthru":
+ return AudioEncoder.FlacPassthru;
case "Auto Passthru":
return AudioEncoder.Passthrough;
default:
@@ -271,40 +232,6 @@ namespace HandBrake.ApplicationServices.Utilities #region Video
- /// <summary>
- /// Get the Video Encoder for a given string
- /// </summary>
- /// <param name="encoder">
- /// The encoder name
- /// </param>
- /// <returns>
- /// VideoEncoder enum object
- /// </returns>
- public static VideoEncoder GetVideoEncoder(string encoder)
- {
- switch (encoder)
- {
- case "ffmpeg":
- case "ffmpeg4":
- case "mpeg4":
- return VideoEncoder.FFMpeg;
- case "ffmpeg2":
- case "mpeg2":
- return VideoEncoder.FFMpeg2;
- case "x264":
- return VideoEncoder.X264;
- case "qsv_h264":
- return VideoEncoder.QuickSync;
- case "theora":
- return VideoEncoder.Theora;
- case "x265":
- return VideoEncoder.X265;
- case "VP8":
- return VideoEncoder.VP8;
- default:
- return VideoEncoder.X264;
- }
- }
/// <summary>
/// Get the Video Encoder for a given string
diff --git a/win/CS/HandBrakeWPF/Commands/CloseOverlayPanelCommand.cs b/win/CS/HandBrakeWPF/Commands/CloseOverlayPanelCommand.cs new file mode 100644 index 000000000..582cca925 --- /dev/null +++ b/win/CS/HandBrakeWPF/Commands/CloseOverlayPanelCommand.cs @@ -0,0 +1,58 @@ +// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="CloseOverlayPanelCommand.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 open overlay panel command.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.Commands
+{
+ using System;
+ using System.Windows.Input;
+
+ using Caliburn.Micro;
+
+ using HandBrakeWPF.ViewModels.Interfaces;
+
+ /// <summary>
+ /// The open overlay panel command.
+ /// </summary>
+ public class CloseOverlayPanelCommand : ICommand
+ {
+ /// <summary>
+ /// The execute.
+ /// </summary>
+ /// <param name="parameter">
+ /// The parameter.
+ /// </param>
+ public void Execute(object parameter)
+ {
+ IShellViewModel shellViewModel = IoC.Get<IShellViewModel>();
+ if (shellViewModel != null)
+ {
+ shellViewModel.HideOverlay();
+ }
+ }
+
+ /// <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 can execute changed.
+ /// </summary>
+ public event EventHandler CanExecuteChanged;
+ }
+}
diff --git a/win/CS/HandBrakeWPF/Commands/OpenOverlayPanelCommand.cs b/win/CS/HandBrakeWPF/Commands/OpenOverlayPanelCommand.cs new file mode 100644 index 000000000..5d2e3cba2 --- /dev/null +++ b/win/CS/HandBrakeWPF/Commands/OpenOverlayPanelCommand.cs @@ -0,0 +1,62 @@ +// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="OpenOverlayPanelCommand.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 open overlay panel command.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.Commands
+{
+ using System;
+ using System.Windows.Input;
+
+ using Caliburn.Micro;
+
+ using HandBrakeWPF.ViewModels.Interfaces;
+
+ /// <summary>
+ /// The open overlay panel command.
+ /// </summary>
+ public class OpenOverlayPanelCommand : ICommand
+ {
+ /// <summary>
+ /// The execute.
+ /// </summary>
+ /// <param name="parameter">
+ /// The parameter.
+ /// </param>
+ public void Execute(object parameter)
+ {
+ IOverlayPanel overlayPanel = parameter as IOverlayPanel;
+ if (overlayPanel != null)
+ {
+ IShellViewModel shellViewModel = IoC.Get<IShellViewModel>();
+ if (shellViewModel != null)
+ {
+ shellViewModel.ShowOverlay(overlayPanel);
+ }
+ }
+ }
+
+ /// <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 can execute changed.
+ /// </summary>
+ public event EventHandler CanExecuteChanged;
+ }
+}
diff --git a/win/CS/HandBrakeWPF/Converters/Audio/AudioBitrateConverter.cs b/win/CS/HandBrakeWPF/Converters/Audio/AudioBitrateConverter.cs index 89fcd58a9..4e7f6069a 100644 --- a/win/CS/HandBrakeWPF/Converters/Audio/AudioBitrateConverter.cs +++ b/win/CS/HandBrakeWPF/Converters/Audio/AudioBitrateConverter.cs @@ -99,6 +99,9 @@ namespace HandBrakeWPF.Converters.Audio case AudioEncoder.Passthrough:
case AudioEncoder.ffflac:
case AudioEncoder.ffflac24:
+ case AudioEncoder.EAc3Passthrough:
+ case AudioEncoder.TrueHDPassthrough:
+ case AudioEncoder.FlacPassthru:
max = 1536; // Since we don't care, just set it to the max.
break;
case AudioEncoder.fdkaac:
diff --git a/win/CS/HandBrakeWPF/Converters/Audio/AudioEncoderConverter.cs b/win/CS/HandBrakeWPF/Converters/Audio/AudioEncoderConverter.cs index 3ced1e9c2..ff6eaec06 100644 --- a/win/CS/HandBrakeWPF/Converters/Audio/AudioEncoderConverter.cs +++ b/win/CS/HandBrakeWPF/Converters/Audio/AudioEncoderConverter.cs @@ -13,9 +13,9 @@ namespace HandBrakeWPF.Converters.Audio using System.Collections.Generic;
using System.Globalization;
using System.Linq;
+ using System.Windows;
using System.Windows.Data;
- using HandBrake.ApplicationServices.Model;
using HandBrake.ApplicationServices.Services.Encode.Model;
using HandBrake.ApplicationServices.Services.Encode.Model.Models;
using HandBrake.ApplicationServices.Utilities;
@@ -57,22 +57,26 @@ namespace HandBrakeWPF.Converters.Audio encoders.Remove(AudioEncoder.Vorbis);
encoders.Remove(AudioEncoder.ffflac);
encoders.Remove(AudioEncoder.ffflac24);
+ encoders.Remove(AudioEncoder.FlacPassthru);
}
if (parameter != null && parameter.ToString() == "True")
{
encoders.Remove(AudioEncoder.DtsHDPassthrough);
encoders.Remove(AudioEncoder.DtsPassthrough);
+ encoders.Remove(AudioEncoder.EAc3Passthrough);
encoders.Remove(AudioEncoder.AacPassthru);
encoders.Remove(AudioEncoder.Ac3Passthrough);
encoders.Remove(AudioEncoder.Mp3Passthru);
encoders.Remove(AudioEncoder.Passthrough);
+ encoders.Remove(AudioEncoder.TrueHDPassthrough);
+ encoders.Remove(AudioEncoder.FlacPassthru);
}
return EnumHelper<AudioEncoder>.GetEnumDisplayValuesSubset(encoders);
}
- if (values.Any())
+ if (values.Any() && values.First() != DependencyProperty.UnsetValue)
{
return EnumHelper<AudioEncoder>.GetDisplay((AudioEncoder)values[0]);
}
diff --git a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj index 2e3aaf53e..dd5ee90ed 100644 --- a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj +++ b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj @@ -130,6 +130,8 @@ <Compile Include="Commands\CancelScanCommand.cs" />
<Compile Include="Commands\Interfaces\IAdvancedEncoderOptionsCommand.cs" />
<Compile Include="Commands\OpenOptionsScreenCommand.cs" />
+ <Compile Include="Commands\CloseOverlayPanelCommand.cs" />
+ <Compile Include="Commands\OpenOverlayPanelCommand.cs" />
<Compile Include="Commands\ProcessShortcutCommand.cs" />
<Compile Include="Commands\SourceMenuCommand.cs" />
<Compile Include="Commands\AdvancedEncoderOptionsCommand.cs" />
@@ -175,6 +177,7 @@ <Compile Include="Controls\SourceSelection.xaml.cs">
<DependentUpon>SourceSelection.xaml</DependentUpon>
</Compile>
+ <Compile Include="ViewModels\Interfaces\IOverlayPanel.cs" />
<Compile Include="ViewModels\Interfaces\IStaticPreviewViewModel.cs" />
<Compile Include="ViewModels\StaticPreviewViewModel.cs" />
<Compile Include="Views\CountdownAlertView.xaml.cs">
diff --git a/win/CS/HandBrakeWPF/Model/Audio/AudioBehaviourModes.cs b/win/CS/HandBrakeWPF/Model/Audio/AudioBehaviourModes.cs index 811ba154b..11f19f2e4 100644 --- a/win/CS/HandBrakeWPF/Model/Audio/AudioBehaviourModes.cs +++ b/win/CS/HandBrakeWPF/Model/Audio/AudioBehaviourModes.cs @@ -16,7 +16,7 @@ namespace HandBrakeWPF.Model.Audio /// </summary>
public enum AudioBehaviourModes
{
- [Display(Name = "None")]
+ [Display(Name = "No Audio")]
None = 0,
[Display(Name = "First Matching Selected Language")]
diff --git a/win/CS/HandBrakeWPF/Presets.dat b/win/CS/HandBrakeWPF/Presets.dat index 9ecb25fa9..00e6fc5b7 100644 --- a/win/CS/HandBrakeWPF/Presets.dat +++ b/win/CS/HandBrakeWPF/Presets.dat @@ -117,6 +117,9 @@ "AudioAllowDTSHDPass": true,
"AudioAllowDTSPass": true,
"AudioAllowMP3Pass": true,
+ "AudioAllowTrueHDPass": true,
+ "AudioAllowFlacPass": true,
+ "AudioAllowEAC3Pass": true,
"AudioEncoderFallback": 4
},
"SubtitleTracks": [],
@@ -146,8 +149,11 @@ "PictureSettingsDesc": "Anamorphic: Loose, Width: \r\nCrop Top: 0, Botton: 0, Left: 0, Right: 0"
},
"UsePictureFilters": true,
- "Version": "svn5311 (Nightly Build)",
- "AudioTrackBehaviours": null,
+ "Version": "svn6809 (Nightly Build)",
+ "AudioTrackBehaviours": {
+ "SelectedBehaviour": 1,
+ "SelectedLangauges": []
+ },
"SubtitleTrackBehaviours": null
},
{
@@ -241,6 +247,9 @@ "AudioAllowDTSHDPass": true,
"AudioAllowDTSPass": true,
"AudioAllowMP3Pass": true,
+ "AudioAllowTrueHDPass": true,
+ "AudioAllowFlacPass": true,
+ "AudioAllowEAC3Pass": true,
"AudioEncoderFallback": 4
},
"SubtitleTracks": [],
@@ -270,8 +279,11 @@ "PictureSettingsDesc": "Resolution: x\r\nCrop Top: 0, Botton: 0, Left: 0, Right: 0"
},
"UsePictureFilters": true,
- "Version": "svn5311 (Nightly Build)",
- "AudioTrackBehaviours": null,
+ "Version": "svn6809 (Nightly Build)",
+ "AudioTrackBehaviours": {
+ "SelectedBehaviour": 1,
+ "SelectedLangauges": []
+ },
"SubtitleTrackBehaviours": null
},
{
@@ -365,6 +377,9 @@ "AudioAllowDTSHDPass": true,
"AudioAllowDTSPass": true,
"AudioAllowMP3Pass": true,
+ "AudioAllowTrueHDPass": true,
+ "AudioAllowFlacPass": true,
+ "AudioAllowEAC3Pass": true,
"AudioEncoderFallback": 4
},
"SubtitleTracks": [],
@@ -394,8 +409,11 @@ "PictureSettingsDesc": "Anamorphic: Loose, Width: \r\nCrop Top: 0, Botton: 0, Left: 0, Right: 0"
},
"UsePictureFilters": true,
- "Version": "svn5311 (Nightly Build)",
- "AudioTrackBehaviours": null,
+ "Version": "svn6809 (Nightly Build)",
+ "AudioTrackBehaviours": {
+ "SelectedBehaviour": 1,
+ "SelectedLangauges": []
+ },
"SubtitleTrackBehaviours": null
},
{
@@ -489,6 +507,9 @@ "AudioAllowDTSHDPass": true,
"AudioAllowDTSPass": true,
"AudioAllowMP3Pass": true,
+ "AudioAllowTrueHDPass": true,
+ "AudioAllowFlacPass": true,
+ "AudioAllowEAC3Pass": true,
"AudioEncoderFallback": 4
},
"SubtitleTracks": [],
@@ -518,8 +539,11 @@ "PictureSettingsDesc": "Anamorphic: Loose, Width: \r\nCrop Top: 0, Botton: 0, Left: 0, Right: 0"
},
"UsePictureFilters": true,
- "Version": "svn5311 (Nightly Build)",
- "AudioTrackBehaviours": null,
+ "Version": "svn6809 (Nightly Build)",
+ "AudioTrackBehaviours": {
+ "SelectedBehaviour": 1,
+ "SelectedLangauges": []
+ },
"SubtitleTrackBehaviours": null
},
{
@@ -640,6 +664,9 @@ "AudioAllowDTSHDPass": true,
"AudioAllowDTSPass": true,
"AudioAllowMP3Pass": true,
+ "AudioAllowTrueHDPass": true,
+ "AudioAllowFlacPass": true,
+ "AudioAllowEAC3Pass": true,
"AudioEncoderFallback": 4
},
"SubtitleTracks": [],
@@ -669,8 +696,11 @@ "PictureSettingsDesc": "Anamorphic: Loose, Width: \r\nCrop Top: 0, Botton: 0, Left: 0, Right: 0"
},
"UsePictureFilters": true,
- "Version": "svn5311 (Nightly Build)",
- "AudioTrackBehaviours": null,
+ "Version": "svn6809 (Nightly Build)",
+ "AudioTrackBehaviours": {
+ "SelectedBehaviour": 1,
+ "SelectedLangauges": []
+ },
"SubtitleTrackBehaviours": null
},
{
@@ -791,6 +821,9 @@ "AudioAllowDTSHDPass": true,
"AudioAllowDTSPass": true,
"AudioAllowMP3Pass": true,
+ "AudioAllowTrueHDPass": true,
+ "AudioAllowFlacPass": true,
+ "AudioAllowEAC3Pass": true,
"AudioEncoderFallback": 4
},
"SubtitleTracks": [],
@@ -820,8 +853,11 @@ "PictureSettingsDesc": "Anamorphic: Loose, Width: \r\nCrop Top: 0, Botton: 0, Left: 0, Right: 0"
},
"UsePictureFilters": true,
- "Version": "svn5311 (Nightly Build)",
- "AudioTrackBehaviours": null,
+ "Version": "svn6809 (Nightly Build)",
+ "AudioTrackBehaviours": {
+ "SelectedBehaviour": 1,
+ "SelectedLangauges": []
+ },
"SubtitleTrackBehaviours": null
},
{
@@ -942,6 +978,9 @@ "AudioAllowDTSHDPass": true,
"AudioAllowDTSPass": true,
"AudioAllowMP3Pass": true,
+ "AudioAllowTrueHDPass": true,
+ "AudioAllowFlacPass": true,
+ "AudioAllowEAC3Pass": true,
"AudioEncoderFallback": 4
},
"SubtitleTracks": [],
@@ -971,8 +1010,11 @@ "PictureSettingsDesc": "Anamorphic: Loose, Width: \r\nCrop Top: 0, Botton: 0, Left: 0, Right: 0"
},
"UsePictureFilters": true,
- "Version": "svn5311 (Nightly Build)",
- "AudioTrackBehaviours": null,
+ "Version": "svn6809 (Nightly Build)",
+ "AudioTrackBehaviours": {
+ "SelectedBehaviour": 1,
+ "SelectedLangauges": []
+ },
"SubtitleTrackBehaviours": null
},
{
@@ -1066,6 +1108,9 @@ "AudioAllowDTSHDPass": true,
"AudioAllowDTSPass": true,
"AudioAllowMP3Pass": true,
+ "AudioAllowTrueHDPass": true,
+ "AudioAllowFlacPass": true,
+ "AudioAllowEAC3Pass": true,
"AudioEncoderFallback": 4
},
"SubtitleTracks": [],
@@ -1095,8 +1140,11 @@ "PictureSettingsDesc": "Anamorphic: Loose, Width: \r\nCrop Top: 0, Botton: 0, Left: 0, Right: 0"
},
"UsePictureFilters": true,
- "Version": "svn5311 (Nightly Build)",
- "AudioTrackBehaviours": null,
+ "Version": "svn6809 (Nightly Build)",
+ "AudioTrackBehaviours": {
+ "SelectedBehaviour": 1,
+ "SelectedLangauges": []
+ },
"SubtitleTrackBehaviours": null
},
{
@@ -1190,6 +1238,9 @@ "AudioAllowDTSHDPass": true,
"AudioAllowDTSPass": true,
"AudioAllowMP3Pass": true,
+ "AudioAllowTrueHDPass": true,
+ "AudioAllowFlacPass": true,
+ "AudioAllowEAC3Pass": true,
"AudioEncoderFallback": 4
},
"SubtitleTracks": [],
@@ -1219,8 +1270,11 @@ "PictureSettingsDesc": "Anamorphic: Loose, Width: \r\nCrop Top: 0, Botton: 0, Left: 0, Right: 0"
},
"UsePictureFilters": true,
- "Version": "svn5311 (Nightly Build)",
- "AudioTrackBehaviours": null,
+ "Version": "svn6809 (Nightly Build)",
+ "AudioTrackBehaviours": {
+ "SelectedBehaviour": 1,
+ "SelectedLangauges": []
+ },
"SubtitleTrackBehaviours": null
},
{
@@ -1314,6 +1368,9 @@ "AudioAllowDTSHDPass": true,
"AudioAllowDTSPass": true,
"AudioAllowMP3Pass": true,
+ "AudioAllowTrueHDPass": true,
+ "AudioAllowFlacPass": true,
+ "AudioAllowEAC3Pass": true,
"AudioEncoderFallback": 4
},
"SubtitleTracks": [],
@@ -1343,8 +1400,11 @@ "PictureSettingsDesc": "Resolution: x\r\nCrop Top: 0, Botton: 0, Left: 0, Right: 0"
},
"UsePictureFilters": true,
- "Version": "svn5311 (Nightly Build)",
- "AudioTrackBehaviours": null,
+ "Version": "svn6809 (Nightly Build)",
+ "AudioTrackBehaviours": {
+ "SelectedBehaviour": 1,
+ "SelectedLangauges": []
+ },
"SubtitleTrackBehaviours": null
},
{
@@ -1438,6 +1498,9 @@ "AudioAllowDTSHDPass": true,
"AudioAllowDTSPass": true,
"AudioAllowMP3Pass": true,
+ "AudioAllowTrueHDPass": true,
+ "AudioAllowFlacPass": true,
+ "AudioAllowEAC3Pass": true,
"AudioEncoderFallback": 4
},
"SubtitleTracks": [],
@@ -1467,8 +1530,11 @@ "PictureSettingsDesc": "Anamorphic: Loose, Width: \r\nCrop Top: 0, Botton: 0, Left: 0, Right: 0"
},
"UsePictureFilters": true,
- "Version": "svn5311 (Nightly Build)",
- "AudioTrackBehaviours": null,
+ "Version": "svn6809 (Nightly Build)",
+ "AudioTrackBehaviours": {
+ "SelectedBehaviour": 1,
+ "SelectedLangauges": []
+ },
"SubtitleTrackBehaviours": null
},
{
@@ -1589,6 +1655,9 @@ "AudioAllowDTSHDPass": true,
"AudioAllowDTSPass": true,
"AudioAllowMP3Pass": true,
+ "AudioAllowTrueHDPass": true,
+ "AudioAllowFlacPass": true,
+ "AudioAllowEAC3Pass": true,
"AudioEncoderFallback": 4
},
"SubtitleTracks": [],
@@ -1618,8 +1687,11 @@ "PictureSettingsDesc": "Anamorphic: Loose, Width: \r\nCrop Top: 0, Botton: 0, Left: 0, Right: 0"
},
"UsePictureFilters": true,
- "Version": "svn5311 (Nightly Build)",
- "AudioTrackBehaviours": null,
+ "Version": "svn6809 (Nightly Build)",
+ "AudioTrackBehaviours": {
+ "SelectedBehaviour": 1,
+ "SelectedLangauges": []
+ },
"SubtitleTrackBehaviours": null
}
]
diff --git a/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs b/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs index c20af5ddc..c0355a3bf 100644 --- a/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs +++ b/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs @@ -15,8 +15,6 @@ namespace HandBrakeWPF.Services.Presets using System.IO;
using System.Linq;
using System.Reflection;
- using System.Text;
- using System.Text.RegularExpressions;
using System.Windows;
using System.Xml.Serialization;
@@ -24,6 +22,7 @@ namespace HandBrakeWPF.Services.Presets using HandBrake.ApplicationServices.Services.Encode.Model.Models;
using HandBrake.ApplicationServices.Utilities;
+ using HandBrakeWPF.Model.Audio;
using HandBrakeWPF.Services.Interfaces;
using HandBrakeWPF.Services.Presets.Interfaces;
using HandBrakeWPF.Services.Presets.Model;
@@ -37,7 +36,7 @@ namespace HandBrakeWPF.Services.Presets {
#region Private Variables
- private static readonly int CurrentPresetVersion = 2;
+ private static readonly int CurrentPresetVersion = 3;
/// <summary>
/// User Preset Default Catgory Name
@@ -292,7 +291,9 @@ namespace HandBrakeWPF.Services.Presets preset.Version = VersionHelper.GetVersion();
preset.UsePictureFilters = true;
preset.IsBuildIn = true; // Older versions did not have this flag so explicitly make sure it is set.
-
+ preset.AudioTrackBehaviours = new AudioBehaviours();
+ preset.AudioTrackBehaviours.SelectedBehaviour = AudioBehaviourModes.FirstMatch;
+
if (preset.Name == "iPod")
{
preset.Task.KeepDisplayAspect = true;
@@ -509,9 +510,9 @@ namespace HandBrakeWPF.Services.Presets string fileName = RecoverFromCorruptedPresetFile(this.userPresetFile);
this.errorService.ShowMessageBox(
"HandBrake is unable to load your user presets because they are from an older version of HandBrake. Your old presets file has been renamed so that it doesn't get loaded on next launch."
- + Environment.NewLine + Environment.NewLine + "Archived File: " + fileName,
- "Unable to load user presets.",
- MessageBoxButton.OK,
+ + Environment.NewLine + Environment.NewLine + "Archived File: " + fileName,
+ "Unable to load user presets.",
+ MessageBoxButton.OK,
MessageBoxImage.Exclamation);
return;
}
diff --git a/win/CS/HandBrakeWPF/Startup/CastleBootstrapper.cs b/win/CS/HandBrakeWPF/Startup/CastleBootstrapper.cs index 406bbdbe7..f09696134 100644 --- a/win/CS/HandBrakeWPF/Startup/CastleBootstrapper.cs +++ b/win/CS/HandBrakeWPF/Startup/CastleBootstrapper.cs @@ -20,7 +20,6 @@ namespace HandBrakeWPF.Startup using Castle.MicroKernel.Registration;
using Castle.Windsor;
- using HandBrake.ApplicationServices;
using HandBrake.ApplicationServices.Services.Encode;
using HandBrake.ApplicationServices.Services.Encode.Interfaces;
using HandBrake.ApplicationServices.Services.Scan;
@@ -99,6 +98,8 @@ namespace HandBrakeWPF.Startup this.windsorContainer.Register(Component.For<ISubtitlesViewModel>().ImplementedBy<SubtitlesViewModel>().LifeStyle.Is(LifestyleType.Singleton));
this.windsorContainer.Register(Component.For<IFiltersViewModel>().ImplementedBy<FiltersViewModel>().LifeStyle.Is(LifestyleType.Singleton));
this.windsorContainer.Register(Component.For<IVideoViewModel>().ImplementedBy<VideoViewModel>().LifeStyle.Is(LifestyleType.Singleton));
+
+ // Overlay Panels
}
/// <summary>
diff --git a/win/CS/HandBrakeWPF/ViewModels/AudioDefaultsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AudioDefaultsViewModel.cs new file mode 100644 index 000000000..18fee1926 --- /dev/null +++ b/win/CS/HandBrakeWPF/ViewModels/AudioDefaultsViewModel.cs @@ -0,0 +1,237 @@ +// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="AudioDefaultsViewModel.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 Defaults View Model
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.ViewModels
+{
+ using System.Collections.Generic;
+ using System.ComponentModel;
+ using System.Linq;
+
+ using Caliburn.Micro;
+
+ using HandBrake.ApplicationServices.Interop.Model.Encoding;
+ using HandBrake.ApplicationServices.Utilities;
+
+ using HandBrakeWPF.Commands;
+ using HandBrakeWPF.Model.Audio;
+ using HandBrakeWPF.Services.Interfaces;
+ using HandBrakeWPF.Services.Presets.Model;
+ using HandBrakeWPF.ViewModels.Interfaces;
+
+ /// <summary>
+ /// The Audio View Model
+ /// </summary>
+ public class AudioDefaultsViewModel : ViewModelBase, IAudioDefaultsViewModel
+ {
+ /// <summary>
+ /// The available languages.
+ /// </summary>
+ private BindingList<string> availableLanguages;
+
+ /// <summary>
+ /// The audio behaviours.
+ /// </summary>
+ private AudioBehaviours audioBehaviours;
+
+ #region Constructors and Destructors
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="AudioDefaultsViewModel"/> class.
+ /// </summary>
+ /// <param name="windowManager">
+ /// The window manager.
+ /// </param>
+ /// <param name="userSettingService">
+ /// The user Setting Service.
+ /// </param>
+ public AudioDefaultsViewModel(IWindowManager windowManager, IUserSettingService userSettingService)
+ {
+ this.AudioEncoders = EnumHelper<AudioEncoder>.GetEnumList();
+
+ this.AudioBehaviours = new AudioBehaviours();
+ this.SelectedAvailableToMove = new BindingList<string>();
+ this.SelectedLangaugesToMove = new BindingList<string>();
+ this.AvailableLanguages = new BindingList<string>();
+ this.SetupLanguages(null);
+ }
+
+ #endregion
+
+ #region Properties
+
+ /// <summary>
+ /// Gets or sets the audio behaviours.
+ /// </summary>
+ public AudioBehaviours AudioBehaviours
+ {
+ get
+ {
+ return this.audioBehaviours;
+ }
+ set
+ {
+ if (Equals(value, this.audioBehaviours))
+ {
+ return;
+ }
+ this.audioBehaviours = value;
+ this.NotifyOfPropertyChange(() => this.AudioBehaviours);
+ }
+ }
+
+ /// <summary>
+ /// Gets the audio behaviour modes.
+ /// </summary>
+ public BindingList<AudioBehaviourModes> AudioBehaviourModeList
+ {
+ get
+ {
+ return new BindingList<AudioBehaviourModes>(EnumHelper<AudioBehaviourModes>.GetEnumList().ToList());
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets AudioEncoders.
+ /// </summary>
+ public IEnumerable<AudioEncoder> AudioEncoders { get; set; }
+
+
+ /// <summary>
+ /// Gets or sets AvailableLanguages.
+ /// </summary>
+ public BindingList<string> AvailableLanguages
+ {
+ get
+ {
+ return this.availableLanguages;
+ }
+
+ set
+ {
+ this.availableLanguages = value;
+ this.NotifyOfPropertyChange("AvailableLanguages");
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets SelectedLangauges.
+ /// </summary>
+ public BindingList<string> SelectedAvailableToMove { get; set; }
+
+ /// <summary>
+ /// Gets or sets SelectedLangauges.
+ /// </summary>
+ public BindingList<string> SelectedLangaugesToMove { get; set; }
+
+ #endregion
+
+ #region Public Methods
+
+ /// <summary>
+ /// Audio List Move Left
+ /// </summary>
+ public void LanguageMoveRight()
+ {
+ if (this.SelectedAvailableToMove.Count > 0)
+ {
+ List<string> copiedList = SelectedAvailableToMove.ToList();
+ foreach (string item in copiedList)
+ {
+ this.AvailableLanguages.Remove(item);
+ this.AudioBehaviours.SelectedLangauges.Add(item);
+ }
+
+ this.AvailableLanguages = new BindingList<string>(this.AvailableLanguages.OrderBy(o => o).ToList());
+ }
+ }
+
+ /// <summary>
+ /// Audio List Move Right
+ /// </summary>
+ public void LanguageMoveLeft()
+ {
+ if (this.SelectedLangaugesToMove.Count > 0)
+ {
+ List<string> copiedList = SelectedLangaugesToMove.ToList();
+ foreach (string item in copiedList)
+ {
+ this.AudioBehaviours.SelectedLangauges.Remove(item);
+ this.AvailableLanguages.Add(item);
+ }
+ }
+
+ this.AvailableLanguages = new BindingList<string>(this.AvailableLanguages.OrderBy(o => o).ToList());
+ }
+
+ /// <summary>
+ /// Audio List Clear all selected languages
+ /// </summary>
+ public void LanguageClearAll()
+ {
+ foreach (string item in this.AudioBehaviours.SelectedLangauges)
+ {
+ this.AvailableLanguages.Add(item);
+ }
+ this.AvailableLanguages = new BindingList<string>(this.AvailableLanguages.OrderBy(o => o).ToList());
+
+ this.AudioBehaviours.SelectedLangauges.Clear();
+ }
+
+ /// <summary>
+ /// The close.
+ /// </summary>
+ public void Close()
+ {
+ CloseOverlayPanelCommand command = new CloseOverlayPanelCommand();
+ command.Execute(null);
+ }
+
+ #endregion
+
+ #region Methods
+
+ /// <summary>
+ /// The setup languages.
+ /// </summary>
+ /// <param name="preset">
+ /// The preset.
+ /// </param>
+ private void SetupLanguages(Preset preset)
+ {
+ // Step 1, Set the behaviour mode
+ this.AudioBehaviours.SelectedBehaviour = AudioBehaviourModes.None;
+ this.AudioBehaviours.SelectedLangauges.Clear();
+
+ // Step 2, Get all the languages
+ IDictionary<string, string> langList = LanguageUtilities.MapLanguages();
+ langList = (from entry in langList orderby entry.Key ascending select entry).ToDictionary(pair => pair.Key, pair => pair.Value);
+
+ // Step 3, Setup Available Languages
+ this.AvailableLanguages.Clear();
+ foreach (string item in langList.Keys)
+ {
+ this.AvailableLanguages.Add(item);
+ }
+
+ // Step 4, Set the Selected Languages
+ if (preset != null && preset.AudioTrackBehaviours != null)
+ {
+ this.AudioBehaviours.SelectedBehaviour = preset.AudioTrackBehaviours.SelectedBehaviour;
+
+ foreach (string selectedItem in preset.AudioTrackBehaviours.SelectedLangauges)
+ {
+ this.AvailableLanguages.Remove(selectedItem);
+ this.AudioBehaviours.SelectedLangauges.Add(selectedItem);
+ }
+ }
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file diff --git a/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs index 699137169..a7c905f67 100644 --- a/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs @@ -23,6 +23,7 @@ namespace HandBrakeWPF.ViewModels using HandBrake.ApplicationServices.Utilities;
using HandBrake.ApplicationServices.Interop.Model.Encoding;
+ using HandBrakeWPF.Commands;
using HandBrakeWPF.Model.Audio;
using HandBrakeWPF.Services.Interfaces;
using HandBrakeWPF.Services.Presets.Model;
@@ -272,6 +273,14 @@ namespace HandBrakeWPF.ViewModels }
/// <summary>
+ /// Reload the audio tracks based on the defaults.
+ /// </summary>
+ public void ReloadDefaults()
+ {
+ this.SetupTracks();
+ }
+
+ /// <summary>
/// Trigger a Notify Property Changed on the Task to force various UI elements to update.
/// </summary>
public void RefreshTask()
@@ -300,6 +309,8 @@ namespace HandBrakeWPF.ViewModels /// </summary>
public void ShowAudioDefaults()
{
+ // OpenOverlayPanelCommand command = new OpenOverlayPanelCommand();
+ // command.Execute(new AudioDefaultsViewModel(this.WindowManager, this.UserSettingService));
this.ShowAudioDefaultsPanel = !this.ShowAudioDefaultsPanel;
}
@@ -507,6 +518,9 @@ namespace HandBrakeWPF.ViewModels // Step 4, Handle the default selection behaviour.
switch (this.AudioBehaviours.SelectedBehaviour)
{
+ case AudioBehaviourModes.None:
+ this.Task.AudioTracks.Clear();
+ break;
case AudioBehaviourModes.FirstMatch: // Adding all remaining audio tracks
this.AddFirstForSelectedLanguages();
break;
diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IAudioDefaultsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IAudioDefaultsViewModel.cs new file mode 100644 index 000000000..db2ce4d26 --- /dev/null +++ b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IAudioDefaultsViewModel.cs @@ -0,0 +1,24 @@ +// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="IAudioDefaultsViewModel.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 IAudioViewModel type.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.ViewModels.Interfaces
+{
+ using HandBrakeWPF.Model.Audio;
+
+ /// <summary>
+ /// The Audio View Model Interface
+ /// </summary>
+ public interface IAudioDefaultsViewModel : IOverlayPanel
+ {
+ /// <summary>
+ /// Gets the audio behaviours.
+ /// </summary>
+ AudioBehaviours AudioBehaviours { get; }
+ }
+}
diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IOverlayPanel.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IOverlayPanel.cs new file mode 100644 index 000000000..c713ce283 --- /dev/null +++ b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IOverlayPanel.cs @@ -0,0 +1,18 @@ +// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="IOverlayPanel.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 OverlayPanel interface.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.ViewModels.Interfaces
+{
+ /// <summary>
+ /// The OverlayPanel interface.
+ /// </summary>
+ public interface IOverlayPanel
+ {
+ }
+}
diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IShellViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IShellViewModel.cs index 6c537ef66..0b156109a 100644 --- a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IShellViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IShellViewModel.cs @@ -17,6 +17,19 @@ namespace HandBrakeWPF.ViewModels.Interfaces public interface IShellViewModel
{
/// <summary>
+ /// The show overlay.
+ /// </summary>
+ /// <param name="panel">
+ /// The panel.
+ /// </param>
+ void ShowOverlay(IOverlayPanel panel);
+
+ /// <summary>
+ /// The hide overlay.
+ /// </summary>
+ void HideOverlay();
+
+ /// <summary>
/// Change the page displayed on this window.
/// </summary>
/// <param name="window">
diff --git a/win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs index c85c707bd..4d505b83d 100644 --- a/win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs @@ -42,6 +42,10 @@ namespace HandBrakeWPF.ViewModels /// </summary>
private bool showOptions;
+ private bool showOverlayPanel;
+
+ private bool isMainPanelEnabled;
+
#endregion
/// <summary>
@@ -55,6 +59,29 @@ namespace HandBrakeWPF.ViewModels this.errorService = errorService;
this.showMainWindow = true;
this.showOptions = false;
+ this.IsMainPanelEnabled = true;
+ }
+
+ /// <summary>
+ /// The show overlay.
+ /// </summary>
+ /// <param name="panel">
+ /// The panel.
+ /// </param>
+ public void ShowOverlay(IOverlayPanel panel)
+ {
+ this.OverlayPanelViewModel = panel;
+ this.NotifyOfPropertyChange(() => this.OverlayPanelViewModel);
+ this.ShowOverlayPanel = true;
+ }
+
+ /// <summary>
+ /// The hide overlay.
+ /// </summary>
+ public void HideOverlay()
+ {
+ this.ShowOverlayPanel = false;
+ this.OverlayPanelViewModel = null;
}
/// <summary>
@@ -95,6 +122,11 @@ namespace HandBrakeWPF.ViewModels public IOptionsViewModel OptionsViewModel { get; set; }
/// <summary>
+ /// Gets or sets the overlay panel view model.
+ /// </summary>
+ public IOverlayPanel OverlayPanelViewModel { get; set; }
+
+ /// <summary>
/// Gets or sets a value indicating whether ShowMainWindow.
/// </summary>
public bool ShowMainWindow
@@ -127,6 +159,47 @@ namespace HandBrakeWPF.ViewModels }
/// <summary>
+ /// Gets or sets a value indicating whether is main panel enabled.
+ /// </summary>
+ public bool IsMainPanelEnabled
+ {
+ get
+ {
+ return this.isMainPanelEnabled;
+ }
+ set
+ {
+ if (value.Equals(this.isMainPanelEnabled))
+ {
+ return;
+ }
+ this.isMainPanelEnabled = value;
+ this.NotifyOfPropertyChange(() => this.IsMainPanelEnabled);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether show overlay panel.
+ /// </summary>
+ public bool ShowOverlayPanel
+ {
+ get
+ {
+ return this.showOverlayPanel;
+ }
+ set
+ {
+ if (value.Equals(this.showOverlayPanel))
+ {
+ return;
+ }
+ this.showOverlayPanel = value;
+ this.IsMainPanelEnabled = !value;
+ this.NotifyOfPropertyChange(() => this.ShowOverlayPanel);
+ }
+ }
+
+ /// <summary>
/// Gets WindowTitle.
/// </summary>
public string WindowTitle
diff --git a/win/CS/HandBrakeWPF/Views/AudioDefaultsView.xaml b/win/CS/HandBrakeWPF/Views/AudioDefaultsView.xaml new file mode 100644 index 000000000..876485d26 --- /dev/null +++ b/win/CS/HandBrakeWPF/Views/AudioDefaultsView.xaml @@ -0,0 +1,163 @@ +<UserControl x:Class="HandBrakeWPF.Views.AudioDefaultsView"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:Audio="clr-namespace:HandBrakeWPF.Converters.Audio"
+ xmlns:cal="http://www.caliburnproject.org"
+ xmlns:Conveters="clr-namespace:HandBrakeWPF.Converters"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:dd="clr-namespace:GongSolutions.Wpf.DragDrop;assembly=GongSolutions.Wpf.DragDrop"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:helpers="clr-namespace:HandBrakeWPF.Helpers"
+ d:DesignHeight="400"
+ d:DesignWidth="720"
+ Width="600"
+ Height="360"
+ mc:Ignorable="d"
+ Background="{Binding Path=Background, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}"
+ BorderThickness="1" BorderBrush="DarkGray"
+ x:Name="audioTab">
+
+ <UserControl.Resources>
+ <Conveters:BooleanToVisibilityConverter x:Key="boolToVisConverter" />
+ <Audio:AudioEncoderConverter x:Key="audioEncoderConverter" />
+ <Audio:AudioBehaviourConverter x:Key="audioBehaviourConverter" />
+ </UserControl.Resources>
+
+ <Grid >
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="*" />
+ <RowDefinition Height="Auto" />
+ </Grid.RowDefinitions>
+
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="*" />
+ <ColumnDefinition Width="Auto" />
+ </Grid.ColumnDefinitions>
+
+
+ <!-- Row 0 -->
+ <TextBlock Grid.Row="0"
+ Margin="10,5,0,0"
+ FontWeight="Bold"
+ VerticalAlignment="Top"
+ Text="AudioDefaults" />
+
+ <!-- Row 2 -->
+ <StackPanel Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Margin="10,0,10,0"
+ Visibility="{Binding ShowAudioDefaultsPanel, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}">
+
+ <Grid Margin="5,0,0,0" >
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ </Grid.RowDefinitions>
+
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="*" />
+ </Grid.ColumnDefinitions>
+
+ <!-- Audio -->
+ <TextBlock Text="Track Selection Behaviour:" Grid.Column="0" Grid.Row="0" Margin="0,0,5,0" HorizontalAlignment="Left" VerticalAlignment="Center" />
+ <ComboBox Name="autoAudioMode" Grid.Column="1" Grid.Row="0" HorizontalAlignment="Left"
+ ItemsSource="{Binding AudioBehaviourModeList, Converter={StaticResource audioBehaviourConverter}}"
+ SelectedItem="{Binding AudioBehaviours.SelectedBehaviour, Converter={StaticResource audioBehaviourConverter}}" Width="210" Margin="0,0,5,0" />
+ </Grid>
+
+ <TextBlock Text="Choose Languages:" Margin="5,10,0,0" />
+
+ <Grid Margin="20,5,0,0">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="*" />
+ </Grid.ColumnDefinitions>
+
+ <StackPanel Orientation="Horizontal">
+ <Grid>
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="*" />
+ <ColumnDefinition Width="*" />
+ <ColumnDefinition Width="*" />
+ </Grid.ColumnDefinitions>
+
+ <StackPanel Orientation="Vertical" Grid.Column="0">
+ <TextBlock Text="Available Languages:" Margin="0,0,0,5"/>
+ <ListBox Name="availableLanguages" ItemsSource="{Binding AvailableLanguages}"
+ helpers:ListBoxHelper.SelectedItems="{Binding SelectedAvailableToMove}"
+ SelectionMode="Extended" Width="140" Height="120" />
+ </StackPanel>
+
+ <DockPanel Grid.Column="1" Margin="10,0,10,0">
+ <StackPanel Orientation="Vertical" VerticalAlignment="Center">
+ <Button Content="Move Right" VerticalAlignment="Center" Margin="0,0,0,5" cal:Message.Attach="[Event Click] = [Action LanguageMoveRight]" MaxWidth="90" />
+ <Button Content="Move Left" VerticalAlignment="Center" Margin="0,0,0,5" cal:Message.Attach="[Event Click] = [Action LanguageMoveLeft]" MaxWidth="90" />
+ <Button Content="Clear" VerticalAlignment="Center" Margin="0,0,0,5" cal:Message.Attach="[Event Click] = [Action LanguageClearAll]" Width="80"/>
+ </StackPanel>
+ </DockPanel>
+
+ <StackPanel Orientation="Vertical" Grid.Column="2">
+ <TextBlock Text="Chosen Languages:" Margin="0,0,0,5"/>
+ <ListBox Name="selectedLangauges" ItemsSource="{Binding AudioBehaviours.SelectedLangauges}"
+ helpers:ListBoxHelper.SelectedItems="{Binding SelectedLangaugesToMove}"
+ SelectionMode="Extended" Width="140" Height="120"
+ dd:DragDrop.DropHandler="{Binding}"
+ dd:DragDrop.IsDragSource="True"
+ dd:DragDrop.IsDropTarget="True"/>
+ </StackPanel>
+ </Grid>
+ </StackPanel>
+ </Grid>
+
+ <TextBlock Text="'Auto Passthru' Behaviour:" FontWeight="Bold" Margin="0,10,0,5" />
+ <StackPanel Margin="10,5,0,0"
+ Orientation="Vertical">
+ <TextBlock Margin="5,0,5,0" Text="When 'Auto Passthru' is selected as the audio codec." VerticalAlignment="Center" />
+ <TextBlock Margin="5,0,5,0" Text="Allow passthru of:" VerticalAlignment="Center" />
+ </StackPanel>
+ <StackPanel Margin="15,5,0,0"
+ Orientation="Horizontal">
+ <CheckBox Margin="0,0,5,0"
+ Content="MP3" VerticalAlignment="Center"
+ IsChecked="{Binding Task.AllowedPassthruOptions.AudioAllowMP3Pass}" />
+ <CheckBox Margin="0,0,5,0"
+ Content="AAC" VerticalAlignment="Center"
+ IsChecked="{Binding Task.AllowedPassthruOptions.AudioAllowAACPass}" />
+ <CheckBox Margin="0,0,5,0"
+ Content="AC3" VerticalAlignment="Center"
+ IsChecked="{Binding Task.AllowedPassthruOptions.AudioAllowAC3Pass}" />
+ <CheckBox Margin="0,0,5,0"
+ Content="DTS" VerticalAlignment="Center"
+ IsChecked="{Binding Task.AllowedPassthruOptions.AudioAllowDTSPass}" />
+ <CheckBox Margin="0,0,5,0"
+ Content="DTSHD" VerticalAlignment="Center"
+ IsChecked="{Binding Task.AllowedPassthruOptions.AudioAllowDTSHDPass}" />
+
+ <TextBlock Margin="15,0,5,0" Text="Otherwise use fallback encoder:" />
+
+ <ComboBox VerticalAlignment="Center" Width="120" Height="22" Margin="10,0,5,0">
+ <ComboBox.SelectedItem>
+ <MultiBinding Converter="{StaticResource audioEncoderConverter}">
+ <Binding Path="Task.AllowedPassthruOptions.AudioEncoderFallback" />
+ </MultiBinding>
+ </ComboBox.SelectedItem>
+ <ComboBox.ItemsSource>
+ <MultiBinding Converter="{StaticResource audioEncoderConverter}" ConverterParameter="True">
+ <Binding Path="DataContext.AudioEncoders" RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type UserControl}}" />
+ <Binding Path="DataContext.Task" RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type UserControl}}" />
+ </MultiBinding>
+ </ComboBox.ItemsSource>
+ </ComboBox>
+
+ </StackPanel>
+
+ </StackPanel>
+
+ <Button Content="Done" cal:Message.Attach="[Event Click] = [Action Close]" Grid.Row="3" HorizontalAlignment="Center"
+ Margin="0,5,0,5" Padding="8,2" />
+ </Grid>
+</UserControl>
diff --git a/win/CS/HandBrakeWPF/Views/AudioView.xaml b/win/CS/HandBrakeWPF/Views/AudioView.xaml index 2c71d0bb1..ce9ebd1e0 100644 --- a/win/CS/HandBrakeWPF/Views/AudioView.xaml +++ b/win/CS/HandBrakeWPF/Views/AudioView.xaml @@ -11,8 +11,8 @@ xmlns:splitButton="clr-namespace:HandBrakeWPF.Controls.SplitButton"
xmlns:controls="clr-namespace:HandBrakeWPF.Controls"
xmlns:helpers="clr-namespace:HandBrakeWPF.Helpers"
- d:DesignHeight="350"
- d:DesignWidth="616"
+ d:DesignHeight="400"
+ d:DesignWidth="750"
mc:Ignorable="d"
x:Name="audioTab">
@@ -81,6 +81,11 @@ cal:Message.Attach="[Event Click] = [Action ShowAudioDefaults]"
Content="{Binding SwitchDisplayTitle}" />
+ <Button MinWidth="65"
+ Margin="0,0,10,0"
+ cal:Message.Attach="[Event Click] = [Action ReloadDefaults]"
+ Content="Reload Defaults" />
+
</StackPanel>
</Grid>
@@ -362,12 +367,21 @@ Content="AC3" VerticalAlignment="Center"
IsChecked="{Binding Task.AllowedPassthruOptions.AudioAllowAC3Pass}" />
<CheckBox Margin="0,0,5,0"
+ Content="E-AC3" VerticalAlignment="Center"
+ IsChecked="{Binding Task.AllowedPassthruOptions.AudioAllowEAC3Pass}" />
+ <CheckBox Margin="0,0,5,0"
Content="DTS" VerticalAlignment="Center"
IsChecked="{Binding Task.AllowedPassthruOptions.AudioAllowDTSPass}" />
<CheckBox Margin="0,0,5,0"
Content="DTSHD" VerticalAlignment="Center"
IsChecked="{Binding Task.AllowedPassthruOptions.AudioAllowDTSHDPass}" />
-
+ <CheckBox Margin="0,0,5,0"
+ Content="TrueHD" VerticalAlignment="Center"
+ IsChecked="{Binding Task.AllowedPassthruOptions.AudioAllowTrueHDPass}" />
+ <CheckBox Margin="0,0,5,0"
+ Content="FLAC" VerticalAlignment="Center"
+ IsChecked="{Binding Task.AllowedPassthruOptions.AudioAllowFlacPass}" />
+
<TextBlock Margin="15,0,5,0" Text="Otherwise use fallback encoder:" />
<ComboBox VerticalAlignment="Center" Width="100" Height="22" Margin="10,0,5,0">
diff --git a/win/CS/HandBrakeWPF/Views/MainView.xaml b/win/CS/HandBrakeWPF/Views/MainView.xaml index ad875db87..44a46b195 100644 --- a/win/CS/HandBrakeWPF/Views/MainView.xaml +++ b/win/CS/HandBrakeWPF/Views/MainView.xaml @@ -641,9 +641,14 @@ <!-- Source Selection-->
<Controls:SourceSelection Grid.Row="1" MinWidth="300" HorizontalAlignment="Left" VerticalAlignment="Stretch" BorderThickness="1" BorderBrush="DarkGray"
- Visibility="{Binding ShowSourceSelection, Converter={StaticResource boolToVisConverter}}"
+ Visibility="{Binding ShowSourceSelection, Converter={StaticResource boolToVisConverter}}" Panel.ZIndex="1"
/>
+
+ <DockPanel Background="Black" Opacity="0.40" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Panel.ZIndex="0"
+ Grid.Row="1"
+ Visibility="{Binding ShowSourceSelection, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}" />
+
<!-- StatusPanel -->
<Controls:StatusPanel x:Name="loadingPanel"
Grid.Row="1"
diff --git a/win/CS/HandBrakeWPF/Views/ShellView.xaml b/win/CS/HandBrakeWPF/Views/ShellView.xaml index 9f735ec61..063678da5 100644 --- a/win/CS/HandBrakeWPF/Views/ShellView.xaml +++ b/win/CS/HandBrakeWPF/Views/ShellView.xaml @@ -3,7 +3,6 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Data="clr-namespace:System.Windows.Data;assembly=PresentationFramework"
xmlns:Converters="clr-namespace:HandBrakeWPF.Converters"
- xmlns:views="clr-namespace:HandBrakeWPF.Views"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:cal="http://www.caliburnproject.org"
Title="{Data:Binding Path=WindowTitle}"
@@ -32,8 +31,17 @@ </i:Interaction.Triggers>
<Grid>
- <ContentControl x:Name="MainViewModel" Visibility="{Binding ShowMainWindow, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}" />
- <ContentControl x:Name="OptionsViewModel" Visibility="{Binding ShowOptions, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}" />
+ <ContentControl x:Name="MainViewModel" Panel.ZIndex="0" Visibility="{Binding ShowMainWindow, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}"
+ IsEnabled="{Binding IsMainPanelEnabled}" />
+ <ContentControl x:Name="OptionsViewModel" Panel.ZIndex="0" Visibility="{Binding ShowOptions, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}"
+ IsEnabled="{Binding IsMainPanelEnabled}" />
+
+ <DockPanel Background="Black" Opacity="0.60" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Panel.ZIndex="1"
+ Visibility="{Binding ShowOverlayPanel, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}" />
+
+ <ContentControl x:Name="OverlayPanelViewModel" Visibility="{Binding ShowOverlayPanel, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}"
+ VerticalAlignment="Center" HorizontalAlignment="Center" Panel.ZIndex="2" MinWidth="900" MinHeight="675" />
+
</Grid>
</Window>
diff --git a/win/CS/HandBrakeWPF/Views/VideoView.xaml b/win/CS/HandBrakeWPF/Views/VideoView.xaml index 9fa047575..db7f0e619 100644 --- a/win/CS/HandBrakeWPF/Views/VideoView.xaml +++ b/win/CS/HandBrakeWPF/Views/VideoView.xaml @@ -170,12 +170,12 @@ <!-- Row 2-->
- <TextBlock Text="H.264 Profile:" Grid.Row="3" Grid.Column="0" Margin="0,10,0,0" VerticalAlignment="Center" Visibility="{Binding DisplayOptimiseOptions, Converter={StaticResource boolToVisConverter}}"/>
+ <TextBlock Text="Encoder Profile:" Grid.Row="3" Grid.Column="0" Margin="0,10,0,0" VerticalAlignment="Center" Visibility="{Binding DisplayOptimiseOptions, Converter={StaticResource boolToVisConverter}}"/>
<ComboBox Width="100" Grid.Row="3" Grid.Column="1" Margin="5,10,5,0" Height="22" VerticalAlignment="Center" Visibility="{Binding DisplayOptimiseOptions, Converter={StaticResource boolToVisConverter}}"
ItemsSource="{Binding VideoProfiles}" DisplayMemberPath="DisplayName" SelectedItem="{Binding VideoProfile}"
Style="{StaticResource LongToolTipHolder}" ToolTip="{x:Static Properties:Resources.Video_EncoderProfile}" />
- <TextBlock Text="H.264 Level:" Grid.Row="3" Grid.Column="2" Margin="10,10,0,0" VerticalAlignment="Center" Visibility="{Binding DisplayLevelControl, Converter={StaticResource boolToVisConverter}}" />
+ <TextBlock Text="Encoder Level:" Grid.Row="3" Grid.Column="2" Margin="10,10,0,0" VerticalAlignment="Center" Visibility="{Binding DisplayLevelControl, Converter={StaticResource boolToVisConverter}}" />
<ComboBox Width="100" Grid.Row="3" Grid.Column="3" Margin="5,10,5,0" Height="22" VerticalAlignment="Center" Visibility="{Binding DisplayLevelControl, Converter={StaticResource boolToVisConverter}}"
ItemsSource="{Binding VideoLevels}" DisplayMemberPath="DisplayName" SelectedItem="{Binding VideoLevel}"
Style="{StaticResource LongToolTipHolder}" ToolTip="{x:Static Properties:Resources.Video_EncoderLevel}"/>
|