]> granicus.if.org Git - handbrake/commitdiff
WinGui:
authorsr55 <sr55.hb@outlook.com>
Tue, 30 Dec 2008 21:04:29 +0000 (21:04 +0000)
committersr55 <sr55.hb@outlook.com>
Tue, 30 Dec 2008 21:04:29 +0000 (21:04 +0000)
- Preview Video setup for Encodes for any of the 10 previews that you'd find in the mac gui, for durations from 5 to 60 seconds.
- Removed some old code

git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2050 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/C#/frmGenPreview.Designer.cs
win/C#/frmGenPreview.cs
win/C#/frmMain.Designer.cs
win/C#/frmMain.cs
win/C#/frmMain.resx
win/C#/frmMain/QueryGenerator.cs

index eefe1362da13d2c9cd05a6f3b464fc3fb3efa58d..4aeca12b4ff16178437217558bbe572ece431221 100644 (file)
@@ -37,6 +37,8 @@
             this.lbl_status = new System.Windows.Forms.Label();\r
             this.cb_duration = new System.Windows.Forms.ComboBox();\r
             this.label2 = new System.Windows.Forms.Label();\r
+            this.label3 = new System.Windows.Forms.Label();\r
+            this.cb_preview = new System.Windows.Forms.ComboBox();\r
             this.toolBar.SuspendLayout();\r
             this.SuspendLayout();\r
             // \r
@@ -50,7 +52,7 @@
             this.toolBar.Location = new System.Drawing.Point(0, 0);\r
             this.toolBar.Name = "toolBar";\r
             this.toolBar.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;\r
-            this.toolBar.Size = new System.Drawing.Size(340, 39);\r
+            this.toolBar.Size = new System.Drawing.Size(377, 39);\r
             this.toolBar.TabIndex = 38;\r
             this.toolBar.Text = "toolStrip1";\r
             // \r
@@ -60,7 +62,7 @@
             this.btn_encode.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;\r
             this.btn_encode.ImageTransparentColor = System.Drawing.Color.Magenta;\r
             this.btn_encode.Name = "btn_encode";\r
-            this.btn_encode.Size = new System.Drawing.Size(127, 36);\r
+            this.btn_encode.Size = new System.Drawing.Size(115, 36);\r
             this.btn_encode.Text = "Encode Sample";\r
             this.btn_encode.Click += new System.EventHandler(this.btn_encode_Click);\r
             // \r
@@ -76,7 +78,7 @@
             this.btn_play.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;\r
             this.btn_play.ImageTransparentColor = System.Drawing.Color.Magenta;\r
             this.btn_play.Name = "btn_play";\r
-            this.btn_play.Size = new System.Drawing.Size(64, 36);\r
+            this.btn_play.Size = new System.Drawing.Size(63, 36);\r
             this.btn_play.Text = "Play";\r
             this.btn_play.Visible = false;\r
             this.btn_play.Click += new System.EventHandler(this.btn_play_Click);\r
@@ -85,7 +87,7 @@
             // \r
             this.label1.AutoSize = true;\r
             this.label1.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.label1.Location = new System.Drawing.Point(12, 77);\r
+            this.label1.Location = new System.Drawing.Point(12, 79);\r
             this.label1.Name = "label1";\r
             this.label1.Size = new System.Drawing.Size(47, 13);\r
             this.label1.TabIndex = 39;\r
@@ -95,7 +97,7 @@
             // \r
             this.lbl_status.AutoSize = true;\r
             this.lbl_status.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.lbl_status.Location = new System.Drawing.Point(133, 77);\r
+            this.lbl_status.Location = new System.Drawing.Point(117, 79);\r
             this.lbl_status.Name = "lbl_status";\r
             this.lbl_status.Size = new System.Drawing.Size(111, 13);\r
             this.lbl_status.TabIndex = 40;\r
             "50",\r
             "55",\r
             "60"});\r
-            this.cb_duration.Location = new System.Drawing.Point(136, 46);\r
+            this.cb_duration.Location = new System.Drawing.Point(304, 47);\r
             this.cb_duration.MaxLength = 2;\r
             this.cb_duration.Name = "cb_duration";\r
             this.cb_duration.Size = new System.Drawing.Size(46, 21);\r
             // \r
             this.label2.AutoSize = true;\r
             this.label2.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.label2.Location = new System.Drawing.Point(12, 49);\r
