summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/Services/Encode
diff options
context:
space:
mode:
authorsr55 <[email protected]>2018-07-07 15:20:55 +0100
committersr55 <[email protected]>2018-07-07 15:20:55 +0100
commit325cb484bfeccb2fa371c7af010c4eb4839c5f37 (patch)
tree9c8f4ace40f927ac8cc4dc4636ef0a79065e19e2 /win/CS/HandBrakeWPF/Services/Encode
parentfb1fe80d8cc9c65a1e3a030c0c61a81134c5efe2 (diff)
WinGui: Update the Encode Json Factory to produce human readable Json for audio and video encoders.
Diffstat (limited to 'win/CS/HandBrakeWPF/Services/Encode')
-rw-r--r--win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeFactory.cs26
-rw-r--r--win/CS/HandBrakeWPF/Services/Encode/Model/Models/OutputFormat.cs4
2 files changed, 15 insertions, 15 deletions
diff --git a/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeFactory.cs b/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeFactory.cs
index 3e133c5fa..a64884941 100644
--- a/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeFactory.cs
+++ b/win/CS/HandBrakeWPF/Services/Encode/Factories/EncodeFactory.cs
@@ -147,7 +147,7 @@ namespace HandBrakeWPF.Services.Encode.Factories
},
ChapterMarkers = job.IncludeChapterMarkers,
AlignAVStart = job.AlignAVStart,
- Mux = HBFunctions.hb_container_get_from_name(job.OutputFormat == OutputFormat.Mp4 ? "av_mp4" : "av_mkv"), // TODO tidy up.
+ Mux = EnumHelper<OutputFormat>.GetShortName(job.OutputFormat),
ChapterList = new List<Chapter>()
};
@@ -271,7 +271,7 @@ namespace HandBrakeWPF.Services.Encode.Factories
Validate.NotNull(videoEncoder, "Video encoder " + job.VideoEncoder + " not recognized.");
if (videoEncoder != null)
{
- video.Encoder = videoEncoder.Id;
+ video.Encoder = videoEncoder.ShortName;
}
string advancedOptions = job.ShowAdvancedTab ? job.AdvancedEncoderOptions : string.Empty;
@@ -331,19 +331,19 @@ namespace HandBrakeWPF.Services.Encode.Factories
{
Audio audio = new Audio();
- List<uint> copyMaskList = new List<uint>();
- 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);
+ List<string> copyMaskList = new List<string>();
+ if (job.AllowedPassthruOptions.AudioAllowAACPass) copyMaskList.Add(EnumHelper<AudioEncoder>.GetShortName(AudioEncoder.AacPassthru));
+ if (job.AllowedPassthruOptions.AudioAllowAC3Pass) copyMaskList.Add(EnumHelper<AudioEncoder>.GetShortName(AudioEncoder.Ac3Passthrough));
+ if (job.AllowedPassthruOptions.AudioAllowDTSHDPass) copyMaskList.Add(EnumHelper<AudioEncoder>.GetShortName(AudioEncoder.DtsHDPassthrough));
+ if (job.AllowedPassthruOptions.AudioAllowDTSPass) copyMaskList.Add(EnumHelper<AudioEncoder>.GetShortName(AudioEncoder.DtsPassthrough));
+ if (job.AllowedPassthruOptions.AudioAllowEAC3Pass) copyMaskList.Add(EnumHelper<AudioEncoder>.GetShortName(AudioEncoder.EAc3Passthrough));
+ if (job.AllowedPassthruOptions.AudioAllowFlacPass) copyMaskList.Add(EnumHelper<AudioEncoder>.GetShortName(AudioEncoder.FlacPassthru));
+ if (job.AllowedPassthruOptions.AudioAllowMP3Pass) copyMaskList.Add(EnumHelper<AudioEncoder>.GetShortName(AudioEncoder.Mp3Passthru));
+ if (job.AllowedPassthruOptions.AudioAllowTrueHDPass) copyMaskList.Add(EnumHelper<AudioEncoder>.GetShortName(AudioEncoder.TrueHDPassthrough));
audio.CopyMask = copyMaskList.ToArray();
HBAudioEncoder audioEncoder = HandBrakeEncoderHelpers.GetAudioEncoder(EnumHelper<AudioEncoder>.GetShortName(job.AllowedPassthruOptions.AudioEncoderFallback));
- audio.FallbackEncoder = audioEncoder.Id;
+ audio.FallbackEncoder = audioEncoder.ShortName;
audio.AudioList = new List<HandBrake.Interop.Interop.Json.Encode.AudioTrack>();
foreach (AudioTrack item in job.AudioTracks)
@@ -365,7 +365,7 @@ namespace HandBrakeWPF.Services.Encode.Factories
{
Track = (item.Track.HasValue ? item.Track.Value : 0) - 1,
DRC = item.DRC,
- Encoder = encoder.Id,
+ Encoder = encoder.ShortName,
Gain = item.Gain,
Mixdown = mixdown != null ? mixdown.Id : -1,
NormalizeMixLevel = false,
diff --git a/win/CS/HandBrakeWPF/Services/Encode/Model/Models/OutputFormat.cs b/win/CS/HandBrakeWPF/Services/Encode/Model/Models/OutputFormat.cs
index 8c55e45b1..dc4f00480 100644
--- a/win/CS/HandBrakeWPF/Services/Encode/Model/Models/OutputFormat.cs
+++ b/win/CS/HandBrakeWPF/Services/Encode/Model/Models/OutputFormat.cs
@@ -17,11 +17,11 @@ namespace HandBrakeWPF.Services.Encode.Model.Models
public enum OutputFormat
{
[DisplayName("MP4")]
- [ShortName("av_mp4")]
+ [ShortName("mp4")]
Mp4 = 0,
[DisplayName("MKV")]
- [ShortName("av_mkv")]
+ [ShortName("mkv")]
Mkv,
}
}