OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sun, 16 Mar 2008 16:50:29 +0000 (16:50 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sun, 16 Mar 2008 16:50:29 +0000 (16:50 +0000)
- When selecting a destination, The audio encoder selection dropdown now repopulates with only compatible encoders (based on file container)
- Misc other changes

git-svn-id: svn://localhost/HandBrake/trunk@1343 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/C#/Properties/Settings.Designer.cs
win/C#/Properties/Settings.settings
win/C#/app.config
win/C#/frmActivityWindow.Designer.cs
win/C#/frmAddPreset.Designer.cs
win/C#/frmMain.Designer.cs
win/C#/frmMain.cs
win/C#/frmMain.resx

index 6b014a0..77b250a 100644 (file)
@@ -121,7 +121,7 @@ namespace Handbrake.Properties {
         \r
         [global::System.Configuration.UserScopedSettingAttribute()]\r
         [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\r
-        [global::System.Configuration.DefaultSettingValueAttribute("2008021900")]\r
+        [global::System.Configuration.DefaultSettingValueAttribute("2008021901")]\r
         public int hb_build {\r
             get {\r
                 return ((int)(this["hb_build"]));\r
index c526f7a..45f50b8 100644 (file)
@@ -27,7 +27,7 @@
       <Value Profile="(Default)">Checked</Value>\r
     </Setting>\r
     <Setting Name="hb_build" Type="System.Int32" Scope="User">\r
-      <Value Profile="(Default)">2008021900</Value>\r
+      <Value Profile="(Default)">2008021901</Value>\r
     </Setting>\r
     <Setting Name="skipversion" Type="System.Int32" Scope="User">\r
       <Value Profile="(Default)">0</Value>\r
index f5213e9..091deef 100644 (file)
@@ -32,7 +32,7 @@
                 <value>Checked</value>\r
             </setting>\r
             <setting name="hb_build" serializeAs="String">\r
-                <value>2008021900</value>\r
+                <value>2008021901</value>\r
             </setting>\r
             <setting name="skipversion" serializeAs="String">\r
                 <value>0</value>\r
index 5d8d444..abddecf 100644 (file)
@@ -49,7 +49,7 @@ namespace Handbrake
             this.rtf_actLog.Location = new System.Drawing.Point(12, 12);\r
             this.rtf_actLog.Name = "rtf_actLog";\r
             this.rtf_actLog.ReadOnly = true;\r
-            this.rtf_actLog.Size = new System.Drawing.Size(389, 381);\r
+            this.rtf_actLog.Size = new System.Drawing.Size(515, 433);\r
             this.rtf_actLog.TabIndex = 29;\r
             this.rtf_actLog.Text = "";\r
             // \r
@@ -60,7 +60,7 @@ namespace Handbrake
             this.btn_close.FlatStyle = System.Windows.Forms.FlatStyle.Flat;\r
             this.btn_close.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
             this.btn_close.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));\r
-            this.btn_close.Location = new System.Drawing.Point(273, 399);\r
+            this.btn_close.Location = new System.Drawing.Point(399, 451);\r
             this.btn_close.Name = "btn_close";\r
             this.btn_close.Size = new System.Drawing.Size(128, 22);\r
             this.btn_close.TabIndex = 28;\r
@@ -80,7 +80,7 @@ namespace Handbrake
             this.btn_copy.FlatStyle = System.Windows.Forms.FlatStyle.Flat;\r
             this.btn_copy.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
             this.btn_copy.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));\r
-            this.btn_copy.Location = new System.Drawing.Point(12, 399);\r
+            this.btn_copy.Location = new System.Drawing.Point(12, 451);\r
             this.btn_copy.Name = "btn_copy";\r
             this.btn_copy.Size = new System.Drawing.Size(134, 23);\r
             this.btn_copy.TabIndex = 93;\r
@@ -95,7 +95,7 @@ namespace Handbrake
             this.btn_refresh.FlatStyle = System.Windows.Forms.FlatStyle.Flat;\r
             this.btn_refresh.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
             this.btn_refresh.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));\r