+            this.label2.Location = new System.Drawing.Point(180, 50);\r
             this.label2.Name = "label2";\r
             this.label2.Size = new System.Drawing.Size(118, 13);\r
             this.label2.TabIndex = 42;\r
             this.label2.Text = "Duration (seconds):";\r
             this.label2.TextAlign = System.Drawing.ContentAlignment.TopCenter;\r
             // \r
+            // label3\r
+            // \r
+            this.label3.AutoSize = true;\r
+            this.label3.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+            this.label3.Location = new System.Drawing.Point(12, 50);\r
+            this.label3.Name = "label3";\r
+            this.label3.Size = new System.Drawing.Size(102, 13);\r
+            this.label3.TabIndex = 44;\r
+            this.label3.Text = "Start at preview:";\r
+            this.label3.TextAlign = System.Drawing.ContentAlignment.TopCenter;\r
+            // \r
+            // cb_preview\r
+            // \r
+            this.cb_preview.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;\r
+            this.cb_preview.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+            this.cb_preview.FormattingEnabled = true;\r
+            this.cb_preview.Items.AddRange(new object[] {\r
+            "1",\r
+            "2",\r
+            "3",\r
+            "4",\r
+            "5",\r
+            "6",\r
+            "7",\r
+            "8",\r
+            "9",\r
+            "10"});\r
+            this.cb_preview.Location = new System.Drawing.Point(120, 47);\r
+            this.cb_preview.MaxLength = 2;\r
+            this.cb_preview.Name = "cb_preview";\r
+            this.cb_preview.Size = new System.Drawing.Size(46, 21);\r
+            this.cb_preview.TabIndex = 43;\r
+            // \r
             // frmGenPreview\r
             // \r
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\r
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\r
-            this.ClientSize = new System.Drawing.Size(340, 102);\r
+            this.ClientSize = new System.Drawing.Size(377, 104);\r
+            this.Controls.Add(this.label3);\r
+            this.Controls.Add(this.cb_preview);\r
             this.Controls.Add(this.label2);\r
             this.Controls.Add(this.cb_duration);\r
             this.Controls.Add(this.lbl_status);\r
         private System.Windows.Forms.Label lbl_status;\r
         private System.Windows.Forms.Label label2;\r
         private System.Windows.Forms.ComboBox cb_duration;\r
+        private System.Windows.Forms.Label label3;\r
+        private System.Windows.Forms.ComboBox cb_preview;\r
     }\r
 }
\ No newline at end of file
index b522187c55975db48d56194602d81ec84df79041..0bc59e0d74cfeffd4a17601bf330e8f29be1419b 100644 (file)
@@ -24,6 +24,7 @@ namespace Handbrake
             InitializeComponent();\r
             this.mainWindow = mw;\r
             cb_duration.SelectedIndex = 0;\r
+            cb_preview.SelectedIndex = 0;\r
         }\r
 \r
         private void btn_play_Click(object sender, EventArgs e)\r
@@ -54,7 +55,7 @@ namespace Handbrake
 \r
         private void btn_encode_Click(object sender, EventArgs e)\r
         {\r
-            String query = queryGen.GeneratePreviewQuery(mainWindow, cb_duration.Text);\r
+            String query = queryGen.GeneratePreviewQuery(mainWindow, cb_duration.Text, cb_preview.Text);\r
             ThreadPool.QueueUserWorkItem(procMonitor, query);\r
         }\r
         private void procMonitor(object state)\r
index 94ee4ce3ee43484090d6c327f6911f766e65add3..7893e7198271fcfab4c43454dc7b8b8d4e3a3b8d 100644 (file)
@@ -38,7 +38,7 @@ namespace Handbrake
             System.Windows.Forms.Label Label38;\r
             System.Windows.Forms.ContextMenuStrip notifyIconMenu;\r
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmMain));\r
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();\r
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();\r
             this.btn_restore = new System.Windows.Forms.ToolStripMenuItem();\r
             this.DVD_Save = new System.Windows.Forms.SaveFileDialog();\r
             this.File_Save = new System.Windows.Forms.SaveFileDialog();\r
@@ -137,6 +137,12 @@ namespace Handbrake
             this.col_samplerate = new System.Windows.Forms.ColumnHeader();\r
             this.col_bitrate = new System.Windows.Forms.ColumnHeader();\r
             this.col_drc = new System.Windows.Forms.ColumnHeader();\r
