]> granicus.if.org Git - handbrake/commitdiff
WinGuWinGui:(WPF) Remove some legacy queue code with the queue models and fix up...
authorsr55 <sr55.hb@outlook.com>
Sun, 25 Mar 2012 18:14:10 +0000 (18:14 +0000)
committersr55 <sr55.hb@outlook.com>
Sun, 25 Mar 2012 18:14:10 +0000 (18:14 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4542 b64f7644-9d1e-0410-96f1-a4d463321fa5

14 files changed:
win/CS/Functions/QueryGenerator.cs
win/CS/HandBrake.ApplicationServices/ASUserSettingConstants.cs
win/CS/HandBrake.ApplicationServices/Model/QueueTask.cs
win/CS/HandBrake.ApplicationServices/Services/Base/EncodeBase.cs
win/CS/HandBrake.ApplicationServices/Services/QueueManager.cs
win/CS/HandBrake.ApplicationServices/Services/QueueProcessor.cs
win/CS/HandBrake.ApplicationServices/Services/UserSettingService.cs
win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs
win/CS/HandBrakeWPF/defaultsettings.xml
win/CS/defaultsettings.xml
win/CS/frmMain.cs
win/CS/frmPreview.cs
win/CS/frmQueue.cs

index 729cfe17eeda9d84b77c9e513ee9811a07a2eede..31082711f311d3b318c8e28ec6d72c8736915e1d 100644 (file)
@@ -132,9 +132,6 @@ namespace Handbrake.Functions
             EncodeTask task = CreateEncodeTaskObject(mainWindow);\r
             QueueTask queueTask = new QueueTask(query)\r
             {\r
-                Source = task.Source,\r
-                Destination = task.Destination,\r
-                Title = mainWindow.GetTitle(),\r
                 CustomQuery = (mainWindow.rtf_query.Text != string.Empty) || isCustom,\r
                 Task = task,\r
                 Query = query,\r
index 0600de5d0be9d52bd6648442bd7d19066f957b0c..e05e37aa91fc2571dbc11f19f3294b4a3dee8192 100644 (file)
@@ -119,5 +119,10 @@ namespace HandBrake.ApplicationServices
         /// Preview Scan Count\r
         /// </summary>\r
         public const string PreviewScanCount = "previewScanCount";\r
+\r
+        /// <summary>\r
+        /// Clear completed items from the queue automatically.\r
+        /// </summary>\r
+        public const string ClearCompletedFromQueue = "ClearCompletedFromQueue";\r
     }\r
 }\r
index f0514805c86d2fda48f3bb4ee2dd39b18678dab0..6848ce3ab1d667a83cc6609eb3febc5b1cd40bcb 100644 (file)
@@ -50,38 +50,11 @@ namespace HandBrake.ApplicationServices.Model
         /// </summary>\r
         public bool CustomQuery { get; set; }\r
 \r
-        /// <summary>\r
-        /// Gets or sets Destination.\r
-        /// </summary>\r
-        public string Destination { get; set; }\r
-\r
-        /// <summary>\r
-        /// Gets or sets the job ID.\r
-        /// </summary>\r
-        public int Id { get; set; }\r
-\r
-        /// <summary>\r
-        /// Gets a value indicating whether or not this instance is empty.\r
-        /// </summary>\r
-        public bool IsEmpty\r
-        {\r
-            get\r
-            {\r
-                return this.Id == 0 && string.IsNullOrEmpty(this.Query) && string.IsNullOrEmpty(this.Task.Source) &&\r
-                       string.IsNullOrEmpty(this.Task.Destination);\r
-            }\r
-        }\r
-\r
         /// <summary>\r
         /// Gets or sets the query string.\r
         /// </summary>\r
         public string Query { get; set; }\r
 \r
-        /// <summary>\r
-        /// Gets or sets Source.\r
-        /// </summary>\r
-        public string Source { get; set; }\r
-\r
         /// <summary>\r
         /// Gets or sets Status.\r
         /// </summary>\r
@@ -104,11 +77,6 @@ namespace HandBrake.ApplicationServices.Model
         /// </summary>\r
         public EncodeTask Task { get; set; }\r
 \r
