From 7e778cf7bf897b692754745862598fbc12cf877c Mon Sep 17 00:00:00 2001 From: sr55 Date: Sun, 31 May 2015 13:45:18 +0000 Subject: WinGui: Use the new libhb preset management code to fetch built-in presets on startup. Note, the preset update notice is now gone so anyone hacking the preset dat files will not be notified when it gets overwritten now. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7252 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- .../Interop/Json/Presets/HBPreset.cs | 4 +- .../Utilities/EnumHelper.cs | 7 +- win/CS/HandBrakeWPF/HandBrakeWPF.csproj | 2 +- win/CS/HandBrakeWPF/Presets.dat | 1697 -------------------- .../Presets/Factories/JsonPresetFactory.cs | 244 +-- .../HandBrakeWPF/Services/Presets/PresetService.cs | 82 +- 6 files changed, 171 insertions(+), 1865 deletions(-) delete mode 100644 win/CS/HandBrakeWPF/Presets.dat (limited to 'win') diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Presets/HBPreset.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Presets/HBPreset.cs index 0c40a858d..6bfeadcdd 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Presets/HBPreset.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Presets/HBPreset.cs @@ -219,12 +219,12 @@ namespace HandBrake.ApplicationServices.Interop.Json.Presets /// /// Gets or sets the picture width. /// - public int PictureWidth { get; set; } + public int? PictureWidth { get; set; } /// /// Gets or sets the picture height. /// - public int PictureHeight { get; set; } + public int? PictureHeight { get; set; } /// /// Gets or sets the picture force height. diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/EnumHelper.cs b/win/CS/HandBrake.ApplicationServices/Utilities/EnumHelper.cs index 72e65adeb..0de767b85 100644 --- a/win/CS/HandBrake.ApplicationServices/Utilities/EnumHelper.cs +++ b/win/CS/HandBrake.ApplicationServices/Utilities/EnumHelper.cs @@ -81,12 +81,13 @@ namespace HandBrake.ApplicationServices.Utilities { string currDescription = GetDescription(val); string currDisplay = GetDisplay(val); - if (currDescription == description || currDisplay == description) + string shortName = GetShortName(val); + if (currDescription == description || currDisplay == description || shortName == description) { return val; } - - if (insensitiveCase && (currDescription.ToLower() == description.ToLower() || currDisplay.ToLower() == description.ToLower())) + + if (insensitiveCase && (currDescription.ToLower() == description.ToLower() || currDisplay.ToLower() == description.ToLower() || shortName.ToLower() == description.ToLower())) { return val; } diff --git a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj index 7ffb9bc05..14fe06b41 100644 --- a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj +++ b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj @@ -159,6 +159,7 @@ + @@ -363,7 +364,6 @@ - diff --git a/win/CS/HandBrakeWPF/Presets.dat b/win/CS/HandBrakeWPF/Presets.dat deleted file mode 100644 index 00e6fc5b7..000000000 --- a/win/CS/HandBrakeWPF/Presets.dat +++ /dev/null @@ -1,1697 +0,0 @@ -[ - { - "Category": "Devices", - "Description": "", - "IsBuildIn": true, - "IsDefault": false, - "Name": "Universal", - "PictureSettingsMode": 0, - "UseDeinterlace": false, - "Task": { - "Source": null, - "Title": 0, - "Angle": 0, - "PointToPointMode": 0, - "StartPoint": 0, - "EndPoint": 0, - "Destination": null, - "OutputFormat": 0, - "OptimizeMP4": false, - "IPod5GSupport": false, - "Width": null, - "Height": null, - "MaxWidth": 720, - "MaxHeight": 576, - "Cropping": { - "Top": 0, - "Bottom": 0, - "Left": 0, - "Right": 0 - }, - "HasCropping": false, - "Anamorphic": 2, - "DisplayWidth": null, - "KeepDisplayAspect": false, - "PixelAspectX": 0, - "PixelAspectY": 0, - "Modulus": 2, - "Deinterlace": 0, - "CustomDeinterlace": null, - "Decomb": 0, - "CustomDecomb": null, - "Detelecine": 0, - "CustomDetelecine": null, - "Denoise": 0, - "DenoisePreset": 0, - "DenoiseTune": 0, - "CustomDenoise": null, - "Deblock": 0, - "Grayscale": false, - "VideoEncodeRateType": 2, - "VideoEncoder": 0, - "FramerateMode": 1, - "Quality": 20.0, - "VideoBitrate": null, - "TwoPass": false, - "TurboFirstPass": false, - "Framerate": 30.0, - "AudioTracks": [ - { - "AudioEncoderDisplayValue": "AAC (avcodec)", - "AudioMixdownDisplayValue": "Dolby Pro Logic II", - "BitRateDisplayValue": "160", - "Bitrate": 160, - "DRC": 0.0, - "IsDefault": false, - "Encoder": 0, - "Gain": 0, - "MixDown": 0, - "SampleRate": 0.0, - "SampleRateDisplayValue": "Auto", - "ScannedTrack": { - "TrackNumber": 0, - "Language": null, - "LanguageCode": null, - "Description": null, - "Format": null, - "SampleRate": 0, - "Bitrate": 0 - }, - "Track": 0, - "IsPassthru": false, - "CannotSetBitrate": false, - "IsLossless": false, - "TrackName": "" - }, - { - "AudioEncoderDisplayValue": "AC3 Passthru", - "AudioMixdownDisplayValue": "Automatic", - "BitRateDisplayValue": "Auto", - "Bitrate": 160, - "DRC": 0.0, - "IsDefault": false, - "Encoder": 6, - "Gain": 0, - "MixDown": 2, - "SampleRate": 0.0, - "SampleRateDisplayValue": "Auto", - "ScannedTrack": { - "TrackNumber": 0, - "Language": null, - "LanguageCode": null, - "Description": null, - "Format": null, - "SampleRate": 0, - "Bitrate": 0 - }, - "Track": 0, - "IsPassthru": true, - "CannotSetBitrate": true, - "IsLossless": true, - "TrackName": "" - } - ], - "AllowedPassthruOptions": { - "AudioAllowAACPass": true, - "AudioAllowAC3Pass": true, - "AudioAllowDTSHDPass": true, - "AudioAllowDTSPass": true, - "AudioAllowMP3Pass": true, - "AudioAllowTrueHDPass": true, - "AudioAllowFlacPass": true, - "AudioAllowEAC3Pass": true, - "AudioEncoderFallback": 4 - }, - "SubtitleTracks": [], - "IncludeChapterMarkers": true, - "ChapterMarkersFilePath": null, - "ChapterNames": [], - "AdvancedEncoderOptions": null, - "VideoProfile": { - "DisplayName": "Baseline", - "ShortName": "baseline" - }, - "VideoLevel": { - "DisplayName": "3.0", - "ShortName": "3.0" - }, - "VideoPreset": { - "DisplayName": "Fast", - "ShortName": "fast" - }, - "VideoTunes": [], - "ExtraAdvancedArguments": null, - "IsPreviewEncode": false, - "PreviewEncodeDuration": null, - "PreviewEncodeStartAt": null, - "RequiresM4v": true, - "ShowAdvancedTab": false, - "PictureSettingsDesc": "Anamorphic: Loose, Width: \r\nCrop Top: 0, Botton: 0, Left: 0, Right: 0" - }, - "UsePictureFilters": true, - "Version": "svn6809 (Nightly Build)", - "AudioTrackBehaviours": { - "SelectedBehaviour": 1, - "SelectedLangauges": [] - }, - "SubtitleTrackBehaviours": null - }, - { - "Category": "Devices", - "Description": "", - "IsBuildIn": true, - "IsDefault": false, - "Name": "iPod", - "PictureSettingsMode": 0, - "UseDeinterlace": false, - "Task": { - "Source": null, - "Title": 0, - "Angle": 0, - "PointToPointMode": 0, - "StartPoint": 0, - "EndPoint": 0, - "Destination": null, - "OutputFormat": 0, - "OptimizeMP4": false, - "IPod5GSupport": true, - "Width": null, - "Height": null, - "MaxWidth": 320, - "MaxHeight": 240, - "Cropping": { - "Top": 0, - "Bottom": 0, - "Left": 0, - "Right": 0 - }, - "HasCropping": false, - "Anamorphic": 0, - "DisplayWidth": null, - "KeepDisplayAspect": true, - "PixelAspectX": 0, - "PixelAspectY": 0, - "Modulus": 2, - "Deinterlace": 0, - "CustomDeinterlace": null, - "Decomb": 0, - "CustomDecomb": null, - "Detelecine": 0, - "CustomDetelecine": null, - "Denoise": 0, - "DenoisePreset": 0, - "DenoiseTune": 0, - "CustomDenoise": null, - "Deblock": 0, - "Grayscale": false, - "VideoEncodeRateType": 2, - "VideoEncoder": 0, - "FramerateMode": 1, - "Quality": 22.0, - "VideoBitrate": null, - "TwoPass": false, - "TurboFirstPass": false, - "Framerate": 30.0, - "AudioTracks": [ - { - "AudioEncoderDisplayValue": "AAC (avcodec)", - "AudioMixdownDisplayValue": "Dolby Pro Logic II", - "BitRateDisplayValue": "160", - "Bitrate": 160, - "DRC": 0.0, - "IsDefault": false, - "Encoder": 0, - "Gain": 0, - "MixDown": 0, - "SampleRate": 0.0, - "SampleRateDisplayValue": "Auto", - "ScannedTrack": { - "TrackNumber": 0, - "Language": null, - "LanguageCode": null, - "Description": null, - "Format": null, - "SampleRate": 0, - "Bitrate": 0 - }, - "Track": 0, - "IsPassthru": false, - "CannotSetBitrate": false, - "IsLossless": false, - "TrackName": "" - } - ], - "AllowedPassthruOptions": { - "AudioAllowAACPass": true, - "AudioAllowAC3Pass": true, - "AudioAllowDTSHDPass": true, - "AudioAllowDTSPass": true, - "AudioAllowMP3Pass": true, - "AudioAllowTrueHDPass": true, - "AudioAllowFlacPass": true, - "AudioAllowEAC3Pass": true, - "AudioEncoderFallback": 4 - }, - "SubtitleTracks": [], - "IncludeChapterMarkers": true, - "ChapterMarkersFilePath": null, - "ChapterNames": [], - "AdvancedEncoderOptions": null, - "VideoProfile": { - "DisplayName": "Baseline", - "ShortName": "baseline" - }, - "VideoLevel": { - "DisplayName": "1.3", - "ShortName": "1.3" - }, - "VideoPreset": { - "DisplayName": "Medium", - "ShortName": "medium" - }, - "VideoTunes": [], - "ExtraAdvancedArguments": null, - "IsPreviewEncode": false, - "PreviewEncodeDuration": null, - "PreviewEncodeStartAt": null, - "RequiresM4v": false, - "ShowAdvancedTab": false, - "PictureSettingsDesc": "Resolution: x\r\nCrop Top: 0, Botton: 0, Left: 0, Right: 0" - }, - "UsePictureFilters": true, - "Version": "svn6809 (Nightly Build)", - "AudioTrackBehaviours": { - "SelectedBehaviour": 1, - "SelectedLangauges": [] - }, - "SubtitleTrackBehaviours": null - }, - { - "Category": "Devices", - "Description": "", - "IsBuildIn": true, - "IsDefault": false, - "Name": "iPhone & iPod touch", - "PictureSettingsMode": 0, - "UseDeinterlace": false, - "Task": { - "Source": null, - "Title": 0, - "Angle": 0, - "PointToPointMode": 0, - "StartPoint": 0, - "EndPoint": 0, - "Destination": null, - "OutputFormat": 0, - "OptimizeMP4": false, - "IPod5GSupport": false, - "Width": null, - "Height": null, - "MaxWidth": 960, - "MaxHeight": 640, - "Cropping": { - "Top": 0, - "Bottom": 0, - "Left": 0, - "Right": 0 - }, - "HasCropping": false, - "Anamorphic": 2, - "DisplayWidth": null, - "KeepDisplayAspect": false, - "PixelAspectX": 0, - "PixelAspectY": 0, - "Modulus": 2, - "Deinterlace": 0, - "CustomDeinterlace": null, - "Decomb": 0, - "CustomDecomb": null, - "Detelecine": 0, - "CustomDetelecine": null, - "Denoise": 0, - "DenoisePreset": 0, - "DenoiseTune": 0, - "CustomDenoise": null, - "Deblock": 0, - "Grayscale": false, - "VideoEncodeRateType": 2, - "VideoEncoder": 0, - "FramerateMode": 1, - "Quality": 22.0, - "VideoBitrate": null, - "TwoPass": false, - "TurboFirstPass": false, - "Framerate": 30.0, - "AudioTracks": [ - { - "AudioEncoderDisplayValue": "AAC (avcodec)", - "AudioMixdownDisplayValue": "Dolby Pro Logic II", - "BitRateDisplayValue": "160", - "Bitrate": 160, - "DRC": 0.0, - "IsDefault": false, - "Encoder": 0, - "Gain": 0, - "MixDown": 0, - "SampleRate": 0.0, - "SampleRateDisplayValue": "Auto", - "ScannedTrack": { - "TrackNumber": 0, - "Language": null, - "LanguageCode": null, - "Description": null, - "Format": null, - "SampleRate": 0, - "Bitrate": 0 - }, - "Track": 0, - "IsPassthru": false, - "CannotSetBitrate": false, - "IsLossless": false, - "TrackName": "" - } - ], - "AllowedPassthruOptions": { - "AudioAllowAACPass": true, - "AudioAllowAC3Pass": true, - "AudioAllowDTSHDPass": true, - "AudioAllowDTSPass": true, - "AudioAllowMP3Pass": true, - "AudioAllowTrueHDPass": true, - "AudioAllowFlacPass": true, - "AudioAllowEAC3Pass": true, - "AudioEncoderFallback": 4 - }, - "SubtitleTracks": [], - "IncludeChapterMarkers": true, - "ChapterMarkersFilePath": null, - "ChapterNames": [], - "AdvancedEncoderOptions": null, - "VideoProfile": { - "DisplayName": "High", - "ShortName": "high" - }, - "VideoLevel": { - "DisplayName": "3.1", - "ShortName": "3.1" - }, - "VideoPreset": { - "DisplayName": "Medium", - "ShortName": "medium" - }, - "VideoTunes": [], - "ExtraAdvancedArguments": null, - "IsPreviewEncode": false, - "PreviewEncodeDuration": null, - "PreviewEncodeStartAt": null, - "RequiresM4v": false, - "ShowAdvancedTab": false, - "PictureSettingsDesc": "Anamorphic: Loose, Width: \r\nCrop Top: 0, Botton: 0, Left: 0, Right: 0" - }, - "UsePictureFilters": true, - "Version": "svn6809 (Nightly Build)", - "AudioTrackBehaviours": { - "SelectedBehaviour": 1, - "SelectedLangauges": [] - }, - "SubtitleTrackBehaviours": null - }, - { - "Category": "Devices", - "Description": "", - "IsBuildIn": true, - "IsDefault": false, - "Name": "iPad", - "PictureSettingsMode": 0, - "UseDeinterlace": false, - "Task": { - "Source": null, - "Title": 0, - "Angle": 0, - "PointToPointMode": 0, - "StartPoint": 0, - "EndPoint": 0, - "Destination": null, - "OutputFormat": 0, - "OptimizeMP4": false, - "IPod5GSupport": false, - "Width": null, - "Height": null, - "MaxWidth": 1280, - "MaxHeight": 720, - "Cropping": { - "Top": 0, - "Bottom": 0, - "Left": 0, - "Right": 0 - }, - "HasCropping": false, - "Anamorphic": 2, - "DisplayWidth": null, - "KeepDisplayAspect": false, - "PixelAspectX": 0, - "PixelAspectY": 0, - "Modulus": 2, - "Deinterlace": 0, - "CustomDeinterlace": null, - "Decomb": 0, - "CustomDecomb": null, - "Detelecine": 0, - "CustomDetelecine": null, - "Denoise": 0, - "DenoisePreset": 0, - "DenoiseTune": 0, - "CustomDenoise": null, - "Deblock": 0, - "Grayscale": false, - "VideoEncodeRateType": 2, - "VideoEncoder": 0, - "FramerateMode": 1, - "Quality": 20.0, - "VideoBitrate": null, - "TwoPass": false, - "TurboFirstPass": false, - "Framerate": 30.0, - "AudioTracks": [ - { - "AudioEncoderDisplayValue": "AAC (avcodec)", - "AudioMixdownDisplayValue": "Dolby Pro Logic II", - "BitRateDisplayValue": "160", - "Bitrate": 160, - "DRC": 0.0, - "IsDefault": false, - "Encoder": 0, - "Gain": 0, - "MixDown": 0, - "SampleRate": 0.0, - "SampleRateDisplayValue": "Auto", - "ScannedTrack": { - "TrackNumber": 0, - "Language": null, - "LanguageCode": null, - "Description": null, - "Format": null, - "SampleRate": 0, - "Bitrate": 0 - }, - "Track": 0, - "IsPassthru": false, - "CannotSetBitrate": false, - "IsLossless": false, - "TrackName": "" - } - ], - "AllowedPassthruOptions": { - "AudioAllowAACPass": true, - "AudioAllowAC3Pass": true, - "AudioAllowDTSHDPass": true, - "AudioAllowDTSPass": true, - "AudioAllowMP3Pass": true, - "AudioAllowTrueHDPass": true, - "AudioAllowFlacPass": true, - "AudioAllowEAC3Pass": true, - "AudioEncoderFallback": 4 - }, - "SubtitleTracks": [], - "IncludeChapterMarkers": true, - "ChapterMarkersFilePath": null, - "ChapterNames": [], - "AdvancedEncoderOptions": null, - "VideoProfile": { - "DisplayName": "High", - "ShortName": "high" - }, - "VideoLevel": { - "DisplayName": "3.1", - "ShortName": "3.1" - }, - "VideoPreset": { - "DisplayName": "Medium", - "ShortName": "medium" - }, - "VideoTunes": [], - "ExtraAdvancedArguments": null, - "IsPreviewEncode": false, - "PreviewEncodeDuration": null, - "PreviewEncodeStartAt": null, - "RequiresM4v": false, - "ShowAdvancedTab": false, - "PictureSettingsDesc": "Anamorphic: Loose, Width: \r\nCrop Top: 0, Botton: 0, Left: 0, Right: 0" - }, - "UsePictureFilters": true, - "Version": "svn6809 (Nightly Build)", - "AudioTrackBehaviours": { - "SelectedBehaviour": 1, - "SelectedLangauges": [] - }, - "SubtitleTrackBehaviours": null - }, - { - "Category": "Devices", - "Description": "", - "IsBuildIn": true, - "IsDefault": false, - "Name": "AppleTV", - "PictureSettingsMode": 0, - "UseDeinterlace": false, - "Task": { - "Source": null, - "Title": 0, - "Angle": 0, - "PointToPointMode": 0, - "StartPoint": 0, - "EndPoint": 0, - "Destination": null, - "OutputFormat": 0, - "OptimizeMP4": false, - "IPod5GSupport": false, - "Width": null, - "Height": null, - "MaxWidth": 960, - "MaxHeight": 720, - "Cropping": { - "Top": 0, - "Bottom": 0, - "Left": 0, - "Right": 0 - }, - "HasCropping": false, - "Anamorphic": 2, - "DisplayWidth": null, - "KeepDisplayAspect": false, - "PixelAspectX": 0, - "PixelAspectY": 0, - "Modulus": 2, - "Deinterlace": 0, - "CustomDeinterlace": null, - "Decomb": 0, - "CustomDecomb": null, - "Detelecine": 0, - "CustomDetelecine": null, - "Denoise": 0, - "DenoisePreset": 0, - "DenoiseTune": 0, - "CustomDenoise": null, - "Deblock": 0, - "Grayscale": false, - "VideoEncodeRateType": 2, - "VideoEncoder": 0, - "FramerateMode": 1, - "Quality": 20.0, - "VideoBitrate": null, - "TwoPass": false, - "TurboFirstPass": false, - "Framerate": 30.0, - "AudioTracks": [ - { - "AudioEncoderDisplayValue": "AAC (avcodec)", - "AudioMixdownDisplayValue": "Dolby Pro Logic II", - "BitRateDisplayValue": "160", - "Bitrate": 160, - "DRC": 0.0, - "IsDefault": false, - "Encoder": 0, - "Gain": 0, - "MixDown": 0, - "SampleRate": 0.0, - "SampleRateDisplayValue": "Auto", - "ScannedTrack": { - "TrackNumber": 0, - "Language": null, - "LanguageCode": null, - "Description": null, - "Format": null, - "SampleRate": 0, - "Bitrate": 0 - }, - "Track": 0, - "IsPassthru": false, - "CannotSetBitrate": false, - "IsLossless": false, - "TrackName": "" - }, - { - "AudioEncoderDisplayValue": "AC3 Passthru", - "AudioMixdownDisplayValue": "Automatic", - "BitRateDisplayValue": "Auto", - "Bitrate": 160, - "DRC": 0.0, - "IsDefault": false, - "Encoder": 6, - "Gain": 0, - "MixDown": 2, - "SampleRate": 0.0, - "SampleRateDisplayValue": "Auto", - "ScannedTrack": { - "TrackNumber": 0, - "Language": null, - "LanguageCode": null, - "Description": null, - "Format": null, - "SampleRate": 0, - "Bitrate": 0 - }, - "Track": 0, - "IsPassthru": true, - "CannotSetBitrate": true, - "IsLossless": true, - "TrackName": "" - } - ], - "AllowedPassthruOptions": { - "AudioAllowAACPass": true, - "AudioAllowAC3Pass": true, - "AudioAllowDTSHDPass": true, - "AudioAllowDTSPass": true, - "AudioAllowMP3Pass": true, - "AudioAllowTrueHDPass": true, - "AudioAllowFlacPass": true, - "AudioAllowEAC3Pass": true, - "AudioEncoderFallback": 4 - }, - "SubtitleTracks": [], - "IncludeChapterMarkers": true, - "ChapterMarkersFilePath": null, - "ChapterNames": [], - "AdvancedEncoderOptions": "qpmin=4:cabac=0:ref=2:b-pyramid=none:weightb=0:weightp=0:vbv-maxrate=9500:vbv-bufsize=9500", - "VideoProfile": { - "DisplayName": "High", - "ShortName": "high" - }, - "VideoLevel": { - "DisplayName": "3.1", - "ShortName": "3.1" - }, - "VideoPreset": { - "DisplayName": "Medium", - "ShortName": "medium" - }, - "VideoTunes": [], - "ExtraAdvancedArguments": null, - "IsPreviewEncode": false, - "PreviewEncodeDuration": null, - "PreviewEncodeStartAt": null, - "RequiresM4v": true, - "ShowAdvancedTab": false, - "PictureSettingsDesc": "Anamorphic: Loose, Width: \r\nCrop Top: 0, Botton: 0, Left: 0, Right: 0" - }, - "UsePictureFilters": true, - "Version": "svn6809 (Nightly Build)", - "AudioTrackBehaviours": { - "SelectedBehaviour": 1, - "SelectedLangauges": [] - }, - "SubtitleTrackBehaviours": null - }, - { - "Category": "Devices", - "Description": "", - "IsBuildIn": true, - "IsDefault": false, - "Name": "AppleTV 2", - "PictureSettingsMode": 0, - "UseDeinterlace": false, - "Task": { - "Source": null, - "Title": 0, - "Angle": 0, - "PointToPointMode": 0, - "StartPoint": 0, - "EndPoint": 0, - "Destination": null, - "OutputFormat": 0, - "OptimizeMP4": false, - "IPod5GSupport": false, - "Width": null, - "Height": null, - "MaxWidth": 1280, - "MaxHeight": 720, - "Cropping": { - "Top": 0, - "Bottom": 0, - "Left": 0, - "Right": 0 - }, - "HasCropping": false, - "Anamorphic": 2, - "DisplayWidth": null, - "KeepDisplayAspect": false, - "PixelAspectX": 0, - "PixelAspectY": 0, - "Modulus": 2, - "Deinterlace": 0, - "CustomDeinterlace": null, - "Decomb": 0, - "CustomDecomb": null, - "Detelecine": 0, - "CustomDetelecine": null, - "Denoise": 0, - "DenoisePreset": 0, - "DenoiseTune": 0, - "CustomDenoise": null, - "Deblock": 0, - "Grayscale": false, - "VideoEncodeRateType": 2, - "VideoEncoder": 0, - "FramerateMode": 1, - "Quality": 20.0, - "VideoBitrate": null, - "TwoPass": false, - "TurboFirstPass": false, - "Framerate": 30.0, - "AudioTracks": [ - { - "AudioEncoderDisplayValue": "AAC (avcodec)", - "AudioMixdownDisplayValue": "Dolby Pro Logic II", - "BitRateDisplayValue": "160", - "Bitrate": 160, - "DRC": 0.0, - "IsDefault": false, - "Encoder": 0, - "Gain": 0, - "MixDown": 0, - "SampleRate": 0.0, - "SampleRateDisplayValue": "Auto", - "ScannedTrack": { - "TrackNumber": 0, - "Language": null, - "LanguageCode": null, - "Description": null, - "Format": null, - "SampleRate": 0, - "Bitrate": 0 - }, - "Track": 0, - "IsPassthru": false, - "CannotSetBitrate": false, - "IsLossless": false, - "TrackName": "" - }, - { - "AudioEncoderDisplayValue": "AC3 Passthru", - "AudioMixdownDisplayValue": "Automatic", - "BitRateDisplayValue": "Auto", - "Bitrate": 160, - "DRC": 0.0, - "IsDefault": false, - "Encoder": 6, - "Gain": 0, - "MixDown": 2, - "SampleRate": 0.0, - "SampleRateDisplayValue": "Auto", - "ScannedTrack": { - "TrackNumber": 0, - "Language": null, - "LanguageCode": null, - "Description": null, - "Format": null, - "SampleRate": 0, - "Bitrate": 0 - }, - "Track": 0, - "IsPassthru": true, - "CannotSetBitrate": true, - "IsLossless": true, - "TrackName": "" - } - ], - "AllowedPassthruOptions": { - "AudioAllowAACPass": true, - "AudioAllowAC3Pass": true, - "AudioAllowDTSHDPass": true, - "AudioAllowDTSPass": true, - "AudioAllowMP3Pass": true, - "AudioAllowTrueHDPass": true, - "AudioAllowFlacPass": true, - "AudioAllowEAC3Pass": true, - "AudioEncoderFallback": 4 - }, - "SubtitleTracks": [], - "IncludeChapterMarkers": true, - "ChapterMarkersFilePath": null, - "ChapterNames": [], - "AdvancedEncoderOptions": null, - "VideoProfile": { - "DisplayName": "High", - "ShortName": "high" - }, - "VideoLevel": { - "DisplayName": "3.1", - "ShortName": "3.1" - }, - "VideoPreset": { - "DisplayName": "Medium", - "ShortName": "medium" - }, - "VideoTunes": [], - "ExtraAdvancedArguments": null, - "IsPreviewEncode": false, - "PreviewEncodeDuration": null, - "PreviewEncodeStartAt": null, - "RequiresM4v": true, - "ShowAdvancedTab": false, - "PictureSettingsDesc": "Anamorphic: Loose, Width: \r\nCrop Top: 0, Botton: 0, Left: 0, Right: 0" - }, - "UsePictureFilters": true, - "Version": "svn6809 (Nightly Build)", - "AudioTrackBehaviours": { - "SelectedBehaviour": 1, - "SelectedLangauges": [] - }, - "SubtitleTrackBehaviours": null - }, - { - "Category": "Devices", - "Description": "", - "IsBuildIn": true, - "IsDefault": false, - "Name": "AppleTV 3", - "PictureSettingsMode": 0, - "UseDeinterlace": false, - "Task": { - "Source": null, - "Title": 0, - "Angle": 0, - "PointToPointMode": 0, - "StartPoint": 0, - "EndPoint": 0, - "Destination": null, - "OutputFormat": 0, - "OptimizeMP4": false, - "IPod5GSupport": false, - "Width": null, - "Height": null, - "MaxWidth": 1920, - "MaxHeight": 1080, - "Cropping": { - "Top": 0, - "Bottom": 0, - "Left": 0, - "Right": 0 - }, - "HasCropping": false, - "Anamorphic": 2, - "DisplayWidth": null, - "KeepDisplayAspect": false, - "PixelAspectX": 0, - "PixelAspectY": 0, - "Modulus": 2, - "Deinterlace": 0, - "CustomDeinterlace": null, - "Decomb": 3, - "CustomDecomb": null, - "Detelecine": 0, - "CustomDetelecine": null, - "Denoise": 0, - "DenoisePreset": 0, - "DenoiseTune": 0, - "CustomDenoise": null, - "Deblock": 0, - "Grayscale": false, - "VideoEncodeRateType": 2, - "VideoEncoder": 0, - "FramerateMode": 1, - "Quality": 20.0, - "VideoBitrate": null, - "TwoPass": false, - "TurboFirstPass": false, - "Framerate": 30.0, - "AudioTracks": [ - { - "AudioEncoderDisplayValue": "AAC (avcodec)", - "AudioMixdownDisplayValue": "Dolby Pro Logic II", - "BitRateDisplayValue": "160", - "Bitrate": 160, - "DRC": 0.0, - "IsDefault": false, - "Encoder": 0, - "Gain": 0, - "MixDown": 0, - "SampleRate": 0.0, - "SampleRateDisplayValue": "Auto", - "ScannedTrack": { - "TrackNumber": 0, - "Language": null, - "LanguageCode": null, - "Description": null, - "Format": null, - "SampleRate": 0, - "Bitrate": 0 - }, - "Track": 0, - "IsPassthru": false, - "CannotSetBitrate": false, - "IsLossless": false, - "TrackName": "" - }, - { - "AudioEncoderDisplayValue": "AC3 Passthru", - "AudioMixdownDisplayValue": "Automatic", - "BitRateDisplayValue": "Auto", - "Bitrate": 160, - "DRC": 0.0, - "IsDefault": false, - "Encoder": 6, - "Gain": 0, - "MixDown": 2, - "SampleRate": 0.0, - "SampleRateDisplayValue": "Auto", - "ScannedTrack": { - "TrackNumber": 0, - "Language": null, - "LanguageCode": null, - "Description": null, - "Format": null, - "SampleRate": 0, - "Bitrate": 0 - }, - "Track": 0, - "IsPassthru": true, - "CannotSetBitrate": true, - "IsLossless": true, - "TrackName": "" - } - ], - "AllowedPassthruOptions": { - "AudioAllowAACPass": true, - "AudioAllowAC3Pass": true, - "AudioAllowDTSHDPass": true, - "AudioAllowDTSPass": true, - "AudioAllowMP3Pass": true, - "AudioAllowTrueHDPass": true, - "AudioAllowFlacPass": true, - "AudioAllowEAC3Pass": true, - "AudioEncoderFallback": 4 - }, - "SubtitleTracks": [], - "IncludeChapterMarkers": true, - "ChapterMarkersFilePath": null, - "ChapterNames": [], - "AdvancedEncoderOptions": null, - "VideoProfile": { - "DisplayName": "High", - "ShortName": "high" - }, - "VideoLevel": { - "DisplayName": "4.0", - "ShortName": "4.0" - }, - "VideoPreset": { - "DisplayName": "Medium", - "ShortName": "medium" - }, - "VideoTunes": [], - "ExtraAdvancedArguments": null, - "IsPreviewEncode": false, - "PreviewEncodeDuration": null, - "PreviewEncodeStartAt": null, - "RequiresM4v": true, - "ShowAdvancedTab": false, - "PictureSettingsDesc": "Anamorphic: Loose, Width: \r\nCrop Top: 0, Botton: 0, Left: 0, Right: 0" - }, - "UsePictureFilters": true, - "Version": "svn6809 (Nightly Build)", - "AudioTrackBehaviours": { - "SelectedBehaviour": 1, - "SelectedLangauges": [] - }, - "SubtitleTrackBehaviours": null - }, - { - "Category": "Devices", - "Description": "", - "IsBuildIn": true, - "IsDefault": false, - "Name": "Android", - "PictureSettingsMode": 0, - "UseDeinterlace": false, - "Task": { - "Source": null, - "Title": 0, - "Angle": 0, - "PointToPointMode": 0, - "StartPoint": 0, - "EndPoint": 0, - "Destination": null, - "OutputFormat": 0, - "OptimizeMP4": false, - "IPod5GSupport": false, - "Width": null, - "Height": null, - "MaxWidth": 720, - "MaxHeight": 576, - "Cropping": { - "Top": 0, - "Bottom": 0, - "Left": 0, - "Right": 0 - }, - "HasCropping": false, - "Anamorphic": 2, - "DisplayWidth": null, - "KeepDisplayAspect": false, - "PixelAspectX": 0, - "PixelAspectY": 0, - "Modulus": 2, - "Deinterlace": 0, - "CustomDeinterlace": null, - "Decomb": 0, - "CustomDecomb": null, - "Detelecine": 0, - "CustomDetelecine": null, - "Denoise": 0, - "DenoisePreset": 0, - "DenoiseTune": 0, - "CustomDenoise": null, - "Deblock": 0, - "Grayscale": false, - "VideoEncodeRateType": 2, - "VideoEncoder": 0, - "FramerateMode": 1, - "Quality": 22.0, - "VideoBitrate": null, - "TwoPass": false, - "TurboFirstPass": false, - "Framerate": 30.0, - "AudioTracks": [ - { - "AudioEncoderDisplayValue": "AAC (avcodec)", - "AudioMixdownDisplayValue": "Dolby Pro Logic II", - "BitRateDisplayValue": "128", - "Bitrate": 128, - "DRC": 0.0, - "IsDefault": false, - "Encoder": 0, - "Gain": 0, - "MixDown": 0, - "SampleRate": 0.0, - "SampleRateDisplayValue": "Auto", - "ScannedTrack": { - "TrackNumber": 0, - "Language": null, - "LanguageCode": null, - "Description": null, - "Format": null, - "SampleRate": 0, - "Bitrate": 0 - }, - "Track": 0, - "IsPassthru": false, - "CannotSetBitrate": false, - "IsLossless": false, - "TrackName": "" - } - ], - "AllowedPassthruOptions": { - "AudioAllowAACPass": true, - "AudioAllowAC3Pass": true, - "AudioAllowDTSHDPass": true, - "AudioAllowDTSPass": true, - "AudioAllowMP3Pass": true, - "AudioAllowTrueHDPass": true, - "AudioAllowFlacPass": true, - "AudioAllowEAC3Pass": true, - "AudioEncoderFallback": 4 - }, - "SubtitleTracks": [], - "IncludeChapterMarkers": false, - "ChapterMarkersFilePath": null, - "ChapterNames": [], - "AdvancedEncoderOptions": null, - "VideoProfile": { - "DisplayName": "Main", - "ShortName": "main" - }, - "VideoLevel": { - "DisplayName": "3.0", - "ShortName": "3.0" - }, - "VideoPreset": { - "DisplayName": "Medium", - "ShortName": "medium" - }, - "VideoTunes": [], - "ExtraAdvancedArguments": null, - "IsPreviewEncode": false, - "PreviewEncodeDuration": null, - "PreviewEncodeStartAt": null, - "RequiresM4v": false, - "ShowAdvancedTab": false, - "PictureSettingsDesc": "Anamorphic: Loose, Width: \r\nCrop Top: 0, Botton: 0, Left: 0, Right: 0" - }, - "UsePictureFilters": true, - "Version": "svn6809 (Nightly Build)", - "AudioTrackBehaviours": { - "SelectedBehaviour": 1, - "SelectedLangauges": [] - }, - "SubtitleTrackBehaviours": null - }, - { - "Category": "Devices", - "Description": "", - "IsBuildIn": true, - "IsDefault": false, - "Name": "Android Tablet", - "PictureSettingsMode": 0, - "UseDeinterlace": false, - "Task": { - "Source": null, - "Title": 0, - "Angle": 0, - "PointToPointMode": 0, - "StartPoint": 0, - "EndPoint": 0, - "Destination": null, - "OutputFormat": 0, - "OptimizeMP4": false, - "IPod5GSupport": false, - "Width": null, - "Height": null, - "MaxWidth": 1280, - "MaxHeight": 720, - "Cropping": { - "Top": 0, - "Bottom": 0, - "Left": 0, - "Right": 0 - }, - "HasCropping": false, - "Anamorphic": 2, - "DisplayWidth": null, - "KeepDisplayAspect": false, - "PixelAspectX": 0, - "PixelAspectY": 0, - "Modulus": 2, - "Deinterlace": 0, - "CustomDeinterlace": null, - "Decomb": 0, - "CustomDecomb": null, - "Detelecine": 0, - "CustomDetelecine": null, - "Denoise": 0, - "DenoisePreset": 0, - "DenoiseTune": 0, - "CustomDenoise": null, - "Deblock": 0, - "Grayscale": false, - "VideoEncodeRateType": 2, - "VideoEncoder": 0, - "FramerateMode": 1, - "Quality": 22.0, - "VideoBitrate": null, - "TwoPass": false, - "TurboFirstPass": false, - "Framerate": 30.0, - "AudioTracks": [ - { - "AudioEncoderDisplayValue": "AAC (avcodec)", - "AudioMixdownDisplayValue": "Dolby Pro Logic II", - "BitRateDisplayValue": "128", - "Bitrate": 128, - "DRC": 0.0, - "IsDefault": false, - "Encoder": 0, - "Gain": 0, - "MixDown": 0, - "SampleRate": 0.0, - "SampleRateDisplayValue": "Auto", - "ScannedTrack": { - "TrackNumber": 0, - "Language": null, - "LanguageCode": null, - "Description": null, - "Format": null, - "SampleRate": 0, - "Bitrate": 0 - }, - "Track": 0, - "IsPassthru": false, - "CannotSetBitrate": false, - "IsLossless": false, - "TrackName": "" - } - ], - "AllowedPassthruOptions": { - "AudioAllowAACPass": true, - "AudioAllowAC3Pass": true, - "AudioAllowDTSHDPass": true, - "AudioAllowDTSPass": true, - "AudioAllowMP3Pass": true, - "AudioAllowTrueHDPass": true, - "AudioAllowFlacPass": true, - "AudioAllowEAC3Pass": true, - "AudioEncoderFallback": 4 - }, - "SubtitleTracks": [], - "IncludeChapterMarkers": false, - "ChapterMarkersFilePath": null, - "ChapterNames": [], - "AdvancedEncoderOptions": null, - "VideoProfile": { - "DisplayName": "Main", - "ShortName": "main" - }, - "VideoLevel": { - "DisplayName": "3.1", - "ShortName": "3.1" - }, - "VideoPreset": { - "DisplayName": "Medium", - "ShortName": "medium" - }, - "VideoTunes": [], - "ExtraAdvancedArguments": null, - "IsPreviewEncode": false, - "PreviewEncodeDuration": null, - "PreviewEncodeStartAt": null, - "RequiresM4v": false, - "ShowAdvancedTab": false, - "PictureSettingsDesc": "Anamorphic: Loose, Width: \r\nCrop Top: 0, Botton: 0, Left: 0, Right: 0" - }, - "UsePictureFilters": true, - "Version": "svn6809 (Nightly Build)", - "AudioTrackBehaviours": { - "SelectedBehaviour": 1, - "SelectedLangauges": [] - }, - "SubtitleTrackBehaviours": null - }, - { - "Category": "Devices", - "Description": "", - "IsBuildIn": true, - "IsDefault": false, - "Name": "Windows Phone 8", - "PictureSettingsMode": 0, - "UseDeinterlace": false, - "Task": { - "Source": null, - "Title": 0, - "Angle": 0, - "PointToPointMode": 0, - "StartPoint": 0, - "EndPoint": 0, - "Destination": null, - "OutputFormat": 0, - "OptimizeMP4": false, - "IPod5GSupport": false, - "Width": null, - "Height": null, - "MaxWidth": 1280, - "MaxHeight": 720, - "Cropping": { - "Top": 0, - "Bottom": 0, - "Left": 0, - "Right": 0 - }, - "HasCropping": false, - "Anamorphic": 0, - "DisplayWidth": null, - "KeepDisplayAspect": false, - "PixelAspectX": 0, - "PixelAspectY": 0, - "Modulus": 2, - "Deinterlace": 0, - "CustomDeinterlace": null, - "Decomb": 0, - "CustomDecomb": null, - "Detelecine": 0, - "CustomDetelecine": null, - "Denoise": 0, - "DenoisePreset": 0, - "DenoiseTune": 0, - "CustomDenoise": null, - "Deblock": 0, - "Grayscale": false, - "VideoEncodeRateType": 2, - "VideoEncoder": 0, - "FramerateMode": 1, - "Quality": 22.0, - "VideoBitrate": null, - "TwoPass": false, - "TurboFirstPass": false, - "Framerate": 30.0, - "AudioTracks": [ - { - "AudioEncoderDisplayValue": "AAC (avcodec)", - "AudioMixdownDisplayValue": "Dolby Pro Logic II", - "BitRateDisplayValue": "128", - "Bitrate": 128, - "DRC": 0.0, - "IsDefault": false, - "Encoder": 0, - "Gain": 0, - "MixDown": 0, - "SampleRate": 0.0, - "SampleRateDisplayValue": "Auto", - "ScannedTrack": { - "TrackNumber": 0, - "Language": null, - "LanguageCode": null, - "Description": null, - "Format": null, - "SampleRate": 0, - "Bitrate": 0 - }, - "Track": 0, - "IsPassthru": false, - "CannotSetBitrate": false, - "IsLossless": false, - "TrackName": "" - } - ], - "AllowedPassthruOptions": { - "AudioAllowAACPass": true, - "AudioAllowAC3Pass": true, - "AudioAllowDTSHDPass": true, - "AudioAllowDTSPass": true, - "AudioAllowMP3Pass": true, - "AudioAllowTrueHDPass": true, - "AudioAllowFlacPass": true, - "AudioAllowEAC3Pass": true, - "AudioEncoderFallback": 4 - }, - "SubtitleTracks": [], - "IncludeChapterMarkers": false, - "ChapterMarkersFilePath": null, - "ChapterNames": [], - "AdvancedEncoderOptions": null, - "VideoProfile": { - "DisplayName": "Main", - "ShortName": "main" - }, - "VideoLevel": { - "DisplayName": "3.1", - "ShortName": "3.1" - }, - "VideoPreset": { - "DisplayName": "Medium", - "ShortName": "medium" - }, - "VideoTunes": [], - "ExtraAdvancedArguments": null, - "IsPreviewEncode": false, - "PreviewEncodeDuration": null, - "PreviewEncodeStartAt": null, - "RequiresM4v": false, - "ShowAdvancedTab": false, - "PictureSettingsDesc": "Resolution: x\r\nCrop Top: 0, Botton: 0, Left: 0, Right: 0" - }, - "UsePictureFilters": true, - "Version": "svn6809 (Nightly Build)", - "AudioTrackBehaviours": { - "SelectedBehaviour": 1, - "SelectedLangauges": [] - }, - "SubtitleTrackBehaviours": null - }, - { - "Category": "Regular", - "Description": "", - "IsBuildIn": true, - "IsDefault": true, - "Name": "Normal", - "PictureSettingsMode": 0, - "UseDeinterlace": false, - "Task": { - "Source": null, - "Title": 0, - "Angle": 0, - "PointToPointMode": 0, - "StartPoint": 0, - "EndPoint": 0, - "Destination": null, - "OutputFormat": 0, - "OptimizeMP4": false, - "IPod5GSupport": false, - "Width": null, - "Height": null, - "MaxWidth": null, - "MaxHeight": null, - "Cropping": { - "Top": 0, - "Bottom": 0, - "Left": 0, - "Right": 0 - }, - "HasCropping": false, - "Anamorphic": 2, - "DisplayWidth": null, - "KeepDisplayAspect": false, - "PixelAspectX": 0, - "PixelAspectY": 0, - "Modulus": 2, - "Deinterlace": 0, - "CustomDeinterlace": null, - "Decomb": 0, - "CustomDecomb": null, - "Detelecine": 0, - "CustomDetelecine": null, - "Denoise": 0, - "DenoisePreset": 0, - "DenoiseTune": 0, - "CustomDenoise": null, - "Deblock": 0, - "Grayscale": false, - "VideoEncodeRateType": 2, - "VideoEncoder": 0, - "FramerateMode": 2, - "Quality": 20.0, - "VideoBitrate": null, - "TwoPass": false, - "TurboFirstPass": false, - "Framerate": null, - "AudioTracks": [ - { - "AudioEncoderDisplayValue": "AAC (avcodec)", - "AudioMixdownDisplayValue": "Dolby Pro Logic II", - "BitRateDisplayValue": "160", - "Bitrate": 160, - "DRC": 0.0, - "IsDefault": false, - "Encoder": 0, - "Gain": 0, - "MixDown": 0, - "SampleRate": 0.0, - "SampleRateDisplayValue": "Auto", - "ScannedTrack": { - "TrackNumber": 0, - "Language": null, - "LanguageCode": null, - "Description": null, - "Format": null, - "SampleRate": 0, - "Bitrate": 0 - }, - "Track": 0, - "IsPassthru": false, - "CannotSetBitrate": false, - "IsLossless": false, - "TrackName": "" - } - ], - "AllowedPassthruOptions": { - "AudioAllowAACPass": true, - "AudioAllowAC3Pass": true, - "AudioAllowDTSHDPass": true, - "AudioAllowDTSPass": true, - "AudioAllowMP3Pass": true, - "AudioAllowTrueHDPass": true, - "AudioAllowFlacPass": true, - "AudioAllowEAC3Pass": true, - "AudioEncoderFallback": 4 - }, - "SubtitleTracks": [], - "IncludeChapterMarkers": true, - "ChapterMarkersFilePath": null, - "ChapterNames": [], - "AdvancedEncoderOptions": null, - "VideoProfile": { - "DisplayName": "Main", - "ShortName": "main" - }, - "VideoLevel": { - "DisplayName": "4.0", - "ShortName": "4.0" - }, - "VideoPreset": { - "DisplayName": "Veryfast", - "ShortName": "veryfast" - }, - "VideoTunes": [], - "ExtraAdvancedArguments": null, - "IsPreviewEncode": false, - "PreviewEncodeDuration": null, - "PreviewEncodeStartAt": null, - "RequiresM4v": false, - "ShowAdvancedTab": false, - "PictureSettingsDesc": "Anamorphic: Loose, Width: \r\nCrop Top: 0, Botton: 0, Left: 0, Right: 0" - }, - "UsePictureFilters": true, - "Version": "svn6809 (Nightly Build)", - "AudioTrackBehaviours": { - "SelectedBehaviour": 1, - "SelectedLangauges": [] - }, - "SubtitleTrackBehaviours": null - }, - { - "Category": "Regular", - "Description": "", - "IsBuildIn": true, - "IsDefault": false, - "Name": "High Profile", - "PictureSettingsMode": 0, - "UseDeinterlace": false, - "Task": { - "Source": null, - "Title": 0, - "Angle": 0, - "PointToPointMode": 0, - "StartPoint": 0, - "EndPoint": 0, - "Destination": null, - "OutputFormat": 0, - "OptimizeMP4": false, - "IPod5GSupport": false, - "Width": null, - "Height": null, - "MaxWidth": null, - "MaxHeight": null, - "Cropping": { - "Top": 0, - "Bottom": 0, - "Left": 0, - "Right": 0 - }, - "HasCropping": false, - "Anamorphic": 2, - "DisplayWidth": null, - "KeepDisplayAspect": false, - "PixelAspectX": 0, - "PixelAspectY": 0, - "Modulus": 2, - "Deinterlace": 0, - "CustomDeinterlace": null, - "Decomb": 2, - "CustomDecomb": null, - "Detelecine": 0, - "CustomDetelecine": null, - "Denoise": 0, - "DenoisePreset": 0, - "DenoiseTune": 0, - "CustomDenoise": null, - "Deblock": 0, - "Grayscale": false, - "VideoEncodeRateType": 2, - "VideoEncoder": 0, - "FramerateMode": 2, - "Quality": 20.0, - "VideoBitrate": null, - "TwoPass": false, - "TurboFirstPass": false, - "Framerate": null, - "AudioTracks": [ - { - "AudioEncoderDisplayValue": "AAC (avcodec)", - "AudioMixdownDisplayValue": "Dolby Pro Logic II", - "BitRateDisplayValue": "160", - "Bitrate": 160, - "DRC": 0.0, - "IsDefault": false, - "Encoder": 0, - "Gain": 0, - "MixDown": 0, - "SampleRate": 0.0, - "SampleRateDisplayValue": "Auto", - "ScannedTrack": { - "TrackNumber": 0, - "Language": null, - "LanguageCode": null, - "Description": null, - "Format": null, - "SampleRate": 0, - "Bitrate": 0 - }, - "Track": 0, - "IsPassthru": false, - "CannotSetBitrate": false, - "IsLossless": false, - "TrackName": "" - }, - { - "AudioEncoderDisplayValue": "AC3 Passthru", - "AudioMixdownDisplayValue": "Automatic", - "BitRateDisplayValue": "Auto", - "Bitrate": 160, - "DRC": 0.0, - "IsDefault": false, - "Encoder": 6, - "Gain": 0, - "MixDown": 2, - "SampleRate": 0.0, - "SampleRateDisplayValue": "Auto", - "ScannedTrack": { - "TrackNumber": 0, - "Language": null, - "LanguageCode": null, - "Description": null, - "Format": null, - "SampleRate": 0, - "Bitrate": 0 - }, - "Track": 0, - "IsPassthru": true, - "CannotSetBitrate": true, - "IsLossless": true, - "TrackName": "" - } - ], - "AllowedPassthruOptions": { - "AudioAllowAACPass": true, - "AudioAllowAC3Pass": true, - "AudioAllowDTSHDPass": true, - "AudioAllowDTSPass": true, - "AudioAllowMP3Pass": true, - "AudioAllowTrueHDPass": true, - "AudioAllowFlacPass": true, - "AudioAllowEAC3Pass": true, - "AudioEncoderFallback": 4 - }, - "SubtitleTracks": [], - "IncludeChapterMarkers": true, - "ChapterMarkersFilePath": null, - "ChapterNames": [], - "AdvancedEncoderOptions": null, - "VideoProfile": { - "DisplayName": "High", - "ShortName": "high" - }, - "VideoLevel": { - "DisplayName": "4.1", - "ShortName": "4.1" - }, - "VideoPreset": { - "DisplayName": "Medium", - "ShortName": "medium" - }, - "VideoTunes": [], - "ExtraAdvancedArguments": null, - "IsPreviewEncode": false, - "PreviewEncodeDuration": null, - "PreviewEncodeStartAt": null, - "RequiresM4v": true, - "ShowAdvancedTab": false, - "PictureSettingsDesc": "Anamorphic: Loose, Width: \r\nCrop Top: 0, Botton: 0, Left: 0, Right: 0" - }, - "UsePictureFilters": true, - "Version": "svn6809 (Nightly Build)", - "AudioTrackBehaviours": { - "SelectedBehaviour": 1, - "SelectedLangauges": [] - }, - "SubtitleTrackBehaviours": null - } -] diff --git a/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs b/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs index 1fff26e1c..ce25af52a 100644 --- a/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs +++ b/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs @@ -9,9 +9,11 @@ namespace HandBrakeWPF.Services.Presets.Factories { + using System; using System.Collections.ObjectModel; using System.Globalization; + using HandBrake.ApplicationServices.Interop.Json.Presets; using HandBrake.ApplicationServices.Interop.Model; using HandBrake.ApplicationServices.Interop.Model.Encoding; using HandBrake.ApplicationServices.Services.Encode.Model; @@ -32,266 +34,270 @@ namespace HandBrakeWPF.Services.Presets.Factories /// /// The create preset. /// - /// + /// /// The preset. /// /// /// The . /// - public static Preset ImportPreset(HandBrake.ApplicationServices.Interop.Json.Presets.HBPreset preset) + public static Preset ImportPreset(HBPreset importedPreset) { - EncodeTask task = new EncodeTask(); - Preset parsedPreset = new Preset(); - parsedPreset.Name = preset.PresetName; - parsedPreset.Description = preset.PresetDescription; - parsedPreset.UsePictureFilters = preset.UsesPictureFilters; - parsedPreset.PictureSettingsMode = (PresetPictureSettingsMode)preset.UsesPictureSettings; - parsedPreset.UseDeinterlace = preset.PictureDecombDeinterlace; - parsedPreset.Task = new EncodeTask(); + Preset preset = new Preset(); + preset.Name = importedPreset.PresetName; + preset.Description = importedPreset.PresetDescription; + preset.UsePictureFilters = importedPreset.UsesPictureFilters; + preset.UseDeinterlace = importedPreset.PictureDecombDeinterlace; + preset.Task = new EncodeTask(); // Step 1, Create the EncodeTask Object that can be loaded into the UI. - /* Output Settings */ - task.OptimizeMP4 = preset.Mp4HttpOptimize; - task.IPod5GSupport = preset.Mp4iPodCompatible; - task.OutputFormat = GetFileFormat(preset.FileFormat.Replace("file", string.Empty).Trim()); // TOOD null check. - - /* Picture Settings */ - task.Cropping = new Cropping(preset.PictureTopCrop, preset.PictureBottomCrop, preset.PictureLeftCrop, preset.PictureRightCrop); - task.HasCropping = preset.PictureAutoCrop; - task.Width = preset.PictureWidth; - task.Height = preset.PictureHeight; - task.Modulus = preset.PictureModulus; - task.KeepDisplayAspect = preset.PictureKeepRatio; - switch (preset.PicturePAR) + /* Output Settings */ + preset.Task.OptimizeMP4 = importedPreset.Mp4HttpOptimize; + preset.Task.IPod5GSupport = importedPreset.Mp4iPodCompatible; + preset.Task.OutputFormat = GetFileFormat(importedPreset.FileFormat.Replace("file", string.Empty).Trim()); // TOOD null check. + + /* Picture Settings */ + preset.PictureSettingsMode = (PresetPictureSettingsMode)importedPreset.UsesPictureSettings; + preset.Task.MaxWidth = importedPreset.PictureWidth.HasValue && importedPreset.PictureWidth.Value > 0 ? importedPreset.PictureWidth.Value : (int?)null; + preset.Task.MaxHeight = importedPreset.PictureHeight.HasValue && importedPreset.PictureHeight.Value > 0 ? importedPreset.PictureHeight.Value : (int?)null; + preset.Task.Cropping = new Cropping(importedPreset.PictureTopCrop, importedPreset.PictureBottomCrop, importedPreset.PictureLeftCrop, importedPreset.PictureRightCrop); + preset.Task.HasCropping = importedPreset.PictureAutoCrop; + + preset.Task.Modulus = importedPreset.PictureModulus; + preset.Task.KeepDisplayAspect = importedPreset.PictureKeepRatio; + switch (importedPreset.PicturePAR) { case "custom": - task.Anamorphic = Anamorphic.Custom; + preset.Task.Anamorphic = Anamorphic.Custom; break; case "loose": - task.Anamorphic = Anamorphic.Loose; + preset.Task.Anamorphic = Anamorphic.Loose; break; case "strict": - task.Anamorphic = Anamorphic.Strict; + preset.Task.Anamorphic = Anamorphic.Strict; break; default: - task.Anamorphic = Anamorphic.Loose; + preset.Task.Anamorphic = Anamorphic.Loose; break; } - /* Filter Settings */ - task.Grayscale = preset.VideoGrayScale; - task.Deblock = preset.PictureDeblock; - switch (preset.PictureDecomb) + /* Filter Settings */ + preset.Task.Grayscale = importedPreset.VideoGrayScale; + preset.Task.Deblock = importedPreset.PictureDeblock; + switch (importedPreset.PictureDecomb) { case "custom": - task.Decomb = Decomb.Custom; + preset.Task.Decomb = Decomb.Custom; break; case "default": - task.Decomb = Decomb.Default; + preset.Task.Decomb = Decomb.Default; break; case "bob": - task.Decomb = Decomb.Bob; + preset.Task.Decomb = Decomb.Bob; break; case "fast": - task.Decomb = Decomb.Fast; + preset.Task.Decomb = Decomb.Fast; break; default: - task.Decomb = Decomb.Off; + preset.Task.Decomb = Decomb.Off; break; } - task.CustomDecomb = preset.PictureDecombCustom; + preset.Task.CustomDecomb = importedPreset.PictureDecombCustom; - switch (preset.PictureDeinterlace) + switch (importedPreset.PictureDeinterlace) { case "custom": - task.Deinterlace = Deinterlace.Custom; + preset.Task.Deinterlace = Deinterlace.Custom; break; case "bob": - task.Deinterlace = Deinterlace.Bob; + preset.Task.Deinterlace = Deinterlace.Bob; break; case "gast": - task.Deinterlace = Deinterlace.Fast; + preset.Task.Deinterlace = Deinterlace.Fast; break; case "slow": - task.Deinterlace = Deinterlace.Slow; + preset.Task.Deinterlace = Deinterlace.Slow; break; case "slower": - task.Deinterlace = Deinterlace.Slower; + preset.Task.Deinterlace = Deinterlace.Slower; break; default: - task.Deinterlace = Deinterlace.Off; + preset.Task.Deinterlace = Deinterlace.Off; break; } - task.CustomDeinterlace = preset.PictureDetelecineCustom; - task.CustomDenoise = preset.PictureDenoiseCustom; - task.CustomDetelecine = preset.PictureDetelecineCustom; + preset.Task.CustomDeinterlace = importedPreset.PictureDetelecineCustom; + preset.Task.CustomDenoise = importedPreset.PictureDenoiseCustom; + preset.Task.CustomDetelecine = importedPreset.PictureDetelecineCustom; - switch (preset.PictureDetelecine) + switch (importedPreset.PictureDetelecine) { case "custom": - task.Detelecine = Detelecine.Custom; + preset.Task.Detelecine = Detelecine.Custom; break; case "default": - task.Detelecine = Detelecine.Default; + preset.Task.Detelecine = Detelecine.Default; break; default: - task.Detelecine = Detelecine.Off; + preset.Task.Detelecine = Detelecine.Off; break; } - switch (preset.PictureDenoiseFilter) + switch (importedPreset.PictureDenoiseFilter) { case "nlmeans": - task.Denoise = Denoise.NLMeans; + preset.Task.Denoise = Denoise.NLMeans; break; case "hqdn3d": - task.Denoise = Denoise.hqdn3d; + preset.Task.Denoise = Denoise.hqdn3d; break; default: - task.Denoise = Denoise.Off; + preset.Task.Denoise = Denoise.Off; break; } - switch (preset.PictureDenoisePreset) + switch (importedPreset.PictureDenoisePreset) { case "custom": - task.DenoisePreset = DenoisePreset.Custom; + preset.Task.DenoisePreset = DenoisePreset.Custom; break; case "light": - task.DenoisePreset = DenoisePreset.Light; + preset.Task.DenoisePreset = DenoisePreset.Light; break; case "medium": - task.DenoisePreset = DenoisePreset.Medium; + preset.Task.DenoisePreset = DenoisePreset.Medium; break; case "strong": - task.DenoisePreset = DenoisePreset.Strong; + preset.Task.DenoisePreset = DenoisePreset.Strong; break; case "ultralight": - task.DenoisePreset = DenoisePreset.Ultralight; + preset.Task.DenoisePreset = DenoisePreset.Ultralight; break; case "weak": - task.DenoisePreset = DenoisePreset.Weak; + preset.Task.DenoisePreset = DenoisePreset.Weak; break; } - switch (preset.PictureDenoiseTune) + switch (importedPreset.PictureDenoiseTune) { case "animation": - task.DenoiseTune = DenoiseTune.Animation; + preset.Task.DenoiseTune = DenoiseTune.Animation; break; case "film": - task.DenoiseTune = DenoiseTune.Film; + preset.Task.DenoiseTune = DenoiseTune.Film; break; case "grain": - task.DenoiseTune = DenoiseTune.Grain; + preset.Task.DenoiseTune = DenoiseTune.Grain; break; case "highnotion": - task.DenoiseTune = DenoiseTune.HighMotion; + preset.Task.DenoiseTune = DenoiseTune.HighMotion; break; default: - task.DenoiseTune = DenoiseTune.None; + preset.Task.DenoiseTune = DenoiseTune.None; break; } - /* Video Settings */ - task.VideoEncoder = EnumHelper.GetValue(preset.VideoEncoder); - task.VideoBitrate = preset.VideoAvgBitrate; - task.TwoPass = preset.VideoTwoPass; - task.TurboFirstPass = preset.VideoTurboTwoPass; - task.ExtraAdvancedArguments = preset.VideoOptionExtra; - task.Quality = double.Parse(preset.VideoQualitySlider.ToString(CultureInfo.InvariantCulture), CultureInfo.InvariantCulture); - task.VideoEncodeRateType = (VideoEncodeRateType)preset.VideoQualityType; - task.VideoLevel = new VideoLevel(preset.VideoLevel, preset.VideoLevel); - task.VideoPreset = new VideoPreset(preset.VideoPreset, preset.VideoPreset); - string[] split = preset.VideoTune.Split(','); - foreach (var item in split) + /* Video Settings */ + preset.Task.VideoEncoder = EnumHelper.GetValue(importedPreset.VideoEncoder); + preset.Task.VideoBitrate = importedPreset.VideoAvgBitrate; + preset.Task.TwoPass = importedPreset.VideoTwoPass; + preset.Task.TurboFirstPass = importedPreset.VideoTurboTwoPass; + preset.Task.ExtraAdvancedArguments = importedPreset.VideoOptionExtra; + preset.Task.Quality = double.Parse(importedPreset.VideoQualitySlider.ToString(CultureInfo.InvariantCulture), CultureInfo.InvariantCulture); + preset.Task.VideoEncodeRateType = (VideoEncodeRateType)importedPreset.VideoQualityType; + preset.Task.VideoLevel = new VideoLevel(importedPreset.VideoLevel, importedPreset.VideoLevel); + preset.Task.VideoPreset = new VideoPreset(importedPreset.VideoPreset, importedPreset.VideoPreset); + + if (!string.IsNullOrEmpty(importedPreset.VideoTune)) { - task.VideoTunes.Add(new VideoTune(item, item)); + string[] split = importedPreset.VideoTune.Split(','); + foreach (var item in split) + { + preset.Task.VideoTunes.Add(new VideoTune(item, item)); + } } - task.Framerate = preset.VideoFramerate == "auto" || string.IsNullOrEmpty(preset.VideoFramerate) + preset.Task.Framerate = importedPreset.VideoFramerate == "auto" || string.IsNullOrEmpty(importedPreset.VideoFramerate) ? (double?)null - : double.Parse(preset.VideoFramerate, CultureInfo.InvariantCulture); - string parsedValue = preset.VideoFramerateMode; + : double.Parse(importedPreset.VideoFramerate, CultureInfo.InvariantCulture); + string parsedValue = importedPreset.VideoFramerateMode; switch (parsedValue) { case "vfr": - task.FramerateMode = FramerateMode.VFR; + preset.Task.FramerateMode = FramerateMode.VFR; break; case "cfr": - task.FramerateMode = FramerateMode.CFR; + preset.Task.FramerateMode = FramerateMode.CFR; break; default: - task.FramerateMode = FramerateMode.PFR; + preset.Task.FramerateMode = FramerateMode.PFR; break; } /* Audio Settings */ - parsedPreset.AudioTrackBehaviours = new AudioBehaviours(); - task.AllowedPassthruOptions.AudioEncoderFallback = EnumHelper.GetValue(preset.AudioEncoderFallback); - parsedPreset.AudioTrackBehaviours.SelectedBehaviour = preset.AudioTrackSelectionBehavior == "all" + preset.AudioTrackBehaviours = new AudioBehaviours(); + preset.Task.AllowedPassthruOptions.AudioEncoderFallback = EnumHelper.GetValue(importedPreset.AudioEncoderFallback); + preset.AudioTrackBehaviours.SelectedBehaviour = importedPreset.AudioTrackSelectionBehavior == "all" ? AudioBehaviourModes.AllMatching - : preset.AudioTrackSelectionBehavior == "first" + : importedPreset.AudioTrackSelectionBehavior == "first" ? AudioBehaviourModes.FirstMatch : AudioBehaviourModes.None; - if (preset.AudioCopyMask != null) + if (importedPreset.AudioCopyMask != null) { - foreach (var item in preset.AudioCopyMask) + foreach (var item in importedPreset.AudioCopyMask) { AudioEncoder encoder = EnumHelper.GetValue(item.ToString()); switch (encoder) { case AudioEncoder.AacPassthru: - task.AllowedPassthruOptions.AudioAllowAACPass = true; + preset.Task.AllowedPassthruOptions.AudioAllowAACPass = true; break; case AudioEncoder.Ac3Passthrough: - task.AllowedPassthruOptions.AudioAllowAACPass = true; + preset.Task.AllowedPassthruOptions.AudioAllowAACPass = true; break; case AudioEncoder.EAc3Passthrough: - task.AllowedPassthruOptions.AudioAllowAACPass = true; + preset.Task.AllowedPassthruOptions.AudioAllowAACPass = true; break; case AudioEncoder.DtsHDPassthrough: - task.AllowedPassthruOptions.AudioAllowAACPass = true; + preset.Task.AllowedPassthruOptions.AudioAllowAACPass = true; break; case AudioEncoder.DtsPassthrough: - task.AllowedPassthruOptions.AudioAllowAACPass = true; + preset.Task.AllowedPassthruOptions.AudioAllowAACPass = true; break; case AudioEncoder.FlacPassthru: - task.AllowedPassthruOptions.AudioAllowAACPass = true; + preset.Task.AllowedPassthruOptions.AudioAllowAACPass = true; break; case AudioEncoder.Mp3Passthru: - task.AllowedPassthruOptions.AudioAllowAACPass = true; + preset.Task.AllowedPassthruOptions.AudioAllowAACPass = true; break; } } } - if (preset.AudioLanguageList != null) + if (importedPreset.AudioLanguageList != null) { - foreach (var item in preset.AudioLanguageList) + foreach (var item in importedPreset.AudioLanguageList) { - parsedPreset.AudioTrackBehaviours.SelectedLangauges.Add(item); + preset.AudioTrackBehaviours.SelectedLangauges.Add(item); } } - task.AudioTracks = new ObservableCollection(); + preset.Task.AudioTracks = new ObservableCollection(); - if (preset.AudioList != null) + if (importedPreset.AudioList != null) { - foreach (var audioTrack in preset.AudioList) + foreach (var audioTrack in importedPreset.AudioList) { AudioTrack track = new AudioTrack(); track.Bitrate = audioTrack.AudioBitrate; // track.CompressionLevel = audioTrack.AudioCompressionLevel; // track.AudioDitherMethod = audioTrack.AudioDitherMethod; - track.Encoder = EnumHelper.GetValue(audioTrack.AudioEncoder); - track.MixDown = Converters.GetAudioMixDown(audioTrack.AudioMixdown); + track.Encoder = EnumHelper.GetValue(audioTrack.AudioEncoder); + track.MixDown = Converters.GetAudioMixDown(Converters.GetMixDown(audioTrack.AudioMixdown)); // TODO refactor // track.AudioNormalizeMixLevel = audioTrack.AudioNormalizeMixLevel; track.SampleRate = audioTrack.AudioSamplerate == "auto" ? 0 : double.Parse(audioTrack.AudioSamplerate); @@ -301,31 +307,31 @@ namespace HandBrakeWPF.Services.Presets.Factories track.Gain = (int)audioTrack.AudioTrackGainSlider; track.DRC = audioTrack.AudioTrackDRCSlider; - task.AudioTracks.Add(track); + preset.Task.AudioTracks.Add(track); } } /* Subtitle Settings */ - parsedPreset.SubtitleTrackBehaviours = new SubtitleBehaviours(); + preset.SubtitleTrackBehaviours = new SubtitleBehaviours(); // parsedPreset.SubtitleTrackBehaviours.SelectedBehaviour = preset.SubtitleTrackSelectionBehavior; - parsedPreset.SubtitleTrackBehaviours.AddClosedCaptions = preset.SubtitleAddCC; - parsedPreset.SubtitleTrackBehaviours.AddForeignAudioScanTrack = preset.SubtitleAddForeignAudioSearch; - if (preset.SubtitleLanguageList != null) + preset.SubtitleTrackBehaviours.AddClosedCaptions = importedPreset.SubtitleAddCC; + preset.SubtitleTrackBehaviours.AddForeignAudioScanTrack = importedPreset.SubtitleAddForeignAudioSearch; + if (importedPreset.SubtitleLanguageList != null) { - foreach (var item in preset.SubtitleLanguageList) + foreach (var item in importedPreset.SubtitleLanguageList) { - parsedPreset.SubtitleTrackBehaviours.SelectedLangauges.Add(item); + preset.SubtitleTrackBehaviours.SelectedLangauges.Add(item); } } /* Chapter Marker Settings */ - task.IncludeChapterMarkers = preset.ChapterMarkers; + preset.Task.IncludeChapterMarkers = importedPreset.ChapterMarkers; /* Advanced Settings */ - task.ShowAdvancedTab = preset.x264UseAdvancedOptions; - task.AdvancedEncoderOptions = preset.x264Option; + preset.Task.ShowAdvancedTab = importedPreset.x264UseAdvancedOptions; + preset.Task.AdvancedEncoderOptions = importedPreset.x264Option; /* Not Supported Yet */ // public int VideoColorMatrixCode { get; set; } @@ -352,7 +358,7 @@ namespace HandBrakeWPF.Services.Presets.Factories // public int PictureDARWidth { get; set; } // public int Type { get; set; } - return parsedPreset; + return preset; } /// diff --git a/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs b/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs index b7be8bfdc..87f6188b5 100644 --- a/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs +++ b/win/CS/HandBrakeWPF/Services/Presets/PresetService.cs @@ -15,16 +15,17 @@ namespace HandBrakeWPF.Services.Presets using System.Diagnostics; using System.IO; using System.Linq; - using System.Reflection; using System.Windows; using System.Xml.Serialization; using HandBrake.ApplicationServices.Exceptions; + using HandBrake.ApplicationServices.Interop; + using HandBrake.ApplicationServices.Interop.Json.Presets; using HandBrake.ApplicationServices.Services.Encode.Model.Models; using HandBrake.ApplicationServices.Utilities; - using HandBrakeWPF.Model.Audio; using HandBrakeWPF.Services.Interfaces; + using HandBrakeWPF.Services.Presets.Factories; using HandBrakeWPF.Services.Presets.Interfaces; using HandBrakeWPF.Services.Presets.Model; @@ -122,7 +123,15 @@ namespace HandBrakeWPF.Services.Presets this.UpdateBuiltInPresets(); } + // Load the presets from file this.LoadPresets(); + + // Check they are up-to-date. + if (this.CheckIfPresetsAreOutOfDate()) + { + this.UpdateBuiltInPresets(); + this.LoadPresets(); // Reload again. + } } /// @@ -277,54 +286,41 @@ namespace HandBrakeWPF.Services.Presets // Clear the current built in Presets and now parse the tempory Presets file. this.ClearBuiltIn(); - using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("HandBrakeWPF.Presets.dat")) + IList presetCategories = HandBrakePresetService.GetBuiltInPresets(); + + foreach (var item in presetCategories) { - using (StreamReader reader = new StreamReader(stream)) + foreach (var hbpreset in item.ChildrenArray) { - // New Preset Format. - try - { - string json = reader.ReadToEnd(); - var presetList = JsonConvert.DeserializeObject>(json); + Preset preset = JsonPresetFactory.ImportPreset(hbpreset); + 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.Category = item.PresetName; - foreach (Preset preset in presetList) - { - 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; - } - - preset.Task.AllowedPassthruOptions = new AllowedPassthru(true); // We don't want to override the built-in preset - - if (preset.Name == "Normal") - { - preset.IsDefault = true; - } + if (preset.Name == "iPod") + { + preset.Task.KeepDisplayAspect = true; + } - this.presets.Add(preset); - } + preset.Task.AllowedPassthruOptions = new AllowedPassthru(true); // We don't want to override the built-in preset - // Verify we have presets. - if (this.presets.Count == 0) - { - throw new GeneralApplicationException("Failed to load built-in presets.", "Restarting HandBrake may resolve this issue", new Exception(json)); - } - } - catch (Exception exc) + if (preset.Name == "Normal") { - // Do Nothing. - Debug.WriteLine(exc); + preset.IsDefault = true; } + + this.presets.Add(preset); } } - // Finally, Create a new or update the current Presets.xml file + // Verify we have presets. + if (this.presets.Count == 0) + { + throw new GeneralApplicationException("Failed to load built-in presets.", "Restarting HandBrake may resolve this issue", null); + } + + // Store the changes to disk this.UpdatePresetFiles(); } @@ -537,7 +533,7 @@ namespace HandBrakeWPF.Services.Presets // We did a preset convertion, so save the updates. if (updatePresets) { - UpdatePresetFiles(); + this.UpdatePresetFiles(); } } catch (Exception exc) @@ -564,11 +560,11 @@ namespace HandBrakeWPF.Services.Presets JsonSerializerSettings settings = new JsonSerializerSettings { MissingMemberHandling = MissingMemberHandling.Ignore }; // Built-in Presets - + using (FileStream strm = new FileStream(this.builtInPresetFile, FileMode.Create, FileAccess.Write)) { string presetsJson = JsonConvert.SerializeObject(this.presets.Where(p => p.IsBuildIn).ToList(), Formatting.Indented, settings); - using (StreamWriter writer = new StreamWriter(strm)) + using (StreamWriter writer = new StreamWriter(strm)) { writer.WriteLine(presetsJson); } -- cgit v1.2.3