From 5b73df5035172e03569777025e040e7fbfe9b875 Mon Sep 17 00:00:00 2001 From: sr55 Date: Fri, 11 Jun 2010 21:08:44 +0000 Subject: WinGui: - Fixes some issues with status labels not updating correctly on the queue window. - Now includes encode status on the queue window. - Minor UI tweaks. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3377 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- .../EncodeProgressEventArgs.cs | 5 + .../Services/Encode.cs | 3 +- win/C#/frmQueue.Designer.cs | 289 +++++---------------- win/C#/frmQueue.cs | 258 ++++++++++-------- 4 files changed, 228 insertions(+), 327 deletions(-) diff --git a/win/C#/HandBrake.ApplicationServices/EncodeProgressEventArgs.cs b/win/C#/HandBrake.ApplicationServices/EncodeProgressEventArgs.cs index 8939e11c2..f51b3ab57 100644 --- a/win/C#/HandBrake.ApplicationServices/EncodeProgressEventArgs.cs +++ b/win/C#/HandBrake.ApplicationServices/EncodeProgressEventArgs.cs @@ -36,5 +36,10 @@ namespace HandBrake.ApplicationServices /// Gets or sets Task. /// public int Task { get; set; } + + /// + /// Gets or sets TaskCount. + /// + public int TaskCount { get; set; } } } diff --git a/win/C#/HandBrake.ApplicationServices/Services/Encode.cs b/win/C#/HandBrake.ApplicationServices/Services/Encode.cs index d4e971e63..cb6dbee7d 100644 --- a/win/C#/HandBrake.ApplicationServices/Services/Encode.cs +++ b/win/C#/HandBrake.ApplicationServices/Services/Encode.cs @@ -595,7 +595,8 @@ namespace HandBrake.ApplicationServices.Services CurrentFrameRate = currentFps, EstimatedTimeLeft = timeRemaining, PercentComplete = percentComplete, - Task = currentTask + Task = currentTask, + TaskCount = taskCount }; if (this.EncodeStatusChanged != null) diff --git a/win/C#/frmQueue.Designer.cs b/win/C#/frmQueue.Designer.cs index e6f0a2e50..a8997e1a7 100644 --- a/win/C#/frmQueue.Designer.cs +++ b/win/C#/frmQueue.Designer.cs @@ -35,15 +35,7 @@ namespace Handbrake { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmQueue)); - 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.toolTip1 = new System.Windows.Forms.ToolTip(this.components); - this.label4 = new System.Windows.Forms.Label(); - this.lbl_chapt = new System.Windows.Forms.Label(); - this.lbl_title = new System.Windows.Forms.Label(); - this.lbl_aEnc = new System.Windows.Forms.Label(); - this.lbl_vEnc = new System.Windows.Forms.Label(); this.lbl_dest = new System.Windows.Forms.Label(); this.lbl_source = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); @@ -60,12 +52,12 @@ namespace Handbrake this.mnu_readd = new System.Windows.Forms.ToolStripMenuItem(); this.SaveFile = new System.Windows.Forms.SaveFileDialog(); this.list_queue = new System.Windows.Forms.ListView(); - this.Title = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.Chapters = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.Source = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.Destination = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.EncoderVideo = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.Audio = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + 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.mnu_queue = new System.Windows.Forms.ContextMenuStrip(this.components); this.mnu_up = new System.Windows.Forms.ToolStripMenuItem(); this.mnu_Down = new System.Windows.Forms.ToolStripMenuItem(); @@ -76,140 +68,35 @@ namespace Handbrake this.statusStrip1 = new System.Windows.Forms.StatusStrip(); this.lbl_encodesPending = new System.Windows.Forms.ToolStripStatusLabel(); this.OpenFile = new System.Windows.Forms.OpenFileDialog(); + this.lbl_encodeStatus = new System.Windows.Forms.Label(); this.splitContainer1 = new System.Windows.Forms.SplitContainer(); - this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); - this.panel3 = new System.Windows.Forms.Panel(); - this.panel2 = new System.Windows.Forms.Panel(); this.panel1 = new System.Windows.Forms.Panel(); + this.panel2 = new System.Windows.Forms.Panel(); + this.lbl_encodeOptions = new System.Windows.Forms.Label(); this.toolStrip1.SuspendLayout(); this.mnu_queue.SuspendLayout(); this.statusStrip1.SuspendLayout(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.SuspendLayout(); - this.tableLayoutPanel1.SuspendLayout(); this.SuspendLayout(); // - // btn_down - // - this.btn_down.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btn_down.BackColor = System.Drawing.SystemColors.ControlLight; - 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(625, 52); - this.btn_down.Name = "btn_down"; - this.tableLayoutPanel1.SetRowSpan(this.btn_down, 2); - this.btn_down.Size = new System.Drawing.Size(64, 22); - this.btn_down.TabIndex = 33; - this.btn_down.TabStop = false; - this.btn_down.Text = "Down"; - this.toolTip1.SetToolTip(this.btn_down, "Move the selected item down 1 place in the queue"); - this.btn_down.UseVisualStyleBackColor = true; - this.btn_down.Click += new System.EventHandler(this.BtnDownClick); - // - // btn_up - // - this.btn_up.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btn_up.BackColor = System.Drawing.SystemColors.ControlLight; - 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(564, 52); - this.btn_up.Name = "btn_up"; - this.tableLayoutPanel1.SetRowSpan(this.btn_up, 2); - this.btn_up.Size = new System.Drawing.Size(55, 22); - this.btn_up.TabIndex = 32; - this.btn_up.TabStop = false; - this.btn_up.Text = "Up"; - this.toolTip1.SetToolTip(this.btn_up, "Move the selected item up 1 place in the queue."); - this.btn_up.UseVisualStyleBackColor = true; - this.btn_up.Click += new System.EventHandler(this.BtnUpClick); - // - // btn_delete - // - this.btn_delete.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.btn_delete.BackColor = System.Drawing.SystemColors.ControlLight; - 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(695, 52); - this.btn_delete.Name = "btn_delete"; - this.tableLayoutPanel1.SetRowSpan(this.btn_delete, 2); - this.btn_delete.Size = new System.Drawing.Size(64, 22); - this.btn_delete.TabIndex = 31; - this.btn_delete.TabStop = false; - this.btn_delete.Text = "Delete"; - this.toolTip1.SetToolTip(this.btn_delete, "Remove the selected item from the queue"); - this.btn_delete.UseVisualStyleBackColor = true; - this.btn_delete.Click += new System.EventHandler(this.BtnDeleteClick); - // - // 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(125, 49); - this.label4.Name = "label4"; - this.tableLayoutPanel1.SetRowSpan(this.label4, 2); - this.label4.Size = new System.Drawing.Size(48, 26); - this.label4.TabIndex = 70; - this.label4.Text = "Video:\r\nAudio:"; - // - // lbl_chapt - // - this.lbl_chapt.AutoSize = true; - this.lbl_chapt.Location = new System.Drawing.Point(108, 62); - this.lbl_chapt.Name = "lbl_chapt"; - this.lbl_chapt.Size = new System.Drawing.Size(11, 13); - this.lbl_chapt.TabIndex = 69; - this.lbl_chapt.Text = "-"; - // - // lbl_title - // - this.lbl_title.AccessibleRole = System.Windows.Forms.AccessibleRole.None; - this.lbl_title.AutoSize = true; - this.lbl_title.Location = new System.Drawing.Point(108, 49); - this.lbl_title.Name = "lbl_title"; - this.lbl_title.Size = new System.Drawing.Size(11, 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(179, 62); - this.lbl_aEnc.Name = "lbl_aEnc"; - this.lbl_aEnc.Size = new System.Drawing.Size(11, 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(179, 49); - this.lbl_vEnc.Name = "lbl_vEnc"; - this.lbl_vEnc.Size = new System.Drawing.Size(11, 13); - this.lbl_vEnc.TabIndex = 66; - this.lbl_vEnc.Text = "-"; - // // lbl_dest // - this.lbl_dest.AutoSize = true; - this.tableLayoutPanel1.SetColumnSpan(this.lbl_dest, 6); - this.lbl_dest.Location = new System.Drawing.Point(108, 36); + this.lbl_dest.AutoEllipsis = true; + this.lbl_dest.Location = new System.Drawing.Point(117, 60); this.lbl_dest.Name = "lbl_dest"; - this.lbl_dest.Size = new System.Drawing.Size(11, 13); + this.lbl_dest.Size = new System.Drawing.Size(671, 13); this.lbl_dest.TabIndex = 65; this.lbl_dest.Text = "-"; this.lbl_dest.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // lbl_source // - this.lbl_source.AutoSize = true; - this.tableLayoutPanel1.SetColumnSpan(this.lbl_source, 6); - this.lbl_source.Location = new System.Drawing.Point(108, 23); + this.lbl_source.AutoEllipsis = true; + this.lbl_source.Location = new System.Drawing.Point(117, 47); this.lbl_source.Name = "lbl_source"; - this.lbl_source.Size = new System.Drawing.Size(11, 13); + this.lbl_source.Size = new System.Drawing.Size(671, 13); this.lbl_source.TabIndex = 64; this.lbl_source.Text = "-"; // @@ -217,18 +104,17 @@ 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(3, 23); + this.label1.Location = new System.Drawing.Point(12, 47); this.label1.Name = "label1"; - this.tableLayoutPanel1.SetRowSpan(this.label1, 4); - this.label1.Size = new System.Drawing.Size(99, 52); + this.label1.Size = new System.Drawing.Size(85, 39); this.label1.TabIndex = 63; - this.label1.Text = "Source:\r\nDestination:\r\nDVD Title:\r\nDVD Chapters:"; + this.label1.Text = "Source:\r\nDestination:\r\nOptions:"; // // label3 // 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(3, 0); + this.label3.Location = new System.Drawing.Point(12, 9); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(82, 13); this.label3.TabIndex = 62; @@ -245,7 +131,7 @@ namespace Handbrake this.toolStrip1.Location = new System.Drawing.Point(0, 0); this.toolStrip1.Name = "toolStrip1"; this.toolStrip1.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional; - this.toolStrip1.Size = new System.Drawing.Size(787, 39); + this.toolStrip1.Size = new System.Drawing.Size(813, 39); this.toolStrip1.TabIndex = 71; this.toolStrip1.Text = "toolStrip1"; // @@ -349,9 +235,9 @@ namespace Handbrake 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(13, 0); + this.list_queue.Location = new System.Drawing.Point(15, 0); this.list_queue.Name = "list_queue"; - this.list_queue.Size = new System.Drawing.Size(761, 219); + this.list_queue.Size = new System.Drawing.Size(773, 214); this.list_queue.TabIndex = 72; this.list_queue.UseCompatibleStateImageBehavior = false; this.list_queue.View = System.Windows.Forms.View.Details; @@ -397,43 +283,43 @@ namespace Handbrake this.toolStripSeparator4, this.mnu_delete}); this.mnu_queue.Name = "mnu_queue"; - this.mnu_queue.Size = new System.Drawing.Size(153, 126); + this.mnu_queue.Size = new System.Drawing.Size(139, 104); // // mnu_up // this.mnu_up.Name = "mnu_up"; - this.mnu_up.Size = new System.Drawing.Size(152, 22); + this.mnu_up.Size = new System.Drawing.Size(138, 22); this.mnu_up.Text = "Move Up"; this.mnu_up.Click += new System.EventHandler(this.MnuUpClick); // // mnu_Down // this.mnu_Down.Name = "mnu_Down"; - this.mnu_Down.Size = new System.Drawing.Size(152, 22); + this.mnu_Down.Size = new System.Drawing.Size(138, 22); this.mnu_Down.Text = "Move Down"; this.mnu_Down.Click += new System.EventHandler(this.MnuDownClick); // // toolStripSeparator3 // this.toolStripSeparator3.Name = "toolStripSeparator3"; - this.toolStripSeparator3.Size = new System.Drawing.Size(149, 6); + this.toolStripSeparator3.Size = new System.Drawing.Size(135, 6); // // mnu_edit // this.mnu_edit.Name = "mnu_edit"; - this.mnu_edit.Size = new System.Drawing.Size(152, 22); + this.mnu_edit.Size = new System.Drawing.Size(138, 22); this.mnu_edit.Text = "Edit"; this.mnu_edit.Click += new System.EventHandler(this.MnuEditClick); // // toolStripSeparator4 // this.toolStripSeparator4.Name = "toolStripSeparator4"; - this.toolStripSeparator4.Size = new System.Drawing.Size(149, 6); + this.toolStripSeparator4.Size = new System.Drawing.Size(135, 6); // // mnu_delete // this.mnu_delete.Name = "mnu_delete"; - this.mnu_delete.Size = new System.Drawing.Size(152, 22); + this.mnu_delete.Size = new System.Drawing.Size(138, 22); this.mnu_delete.Text = "Delete"; this.mnu_delete.Click += new System.EventHandler(this.MnuDeleteClick); // @@ -441,10 +327,10 @@ namespace Handbrake // this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.lbl_encodesPending}); - this.statusStrip1.Location = new System.Drawing.Point(0, 368); + this.statusStrip1.Location = new System.Drawing.Point(0, 363); this.statusStrip1.Name = "statusStrip1"; this.statusStrip1.Padding = new System.Windows.Forms.Padding(1, 0, 12, 0); - this.statusStrip1.Size = new System.Drawing.Size(787, 22); + this.statusStrip1.Size = new System.Drawing.Size(813, 22); this.statusStrip1.TabIndex = 73; this.statusStrip1.Text = "statusStrip1"; // @@ -460,94 +346,71 @@ namespace Handbrake // this.OpenFile.Filter = "HandBrake Queue|*.queue"; // + // lbl_encodeStatus + // + this.lbl_encodeStatus.AutoSize = true; + this.lbl_encodeStatus.Location = new System.Drawing.Point(12, 30); + this.lbl_encodeStatus.Name = "lbl_encodeStatus"; + this.lbl_encodeStatus.Size = new System.Drawing.Size(38, 13); + this.lbl_encodeStatus.TabIndex = 73; + this.lbl_encodeStatus.Text = "Ready"; + // // splitContainer1 // this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1; - this.splitContainer1.IsSplitterFixed = true; this.splitContainer1.Location = new System.Drawing.Point(0, 39); this.splitContainer1.Name = "splitContainer1"; this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal; // // splitContainer1.Panel1 // - this.splitContainer1.Panel1.Controls.Add(this.tableLayoutPanel1); + this.splitContainer1.Panel1.Controls.Add(this.lbl_encodeOptions); + this.splitContainer1.Panel1.Controls.Add(this.label3); + this.splitContainer1.Panel1.Controls.Add(this.lbl_dest); + this.splitContainer1.Panel1.Controls.Add(this.label1); + this.splitContainer1.Panel1.Controls.Add(this.lbl_encodeStatus); + this.splitContainer1.Panel1.Controls.Add(this.lbl_source); // // splitContainer1.Panel2 // this.splitContainer1.Panel2.Controls.Add(this.list_queue); - this.splitContainer1.Panel2.Controls.Add(this.panel3); this.splitContainer1.Panel2.Controls.Add(this.panel2); this.splitContainer1.Panel2.Controls.Add(this.panel1); - this.splitContainer1.Size = new System.Drawing.Size(787, 329); - this.splitContainer1.SplitterDistance = 94; - this.splitContainer1.SplitterWidth = 1; + this.splitContainer1.Size = new System.Drawing.Size(813, 324); + this.splitContainer1.SplitterDistance = 106; this.splitContainer1.TabIndex = 74; // - // tableLayoutPanel1 - // - this.tableLayoutPanel1.AutoSize = true; - this.tableLayoutPanel1.ColumnCount = 7; - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel1.Controls.Add(this.label1, 0, 2); - this.tableLayoutPanel1.Controls.Add(this.btn_delete, 6, 4); - this.tableLayoutPanel1.Controls.Add(this.btn_down, 5, 4); - this.tableLayoutPanel1.Controls.Add(this.lbl_aEnc, 3, 5); - this.tableLayoutPanel1.Controls.Add(this.btn_up, 4, 4); - this.tableLayoutPanel1.Controls.Add(this.lbl_source, 1, 2); - this.tableLayoutPanel1.Controls.Add(this.lbl_vEnc, 3, 4); - this.tableLayoutPanel1.Controls.Add(this.label4, 2, 4); - this.tableLayoutPanel1.Controls.Add(this.lbl_dest, 1, 3); - this.tableLayoutPanel1.Controls.Add(this.lbl_title, 1, 4); - this.tableLayoutPanel1.Controls.Add(this.lbl_chapt, 1, 5); - this.tableLayoutPanel1.Controls.Add(this.label3, 0, 0); - this.tableLayoutPanel1.Location = new System.Drawing.Point(13, 13); - this.tableLayoutPanel1.Name = "tableLayoutPanel1"; - this.tableLayoutPanel1.RowCount = 6; - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 10F)); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel1.Size = new System.Drawing.Size(762, 77); - this.tableLayoutPanel1.TabIndex = 71; - // - // panel3 - // - this.panel3.Dock = System.Windows.Forms.DockStyle.Bottom; - this.panel3.Location = new System.Drawing.Point(13, 219); - this.panel3.Name = "panel3"; - this.panel3.Size = new System.Drawing.Size(761, 15); - this.panel3.TabIndex = 77; + // panel1 + // + this.panel1.Dock = System.Windows.Forms.DockStyle.Left; + this.panel1.Location = new System.Drawing.Point(0, 0); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(15, 214); + this.panel1.TabIndex = 0; // // panel2 // this.panel2.Dock = System.Windows.Forms.DockStyle.Right; - this.panel2.Location = new System.Drawing.Point(774, 0); + this.panel2.Location = new System.Drawing.Point(788, 0); this.panel2.Name = "panel2"; - this.panel2.Size = new System.Drawing.Size(13, 234); - this.panel2.TabIndex = 76; + this.panel2.Size = new System.Drawing.Size(25, 214); + this.panel2.TabIndex = 1; // - // panel1 + // lbl_encodeOptions // - this.panel1.Dock = System.Windows.Forms.DockStyle.Left; - this.panel1.Location = new System.Drawing.Point(0, 0); - this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(13, 234); - this.panel1.TabIndex = 75; + this.lbl_encodeOptions.AutoEllipsis = true; + this.lbl_encodeOptions.Location = new System.Drawing.Point(117, 73); + this.lbl_encodeOptions.Name = "lbl_encodeOptions"; + this.lbl_encodeOptions.Size = new System.Drawing.Size(671, 33); + this.lbl_encodeOptions.TabIndex = 74; + this.lbl_encodeOptions.Text = "-"; // // frmQueue // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(787, 390); + this.ClientSize = new System.Drawing.Size(813, 385); this.Controls.Add(this.splitContainer1); this.Controls.Add(this.statusStrip1); this.Controls.Add(this.toolStrip1); @@ -566,8 +429,6 @@ namespace Handbrake this.splitContainer1.Panel1.PerformLayout(); this.splitContainer1.Panel2.ResumeLayout(false); this.splitContainer1.ResumeLayout(false); - this.tableLayoutPanel1.ResumeLayout(false); - this.tableLayoutPanel1.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); @@ -575,15 +436,7 @@ namespace Handbrake #endregion - internal System.Windows.Forms.Button btn_down; - internal System.Windows.Forms.Button btn_up; - internal System.Windows.Forms.Button btn_delete; private System.Windows.Forms.ToolTip toolTip1; - private System.Windows.Forms.Label label4; - private System.Windows.Forms.Label lbl_chapt; - private System.Windows.Forms.Label lbl_title; - private System.Windows.Forms.Label lbl_aEnc; - private System.Windows.Forms.Label lbl_vEnc; private System.Windows.Forms.Label lbl_dest; private System.Windows.Forms.Label lbl_source; private System.Windows.Forms.Label label1; @@ -607,10 +460,6 @@ namespace Handbrake private System.Windows.Forms.ToolStripMenuItem mnu_export; private System.Windows.Forms.OpenFileDialog OpenFile; private System.Windows.Forms.ToolStripStatusLabel lbl_encodesPending; - private System.Windows.Forms.SplitContainer splitContainer1; - private System.Windows.Forms.Panel panel2; - private System.Windows.Forms.Panel panel1; - private System.Windows.Forms.Panel panel3; private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; private System.Windows.Forms.ToolStripMenuItem mnu_readd; private System.Windows.Forms.ContextMenuStrip mnu_queue; @@ -618,8 +467,12 @@ namespace Handbrake private System.Windows.Forms.ToolStripMenuItem mnu_Down; 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_edit; private System.Windows.Forms.ToolStripSeparator toolStripSeparator4; + private System.Windows.Forms.Label lbl_encodeStatus; + private System.Windows.Forms.SplitContainer splitContainer1; + private System.Windows.Forms.Panel panel2; + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.Label lbl_encodeOptions; } } diff --git a/win/C#/frmQueue.cs b/win/C#/frmQueue.cs index f45ed39bc..b5a37bc5a 100644 --- a/win/C#/frmQueue.cs +++ b/win/C#/frmQueue.cs @@ -9,6 +9,7 @@ namespace Handbrake using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; + using System.IO; using System.Windows.Forms; using Functions; @@ -57,6 +58,80 @@ namespace Handbrake queue.EncodeStarted += new EventHandler(QueueOnEncodeStart); queue.QueueCompleted += new EventHandler(QueueOnQueueFinished); queue.QueuePauseRequested += new EventHandler(QueueOnPaused); + queue.QueueListChanged += new EventHandler(queue_QueueListChanged); + + queue.EncodeStarted += new EventHandler(queue_EncodeStarted); + queue.EncodeEnded += new EventHandler(queue_EncodeEnded); + } + + /// + /// Queue Changed + /// + /// + /// The sender. + /// + /// + /// The e. + /// + private void queue_QueueListChanged(object sender, EventArgs e) + { + UpdateUiElementsOnQueueChange(); + } + + /// + /// Encode Ended + /// + /// + /// The sender. + /// + /// + /// The e. + /// + private void queue_EncodeEnded(object sender, EventArgs e) + { + queue.EncodeStatusChanged -= EncodeQueue_EncodeStatusChanged; + ResetEncodeText(); + } + + /// + /// Queue Started + /// + /// + /// The sender. + /// + /// + /// The e. + /// + private void queue_EncodeStarted(object sender, EventArgs e) + { + this.SetCurrentEncodeInformation(); + queue.EncodeStatusChanged += EncodeQueue_EncodeStatusChanged; + } + + /// + /// Display the Encode Status + /// + /// + /// The sender. + /// + /// + /// The e. + /// + private void EncodeQueue_EncodeStatusChanged(object sender, HandBrake.ApplicationServices.EncodeProgressEventArgs e) + { + if (this.InvokeRequired) + { + this.BeginInvoke(new Encode.EncodeProgessStatus(EncodeQueue_EncodeStatusChanged), new[] { sender, e }); + return; + } + + lbl_encodeStatus.Text = + string.Format( + "Encoding: Pass {0} of {1}, {2:00.00}% Time Remaining: {3}", + e.Task, + e.Task, + e.PercentComplete, + e.EstimatedTimeLeft); } /// @@ -71,7 +146,7 @@ namespace Handbrake private void QueueOnPaused(object sender, EventArgs e) { SetUiEncodeFinished(); - UpdateUiElements(); + UpdateUiElementsOnQueueChange(); } /// @@ -101,8 +176,7 @@ namespace Handbrake private void QueueOnEncodeStart(object sender, EventArgs e) { SetUiEncodeStarted(); // make sure the UI is set correctly - SetCurrentEncodeInformation(); - UpdateUiElements(); // Redraw the Queue, a new encode has started. + UpdateUiElementsOnQueueChange(); // Redraw the Queue, a new encode has started. } /// @@ -110,7 +184,7 @@ namespace Handbrake /// public void SetQueue() { - UpdateUiElements(); + UpdateUiElementsOnQueueChange(); } /// @@ -143,8 +217,8 @@ namespace Handbrake SetUiEncodeStarted(); } - if (!queue.IsEncoding) - queue.Start(); + lbl_encodeStatus.Text = "Encoding ..."; + queue.Start(); } /// @@ -159,8 +233,6 @@ namespace Handbrake private void BtnPauseClick(object sender, EventArgs e) { queue.Pause(); - SetUiEncodeFinished(); - ResetQueue(); 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); @@ -209,12 +281,24 @@ namespace Handbrake btn_pause.Visible = false; btn_encode.Enabled = true; + ResetEncodeText(); + } + + /// + /// Reset the current job text + /// + private void ResetEncodeText() + { + if (InvokeRequired) + { + BeginInvoke(new UpdateHandler(ResetEncodeText)); + return; + } + lbl_encodeStatus.Text = "Ready"; + lbl_source.Text = "-"; lbl_dest.Text = "-"; - lbl_vEnc.Text = "-"; - lbl_aEnc.Text = "-"; - lbl_title.Text = "-"; - lbl_chapt.Text = "-"; + lbl_encodeOptions.Text = "-"; lbl_encodesPending.Text = list_queue.Items.Count + " encode(s) pending"; } @@ -276,11 +360,11 @@ namespace Handbrake /// /// Update the UI elements /// - private void UpdateUiElements() + private void UpdateUiElementsOnQueueChange() { if (InvokeRequired) { - BeginInvoke(new UpdateHandler(UpdateUiElements)); + BeginInvoke(new UpdateHandler(UpdateUiElementsOnQueueChange)); return; } @@ -300,75 +384,45 @@ namespace Handbrake BeginInvoke(new UpdateHandler(SetCurrentEncodeInformation)); } - // found query is a global varible QueryParser parsed = QueryParser.Parse(queue.LastEncode.Query); - lbl_source.Text = queue.LastEncode.Source; - lbl_dest.Text = queue.LastEncode.Destination; - - lbl_title.Text = parsed.Title == 0 ? "Auto" : parsed.Title.ToString(); + // Get title and chapters + string title = parsed.Title == 0 ? "Auto" : parsed.Title.ToString(); + string chapterlbl; if (Equals(parsed.ChapterStart, 0)) - lbl_chapt.Text = "Auto"; + chapterlbl = "Auto"; else { string chapters = parsed.ChapterStart.ToString(); if (parsed.ChapterFinish != 0) chapters = chapters + " - " + parsed.ChapterFinish; - lbl_chapt.Text = chapters; + chapterlbl = chapters; } - lbl_vEnc.Text = parsed.VideoEncoder; - - // Display The Audio Track Information + // Get audio information string audio = string.Empty; foreach (AudioTrack track in parsed.AudioInformation) { - if (audio != string.Empty) + if (audio != string.Empty) audio += ", " + track.Encoder; else audio = track.Encoder; } - lbl_aEnc.Text = audio; - } + + // found query is a global varible + lbl_encodeStatus.Text = "Encoding ..."; + lbl_source.Text = queue.LastEncode.Source + "(Title: " + title + " Chapters: " + chapterlbl + ")"; + lbl_dest.Text = queue.LastEncode.Destination; + lbl_encodeOptions.Text = "Video: " + parsed.VideoEncoder + " Audio: " + audio + Environment.NewLine + + "x264 Options: " + parsed.H264Query; + } catch (Exception) { // Do Nothing } } - /// - /// Delete the currently selected items on the queue - /// - private void DeleteSelectedItems() - { - // If there are selected items - if (list_queue.SelectedIndices.Count > 0) - { - // Save the selected indices to select them after the move - List selectedIndices = new List(list_queue.SelectedIndices.Count); - foreach (int selectedIndex in list_queue.SelectedIndices) - selectedIndices.Add(selectedIndex); - - int firstSelectedIndex = selectedIndices[0]; - - // Reverse the list to delete the items from last to first (preserves indices) - selectedIndices.Reverse(); - - // Remove each selected item - foreach (int selectedIndex in selectedIndices) - queue.Remove(selectedIndex); - - UpdateUiElements(); - - // Select the item where the first deleted item was previously - if (firstSelectedIndex < list_queue.Items.Count) - list_queue.Items[firstSelectedIndex].Selected = true; - } - - list_queue.Select(); // Activate the control to show the selected items - } - - // Queue Management + /* Right Click Menu */ /// /// Handle the Move Up Menu Item /// @@ -437,47 +491,7 @@ namespace Handbrake DeleteSelectedItems(); } - /// - /// Handle the Button Up Click - /// - /// - /// The sender. - /// - /// - /// The e. - /// - private void BtnUpClick(object sender, EventArgs e) - { - MoveUp(); - } - - /// - /// Handle the button down click - /// - /// - /// The sender. - /// - /// - /// The e. - /// - private void BtnDownClick(object sender, EventArgs e) - { - MoveDown(); - } - - /// - /// Handle the delete button click - /// - /// - /// The sender. - /// - /// - /// The e. - /// - private void BtnDeleteClick(object sender, EventArgs e) - { - DeleteSelectedItems(); - } + /* Keyboard Shortcuts */ /// /// Handle the delete keyboard press @@ -494,6 +508,8 @@ namespace Handbrake DeleteSelectedItems(); } + /* Queue Management */ + /// /// Move items up in the queue /// @@ -511,8 +527,6 @@ namespace Handbrake foreach (int selectedIndex in selectedIndices) queue.MoveUp(selectedIndex); - UpdateUiElements(); - // Keep the selected item(s) selected, now moved up one index foreach (int selectedIndex in selectedIndices) if (selectedIndex - 1 > -1) // Defensive programming: ensure index is good @@ -543,8 +557,6 @@ namespace Handbrake foreach (int selectedIndex in selectedIndices) queue.MoveDown(selectedIndex); - UpdateUiElements(); - // Keep the selected item(s) selected, now moved down one index foreach (int selectedIndex in selectedIndices) if (selectedIndex + 1 < list_queue.Items.Count) // Defensive programming: ensure index is good @@ -554,7 +566,37 @@ namespace Handbrake list_queue.Select(); // Activate the control to show the selected items } - // Queue Import/Export Features + /// + /// Delete the currently selected items on the queue + /// + private void DeleteSelectedItems() + { + // If there are selected items + if (list_queue.SelectedIndices.Count > 0) + { + // Save the selected indices to select them after the move + List selectedIndices = new List(list_queue.SelectedIndices.Count); + foreach (int selectedIndex in list_queue.SelectedIndices) + selectedIndices.Add(selectedIndex); + + int firstSelectedIndex = selectedIndices[0]; + + // Reverse the list to delete the items from last to first (preserves indices) + selectedIndices.Reverse(); + + // Remove each selected item + foreach (int selectedIndex in selectedIndices) + queue.Remove(selectedIndex); + + // Select the item where the first deleted item was previously + if (firstSelectedIndex < list_queue.Items.Count) + list_queue.Items[firstSelectedIndex].Selected = true; + } + + list_queue.Select(); // Activate the control to show the selected items + } + + /* Queue Import / Export features */ /// /// Create a batch script @@ -607,7 +649,6 @@ namespace Handbrake OpenFile.ShowDialog(); if (OpenFile.FileName != String.Empty) queue.LoadQueueFromFile(OpenFile.FileName); - UpdateUiElements(); } /// @@ -629,10 +670,11 @@ namespace Handbrake queue.LastEncode.Source, queue.LastEncode.Destination, queue.LastEncode.CustomQuery); - UpdateUiElements(); } } + /* Overrides */ + /// /// Hide's the window when the user tries to "x" out of the window instead of closing it. /// -- cgit v1.2.3