From 11d88373a0fadfa6321a3a85f28e00df88494d11 Mon Sep 17 00:00:00 2001 From: sr55 Date: Tue, 7 Apr 2015 18:50:38 +0000 Subject: WinGui: Fix the copy mask list. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7069 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- .../Interop/Json/Encode/Audio.cs | 2 +- .../Services/Encode/Factories/EncodeFactory.cs | 18 +++++++++--------- win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | 7 ++++--- 3 files changed, 14 insertions(+), 13 deletions(-) (limited to 'win/CS') diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Audio.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Audio.cs index ce1c69c9c..2661a8f17 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Audio.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Audio.cs @@ -24,7 +24,7 @@ namespace HandBrake.ApplicationServices.Interop.Json.Encode /// /// Gets or sets the copy mask. /// - public string[] CopyMask { get; set; } + public uint[] CopyMask { get; set; } /// /// Gets or sets the fallback encoder. diff --git a/win/CS/HandBrake.ApplicationServices/Services/Encode/Factories/EncodeFactory.cs b/win/CS/HandBrake.ApplicationServices/Services/Encode/Factories/EncodeFactory.cs index 52fc9636a..875cdc938 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/Encode/Factories/EncodeFactory.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Encode/Factories/EncodeFactory.cs @@ -306,15 +306,15 @@ namespace HandBrake.ApplicationServices.Services.Encode.Factories { Audio audio = new Audio(); - List copyMaskList = new List(); - if (job.AllowedPassthruOptions.AudioAllowAACPass) copyMaskList.Add("copy:aac"); - if (job.AllowedPassthruOptions.AudioAllowAC3Pass) copyMaskList.Add("copy:ac3"); - if (job.AllowedPassthruOptions.AudioAllowDTSHDPass) copyMaskList.Add("copy:dtshd"); - if (job.AllowedPassthruOptions.AudioAllowDTSPass) copyMaskList.Add("copy:dts"); - if (job.AllowedPassthruOptions.AudioAllowEAC3Pass) copyMaskList.Add("copy:eac3"); - if (job.AllowedPassthruOptions.AudioAllowFlacPass) copyMaskList.Add("copy:flac"); - if (job.AllowedPassthruOptions.AudioAllowMP3Pass) copyMaskList.Add("copy:mp3"); - if (job.AllowedPassthruOptions.AudioAllowTrueHDPass) copyMaskList.Add("copy:truehd"); + List copyMaskList = new List(); + if (job.AllowedPassthruOptions.AudioAllowAACPass) copyMaskList.Add(NativeConstants.HB_ACODEC_AAC_PASS); + if (job.AllowedPassthruOptions.AudioAllowAC3Pass) copyMaskList.Add(NativeConstants.HB_ACODEC_AC3_PASS); + if (job.AllowedPassthruOptions.AudioAllowDTSHDPass) copyMaskList.Add(NativeConstants.HB_ACODEC_DCA_HD_PASS); + if (job.AllowedPassthruOptions.AudioAllowDTSPass) copyMaskList.Add(NativeConstants.HB_ACODEC_DCA_PASS); + if (job.AllowedPassthruOptions.AudioAllowEAC3Pass) copyMaskList.Add(NativeConstants.HB_ACODEC_EAC3_PASS); + if (job.AllowedPassthruOptions.AudioAllowFlacPass) copyMaskList.Add(NativeConstants.HB_ACODEC_FLAC_PASS); + if (job.AllowedPassthruOptions.AudioAllowMP3Pass) copyMaskList.Add(NativeConstants.HB_ACODEC_MP3_PASS); + if (job.AllowedPassthruOptions.AudioAllowTrueHDPass) copyMaskList.Add(NativeConstants.HB_ACODEC_TRUEHD_PASS); audio.CopyMask = copyMaskList.ToArray(); HBAudioEncoder audioEncoder = HandBrakeEncoderHelpers.GetAudioEncoder(EnumHelper.GetShortName(job.AllowedPassthruOptions.AudioEncoderFallback)); diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index c35d6d7de..4c9921459 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -1520,9 +1520,10 @@ namespace HandBrakeWPF.ViewModels if (this.CurrentTask != null && !string.IsNullOrEmpty(this.CurrentTask.Destination)) { - saveFileDialog.InitialDirectory = Directory.Exists(Path.GetDirectoryName(this.CurrentTask.Destination)) - ? Path.GetDirectoryName(this.CurrentTask.Destination) + "\\" - : null; + if (Directory.Exists(Path.GetDirectoryName(this.CurrentTask.Destination))) + { + saveFileDialog.InitialDirectory = Path.GetDirectoryName(this.CurrentTask.Destination); + } saveFileDialog.FileName = Path.GetFileName(this.CurrentTask.Destination); } -- cgit v1.2.3