+            this.audioMenu = new System.Windows.Forms.ContextMenuStrip(this.components);\r
+            this.audioList_moveup = new System.Windows.Forms.ToolStripMenuItem();\r
+            this.audioList_movedown = new System.Windows.Forms.ToolStripMenuItem();\r
+            this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();\r
+            this.audioList_remove = new System.Windows.Forms.ToolStripMenuItem();\r
+            this.AudioMenuRowHeightHack = new System.Windows.Forms.ImageList(this.components);\r
             this.btn_RemoveAudioTrack = new System.Windows.Forms.Button();\r
             this.btn_addAudioTrack = new System.Windows.Forms.Button();\r
             this.lbl_drc = new System.Windows.Forms.Label();\r
@@ -243,12 +249,6 @@ namespace Handbrake
             this.notifyIcon = new System.Windows.Forms.NotifyIcon(this.components);\r
             this.StatusStrip = new System.Windows.Forms.StatusStrip();\r
             this.lbl_encode = new System.Windows.Forms.ToolStripStatusLabel();\r
-            this.audioMenu = new System.Windows.Forms.ContextMenuStrip(this.components);\r
-            this.audioList_movedown = new System.Windows.Forms.ToolStripMenuItem();\r
-            this.audioList_moveup = new System.Windows.Forms.ToolStripMenuItem();\r
-            this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();\r
-            this.audioList_remove = new System.Windows.Forms.ToolStripMenuItem();\r
-            this.AudioMenuRowHeightHack = new System.Windows.Forms.ImageList(this.components);\r
             Label38 = new System.Windows.Forms.Label();\r
             notifyIconMenu = new System.Windows.Forms.ContextMenuStrip(this.components);\r
             notifyIconMenu.SuspendLayout();\r
@@ -258,6 +258,7 @@ namespace Handbrake
             this.GroupBox1.SuspendLayout();\r
             this.groupBox_output.SuspendLayout();\r
             this.TabPage2.SuspendLayout();\r
+            this.audioMenu.SuspendLayout();\r
             ((System.ComponentModel.ISupportInitialize)(this.tb_drc)).BeginInit();\r
             this.TabPage3.SuspendLayout();\r
             this.TabPage1.SuspendLayout();\r
@@ -278,7 +279,6 @@ namespace Handbrake
             this.presets_menu.SuspendLayout();\r
             this.toolStrip1.SuspendLayout();\r
             this.StatusStrip.SuspendLayout();\r
-            this.audioMenu.SuspendLayout();\r
             this.SuspendLayout();\r
             // \r
             // Label38\r
@@ -642,9 +642,9 @@ namespace Handbrake
             // \r
             // number\r
             // \r
-            dataGridViewCellStyle6.Format = "N0";\r
-            dataGridViewCellStyle6.NullValue = null;\r
-            this.number.DefaultCellStyle = dataGridViewCellStyle6;\r
+            dataGridViewCellStyle1.Format = "N0";\r
+            dataGridViewCellStyle1.NullValue = null;\r
+            this.number.DefaultCellStyle = dataGridViewCellStyle1;\r
             this.number.HeaderText = "Chapter Number";\r
             this.number.MaxInputLength = 3;\r
             this.number.Name = "number";\r
@@ -1597,6 +1597,49 @@ namespace Handbrake
             // \r
             this.col_drc.Text = "DRC";\r
             // \r
+            // audioMenu\r
+            // \r
+            this.audioMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {\r
+            this.audioList_moveup,\r
+            this.audioList_movedown,\r
+            this.toolStripSeparator2,\r
+            this.audioList_remove});\r
+            this.audioMenu.Name = "audioMenu";\r
+            this.audioMenu.Size = new System.Drawing.Size(142, 76);\r
+            // \r
+            // audioList_moveup\r
+            // \r
+            this.audioList_moveup.Name = "audioList_moveup";\r
+            this.audioList_moveup.Size = new System.Drawing.Size(141, 22);\r
+            this.audioList_moveup.Text = "Move Up";\r
+            this.audioList_moveup.Click += new System.EventHandler(this.audioList_moveup_Click);\r
+            // \r
+            // audioList_movedown\r
+            // \r
+            this.audioList_movedown.Name = "audioList_movedown";\r
+            this.audioList_movedown.Size = new System.Drawing.Size(141, 22);\r
+            this.audioList_movedown.Text = "Move Down";\r
+            this.audioList_movedown.TextAlign = System.Drawing.ContentAlignment.MiddleRight;\r
+            this.audioList_movedown.Click += new System.EventHandler(this.audioList_movedown_Click);\r
+            // \r
+            // toolStripSeparator2\r
+            // \r
+            this.toolStripSeparator2.Name = "toolStripSeparator2";\r
+            this.toolStripSeparator2.Size = new System.Drawing.Size(138, 6);\r
+            // \r
+            // audioList_remove\r
+            // \r
+            this.audioList_remove.Name = "audioList_remove";\r
+            this.audioList_remove.Size = new System.Drawing.Size(141, 22);\r
+            this.audioList_remove.Text = "Remove";\r
+            this.audioList_remove.Click += new System.EventHandler(this.audioList_remove_Click);\r
+            // \r
+            // AudioMenuRowHeightHack\r
+            // \r
+            this.AudioMenuRowHeightHack.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;\r
+            this.AudioMenuRowHeightHack.ImageSize = new System.Drawing.Size(1, 18);\r
+            this.AudioMenuRowHeightHack.TransparentColor = System.Drawing.Color.Transparent;\r
+            // \r
             // btn_RemoveAudioTrack\r
             // \r
             this.btn_RemoveAudioTrack.BackColor = System.Drawing.SystemColors.Control;\r
