summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrake.ApplicationServices
diff options
context:
space:
mode:
authorsr55 <[email protected]>2013-11-19 23:18:43 +0000
committersr55 <[email protected]>2013-11-19 23:18:43 +0000
commitacc52477100589c854cd3410a09949dd86fac754 (patch)
treebf4658ab3770f0541a5be78498a5cecc7687484f /win/CS/HandBrake.ApplicationServices
parentc32a46c925608e51be9edcd6b5647c50124dd16a (diff)
WinGui: Putting in place the framework for a static preview window. Initial window created and now displays a static preview. This feature is not enabled in the UI yet.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5901 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices')
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/Interfaces/IScan.cs15
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/LibScan.cs26
-rw-r--r--win/CS/HandBrake.ApplicationServices/Utilities/InteropModelCreator.cs20
3 files changed, 58 insertions, 3 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
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/InteropModelCreator.cs b/win/CS/HandBrake.ApplicationServices/Utilities/InteropModelCreator.cs
index 81b4a63c1..c8095f9c1 100644
--- a/win/CS/HandBrake.ApplicationServices/Utilities/InteropModelCreator.cs
+++ b/win/CS/HandBrake.ApplicationServices/Utilities/InteropModelCreator.cs
@@ -25,13 +25,13 @@ namespace HandBrake.ApplicationServices.Utilities
public class InteropModelCreator
{
/// <summary>
- /// Get an EncodeJob model for a LibHB Encode.
+ /// The get encode job.
/// </summary>
/// <param name="task">
/// The task.
/// </param>
/// <returns>
- /// An Interop.EncodeJob model.
+ /// The <see cref="EncodeJob"/>.
/// </returns>
public static EncodeJob GetEncodeJob(QueueTask task)
{
@@ -41,8 +41,22 @@ namespace HandBrake.ApplicationServices.Utilities
return null;
}
+ return GetEncodeJob(task.Task);
+ }
+
+ /// <summary>
+ /// Get an EncodeJob model for a LibHB Encode.
+ /// </summary>
+ /// <param name="task">
+ /// The task.
+ /// </param>
+ /// <returns>
+ /// An Interop.EncodeJob model.
+ /// </returns>
+ public static EncodeJob GetEncodeJob(EncodeTask task)
+ {
// The current Job Configuration
- EncodeTask work = task.Task;
+ EncodeTask work = task;
// Which will be converted to this EncodeJob Model.
EncodeJob job = new EncodeJob();