diff options
author | sr55 <[email protected]> | 2013-11-19 23:18:43 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2013-11-19 23:18:43 +0000 |
commit | acc52477100589c854cd3410a09949dd86fac754 (patch) | |
tree | bf4658ab3770f0541a5be78498a5cecc7687484f /win/CS/HandBrakeWPF/ViewModels | |
parent | c32a46c925608e51be9edcd6b5647c50124dd16a (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/HandBrakeWPF/ViewModels')
3 files changed, 109 insertions, 12 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IStaticPreviewViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IStaticPreviewViewModel.cs new file mode 100644 index 000000000..91c75fe45 --- /dev/null +++ b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IStaticPreviewViewModel.cs @@ -0,0 +1,27 @@ +// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="IStaticPreviewViewModel.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// The Static Preview View Model Interface
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.ViewModels.Interfaces
+{
+ using System.Windows.Media.Imaging;
+
+ /// <summary>
+ /// The Static Preview View Model Interface
+ /// </summary>
+ public interface IStaticPreviewViewModel
+ {
+ /// <summary>
+ /// The preview frame.
+ /// </summary>
+ /// <param name="image">
+ /// The image.
+ /// </param>
+ void PreviewFrame(BitmapImage image);
+ }
+}
diff --git a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs index 59ce20942..2cde191f5 100644 --- a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs @@ -12,6 +12,7 @@ namespace HandBrakeWPF.ViewModels using System;
using System.Collections.Generic;
using System.Globalization;
+ using System.Windows.Media.Imaging;
using Caliburn.Micro;
@@ -109,13 +110,7 @@ namespace HandBrakeWPF.ViewModels /// <summary>
/// Initializes a new instance of the <see cref="HandBrakeWPF.ViewModels.PictureSettingsViewModel"/> class.
/// </summary>
- /// <param name="windowManager">
- /// The window manager.
- /// </param>
- /// <param name="userSettingService">
- /// The user Setting Service.
- /// </param>
- public PictureSettingsViewModel(IWindowManager windowManager, IUserSettingService userSettingService)
+ public PictureSettingsViewModel()
{
this.Task = new EncodeTask();
this.SelectedModulus = 16;
@@ -131,6 +126,11 @@ namespace HandBrakeWPF.ViewModels #region Properties
/// <summary>
+ /// Gets or sets the static preview view model.
+ /// </summary>
+ public IStaticPreviewViewModel StaticPreviewViewModel { get; set; }
+
+ /// <summary>
/// Gets AnamorphicModes.
/// </summary>
public IEnumerable<Anamorphic> AnamorphicModes
@@ -595,9 +595,7 @@ namespace HandBrakeWPF.ViewModels #endregion
- #region Implemented Interfaces
-
- #region ITabInterface
+ #region Public Methods
/// <summary>
/// Setup this tab for the specified preset.
@@ -802,7 +800,21 @@ namespace HandBrakeWPF.ViewModels this.NotifyOfPropertyChange(() => this.Task);
}
- #endregion
+ /// <summary>
+ /// The preview image.
+ /// Experimental Feature => In-Progress
+ /// </summary>
+ public void PreviewImage()
+ {
+ IScan scanService = IoC.Get<IScan>();
+ BitmapImage image = scanService.GetPreview(this.Task, 5);
+
+ if (image != null)
+ {
+ this.StaticPreviewViewModel.PreviewFrame(image);
+ this.WindowManager.ShowDialog(this.StaticPreviewViewModel);
+ }
+ }
#endregion
@@ -1164,6 +1176,6 @@ namespace HandBrakeWPF.ViewModels return job;
}
- #endregion
+ #endregion
}
}
\ No newline at end of file diff --git a/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs new file mode 100644 index 000000000..dc851864a --- /dev/null +++ b/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs @@ -0,0 +1,58 @@ +// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="StaticPreviewViewModel.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// The Static Preview View Model
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.ViewModels
+{
+ using System.Windows.Media.Imaging;
+
+ using HandBrakeWPF.ViewModels.Interfaces;
+
+ /// <summary>
+ /// The Static Preview View Model
+ /// </summary>
+ public class StaticPreviewViewModel : ViewModelBase, IStaticPreviewViewModel
+ {
+ /// <summary>
+ /// The preview image.
+ /// </summary>
+ private BitmapImage previewImage;
+
+ /// <summary>
+ /// Gets or sets the preview image.
+ /// </summary>
+ public BitmapImage PreviewImage
+ {
+ get
+ {
+ return this.previewImage;
+ }
+ set
+ {
+ if (Equals(value, this.previewImage))
+ {
+ return;
+ }
+
+ this.previewImage = value;
+ this.NotifyOfPropertyChange(() => this.PreviewImage);
+ }
+ }
+
+ /// <summary>
+ /// The preview frame.
+ /// </summary>
+ /// <param name="image">
+ /// The image.
+ /// </param>
+ public void PreviewFrame(BitmapImage image)
+ {
+ this.PreviewImage = image;
+ }
+ }
+}
|