summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrake.ApplicationServices/Services
diff options
context:
space:
mode:
authorsr55 <[email protected]>2015-05-03 17:29:45 +0000
committersr55 <[email protected]>2015-05-03 17:29:45 +0000
commit99aa2bf7c9bfa34d1bf822d70da22243fbbdd344 (patch)
treeaeda9214568a48dac6fcac2fb8902d73fe8ae378 /win/CS/HandBrake.ApplicationServices/Services
parent0be4e18bacefa6b7bc63731b4a004a6ff772af20 (diff)
WinGui: Fix Line Endings and (StyleCop)Warnings
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7152 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Services')
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/Encode/Factories/EncodeFactory.cs440
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/Encode/LibEncode.cs1
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/Scan/LibScan.cs73
3 files changed, 256 insertions, 258 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Encode/Factories/EncodeFactory.cs b/win/CS/HandBrake.ApplicationServices/Services/Encode/Factories/EncodeFactory.cs
index 54b80b28c..8554c843b 100644
--- a/win/CS/HandBrake.ApplicationServices/Services/Encode/Factories/EncodeFactory.cs
+++ b/win/CS/HandBrake.ApplicationServices/Services/Encode/Factories/EncodeFactory.cs
@@ -14,24 +14,24 @@ namespace HandBrake.ApplicationServices.Services.Encode.Factories
using System.Linq;
using System.Runtime.InteropServices;
- using HandBrake.ApplicationServices.Interop;
- using HandBrake.ApplicationServices.Interop.HbLib;
- using HandBrake.ApplicationServices.Interop.Helpers;
- using HandBrake.ApplicationServices.Interop.Json;
- using HandBrake.ApplicationServices.Interop.Json.Anamorphic;
- using HandBrake.ApplicationServices.Interop.Json.Encode;
- using HandBrake.ApplicationServices.Interop.Json.Shared;
- using HandBrake.ApplicationServices.Interop.Model.Encoding;
+ using HandBrake.ApplicationServices.Interop;
+ using HandBrake.ApplicationServices.Interop.HbLib;
+ using HandBrake.ApplicationServices.Interop.Helpers;
+ using HandBrake.ApplicationServices.Interop.Json;
+ using HandBrake.ApplicationServices.Interop.Json.Anamorphic;
+ using HandBrake.ApplicationServices.Interop.Json.Encode;
+ using HandBrake.ApplicationServices.Interop.Json.Shared;
+ using HandBrake.ApplicationServices.Interop.Model.Encoding;
using HandBrake.ApplicationServices.Model;
using HandBrake.ApplicationServices.Services.Encode.Model;
- using HandBrake.ApplicationServices.Services.Encode.Model.Models;
- using HandBrake.ApplicationServices.Utilities;
-
- using AudioTrack = HandBrake.ApplicationServices.Services.Encode.Model.Models.AudioTrack;
- using Subtitle = HandBrake.ApplicationServices.Interop.Json.Encode.Subtitles;
-
- /// <summary>
- /// This factory takes the internal EncodeJob object and turns it into a set of JSON models
+ using HandBrake.ApplicationServices.Services.Encode.Model.Models;
+ using HandBrake.ApplicationServices.Utilities;
+
+ using AudioTrack = HandBrake.ApplicationServices.Services.Encode.Model.Models.AudioTrack;
+ using Subtitle = HandBrake.ApplicationServices.Interop.Json.Encode.Subtitles;
+
+ /// <summary>
+ /// This factory takes the internal EncodeJob object and turns it into a set of JSON models
/// that can be deserialized by libhb.
/// </summary>
internal class EncodeFactory
@@ -51,23 +51,23 @@ namespace HandBrake.ApplicationServices.Services.Encode.Factories
/// <param name="configuration">
/// The configuration.
/// </param>
- /// <returns>
- /// The <see cref="JsonEncodeObject"/>.
- /// </returns>
- internal static JsonEncodeObject Create(EncodeTask job, HBConfiguration configuration)
- {
- JsonEncodeObject encode = new JsonEncodeObject
- {
- SequenceID = 0,
- Audio = CreateAudio(job),
- Destination = CreateDestination(job),
- Filters = CreateFilters(job),
- PAR = CreatePAR(job),
- Metadata = CreateMetadata(job),
- Source = CreateSource(job, configuration),
- Subtitle = CreateSubtitle(job),
- Video = CreateVideo(job, configuration)
- };
+ /// <returns>
+ /// The <see cref="JsonEncodeObject"/>.
+ /// </returns>
+ internal static JsonEncodeObject Create(EncodeTask job, HBConfiguration configuration)
+ {
+ JsonEncodeObject encode = new JsonEncodeObject
+ {
+ SequenceID = 0,
+ Audio = CreateAudio(job),
+ Destination = CreateDestination(job),
+ Filters = CreateFilters(job),
+ PAR = CreatePAR(job),
+ Metadata = CreateMetadata(job),
+ Source = CreateSource(job, configuration),
+ Subtitle = CreateSubtitle(job),
+ Video = CreateVideo(job, configuration)
+ };
return encode;
}
@@ -88,36 +88,36 @@ namespace HandBrake.ApplicationServices.Services.Encode.Factories
{
Range range = new Range();
switch (job.PointToPointMode)
- {
- case PointToPointMode.Chapters:
- range.Type = "chapter";
- range.Start = job.StartPoint;
- range.End = job.EndPoint;
- break;
- case PointToPointMode.Seconds:
- range.Type = "time";
- range.Start = job.StartPoint * 90000;
- range.End = (job.EndPoint - job.StartPoint) * 90000;
- break;
- case PointToPointMode.Frames:
- range.Type = "frame";
- range.Start = job.StartPoint;
- range.End = job.EndPoint;
- break;
- case PointToPointMode.Preview:
- range.Type = "preview";
- range.Start = job.PreviewEncodeStartAt;
- range.SeekPoints = configuration.PreviewScanCount;
- range.End = job.PreviewEncodeDuration * 90000;
- break;
- }
-
- Source source = new Source
- {
- Title = job.Title,
- Range = range,
- Angle = job.Angle,
- Path = job.Source,
+ {
+ case PointToPointMode.Chapters:
+ range.Type = "chapter";
+ range.Start = job.StartPoint;
+ range.End = job.EndPoint;
+ break;
+ case PointToPointMode.Seconds:
+ range.Type = "time";
+ range.Start = job.StartPoint * 90000;
+ range.End = (job.EndPoint - job.StartPoint) * 90000;
+ break;
+ case PointToPointMode.Frames:
+ range.Type = "frame";
+ range.Start = job.StartPoint;
+ range.End = job.EndPoint;
+ break;
+ case PointToPointMode.Preview:
+ range.Type = "preview";
+ range.Start = job.PreviewEncodeStartAt;
+ range.SeekPoints = configuration.PreviewScanCount;
+ range.End = job.PreviewEncodeDuration * 90000;
+ break;
+ }
+
+ Source source = new Source
+ {
+ Title = job.Title,
+ Range = range,
+ Angle = job.Angle,
+ Path = job.Source,
};
return source;
}
@@ -132,28 +132,28 @@ namespace HandBrake.ApplicationServices.Services.Encode.Factories
/// The <see cref="Destination"/>.
/// </returns>
private static Destination CreateDestination(EncodeTask job)
- {
- Destination destination = new Destination
- {
- File = job.Destination,
- Mp4Options = new Mp4Options
- {
- IpodAtom = job.IPod5GSupport,
- Mp4Optimize = job.OptimizeMP4
- },
- ChapterMarkers = job.IncludeChapterMarkers,
- Mux = HBFunctions.hb_container_get_from_name(job.OutputFormat == OutputFormat.Mp4 ? "av_mp4" : "av_mkv"), // TODO tidy up.
- ChapterList = new List<Chapter>()
- };
-
- if (job.IncludeChapterMarkers)
- {
- foreach (ChapterMarker item in job.ChapterNames)
- {
- Chapter chapter = new Chapter { Name = item.ChapterName };
- destination.ChapterList.Add(chapter);
- }
- }
+ {
+ Destination destination = new Destination
+ {
+ File = job.Destination,
+ Mp4Options = new Mp4Options
+ {
+ IpodAtom = job.IPod5GSupport,
+ Mp4Optimize = job.OptimizeMP4
+ },
+ ChapterMarkers = job.IncludeChapterMarkers,
+ Mux = HBFunctions.hb_container_get_from_name(job.OutputFormat == OutputFormat.Mp4 ? "av_mp4" : "av_mkv"), // TODO tidy up.
+ ChapterList = new List<Chapter>()
+ };
+
+ if (job.IncludeChapterMarkers)
+ {
+ foreach (ChapterMarker item in job.ChapterNames)
+ {
+ Chapter chapter = new Chapter { Name = item.ChapterName };
+ destination.ChapterList.Add(chapter);
+ }
+ }
return destination;
}
@@ -178,28 +178,28 @@ namespace HandBrake.ApplicationServices.Services.Encode.Factories
/// <param name="job">
/// The job.
/// </param>
- /// <returns>
- /// The <see cref="HandBrake.ApplicationServices.Interop.Json.Encode.Subtitles"/>.
- /// </returns>
- private static Subtitle CreateSubtitle(EncodeTask job)
- {
- Subtitles subtitle = new Subtitles
- {
- Search =
- new SubtitleSearch
- {
- Enable = false,
- Default = false,
- Burn = false,
- Forced = false
- },
- SubtitleList = new List<HandBrake.ApplicationServices.Interop.Json.Encode.SubtitleTrack>()
- };
-
- foreach (HandBrake.ApplicationServices.Services.Encode.Model.Models.SubtitleTrack item in job.SubtitleTracks)
- {
- if (!item.IsSrtSubtitle)
- {
+ /// <returns>
+ /// The <see cref="HandBrake.ApplicationServices.Interop.Json.Encode.Subtitles"/>.
+ /// </returns>
+ private static Subtitle CreateSubtitle(EncodeTask job)
+ {
+ Subtitles subtitle = new Subtitles
+ {
+ Search =
+ new SubtitleSearch
+ {
+ Enable = false,
+ Default = false,
+ Burn = false,
+ Forced = false
+ },
+ SubtitleList = new List<HandBrake.ApplicationServices.Interop.Json.Encode.SubtitleTrack>()
+ };
+
+ foreach (HandBrake.ApplicationServices.Services.Encode.Model.Models.SubtitleTrack item in job.SubtitleTracks)
+ {
+ if (!item.IsSrtSubtitle)
+ {
// Handle Foreign Audio Search
if (item.SourceTrack.TrackNumber == 0)
{
@@ -207,27 +207,27 @@ namespace HandBrake.ApplicationServices.Services.Encode.Factories
subtitle.Search.Burn = item.Burned;
subtitle.Search.Default = item.Default;
subtitle.Search.Forced = item.Forced;
- }
- else
- {
- HandBrake.ApplicationServices.Interop.Json.Encode.SubtitleTrack track = new HandBrake.ApplicationServices.Interop.Json.Encode.SubtitleTrack
- {
- Burn = item.Burned,
- Default = item.Default,
- Forced = item.Forced,
- ID = item.SourceTrack.TrackNumber,
- Track = (item.SourceTrack.TrackNumber - 1)
- };
-
- subtitle.SubtitleList.Add(track);
- }
- }
- else
- {
- HandBrake.ApplicationServices.Interop.Json.Encode.SubtitleTrack track = new HandBrake.ApplicationServices.Interop.Json.Encode.SubtitleTrack
- {
- Track = -1, // Indicates SRT
- Default = item.Default,
+ }
+ else
+ {
+ HandBrake.ApplicationServices.Interop.Json.Encode.SubtitleTrack track = new HandBrake.ApplicationServices.Interop.Json.Encode.SubtitleTrack
+ {
+ Burn = item.Burned,
+ Default = item.Default,
+ Forced = item.Forced,
+ ID = item.SourceTrack.TrackNumber,
+ Track = (item.SourceTrack.TrackNumber - 1)
+ };
+
+ subtitle.SubtitleList.Add(track);
+ }
+ }
+ else
+ {
+ HandBrake.ApplicationServices.Interop.Json.Encode.SubtitleTrack track = new HandBrake.ApplicationServices.Interop.Json.Encode.SubtitleTrack
+ {
+ Track = -1, // Indicates SRT
+ Default = item.Default,
Offset = item.SrtOffset,
Burn = item.Burned,
SRT =
@@ -237,13 +237,13 @@ namespace HandBrake.ApplicationServices.Services.Encode.Factories
Codeset = item.SrtCharCode,
Language = item.SrtLang
}
- };
-
- subtitle.SubtitleList.Add(track);
- }
- }
-
- return subtitle;
+ };
+
+ subtitle.SubtitleList.Add(track);
+ }
+ }
+
+ return subtitle;
}
/// <summary>
@@ -315,64 +315,64 @@ namespace HandBrake.ApplicationServices.Services.Encode.Factories
/// The <see cref="Audio"/>.
/// </returns>
private static Audio CreateAudio(EncodeTask job)
- {
- Audio audio = new Audio();
-
- List<uint> copyMaskList = new List<uint>();
- if (job.AllowedPassthruOptions.AudioAllowAACPass) copyMaskList.Add(NativeConstants.HB_ACODEC_AAC_PASS);
- if (job.AllowedPassthruOptions.AudioAllowAC3Pass) copyMaskList.Add(NativeConstants.HB_ACODEC_AC3_PASS);
- if (job.AllowedPassthruOptions.AudioAllowDTSHDPass) copyMaskList.Add(NativeConstants.HB_ACODEC_DCA_HD_PASS);
+ {
+ Audio audio = new Audio();
+
+ List<uint> copyMaskList = new List<uint>();
+ if (job.AllowedPassthruOptions.AudioAllowAACPass) copyMaskList.Add(NativeConstants.HB_ACODEC_AAC_PASS);
+ if (job.AllowedPassthruOptions.AudioAllowAC3Pass) copyMaskList.Add(NativeConstants.HB_ACODEC_AC3_PASS);
+ if (job.AllowedPassthruOptions.AudioAllowDTSHDPass) copyMaskList.Add(NativeConstants.HB_ACODEC_DCA_HD_PASS);
if (job.AllowedPassthruOptions.AudioAllowDTSPass) copyMaskList.Add(NativeConstants.HB_ACODEC_DCA_PASS);
if (job.AllowedPassthruOptions.AudioAllowEAC3Pass) copyMaskList.Add(NativeConstants.HB_ACODEC_EAC3_PASS);
- if (job.AllowedPassthruOptions.AudioAllowFlacPass) copyMaskList.Add(NativeConstants.HB_ACODEC_FLAC_PASS);
- if (job.AllowedPassthruOptions.AudioAllowMP3Pass) copyMaskList.Add(NativeConstants.HB_ACODEC_MP3_PASS);
- if (job.AllowedPassthruOptions.AudioAllowTrueHDPass) copyMaskList.Add(NativeConstants.HB_ACODEC_TRUEHD_PASS);
- audio.CopyMask = copyMaskList.ToArray();
-
- HBAudioEncoder audioEncoder = HandBrakeEncoderHelpers.GetAudioEncoder(EnumHelper<AudioEncoder>.GetShortName(job.AllowedPassthruOptions.AudioEncoderFallback));
- audio.FallbackEncoder = audioEncoder.Id;
-
- audio.AudioList = new List<Interop.Json.Encode.AudioTrack>();
- foreach (AudioTrack item in job.AudioTracks)
- {
- HBAudioEncoder encoder = HandBrakeEncoderHelpers.GetAudioEncoder(ApplicationServices.Utilities.Converters.GetCliAudioEncoder(item.Encoder));
- Validate.NotNull(encoder, "Unrecognized audio encoder:" + item.Encoder);
-
- HBMixdown mixdown = HandBrakeEncoderHelpers.GetMixdown(ApplicationServices.Utilities.Converters.GetCliMixDown(item.MixDown));
- Validate.NotNull(mixdown, "Unrecognized audio mixdown:" + ApplicationServices.Utilities.Converters.GetCliMixDown(item.MixDown));
-
- HandBrake.ApplicationServices.Interop.Json.Encode.AudioTrack audioTrack = new HandBrake.ApplicationServices.Interop.Json.Encode.AudioTrack
- {
- Track = (item.Track.HasValue ? item.Track.Value : 0) - 1,
- DRC = item.DRC,
- Encoder = encoder.Id,
- Gain = item.Gain,
- Mixdown = mixdown.Id,
- NormalizeMixLevel = false,
- Samplerate = GetSampleRateRaw(item.SampleRate),
- Name = item.TrackName,
+ if (job.AllowedPassthruOptions.AudioAllowFlacPass) copyMaskList.Add(NativeConstants.HB_ACODEC_FLAC_PASS);
+ if (job.AllowedPassthruOptions.AudioAllowMP3Pass) copyMaskList.Add(NativeConstants.HB_ACODEC_MP3_PASS);
+ if (job.AllowedPassthruOptions.AudioAllowTrueHDPass) copyMaskList.Add(NativeConstants.HB_ACODEC_TRUEHD_PASS);
+ audio.CopyMask = copyMaskList.ToArray();
+
+ HBAudioEncoder audioEncoder = HandBrakeEncoderHelpers.GetAudioEncoder(EnumHelper<AudioEncoder>.GetShortName(job.AllowedPassthruOptions.AudioEncoderFallback));
+ audio.FallbackEncoder = audioEncoder.Id;
+
+ audio.AudioList = new List<Interop.Json.Encode.AudioTrack>();
+ foreach (AudioTrack item in job.AudioTracks)
+ {
+ HBAudioEncoder encoder = HandBrakeEncoderHelpers.GetAudioEncoder(ApplicationServices.Utilities.Converters.GetCliAudioEncoder(item.Encoder));
+ Validate.NotNull(encoder, "Unrecognized audio encoder:" + item.Encoder);
+
+ HBMixdown mixdown = HandBrakeEncoderHelpers.GetMixdown(ApplicationServices.Utilities.Converters.GetCliMixDown(item.MixDown));
+ Validate.NotNull(mixdown, "Unrecognized audio mixdown:" + ApplicationServices.Utilities.Converters.GetCliMixDown(item.MixDown));
+
+ HandBrake.ApplicationServices.Interop.Json.Encode.AudioTrack audioTrack = new HandBrake.ApplicationServices.Interop.Json.Encode.AudioTrack
+ {
+ Track = (item.Track.HasValue ? item.Track.Value : 0) - 1,
+ DRC = item.DRC,
+ Encoder = encoder.Id,
+ Gain = item.Gain,
+ Mixdown = mixdown.Id,
+ NormalizeMixLevel = false,
+ Samplerate = GetSampleRateRaw(item.SampleRate),
+ Name = item.TrackName,
};
if (!item.IsPassthru)
{
// TODO Impiment Quality and Compression. We only support bitrate right now.
- //if (item.EncodeRateType == AudioEncodeRateType.Quality)
- //{
+ // if (item.EncodeRateType == AudioEncodeRateType.Quality)
+ // {
// audioTrack.Quality = item.Quality;
- //}
+ // }
- //if (item.EncodeRateType == AudioEncodeRateType.Compression)
- //{
+ // if (item.EncodeRateType == AudioEncodeRateType.Compression)
+ // {
// audioTrack.CompressionLevel = item.Compression;
- //}
-
- //if (item.EncodeRateType == AudioEncodeRateType.Bitrate)
- // {
- audioTrack.Bitrate = item.Bitrate;
- // }
- }
-
- audio.AudioList.Add(audioTrack);
+ // }
+
+ // if (item.EncodeRateType == AudioEncodeRateType.Bitrate)
+ // {
+ audioTrack.Bitrate = item.Bitrate;
+ // }
+ }
+
+ audio.AudioList.Add(audioTrack);
}
return audio;
@@ -406,17 +406,17 @@ namespace HandBrake.ApplicationServices.Services.Encode.Factories
/// <param name="job">
/// The job.
/// </param>
- /// <returns>
- /// The <see cref="Filters"/>.
- /// </returns>
- private static Filters CreateFilters(EncodeTask job)
- {
- Filters filter = new Filters
- {
- FilterList = new List<Filter>(),
- Grayscale = job.Grayscale
- };
-
+ /// <returns>
+ /// The <see cref="Filters"/>.
+ /// </returns>
+ private static Filters CreateFilters(EncodeTask job)
+ {
+ Filters filter = new Filters
+ {
+ FilterList = new List<Filter>(),
+ Grayscale = job.Grayscale
+ };
+
// Detelecine
if (job.Detelecine != Detelecine.Off)
{
@@ -521,21 +521,21 @@ namespace HandBrake.ApplicationServices.Services.Encode.Factories
filter.FilterList.Add(filterItem);
}
- // CropScale Filter
- Filter cropScale = new Filter
- {
- ID = (int)hb_filter_ids.HB_FILTER_CROP_SCALE,
- Settings =
- string.Format(
- "{0}:{1}:{2}:{3}:{4}:{5}",
- job.Width,
- job.Height,
- job.Cropping.Top,
- job.Cropping.Bottom,
- job.Cropping.Left,
- job.Cropping.Right)
- };
- filter.FilterList.Add(cropScale);
+ // CropScale Filter
+ Filter cropScale = new Filter
+ {
+ ID = (int)hb_filter_ids.HB_FILTER_CROP_SCALE,
+ Settings =
+ string.Format(
+ "{0}:{1}:{2}:{3}:{4}:{5}",
+ job.Width,
+ job.Height,
+ job.Cropping.Top,
+ job.Cropping.Bottom,
+ job.Cropping.Left,
+ job.Cropping.Right)
+ };
+ filter.FilterList.Add(cropScale);
// Rotate
/* TODO NOT SUPPORTED YET. */
@@ -547,17 +547,17 @@ namespace HandBrake.ApplicationServices.Services.Encode.Factories
/// The create meta data.
/// </summary>
/// <param name="job">
- /// The job.
- /// </param>
- /// <returns>
- /// The <see cref="Metadata"/>.
- /// </returns>
- private static Metadata CreateMetadata(EncodeTask job)
- {
- Metadata metaData = new Metadata();
-
- /* TODO NOT SUPPORTED YET. */
- return metaData;
+ /// The job.
+ /// </param>
+ /// <returns>
+ /// The <see cref="Metadata"/>.
+ /// </returns>
+ private static Metadata CreateMetadata(EncodeTask job)
+ {
+ Metadata metaData = new Metadata();
+
+ /* TODO NOT SUPPORTED YET. */
+ return metaData;
}
}
}
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Encode/LibEncode.cs b/win/CS/HandBrake.ApplicationServices/Services/Encode/LibEncode.cs
index a0718262d..6ad5875cf 100644
--- a/win/CS/HandBrake.ApplicationServices/Services/Encode/LibEncode.cs
+++ b/win/CS/HandBrake.ApplicationServices/Services/Encode/LibEncode.cs
@@ -164,7 +164,6 @@ namespace HandBrake.ApplicationServices.Services.Encode
}
}
-
#region HandBrakeInstance Event Handlers.
/// <summary>
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Scan/LibScan.cs b/win/CS/HandBrake.ApplicationServices/Services/Scan/LibScan.cs
index 5eab75520..b67513826 100644
--- a/win/CS/HandBrake.ApplicationServices/Services/Scan/LibScan.cs
+++ b/win/CS/HandBrake.ApplicationServices/Services/Scan/LibScan.cs
@@ -102,13 +102,13 @@ namespace HandBrake.ApplicationServices.Services.Scan
#region Events
- /// <summary>
- /// Scan has Started
- /// </summary>
- public event EventHandler ScanStarted;
-
- /// <summary>
- /// Scan has completed
+ /// <summary>
+ /// Scan has Started
+ /// </summary>
+ public event EventHandler ScanStarted;
+
+ /// <summary>
+ /// Scan has completed
/// </summary>
public event ScanCompletedStatus ScanCompleted;
@@ -318,14 +318,14 @@ namespace HandBrake.ApplicationServices.Services.Scan
HandBrakeUtils.SetDvdNav(!configuraiton.IsDvdNavDisabled);
- this.ServiceLogMessage("Starting Scan ...");
- this.instance.StartScan(sourcePath.ToString(), previewCount, minDuration, title != 0 ? title : 0);
-
- if (this.ScanStarted != null)
- this.ScanStarted(this, System.EventArgs.Empty);
- }
- catch (Exception exc)
- {
+ this.ServiceLogMessage("Starting Scan ...");
+ this.instance.StartScan(sourcePath.ToString(), previewCount, minDuration, title != 0 ? title : 0);
+
+ if (this.ScanStarted != null)
+ this.ScanStarted(this, System.EventArgs.Empty);
+ }
+ catch (Exception exc)
+ {
this.ServiceLogMessage("Scan Failed ..." + Environment.NewLine + exc);
this.Stop();
@@ -488,28 +488,28 @@ namespace HandBrake.ApplicationServices.Services.Scan
Playlist = title.Type == 1 ? string.Format(" {0:d5}.MPLS", title.Playlist).Trim() : null,
FramerateNumerator = title.FrameRate.Num,
FramerateDenominator = title.FrameRate.Den
- };
-
- int currentTrack = 1;
- foreach (SourceChapter chapter in title.ChapterList)
- {
- string chapterName = !string.IsNullOrEmpty(chapter.Name) ? chapter.Name : string.Empty;
- converted.Chapters.Add(new Chapter(currentTrack, chapterName, new TimeSpan(chapter.Duration.Hours, chapter.Duration.Minutes, chapter.Duration.Seconds)));
+ };
+
+ int currentTrack = 1;
+ foreach (SourceChapter chapter in title.ChapterList)
+ {
+ string chapterName = !string.IsNullOrEmpty(chapter.Name) ? chapter.Name : string.Empty;
+ converted.Chapters.Add(new Chapter(currentTrack, chapterName, new TimeSpan(chapter.Duration.Hours, chapter.Duration.Minutes, chapter.Duration.Seconds)));
currentTrack++;
- }
-
- int currentAudioTrack = 1;
- foreach (SourceAudioTrack track in title.AudioList)
- {
- converted.AudioTracks.Add(new Audio(currentAudioTrack, track.Language, track.LanguageCode, track.Description, string.Empty, track.SampleRate, track.BitRate));
- currentAudioTrack++;
- }
-
- int currentSubtitleTrack = 1;
- foreach (SourceSubtitleTrack track in title.SubtitleList)
- {
- SubtitleType convertedType = new SubtitleType();
-
+ }
+
+ int currentAudioTrack = 1;
+ foreach (SourceAudioTrack track in title.AudioList)
+ {
+ converted.AudioTracks.Add(new Audio(currentAudioTrack, track.Language, track.LanguageCode, track.Description, string.Empty, track.SampleRate, track.BitRate));
+ currentAudioTrack++;
+ }
+
+ int currentSubtitleTrack = 1;
+ foreach (SourceSubtitleTrack track in title.SubtitleList)
+ {
+ SubtitleType convertedType = new SubtitleType();
+
switch (track.Source)
{
case 0:
@@ -538,7 +538,6 @@ namespace HandBrake.ApplicationServices.Services.Scan
break;
}
-
bool canBurn = HBFunctions.hb_subtitle_can_burn(track.Source) > 0;
bool canSetForcedOnly = HBFunctions.hb_subtitle_can_force(track.Source) > 0;