diff options
-rw-r--r-- | win/C#/EncodeQueue/Queue.cs | 13 | ||||
-rw-r--r-- | win/C#/frmMain.cs | 35 | ||||
-rw-r--r-- | win/C#/frmQueue.Designer.cs | 27 | ||||
-rw-r--r-- | win/C#/frmQueue.cs | 24 |
4 files changed, 89 insertions, 10 deletions
diff --git a/win/C#/EncodeQueue/Queue.cs b/win/C#/EncodeQueue/Queue.cs index f279a974f..0372d90b7 100644 --- a/win/C#/EncodeQueue/Queue.cs +++ b/win/C#/EncodeQueue/Queue.cs @@ -103,6 +103,19 @@ namespace Handbrake.EncodeQueue }
/// <summary>
+ /// Retrieve a job from the queue
+ /// </summary>
+ /// <param name="index"></param>
+ /// <returns></returns>
+ public Job GetJob(int index)
+ {
+ if (queue.Count >= (index +1))
+ return queue[index];
+
+ return new Job();
+ }
+
+ /// <summary>
/// Moves an item up one position in the queue.
/// </summary>
/// <param name="index">The zero-based location of the job in the queue.</param>
diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs index 822e8a734..4d45b7fcc 100644 --- a/win/C#/frmMain.cs +++ b/win/C#/frmMain.cs @@ -88,7 +88,7 @@ namespace Handbrake treeView_presets.ExpandAll();
lbl_encode.Text = "";
drop_mode.SelectedIndex = 0;
- queueWindow = new frmQueue(encodeQueue); // Prepare the Queue
+ queueWindow = new frmQueue(encodeQueue, this); // Prepare the Queue
if (!Properties.Settings.Default.QueryEditorTab)
tabs_panel.TabPages.RemoveAt(7); // Remove the query editor tab if the user does not want it enabled.
@@ -1817,6 +1817,39 @@ namespace Handbrake }
#endregion
+ public void RecievingJob(Job job)
+ {
+ string query = job.Query;
+ StartScan(job.Source, 0);
+
+
+ if (query != null)
+ {
+ //Ok, Reset all the H264 widgets before changing the preset
+ x264Panel.reset2Defaults();
+
+ // Send the query from the file to the Query Parser class
+ QueryParser presetQuery = QueryParser.Parse(query);
+
+ // Now load the preset
+ PresetLoader.presetLoader(this, presetQuery, "Load Back From Queue", true);
+
+ // The x264 widgets will need updated, so do this now:
+ x264Panel.X264_StandardizeOptString();
+ x264Panel.X264_SetCurrentSettingsInPanel();
+
+ // Finally, let this window have a copy of the preset settings.
+ CurrentlySelectedPreset = null;
+ PictureSettings.SetPresetCropWarningLabel(null);
+ }
+
+ }
+
+ private void UpdateGuiWithQueueItemAfterScan()
+ {
+
+ }
+
// This is the END of the road ****************************************
}
}
\ No newline at end of file diff --git a/win/C#/frmQueue.Designer.cs b/win/C#/frmQueue.Designer.cs index e3d72597d..bff81f0af 100644 --- a/win/C#/frmQueue.Designer.cs +++ b/win/C#/frmQueue.Designer.cs @@ -59,6 +59,7 @@ namespace Handbrake this.mnu_export = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.mnu_readd = new System.Windows.Forms.ToolStripMenuItem();
+ this.mnu_reconfigureJob = new System.Windows.Forms.ToolStripMenuItem();
this.SaveFile = new System.Windows.Forms.SaveFileDialog();
this.list_queue = new System.Windows.Forms.ListView();
this.Title = new System.Windows.Forms.ColumnHeader();
@@ -282,7 +283,8 @@ namespace Handbrake this.mnu_import,
this.mnu_export,
this.toolStripSeparator2,
- this.mnu_readd});
+ this.mnu_readd,
+ this.mnu_reconfigureJob});
this.drop_button_queue.Image = global::Handbrake.Properties.Resources.ActivityWindow;
this.drop_button_queue.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
this.drop_button_queue.ImageTransparentColor = System.Drawing.Color.Magenta;
@@ -294,7 +296,7 @@ namespace Handbrake //
this.mnu_batch.Image = global::Handbrake.Properties.Resources.Output_Small;
this.mnu_batch.Name = "mnu_batch";
- this.mnu_batch.Size = new System.Drawing.Size(187, 22);
+ this.mnu_batch.Size = new System.Drawing.Size(238, 22);
this.mnu_batch.Text = "Generate Batch Script";
this.mnu_batch.Click += new System.EventHandler(this.mnu_batch_Click);
//
@@ -302,7 +304,7 @@ namespace Handbrake //
this.mnu_import.Image = global::Handbrake.Properties.Resources.folder;
this.mnu_import.Name = "mnu_import";
- this.mnu_import.Size = new System.Drawing.Size(187, 22);
+ this.mnu_import.Size = new System.Drawing.Size(238, 22);
this.mnu_import.Text = "Import Queue";
this.mnu_import.Click += new System.EventHandler(this.mnu_import_Click);
//
@@ -310,24 +312,34 @@ namespace Handbrake //
this.mnu_export.Image = global::Handbrake.Properties.Resources.save;
this.mnu_export.Name = "mnu_export";
- this.mnu_export.Size = new System.Drawing.Size(187, 22);
+ this.mnu_export.Size = new System.Drawing.Size(238, 22);
this.mnu_export.Text = "Export Queue";
this.mnu_export.Click += new System.EventHandler(this.mnu_export_Click);
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
- this.toolStripSeparator2.Size = new System.Drawing.Size(184, 6);
+ this.toolStripSeparator2.Size = new System.Drawing.Size(235, 6);
//
// mnu_readd
//
this.mnu_readd.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.mnu_readd.Image = global::Handbrake.Properties.Resources.AddToQueue_small;
this.mnu_readd.Name = "mnu_readd";
- this.mnu_readd.Size = new System.Drawing.Size(187, 22);
- this.mnu_readd.Text = "Re-Add Current Job";
+ this.mnu_readd.Size = new System.Drawing.Size(238, 22);
+ this.mnu_readd.Text = "Re-Add Currently Running Job";
+ this.mnu_readd.ToolTipText = "Readds the currently encoding job back onto the queue.";
this.mnu_readd.Click += new System.EventHandler(this.mnu_readd_Click);
//
+ // mnu_reconfigureJob
+ //
+ this.mnu_reconfigureJob.Name = "mnu_reconfigureJob";
+ this.mnu_reconfigureJob.Size = new System.Drawing.Size(238, 22);
+ this.mnu_reconfigureJob.Text = "Reconfigure Job (Experimental)";
+ this.mnu_reconfigureJob.ToolTipText = "Removes the job from the queue and sends it back to the main window.\r\nFrom there," +
+ " you can change settings then re-add it to the queue";
+ this.mnu_reconfigureJob.Click += new System.EventHandler(this.mnu_reconfigureJob_Click);
+ //
// SaveFile
//
this.SaveFile.Filter = "Batch|.bat";
@@ -603,5 +615,6 @@ namespace Handbrake private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
private System.Windows.Forms.ToolStripMenuItem mnu_delete;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
+ private System.Windows.Forms.ToolStripMenuItem mnu_reconfigureJob;
}
}
diff --git a/win/C#/frmQueue.cs b/win/C#/frmQueue.cs index 3d3e28f7f..739413cef 100644 --- a/win/C#/frmQueue.cs +++ b/win/C#/frmQueue.cs @@ -17,11 +17,14 @@ namespace Handbrake {
private delegate void UpdateHandler();
private Queue queue;
+ private frmMain mainWindow;
- public frmQueue(Queue q)
+ public frmQueue(Queue q, frmMain mw)
{
InitializeComponent();
+ this.mainWindow = mw;
+
this.queue = q;
queue.NewJobStarted += new EventHandler(QueueOnEncodeStart);
queue.QueueCompleted += new EventHandler(QueueOnQueueFinished);
@@ -94,6 +97,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);
}
+
// Window Display Management
private void SetUIEncodeStarted()
{
@@ -384,6 +388,23 @@ namespace Handbrake UpdateUIElements();
}
}
+ private void mnu_reconfigureJob_Click(object sender, EventArgs e)
+ {
+ if (list_queue.SelectedIndices != null)
+ {
+ lock (queue)
+ {
+ lock (list_queue)
+ {
+ int index = list_queue.SelectedIndices[0];
+ mainWindow.RecievingJob(queue.GetJob(index));
+ queue.Remove(index);
+ RedrawQueue();
+ }
+ }
+ }
+ }
+
// Hide's the window when the user tries to "x" out of the window instead of closing it.
protected override void OnClosing(CancelEventArgs e)
@@ -392,6 +413,5 @@ namespace Handbrake this.Hide();
base.OnClosing(e);
}
-
}
}
|