-            this.btn_refresh.Location = new System.Drawing.Point(152, 399);\r
+            this.btn_refresh.Location = new System.Drawing.Point(152, 451);\r
             this.btn_refresh.Name = "btn_refresh";\r
             this.btn_refresh.Size = new System.Drawing.Size(69, 23);\r
             this.btn_refresh.TabIndex = 94;\r
@@ -109,7 +109,7 @@ namespace Handbrake
             this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 13F);\r
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\r
             this.BackColor = System.Drawing.SystemColors.ControlLight;\r
-            this.ClientSize = new System.Drawing.Size(414, 434);\r
+            this.ClientSize = new System.Drawing.Size(539, 486);\r
             this.Controls.Add(this.btn_refresh);\r
             this.Controls.Add(this.btn_copy);\r
             this.Controls.Add(this.rtf_actLog);\r
index 541c3a3..61884d5 100644 (file)
             this.Controls.Add(this.txt_preset_name);\r
             this.Controls.Add(this.lbl_name);\r
             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));\r
+            this.MaximizeBox = false;\r
+            this.MinimizeBox = false;\r
             this.Name = "frmAddPreset";\r
+            this.ShowInTaskbar = false;\r
+            this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;\r
+            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;\r
             this.Text = "Add Preset";\r
+            this.TopMost = true;\r
             this.ResumeLayout(false);\r
             this.PerformLayout();\r
 \r
index 315d13a..331271f 100644 (file)
@@ -37,7 +37,7 @@ namespace Handbrake
             this.components = new System.ComponentModel.Container();\r
             System.Windows.Forms.Label Label38;\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.DVD_Save = new System.Windows.Forms.SaveFileDialog();\r
             this.File_Save = new System.Windows.Forms.SaveFileDialog();\r
             this.ToolTip = new System.Windows.Forms.ToolTip(this.components);\r
@@ -133,6 +133,7 @@ namespace Handbrake
             this.Label32 = new System.Windows.Forms.Label();\r
             this.Label18 = new System.Windows.Forms.Label();\r
             this.TabPage3 = new System.Windows.Forms.TabPage();\r
+            this.label25 = new System.Windows.Forms.Label();\r
             this.lbl_vfr = new System.Windows.Forms.Label();\r
             this.check_grayscale = new System.Windows.Forms.CheckBox();\r
             this.Label22 = new System.Windows.Forms.Label();\r
@@ -143,6 +144,8 @@ namespace Handbrake
             this.Label46 = new System.Windows.Forms.Label();\r
             this.Label40 = new System.Windows.Forms.Label();\r
             this.TabPage1 = new System.Windows.Forms.TabPage();\r
+            this.label6 = new System.Windows.Forms.Label();\r
+            this.drp_anamorphic = new System.Windows.Forms.ComboBox();\r
             this.text_bottom = new System.Windows.Forms.NumericUpDown();\r
             this.text_top = new System.Windows.Forms.NumericUpDown();\r
             this.text_left = new System.Windows.Forms.NumericUpDown();\r
@@ -199,9 +202,6 @@ namespace Handbrake
             this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();\r
             this.btn_ActivityWindow = new System.Windows.Forms.ToolStripButton();\r
             this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator();\r
-            this.label25 = new System.Windows.Forms.Label();\r
-            this.drp_anamorphic = new System.Windows.Forms.ComboBox();\r
-            this.label6 = new System.Windows.Forms.Label();\r
             Label38 = new System.Windows.Forms.Label();\r
             ((System.ComponentModel.ISupportInitialize)(this.slider_videoQuality)).BeginInit();\r
             ((System.ComponentModel.ISupportInitialize)(this.data_chpt)).BeginInit();\r