-        /// <summary>\r
-        /// Gets or sets Title.\r
-        /// </summary>\r
-        public int Title { get; set; }\r
-\r
         #endregion\r
     }\r
 }
\ No newline at end of file
index e2eacce728f30d4ec3fd2cac8fcb2fd46d8db970..d57f3a51f25070f1e33f6dc0d7b2555ea54c968b 100644 (file)
@@ -366,7 +366,7 @@ namespace HandBrake.ApplicationServices.Services.Base
             // Make sure the path exists, attempt to create it if it doesn't\r
             try\r
             {\r
-                string path = Directory.GetParent(task.Destination ?? task.Task.Destination).ToString();\r
+                string path = Directory.GetParent(task.Task.Destination).ToString();\r
                 if (!Directory.Exists(path))\r
                 {\r
                     Directory.CreateDirectory(path);\r
index 7c60d1e86cb975646a6f3e578a20062cdad53186..1ce362449d022e2e77c3ab764eb06365c76c2a31 100644 (file)
@@ -154,8 +154,6 @@ namespace HandBrake.ApplicationServices.Services
         {\r
             lock (QueueLock)\r
             {\r
-                // Tag the job with an ID\r
-                job.Id = lastJobId++;\r
                 queue.Add(job);\r
                 InvokeQueueChanged(EventArgs.Empty);\r
             }\r
@@ -366,7 +364,7 @@ namespace HandBrake.ApplicationServices.Services
         /// <returns>Whether or not the supplied destination is already in the queue.</returns>\r
         public bool CheckForDestinationPathDuplicates(string destination)\r
         {\r
-            return this.queue.Any(checkItem => checkItem.Destination.Contains(destination.Replace("\\\\", "\\")));\r
+            return this.queue.Any(checkItem => checkItem.Task.Destination.Contains(destination.Replace("\\\\", "\\")));\r
         }\r
 \r
         /// <summary>\r
index ce3a756edb2dc009f6d0ba8c26a4e234ef184d90..1deeb0d44b4345b4c94a2b09dbdadb9ccbd84e7c 100644 (file)
@@ -201,6 +201,12 @@ namespace HandBrake.ApplicationServices.Services
         {\r
             this.QueueManager.LastProcessedJob.Status = QueueItemStatus.Completed;\r
 \r
+            // Clear the completed item of the queue if the setting is set.\r
+            if (userSettingService.GetUserSetting<bool>(ASUserSettingConstants.ClearCompletedFromQueue))\r
+            {\r
+                this.QueueManager.ClearCompleted();\r
+            }\r
+\r
             // Growl\r
             if (userSettingService.GetUserSetting<bool>(ASUserSettingConstants.GrowlEncode))\r
                 GrowlCommunicator.Notify("Encode Completed",\r
@@ -218,12 +224,12 @@ namespace HandBrake.ApplicationServices.Services
             }\r
 \r
             // Handling Log Data \r
-            this.EncodeService.ProcessLogs(this.QueueManager.LastProcessedJob.Destination);\r
+            this.EncodeService.ProcessLogs(this.QueueManager.LastProcessedJob.Task.Destination);\r
 \r
             // Post-Processing\r
             if (e.Successful)\r
             {\r
-                SendToApplication(this.QueueManager.LastProcessedJob.Destination);\r
+                SendToApplication(this.QueueManager.LastProcessedJob.Task.Destination);\r
             }\r
 \r
             // Move onto the next job.\r
index d8e537bdc9de437114e668d629a78ebfa0d773d2..c36b5ec49ac445bfa15ebf87bf583039578ef8b8 100644 (file)
@@ -6,9 +6,9 @@
 namespace HandBrake.ApplicationServices.Services\r
 {\r
     using System;\r
-    using System.Collections.Generic;\r
     using System.Collections.Specialized;\r
     using System.IO;\r
+    using System.Linq;\r
     using System.Windows.Forms;\r
     using System.Xml.Serialization;\r
 \r
@@ -44,7 +44,7 @@ namespace HandBrake.ApplicationServices.Services
             this.Load();\r
             if (userSettings == null || userSettings.Count == 0)\r
             {\r
-                this.LoadDefaults();\r
+                this.userSettings = this.GetDefaults();\r
             }\r
         }\r
 \r
@@ -104,15 +104,25 @@ namespace HandBrake.ApplicationServices.Services
         /// </summary>\r
         private void Save()\r
         {\r
-            string directory = Path.GetDirectoryName(this.settingsFile);\r
-            if (!string.IsNullOrEmpty(directory) && !Directory.Exists(directory))\r
+            try\r
             {\r
-                Directory.CreateDirectory(directory);\r
-            }\r
+                string directory = Path.GetDirectoryName(this.settingsFile);\r
+                if (!string.IsNullOrEmpty(directory) && !Directory.Exists(directory))\r
+                {\r
+                    Directory.CreateDirectory(directory);\r
+                }\r
 \r
-            using (FileStream strm = new FileStream(this.settingsFile, FileMode.Create, FileAccess.Write))\r
+                using (FileStream strm = new FileStream(this.settingsFile, FileMode.Create, FileAccess.Write))\r
+                {\r
+                    serializer.Serialize(strm, this.userSettings);\r
+                }\r
+            }\r
+            catch (Exception exc)\r
             {\r
-                serializer.Serialize(strm, this.userSettings);\r
+                throw new GeneralApplicationException(\r
+                    "A problem occured when trying to save your preferences.",\r
+                    "Any settings you changed may need to be reset the next time HandBrake launches.",\r
+                    exc);\r
             }\r
         }\r
 \r
@@ -129,7 +139,16 @@ namespace HandBrake.ApplicationServices.Services
                     {\r
                         SerializableDictionary<string, object> data = (SerializableDictionary<string, object>)serializer.Deserialize(reader);\r
                         this.userSettings = data;\r
+\r
+                        // Add any new settings\r
+                        SerializableDictionary<string, object> defaults = this.GetDefaults();\r
+                        foreach (var item in defaults.Where(item => !this.userSettings.Keys.Contains(item.Key)))\r
+                        {\r
+                            this.userSettings.Add(item.Key, item.Value);\r
+                        }\r
                     }\r
+\r
+                    this.Save();\r
                 }\r
             }\r
             catch (Exception exc)\r
@@ -144,76 +163,34 @@ namespace HandBrake.ApplicationServices.Services
         /// <summary>\r
         /// Load Default Settings\r
         /// </summary>\r
-        private void LoadDefaults()\r
+        /// <returns>\r
+        /// The get defaults.\r
+        /// </returns>\r
+        private SerializableDictionary<string, object> GetDefaults()\r
         {\r
-            string defaults = Path.Combine(Application.StartupPath, "defaultsettings.xml");\r
-            if (File.Exists(defaults))\r
+            try\r
             {\r
-                using (StreamReader reader = new StreamReader(defaults))\r
+                string defaults = Path.Combine(Application.StartupPath, "defaultsettings.xml");\r
+                if (File.Exists(defaults))\r
                 {\r
-                    SerializableDictionary<string, object> data = (SerializableDictionary<string, object>)serializer.Deserialize(reader);\r
-                    this.userSettings = data;\r
+                    using (StreamReader reader = new StreamReader(defaults))\r
+                    {\r
+                        return (SerializableDictionary<string, object>)serializer.Deserialize(reader);\r
+                    }\r
                 }\r
-            }\r
-        }\r
 \r
-        /// <summary>\r
-        /// This is just a utility method for creating a defaults xml file. Don't use this!!!\r
-        /// </summary>\r
-        private void SetAllDefaults()\r
-        {\r
-            userSettings = new SerializableDictionary<string, object>();\r
-            userSettings[ASUserSettingConstants.X264Step] = 0.25;\r
-            userSettings[ASUserSettingConstants.Verbosity] = 1;\r
-            userSettings[ASUserSettingConstants.WhenCompleteAction] = "Do Nothing";\r
-            userSettings[ASUserSettingConstants.GrowlEncode] = false;\r
-            userSettings[ASUserSettingConstants.GrowlQueue] = false;\r
-            userSettings[ASUserSettingConstants.ProcessPriority] = "Below Normal";\r
-            userSettings[ASUserSettingConstants.PreventSleep] = true;\r
-            userSettings[ASUserSettingConstants.ShowCLI] = false;\r
-            userSettings[ASUserSettingConstants.SaveLogToCopyDirectory] = false;\r
-            userSettings[ASUserSettingConstants.SaveLogWithVideo] = false;\r
-            userSettings[ASUserSettingConstants.DisableLibDvdNav] = false;\r
-            userSettings[ASUserSettingConstants.SendFile] = false;\r
-            userSettings[ASUserSettingConstants.MinScanDuration] = 10;\r
-            userSettings[ASUserSettingConstants.HandBrakeBuild] = 0;\r
-            userSettings[ASUserSettingConstants.HandBrakeVersion] = string.Empty;\r
-            userSettings["updateStatus"] = true;\r
-            userSettings["tooltipEnable"] = true;\r
-            userSettings["defaultPreset"] = string.Empty;\r
-            userSettings["skipversion"] = 0;\r
-            userSettings["autoNaming"] = true;\r
-            userSettings["autoNamePath"] = string.Empty;\r
-            userSettings["appcast_i686"] = "http://handbrake.fr/appcast.i386.xml";\r
-            userSettings["appcast_x64"] = "http://handbrake.fr/appcast_unstable.x86_64.xml";\r
-            userSettings["autoNameFormat"] = "{source}-{title}";\r
-            userSettings["VLC_Path"] = "C:\\Program Files\\VideoLAN\\vlc\\vlc.exe";\r
-            userSettings["MainWindowMinimize"] = true;\r
-            userSettings["QueryEditorTab"] = false;\r
-            userSettings["presetNotification"] = false;\r
-            userSettings["trayIconAlerts"] = true;\r
-            userSettings["lastUpdateCheckDate"] = DateTime.Today;\r
-            userSettings["daysBetweenUpdateCheck"] = 7;\r
-            userSettings["useM4v"] = 0;\r
-            userSettings["PromptOnUnmatchingQueries"] = true;\r
-            userSettings["NativeLanguage"] = "Any";\r
-            userSettings["DubMode"] = 255;\r
-            userSettings["HandBrakeExeHash"] = string.Empty;\r
-            userSettings["previewScanCount"] = 10;\r
-            userSettings["clearOldLogs"] = true;\r
-            userSettings["AutoNameTitleCase"] = true;\r
-            userSettings["AutoNameRemoveUnderscore"] = true;\r
-            userSettings["ActivityWindowLastMode"] = 0;\r
-            userSettings["useClosedCaption"] = false;\r
-            userSettings["batchMinDuration"] = "00:18:00";\r
-            userSettings["batchMaxDuration"] = "02:30:00";\r
-            userSettings["defaultPlayer"] = false;\r
-            userSettings["SelectedLanguages"] = new StringCollection();\r
-            userSettings["DubModeAudio"] = 0;\r
-            userSettings["DubModeSubtitle"] = 0;\r
-            userSettings["addOnlyOneAudioPerLanguage"] = true;\r
-            userSettings["MinTitleLength"] = 10;\r
-            userSettings["ShowAdvancedAudioPassthruOpts"] = false;\r
+                throw new GeneralApplicationException(\r
+                "User default settings file is missing. This install of HandBrake may be corrupted.",\r
+                "Try re-installing HandBrake.",\r
+                null);\r
+            }\r
+            catch (Exception exc)\r
+            {\r
+                throw new GeneralApplicationException(\r
+                   "User default settings file is missing or inaccessible. This install of HandBrake may be corrupted.",\r
+                   "Try re-installing HandBrake.",\r
+                   exc);\r
+            }\r
         }\r
     }\r
 }\r
