OSDN Git Service

WinGui:
[handbrake-jp/handbrake-jp-git.git] / win / C# / frmQueue.cs
index 3d3e28f..326fb72 100644 (file)
@@ -10,6 +10,7 @@ using System.ComponentModel;
 using System.Windows.Forms;\r
 using Handbrake.EncodeQueue;\r
 using System.Collections.ObjectModel;\r
+using Handbrake.Model;\r
 \r
 namespace Handbrake\r
 {\r
@@ -17,13 +18,16 @@ namespace Handbrake
     {\r
         private delegate void UpdateHandler();\r
         private Queue queue;\r
+        private frmMain mainWindow;\r
 \r
-        public frmQueue(Queue q)\r
+        public frmQueue(Queue q, frmMain mw)\r
         {\r
             InitializeComponent();\r
 \r
+            this.mainWindow = mw;\r
+\r
             this.queue = q;\r
-            queue.NewJobStarted += new EventHandler(QueueOnEncodeStart);\r
+            queue.EncodeStarted += new EventHandler(QueueOnEncodeStart);\r
             queue.QueueCompleted += new EventHandler(QueueOnQueueFinished);\r
             queue.QueuePauseRequested += new EventHandler(QueueOnPaused);\r
         }\r
@@ -94,6 +98,7 @@ namespace Handbrake
             MessageBox.Show("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.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
         }\r
 \r
+\r
         // Window Display Management\r
         private void SetUIEncodeStarted()\r
         {\r
@@ -172,7 +177,7 @@ namespace Handbrake
 \r
                 // Display The Audio Track Information\r
                 string audio = string.Empty;\r
-                foreach (Functions.AudioTrack track in parsed.AudioInformation)\r
+                foreach (AudioTrack track in parsed.AudioInformation)\r
                 {\r
                     if (audio != "")\r
                         audio += ", " + track.Encoder;\r
@@ -225,7 +230,7 @@ namespace Handbrake
 \r
                 // Display The Audio Track Information\r
                 string audio = string.Empty;\r
-                foreach (Functions.AudioTrack track in parsed.AudioInformation)\r
+                foreach (AudioTrack track in parsed.AudioInformation)\r
                 {\r
                     if (audio != "")\r
                         audio += ", " + track.Encoder;\r
@@ -384,6 +389,23 @@ namespace Handbrake
                 UpdateUIElements();\r
             }\r
         }\r
+        private void mnu_reconfigureJob_Click(object sender, EventArgs e)\r
+        {\r
+            if (list_queue.SelectedIndices != null)\r
+            {\r
+                lock (queue)\r
+                {\r
+                    lock (list_queue)\r
+                    {\r
+                        int index = list_queue.SelectedIndices[0];\r
+                        mainWindow.RecievingJob(queue.GetJob(index));\r
+                        queue.Remove(index);\r
+                        RedrawQueue();\r
+                    }\r
+                }\r
+            }\r
+        }\r
+\r
 \r
         // Hide's the window when the user tries to "x" out of the window instead of closing it.\r
         protected override void OnClosing(CancelEventArgs e)\r
@@ -392,6 +414,5 @@ namespace Handbrake
             this.Hide();\r
             base.OnClosing(e);\r
         }\r
-\r
     }\r
 }\r