@@ -323,6 +323,7 @@ namespace Handbrake
             this.text_destination.Size = new System.Drawing.Size(429, 21);\r
             this.text_destination.TabIndex = 1;\r
             this.ToolTip.SetToolTip(this.text_destination, "Location where the encoded file will be saved.");\r
+            this.text_destination.TextChanged += new System.EventHandler(this.text_destination_TextChanged);\r
             // \r
             // btn_Browse\r
             // \r
@@ -665,9 +666,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
@@ -1112,7 +1113,7 @@ namespace Handbrake
             this.TabPage2.Location = new System.Drawing.Point(4, 22);\r
             this.TabPage2.Name = "TabPage2";\r
             this.TabPage2.Padding = new System.Windows.Forms.Padding(3);\r
-            this.TabPage2.Size = new System.Drawing.Size(649, 274);\r
+            this.TabPage2.Size = new System.Drawing.Size(649, 283);\r
             this.TabPage2.TabIndex = 3;\r
             this.TabPage2.Text = "Audio && Subtitles";\r
             // \r
@@ -1343,10 +1344,21 @@ namespace Handbrake
             this.TabPage3.Location = new System.Drawing.Point(4, 22);\r
             this.TabPage3.Name = "TabPage3";\r
             this.TabPage3.Padding = new System.Windows.Forms.Padding(3);\r
-            this.TabPage3.Size = new System.Drawing.Size(649, 302);\r
+            this.TabPage3.Size = new System.Drawing.Size(649, 283);\r
             this.TabPage3.TabIndex = 2;\r
             this.TabPage3.Text = "Video";\r
             // \r
+            // label25\r
+            // \r
+            this.label25.AutoSize = true;\r
+            this.label25.BackColor = System.Drawing.Color.Transparent;\r
+            this.label25.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+            this.label25.Location = new System.Drawing.Point(13, 13);\r
+            this.label25.Name = "label25";\r
+            this.label25.Size = new System.Drawing.Size(76, 13);\r
+            this.label25.TabIndex = 28;\r
+            this.label25.Text = "Framerate";\r
+            // \r
             // lbl_vfr\r
             // \r
             this.lbl_vfr.AutoSize = true;\r
@@ -1490,6 +1502,33 @@ namespace Handbrake
             this.TabPage1.TabIndex = 0;\r
             this.TabPage1.Text = "Picture Settings";\r
             // \r
+            // label6\r
+            // \r
+            this.label6.AutoSize = true;\r
+            this.label6.BackColor = System.Drawing.Color.Transparent;\r
+            this.label6.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+            this.label6.Location = new System.Drawing.Point(311, 89);\r
+            this.label6.Name = "label6";\r
+            this.label6.Size = new System.Drawing.Size(80, 13);\r
+            this.label6.TabIndex = 37;\r
+            this.label6.Text = "Anamorphic:";\r
+            // \r
+            // drp_anamorphic\r
+            // \r
+            this.drp_anamorphic.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;\r
+            this.drp_anamorphic.FlatStyle = System.Windows.Forms.FlatStyle.Flat;\r
+            this.drp_anamorphic.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
+            this.drp_anamorphic.FormattingEnabled = true;\r
+            this.drp_anamorphic.Items.AddRange(new object[] {\r
+            "None",\r
+            "Strict",\r
+            "Loose"});\r
+            this.drp_anamorphic.Location = new System.Drawing.Point(414, 86);\r
+            this.drp_anamorphic.Name = "drp_anamorphic";\r
+            this.drp_anamorphic.Size = new System.Drawing.Size(110, 21);\r
+            this.drp_anamorphic.TabIndex = 36;\r
+            this.drp_anamorphic.SelectedIndexChanged += new System.EventHandler(this.drp_anamorphic_SelectedIndexChanged);\r
+            // \r
             // text_bottom\r
             // \r
             this.text_bottom.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;\r