index 731e7d384fa0bb6d44bccf1abd35ac4f2ae75133..2680029572dde3dbab0575d012b087d78acff127 100644 (file)
@@ -816,7 +816,6 @@ namespace HandBrakeWPF.ViewModels
             // Create the Queue Task and Start Processing\r
             QueueTask task = new QueueTask(null)\r
                 {\r
-                    Destination = this.CurrentTask.Destination,\r
                     Task = this.CurrentTask,\r
                     Query = QueryGeneratorUtility.GenerateQuery(this.CurrentTask),\r
                     CustomQuery = false\r
index 7f7520dc4472010938561d5101a3bb94cd2df2bd..295eb3b3b61cf513f503f127bf584f474c6c0e2e 100644 (file)
@@ -12,6 +12,7 @@ namespace HandBrakeWPF.ViewModels
     using System;\r
     using System.Collections.Generic;\r
     using System.ComponentModel.Composition;\r
+    using System.Globalization;\r
 \r
     using Caliburn.Micro;\r
 \r
@@ -310,8 +311,8 @@ namespace HandBrakeWPF.ViewModels
                     this.ShowPeakFramerate = true;\r
                     if (this.Task.FramerateMode == FramerateMode.VFR)\r
                     {\r
-                        this.Task.FramerateMode = FramerateMode.PFR; \r
-                    } \r
+                        this.Task.FramerateMode = FramerateMode.PFR;\r
+                    }\r
                     this.Task.Framerate = double.Parse(value);\r
                 }\r
 \r
