summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/ViewModels
diff options
context:
space:
mode:
authorsr55 <[email protected]>2014-01-25 21:12:38 +0000
committersr55 <[email protected]>2014-01-25 21:12:38 +0000
commitc70a9eb8cd000862c0f31db19e800a312b2b296e (patch)
treecdf5200cbee8b277d43520cb92a411d4158c39e3 /win/CS/HandBrakeWPF/ViewModels
parent0bc190da0afda80b9a40b6d24a5416c568c23fa0 (diff)
WinGui: Tidy up a few cosmetic issues and enable the picture preview code in the background so it can get some testing.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5991 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels')
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/Interfaces/IStaticPreviewViewModel.cs7
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs21
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs21
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/ViewModelBase.cs2
4 files changed, 11 insertions, 40 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IStaticPreviewViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IStaticPreviewViewModel.cs
index a0374b5f1..a1d6b465c 100644
--- a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IStaticPreviewViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IStaticPreviewViewModel.cs
@@ -9,8 +9,6 @@
namespace HandBrakeWPF.ViewModels.Interfaces
{
- using System.Windows.Media.Imaging;
-
using HandBrake.ApplicationServices.Model;
/// <summary>
@@ -21,12 +19,9 @@ namespace HandBrakeWPF.ViewModels.Interfaces
/// <summary>
/// The preview frame.
/// </summary>
- /// <param name="image">
- /// The image.
- /// </param>
/// <param name="task">
/// The task.
/// </param>
- void PreviewFrame(BitmapImage image, EncodeTask task);
+ void UpdatePreviewFrame(EncodeTask task);
}
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs
index 9b95d0393..c051b0aad 100644
--- a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs
@@ -823,12 +823,9 @@ namespace HandBrakeWPF.ViewModels
/// </summary>
public void PreviewImage()
{
- IScan scanService = IoC.Get<IScan>();
- BitmapImage image = scanService.GetPreview(this.Task, 1);
-
- if (image != null)
+ if (!string.IsNullOrEmpty(this.Task.Source))
{
- this.StaticPreviewViewModel.PreviewFrame(image, this.Task);
+ this.StaticPreviewViewModel.UpdatePreviewFrame(this.Task);
this.WindowManager.ShowWindow(this.StaticPreviewViewModel);
}
}
@@ -1200,19 +1197,9 @@ namespace HandBrakeWPF.ViewModels
/// </summary>
private void UpdatePreviewImage()
{
- return;
- if (delayedPreviewprocessor != null)
+ if (delayedPreviewprocessor != null && this.Task != null)
{
- delayedPreviewprocessor.PerformTask(() =>
- {
- IScan scanService = IoC.Get<IScan>();
- BitmapImage image = scanService.GetPreview(this.Task, 1);
-
- if (image != null)
- {
- this.StaticPreviewViewModel.PreviewFrame(image, this.Task);
- }
- }, 800);
+ delayedPreviewprocessor.PerformTask(() => this.StaticPreviewViewModel.UpdatePreviewFrame(this.Task), 800);
}
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs
index d836f6d49..fd683fc2a 100644
--- a/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs
@@ -172,21 +172,11 @@ namespace HandBrakeWPF.ViewModels
#region Public Methods and Operators
- /// <summary>
- /// The preview frame.
- /// </summary>
- /// <param name="image">
- /// The image.
- /// </param>
- /// <param name="task">
- /// The task.
- /// </param>
- public void PreviewFrame(BitmapImage image, EncodeTask task)
+ public void UpdatePreviewFrame(EncodeTask task)
{
this.Task = task;
- this.Width = (int)Math.Ceiling(image.Width);
- this.Height = (int)Math.Ceiling(image.Height);
- this.PreviewImage = image;
+ this.UpdatePreviewFrame();
+ this.DisplayName = "Picture Preview";
}
/// <summary>
@@ -198,10 +188,11 @@ namespace HandBrakeWPF.ViewModels
if (image != null)
{
- this.PreviewFrame(image, this.Task);
+ this.Width = (int)Math.Ceiling(image.Width);
+ this.Height = (int)Math.Ceiling(image.Height);
+ this.PreviewImage = image;
}
}
-
#endregion
}
} \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/ViewModels/ViewModelBase.cs b/win/CS/HandBrakeWPF/ViewModels/ViewModelBase.cs
index 301e161dd..1e6946b8a 100644
--- a/win/CS/HandBrakeWPF/ViewModels/ViewModelBase.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/ViewModelBase.cs
@@ -11,8 +11,6 @@ namespace HandBrakeWPF.ViewModels
{
using Caliburn.Micro;
- using HandBrake.ApplicationServices.Services.Interfaces;
-
using HandBrakeWPF.Helpers;
using HandBrakeWPF.Services.Interfaces;
using HandBrakeWPF.ViewModels.Interfaces;