\r
using HandBrake.ApplicationServices.Model;\r
\r
+ using HandBrakeWPF.Services.Presets.Model;\r
using HandBrakeWPF.Utilities;\r
\r
using EncodeTask = HandBrakeWPF.Services.Encode.Model.EncodeTask;\r
{\r
private static int id;\r
private QueueItemStatus status;\r
+ private string presetKey;\r
\r
#region Properties\r
\r
/// <param name="scannedSourcePath">\r
/// The scanned Source Path.\r
/// </param>\r
- public QueueTask(EncodeTask task, HBConfiguration configuration, string scannedSourcePath)\r
+ /// <param name="currentPreset">\r
+ /// The currently active preset.\r
+ /// </param>\r
+ public QueueTask(EncodeTask task, HBConfiguration configuration, string scannedSourcePath, Preset currentPreset)\r
{\r
this.Task = task;\r
this.Configuration = configuration;\r
this.Status = QueueItemStatus.Waiting;\r
this.ScannedSourcePath = scannedSourcePath;\r
+ if (currentPreset != null)\r
+ {\r
+ this.presetKey = currentPreset.Name;\r
+ }\r
\r
id = id + 1;\r
this.Id = string.Format("{0}.{1}", GeneralUtilities.ProcessId, id);\r
\r
public QueueStats Statistics { get; set; }\r
\r
+ public string SelectedPresetKey\r
+ {\r
+ get\r
+ {\r
+ return this.presetKey;\r
+ }\r
+ }\r
+\r
#endregion\r
\r
protected bool Equals(QueueTask other)\r
private bool isEncoding;\r
private bool showStatusWindow;\r
private Preset selectedPreset;\r
- private EncodeTask queueEditTask;\r
+ private QueueTask queueEditTask;\r
private int lastEncodePercentage;\r
private bool isPresetPanelShowing;\r
private bool showSourceSelection;\r
return false;\r
}\r
\r
- QueueTask task = new QueueTask(new EncodeTask(this.CurrentTask), HBConfigurationFactory.Create(), this.ScannedSource.ScanPath);\r
+ QueueTask task = new QueueTask(new EncodeTask(this.CurrentTask), HBConfigurationFactory.Create(), this.ScannedSource.ScanPath, this.SelectedPreset);\r
\r
if (!this.queueProcessor.CheckForDestinationPathDuplicates(task.Task.Destination))\r
{\r
/// <summary>\r
/// Edit a Queue Task\r
/// </summary>\r
- /// <param name="task">\r
+ /// <param name="queueTask">\r
/// The task.\r
/// </param>\r
- public void EditQueueJob(EncodeTask task)\r
+ public void EditQueueJob(QueueTask queueTask)\r
{\r
// Rescan the source to make sure it's still valid\r
- this.queueEditTask = task;\r
+ EncodeTask task = queueTask.Task;\r
+\r
+ this.queueEditTask = queueTask;\r
this.scanService.Scan(task.Source, task.Title, QueueEditAction, HBConfigurationFactory.Create());\r
}\r
\r
/* TODO Fix this. */\r
Execute.OnUIThread(() =>\r
{\r
+ if (this.queueEditTask != null && this.selectedPreset.Name != this.queueEditTask.SelectedPresetKey)\r
+ {\r
+ Preset foundPreset = this.presetService.GetPreset(this.queueEditTask.SelectedPresetKey);\r
+ if (foundPreset != null)\r
+ {\r
+ this.selectedPreset = foundPreset;\r
+ this.NotifyOfPropertyChange(() => this.SelectedPreset);\r
+ }\r
+ }\r
+\r
// Copy all the Scan data into the UI\r
scannedSource.CopyTo(this.ScannedSource);\r
this.NotifyOfPropertyChange(() => this.ScannedSource);\r
\r
// Select the Users Title\r
this.SelectedTitle = this.ScannedSource.Titles.FirstOrDefault();\r
- this.CurrentTask = new EncodeTask(queueEditTask);\r
+ this.CurrentTask = new EncodeTask(this.queueEditTask.Task);\r
this.NotifyOfPropertyChange(() => this.CurrentTask);\r
this.HasSource = true;\r
\r
this.SelectedEndPoint = end;\r
\r
// Update the Tab Controls\r
+ this.SummaryViewModel.UpdateTask(this.CurrentTask);\r
this.PictureSettingsViewModel.UpdateTask(this.CurrentTask);\r
this.VideoViewModel.UpdateTask(this.CurrentTask);\r
this.FiltersViewModel.UpdateTask(this.CurrentTask);\r
this.ChaptersViewModel.UpdateTask(this.CurrentTask);\r
this.AdvancedViewModel.UpdateTask(this.CurrentTask);\r
this.MetaDataViewModel.UpdateTask(this.CurrentTask);\r
- this.SummaryViewModel.UpdateTask(this.CurrentTask);\r
-\r
+ \r
// Cleanup\r
this.ShowStatusWindow = false;\r
this.SourceLabel = this.SourceName;\r
{
get
{
- return this.isMkv;
- }
- set
- {
- this.isMkv = value;
- this.NotifyOfPropertyChange(() => this.IsMkv);
+ return this.SelectedOutputFormat == OutputFormat.Mkv;
}
}
newExtension = ".m4v";
break;
}
-
- this.IsMkv = false;
}
// Now disable controls that are not required. The Following are for MP4 only!
if (newExtension == ".mkv")
{
- this.IsMkv = true;
this.OptimizeMP4 = false;
this.IPod5GSupport = false;
this.AlignAVStart = false;
}
+ this.NotifyOfPropertyChange(() => this.IsMkv);
+
// Update The browse file extension display
if (Path.HasExtension(newExtension))
{