@@ -416,9 +417,15 @@ namespace HandBrakeWPF.ViewModels
             {\r
                 return;\r
             }\r
-            \r
+\r
             this.SelectedVideoEncoder = preset.Task.VideoEncoder;\r
-            this.SelectedFramerate = preset.Task.Framerate.ToString();\r
+            if (preset.Task.Framerate.HasValue)\r
+            {\r
+                this.SelectedFramerate = preset.Task.Framerate.Value.ToString(CultureInfo.InvariantCulture);\r
+            }\r
+\r
+            this.IsConstantQuantity = preset.Task.VideoEncodeRateType == VideoEncodeRateType.ConstantQuality;\r
+\r
             switch (preset.Task.FramerateMode)\r
             {\r
                 case FramerateMode.CFR:\r
@@ -433,9 +440,39 @@ namespace HandBrakeWPF.ViewModels
                     this.ShowPeakFramerate = true;\r
                     break;\r
             }\r
-             \r
-            // TODO Compute RF\r
-            this.RF = 20;\r
+\r
+            double cqStep = userSettingService.GetUserSetting<double>(ASUserSettingConstants.X264Step);\r
+            double rfValue = 0;\r
+            switch (this.SelectedVideoEncoder)\r
+            {\r
+                case VideoEncoder.FFMpeg:\r
+                case VideoEncoder.FFMpeg2:\r
+                    int cq;\r
+                    if (preset.Task.Quality.HasValue)\r
+                    {\r
+                        int.TryParse(preset.Task.Quality.Value.ToString(CultureInfo.InvariantCulture), out cq);\r
+                        this.RF = 32 - cq;\r
+                    }\r
+                    break;\r
+                case VideoEncoder.X264:\r
\r
+                    double multiplier = 1.0 / cqStep;\r
+                    if (preset.Task.Quality.HasValue)\r
+                    {\r
+                        rfValue = preset.Task.Quality.Value * multiplier;\r
+                    }\r
+\r
+                    this.RF = this.QualityMax - (int)Math.Round(rfValue, 0);\r
+\r
+                    break;\r
+\r
+                case VideoEncoder.Theora:\r
+                    if (preset.Task.Quality.HasValue)\r
+                    {\r
+                        this.RF = (int)preset.Task.Quality.Value;\r
+                    }\r
+                    break;\r
+            }\r
 \r
             this.Task.TwoPass = preset.Task.TwoPass;\r
             this.Task.TurboFirstPass = preset.Task.TurboFirstPass;\r
