From 5c5b4d7773126d3f4852deb01856c905d2398b5e Mon Sep 17 00:00:00 2001 From: sr55 Date: Tue, 5 Jun 2018 21:52:23 +0100 Subject: [PATCH] WinGui: Rename HandBrake.ApplicationServices back to HandBrake.Interop. It's moving back to being more of an libhb interop/abstraction library only. --- .../Docs/Readme.txt | 3 - .../Attributes/DisplayName.cs | 2 +- .../Attributes/ShortName.cs | 70 +- .../HandBrake.Interop.csproj} | 394 ++--- .../HandBrake.Interop.nuspec} | 2 +- .../EventArgs/EncodeCompletedEventArgs.cs | 70 +- .../EventArgs/EncodeProgressEventArgs.cs | 240 +-- .../EventArgs/MessageLoggedEventArgs.cs | 70 +- .../EventArgs/ScanProgressEventArgs.cs | 142 +- .../Interop/Factories/AnamorphicFactory.cs | 188 +-- .../Interop/HandBrakeEncoderHelpers.cs | 1332 ++++++++--------- .../Interop/HandBrakeFilterHelpers.cs | 14 +- .../Interop/HandBrakeInstance.cs | 1104 +++++++------- .../Interop/HandBrakeInstanceManager.cs | 342 ++--- .../Interop/HandBrakeLanguagesHelper.cs | 104 +- .../Interop/HandBrakePresetService.cs | 184 +-- .../Interop/HandBrakeUnitConversionHelpers.cs | 382 ++--- .../Interop/HandBrakeUtils.cs | 692 ++++----- .../Interop/HbLib/HBDelegates.cs | 34 +- .../Interop/HbLib/HbFunctions.cs | 924 ++++++------ .../Interop/HbLib/NativeConstants.cs | 138 +- .../Interop/HbLib/hb_anamorphic_mode_t.cs | 42 +- .../Interop/HbLib/hb_container_s.cs | 58 +- .../Interop/HbLib/hb_encoder_s.cs | 56 +- .../Interop/HbLib/hb_error_code.cs | 48 +- .../Interop/HbLib/hb_filter_ids.cs | 92 +- .../Interop/HbLib/hb_geometry.cs | 200 +-- .../Interop/HbLib/hb_image_s.cs | 82 +- .../Interop/HbLib/hb_mixdown_s.cs | 50 +- .../Interop/HbLib/hb_rate_s.cs | 44 +- .../Interop/HbLib/hb_subtitle.cs | 56 +- .../Interop/HbLib/iso639_lang_t.cs | 58 +- .../Interop/Helpers/InteropUtilities.cs | 566 +++---- .../Interop/Helpers/NativeList.cs | 254 ++-- .../Interop/Helpers/Utilities.cs | 98 +- .../Interop/Interfaces/IHandBrakeInstance.cs | 300 ++-- .../Json/Anamorphic/AnamorphicGeometry.cs | 56 +- .../Interop/Json/Anamorphic/DestSettings.cs | 136 +- .../Interop/Json/Encode/Audio.cs | 66 +- .../Interop/Json/Encode/AudioTrack.cs | 152 +- .../Interop/Json/Encode/Chapter.cs | 42 +- .../Interop/Json/Encode/Destination.cs | 96 +- .../Interop/Json/Encode/Filter.cs | 56 +- .../Interop/Json/Encode/Filters.cs | 48 +- .../Interop/Json/Encode/JsonEncodeObject.cs | 126 +- .../Interop/Json/Encode/Metadata.cs} | 122 +- .../Interop/Json/Encode/Mp4Options.cs | 52 +- .../Interop/Json/Encode/QSV.cs | 54 +- .../Interop/Json/Encode/Range.cs | 74 +- .../Interop/Json/Encode/SRT.cs | 62 +- .../Interop/Json/Encode/Source.cs | 72 +- .../Interop/Json/Encode/SubtitleSearch.cs | 72 +- .../Interop/Json/Encode/SubtitleTrack.cs | 102 +- .../Interop/Json/Encode/Subtitles.cs | 56 +- .../Interop/Json/Encode/Video.cs | 178 +-- .../Interop/Json/Filters/PresetTune.cs | 2 +- .../Interop/Json/Presets/AudioList.cs | 142 +- .../Interop/Json/Presets/HBPreset.cs | 830 +++++----- .../Interop/Json/Presets/PresetCategory.cs | 86 +- .../Json/Presets/PresetTransportContainer.cs | 134 +- .../Interop/Json/Queue/Task.cs | 4 +- .../Interop/Json/Scan/AudioAttributes.cs | 2 +- .../Interop/Json/Scan/Color.cs | 62 +- .../Interop/Json/Scan/Duration.cs | 72 +- .../Interop/Json/Scan/FrameRate.cs | 52 +- .../Interop/Json/Scan/JsonScanObject.cs | 56 +- .../Interop/Json/Scan/SourceAudioTrack.cs | 122 +- .../Interop/Json/Scan/SourceChapter.cs | 52 +- .../Interop/Json/Scan/SourceMetadata.cs | 2 +- .../Interop/Json/Scan/SourceSubtitleTrack.cs | 2 +- .../Interop/Json/Scan/SourceTitle.cs | 170 +-- .../Interop/Json/Scan/SubtitleAttributes.cs | 2 +- .../Interop/Json/Shared/Geometry.cs | 62 +- .../Interop/Json/Shared/PAR.cs | 52 +- .../Interop/Json/State/JsonState.cs | 72 +- .../Interop/Json/State/Scanning.cs | 82 +- .../Interop/Json/State/TaskState.cs | 2 +- .../Interop/Json/State/WorkDone.cs | 42 +- .../Interop/Json/State/Working.cs | 144 +- .../Interop/Model/BitrateLimits.cs | 84 +- .../Interop/Model/Cropping.cs | 198 +-- .../Interop/Model/Encoding/Anamorphic.cs | 62 +- .../Interop/Model/Encoding/CombDetect.cs | 4 +- .../Interop/Model/Encoding/Container.cs | 58 +- .../Interop/Model/Encoding/Decomb.cs | 68 +- .../Interop/Model/Encoding/Deinterlace.cs | 62 +- .../Model/Encoding/DeinterlaceFilter.cs | 4 +- .../Interop/Model/Encoding/Denoise.cs | 56 +- .../Interop/Model/Encoding/Detelecine.cs | 52 +- .../Interop/Model/Encoding/HBAudioEncoder.cs | 260 ++-- .../Interop/Model/Encoding/HBContainer.cs | 118 +- .../Interop/Model/Encoding/HBMixdown.cs | 100 +- .../Interop/Model/Encoding/HBPresetTune.cs | 2 +- .../Interop/Model/Encoding/HBRate.cs | 84 +- .../Interop/Model/Encoding/HBVideoEncoder.cs | 216 +-- .../Interop/Model/Encoding/PictureRotation.cs | 44 +- .../Interop/Model/Encoding/ScaleMethod.cs | 54 +- .../Interop/Model/Encoding/Sharpen.cs | 4 +- .../Model/Encoding/VideoEncodeRateType.cs | 42 +- .../Interop/Model/Encoding/VideoEncoder.cs | 142 +- .../Interop/Model/Language.cs | 134 +- .../Interop/Model/Preview/PreviewSettings.cs | 162 +- .../Interop/Model/Preview/RawPreviewData.cs | 2 +- .../Interop/Model/RangeLimits.cs | 118 +- .../Interop/Model/Size.cs | 118 +- .../Interop/Model/SourceVideoInfo.cs | 84 +- .../Interop/Model/VideoQualityLimits.cs | 120 +- .../Model/HBConfiguration.cs | 134 +- .../Model/VideoScaler.cs | 46 +- .../Properties/AssemblyInfo.cs | 94 +- .../Properties/Resources.Designer.cs | 126 +- .../Properties/Resources.resx | 238 +-- .../Utilities/CharCodesUtilities.cs | 126 +- .../Utilities/LanguageUtilities.cs | 624 ++++---- .../Utilities/SystemInfo.cs | 188 +-- .../Utilities/VersionHelper.cs | 106 +- .../app.config | 16 +- .../packages.config | 0 win/CS/HandBrake.sln | 2 +- win/CS/HandBrakeAppX/HandBrakeAppX.jsproj | 4 +- win/CS/HandBrakeCS.csproj | 8 +- .../Audio/AudioBehaviourConverter.cs | 2 +- .../Converters/Audio/AudioEncoderConverter.cs | 4 +- .../Converters/Audio/AudioMixdownConverter.cs | 4 +- .../Audio/AudioMixdownListConverter.cs | 4 +- .../Audio/AudioQueueDisplayConverter.cs | 2 +- .../Audio/AudioRateTypeConverter.cs | 2 +- .../AudioTrackDefaultBehaviourConverter.cs | 2 +- .../Converters/EnumComboConverter.cs | 4 +- .../Filters/DenoisePresetConverter.cs | 2 +- .../Filters/SharpenPresetConverter.cs | 6 +- .../Filters/SharpenTuneConverter.cs | 6 +- .../Options/OptionsTabNameConverter.cs | 2 +- .../Queue/PictureSettingsDescConveter.cs | 2 +- .../Subtitles/SubtitleBehaviourConverter.cs | 2 +- .../Video/EncoderOptionsTooltipConverter.cs | 2 +- .../Converters/Video/ScalingConverter.cs | 4 +- .../Converters/Video/VideoEncoderConverter.cs | 6 +- .../Video/VideoOptionsTooltipConverter.cs | 2 +- .../EventArgs/QueueProgressEventArgs.cs | 2 +- .../Factories/HBConfigurationFactory.cs | 2 +- win/CS/HandBrakeWPF/HandBrakeWPF.csproj | 12 +- win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs | 2 +- win/CS/HandBrakeWPF/Helpers/LogManager.cs | 6 +- win/CS/HandBrakeWPF/Helpers/PictureSize.cs | 6 +- .../Helpers/QueueRecoveryHelper.cs | 2 +- .../Model/Audio/AudioBehaviourModes.cs | 2 +- .../Model/Audio/AudioBehaviourTrack.cs | 6 +- .../Model/Audio/AudioTrackDefaultsMode.cs | 2 +- .../Model/Filters/FilterPreset.cs | 2 +- .../HandBrakeWPF/Model/Filters/FilterTune.cs | 2 +- win/CS/HandBrakeWPF/Model/OptionsTab.cs | 2 +- .../Picture/PresetPictureSettingsMode.cs | 2 +- .../Model/Subtitles/SubtitleBehaviourModes.cs | 2 +- .../Subtitles/SubtitleBurnInBehaviourModes.cs | 2 +- .../Services/Encode/EncodeBase.cs | 4 +- .../Encode/Factories/EncodeFactory.cs | 28 +- .../Services/Encode/Factories/QueueFactory.cs | 4 +- .../Services/Encode/Interfaces/IEncode.cs | 2 +- .../HandBrakeWPF/Services/Encode/LibEncode.cs | 10 +- .../Services/Encode/Model/EncodeTask.cs | 4 +- .../Encode/Model/Models/AudioEncoder.cs | 2 +- .../Model/Models/AudioEncoderRateType.cs | 2 +- .../Encode/Model/Models/AudioTrack.cs | 6 +- .../Encode/Model/Models/DenoisePreset.cs | 2 +- .../Encode/Model/Models/DenoiseTune.cs | 2 +- .../Encode/Model/Models/FramerateMode.cs | 2 +- .../Encode/Model/Models/OutputFormat.cs | 2 +- .../Encode/Model/Models/PointToPointMode.cs | 2 +- .../Encode/Model/Models/SubtitleTrack.cs | 2 +- .../Services/Logging/LogService.cs | 4 +- .../Services/PrePostActionService.cs | 2 +- .../Presets/Factories/JsonPresetFactory.cs | 14 +- .../Presets/Interfaces/IPresetService.cs | 2 +- .../Services/Presets/PresetService.cs | 8 +- .../Services/Queue/Model/QueueItemStatus.cs | 2 +- .../Services/Queue/Model/QueueTask.cs | 2 +- .../Services/Queue/QueueProcessor.cs | 4 +- .../Services/Scan/Interfaces/IScan.cs | 2 +- win/CS/HandBrakeWPF/Services/Scan/LibScan.cs | 18 +- .../Services/Scan/Model/Subtitle.cs | 2 +- .../HandBrakeWPF/Services/Scan/Model/Title.cs | 2 +- win/CS/HandBrakeWPF/Services/UpdateService.cs | 4 +- .../Services/UserSettingService.cs | 2 +- .../HandBrakeWPF/Utilities/BitmapUtilities.cs | 2 +- win/CS/HandBrakeWPF/Utilities/EnumHelper.cs | 2 +- .../Utilities/GeneralUtilities.cs | 2 +- win/CS/HandBrakeWPF/Utilities/HandBrakeApp.cs | 2 +- win/CS/HandBrakeWPF/Utilities/SystemInfo.cs | 2 +- .../HandBrakeWPF/ViewModels/AboutViewModel.cs | 2 +- .../ViewModels/AddPresetViewModel.cs | 2 +- .../ViewModels/AudioDefaultsViewModel.cs | 6 +- .../HandBrakeWPF/ViewModels/AudioViewModel.cs | 6 +- .../ViewModels/FiltersViewModel.cs | 6 +- .../ViewModels/Interfaces/IX264ViewModel.cs | 2 +- .../HandBrakeWPF/ViewModels/MainViewModel.cs | 2 +- .../ViewModels/OptionsViewModel.cs | 6 +- .../ViewModels/PictureSettingsViewModel.cs | 6 +- .../ViewModels/StaticPreviewViewModel.cs | 2 +- .../ViewModels/SubtitlesDefaultsViewModel.cs | 2 +- .../ViewModels/SubtitlesViewModel.cs | 2 +- .../ViewModels/SummaryViewModel.cs | 4 +- .../HandBrakeWPF/ViewModels/VideoViewModel.cs | 4 +- .../HandBrakeWPF/ViewModels/X264ViewModel.cs | 2 +- win/CS/build.xml | 4 +- 205 files changed, 8392 insertions(+), 8399 deletions(-) delete mode 100644 win/CS/HandBrake.ApplicationServices/Docs/Readme.txt rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Attributes/DisplayName.cs (95%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Attributes/ShortName.cs (92%) rename win/CS/{HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj => HandBrake.Interop/HandBrake.Interop.csproj} (96%) rename win/CS/{HandBrake.ApplicationServices/HandBrake.ApplicationServices.nuspec => HandBrake.Interop/HandBrake.Interop.nuspec} (89%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/EventArgs/EncodeCompletedEventArgs.cs (92%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/EventArgs/EncodeProgressEventArgs.cs (95%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/EventArgs/MessageLoggedEventArgs.cs (92%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/EventArgs/ScanProgressEventArgs.cs (94%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Factories/AnamorphicFactory.cs (88%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/HandBrakeEncoderHelpers.cs (95%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/HandBrakeFilterHelpers.cs (90%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/HandBrakeInstance.cs (93%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/HandBrakeInstanceManager.cs (94%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/HandBrakeLanguagesHelper.cs (87%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/HandBrakePresetService.cs (90%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/HandBrakeUnitConversionHelpers.cs (93%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/HandBrakeUtils.cs (94%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/HbLib/HBDelegates.cs (91%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/HbLib/HbFunctions.cs (98%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/HbLib/NativeConstants.cs (96%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/HbLib/hb_anamorphic_mode_t.cs (91%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/HbLib/hb_container_s.cs (92%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/HbLib/hb_encoder_s.cs (92%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/HbLib/hb_error_code.cs (91%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/HbLib/hb_filter_ids.cs (94%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/HbLib/hb_geometry.cs (94%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/HbLib/hb_image_s.cs (92%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/HbLib/hb_mixdown_s.cs (91%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/HbLib/hb_rate_s.cs (91%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/HbLib/hb_subtitle.cs (90%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/HbLib/iso639_lang_t.cs (92%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Helpers/InteropUtilities.cs (96%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Helpers/NativeList.cs (94%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Helpers/Utilities.cs (92%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Interfaces/IHandBrakeInstance.cs (90%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Json/Anamorphic/AnamorphicGeometry.cs (85%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Json/Anamorphic/DestSettings.cs (91%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Json/Encode/Audio.cs (91%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Json/Encode/AudioTrack.cs (94%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Json/Encode/Chapter.cs (90%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Json/Encode/Destination.cs (93%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Json/Encode/Filter.cs (90%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Json/Encode/Filters.cs (90%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Json/Encode/JsonEncodeObject.cs (90%) rename win/CS/{HandBrake.ApplicationServices/Interop/Json/Encode/MetaData.cs => HandBrake.Interop/Interop/Json/Encode/Metadata.cs} (93%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Json/Encode/Mp4Options.cs (91%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Json/Encode/QSV.cs (90%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Json/Encode/Range.cs (92%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Json/Encode/SRT.cs (91%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Json/Encode/Source.cs (91%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Json/Encode/SubtitleSearch.cs (92%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Json/Encode/SubtitleTrack.cs (93%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Json/Encode/Subtitles.cs (91%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Json/Encode/Video.cs (94%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Json/Filters/PresetTune.cs (93%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Json/Presets/AudioList.cs (94%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Json/Presets/HBPreset.cs (96%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Json/Presets/PresetCategory.cs (92%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Json/Presets/PresetTransportContainer.cs (94%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Json/Queue/Task.cs (85%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Json/Scan/AudioAttributes.cs (93%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Json/Scan/Color.cs (91%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Json/Scan/Duration.cs (92%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Json/Scan/FrameRate.cs (90%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Json/Scan/JsonScanObject.cs (91%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Json/Scan/SourceAudioTrack.cs (93%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Json/Scan/SourceChapter.cs (91%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Json/Scan/SourceMetadata.cs (91%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Json/Scan/SourceSubtitleTrack.cs (95%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Json/Scan/SourceTitle.cs (93%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Json/Scan/SubtitleAttributes.cs (95%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Json/Shared/Geometry.cs (91%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Json/Shared/PAR.cs (90%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Json/State/JsonState.cs (92%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Json/State/Scanning.cs (92%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Json/State/TaskState.cs (97%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Json/State/WorkDone.cs (90%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Json/State/Working.cs (93%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Model/BitrateLimits.cs (93%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Model/Cropping.cs (94%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Model/Encoding/Anamorphic.cs (86%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Model/Encoding/CombDetect.cs (88%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Model/Encoding/Container.cs (84%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Model/Encoding/Decomb.cs (85%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Model/Encoding/Deinterlace.cs (85%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Model/Encoding/DeinterlaceFilter.cs (87%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Model/Encoding/Denoise.cs (84%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Model/Encoding/Detelecine.cs (84%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Model/Encoding/HBAudioEncoder.cs (94%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Model/Encoding/HBContainer.cs (93%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Model/Encoding/HBMixdown.cs (93%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Model/Encoding/HBPresetTune.cs (95%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Model/Encoding/HBRate.cs (92%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Model/Encoding/HBVideoEncoder.cs (92%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Model/Encoding/PictureRotation.cs (89%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Model/Encoding/ScaleMethod.cs (90%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Model/Encoding/Sharpen.cs (86%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Model/Encoding/VideoEncodeRateType.cs (89%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Model/Encoding/VideoEncoder.cs (90%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Model/Language.cs (94%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Model/Preview/PreviewSettings.cs (94%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Model/Preview/RawPreviewData.cs (94%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Model/RangeLimits.cs (94%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Model/Size.cs (93%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Model/SourceVideoInfo.cs (93%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Interop/Model/VideoQualityLimits.cs (94%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Model/HBConfiguration.cs (95%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Model/VideoScaler.cs (86%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Properties/AssemblyInfo.cs (95%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Properties/Resources.Designer.cs (91%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Properties/Resources.resx (97%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Utilities/CharCodesUtilities.cs (94%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Utilities/LanguageUtilities.cs (96%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Utilities/SystemInfo.cs (95%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/Utilities/VersionHelper.cs (89%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/app.config (96%) rename win/CS/{HandBrake.ApplicationServices => HandBrake.Interop}/packages.config (100%) diff --git a/win/CS/HandBrake.ApplicationServices/Docs/Readme.txt b/win/CS/HandBrake.ApplicationServices/Docs/Readme.txt deleted file mode 100644 index 69d4b85d9..000000000 --- a/win/CS/HandBrake.ApplicationServices/Docs/Readme.txt +++ /dev/null @@ -1,3 +0,0 @@ -Library: HandBrake.ApplicationServices.dll -Description: A C# Wrapper library around LibHB. This wrapper library exposes the main scan and encode functions of the JSON API and many helper functions. -Usage: See the IHandBrakeInstance interface. \ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Attributes/DisplayName.cs b/win/CS/HandBrake.Interop/Attributes/DisplayName.cs similarity index 95% rename from win/CS/HandBrake.ApplicationServices/Attributes/DisplayName.cs rename to win/CS/HandBrake.Interop/Attributes/DisplayName.cs index e96c9ab73..a890d97f1 100644 --- a/win/CS/HandBrake.ApplicationServices/Attributes/DisplayName.cs +++ b/win/CS/HandBrake.Interop/Attributes/DisplayName.cs @@ -7,7 +7,7 @@ // // -------------------------------------------------------------------------------------------------------------------- -namespace HandBrake.ApplicationServices.Attributes +namespace HandBrake.Interop.Attributes { using System; diff --git a/win/CS/HandBrake.ApplicationServices/Attributes/ShortName.cs b/win/CS/HandBrake.Interop/Attributes/ShortName.cs similarity index 92% rename from win/CS/HandBrake.ApplicationServices/Attributes/ShortName.cs rename to win/CS/HandBrake.Interop/Attributes/ShortName.cs index ba70fdf95..1f5ef6700 100644 --- a/win/CS/HandBrake.ApplicationServices/Attributes/ShortName.cs +++ b/win/CS/HandBrake.Interop/Attributes/ShortName.cs @@ -1,35 +1,35 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// A Short Name for an enum value -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Attributes -{ - using System; - - /// - /// A Short Name for an enum value - /// - public class ShortName : Attribute - { - /// - /// Initializes a new instance of the class. - /// - /// - /// The short name. - /// - public ShortName(string shortName) - { - this.Name = shortName; - } - - /// - /// Gets the short name. - /// - public string Name { get; private set; } - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// A Short Name for an enum value +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Attributes +{ + using System; + + /// + /// A Short Name for an enum value + /// + public class ShortName : Attribute + { + /// + /// Initializes a new instance of the class. + /// + /// + /// The short name. + /// + public ShortName(string shortName) + { + this.Name = shortName; + } + + /// + /// Gets the short name. + /// + public string Name { get; private set; } + } +} diff --git a/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj b/win/CS/HandBrake.Interop/HandBrake.Interop.csproj similarity index 96% rename from win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj rename to win/CS/HandBrake.Interop/HandBrake.Interop.csproj index e55e0e039..09e73d0f5 100644 --- a/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj +++ b/win/CS/HandBrake.Interop/HandBrake.Interop.csproj @@ -1,198 +1,198 @@ - - - - Debug - x64 - {087A2BA8-BAC2-4577-A46F-07FF9D420016} - Library - Properties - HandBrake.ApplicationServices - HandBrake.ApplicationServices - v4.7.1 - 512 - - - - - - - - x64 - bin\Debug\ - TRACE;DEBUG - true - false - ..\HandBrake.ruleset - - - AnyCPU - bin\Release\ - DEBUG;TRACE - true - pdbonly - true - false - - - - - ..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll - - - - 3.5 - - - 3.5 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - True - True - Resources.resx - - - - - - - stylecop.json - - - - - - - - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - - - - - - + + + + Debug + x64 + {087A2BA8-BAC2-4577-A46F-07FF9D420016} + Library + Properties + HandBrake.Interop + HandBrake.Interop + v4.7.1 + 512 + + + + + + + + x64 + bin\Debug\ + TRACE;DEBUG + true + false + ..\HandBrake.ruleset + + + AnyCPU + bin\Release\ + DEBUG;TRACE + true + pdbonly + true + false + + + + + ..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll + + + + 3.5 + + + 3.5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + True + True + Resources.resx + + + + + + + stylecop.json + + + + + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + + + + + + \ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.nuspec b/win/CS/HandBrake.Interop/HandBrake.Interop.nuspec similarity index 89% rename from win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.nuspec rename to win/CS/HandBrake.Interop/HandBrake.Interop.nuspec index 4e7eb56f7..42a383f9f 100644 --- a/win/CS/HandBrake.ApplicationServices/HandBrake.ApplicationServices.nuspec +++ b/win/CS/HandBrake.Interop/HandBrake.Interop.nuspec @@ -20,6 +20,6 @@ - + \ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/EventArgs/EncodeCompletedEventArgs.cs b/win/CS/HandBrake.Interop/Interop/EventArgs/EncodeCompletedEventArgs.cs similarity index 92% rename from win/CS/HandBrake.ApplicationServices/Interop/EventArgs/EncodeCompletedEventArgs.cs rename to win/CS/HandBrake.Interop/Interop/EventArgs/EncodeCompletedEventArgs.cs index 52b5719fe..ea54e1d1c 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/EventArgs/EncodeCompletedEventArgs.cs +++ b/win/CS/HandBrake.Interop/Interop/EventArgs/EncodeCompletedEventArgs.cs @@ -1,35 +1,35 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// Defines the EncodeCompletedEventArgs type. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.EventArgs -{ - using System; - - /// - /// Encode Completed Event Args - /// - public class EncodeCompletedEventArgs : EventArgs - { - /// - /// Initializes a new instance of the class. - /// - /// - /// The error. - /// - public EncodeCompletedEventArgs(bool error) - { - this.Error = error; - } - - /// - /// Gets a value indicating whether an error occurred during the encode. - /// - public bool Error { get; private set; } - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Defines the EncodeCompletedEventArgs type. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.EventArgs +{ + using System; + + /// + /// Encode Completed Event Args + /// + public class EncodeCompletedEventArgs : EventArgs + { + /// + /// Initializes a new instance of the class. + /// + /// + /// The error. + /// + public EncodeCompletedEventArgs(bool error) + { + this.Error = error; + } + + /// + /// Gets a value indicating whether an error occurred during the encode. + /// + public bool Error { get; private set; } + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Interop/EventArgs/EncodeProgressEventArgs.cs b/win/CS/HandBrake.Interop/Interop/EventArgs/EncodeProgressEventArgs.cs similarity index 95% rename from win/CS/HandBrake.ApplicationServices/Interop/EventArgs/EncodeProgressEventArgs.cs rename to win/CS/HandBrake.Interop/Interop/EventArgs/EncodeProgressEventArgs.cs index c43ac42d9..303995194 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/EventArgs/EncodeProgressEventArgs.cs +++ b/win/CS/HandBrake.Interop/Interop/EventArgs/EncodeProgressEventArgs.cs @@ -1,120 +1,120 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// Defines the EncodeProgressEventArgs type. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.EventArgs -{ - using System; - - /// s - /// Encode Progress Event Args - /// - public class EncodeProgressEventArgs : EventArgs - { - /// - /// Initializes a new instance of the class. - /// - /// - /// The fraction complete. - /// - /// - /// The current frame rate. - /// - /// - /// The average frame rate. - /// - /// - /// The estimated time left. - /// - /// - /// The pass id. - /// - /// - /// The pass. - /// - /// - /// The pass count. - /// - /// - /// The code for the state the encode process is in. - /// - public EncodeProgressEventArgs(double fractionComplete, double currentFrameRate, double averageFrameRate, TimeSpan estimatedTimeLeft, int passId, int pass, int passCount, string stateCode) - { - this.FractionComplete = fractionComplete; - this.CurrentFrameRate = currentFrameRate; - this.AverageFrameRate = averageFrameRate; - this.EstimatedTimeLeft = estimatedTimeLeft; - this.PassId = passId; - this.Pass = pass; - this.PassCount = passCount; - this.StateCode = stateCode; - } - - /// - /// Gets the % Complete. - /// - public double FractionComplete { get; private set; } - - /// - /// Gets the Current FrameRate. - /// - public double CurrentFrameRate { get; private set; } - - /// - /// Gets the Average FrameRate. - /// - public double AverageFrameRate { get; private set; } - - /// - /// Gets the Estimated Time Left. - /// - public TimeSpan EstimatedTimeLeft { get; private set; } - - /// - /// Gets the pass ID. - /// - /// - /// -1: Subtitle scan - /// 0: Encode - /// 1: Encode first pass - /// 2: Encode second pass - /// - public int PassId { get; private set; } - - /// - /// Gets the current encoding pass. (1-based) - /// - public int Pass { get; private set; } - - /// - /// Gets the pass count. - /// - public int PassCount { get; private set; } - - /// - /// Gets the state code of the encode process. - /// - public string StateCode { get; } - - /// - /// Gets a value indicating that we are doing a subtitle scan pass. - /// - public bool IsSubtitleScan - { - get - { - if (this.PassId == -1) - { - return true; - } - - return false; - } - } - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Defines the EncodeProgressEventArgs type. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.EventArgs +{ + using System; + + /// s + /// Encode Progress Event Args + /// + public class EncodeProgressEventArgs : EventArgs + { + /// + /// Initializes a new instance of the class. + /// + /// + /// The fraction complete. + /// + /// + /// The current frame rate. + /// + /// + /// The average frame rate. + /// + /// + /// The estimated time left. + /// + /// + /// The pass id. + /// + /// + /// The pass. + /// + /// + /// The pass count. + /// + /// + /// The code for the state the encode process is in. + /// + public EncodeProgressEventArgs(double fractionComplete, double currentFrameRate, double averageFrameRate, TimeSpan estimatedTimeLeft, int passId, int pass, int passCount, string stateCode) + { + this.FractionComplete = fractionComplete; + this.CurrentFrameRate = currentFrameRate; + this.AverageFrameRate = averageFrameRate; + this.EstimatedTimeLeft = estimatedTimeLeft; + this.PassId = passId; + this.Pass = pass; + this.PassCount = passCount; + this.StateCode = stateCode; + } + + /// + /// Gets the % Complete. + /// + public double FractionComplete { get; private set; } + + /// + /// Gets the Current FrameRate. + /// + public double CurrentFrameRate { get; private set; } + + /// + /// Gets the Average FrameRate. + /// + public double AverageFrameRate { get; private set; } + + /// + /// Gets the Estimated Time Left. + /// + public TimeSpan EstimatedTimeLeft { get; private set; } + + /// + /// Gets the pass ID. + /// + /// + /// -1: Subtitle scan + /// 0: Encode + /// 1: Encode first pass + /// 2: Encode second pass + /// + public int PassId { get; private set; } + + /// + /// Gets the current encoding pass. (1-based) + /// + public int Pass { get; private set; } + + /// + /// Gets the pass count. + /// + public int PassCount { get; private set; } + + /// + /// Gets the state code of the encode process. + /// + public string StateCode { get; } + + /// + /// Gets a value indicating that we are doing a subtitle scan pass. + /// + public bool IsSubtitleScan + { + get + { + if (this.PassId == -1) + { + return true; + } + + return false; + } + } + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Interop/EventArgs/MessageLoggedEventArgs.cs b/win/CS/HandBrake.Interop/Interop/EventArgs/MessageLoggedEventArgs.cs similarity index 92% rename from win/CS/HandBrake.ApplicationServices/Interop/EventArgs/MessageLoggedEventArgs.cs rename to win/CS/HandBrake.Interop/Interop/EventArgs/MessageLoggedEventArgs.cs index 610ab0a77..2359fff5d 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/EventArgs/MessageLoggedEventArgs.cs +++ b/win/CS/HandBrake.Interop/Interop/EventArgs/MessageLoggedEventArgs.cs @@ -1,35 +1,35 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// Defines the MessageLoggedEventArgs type. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.EventArgs -{ - using System; - - /// - /// The Message Logged Event Args - /// - public class MessageLoggedEventArgs : EventArgs - { - /// - /// Initializes a new instance of the class. - /// - /// - /// The message. - /// - public MessageLoggedEventArgs(string message) - { - this.Message = message; - } - - /// - /// Gets the Message. - /// - public string Message { get; private set; } - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Defines the MessageLoggedEventArgs type. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.EventArgs +{ + using System; + + /// + /// The Message Logged Event Args + /// + public class MessageLoggedEventArgs : EventArgs + { + /// + /// Initializes a new instance of the class. + /// + /// + /// The message. + /// + public MessageLoggedEventArgs(string message) + { + this.Message = message; + } + + /// + /// Gets the Message. + /// + public string Message { get; private set; } + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Interop/EventArgs/ScanProgressEventArgs.cs b/win/CS/HandBrake.Interop/Interop/EventArgs/ScanProgressEventArgs.cs similarity index 94% rename from win/CS/HandBrake.ApplicationServices/Interop/EventArgs/ScanProgressEventArgs.cs rename to win/CS/HandBrake.Interop/Interop/EventArgs/ScanProgressEventArgs.cs index 78737943e..8e87552a2 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/EventArgs/ScanProgressEventArgs.cs +++ b/win/CS/HandBrake.Interop/Interop/EventArgs/ScanProgressEventArgs.cs @@ -1,71 +1,71 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// Defines the ScanProgressEventArgs type. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.EventArgs -{ - using System; - - /// - /// The Scan Progress Event Args - /// - public class ScanProgressEventArgs : EventArgs - { - /// - /// Initializes a new instance of the class. - /// - /// - /// The progress. - /// - /// - /// The current preview. - /// - /// - /// The previews. - /// - /// - /// The current title. - /// - /// - /// The titles. - /// - public ScanProgressEventArgs(double progress, int currentPreview, int previews, int currentTitle, int titles) - { - this.Progress = progress; - this.CurrentPreview = currentPreview; - this.Previews = previews; - this.CurrentTitle = currentTitle; - this.Titles = titles; - } - - /// - /// Gets the total progress fraction for the scan. - /// - public double Progress { get; private set; } - - /// - /// Gets the current preview being processed on the scan. - /// - public int CurrentPreview { get; private set; } - - /// - /// Gets the total number of previews to process. - /// - public int Previews { get; private set; } - - /// - /// Gets the current title being processed on the scan. - /// - public int CurrentTitle { get; private set; } - - /// - /// Gets the total number of titles to process. - /// - public int Titles { get; private set; } - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Defines the ScanProgressEventArgs type. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.EventArgs +{ + using System; + + /// + /// The Scan Progress Event Args + /// + public class ScanProgressEventArgs : EventArgs + { + /// + /// Initializes a new instance of the class. + /// + /// + /// The progress. + /// + /// + /// The current preview. + /// + /// + /// The previews. + /// + /// + /// The current title. + /// + /// + /// The titles. + /// + public ScanProgressEventArgs(double progress, int currentPreview, int previews, int currentTitle, int titles) + { + this.Progress = progress; + this.CurrentPreview = currentPreview; + this.Previews = previews; + this.CurrentTitle = currentTitle; + this.Titles = titles; + } + + /// + /// Gets the total progress fraction for the scan. + /// + public double Progress { get; private set; } + + /// + /// Gets the current preview being processed on the scan. + /// + public int CurrentPreview { get; private set; } + + /// + /// Gets the total number of previews to process. + /// + public int Previews { get; private set; } + + /// + /// Gets the current title being processed on the scan. + /// + public int CurrentTitle { get; private set; } + + /// + /// Gets the total number of titles to process. + /// + public int Titles { get; private set; } + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Factories/AnamorphicFactory.cs b/win/CS/HandBrake.Interop/Interop/Factories/AnamorphicFactory.cs similarity index 88% rename from win/CS/HandBrake.ApplicationServices/Interop/Factories/AnamorphicFactory.cs rename to win/CS/HandBrake.Interop/Interop/Factories/AnamorphicFactory.cs index 5d095cc2c..a1d0207f3 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Factories/AnamorphicFactory.cs +++ b/win/CS/HandBrake.Interop/Interop/Factories/AnamorphicFactory.cs @@ -1,94 +1,94 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// The Anamorphic factory. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Factories -{ - using System.Collections.Generic; - - using HandBrake.ApplicationServices.Interop.Json.Anamorphic; - using HandBrake.ApplicationServices.Interop.Json.Shared; - using HandBrake.ApplicationServices.Interop.Model; - using HandBrake.ApplicationServices.Interop.Model.Encoding; - using HandBrake.ApplicationServices.Interop.Model.Preview; - - /// - /// The anamorphic factory. - /// - public class AnamorphicFactory - { - /// - /// The keep setting. - /// - public enum KeepSetting - { - HB_KEEP_WIDTH = 0x01, - HB_KEEP_HEIGHT = 0x02, - HB_KEEP_DISPLAY_ASPECT = 0x04 - } - - /// - /// Finds output geometry for the given preview settings and title. - /// - /// - /// The preview settings. - /// - /// - /// Information on the title to consider. - /// - /// - /// Geometry Information - /// - public static Geometry CreateGeometry(PreviewSettings settings, SourceVideoInfo title) - { - int settingMode = settings.KeepDisplayAspect ? 0x04 : 0; - - // Sanitize the Geometry First. - AnamorphicGeometry anamorphicGeometry = new AnamorphicGeometry - { - SourceGeometry = new Geometry - { - Width = title.Resolution.Width, - Height = title.Resolution.Height, - PAR = new PAR { Num = title.ParVal.Width, Den = title.ParVal.Height } - }, - DestSettings = new DestSettings - { - AnamorphicMode = (int)settings.Anamorphic, - Geometry = - { - Width = settings.Width, - Height = settings.Height, - PAR = new PAR - { - Num = settings.Anamorphic != Anamorphic.Custom ? title.ParVal.Width : settings.PixelAspectX, - Den = settings.Anamorphic != Anamorphic.Custom ? title.ParVal.Height : settings.PixelAspectY, - } - }, - Keep = settingMode, - Crop = new List { settings.Cropping.Top, settings.Cropping.Bottom, settings.Cropping.Left, settings.Cropping.Right }, - Modulus = settings.Modulus ?? 16, - MaxWidth = settings.MaxWidth, - MaxHeight = settings.MaxHeight, - ItuPAR = false - } - }; - - if (settings.Anamorphic == Anamorphic.Custom) - { - anamorphicGeometry.DestSettings.Geometry.PAR = new PAR { Num = settings.PixelAspectX, Den = settings.PixelAspectY }; - } - else - { - anamorphicGeometry.DestSettings.Geometry.PAR = new PAR { Num = title.ParVal.Width, Den = title.ParVal.Height }; - } - - return HandBrakeUtils.GetAnamorphicSize(anamorphicGeometry); - } - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The Anamorphic factory. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Factories +{ + using System.Collections.Generic; + + using HandBrake.Interop.Interop.Json.Anamorphic; + using HandBrake.Interop.Interop.Json.Shared; + using HandBrake.Interop.Interop.Model; + using HandBrake.Interop.Interop.Model.Encoding; + using HandBrake.Interop.Interop.Model.Preview; + + /// + /// The anamorphic factory. + /// + public class AnamorphicFactory + { + /// + /// The keep setting. + /// + public enum KeepSetting + { + HB_KEEP_WIDTH = 0x01, + HB_KEEP_HEIGHT = 0x02, + HB_KEEP_DISPLAY_ASPECT = 0x04 + } + + /// + /// Finds output geometry for the given preview settings and title. + /// + /// + /// The preview settings. + /// + /// + /// Information on the title to consider. + /// + /// + /// Geometry Information + /// + public static Geometry CreateGeometry(PreviewSettings settings, SourceVideoInfo title) + { + int settingMode = settings.KeepDisplayAspect ? 0x04 : 0; + + // Sanitize the Geometry First. + AnamorphicGeometry anamorphicGeometry = new AnamorphicGeometry + { + SourceGeometry = new Geometry + { + Width = title.Resolution.Width, + Height = title.Resolution.Height, + PAR = new PAR { Num = title.ParVal.Width, Den = title.ParVal.Height } + }, + DestSettings = new DestSettings + { + AnamorphicMode = (int)settings.Anamorphic, + Geometry = + { + Width = settings.Width, + Height = settings.Height, + PAR = new PAR + { + Num = settings.Anamorphic != Anamorphic.Custom ? title.ParVal.Width : settings.PixelAspectX, + Den = settings.Anamorphic != Anamorphic.Custom ? title.ParVal.Height : settings.PixelAspectY, + } + }, + Keep = settingMode, + Crop = new List { settings.Cropping.Top, settings.Cropping.Bottom, settings.Cropping.Left, settings.Cropping.Right }, + Modulus = settings.Modulus ?? 16, + MaxWidth = settings.MaxWidth, + MaxHeight = settings.MaxHeight, + ItuPAR = false + } + }; + + if (settings.Anamorphic == Anamorphic.Custom) + { + anamorphicGeometry.DestSettings.Geometry.PAR = new PAR { Num = settings.PixelAspectX, Den = settings.PixelAspectY }; + } + else + { + anamorphicGeometry.DestSettings.Geometry.PAR = new PAR { Num = title.ParVal.Width, Den = title.ParVal.Height }; + } + + return HandBrakeUtils.GetAnamorphicSize(anamorphicGeometry); + } + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeEncoderHelpers.cs b/win/CS/HandBrake.Interop/Interop/HandBrakeEncoderHelpers.cs similarity index 95% rename from win/CS/HandBrake.ApplicationServices/Interop/HandBrakeEncoderHelpers.cs rename to win/CS/HandBrake.Interop/Interop/HandBrakeEncoderHelpers.cs index 125c04449..db5744315 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeEncoderHelpers.cs +++ b/win/CS/HandBrake.Interop/Interop/HandBrakeEncoderHelpers.cs @@ -1,666 +1,666 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// The encoders. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop -{ - using System.Collections.Generic; - using System.Linq; - - using HandBrake.ApplicationServices.Interop.HbLib; - using HandBrake.ApplicationServices.Interop.Helpers; - using HandBrake.ApplicationServices.Interop.Model; - using HandBrake.ApplicationServices.Interop.Model.Encoding; - - /// - /// The encoders. - /// - public static class HandBrakeEncoderHelpers - { - /// - /// The audio encoders. - /// - private static List audioEncoders; - - /// - /// The video encoders. - /// - private static List videoEncoders; - - /// - /// Video framerates in pts. - /// - private static List videoFramerates; - - /// - /// List of HandBrake mixdowns. - /// - private static List mixdowns; - - /// - /// List of HandBrake containers. - /// - private static List containers; - - /// - /// The audio bitrates. - /// - private static List audioBitrates; - - /// - /// Audio sample rates in Hz. - /// - private static List audioSampleRates; - - /// - /// Initializes static members of the HandBrakeEncoderHelpers class. - /// - static HandBrakeEncoderHelpers() - { - HandBrakeUtils.EnsureGlobalInit(); - } - - /// - /// Gets a list of supported audio encoders. - /// - public static List AudioEncoders - { - get - { - if (audioEncoders == null) - { - audioEncoders = InteropUtilities.ToListFromIterator(HBFunctions.hb_audio_encoder_get_next, HandBrakeUnitConversionHelpers.NativeToAudioEncoder); - } - - return audioEncoders; - } - } - - /// - /// Gets a list of supported video encoders. - /// - public static List VideoEncoders - { - get - { - if (videoEncoders == null) - { - videoEncoders = InteropUtilities.ToListFromIterator(HBFunctions.hb_video_encoder_get_next, HandBrakeUnitConversionHelpers.NativeToVideoEncoder); - } - - return videoEncoders; - } - } - - /// - /// Gets a list of supported video framerates (in pts). - /// - public static List VideoFramerates - { - get - { - if (videoFramerates == null) - { - videoFramerates = InteropUtilities.ToListFromIterator(HBFunctions.hb_video_framerate_get_next, HandBrakeUnitConversionHelpers.NativeToRate); - } - - return videoFramerates; - } - } - - /// - /// Gets a list of supported mixdowns. - /// - public static List Mixdowns - { - get - { - if (mixdowns == null) - { - mixdowns = InteropUtilities.ToListFromIterator(HBFunctions.hb_mixdown_get_next, HandBrakeUnitConversionHelpers.NativeToMixdown); - } - - return mixdowns; - } - } - - /// - /// Gets a list of supported audio bitrates. - /// - public static List AudioBitrates - { - get - { - if (audioBitrates == null) - { - audioBitrates = InteropUtilities.ToListFromIterator(HBFunctions.hb_audio_bitrate_get_next, b => b.rate); - } - - return audioBitrates; - } - } - - /// - /// Gets a list of supported audio sample rates (in Hz). - /// - public static List AudioSampleRates - { - get - { - if (audioSampleRates == null) - { - audioSampleRates = InteropUtilities.ToListFromIterator(HBFunctions.hb_audio_samplerate_get_next, HandBrakeUnitConversionHelpers.NativeToRate); - } - - return audioSampleRates; - } - } - - /// - /// Gets a list of supported containers. - /// - public static List Containers - { - get - { - if (containers == null) - { - containers = InteropUtilities.ToListFromIterator(HBFunctions.hb_container_get_next, HandBrakeUnitConversionHelpers.NativeToContainer); - } - - return containers; - } - } - - /// - /// Gets a value indicating whether SRT subtitles can be burnt in. - /// - public static bool CanBurnSrt - { - get - { - return HBFunctions.hb_subtitle_can_burn((int)hb_subtitle_s_subsource.SRTSUB) > 0; - } - } - - /// - /// Gets the audio encoder with the specified short name. - /// - /// - /// The name of the audio encoder. - /// - /// - /// The requested audio encoder. - /// - public static HBAudioEncoder GetAudioEncoder(string shortName) - { - return AudioEncoders.SingleOrDefault(e => e.ShortName == shortName); - } - - /// - /// Gets the audio encoder with the specified codec ID. - /// - /// - /// The ID of the audio encoder. - /// - /// - /// The requested audio encoder. - /// - public static HBAudioEncoder GetAudioEncoder(int codecId) - { - return AudioEncoders.SingleOrDefault(e => e.Id == codecId); - } - - /// - /// Gets the video encoder with the specified short name. - /// - /// - /// The name of the video encoder. - /// - /// - /// The requested video encoder. - /// - public static HBVideoEncoder GetVideoEncoder(string shortName) - { - return VideoEncoders.SingleOrDefault(e => e.ShortName == shortName); - } - - /// - /// Gets the mixdown with the specified short name. - /// - /// - /// The name of the mixdown. - /// - /// - /// The requested mixdown. - /// - public static HBMixdown GetMixdown(string shortName) - { - return Mixdowns.SingleOrDefault(m => m.ShortName == shortName); - } - - /// - /// Gets the mixdown with the specified ID. - /// - /// The mixdown ID. - /// The requested mixdown. - public static HBMixdown GetMixdown(int id) - { - return Mixdowns.SingleOrDefault(m => m.Id == id); - } - - /// - /// Gets the container with the specified short name. - /// - /// - /// The name of the container. - /// - /// - /// The requested container. - /// - public static HBContainer GetContainer(string shortName) - { - return Containers.SingleOrDefault(c => c.ShortName == shortName); - } - - /// - /// Returns true if the subtitle source type can be set to forced only. - /// - /// - /// The subtitle source type (SSA, VobSub, etc) - /// - /// - /// True if the subtitle source type can be set to forced only. - /// - public static bool SubtitleCanSetForcedOnly(int source) - { - return HBFunctions.hb_subtitle_can_force(source) > 0; - } - - /// - /// Returns true if the subtitle source type can be burned in. - /// - /// - /// The subtitle source type (SSA, VobSub, etc) - /// - /// - /// True if the subtitle source type can be burned in. - /// - public static bool SubtitleCanBurn(int source) - { - return HBFunctions.hb_subtitle_can_burn(source) > 0; - } - - /// - /// Returns true if the subtitle type can be passed through using the given muxer. - /// - /// - /// The subtitle source type (SSA, VobSub, etc) - /// - /// - /// The ID of the muxer. - /// - /// - /// True if the subtitle type can be passed through with the given muxer. - /// - public static bool SubtitleCanPassthrough(int subtitleSourceType, int muxer) - { - return HBFunctions.hb_subtitle_can_pass(subtitleSourceType, muxer) > 0; - } - - /// - /// Gets the subtitle source type's name. - /// - /// - /// The subtitle source type (SSA, VobSub, etc). - /// - /// - /// The name of the subtitle source. - /// - public static string GetSubtitleSourceName(int source) - { - switch ((hb_subtitle_s_subsource)source) - { - case hb_subtitle_s_subsource.CC608SUB: - return "CC608"; - case hb_subtitle_s_subsource.CC708SUB: - return "CC708"; - case hb_subtitle_s_subsource.SRTSUB: - return "SRT"; - case hb_subtitle_s_subsource.SSASUB: - return "SSA"; - case hb_subtitle_s_subsource.TX3GSUB: - return "TX3G"; - case hb_subtitle_s_subsource.UTF8SUB: - return "UTF8"; - case hb_subtitle_s_subsource.VOBSUB: - return "VobSub"; - case hb_subtitle_s_subsource.PGSSUB: - return "PGS"; - default: - return string.Empty; - } - } - - /// - /// Determines if the given encoder is compatible with the given track. - /// - /// - /// The codec Id. - /// - /// - /// The encoder to examine. - /// - /// - /// True if the given encoder is comatible with the given audio track. - /// - /// - /// Only works with passthrough encoders. - /// - public static bool AudioEncoderIsCompatible(int codecId, HBAudioEncoder encoder) - { - return (codecId & encoder.Id) > 0; - } - - /// - /// Determines if the given mixdown supports the given channel layout. - /// - /// - /// The mixdown to evaluate. - /// - /// - /// The channel layout to evaluate. - /// - /// - /// True if the mixdown supports the given channel layout. - /// - public static bool MixdownHasRemixSupport(HBMixdown mixdown, ulong layout) - { - return HBFunctions.hb_mixdown_has_remix_support(mixdown.Id, layout) > 0; - } - - /// - /// Determines if the given encoder supports the given mixdown. - /// - /// - /// The mixdown to evaluate. - /// - /// - /// The encoder to evaluate. - /// - /// - /// True if the encoder supports the mixdown. - /// - public static bool MixdownHasCodecSupport(HBMixdown mixdown, HBAudioEncoder encoder) - { - return HBFunctions.hb_mixdown_has_codec_support(mixdown.Id, (uint)encoder.Id) > 0; - } - - /// - /// Determines if a mixdown is available for a given track and encoder. - /// - /// - /// The mixdown to evaluate. - /// - /// - /// The encoder to evaluate. - /// - /// channel layout of the source track - /// True if available. - public static bool MixdownIsSupported(HBMixdown mixdown, HBAudioEncoder encoder, long channelLayout) - { - return HBFunctions.hb_mixdown_is_supported(mixdown.Id, (uint)encoder.Id, (uint)channelLayout) > 0; - } - - /// - /// Determines if DRC can be applied to the given track with the given encoder. - /// - /// - /// The track Number. - /// - /// - /// The encoder to use for DRC. - /// - /// - /// The title. - /// - /// - /// True if DRC can be applied to the track with the given encoder. - /// - public static bool CanApplyDrc(int trackNumber, HBAudioEncoder encoder, int title) - { - return HBFunctions.hb_audio_can_apply_drc2(HandBrakeInstanceManager.LastScanHandle, title, trackNumber, encoder.Id) > 0; - } - - /// - /// Determines if the given input audio codec can be passed through. - /// - /// - /// The input codec to consider. - /// - /// - /// True if the codec can be passed through. - /// - public static bool CanPassthroughAudio(int codecId) - { - return (codecId & NativeConstants.HB_ACODEC_PASS_MASK) > 0; - } - - /// - /// Sanitizes a mixdown given the output codec and input channel layout. - /// - /// - /// The desired mixdown. - /// - /// - /// The output encoder to be used. - /// - /// - /// The input channel layout. - /// - /// - /// A sanitized mixdown value. - /// - public static HBMixdown SanitizeMixdown(HBMixdown mixdown, HBAudioEncoder encoder, ulong layout) - { - if (mixdown == null) - { - return null; - } - - int sanitizedMixdown = HBFunctions.hb_mixdown_get_best((uint)encoder.Id, layout, mixdown.Id); - if (sanitizedMixdown != -1) - { - return Mixdowns.Single(m => m.Id == sanitizedMixdown); - } - return Mixdowns.FirstOrDefault(); // "none" - } - - /// - /// Gets the default mixdown for the given audio encoder and channel layout. - /// - /// - /// The output codec to be used. - /// - /// - /// The input channel layout. - /// - /// - /// The default mixdown for the given codec and channel layout. - /// - public static HBMixdown GetDefaultMixdown(HBAudioEncoder encoder, ulong layout) - { - int defaultMixdown = HBFunctions.hb_mixdown_get_default((uint)encoder.Id, layout); - return Mixdowns.Single(m => m.Id == defaultMixdown); - } - - /// - /// Sanitizes the given sample rate for the given encoder. - /// - /// The encoder. - /// The sample rate to sanitize. - /// The sanitized sample rate. - public static int SanitizeSampleRate(HBAudioEncoder encoder, int sampleRate) - { - return HBFunctions.hb_audio_samplerate_find_closest(sampleRate, (uint)encoder.Id); - } - - /// - /// Gets the bitrate limits for the given audio codec, sample rate and mixdown. - /// - /// - /// The audio encoder used. - /// - /// - /// The sample rate used (Hz). - /// - /// - /// The mixdown used. - /// - /// - /// Limits on the audio bitrate for the given settings. - /// - public static BitrateLimits GetBitrateLimits(HBAudioEncoder encoder, int sampleRate, HBMixdown mixdown) - { - int low = 0; - int high = 0; - - HBFunctions.hb_audio_bitrate_get_limits((uint)encoder.Id, sampleRate, mixdown.Id, ref low, ref high); - - return new BitrateLimits(low, high); - } - - /// - /// Gets the video quality limits for the given video codec. - /// - /// - /// The video encoder to check. - /// - /// - /// Limits on the video quality for the encoder. - /// - public static VideoQualityLimits GetVideoQualityLimits(HBVideoEncoder encoder) - { - float low = 0; - float high = 0; - float granularity = 0; - int direction = 0; - - HBFunctions.hb_video_quality_get_limits((uint)encoder.Id, ref low, ref high, ref granularity, ref direction); - - return new VideoQualityLimits(low, high, granularity, direction == 0); - } - - /// - /// Sanitizes an audio bitrate given the output codec, sample rate and mixdown. - /// - /// - /// The desired audio bitrate. - /// - /// - /// The output encoder to be used. - /// - /// - /// The output sample rate to be used. - /// - /// - /// The mixdown to be used. - /// - /// - /// A sanitized audio bitrate. - /// - public static int SanitizeAudioBitrate(int audioBitrate, HBAudioEncoder encoder, int sampleRate, HBMixdown mixdown) - { - return HBFunctions.hb_audio_bitrate_get_best((uint)encoder.Id, audioBitrate, sampleRate, mixdown.Id); - } - - /// - /// Gets the default audio bitrate for the given parameters. - /// - /// - /// The encoder to use. - /// - /// - /// The sample rate to use. - /// - /// - /// The mixdown to use. - /// - /// - /// The default bitrate for these parameters. - /// - public static int GetDefaultBitrate(HBAudioEncoder encoder, int sampleRate, HBMixdown mixdown) - { - return HBFunctions.hb_audio_bitrate_get_default((uint)encoder.Id, sampleRate, mixdown.Id); - } - - /// - /// Gets limits on audio quality for a given encoder. - /// - /// - /// The audio encoder ID. - /// - /// - /// Limits on the audio quality for the given encoder. - /// - public static RangeLimits GetAudioQualityLimits(int encoderId) - { - float low = 0, high = 0, granularity = 0; - int direction = 0; - HBFunctions.hb_audio_quality_get_limits((uint)encoderId, ref low, ref high, ref granularity, ref direction); - - return new RangeLimits(direction == 0, granularity, high, low); - } - - /// - /// Gets limits on audio compression for a given encoder. - /// - /// - /// The audio encoder ID. - /// - /// - /// Limits on the audio compression for the given encoder. - /// - public static RangeLimits GetAudioCompressionLimits(int encoderId) - { - float low = 0, high = 0, granularity = 0; - int direction = 0; - HBFunctions.hb_audio_compression_get_limits((uint)encoderId, ref low, ref high, ref granularity, ref direction); - - return new RangeLimits(direction == 0, granularity, high, low); - } - - /// - /// The get default quality. - /// - /// - /// The encoder. - /// - /// - /// The . - /// - public static double GetDefaultQuality(HBAudioEncoder encoder) - { - return HBFunctions.hb_audio_quality_get_default((uint)encoder.Id); - } - - /// - /// The get default audio compression. - /// - /// - /// The encoder. - /// - /// - /// The . - /// - public static double GetDefaultAudioCompression(HBAudioEncoder encoder) - { - return HBFunctions.hb_audio_compression_get_default((uint)encoder.Id); - } - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The encoders. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop +{ + using System.Collections.Generic; + using System.Linq; + + using HandBrake.Interop.Interop.HbLib; + using HandBrake.Interop.Interop.Helpers; + using HandBrake.Interop.Interop.Model; + using HandBrake.Interop.Interop.Model.Encoding; + + /// + /// The encoders. + /// + public static class HandBrakeEncoderHelpers + { + /// + /// The audio encoders. + /// + private static List audioEncoders; + + /// + /// The video encoders. + /// + private static List videoEncoders; + + /// + /// Video framerates in pts. + /// + private static List videoFramerates; + + /// + /// List of HandBrake mixdowns. + /// + private static List mixdowns; + + /// + /// List of HandBrake containers. + /// + private static List containers; + + /// + /// The audio bitrates. + /// + private static List audioBitrates; + + /// + /// Audio sample rates in Hz. + /// + private static List audioSampleRates; + + /// + /// Initializes static members of the HandBrakeEncoderHelpers class. + /// + static HandBrakeEncoderHelpers() + { + HandBrakeUtils.EnsureGlobalInit(); + } + + /// + /// Gets a list of supported audio encoders. + /// + public static List AudioEncoders + { + get + { + if (audioEncoders == null) + { + audioEncoders = InteropUtilities.ToListFromIterator(HBFunctions.hb_audio_encoder_get_next, HandBrakeUnitConversionHelpers.NativeToAudioEncoder); + } + + return audioEncoders; + } + } + + /// + /// Gets a list of supported video encoders. + /// + public static List VideoEncoders + { + get + { + if (videoEncoders == null) + { + videoEncoders = InteropUtilities.ToListFromIterator(HBFunctions.hb_video_encoder_get_next, HandBrakeUnitConversionHelpers.NativeToVideoEncoder); + } + + return videoEncoders; + } + } + + /// + /// Gets a list of supported video framerates (in pts). + /// + public static List VideoFramerates + { + get + { + if (videoFramerates == null) + { + videoFramerates = InteropUtilities.ToListFromIterator(HBFunctions.hb_video_framerate_get_next, HandBrakeUnitConversionHelpers.NativeToRate); + } + + return videoFramerates; + } + } + + /// + /// Gets a list of supported mixdowns. + /// + public static List Mixdowns + { + get + { + if (mixdowns == null) + { + mixdowns = InteropUtilities.ToListFromIterator(HBFunctions.hb_mixdown_get_next, HandBrakeUnitConversionHelpers.NativeToMixdown); + } + + return mixdowns; + } + } + + /// + /// Gets a list of supported audio bitrates. + /// + public static List AudioBitrates + { + get + { + if (audioBitrates == null) + { + audioBitrates = InteropUtilities.ToListFromIterator(HBFunctions.hb_audio_bitrate_get_next, b => b.rate); + } + + return audioBitrates; + } + } + + /// + /// Gets a list of supported audio sample rates (in Hz). + /// + public static List AudioSampleRates + { + get + { + if (audioSampleRates == null) + { + audioSampleRates = InteropUtilities.ToListFromIterator(HBFunctions.hb_audio_samplerate_get_next, HandBrakeUnitConversionHelpers.NativeToRate); + } + + return audioSampleRates; + } + } + + /// + /// Gets a list of supported containers. + /// + public static List Containers + { + get + { + if (containers == null) + { + containers = InteropUtilities.ToListFromIterator(HBFunctions.hb_container_get_next, HandBrakeUnitConversionHelpers.NativeToContainer); + } + + return containers; + } + } + + /// + /// Gets a value indicating whether SRT subtitles can be burnt in. + /// + public static bool CanBurnSrt + { + get + { + return HBFunctions.hb_subtitle_can_burn((int)hb_subtitle_s_subsource.SRTSUB) > 0; + } + } + + /// + /// Gets the audio encoder with the specified short name. + /// + /// + /// The name of the audio encoder. + /// + /// + /// The requested audio encoder. + /// + public static HBAudioEncoder GetAudioEncoder(string shortName) + { + return AudioEncoders.SingleOrDefault(e => e.ShortName == shortName); + } + + /// + /// Gets the audio encoder with the specified codec ID. + /// + /// + /// The ID of the audio encoder. + /// + /// + /// The requested audio encoder. + /// + public static HBAudioEncoder GetAudioEncoder(int codecId) + { + return AudioEncoders.SingleOrDefault(e => e.Id == codecId); + } + + /// + /// Gets the video encoder with the specified short name. + /// + /// + /// The name of the video encoder. + /// + /// + /// The requested video encoder. + /// + public static HBVideoEncoder GetVideoEncoder(string shortName) + { + return VideoEncoders.SingleOrDefault(e => e.ShortName == shortName); + } + + /// + /// Gets the mixdown with the specified short name. + /// + /// + /// The name of the mixdown. + /// + /// + /// The requested mixdown. + /// + public static HBMixdown GetMixdown(string shortName) + { + return Mixdowns.SingleOrDefault(m => m.ShortName == shortName); + } + + /// + /// Gets the mixdown with the specified ID. + /// + /// The mixdown ID. + /// The requested mixdown. + public static HBMixdown GetMixdown(int id) + { + return Mixdowns.SingleOrDefault(m => m.Id == id); + } + + /// + /// Gets the container with the specified short name. + /// + /// + /// The name of the container. + /// + /// + /// The requested container. + /// + public static HBContainer GetContainer(string shortName) + { + return Containers.SingleOrDefault(c => c.ShortName == shortName); + } + + /// + /// Returns true if the subtitle source type can be set to forced only. + /// + /// + /// The subtitle source type (SSA, VobSub, etc) + /// + /// + /// True if the subtitle source type can be set to forced only. + /// + public static bool SubtitleCanSetForcedOnly(int source) + { + return HBFunctions.hb_subtitle_can_force(source) > 0; + } + + /// + /// Returns true if the subtitle source type can be burned in. + /// + /// + /// The subtitle source type (SSA, VobSub, etc) + /// + /// + /// True if the subtitle source type can be burned in. + /// + public static bool SubtitleCanBurn(int source) + { + return HBFunctions.hb_subtitle_can_burn(source) > 0; + } + + /// + /// Returns true if the subtitle type can be passed through using the given muxer. + /// + /// + /// The subtitle source type (SSA, VobSub, etc) + /// + /// + /// The ID of the muxer. + /// + /// + /// True if the subtitle type can be passed through with the given muxer. + /// + public static bool SubtitleCanPassthrough(int subtitleSourceType, int muxer) + { + return HBFunctions.hb_subtitle_can_pass(subtitleSourceType, muxer) > 0; + } + + /// + /// Gets the subtitle source type's name. + /// + /// + /// The subtitle source type (SSA, VobSub, etc). + /// + /// + /// The name of the subtitle source. + /// + public static string GetSubtitleSourceName(int source) + { + switch ((hb_subtitle_s_subsource)source) + { + case hb_subtitle_s_subsource.CC608SUB: + return "CC608"; + case hb_subtitle_s_subsource.CC708SUB: + return "CC708"; + case hb_subtitle_s_subsource.SRTSUB: + return "SRT"; + case hb_subtitle_s_subsource.SSASUB: + return "SSA"; + case hb_subtitle_s_subsource.TX3GSUB: + return "TX3G"; + case hb_subtitle_s_subsource.UTF8SUB: + return "UTF8"; + case hb_subtitle_s_subsource.VOBSUB: + return "VobSub"; + case hb_subtitle_s_subsource.PGSSUB: + return "PGS"; + default: + return string.Empty; + } + } + + /// + /// Determines if the given encoder is compatible with the given track. + /// + /// + /// The codec Id. + /// + /// + /// The encoder to examine. + /// + /// + /// True if the given encoder is comatible with the given audio track. + /// + /// + /// Only works with passthrough encoders. + /// + public static bool AudioEncoderIsCompatible(int codecId, HBAudioEncoder encoder) + { + return (codecId & encoder.Id) > 0; + } + + /// + /// Determines if the given mixdown supports the given channel layout. + /// + /// + /// The mixdown to evaluate. + /// + /// + /// The channel layout to evaluate. + /// + /// + /// True if the mixdown supports the given channel layout. + /// + public static bool MixdownHasRemixSupport(HBMixdown mixdown, ulong layout) + { + return HBFunctions.hb_mixdown_has_remix_support(mixdown.Id, layout) > 0; + } + + /// + /// Determines if the given encoder supports the given mixdown. + /// + /// + /// The mixdown to evaluate. + /// + /// + /// The encoder to evaluate. + /// + /// + /// True if the encoder supports the mixdown. + /// + public static bool MixdownHasCodecSupport(HBMixdown mixdown, HBAudioEncoder encoder) + { + return HBFunctions.hb_mixdown_has_codec_support(mixdown.Id, (uint)encoder.Id) > 0; + } + + /// + /// Determines if a mixdown is available for a given track and encoder. + /// + /// + /// The mixdown to evaluate. + /// + /// + /// The encoder to evaluate. + /// + /// channel layout of the source track + /// True if available. + public static bool MixdownIsSupported(HBMixdown mixdown, HBAudioEncoder encoder, long channelLayout) + { + return HBFunctions.hb_mixdown_is_supported(mixdown.Id, (uint)encoder.Id, (uint)channelLayout) > 0; + } + + /// + /// Determines if DRC can be applied to the given track with the given encoder. + /// + /// + /// The track Number. + /// + /// + /// The encoder to use for DRC. + /// + /// + /// The title. + /// + /// + /// True if DRC can be applied to the track with the given encoder. + /// + public static bool CanApplyDrc(int trackNumber, HBAudioEncoder encoder, int title) + { + return HBFunctions.hb_audio_can_apply_drc2(HandBrakeInstanceManager.LastScanHandle, title, trackNumber, encoder.Id) > 0; + } + + /// + /// Determines if the given input audio codec can be passed through. + /// + /// + /// The input codec to consider. + /// + /// + /// True if the codec can be passed through. + /// + public static bool CanPassthroughAudio(int codecId) + { + return (codecId & NativeConstants.HB_ACODEC_PASS_MASK) > 0; + } + + /// + /// Sanitizes a mixdown given the output codec and input channel layout. + /// + /// + /// The desired mixdown. + /// + /// + /// The output encoder to be used. + /// + /// + /// The input channel layout. + /// + /// + /// A sanitized mixdown value. + /// + public static HBMixdown SanitizeMixdown(HBMixdown mixdown, HBAudioEncoder encoder, ulong layout) + { + if (mixdown == null) + { + return null; + } + + int sanitizedMixdown = HBFunctions.hb_mixdown_get_best((uint)encoder.Id, layout, mixdown.Id); + if (sanitizedMixdown != -1) + { + return Mixdowns.Single(m => m.Id == sanitizedMixdown); + } + return Mixdowns.FirstOrDefault(); // "none" + } + + /// + /// Gets the default mixdown for the given audio encoder and channel layout. + /// + /// + /// The output codec to be used. + /// + /// + /// The input channel layout. + /// + /// + /// The default mixdown for the given codec and channel layout. + /// + public static HBMixdown GetDefaultMixdown(HBAudioEncoder encoder, ulong layout) + { + int defaultMixdown = HBFunctions.hb_mixdown_get_default((uint)encoder.Id, layout); + return Mixdowns.Single(m => m.Id == defaultMixdown); + } + + /// + /// Sanitizes the given sample rate for the given encoder. + /// + /// The encoder. + /// The sample rate to sanitize. + /// The sanitized sample rate. + public static int SanitizeSampleRate(HBAudioEncoder encoder, int sampleRate) + { + return HBFunctions.hb_audio_samplerate_find_closest(sampleRate, (uint)encoder.Id); + } + + /// + /// Gets the bitrate limits for the given audio codec, sample rate and mixdown. + /// + /// + /// The audio encoder used. + /// + /// + /// The sample rate used (Hz). + /// + /// + /// The mixdown used. + /// + /// + /// Limits on the audio bitrate for the given settings. + /// + public static BitrateLimits GetBitrateLimits(HBAudioEncoder encoder, int sampleRate, HBMixdown mixdown) + { + int low = 0; + int high = 0; + + HBFunctions.hb_audio_bitrate_get_limits((uint)encoder.Id, sampleRate, mixdown.Id, ref low, ref high); + + return new BitrateLimits(low, high); + } + + /// + /// Gets the video quality limits for the given video codec. + /// + /// + /// The video encoder to check. + /// + /// + /// Limits on the video quality for the encoder. + /// + public static VideoQualityLimits GetVideoQualityLimits(HBVideoEncoder encoder) + { + float low = 0; + float high = 0; + float granularity = 0; + int direction = 0; + + HBFunctions.hb_video_quality_get_limits((uint)encoder.Id, ref low, ref high, ref granularity, ref direction); + + return new VideoQualityLimits(low, high, granularity, direction == 0); + } + + /// + /// Sanitizes an audio bitrate given the output codec, sample rate and mixdown. + /// + /// + /// The desired audio bitrate. + /// + /// + /// The output encoder to be used. + /// + /// + /// The output sample rate to be used. + /// + /// + /// The mixdown to be used. + /// + /// + /// A sanitized audio bitrate. + /// + public static int SanitizeAudioBitrate(int audioBitrate, HBAudioEncoder encoder, int sampleRate, HBMixdown mixdown) + { + return HBFunctions.hb_audio_bitrate_get_best((uint)encoder.Id, audioBitrate, sampleRate, mixdown.Id); + } + + /// + /// Gets the default audio bitrate for the given parameters. + /// + /// + /// The encoder to use. + /// + /// + /// The sample rate to use. + /// + /// + /// The mixdown to use. + /// + /// + /// The default bitrate for these parameters. + /// + public static int GetDefaultBitrate(HBAudioEncoder encoder, int sampleRate, HBMixdown mixdown) + { + return HBFunctions.hb_audio_bitrate_get_default((uint)encoder.Id, sampleRate, mixdown.Id); + } + + /// + /// Gets limits on audio quality for a given encoder. + /// + /// + /// The audio encoder ID. + /// + /// + /// Limits on the audio quality for the given encoder. + /// + public static RangeLimits GetAudioQualityLimits(int encoderId) + { + float low = 0, high = 0, granularity = 0; + int direction = 0; + HBFunctions.hb_audio_quality_get_limits((uint)encoderId, ref low, ref high, ref granularity, ref direction); + + return new RangeLimits(direction == 0, granularity, high, low); + } + + /// + /// Gets limits on audio compression for a given encoder. + /// + /// + /// The audio encoder ID. + /// + /// + /// Limits on the audio compression for the given encoder. + /// + public static RangeLimits GetAudioCompressionLimits(int encoderId) + { + float low = 0, high = 0, granularity = 0; + int direction = 0; + HBFunctions.hb_audio_compression_get_limits((uint)encoderId, ref low, ref high, ref granularity, ref direction); + + return new RangeLimits(direction == 0, granularity, high, low); + } + + /// + /// The get default quality. + /// + /// + /// The encoder. + /// + /// + /// The . + /// + public static double GetDefaultQuality(HBAudioEncoder encoder) + { + return HBFunctions.hb_audio_quality_get_default((uint)encoder.Id); + } + + /// + /// The get default audio compression. + /// + /// + /// The encoder. + /// + /// + /// The . + /// + public static double GetDefaultAudioCompression(HBAudioEncoder encoder) + { + return HBFunctions.hb_audio_compression_get_default((uint)encoder.Id); + } + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeFilterHelpers.cs b/win/CS/HandBrake.Interop/Interop/HandBrakeFilterHelpers.cs similarity index 90% rename from win/CS/HandBrake.ApplicationServices/Interop/HandBrakeFilterHelpers.cs rename to win/CS/HandBrake.Interop/Interop/HandBrakeFilterHelpers.cs index 0db9f4f37..e8d7f5f31 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeFilterHelpers.cs +++ b/win/CS/HandBrake.Interop/Interop/HandBrakeFilterHelpers.cs @@ -7,17 +7,17 @@ // // -------------------------------------------------------------------------------------------------------------------- -namespace HandBrake.ApplicationServices.Interop +namespace HandBrake.Interop.Interop { using System; using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices; - using HandBrake.ApplicationServices.Interop.HbLib; - using HandBrake.ApplicationServices.Interop.Helpers; - using HandBrake.ApplicationServices.Interop.Json.Filters; - using HandBrake.ApplicationServices.Interop.Model.Encoding; + using HandBrake.Interop.Interop.HbLib; + using HandBrake.Interop.Interop.Helpers; + using HandBrake.Interop.Interop.Json.Filters; + using HandBrake.Interop.Interop.Model.Encoding; using Newtonsoft.Json; @@ -33,7 +33,7 @@ namespace HandBrake.ApplicationServices.Interop /// The filter. /// /// - /// The . + /// The . /// public static List GetFilterPresets(int filter) { @@ -51,7 +51,7 @@ namespace HandBrake.ApplicationServices.Interop /// The filter. /// /// - /// The . + /// The . /// public static List GetFilterTunes(int filter) { diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs b/win/CS/HandBrake.Interop/Interop/HandBrakeInstance.cs similarity index 93% rename from win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs rename to win/CS/HandBrake.Interop/Interop/HandBrakeInstance.cs index 7fe52a899..9f5420d3f 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs +++ b/win/CS/HandBrake.Interop/Interop/HandBrakeInstance.cs @@ -1,552 +1,552 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// A wrapper for a HandBrake instance. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop -{ - using System; - using System.Collections.Generic; - using System.Diagnostics; - using System.Linq; - using System.Runtime.ExceptionServices; - using System.Runtime.InteropServices; - using System.Timers; - - using HandBrake.ApplicationServices.Interop.EventArgs; - using HandBrake.ApplicationServices.Interop.Factories; - using HandBrake.ApplicationServices.Interop.HbLib; - using HandBrake.ApplicationServices.Interop.Helpers; - using HandBrake.ApplicationServices.Interop.Interfaces; - using HandBrake.ApplicationServices.Interop.Json.Encode; - using HandBrake.ApplicationServices.Interop.Json.Scan; - using HandBrake.ApplicationServices.Interop.Json.State; - using HandBrake.ApplicationServices.Interop.Model.Encoding; - using HandBrake.ApplicationServices.Interop.Model.Preview; - - using Newtonsoft.Json; - - /// - /// A wrapper for a HandBrake instance. - /// - public class HandBrakeInstance : IHandBrakeInstance, IDisposable - { - /// - /// The number of MS between status polls when scanning. - /// - private const double ScanPollIntervalMs = 250; - - /// - /// The number of MS between status polls when encoding. - /// - private const double EncodePollIntervalMs = 250; - - /// - /// The native handle to the HandBrake instance. - /// - private IntPtr hbHandle; - - /// - /// The number of previews created during scan. - /// - private int previewCount; - - /// - /// The timer to poll for scan status. - /// - private Timer scanPollTimer; - - /// - /// The timer to poll for encode status. - /// - private Timer encodePollTimer; - - /// - /// The list of titles on this instance. - /// - private JsonScanObject titles; - - /// - /// The raw JSON for the titles list. - /// - private string titlesJson; - - /// - /// The index of the default title. - /// - private int featureTitle; - - /// - /// A value indicating whether this object has been disposed or not. - /// - private bool disposed; - - /// - /// Finalizes an instance of the HandBrakeInstance class. - /// - ~HandBrakeInstance() - { - this.Dispose(false); - } - - /// - /// Fires for progress updates when scanning. - /// - public event EventHandler ScanProgress; - - /// - /// Fires when a scan has completed. - /// - public event EventHandler ScanCompleted; - - /// - /// Fires for progress updates when encoding. - /// - public event EventHandler EncodeProgress; - - /// - /// Fires when an encode has completed. - /// - public event EventHandler EncodeCompleted; - - /// - /// Gets the handle. - /// - internal IntPtr Handle - { - get - { - return this.hbHandle; - } - } - - /// - /// Gets the number of previews created during scan. - /// - public int PreviewCount - { - get - { - return this.previewCount; - } - } - - /// - /// Gets the list of titles on this instance. - /// - public JsonScanObject Titles - { - get - { - return this.titles; - } - } - - /// - /// Gets the raw JSON for the list of titles on this instance. - /// - public string TitlesJson - { - get - { - return this.titlesJson; - } - } - - /// - /// Gets the index of the default title. - /// - public int FeatureTitle - { - get - { - return this.featureTitle; - } - } - - /// - /// Gets the HandBrake version string. - /// - public string Version - { - get - { - var versionPtr = HBFunctions.hb_get_version(this.hbHandle); - return Marshal.PtrToStringAnsi(versionPtr); - } - } - - /// - /// Gets the HandBrake build number. - /// - public int Build - { - get - { - return HBFunctions.hb_get_build(this.hbHandle); - } - } - - /// - /// Initializes this instance. - /// - /// - /// The code for the logging verbosity to use. - /// - public void Initialize(int verbosity) - { - HandBrakeUtils.EnsureGlobalInit(); - - HandBrakeUtils.RegisterLogger(); - this.hbHandle = HBFunctions.hb_init(verbosity, update_check: 0); - } - - /// - /// Starts a scan of the given path. - /// - /// - /// The path of the video to scan. - /// - /// - /// The number of previews to make on each title. - /// - /// - /// The minimum duration of a title to show up on the scan. - /// - /// - /// The title index to scan (1-based, 0 for all titles). - /// - public void StartScan(string path, int previewCount, TimeSpan minDuration, int titleIndex) - { - this.previewCount = previewCount; - - IntPtr pathPtr = InteropUtilities.ToUtf8PtrFromString(path); - HBFunctions.hb_scan(this.hbHandle, pathPtr, titleIndex, previewCount, 1, (ulong)(minDuration.TotalSeconds * 90000)); - Marshal.FreeHGlobal(pathPtr); - - this.scanPollTimer = new Timer(); - this.scanPollTimer.Interval = ScanPollIntervalMs; - - // Lambda notation used to make sure we can view any JIT exceptions the method throws - this.scanPollTimer.Elapsed += (o, e) => - { - try - { - this.PollScanProgress(); - } - catch (Exception exc) - { - Debug.WriteLine(exc); - HandBrakeUtils.SendErrorEvent(exc.ToString()); - } - }; - this.scanPollTimer.Start(); - } - - /// - /// Stops an ongoing scan. - /// - [HandleProcessCorruptedStateExceptions] - public void StopScan() - { - HBFunctions.hb_scan_stop(this.hbHandle); - } - - /// - /// Gets an image for the given job and preview - /// - /// - /// Only incorporates sizing and aspect ratio into preview image. - /// - /// - /// The encode job to preview. - /// - /// - /// The index of the preview to get (0-based). - /// - /// - /// True to enable basic deinterlace of preview images. - /// - /// - /// An image with the requested preview. - /// - [HandleProcessCorruptedStateExceptions] - public RawPreviewData GetPreview(PreviewSettings settings, int previewNumber, bool deinterlace) - { - SourceTitle title = this.Titles.TitleList.FirstOrDefault(t => t.Index == settings.TitleNumber); - - // Create the Expected Output Geometry details for libhb. - hb_geometry_settings_s uiGeometry = new hb_geometry_settings_s - { - crop = new[] { settings.Cropping.Top, settings.Cropping.Bottom, settings.Cropping.Left, settings.Cropping.Right }, - itu_par = 0, - keep = (int)AnamorphicFactory.KeepSetting.HB_KEEP_WIDTH + (settings.KeepDisplayAspect ? 0x04 : 0), // TODO Keep Width? - maxWidth = settings.MaxWidth, - maxHeight = settings.MaxHeight, - mode = (int)(hb_anamorphic_mode_t)settings.Anamorphic, - modulus = settings.Modulus ?? 16, - geometry = new hb_geometry_s - { - height = settings.Height, - width = settings.Width, - par = settings.Anamorphic != Anamorphic.Custom && settings.Anamorphic != Anamorphic.Automatic - ? new hb_rational_t { den = title.Geometry.PAR.Den, num = title.Geometry.PAR.Num } - : new hb_rational_t { den = settings.PixelAspectY, num = settings.PixelAspectX } - } - }; - - // Fetch the image data from LibHb - IntPtr resultingImageStuct = HBFunctions.hb_get_preview2(this.hbHandle, settings.TitleNumber, previewNumber, ref uiGeometry, deinterlace ? 1 : 0); - hb_image_s image = InteropUtilities.ToStructureFromPtr(resultingImageStuct); - - // Copy the filled image buffer to a managed array. - int stride_width = image.plane[0].stride; - int stride_height = image.plane[0].height_stride; - int imageBufferSize = stride_width * stride_height; // int imageBufferSize = outputWidth * outputHeight * 4; - - byte[] managedBuffer = new byte[imageBufferSize]; - Marshal.Copy(image.plane[0].data, managedBuffer, 0, imageBufferSize); - - RawPreviewData preview = new RawPreviewData(managedBuffer, stride_width, stride_height, image.width, image.height); - - // Close the image so we don't leak memory. - IntPtr nativeJobPtrPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(IntPtr))); - Marshal.WriteIntPtr(nativeJobPtrPtr, resultingImageStuct); - HBFunctions.hb_image_close(nativeJobPtrPtr); - Marshal.FreeHGlobal(nativeJobPtrPtr); - - return preview; - } - - /// - /// Determines if DRC can be applied to the given track with the given encoder. - /// - /// The track Number. - /// The encoder to use for DRC. - /// The title. - /// True if DRC can be applied to the track with the given encoder. - public bool CanApplyDrc(int trackNumber, HBAudioEncoder encoder, int title) - { - return HBFunctions.hb_audio_can_apply_drc2(this.hbHandle, title, trackNumber, encoder.Id) > 0; - } - - /// - /// Starts an encode with the given job. - /// - /// - /// The encode Object. - /// - [HandleProcessCorruptedStateExceptions] - public void StartEncode(JsonEncodeObject encodeObject) - { - JsonSerializerSettings settings = new JsonSerializerSettings - { - NullValueHandling = NullValueHandling.Ignore, - }; - - string encode = JsonConvert.SerializeObject(encodeObject, Formatting.Indented, settings); - this.StartEncode(encode); - } - - /// - /// Starts an encode with the given job JSON. - /// - /// The JSON for the job to start. - [HandleProcessCorruptedStateExceptions] - public void StartEncode(string encodeJson) - { - HBFunctions.hb_add_json(this.hbHandle, InteropUtilities.ToUtf8PtrFromString(encodeJson)); - HBFunctions.hb_start(this.hbHandle); - - this.encodePollTimer = new Timer(); - this.encodePollTimer.Interval = EncodePollIntervalMs; - - this.encodePollTimer.Elapsed += (o, e) => - { - try - { - this.PollEncodeProgress(); - } - catch (Exception exc) - { - Debug.WriteLine(exc); - } - }; - this.encodePollTimer.Start(); - } - - /// - /// Pauses the current encode. - /// - [HandleProcessCorruptedStateExceptions] - public void PauseEncode() - { - HBFunctions.hb_pause(this.hbHandle); - } - - /// - /// Resumes a paused encode. - /// - [HandleProcessCorruptedStateExceptions] - public void ResumeEncode() - { - HBFunctions.hb_resume(this.hbHandle); - } - - /// - /// Stops the current encode. - /// - [HandleProcessCorruptedStateExceptions] - public void StopEncode() - { - HBFunctions.hb_stop(this.hbHandle); - - // Also remove all jobs from the queue (in case we stopped a 2-pass encode) - var currentJobs = new List(); - - int jobs = HBFunctions.hb_count(this.hbHandle); - for (int i = 0; i < jobs; i++) - { - currentJobs.Add(HBFunctions.hb_job(this.hbHandle, 0)); - } - - foreach (IntPtr job in currentJobs) - { - HBFunctions.hb_rem(this.hbHandle, job); - } - } - - /// - /// Frees any resources associated with this object. - /// - public void Dispose() - { - if (this.disposed) - { - return; - } - - this.Dispose(true); - GC.SuppressFinalize(this); - } - - /// - /// Gets a value indicating whether the object is disposed. - /// - public bool IsDisposed - { - get - { - return this.disposed; - } - } - - /// - /// Frees any resources associated with this object. - /// - /// - /// True if managed objects as well as unmanaged should be disposed. - /// - protected virtual void Dispose(bool disposing) - { - if (disposing) - { - // Free other state (managed objects). - } - - // Free unmanaged objects. - IntPtr handlePtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(IntPtr))); - Marshal.WriteIntPtr(handlePtr, this.hbHandle); - HBFunctions.hb_close(handlePtr); - Marshal.FreeHGlobal(handlePtr); - - this.disposed = true; - } - - /// - /// Checks the status of the ongoing scan. - /// - [HandleProcessCorruptedStateExceptions] - private void PollScanProgress() - { - IntPtr json = HBFunctions.hb_get_state_json(this.hbHandle); - string statusJson = Marshal.PtrToStringAnsi(json); - JsonState state = null; - if (!string.IsNullOrEmpty(statusJson)) - { - state = JsonConvert.DeserializeObject(statusJson); - } - - TaskState taskState = state != null ? TaskState.FromRepositoryValue(state.State) : null; - - if (taskState != null && (taskState == TaskState.Scanning || taskState == TaskState.Searching)) - { - if (this.ScanProgress != null && state.Scanning != null) - { - this.ScanProgress(this, new ScanProgressEventArgs(state.Scanning.Progress, state.Scanning.Preview, state.Scanning.PreviewCount, state.Scanning.Title, state.Scanning.TitleCount)); - } - } - else if (taskState != null && taskState == TaskState.ScanDone) - { - this.scanPollTimer.Stop(); - - var jsonMsg = HBFunctions.hb_get_title_set_json(this.hbHandle); - this.titlesJson = InteropUtilities.ToStringFromUtf8Ptr(jsonMsg); - - if (!string.IsNullOrEmpty(this.titlesJson)) - { - this.titles = JsonConvert.DeserializeObject(this.titlesJson); - if (this.titles != null) - { - this.featureTitle = this.titles.MainFeature; - } - } - - if (this.ScanCompleted != null) - { - this.ScanCompleted(this, new System.EventArgs()); - } - } - } - - /// - /// Checks the status of the ongoing encode. - /// - [HandleProcessCorruptedStateExceptions] - private void PollEncodeProgress() - { - IntPtr json = HBFunctions.hb_get_state_json(this.hbHandle); - string statusJson = Marshal.PtrToStringAnsi(json); - - JsonState state = JsonConvert.DeserializeObject(statusJson); - - TaskState taskState = state != null ? TaskState.FromRepositoryValue(state.State) : null; - - if (taskState != null && (taskState == TaskState.Working || taskState == TaskState.Muxing || taskState == TaskState.Searching)) - { - if (this.EncodeProgress != null) - { - var progressEventArgs = new EncodeProgressEventArgs(state.Working.Progress, state.Working.Rate, state.Working.RateAvg, new TimeSpan(state.Working.Hours, state.Working.Minutes, state.Working.Seconds), - state.Working.PassID, state.Working.Pass, state.Working.PassCount, taskState.Code); - - this.EncodeProgress(this, progressEventArgs); - } - } - else if (taskState != null && taskState == TaskState.WorkDone) - { - this.encodePollTimer.Stop(); - - if (this.EncodeCompleted != null) - { - this.EncodeCompleted( - this, - new EncodeCompletedEventArgs(state.WorkDone.Error != (int)hb_error_code.HB_ERROR_NONE)); - } - } - } - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// A wrapper for a HandBrake instance. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop +{ + using System; + using System.Collections.Generic; + using System.Diagnostics; + using System.Linq; + using System.Runtime.ExceptionServices; + using System.Runtime.InteropServices; + using System.Timers; + + using HandBrake.Interop.Interop.EventArgs; + using HandBrake.Interop.Interop.Factories; + using HandBrake.Interop.Interop.HbLib; + using HandBrake.Interop.Interop.Helpers; + using HandBrake.Interop.Interop.Interfaces; + using HandBrake.Interop.Interop.Json.Encode; + using HandBrake.Interop.Interop.Json.Scan; + using HandBrake.Interop.Interop.Json.State; + using HandBrake.Interop.Interop.Model.Encoding; + using HandBrake.Interop.Interop.Model.Preview; + + using Newtonsoft.Json; + + /// + /// A wrapper for a HandBrake instance. + /// + public class HandBrakeInstance : IHandBrakeInstance, IDisposable + { + /// + /// The number of MS between status polls when scanning. + /// + private const double ScanPollIntervalMs = 250; + + /// + /// The number of MS between status polls when encoding. + /// + private const double EncodePollIntervalMs = 250; + + /// + /// The native handle to the HandBrake instance. + /// + private IntPtr hbHandle; + + /// + /// The number of previews created during scan. + /// + private int previewCount; + + /// + /// The timer to poll for scan status. + /// + private Timer scanPollTimer; + + /// + /// The timer to poll for encode status. + /// + private Timer encodePollTimer; + + /// + /// The list of titles on this instance. + /// + private JsonScanObject titles; + + /// + /// The raw JSON for the titles list. + /// + private string titlesJson; + + /// + /// The index of the default title. + /// + private int featureTitle; + + /// + /// A value indicating whether this object has been disposed or not. + /// + private bool disposed; + + /// + /// Finalizes an instance of the HandBrakeInstance class. + /// + ~HandBrakeInstance() + { + this.Dispose(false); + } + + /// + /// Fires for progress updates when scanning. + /// + public event EventHandler ScanProgress; + + /// + /// Fires when a scan has completed. + /// + public event EventHandler ScanCompleted; + + /// + /// Fires for progress updates when encoding. + /// + public event EventHandler EncodeProgress; + + /// + /// Fires when an encode has completed. + /// + public event EventHandler EncodeCompleted; + + /// + /// Gets the handle. + /// + internal IntPtr Handle + { + get + { + return this.hbHandle; + } + } + + /// + /// Gets the number of previews created during scan. + /// + public int PreviewCount + { + get + { + return this.previewCount; + } + } + + /// + /// Gets the list of titles on this instance. + /// + public JsonScanObject Titles + { + get + { + return this.titles; + } + } + + /// + /// Gets the raw JSON for the list of titles on this instance. + /// + public string TitlesJson + { + get + { + return this.titlesJson; + } + } + + /// + /// Gets the index of the default title. + /// + public int FeatureTitle + { + get + { + return this.featureTitle; + } + } + + /// + /// Gets the HandBrake version string. + /// + public string Version + { + get + { + var versionPtr = HBFunctions.hb_get_version(this.hbHandle); + return Marshal.PtrToStringAnsi(versionPtr); + } + } + + /// + /// Gets the HandBrake build number. + /// + public int Build + { + get + { + return HBFunctions.hb_get_build(this.hbHandle); + } + } + + /// + /// Initializes this instance. + /// + /// + /// The code for the logging verbosity to use. + /// + public void Initialize(int verbosity) + { + HandBrakeUtils.EnsureGlobalInit(); + + HandBrakeUtils.RegisterLogger(); + this.hbHandle = HBFunctions.hb_init(verbosity, update_check: 0); + } + + /// + /// Starts a scan of the given path. + /// + /// + /// The path of the video to scan. + /// + /// + /// The number of previews to make on each title. + /// + /// + /// The minimum duration of a title to show up on the scan. + /// + /// + /// The title index to scan (1-based, 0 for all titles). + /// + public void StartScan(string path, int previewCount, TimeSpan minDuration, int titleIndex) + { + this.previewCount = previewCount; + + IntPtr pathPtr = InteropUtilities.ToUtf8PtrFromString(path); + HBFunctions.hb_scan(this.hbHandle, pathPtr, titleIndex, previewCount, 1, (ulong)(minDuration.TotalSeconds * 90000)); + Marshal.FreeHGlobal(pathPtr); + + this.scanPollTimer = new Timer(); + this.scanPollTimer.Interval = ScanPollIntervalMs; + + // Lambda notation used to make sure we can view any JIT exceptions the method throws + this.scanPollTimer.Elapsed += (o, e) => + { + try + { + this.PollScanProgress(); + } + catch (Exception exc) + { + Debug.WriteLine(exc); + HandBrakeUtils.SendErrorEvent(exc.ToString()); + } + }; + this.scanPollTimer.Start(); + } + + /// + /// Stops an ongoing scan. + /// + [HandleProcessCorruptedStateExceptions] + public void StopScan() + { + HBFunctions.hb_scan_stop(this.hbHandle); + } + + /// + /// Gets an image for the given job and preview + /// + /// + /// Only incorporates sizing and aspect ratio into preview image. + /// + /// + /// The encode job to preview. + /// + /// + /// The index of the preview to get (0-based). + /// + /// + /// True to enable basic deinterlace of preview images. + /// + /// + /// An image with the requested preview. + /// + [HandleProcessCorruptedStateExceptions] + public RawPreviewData GetPreview(PreviewSettings settings, int previewNumber, bool deinterlace) + { + SourceTitle title = this.Titles.TitleList.FirstOrDefault(t => t.Index == settings.TitleNumber); + + // Create the Expected Output Geometry details for libhb. + hb_geometry_settings_s uiGeometry = new hb_geometry_settings_s + { + crop = new[] { settings.Cropping.Top, settings.Cropping.Bottom, settings.Cropping.Left, settings.Cropping.Right }, + itu_par = 0, + keep = (int)AnamorphicFactory.KeepSetting.HB_KEEP_WIDTH + (settings.KeepDisplayAspect ? 0x04 : 0), // TODO Keep Width? + maxWidth = settings.MaxWidth, + maxHeight = settings.MaxHeight, + mode = (int)(hb_anamorphic_mode_t)settings.Anamorphic, + modulus = settings.Modulus ?? 16, + geometry = new hb_geometry_s + { + height = settings.Height, + width = settings.Width, + par = settings.Anamorphic != Anamorphic.Custom && settings.Anamorphic != Anamorphic.Automatic + ? new hb_rational_t { den = title.Geometry.PAR.Den, num = title.Geometry.PAR.Num } + : new hb_rational_t { den = settings.PixelAspectY, num = settings.PixelAspectX } + } + }; + + // Fetch the image data from LibHb + IntPtr resultingImageStuct = HBFunctions.hb_get_preview2(this.hbHandle, settings.TitleNumber, previewNumber, ref uiGeometry, deinterlace ? 1 : 0); + hb_image_s image = InteropUtilities.ToStructureFromPtr(resultingImageStuct); + + // Copy the filled image buffer to a managed array. + int stride_width = image.plane[0].stride; + int stride_height = image.plane[0].height_stride; + int imageBufferSize = stride_width * stride_height; // int imageBufferSize = outputWidth * outputHeight * 4; + + byte[] managedBuffer = new byte[imageBufferSize]; + Marshal.Copy(image.plane[0].data, managedBuffer, 0, imageBufferSize); + + RawPreviewData preview = new RawPreviewData(managedBuffer, stride_width, stride_height, image.width, image.height); + + // Close the image so we don't leak memory. + IntPtr nativeJobPtrPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(IntPtr))); + Marshal.WriteIntPtr(nativeJobPtrPtr, resultingImageStuct); + HBFunctions.hb_image_close(nativeJobPtrPtr); + Marshal.FreeHGlobal(nativeJobPtrPtr); + + return preview; + } + + /// + /// Determines if DRC can be applied to the given track with the given encoder. + /// + /// The track Number. + /// The encoder to use for DRC. + /// The title. + /// True if DRC can be applied to the track with the given encoder. + public bool CanApplyDrc(int trackNumber, HBAudioEncoder encoder, int title) + { + return HBFunctions.hb_audio_can_apply_drc2(this.hbHandle, title, trackNumber, encoder.Id) > 0; + } + + /// + /// Starts an encode with the given job. + /// + /// + /// The encode Object. + /// + [HandleProcessCorruptedStateExceptions] + public void StartEncode(JsonEncodeObject encodeObject) + { + JsonSerializerSettings settings = new JsonSerializerSettings + { + NullValueHandling = NullValueHandling.Ignore, + }; + + string encode = JsonConvert.SerializeObject(encodeObject, Formatting.Indented, settings); + this.StartEncode(encode); + } + + /// + /// Starts an encode with the given job JSON. + /// + /// The JSON for the job to start. + [HandleProcessCorruptedStateExceptions] + public void StartEncode(string encodeJson) + { + HBFunctions.hb_add_json(this.hbHandle, InteropUtilities.ToUtf8PtrFromString(encodeJson)); + HBFunctions.hb_start(this.hbHandle); + + this.encodePollTimer = new Timer(); + this.encodePollTimer.Interval = EncodePollIntervalMs; + + this.encodePollTimer.Elapsed += (o, e) => + { + try + { + this.PollEncodeProgress(); + } + catch (Exception exc) + { + Debug.WriteLine(exc); + } + }; + this.encodePollTimer.Start(); + } + + /// + /// Pauses the current encode. + /// + [HandleProcessCorruptedStateExceptions] + public void PauseEncode() + { + HBFunctions.hb_pause(this.hbHandle); + } + + /// + /// Resumes a paused encode. + /// + [HandleProcessCorruptedStateExceptions] + public void ResumeEncode() + { + HBFunctions.hb_resume(this.hbHandle); + } + + /// + /// Stops the current encode. + /// + [HandleProcessCorruptedStateExceptions] + public void StopEncode() + { + HBFunctions.hb_stop(this.hbHandle); + + // Also remove all jobs from the queue (in case we stopped a 2-pass encode) + var currentJobs = new List(); + + int jobs = HBFunctions.hb_count(this.hbHandle); + for (int i = 0; i < jobs; i++) + { + currentJobs.Add(HBFunctions.hb_job(this.hbHandle, 0)); + } + + foreach (IntPtr job in currentJobs) + { + HBFunctions.hb_rem(this.hbHandle, job); + } + } + + /// + /// Frees any resources associated with this object. + /// + public void Dispose() + { + if (this.disposed) + { + return; + } + + this.Dispose(true); + GC.SuppressFinalize(this); + } + + /// + /// Gets a value indicating whether the object is disposed. + /// + public bool IsDisposed + { + get + { + return this.disposed; + } + } + + /// + /// Frees any resources associated with this object. + /// + /// + /// True if managed objects as well as unmanaged should be disposed. + /// + protected virtual void Dispose(bool disposing) + { + if (disposing) + { + // Free other state (managed objects). + } + + // Free unmanaged objects. + IntPtr handlePtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(IntPtr))); + Marshal.WriteIntPtr(handlePtr, this.hbHandle); + HBFunctions.hb_close(handlePtr); + Marshal.FreeHGlobal(handlePtr); + + this.disposed = true; + } + + /// + /// Checks the status of the ongoing scan. + /// + [HandleProcessCorruptedStateExceptions] + private void PollScanProgress() + { + IntPtr json = HBFunctions.hb_get_state_json(this.hbHandle); + string statusJson = Marshal.PtrToStringAnsi(json); + JsonState state = null; + if (!string.IsNullOrEmpty(statusJson)) + { + state = JsonConvert.DeserializeObject(statusJson); + } + + TaskState taskState = state != null ? TaskState.FromRepositoryValue(state.State) : null; + + if (taskState != null && (taskState == TaskState.Scanning || taskState == TaskState.Searching)) + { + if (this.ScanProgress != null && state.Scanning != null) + { + this.ScanProgress(this, new ScanProgressEventArgs(state.Scanning.Progress, state.Scanning.Preview, state.Scanning.PreviewCount, state.Scanning.Title, state.Scanning.TitleCount)); + } + } + else if (taskState != null && taskState == TaskState.ScanDone) + { + this.scanPollTimer.Stop(); + + var jsonMsg = HBFunctions.hb_get_title_set_json(this.hbHandle); + this.titlesJson = InteropUtilities.ToStringFromUtf8Ptr(jsonMsg); + + if (!string.IsNullOrEmpty(this.titlesJson)) + { + this.titles = JsonConvert.DeserializeObject(this.titlesJson); + if (this.titles != null) + { + this.featureTitle = this.titles.MainFeature; + } + } + + if (this.ScanCompleted != null) + { + this.ScanCompleted(this, new System.EventArgs()); + } + } + } + + /// + /// Checks the status of the ongoing encode. + /// + [HandleProcessCorruptedStateExceptions] + private void PollEncodeProgress() + { + IntPtr json = HBFunctions.hb_get_state_json(this.hbHandle); + string statusJson = Marshal.PtrToStringAnsi(json); + + JsonState state = JsonConvert.DeserializeObject(statusJson); + + TaskState taskState = state != null ? TaskState.FromRepositoryValue(state.State) : null; + + if (taskState != null && (taskState == TaskState.Working || taskState == TaskState.Muxing || taskState == TaskState.Searching)) + { + if (this.EncodeProgress != null) + { + var progressEventArgs = new EncodeProgressEventArgs(state.Working.Progress, state.Working.Rate, state.Working.RateAvg, new TimeSpan(state.Working.Hours, state.Working.Minutes, state.Working.Seconds), + state.Working.PassID, state.Working.Pass, state.Working.PassCount, taskState.Code); + + this.EncodeProgress(this, progressEventArgs); + } + } + else if (taskState != null && taskState == TaskState.WorkDone) + { + this.encodePollTimer.Stop(); + + if (this.EncodeCompleted != null) + { + this.EncodeCompleted( + this, + new EncodeCompletedEventArgs(state.WorkDone.Error != (int)hb_error_code.HB_ERROR_NONE)); + } + } + } + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstanceManager.cs b/win/CS/HandBrake.Interop/Interop/HandBrakeInstanceManager.cs similarity index 94% rename from win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstanceManager.cs rename to win/CS/HandBrake.Interop/Interop/HandBrakeInstanceManager.cs index 5ceb70bdc..07ddb8a15 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstanceManager.cs +++ b/win/CS/HandBrake.Interop/Interop/HandBrakeInstanceManager.cs @@ -1,171 +1,171 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// The hand brake instance manager. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop -{ - using System; - - using HandBrake.ApplicationServices.Interop.Interfaces; - - /// - /// The HandBrake Instance manager. - /// Only supports scanning right now. - /// - public static class HandBrakeInstanceManager - { - private static HandBrakeInstance scanInstance; - private static HandBrakeInstance encodeInstance; - private static HandBrakeInstance previewInstance; - private static HandBrakeInstance masterInstance; - - /// - /// Initializes static members of the class. - /// - static HandBrakeInstanceManager() - { - masterInstance = new HandBrakeInstance(); - masterInstance.Initialize(2); - } - - /// - /// The init. - /// - public static void Init() - { - // Nothing to do. Triggers static constructor. - } - - /// - /// Gets the scanInstance. - /// - /// - /// The verbosity. - /// - /// - /// The . - /// - public static IHandBrakeInstance GetScanInstance(int verbosity) - { - if (scanInstance != null) - { - scanInstance.Dispose(); - scanInstance = null; - } - - HandBrakeInstance newInstance = new HandBrakeInstance(); - newInstance.Initialize(verbosity); - scanInstance = newInstance; - - return scanInstance; - } - - /// - /// The get encode instance. - /// - /// - /// The verbosity. - /// - /// - /// The . - /// - public static IHandBrakeInstance GetEncodeInstance(int verbosity) - { - if (encodeInstance != null) - { - encodeInstance.Dispose(); - encodeInstance = null; - } - - HandBrakeInstance newInstance = new HandBrakeInstance(); - newInstance.Initialize(verbosity); - encodeInstance = newInstance; - - return encodeInstance; - } - - /// - /// The get encode instance. - /// - /// - /// The verbosity. - /// - /// - /// The . - /// - public static IHandBrakeInstance GetPreviewInstance(int verbosity) - { - if (previewInstance != null) - { - previewInstance.Dispose(); - previewInstance = null; - } - - HandBrakeInstance newInstance = new HandBrakeInstance(); - newInstance.Initialize(verbosity); - previewInstance = newInstance; - - return previewInstance; - } - - /// - /// Gets the master instance. - /// - internal static IHandBrakeInstance MasterInstance - { - get - { - return masterInstance; - } - } - - /// - /// Gets the last scan scan instance. - /// - internal static IHandBrakeInstance LastScanScanInstance - { - get - { - return scanInstance; - } - } - - /// - /// Gets the handle. - /// - internal static IntPtr LastScanHandle - { - get - { - return scanInstance.Handle; - } - } - - /// - /// Gets the last encode scan instance. - /// - internal static IHandBrakeInstance LastEncodeScanInstance - { - get - { - return encodeInstance; - } - } - - /// - /// Gets the encode handle. - /// - internal static IntPtr LastEncodeHandle - { - get - { - return encodeInstance.Handle; - } - } - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The hand brake instance manager. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop +{ + using System; + + using HandBrake.Interop.Interop.Interfaces; + + /// + /// The HandBrake Instance manager. + /// Only supports scanning right now. + /// + public static class HandBrakeInstanceManager + { + private static HandBrakeInstance scanInstance; + private static HandBrakeInstance encodeInstance; + private static HandBrakeInstance previewInstance; + private static HandBrakeInstance masterInstance; + + /// + /// Initializes static members of the class. + /// + static HandBrakeInstanceManager() + { + masterInstance = new HandBrakeInstance(); + masterInstance.Initialize(2); + } + + /// + /// The init. + /// + public static void Init() + { + // Nothing to do. Triggers static constructor. + } + + /// + /// Gets the scanInstance. + /// + /// + /// The verbosity. + /// + /// + /// The . + /// + public static IHandBrakeInstance GetScanInstance(int verbosity) + { + if (scanInstance != null) + { + scanInstance.Dispose(); + scanInstance = null; + } + + HandBrakeInstance newInstance = new HandBrakeInstance(); + newInstance.Initialize(verbosity); + scanInstance = newInstance; + + return scanInstance; + } + + /// + /// The get encode instance. + /// + /// + /// The verbosity. + /// + /// + /// The . + /// + public static IHandBrakeInstance GetEncodeInstance(int verbosity) + { + if (encodeInstance != null) + { + encodeInstance.Dispose(); + encodeInstance = null; + } + + HandBrakeInstance newInstance = new HandBrakeInstance(); + newInstance.Initialize(verbosity); + encodeInstance = newInstance; + + return encodeInstance; + } + + /// + /// The get encode instance. + /// + /// + /// The verbosity. + /// + /// + /// The . + /// + public static IHandBrakeInstance GetPreviewInstance(int verbosity) + { + if (previewInstance != null) + { + previewInstance.Dispose(); + previewInstance = null; + } + + HandBrakeInstance newInstance = new HandBrakeInstance(); + newInstance.Initialize(verbosity); + previewInstance = newInstance; + + return previewInstance; + } + + /// + /// Gets the master instance. + /// + internal static IHandBrakeInstance MasterInstance + { + get + { + return masterInstance; + } + } + + /// + /// Gets the last scan scan instance. + /// + internal static IHandBrakeInstance LastScanScanInstance + { + get + { + return scanInstance; + } + } + + /// + /// Gets the handle. + /// + internal static IntPtr LastScanHandle + { + get + { + return scanInstance.Handle; + } + } + + /// + /// Gets the last encode scan instance. + /// + internal static IHandBrakeInstance LastEncodeScanInstance + { + get + { + return encodeInstance; + } + } + + /// + /// Gets the encode handle. + /// + internal static IntPtr LastEncodeHandle + { + get + { + return encodeInstance.Handle; + } + } + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeLanguagesHelper.cs b/win/CS/HandBrake.Interop/Interop/HandBrakeLanguagesHelper.cs similarity index 87% rename from win/CS/HandBrake.ApplicationServices/Interop/HandBrakeLanguagesHelper.cs rename to win/CS/HandBrake.Interop/Interop/HandBrakeLanguagesHelper.cs index 343280031..36b7a19e1 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeLanguagesHelper.cs +++ b/win/CS/HandBrake.Interop/Interop/HandBrakeLanguagesHelper.cs @@ -1,52 +1,52 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// Contains utilities for converting language codes. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop -{ - using System.Collections.Generic; - - using HandBrake.ApplicationServices.Interop.HbLib; - using HandBrake.ApplicationServices.Interop.Helpers; - using HandBrake.ApplicationServices.Interop.Model; - - /// - /// Contains utilities for converting language codes. - /// - public static class HandBrakeLanguagesHelper - { - /// - /// The list of all languages. - /// - private static IList allLanguages; - - /// - /// Gets a list of all languages. - /// - public static IList AllLanguages - { - get - { - return allLanguages - ?? (allLanguages = - InteropUtilities.ToListFromIterator(HBFunctions.lang_get_next, HandBrakeUnitConversionHelpers.NativeToLanguage)); - } - } - - /// - /// Gets the language object for the given code. - /// - /// The ISO-639-2 code for the language. - /// Object that describes the language. - public static Language Get(string code) - { - iso639_lang_t language = InteropUtilities.ToStructureFromPtr(HBFunctions.lang_for_code2(code)); - return HandBrakeUnitConversionHelpers.NativeToLanguage(language); - } - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Contains utilities for converting language codes. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop +{ + using System.Collections.Generic; + + using HandBrake.Interop.Interop.HbLib; + using HandBrake.Interop.Interop.Helpers; + using HandBrake.Interop.Interop.Model; + + /// + /// Contains utilities for converting language codes. + /// + public static class HandBrakeLanguagesHelper + { + /// + /// The list of all languages. + /// + private static IList allLanguages; + + /// + /// Gets a list of all languages. + /// + public static IList AllLanguages + { + get + { + return allLanguages + ?? (allLanguages = + InteropUtilities.ToListFromIterator(HBFunctions.lang_get_next, HandBrakeUnitConversionHelpers.NativeToLanguage)); + } + } + + /// + /// Gets the language object for the given code. + /// + /// The ISO-639-2 code for the language. + /// Object that describes the language. + public static Language Get(string code) + { + iso639_lang_t language = InteropUtilities.ToStructureFromPtr(HBFunctions.lang_for_code2(code)); + return HandBrakeUnitConversionHelpers.NativeToLanguage(language); + } + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakePresetService.cs b/win/CS/HandBrake.Interop/Interop/HandBrakePresetService.cs similarity index 90% rename from win/CS/HandBrake.ApplicationServices/Interop/HandBrakePresetService.cs rename to win/CS/HandBrake.Interop/Interop/HandBrakePresetService.cs index e3667a966..a51a44fd1 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakePresetService.cs +++ b/win/CS/HandBrake.Interop/Interop/HandBrakePresetService.cs @@ -1,92 +1,92 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// The hand brake preset service. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop -{ - using System; - using System.Collections.Generic; - using System.IO; - using System.Runtime.InteropServices; - - using HandBrake.ApplicationServices.Interop.HbLib; - using HandBrake.ApplicationServices.Interop.Helpers; - using HandBrake.ApplicationServices.Interop.Json.Presets; - - using Newtonsoft.Json; - - /// - /// The hand brake preset service. - /// - public class HandBrakePresetService - { - /// - /// The get built in presets. - /// Requires an hb_init to have been invoked. - /// - /// - /// The . - /// - public static IList GetBuiltInPresets() - { - IntPtr presets = HBFunctions.hb_presets_builtin_get_json(); - string presetJson = Marshal.PtrToStringAnsi(presets); - IList presetList = JsonConvert.DeserializeObject>(presetJson); - - return presetList; - } - - /// - /// The get preset from file. - /// - /// - /// The filename. - /// - /// - /// The . - /// - public static PresetTransportContainer GetPresetFromFile(string filename) - { - IntPtr presetStringPointer = HBFunctions.hb_presets_read_file_json(InteropUtilities.ToUtf8PtrFromString(filename)); - string presetJson = Marshal.PtrToStringAnsi(presetStringPointer); - - if (!string.IsNullOrEmpty(presetJson)) - { - // Check to see if we have a list of presets. - if (presetJson.StartsWith("[")) - { - presetJson = "{ \"PresetList\":" + presetJson + " } "; - } - - PresetTransportContainer preset = JsonConvert.DeserializeObject(presetJson); - - return preset; - } - - return null; - } - - /// - /// The export preset. - /// - /// - /// The filename. - /// - /// - /// The container. - /// - public static void ExportPreset(string filename, PresetTransportContainer container) - { - string preset = JsonConvert.SerializeObject(container, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore }); - using (StreamWriter writer = new StreamWriter(filename)) - { - writer.Write(preset); - } - } - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The hand brake preset service. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop +{ + using System; + using System.Collections.Generic; + using System.IO; + using System.Runtime.InteropServices; + + using HandBrake.Interop.Interop.HbLib; + using HandBrake.Interop.Interop.Helpers; + using HandBrake.Interop.Interop.Json.Presets; + + using Newtonsoft.Json; + + /// + /// The hand brake preset service. + /// + public class HandBrakePresetService + { + /// + /// The get built in presets. + /// Requires an hb_init to have been invoked. + /// + /// + /// The . + /// + public static IList GetBuiltInPresets() + { + IntPtr presets = HBFunctions.hb_presets_builtin_get_json(); + string presetJson = Marshal.PtrToStringAnsi(presets); + IList presetList = JsonConvert.DeserializeObject>(presetJson); + + return presetList; + } + + /// + /// The get preset from file. + /// + /// + /// The filename. + /// + /// + /// The . + /// + public static PresetTransportContainer GetPresetFromFile(string filename) + { + IntPtr presetStringPointer = HBFunctions.hb_presets_read_file_json(InteropUtilities.ToUtf8PtrFromString(filename)); + string presetJson = Marshal.PtrToStringAnsi(presetStringPointer); + + if (!string.IsNullOrEmpty(presetJson)) + { + // Check to see if we have a list of presets. + if (presetJson.StartsWith("[")) + { + presetJson = "{ \"PresetList\":" + presetJson + " } "; + } + + PresetTransportContainer preset = JsonConvert.DeserializeObject(presetJson); + + return preset; + } + + return null; + } + + /// + /// The export preset. + /// + /// + /// The filename. + /// + /// + /// The container. + /// + public static void ExportPreset(string filename, PresetTransportContainer container) + { + string preset = JsonConvert.SerializeObject(container, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore }); + using (StreamWriter writer = new StreamWriter(filename)) + { + writer.Write(preset); + } + } + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUnitConversionHelpers.cs b/win/CS/HandBrake.Interop/Interop/HandBrakeUnitConversionHelpers.cs similarity index 93% rename from win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUnitConversionHelpers.cs rename to win/CS/HandBrake.Interop/Interop/HandBrakeUnitConversionHelpers.cs index 5140ddba4..93cc0fc0c 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUnitConversionHelpers.cs +++ b/win/CS/HandBrake.Interop/Interop/HandBrakeUnitConversionHelpers.cs @@ -1,191 +1,191 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// Defines the HandrakeUnitConversionHelpers type. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop -{ - using System; - using System.Collections.Generic; - using System.Globalization; - - using HandBrake.ApplicationServices.Interop.HbLib; - using HandBrake.ApplicationServices.Interop.Helpers; - using HandBrake.ApplicationServices.Interop.Model; - using HandBrake.ApplicationServices.Interop.Model.Encoding; - - /// - /// Converters for various encoding values. - /// - public static class HandBrakeUnitConversionHelpers - { - /// - /// Video Frame Rates - /// - private static readonly Dictionary VideoRates; - - /// - /// Initializes static members of the HandBrakeUnitConversionHelpers class. - /// - static HandBrakeUnitConversionHelpers() - { - HandBrakeUtils.EnsureGlobalInit(); - - VideoRates = new Dictionary(); - foreach (var framerate in HandBrakeEncoderHelpers.VideoFramerates) - { - VideoRates.Add(double.Parse(framerate.Name, CultureInfo.InvariantCulture), framerate.Rate); - } - } - - /// - /// Convert Framerate to Video Rates - /// - /// - /// The framerate. - /// - /// - /// The vrate if a valid framerate is passed in. - /// - /// - /// Thrown when framerate is invalid. - /// - public static int FramerateToVrate(double framerate) - { - if (!VideoRates.ContainsKey(framerate)) - { - throw new ArgumentException("Framerate not recognized.", "framerate"); - } - - return VideoRates[framerate]; - } - - /// - /// Converts a native HB encoder structure to an Encoder model. - /// - /// - /// The structure to convert. - /// - /// - /// The converted model. - /// - internal static HBVideoEncoder NativeToVideoEncoder(hb_encoder_s encoder) - { - return new HBVideoEncoder(encoder.muxers, encoder.name, encoder.codec, encoder.short_name); - } - - /// - /// Converts a native HB encoder structure to an Encoder model. - /// - /// - /// The structure to convert. - /// - /// - /// The converted model. - /// - internal static HBAudioEncoder NativeToAudioEncoder(hb_encoder_s encoder) - { - var result = new HBAudioEncoder( - encoder.muxers, - HandBrakeEncoderHelpers.GetAudioCompressionLimits(encoder.codec), - HBFunctions.hb_audio_compression_get_default((uint)encoder.codec), - HBFunctions.hb_audio_quality_get_default((uint)encoder.codec), - encoder.name, - encoder.codec, - HandBrakeEncoderHelpers.GetAudioQualityLimits(encoder.codec), - encoder.short_name); - - return result; - } - - /// - /// Converts a native HB rate structure to an HBRate object. - /// - /// - /// The structure to convert. - /// - /// - /// The converted rate object. - /// - internal static HBRate NativeToRate(hb_rate_s rate) - { - return new HBRate(rate.name, rate.rate); - } - - /// - /// Converts a native HB mixdown structure to a Mixdown model. - /// - /// - /// The structure to convert. - /// - /// - /// The converted model. - /// - internal static HBMixdown NativeToMixdown(hb_mixdown_s mixdown) - { - return new HBMixdown(mixdown.name, mixdown.amixdown, mixdown.short_name); - } - - /// - /// Converts a native HB container structure into an HBContainer object. - /// - /// - /// The structure to convert. - /// - /// - /// The converted structure. - /// - internal static HBContainer NativeToContainer(hb_container_s container) - { - return new HBContainer(container.default_extension, container.name, container.format, container.short_name); - } - - /// - /// Converts a native language structure to a Language object. - /// - /// - /// The structure to convert. - /// - /// - /// The converted structure. - /// - internal static Language NativeToLanguage(iso639_lang_t language) - { - string englishName = InteropUtilities.ToStringFromUtf8Ptr(language.eng_name); - string nativeName = InteropUtilities.ToStringFromUtf8Ptr(language.native_name); - return new Language(englishName, nativeName, language.iso639_2); - } - - /// - /// Converts the PTS amount to a TimeSpan. There may be some accuracy loss here. - /// - /// - /// The PTS to convert. - /// - /// - /// The timespan for it. - /// - public static TimeSpan PtsToTimeSpan(ulong pts) - { - return TimeSpan.FromTicks((long)((pts * 10000000) / 90000)); - } - - /// - /// Converts the PTS amount to seconds. - /// - /// - /// The PTS to convert. - /// - /// - /// The corresponding number of seconds. - /// - public static double PtsToSeconds(ulong pts) - { - return (double)pts / 90000; - } - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Defines the HandrakeUnitConversionHelpers type. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop +{ + using System; + using System.Collections.Generic; + using System.Globalization; + + using HandBrake.Interop.Interop.HbLib; + using HandBrake.Interop.Interop.Helpers; + using HandBrake.Interop.Interop.Model; + using HandBrake.Interop.Interop.Model.Encoding; + + /// + /// Converters for various encoding values. + /// + public static class HandBrakeUnitConversionHelpers + { + /// + /// Video Frame Rates + /// + private static readonly Dictionary VideoRates; + + /// + /// Initializes static members of the HandBrakeUnitConversionHelpers class. + /// + static HandBrakeUnitConversionHelpers() + { + HandBrakeUtils.EnsureGlobalInit(); + + VideoRates = new Dictionary(); + foreach (var framerate in HandBrakeEncoderHelpers.VideoFramerates) + { + VideoRates.Add(double.Parse(framerate.Name, CultureInfo.InvariantCulture), framerate.Rate); + } + } + + /// + /// Convert Framerate to Video Rates + /// + /// + /// The framerate. + /// + /// + /// The vrate if a valid framerate is passed in. + /// + /// + /// Thrown when framerate is invalid. + /// + public static int FramerateToVrate(double framerate) + { + if (!VideoRates.ContainsKey(framerate)) + { + throw new ArgumentException("Framerate not recognized.", "framerate"); + } + + return VideoRates[framerate]; + } + + /// + /// Converts a native HB encoder structure to an Encoder model. + /// + /// + /// The structure to convert. + /// + /// + /// The converted model. + /// + internal static HBVideoEncoder NativeToVideoEncoder(hb_encoder_s encoder) + { + return new HBVideoEncoder(encoder.muxers, encoder.name, encoder.codec, encoder.short_name); + } + + /// + /// Converts a native HB encoder structure to an Encoder model. + /// + /// + /// The structure to convert. + /// + /// + /// The converted model. + /// + internal static HBAudioEncoder NativeToAudioEncoder(hb_encoder_s encoder) + { + var result = new HBAudioEncoder( + encoder.muxers, + HandBrakeEncoderHelpers.GetAudioCompressionLimits(encoder.codec), + HBFunctions.hb_audio_compression_get_default((uint)encoder.codec), + HBFunctions.hb_audio_quality_get_default((uint)encoder.codec), + encoder.name, + encoder.codec, + HandBrakeEncoderHelpers.GetAudioQualityLimits(encoder.codec), + encoder.short_name); + + return result; + } + + /// + /// Converts a native HB rate structure to an HBRate object. + /// + /// + /// The structure to convert. + /// + /// + /// The converted rate object. + /// + internal static HBRate NativeToRate(hb_rate_s rate) + { + return new HBRate(rate.name, rate.rate); + } + + /// + /// Converts a native HB mixdown structure to a Mixdown model. + /// + /// + /// The structure to convert. + /// + /// + /// The converted model. + /// + internal static HBMixdown NativeToMixdown(hb_mixdown_s mixdown) + { + return new HBMixdown(mixdown.name, mixdown.amixdown, mixdown.short_name); + } + + /// + /// Converts a native HB container structure into an HBContainer object. + /// + /// + /// The structure to convert. + /// + /// + /// The converted structure. + /// + internal static HBContainer NativeToContainer(hb_container_s container) + { + return new HBContainer(container.default_extension, container.name, container.format, container.short_name); + } + + /// + /// Converts a native language structure to a Language object. + /// + /// + /// The structure to convert. + /// + /// + /// The converted structure. + /// + internal static Language NativeToLanguage(iso639_lang_t language) + { + string englishName = InteropUtilities.ToStringFromUtf8Ptr(language.eng_name); + string nativeName = InteropUtilities.ToStringFromUtf8Ptr(language.native_name); + return new Language(englishName, nativeName, language.iso639_2); + } + + /// + /// Converts the PTS amount to a TimeSpan. There may be some accuracy loss here. + /// + /// + /// The PTS to convert. + /// + /// + /// The timespan for it. + /// + public static TimeSpan PtsToTimeSpan(ulong pts) + { + return TimeSpan.FromTicks((long)((pts * 10000000) / 90000)); + } + + /// + /// Converts the PTS amount to seconds. + /// + /// + /// The PTS to convert. + /// + /// + /// The corresponding number of seconds. + /// + public static double PtsToSeconds(ulong pts) + { + return (double)pts / 90000; + } + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUtils.cs b/win/CS/HandBrake.Interop/Interop/HandBrakeUtils.cs similarity index 94% rename from win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUtils.cs rename to win/CS/HandBrake.Interop/Interop/HandBrakeUtils.cs index a30f43133..bd8630911 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeUtils.cs +++ b/win/CS/HandBrake.Interop/Interop/HandBrakeUtils.cs @@ -1,346 +1,346 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// Defines the HandBrakeUtils type. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop -{ - using System; - using System.Collections.Generic; - using System.Runtime.InteropServices; - - using HandBrake.ApplicationServices.Interop.EventArgs; - using HandBrake.ApplicationServices.Interop.HbLib; - using HandBrake.ApplicationServices.Interop.Json.Anamorphic; - using HandBrake.ApplicationServices.Interop.Json.Shared; - - using Newtonsoft.Json; - - /// - /// HandBrake Interop Utilities - /// - public static class HandBrakeUtils - { - /// - /// The callback for log messages from HandBrake. - /// - private static LoggingCallback loggingCallback; - - /// - /// The callback for error messages from HandBrake. - /// - private static LoggingCallback errorCallback; - - /// - /// True if the global initialize function has been called. - /// - private static bool globalInitialized; - - /// - /// Fires when HandBrake has logged a message. - /// - public static event EventHandler MessageLogged; - - /// - /// Fires when HandBrake has logged an error. - /// - public static event EventHandler ErrorLogged; - - /// - /// Initializes static members of the HandBrakeUtils class. - /// - static HandBrakeUtils() - { - if (!globalInitialized) - { - if (HBFunctions.hb_global_init() == -1) - { - throw new InvalidOperationException("HB global init failed."); - } - - globalInitialized = true; - } - } - - /// - /// Gets the HandBrake version string. - /// - public static string Version - { - get - { - var versionPtr = HBFunctions.hb_get_version(IntPtr.Zero); // Pointer isn't actually used. - return Marshal.PtrToStringAnsi(versionPtr); - } - } - - /// - /// Gets the HandBrake build number. - /// - public static int Build - { - get - { - return HBFunctions.hb_get_build(IntPtr.Zero); - } - } - - /// - /// Ensures the HB global initialize method has been called. - /// - public static void EnsureGlobalInit() - { - // Does nothing, but invokes static ctor. - } - - /// - /// Enables or disables LibDVDNav. If disabled libdvdread will be used instead. - /// - /// - /// True to enable LibDVDNav. - /// - public static void SetDvdNav(bool enableDvdNav) - { - HBFunctions.hb_dvd_set_dvdnav(enableDvdNav ? 1 : 0); - } - - /// - /// Call before app shutdown. Performs global cleanup. - /// - public static void DisposeGlobal() - { - HBFunctions.hb_global_close(); - } - - /// - /// Register the logger. - /// - public static void RegisterLogger() - { - // Register the logger if we have not already - if (loggingCallback == null) - { - // Keep the callback as a member to prevent it from being garbage collected. - loggingCallback = LoggingHandler; - errorCallback = ErrorHandler; - HBFunctions.hb_register_logger(loggingCallback); - HBFunctions.hb_register_error_handler(errorCallback); - } - } - - /// - /// Handles log messages from HandBrake. - /// - /// - /// The log message (including newline). - /// - public static void LoggingHandler(string message) - { - message = message.TrimEnd(); - if (!string.IsNullOrEmpty(message)) - { - SendMessageEvent(message); - } - } - - /// - /// Handles errors from HandBrake. - /// - /// - /// The error message. - /// - public static void ErrorHandler(string message) - { - if (!string.IsNullOrEmpty(message)) - { - // These errors happen in normal operations. Log them as messages. - if (message == "dvd: ifoOpen failed" || message.Contains("avformat_seek_file failed") || message.Contains("nav_get_title_list")) - { - SendMessageEvent(message); - return; - } - - SendErrorEvent(message); - } - } - - /// - /// Gets the standard x264 option name given the starting point. - /// - /// - /// The name. - /// - /// - /// The standard x264 option name. - /// - public static string SanitizeX264OptName(string name) - { - IntPtr namePtr = Marshal.StringToHGlobalAnsi(name); - string sanitizedName = Marshal.PtrToStringAnsi(HBFunctions.hb_x264_encopt_name(namePtr)); - Marshal.FreeHGlobal(namePtr); - return sanitizedName; - } - - /// - /// Checks to see if the given H.264 level is valid given the inputs. - /// - /// - /// The level to check. - /// - /// - /// The output picture width. - /// - /// - /// The output picture height. - /// - /// - /// The rate numerator. - /// - /// - /// The rate denominator. - /// - /// - /// True if x264 interlaced output is enabled. - /// - /// - /// True if x264 fake interlacing is enabled. - /// - /// - /// True if the level is valid. - /// - public static bool IsH264LevelValid(string level, int width, int height, int fpsNumerator, int fpsDenominator, bool interlaced, bool fakeInterlaced) - { - return HBFunctions.hb_check_h264_level( - level, - width, - height, - fpsNumerator, - fpsDenominator, - interlaced ? 1 : 0, - fakeInterlaced ? 1 : 0) == 0; - } - - /// - /// Creates an X264 options string from the given settings. - /// - /// - /// The x264 preset. - /// - /// - /// The x264 tunes being used. - /// - /// - /// The extra options string. - /// - /// - /// The H.264 profile. - /// - /// - /// The H.264 level. - /// - /// - /// The width of the final picture. - /// - /// - /// The height of the final picture. - /// - /// - /// The full x264 options string from the given inputs. - /// - public static string CreateX264OptionsString( - string preset, - IList tunes, - string extraOptions, - string profile, - string level, - int width, - int height) - { - if (width <= 0) - { - throw new ArgumentException("width must be positive."); - } - - if (height <= 0) - { - throw new ArgumentException("height must be positive."); - } - - IntPtr ptr = HBFunctions.hb_x264_param_unparse( - 8, - preset, - string.Join(",", tunes), - extraOptions, - profile, - level, - width, - height); // TODO add bit-depth support. - - string x264Settings = Marshal.PtrToStringAnsi(ptr); - - return x264Settings; - } - - /// - /// Gets the final size and PAR of the video, given anamorphic inputs. - /// - /// Anamorphic inputs. - /// The final size and PAR of the video. - public static Geometry GetAnamorphicSize(AnamorphicGeometry anamorphicGeometry) - { - string encode = JsonConvert.SerializeObject(anamorphicGeometry, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore }); - IntPtr json = HBFunctions.hb_set_anamorphic_size_json(Marshal.StringToHGlobalAnsi(encode)); - string result = Marshal.PtrToStringAnsi(json); - return JsonConvert.DeserializeObject(result); - } - - public static void Reduce(long den, long num, out long x, out long y) - { - // find the greatest common divisor of num & den by Euclid's algorithm - long n = num, d = den; - while (d > 0) - { - long t = d; - d = n % d; - n = t; - } - - // at this point n is the gcd. if it's non-zero remove it from num - // and den. Otherwise just return the original values. - if (n > 0) - { - num /= n; - den /= n; - } - - x = num; - y = den; - } - - /// - /// Sends the message logged event to any registered listeners. - /// - /// - /// The message to send. - /// - public static void SendMessageEvent(string message) - { - MessageLogged?.Invoke(null, new MessageLoggedEventArgs(message)); - } - - /// - /// Sends the error logged event to any registered listeners. - /// - /// - /// The message to send - /// - public static void SendErrorEvent(string message) - { - ErrorLogged?.Invoke(null, new MessageLoggedEventArgs(message)); - } - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Defines the HandBrakeUtils type. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop +{ + using System; + using System.Collections.Generic; + using System.Runtime.InteropServices; + + using HandBrake.Interop.Interop.EventArgs; + using HandBrake.Interop.Interop.HbLib; + using HandBrake.Interop.Interop.Json.Anamorphic; + using HandBrake.Interop.Interop.Json.Shared; + + using Newtonsoft.Json; + + /// + /// HandBrake Interop Utilities + /// + public static class HandBrakeUtils + { + /// + /// The callback for log messages from HandBrake. + /// + private static LoggingCallback loggingCallback; + + /// + /// The callback for error messages from HandBrake. + /// + private static LoggingCallback errorCallback; + + /// + /// True if the global initialize function has been called. + /// + private static bool globalInitialized; + + /// + /// Fires when HandBrake has logged a message. + /// + public static event EventHandler MessageLogged; + + /// + /// Fires when HandBrake has logged an error. + /// + public static event EventHandler ErrorLogged; + + /// + /// Initializes static members of the HandBrakeUtils class. + /// + static HandBrakeUtils() + { + if (!globalInitialized) + { + if (HBFunctions.hb_global_init() == -1) + { + throw new InvalidOperationException("HB global init failed."); + } + + globalInitialized = true; + } + } + + /// + /// Gets the HandBrake version string. + /// + public static string Version + { + get + { + var versionPtr = HBFunctions.hb_get_version(IntPtr.Zero); // Pointer isn't actually used. + return Marshal.PtrToStringAnsi(versionPtr); + } + } + + /// + /// Gets the HandBrake build number. + /// + public static int Build + { + get + { + return HBFunctions.hb_get_build(IntPtr.Zero); + } + } + + /// + /// Ensures the HB global initialize method has been called. + /// + public static void EnsureGlobalInit() + { + // Does nothing, but invokes static ctor. + } + + /// + /// Enables or disables LibDVDNav. If disabled libdvdread will be used instead. + /// + /// + /// True to enable LibDVDNav. + /// + public static void SetDvdNav(bool enableDvdNav) + { + HBFunctions.hb_dvd_set_dvdnav(enableDvdNav ? 1 : 0); + } + + /// + /// Call before app shutdown. Performs global cleanup. + /// + public static void DisposeGlobal() + { + HBFunctions.hb_global_close(); + } + + /// + /// Register the logger. + /// + public static void RegisterLogger() + { + // Register the logger if we have not already + if (loggingCallback == null) + { + // Keep the callback as a member to prevent it from being garbage collected. + loggingCallback = LoggingHandler; + errorCallback = ErrorHandler; + HBFunctions.hb_register_logger(loggingCallback); + HBFunctions.hb_register_error_handler(errorCallback); + } + } + + /// + /// Handles log messages from HandBrake. + /// + /// + /// The log message (including newline). + /// + public static void LoggingHandler(string message) + { + message = message.TrimEnd(); + if (!string.IsNullOrEmpty(message)) + { + SendMessageEvent(message); + } + } + + /// + /// Handles errors from HandBrake. + /// + /// + /// The error message. + /// + public static void ErrorHandler(string message) + { + if (!string.IsNullOrEmpty(message)) + { + // These errors happen in normal operations. Log them as messages. + if (message == "dvd: ifoOpen failed" || message.Contains("avformat_seek_file failed") || message.Contains("nav_get_title_list")) + { + SendMessageEvent(message); + return; + } + + SendErrorEvent(message); + } + } + + /// + /// Gets the standard x264 option name given the starting point. + /// + /// + /// The name. + /// + /// + /// The standard x264 option name. + /// + public static string SanitizeX264OptName(string name) + { + IntPtr namePtr = Marshal.StringToHGlobalAnsi(name); + string sanitizedName = Marshal.PtrToStringAnsi(HBFunctions.hb_x264_encopt_name(namePtr)); + Marshal.FreeHGlobal(namePtr); + return sanitizedName; + } + + /// + /// Checks to see if the given H.264 level is valid given the inputs. + /// + /// + /// The level to check. + /// + /// + /// The output picture width. + /// + /// + /// The output picture height. + /// + /// + /// The rate numerator. + /// + /// + /// The rate denominator. + /// + /// + /// True if x264 interlaced output is enabled. + /// + /// + /// True if x264 fake interlacing is enabled. + /// + /// + /// True if the level is valid. + /// + public static bool IsH264LevelValid(string level, int width, int height, int fpsNumerator, int fpsDenominator, bool interlaced, bool fakeInterlaced) + { + return HBFunctions.hb_check_h264_level( + level, + width, + height, + fpsNumerator, + fpsDenominator, + interlaced ? 1 : 0, + fakeInterlaced ? 1 : 0) == 0; + } + + /// + /// Creates an X264 options string from the given settings. + /// + /// + /// The x264 preset. + /// + /// + /// The x264 tunes being used. + /// + /// + /// The extra options string. + /// + /// + /// The H.264 profile. + /// + /// + /// The H.264 level. + /// + /// + /// The width of the final picture. + /// + /// + /// The height of the final picture. + /// + /// + /// The full x264 options string from the given inputs. + /// + public static string CreateX264OptionsString( + string preset, + IList tunes, + string extraOptions, + string profile, + string level, + int width, + int height) + { + if (width <= 0) + { + throw new ArgumentException("width must be positive."); + } + + if (height <= 0) + { + throw new ArgumentException("height must be positive."); + } + + IntPtr ptr = HBFunctions.hb_x264_param_unparse( + 8, + preset, + string.Join(",", tunes), + extraOptions, + profile, + level, + width, + height); // TODO add bit-depth support. + + string x264Settings = Marshal.PtrToStringAnsi(ptr); + + return x264Settings; + } + + /// + /// Gets the final size and PAR of the video, given anamorphic inputs. + /// + /// Anamorphic inputs. + /// The final size and PAR of the video. + public static Geometry GetAnamorphicSize(AnamorphicGeometry anamorphicGeometry) + { + string encode = JsonConvert.SerializeObject(anamorphicGeometry, Formatting.Indented, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore }); + IntPtr json = HBFunctions.hb_set_anamorphic_size_json(Marshal.StringToHGlobalAnsi(encode)); + string result = Marshal.PtrToStringAnsi(json); + return JsonConvert.DeserializeObject(result); + } + + public static void Reduce(long den, long num, out long x, out long y) + { + // find the greatest common divisor of num & den by Euclid's algorithm + long n = num, d = den; + while (d > 0) + { + long t = d; + d = n % d; + n = t; + } + + // at this point n is the gcd. if it's non-zero remove it from num + // and den. Otherwise just return the original values. + if (n > 0) + { + num /= n; + den /= n; + } + + x = num; + y = den; + } + + /// + /// Sends the message logged event to any registered listeners. + /// + /// + /// The message to send. + /// + public static void SendMessageEvent(string message) + { + MessageLogged?.Invoke(null, new MessageLoggedEventArgs(message)); + } + + /// + /// Sends the error logged event to any registered listeners. + /// + /// + /// The message to send + /// + public static void SendErrorEvent(string message) + { + ErrorLogged?.Invoke(null, new MessageLoggedEventArgs(message)); + } + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/HBDelegates.cs b/win/CS/HandBrake.Interop/Interop/HbLib/HBDelegates.cs similarity index 91% rename from win/CS/HandBrake.ApplicationServices/Interop/HbLib/HBDelegates.cs rename to win/CS/HandBrake.Interop/Interop/HbLib/HBDelegates.cs index 3dff02a9d..33d3f0bca 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/HBDelegates.cs +++ b/win/CS/HandBrake.Interop/Interop/HbLib/HBDelegates.cs @@ -1,17 +1,17 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// Contains delegates for HandBrake interop. -// -// Disable Stylecop Warnings for this file -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.HbLib -{ - using System.Runtime.InteropServices; - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void LoggingCallback(string message); -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Contains delegates for HandBrake interop. +// +// Disable Stylecop Warnings for this file +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.HbLib +{ + using System.Runtime.InteropServices; + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void LoggingCallback(string message); +} diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/HbFunctions.cs b/win/CS/HandBrake.Interop/Interop/HbLib/HbFunctions.cs similarity index 98% rename from win/CS/HandBrake.ApplicationServices/Interop/HbLib/HbFunctions.cs rename to win/CS/HandBrake.Interop/Interop/HbLib/HbFunctions.cs index 63eac3468..c55c8a927 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/HbFunctions.cs +++ b/win/CS/HandBrake.Interop/Interop/HbLib/HbFunctions.cs @@ -1,462 +1,462 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// Defines the HBFunctions type. -// -// Disable Stylecop Warnings for this file -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.HbLib -{ - using System; - using System.Runtime.InteropServices; - - /// - /// Contains p-invoke function declarations to hblib. - /// - public static class HBFunctions - { - [DllImport("hb", EntryPoint = "hb_register_logger", CallingConvention = CallingConvention.Cdecl)] - public static extern void hb_register_logger(LoggingCallback callback); - - [DllImport("hb", EntryPoint = "hb_register_error_handler", CallingConvention = CallingConvention.Cdecl)] - public static extern void hb_register_error_handler(LoggingCallback callback); - - [DllImport("hb", EntryPoint = "hb_global_init", CallingConvention = CallingConvention.Cdecl)] - public static extern int hb_global_init(); - - /// Return Type: hb_handle_t* - ///verbose: int - ///update_check: int - [DllImport("hb", EntryPoint = "hb_init", CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr hb_init(int verbose, int update_check); - - - /// Return Type: hb_handle_t* - ///verbose: int - ///update_check: int - [DllImport("hb", EntryPoint = "hb_init_dl", CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr hb_init_dl(int verbose, int update_check); - - - /// Return Type: char* - ///param0: hb_handle_t* - [DllImport("hb", EntryPoint = "hb_get_version", CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr hb_get_version(IntPtr hbHandle); - - - /// Return Type: int - ///param0: hb_handle_t* - [DllImport("hb", EntryPoint = "hb_get_build", CallingConvention = CallingConvention.Cdecl)] - public static extern int hb_get_build(IntPtr hbHandle); - - - /// Return Type: int - ///h: hb_handle_t* - ///version: char** - [DllImport("hb", EntryPoint = "hb_check_update", CallingConvention = CallingConvention.Cdecl)] - public static extern int hb_check_update(IntPtr handle, ref IntPtr version); - - - /// Return Type: char* - ///path: char* - [DllImport("hb", EntryPoint = "hb_dvd_name", CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr hb_dvd_name(IntPtr path); - - - /// Return Type: void - ///enable: int - [DllImport("hb", EntryPoint = "hb_dvd_set_dvdnav", CallingConvention = CallingConvention.Cdecl)] - public static extern void hb_dvd_set_dvdnav(int enable); - - /// Return Type: void - ///param0: hb_handle_t* - ///path: char* - ///title_index: int - ///preview_count: int - ///store_previews: int - [DllImport("hb", EntryPoint = "hb_scan", CallingConvention = CallingConvention.Cdecl)] - public static extern void hb_scan(IntPtr hbHandle, IntPtr path, int title_index, int preview_count, int store_previews, ulong min_duration); - - [DllImport("hb", EntryPoint = "hb_scan_stop", CallingConvention = CallingConvention.Cdecl)] - public static extern void hb_scan_stop(IntPtr hbHandle); - - /// Return Type: hb_list_t* - ///param0: hb_handle_t* - [DllImport("hb", EntryPoint = "hb_get_titles", CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr hb_get_titles(IntPtr hbHandle); - - [DllImport("hb", EntryPoint = "hb_set_anamorphic_size2", CallingConvention = CallingConvention.Cdecl)] - public static extern void hb_set_anamorphic_size2(ref hb_geometry_s sourceGeometry, ref hb_geometry_settings_s uiGeometry, ref hb_geometry_s result); - - - /// Return Type: int - ///param0: hb_handle_t* - [DllImport("hb", EntryPoint = "hb_count", CallingConvention = CallingConvention.Cdecl)] - public static extern int hb_count(IntPtr hbHandle); - - - /// Return Type: hb_job_t* - ///param0: hb_handle_t* - ///param1: int - [DllImport("hb", EntryPoint = "hb_job", CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr hb_job(IntPtr hbHandle, int jobIndex); - - /// Return Type: void - ///param0: hb_handle_t* - ///param1: hb_job_t* - [DllImport("hb", EntryPoint = "hb_rem", CallingConvention = CallingConvention.Cdecl)] - public static extern void hb_rem(IntPtr hbHandle, IntPtr job); - - - /// Return Type: void - ///param0: hb_handle_t* - [DllImport("hb", EntryPoint = "hb_start", CallingConvention = CallingConvention.Cdecl)] - public static extern void hb_start(IntPtr hbHandle); - - - /// Return Type: void - ///param0: hb_handle_t* - [DllImport("hb", EntryPoint = "hb_pause", CallingConvention = CallingConvention.Cdecl)] - public static extern void hb_pause(IntPtr hbHandle); - - - /// Return Type: void - ///param0: hb_handle_t* - [DllImport("hb", EntryPoint = "hb_resume", CallingConvention = CallingConvention.Cdecl)] - public static extern void hb_resume(IntPtr hbHandle); - - - /// Return Type: void - ///param0: hb_handle_t* - [DllImport("hb", EntryPoint = "hb_stop", CallingConvention = CallingConvention.Cdecl)] - public static extern void hb_stop(IntPtr hbHandle); - - - /// Return Type: void - ///param0: hb_handle_t** - [DllImport("hb", EntryPoint = "hb_close", CallingConvention = CallingConvention.Cdecl)] - public static extern void hb_close(IntPtr hbHandle); - - [DllImport("hb", EntryPoint = "hb_global_close", CallingConvention = CallingConvention.Cdecl)] - public static extern void hb_global_close(); - - //hb_list_t * hb_list_init(); - [DllImport("hb", EntryPoint = "hb_list_init", CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr hb_list_init(); - - //int hb_list_count( const hb_list_t * ); - [DllImport("hb", EntryPoint = "hb_list_count", CallingConvention = CallingConvention.Cdecl)] - public static extern int hb_list_count(IntPtr listPtr); - - //void hb_list_add( hb_list_t *, void * ); - [DllImport("hb", EntryPoint = "hb_list_add", CallingConvention = CallingConvention.Cdecl)] - public static extern void hb_list_add(IntPtr listPtr, IntPtr item); - - //void hb_list_insert( hb_list_t * l, int pos, void * p ); - [DllImport("hb", EntryPoint = "hb_list_insert", CallingConvention = CallingConvention.Cdecl)] - public static extern void hb_list_insert(IntPtr listPtr, int pos, IntPtr item); - - //void hb_list_rem( hb_list_t *, void * ); - [DllImport("hb", EntryPoint = "hb_list_rem", CallingConvention = CallingConvention.Cdecl)] - public static extern void hb_list_rem(IntPtr listPtr, IntPtr item); - - //void * hb_list_item( const hb_list_t *, int ); - [DllImport("hb", EntryPoint = "hb_list_item", CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr hb_list_item(IntPtr listPtr, int itemIndex); - - //void hb_list_close( hb_list_t ** ); - [DllImport("hb", EntryPoint = "hb_list_close", CallingConvention = CallingConvention.Cdecl)] - public static extern void hb_list_close(IntPtr listPtrPtr); - - [DllImport("hb", EntryPoint = "hb_subtitle_can_force", CallingConvention = CallingConvention.Cdecl)] - public static extern int hb_subtitle_can_force(int source); - - [DllImport("hb", EntryPoint = "hb_subtitle_can_burn", CallingConvention = CallingConvention.Cdecl)] - public static extern int hb_subtitle_can_burn(int source); - - [DllImport("hb", EntryPoint = "hb_subtitle_can_pass", CallingConvention = CallingConvention.Cdecl)] - public static extern int hb_subtitle_can_pass(int source, int mux); - - - // int hb_video_framerate_get_from_name(const char *name) - [DllImport("hb", EntryPoint = "hb_video_framerate_get_from_name", CallingConvention = CallingConvention.Cdecl)] - public static extern int hb_video_framerate_get_from_name(IntPtr name); - -//const char* hb_video_framerate_get_name(int framerate); -//const char* hb_video_framerate_sanitize_name(const char *name); - - // returns hb_rate_s - [DllImport("hb", EntryPoint = "hb_video_framerate_get_next", CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr hb_video_framerate_get_next(IntPtr last); - - -//int hb_audio_samplerate_get_best(uint32_t codec, int samplerate, int *sr_shift); -//int hb_audio_samplerate_get_from_name(const char *name); -//const char* hb_audio_samplerate_get_name(int samplerate); - - // returns hb_rate_s - [DllImport("hb", EntryPoint = "hb_audio_samplerate_get_next", CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr hb_audio_samplerate_get_next(IntPtr last); - - [DllImport("hb", EntryPoint = "hb_audio_samplerate_find_closest", CallingConvention = CallingConvention.Cdecl)] - public static extern int hb_audio_samplerate_find_closest(int samplerate, uint codec); - - [DllImport("hb", EntryPoint = "hb_audio_bitrate_get_best", CallingConvention = CallingConvention.Cdecl)] - public static extern int hb_audio_bitrate_get_best(uint codec, int bitrate, int samplerate, int mixdown); - - [DllImport("hb", EntryPoint = "hb_audio_bitrate_get_default", CallingConvention = CallingConvention.Cdecl)] - public static extern int hb_audio_bitrate_get_default(uint codec, int samplerate, int mixdown); - - [DllImport("hb", EntryPoint = "hb_audio_bitrate_get_limits", CallingConvention = CallingConvention.Cdecl)] - public static extern int hb_audio_bitrate_get_limits(uint codec, int samplerate, int mixdown, ref int low, ref int high); - - [DllImport("hb", EntryPoint = "hb_audio_bitrate_get_next", CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr hb_audio_bitrate_get_next(IntPtr last); - - [DllImport("hb", EntryPoint = "hb_video_quality_get_limits", CallingConvention = CallingConvention.Cdecl)] - public static extern void hb_video_quality_get_limits(uint codec, ref float low, ref float high, ref float granularity, ref int direction); - - [DllImport("hb", EntryPoint = "hb_video_quality_get_name", CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr hb_video_quality_get_name(uint codec); - - [DllImport("hb", EntryPoint = "hb_audio_quality_get_limits", CallingConvention = CallingConvention.Cdecl)] - public static extern void hb_audio_quality_get_limits(uint codec, ref float low, ref float high, ref float granularity, ref int direction); - -//float hb_audio_quality_get_best(uint32_t codec, float quality); - - [DllImport("hb", EntryPoint = "hb_audio_quality_get_default", CallingConvention = CallingConvention.Cdecl)] - public static extern float hb_audio_quality_get_default(uint codec); - - - [DllImport("hb", EntryPoint = "hb_audio_compression_get_limits", CallingConvention = CallingConvention.Cdecl)] - public static extern void hb_audio_compression_get_limits(uint codec, ref float low, ref float high, ref float granularity, ref int direction); - -//float hb_audio_compression_get_best(uint32_t codec, float compression); - - [DllImport("hb", EntryPoint = "hb_audio_compression_get_default", CallingConvention = CallingConvention.Cdecl)] - public static extern float hb_audio_compression_get_default(uint codec); - - -//int hb_audio_dither_get_default(); -//int hb_audio_dither_get_default_method(); // default method, if enabled && supported -//int hb_audio_dither_is_supported(uint32_t codec); -//int hb_audio_dither_get_from_name(const char *name); -//const char* hb_audio_dither_get_description(int method); -//const hb_dither_t* hb_audio_dither_get_next(const hb_dither_t *last); - - // hb_audio_can_apply_drc2(hb_handle_t *h, int title_idx, int audio_idx, int encoder) - [DllImport("hb", EntryPoint = "hb_audio_can_apply_drc2", CallingConvention = CallingConvention.Cdecl)] - public static extern int hb_audio_can_apply_drc2(IntPtr handle, int title_index, int audio_index, int encoder); - - [DllImport("hb", EntryPoint = "hb_mixdown_is_supported", CallingConvention = CallingConvention.Cdecl)] - public static extern int hb_mixdown_is_supported(int mixdown, uint codec, ulong layout); - - [DllImport("hb", EntryPoint = "hb_mixdown_has_codec_support", CallingConvention = CallingConvention.Cdecl)] - public static extern int hb_mixdown_has_codec_support(int mixdown, uint codec); - - [DllImport("hb", EntryPoint = "hb_mixdown_has_remix_support", CallingConvention = CallingConvention.Cdecl)] - public static extern int hb_mixdown_has_remix_support(int mixdown, ulong layout); - -//int hb_mixdown_get_discrete_channel_count(int mixdown); -//int hb_mixdown_get_low_freq_channel_count(int mixdown); - - [DllImport("hb", EntryPoint = "hb_mixdown_get_best", CallingConvention = CallingConvention.Cdecl)] - public static extern int hb_mixdown_get_best(uint codec, ulong layout, int mixdown); - - [DllImport("hb", EntryPoint = "hb_mixdown_get_default", CallingConvention = CallingConvention.Cdecl)] - public static extern int hb_mixdown_get_default(uint codec, ulong layout); - -//int hb_mixdown_get_from_name(const char *name); -//const char* hb_mixdown_get_name(int mixdown); -//const char* hb_mixdown_get_short_name(int mixdown); -//const char* hb_mixdown_sanitize_name(const char *name); - - [DllImport("hb", EntryPoint = "hb_mixdown_get_next", CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr hb_mixdown_get_next(IntPtr last); - -//int hb_video_encoder_get_default(int muxer); -//int hb_video_encoder_get_from_name(const char *name); -//const char* hb_video_encoder_get_name(int encoder); -//const char* hb_video_encoder_get_short_name(int encoder); -//const char* hb_video_encoder_get_long_name(int encoder); -//const char* hb_video_encoder_sanitize_name(const char *name); - - [DllImport("hb", EntryPoint = "hb_video_encoder_get_next", CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr hb_video_encoder_get_next(IntPtr last); - -/* - * hb_audio_encoder_get_fallback_for_passthru() will sanitize a passthru codec - * to the matching audio encoder (if any is available). - * - * hb_audio_encoder_get_from_name(), hb_audio_encoder_sanitize_name() will - * sanitize legacy encoder names, but won't convert passthru to an encoder. - */ -//int hb_audio_encoder_get_fallback_for_passthru(int passthru); -//int hb_audio_encoder_get_default(int muxer); -//int hb_audio_encoder_get_from_name(const char *name); -//const char* hb_audio_encoder_get_name(int encoder); -//const char* hb_audio_encoder_get_short_name(int encoder); -//const char* hb_audio_encoder_get_long_name(int encoder); -//const char* hb_audio_encoder_sanitize_name(const char *name); - - [DllImport("hb", EntryPoint = "hb_audio_encoder_get_next", CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr hb_audio_encoder_get_next(IntPtr last); - -//int hb_container_get_from_name(const char *name); -//int hb_container_get_from_extension(const char *extension); // not really a container name -//const char* hb_container_get_name(int format); -//const char* hb_container_get_short_name(int format); -//const char* hb_container_get_long_name(int format); -//const char* hb_container_get_default_extension(int format); -//const char* hb_container_sanitize_name(const char *name); - - [DllImport("hb", EntryPoint = "hb_container_get_from_name", CallingConvention = CallingConvention.Cdecl)] - public static extern int hb_container_get_from_name([In] [MarshalAs(UnmanagedType.LPStr)] string name); - - [DllImport("hb", EntryPoint = "hb_container_get_next", CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr hb_container_get_next(IntPtr last); - - [DllImport("hb", EntryPoint = "hb_video_encoder_get_presets", CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr hb_video_encoder_get_presets(int encoder); - - [DllImport("hb", EntryPoint = "hb_video_encoder_get_tunes", CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr hb_video_encoder_get_tunes(int encoder); - - [DllImport("hb", EntryPoint = "hb_video_encoder_get_profiles", CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr hb_video_encoder_get_profiles(int encoder); - - [DllImport("hb", EntryPoint = "hb_video_encoder_get_levels", CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr hb_video_encoder_get_levels(int encoder); - - - [DllImport("hb", EntryPoint = "lang_get_next", CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr lang_get_next(IntPtr last); - - [DllImport("hb", EntryPoint = "lang_for_code2", CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr lang_for_code2([In] [MarshalAs(UnmanagedType.LPStr)] string code2); - - - ///hb_title_set_t * hb_get_title_set( hb_handle_t * ); - [DllImport("hb", EntryPoint = "hb_get_title_set", CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr hb_get_title_set(IntPtr hbHandle); - - ///hb_job_t * hb_job_init_by_index( hb_handle_t *h, int title_index ); - [DllImport("hb", EntryPoint = "hb_job_init_by_index", CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr hb_job_init_by_index(IntPtr hbHandle, int title_index); - - ///void hb_job_close( hb_job_t ** job ); - [DllImport("hb", EntryPoint = "hb_job_close", CallingConvention = CallingConvention.Cdecl)] - public static extern void hb_job_close(IntPtr job); - - ///void hb_chapter_set_title(hb_chapter_t *chapter, const char *title); - [DllImport("hb", EntryPoint = "hb_chapter_set_title", CallingConvention = CallingConvention.Cdecl)] - public static extern void hb_chapter_set_title(IntPtr chapter, [In] [MarshalAs(UnmanagedType.LPStr)] string title); - - ///void hb_chapter_set_title(hb_chapter_t *chapter, const char *title); - [DllImport("hb", EntryPoint = "hb_chapter_set_title", CallingConvention = CallingConvention.Cdecl)] - public static extern void hb_chapter_set_title__ptr(IntPtr chapter, IntPtr title); - - /// hb_filter_object_t * hb_filter_init( int filter_id ); - [DllImport("hb", EntryPoint = "hb_filter_init", CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr hb_filter_init(int filter_id); - - [DllImport("hb", EntryPoint = "hb_generate_filter_settings_json", CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr hb_generate_filter_settings_json( - int filter_id, - [In] [MarshalAs(UnmanagedType.LPStr)] string preset, - [In] [MarshalAs(UnmanagedType.LPStr)] string tune, - [In] [MarshalAs(UnmanagedType.LPStr)] string custom); - - /// char* hb_filter_get_presets_json(int filter_id); - [DllImport("hb", EntryPoint = "hb_filter_get_presets_json", CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr hb_filter_get_presets_json(int filter_id); - - /// char* hb_filter_get_tuness_json(int filter_id); - [DllImport("hb", EntryPoint = "hb_filter_get_tunes_json", CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr hb_filter_get_tunes_json(int filter_id); - - // char ** hb_filter_get_keys(int filter_id); - [DllImport("hb", EntryPoint = "hb_filter_get_keys", CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr hb_filter_get_keys(int filter_id); - - [DllImport("hb", EntryPoint = "hb_x264_encopt_name", CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr hb_x264_encopt_name(IntPtr name); - - [DllImport("hb", EntryPoint = "hb_check_h264_level", CallingConvention = CallingConvention.Cdecl)] - public static extern int hb_check_h264_level([In] [MarshalAs(UnmanagedType.LPStr)] string level, int width, int height, int fps_num, int fps_den, int interlaced, int fake_interlaced); - - [DllImport("hb", EntryPoint = "hb_x264_param_unparse", CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr hb_x264_param_unparse( - int bit_depth, - [In] [MarshalAs(UnmanagedType.LPStr)] string x264_preset, - [In] [MarshalAs(UnmanagedType.LPStr)] string x264_tune, - [In] [MarshalAs(UnmanagedType.LPStr)] string x264_encopts, - [In] [MarshalAs(UnmanagedType.LPStr)] string x264_profile, - [In] [MarshalAs(UnmanagedType.LPStr)] string h264_level, - int width, - int height); - - - [DllImport("hb", EntryPoint = "hb_get_opencl_env", CallingConvention = CallingConvention.Cdecl)] - public static extern int hb_get_opencl_env(); - - [DllImport("hb", EntryPoint = "hb_qsv_available", CallingConvention = CallingConvention.Cdecl)] - public static extern int hb_qsv_available(); - - [DllImport("hb", EntryPoint = "hb_qsv_info_init", CallingConvention = CallingConvention.Cdecl)] - public static extern int hb_qsv_info_init(); - - // hb_image_t* hb_get_preview2(hb_handle_t* h, int title_idx, int picture, hb_geometry_settings_t* geo, int deinterlace); - [DllImport("hb", EntryPoint = "hb_get_preview2", CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr hb_get_preview2(IntPtr hbHandle, int title_idx, int preview_idx, ref hb_geometry_settings_s geo, int deinterlace); - - // void hb_image_close(hb_image_t **_image); - [DllImport("hb", EntryPoint = "hb_image_close", CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr hb_image_close(IntPtr image); - - /* JSON API */ - - // char * hb_get_title_set_json(hb_handle_t * h); - [DllImport("hb", EntryPoint = "hb_get_title_set_json", CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr hb_get_title_set_json(IntPtr hbHandle); - - // char * hb_job_init_json(hb_handle_t *h, int title_index); - [DllImport("hb", EntryPoint = "hb_job_init_json", CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr hb_job_init_json(IntPtr hbHandle, int title_index); - - // hb_job_t * hb_json_to_job(hb_handle_t * h, const char * json_job); - [DllImport("hb", EntryPoint = "hb_json_to_job", CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr hb_json_to_job(IntPtr hbHandle, IntPtr json_job); - - // int hb_add_json( hb_handle_t *, const char * ) - [DllImport("hb", EntryPoint = "hb_add_json", CallingConvention = CallingConvention.Cdecl)] - public static extern int hb_add_json(IntPtr hbHandle, IntPtr json_job); - - //char * hb_set_anamorphic_size_json(const char * json_param); - [DllImport("hb", EntryPoint = "hb_set_anamorphic_size_json", CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr hb_set_anamorphic_size_json(IntPtr json_param); - - // char * hb_get_state_json(hb_handle_t * h); - [DllImport("hb", EntryPoint = "hb_get_state_json", CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr hb_get_state_json(IntPtr hbHandle); - - // char* hb_get_preview_params_json(int title_idx, int preview_idx, int deinterlace, hb_geometry_settings_t *settings) - [DllImport("hb", EntryPoint = "hb_get_preview_params_json", CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr hb_get_preview_params_json(int title_idx, int preview_idx, int deinterlace, ref hb_geometry_settings_s settings); - - //void hb_presets_builtin_init(void); - [DllImport("hb", EntryPoint = "hb_presets_builtin_init", CallingConvention = CallingConvention.Cdecl)] - public static extern void hb_presets_builtin_init(); - - // char * hb_presets_builtin_get_json(void); // Get list of HandBrake builtin presets as json string - [DllImport("hb", EntryPoint = "hb_presets_builtin_get_json", CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr hb_presets_builtin_get_json(); - - // char * hb_presets_read_file_json(const char *filename); - [DllImport("hb", EntryPoint = "hb_presets_read_file_json", CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr hb_presets_read_file_json(IntPtr filename); - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Defines the HBFunctions type. +// +// Disable Stylecop Warnings for this file +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.HbLib +{ + using System; + using System.Runtime.InteropServices; + + /// + /// Contains p-invoke function declarations to hblib. + /// + public static class HBFunctions + { + [DllImport("hb", EntryPoint = "hb_register_logger", CallingConvention = CallingConvention.Cdecl)] + public static extern void hb_register_logger(LoggingCallback callback); + + [DllImport("hb", EntryPoint = "hb_register_error_handler", CallingConvention = CallingConvention.Cdecl)] + public static extern void hb_register_error_handler(LoggingCallback callback); + + [DllImport("hb", EntryPoint = "hb_global_init", CallingConvention = CallingConvention.Cdecl)] + public static extern int hb_global_init(); + + /// Return Type: hb_handle_t* + ///verbose: int + ///update_check: int + [DllImport("hb", EntryPoint = "hb_init", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr hb_init(int verbose, int update_check); + + + /// Return Type: hb_handle_t* + ///verbose: int + ///update_check: int + [DllImport("hb", EntryPoint = "hb_init_dl", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr hb_init_dl(int verbose, int update_check); + + + /// Return Type: char* + ///param0: hb_handle_t* + [DllImport("hb", EntryPoint = "hb_get_version", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr hb_get_version(IntPtr hbHandle); + + + /// Return Type: int + ///param0: hb_handle_t* + [DllImport("hb", EntryPoint = "hb_get_build", CallingConvention = CallingConvention.Cdecl)] + public static extern int hb_get_build(IntPtr hbHandle); + + + /// Return Type: int + ///h: hb_handle_t* + ///version: char** + [DllImport("hb", EntryPoint = "hb_check_update", CallingConvention = CallingConvention.Cdecl)] + public static extern int hb_check_update(IntPtr handle, ref IntPtr version); + + + /// Return Type: char* + ///path: char* + [DllImport("hb", EntryPoint = "hb_dvd_name", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr hb_dvd_name(IntPtr path); + + + /// Return Type: void + ///enable: int + [DllImport("hb", EntryPoint = "hb_dvd_set_dvdnav", CallingConvention = CallingConvention.Cdecl)] + public static extern void hb_dvd_set_dvdnav(int enable); + + /// Return Type: void + ///param0: hb_handle_t* + ///path: char* + ///title_index: int + ///preview_count: int + ///store_previews: int + [DllImport("hb", EntryPoint = "hb_scan", CallingConvention = CallingConvention.Cdecl)] + public static extern void hb_scan(IntPtr hbHandle, IntPtr path, int title_index, int preview_count, int store_previews, ulong min_duration); + + [DllImport("hb", EntryPoint = "hb_scan_stop", CallingConvention = CallingConvention.Cdecl)] + public static extern void hb_scan_stop(IntPtr hbHandle); + + /// Return Type: hb_list_t* + ///param0: hb_handle_t* + [DllImport("hb", EntryPoint = "hb_get_titles", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr hb_get_titles(IntPtr hbHandle); + + [DllImport("hb", EntryPoint = "hb_set_anamorphic_size2", CallingConvention = CallingConvention.Cdecl)] + public static extern void hb_set_anamorphic_size2(ref hb_geometry_s sourceGeometry, ref hb_geometry_settings_s uiGeometry, ref hb_geometry_s result); + + + /// Return Type: int + ///param0: hb_handle_t* + [DllImport("hb", EntryPoint = "hb_count", CallingConvention = CallingConvention.Cdecl)] + public static extern int hb_count(IntPtr hbHandle); + + + /// Return Type: hb_job_t* + ///param0: hb_handle_t* + ///param1: int + [DllImport("hb", EntryPoint = "hb_job", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr hb_job(IntPtr hbHandle, int jobIndex); + + /// Return Type: void + ///param0: hb_handle_t* + ///param1: hb_job_t* + [DllImport("hb", EntryPoint = "hb_rem", CallingConvention = CallingConvention.Cdecl)] + public static extern void hb_rem(IntPtr hbHandle, IntPtr job); + + + /// Return Type: void + ///param0: hb_handle_t* + [DllImport("hb", EntryPoint = "hb_start", CallingConvention = CallingConvention.Cdecl)] + public static extern void hb_start(IntPtr hbHandle); + + + /// Return Type: void + ///param0: hb_handle_t* + [DllImport("hb", EntryPoint = "hb_pause", CallingConvention = CallingConvention.Cdecl)] + public static extern void hb_pause(IntPtr hbHandle); + + + /// Return Type: void + ///param0: hb_handle_t* + [DllImport("hb", EntryPoint = "hb_resume", CallingConvention = CallingConvention.Cdecl)] + public static extern void hb_resume(IntPtr hbHandle); + + + /// Return Type: void + ///param0: hb_handle_t* + [DllImport("hb", EntryPoint = "hb_stop", CallingConvention = CallingConvention.Cdecl)] + public static extern void hb_stop(IntPtr hbHandle); + + + /// Return Type: void + ///param0: hb_handle_t** + [DllImport("hb", EntryPoint = "hb_close", CallingConvention = CallingConvention.Cdecl)] + public static extern void hb_close(IntPtr hbHandle); + + [DllImport("hb", EntryPoint = "hb_global_close", CallingConvention = CallingConvention.Cdecl)] + public static extern void hb_global_close(); + + //hb_list_t * hb_list_init(); + [DllImport("hb", EntryPoint = "hb_list_init", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr hb_list_init(); + + //int hb_list_count( const hb_list_t * ); + [DllImport("hb", EntryPoint = "hb_list_count", CallingConvention = CallingConvention.Cdecl)] + public static extern int hb_list_count(IntPtr listPtr); + + //void hb_list_add( hb_list_t *, void * ); + [DllImport("hb", EntryPoint = "hb_list_add", CallingConvention = CallingConvention.Cdecl)] + public static extern void hb_list_add(IntPtr listPtr, IntPtr item); + + //void hb_list_insert( hb_list_t * l, int pos, void * p ); + [DllImport("hb", EntryPoint = "hb_list_insert", CallingConvention = CallingConvention.Cdecl)] + public static extern void hb_list_insert(IntPtr listPtr, int pos, IntPtr item); + + //void hb_list_rem( hb_list_t *, void * ); + [DllImport("hb", EntryPoint = "hb_list_rem", CallingConvention = CallingConvention.Cdecl)] + public static extern void hb_list_rem(IntPtr listPtr, IntPtr item); + + //void * hb_list_item( const hb_list_t *, int ); + [DllImport("hb", EntryPoint = "hb_list_item", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr hb_list_item(IntPtr listPtr, int itemIndex); + + //void hb_list_close( hb_list_t ** ); + [DllImport("hb", EntryPoint = "hb_list_close", CallingConvention = CallingConvention.Cdecl)] + public static extern void hb_list_close(IntPtr listPtrPtr); + + [DllImport("hb", EntryPoint = "hb_subtitle_can_force", CallingConvention = CallingConvention.Cdecl)] + public static extern int hb_subtitle_can_force(int source); + + [DllImport("hb", EntryPoint = "hb_subtitle_can_burn", CallingConvention = CallingConvention.Cdecl)] + public static extern int hb_subtitle_can_burn(int source); + + [DllImport("hb", EntryPoint = "hb_subtitle_can_pass", CallingConvention = CallingConvention.Cdecl)] + public static extern int hb_subtitle_can_pass(int source, int mux); + + + // int hb_video_framerate_get_from_name(const char *name) + [DllImport("hb", EntryPoint = "hb_video_framerate_get_from_name", CallingConvention = CallingConvention.Cdecl)] + public static extern int hb_video_framerate_get_from_name(IntPtr name); + +//const char* hb_video_framerate_get_name(int framerate); +//const char* hb_video_framerate_sanitize_name(const char *name); + + // returns hb_rate_s + [DllImport("hb", EntryPoint = "hb_video_framerate_get_next", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr hb_video_framerate_get_next(IntPtr last); + + +//int hb_audio_samplerate_get_best(uint32_t codec, int samplerate, int *sr_shift); +//int hb_audio_samplerate_get_from_name(const char *name); +//const char* hb_audio_samplerate_get_name(int samplerate); + + // returns hb_rate_s + [DllImport("hb", EntryPoint = "hb_audio_samplerate_get_next", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr hb_audio_samplerate_get_next(IntPtr last); + + [DllImport("hb", EntryPoint = "hb_audio_samplerate_find_closest", CallingConvention = CallingConvention.Cdecl)] + public static extern int hb_audio_samplerate_find_closest(int samplerate, uint codec); + + [DllImport("hb", EntryPoint = "hb_audio_bitrate_get_best", CallingConvention = CallingConvention.Cdecl)] + public static extern int hb_audio_bitrate_get_best(uint codec, int bitrate, int samplerate, int mixdown); + + [DllImport("hb", EntryPoint = "hb_audio_bitrate_get_default", CallingConvention = CallingConvention.Cdecl)] + public static extern int hb_audio_bitrate_get_default(uint codec, int samplerate, int mixdown); + + [DllImport("hb", EntryPoint = "hb_audio_bitrate_get_limits", CallingConvention = CallingConvention.Cdecl)] + public static extern int hb_audio_bitrate_get_limits(uint codec, int samplerate, int mixdown, ref int low, ref int high); + + [DllImport("hb", EntryPoint = "hb_audio_bitrate_get_next", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr hb_audio_bitrate_get_next(IntPtr last); + + [DllImport("hb", EntryPoint = "hb_video_quality_get_limits", CallingConvention = CallingConvention.Cdecl)] + public static extern void hb_video_quality_get_limits(uint codec, ref float low, ref float high, ref float granularity, ref int direction); + + [DllImport("hb", EntryPoint = "hb_video_quality_get_name", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr hb_video_quality_get_name(uint codec); + + [DllImport("hb", EntryPoint = "hb_audio_quality_get_limits", CallingConvention = CallingConvention.Cdecl)] + public static extern void hb_audio_quality_get_limits(uint codec, ref float low, ref float high, ref float granularity, ref int direction); + +//float hb_audio_quality_get_best(uint32_t codec, float quality); + + [DllImport("hb", EntryPoint = "hb_audio_quality_get_default", CallingConvention = CallingConvention.Cdecl)] + public static extern float hb_audio_quality_get_default(uint codec); + + + [DllImport("hb", EntryPoint = "hb_audio_compression_get_limits", CallingConvention = CallingConvention.Cdecl)] + public static extern void hb_audio_compression_get_limits(uint codec, ref float low, ref float high, ref float granularity, ref int direction); + +//float hb_audio_compression_get_best(uint32_t codec, float compression); + + [DllImport("hb", EntryPoint = "hb_audio_compression_get_default", CallingConvention = CallingConvention.Cdecl)] + public static extern float hb_audio_compression_get_default(uint codec); + + +//int hb_audio_dither_get_default(); +//int hb_audio_dither_get_default_method(); // default method, if enabled && supported +//int hb_audio_dither_is_supported(uint32_t codec); +//int hb_audio_dither_get_from_name(const char *name); +//const char* hb_audio_dither_get_description(int method); +//const hb_dither_t* hb_audio_dither_get_next(const hb_dither_t *last); + + // hb_audio_can_apply_drc2(hb_handle_t *h, int title_idx, int audio_idx, int encoder) + [DllImport("hb", EntryPoint = "hb_audio_can_apply_drc2", CallingConvention = CallingConvention.Cdecl)] + public static extern int hb_audio_can_apply_drc2(IntPtr handle, int title_index, int audio_index, int encoder); + + [DllImport("hb", EntryPoint = "hb_mixdown_is_supported", CallingConvention = CallingConvention.Cdecl)] + public static extern int hb_mixdown_is_supported(int mixdown, uint codec, ulong layout); + + [DllImport("hb", EntryPoint = "hb_mixdown_has_codec_support", CallingConvention = CallingConvention.Cdecl)] + public static extern int hb_mixdown_has_codec_support(int mixdown, uint codec); + + [DllImport("hb", EntryPoint = "hb_mixdown_has_remix_support", CallingConvention = CallingConvention.Cdecl)] + public static extern int hb_mixdown_has_remix_support(int mixdown, ulong layout); + +//int hb_mixdown_get_discrete_channel_count(int mixdown); +//int hb_mixdown_get_low_freq_channel_count(int mixdown); + + [DllImport("hb", EntryPoint = "hb_mixdown_get_best", CallingConvention = CallingConvention.Cdecl)] + public static extern int hb_mixdown_get_best(uint codec, ulong layout, int mixdown); + + [DllImport("hb", EntryPoint = "hb_mixdown_get_default", CallingConvention = CallingConvention.Cdecl)] + public static extern int hb_mixdown_get_default(uint codec, ulong layout); + +//int hb_mixdown_get_from_name(const char *name); +//const char* hb_mixdown_get_name(int mixdown); +//const char* hb_mixdown_get_short_name(int mixdown); +//const char* hb_mixdown_sanitize_name(const char *name); + + [DllImport("hb", EntryPoint = "hb_mixdown_get_next", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr hb_mixdown_get_next(IntPtr last); + +//int hb_video_encoder_get_default(int muxer); +//int hb_video_encoder_get_from_name(const char *name); +//const char* hb_video_encoder_get_name(int encoder); +//const char* hb_video_encoder_get_short_name(int encoder); +//const char* hb_video_encoder_get_long_name(int encoder); +//const char* hb_video_encoder_sanitize_name(const char *name); + + [DllImport("hb", EntryPoint = "hb_video_encoder_get_next", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr hb_video_encoder_get_next(IntPtr last); + +/* + * hb_audio_encoder_get_fallback_for_passthru() will sanitize a passthru codec + * to the matching audio encoder (if any is available). + * + * hb_audio_encoder_get_from_name(), hb_audio_encoder_sanitize_name() will + * sanitize legacy encoder names, but won't convert passthru to an encoder. + */ +//int hb_audio_encoder_get_fallback_for_passthru(int passthru); +//int hb_audio_encoder_get_default(int muxer); +//int hb_audio_encoder_get_from_name(const char *name); +//const char* hb_audio_encoder_get_name(int encoder); +//const char* hb_audio_encoder_get_short_name(int encoder); +//const char* hb_audio_encoder_get_long_name(int encoder); +//const char* hb_audio_encoder_sanitize_name(const char *name); + + [DllImport("hb", EntryPoint = "hb_audio_encoder_get_next", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr hb_audio_encoder_get_next(IntPtr last); + +//int hb_container_get_from_name(const char *name); +//int hb_container_get_from_extension(const char *extension); // not really a container name +//const char* hb_container_get_name(int format); +//const char* hb_container_get_short_name(int format); +//const char* hb_container_get_long_name(int format); +//const char* hb_container_get_default_extension(int format); +//const char* hb_container_sanitize_name(const char *name); + + [DllImport("hb", EntryPoint = "hb_container_get_from_name", CallingConvention = CallingConvention.Cdecl)] + public static extern int hb_container_get_from_name([In] [MarshalAs(UnmanagedType.LPStr)] string name); + + [DllImport("hb", EntryPoint = "hb_container_get_next", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr hb_container_get_next(IntPtr last); + + [DllImport("hb", EntryPoint = "hb_video_encoder_get_presets", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr hb_video_encoder_get_presets(int encoder); + + [DllImport("hb", EntryPoint = "hb_video_encoder_get_tunes", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr hb_video_encoder_get_tunes(int encoder); + + [DllImport("hb", EntryPoint = "hb_video_encoder_get_profiles", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr hb_video_encoder_get_profiles(int encoder); + + [DllImport("hb", EntryPoint = "hb_video_encoder_get_levels", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr hb_video_encoder_get_levels(int encoder); + + + [DllImport("hb", EntryPoint = "lang_get_next", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr lang_get_next(IntPtr last); + + [DllImport("hb", EntryPoint = "lang_for_code2", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr lang_for_code2([In] [MarshalAs(UnmanagedType.LPStr)] string code2); + + + ///hb_title_set_t * hb_get_title_set( hb_handle_t * ); + [DllImport("hb", EntryPoint = "hb_get_title_set", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr hb_get_title_set(IntPtr hbHandle); + + ///hb_job_t * hb_job_init_by_index( hb_handle_t *h, int title_index ); + [DllImport("hb", EntryPoint = "hb_job_init_by_index", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr hb_job_init_by_index(IntPtr hbHandle, int title_index); + + ///void hb_job_close( hb_job_t ** job ); + [DllImport("hb", EntryPoint = "hb_job_close", CallingConvention = CallingConvention.Cdecl)] + public static extern void hb_job_close(IntPtr job); + + ///void hb_chapter_set_title(hb_chapter_t *chapter, const char *title); + [DllImport("hb", EntryPoint = "hb_chapter_set_title", CallingConvention = CallingConvention.Cdecl)] + public static extern void hb_chapter_set_title(IntPtr chapter, [In] [MarshalAs(UnmanagedType.LPStr)] string title); + + ///void hb_chapter_set_title(hb_chapter_t *chapter, const char *title); + [DllImport("hb", EntryPoint = "hb_chapter_set_title", CallingConvention = CallingConvention.Cdecl)] + public static extern void hb_chapter_set_title__ptr(IntPtr chapter, IntPtr title); + + /// hb_filter_object_t * hb_filter_init( int filter_id ); + [DllImport("hb", EntryPoint = "hb_filter_init", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr hb_filter_init(int filter_id); + + [DllImport("hb", EntryPoint = "hb_generate_filter_settings_json", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr hb_generate_filter_settings_json( + int filter_id, + [In] [MarshalAs(UnmanagedType.LPStr)] string preset, + [In] [MarshalAs(UnmanagedType.LPStr)] string tune, + [In] [MarshalAs(UnmanagedType.LPStr)] string custom); + + /// char* hb_filter_get_presets_json(int filter_id); + [DllImport("hb", EntryPoint = "hb_filter_get_presets_json", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr hb_filter_get_presets_json(int filter_id); + + /// char* hb_filter_get_tuness_json(int filter_id); + [DllImport("hb", EntryPoint = "hb_filter_get_tunes_json", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr hb_filter_get_tunes_json(int filter_id); + + // char ** hb_filter_get_keys(int filter_id); + [DllImport("hb", EntryPoint = "hb_filter_get_keys", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr hb_filter_get_keys(int filter_id); + + [DllImport("hb", EntryPoint = "hb_x264_encopt_name", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr hb_x264_encopt_name(IntPtr name); + + [DllImport("hb", EntryPoint = "hb_check_h264_level", CallingConvention = CallingConvention.Cdecl)] + public static extern int hb_check_h264_level([In] [MarshalAs(UnmanagedType.LPStr)] string level, int width, int height, int fps_num, int fps_den, int interlaced, int fake_interlaced); + + [DllImport("hb", EntryPoint = "hb_x264_param_unparse", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr hb_x264_param_unparse( + int bit_depth, + [In] [MarshalAs(UnmanagedType.LPStr)] string x264_preset, + [In] [MarshalAs(UnmanagedType.LPStr)] string x264_tune, + [In] [MarshalAs(UnmanagedType.LPStr)] string x264_encopts, + [In] [MarshalAs(UnmanagedType.LPStr)] string x264_profile, + [In] [MarshalAs(UnmanagedType.LPStr)] string h264_level, + int width, + int height); + + + [DllImport("hb", EntryPoint = "hb_get_opencl_env", CallingConvention = CallingConvention.Cdecl)] + public static extern int hb_get_opencl_env(); + + [DllImport("hb", EntryPoint = "hb_qsv_available", CallingConvention = CallingConvention.Cdecl)] + public static extern int hb_qsv_available(); + + [DllImport("hb", EntryPoint = "hb_qsv_info_init", CallingConvention = CallingConvention.Cdecl)] + public static extern int hb_qsv_info_init(); + + // hb_image_t* hb_get_preview2(hb_handle_t* h, int title_idx, int picture, hb_geometry_settings_t* geo, int deinterlace); + [DllImport("hb", EntryPoint = "hb_get_preview2", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr hb_get_preview2(IntPtr hbHandle, int title_idx, int preview_idx, ref hb_geometry_settings_s geo, int deinterlace); + + // void hb_image_close(hb_image_t **_image); + [DllImport("hb", EntryPoint = "hb_image_close", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr hb_image_close(IntPtr image); + + /* JSON API */ + + // char * hb_get_title_set_json(hb_handle_t * h); + [DllImport("hb", EntryPoint = "hb_get_title_set_json", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr hb_get_title_set_json(IntPtr hbHandle); + + // char * hb_job_init_json(hb_handle_t *h, int title_index); + [DllImport("hb", EntryPoint = "hb_job_init_json", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr hb_job_init_json(IntPtr hbHandle, int title_index); + + // hb_job_t * hb_json_to_job(hb_handle_t * h, const char * json_job); + [DllImport("hb", EntryPoint = "hb_json_to_job", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr hb_json_to_job(IntPtr hbHandle, IntPtr json_job); + + // int hb_add_json( hb_handle_t *, const char * ) + [DllImport("hb", EntryPoint = "hb_add_json", CallingConvention = CallingConvention.Cdecl)] + public static extern int hb_add_json(IntPtr hbHandle, IntPtr json_job); + + //char * hb_set_anamorphic_size_json(const char * json_param); + [DllImport("hb", EntryPoint = "hb_set_anamorphic_size_json", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr hb_set_anamorphic_size_json(IntPtr json_param); + + // char * hb_get_state_json(hb_handle_t * h); + [DllImport("hb", EntryPoint = "hb_get_state_json", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr hb_get_state_json(IntPtr hbHandle); + + // char* hb_get_preview_params_json(int title_idx, int preview_idx, int deinterlace, hb_geometry_settings_t *settings) + [DllImport("hb", EntryPoint = "hb_get_preview_params_json", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr hb_get_preview_params_json(int title_idx, int preview_idx, int deinterlace, ref hb_geometry_settings_s settings); + + //void hb_presets_builtin_init(void); + [DllImport("hb", EntryPoint = "hb_presets_builtin_init", CallingConvention = CallingConvention.Cdecl)] + public static extern void hb_presets_builtin_init(); + + // char * hb_presets_builtin_get_json(void); // Get list of HandBrake builtin presets as json string + [DllImport("hb", EntryPoint = "hb_presets_builtin_get_json", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr hb_presets_builtin_get_json(); + + // char * hb_presets_read_file_json(const char *filename); + [DllImport("hb", EntryPoint = "hb_presets_read_file_json", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr hb_presets_read_file_json(IntPtr filename); + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/NativeConstants.cs b/win/CS/HandBrake.Interop/Interop/HbLib/NativeConstants.cs similarity index 96% rename from win/CS/HandBrake.ApplicationServices/Interop/HbLib/NativeConstants.cs rename to win/CS/HandBrake.Interop/Interop/HbLib/NativeConstants.cs index 9f4615bbf..aacec1bcf 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/NativeConstants.cs +++ b/win/CS/HandBrake.Interop/Interop/HbLib/NativeConstants.cs @@ -1,69 +1,69 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// Defines the NativeConstants type. -// -// Disable Stylecop Warnings for this file -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.HbLib -{ - public class NativeConstants - { - // Audio encoders - public const uint HB_ACODEC_MASK = 0x03FFFF00; - public const uint HB_ACODEC_LAME = 0x00000200; - public const uint HB_ACODEC_VORBIS = 0x00000400; - public const uint HB_ACODEC_AC3 = 0x00000800; - public const uint HB_ACODEC_LPCM = 0x00001000; - public const uint HB_ACODEC_DCA = 0x00002000; - public const uint HB_ACODEC_CA_AAC = 0x00004000; - public const uint HB_ACODEC_CA_HAAC = 0x00008000; - public const uint HB_ACODEC_FFAAC = 0x00010000; - public const uint HB_ACODEC_FFMPEG = 0x00020000; - public const uint HB_ACODEC_DCA_HD = 0x00040000; - public const uint HB_ACODEC_MP3 = 0x00080000; - public const uint HB_ACODEC_FFFLAC = 0x00100000; - public const uint HB_ACODEC_FFFLAC24 = 0x00200000; - public const uint HB_ACODEC_FDK_AAC = 0x00400000; - public const uint HB_ACODEC_FDK_HAAC = 0x00800000; - public const uint HB_ACODEC_FFEAC3 = 0x01000000; - public const uint HB_ACODEC_FFTRUEHD = 0x02000000; - public const uint HB_ACODEC_FF_MASK = 0x03FF2800; - public const uint HB_ACODEC_PASS_FLAG = 0x40000000; - public const uint HB_ACODEC_PASS_MASK = (HB_ACODEC_AC3 | HB_ACODEC_DCA | HB_ACODEC_DCA_HD | HB_ACODEC_FFAAC | HB_ACODEC_FFEAC3 | HB_ACODEC_FFFLAC | HB_ACODEC_MP3 | HB_ACODEC_FFTRUEHD); - public const uint HB_ACODEC_AUTO_PASS = (HB_ACODEC_PASS_MASK | HB_ACODEC_PASS_FLAG); - public const uint HB_ACODEC_MP3_PASS = (HB_ACODEC_MP3 | HB_ACODEC_PASS_FLAG); - public const uint HB_ACODEC_AAC_PASS = (HB_ACODEC_FFAAC | HB_ACODEC_PASS_FLAG); - public const uint HB_ACODEC_AC3_PASS = (HB_ACODEC_AC3 | HB_ACODEC_PASS_FLAG); - public const uint HB_ACODEC_DCA_PASS = (HB_ACODEC_DCA | HB_ACODEC_PASS_FLAG); - public const uint HB_ACODEC_DCA_HD_PASS = (HB_ACODEC_DCA_HD | HB_ACODEC_PASS_FLAG); - public const uint HB_ACODEC_EAC3_PASS = (HB_ACODEC_PASS_FLAG | HB_ACODEC_FFEAC3); - public const uint HB_ACODEC_FLAC_PASS = (HB_ACODEC_PASS_FLAG | HB_ACODEC_FFFLAC); - public const uint HB_ACODEC_ANY = (HB_ACODEC_MASK | HB_ACODEC_PASS_FLAG); - public const uint HB_ACODEC_TRUEHD_PASS = (HB_ACODEC_PASS_FLAG | HB_ACODEC_FFTRUEHD); - - // VideoEncoders - public const uint HB_VCODEC_QSV_H264 = 0x0000100; - public const uint HB_VCODEC_QSV_H265 = 0x0000200; - public const uint HB_VCODEC_QSV_H265_10BIT = 0x0000400; - public const uint HB_VCODEC_QSV_MASK = 0x0000F00; - - // Encode state - public const int HB_STATE_IDLE = 1; - public const int HB_STATE_SCANNING = 2; - public const int HB_STATE_SCANDONE = 4; - public const int HB_STATE_WORKING = 8; - public const int HB_STATE_PAUSED = 16; - public const int HB_STATE_WORKDONE = 32; - public const int HB_STATE_MUXING = 64; - public const int HB_STATE_SEARCHING = 128; - - // Keep aspect ratio values - public const int HB_KEEP_WIDTH = 0x01; - public const int HB_KEEP_HEIGHT = 0x02; - public const int HB_KEEP_DISPLAY_ASPECT = 0x04; - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Defines the NativeConstants type. +// +// Disable Stylecop Warnings for this file +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.HbLib +{ + public class NativeConstants + { + // Audio encoders + public const uint HB_ACODEC_MASK = 0x03FFFF00; + public const uint HB_ACODEC_LAME = 0x00000200; + public const uint HB_ACODEC_VORBIS = 0x00000400; + public const uint HB_ACODEC_AC3 = 0x00000800; + public const uint HB_ACODEC_LPCM = 0x00001000; + public const uint HB_ACODEC_DCA = 0x00002000; + public const uint HB_ACODEC_CA_AAC = 0x00004000; + public const uint HB_ACODEC_CA_HAAC = 0x00008000; + public const uint HB_ACODEC_FFAAC = 0x00010000; + public const uint HB_ACODEC_FFMPEG = 0x00020000; + public const uint HB_ACODEC_DCA_HD = 0x00040000; + public const uint HB_ACODEC_MP3 = 0x00080000; + public const uint HB_ACODEC_FFFLAC = 0x00100000; + public const uint HB_ACODEC_FFFLAC24 = 0x00200000; + public const uint HB_ACODEC_FDK_AAC = 0x00400000; + public const uint HB_ACODEC_FDK_HAAC = 0x00800000; + public const uint HB_ACODEC_FFEAC3 = 0x01000000; + public const uint HB_ACODEC_FFTRUEHD = 0x02000000; + public const uint HB_ACODEC_FF_MASK = 0x03FF2800; + public const uint HB_ACODEC_PASS_FLAG = 0x40000000; + public const uint HB_ACODEC_PASS_MASK = (HB_ACODEC_AC3 | HB_ACODEC_DCA | HB_ACODEC_DCA_HD | HB_ACODEC_FFAAC | HB_ACODEC_FFEAC3 | HB_ACODEC_FFFLAC | HB_ACODEC_MP3 | HB_ACODEC_FFTRUEHD); + public const uint HB_ACODEC_AUTO_PASS = (HB_ACODEC_PASS_MASK | HB_ACODEC_PASS_FLAG); + public const uint HB_ACODEC_MP3_PASS = (HB_ACODEC_MP3 | HB_ACODEC_PASS_FLAG); + public const uint HB_ACODEC_AAC_PASS = (HB_ACODEC_FFAAC | HB_ACODEC_PASS_FLAG); + public const uint HB_ACODEC_AC3_PASS = (HB_ACODEC_AC3 | HB_ACODEC_PASS_FLAG); + public const uint HB_ACODEC_DCA_PASS = (HB_ACODEC_DCA | HB_ACODEC_PASS_FLAG); + public const uint HB_ACODEC_DCA_HD_PASS = (HB_ACODEC_DCA_HD | HB_ACODEC_PASS_FLAG); + public const uint HB_ACODEC_EAC3_PASS = (HB_ACODEC_PASS_FLAG | HB_ACODEC_FFEAC3); + public const uint HB_ACODEC_FLAC_PASS = (HB_ACODEC_PASS_FLAG | HB_ACODEC_FFFLAC); + public const uint HB_ACODEC_ANY = (HB_ACODEC_MASK | HB_ACODEC_PASS_FLAG); + public const uint HB_ACODEC_TRUEHD_PASS = (HB_ACODEC_PASS_FLAG | HB_ACODEC_FFTRUEHD); + + // VideoEncoders + public const uint HB_VCODEC_QSV_H264 = 0x0000100; + public const uint HB_VCODEC_QSV_H265 = 0x0000200; + public const uint HB_VCODEC_QSV_H265_10BIT = 0x0000400; + public const uint HB_VCODEC_QSV_MASK = 0x0000F00; + + // Encode state + public const int HB_STATE_IDLE = 1; + public const int HB_STATE_SCANNING = 2; + public const int HB_STATE_SCANDONE = 4; + public const int HB_STATE_WORKING = 8; + public const int HB_STATE_PAUSED = 16; + public const int HB_STATE_WORKDONE = 32; + public const int HB_STATE_MUXING = 64; + public const int HB_STATE_SEARCHING = 128; + + // Keep aspect ratio values + public const int HB_KEEP_WIDTH = 0x01; + public const int HB_KEEP_HEIGHT = 0x02; + public const int HB_KEEP_DISPLAY_ASPECT = 0x04; + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_anamorphic_mode_t.cs b/win/CS/HandBrake.Interop/Interop/HbLib/hb_anamorphic_mode_t.cs similarity index 91% rename from win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_anamorphic_mode_t.cs rename to win/CS/HandBrake.Interop/Interop/HbLib/hb_anamorphic_mode_t.cs index ba379c3ad..949f7d694 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_anamorphic_mode_t.cs +++ b/win/CS/HandBrake.Interop/Interop/HbLib/hb_anamorphic_mode_t.cs @@ -1,21 +1,21 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// Defines the hb_job_s type. -// -// Disable Stylecop Warnings for this file -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.HbLib -{ - internal enum hb_anamorphic_mode_t - { - HB_ANAMORPHIC_NONE, - HB_ANAMORPHIC_STRICT, - HB_ANAMORPHIC_LOOSE, - HB_ANAMORPHIC_CUSTOM, - HB_ANAMORPHIC_AUTO - } ; -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Defines the hb_job_s type. +// +// Disable Stylecop Warnings for this file +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.HbLib +{ + internal enum hb_anamorphic_mode_t + { + HB_ANAMORPHIC_NONE, + HB_ANAMORPHIC_STRICT, + HB_ANAMORPHIC_LOOSE, + HB_ANAMORPHIC_CUSTOM, + HB_ANAMORPHIC_AUTO + } ; +} diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_container_s.cs b/win/CS/HandBrake.Interop/Interop/HbLib/hb_container_s.cs similarity index 92% rename from win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_container_s.cs rename to win/CS/HandBrake.Interop/Interop/HbLib/hb_container_s.cs index 156bc7554..2611cab47 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_container_s.cs +++ b/win/CS/HandBrake.Interop/Interop/HbLib/hb_container_s.cs @@ -1,29 +1,29 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// Disable Stylecop Warnings for this file -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.HbLib -{ - using System.Runtime.InteropServices; - - [StructLayout(LayoutKind.Sequential)] - internal struct hb_container_s - { - [MarshalAs(UnmanagedType.LPStr)] - public string name; - - [MarshalAs(UnmanagedType.LPStr)] - public string short_name; - - [MarshalAs(UnmanagedType.LPStr)] - public string long_name; - - [MarshalAs(UnmanagedType.LPStr)] - public string default_extension; - - public int format; - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// Disable Stylecop Warnings for this file +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.HbLib +{ + using System.Runtime.InteropServices; + + [StructLayout(LayoutKind.Sequential)] + internal struct hb_container_s + { + [MarshalAs(UnmanagedType.LPStr)] + public string name; + + [MarshalAs(UnmanagedType.LPStr)] + public string short_name; + + [MarshalAs(UnmanagedType.LPStr)] + public string long_name; + + [MarshalAs(UnmanagedType.LPStr)] + public string default_extension; + + public int format; + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_encoder_s.cs b/win/CS/HandBrake.Interop/Interop/HbLib/hb_encoder_s.cs similarity index 92% rename from win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_encoder_s.cs rename to win/CS/HandBrake.Interop/Interop/HbLib/hb_encoder_s.cs index 6fddc1827..54c5b182f 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_encoder_s.cs +++ b/win/CS/HandBrake.Interop/Interop/HbLib/hb_encoder_s.cs @@ -1,28 +1,28 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// Disable Stylecop Warnings for this file -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.HbLib -{ - using System.Runtime.InteropServices; - - [StructLayout(LayoutKind.Sequential)] - internal struct hb_encoder_s - { - [MarshalAs(UnmanagedType.LPStr)] - public string name; - - [MarshalAs(UnmanagedType.LPStr)] - public string short_name; - - [MarshalAs(UnmanagedType.LPStr)] - public string long_name; - - public int codec; - - public int muxers; - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// Disable Stylecop Warnings for this file +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.HbLib +{ + using System.Runtime.InteropServices; + + [StructLayout(LayoutKind.Sequential)] + internal struct hb_encoder_s + { + [MarshalAs(UnmanagedType.LPStr)] + public string name; + + [MarshalAs(UnmanagedType.LPStr)] + public string short_name; + + [MarshalAs(UnmanagedType.LPStr)] + public string long_name; + + public int codec; + + public int muxers; + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_error_code.cs b/win/CS/HandBrake.Interop/Interop/HbLib/hb_error_code.cs similarity index 91% rename from win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_error_code.cs rename to win/CS/HandBrake.Interop/Interop/HbLib/hb_error_code.cs index 96a6fbe00..f0c996ca8 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_error_code.cs +++ b/win/CS/HandBrake.Interop/Interop/HbLib/hb_error_code.cs @@ -1,24 +1,24 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// Defines the hb_error_code type. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.HbLib -{ - /// - /// The hb_error_code. - /// - internal enum hb_error_code - { - HB_ERROR_NONE = 0, - HB_ERROR_CANCELED, - HB_ERROR_WRONG_INPUT, - HB_ERROR_INIT, - HB_ERROR_UNKNOWN, - HB_ERROR_READ - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Defines the hb_error_code type. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.HbLib +{ + /// + /// The hb_error_code. + /// + internal enum hb_error_code + { + HB_ERROR_NONE = 0, + HB_ERROR_CANCELED, + HB_ERROR_WRONG_INPUT, + HB_ERROR_INIT, + HB_ERROR_UNKNOWN, + HB_ERROR_READ + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_filter_ids.cs b/win/CS/HandBrake.Interop/Interop/HbLib/hb_filter_ids.cs similarity index 94% rename from win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_filter_ids.cs rename to win/CS/HandBrake.Interop/Interop/HbLib/hb_filter_ids.cs index 63e279410..62b0889cb 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_filter_ids.cs +++ b/win/CS/HandBrake.Interop/Interop/HbLib/hb_filter_ids.cs @@ -1,46 +1,46 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// Disable Stylecop Warnings for this file -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.HbLib -{ - public enum hb_filter_ids - { - HB_FILTER_INVALID = 0, - // for QSV - important to have before other filters - HB_FILTER_FIRST = 1, - HB_FILTER_QSV_PRE = 1, - - // First, filters that may change the framerate (drop or dup frames) - HB_FILTER_DETELECINE, - HB_FILTER_COMB_DETECT, - HB_FILTER_DECOMB, - HB_FILTER_DEINTERLACE, - HB_FILTER_VFR, - // Filters that must operate on the original source image are next - HB_FILTER_DEBLOCK, - HB_FILTER_DENOISE, - HB_FILTER_HQDN3D = HB_FILTER_DENOISE, - HB_FILTER_NLMEANS, - HB_FILTER_RENDER_SUB, - HB_FILTER_CROP_SCALE, - HB_FILTER_LAPSHARP, - HB_FILTER_UNSHARP, - HB_FILTER_ROTATE, - HB_FILTER_GRAYSCALE, - HB_FILTER_PAD, - - // Finally filters that don't care what order they are in, - // except that they must be after the above filters - HB_FILTER_AVFILTER, - - // for QSV - important to have as a last one - HB_FILTER_QSV_POST, - // default MSDK VPP filter - HB_FILTER_QSV, - HB_FILTER_LAST = HB_FILTER_QSV - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// Disable Stylecop Warnings for this file +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.HbLib +{ + public enum hb_filter_ids + { + HB_FILTER_INVALID = 0, + // for QSV - important to have before other filters + HB_FILTER_FIRST = 1, + HB_FILTER_QSV_PRE = 1, + + // First, filters that may change the framerate (drop or dup frames) + HB_FILTER_DETELECINE, + HB_FILTER_COMB_DETECT, + HB_FILTER_DECOMB, + HB_FILTER_DEINTERLACE, + HB_FILTER_VFR, + // Filters that must operate on the original source image are next + HB_FILTER_DEBLOCK, + HB_FILTER_DENOISE, + HB_FILTER_HQDN3D = HB_FILTER_DENOISE, + HB_FILTER_NLMEANS, + HB_FILTER_RENDER_SUB, + HB_FILTER_CROP_SCALE, + HB_FILTER_LAPSHARP, + HB_FILTER_UNSHARP, + HB_FILTER_ROTATE, + HB_FILTER_GRAYSCALE, + HB_FILTER_PAD, + + // Finally filters that don't care what order they are in, + // except that they must be after the above filters + HB_FILTER_AVFILTER, + + // for QSV - important to have as a last one + HB_FILTER_QSV_POST, + // default MSDK VPP filter + HB_FILTER_QSV, + HB_FILTER_LAST = HB_FILTER_QSV + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_geometry.cs b/win/CS/HandBrake.Interop/Interop/HbLib/hb_geometry.cs similarity index 94% rename from win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_geometry.cs rename to win/CS/HandBrake.Interop/Interop/HbLib/hb_geometry.cs index 8a6cfa3e6..c665a5306 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_geometry.cs +++ b/win/CS/HandBrake.Interop/Interop/HbLib/hb_geometry.cs @@ -1,101 +1,101 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// Defines the hb_geometry type. -// -// Disable Stylecop Warnings for this file -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.HbLib -{ - using System.Runtime.InteropServices; - - /// - /// The hb_geometry_s. - /// - [StructLayout(LayoutKind.Sequential)] - public struct hb_geometry_s - { - /// - /// The width. - /// - public int width; - - /// - /// The height. - /// - public int height; - - /// - /// The par. - /// - public hb_rational_t par; - } - - /// - /// The hb_ui_geometry_s. - /// - [StructLayout(LayoutKind.Sequential)] - public struct hb_geometry_settings_s - { - /// - /// Anamorphic mode, see job struct anamorphic - /// - public int mode; - - /// - /// Specifies settings that shouldn't be changed - /// - public int keep; - - /// - /// use dvd dimensions to determine PAR - /// - public int itu_par; - - /// - /// pixel alignment for loose anamorphic - /// - public int modulus; - - /// - /// Cropping - /// - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4, ArraySubType = UnmanagedType.I4)] - public int[] crop; - - /// - /// max destination storage width - /// - public int maxWidth; - - /// - /// max destination storage height - /// - public int maxHeight; - - /// - /// Pixel aspect used in custom anamorphic - /// - public hb_geometry_s geometry; - } - - /// - /// The hb_rational_t. - /// - [StructLayout(LayoutKind.Sequential)] - public struct hb_rational_t - { - /// - /// The num. W - /// - public int num; - - /// - /// The den. H - /// - public int den; - } +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Defines the hb_geometry type. +// +// Disable Stylecop Warnings for this file +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.HbLib +{ + using System.Runtime.InteropServices; + + /// + /// The hb_geometry_s. + /// + [StructLayout(LayoutKind.Sequential)] + public struct hb_geometry_s + { + /// + /// The width. + /// + public int width; + + /// + /// The height. + /// + public int height; + + /// + /// The par. + /// + public hb_rational_t par; + } + + /// + /// The hb_ui_geometry_s. + /// + [StructLayout(LayoutKind.Sequential)] + public struct hb_geometry_settings_s + { + /// + /// Anamorphic mode, see job struct anamorphic + /// + public int mode; + + /// + /// Specifies settings that shouldn't be changed + /// + public int keep; + + /// + /// use dvd dimensions to determine PAR + /// + public int itu_par; + + /// + /// pixel alignment for loose anamorphic + /// + public int modulus; + + /// + /// Cropping + /// + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4, ArraySubType = UnmanagedType.I4)] + public int[] crop; + + /// + /// max destination storage width + /// + public int maxWidth; + + /// + /// max destination storage height + /// + public int maxHeight; + + /// + /// Pixel aspect used in custom anamorphic + /// + public hb_geometry_s geometry; + } + + /// + /// The hb_rational_t. + /// + [StructLayout(LayoutKind.Sequential)] + public struct hb_rational_t + { + /// + /// The num. W + /// + public int num; + + /// + /// The den. H + /// + public int den; + } } \ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_image_s.cs b/win/CS/HandBrake.Interop/Interop/HbLib/hb_image_s.cs similarity index 92% rename from win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_image_s.cs rename to win/CS/HandBrake.Interop/Interop/HbLib/hb_image_s.cs index 764a3ea43..2d2632622 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_image_s.cs +++ b/win/CS/HandBrake.Interop/Interop/HbLib/hb_image_s.cs @@ -1,41 +1,41 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// Defines the hb_image_s type. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.HbLib -{ - using System; - using System.Runtime.InteropServices; - - /// - /// The hb_image_s. - /// - internal struct hb_image_s - { - public int format; - public int width; - public int height; - public IntPtr data; - - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4, ArraySubType = UnmanagedType.I4)] - public image_plane[] plane; - } - - /// - /// The image_plane. - /// - internal struct image_plane - { - public IntPtr data; - public int width; - public int height; - public int stride; - public int height_stride; - public int size; - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Defines the hb_image_s type. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.HbLib +{ + using System; + using System.Runtime.InteropServices; + + /// + /// The hb_image_s. + /// + internal struct hb_image_s + { + public int format; + public int width; + public int height; + public IntPtr data; + + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4, ArraySubType = UnmanagedType.I4)] + public image_plane[] plane; + } + + /// + /// The image_plane. + /// + internal struct image_plane + { + public IntPtr data; + public int width; + public int height; + public int stride; + public int height_stride; + public int size; + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_mixdown_s.cs b/win/CS/HandBrake.Interop/Interop/HbLib/hb_mixdown_s.cs similarity index 91% rename from win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_mixdown_s.cs rename to win/CS/HandBrake.Interop/Interop/HbLib/hb_mixdown_s.cs index 726ebf226..06fb6af6b 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_mixdown_s.cs +++ b/win/CS/HandBrake.Interop/Interop/HbLib/hb_mixdown_s.cs @@ -1,25 +1,25 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// Disable Stylecop Warnings for this file -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.HbLib -{ - using System.Runtime.InteropServices; - - [StructLayout(LayoutKind.Sequential)] - internal struct hb_mixdown_s - { - [MarshalAs(UnmanagedType.LPStr)] - public string name; - - /// char* - [MarshalAs(UnmanagedType.LPStr)] - public string short_name; - - /// int - public int amixdown; - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// Disable Stylecop Warnings for this file +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.HbLib +{ + using System.Runtime.InteropServices; + + [StructLayout(LayoutKind.Sequential)] + internal struct hb_mixdown_s + { + [MarshalAs(UnmanagedType.LPStr)] + public string name; + + /// char* + [MarshalAs(UnmanagedType.LPStr)] + public string short_name; + + /// int + public int amixdown; + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_rate_s.cs b/win/CS/HandBrake.Interop/Interop/HbLib/hb_rate_s.cs similarity index 91% rename from win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_rate_s.cs rename to win/CS/HandBrake.Interop/Interop/HbLib/hb_rate_s.cs index 5a4f48b4a..f10c320ce 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_rate_s.cs +++ b/win/CS/HandBrake.Interop/Interop/HbLib/hb_rate_s.cs @@ -1,22 +1,22 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// Disable Stylecop Warnings for this file -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.HbLib -{ - using System.Runtime.InteropServices; - - [StructLayout(LayoutKind.Sequential)] - internal struct hb_rate_s - { - /// char* - [MarshalAs(UnmanagedType.LPStr)] - public string name; - - /// int - public int rate; - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// Disable Stylecop Warnings for this file +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.HbLib +{ + using System.Runtime.InteropServices; + + [StructLayout(LayoutKind.Sequential)] + internal struct hb_rate_s + { + /// char* + [MarshalAs(UnmanagedType.LPStr)] + public string name; + + /// int + public int rate; + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_subtitle.cs b/win/CS/HandBrake.Interop/Interop/HbLib/hb_subtitle.cs similarity index 90% rename from win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_subtitle.cs rename to win/CS/HandBrake.Interop/Interop/HbLib/hb_subtitle.cs index 4d0351814..0cfb0038b 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/hb_subtitle.cs +++ b/win/CS/HandBrake.Interop/Interop/HbLib/hb_subtitle.cs @@ -1,28 +1,28 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// Disable Stylecop Warnings for this file -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.HbLib -{ - public enum hb_subtitle_s_subsource - { - VOBSUB, - - SRTSUB, - - CC608SUB, - - CC708SUB, - - UTF8SUB, - - TX3GSUB, - - SSASUB, - - PGSSUB - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// Disable Stylecop Warnings for this file +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.HbLib +{ + public enum hb_subtitle_s_subsource + { + VOBSUB, + + SRTSUB, + + CC608SUB, + + CC708SUB, + + UTF8SUB, + + TX3GSUB, + + SSASUB, + + PGSSUB + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/iso639_lang_t.cs b/win/CS/HandBrake.Interop/Interop/HbLib/iso639_lang_t.cs similarity index 92% rename from win/CS/HandBrake.ApplicationServices/Interop/HbLib/iso639_lang_t.cs rename to win/CS/HandBrake.Interop/Interop/HbLib/iso639_lang_t.cs index 86aa71dd8..8a9d8ab64 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/HbLib/iso639_lang_t.cs +++ b/win/CS/HandBrake.Interop/Interop/HbLib/iso639_lang_t.cs @@ -1,29 +1,29 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// Disable Stylecop Warnings for this file -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.HbLib -{ - using System; - using System.Runtime.InteropServices; - - [StructLayout(LayoutKind.Sequential)] - internal struct iso639_lang_t - { - public IntPtr eng_name; - - public IntPtr native_name; - - [MarshalAs(UnmanagedType.LPStr)] - public string iso639_1; - - [MarshalAs(UnmanagedType.LPStr)] - public string iso639_2; - - [MarshalAs(UnmanagedType.LPStr)] - public string iso639_2b; - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// Disable Stylecop Warnings for this file +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.HbLib +{ + using System; + using System.Runtime.InteropServices; + + [StructLayout(LayoutKind.Sequential)] + internal struct iso639_lang_t + { + public IntPtr eng_name; + + public IntPtr native_name; + + [MarshalAs(UnmanagedType.LPStr)] + public string iso639_1; + + [MarshalAs(UnmanagedType.LPStr)] + public string iso639_2; + + [MarshalAs(UnmanagedType.LPStr)] + public string iso639_2b; + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Helpers/InteropUtilities.cs b/win/CS/HandBrake.Interop/Interop/Helpers/InteropUtilities.cs similarity index 96% rename from win/CS/HandBrake.ApplicationServices/Interop/Helpers/InteropUtilities.cs rename to win/CS/HandBrake.Interop/Interop/Helpers/InteropUtilities.cs index 95c43aee8..c63fde326 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Helpers/InteropUtilities.cs +++ b/win/CS/HandBrake.Interop/Interop/Helpers/InteropUtilities.cs @@ -1,283 +1,283 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// Helper utilities for native interop. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Helpers -{ - using System; - using System.Collections.Generic; - using System.Linq; - using System.Runtime.InteropServices; - using System.Text; - - using HandBrake.ApplicationServices.Interop.HbLib; - - /// - /// Helper utilities for native interop. - /// - internal static class InteropUtilities - { - /// - /// Reads the given native structure pointer. - /// - /// The type to convert the structure to. - /// The pointer to the native structure. - /// The converted structure. - public static T ToStructureFromPtr(IntPtr structPtr) - { - return (T)Marshal.PtrToStructure(structPtr, typeof(T)); - } - - /// - /// Reads the given native UTF-8 string. - /// - /// The pointer to the string. - /// The resulting string. - public static string ToStringFromUtf8Ptr(IntPtr stringPtr) - { - var data = new List(); - var ptr = stringPtr; - var offset = 0; - while (true) - { - byte ch = Marshal.ReadByte(ptr, offset++); - if (ch == 0) - { - break; - } - - data.Add(ch); - } - - return Encoding.UTF8.GetString(data.ToArray()); - } - - /// - /// Creates a pointer to a UTF-8 null-terminated string. - /// - /// - /// The string to encode. - /// - /// - /// The . - /// - public static IntPtr ToUtf8PtrFromString(string str) - { - byte[] bytes = Encoding.UTF8.GetBytes(str); - IntPtr stringPtr = Marshal.AllocHGlobal(bytes.Length + 1); - var offset = 0; - foreach (byte b in bytes) - { - Marshal.WriteByte(stringPtr, offset, b); - offset++; - } - - Marshal.WriteByte(stringPtr, offset, 0); - return stringPtr; - } - - /// - /// Converts the given native HandBrake list to a managed list. - /// - /// The type of structure in the list. - /// The pointer to the native list. - /// The converted managed list. - public static List ToListFromHandBrakeList(this IntPtr listPtr) - { - List returnList = new List(); - NativeList nativeList = new NativeList(listPtr); - - for (int i = 0; i < nativeList.Count; i++) - { - IntPtr itemPtr = nativeList[i]; - returnList.Add(ToStructureFromPtr(itemPtr)); - } - - return returnList; - } - - /// - /// Converts the HB list to a managed list of pointers. - /// - /// The list to convert. - /// The managed list of pointers. - public static List ToIntPtrList(this IntPtr listPtr) - { - var returnList = new List(); - NativeList nativeList = new NativeList(listPtr); - - for (int i = 0; i < nativeList.Count; i++) - { - IntPtr itemPtr = nativeList[i]; - returnList.Add(itemPtr); - } - - return returnList; - } - - /// - /// Converts the given native array to a managed collection. - /// - /// The type of item in the list. - /// The pointer to the array. - /// The number of items in the array. - /// The converted collection. - public static List ToListFromNativeArray(IntPtr arrayPtr, int count) - { - IntPtr currentItem = arrayPtr; - - var result = new List(); - for (int i = 0; i < count; i++) - { - T nativeEncoder = ToStructureFromPtr(currentItem); - result.Add(nativeEncoder); - - currentItem = IntPtr.Add(currentItem, Marshal.SizeOf(typeof(T))); - } - - return result; - } - - /// - /// Takes an array pointer and converts it into a list of strings. - /// - /// A pointer to a raw list of strings. - /// The list of strings. - public static List ToStringListFromArrayPtr(IntPtr arrayPtr) - { - if (arrayPtr == IntPtr.Zero) - { - return null; - } - - return ToPtrListFromPtr(arrayPtr).Select(ptr => Marshal.PtrToStringAnsi(ptr)).ToList(); - } - - /// - /// Finds all the pointers starting at the given location and puts them in a list. Stops when it finds zero for a pointer. - /// - /// The address of the list of pointers. - /// The list of pointers. - public static List ToPtrListFromPtr(IntPtr arrayPtr) - { - var result = new List(); - int ptrSize = Marshal.SizeOf(typeof(IntPtr)); - IntPtr currentPtr = Marshal.ReadIntPtr(arrayPtr); - for (int i = 0; currentPtr != IntPtr.Zero; i++) - { - result.Add(currentPtr); - currentPtr = Marshal.ReadIntPtr(arrayPtr, (i + 1) * ptrSize); - } - - return result; - } - - /// - /// Creates a native HandBrake list from the given managed list of pointers. - /// - /// The managed list to convert. - /// The converted native list. - public static NativeList ToHandBrakeListFromPtrList(List list) - { - NativeList returnList = NativeList.CreateList(); - - foreach (IntPtr ptr in list) - { - returnList.Add(ptr); - } - - return returnList; - } - - /// - /// Creates a native HandBrake list from the given managed list of structures. - /// - /// The type of structures in the list. - /// The managed list to convert. - /// The converted native list. - public static NativeList ToHandBrakeListFromList(List list) - { - NativeList returnList = NativeList.CreateList(); - foreach (T item in list) - { - IntPtr itemPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(T))); - returnList.AllocatedMemory.Add(itemPtr); - Marshal.StructureToPtr(item, itemPtr, false); - - returnList.Add(itemPtr); - } - - return returnList; - } - - /// - /// Reads in a list of objects given an iterator and a conversion function. - /// - /// The type of the struct given by the iterator. - /// The object type to convert to. - /// The iterator to use to build the list. - /// The converter to convert from the struct to the object. - /// The list of objects. - public static List ToListFromIterator(Func iterator, Func converter) - { - return ToListFromIterator(iterator).Select(converter).ToList(); - } - - /// - /// Reads in a list of structs given an iterator. - /// - /// The type of the struct. - /// The iterator to use to build the list. - /// The list of structs. - public static List ToListFromIterator(Func iterator) - { - var structureList = new List(); - IntPtr current = IntPtr.Zero; - - current = iterator(current); - while (current != IntPtr.Zero) - { - T encoder = ToStructureFromPtr(current); - structureList.Add(encoder); - - current = iterator(current); - } - - return structureList; - } - - /// - /// Closes the given job. - /// - /// The pointer to the job. - public static void CloseJob(IntPtr nativeJobPtr) - { - // Create a point to the job pointer first. - IntPtr nativeJobPtrPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(IntPtr))); - - // Assign the new pointer to the job pointer and tell HB to clean the job up. - Marshal.WriteIntPtr(nativeJobPtrPtr, nativeJobPtr); - HBFunctions.hb_job_close(nativeJobPtrPtr); - - // Free the pointer we used. - Marshal.FreeHGlobal(nativeJobPtrPtr); - } - - /// - /// Frees all the memory locations in the given list. - /// - /// The list of memory locations to free. - public static void FreeMemory(List memoryList) - { - foreach (IntPtr memoryLocation in memoryList) - { - Marshal.FreeHGlobal(memoryLocation); - } - } - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Helper utilities for native interop. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Helpers +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Runtime.InteropServices; + using System.Text; + + using HandBrake.Interop.Interop.HbLib; + + /// + /// Helper utilities for native interop. + /// + internal static class InteropUtilities + { + /// + /// Reads the given native structure pointer. + /// + /// The type to convert the structure to. + /// The pointer to the native structure. + /// The converted structure. + public static T ToStructureFromPtr(IntPtr structPtr) + { + return (T)Marshal.PtrToStructure(structPtr, typeof(T)); + } + + /// + /// Reads the given native UTF-8 string. + /// + /// The pointer to the string. + /// The resulting string. + public static string ToStringFromUtf8Ptr(IntPtr stringPtr) + { + var data = new List(); + var ptr = stringPtr; + var offset = 0; + while (true) + { + byte ch = Marshal.ReadByte(ptr, offset++); + if (ch == 0) + { + break; + } + + data.Add(ch); + } + + return Encoding.UTF8.GetString(data.ToArray()); + } + + /// + /// Creates a pointer to a UTF-8 null-terminated string. + /// + /// + /// The string to encode. + /// + /// + /// The . + /// + public static IntPtr ToUtf8PtrFromString(string str) + { + byte[] bytes = Encoding.UTF8.GetBytes(str); + IntPtr stringPtr = Marshal.AllocHGlobal(bytes.Length + 1); + var offset = 0; + foreach (byte b in bytes) + { + Marshal.WriteByte(stringPtr, offset, b); + offset++; + } + + Marshal.WriteByte(stringPtr, offset, 0); + return stringPtr; + } + + /// + /// Converts the given native HandBrake list to a managed list. + /// + /// The type of structure in the list. + /// The pointer to the native list. + /// The converted managed list. + public static List ToListFromHandBrakeList(this IntPtr listPtr) + { + List returnList = new List(); + NativeList nativeList = new NativeList(listPtr); + + for (int i = 0; i < nativeList.Count; i++) + { + IntPtr itemPtr = nativeList[i]; + returnList.Add(ToStructureFromPtr(itemPtr)); + } + + return returnList; + } + + /// + /// Converts the HB list to a managed list of pointers. + /// + /// The list to convert. + /// The managed list of pointers. + public static List ToIntPtrList(this IntPtr listPtr) + { + var returnList = new List(); + NativeList nativeList = new NativeList(listPtr); + + for (int i = 0; i < nativeList.Count; i++) + { + IntPtr itemPtr = nativeList[i]; + returnList.Add(itemPtr); + } + + return returnList; + } + + /// + /// Converts the given native array to a managed collection. + /// + /// The type of item in the list. + /// The pointer to the array. + /// The number of items in the array. + /// The converted collection. + public static List ToListFromNativeArray(IntPtr arrayPtr, int count) + { + IntPtr currentItem = arrayPtr; + + var result = new List(); + for (int i = 0; i < count; i++) + { + T nativeEncoder = ToStructureFromPtr(currentItem); + result.Add(nativeEncoder); + + currentItem = IntPtr.Add(currentItem, Marshal.SizeOf(typeof(T))); + } + + return result; + } + + /// + /// Takes an array pointer and converts it into a list of strings. + /// + /// A pointer to a raw list of strings. + /// The list of strings. + public static List ToStringListFromArrayPtr(IntPtr arrayPtr) + { + if (arrayPtr == IntPtr.Zero) + { + return null; + } + + return ToPtrListFromPtr(arrayPtr).Select(ptr => Marshal.PtrToStringAnsi(ptr)).ToList(); + } + + /// + /// Finds all the pointers starting at the given location and puts them in a list. Stops when it finds zero for a pointer. + /// + /// The address of the list of pointers. + /// The list of pointers. + public static List ToPtrListFromPtr(IntPtr arrayPtr) + { + var result = new List(); + int ptrSize = Marshal.SizeOf(typeof(IntPtr)); + IntPtr currentPtr = Marshal.ReadIntPtr(arrayPtr); + for (int i = 0; currentPtr != IntPtr.Zero; i++) + { + result.Add(currentPtr); + currentPtr = Marshal.ReadIntPtr(arrayPtr, (i + 1) * ptrSize); + } + + return result; + } + + /// + /// Creates a native HandBrake list from the given managed list of pointers. + /// + /// The managed list to convert. + /// The converted native list. + public static NativeList ToHandBrakeListFromPtrList(List list) + { + NativeList returnList = NativeList.CreateList(); + + foreach (IntPtr ptr in list) + { + returnList.Add(ptr); + } + + return returnList; + } + + /// + /// Creates a native HandBrake list from the given managed list of structures. + /// + /// The type of structures in the list. + /// The managed list to convert. + /// The converted native list. + public static NativeList ToHandBrakeListFromList(List list) + { + NativeList returnList = NativeList.CreateList(); + foreach (T item in list) + { + IntPtr itemPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(T))); + returnList.AllocatedMemory.Add(itemPtr); + Marshal.StructureToPtr(item, itemPtr, false); + + returnList.Add(itemPtr); + } + + return returnList; + } + + /// + /// Reads in a list of objects given an iterator and a conversion function. + /// + /// The type of the struct given by the iterator. + /// The object type to convert to. + /// The iterator to use to build the list. + /// The converter to convert from the struct to the object. + /// The list of objects. + public static List ToListFromIterator(Func iterator, Func converter) + { + return ToListFromIterator(iterator).Select(converter).ToList(); + } + + /// + /// Reads in a list of structs given an iterator. + /// + /// The type of the struct. + /// The iterator to use to build the list. + /// The list of structs. + public static List ToListFromIterator(Func iterator) + { + var structureList = new List(); + IntPtr current = IntPtr.Zero; + + current = iterator(current); + while (current != IntPtr.Zero) + { + T encoder = ToStructureFromPtr(current); + structureList.Add(encoder); + + current = iterator(current); + } + + return structureList; + } + + /// + /// Closes the given job. + /// + /// The pointer to the job. + public static void CloseJob(IntPtr nativeJobPtr) + { + // Create a point to the job pointer first. + IntPtr nativeJobPtrPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(IntPtr))); + + // Assign the new pointer to the job pointer and tell HB to clean the job up. + Marshal.WriteIntPtr(nativeJobPtrPtr, nativeJobPtr); + HBFunctions.hb_job_close(nativeJobPtrPtr); + + // Free the pointer we used. + Marshal.FreeHGlobal(nativeJobPtrPtr); + } + + /// + /// Frees all the memory locations in the given list. + /// + /// The list of memory locations to free. + public static void FreeMemory(List memoryList) + { + foreach (IntPtr memoryLocation in memoryList) + { + Marshal.FreeHGlobal(memoryLocation); + } + } + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Helpers/NativeList.cs b/win/CS/HandBrake.Interop/Interop/Helpers/NativeList.cs similarity index 94% rename from win/CS/HandBrake.ApplicationServices/Interop/Helpers/NativeList.cs rename to win/CS/HandBrake.Interop/Interop/Helpers/NativeList.cs index a692b6c75..dc0f9c3db 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Helpers/NativeList.cs +++ b/win/CS/HandBrake.Interop/Interop/Helpers/NativeList.cs @@ -1,127 +1,127 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// Represents a HandBrake style native list. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Helpers -{ - using System; - using System.Collections.Generic; - using System.Diagnostics; - using System.Runtime.InteropServices; - - using HandBrake.ApplicationServices.Interop.HbLib; - - /// - /// Represents a HandBrake style native list. - /// - internal class NativeList : IDisposable - { - /// - /// Initializes a new instance of the NativeList class. - /// - /// The pointer to use for the list. - public NativeList(IntPtr listPtr) - { - this.Ptr = listPtr; - } - - /// - /// The list of native memory locations allocated for this list. - /// - private readonly List allocatedMemory = new List(); - - /// - /// Gets the pointer to the native list. - /// - public IntPtr Ptr { get; private set; } - - /// - /// Gets the number of items in the list. - /// - public int Count - { - get - { - Debug.WriteLine("Got a Zero Pointer in the NativeList"); - return this.Ptr == IntPtr.Zero ? 0 : HBFunctions.hb_list_count(this.Ptr); - } - } - - /// - /// Gets the list of native memory locations allocated for this list. - /// - public List AllocatedMemory - { - get - { - return this.allocatedMemory; - } - } - - /// - /// Adds an item to the end of the list. - /// - /// The item to add. - public void Add(IntPtr item) - { - HBFunctions.hb_list_add(this.Ptr, item); - } - - /// - /// Inserts an item into the list. - /// - /// The index to insert the item at. - /// The item to insert. - public void Insert(int position, IntPtr item) - { - HBFunctions.hb_list_insert(this.Ptr, position, item); - } - - /// - /// Removes an item from the list. - /// - /// The item to remove. - public void Remove(IntPtr item) - { - HBFunctions.hb_list_rem(this.Ptr, item); - } - - /// - /// Gets an item out of the list. - /// - /// Index in the list. - /// The item at that index in the list. - public IntPtr this[int i] - { - get - { - return HBFunctions.hb_list_item(this.Ptr, i); - } - } - - /// - /// Disposes resources associated with this object. - /// - public void Dispose() - { - IntPtr listPtrPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(IntPtr))); - Marshal.WriteIntPtr(listPtrPtr, this.Ptr); - HBFunctions.hb_list_close(listPtrPtr); - Marshal.FreeHGlobal(listPtrPtr); - } - - /// - /// Creates a new list in unmanaged memory. - /// - /// The created list. - public static NativeList CreateList() - { - return new NativeList(HBFunctions.hb_list_init()); - } - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Represents a HandBrake style native list. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Helpers +{ + using System; + using System.Collections.Generic; + using System.Diagnostics; + using System.Runtime.InteropServices; + + using HandBrake.Interop.Interop.HbLib; + + /// + /// Represents a HandBrake style native list. + /// + internal class NativeList : IDisposable + { + /// + /// Initializes a new instance of the NativeList class. + /// + /// The pointer to use for the list. + public NativeList(IntPtr listPtr) + { + this.Ptr = listPtr; + } + + /// + /// The list of native memory locations allocated for this list. + /// + private readonly List allocatedMemory = new List(); + + /// + /// Gets the pointer to the native list. + /// + public IntPtr Ptr { get; private set; } + + /// + /// Gets the number of items in the list. + /// + public int Count + { + get + { + Debug.WriteLine("Got a Zero Pointer in the NativeList"); + return this.Ptr == IntPtr.Zero ? 0 : HBFunctions.hb_list_count(this.Ptr); + } + } + + /// + /// Gets the list of native memory locations allocated for this list. + /// + public List AllocatedMemory + { + get + { + return this.allocatedMemory; + } + } + + /// + /// Adds an item to the end of the list. + /// + /// The item to add. + public void Add(IntPtr item) + { + HBFunctions.hb_list_add(this.Ptr, item); + } + + /// + /// Inserts an item into the list. + /// + /// The index to insert the item at. + /// The item to insert. + public void Insert(int position, IntPtr item) + { + HBFunctions.hb_list_insert(this.Ptr, position, item); + } + + /// + /// Removes an item from the list. + /// + /// The item to remove. + public void Remove(IntPtr item) + { + HBFunctions.hb_list_rem(this.Ptr, item); + } + + /// + /// Gets an item out of the list. + /// + /// Index in the list. + /// The item at that index in the list. + public IntPtr this[int i] + { + get + { + return HBFunctions.hb_list_item(this.Ptr, i); + } + } + + /// + /// Disposes resources associated with this object. + /// + public void Dispose() + { + IntPtr listPtrPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(IntPtr))); + Marshal.WriteIntPtr(listPtrPtr, this.Ptr); + HBFunctions.hb_list_close(listPtrPtr); + Marshal.FreeHGlobal(listPtrPtr); + } + + /// + /// Creates a new list in unmanaged memory. + /// + /// The created list. + public static NativeList CreateList() + { + return new NativeList(HBFunctions.hb_list_init()); + } + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Helpers/Utilities.cs b/win/CS/HandBrake.Interop/Interop/Helpers/Utilities.cs similarity index 92% rename from win/CS/HandBrake.ApplicationServices/Interop/Helpers/Utilities.cs rename to win/CS/HandBrake.Interop/Interop/Helpers/Utilities.cs index eba89bcaa..369216023 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Helpers/Utilities.cs +++ b/win/CS/HandBrake.Interop/Interop/Helpers/Utilities.cs @@ -1,49 +1,49 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// Defines the Utilities type. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Helpers -{ - /// - /// The utilities. - /// - internal static class Utilities - { - /// - /// Get the Greatest Common Factor - /// - /// - /// The a. - /// - /// - /// The b. - /// - /// - /// The greatest common factor - /// - public static int GreatestCommonFactor(int a, int b) - { - if (a == 0) - { - return b; - } - - if (b == 0) - { - return a; - } - - if (a > b) - { - return GreatestCommonFactor(a % b, b); - } - - return GreatestCommonFactor(a, b % a); - } - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Defines the Utilities type. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Helpers +{ + /// + /// The utilities. + /// + internal static class Utilities + { + /// + /// Get the Greatest Common Factor + /// + /// + /// The a. + /// + /// + /// The b. + /// + /// + /// The greatest common factor + /// + public static int GreatestCommonFactor(int a, int b) + { + if (a == 0) + { + return b; + } + + if (b == 0) + { + return a; + } + + if (a > b) + { + return GreatestCommonFactor(a % b, b); + } + + return GreatestCommonFactor(a, b % a); + } + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Interfaces/IHandBrakeInstance.cs b/win/CS/HandBrake.Interop/Interop/Interfaces/IHandBrakeInstance.cs similarity index 90% rename from win/CS/HandBrake.ApplicationServices/Interop/Interfaces/IHandBrakeInstance.cs rename to win/CS/HandBrake.Interop/Interop/Interfaces/IHandBrakeInstance.cs index 3f61499b9..7714e5222 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Interfaces/IHandBrakeInstance.cs +++ b/win/CS/HandBrake.Interop/Interop/Interfaces/IHandBrakeInstance.cs @@ -1,151 +1,151 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// The Interface for HandBrakeInstance -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Interfaces -{ - using System; - - using HandBrake.ApplicationServices.Interop.EventArgs; - using HandBrake.ApplicationServices.Interop.Json.Encode; - using HandBrake.ApplicationServices.Interop.Json.Scan; - using HandBrake.ApplicationServices.Interop.Model.Preview; - - /// - /// The Interface for HandBrakeInstance - /// - public interface IHandBrakeInstance - { - #region Events - - /// - /// Fires when an encode has completed. - /// - event EventHandler EncodeCompleted; - - /// - /// Fires for progress updates when encoding. - /// - event EventHandler EncodeProgress; - - /// - /// Fires when a scan has completed. - /// - event EventHandler ScanCompleted; - - /// - /// Fires for progress updates when scanning. - /// - event EventHandler ScanProgress; - - #endregion - - #region Properties - - /// - /// Gets the index of the default title. - /// - int FeatureTitle { get; } - - /// - /// Gets the list of titles on this instance. - /// - JsonScanObject Titles { get; } - - /// - /// Gets the HandBrake version string. - /// - string Version { get; } - - /// - /// Gets the HandBrake build number. - /// - int Build { get; } - - #endregion - - #region Public Methods - - /// - /// Initializes this instance. - /// - /// - /// The code for the logging verbosity to use. - /// - void Initialize(int verbosity); - - /// - /// Frees any resources associated with this object. - /// - void Dispose(); - - /// - /// Gets an image for the given job and preview - /// - /// - /// Only incorporates sizing and aspect ratio into preview image. - /// - /// - /// The encode job to preview. - /// - /// - /// The index of the preview to get (0-based). - /// - /// - /// True to enable basic deinterlace of preview images. - /// - /// - /// An image with the requested preview. - /// - RawPreviewData GetPreview(PreviewSettings job, int previewNumber, bool deinterlace); - - /// - /// Pauses the current encode. - /// - void PauseEncode(); - - /// - /// Resumes a paused encode. - /// - void ResumeEncode(); - - /// - /// Starts an encode with the given job. - /// - /// - /// The job to start. - /// - void StartEncode(JsonEncodeObject jobToStart); - - /// - /// Starts a scan of the given path. - /// - /// - /// The path of the video to scan. - /// - /// - /// The number of previews to make on each title. - /// - /// - /// The min Duration. - /// - void StartScan(string path, int previewCount, TimeSpan minDuration, int titleIndex); - - /// - /// Stops the current encode. - /// - void StopEncode(); - - /// - /// Stop any running scans - /// - void StopScan(); - - #endregion - } +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The Interface for HandBrakeInstance +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Interfaces +{ + using System; + + using HandBrake.Interop.Interop.EventArgs; + using HandBrake.Interop.Interop.Json.Encode; + using HandBrake.Interop.Interop.Json.Scan; + using HandBrake.Interop.Interop.Model.Preview; + + /// + /// The Interface for HandBrakeInstance + /// + public interface IHandBrakeInstance + { + #region Events + + /// + /// Fires when an encode has completed. + /// + event EventHandler EncodeCompleted; + + /// + /// Fires for progress updates when encoding. + /// + event EventHandler EncodeProgress; + + /// + /// Fires when a scan has completed. + /// + event EventHandler ScanCompleted; + + /// + /// Fires for progress updates when scanning. + /// + event EventHandler ScanProgress; + + #endregion + + #region Properties + + /// + /// Gets the index of the default title. + /// + int FeatureTitle { get; } + + /// + /// Gets the list of titles on this instance. + /// + JsonScanObject Titles { get; } + + /// + /// Gets the HandBrake version string. + /// + string Version { get; } + + /// + /// Gets the HandBrake build number. + /// + int Build { get; } + + #endregion + + #region Public Methods + + /// + /// Initializes this instance. + /// + /// + /// The code for the logging verbosity to use. + /// + void Initialize(int verbosity); + + /// + /// Frees any resources associated with this object. + /// + void Dispose(); + + /// + /// Gets an image for the given job and preview + /// + /// + /// Only incorporates sizing and aspect ratio into preview image. + /// + /// + /// The encode job to preview. + /// + /// + /// The index of the preview to get (0-based). + /// + /// + /// True to enable basic deinterlace of preview images. + /// + /// + /// An image with the requested preview. + /// + RawPreviewData GetPreview(PreviewSettings job, int previewNumber, bool deinterlace); + + /// + /// Pauses the current encode. + /// + void PauseEncode(); + + /// + /// Resumes a paused encode. + /// + void ResumeEncode(); + + /// + /// Starts an encode with the given job. + /// + /// + /// The job to start. + /// + void StartEncode(JsonEncodeObject jobToStart); + + /// + /// Starts a scan of the given path. + /// + /// + /// The path of the video to scan. + /// + /// + /// The number of previews to make on each title. + /// + /// + /// The min Duration. + /// + void StartScan(string path, int previewCount, TimeSpan minDuration, int titleIndex); + + /// + /// Stops the current encode. + /// + void StopEncode(); + + /// + /// Stop any running scans + /// + void StopScan(); + + #endregion + } } \ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Anamorphic/AnamorphicGeometry.cs b/win/CS/HandBrake.Interop/Interop/Json/Anamorphic/AnamorphicGeometry.cs similarity index 85% rename from win/CS/HandBrake.ApplicationServices/Interop/Json/Anamorphic/AnamorphicGeometry.cs rename to win/CS/HandBrake.Interop/Interop/Json/Anamorphic/AnamorphicGeometry.cs index 96e257b57..6f6714caa 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Anamorphic/AnamorphicGeometry.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Anamorphic/AnamorphicGeometry.cs @@ -1,29 +1,29 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// The geometry. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Json.Anamorphic -{ - using HandBrake.ApplicationServices.Interop.Json.Shared; - - /// - /// The geometry. - /// - public class AnamorphicGeometry - { - /// - /// Gets or sets the dest geometry. - /// - public DestSettings DestSettings { get; set; } - - /// - /// Gets or sets the source geometry. - /// - public Geometry SourceGeometry { get; set; } - } +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The geometry. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Json.Anamorphic +{ + using HandBrake.Interop.Interop.Json.Shared; + + /// + /// The geometry. + /// + public class AnamorphicGeometry + { + /// + /// Gets or sets the dest geometry. + /// + public DestSettings DestSettings { get; set; } + + /// + /// Gets or sets the source geometry. + /// + public Geometry SourceGeometry { get; set; } + } } \ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Anamorphic/DestSettings.cs b/win/CS/HandBrake.Interop/Interop/Json/Anamorphic/DestSettings.cs similarity index 91% rename from win/CS/HandBrake.ApplicationServices/Interop/Json/Anamorphic/DestSettings.cs rename to win/CS/HandBrake.Interop/Interop/Json/Anamorphic/DestSettings.cs index 28971308b..99f38439b 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Anamorphic/DestSettings.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Anamorphic/DestSettings.cs @@ -1,69 +1,69 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// The dest geometry. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Json.Anamorphic -{ - using System.Collections.Generic; - - using HandBrake.ApplicationServices.Interop.Json.Shared; - - /// - /// The dest geometry. - /// - public class DestSettings - { - /// - /// Initializes a new instance of the class. - /// - public DestSettings() - { - this.Geometry = new Geometry(); - } - - /// - /// Gets or sets the anamorphic mode. - /// - public int AnamorphicMode { get; set; } - - /// - /// Gets or sets the crop. - /// - public List Crop { get; set; } - - /// - /// Gets or sets the Geometry - /// - public Geometry Geometry { get; set; } - - /// - /// Gets or sets a value indicating whether itu par. - /// - public bool ItuPAR { get; set; } - - /// - /// Gets or sets a value indicating whether keep display aspect. - /// - public int Keep { get; set; } - - /// - /// Gets or sets the max height. - /// - public int MaxHeight { get; set; } - - /// - /// Gets or sets the max width. - /// - public int MaxWidth { get; set; } - - /// - /// Gets or sets the modulus. - /// - public int Modulus { get; set; } - } +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The dest geometry. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Json.Anamorphic +{ + using System.Collections.Generic; + + using HandBrake.Interop.Interop.Json.Shared; + + /// + /// The dest geometry. + /// + public class DestSettings + { + /// + /// Initializes a new instance of the class. + /// + public DestSettings() + { + this.Geometry = new Geometry(); + } + + /// + /// Gets or sets the anamorphic mode. + /// + public int AnamorphicMode { get; set; } + + /// + /// Gets or sets the crop. + /// + public List Crop { get; set; } + + /// + /// Gets or sets the Geometry + /// + public Geometry Geometry { get; set; } + + /// + /// Gets or sets a value indicating whether itu par. + /// + public bool ItuPAR { get; set; } + + /// + /// Gets or sets a value indicating whether keep display aspect. + /// + public int Keep { get; set; } + + /// + /// Gets or sets the max height. + /// + public int MaxHeight { get; set; } + + /// + /// Gets or sets the max width. + /// + public int MaxWidth { get; set; } + + /// + /// Gets or sets the modulus. + /// + public int Modulus { get; set; } + } } \ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Audio.cs b/win/CS/HandBrake.Interop/Interop/Json/Encode/Audio.cs similarity index 91% rename from win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Audio.cs rename to win/CS/HandBrake.Interop/Interop/Json/Encode/Audio.cs index 4e4b61d6b..924185f50 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Audio.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Encode/Audio.cs @@ -1,34 +1,34 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// The audio. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Json.Encode -{ - using System.Collections.Generic; - - /// - /// The audio. - /// - public class Audio - { - /// - /// Gets or sets the audio list. - /// - public List AudioList { get; set; } - - /// - /// Gets or sets the copy mask. - /// - public uint[] CopyMask { get; set; } - - /// - /// Gets or sets the fallback encoder. - /// - public int FallbackEncoder { get; set; } - } +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The audio. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Json.Encode +{ + using System.Collections.Generic; + + /// + /// The audio. + /// + public class Audio + { + /// + /// Gets or sets the audio list. + /// + public List AudioList { get; set; } + + /// + /// Gets or sets the copy mask. + /// + public uint[] CopyMask { get; set; } + + /// + /// Gets or sets the fallback encoder. + /// + public int FallbackEncoder { get; set; } + } } \ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/AudioTrack.cs b/win/CS/HandBrake.Interop/Interop/Json/Encode/AudioTrack.cs similarity index 94% rename from win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/AudioTrack.cs rename to win/CS/HandBrake.Interop/Interop/Json/Encode/AudioTrack.cs index 2bde4cca4..64ef94fd7 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/AudioTrack.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Encode/AudioTrack.cs @@ -1,77 +1,77 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// Represents an audio track to encode. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Json.Encode -{ - /// - /// Represents an audio track to encode. - /// - public class AudioTrack - { - /// - /// Gets or sets the bitrate. - /// - public int? Bitrate { get; set; } - - /// - /// Gets or sets the compression level. - /// - public double? CompressionLevel { get; set; } - - /// - /// Gets or sets the drc. - /// - public double DRC { get; set; } - - /// - /// Gets or sets the encoder. - /// - public int Encoder { get; set; } - - /// - /// Gets or sets the gain. - /// - public double Gain { get; set; } - - /// - /// Gets or sets the mixdown. - /// - public int Mixdown { get; set; } - - /// - /// Gets or sets a value indicating whether normalize mix level. - /// - public bool NormalizeMixLevel { get; set; } - - /// - /// Gets or sets the quality. - /// - public double? Quality { get; set; } - - /// - /// Gets or sets the samplerate. - /// - public int Samplerate { get; set; } - - /// - /// Gets or sets the Name of the audio track. - /// - public string Name { get; set; } - - /// - /// Gets or sets the track. - /// - public int Track { get; set; } - - /// - /// Gets or sets the dither method. - /// - public int DitherMethod { get; set; } - } +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Represents an audio track to encode. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Json.Encode +{ + /// + /// Represents an audio track to encode. + /// + public class AudioTrack + { + /// + /// Gets or sets the bitrate. + /// + public int? Bitrate { get; set; } + + /// + /// Gets or sets the compression level. + /// + public double? CompressionLevel { get; set; } + + /// + /// Gets or sets the drc. + /// + public double DRC { get; set; } + + /// + /// Gets or sets the encoder. + /// + public int Encoder { get; set; } + + /// + /// Gets or sets the gain. + /// + public double Gain { get; set; } + + /// + /// Gets or sets the mixdown. + /// + public int Mixdown { get; set; } + + /// + /// Gets or sets a value indicating whether normalize mix level. + /// + public bool NormalizeMixLevel { get; set; } + + /// + /// Gets or sets the quality. + /// + public double? Quality { get; set; } + + /// + /// Gets or sets the samplerate. + /// + public int Samplerate { get; set; } + + /// + /// Gets or sets the Name of the audio track. + /// + public string Name { get; set; } + + /// + /// Gets or sets the track. + /// + public int Track { get; set; } + + /// + /// Gets or sets the dither method. + /// + public int DitherMethod { get; set; } + } } \ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Chapter.cs b/win/CS/HandBrake.Interop/Interop/Json/Encode/Chapter.cs similarity index 90% rename from win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Chapter.cs rename to win/CS/HandBrake.Interop/Interop/Json/Encode/Chapter.cs index 95eeb0057..ae8924e5d 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Chapter.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Encode/Chapter.cs @@ -1,22 +1,22 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// Represents a chapter to encode. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Json.Encode -{ - /// - /// Represents a chapter to encode. - /// - public class Chapter - { - /// - /// Gets or sets the name. - /// - public string Name { get; set; } - } +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Represents a chapter to encode. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Json.Encode +{ + /// + /// Represents a chapter to encode. + /// + public class Chapter + { + /// + /// Gets or sets the name. + /// + public string Name { get; set; } + } } \ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Destination.cs b/win/CS/HandBrake.Interop/Interop/Json/Encode/Destination.cs similarity index 93% rename from win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Destination.cs rename to win/CS/HandBrake.Interop/Interop/Json/Encode/Destination.cs index 910a541ca..0d8b2daeb 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Destination.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Encode/Destination.cs @@ -1,49 +1,49 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// The destination. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Json.Encode -{ - using System.Collections.Generic; - - /// - /// The destination. - /// - public class Destination - { - /// - /// Gets or sets the chapter list. - /// - public List ChapterList { get; set; } - - /// - /// Gets or sets a value indicating whether chapter markers. - /// - public bool ChapterMarkers { get; set; } - - /// - /// Use Legacy A/V Alignment rather than Edit Lists. - /// - public bool AlignAVStart { get; set; } - - /// - /// Gets or sets the file. - /// - public string File { get; set; } - - /// - /// Gets or sets the mp 4 options. - /// - public Mp4Options Mp4Options { get; set; } - - /// - /// Gets or sets the mux. - /// - public int Mux { get; set; } - } +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The destination. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Json.Encode +{ + using System.Collections.Generic; + + /// + /// The destination. + /// + public class Destination + { + /// + /// Gets or sets the chapter list. + /// + public List ChapterList { get; set; } + + /// + /// Gets or sets a value indicating whether chapter markers. + /// + public bool ChapterMarkers { get; set; } + + /// + /// Use Legacy A/V Alignment rather than Edit Lists. + /// + public bool AlignAVStart { get; set; } + + /// + /// Gets or sets the file. + /// + public string File { get; set; } + + /// + /// Gets or sets the mp 4 options. + /// + public Mp4Options Mp4Options { get; set; } + + /// + /// Gets or sets the mux. + /// + public int Mux { get; set; } + } } \ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Filter.cs b/win/CS/HandBrake.Interop/Interop/Json/Encode/Filter.cs similarity index 90% rename from win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Filter.cs rename to win/CS/HandBrake.Interop/Interop/Json/Encode/Filter.cs index 4479f5d77..9cd5161ac 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Filter.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Encode/Filter.cs @@ -1,29 +1,29 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// The filter list. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Json.Encode -{ - using Newtonsoft.Json.Linq; - - /// - /// The filter list. - /// - public class Filter - { - /// - /// Gets or sets the id. - /// - public int ID { get; set; } - - /// - /// Gets or sets the settings. - /// - public JToken Settings { get; set; } - } +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The filter list. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Json.Encode +{ + using Newtonsoft.Json.Linq; + + /// + /// The filter list. + /// + public class Filter + { + /// + /// Gets or sets the id. + /// + public int ID { get; set; } + + /// + /// Gets or sets the settings. + /// + public JToken Settings { get; set; } + } } \ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Filters.cs b/win/CS/HandBrake.Interop/Interop/Json/Encode/Filters.cs similarity index 90% rename from win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Filters.cs rename to win/CS/HandBrake.Interop/Interop/Json/Encode/Filters.cs index 2e767b18a..9c664cfa5 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Filters.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Encode/Filters.cs @@ -1,24 +1,24 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// The filter. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Json.Encode -{ - using System.Collections.Generic; - - /// - /// The filter. - /// - public class Filters - { - /// - /// Gets or sets the filter list. - /// - public List FilterList { get; set; } - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The filter. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Json.Encode +{ + using System.Collections.Generic; + + /// + /// The filter. + /// + public class Filters + { + /// + /// Gets or sets the filter list. + /// + public List FilterList { get; set; } + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/JsonEncodeObject.cs b/win/CS/HandBrake.Interop/Interop/Json/Encode/JsonEncodeObject.cs similarity index 90% rename from win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/JsonEncodeObject.cs rename to win/CS/HandBrake.Interop/Interop/Json/Encode/JsonEncodeObject.cs index 68baffcb4..fa3d26c26 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/JsonEncodeObject.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Encode/JsonEncodeObject.cs @@ -1,64 +1,64 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// The root object. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Json.Encode -{ - using HandBrake.ApplicationServices.Interop.Json.Shared; - - /// - /// The root object. - /// - public class JsonEncodeObject - { - /// - /// Gets or sets the audio. - /// - public Audio Audio { get; set; } - - /// - /// Gets or sets the destination. - /// - public Destination Destination { get; set; } - - /// - /// Gets or sets the filter. - /// - public Filters Filters { get; set; } - - /// - /// Gets or sets the PAR - /// - public PAR PAR { get; set; } - - /// - /// Gets or sets the meta data. - /// - public Metadata Metadata { get; set; } - - /// - /// Gets or sets the sequence id. - /// - public int SequenceID { get; set; } - - /// - /// Gets or sets the source. - /// - public Source Source { get; set; } - - /// - /// Gets or sets the subtitle. - /// - public Subtitles Subtitle { get; set; } - - /// - /// Gets or sets the video. - /// - public Video Video { get; set; } - } +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The root object. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Json.Encode +{ + using HandBrake.Interop.Interop.Json.Shared; + + /// + /// The root object. + /// + public class JsonEncodeObject + { + /// + /// Gets or sets the audio. + /// + public Audio Audio { get; set; } + + /// + /// Gets or sets the destination. + /// + public Destination Destination { get; set; } + + /// + /// Gets or sets the filter. + /// + public Filters Filters { get; set; } + + /// + /// Gets or sets the PAR + /// + public PAR PAR { get; set; } + + /// + /// Gets or sets the meta data. + /// + public Metadata Metadata { get; set; } + + /// + /// Gets or sets the sequence id. + /// + public int SequenceID { get; set; } + + /// + /// Gets or sets the source. + /// + public Source Source { get; set; } + + /// + /// Gets or sets the subtitle. + /// + public Subtitles Subtitle { get; set; } + + /// + /// Gets or sets the video. + /// + public Video Video { get; set; } + } } \ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/MetaData.cs b/win/CS/HandBrake.Interop/Interop/Json/Encode/Metadata.cs similarity index 93% rename from win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/MetaData.cs rename to win/CS/HandBrake.Interop/Interop/Json/Encode/Metadata.cs index c193527eb..adf82c09c 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/MetaData.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Encode/Metadata.cs @@ -1,62 +1,62 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// The meta data. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Json.Encode -{ - /// - /// The meta data. - /// - public class Metadata - { - /// - /// Gets or sets the album artist. - /// - public string AlbumArtist { get; set; } - - /// - /// Gets or sets the artist. - /// - public string Artist { get; set; } - - /// - /// Gets or sets the comment. - /// - public string Comment { get; set; } - - /// - /// Gets or sets the composer. - /// - public string Composer { get; set; } - - /// - /// Gets or sets the description. - /// - public string Description { get; set; } - - /// - /// Gets or sets the genre. - /// - public string Genre { get; set; } - - /// - /// Gets or sets the long description. - /// - public string LongDescription { get; set; } - - /// - /// Gets or sets the name. - /// - public string Name { get; set; } - - /// - /// Gets or sets the release date. - /// - public string ReleaseDate { get; set; } - } +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The meta data. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Json.Encode +{ + /// + /// The meta data. + /// + public class Metadata + { + /// + /// Gets or sets the album artist. + /// + public string AlbumArtist { get; set; } + + /// + /// Gets or sets the artist. + /// + public string Artist { get; set; } + + /// + /// Gets or sets the comment. + /// + public string Comment { get; set; } + + /// + /// Gets or sets the composer. + /// + public string Composer { get; set; } + + /// + /// Gets or sets the description. + /// + public string Description { get; set; } + + /// + /// Gets or sets the genre. + /// + public string Genre { get; set; } + + /// + /// Gets or sets the long description. + /// + public string LongDescription { get; set; } + + /// + /// Gets or sets the name. + /// + public string Name { get; set; } + + /// + /// Gets or sets the release date. + /// + public string ReleaseDate { get; set; } + } } \ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Mp4Options.cs b/win/CS/HandBrake.Interop/Interop/Json/Encode/Mp4Options.cs similarity index 91% rename from win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Mp4Options.cs rename to win/CS/HandBrake.Interop/Interop/Json/Encode/Mp4Options.cs index ad12e4e69..2dc833375 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Mp4Options.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Encode/Mp4Options.cs @@ -1,27 +1,27 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// The mp 4 options. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Json.Encode -{ - /// - /// The mp 4 options. - /// - public class Mp4Options - { - /// - /// Gets or sets a value indicating whether ipod atom. - /// - public bool IpodAtom { get; set; } - - /// - /// Gets or sets a value indicating whether mp 4 optimize. - /// - public bool Mp4Optimize { get; set; } - } +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The mp 4 options. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Json.Encode +{ + /// + /// The mp 4 options. + /// + public class Mp4Options + { + /// + /// Gets or sets a value indicating whether ipod atom. + /// + public bool IpodAtom { get; set; } + + /// + /// Gets or sets a value indicating whether mp 4 optimize. + /// + public bool Mp4Optimize { get; set; } + } } \ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/QSV.cs b/win/CS/HandBrake.Interop/Interop/Json/Encode/QSV.cs similarity index 90% rename from win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/QSV.cs rename to win/CS/HandBrake.Interop/Interop/Json/Encode/QSV.cs index 0ca120643..64286ab28 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/QSV.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Encode/QSV.cs @@ -1,27 +1,27 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// The qsv. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Json.Encode -{ - /// - /// The qsv. - /// - public class QSV - { - /// - /// Gets or sets a value indicating whether decode. - /// - public bool Decode { get; set; } - - /// - /// Gets or sets the async depth. - /// - public int AsyncDepth { get; set; } - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The qsv. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Json.Encode +{ + /// + /// The qsv. + /// + public class QSV + { + /// + /// Gets or sets a value indicating whether decode. + /// + public bool Decode { get; set; } + + /// + /// Gets or sets the async depth. + /// + public int AsyncDepth { get; set; } + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Range.cs b/win/CS/HandBrake.Interop/Interop/Json/Encode/Range.cs similarity index 92% rename from win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Range.cs rename to win/CS/HandBrake.Interop/Interop/Json/Encode/Range.cs index f4b3724d2..2327e359f 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Range.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Encode/Range.cs @@ -1,38 +1,38 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// The range. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Json.Encode -{ - /// - /// The range. - /// - public class Range - { - /// - /// Gets or sets the chapter end. - /// Type is "chapter", "time", "frame", or "preview". - /// - public string Type { get; set; } - - /// - /// Gets or sets the chapter start. - /// - public long? Start { get; set; } - - /// - /// Gets or sets the frame to start. - /// - public long? End { get; set; } - - /// - /// Gets or sets the seek points. - /// - public long? SeekPoints { get; set; } - } +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The range. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Json.Encode +{ + /// + /// The range. + /// + public class Range + { + /// + /// Gets or sets the chapter end. + /// Type is "chapter", "time", "frame", or "preview". + /// + public string Type { get; set; } + + /// + /// Gets or sets the chapter start. + /// + public long? Start { get; set; } + + /// + /// Gets or sets the frame to start. + /// + public long? End { get; set; } + + /// + /// Gets or sets the seek points. + /// + public long? SeekPoints { get; set; } + } } \ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/SRT.cs b/win/CS/HandBrake.Interop/Interop/Json/Encode/SRT.cs similarity index 91% rename from win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/SRT.cs rename to win/CS/HandBrake.Interop/Interop/Json/Encode/SRT.cs index 94229c97b..96f42a52f 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/SRT.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Encode/SRT.cs @@ -1,32 +1,32 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// The srt. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Json.Encode -{ - /// - /// The srt. - /// - public class SRT - { - /// - /// Gets or sets the codeset. - /// - public string Codeset { get; set; } - - /// - /// Gets or sets the filename. - /// - public string Filename { get; set; } - - /// - /// Gets or sets the language. - /// - public string Language { get; set; } - } +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The srt. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Json.Encode +{ + /// + /// The srt. + /// + public class SRT + { + /// + /// Gets or sets the codeset. + /// + public string Codeset { get; set; } + + /// + /// Gets or sets the filename. + /// + public string Filename { get; set; } + + /// + /// Gets or sets the language. + /// + public string Language { get; set; } + } } \ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Source.cs b/win/CS/HandBrake.Interop/Interop/Json/Encode/Source.cs similarity index 91% rename from win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Source.cs rename to win/CS/HandBrake.Interop/Interop/Json/Encode/Source.cs index 27a746c36..7f156c0c6 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Source.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Encode/Source.cs @@ -1,37 +1,37 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// The source. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Json.Encode -{ - /// - /// The source. - /// - public class Source - { - /// - /// Gets or sets the angle. - /// - public int Angle { get; set; } - - /// - /// Gets or sets the range. - /// - public Range Range { get; set; } - - /// - /// Gets or sets the title. - /// - public int Title { get; set; } - - /// - /// Gets or sets the path. - /// - public string Path { get; set; } - } +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The source. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Json.Encode +{ + /// + /// The source. + /// + public class Source + { + /// + /// Gets or sets the angle. + /// + public int Angle { get; set; } + + /// + /// Gets or sets the range. + /// + public Range Range { get; set; } + + /// + /// Gets or sets the title. + /// + public int Title { get; set; } + + /// + /// Gets or sets the path. + /// + public string Path { get; set; } + } } \ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/SubtitleSearch.cs b/win/CS/HandBrake.Interop/Interop/Json/Encode/SubtitleSearch.cs similarity index 92% rename from win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/SubtitleSearch.cs rename to win/CS/HandBrake.Interop/Interop/Json/Encode/SubtitleSearch.cs index b6c5cbd63..28558f48b 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/SubtitleSearch.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Encode/SubtitleSearch.cs @@ -1,37 +1,37 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// The search. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Json.Encode -{ - /// - /// The search. - /// - public class SubtitleSearch - { - /// - /// Gets or sets a value indicating whether burn. - /// - public bool Burn { get; set; } - - /// - /// Gets or sets a value indicating whether default. - /// - public bool Default { get; set; } - - /// - /// Gets or sets a value indicating whether enable. - /// - public bool Enable { get; set; } - - /// - /// Gets or sets a value indicating whether forced. - /// - public bool Forced { get; set; } - } +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The search. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Json.Encode +{ + /// + /// The search. + /// + public class SubtitleSearch + { + /// + /// Gets or sets a value indicating whether burn. + /// + public bool Burn { get; set; } + + /// + /// Gets or sets a value indicating whether default. + /// + public bool Default { get; set; } + + /// + /// Gets or sets a value indicating whether enable. + /// + public bool Enable { get; set; } + + /// + /// Gets or sets a value indicating whether forced. + /// + public bool Forced { get; set; } + } } \ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/SubtitleTrack.cs b/win/CS/HandBrake.Interop/Interop/Json/Encode/SubtitleTrack.cs similarity index 93% rename from win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/SubtitleTrack.cs rename to win/CS/HandBrake.Interop/Interop/Json/Encode/SubtitleTrack.cs index 929c001d0..ab51a1db9 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/SubtitleTrack.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Encode/SubtitleTrack.cs @@ -1,52 +1,52 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// Represents a subtitle track to encode. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Json.Encode -{ - /// - /// Represents a subtitle track to encode. - /// - public class SubtitleTrack - { - /// - /// Gets or sets a value indicating whether burn. - /// - public bool Burn { get; set; } - - /// - /// Gets or sets a value indicating whether default. - /// - public bool Default { get; set; } - - /// - /// Gets or sets a value indicating whether force. - /// - public bool Forced { get; set; } - - /// - /// Gets or sets the id. - /// - public int ID { get; set; } - - /// - /// Gets or sets the offset. - /// - public int Offset { get; set; } - - /// - /// Gets or sets the track. - /// - public int Track { get; set; } - - /// - /// Gets or sets the srt. - /// - public SRT SRT { get; set; } - } +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Represents a subtitle track to encode. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Json.Encode +{ + /// + /// Represents a subtitle track to encode. + /// + public class SubtitleTrack + { + /// + /// Gets or sets a value indicating whether burn. + /// + public bool Burn { get; set; } + + /// + /// Gets or sets a value indicating whether default. + /// + public bool Default { get; set; } + + /// + /// Gets or sets a value indicating whether force. + /// + public bool Forced { get; set; } + + /// + /// Gets or sets the id. + /// + public int ID { get; set; } + + /// + /// Gets or sets the offset. + /// + public int Offset { get; set; } + + /// + /// Gets or sets the track. + /// + public int Track { get; set; } + + /// + /// Gets or sets the srt. + /// + public SRT SRT { get; set; } + } } \ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Subtitles.cs b/win/CS/HandBrake.Interop/Interop/Json/Encode/Subtitles.cs similarity index 91% rename from win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Subtitles.cs rename to win/CS/HandBrake.Interop/Interop/Json/Encode/Subtitles.cs index 248801789..8c565d185 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Subtitles.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Encode/Subtitles.cs @@ -1,29 +1,29 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// The subtitle. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Json.Encode -{ - using System.Collections.Generic; - - /// - /// The subtitle. - /// - public class Subtitles - { - /// - /// Gets or sets the search. - /// - public SubtitleSearch Search { get; set; } - - /// - /// Gets or sets the subtitle list. - /// - public List SubtitleList { get; set; } - } +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The subtitle. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Json.Encode +{ + using System.Collections.Generic; + + /// + /// The subtitle. + /// + public class Subtitles + { + /// + /// Gets or sets the search. + /// + public SubtitleSearch Search { get; set; } + + /// + /// Gets or sets the subtitle list. + /// + public List SubtitleList { get; set; } + } } \ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Video.cs b/win/CS/HandBrake.Interop/Interop/Json/Encode/Video.cs similarity index 94% rename from win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Video.cs rename to win/CS/HandBrake.Interop/Interop/Json/Encode/Video.cs index b22910768..f77c0d335 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/Video.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Encode/Video.cs @@ -1,90 +1,90 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// The video. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Json.Encode -{ - /// - /// The video. - /// - public class Video - { - /// - /// Initializes a new instance of the class. - /// - public Video() - { - this.QSV = new QSV(); - } - - /// - /// Gets or sets the codec. - /// - public int Encoder { get; set; } - - /// - /// Gets or sets the level. - /// - public string Level { get; set; } - - /// - /// Gets or sets the bitrate for the encode. - /// - public int? Bitrate { get; set; } - - /// - /// Gets or sets a value indicating whether two pass. - /// - public bool TwoPass { get; set; } - - /// - /// Gets or sets a value indicating whether Turbo First Pass. For x264/5 - /// - public bool Turbo { get; set; } - - /// - /// Gets or sets the Colour Matrix Code - /// - public int ColorMatrixCode { get; set; } - - /// - /// Gets or sets the options. - /// - public string Options { get; set; } - - /// - /// Gets or sets the preset. - /// - public string Preset { get; set; } - - /// - /// Gets or sets the profile. - /// - public string Profile { get; set; } - - /// - /// Gets or sets the quality. - /// - public double? Quality { get; set; } - - /// - /// Gets or sets the tune. - /// - public string Tune { get; set; } - - /// - /// Gets or sets a value indicating whether hw decode. - /// - public bool HWDecode { get; set; } - - /// - /// Gets or sets the qsv. - /// - public QSV QSV { get; set; } - } +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The video. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Json.Encode +{ + /// + /// The video. + /// + public class Video + { + /// + /// Initializes a new instance of the class. + /// + public Video() + { + this.QSV = new QSV(); + } + + /// + /// Gets or sets the codec. + /// + public int Encoder { get; set; } + + /// + /// Gets or sets the level. + /// + public string Level { get; set; } + + /// + /// Gets or sets the bitrate for the encode. + /// + public int? Bitrate { get; set; } + + /// + /// Gets or sets a value indicating whether two pass. + /// + public bool TwoPass { get; set; } + + /// + /// Gets or sets a value indicating whether Turbo First Pass. For x264/5 + /// + public bool Turbo { get; set; } + + /// + /// Gets or sets the Colour Matrix Code + /// + public int ColorMatrixCode { get; set; } + + /// + /// Gets or sets the options. + /// + public string Options { get; set; } + + /// + /// Gets or sets the preset. + /// + public string Preset { get; set; } + + /// + /// Gets or sets the profile. + /// + public string Profile { get; set; } + + /// + /// Gets or sets the quality. + /// + public double? Quality { get; set; } + + /// + /// Gets or sets the tune. + /// + public string Tune { get; set; } + + /// + /// Gets or sets a value indicating whether hw decode. + /// + public bool HWDecode { get; set; } + + /// + /// Gets or sets the qsv. + /// + public QSV QSV { get; set; } + } } \ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Filters/PresetTune.cs b/win/CS/HandBrake.Interop/Interop/Json/Filters/PresetTune.cs similarity index 93% rename from win/CS/HandBrake.ApplicationServices/Interop/Json/Filters/PresetTune.cs rename to win/CS/HandBrake.Interop/Interop/Json/Filters/PresetTune.cs index f69cec099..ad7648901 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Filters/PresetTune.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Filters/PresetTune.cs @@ -7,7 +7,7 @@ // // -------------------------------------------------------------------------------------------------------------------- -namespace HandBrake.ApplicationServices.Interop.Json.Filters +namespace HandBrake.Interop.Interop.Json.Filters { /// /// The preset tune. diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Presets/AudioList.cs b/win/CS/HandBrake.Interop/Interop/Json/Presets/AudioList.cs similarity index 94% rename from win/CS/HandBrake.ApplicationServices/Interop/Json/Presets/AudioList.cs rename to win/CS/HandBrake.Interop/Interop/Json/Presets/AudioList.cs index 8ad95d173..49f875de9 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Presets/AudioList.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Presets/AudioList.cs @@ -1,72 +1,72 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// The audio list. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Json.Presets -{ - /// - /// The audio list. - /// - public class AudioList - { - /// - /// Gets or sets the audio bitrate. - /// - public int AudioBitrate { get; set; } - - /// - /// Gets or sets the audio compression level. - /// - public double AudioCompressionLevel { get; set; } - - /// - /// Gets or sets the audio dither method. - /// - public string AudioDitherMethod { get; set; } - - /// - /// Gets or sets the audio encoder. - /// - public string AudioEncoder { get; set; } - - /// - /// Gets or sets the audio mixdown. (ShortName) - /// - public string AudioMixdown { get; set; } - - /// - /// Gets or sets a value indicating whether audio normalize mix level. - /// - public bool AudioNormalizeMixLevel { get; set; } - - /// - /// Gets or sets the audio samplerate. - /// - public string AudioSamplerate { get; set; } - - /// - /// Gets or sets a value indicating whether audio track quality enable. - /// - public bool AudioTrackQualityEnable { get; set; } - - /// - /// Gets or sets the audio track quality. - /// - public double AudioTrackQuality { get; set; } - - /// - /// Gets or sets the audio track gain slider. - /// - public double AudioTrackGainSlider { get; set; } - - /// - /// Gets or sets the audio track drc slider. - /// - public double AudioTrackDRCSlider { get; set; } - } +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The audio list. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Json.Presets +{ + /// + /// The audio list. + /// + public class AudioList + { + /// + /// Gets or sets the audio bitrate. + /// + public int AudioBitrate { get; set; } + + /// + /// Gets or sets the audio compression level. + /// + public double AudioCompressionLevel { get; set; } + + /// + /// Gets or sets the audio dither method. + /// + public string AudioDitherMethod { get; set; } + + /// + /// Gets or sets the audio encoder. + /// + public string AudioEncoder { get; set; } + + /// + /// Gets or sets the audio mixdown. (ShortName) + /// + public string AudioMixdown { get; set; } + + /// + /// Gets or sets a value indicating whether audio normalize mix level. + /// + public bool AudioNormalizeMixLevel { get; set; } + + /// + /// Gets or sets the audio samplerate. + /// + public string AudioSamplerate { get; set; } + + /// + /// Gets or sets a value indicating whether audio track quality enable. + /// + public bool AudioTrackQualityEnable { get; set; } + + /// + /// Gets or sets the audio track quality. + /// + public double AudioTrackQuality { get; set; } + + /// + /// Gets or sets the audio track gain slider. + /// + public double AudioTrackGainSlider { get; set; } + + /// + /// Gets or sets the audio track drc slider. + /// + public double AudioTrackDRCSlider { get; set; } + } } \ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Presets/HBPreset.cs b/win/CS/HandBrake.Interop/Interop/Json/Presets/HBPreset.cs similarity index 96% rename from win/CS/HandBrake.ApplicationServices/Interop/Json/Presets/HBPreset.cs rename to win/CS/HandBrake.Interop/Interop/Json/Presets/HBPreset.cs index 118b5cbf7..2ea758d5d 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Presets/HBPreset.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Presets/HBPreset.cs @@ -1,416 +1,416 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// The preset. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Json.Presets -{ - using System.Collections.Generic; - - /// - /// The preset. - /// - public class HBPreset - { - public bool AlignAVStart { get; set; } - - /// - /// Gets or sets the audio copy mask. - /// - public List AudioCopyMask { get; set; } - - /// - /// Gets or sets the audio encoder fallback. - /// - public string AudioEncoderFallback { get; set; } - - /// - /// Gets or sets the audio language list. - /// - public List AudioLanguageList { get; set; } - - /// - /// Gets or sets the audio list. - /// - public List AudioList { get; set; } - - /// - /// Gets or sets a value indicating whether audio secondary encoder mode. - /// - public bool AudioSecondaryEncoderMode { get; set; } - - /// - /// Gets or sets the audio track selection behavior. - /// - public string AudioTrackSelectionBehavior { get; set; } - - /// - /// Gets or sets a value indicating whether chapter markers. - /// - public bool ChapterMarkers { get; set; } - - /// - /// Gets or sets the children array. - /// - public List ChildrenArray { get; set; } - - /// - /// Gets or sets a value indicating whether default. - /// - public bool Default { get; set; } - - /// - /// Gets or sets the file format. - /// - public string FileFormat { get; set; } - - /// - /// Gets or sets a value indicating whether folder. - /// - public bool Folder { get; set; } - - /// - /// Gets or sets a value indicating whether folder open. - /// - public bool FolderOpen { get; set; } - - /// - /// Gets or sets a value indicating whether mp 4 http optimize. - /// - public bool Mp4HttpOptimize { get; set; } - - /// - /// Gets or sets a value indicating whether mp 4 i pod compatible. - /// - public bool Mp4iPodCompatible { get; set; } - - /// - /// Gets or sets a value indicating whether picture auto crop. - /// - public bool PictureAutoCrop { get; set; } - - /// - /// Gets or sets the picture bottom crop. - /// - public int PictureBottomCrop { get; set; } - - /// - /// Gets or sets the picture left crop. - /// - public int PictureLeftCrop { get; set; } - - /// - /// Gets or sets the picture right crop. - /// - public int PictureRightCrop { get; set; } - - /// - /// Gets or sets the picture top crop. - /// - public int PictureTopCrop { get; set; } - - /// - /// Gets or sets the picture dar width. - /// - public int PictureDARWidth { get; set; } - - /// - /// Gets or sets the picture deblock. - /// - public int PictureDeblock { get; set; } - - /// - /// Gets or sets a value indicating whether picture decomb deinterlace. - /// - public string PictureDeinterlaceFilter { get; set; } - - /// - /// Gets or sets the picture comb detect preset. - /// - public string PictureCombDetectPreset { get; set; } - - /// - /// Gets or sets the picture comb detect custom. - /// - public string PictureCombDetectCustom { get; set; } - - /// - /// Gets or sets the picture deinterlace preset. - /// - public string PictureDeinterlacePreset { get; set; } - - /// - /// Gets or sets the picture deinterlace custom. - /// - public string PictureDeinterlaceCustom { get; set; } - - /// - /// Gets or sets the picture denoise custom. - /// - public string PictureDenoiseCustom { get; set; } - - /// - /// Gets or sets the picture denoise filter. - /// - public string PictureDenoiseFilter { get; set; } - - /// - /// Gets or sets the picture denoise preset. - /// - public string PictureDenoisePreset { get; set; } - - /// - /// Gets or sets the picture denoise tune. - /// - public string PictureDenoiseTune { get; set; } - - public string PictureSharpenCustom { get; set; } - public string PictureSharpenFilter { get; set; } - public string PictureSharpenPreset { get; set; } - public string PictureSharpenTune { get; set; } - - /// - /// Gets or sets the picture detelecine. - /// - public string PictureDetelecine { get; set; } - - /// - /// Gets or sets the picture detelecine custom. - /// - public string PictureDetelecineCustom { get; set; } - - /// - /// Gets or sets a value indicating whether picture itu par. - /// - public bool PictureItuPAR { get; set; } - - /// - /// Gets or sets a value indicating whether picture keep ratio. - /// - public bool PictureKeepRatio { get; set; } - - /// - /// Gets or sets a value indicating whether picture loose crop. - /// - public bool PictureLooseCrop { get; set; } - - /// - /// Gets or sets the picture modulus. - /// - public int PictureModulus { get; set; } - - /// - /// Gets or sets the picture par. - /// - public string PicturePAR { get; set; } - - /// - /// Gets or sets the picture par width. - /// - public int PicturePARWidth { get; set; } - - /// - /// Gets or sets the picture par height. - /// - public int PicturePARHeight { get; set; } - - /// - /// Gets or sets the picture rotate. - /// - public string PictureRotate { get; set; } - - /// - /// Gets or sets the picture width. - /// - public int? PictureWidth { get; set; } - - /// - /// Gets or sets the picture height. - /// - public int? PictureHeight { get; set; } - - /// - /// Gets or sets the picture force height. - /// - public int PictureForceHeight { get; set; } - - /// - /// Gets or sets the picture force width. - /// - public int PictureForceWidth { get; set; } - - /// - /// Gets or sets the preset description. - /// - public string PresetDescription { get; set; } - - /// - /// Gets or sets the preset name. - /// - public string PresetName { get; set; } - - /// - /// Gets or sets the type. - /// - public int Type { get; set; } - - /// - /// Gets or sets a value indicating whether uses picture filters. - /// - public bool UsesPictureFilters { get; set; } - - /// - /// Gets or sets the uses picture settings. - /// - public int UsesPictureSettings { get; set; } - - /// - /// Gets or sets a value indicating whether subtitle add cc. - /// - public bool SubtitleAddCC { get; set; } - - /// - /// Gets or sets a value indicating whether subtitle add foreign audio search. - /// - public bool SubtitleAddForeignAudioSearch { get; set; } - - /// - /// Gets or sets a value indicating whether subtitle add foreign audio subtitle. - /// - public bool SubtitleAddForeignAudioSubtitle { get; set; } - - /// - /// Gets or sets the subtitle burn behavior. - /// - public string SubtitleBurnBehavior { get; set; } - - /// - /// Gets or sets a value indicating whether subtitle burn bd sub. - /// - public bool SubtitleBurnBDSub { get; set; } - - /// - /// Gets or sets a value indicating whether subtitle burn dvd sub. - /// - public bool SubtitleBurnDVDSub { get; set; } - - /// - /// Gets or sets the subtitle language list. - /// - public List SubtitleLanguageList { get; set; } - - /// - /// Gets or sets the subtitle track selection behavior. - /// - public string SubtitleTrackSelectionBehavior { get; set; } - - /// - /// Gets or sets the video avg bitrate. - /// - public int? VideoAvgBitrate { get; set; } - - /// - /// Gets or sets the video color matrix code. - /// - public int VideoColorMatrixCode { get; set; } - - /// - /// Gets or sets the video encoder. - /// - public string VideoEncoder { get; set; } - - /// - /// Gets or sets the video framerate. - /// - public string VideoFramerate { get; set; } - - /// - /// Gets or sets the video framerate mode. - /// - public string VideoFramerateMode { get; set; } - - /// - /// Gets or sets a value indicating whether video gray scale. - /// - public bool VideoGrayScale { get; set; } - - /// - /// Gets or sets a value indicating whether video hw decode. - /// - public bool VideoHWDecode { get; set; } - - /// - /// Gets or sets the video scaler. - /// - public string VideoScaler { get; set; } - - /// - /// Gets or sets the video preset. - /// - public string VideoPreset { get; set; } - - /// - /// Gets or sets the video tune. - /// - public string VideoTune { get; set; } - - /// - /// Gets or sets the video profile. - /// - public string VideoProfile { get; set; } - - /// - /// Gets or sets the video level. - /// - public string VideoLevel { get; set; } - - /// - /// Gets or sets the video option extra. - /// - public string VideoOptionExtra { get; set; } - - /// - /// Gets or sets the video quality type. - /// - public int VideoQualityType { get; set; } - - /// - /// Gets or sets the video quality slider. - /// - public double VideoQualitySlider { get; set; } - - /// - /// Gets or sets a value indicating whether video qsv decode. - /// - public bool VideoQSVDecode { get; set; } - - /// - /// Gets or sets the video qsv async depth. - /// - public int VideoQSVAsyncDepth { get; set; } - - /// - /// Gets or sets a value indicating whether video two pass. - /// - public bool VideoTwoPass { get; set; } - - /// - /// Gets or sets a value indicating whether video turbo two pass. - /// - public bool VideoTurboTwoPass { get; set; } - - /// - /// Gets or sets the x 264 option. - /// - public string x264Option { get; set; } - - /// - /// Gets or sets a value indicating whether x 264 use advanced options. - /// - public bool x264UseAdvancedOptions { get; set; } - } +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The preset. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Json.Presets +{ + using System.Collections.Generic; + + /// + /// The preset. + /// + public class HBPreset + { + public bool AlignAVStart { get; set; } + + /// + /// Gets or sets the audio copy mask. + /// + public List AudioCopyMask { get; set; } + + /// + /// Gets or sets the audio encoder fallback. + /// + public string AudioEncoderFallback { get; set; } + + /// + /// Gets or sets the audio language list. + /// + public List AudioLanguageList { get; set; } + + /// + /// Gets or sets the audio list. + /// + public List AudioList { get; set; } + + /// + /// Gets or sets a value indicating whether audio secondary encoder mode. + /// + public bool AudioSecondaryEncoderMode { get; set; } + + /// + /// Gets or sets the audio track selection behavior. + /// + public string AudioTrackSelectionBehavior { get; set; } + + /// + /// Gets or sets a value indicating whether chapter markers. + /// + public bool ChapterMarkers { get; set; } + + /// + /// Gets or sets the children array. + /// + public List ChildrenArray { get; set; } + + /// + /// Gets or sets a value indicating whether default. + /// + public bool Default { get; set; } + + /// + /// Gets or sets the file format. + /// + public string FileFormat { get; set; } + + /// + /// Gets or sets a value indicating whether folder. + /// + public bool Folder { get; set; } + + /// + /// Gets or sets a value indicating whether folder open. + /// + public bool FolderOpen { get; set; } + + /// + /// Gets or sets a value indicating whether mp 4 http optimize. + /// + public bool Mp4HttpOptimize { get; set; } + + /// + /// Gets or sets a value indicating whether mp 4 i pod compatible. + /// + public bool Mp4iPodCompatible { get; set; } + + /// + /// Gets or sets a value indicating whether picture auto crop. + /// + public bool PictureAutoCrop { get; set; } + + /// + /// Gets or sets the picture bottom crop. + /// + public int PictureBottomCrop { get; set; } + + /// + /// Gets or sets the picture left crop. + /// + public int PictureLeftCrop { get; set; } + + /// + /// Gets or sets the picture right crop. + /// + public int PictureRightCrop { get; set; } + + /// + /// Gets or sets the picture top crop. + /// + public int PictureTopCrop { get; set; } + + /// + /// Gets or sets the picture dar width. + /// + public int PictureDARWidth { get; set; } + + /// + /// Gets or sets the picture deblock. + /// + public int PictureDeblock { get; set; } + + /// + /// Gets or sets a value indicating whether picture decomb deinterlace. + /// + public string PictureDeinterlaceFilter { get; set; } + + /// + /// Gets or sets the picture comb detect preset. + /// + public string PictureCombDetectPreset { get; set; } + + /// + /// Gets or sets the picture comb detect custom. + /// + public string PictureCombDetectCustom { get; set; } + + /// + /// Gets or sets the picture deinterlace preset. + /// + public string PictureDeinterlacePreset { get; set; } + + /// + /// Gets or sets the picture deinterlace custom. + /// + public string PictureDeinterlaceCustom { get; set; } + + /// + /// Gets or sets the picture denoise custom. + /// + public string PictureDenoiseCustom { get; set; } + + /// + /// Gets or sets the picture denoise filter. + /// + public string PictureDenoiseFilter { get; set; } + + /// + /// Gets or sets the picture denoise preset. + /// + public string PictureDenoisePreset { get; set; } + + /// + /// Gets or sets the picture denoise tune. + /// + public string PictureDenoiseTune { get; set; } + + public string PictureSharpenCustom { get; set; } + public string PictureSharpenFilter { get; set; } + public string PictureSharpenPreset { get; set; } + public string PictureSharpenTune { get; set; } + + /// + /// Gets or sets the picture detelecine. + /// + public string PictureDetelecine { get; set; } + + /// + /// Gets or sets the picture detelecine custom. + /// + public string PictureDetelecineCustom { get; set; } + + /// + /// Gets or sets a value indicating whether picture itu par. + /// + public bool PictureItuPAR { get; set; } + + /// + /// Gets or sets a value indicating whether picture keep ratio. + /// + public bool PictureKeepRatio { get; set; } + + /// + /// Gets or sets a value indicating whether picture loose crop. + /// + public bool PictureLooseCrop { get; set; } + + /// + /// Gets or sets the picture modulus. + /// + public int PictureModulus { get; set; } + + /// + /// Gets or sets the picture par. + /// + public string PicturePAR { get; set; } + + /// + /// Gets or sets the picture par width. + /// + public int PicturePARWidth { get; set; } + + /// + /// Gets or sets the picture par height. + /// + public int PicturePARHeight { get; set; } + + /// + /// Gets or sets the picture rotate. + /// + public string PictureRotate { get; set; } + + /// + /// Gets or sets the picture width. + /// + public int? PictureWidth { get; set; } + + /// + /// Gets or sets the picture height. + /// + public int? PictureHeight { get; set; } + + /// + /// Gets or sets the picture force height. + /// + public int PictureForceHeight { get; set; } + + /// + /// Gets or sets the picture force width. + /// + public int PictureForceWidth { get; set; } + + /// + /// Gets or sets the preset description. + /// + public string PresetDescription { get; set; } + + /// + /// Gets or sets the preset name. + /// + public string PresetName { get; set; } + + /// + /// Gets or sets the type. + /// + public int Type { get; set; } + + /// + /// Gets or sets a value indicating whether uses picture filters. + /// + public bool UsesPictureFilters { get; set; } + + /// + /// Gets or sets the uses picture settings. + /// + public int UsesPictureSettings { get; set; } + + /// + /// Gets or sets a value indicating whether subtitle add cc. + /// + public bool SubtitleAddCC { get; set; } + + /// + /// Gets or sets a value indicating whether subtitle add foreign audio search. + /// + public bool SubtitleAddForeignAudioSearch { get; set; } + + /// + /// Gets or sets a value indicating whether subtitle add foreign audio subtitle. + /// + public bool SubtitleAddForeignAudioSubtitle { get; set; } + + /// + /// Gets or sets the subtitle burn behavior. + /// + public string SubtitleBurnBehavior { get; set; } + + /// + /// Gets or sets a value indicating whether subtitle burn bd sub. + /// + public bool SubtitleBurnBDSub { get; set; } + + /// + /// Gets or sets a value indicating whether subtitle burn dvd sub. + /// + public bool SubtitleBurnDVDSub { get; set; } + + /// + /// Gets or sets the subtitle language list. + /// + public List SubtitleLanguageList { get; set; } + + /// + /// Gets or sets the subtitle track selection behavior. + /// + public string SubtitleTrackSelectionBehavior { get; set; } + + /// + /// Gets or sets the video avg bitrate. + /// + public int? VideoAvgBitrate { get; set; } + + /// + /// Gets or sets the video color matrix code. + /// + public int VideoColorMatrixCode { get; set; } + + /// + /// Gets or sets the video encoder. + /// + public string VideoEncoder { get; set; } + + /// + /// Gets or sets the video framerate. + /// + public string VideoFramerate { get; set; } + + /// + /// Gets or sets the video framerate mode. + /// + public string VideoFramerateMode { get; set; } + + /// + /// Gets or sets a value indicating whether video gray scale. + /// + public bool VideoGrayScale { get; set; } + + /// + /// Gets or sets a value indicating whether video hw decode. + /// + public bool VideoHWDecode { get; set; } + + /// + /// Gets or sets the video scaler. + /// + public string VideoScaler { get; set; } + + /// + /// Gets or sets the video preset. + /// + public string VideoPreset { get; set; } + + /// + /// Gets or sets the video tune. + /// + public string VideoTune { get; set; } + + /// + /// Gets or sets the video profile. + /// + public string VideoProfile { get; set; } + + /// + /// Gets or sets the video level. + /// + public string VideoLevel { get; set; } + + /// + /// Gets or sets the video option extra. + /// + public string VideoOptionExtra { get; set; } + + /// + /// Gets or sets the video quality type. + /// + public int VideoQualityType { get; set; } + + /// + /// Gets or sets the video quality slider. + /// + public double VideoQualitySlider { get; set; } + + /// + /// Gets or sets a value indicating whether video qsv decode. + /// + public bool VideoQSVDecode { get; set; } + + /// + /// Gets or sets the video qsv async depth. + /// + public int VideoQSVAsyncDepth { get; set; } + + /// + /// Gets or sets a value indicating whether video two pass. + /// + public bool VideoTwoPass { get; set; } + + /// + /// Gets or sets a value indicating whether video turbo two pass. + /// + public bool VideoTurboTwoPass { get; set; } + + /// + /// Gets or sets the x 264 option. + /// + public string x264Option { get; set; } + + /// + /// Gets or sets a value indicating whether x 264 use advanced options. + /// + public bool x264UseAdvancedOptions { get; set; } + } } \ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Presets/PresetCategory.cs b/win/CS/HandBrake.Interop/Interop/Json/Presets/PresetCategory.cs similarity index 92% rename from win/CS/HandBrake.ApplicationServices/Interop/Json/Presets/PresetCategory.cs rename to win/CS/HandBrake.Interop/Interop/Json/Presets/PresetCategory.cs index 182772106..2cab7d25d 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Presets/PresetCategory.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Presets/PresetCategory.cs @@ -1,44 +1,44 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// The preset category. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Json.Presets -{ - using System.Collections.Generic; - - /// - /// The preset category. - /// - public class PresetCategory - { - /// - /// Gets or sets the children array. - /// - public List ChildrenArray { get; set; } - - /// - /// Gets or sets a value indicating whether folder. - /// - public bool Folder { get; set; } - - /// - /// Gets or sets the preset name. - /// - public string PresetName { get; set; } - - /// - /// Description for the preset group. - /// - public string PresetDescription { get; set; } - - /// - /// Gets or sets the type. - /// - public int Type { get; set; } - } +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The preset category. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Json.Presets +{ + using System.Collections.Generic; + + /// + /// The preset category. + /// + public class PresetCategory + { + /// + /// Gets or sets the children array. + /// + public List ChildrenArray { get; set; } + + /// + /// Gets or sets a value indicating whether folder. + /// + public bool Folder { get; set; } + + /// + /// Gets or sets the preset name. + /// + public string PresetName { get; set; } + + /// + /// Description for the preset group. + /// + public string PresetDescription { get; set; } + + /// + /// Gets or sets the type. + /// + public int Type { get; set; } + } } \ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Presets/PresetTransportContainer.cs b/win/CS/HandBrake.Interop/Interop/Json/Presets/PresetTransportContainer.cs similarity index 94% rename from win/CS/HandBrake.ApplicationServices/Interop/Json/Presets/PresetTransportContainer.cs rename to win/CS/HandBrake.Interop/Interop/Json/Presets/PresetTransportContainer.cs index 34a7c0996..91ce48de5 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Presets/PresetTransportContainer.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Presets/PresetTransportContainer.cs @@ -1,67 +1,67 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// The preset transport container. -// This is a model for importing the JSON / Plist presets into the GUI. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Json.Presets -{ - using System.Collections.Generic; - - /// - /// The preset transport container. - /// This is a model for importing the JSON / Plist presets into the GUI. - /// - public class PresetTransportContainer - { - /// - /// Initializes a new instance of the class. - /// - public PresetTransportContainer() - { - } - - /// - /// Initializes a new instance of the class. - /// - /// - /// The version major. - /// - /// - /// The version minor. - /// - /// - /// The version micro. - /// - public PresetTransportContainer(string versionMajor, string versionMinor, string versionMicro) - { - this.VersionMajor = versionMajor; - this.VersionMicro = versionMicro; - this.VersionMinor = versionMinor; - } - - /// - /// Gets or sets the children array. - /// - public List PresetList { get; set; } - - /// - /// Gets or sets the version major. - /// - public string VersionMajor { get; set; } - - /// - /// Gets or sets the version micro. - /// - public string VersionMicro { get; set; } - - /// - /// Gets or sets the version minor. - /// - public string VersionMinor { get; set; } - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The preset transport container. +// This is a model for importing the JSON / Plist presets into the GUI. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Json.Presets +{ + using System.Collections.Generic; + + /// + /// The preset transport container. + /// This is a model for importing the JSON / Plist presets into the GUI. + /// + public class PresetTransportContainer + { + /// + /// Initializes a new instance of the class. + /// + public PresetTransportContainer() + { + } + + /// + /// Initializes a new instance of the class. + /// + /// + /// The version major. + /// + /// + /// The version minor. + /// + /// + /// The version micro. + /// + public PresetTransportContainer(string versionMajor, string versionMinor, string versionMicro) + { + this.VersionMajor = versionMajor; + this.VersionMicro = versionMicro; + this.VersionMinor = versionMinor; + } + + /// + /// Gets or sets the children array. + /// + public List PresetList { get; set; } + + /// + /// Gets or sets the version major. + /// + public string VersionMajor { get; set; } + + /// + /// Gets or sets the version micro. + /// + public string VersionMicro { get; set; } + + /// + /// Gets or sets the version minor. + /// + public string VersionMinor { get; set; } + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Queue/Task.cs b/win/CS/HandBrake.Interop/Interop/Json/Queue/Task.cs similarity index 85% rename from win/CS/HandBrake.ApplicationServices/Interop/Json/Queue/Task.cs rename to win/CS/HandBrake.Interop/Interop/Json/Queue/Task.cs index e1805c3d9..e7a1da64e 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Queue/Task.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Queue/Task.cs @@ -7,9 +7,9 @@ // // -------------------------------------------------------------------------------------------------------------------- -namespace HandBrake.ApplicationServices.Interop.Json.Queue +namespace HandBrake.Interop.Interop.Json.Queue { - using HandBrake.ApplicationServices.Interop.Json.Encode; + using HandBrake.Interop.Interop.Json.Encode; /// /// The task. diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/AudioAttributes.cs b/win/CS/HandBrake.Interop/Interop/Json/Scan/AudioAttributes.cs similarity index 93% rename from win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/AudioAttributes.cs rename to win/CS/HandBrake.Interop/Interop/Json/Scan/AudioAttributes.cs index b6a29e194..96c6b9065 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/AudioAttributes.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Scan/AudioAttributes.cs @@ -7,7 +7,7 @@ // // -------------------------------------------------------------------------------------------------------------------- -namespace HandBrake.ApplicationServices.Interop.Json.Scan +namespace HandBrake.Interop.Interop.Json.Scan { public class AudioAttributes { diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/Color.cs b/win/CS/HandBrake.Interop/Interop/Json/Scan/Color.cs similarity index 91% rename from win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/Color.cs rename to win/CS/HandBrake.Interop/Interop/Json/Scan/Color.cs index b99495440..65af225c7 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/Color.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Scan/Color.cs @@ -1,32 +1,32 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// The color. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Json.Scan -{ - /// - /// The color. - /// - public class Color - { - /// - /// Gets or sets the matrix. - /// - public int Matrix { get; set; } - - /// - /// Gets or sets the primary. - /// - public int Primary { get; set; } - - /// - /// Gets or sets the transfer. - /// - public int Transfer { get; set; } - } +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The color. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Json.Scan +{ + /// + /// The color. + /// + public class Color + { + /// + /// Gets or sets the matrix. + /// + public int Matrix { get; set; } + + /// + /// Gets or sets the primary. + /// + public int Primary { get; set; } + + /// + /// Gets or sets the transfer. + /// + public int Transfer { get; set; } + } } \ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/Duration.cs b/win/CS/HandBrake.Interop/Interop/Json/Scan/Duration.cs similarity index 92% rename from win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/Duration.cs rename to win/CS/HandBrake.Interop/Interop/Json/Scan/Duration.cs index 6ae496901..533ec05ae 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/Duration.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Scan/Duration.cs @@ -1,37 +1,37 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// The duration. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Json.Scan -{ - /// - /// The duration. - /// - public class Duration - { - /// - /// Gets or sets the hours. - /// - public int Hours { get; set; } - - /// - /// Gets or sets the minutes. - /// - public int Minutes { get; set; } - - /// - /// Gets or sets the seconds. - /// - public int Seconds { get; set; } - - /// - /// Gets or sets the ticks. - /// - public long Ticks { get; set; } - } +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The duration. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Json.Scan +{ + /// + /// The duration. + /// + public class Duration + { + /// + /// Gets or sets the hours. + /// + public int Hours { get; set; } + + /// + /// Gets or sets the minutes. + /// + public int Minutes { get; set; } + + /// + /// Gets or sets the seconds. + /// + public int Seconds { get; set; } + + /// + /// Gets or sets the ticks. + /// + public long Ticks { get; set; } + } } \ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/FrameRate.cs b/win/CS/HandBrake.Interop/Interop/Json/Scan/FrameRate.cs similarity index 90% rename from win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/FrameRate.cs rename to win/CS/HandBrake.Interop/Interop/Json/Scan/FrameRate.cs index a85042320..04fa33c37 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/FrameRate.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Scan/FrameRate.cs @@ -1,27 +1,27 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// The frame rate. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Json.Scan -{ - /// - /// The frame rate. - /// - public class FrameRate - { - /// - /// Gets or sets the den. - /// - public int Den { get; set; } - - /// - /// Gets or sets the num. - /// - public int Num { get; set; } - } +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The frame rate. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Json.Scan +{ + /// + /// The frame rate. + /// + public class FrameRate + { + /// + /// Gets or sets the den. + /// + public int Den { get; set; } + + /// + /// Gets or sets the num. + /// + public int Num { get; set; } + } } \ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/JsonScanObject.cs b/win/CS/HandBrake.Interop/Interop/Json/Scan/JsonScanObject.cs similarity index 91% rename from win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/JsonScanObject.cs rename to win/CS/HandBrake.Interop/Interop/Json/Scan/JsonScanObject.cs index 4232ee49f..cc19e4923 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/JsonScanObject.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Scan/JsonScanObject.cs @@ -1,29 +1,29 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// The root object. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Json.Scan -{ - using System.Collections.Generic; - - /// - /// The root object. - /// - public class JsonScanObject - { - /// - /// Gets or sets the main feature. - /// - public int MainFeature { get; set; } - - /// - /// Gets or sets the title list. - /// - public List TitleList { get; set; } - } +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The root object. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Json.Scan +{ + using System.Collections.Generic; + + /// + /// The root object. + /// + public class JsonScanObject + { + /// + /// Gets or sets the main feature. + /// + public int MainFeature { get; set; } + + /// + /// Gets or sets the title list. + /// + public List TitleList { get; set; } + } } \ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SourceAudioTrack.cs b/win/CS/HandBrake.Interop/Interop/Json/Scan/SourceAudioTrack.cs similarity index 93% rename from win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SourceAudioTrack.cs rename to win/CS/HandBrake.Interop/Interop/Json/Scan/SourceAudioTrack.cs index 3cdba5794..e0d9bafd8 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SourceAudioTrack.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Scan/SourceAudioTrack.cs @@ -1,62 +1,62 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// An audio track from the source video. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Json.Scan -{ - /// - /// An audio track from the source video. - /// - public class SourceAudioTrack - { - /// - /// Gets or sets the bit rate. - /// - public int BitRate { get; set; } - - /// - /// Gets or sets the channel layout. - /// - public long ChannelLayout { get; set; } - - /// - /// Gets or sets the description. - /// - public string Description { get; set; } - - /// - /// Gets or sets the language. - /// - public string Language { get; set; } - - /// - /// Gets or sets the language code. - /// - public string LanguageCode { get; set; } - - /// - /// Gets or sets the sample rate. - /// - public int SampleRate { get; set; } - - /// - /// Gets or sets the codec. - /// - public int Codec { get; set; } - - public string CodecName { get; set; } - - public long LFECount { get; set; } - - public string ChannelLayoutName { get; set; } - - public int ChannelCount { get; set; } - - public AudioAttributes Attributes { get; set; } - } +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// An audio track from the source video. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Json.Scan +{ + /// + /// An audio track from the source video. + /// + public class SourceAudioTrack + { + /// + /// Gets or sets the bit rate. + /// + public int BitRate { get; set; } + + /// + /// Gets or sets the channel layout. + /// + public long ChannelLayout { get; set; } + + /// + /// Gets or sets the description. + /// + public string Description { get; set; } + + /// + /// Gets or sets the language. + /// + public string Language { get; set; } + + /// + /// Gets or sets the language code. + /// + public string LanguageCode { get; set; } + + /// + /// Gets or sets the sample rate. + /// + public int SampleRate { get; set; } + + /// + /// Gets or sets the codec. + /// + public int Codec { get; set; } + + public string CodecName { get; set; } + + public long LFECount { get; set; } + + public string ChannelLayoutName { get; set; } + + public int ChannelCount { get; set; } + + public AudioAttributes Attributes { get; set; } + } } \ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SourceChapter.cs b/win/CS/HandBrake.Interop/Interop/Json/Scan/SourceChapter.cs similarity index 91% rename from win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SourceChapter.cs rename to win/CS/HandBrake.Interop/Interop/Json/Scan/SourceChapter.cs index 93b5e1ce3..02e83fe1d 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SourceChapter.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Scan/SourceChapter.cs @@ -1,27 +1,27 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// The a chapter from a video source. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Json.Scan -{ - /// - /// The a chapter from a video source. - /// - public class SourceChapter - { - /// - /// Gets or sets the duration. - /// - public Duration Duration { get; set; } - - /// - /// Gets or sets the name. - /// - public string Name { get; set; } - } +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The a chapter from a video source. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Json.Scan +{ + /// + /// The a chapter from a video source. + /// + public class SourceChapter + { + /// + /// Gets or sets the duration. + /// + public Duration Duration { get; set; } + + /// + /// Gets or sets the name. + /// + public string Name { get; set; } + } } \ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SourceMetadata.cs b/win/CS/HandBrake.Interop/Interop/Json/Scan/SourceMetadata.cs similarity index 91% rename from win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SourceMetadata.cs rename to win/CS/HandBrake.Interop/Interop/Json/Scan/SourceMetadata.cs index f575dc637..240635cc6 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SourceMetadata.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Scan/SourceMetadata.cs @@ -7,7 +7,7 @@ // // -------------------------------------------------------------------------------------------------------------------- -namespace HandBrake.ApplicationServices.Interop.Json.Scan +namespace HandBrake.Interop.Interop.Json.Scan { /// /// The meta data. diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SourceSubtitleTrack.cs b/win/CS/HandBrake.Interop/Interop/Json/Scan/SourceSubtitleTrack.cs similarity index 95% rename from win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SourceSubtitleTrack.cs rename to win/CS/HandBrake.Interop/Interop/Json/Scan/SourceSubtitleTrack.cs index 67be629a2..eaeda2a69 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SourceSubtitleTrack.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Scan/SourceSubtitleTrack.cs @@ -7,7 +7,7 @@ // // -------------------------------------------------------------------------------------------------------------------- -namespace HandBrake.ApplicationServices.Interop.Json.Scan +namespace HandBrake.Interop.Interop.Json.Scan { /// /// The subtitle list. diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SourceTitle.cs b/win/CS/HandBrake.Interop/Interop/Json/Scan/SourceTitle.cs similarity index 93% rename from win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SourceTitle.cs rename to win/CS/HandBrake.Interop/Interop/Json/Scan/SourceTitle.cs index e8f62c8d0..4fd5232ff 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SourceTitle.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Scan/SourceTitle.cs @@ -1,28 +1,28 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// The title list. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Json.Scan -{ - using System.Collections.Generic; - - using HandBrake.ApplicationServices.Interop.Json.Shared; - - /// - /// The title list. - /// - public class SourceTitle - { - /// - /// Gets or sets the angle count. - /// - public int AngleCount { get; set; } - +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The title list. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Json.Scan +{ + using System.Collections.Generic; + + using HandBrake.Interop.Interop.Json.Shared; + + /// + /// The title list. + /// + public class SourceTitle + { + /// + /// Gets or sets the angle count. + /// + public int AngleCount { get; set; } + /// /// Gets or sets the audio list. /// @@ -35,44 +35,44 @@ namespace HandBrake.ApplicationServices.Interop.Json.Scan /// /// Gets or sets the color. - /// - public Color Color { get; set; } - - /// - /// Gets or sets the input file container. - /// - public string Container { get; set; } - - /// - /// Gets or sets the cropping values - /// - public List Crop { get; set; } - - /// - /// Gets or sets the duration. - /// - public Duration Duration { get; set; } - - /// - /// Gets or sets the frame rate. - /// - public FrameRate FrameRate { get; set; } - - /// - /// Gets or sets the geometry. - /// - public Geometry Geometry { get; set; } - - /// - /// Gets or sets the index. - /// - public int Index { get; set; } - - /// - /// Gets or sets a value indicating whether interlace detected. - /// - public bool InterlaceDetected { get; set; } - + /// + public Color Color { get; set; } + + /// + /// Gets or sets the input file container. + /// + public string Container { get; set; } + + /// + /// Gets or sets the cropping values + /// + public List Crop { get; set; } + + /// + /// Gets or sets the duration. + /// + public Duration Duration { get; set; } + + /// + /// Gets or sets the frame rate. + /// + public FrameRate FrameRate { get; set; } + + /// + /// Gets or sets the geometry. + /// + public Geometry Geometry { get; set; } + + /// + /// Gets or sets the index. + /// + public int Index { get; set; } + + /// + /// Gets or sets a value indicating whether interlace detected. + /// + public bool InterlaceDetected { get; set; } + /// /// Gets or sets the meta data. /// @@ -80,19 +80,19 @@ namespace HandBrake.ApplicationServices.Interop.Json.Scan /// /// Gets or sets the name. - /// - public string Name { get; set; } - - /// - /// Gets or sets the path. - /// - public string Path { get; set; } - - /// - /// Gets or sets the playlist. - /// - public int Playlist { get; set; } - + /// + public string Name { get; set; } + + /// + /// Gets or sets the path. + /// + public string Path { get; set; } + + /// + /// Gets or sets the playlist. + /// + public int Playlist { get; set; } + /// /// Gets or sets the subtitle list. /// @@ -100,13 +100,13 @@ namespace HandBrake.ApplicationServices.Interop.Json.Scan /// /// Gets or sets the type. - /// HB_DVD_TYPE = 0, HB_BD_TYPE, HB_STREAM_TYPE, HB_FF_STREAM_TYPE - /// - public int Type { get; set; } - - /// - /// Gets or sets the video codec. - /// - public string VideoCodec { get; set; } - } + /// HB_DVD_TYPE = 0, HB_BD_TYPE, HB_STREAM_TYPE, HB_FF_STREAM_TYPE + /// + public int Type { get; set; } + + /// + /// Gets or sets the video codec. + /// + public string VideoCodec { get; set; } + } } \ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SubtitleAttributes.cs b/win/CS/HandBrake.Interop/Interop/Json/Scan/SubtitleAttributes.cs similarity index 95% rename from win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SubtitleAttributes.cs rename to win/CS/HandBrake.Interop/Interop/Json/Scan/SubtitleAttributes.cs index b22a470be..07ac8b032 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Scan/SubtitleAttributes.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Scan/SubtitleAttributes.cs @@ -7,7 +7,7 @@ // // -------------------------------------------------------------------------------------------------------------------- -namespace HandBrake.ApplicationServices.Interop.Json.Scan +namespace HandBrake.Interop.Interop.Json.Scan { using Newtonsoft.Json; diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Shared/Geometry.cs b/win/CS/HandBrake.Interop/Interop/Json/Shared/Geometry.cs similarity index 91% rename from win/CS/HandBrake.ApplicationServices/Interop/Json/Shared/Geometry.cs rename to win/CS/HandBrake.Interop/Interop/Json/Shared/Geometry.cs index 429deb615..5632b3736 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Shared/Geometry.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Shared/Geometry.cs @@ -1,32 +1,32 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// The geometry. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Json.Shared -{ - /// - /// The geometry. - /// - public class Geometry - { - /// - /// Gets or sets the height. - /// - public int Height { get; set; } - - /// - /// Gets or sets the par. - /// - public PAR PAR { get; set; } - - /// - /// Gets or sets the width. - /// - public int Width { get; set; } - } +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The geometry. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Json.Shared +{ + /// + /// The geometry. + /// + public class Geometry + { + /// + /// Gets or sets the height. + /// + public int Height { get; set; } + + /// + /// Gets or sets the par. + /// + public PAR PAR { get; set; } + + /// + /// Gets or sets the width. + /// + public int Width { get; set; } + } } \ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Shared/PAR.cs b/win/CS/HandBrake.Interop/Interop/Json/Shared/PAR.cs similarity index 90% rename from win/CS/HandBrake.ApplicationServices/Interop/Json/Shared/PAR.cs rename to win/CS/HandBrake.Interop/Interop/Json/Shared/PAR.cs index 503acf2f7..075c26672 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Shared/PAR.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/Shared/PAR.cs @@ -1,27 +1,27 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// The par. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Json.Shared -{ - /// - /// The par. - /// - public class PAR - { - /// - /// Gets or sets the Number. - /// - public int Num { get; set; } - - /// - /// Gets or sets the Denominator. - /// - public int Den { get; set; } - } +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The par. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Json.Shared +{ + /// + /// The par. + /// + public class PAR + { + /// + /// Gets or sets the Number. + /// + public int Num { get; set; } + + /// + /// Gets or sets the Denominator. + /// + public int Den { get; set; } + } } \ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/State/JsonState.cs b/win/CS/HandBrake.Interop/Interop/Json/State/JsonState.cs similarity index 92% rename from win/CS/HandBrake.ApplicationServices/Interop/Json/State/JsonState.cs rename to win/CS/HandBrake.Interop/Interop/Json/State/JsonState.cs index 2309b0d16..6f8513671 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/State/JsonState.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/State/JsonState.cs @@ -1,37 +1,37 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// The hand brake state. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Json.State -{ - /// - /// The hand brake state. - /// - public class JsonState - { - /// - /// Gets or sets the scanning. - /// - public Scanning Scanning { get; set; } - - /// - /// Gets or sets the working. - /// - public Working Working { get; set; } - - /// - /// Gets or sets the work done. - /// - public WorkDone WorkDone { get; set; } - - /// - /// Gets or sets the state. - /// - public string State { get; set; } - } +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The hand brake state. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Json.State +{ + /// + /// The hand brake state. + /// + public class JsonState + { + /// + /// Gets or sets the scanning. + /// + public Scanning Scanning { get; set; } + + /// + /// Gets or sets the working. + /// + public Working Working { get; set; } + + /// + /// Gets or sets the work done. + /// + public WorkDone WorkDone { get; set; } + + /// + /// Gets or sets the state. + /// + public string State { get; set; } + } } \ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/State/Scanning.cs b/win/CS/HandBrake.Interop/Interop/Json/State/Scanning.cs similarity index 92% rename from win/CS/HandBrake.ApplicationServices/Interop/Json/State/Scanning.cs rename to win/CS/HandBrake.Interop/Interop/Json/State/Scanning.cs index 033bef017..4f3cfb22d 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/State/Scanning.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/State/Scanning.cs @@ -1,42 +1,42 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// The scanning. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Json.State -{ - /// - /// The scanning. - /// - public class Scanning - { - /// - /// Gets or sets the preview. - /// - public int Preview { get; set; } - - /// - /// Gets or sets the preview count. - /// - public int PreviewCount { get; set; } - - /// - /// Gets or sets the progress. - /// - public double Progress { get; set; } - - /// - /// Gets or sets the title. - /// - public int Title { get; set; } - - /// - /// Gets or sets the title count. - /// - public int TitleCount { get; set; } - } +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The scanning. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Json.State +{ + /// + /// The scanning. + /// + public class Scanning + { + /// + /// Gets or sets the preview. + /// + public int Preview { get; set; } + + /// + /// Gets or sets the preview count. + /// + public int PreviewCount { get; set; } + + /// + /// Gets or sets the progress. + /// + public double Progress { get; set; } + + /// + /// Gets or sets the title. + /// + public int Title { get; set; } + + /// + /// Gets or sets the title count. + /// + public int TitleCount { get; set; } + } } \ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/State/TaskState.cs b/win/CS/HandBrake.Interop/Interop/Json/State/TaskState.cs similarity index 97% rename from win/CS/HandBrake.ApplicationServices/Interop/Json/State/TaskState.cs rename to win/CS/HandBrake.Interop/Interop/Json/State/TaskState.cs index 168303e1d..5d0f5f92f 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/State/TaskState.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/State/TaskState.cs @@ -7,7 +7,7 @@ // // -------------------------------------------------------------------------------------------------------------------- -namespace HandBrake.ApplicationServices.Interop.Json.State +namespace HandBrake.Interop.Interop.Json.State { using System.Collections.Generic; diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/State/WorkDone.cs b/win/CS/HandBrake.Interop/Interop/Json/State/WorkDone.cs similarity index 90% rename from win/CS/HandBrake.ApplicationServices/Interop/Json/State/WorkDone.cs rename to win/CS/HandBrake.Interop/Interop/Json/State/WorkDone.cs index 76f85ba90..aa821f286 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/State/WorkDone.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/State/WorkDone.cs @@ -1,22 +1,22 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// The work done. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Json.State -{ - /// - /// The work done. - /// - public class WorkDone - { - /// - /// Gets or sets the error. - /// - public int Error { get; set; } - } +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The work done. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Json.State +{ + /// + /// The work done. + /// + public class WorkDone + { + /// + /// Gets or sets the error. + /// + public int Error { get; set; } + } } \ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/State/Working.cs b/win/CS/HandBrake.Interop/Interop/Json/State/Working.cs similarity index 93% rename from win/CS/HandBrake.ApplicationServices/Interop/Json/State/Working.cs rename to win/CS/HandBrake.Interop/Interop/Json/State/Working.cs index 2347eb4c2..a1b7fb0e5 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/State/Working.cs +++ b/win/CS/HandBrake.Interop/Interop/Json/State/Working.cs @@ -1,73 +1,73 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// The working. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Json.State -{ - /// - /// The working. - /// - public class Working - { - /// - /// Gets or sets the hours. - /// - public int Hours { get; set; } - - /// - /// Gets or sets the Pass ID. - /// - /// - /// -1: Subtitle scan - /// 0: Encode - /// 1: Encode first pass - /// 2: Encode second pass - /// - public int PassID { get; set; } - - /// - /// Gets or sets the pass number (1-based). - /// - public int Pass { get; set; } - - /// - /// Gets or sets the pass count. - /// - public int PassCount { get; set; } - - /// - /// Gets or sets the minutes. - /// - public int Minutes { get; set; } - - /// - /// Gets or sets the progress. - /// - public double Progress { get; set; } - - /// - /// Gets or sets the rate. - /// - public double Rate { get; set; } - - /// - /// Gets or sets the rate avg. - /// - public double RateAvg { get; set; } - - /// - /// Gets or sets the seconds. - /// - public int Seconds { get; set; } - - /// - /// Gets or sets the sequence id. - /// - public int SequenceID { get; set; } - } +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The working. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Json.State +{ + /// + /// The working. + /// + public class Working + { + /// + /// Gets or sets the hours. + /// + public int Hours { get; set; } + + /// + /// Gets or sets the Pass ID. + /// + /// + /// -1: Subtitle scan + /// 0: Encode + /// 1: Encode first pass + /// 2: Encode second pass + /// + public int PassID { get; set; } + + /// + /// Gets or sets the pass number (1-based). + /// + public int Pass { get; set; } + + /// + /// Gets or sets the pass count. + /// + public int PassCount { get; set; } + + /// + /// Gets or sets the minutes. + /// + public int Minutes { get; set; } + + /// + /// Gets or sets the progress. + /// + public double Progress { get; set; } + + /// + /// Gets or sets the rate. + /// + public double Rate { get; set; } + + /// + /// Gets or sets the rate avg. + /// + public double RateAvg { get; set; } + + /// + /// Gets or sets the seconds. + /// + public int Seconds { get; set; } + + /// + /// Gets or sets the sequence id. + /// + public int SequenceID { get; set; } + } } \ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/BitrateLimits.cs b/win/CS/HandBrake.Interop/Interop/Model/BitrateLimits.cs similarity index 93% rename from win/CS/HandBrake.ApplicationServices/Interop/Model/BitrateLimits.cs rename to win/CS/HandBrake.Interop/Interop/Model/BitrateLimits.cs index 533c73a5b..91ee98356 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Model/BitrateLimits.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/BitrateLimits.cs @@ -1,42 +1,42 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// Defines the BitrateLimits type. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Model -{ - /// - /// Represents bitrate limits as a range. - /// - public class BitrateLimits - { - /// - /// Initializes a new instance of the class. - /// - /// - /// The low. - /// - /// - /// The high. - /// - public BitrateLimits(int low, int high) - { - this.Low = low; - this.High = high; - } - - /// - /// Gets the inclusive lower limit for the bitrate. - /// - public int Low { get; private set; } - - /// - /// Gets the inclusive upper limit for the bitrate. - /// - public int High { get; private set; } - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Defines the BitrateLimits type. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Model +{ + /// + /// Represents bitrate limits as a range. + /// + public class BitrateLimits + { + /// + /// Initializes a new instance of the class. + /// + /// + /// The low. + /// + /// + /// The high. + /// + public BitrateLimits(int low, int high) + { + this.Low = low; + this.High = high; + } + + /// + /// Gets the inclusive lower limit for the bitrate. + /// + public int Low { get; private set; } + + /// + /// Gets the inclusive upper limit for the bitrate. + /// + public int High { get; private set; } + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Cropping.cs b/win/CS/HandBrake.Interop/Interop/Model/Cropping.cs similarity index 94% rename from win/CS/HandBrake.ApplicationServices/Interop/Model/Cropping.cs rename to win/CS/HandBrake.Interop/Interop/Model/Cropping.cs index 52c9e64d5..63a1b176a 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Cropping.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/Cropping.cs @@ -1,99 +1,99 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// Defines the Cropping type. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Model -{ - /// - /// The Cropping Model - /// - public class Cropping - { - /// - /// Initializes a new instance of the class. - /// - public Cropping() - { - } - - /// - /// Initializes a new instance of the class. - /// Copy Constructor - /// - /// - /// The croping. - /// - public Cropping(Cropping croping) - { - this.Top = croping.Top; - this.Bottom = croping.Bottom; - this.Left = croping.Left; - this.Right = croping.Right; - } - - /// - /// Initializes a new instance of the class. - /// - /// - /// The Top Value - /// - /// - /// The Bottom Value - /// - /// - /// The Left Value - /// - /// - /// The Right Value - /// - public Cropping(int top, int bottom, int left, int right) - { - this.Top = top; - this.Bottom = bottom; - this.Left = left; - this.Right = right; - } - - /// - /// Gets or sets Top. - /// - public int Top { get; set; } - - /// - /// Gets or sets Bottom. - /// - public int Bottom { get; set; } - - /// - /// Gets or sets Left. - /// - public int Left { get; set; } - - /// - /// Gets or sets Right. - /// - public int Right { get; set; } - - /// - /// Clone this model - /// - /// - /// A Cloned copy - /// - public Cropping Clone() - { - return new Cropping - { - Top = this.Top, - Bottom = this.Bottom, - Left = this.Left, - Right = this.Right - }; - } - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Defines the Cropping type. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Model +{ + /// + /// The Cropping Model + /// + public class Cropping + { + /// + /// Initializes a new instance of the class. + /// + public Cropping() + { + } + + /// + /// Initializes a new instance of the class. + /// Copy Constructor + /// + /// + /// The croping. + /// + public Cropping(Cropping croping) + { + this.Top = croping.Top; + this.Bottom = croping.Bottom; + this.Left = croping.Left; + this.Right = croping.Right; + } + + /// + /// Initializes a new instance of the class. + /// + /// + /// The Top Value + /// + /// + /// The Bottom Value + /// + /// + /// The Left Value + /// + /// + /// The Right Value + /// + public Cropping(int top, int bottom, int left, int right) + { + this.Top = top; + this.Bottom = bottom; + this.Left = left; + this.Right = right; + } + + /// + /// Gets or sets Top. + /// + public int Top { get; set; } + + /// + /// Gets or sets Bottom. + /// + public int Bottom { get; set; } + + /// + /// Gets or sets Left. + /// + public int Left { get; set; } + + /// + /// Gets or sets Right. + /// + public int Right { get; set; } + + /// + /// Clone this model + /// + /// + /// A Cloned copy + /// + public Cropping Clone() + { + return new Cropping + { + Top = this.Top, + Bottom = this.Bottom, + Left = this.Left, + Right = this.Right + }; + } + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Anamorphic.cs b/win/CS/HandBrake.Interop/Interop/Model/Encoding/Anamorphic.cs similarity index 86% rename from win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Anamorphic.cs rename to win/CS/HandBrake.Interop/Interop/Model/Encoding/Anamorphic.cs index 26ac4883c..f98875a16 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Anamorphic.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/Encoding/Anamorphic.cs @@ -1,32 +1,32 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// Defines the Anamorphic type. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Model.Encoding -{ - using HandBrake.ApplicationServices.Attributes; - - /// - /// The anamorphic. - /// - public enum Anamorphic - { - [DisplayName("None")] - [ShortName("none")] - None = 0, - [DisplayName("Automatic")] - [ShortName("auto")] - Automatic = 4, - [DisplayName("Loose")] - [ShortName("loose")] - Loose = 2, - [DisplayName("Custom")] - [ShortName("custom")] - Custom = 3 - } +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Defines the Anamorphic type. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Model.Encoding +{ + using HandBrake.Interop.Attributes; + + /// + /// The anamorphic. + /// + public enum Anamorphic + { + [DisplayName("None")] + [ShortName("none")] + None = 0, + [DisplayName("Automatic")] + [ShortName("auto")] + Automatic = 4, + [DisplayName("Loose")] + [ShortName("loose")] + Loose = 2, + [DisplayName("Custom")] + [ShortName("custom")] + Custom = 3 + } } \ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/CombDetect.cs b/win/CS/HandBrake.Interop/Interop/Model/Encoding/CombDetect.cs similarity index 88% rename from win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/CombDetect.cs rename to win/CS/HandBrake.Interop/Interop/Model/Encoding/CombDetect.cs index d98d0d2ec..922cdbc24 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/CombDetect.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/Encoding/CombDetect.cs @@ -7,9 +7,9 @@ // // -------------------------------------------------------------------------------------------------------------------- -namespace HandBrake.ApplicationServices.Interop.Model.Encoding +namespace HandBrake.Interop.Interop.Model.Encoding { - using HandBrake.ApplicationServices.Attributes; + using HandBrake.Interop.Attributes; /// /// The CombDetect Type. diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Container.cs b/win/CS/HandBrake.Interop/Interop/Model/Encoding/Container.cs similarity index 84% rename from win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Container.cs rename to win/CS/HandBrake.Interop/Interop/Model/Encoding/Container.cs index b8eab8dad..8950d2b92 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Container.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/Encoding/Container.cs @@ -1,29 +1,29 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// Defines the Container type. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Model.Encoding -{ - using System; - - using HandBrake.ApplicationServices.Attributes; - - /// - /// The container. - /// - [Flags] - public enum Container - { - None = 0x0, - - [DisplayName("MP4")] - MP4, - [DisplayName("MKV")] - MKV - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Defines the Container type. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Model.Encoding +{ + using System; + + using HandBrake.Interop.Attributes; + + /// + /// The container. + /// + [Flags] + public enum Container + { + None = 0x0, + + [DisplayName("MP4")] + MP4, + [DisplayName("MKV")] + MKV + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Decomb.cs b/win/CS/HandBrake.Interop/Interop/Model/Encoding/Decomb.cs similarity index 85% rename from win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Decomb.cs rename to win/CS/HandBrake.Interop/Interop/Model/Encoding/Decomb.cs index a2b544029..1fe70b421 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Decomb.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/Encoding/Decomb.cs @@ -1,34 +1,34 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// Defines the Decomb type. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Model.Encoding -{ - using HandBrake.ApplicationServices.Attributes; - - /// - /// The decomb. - /// - public enum Decomb - { - [ShortName("default")] - Default, - - [ShortName("bob")] - Bob, - - [ShortName("custom")] - Custom, - - [ShortName("eedi2")] - EEDI2, - - [ShortName("eedi2bob")] - EEDI2Bob - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Defines the Decomb type. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Model.Encoding +{ + using HandBrake.Interop.Attributes; + + /// + /// The decomb. + /// + public enum Decomb + { + [ShortName("default")] + Default, + + [ShortName("bob")] + Bob, + + [ShortName("custom")] + Custom, + + [ShortName("eedi2")] + EEDI2, + + [ShortName("eedi2bob")] + EEDI2Bob + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Deinterlace.cs b/win/CS/HandBrake.Interop/Interop/Model/Encoding/Deinterlace.cs similarity index 85% rename from win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Deinterlace.cs rename to win/CS/HandBrake.Interop/Interop/Model/Encoding/Deinterlace.cs index 162400b5d..07c519a35 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Deinterlace.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/Encoding/Deinterlace.cs @@ -1,31 +1,31 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// Defines the Deinterlace type. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Model.Encoding -{ - using HandBrake.ApplicationServices.Attributes; - - /// - /// The deinterlace. - /// - public enum Deinterlace - { - [ShortName("custom")] - Custom, - - [ShortName("default")] - Default, - - [ShortName("skip-spatial")] - SkipSpatialCheck, - - [ShortName("bob")] - Bob - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Defines the Deinterlace type. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Model.Encoding +{ + using HandBrake.Interop.Attributes; + + /// + /// The deinterlace. + /// + public enum Deinterlace + { + [ShortName("custom")] + Custom, + + [ShortName("default")] + Default, + + [ShortName("skip-spatial")] + SkipSpatialCheck, + + [ShortName("bob")] + Bob + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/DeinterlaceFilter.cs b/win/CS/HandBrake.Interop/Interop/Model/Encoding/DeinterlaceFilter.cs similarity index 87% rename from win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/DeinterlaceFilter.cs rename to win/CS/HandBrake.Interop/Interop/Model/Encoding/DeinterlaceFilter.cs index 03d7bce60..1ebc03cc6 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/DeinterlaceFilter.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/Encoding/DeinterlaceFilter.cs @@ -7,9 +7,9 @@ // // -------------------------------------------------------------------------------------------------------------------- -namespace HandBrake.ApplicationServices.Interop.Model.Encoding +namespace HandBrake.Interop.Interop.Model.Encoding { - using HandBrake.ApplicationServices.Attributes; + using HandBrake.Interop.Attributes; /// /// The deinterlace. diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Denoise.cs b/win/CS/HandBrake.Interop/Interop/Model/Encoding/Denoise.cs similarity index 84% rename from win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Denoise.cs rename to win/CS/HandBrake.Interop/Interop/Model/Encoding/Denoise.cs index 4374372ff..fb6440188 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Denoise.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/Encoding/Denoise.cs @@ -1,28 +1,28 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// Defines the Denoise type. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Model.Encoding -{ - using HandBrake.ApplicationServices.Attributes; - - /// - /// The denoise. - /// - public enum Denoise - { - [ShortName("off")] - Off = 0, - - [ShortName("hqdn3d")] - hqdn3d = 1, - - [ShortName("nlmeans")] - NLMeans = 2, - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Defines the Denoise type. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Model.Encoding +{ + using HandBrake.Interop.Attributes; + + /// + /// The denoise. + /// + public enum Denoise + { + [ShortName("off")] + Off = 0, + + [ShortName("hqdn3d")] + hqdn3d = 1, + + [ShortName("nlmeans")] + NLMeans = 2, + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Detelecine.cs b/win/CS/HandBrake.Interop/Interop/Model/Encoding/Detelecine.cs similarity index 84% rename from win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Detelecine.cs rename to win/CS/HandBrake.Interop/Interop/Model/Encoding/Detelecine.cs index f93c754a4..0aeebdd7c 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Detelecine.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/Encoding/Detelecine.cs @@ -1,26 +1,26 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// Defines the Detelecine type. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Model.Encoding -{ - using HandBrake.ApplicationServices.Attributes; - - /// - /// The detelecine. - /// - public enum Detelecine - { - [ShortName("off")] - Off = 0, - [ShortName("default")] - Default = 2, - [ShortName("custom")] - Custom = 1 - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Defines the Detelecine type. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Model.Encoding +{ + using HandBrake.Interop.Attributes; + + /// + /// The detelecine. + /// + public enum Detelecine + { + [ShortName("off")] + Off = 0, + [ShortName("default")] + Default = 2, + [ShortName("custom")] + Custom = 1 + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/HBAudioEncoder.cs b/win/CS/HandBrake.Interop/Interop/Model/Encoding/HBAudioEncoder.cs similarity index 94% rename from win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/HBAudioEncoder.cs rename to win/CS/HandBrake.Interop/Interop/Model/Encoding/HBAudioEncoder.cs index 2d2e5b26d..4e4f241df 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/HBAudioEncoder.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/Encoding/HBAudioEncoder.cs @@ -1,131 +1,131 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// The hb audio encoder. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Model.Encoding -{ - using HandBrake.ApplicationServices.Interop.HbLib; - - /// - /// The hb audio encoder. - /// - public class HBAudioEncoder - { - /// - /// Initializes a new instance of the class. - /// - /// - /// The compatible containers. - /// - /// - /// The compression limits. - /// - /// - /// The default compression. - /// - /// - /// The default quality. - /// - /// - /// The display name. - /// - /// - /// The id. - /// - /// - /// The quality limits. - /// - /// - /// The short name. - /// - public HBAudioEncoder(int compatibleContainers, RangeLimits compressionLimits, float defaultCompression, float defaultQuality, string displayName, int id, RangeLimits qualityLimits, string shortName) - { - this.CompatibleContainers = compatibleContainers; - this.CompressionLimits = compressionLimits; - this.DefaultCompression = defaultCompression; - this.DefaultQuality = defaultQuality; - this.DisplayName = displayName; - this.Id = id; - this.QualityLimits = qualityLimits; - this.ShortName = shortName; - } - - /// - /// Gets the compatible containers. - /// - public int CompatibleContainers { get; private set; } - - /// - /// Gets the compression limits. - /// - public RangeLimits CompressionLimits { get; private set; } - - /// - /// Gets the default compression. - /// - public float DefaultCompression { get; private set; } - - /// - /// Gets the default quality. - /// - public float DefaultQuality { get; private set; } - - /// - /// Gets the display name. - /// - public string DisplayName { get; private set; } - - /// - /// Gets the id. - /// - public int Id { get; private set; } - - /// - /// Gets a value indicating whether the encoder is passthrough. - /// - public bool IsPassthrough - { - get - { - return (this.Id & NativeConstants.HB_ACODEC_PASS_FLAG) > 0; - } - } - - /// - /// Gets or sets the quality limits. - /// - public RangeLimits QualityLimits { get; set; } - - /// - /// Gets or sets the short name. - /// - public string ShortName { get; set; } - - /// - /// Gets a value indicating whether the encoder supports compression. - /// - public bool SupportsCompression - { - get - { - return this.CompressionLimits.High >= 0; - } - } - - /// - /// Gets a value indicating whether the encoder supports quality. - /// - public bool SupportsQuality - { - get - { - return this.QualityLimits.High >= 0; - } - } - } +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The hb audio encoder. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Model.Encoding +{ + using HandBrake.Interop.Interop.HbLib; + + /// + /// The hb audio encoder. + /// + public class HBAudioEncoder + { + /// + /// Initializes a new instance of the class. + /// + /// + /// The compatible containers. + /// + /// + /// The compression limits. + /// + /// + /// The default compression. + /// + /// + /// The default quality. + /// + /// + /// The display name. + /// + /// + /// The id. + /// + /// + /// The quality limits. + /// + /// + /// The short name. + /// + public HBAudioEncoder(int compatibleContainers, RangeLimits compressionLimits, float defaultCompression, float defaultQuality, string displayName, int id, RangeLimits qualityLimits, string shortName) + { + this.CompatibleContainers = compatibleContainers; + this.CompressionLimits = compressionLimits; + this.DefaultCompression = defaultCompression; + this.DefaultQuality = defaultQuality; + this.DisplayName = displayName; + this.Id = id; + this.QualityLimits = qualityLimits; + this.ShortName = shortName; + } + + /// + /// Gets the compatible containers. + /// + public int CompatibleContainers { get; private set; } + + /// + /// Gets the compression limits. + /// + public RangeLimits CompressionLimits { get; private set; } + + /// + /// Gets the default compression. + /// + public float DefaultCompression { get; private set; } + + /// + /// Gets the default quality. + /// + public float DefaultQuality { get; private set; } + + /// + /// Gets the display name. + /// + public string DisplayName { get; private set; } + + /// + /// Gets the id. + /// + public int Id { get; private set; } + + /// + /// Gets a value indicating whether the encoder is passthrough. + /// + public bool IsPassthrough + { + get + { + return (this.Id & NativeConstants.HB_ACODEC_PASS_FLAG) > 0; + } + } + + /// + /// Gets or sets the quality limits. + /// + public RangeLimits QualityLimits { get; set; } + + /// + /// Gets or sets the short name. + /// + public string ShortName { get; set; } + + /// + /// Gets a value indicating whether the encoder supports compression. + /// + public bool SupportsCompression + { + get + { + return this.CompressionLimits.High >= 0; + } + } + + /// + /// Gets a value indicating whether the encoder supports quality. + /// + public bool SupportsQuality + { + get + { + return this.QualityLimits.High >= 0; + } + } + } } \ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/HBContainer.cs b/win/CS/HandBrake.Interop/Interop/Model/Encoding/HBContainer.cs similarity index 93% rename from win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/HBContainer.cs rename to win/CS/HandBrake.Interop/Interop/Model/Encoding/HBContainer.cs index 832d3513d..487e90362 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/HBContainer.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/Encoding/HBContainer.cs @@ -1,60 +1,60 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// The hb container. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Model.Encoding -{ - /// - /// The hb container. - /// - public class HBContainer - { - /// - /// Initializes a new instance of the class. - /// - /// - /// The default extension. - /// - /// - /// The display name. - /// - /// - /// The id. - /// - /// - /// The short name. - /// - public HBContainer(string defaultExtension, string displayName, int id, string shortName) - { - this.DefaultExtension = defaultExtension; - this.DisplayName = displayName; - this.Id = id; - this.ShortName = shortName; - } - - /// - /// Gets the default extension. - /// - public string DefaultExtension { get; private set; } - - /// - /// Gets the display name. - /// - public string DisplayName { get; private set; } - - /// - /// Gets the id. - /// - public int Id { get; private set; } - - /// - /// Gets the short name. - /// - public string ShortName { get; private set; } - } +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The hb container. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Model.Encoding +{ + /// + /// The hb container. + /// + public class HBContainer + { + /// + /// Initializes a new instance of the class. + /// + /// + /// The default extension. + /// + /// + /// The display name. + /// + /// + /// The id. + /// + /// + /// The short name. + /// + public HBContainer(string defaultExtension, string displayName, int id, string shortName) + { + this.DefaultExtension = defaultExtension; + this.DisplayName = displayName; + this.Id = id; + this.ShortName = shortName; + } + + /// + /// Gets the default extension. + /// + public string DefaultExtension { get; private set; } + + /// + /// Gets the display name. + /// + public string DisplayName { get; private set; } + + /// + /// Gets the id. + /// + public int Id { get; private set; } + + /// + /// Gets the short name. + /// + public string ShortName { get; private set; } + } } \ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/HBMixdown.cs b/win/CS/HandBrake.Interop/Interop/Model/Encoding/HBMixdown.cs similarity index 93% rename from win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/HBMixdown.cs rename to win/CS/HandBrake.Interop/Interop/Model/Encoding/HBMixdown.cs index 04927b9dd..a96724c31 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/HBMixdown.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/Encoding/HBMixdown.cs @@ -1,51 +1,51 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// The hb mixdown. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Model.Encoding -{ - /// - /// The hb mixdown. - /// - public class HBMixdown - { - /// - /// Initializes a new instance of the class. - /// - /// - /// The display name. - /// - /// - /// The id. - /// - /// - /// The short name. - /// - public HBMixdown(string displayName, int id, string shortName) - { - this.DisplayName = displayName; - this.Id = id; - this.ShortName = shortName; - } - - /// - /// Gets the display name. - /// - public string DisplayName { get; private set; } - - /// - /// Gets the id. - /// - public int Id { get; private set; } - - /// - /// Gets the short name. - /// - public string ShortName { get; private set; } - } +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The hb mixdown. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Model.Encoding +{ + /// + /// The hb mixdown. + /// + public class HBMixdown + { + /// + /// Initializes a new instance of the class. + /// + /// + /// The display name. + /// + /// + /// The id. + /// + /// + /// The short name. + /// + public HBMixdown(string displayName, int id, string shortName) + { + this.DisplayName = displayName; + this.Id = id; + this.ShortName = shortName; + } + + /// + /// Gets the display name. + /// + public string DisplayName { get; private set; } + + /// + /// Gets the id. + /// + public int Id { get; private set; } + + /// + /// Gets the short name. + /// + public string ShortName { get; private set; } + } } \ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/HBPresetTune.cs b/win/CS/HandBrake.Interop/Interop/Model/Encoding/HBPresetTune.cs similarity index 95% rename from win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/HBPresetTune.cs rename to win/CS/HandBrake.Interop/Interop/Model/Encoding/HBPresetTune.cs index e3ed4c06a..2954128d7 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/HBPresetTune.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/Encoding/HBPresetTune.cs @@ -7,7 +7,7 @@ // // -------------------------------------------------------------------------------------------------------------------- -namespace HandBrake.ApplicationServices.Interop.Model.Encoding +namespace HandBrake.Interop.Interop.Model.Encoding { /// /// The hb preset tune. diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/HBRate.cs b/win/CS/HandBrake.Interop/Interop/Model/Encoding/HBRate.cs similarity index 92% rename from win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/HBRate.cs rename to win/CS/HandBrake.Interop/Interop/Model/Encoding/HBRate.cs index d3287cddb..ecebb0526 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/HBRate.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/Encoding/HBRate.cs @@ -1,42 +1,42 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// Represents a rate in HandBrake: audio sample rate or video framerate. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Model.Encoding -{ - /// - /// Represents a rate in HandBrake: audio sample rate or video framerate. - /// - public class HBRate - { - /// - /// Initializes a new instance of the class. - /// - /// - /// The name. - /// - /// - /// The rate. - /// - public HBRate(string name, int rate) - { - this.Name = name; - this.Rate = rate; - } - - /// - /// Gets the name to use for this rate. - /// - public string Name { get; private set; } - - /// - /// Gets the raw rate. - /// - public int Rate { get; private set; } - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Represents a rate in HandBrake: audio sample rate or video framerate. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Model.Encoding +{ + /// + /// Represents a rate in HandBrake: audio sample rate or video framerate. + /// + public class HBRate + { + /// + /// Initializes a new instance of the class. + /// + /// + /// The name. + /// + /// + /// The rate. + /// + public HBRate(string name, int rate) + { + this.Name = name; + this.Rate = rate; + } + + /// + /// Gets the name to use for this rate. + /// + public string Name { get; private set; } + + /// + /// Gets the raw rate. + /// + public int Rate { get; private set; } + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/HBVideoEncoder.cs b/win/CS/HandBrake.Interop/Interop/Model/Encoding/HBVideoEncoder.cs similarity index 92% rename from win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/HBVideoEncoder.cs rename to win/CS/HandBrake.Interop/Interop/Model/Encoding/HBVideoEncoder.cs index a1e60b2de..2c064b2be 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/HBVideoEncoder.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/Encoding/HBVideoEncoder.cs @@ -1,109 +1,109 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// The hb video encoder. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Model.Encoding -{ - using System.Collections.Generic; - - using HandBrake.ApplicationServices.Interop.HbLib; - using HandBrake.ApplicationServices.Interop.Helpers; - - /// - /// The hb video encoder. - /// - public class HBVideoEncoder - { - /// - /// Initializes a new instance of the class. - /// - /// - /// The compatible containers. - /// - /// - /// The display name. - /// - /// - /// The id. - /// - /// - /// The short name. - /// - public HBVideoEncoder(int compatibleContainers, string displayName, int id, string shortName) - { - this.CompatibleContainers = compatibleContainers; - this.DisplayName = displayName; - this.Id = id; - this.ShortName = shortName; - } - - /// - /// Gets the compatible containers. - /// - public int CompatibleContainers { get; private set; } - - /// - /// Gets the display name. - /// - public string DisplayName { get; private set; } - - /// - /// Gets the id. - /// - public int Id { get; private set; } - - /// - /// Gets the short name. - /// - public string ShortName { get; private set; } - - /// - /// Gets the list of presets this encoder supports. (null if the encoder doesn't support presets) - /// - public List Presets - { - get - { - return InteropUtilities.ToStringListFromArrayPtr(HBFunctions.hb_video_encoder_get_presets(this.Id)); - } - } - - /// - /// Gets the list of tunes this encoder supports. (null if the encoder doesn't support tunes) - /// - public List Tunes - { - get - { - return InteropUtilities.ToStringListFromArrayPtr(HBFunctions.hb_video_encoder_get_tunes(this.Id)); - } - } - - /// - /// Gets the list of profiles this encoder supports. (null if the encoder doesn't support profiles) - /// - public List Profiles - { - get - { - return InteropUtilities.ToStringListFromArrayPtr(HBFunctions.hb_video_encoder_get_profiles(this.Id)); - } - } - - /// - /// Gets the list of levels this encoder supports. (null if the encoder doesn't support levels) - /// - public List Levels - { - get - { - return InteropUtilities.ToStringListFromArrayPtr(HBFunctions.hb_video_encoder_get_levels(this.Id)); - } - } - } +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The hb video encoder. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Model.Encoding +{ + using System.Collections.Generic; + + using HandBrake.Interop.Interop.HbLib; + using HandBrake.Interop.Interop.Helpers; + + /// + /// The hb video encoder. + /// + public class HBVideoEncoder + { + /// + /// Initializes a new instance of the class. + /// + /// + /// The compatible containers. + /// + /// + /// The display name. + /// + /// + /// The id. + /// + /// + /// The short name. + /// + public HBVideoEncoder(int compatibleContainers, string displayName, int id, string shortName) + { + this.CompatibleContainers = compatibleContainers; + this.DisplayName = displayName; + this.Id = id; + this.ShortName = shortName; + } + + /// + /// Gets the compatible containers. + /// + public int CompatibleContainers { get; private set; } + + /// + /// Gets the display name. + /// + public string DisplayName { get; private set; } + + /// + /// Gets the id. + /// + public int Id { get; private set; } + + /// + /// Gets the short name. + /// + public string ShortName { get; private set; } + + /// + /// Gets the list of presets this encoder supports. (null if the encoder doesn't support presets) + /// + public List Presets + { + get + { + return InteropUtilities.ToStringListFromArrayPtr(HBFunctions.hb_video_encoder_get_presets(this.Id)); + } + } + + /// + /// Gets the list of tunes this encoder supports. (null if the encoder doesn't support tunes) + /// + public List Tunes + { + get + { + return InteropUtilities.ToStringListFromArrayPtr(HBFunctions.hb_video_encoder_get_tunes(this.Id)); + } + } + + /// + /// Gets the list of profiles this encoder supports. (null if the encoder doesn't support profiles) + /// + public List Profiles + { + get + { + return InteropUtilities.ToStringListFromArrayPtr(HBFunctions.hb_video_encoder_get_profiles(this.Id)); + } + } + + /// + /// Gets the list of levels this encoder supports. (null if the encoder doesn't support levels) + /// + public List Levels + { + get + { + return InteropUtilities.ToStringListFromArrayPtr(HBFunctions.hb_video_encoder_get_levels(this.Id)); + } + } + } } \ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/PictureRotation.cs b/win/CS/HandBrake.Interop/Interop/Model/Encoding/PictureRotation.cs similarity index 89% rename from win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/PictureRotation.cs rename to win/CS/HandBrake.Interop/Interop/Model/Encoding/PictureRotation.cs index 76dc2846b..2c0d85b9d 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/PictureRotation.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/Encoding/PictureRotation.cs @@ -1,22 +1,22 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// Possible picture rotations. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Model.Encoding -{ - /// - /// Possible picture rotations. - /// - public enum PictureRotation - { - None = 0, - Clockwise90, - Clockwise180, - Clockwise270 - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Possible picture rotations. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Model.Encoding +{ + /// + /// Possible picture rotations. + /// + public enum PictureRotation + { + None = 0, + Clockwise90, + Clockwise180, + Clockwise270 + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/ScaleMethod.cs b/win/CS/HandBrake.Interop/Interop/Model/Encoding/ScaleMethod.cs similarity index 90% rename from win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/ScaleMethod.cs rename to win/CS/HandBrake.Interop/Interop/Model/Encoding/ScaleMethod.cs index 5d49ec2ae..8f62f3f22 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/ScaleMethod.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/Encoding/ScaleMethod.cs @@ -1,27 +1,27 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// Scaling Method -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Model.Encoding -{ - /// - /// Enumeration of rescaling algorithms. - /// - public enum ScaleMethod - { - /// - /// Standard software scaling. Highest quality. - /// - Lanczos = 0, - - /// - /// OpenCL-assisted bicubic scaling. - /// - Bicubic = 1 - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Scaling Method +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Model.Encoding +{ + /// + /// Enumeration of rescaling algorithms. + /// + public enum ScaleMethod + { + /// + /// Standard software scaling. Highest quality. + /// + Lanczos = 0, + + /// + /// OpenCL-assisted bicubic scaling. + /// + Bicubic = 1 + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Sharpen.cs b/win/CS/HandBrake.Interop/Interop/Model/Encoding/Sharpen.cs similarity index 86% rename from win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Sharpen.cs rename to win/CS/HandBrake.Interop/Interop/Model/Encoding/Sharpen.cs index 7f5b9e75a..5924604fe 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/Sharpen.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/Encoding/Sharpen.cs @@ -7,9 +7,9 @@ // // -------------------------------------------------------------------------------------------------------------------- -namespace HandBrake.ApplicationServices.Interop.Model.Encoding +namespace HandBrake.Interop.Interop.Model.Encoding { - using HandBrake.ApplicationServices.Attributes; + using HandBrake.Interop.Attributes; /// /// The Sharpen. diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/VideoEncodeRateType.cs b/win/CS/HandBrake.Interop/Interop/Model/Encoding/VideoEncodeRateType.cs similarity index 89% rename from win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/VideoEncodeRateType.cs rename to win/CS/HandBrake.Interop/Interop/Model/Encoding/VideoEncodeRateType.cs index beb5ca949..461b3931d 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/VideoEncodeRateType.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/Encoding/VideoEncodeRateType.cs @@ -1,21 +1,21 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// Defines the VideoEncodeRateType type. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Model.Encoding -{ - /// - /// The video encode rate type. - /// - public enum VideoEncodeRateType - { - TargetSize = 0, - AverageBitrate = 1, - ConstantQuality = 2 - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Defines the VideoEncodeRateType type. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Model.Encoding +{ + /// + /// The video encode rate type. + /// + public enum VideoEncodeRateType + { + TargetSize = 0, + AverageBitrate = 1, + ConstantQuality = 2 + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/VideoEncoder.cs b/win/CS/HandBrake.Interop/Interop/Model/Encoding/VideoEncoder.cs similarity index 90% rename from win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/VideoEncoder.cs rename to win/CS/HandBrake.Interop/Interop/Model/Encoding/VideoEncoder.cs index e2b82db1d..68c09d0d1 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Encoding/VideoEncoder.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/Encoding/VideoEncoder.cs @@ -1,71 +1,71 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// The video encoder. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Model.Encoding -{ - using HandBrake.ApplicationServices.Attributes; - - /// - /// The video encoder. - /// - public enum VideoEncoder - { - [DisplayName("H.264 (x264)")] - [ShortName("x264")] - X264 = 0, - - [DisplayName("H.264 10-bit (x264)")] - [ShortName("x264_10bit")] - X264_10, - - [DisplayName("H.264 (Intel QSV)")] - [ShortName("qsv_h264")] - QuickSync, - - [DisplayName("MPEG-4")] - [ShortName("mpeg4")] - FFMpeg, - - [DisplayName("MPEG-2")] - [ShortName("mpeg2")] - FFMpeg2, - - [DisplayName("Theora")] - [ShortName("theora")] - Theora, - - [DisplayName("H.265 (x265)")] - [ShortName("x265")] - X265, - - [DisplayName("H.265 12-bit (x265)")] - [ShortName("x265_12bit")] - X265_12, - - [DisplayName("H.265 10-bit (x265)")] - [ShortName("x265_10bit")] - X265_10, - - [DisplayName("H.265 (Intel QSV)")] - [ShortName("qsv_h265")] - QuickSyncH265, - - [DisplayName("H.265 10-bit (Intel QSV)")] - [ShortName("qsv_h265_10bit")] - QuickSyncH26510b, - - [DisplayName("VP8")] - [ShortName("VP8")] - VP8, - - [DisplayName("VP9")] - [ShortName("VP9")] - VP9 - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The video encoder. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Model.Encoding +{ + using HandBrake.Interop.Attributes; + + /// + /// The video encoder. + /// + public enum VideoEncoder + { + [DisplayName("H.264 (x264)")] + [ShortName("x264")] + X264 = 0, + + [DisplayName("H.264 10-bit (x264)")] + [ShortName("x264_10bit")] + X264_10, + + [DisplayName("H.264 (Intel QSV)")] + [ShortName("qsv_h264")] + QuickSync, + + [DisplayName("MPEG-4")] + [ShortName("mpeg4")] + FFMpeg, + + [DisplayName("MPEG-2")] + [ShortName("mpeg2")] + FFMpeg2, + + [DisplayName("Theora")] + [ShortName("theora")] + Theora, + + [DisplayName("H.265 (x265)")] + [ShortName("x265")] + X265, + + [DisplayName("H.265 12-bit (x265)")] + [ShortName("x265_12bit")] + X265_12, + + [DisplayName("H.265 10-bit (x265)")] + [ShortName("x265_10bit")] + X265_10, + + [DisplayName("H.265 (Intel QSV)")] + [ShortName("qsv_h265")] + QuickSyncH265, + + [DisplayName("H.265 10-bit (Intel QSV)")] + [ShortName("qsv_h265_10bit")] + QuickSyncH26510b, + + [DisplayName("VP8")] + [ShortName("VP8")] + VP8, + + [DisplayName("VP9")] + [ShortName("VP9")] + VP9 + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Language.cs b/win/CS/HandBrake.Interop/Interop/Model/Language.cs similarity index 94% rename from win/CS/HandBrake.ApplicationServices/Interop/Model/Language.cs rename to win/CS/HandBrake.Interop/Interop/Model/Language.cs index a110f2590..5564a434e 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Language.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/Language.cs @@ -1,67 +1,67 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// Represents a language. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Model -{ - /// - /// Represents a language. - /// - public class Language - { - /// - /// Initializes a new instance of the class. - /// - /// - /// The english name. - /// - /// - /// The native name. - /// - /// - /// The code. - /// - public Language(string englishName, string nativeName, string code) - { - this.EnglishName = englishName; - this.NativeName = nativeName; - this.Code = code; - } - - /// - /// Gets the english name of the language. - /// - public string EnglishName { get; private set; } - - /// - /// Gets the native name of the language. - /// - public string NativeName { get; private set; } - - /// - /// Gets the language code. - /// - public string Code { get; private set; } - - /// - /// Gets the display string for the language. - /// - public string Display - { - get - { - if (!string.IsNullOrEmpty(this.NativeName) && this.NativeName != this.EnglishName) - { - return this.EnglishName + " (" + this.NativeName + ")"; - } - - return this.EnglishName; - } - } - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Represents a language. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Model +{ + /// + /// Represents a language. + /// + public class Language + { + /// + /// Initializes a new instance of the class. + /// + /// + /// The english name. + /// + /// + /// The native name. + /// + /// + /// The code. + /// + public Language(string englishName, string nativeName, string code) + { + this.EnglishName = englishName; + this.NativeName = nativeName; + this.Code = code; + } + + /// + /// Gets the english name of the language. + /// + public string EnglishName { get; private set; } + + /// + /// Gets the native name of the language. + /// + public string NativeName { get; private set; } + + /// + /// Gets the language code. + /// + public string Code { get; private set; } + + /// + /// Gets the display string for the language. + /// + public string Display + { + get + { + if (!string.IsNullOrEmpty(this.NativeName) && this.NativeName != this.EnglishName) + { + return this.EnglishName + " (" + this.NativeName + ")"; + } + + return this.EnglishName; + } + } + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Preview/PreviewSettings.cs b/win/CS/HandBrake.Interop/Interop/Model/Preview/PreviewSettings.cs similarity index 94% rename from win/CS/HandBrake.ApplicationServices/Interop/Model/Preview/PreviewSettings.cs rename to win/CS/HandBrake.Interop/Interop/Model/Preview/PreviewSettings.cs index b3c330a7c..beebc12f5 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Preview/PreviewSettings.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/Preview/PreviewSettings.cs @@ -1,81 +1,81 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// The preview settings. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Model.Preview -{ - using Encoding; - - /// - /// The preview settings. - /// - public class PreviewSettings - { - /// - /// Initializes a new instance of the class. - /// - public PreviewSettings() - { - } - - /// - /// Gets or sets the cropping. - /// - public Cropping Cropping { get; set; } - - /// - /// Gets or sets the max width. - /// - public int MaxWidth { get; set; } - - /// - /// Gets or sets the max height. - /// - public int MaxHeight { get; set; } - - /// - /// Gets or sets a value indicating whether keep display aspect. - /// - public bool KeepDisplayAspect { get; set; } - - /// - /// Gets or sets the title number. - /// - public int TitleNumber { get; set; } - - /// - /// Gets or sets the anamorphic. - /// - public Anamorphic Anamorphic { get; set; } - - /// - /// Gets or sets the modulus. - /// - public int? Modulus { get; set; } - - /// - /// Gets or sets the width. - /// - public int Width { get; set; } - - /// - /// Gets or sets the height. - /// - public int Height { get; set; } - - /// - /// Gets or sets the pixel aspect x. - /// - public int PixelAspectX { get; set; } - - /// - /// Gets or sets the pixel aspect y. - /// - public int PixelAspectY { get; set; } - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The preview settings. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Model.Preview +{ + using Encoding; + + /// + /// The preview settings. + /// + public class PreviewSettings + { + /// + /// Initializes a new instance of the class. + /// + public PreviewSettings() + { + } + + /// + /// Gets or sets the cropping. + /// + public Cropping Cropping { get; set; } + + /// + /// Gets or sets the max width. + /// + public int MaxWidth { get; set; } + + /// + /// Gets or sets the max height. + /// + public int MaxHeight { get; set; } + + /// + /// Gets or sets a value indicating whether keep display aspect. + /// + public bool KeepDisplayAspect { get; set; } + + /// + /// Gets or sets the title number. + /// + public int TitleNumber { get; set; } + + /// + /// Gets or sets the anamorphic. + /// + public Anamorphic Anamorphic { get; set; } + + /// + /// Gets or sets the modulus. + /// + public int? Modulus { get; set; } + + /// + /// Gets or sets the width. + /// + public int Width { get; set; } + + /// + /// Gets or sets the height. + /// + public int Height { get; set; } + + /// + /// Gets or sets the pixel aspect x. + /// + public int PixelAspectX { get; set; } + + /// + /// Gets or sets the pixel aspect y. + /// + public int PixelAspectY { get; set; } + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Preview/RawPreviewData.cs b/win/CS/HandBrake.Interop/Interop/Model/Preview/RawPreviewData.cs similarity index 94% rename from win/CS/HandBrake.ApplicationServices/Interop/Model/Preview/RawPreviewData.cs rename to win/CS/HandBrake.Interop/Interop/Model/Preview/RawPreviewData.cs index 2da2dc52d..8768d0054 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Preview/RawPreviewData.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/Preview/RawPreviewData.cs @@ -4,7 +4,7 @@ // // -------------------------------------------------------------------------------------------------------------------- -namespace HandBrake.ApplicationServices.Interop.Model.Preview +namespace HandBrake.Interop.Interop.Model.Preview { public class RawPreviewData { diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/RangeLimits.cs b/win/CS/HandBrake.Interop/Interop/Model/RangeLimits.cs similarity index 94% rename from win/CS/HandBrake.ApplicationServices/Interop/Model/RangeLimits.cs rename to win/CS/HandBrake.Interop/Interop/Model/RangeLimits.cs index b25c610dd..3a05f8e38 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Model/RangeLimits.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/RangeLimits.cs @@ -1,60 +1,60 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// The range limits. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Model -{ - /// - /// The range limits. - /// - public class RangeLimits - { - /// - /// Initializes a new instance of the class. - /// - /// - /// The ascending. - /// - /// - /// The granularity. - /// - /// - /// The high. - /// - /// - /// The low. - /// - public RangeLimits(bool @ascending, float granularity, float high, float low) - { - this.Ascending = @ascending; - this.Granularity = granularity; - this.High = high; - this.Low = low; - } - - /// - /// Gets a value indicating whether ascending. - /// - public bool Ascending { get; private set; } - - /// - /// Gets the granularity. - /// - public float Granularity { get; private set; } - - /// - /// Gets the high. - /// - public float High { get; private set; } - - /// - /// Gets the low. - /// - public float Low { get; private set; } - } +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The range limits. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Model +{ + /// + /// The range limits. + /// + public class RangeLimits + { + /// + /// Initializes a new instance of the class. + /// + /// + /// The ascending. + /// + /// + /// The granularity. + /// + /// + /// The high. + /// + /// + /// The low. + /// + public RangeLimits(bool @ascending, float granularity, float high, float low) + { + this.Ascending = @ascending; + this.Granularity = granularity; + this.High = high; + this.Low = low; + } + + /// + /// Gets a value indicating whether ascending. + /// + public bool Ascending { get; private set; } + + /// + /// Gets the granularity. + /// + public float Granularity { get; private set; } + + /// + /// Gets the high. + /// + public float High { get; private set; } + + /// + /// Gets the low. + /// + public float Low { get; private set; } + } } \ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/Size.cs b/win/CS/HandBrake.Interop/Interop/Model/Size.cs similarity index 93% rename from win/CS/HandBrake.ApplicationServices/Interop/Model/Size.cs rename to win/CS/HandBrake.Interop/Interop/Model/Size.cs index 4a4e09d34..6113b8bcf 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Model/Size.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/Size.cs @@ -1,60 +1,60 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// Defines the Size type. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Model -{ - /// - /// The size. - /// - public class Size - { - /// - /// Initializes a new instance of the class. - /// - /// - /// The width. - /// - /// - /// The height. - /// - public Size(int width, int height) - { - this.Width = width; - this.Height = height; - } - - /// - /// Gets the height. - /// - public int Height { get; private set; } - - /// - /// Gets the width. - /// - public int Width { get; private set; } - - /// - /// Gets a value indicating whether is empty. - /// - public bool IsEmpty - { - get - { - if (this.Width <= 0 && this.Height <= 0) - { - return true; - } - else - { - return false; - } - } - } - } +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Defines the Size type. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Model +{ + /// + /// The size. + /// + public class Size + { + /// + /// Initializes a new instance of the class. + /// + /// + /// The width. + /// + /// + /// The height. + /// + public Size(int width, int height) + { + this.Width = width; + this.Height = height; + } + + /// + /// Gets the height. + /// + public int Height { get; private set; } + + /// + /// Gets the width. + /// + public int Width { get; private set; } + + /// + /// Gets a value indicating whether is empty. + /// + public bool IsEmpty + { + get + { + if (this.Width <= 0 && this.Height <= 0) + { + return true; + } + else + { + return false; + } + } + } + } } \ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/SourceVideoInfo.cs b/win/CS/HandBrake.Interop/Interop/Model/SourceVideoInfo.cs similarity index 93% rename from win/CS/HandBrake.ApplicationServices/Interop/Model/SourceVideoInfo.cs rename to win/CS/HandBrake.Interop/Interop/Model/SourceVideoInfo.cs index 4a0ffd2ec..23b43df79 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Model/SourceVideoInfo.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/SourceVideoInfo.cs @@ -1,42 +1,42 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// The source framerate info. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Model -{ - /// - /// The source framerate info. - /// - public class SourceVideoInfo - { - /// - /// Initializes a new instance of the class. - /// - /// - /// The resolution. - /// - /// - /// The par val. - /// - public SourceVideoInfo(Size resolution, Size parVal) - { - this.Resolution = resolution; - this.ParVal = parVal; - } - - /// - /// Gets the resolution (width/height) of this Title - /// - public Size Resolution { get; private set; } - - /// - /// Gets the pixel aspect ratio. - /// - public Size ParVal { get; private set; } - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The source framerate info. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Model +{ + /// + /// The source framerate info. + /// + public class SourceVideoInfo + { + /// + /// Initializes a new instance of the class. + /// + /// + /// The resolution. + /// + /// + /// The par val. + /// + public SourceVideoInfo(Size resolution, Size parVal) + { + this.Resolution = resolution; + this.ParVal = parVal; + } + + /// + /// Gets the resolution (width/height) of this Title + /// + public Size Resolution { get; private set; } + + /// + /// Gets the pixel aspect ratio. + /// + public Size ParVal { get; private set; } + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Model/VideoQualityLimits.cs b/win/CS/HandBrake.Interop/Interop/Model/VideoQualityLimits.cs similarity index 94% rename from win/CS/HandBrake.ApplicationServices/Interop/Model/VideoQualityLimits.cs rename to win/CS/HandBrake.Interop/Interop/Model/VideoQualityLimits.cs index 19a0755af..64fbd6f4f 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Model/VideoQualityLimits.cs +++ b/win/CS/HandBrake.Interop/Interop/Model/VideoQualityLimits.cs @@ -1,60 +1,60 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// Defines the VideoQualityLimits type. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Interop.Model -{ - /// - /// Represents limits on video quality for a particular encoder. - /// - public class VideoQualityLimits - { - /// - /// Initializes a new instance of the class. - /// - /// - /// The low. - /// - /// - /// The high. - /// - /// - /// The granularity. - /// - /// - /// The ascending. - /// - public VideoQualityLimits(float low, float high, float granularity, bool @ascending) - { - this.Low = low; - this.High = high; - this.Granularity = granularity; - this.Ascending = @ascending; - } - - /// - /// Gets the inclusive lower limit for the quality. - /// - public float Low { get; private set; } - - /// - /// Gets the inclusive upper limit for the quality. - /// - public float High { get; private set; } - - /// - /// Gets the granularity for the quality. - /// - public float Granularity { get; private set; } - - /// - /// Gets a value indicating whether the quality increases as the number increases. - /// - public bool Ascending { get; private set; } - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Defines the VideoQualityLimits type. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Interop.Model +{ + /// + /// Represents limits on video quality for a particular encoder. + /// + public class VideoQualityLimits + { + /// + /// Initializes a new instance of the class. + /// + /// + /// The low. + /// + /// + /// The high. + /// + /// + /// The granularity. + /// + /// + /// The ascending. + /// + public VideoQualityLimits(float low, float high, float granularity, bool @ascending) + { + this.Low = low; + this.High = high; + this.Granularity = granularity; + this.Ascending = @ascending; + } + + /// + /// Gets the inclusive lower limit for the quality. + /// + public float Low { get; private set; } + + /// + /// Gets the inclusive upper limit for the quality. + /// + public float High { get; private set; } + + /// + /// Gets the granularity for the quality. + /// + public float Granularity { get; private set; } + + /// + /// Gets a value indicating whether the quality increases as the number increases. + /// + public bool Ascending { get; private set; } + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Model/HBConfiguration.cs b/win/CS/HandBrake.Interop/Model/HBConfiguration.cs similarity index 95% rename from win/CS/HandBrake.ApplicationServices/Model/HBConfiguration.cs rename to win/CS/HandBrake.Interop/Model/HBConfiguration.cs index fd8c97ea3..a9c59c8b4 100644 --- a/win/CS/HandBrake.ApplicationServices/Model/HBConfiguration.cs +++ b/win/CS/HandBrake.Interop/Model/HBConfiguration.cs @@ -1,67 +1,67 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// HandBrakes Configuration options -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Model -{ - /// - /// HandBrakes configuration options - /// - public class HBConfiguration - { - /// - /// Gets or sets a value indicating whether is dvd nav disabled. - /// - public bool IsDvdNavDisabled { get; set; } - - /// - /// Gets or sets a value indicating whether disable quick sync decoding. - /// - public bool EnableQuickSyncDecoding { get; set; } - - /// - /// Gets or sets a value indicating whether use qsv decode for non qsv enc. - /// - public bool UseQSVDecodeForNonQSVEnc { get; set; } - - /// - /// Gets or sets the scaling mode. - /// - public VideoScaler ScalingMode { get; set; } - - /// - /// Gets or sets the preview scan count. - /// - public int PreviewScanCount { get; set; } - - /// - /// Gets or sets the verbosity. - /// - public int Verbosity { get; set; } - - /// - /// Gets or sets the min scan duration. - /// - public int MinScanDuration { get; set; } - - /// - /// Gets or sets a value indicating whether save log to copy directory. - /// - public bool SaveLogToCopyDirectory { get; set; } - - /// - /// Gets or sets a value indicating whether save log with video. - /// - public bool SaveLogWithVideo { get; set; } - - /// - /// Gets or sets the save log copy directory. - /// - public string SaveLogCopyDirectory { get; set; } - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// HandBrakes Configuration options +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Model +{ + /// + /// HandBrakes configuration options + /// + public class HBConfiguration + { + /// + /// Gets or sets a value indicating whether is dvd nav disabled. + /// + public bool IsDvdNavDisabled { get; set; } + + /// + /// Gets or sets a value indicating whether disable quick sync decoding. + /// + public bool EnableQuickSyncDecoding { get; set; } + + /// + /// Gets or sets a value indicating whether use qsv decode for non qsv enc. + /// + public bool UseQSVDecodeForNonQSVEnc { get; set; } + + /// + /// Gets or sets the scaling mode. + /// + public VideoScaler ScalingMode { get; set; } + + /// + /// Gets or sets the preview scan count. + /// + public int PreviewScanCount { get; set; } + + /// + /// Gets or sets the verbosity. + /// + public int Verbosity { get; set; } + + /// + /// Gets or sets the min scan duration. + /// + public int MinScanDuration { get; set; } + + /// + /// Gets or sets a value indicating whether save log to copy directory. + /// + public bool SaveLogToCopyDirectory { get; set; } + + /// + /// Gets or sets a value indicating whether save log with video. + /// + public bool SaveLogWithVideo { get; set; } + + /// + /// Gets or sets the save log copy directory. + /// + public string SaveLogCopyDirectory { get; set; } + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Model/VideoScaler.cs b/win/CS/HandBrake.Interop/Model/VideoScaler.cs similarity index 86% rename from win/CS/HandBrake.ApplicationServices/Model/VideoScaler.cs rename to win/CS/HandBrake.Interop/Model/VideoScaler.cs index 4f407881c..03a19fcf3 100644 --- a/win/CS/HandBrake.ApplicationServices/Model/VideoScaler.cs +++ b/win/CS/HandBrake.Interop/Model/VideoScaler.cs @@ -1,23 +1,23 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// The different scaling modes available in HandBrake -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Model -{ - using HandBrake.ApplicationServices.Attributes; - - /// - /// The different scaling modes available in HandBrake - /// - public enum VideoScaler - { - [DisplayName("Lanczos (default)")] - [ShortName("swscale")] - Lanczos = 0, - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The different scaling modes available in HandBrake +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Model +{ + using HandBrake.Interop.Attributes; + + /// + /// The different scaling modes available in HandBrake + /// + public enum VideoScaler + { + [DisplayName("Lanczos (default)")] + [ShortName("swscale")] + Lanczos = 0, + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Properties/AssemblyInfo.cs b/win/CS/HandBrake.Interop/Properties/AssemblyInfo.cs similarity index 95% rename from win/CS/HandBrake.ApplicationServices/Properties/AssemblyInfo.cs rename to win/CS/HandBrake.Interop/Properties/AssemblyInfo.cs index c147f3bca..c15a66b8a 100644 --- a/win/CS/HandBrake.ApplicationServices/Properties/AssemblyInfo.cs +++ b/win/CS/HandBrake.Interop/Properties/AssemblyInfo.cs @@ -1,47 +1,47 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// Assembly Info -// -// -// -------------------------------------------------------------------------------------------------------------------- - -using System.Reflection; -using System.Resources; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("HandBrake LibHB Wrapper")] -[assembly: AssemblyDescription("HandBrake is a GPL-licensed, multiplatform, multithreaded video transcoder.")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("HandBrake Team")] -[assembly: AssemblyProduct("HandBrake")] -[assembly: AssemblyCopyright("Copyright © 2003-2018 HandBrake Team")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("5e4e3f97-5252-41f6-aae9-3846f62cbc66")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.2.0.0")] -[assembly: NeutralResourcesLanguage("")] +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Assembly Info +// +// +// -------------------------------------------------------------------------------------------------------------------- + +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("HandBrake.Interop")] +[assembly: AssemblyDescription("HandBrake is a GPL-licensed, multiplatform, multithreaded video transcoder.")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("HandBrake Team")] +[assembly: AssemblyProduct("HandBrake")] +[assembly: AssemblyCopyright("Copyright © 2003-2018 HandBrake Team")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("5e4e3f97-5252-41f6-aae9-3846f62cbc66")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.2.0.0")] +[assembly: NeutralResourcesLanguage("")] diff --git a/win/CS/HandBrake.ApplicationServices/Properties/Resources.Designer.cs b/win/CS/HandBrake.Interop/Properties/Resources.Designer.cs similarity index 91% rename from win/CS/HandBrake.ApplicationServices/Properties/Resources.Designer.cs rename to win/CS/HandBrake.Interop/Properties/Resources.Designer.cs index 32976b8b7..c288971f6 100644 --- a/win/CS/HandBrake.ApplicationServices/Properties/Resources.Designer.cs +++ b/win/CS/HandBrake.Interop/Properties/Resources.Designer.cs @@ -1,63 +1,63 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace HandBrake.ApplicationServices.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("HandBrake.ApplicationServices.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - } -} +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace HandBrake.Interop.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("HandBrake.Interop.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Properties/Resources.resx b/win/CS/HandBrake.Interop/Properties/Resources.resx similarity index 97% rename from win/CS/HandBrake.ApplicationServices/Properties/Resources.resx rename to win/CS/HandBrake.Interop/Properties/Resources.resx index 29dcb1b3a..1af7de150 100644 --- a/win/CS/HandBrake.ApplicationServices/Properties/Resources.resx +++ b/win/CS/HandBrake.Interop/Properties/Resources.resx @@ -1,120 +1,120 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + \ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/CharCodesUtilities.cs b/win/CS/HandBrake.Interop/Utilities/CharCodesUtilities.cs similarity index 94% rename from win/CS/HandBrake.ApplicationServices/Utilities/CharCodesUtilities.cs rename to win/CS/HandBrake.Interop/Utilities/CharCodesUtilities.cs index 8470927f6..ced240bb7 100644 --- a/win/CS/HandBrake.ApplicationServices/Utilities/CharCodesUtilities.cs +++ b/win/CS/HandBrake.Interop/Utilities/CharCodesUtilities.cs @@ -1,63 +1,63 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// Char Codes -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Utilities -{ - using System.Collections.Generic; - - /// - /// Char Codes - /// - public class CharCodesUtilities - { - /// - /// Get a command subset of character codes. - /// - /// - /// A String List of Character codes. - /// - public static List GetCharacterCodes() - { - return new List - { - "ANSI_X3.4-1968", - "ANSI_X3.4-1986", - "ANSI_X3.4", - "ANSI_X3.110-1983", - "ANSI_X3.110", - "ASCII", - "ECMA-114", - "ECMA-118", - "ECMA-128", - "ECMA-CYRILLIC", - "IEC_P27-1", - "ISO-8859-1", - "ISO-8859-2", - "ISO-8859-3", - "ISO-8859-4", - "ISO-8859-5", - "ISO-8859-6", - "ISO-8859-7", - "ISO-8859-8", - "ISO-8859-9", - "ISO-8859-9E", - "ISO-8859-10", - "ISO-8859-11", - "ISO-8859-13", - "ISO-8859-14", - "ISO-8859-15", - "ISO-8859-16", - "UTF-7", - "UTF-8", - "UTF-16", - "UTF-32" - }; - } - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Char Codes +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Utilities +{ + using System.Collections.Generic; + + /// + /// Char Codes + /// + public class CharCodesUtilities + { + /// + /// Get a command subset of character codes. + /// + /// + /// A String List of Character codes. + /// + public static List GetCharacterCodes() + { + return new List + { + "ANSI_X3.4-1968", + "ANSI_X3.4-1986", + "ANSI_X3.4", + "ANSI_X3.110-1983", + "ANSI_X3.110", + "ASCII", + "ECMA-114", + "ECMA-118", + "ECMA-128", + "ECMA-CYRILLIC", + "IEC_P27-1", + "ISO-8859-1", + "ISO-8859-2", + "ISO-8859-3", + "ISO-8859-4", + "ISO-8859-5", + "ISO-8859-6", + "ISO-8859-7", + "ISO-8859-8", + "ISO-8859-9", + "ISO-8859-9E", + "ISO-8859-10", + "ISO-8859-11", + "ISO-8859-13", + "ISO-8859-14", + "ISO-8859-15", + "ISO-8859-16", + "UTF-7", + "UTF-8", + "UTF-16", + "UTF-32" + }; + } + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/LanguageUtilities.cs b/win/CS/HandBrake.Interop/Utilities/LanguageUtilities.cs similarity index 96% rename from win/CS/HandBrake.ApplicationServices/Utilities/LanguageUtilities.cs rename to win/CS/HandBrake.Interop/Utilities/LanguageUtilities.cs index d8a3c0854..49c16c818 100644 --- a/win/CS/HandBrake.ApplicationServices/Utilities/LanguageUtilities.cs +++ b/win/CS/HandBrake.Interop/Utilities/LanguageUtilities.cs @@ -1,312 +1,312 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// Language Utilities -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Utilities -{ - using System.Collections.Generic; - using System.Linq; - - /// - /// Language Utilities - /// - public class LanguageUtilities - { - /// - /// The language map. - /// - private static IDictionary languageMap; - - /// - /// Map languages and their iso639_2 value into a IDictionary - /// - /// A Dictionary containing the language and iso code - public static IDictionary MapLanguages() - { - if (languageMap != null) - { - return languageMap; - } - - languageMap = new Dictionary - { - { "(Any)", "und" }, - { "Afar", "aar" }, - { "Abkhazian", "abk" }, - { "Afrikaans", "afr" }, - { "Akan", "aka" }, - { "Albanian", "sqi" }, - { "Amharic", "amh" }, - { "Arabic", "ara" }, - { "Aragonese", "arg" }, - { "Armenian", "hye" }, - { "Assamese", "asm" }, - { "Avaric", "ava" }, - { "Avestan", "ave" }, - { "Aymara", "aym" }, - { "Azerbaijani", "aze" }, - { "Bashkir", "bak" }, - { "Bambara", "bam" }, - { "Basque", "eus" }, - { "Belarusian", "bel" }, - { "Bengali", "ben" }, - { "Bihari", "bih" }, - { "Bislama", "bis" }, - { "Bosnian", "bos" }, - { "Breton", "bre" }, - { "Bulgarian", "bul" }, - { "Burmese", "mya" }, - { "Catalan", "cat" }, - { "Chamorro", "cha" }, - { "Chechen", "che" }, - { "Chinese", "zho" }, - { "Church Slavic", "chu" }, - { "Chuvash", "chv" }, - { "Cornish", "cor" }, - { "Corsican", "cos" }, - { "Cree", "cre" }, - { "Czech", "ces" }, - { "Dansk", "dan" }, - { "Divehi", "div" }, - { "Nederlands", "nld" }, - { "Dzongkha", "dzo" }, - { "English", "eng" }, - { "Esperanto", "epo" }, - { "Estonian", "est" }, - { "Ewe", "ewe" }, - { "Faroese", "fao" }, - { "Fijian", "fij" }, - { "Suomi", "fin" }, - { "Francais", "fra" }, - { "Western Frisian", "fry" }, - { "Fulah", "ful" }, - { "Georgian", "kat" }, - { "Deutsch", "deu" }, - { "Gaelic (Scots)", "gla" }, - { "Irish", "gle" }, - { "Galician", "glg" }, - { "Manx", "glv" }, - { "Greek, Modern", "ell" }, - { "Guarani", "grn" }, - { "Gujarati", "guj" }, - { "Haitian", "hat" }, - { "Hausa", "hau" }, - { "Hebrew", "heb" }, - { "Herero", "her" }, - { "Hindi", "hin" }, - { "Hiri Motu", "hmo" }, - { "Magyar", "hun" }, - { "Igbo", "ibo" }, - { "Islenska", "isl" }, - { "Ido", "ido" }, - { "Sichuan Yi", "iii" }, - { "Inuktitut", "iku" }, - { "Interlingue", "ile" }, - { "Interlingua", "ina" }, - { "Indonesian", "ind" }, - { "Inupiaq", "ipk" }, - { "Italiano", "ita" }, - { "Javanese", "jav" }, - { "Japanese", "jpn" }, - { "Kalaallisut", "kal" }, - { "Kannada", "kan" }, - { "Kashmiri", "kas" }, - { "Kanuri", "kau" }, - { "Kazakh", "kaz" }, - { "Central Khmer", "khm" }, - { "Kikuyu", "kik" }, - { "Kinyarwanda", "kin" }, - { "Kirghiz", "kir" }, - { "Komi", "kom" }, - { "Kongo", "kon" }, - { "Korean", "kor" }, - { "Kuanyama", "kua" }, - { "Kurdish", "kur" }, - { "Lao", "lao" }, - { "Latin", "lat" }, - { "Latvian", "lav" }, - { "Limburgan", "lim" }, - { "Lingala", "lin" }, - { "Lithuanian", "lit" }, - { "Luxembourgish", "ltz" }, - { "Luba-Katanga", "lub" }, - { "Ganda", "lug" }, - { "Macedonian", "mkd" }, - { "Marshallese", "mah" }, - { "Malayalam", "mal" }, - { "Maori", "mri" }, - { "Marathi", "mar" }, - { "Malay", "msa" }, - { "Malagasy", "mlg" }, - { "Maltese", "mlt" }, - { "Moldavian", "mol" }, - { "Mongolian", "mon" }, - { "Nauru", "nau" }, - { "Navajo", "nav" }, - { "Ndebele, South", "nbl" }, - { "Ndebele, North", "nde" }, - { "Ndonga", "ndo" }, - { "Nepali", "nep" }, - { "Norwegian Nynorsk", "nno" }, - { "Norwegian Bokmål", "nob" }, - { "Norsk", "nor" }, - { "Chichewa; Nyanja", "nya" }, - { "Occitan", "oci" }, - { "Ojibwa", "oji" }, - { "Oriya", "ori" }, - { "Oromo", "orm" }, - { "Ossetian", "oss" }, - { "Panjabi", "pan" }, - { "Persian", "fas" }, - { "Pali", "pli" }, - { "Polish", "pol" }, - { "Portuguese", "por" }, - { "Pushto", "pus" }, - { "Quechua", "que" }, - { "Romansh", "roh" }, - { "Romanian", "ron" }, - { "Rundi", "run" }, - { "Russian", "rus" }, - { "Sango", "sag" }, - { "Sanskrit", "san" }, - { "Serbian", "srp" }, - { "Hrvatski", "hrv" }, - { "Sinhala", "sin" }, - { "Slovak", "slk" }, - { "Slovenian", "slv" }, - { "Northern Sami", "sme" }, - { "Samoan", "smo" }, - { "Shona", "sna" }, - { "Sindhi", "snd" }, - { "Somali", "som" }, - { "Sotho Southern", "sot" }, - { "Espanol", "spa" }, - { "Sardinian", "srd" }, - { "Swati", "ssw" }, - { "Sundanese", "sun" }, - { "Swahili", "swa" }, - { "Svenska", "swe" }, - { "Tahitian", "tah" }, - { "Tamil", "tam" }, - { "Tatar", "tat" }, - { "Telugu", "tel" }, - { "Tajik", "tgk" }, - { "Tagalog", "tgl" }, - { "Thai", "tha" }, - { "Tibetan", "bod" }, - { "Tigrinya", "tir" }, - { "Tonga", "ton" }, - { "Tswana", "tsn" }, - { "Tsonga", "tso" }, - { "Turkmen", "tuk" }, - { "Turkish", "tur" }, - { "Twi", "twi" }, - { "Uighur", "uig" }, - { "Ukrainian", "ukr" }, - { "Urdu", "urd" }, - { "Uzbek", "uzb" }, - { "Venda", "ven" }, - { "Vietnamese", "vie" }, - { "Volapük", "vol" }, - { "Welsh", "cym" }, - { "Walloon", "wln" }, - { "Wolof", "wol" }, - { "Xhosa", "xho" }, - { "Yiddish", "yid" }, - { "Yoruba", "yor" }, - { "Zhuang", "zha" }, - { "Zulu", "zul" } - }; - - return languageMap; - } - - /// - /// The get language codes. - /// - /// - /// The user languages. - /// - /// - /// The . - /// - public static List GetLanguageCodes(IEnumerable userLanguages) - { - // Translate to Iso Codes - List iso6392Codes = new List(); - foreach (var item in userLanguages) - { - string isoCode; - if (MapLanguages().TryGetValue(item, out isoCode)) - { - iso6392Codes.Add(isoCode); - } - } - - return iso6392Codes; - } - - /// - /// The get language names. - /// - /// - /// The language codes. - /// - /// - /// The . - /// - public static List GetLanguageNames(IList languageCodes) - { - // Translate to Iso Codes - List names = new List(); - foreach (var item in languageCodes) - { - KeyValuePair name = MapLanguages().FirstOrDefault(v => v.Value == item); // Slightly inefficient but small set anyway so not a big issue. - names.Add(name.Key); - } - - return names; - } - - /// - /// The get iso codes. - /// - /// - /// The . - /// - public static List GetIsoCodes() - { - return MapLanguages().Values.ToList(); - } - - /// - /// The get language code. - /// - /// - /// The language. - /// - /// - /// The . - /// - public static string GetLanguageCode(string language) - { - if (string.IsNullOrEmpty(language)) - { - return null; - } - - string isoCode; - if (MapLanguages().TryGetValue(language, out isoCode)) - { - return isoCode; - } - - return null; - } - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Language Utilities +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Utilities +{ + using System.Collections.Generic; + using System.Linq; + + /// + /// Language Utilities + /// + public class LanguageUtilities + { + /// + /// The language map. + /// + private static IDictionary languageMap; + + /// + /// Map languages and their iso639_2 value into a IDictionary + /// + /// A Dictionary containing the language and iso code + public static IDictionary MapLanguages() + { + if (languageMap != null) + { + return languageMap; + } + + languageMap = new Dictionary + { + { "(Any)", "und" }, + { "Afar", "aar" }, + { "Abkhazian", "abk" }, + { "Afrikaans", "afr" }, + { "Akan", "aka" }, + { "Albanian", "sqi" }, + { "Amharic", "amh" }, + { "Arabic", "ara" }, + { "Aragonese", "arg" }, + { "Armenian", "hye" }, + { "Assamese", "asm" }, + { "Avaric", "ava" }, + { "Avestan", "ave" }, + { "Aymara", "aym" }, + { "Azerbaijani", "aze" }, + { "Bashkir", "bak" }, + { "Bambara", "bam" }, + { "Basque", "eus" }, + { "Belarusian", "bel" }, + { "Bengali", "ben" }, + { "Bihari", "bih" }, + { "Bislama", "bis" }, + { "Bosnian", "bos" }, + { "Breton", "bre" }, + { "Bulgarian", "bul" }, + { "Burmese", "mya" }, + { "Catalan", "cat" }, + { "Chamorro", "cha" }, + { "Chechen", "che" }, + { "Chinese", "zho" }, + { "Church Slavic", "chu" }, + { "Chuvash", "chv" }, + { "Cornish", "cor" }, + { "Corsican", "cos" }, + { "Cree", "cre" }, + { "Czech", "ces" }, + { "Dansk", "dan" }, + { "Divehi", "div" }, + { "Nederlands", "nld" }, + { "Dzongkha", "dzo" }, + { "English", "eng" }, + { "Esperanto", "epo" }, + { "Estonian", "est" }, + { "Ewe", "ewe" }, + { "Faroese", "fao" }, + { "Fijian", "fij" }, + { "Suomi", "fin" }, + { "Francais", "fra" }, + { "Western Frisian", "fry" }, + { "Fulah", "ful" }, + { "Georgian", "kat" }, + { "Deutsch", "deu" }, + { "Gaelic (Scots)", "gla" }, + { "Irish", "gle" }, + { "Galician", "glg" }, + { "Manx", "glv" }, + { "Greek, Modern", "ell" }, + { "Guarani", "grn" }, + { "Gujarati", "guj" }, + { "Haitian", "hat" }, + { "Hausa", "hau" }, + { "Hebrew", "heb" }, + { "Herero", "her" }, + { "Hindi", "hin" }, + { "Hiri Motu", "hmo" }, + { "Magyar", "hun" }, + { "Igbo", "ibo" }, + { "Islenska", "isl" }, + { "Ido", "ido" }, + { "Sichuan Yi", "iii" }, + { "Inuktitut", "iku" }, + { "Interlingue", "ile" }, + { "Interlingua", "ina" }, + { "Indonesian", "ind" }, + { "Inupiaq", "ipk" }, + { "Italiano", "ita" }, + { "Javanese", "jav" }, + { "Japanese", "jpn" }, + { "Kalaallisut", "kal" }, + { "Kannada", "kan" }, + { "Kashmiri", "kas" }, + { "Kanuri", "kau" }, + { "Kazakh", "kaz" }, + { "Central Khmer", "khm" }, + { "Kikuyu", "kik" }, + { "Kinyarwanda", "kin" }, + { "Kirghiz", "kir" }, + { "Komi", "kom" }, + { "Kongo", "kon" }, + { "Korean", "kor" }, + { "Kuanyama", "kua" }, + { "Kurdish", "kur" }, + { "Lao", "lao" }, + { "Latin", "lat" }, + { "Latvian", "lav" }, + { "Limburgan", "lim" }, + { "Lingala", "lin" }, + { "Lithuanian", "lit" }, + { "Luxembourgish", "ltz" }, + { "Luba-Katanga", "lub" }, + { "Ganda", "lug" }, + { "Macedonian", "mkd" }, + { "Marshallese", "mah" }, + { "Malayalam", "mal" }, + { "Maori", "mri" }, + { "Marathi", "mar" }, + { "Malay", "msa" }, + { "Malagasy", "mlg" }, + { "Maltese", "mlt" }, + { "Moldavian", "mol" }, + { "Mongolian", "mon" }, + { "Nauru", "nau" }, + { "Navajo", "nav" }, + { "Ndebele, South", "nbl" }, + { "Ndebele, North", "nde" }, + { "Ndonga", "ndo" }, + { "Nepali", "nep" }, + { "Norwegian Nynorsk", "nno" }, + { "Norwegian Bokmål", "nob" }, + { "Norsk", "nor" }, + { "Chichewa; Nyanja", "nya" }, + { "Occitan", "oci" }, + { "Ojibwa", "oji" }, + { "Oriya", "ori" }, + { "Oromo", "orm" }, + { "Ossetian", "oss" }, + { "Panjabi", "pan" }, + { "Persian", "fas" }, + { "Pali", "pli" }, + { "Polish", "pol" }, + { "Portuguese", "por" }, + { "Pushto", "pus" }, + { "Quechua", "que" }, + { "Romansh", "roh" }, + { "Romanian", "ron" }, + { "Rundi", "run" }, + { "Russian", "rus" }, + { "Sango", "sag" }, + { "Sanskrit", "san" }, + { "Serbian", "srp" }, + { "Hrvatski", "hrv" }, + { "Sinhala", "sin" }, + { "Slovak", "slk" }, + { "Slovenian", "slv" }, + { "Northern Sami", "sme" }, + { "Samoan", "smo" }, + { "Shona", "sna" }, + { "Sindhi", "snd" }, + { "Somali", "som" }, + { "Sotho Southern", "sot" }, + { "Espanol", "spa" }, + { "Sardinian", "srd" }, + { "Swati", "ssw" }, + { "Sundanese", "sun" }, + { "Swahili", "swa" }, + { "Svenska", "swe" }, + { "Tahitian", "tah" }, + { "Tamil", "tam" }, + { "Tatar", "tat" }, + { "Telugu", "tel" }, + { "Tajik", "tgk" }, + { "Tagalog", "tgl" }, + { "Thai", "tha" }, + { "Tibetan", "bod" }, + { "Tigrinya", "tir" }, + { "Tonga", "ton" }, + { "Tswana", "tsn" }, + { "Tsonga", "tso" }, + { "Turkmen", "tuk" }, + { "Turkish", "tur" }, + { "Twi", "twi" }, + { "Uighur", "uig" }, + { "Ukrainian", "ukr" }, + { "Urdu", "urd" }, + { "Uzbek", "uzb" }, + { "Venda", "ven" }, + { "Vietnamese", "vie" }, + { "Volapük", "vol" }, + { "Welsh", "cym" }, + { "Walloon", "wln" }, + { "Wolof", "wol" }, + { "Xhosa", "xho" }, + { "Yiddish", "yid" }, + { "Yoruba", "yor" }, + { "Zhuang", "zha" }, + { "Zulu", "zul" } + }; + + return languageMap; + } + + /// + /// The get language codes. + /// + /// + /// The user languages. + /// + /// + /// The . + /// + public static List GetLanguageCodes(IEnumerable userLanguages) + { + // Translate to Iso Codes + List iso6392Codes = new List(); + foreach (var item in userLanguages) + { + string isoCode; + if (MapLanguages().TryGetValue(item, out isoCode)) + { + iso6392Codes.Add(isoCode); + } + } + + return iso6392Codes; + } + + /// + /// The get language names. + /// + /// + /// The language codes. + /// + /// + /// The . + /// + public static List GetLanguageNames(IList languageCodes) + { + // Translate to Iso Codes + List names = new List(); + foreach (var item in languageCodes) + { + KeyValuePair name = MapLanguages().FirstOrDefault(v => v.Value == item); // Slightly inefficient but small set anyway so not a big issue. + names.Add(name.Key); + } + + return names; + } + + /// + /// The get iso codes. + /// + /// + /// The . + /// + public static List GetIsoCodes() + { + return MapLanguages().Values.ToList(); + } + + /// + /// The get language code. + /// + /// + /// The language. + /// + /// + /// The . + /// + public static string GetLanguageCode(string language) + { + if (string.IsNullOrEmpty(language)) + { + return null; + } + + string isoCode; + if (MapLanguages().TryGetValue(language, out isoCode)) + { + return isoCode; + } + + return null; + } + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/SystemInfo.cs b/win/CS/HandBrake.Interop/Utilities/SystemInfo.cs similarity index 95% rename from win/CS/HandBrake.ApplicationServices/Utilities/SystemInfo.cs rename to win/CS/HandBrake.Interop/Utilities/SystemInfo.cs index 8966b5a8f..af0c24724 100644 --- a/win/CS/HandBrake.ApplicationServices/Utilities/SystemInfo.cs +++ b/win/CS/HandBrake.Interop/Utilities/SystemInfo.cs @@ -1,94 +1,94 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// The System Information. -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Utilities -{ - using System; - - using Interop.HbLib; - - /// - /// The System Information. - /// - public class SystemInfo - { - /// - /// Gets a value indicating whether is qsv available. - /// - public static bool IsQsvAvailable - { - get - { - try - { - return HBFunctions.hb_qsv_available() != 0; - } - catch (Exception) - { - // Silent failure. Typically this means the dll hasn't been built with --enable-qsv - return false; - } - } - } - - /// - /// Gets a value indicating whether is qsv available. - /// - public static bool IsQsvAvailableH264 - { - get - { - try - { - return (HBFunctions.hb_qsv_available() & NativeConstants.HB_VCODEC_QSV_H264) != 0; - } - catch (Exception) - { - // Silent failure. Typically this means the dll hasn't been built with --enable-qsv - return false; - } - } - } - - /// - /// Gets a value indicating whether is qsv available. - /// - public static bool IsQsvAvailableH265 - { - get - { - try - { - return (HBFunctions.hb_qsv_available() & NativeConstants.HB_VCODEC_QSV_H265) != 0; - } - catch (Exception) - { - // Silent failure. Typically this means the dll hasn't been built with --enable-qsv - return false; - } - } - } - - public static bool IsQsvAvailableH26510bit - { - get - { - try - { - return (HBFunctions.hb_qsv_available() & NativeConstants.HB_VCODEC_QSV_H265_10BIT) != 0; - } - catch (Exception) - { - // Silent failure. Typically this means the dll hasn't been built with --enable-qsv - return false; - } - } - } - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// The System Information. +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Utilities +{ + using System; + + using Interop.HbLib; + + /// + /// The System Information. + /// + public class SystemInfo + { + /// + /// Gets a value indicating whether is qsv available. + /// + public static bool IsQsvAvailable + { + get + { + try + { + return HBFunctions.hb_qsv_available() != 0; + } + catch (Exception) + { + // Silent failure. Typically this means the dll hasn't been built with --enable-qsv + return false; + } + } + } + + /// + /// Gets a value indicating whether is qsv available. + /// + public static bool IsQsvAvailableH264 + { + get + { + try + { + return (HBFunctions.hb_qsv_available() & NativeConstants.HB_VCODEC_QSV_H264) != 0; + } + catch (Exception) + { + // Silent failure. Typically this means the dll hasn't been built with --enable-qsv + return false; + } + } + } + + /// + /// Gets a value indicating whether is qsv available. + /// + public static bool IsQsvAvailableH265 + { + get + { + try + { + return (HBFunctions.hb_qsv_available() & NativeConstants.HB_VCODEC_QSV_H265) != 0; + } + catch (Exception) + { + // Silent failure. Typically this means the dll hasn't been built with --enable-qsv + return false; + } + } + } + + public static bool IsQsvAvailableH26510bit + { + get + { + try + { + return (HBFunctions.hb_qsv_available() & NativeConstants.HB_VCODEC_QSV_H265_10BIT) != 0; + } + catch (Exception) + { + // Silent failure. Typically this means the dll hasn't been built with --enable-qsv + return false; + } + } + } + } +} diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/VersionHelper.cs b/win/CS/HandBrake.Interop/Utilities/VersionHelper.cs similarity index 89% rename from win/CS/HandBrake.ApplicationServices/Utilities/VersionHelper.cs rename to win/CS/HandBrake.Interop/Utilities/VersionHelper.cs index cc5c903ef..2975a4793 100644 --- a/win/CS/HandBrake.ApplicationServices/Utilities/VersionHelper.cs +++ b/win/CS/HandBrake.Interop/Utilities/VersionHelper.cs @@ -1,53 +1,53 @@ -// -------------------------------------------------------------------------------------------------------------------- -// -// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. -// -// -// Version Utility -// -// -------------------------------------------------------------------------------------------------------------------- - -namespace HandBrake.ApplicationServices.Utilities -{ - using HandBrake.ApplicationServices.Interop; - using HandBrake.ApplicationServices.Interop.Interfaces; - - /// - /// Version Utility - /// - public class VersionHelper - { - /// - /// The get build. - /// - /// - /// The . - /// - public static string GetVersion() - { - IHandBrakeInstance instance = HandBrakeInstanceManager.MasterInstance; - - return IsNightly() ? string.Format("Nightly {0} ({1})", instance.Version, instance.Build) : string.Format("{0} ({1})", instance.Version, instance.Build); - } - - public static string GetVersionShort() - { - IHandBrakeInstance instance = HandBrakeInstanceManager.MasterInstance; - return string.Format("{0} {1}", instance.Version, instance.Build); - } - - /// - /// The is nightly. - /// - /// - /// The . - /// - public static bool IsNightly() - { - IHandBrakeInstance instance = HandBrakeInstanceManager.MasterInstance; - - // 01 = Unofficial Builds. 00 = Official Tagged Releases. - return instance.Build.ToString().EndsWith("01"); - } - } -} +// -------------------------------------------------------------------------------------------------------------------- +// +// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. +// +// +// Version Utility +// +// -------------------------------------------------------------------------------------------------------------------- + +namespace HandBrake.Interop.Utilities +{ + using HandBrake.Interop.Interop; + using HandBrake.Interop.Interop.Interfaces; + + /// + /// Version Utility + /// + public class VersionHelper + { + /// + /// The get build. + /// + /// + /// The . + /// + public static string GetVersion() + { + IHandBrakeInstance instance = HandBrakeInstanceManager.MasterInstance; + + return IsNightly() ? string.Format("Nightly {0} ({1})", instance.Version, instance.Build) : string.Format("{0} ({1})", instance.Version, instance.Build); + } + + public static string GetVersionShort() + { + IHandBrakeInstance instance = HandBrakeInstanceManager.MasterInstance; + return string.Format("{0} {1}", instance.Version, instance.Build); + } + + /// + /// The is nightly. + /// + /// + /// The . + /// + public static bool IsNightly() + { + IHandBrakeInstance instance = HandBrakeInstanceManager.MasterInstance; + + // 01 = Unofficial Builds. 00 = Official Tagged Releases. + return instance.Build.ToString().EndsWith("01"); + } + } +} diff --git a/win/CS/HandBrake.ApplicationServices/app.config b/win/CS/HandBrake.Interop/app.config similarity index 96% rename from win/CS/HandBrake.ApplicationServices/app.config rename to win/CS/HandBrake.Interop/app.config index 74b635ee6..4a29a96b3 100644 --- a/win/CS/HandBrake.ApplicationServices/app.config +++ b/win/CS/HandBrake.Interop/app.config @@ -1,8 +1,8 @@ - - - - - - - - + + + + + + + + diff --git a/win/CS/HandBrake.ApplicationServices/packages.config b/win/CS/HandBrake.Interop/packages.config similarity index 100% rename from win/CS/HandBrake.ApplicationServices/packages.config rename to win/CS/HandBrake.Interop/packages.config diff --git a/win/CS/HandBrake.sln b/win/CS/HandBrake.sln index 0e7f155b4..7d9ad28ca 100644 --- a/win/CS/HandBrake.sln +++ b/win/CS/HandBrake.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.26730.12 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HandBrake.ApplicationServices", "HandBrake.ApplicationServices\HandBrake.ApplicationServices.csproj", "{087A2BA8-BAC2-4577-A46F-07FF9D420016}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HandBrake.Interop", "HandBrake.Interop\HandBrake.Interop.csproj", "{087A2BA8-BAC2-4577-A46F-07FF9D420016}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HandBrakeWPF", "HandBrakeWPF\HandBrakeWPF.csproj", "{DADE66CB-0E12-4959-ADE5-0ACD31D27C59}" EndProject diff --git a/win/CS/HandBrakeAppX/HandBrakeAppX.jsproj b/win/CS/HandBrakeAppX/HandBrakeAppX.jsproj index 5631ac3f5..031334879 100644 --- a/win/CS/HandBrakeAppX/HandBrakeAppX.jsproj +++ b/win/CS/HandBrakeAppX/HandBrakeAppX.jsproj @@ -67,8 +67,8 @@ - - + + diff --git a/win/CS/HandBrakeCS.csproj b/win/CS/HandBrakeCS.csproj index 947eff2c0..ed044bafa 100644 --- a/win/CS/HandBrakeCS.csproj +++ b/win/CS/HandBrakeCS.csproj @@ -165,13 +165,9 @@ - + {087A2BA8-BAC2-4577-A46F-07FF9D420016} - HandBrake.ApplicationServices - - - {F0A61F62-2C3B-4A87-AFF4-0C4256253DA1} - HandBrakeInterop + HandBrake.Interop diff --git a/win/CS/HandBrakeWPF/Converters/Audio/AudioBehaviourConverter.cs b/win/CS/HandBrakeWPF/Converters/Audio/AudioBehaviourConverter.cs index 667e372b7..8263846f2 100644 --- a/win/CS/HandBrakeWPF/Converters/Audio/AudioBehaviourConverter.cs +++ b/win/CS/HandBrakeWPF/Converters/Audio/AudioBehaviourConverter.cs @@ -15,7 +15,7 @@ namespace HandBrakeWPF.Converters.Audio using System.Linq; using System.Windows.Data; - using HandBrake.ApplicationServices.Utilities; + using HandBrake.Interop.Utilities; using HandBrakeWPF.Model.Audio; using HandBrakeWPF.Utilities; diff --git a/win/CS/HandBrakeWPF/Converters/Audio/AudioEncoderConverter.cs b/win/CS/HandBrakeWPF/Converters/Audio/AudioEncoderConverter.cs index 350a8e06d..ec70119e0 100644 --- a/win/CS/HandBrakeWPF/Converters/Audio/AudioEncoderConverter.cs +++ b/win/CS/HandBrakeWPF/Converters/Audio/AudioEncoderConverter.cs @@ -16,8 +16,8 @@ namespace HandBrakeWPF.Converters.Audio using System.Windows; using System.Windows.Data; - using HandBrake.ApplicationServices.Interop; - using HandBrake.ApplicationServices.Utilities; + using HandBrake.Interop.Interop; + using HandBrake.Interop.Utilities; using HandBrakeWPF.Utilities; diff --git a/win/CS/HandBrakeWPF/Converters/Audio/AudioMixdownConverter.cs b/win/CS/HandBrakeWPF/Converters/Audio/AudioMixdownConverter.cs index 0ef315fba..8b7a0cd42 100644 --- a/win/CS/HandBrakeWPF/Converters/Audio/AudioMixdownConverter.cs +++ b/win/CS/HandBrakeWPF/Converters/Audio/AudioMixdownConverter.cs @@ -12,8 +12,8 @@ namespace HandBrakeWPF.Converters.Audio using System; using System.Globalization; using System.Windows.Data; - using HandBrake.ApplicationServices.Interop; - using HandBrake.ApplicationServices.Interop.Model.Encoding; + using HandBrake.Interop.Interop; + using HandBrake.Interop.Interop.Model.Encoding; /// /// The audio mixdown converter. diff --git a/win/CS/HandBrakeWPF/Converters/Audio/AudioMixdownListConverter.cs b/win/CS/HandBrakeWPF/Converters/Audio/AudioMixdownListConverter.cs index df108d961..1a085cd73 100644 --- a/win/CS/HandBrakeWPF/Converters/Audio/AudioMixdownListConverter.cs +++ b/win/CS/HandBrakeWPF/Converters/Audio/AudioMixdownListConverter.cs @@ -13,8 +13,8 @@ namespace HandBrakeWPF.Converters.Audio using System.ComponentModel; using System.Globalization; using System.Windows.Data; - using HandBrake.ApplicationServices.Interop; - using HandBrake.ApplicationServices.Interop.Model.Encoding; + using HandBrake.Interop.Interop; + using HandBrake.Interop.Interop.Model.Encoding; using HandBrakeWPF.Services.Encode.Model.Models; using HandBrakeWPF.Utilities; diff --git a/win/CS/HandBrakeWPF/Converters/Audio/AudioQueueDisplayConverter.cs b/win/CS/HandBrakeWPF/Converters/Audio/AudioQueueDisplayConverter.cs index 512fa0774..400f17ce4 100644 --- a/win/CS/HandBrakeWPF/Converters/Audio/AudioQueueDisplayConverter.cs +++ b/win/CS/HandBrakeWPF/Converters/Audio/AudioQueueDisplayConverter.cs @@ -15,7 +15,7 @@ namespace HandBrakeWPF.Converters.Audio using System.Text; using System.Windows.Data; - using HandBrake.ApplicationServices.Utilities; + using HandBrake.Interop.Utilities; using HandBrakeWPF.Utilities; diff --git a/win/CS/HandBrakeWPF/Converters/Audio/AudioRateTypeConverter.cs b/win/CS/HandBrakeWPF/Converters/Audio/AudioRateTypeConverter.cs index 9808cbb58..e6e458ed9 100644 --- a/win/CS/HandBrakeWPF/Converters/Audio/AudioRateTypeConverter.cs +++ b/win/CS/HandBrakeWPF/Converters/Audio/AudioRateTypeConverter.cs @@ -14,7 +14,7 @@ namespace HandBrakeWPF.Converters.Audio using System.Globalization; using System.Windows.Data; - using HandBrake.ApplicationServices.Utilities; + using HandBrake.Interop.Utilities; using HandBrakeWPF.Utilities; diff --git a/win/CS/HandBrakeWPF/Converters/Audio/AudioTrackDefaultBehaviourConverter.cs b/win/CS/HandBrakeWPF/Converters/Audio/AudioTrackDefaultBehaviourConverter.cs index 297488b65..6aa590bbf 100644 --- a/win/CS/HandBrakeWPF/Converters/Audio/AudioTrackDefaultBehaviourConverter.cs +++ b/win/CS/HandBrakeWPF/Converters/Audio/AudioTrackDefaultBehaviourConverter.cs @@ -15,7 +15,7 @@ namespace HandBrakeWPF.Converters.Audio using System.Linq; using System.Windows.Data; - using HandBrake.ApplicationServices.Utilities; + using HandBrake.Interop.Utilities; using HandBrakeWPF.Model.Audio; using HandBrakeWPF.Utilities; diff --git a/win/CS/HandBrakeWPF/Converters/EnumComboConverter.cs b/win/CS/HandBrakeWPF/Converters/EnumComboConverter.cs index c9afb8c14..ff6f71156 100644 --- a/win/CS/HandBrakeWPF/Converters/EnumComboConverter.cs +++ b/win/CS/HandBrakeWPF/Converters/EnumComboConverter.cs @@ -13,8 +13,8 @@ namespace HandBrakeWPF.Converters using System.Collections.Generic; using System.Globalization; using System.Windows.Data; - using HandBrake.ApplicationServices.Interop.Model.Encoding; - using HandBrake.ApplicationServices.Model; + using HandBrake.Interop.Interop.Model.Encoding; + using HandBrake.Interop.Model; using HandBrakeWPF.Services.Queue.Model; using HandBrakeWPF.Utilities; using OutputFormat = HandBrakeWPF.Services.Encode.Model.Models.OutputFormat; diff --git a/win/CS/HandBrakeWPF/Converters/Filters/DenoisePresetConverter.cs b/win/CS/HandBrakeWPF/Converters/Filters/DenoisePresetConverter.cs index 5e2b7024a..accd7bc3b 100644 --- a/win/CS/HandBrakeWPF/Converters/Filters/DenoisePresetConverter.cs +++ b/win/CS/HandBrakeWPF/Converters/Filters/DenoisePresetConverter.cs @@ -15,7 +15,7 @@ namespace HandBrakeWPF.Converters.Filters using System.Linq; using System.Windows.Data; - using HandBrake.ApplicationServices.Interop.Model.Encoding; + using HandBrake.Interop.Interop.Model.Encoding; using DenoisePreset = HandBrakeWPF.Services.Encode.Model.Models.DenoisePreset; diff --git a/win/CS/HandBrakeWPF/Converters/Filters/SharpenPresetConverter.cs b/win/CS/HandBrakeWPF/Converters/Filters/SharpenPresetConverter.cs index 417b0d155..5e8c4f37b 100644 --- a/win/CS/HandBrakeWPF/Converters/Filters/SharpenPresetConverter.cs +++ b/win/CS/HandBrakeWPF/Converters/Filters/SharpenPresetConverter.cs @@ -14,9 +14,9 @@ namespace HandBrakeWPF.Converters.Filters using System.Globalization; using System.Windows.Data; - using HandBrake.ApplicationServices.Interop; - using HandBrake.ApplicationServices.Interop.HbLib; - using HandBrake.ApplicationServices.Interop.Model.Encoding; + using HandBrake.Interop.Interop; + using HandBrake.Interop.Interop.HbLib; + using HandBrake.Interop.Interop.Model.Encoding; using HandBrakeWPF.Model.Filters; diff --git a/win/CS/HandBrakeWPF/Converters/Filters/SharpenTuneConverter.cs b/win/CS/HandBrakeWPF/Converters/Filters/SharpenTuneConverter.cs index 72d40e3ae..e3190d831 100644 --- a/win/CS/HandBrakeWPF/Converters/Filters/SharpenTuneConverter.cs +++ b/win/CS/HandBrakeWPF/Converters/Filters/SharpenTuneConverter.cs @@ -14,9 +14,9 @@ namespace HandBrakeWPF.Converters.Filters using System.Globalization; using System.Windows.Data; - using HandBrake.ApplicationServices.Interop; - using HandBrake.ApplicationServices.Interop.HbLib; - using HandBrake.ApplicationServices.Interop.Model.Encoding; + using HandBrake.Interop.Interop; + using HandBrake.Interop.Interop.HbLib; + using HandBrake.Interop.Interop.Model.Encoding; using HandBrakeWPF.Model.Filters; diff --git a/win/CS/HandBrakeWPF/Converters/Options/OptionsTabNameConverter.cs b/win/CS/HandBrakeWPF/Converters/Options/OptionsTabNameConverter.cs index b60e626f6..5c0fb47f0 100644 --- a/win/CS/HandBrakeWPF/Converters/Options/OptionsTabNameConverter.cs +++ b/win/CS/HandBrakeWPF/Converters/Options/OptionsTabNameConverter.cs @@ -13,7 +13,7 @@ namespace HandBrakeWPF.Converters.Options using System.Globalization; using System.Windows.Data; - using HandBrake.ApplicationServices.Utilities; + using HandBrake.Interop.Utilities; using HandBrakeWPF.Model; using HandBrakeWPF.Utilities; diff --git a/win/CS/HandBrakeWPF/Converters/Queue/PictureSettingsDescConveter.cs b/win/CS/HandBrakeWPF/Converters/Queue/PictureSettingsDescConveter.cs index 782d1698e..f9dacd7c7 100644 --- a/win/CS/HandBrakeWPF/Converters/Queue/PictureSettingsDescConveter.cs +++ b/win/CS/HandBrakeWPF/Converters/Queue/PictureSettingsDescConveter.cs @@ -12,7 +12,7 @@ namespace HandBrakeWPF.Converters.Queue using System; using System.Globalization; using System.Windows.Data; - using HandBrake.ApplicationServices.Interop.Model.Encoding; + using HandBrake.Interop.Interop.Model.Encoding; using HandBrakeWPF.Services.Encode.Model; /// diff --git a/win/CS/HandBrakeWPF/Converters/Subtitles/SubtitleBehaviourConverter.cs b/win/CS/HandBrakeWPF/Converters/Subtitles/SubtitleBehaviourConverter.cs index e488d71e8..604b86b21 100644 --- a/win/CS/HandBrakeWPF/Converters/Subtitles/SubtitleBehaviourConverter.cs +++ b/win/CS/HandBrakeWPF/Converters/Subtitles/SubtitleBehaviourConverter.cs @@ -15,7 +15,7 @@ namespace HandBrakeWPF.Converters.Subtitles using System.Linq; using System.Windows.Data; - using HandBrake.ApplicationServices.Utilities; + using HandBrake.Interop.Utilities; using HandBrakeWPF.Model.Subtitles; using HandBrakeWPF.Utilities; diff --git a/win/CS/HandBrakeWPF/Converters/Video/EncoderOptionsTooltipConverter.cs b/win/CS/HandBrakeWPF/Converters/Video/EncoderOptionsTooltipConverter.cs index dce48a4cf..d0486eff9 100644 --- a/win/CS/HandBrakeWPF/Converters/Video/EncoderOptionsTooltipConverter.cs +++ b/win/CS/HandBrakeWPF/Converters/Video/EncoderOptionsTooltipConverter.cs @@ -14,7 +14,7 @@ namespace HandBrakeWPF.Converters.Video using System.Linq; using System.Windows.Data; - using HandBrake.ApplicationServices.Interop.Model.Encoding; + using HandBrake.Interop.Interop.Model.Encoding; using EncodeTask = HandBrakeWPF.Services.Encode.Model.EncodeTask; using VideoLevel = HandBrakeWPF.Services.Encode.Model.Models.Video.VideoLevel; diff --git a/win/CS/HandBrakeWPF/Converters/Video/ScalingConverter.cs b/win/CS/HandBrakeWPF/Converters/Video/ScalingConverter.cs index 442d525fe..f725bb72a 100644 --- a/win/CS/HandBrakeWPF/Converters/Video/ScalingConverter.cs +++ b/win/CS/HandBrakeWPF/Converters/Video/ScalingConverter.cs @@ -13,8 +13,8 @@ namespace HandBrakeWPF.Converters.Video using System.Globalization; using System.Windows.Data; - using HandBrake.ApplicationServices.Model; - using HandBrake.ApplicationServices.Utilities; + using HandBrake.Interop.Model; + using HandBrake.Interop.Utilities; using HandBrakeWPF.Model; using HandBrakeWPF.Utilities; diff --git a/win/CS/HandBrakeWPF/Converters/Video/VideoEncoderConverter.cs b/win/CS/HandBrakeWPF/Converters/Video/VideoEncoderConverter.cs index ca54837b6..285b1a373 100644 --- a/win/CS/HandBrakeWPF/Converters/Video/VideoEncoderConverter.cs +++ b/win/CS/HandBrakeWPF/Converters/Video/VideoEncoderConverter.cs @@ -15,14 +15,14 @@ namespace HandBrakeWPF.Converters.Video using System.Linq; using System.Windows.Data; - using HandBrake.ApplicationServices.Interop; - using HandBrake.ApplicationServices.Interop.Model.Encoding; + using HandBrake.Interop.Interop; + using HandBrake.Interop.Interop.Model.Encoding; using HandBrakeWPF.Utilities; using EncodeTask = HandBrakeWPF.Services.Encode.Model.EncodeTask; using OutputFormat = HandBrakeWPF.Services.Encode.Model.Models.OutputFormat; - using SystemInfo = HandBrake.ApplicationServices.Utilities.SystemInfo; + using SystemInfo = HandBrake.Interop.Utilities.SystemInfo; /// /// Video Encoder Converter diff --git a/win/CS/HandBrakeWPF/Converters/Video/VideoOptionsTooltipConverter.cs b/win/CS/HandBrakeWPF/Converters/Video/VideoOptionsTooltipConverter.cs index 4a6c036c4..7b4ec0fc0 100644 --- a/win/CS/HandBrakeWPF/Converters/Video/VideoOptionsTooltipConverter.cs +++ b/win/CS/HandBrakeWPF/Converters/Video/VideoOptionsTooltipConverter.cs @@ -13,7 +13,7 @@ namespace HandBrakeWPF.Converters.Video using System.Globalization; using System.Windows.Data; - using HandBrake.ApplicationServices.Interop.Model.Encoding; + using HandBrake.Interop.Interop.Model.Encoding; using HandBrakeWPF.Utilities; diff --git a/win/CS/HandBrakeWPF/EventArgs/QueueProgressEventArgs.cs b/win/CS/HandBrakeWPF/EventArgs/QueueProgressEventArgs.cs index 03155d0b5..a3d9918d7 100644 --- a/win/CS/HandBrakeWPF/EventArgs/QueueProgressEventArgs.cs +++ b/win/CS/HandBrakeWPF/EventArgs/QueueProgressEventArgs.cs @@ -11,7 +11,7 @@ namespace HandBrakeWPF.EventArgs { using System; - using HandBrake.ApplicationServices.Model; + using HandBrake.Interop.Model; using HandBrakeWPF.Services.Queue.Model; diff --git a/win/CS/HandBrakeWPF/Factories/HBConfigurationFactory.cs b/win/CS/HandBrakeWPF/Factories/HBConfigurationFactory.cs index d6ac2f7f5..568f7e390 100644 --- a/win/CS/HandBrakeWPF/Factories/HBConfigurationFactory.cs +++ b/win/CS/HandBrakeWPF/Factories/HBConfigurationFactory.cs @@ -11,7 +11,7 @@ namespace HandBrakeWPF.Factories { using Caliburn.Micro; - using HandBrake.ApplicationServices.Model; + using HandBrake.Interop.Model; using HandBrakeWPF.Services.Interfaces; diff --git a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj index 4757f7eec..0131e9297 100644 --- a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj +++ b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj @@ -668,12 +668,6 @@ - - - {087A2BA8-BAC2-4577-A46F-07FF9D420016} - HandBrake.ApplicationServices - - @@ -718,6 +712,12 @@ + + + {087a2ba8-bac2-4577-a46f-07ff9d420016} + HandBrake.Interop + + - + @@ -38,7 +38,7 @@ - +