From 50f18f305bd08008848cbe9bc22e602473a1c08c Mon Sep 17 00:00:00 2001 From: sr55 Date: Mon, 30 Jun 2008 14:24:47 +0000 Subject: [PATCH] WinGui: - Queue system moved into it's own class. - Queue now uses a listview display instead of a simple list. It now displays some information about each encode instead of the CLI String. - Misc other Fixes. git-svn-id: svn://localhost/HandBrake/trunk@1544 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/C#/Functions/Queue.cs | 106 ++++++++++++ win/C#/HandBrakeCS.csproj | 14 +- win/C#/Properties/Settings.Designer.cs | 2 +- win/C#/Properties/Settings.settings | 2 +- win/C#/Resources/JobPassLarge.png | Bin 0 -> 4673 bytes win/C#/app.config | 2 +- win/C#/frmMain.cs | 27 ++- win/C#/frmQueue.Designer.cs | 301 +++++++++++++++++---------------- win/C#/frmQueue.cs | 238 +++++++++++++------------- 9 files changed, 397 insertions(+), 295 deletions(-) create mode 100644 win/C#/Functions/Queue.cs create mode 100644 win/C#/Resources/JobPassLarge.png diff --git a/win/C#/Functions/Queue.cs b/win/C#/Functions/Queue.cs new file mode 100644 index 00000000..e566c2e0 --- /dev/null +++ b/win/C#/Functions/Queue.cs @@ -0,0 +1,106 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Collections; + +namespace Handbrake.Functions +{ + public class Queue + { + ArrayList queue = new ArrayList(); + string lastQuery; + + public ArrayList getQueue() + { + return queue; + } + + /// + /// Get's the next CLI query for encoding + /// + /// String + public string getNextItemForEncoding() + { + string query = queue[0].ToString(); + lastQuery = query; + remove(0); + return query; + } + + /// + /// Add's a new item to the queue + /// + /// String + public void add(string query) + { + queue.Add(query); + } + + /// + /// Removes an item from the queue. + /// + /// Index + /// Bolean true if successful + public Boolean remove(int index) + { + try + { + queue.RemoveAt(index); + return true; + } + catch (Exception) + { + return false; + } + } + + /// + /// Returns how many items are in the queue + /// + /// Int + public int count() + { + return queue.Count; + } + + /// + /// Get's the last query to be selected for encoding by getNextItemForEncoding() + /// + /// String + public string getLastQuery() + { + return lastQuery; + } + + /// + /// Move an item with an index x, up in the queue + /// + /// Int + public void moveUp(int index) + { + if (index != 0) + { + string item = queue[index].ToString(); + + queue.Insert((index - 1), item); + queue.RemoveAt((index + 1)); + } + } + + /// + /// Move an item with an index x, down in the queue + /// + /// Int + public void moveDown(int index) + { + if (index != queue.Count - 1) + { + string item = queue[index].ToString(); + + queue.Insert((index + 2), item); + queue.RemoveAt((index)); + } + } + + } +} diff --git a/win/C#/HandBrakeCS.csproj b/win/C#/HandBrakeCS.csproj index a8b3107d..96ae9194 100644 --- a/win/C#/HandBrakeCS.csproj +++ b/win/C#/HandBrakeCS.csproj @@ -82,18 +82,6 @@ x86 - - False - C:\Documents and Settings\Scott\My Documents\C4F\C4F Developer Kit 2008\Controls\C4F.DevKit.Contacts.Controls.dll - - - False - C:\Documents and Settings\Scott\My Documents\C4F\C4F Developer Kit 2008\Controls\C4F.DevKit.Messaging.dll - - - False - C:\Documents and Settings\Scott\My Documents\C4F\C4F Developer Kit 2008\Controls\C4F.DevKit.Telephony.dll - @@ -154,6 +142,7 @@ + @@ -245,6 +234,7 @@ + diff --git a/win/C#/Properties/Settings.Designer.cs b/win/C#/Properties/Settings.Designer.cs index f4ab1fb8..48947cc1 100644 --- a/win/C#/Properties/Settings.Designer.cs +++ b/win/C#/Properties/Settings.Designer.cs @@ -73,7 +73,7 @@ namespace Handbrake.Properties { [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("SVN1477")] + [global::System.Configuration.DefaultSettingValueAttribute("SVN1544")] public string hb_version { get { return ((string)(this["hb_version"])); diff --git a/win/C#/Properties/Settings.settings b/win/C#/Properties/Settings.settings index c216caee..463e8ac6 100644 --- a/win/C#/Properties/Settings.settings +++ b/win/C#/Properties/Settings.settings @@ -15,7 +15,7 @@ Checked - SVN1477 + SVN1544 Checked diff --git a/win/C#/Resources/JobPassLarge.png b/win/C#/Resources/JobPassLarge.png new file m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F1m{CPy;#J|H$Yu|ZmXPYWXBM3Y#%0_25S=+9Wx$YCP3;)5Y{r}>fAJ?OV`-t=p;PnSM zbGe4Mzo)R~kjk>x92iaMBu`z%EZfIecih3%EYsNF8d<<#FlOJnd56cNtgr9Jy6zJe zul_4p8_U^WR!4hRfId~FuP;I*(vQa<<|o%eWNm3DZ+i{X=f6#iaU2t7euEVy-8fwV z>S`aTk|aG{K%>!^4F+S8WR$iTjZ#r!V$!MF8dv}Q+BVFV)kx!3BgJoH%IsoJ9Q{7; zp1REGGr!=>*`IOtyO+paS&AWX4{=Gmh>b5qqZx&ER3ejSeVw}doz&JejVPdde4y9s z7gSd@^;cK9Fc{JhA|4?oAw&vM+H|zq1!%Q7Xm#0WwX+c-6(P(BF`3cY0)%)8Aq0AZ ziR!8*s;fp8`0}gx5+NC-`3`$S_+E7j8FLR|PTkF<$-7BO+fMS7og}AhCLy_ycuNt< zmd%(`ibzS@#iaBSrp_p3{P<}YjS{J83#hJg;jlNVl5u2#VWVtzd8u-=;;^@Tg`)+B zy&3x#I3Ci1!_kVv(Tcs&No7SN4to>LE-&`V#)#1<&3|Trm>7Nb%|CxWP*L7M`Q19o z@76y-MR`3HPt5BmzgtH|c>{xI>!~Pj;MUDM12HlBoM#pgLRf?l2ZRu>3n30hMQINj z2e;;kL`7*23L&0G#zTSAr%#WB?)vrX;@r7&qO9zcC@VW93JMCIMOqXT6g)gLlrnMS z#*OFtJJteGU!YS}RoHB{5g%@|*@UX9;*oR1A^tr8701L?n%?oF00000NkvXXu0mjf D!?WM# literal 0 HcmV?d00001 diff --git a/win/C#/app.config b/win/C#/app.config index 0b4648b4..00103865 100644 --- a/win/C#/app.config +++ b/win/C#/app.config @@ -20,7 +20,7 @@ Checked - SVN1477 + SVN1544 Checked diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs index 4328c209..96a81768 100644 --- a/win/C#/frmMain.cs +++ b/win/C#/frmMain.cs @@ -25,6 +25,7 @@ namespace Handbrake Functions.Common hb_common_func = new Functions.Common(); Functions.x264Panel x264PanelFunctions = new Functions.x264Panel(); Functions.CLI cliObj = new Functions.CLI(); + Functions.Queue encodeQueue = new Functions.Queue(); Parsing.Title selectedTitle; internal Process hbProc; private Parsing.DVD thisDVD; @@ -56,8 +57,7 @@ namespace Handbrake // show the form, but leave disabled until preloading is complete then show the main form this.Enabled = false; this.Show(); - // Forces frmMain to draw - Application.DoEvents(); + Application.DoEvents(); // Forces frmMain to draw // update the status if (Properties.Settings.Default.updateStatus == "Checked") @@ -342,7 +342,8 @@ namespace Handbrake private void mnu_encode_Click(object sender, EventArgs e) { - showQueue(); + queueWindow.setQueue(encodeQueue); + queueWindow.Show(); } private void mnu_viewDVDdata_Click(object sender, EventArgs e) { @@ -441,19 +442,21 @@ namespace Handbrake MessageBox.Show("No source OR destination selected.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); else { - String query; + + String query = hb_common_func.GenerateTheQuery(this); if (rtf_query.Text != "") query = rtf_query.Text; - else - query = hb_common_func.GenerateTheQuery(this); - queueWindow.list_queue.Items.Add(query); + encodeQueue.add(query); + + queueWindow.setQueue(encodeQueue); queueWindow.Show(); } } private void btn_showQueue_Click(object sender, EventArgs e) { - showQueue(); + queueWindow.setQueue(encodeQueue); + queueWindow.Show(); } private void btn_ActivityWindow_Click(object sender, EventArgs e) { @@ -1900,7 +1903,7 @@ namespace Handbrake int normal = 0; foreach (TreeNode treenode in treeView_presets.Nodes) { - if (treenode.ToString().Equals("TreeNode: Normal")) + if (treenode.Text.ToString().Equals("Normal")) normal = treenode.Index; } @@ -1988,12 +1991,6 @@ namespace Handbrake x264PanelFunctions.X264_SetCurrentSettingsInPanel(this); } } - - // Queue system functions - private void showQueue() - { - queueWindow.Show(); - } #endregion #region Encoding and Queue diff --git a/win/C#/frmQueue.Designer.cs b/win/C#/frmQueue.Designer.cs index cc7b9cf6..c7617df9 100644 --- a/win/C#/frmQueue.Designer.cs +++ b/win/C#/frmQueue.Designer.cs @@ -39,15 +39,7 @@ namespace Handbrake this.btn_down = new System.Windows.Forms.Button(); this.btn_up = new System.Windows.Forms.Button(); this.btn_delete = new System.Windows.Forms.Button(); - this.list_queue = new System.Windows.Forms.ListBox(); - this.btn_Close = new System.Windows.Forms.Button(); - this.progressBar = new System.Windows.Forms.ProgressBar(); - this.label2 = new System.Windows.Forms.Label(); - this.lbl_progressValue = new System.Windows.Forms.Label(); - this.lbl_status = new System.Windows.Forms.Label(); this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); - this.text_edit = new System.Windows.Forms.TextBox(); - this.btn_updateQuery = new System.Windows.Forms.Button(); this.label4 = new System.Windows.Forms.Label(); this.lbl_chapt = new System.Windows.Forms.Label(); this.lbl_title = new System.Windows.Forms.Label(); @@ -64,6 +56,17 @@ namespace Handbrake this.btn_batch = new System.Windows.Forms.ToolStripButton(); this.SaveFile = new System.Windows.Forms.SaveFileDialog(); this.pictureBox1 = new System.Windows.Forms.PictureBox(); + this.list_queue = new System.Windows.Forms.ListView(); + this.Title = new System.Windows.Forms.ColumnHeader(); + this.Chapters = new System.Windows.Forms.ColumnHeader(); + this.Source = new System.Windows.Forms.ColumnHeader(); + this.Destination = new System.Windows.Forms.ColumnHeader(); + this.EncoderVideo = new System.Windows.Forms.ColumnHeader(); + this.Audio = new System.Windows.Forms.ColumnHeader(); + this.lbl_progressValue = new System.Windows.Forms.Label(); + this.progressBar = new System.Windows.Forms.ProgressBar(); + this.label2 = new System.Windows.Forms.Label(); + this.lbl_status = new System.Windows.Forms.Label(); this.toolStrip1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.SuspendLayout(); @@ -74,9 +77,9 @@ namespace Handbrake this.btn_down.FlatAppearance.BorderColor = System.Drawing.Color.Black; this.btn_down.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btn_down.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0))))); - this.btn_down.Location = new System.Drawing.Point(74, 327); + this.btn_down.Location = new System.Drawing.Point(610, 124); this.btn_down.Name = "btn_down"; - this.btn_down.Size = new System.Drawing.Size(64, 22); + this.btn_down.Size = new System.Drawing.Size(75, 22); this.btn_down.TabIndex = 33; this.btn_down.TabStop = false; this.btn_down.Text = "Down"; @@ -89,9 +92,9 @@ namespace Handbrake this.btn_up.FlatAppearance.BorderColor = System.Drawing.Color.Black; this.btn_up.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btn_up.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0))))); - this.btn_up.Location = new System.Drawing.Point(13, 327); + this.btn_up.Location = new System.Drawing.Point(539, 124); this.btn_up.Name = "btn_up"; - this.btn_up.Size = new System.Drawing.Size(55, 22); + this.btn_up.Size = new System.Drawing.Size(64, 22); this.btn_up.TabIndex = 32; this.btn_up.TabStop = false; this.btn_up.Text = "Up"; @@ -104,110 +107,20 @@ namespace Handbrake this.btn_delete.FlatAppearance.BorderColor = System.Drawing.Color.Black; this.btn_delete.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btn_delete.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0))))); - this.btn_delete.Location = new System.Drawing.Point(144, 327); + this.btn_delete.Location = new System.Drawing.Point(692, 124); this.btn_delete.Name = "btn_delete"; - this.btn_delete.Size = new System.Drawing.Size(64, 22); + this.btn_delete.Size = new System.Drawing.Size(75, 22); this.btn_delete.TabIndex = 31; this.btn_delete.TabStop = false; this.btn_delete.Text = "Delete"; this.btn_delete.UseVisualStyleBackColor = true; this.btn_delete.Click += new System.EventHandler(this.btn_delete_Click); // - // list_queue - // - this.list_queue.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.list_queue.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.list_queue.HorizontalScrollbar = true; - this.list_queue.Location = new System.Drawing.Point(12, 176); - this.list_queue.Name = "list_queue"; - this.list_queue.Size = new System.Drawing.Size(701, 145); - this.list_queue.TabIndex = 28; - this.list_queue.SelectedIndexChanged += new System.EventHandler(this.list_queue_SelectedIndexChanged); - // - // btn_Close - // - this.btn_Close.BackColor = System.Drawing.SystemColors.ControlLight; - this.btn_Close.FlatAppearance.BorderColor = System.Drawing.Color.Black; - this.btn_Close.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btn_Close.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btn_Close.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0))))); - this.btn_Close.Location = new System.Drawing.Point(605, 12); - this.btn_Close.Name = "btn_Close"; - this.btn_Close.Size = new System.Drawing.Size(108, 22); - this.btn_Close.TabIndex = 27; - this.btn_Close.TabStop = false; - this.btn_Close.Text = "Close Window"; - this.btn_Close.UseVisualStyleBackColor = false; - this.btn_Close.Click += new System.EventHandler(this.btn_Close_Click); - // - // progressBar - // - this.progressBar.Location = new System.Drawing.Point(67, 360); - this.progressBar.Name = "progressBar"; - this.progressBar.Size = new System.Drawing.Size(616, 23); - this.progressBar.Style = System.Windows.Forms.ProgressBarStyle.Continuous; - this.progressBar.TabIndex = 34; - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(10, 366); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(51, 13); - this.label2.TabIndex = 35; - this.label2.Text = "Progress:"; - // - // lbl_progressValue - // - this.lbl_progressValue.AutoSize = true; - this.lbl_progressValue.Location = new System.Drawing.Point(689, 366); - this.lbl_progressValue.Name = "lbl_progressValue"; - this.lbl_progressValue.Size = new System.Drawing.Size(24, 13); - this.lbl_progressValue.TabIndex = 36; - this.lbl_progressValue.Text = "0 %"; - // - // lbl_status - // - this.lbl_status.AutoSize = true; - this.lbl_status.BackColor = System.Drawing.Color.Transparent; - this.lbl_status.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lbl_status.Location = new System.Drawing.Point(274, 366); - this.lbl_status.Name = "lbl_status"; - this.lbl_status.Size = new System.Drawing.Size(176, 13); - this.lbl_status.TabIndex = 42; - this.lbl_status.Text = "Encode Queue Completed!"; - this.lbl_status.Visible = false; - // - // text_edit - // - this.text_edit.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.text_edit.Location = new System.Drawing.Point(214, 328); - this.text_edit.Name = "text_edit"; - this.text_edit.Size = new System.Drawing.Size(430, 20); - this.text_edit.TabIndex = 43; - this.toolTip1.SetToolTip(this.text_edit, "Avoid using this feature when the encoder is about to start a new task. You may o" + - "verwrite the wrong job"); - // - // btn_updateQuery - // - this.btn_updateQuery.BackColor = System.Drawing.SystemColors.ControlLight; - this.btn_updateQuery.FlatAppearance.BorderColor = System.Drawing.Color.Black; - this.btn_updateQuery.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.btn_updateQuery.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0))))); - this.btn_updateQuery.Location = new System.Drawing.Point(649, 325); - this.btn_updateQuery.Name = "btn_updateQuery"; - this.btn_updateQuery.Size = new System.Drawing.Size(64, 23); - this.btn_updateQuery.TabIndex = 46; - this.btn_updateQuery.TabStop = false; - this.btn_updateQuery.Text = "Update"; - this.btn_updateQuery.UseVisualStyleBackColor = true; - this.btn_updateQuery.Click += new System.EventHandler(this.btn_updateQuery_Click); - // // label4 // this.label4.AutoSize = true; this.label4.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label4.Location = new System.Drawing.Point(232, 125); + this.label4.Location = new System.Drawing.Point(269, 121); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(47, 26); this.label4.TabIndex = 70; @@ -216,9 +129,9 @@ namespace Handbrake // lbl_chapt // this.lbl_chapt.AutoSize = true; - this.lbl_chapt.Location = new System.Drawing.Point(175, 137); + this.lbl_chapt.Location = new System.Drawing.Point(202, 133); this.lbl_chapt.Name = "lbl_chapt"; - this.lbl_chapt.Size = new System.Drawing.Size(10, 13); + this.lbl_chapt.Size = new System.Drawing.Size(12, 13); this.lbl_chapt.TabIndex = 69; this.lbl_chapt.Text = "-"; // @@ -226,36 +139,36 @@ namespace Handbrake // this.lbl_title.AccessibleRole = System.Windows.Forms.AccessibleRole.None; this.lbl_title.AutoSize = true; - this.lbl_title.Location = new System.Drawing.Point(175, 124); + this.lbl_title.Location = new System.Drawing.Point(202, 120); this.lbl_title.Name = "lbl_title"; - this.lbl_title.Size = new System.Drawing.Size(10, 13); + this.lbl_title.Size = new System.Drawing.Size(12, 13); this.lbl_title.TabIndex = 68; this.lbl_title.Text = "-"; // // lbl_aEnc // this.lbl_aEnc.AutoSize = true; - this.lbl_aEnc.Location = new System.Drawing.Point(285, 138); + this.lbl_aEnc.Location = new System.Drawing.Point(330, 134); this.lbl_aEnc.Name = "lbl_aEnc"; - this.lbl_aEnc.Size = new System.Drawing.Size(10, 13); + this.lbl_aEnc.Size = new System.Drawing.Size(12, 13); this.lbl_aEnc.TabIndex = 67; this.lbl_aEnc.Text = "-"; // // lbl_vEnc // this.lbl_vEnc.AutoSize = true; - this.lbl_vEnc.Location = new System.Drawing.Point(285, 125); + this.lbl_vEnc.Location = new System.Drawing.Point(330, 121); this.lbl_vEnc.Name = "lbl_vEnc"; - this.lbl_vEnc.Size = new System.Drawing.Size(10, 13); + this.lbl_vEnc.Size = new System.Drawing.Size(12, 13); this.lbl_vEnc.TabIndex = 66; this.lbl_vEnc.Text = "-"; // // lbl_dest // this.lbl_dest.AutoSize = true; - this.lbl_dest.Location = new System.Drawing.Point(175, 112); + this.lbl_dest.Location = new System.Drawing.Point(202, 108); this.lbl_dest.Name = "lbl_dest"; - this.lbl_dest.Size = new System.Drawing.Size(10, 13); + this.lbl_dest.Size = new System.Drawing.Size(12, 13); this.lbl_dest.TabIndex = 65; this.lbl_dest.Text = "-"; this.lbl_dest.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -263,9 +176,9 @@ namespace Handbrake // lbl_source // this.lbl_source.AutoSize = true; - this.lbl_source.Location = new System.Drawing.Point(175, 99); + this.lbl_source.Location = new System.Drawing.Point(202, 95); this.lbl_source.Name = "lbl_source"; - this.lbl_source.Size = new System.Drawing.Size(10, 13); + this.lbl_source.Size = new System.Drawing.Size(12, 13); this.lbl_source.TabIndex = 64; this.lbl_source.Text = "-"; // @@ -273,7 +186,7 @@ namespace Handbrake // this.label1.AutoSize = true; this.label1.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label1.Location = new System.Drawing.Point(50, 99); + this.label1.Location = new System.Drawing.Point(56, 95); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(99, 52); this.label1.TabIndex = 63; @@ -283,7 +196,7 @@ namespace Handbrake // this.label3.AutoSize = true; this.label3.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label3.Location = new System.Drawing.Point(50, 77); + this.label3.Location = new System.Drawing.Point(56, 73); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(82, 13); this.label3.TabIndex = 62; @@ -301,7 +214,7 @@ namespace Handbrake this.toolStrip1.Location = new System.Drawing.Point(0, 0); this.toolStrip1.Name = "toolStrip1"; this.toolStrip1.RenderMode = System.Windows.Forms.ToolStripRenderMode.System; - this.toolStrip1.Size = new System.Drawing.Size(729, 49); + this.toolStrip1.Size = new System.Drawing.Size(780, 49); this.toolStrip1.TabIndex = 71; this.toolStrip1.Text = "toolStrip1"; // @@ -349,39 +262,126 @@ namespace Handbrake // pictureBox1 // this.pictureBox1.Image = global::Handbrake.Properties.Resources.Queue; - this.pictureBox1.Location = new System.Drawing.Point(12, 65); + this.pictureBox1.Location = new System.Drawing.Point(12, 61); this.pictureBox1.Name = "pictureBox1"; - this.pictureBox1.Size = new System.Drawing.Size(32, 32); + this.pictureBox1.Size = new System.Drawing.Size(37, 32); this.pictureBox1.TabIndex = 61; this.pictureBox1.TabStop = false; // + // list_queue + // + this.list_queue.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.Title, + this.Chapters, + this.Source, + this.Destination, + this.EncoderVideo, + this.Audio}); + this.list_queue.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.list_queue.FullRowSelect = true; + this.list_queue.GridLines = true; + this.list_queue.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; + this.list_queue.Location = new System.Drawing.Point(12, 157); + this.list_queue.MultiSelect = false; + this.list_queue.Name = "list_queue"; + this.list_queue.Size = new System.Drawing.Size(755, 185); + this.list_queue.TabIndex = 72; + this.list_queue.UseCompatibleStateImageBehavior = false; + this.list_queue.View = System.Windows.Forms.View.Details; + // + // Title + // + this.Title.Text = "Title"; + this.Title.Width = 39; + // + // Chapters + // + this.Chapters.Text = "Chapters"; + this.Chapters.Width = 71; + // + // Source + // + this.Source.Text = "Source"; + this.Source.Width = 219; + // + // Destination + // + this.Destination.Text = "Destination"; + this.Destination.Width = 215; + // + // EncoderVideo + // + this.EncoderVideo.Text = "Video Encoder"; + this.EncoderVideo.Width = 110; + // + // Audio + // + this.Audio.Text = "Audio Encoder"; + this.Audio.Width = 94; + // + // lbl_progressValue + // + this.lbl_progressValue.AutoSize = true; + this.lbl_progressValue.Location = new System.Drawing.Point(737, 353); + this.lbl_progressValue.Name = "lbl_progressValue"; + this.lbl_progressValue.Size = new System.Drawing.Size(30, 13); + this.lbl_progressValue.TabIndex = 36; + this.lbl_progressValue.Text = "0 %"; + // + // progressBar + // + this.progressBar.Location = new System.Drawing.Point(76, 348); + this.progressBar.Name = "progressBar"; + this.progressBar.Size = new System.Drawing.Size(655, 23); + this.progressBar.Style = System.Windows.Forms.ProgressBarStyle.Continuous; + this.progressBar.TabIndex = 34; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(9, 353); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(62, 13); + this.label2.TabIndex = 35; + this.label2.Text = "Progress:"; + // + // lbl_status + // + this.lbl_status.AutoSize = true; + this.lbl_status.BackColor = System.Drawing.Color.Transparent; + this.lbl_status.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lbl_status.Location = new System.Drawing.Point(319, 353); + this.lbl_status.Name = "lbl_status"; + this.lbl_status.Size = new System.Drawing.Size(176, 13); + this.lbl_status.TabIndex = 42; + this.lbl_status.Text = "Encode Queue Completed!"; + this.lbl_status.Visible = false; + // // frmQueue // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(729, 400); + this.ClientSize = new System.Drawing.Size(780, 386); + this.Controls.Add(this.lbl_status); + this.Controls.Add(this.label2); + this.Controls.Add(this.list_queue); + this.Controls.Add(this.progressBar); + this.Controls.Add(this.lbl_progressValue); + this.Controls.Add(this.pictureBox1); + this.Controls.Add(this.btn_down); + this.Controls.Add(this.btn_up); this.Controls.Add(this.toolStrip1); this.Controls.Add(this.label4); - this.Controls.Add(this.lbl_chapt); - this.Controls.Add(this.lbl_title); - this.Controls.Add(this.lbl_aEnc); - this.Controls.Add(this.lbl_vEnc); this.Controls.Add(this.lbl_dest); + this.Controls.Add(this.btn_delete); + this.Controls.Add(this.lbl_vEnc); + this.Controls.Add(this.lbl_chapt); this.Controls.Add(this.lbl_source); - this.Controls.Add(this.label1); this.Controls.Add(this.label3); - this.Controls.Add(this.pictureBox1); - this.Controls.Add(this.list_queue); - this.Controls.Add(this.btn_updateQuery); - this.Controls.Add(this.btn_delete); - this.Controls.Add(this.lbl_status); - this.Controls.Add(this.btn_up); - this.Controls.Add(this.text_edit); - this.Controls.Add(this.btn_down); - this.Controls.Add(this.lbl_progressValue); - this.Controls.Add(this.label2); - this.Controls.Add(this.progressBar); - this.Controls.Add(this.btn_Close); + this.Controls.Add(this.lbl_aEnc); + this.Controls.Add(this.lbl_title); + this.Controls.Add(this.label1); + this.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MaximizeBox = false; this.Name = "frmQueue"; @@ -400,15 +400,7 @@ namespace Handbrake internal System.Windows.Forms.Button btn_down; internal System.Windows.Forms.Button btn_up; internal System.Windows.Forms.Button btn_delete; - internal System.Windows.Forms.Button btn_Close; - private System.Windows.Forms.ProgressBar progressBar; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label lbl_progressValue; - private System.Windows.Forms.Label lbl_status; private System.Windows.Forms.ToolTip toolTip1; - public System.Windows.Forms.ListBox list_queue; - private System.Windows.Forms.TextBox text_edit; - internal System.Windows.Forms.Button btn_updateQuery; private System.Windows.Forms.Label label4; private System.Windows.Forms.Label lbl_chapt; private System.Windows.Forms.Label lbl_title; @@ -425,5 +417,16 @@ namespace Handbrake private System.Windows.Forms.ToolStripButton btn_stop; private System.Windows.Forms.ToolStripButton btn_batch; private System.Windows.Forms.SaveFileDialog SaveFile; + private System.Windows.Forms.ListView list_queue; + private System.Windows.Forms.ColumnHeader Title; + private System.Windows.Forms.ColumnHeader Chapters; + private System.Windows.Forms.ColumnHeader Source; + private System.Windows.Forms.ColumnHeader Destination; + private System.Windows.Forms.ColumnHeader EncoderVideo; + private System.Windows.Forms.ColumnHeader Audio; + private System.Windows.Forms.Label lbl_progressValue; + private System.Windows.Forms.ProgressBar progressBar; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label lbl_status; } } \ No newline at end of file diff --git a/win/C#/frmQueue.cs b/win/C#/frmQueue.cs index 37c64625..1a50f1cc 100644 --- a/win/C#/frmQueue.cs +++ b/win/C#/frmQueue.cs @@ -25,15 +25,27 @@ namespace Handbrake Functions.CLI cliObj = new Functions.CLI(); Boolean cancel = false; Process hbProc = null; + Functions.Queue queue; public frmQueue() { - InitializeComponent(); + InitializeComponent(); } + /// + /// Initializes the Queue list with the Arraylist from the Queue class + /// + /// + public void setQueue(Functions.Queue qw) + { + queue = qw; + redrawQueue(); + } - #region Queue / Handling - + /// + /// Returns if there is currently an item being encoded by the queue + /// + /// Boolean true if encoding public Boolean isEncoding() { if (hbProc == null) @@ -42,11 +54,48 @@ namespace Handbrake return true; } - private void btn_encode_Click(object sender, EventArgs e) + // Redraw's the queue with the latest data from the Queue class + private void redrawQueue() { - // Reset some values + list_queue.Items.Clear(); + foreach (string queue_item in queue.getQueue()) + { + Functions.QueryParser parsed = Functions.QueryParser.Parse(queue_item); + + // Get the DVD Title + string title = ""; + if (parsed.DVDTitle == 0) + title = "Auto"; + else + title = parsed.DVDTitle.ToString(); + + // Get the DVD Chapters + string chapters = ""; + if (parsed.DVDChapterStart == 0) + chapters = "Auto"; + else + { + chapters = parsed.DVDChapterStart.ToString(); + if (parsed.DVDChapterFinish != 0) + chapters = chapters + " - " + parsed.DVDChapterFinish; + } + + ListViewItem item = new ListViewItem(); + item.Text = title; // Title + item.SubItems.Add(chapters); // Chapters + item.SubItems.Add(parsed.Source); // Source + item.SubItems.Add(parsed.Destination); // Destination + item.SubItems.Add(parsed.VideoEncoder); // Video + item.SubItems.Add(parsed.AudioEncoder1); // Audio + + list_queue.Items.Add(item); + } + } - if (list_queue.Items.Count != 0) + // Initializes the encode process + private void btn_encode_Click(object sender, EventArgs e) + { + if (queue.count() != 0) { lbl_status.Visible = false; btn_encode.Enabled = false; @@ -56,16 +105,14 @@ namespace Handbrake // Start the encode try { - if (list_queue.Items.Count != 0) + if (queue.count() != 0) { // Setup or reset some values btn_stop.Visible = true; progressBar.Value = 0; lbl_progressValue.Text = "0 %"; - progressBar.Step = 100 / list_queue.Items.Count; + progressBar.Step = 100 / queue.count(); progressBar.Update(); - //ThreadPool.QueueUserWorkItem(startProc); - // Testing a new way of launching a thread. Hopefully will fix a random freeze up of the main thread. Thread theQ = new Thread(startProc); theQ.Start(); } @@ -76,26 +123,19 @@ namespace Handbrake } } - private void btn_stop_Click(object sender, EventArgs e) - { - cancel = true; - btn_stop.Visible = false; - btn_encode.Enabled = true; - MessageBox.Show("No further items on the queue will start. The current encode process will continue until it is finished. \nClick 'Encode Video' when you wish to continue encoding the queue.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - + // Starts the encoding process private void startProc(object state) { try { - - while (list_queue.Items.Count != 0) + // Run through each item on the queue + while (queue.count() != 0) { - string query = list_queue.Items[0].ToString(); + string query = queue.getNextItemForEncoding(); + setEncValue(); updateUIElements(); - hbProc = cliObj.runCli(this, query); hbProc.WaitForExit(); @@ -108,12 +148,11 @@ namespace Handbrake if (cancel == true) { break; - } + } } resetQueue(); - // After the encode is done, we may want to shutdown, suspend etc. cliObj.afterEncodeAction(); } @@ -123,27 +162,7 @@ namespace Handbrake } } - private void updateUIElements() - { - try - { - if (this.InvokeRequired) - { - this.BeginInvoke(new ProgressUpdateHandler(updateUIElements)); - return; - } - this.list_queue.Items.RemoveAt(0); - - progressBar.PerformStep(); - lbl_progressValue.Text = string.Format("{0} %", progressBar.Value); - progressBar.Update(); - } - catch (Exception exc) - { - MessageBox.Show(exc.ToString()); - } - } - + // Reset's the window to the default state. private void resetQueue() { try @@ -161,15 +180,13 @@ namespace Handbrake { lbl_status.Visible = true; lbl_status.Text = "Encode Queue Cancelled!"; - text_edit.Text = ""; } else { lbl_status.Visible = true; lbl_status.Text = "Encode Queue Completed!"; - text_edit.Text = ""; } - + lbl_progressValue.Text = "0 %"; progressBar.Value = 0; progressBar.Update(); @@ -186,7 +203,40 @@ namespace Handbrake MessageBox.Show(exc.ToString()); } } - + + // Stop's the queue from continuing. + private void btn_stop_Click(object sender, EventArgs e) + { + cancel = true; + btn_stop.Visible = false; + btn_encode.Enabled = true; + MessageBox.Show("No further items on the queue will start. The current encode process will continue until it is finished. \nClick 'Encode Video' when you wish to continue encoding the queue.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); + } + + // Updates the progress bar and progress label for a new status. + private void updateUIElements() + { + try + { + if (this.InvokeRequired) + { + this.BeginInvoke(new ProgressUpdateHandler(updateUIElements)); + return; + } + + redrawQueue(); + + progressBar.PerformStep(); + lbl_progressValue.Text = string.Format("{0} %", progressBar.Value); + progressBar.Update(); + } + catch (Exception exc) + { + MessageBox.Show(exc.ToString()); + } + } + + // Set's the information lables about the current encode. private void setEncValue() { try @@ -196,10 +246,8 @@ namespace Handbrake this.BeginInvoke(new setEncoding(setEncValue)); } - string query = query = list_queue.Items[0].ToString(); - // found query is a global varible - Functions.QueryParser parsed = Functions.QueryParser.Parse(query); + Functions.QueryParser parsed = Functions.QueryParser.Parse(queue.getLastQuery()); lbl_source.Text = parsed.Source; lbl_dest.Text = parsed.Destination; @@ -231,64 +279,43 @@ namespace Handbrake } } - private void list_queue_SelectedIndexChanged(object sender, EventArgs e) - { - if (list_queue.SelectedItem != null) - text_edit.Text = list_queue.SelectedItem.ToString(); - - listCount = list_queue.Items.Count; - } - - #endregion - - #region Buttons - + // Move an item up the Queue private void btn_up_Click(object sender, EventArgs e) { - int count = list_queue.Items.Count; - int itemToMove = list_queue.SelectedIndex; - int previousItemint = 0; - String previousItem = ""; - - if (itemToMove > 0) + if (list_queue.SelectedIndices.Count != 0) { - previousItemint = itemToMove - 1; - previousItem = list_queue.Items[previousItemint].ToString(); - list_queue.Items[previousItemint] = list_queue.Items[itemToMove]; - list_queue.Items[itemToMove] = previousItem; - list_queue.SelectedIndex = list_queue.SelectedIndex - 1; + queue.moveUp(list_queue.SelectedIndices[0]); + redrawQueue(); } } + // Move an item down the Queue private void btn_down_Click(object sender, EventArgs e) { - int count = list_queue.Items.Count; - int itemToMove = list_queue.SelectedIndex; - int itemAfterInt = 0; - String itemAfter = ""; - - if (itemToMove < (count - 1)) + if (list_queue.SelectedIndices.Count != 0) { - itemAfterInt = itemToMove + 1; - itemAfter = list_queue.Items[itemAfterInt].ToString(); - list_queue.Items[itemAfterInt] = list_queue.Items[itemToMove]; - list_queue.Items[itemToMove] = itemAfter; - list_queue.SelectedIndex = list_queue.SelectedIndex + 1; + queue.moveDown(list_queue.SelectedIndices[0]); + redrawQueue(); } } + // Remove an item from the queue private void btn_delete_Click(object sender, EventArgs e) { - list_queue.Items.Remove(list_queue.SelectedItem); + if (list_queue.SelectedIndices.Count != 0) + { + queue.remove(list_queue.SelectedIndices[0]); + redrawQueue(); + } } + // Generate a batch file script to run the encode seperate of HandBrake private void btn_batch_Click(object sender, EventArgs e) { string queries = ""; - for (int i = 0; i < list_queue.Items.Count; i++) + foreach (string query_item in queue.getQueue()) { - string query = list_queue.Items[i].ToString(); - string fullQuery = '"' + Application.StartupPath.ToString() + "\\HandBrakeCLI.exe" + '"' + query; + string fullQuery = '"' + Application.StartupPath.ToString() + "\\HandBrakeCLI.exe" + '"' + query_item; if (queries == "") queries = queries + fullQuery; @@ -304,13 +331,10 @@ namespace Handbrake { try { - // Create a StreamWriter and open the file + // Create a StreamWriter and open the file, Write the batch file query to the file and + // Close the stream StreamWriter line = new StreamWriter(filename); - - // Write the batch file query to the file line.WriteLine(strCmdLine); - - // close the stream line.Close(); MessageBox.Show("Your batch script has been sucessfully saved.", "Status", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); @@ -323,37 +347,19 @@ namespace Handbrake } } - int listCount = 0; - private void btn_updateQuery_Click(object sender, EventArgs e) - { - if (text_edit.Text != "") - { - if (list_queue.Items.Count != listCount) - { - MessageBox.Show("Unable to modify the selected item. The number of items on the list has changed. \nPlease avoid modifying an item when a new encode is about to start!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); - } - else - { - if (list_queue.SelectedItem != null) - list_queue.Items[list_queue.SelectedIndex] = text_edit.Text; - - } - } - } - + // Hide's the window from the users view. private void btn_Close_Click(object sender, EventArgs e) { this.Hide(); } - #endregion - + // Hide's the window when the user tries to "x" out of the window instead of closing it. protected override void OnClosing(CancelEventArgs e) { e.Cancel = true; this.Hide(); base.OnClosing(e); } - + } } \ No newline at end of file -- 2.11.0