@@ -2848,53 +2891,11 @@ namespace Handbrake
             this.lbl_encode.Size = new System.Drawing.Size(31, 17);\r
             this.lbl_encode.Text = "{0}";\r
             // \r
-            // audioMenu\r
-            // \r
-            this.audioMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {\r
-            this.audioList_moveup,\r
-            this.audioList_movedown,\r
-            this.toolStripSeparator2,\r
-            this.audioList_remove});\r
-            this.audioMenu.Name = "audioMenu";\r
-            this.audioMenu.Size = new System.Drawing.Size(142, 76);\r
-            // \r
-            // audioList_movedown\r
-            // \r
-            this.audioList_movedown.Name = "audioList_movedown";\r
-            this.audioList_movedown.Size = new System.Drawing.Size(141, 22);\r
-            this.audioList_movedown.Text = "Move Down";\r
-            this.audioList_movedown.TextAlign = System.Drawing.ContentAlignment.MiddleRight;\r
-            this.audioList_movedown.Click += new System.EventHandler(this.audioList_movedown_Click);\r
-            // \r
-            // audioList_moveup\r
-            // \r
-            this.audioList_moveup.Name = "audioList_moveup";\r
-            this.audioList_moveup.Size = new System.Drawing.Size(141, 22);\r
-            this.audioList_moveup.Text = "Move Up";\r
-            this.audioList_moveup.Click += new System.EventHandler(this.audioList_moveup_Click);\r
-            // \r
-            // toolStripSeparator2\r
-            // \r
-            this.toolStripSeparator2.Name = "toolStripSeparator2";\r
-            this.toolStripSeparator2.Size = new System.Drawing.Size(138, 6);\r
-            // \r
-            // audioList_remove\r
-            // \r
-            this.audioList_remove.Name = "audioList_remove";\r
-            this.audioList_remove.Size = new System.Drawing.Size(141, 22);\r
-            this.audioList_remove.Text = "Remove";\r
-            this.audioList_remove.Click += new System.EventHandler(this.audioList_remove_Click);\r
-            // \r
-            // AudioMenuRowHeightHack\r
-            // \r
-            this.AudioMenuRowHeightHack.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;\r
-            this.AudioMenuRowHeightHack.ImageSize = new System.Drawing.Size(1, 18);\r
-            this.AudioMenuRowHeightHack.TransparentColor = System.Drawing.Color.Transparent;\r
-            // \r
             // frmMain\r
             // \r
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\r
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\r
+            this.AutoScroll = true;\r
             this.ClientSize = new System.Drawing.Size(992, 649);\r
             this.Controls.Add(this.GroupBox1);\r
             this.Controls.Add(this.groupBox_dest);\r
@@ -2906,7 +2907,6 @@ namespace Handbrake
             this.Controls.Add(this.StatusStrip);\r
             this.DoubleBuffered = true;\r
             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));\r
-            this.MinimumSize = new System.Drawing.Size(1000, 668);\r
             this.Name = "frmMain";\r
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;\r
             this.Text = "HandBrake";\r
@@ -2921,6 +2921,7 @@ namespace Handbrake
             this.groupBox_output.PerformLayout();\r
             this.TabPage2.ResumeLayout(false);\r
             this.TabPage2.PerformLayout();\r