@@ -1842,7 +1881,7 @@ namespace Handbrake
             this.tab_chapters.Controls.Add(this.Check_ChapterMarkers);\r
             this.tab_chapters.Location = new System.Drawing.Point(4, 22);\r
             this.tab_chapters.Name = "tab_chapters";\r
-            this.tab_chapters.Size = new System.Drawing.Size(649, 274);\r
+            this.tab_chapters.Size = new System.Drawing.Size(649, 283);\r
             this.tab_chapters.TabIndex = 6;\r
             this.tab_chapters.Text = "Chapters";\r
             // \r
@@ -1879,7 +1918,7 @@ namespace Handbrake
             this.h264Tab.Location = new System.Drawing.Point(4, 22);\r
             this.h264Tab.Name = "h264Tab";\r
             this.h264Tab.Padding = new System.Windows.Forms.Padding(3);\r
-            this.h264Tab.Size = new System.Drawing.Size(649, 274);\r
+            this.h264Tab.Size = new System.Drawing.Size(649, 283);\r
             this.h264Tab.TabIndex = 5;\r
             this.h264Tab.Text = "Advanced";\r
             // \r
@@ -1962,7 +2001,7 @@ namespace Handbrake
             this.tabPage4.Controls.Add(this.rtf_query);\r
             this.tabPage4.Location = new System.Drawing.Point(4, 22);\r
             this.tabPage4.Name = "tabPage4";\r
-            this.tabPage4.Size = new System.Drawing.Size(649, 274);\r
+            this.tabPage4.Size = new System.Drawing.Size(649, 283);\r
             this.tabPage4.TabIndex = 7;\r
             this.tabPage4.Text = "Query Editor";\r
             // \r
@@ -2163,44 +2202,6 @@ namespace Handbrake
             this.toolStripSeparator8.Name = "toolStripSeparator8";\r
             this.toolStripSeparator8.Size = new System.Drawing.Size(6, 39);\r
             // \r
-            // label25\r
-            // \r
-            this.label25.AutoSize = true;\r
-            this.label25.BackColor = System.Drawing.Color.Transparent;\r
-            this.label25.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.label25.Location = new System.Drawing.Point(13, 13);\r
-            this.label25.Name = "label25";\r
-            this.label25.Size = new System.Drawing.Size(76, 13);\r
-            this.label25.TabIndex = 28;\r
-            this.label25.Text = "Framerate";\r
-            // \r
-            // drp_anamorphic\r
-            // \r
-            this.drp_anamorphic.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;\r
-            this.drp_anamorphic.FlatStyle = System.Windows.Forms.FlatStyle.Flat;\r
-            this.drp_anamorphic.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.drp_anamorphic.FormattingEnabled = true;\r
-            this.drp_anamorphic.Items.AddRange(new object[] {\r
-            "None",\r
-            "Strict",\r
-            "Loose"});\r
-            this.drp_anamorphic.Location = new System.Drawing.Point(414, 86);\r
-            this.drp_anamorphic.Name = "drp_anamorphic";\r
-            this.drp_anamorphic.Size = new System.Drawing.Size(110, 21);\r
-            this.drp_anamorphic.TabIndex = 36;\r
-            this.drp_anamorphic.SelectedIndexChanged += new System.EventHandler(this.drp_anamorphic_SelectedIndexChanged);\r
-            // \r
-            // label6\r
-            // \r
-            this.label6.AutoSize = true;\r
-            this.label6.BackColor = System.Drawing.Color.Transparent;\r
-            this.label6.Font = new System.Drawing.Font("Verdana", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));\r
-            this.label6.Location = new System.Drawing.Point(311, 89);\r
-            this.label6.Name = "label6";\r
-            this.label6.Size = new System.Drawing.Size(80, 13);\r
-            this.label6.TabIndex = 37;\r
-            this.label6.Text = "Anamorphic:";\r
-            // \r
             // frmMain\r
             // \r
             this.AllowDrop = true;\r
