summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrake.ApplicationServices/Services
diff options
context:
space:
mode:
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Services')
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/Interfaces/IScan.cs15
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/LibScan.cs26
2 files changed, 41 insertions, 0 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IScan.cs b/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IScan.cs
index f102d0d36..05bc52499 100644
--- a/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IScan.cs
+++ b/win/CS/HandBrake.ApplicationServices/Services/Interfaces/IScan.cs
@@ -10,6 +10,7 @@
namespace HandBrake.ApplicationServices.Services.Interfaces
{
using System;
+ using System.Windows.Media.Imaging;
using HandBrake.ApplicationServices.EventArgs;
using HandBrake.ApplicationServices.Model;
@@ -91,6 +92,20 @@ namespace HandBrake.ApplicationServices.Services.Interfaces
void Scan(string sourcePath, int title, Action<bool> postAction, HBConfiguration configuration);
/// <summary>
+ /// Get a Preview image for the current job and preview number.
+ /// </summary>
+ /// <param name="task">
+ /// The task.
+ /// </param>
+ /// <param name="preview">
+ /// The preview.
+ /// </param>
+ /// <returns>
+ /// The <see cref="BitmapImage"/>.
+ /// </returns>
+ BitmapImage GetPreview(EncodeTask task, int preview);
+
+ /// <summary>
/// Kill the scan
/// </summary>
void Stop();
diff --git a/win/CS/HandBrake.ApplicationServices/Services/LibScan.cs b/win/CS/HandBrake.ApplicationServices/Services/LibScan.cs
index 167394764..24c364024 100644
--- a/win/CS/HandBrake.ApplicationServices/Services/LibScan.cs
+++ b/win/CS/HandBrake.ApplicationServices/Services/LibScan.cs
@@ -13,6 +13,7 @@ namespace HandBrake.ApplicationServices.Services
using System.Collections.Generic;
using System.IO;
using System.Text;
+ using System.Windows.Media.Imaging;
using HandBrake.ApplicationServices.EventArgs;
using HandBrake.ApplicationServices.Model;
@@ -23,6 +24,7 @@ namespace HandBrake.ApplicationServices.Services
using HandBrake.Interop;
using HandBrake.Interop.EventArgs;
using HandBrake.Interop.Interfaces;
+ using HandBrake.Interop.Model;
using AudioTrack = HandBrake.ApplicationServices.Parsing.Audio;
using ScanProgressEventArgs = HandBrake.Interop.EventArgs.ScanProgressEventArgs;
@@ -239,6 +241,30 @@ namespace HandBrake.ApplicationServices.Services
}
}
+ /// <summary>
+ /// Get a Preview image for the current job and preview number.
+ /// </summary>
+ /// <param name="job">
+ /// The job.
+ /// </param>
+ /// <param name="preview">
+ /// The preview.
+ /// </param>
+ /// <returns>
+ /// The <see cref="BitmapImage"/>.
+ /// </returns>
+ public BitmapImage GetPreview(EncodeTask job, int preview)
+ {
+ if (this.instance == null)
+ {
+ return null;
+ }
+
+ EncodeJob encodeJob = InteropModelCreator.GetEncodeJob(job);
+ BitmapImage bitmapImage = this.instance.GetPreview(encodeJob, preview);
+ return bitmapImage;
+ }
+
#endregion
#region Private Methods