index ce18ff68094bf41e883c9a69c3142fd861723753..6bd00ae0d694d653ed5dd896379e48d5eed809f5 100644 (file)
       <string>appcast_x64</string>\r
     </key>\r
     <value>\r
-      <anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:string" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">http://handbrake.fr/appcast_unstable.x86_64.xml</anyType>\r
+      <anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:string" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">http://handbrake.fr/appcast.86_64.xml</anyType>\r
     </value>\r
   </item>\r
   <item>\r
       <anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:string" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">MinGW i686</anyType>\r
     </value>\r
   </item>\r
+  <item>\r
+    <key>\r
+      <string>ClearCompletedFromQueue</string>\r
+    </key>\r
+    <value>\r
+      <anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:boolean" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">false</anyType>\r
+    </value>\r
+  </item>\r
 </dictionary>
\ No newline at end of file
index ce18ff68094bf41e883c9a69c3142fd861723753..6bd00ae0d694d653ed5dd896379e48d5eed809f5 100644 (file)
       <string>appcast_x64</string>\r
     </key>\r
     <value>\r
-      <anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:string" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">http://handbrake.fr/appcast_unstable.x86_64.xml</anyType>\r
+      <anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:string" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">http://handbrake.fr/appcast.86_64.xml</anyType>\r
     </value>\r
   </item>\r
   <item>\r
       <anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:string" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">MinGW i686</anyType>\r
     </value>\r
   </item>\r