+            this.audioMenu.ResumeLayout(false);\r
             ((System.ComponentModel.ISupportInitialize)(this.tb_drc)).EndInit();\r
             this.TabPage3.ResumeLayout(false);\r
             this.TabPage3.PerformLayout();\r
@@ -2949,7 +2950,6 @@ namespace Handbrake
             this.toolStrip1.PerformLayout();\r
             this.StatusStrip.ResumeLayout(false);\r
             this.StatusStrip.PerformLayout();\r
-            this.audioMenu.ResumeLayout(false);\r
             this.ResumeLayout(false);\r
             this.PerformLayout();\r
 \r
index aee2f2b5c5f02a38bb77cb5aae3bb74bceeb944d..c8753d184d93636b1be803c7b82e50c63d310fda 100644 (file)
@@ -312,7 +312,7 @@ namespace Handbrake
             nodeStatus.Add(true);\r
 \r
             // Now add the new preset\r
-            Form preset = new frmAddPreset(this, queryGen.GenerateTheQuery(this), presetHandler);\r
+            Form preset = new frmAddPreset(this, queryGen.generateTabbedComponentsQuery(this), presetHandler);\r
             preset.ShowDialog();\r
 \r
             // Now reload the TreeView states\r
@@ -760,21 +760,6 @@ namespace Handbrake
                 drp_track1Audio.Items.AddRange(selectedTitle.AudioTracks.ToArray());\r
                 drp_track1Audio.SelectedIndex = 0;\r
 \r
-                /*drp_track2Audio.Items.Clear();\r
-                drp_track2Audio.Items.Add("None");\r
-                drp_track2Audio.Items.AddRange(selectedTitle.AudioTracks.ToArray());\r
-                drp_track2Audio.SelectedIndex = 0;\r
-\r
-                drp_track3Audio.Items.Clear();\r
-                drp_track3Audio.Items.Add("None");\r
-                drp_track3Audio.Items.AddRange(selectedTitle.AudioTracks.ToArray());\r
-                drp_track3Audio.SelectedIndex = 0;\r
-\r
-                drp_track4Audio.Items.Clear();\r
-                drp_track4Audio.Items.Add("None");\r
-                drp_track4Audio.Items.AddRange(selectedTitle.AudioTracks.ToArray());\r
-                drp_track4Audio.SelectedIndex = 0;*/\r
-\r
                 // Populate the Subtitles dropdown\r
                 drp_subtitle.Items.Clear();\r
                 drp_subtitle.Items.Add("None");\r
index 0039ebd874ba1a7f9517d990420888ae5763a5cd..d6bf08e3e0a56db8abc5c1a5207fa657ea90865f 100644 (file)
@@ -155,12 +155,6 @@ Make sure you have selected a "Title" from the "Source" box above otherwise
 the list will not be populated with the correct amount of chapters.\r
 Note: Do not change any of the chapter numbers!</value>\r
   </data>\r
-  <metadata name="number.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">\r
-    <value>True</value>\r
-  </metadata>\r
-  <metadata name="name.UserAddedColumn" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">\r
-    <value>True</value>\r
-  </metadata>\r
   <data name="check_Cabac.ToolTip" xml:space="preserve">\r
     <value>CABAC, or context adaptive binary arithmetic coding, is used by x264 to reduce the bitrate needed for a given quality by 15%. \r
 This makes it very cool and very useful, and it should be left on whenever possible. However, it is incompatible with the iPod 5.5G, and makes the AppleTV struggle. \r
index c10d3b10ac08fd1be2804bca0f05027503c6ba3e..d7a4900fc574081f094729e81582c3dd57063953 100644 (file)
@@ -50,7 +50,7 @@ namespace Handbrake
         /// </summary>\r
         /// <param name="mainWindow"></param>\r
         /// <returns>Returns a CLI query String.</returns>\r
-        public string GeneratePreviewQuery(frmMain mainWindow, string duration)\r
+        public string GeneratePreviewQuery(frmMain mainWindow, string duration, string preview)\r
         {\r
             int seconds = 0;\r
             int.TryParse(duration, out seconds);\r
@@ -67,7 +67,8 @@ namespace Handbrake
                 query += " -t " + titleInfo[0];\r
             }\r
 \r
-            query += " -c 2";\r
+            query += " --start-at-preview " + preview;\r
+            query += " --stop-at-duration " + duration + " ";\r
 \r
             // Destination tab\r
             if (mainWindow.text_destination.Text != "")\r