+ SetUiEncodeFinished();\r
+ ResetQueue(); // Reset the Queue Window\r
+ }\r
+\r
+ /// <summary>\r
+ /// Handle the Encode Started event\r
+ /// </summary>\r
+ /// <param name="sender">\r
+ /// The sender.\r
+ /// </param>\r
+ /// <param name="e">\r
+ /// The e.\r
+ /// </param>\r
+ private void QueueOnEncodeStart(object sender, EventArgs e)\r
+ {\r
+ SetUiEncodeStarted(); // make sure the UI is set correctly\r
+ UpdateUiElementsOnQueueChange(); // Redraw the Queue, a new encode has started.\r
+ }\r
+\r
+ /// <summary>\r
+ /// Initializes the Queue list with the Arraylist from the Queue class\r
+ /// </summary>\r
+ public void SetQueue()\r
+ {\r
+ UpdateUiElementsOnQueueChange();\r
+ }\r
+\r
+ /// <summary>\r
+ /// Initializes the Queue list, then shows and activates the window\r
+ /// </summary>\r
+ public new void Show()\r
+ {\r
+ Show(true);\r
+ }\r
+\r
+ /// <summary>\r
+ /// Initializes the Queue list only if doSetQueue is true, then shows and activates the window\r
+ /// </summary>\r
+ /// <param name="doSetQueue">Indicates whether to call setQueue() before showing the window</param>\r
+ public void Show(bool doSetQueue)\r
+ {\r
+ if (doSetQueue) SetQueue();\r
+ base.Show();\r
+ }\r
+\r
+ /// <summary>\r
+ /// Handle the Encode button Click event\r
+ /// </summary>\r
+ /// <param name="sender">The sender</param>\r
+ /// <param name="e">the EventArgs</param>\r
+ private void BtnEncodeClick(object sender, EventArgs e)\r
+ {\r
+ if (queue.Paused)\r
+ {\r
+ SetUiEncodeStarted();\r
+ }\r
+\r
+ lbl_encodeStatus.Text = "Encoding ...";\r
+ queue.Start();\r
+ }\r
+\r
+ /// <summary>\r
+ /// Handle the Pause button click event.\r
+ /// </summary>\r
+ /// <param name="sender">\r
+ /// The sender.\r
+ /// </param>\r
+ /// <param name="e">\r
+ /// The EventArgs.\r
+ /// </param>\r
+ private void BtnPauseClick(object sender, EventArgs e)\r
+ {\r
+ queue.Pause();\r
+ MessageBox.Show(\r
+ "No further items on the queue will start. The current encode process will continue until it is finished. \nClick 'Encode' when you wish to continue encoding the queue.",\r
+ "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
+ }\r
+\r
+ // UI Work\r
+\r
+ /// <summary>\r
+ /// Setup the UI to show that an encode has started\r
+ /// </summary>\r
+ private void SetUiEncodeStarted()\r
+ {\r
+ if (InvokeRequired)\r
+ {\r
+ BeginInvoke(new UpdateHandler(SetUiEncodeStarted));\r
+ return;\r
+ }\r
+ btn_encode.Enabled = false;\r
+ btn_pause.Visible = true;\r
+ }\r
+\r
+ /// <summary>\r
+ /// Setup the UI to indicate that an encode has finished.\r
+ /// </summary>\r
+ private void SetUiEncodeFinished()\r
+ {\r
+ if (InvokeRequired)\r