summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/ViewModels
diff options
context:
space:
mode:
authorsr55 <[email protected]>2015-01-19 21:55:29 +0000
committersr55 <[email protected]>2015-01-19 21:55:29 +0000
commit50445c5138c234e860dcf8b54134aa6668c896df (patch)
treea9f4215d3354b1d0c6bf7a8e5550d680d1d3b8c8 /win/CS/HandBrakeWPF/ViewModels
parente92de31ae2e15317e95c5ecf13a2105916348881 (diff)
WinGui: Quick Fix for the batch encoding with libhb mode.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6775 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels')
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs10
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs5
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs5
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/EncoderOptionsViewModel.cs6
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/FiltersViewModel.cs5
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/Interfaces/IStaticPreviewViewModel.cs7
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/Interfaces/ITabInterface.cs6
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs19
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs14
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs14
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs5
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs5
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/X264ViewModel.cs5
13 files changed, 77 insertions, 29 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs
index 6f2dee1a0..e01a38210 100644
--- a/win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs
@@ -9,7 +9,6 @@
namespace HandBrakeWPF.ViewModels
{
- using HandBrake.ApplicationServices.Model;
using HandBrake.ApplicationServices.Services.Encode.Model;
using HandBrake.ApplicationServices.Services.Scan.Model;
using HandBrake.Interop.Model.Encoding;
@@ -148,6 +147,9 @@ namespace HandBrakeWPF.ViewModels
/// <summary>
/// Setup this window for a new source
/// </summary>
+ /// <param name="source">
+ /// The source.
+ /// </param>
/// <param name="title">
/// The title.
/// </param>
@@ -157,10 +159,10 @@ namespace HandBrakeWPF.ViewModels
/// <param name="task">
/// The task.
/// </param>
- public void SetSource(Title title, Preset preset, EncodeTask task)
+ public void SetSource(Source source, Title title, Preset preset, EncodeTask task)
{
- this.EncoderOptionsViewModel.SetSource(title, preset, task);
- this.X264ViewModel.SetSource(title, preset, task);
+ this.EncoderOptionsViewModel.SetSource(source, title, preset, task);
+ this.X264ViewModel.SetSource(source, title, preset, task);
}
#endregion
diff --git a/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs
index b0e30f3ac..22a7094e7 100644
--- a/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs
@@ -400,6 +400,9 @@ namespace HandBrakeWPF.ViewModels
/// <summary>
/// Set the Source Title
/// </summary>
+ /// <param name="source">
+ /// The source.
+ /// </param>
/// <param name="title">
/// The title.
/// </param>
@@ -409,7 +412,7 @@ namespace HandBrakeWPF.ViewModels
/// <param name="task">
/// The task.
/// </param>
- public void SetSource(Title title, Preset preset, EncodeTask task)
+ public void SetSource(Source source, Title title, Preset preset, EncodeTask task)
{
this.SourceTracks = title.AudioTracks;
diff --git a/win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs
index a965440df..0e889d176 100644
--- a/win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs
@@ -194,6 +194,9 @@ namespace HandBrakeWPF.ViewModels
/// <summary>
/// Setup this window for a new source
/// </summary>
+ /// <param name="source">
+ /// The source.
+ /// </param>
/// <param name="title">
/// The title.
/// </param>
@@ -203,7 +206,7 @@ namespace HandBrakeWPF.ViewModels
/// <param name="task">
/// The task.
/// </param>
- public void SetSource(Title title, Preset preset, EncodeTask task)
+ public void SetSource(Source source, Title title, Preset preset, EncodeTask task)
{
this.Task = task;
this.NotifyOfPropertyChange(() => this.Task);
diff --git a/win/CS/HandBrakeWPF/ViewModels/EncoderOptionsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/EncoderOptionsViewModel.cs
index 12ba85a49..ae9cc386f 100644
--- a/win/CS/HandBrakeWPF/ViewModels/EncoderOptionsViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/EncoderOptionsViewModel.cs
@@ -11,7 +11,6 @@ namespace HandBrakeWPF.ViewModels
{
using System.Collections.Generic;
- using HandBrake.ApplicationServices.Model;
using HandBrake.ApplicationServices.Services.Encode.Model;
using HandBrake.ApplicationServices.Services.Scan.Model;
using HandBrake.Interop.Model.Encoding;
@@ -71,6 +70,9 @@ namespace HandBrakeWPF.ViewModels
/// <summary>
/// The set source.
/// </summary>
+ /// <param name="source">
+ /// The source.
+ /// </param>
/// <param name="selectedTitle">
/// The selected title.
/// </param>
@@ -80,7 +82,7 @@ namespace HandBrakeWPF.ViewModels
/// <param name="task">
/// The task.
/// </param>
- public void SetSource(Title selectedTitle, Preset currentPreset, EncodeTask task)
+ public void SetSource(Source source, Title selectedTitle, Preset currentPreset, EncodeTask task)
{
this.Task = task;
this.Preset = currentPreset;
diff --git a/win/CS/HandBrakeWPF/ViewModels/FiltersViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/FiltersViewModel.cs
index 0a983348e..84b649b21 100644
--- a/win/CS/HandBrakeWPF/ViewModels/FiltersViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/FiltersViewModel.cs
@@ -550,6 +550,9 @@ namespace HandBrakeWPF.ViewModels
/// <summary>
/// Setup this window for a new source
/// </summary>
+ /// <param name="source">
+ /// The source.
+ /// </param>
/// <param name="title">
/// The title.
/// </param>
@@ -559,7 +562,7 @@ namespace HandBrakeWPF.ViewModels
/// <param name="task">
/// The task.
/// </param>
- public void SetSource(Title title, Preset preset, EncodeTask task)
+ public void SetSource(Source source, Title title, Preset preset, EncodeTask task)
{
this.CurrentTask = task;
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IStaticPreviewViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IStaticPreviewViewModel.cs
index 448faca36..aa2ba9d1b 100644
--- a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IStaticPreviewViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IStaticPreviewViewModel.cs
@@ -9,8 +9,8 @@
namespace HandBrakeWPF.ViewModels.Interfaces
{
- using HandBrake.ApplicationServices.Model;
using HandBrake.ApplicationServices.Services.Encode.Model;
+ using HandBrake.ApplicationServices.Services.Scan.Model;
/// <summary>
/// The Static Preview View Model Interface
@@ -23,7 +23,10 @@ namespace HandBrakeWPF.ViewModels.Interfaces
/// <param name="task">
/// The task.
/// </param>
- void UpdatePreviewFrame(EncodeTask task);
+ /// <param name="scannedSource">
+ /// The scanned Source.
+ /// </param>
+ void UpdatePreviewFrame(EncodeTask task, Source scannedSource);
/// <summary>
/// Gets or sets a value indicating whether is open.
diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/ITabInterface.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/ITabInterface.cs
index 437534181..43a536ab4 100644
--- a/win/CS/HandBrakeWPF/ViewModels/Interfaces/ITabInterface.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/Interfaces/ITabInterface.cs
@@ -9,7 +9,6 @@
namespace HandBrakeWPF.ViewModels.Interfaces
{
- using HandBrake.ApplicationServices.Model;
using HandBrake.ApplicationServices.Services.Encode.Model;
using HandBrake.ApplicationServices.Services.Scan.Model;
@@ -23,6 +22,9 @@ namespace HandBrakeWPF.ViewModels.Interfaces
/// <summary>
/// Setup the window after a scan.
/// </summary>
+ /// <param name="source">
+ /// The source.
+ /// </param>
/// <param name="selectedTitle">
/// The selected title.
/// </param>
@@ -32,7 +34,7 @@ namespace HandBrakeWPF.ViewModels.Interfaces
/// <param name="task">
/// The task.
/// </param>
- void SetSource(Title selectedTitle, Preset currentPreset, EncodeTask task);
+ void SetSource(Source source, Title selectedTitle, Preset currentPreset, EncodeTask task);
/// <summary>
/// Set the selected preset
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
index 788b2ba0f..523f07312 100644
--- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
@@ -1166,7 +1166,7 @@ namespace HandBrakeWPF.ViewModels
if (!string.IsNullOrEmpty(this.CurrentTask.Source))
{
this.StaticPreviewViewModel.IsOpen = true;
- this.StaticPreviewViewModel.UpdatePreviewFrame(this.CurrentTask);
+ this.StaticPreviewViewModel.UpdatePreviewFrame(this.CurrentTask, this.ScannedSource);
this.WindowManager.ShowWindow(this.StaticPreviewViewModel);
}
}
@@ -1229,7 +1229,7 @@ namespace HandBrakeWPF.ViewModels
return false;
}
- QueueTask task = new QueueTask(new EncodeTask(this.CurrentTask), HBConfigurationFactory.Create());
+ QueueTask task = new QueueTask(new EncodeTask(this.CurrentTask), HBConfigurationFactory.Create(), this.ScannedSource);
if (!this.queueProcessor.CheckForDestinationPathDuplicates(task.Task.Destination))
{
@@ -1813,6 +1813,7 @@ namespace HandBrakeWPF.ViewModels
/// </param>
private void QueueEditAction(bool successful)
{
+ /* TODO Fix this. */
Execute.OnUIThread(() =>
{
// Copy all the Scan data into the UI
@@ -1903,13 +1904,13 @@ namespace HandBrakeWPF.ViewModels
// Setup the Tabs
if (this.selectedTitle != null)
{
- this.PictureSettingsViewModel.SetSource(this.SelectedTitle, this.SelectedPreset, this.CurrentTask);
- this.VideoViewModel.SetSource(this.SelectedTitle, this.SelectedPreset, this.CurrentTask);
- this.FiltersViewModel.SetSource(this.SelectedTitle, this.SelectedPreset, this.CurrentTask);
- this.AudioViewModel.SetSource(this.SelectedTitle, this.SelectedPreset, this.CurrentTask);
- this.SubtitleViewModel.SetSource(this.SelectedTitle, this.SelectedPreset, this.CurrentTask);
- this.ChaptersViewModel.SetSource(this.SelectedTitle, this.SelectedPreset, this.CurrentTask);
- this.AdvancedViewModel.SetSource(this.SelectedTitle, this.SelectedPreset, this.CurrentTask);
+ this.PictureSettingsViewModel.SetSource(this.ScannedSource, this.SelectedTitle, this.SelectedPreset, this.CurrentTask);
+ this.VideoViewModel.SetSource(this.ScannedSource, this.SelectedTitle, this.SelectedPreset, this.CurrentTask);
+ this.FiltersViewModel.SetSource(this.ScannedSource, this.SelectedTitle, this.SelectedPreset, this.CurrentTask);
+ this.AudioViewModel.SetSource(this.ScannedSource, this.SelectedTitle, this.SelectedPreset, this.CurrentTask);
+ this.SubtitleViewModel.SetSource(this.ScannedSource, this.SelectedTitle, this.SelectedPreset, this.CurrentTask);
+ this.ChaptersViewModel.SetSource(this.ScannedSource, this.SelectedTitle, this.SelectedPreset, this.CurrentTask);
+ this.AdvancedViewModel.SetSource(this.ScannedSource, this.SelectedTitle, this.SelectedPreset, this.CurrentTask);
}
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs
index 3a1df33bf..56ceacf71 100644
--- a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs
@@ -112,6 +112,11 @@ namespace HandBrakeWPF.ViewModels
/// </summary>
private Title currentTitle;
+ /// <summary>
+ /// The scanned source.
+ /// </summary>
+ private Source scannedSource;
+
#endregion
#region Constructors and Destructors
@@ -701,6 +706,9 @@ namespace HandBrakeWPF.ViewModels
/// <summary>
/// Setup this window for a new source
/// </summary>
+ /// <param name="source">
+ /// The source.
+ /// </param>
/// <param name="title">
/// The title.
/// </param>
@@ -710,11 +718,13 @@ namespace HandBrakeWPF.ViewModels
/// <param name="task">
/// The task.
/// </param>
- public void SetSource(Title title, Preset preset, EncodeTask task)
+ public void SetSource(Source source, Title title, Preset preset, EncodeTask task)
{
this.currentTitle = title;
this.Task = task;
+ this.scannedSource = source;
+
if (title != null)
{
// Set cached info
@@ -956,7 +966,7 @@ namespace HandBrakeWPF.ViewModels
// Step 5, Update the Preview
if (delayedPreviewprocessor != null && this.Task != null && this.StaticPreviewViewModel != null && this.StaticPreviewViewModel.IsOpen)
{
- delayedPreviewprocessor.PerformTask(() => this.StaticPreviewViewModel.UpdatePreviewFrame(this.Task), 800);
+ delayedPreviewprocessor.PerformTask(() => this.StaticPreviewViewModel.UpdatePreviewFrame(this.Task, this.scannedSource), 800);
}
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs
index d360ab0ea..a05ea2194 100644
--- a/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs
@@ -26,6 +26,7 @@ namespace HandBrakeWPF.ViewModels
using HandBrake.ApplicationServices.Services.Encode.Model.Models;
using HandBrake.ApplicationServices.Services.Interfaces;
using HandBrake.ApplicationServices.Services.Scan.Interfaces;
+ using HandBrake.ApplicationServices.Services.Scan.Model;
using HandBrake.Interop.Model.Encoding;
using HandBrakeWPF.Factories;
@@ -218,6 +219,11 @@ namespace HandBrakeWPF.ViewModels
public EncodeTask Task { get; set; }
/// <summary>
+ /// Gets or sets the scanned source.
+ /// </summary>
+ public Source ScannedSource { get; set; }
+
+ /// <summary>
/// Gets the total previews.
/// </summary>
public int TotalPreviews
@@ -395,12 +401,16 @@ namespace HandBrakeWPF.ViewModels
/// <param name="task">
/// The task.
/// </param>
- public void UpdatePreviewFrame(EncodeTask task)
+ /// <param name="scannedSource">
+ /// The scanned Source.
+ /// </param>
+ public void UpdatePreviewFrame(EncodeTask task, Source scannedSource)
{
this.Task = task;
this.UpdatePreviewFrame();
this.DisplayName = "Picture Preview";
this.Title = Properties.Resources.Preview;
+ this.ScannedSource = scannedSource;
}
/// <summary>
@@ -543,7 +553,7 @@ namespace HandBrakeWPF.ViewModels
encodeTask.IsPreviewEncode = true;
encodeTask.PreviewEncodeStartAt = this.SelectedPreviewImage; // TODO 0 and 1 mean the same. Need to fix this as it knocks the video out of sync with the still preview.
encodeTask.PreviewEncodeDuration = this.Duration;
- QueueTask task = new QueueTask(encodeTask, HBConfigurationFactory.Create());
+ QueueTask task = new QueueTask(encodeTask, HBConfigurationFactory.Create(), this.ScannedSource);
ThreadPool.QueueUserWorkItem(this.CreatePreview, task);
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs
index 7d0b16cdb..660c99843 100644
--- a/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs
@@ -531,6 +531,9 @@ namespace HandBrakeWPF.ViewModels
/// <summary>
/// Setup this window for a new source
/// </summary>
+ /// <param name="source">
+ /// The source.
+ /// </param>
/// <param name="title">
/// The title.
/// </param>
@@ -540,7 +543,7 @@ namespace HandBrakeWPF.ViewModels
/// <param name="task">
/// The task.
/// </param>
- public void SetSource(Title title, Preset preset, EncodeTask task)
+ public void SetSource(Source source, Title title, Preset preset, EncodeTask task)
{
this.SourceTracks.Clear();
this.SourceTracks.Add(ForeignAudioSearchTrack);
diff --git a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs
index 8b745aa3c..7060530ef 100644
--- a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs
@@ -1059,6 +1059,9 @@ namespace HandBrakeWPF.ViewModels
/// <summary>
/// Setup this window for a new source
/// </summary>
+ /// <param name="source">
+ /// The source.
+ /// </param>
/// <param name="title">
/// The title.
/// </param>
@@ -1068,7 +1071,7 @@ namespace HandBrakeWPF.ViewModels
/// <param name="task">
/// The task.
/// </param>
- public void SetSource(Title title, Preset preset, EncodeTask task)
+ public void SetSource(Source source, Title title, Preset preset, EncodeTask task)
{
this.Task = task;
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/X264ViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/X264ViewModel.cs
index 69e4a0f33..2647e2ae8 100644
--- a/win/CS/HandBrakeWPF/ViewModels/X264ViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/X264ViewModel.cs
@@ -962,6 +962,9 @@ namespace HandBrakeWPF.ViewModels
/// <summary>
/// Setup this window for a new source
/// </summary>
+ /// <param name="source">
+ /// The source.
+ /// </param>
/// <param name="title">
/// The title.
/// </param>
@@ -971,7 +974,7 @@ namespace HandBrakeWPF.ViewModels
/// <param name="task">
/// The task.
/// </param>
- public void SetSource(Title title, Preset preset, EncodeTask task)
+ public void SetSource(Source source, Title title, Preset preset, EncodeTask task)
{
this.Task = task;
this.NotifyOfPropertyChange(() => this.AdvancedOptionsString);