index 424142e..b831372 100644 (file)
@@ -377,6 +377,8 @@ namespace Handbrake
                 MessageBox.Show("Sorry, HandBrake does not support UNC file paths. \nTry mounting the share as a network drive in My Computer", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
             else\r
             {\r
+                setAudioByContainer(DVD_Save.FileName);\r
+\r
                 text_destination.Text = DVD_Save.FileName;\r
 \r
                 // Quicktime requires .m4v file for chapter markers to work. If checked, change the extension to .m4v (mp4 and m4v are the same thing)\r
@@ -398,8 +400,49 @@ namespace Handbrake
 \r
         #endregion\r
 \r
+        #region Reusable Functions\r
+        private void setAudioByContainer(String path)\r
+        {\r
+            if ((path.EndsWith(".mp4")) || (path.EndsWith(".mp4")))\r
+            {\r
+                drp_audioCodec.Items.Clear();\r
+                drp_audioCodec.Items.Add("AAC");\r
+                drp_audioCodec.Items.Add("AAC + AC3");\r
+                drp_audioCodec.SelectedIndex = 0;\r
+            }\r
+            else if (path.EndsWith(".avi"))\r
+            {\r
+                drp_audioCodec.Items.Clear();\r
+                drp_audioCodec.Items.Add("MP3");\r
+                drp_audioCodec.Items.Add("AC3");\r
+                drp_audioCodec.SelectedIndex = 0;\r
+            }\r
+            else if (path.EndsWith(".ogm"))\r
+            {\r
+                drp_audioCodec.Items.Clear();\r
+                drp_audioCodec.Items.Add("Vorbis");\r
+                drp_audioCodec.SelectedIndex = 0;\r
+            }\r
+            else if (path.EndsWith(".mkv"))\r
+            {\r
+                drp_audioCodec.Items.Clear();\r
+                drp_audioCodec.Items.Add("AAC");\r
+                drp_audioCodec.Items.Add("AAC + AC3");\r
+                drp_audioCodec.Items.Add("MP3");\r
+                drp_audioCodec.Items.Add("AC3");\r
+                drp_audioCodec.Items.Add("Vorbis");\r
+                drp_audioCodec.SelectedIndex = 0;\r
+            }    \r
+        }\r
+        #endregion\r
+\r
         #region frmMain Actions\r
 \r
+        private void text_destination_TextChanged(object sender, EventArgs e)\r
+        {\r
+            setAudioByContainer(text_destination.Text);\r
+        }\r
+\r
         private void drp_dvdtitle_SelectedIndexChanged(object sender, EventArgs e)\r
         {\r
             // Reset some values on the form\r
@@ -1134,7 +1177,7 @@ namespace Handbrake
             selectedPreset = treeView_presets.SelectedNode.Text;\r
 \r
             if (!selectedPreset.StartsWith("--"))\r
-                MessageBox.Show("Sorry, You can not remove any of the built in presets.","Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
+                MessageBox.Show("Sorry, You can not remove any of the built in presets.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
 \r
 \r
             // Scan through the users presets and dump them all in an arraylist\r
@@ -1163,7 +1206,7 @@ namespace Handbrake
             int c = 0;\r
             foreach (string item in user_presets)\r
             {\r
-                string preset_name = selectedPreset.Replace("--","");\r
+                string preset_name = selectedPreset.Replace("--", "");\r
                 if (item.Contains(preset_name))\r
                     modified_presets_list.RemoveAt(c);\r
                 c++;\r
@@ -1296,6 +1339,7 @@ namespace Handbrake
 \r
         #endregion\r
 \r
+\r
         // This is the END of the road ------------------------------------------------------------------------------\r
     }\r
 }
\ No newline at end of file
index 4ed516e..8f2c94a 100644 (file)
@@ -149,12 +149,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
   <metadata name="DVD_Open.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
     <value>223, 15</value>\r
   </metadata>\r