+  <item>\r
+    <key>\r
+      <string>ClearCompletedFromQueue</string>\r
+    </key>\r
+    <value>\r
+      <anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:boolean" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">false</anyType>\r
+    </value>\r
+  </item>\r
 </dictionary>
\ No newline at end of file
index 2d022bedb89101a65edbcabb77fbe9bf5050b9e1..9242bac0b6c7f2ea6d51078a24ba07f79c577adc 100644 (file)
@@ -2236,7 +2236,7 @@ namespace Handbrake
                         this.AudioSettings.LoadTracks(preset);\r
 \r
                         // Set the destination path);\r
-                        this.text_destination.Text = queueEdit.Destination;\r
+                        this.text_destination.Text = queueEdit.Task.Destination;\r
 \r
                         // The x264 widgets will need updated, so do this now:\r
                         x264Panel.StandardizeOptString();\r
@@ -2355,7 +2355,7 @@ namespace Handbrake
 \r
             // Scan\r
             queueEdit = job; // Nasty but will do for now. TODO\r
-            StartScan(job.Source, job.Title);\r
+            StartScan(job.Task.Source, job.Task.Title);\r
         }\r
 \r
         #endregion\r
index f070e0503c487cdbb2e74076261a28ed0cf99824..7ebea1accb7b398e21389c89f1344afa1b94f657 100644 (file)
@@ -219,7 +219,7 @@ namespace Handbrake
             int duration;\r
             int.TryParse(endPoint.Text, out duration);\r
             string query = QueryGenerator.GeneratePreviewQuery(this.mainWindow, duration, startPoint.Text);\r
-            QueueTask task = new QueueTask(query) { Destination = this.mainWindow.text_destination.Text };\r
+            QueueTask task = new QueueTask(query) { Task = { Destination = this.mainWindow.text_destination.Text } };\r
             ThreadPool.QueueUserWorkItem(this.CreatePreview, task);\r
         }\r
 \r
index 5f72d83de8ce42208daa2f816a7f9a2bcc043dba..c7117068fe23c1977abf0bca7d203a3fb62f4ded 100644 (file)
@@ -353,8 +353,8 @@ namespace Handbrake
                     { Tag = queueItem, Text = EnumHelper<QueueItemStatus>.GetDescription(queueItem.Status) };\r
                 item.SubItems.Add(title);\r
                 item.SubItems.Add(chapters); // Chapters\r
-                item.SubItems.Add(queueItem.Source); // Source\r
-                item.SubItems.Add(queueItem.Destination); // Destination\r
+                item.SubItems.Add(queueItem.Task.Source); // Source\r
+                item.SubItems.Add(queueItem.Task.Destination); // Destination\r
                 item.SubItems.Add(EnumHelper<VideoEncoder>.GetDisplay(parsed.VideoEncoder));\r
 \r
                 // Display The Audio Track Information\r
@@ -440,8 +440,8 @@ namespace Handbrake
 \r
                 // found query is a global varible        \r
                 lbl_encodeStatus.Text = "Encoding ...";\r
-                lbl_source.Text = queue.QueueManager.LastProcessedJob.Source + "(Title: " + title + " Chapters: " + chapterlbl + ")";\r
-                lbl_dest.Text = queue.QueueManager.LastProcessedJob.Destination;\r
+                lbl_source.Text = queue.QueueManager.LastProcessedJob.Task.Source + "(Title: " + title + " Chapters: " + chapterlbl + ")";\r
+                lbl_dest.Text = queue.QueueManager.LastProcessedJob.Task.Destination;\r
                 lbl_encodeOptions.Text = string.Format("Video: {0},  Audio: {1}\nx264 Options: {2}",\r
                     EnumHelper<VideoEncoder>.GetDisplay(parsed.VideoEncoder),\r
                     audio, \r