]> granicus.if.org Git - handbrake/commitdiff
WinGui:
authorsr55 <sr55.hb@outlook.com>
Sat, 19 Feb 2011 19:14:12 +0000 (19:14 +0000)
committersr55 <sr55.hb@outlook.com>
Sat, 19 Feb 2011 19:14:12 +0000 (19:14 +0000)
- Give more control over MP4 file extensions. (Automatic, Always use MP4, Always use M4v)

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

win/C#/Functions/Main.cs
win/C#/Properties/Settings.Designer.cs
win/C#/Properties/Settings.settings
win/C#/app.config
win/C#/frmMain.cs
win/C#/frmOptions.Designer.cs
win/C#/frmOptions.cs
win/C#/frmOptions.resx

index 578d2e8b06670fbcd18e50b51d5a42540d612049..3b1e54631566b0eb6217318f158212630217aeaf 100644 (file)
@@ -240,7 +240,7 @@ namespace Handbrake.Functions
                 // Add the appropriate file extension\r
                 if (mainWindow.drop_format.SelectedIndex == 0)\r
                 {\r
-                    destinationFilename += Properties.Settings.Default.useM4v || mainWindow.Check_ChapterMarkers.Checked ||\r
+                    destinationFilename += Properties.Settings.Default.useM4v == 0 || Properties.Settings.Default.useM4v == 2 || mainWindow.Check_ChapterMarkers.Checked ||\r
                                            mainWindow.AudioSettings.RequiresM4V() || mainWindow.Subtitles.RequiresM4V()\r
                                                ? ".m4v"\r
                                                : ".mp4";\r
index 9dad5078d0ddce88bc3b7df9ab51f4eb65982130..5e1a2bfb9e1bf4c43b11376b4be90621c186def3 100644 (file)
@@ -336,10 +336,10 @@ namespace Handbrake.Properties {
         \r
         [global::System.Configuration.UserScopedSettingAttribute()]\r
         [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\r
-        [global::System.Configuration.DefaultSettingValueAttribute("True")]\r
-        public bool useM4v {\r
+        [global::System.Configuration.DefaultSettingValueAttribute("0")]\r
+        public int useM4v {\r
             get {\r
-                return ((bool)(this["useM4v"]));\r
+                return ((int)(this["useM4v"]));\r
             }\r
             set {\r
                 this["useM4v"] = value;\r
index 2cd3898debe14b076a398158066ce670d2472122..08849f0eac0eaaddf9a2537922b75a0475689223 100644 (file)
@@ -80,8 +80,8 @@
     <Setting Name="daysBetweenUpdateCheck" Type="System.Int32" Scope="User">\r
       <Value Profile="(Default)">7</Value>\r
     </Setting>\r
-    <Setting Name="useM4v" Type="System.Boolean" Scope="User">\r
-      <Value Profile="(Default)">True</Value>\r
+    <Setting Name="useM4v" Type="System.Int32" Scope="User">\r
+      <Value Profile="(Default)">0</Value>\r
     </Setting>\r
     <Setting Name="PromptOnUnmatchingQueries" Type="System.Boolean" Scope="User">\r
       <Value Profile="(Default)">True</Value>\r
index d2164ddf60f435c05b214717e2597e74f99ac715..c4155cd0753678b17d493ca4148e6ed79d534b34 100644 (file)
@@ -26,7 +26,7 @@
         <value>Do Nothing</value>\r
       </setting>\r
       <setting name="defaultPreset" serializeAs="String">\r
-        <value/>\r
+        <value />\r
       </setting>\r
       <setting name="hb_build" serializeAs="String">\r
         <value>0</value>\r
@@ -38,7 +38,7 @@
         <value>True</value>\r
       </setting>\r
       <setting name="autoNamePath" serializeAs="String">\r
-        <value/>\r
+        <value />\r
       </setting>\r
       <setting name="appcast" serializeAs="String">\r
         <value>http://handbrake.fr/appcast.xml</value>\r
@@ -53,7 +53,7 @@
         <value>False</value>\r
       </setting>\r
       <setting name="saveLogPath" serializeAs="String">\r
-        <value/>\r
+        <value />\r
       </setting>\r
       <setting name="saveLogWithVideo" serializeAs="String">\r
         <value>False</value>\r
         <value>True</value>\r
       </setting>\r
       <setting name="lastUpdateCheckDate" serializeAs="String">\r
-        <value/>\r
+        <value />\r
       </setting>\r
       <setting name="daysBetweenUpdateCheck" serializeAs="String">\r
         <value>7</value>\r
       </setting>\r
       <setting name="useM4v" serializeAs="String">\r
-        <value>True</value>\r
+        <value>0</value>\r
       </setting>\r
       <setting name="PromptOnUnmatchingQueries" serializeAs="String">\r
         <value>True</value>\r
         <value>0</value>\r
       </setting>\r
       <setting name="hb_platform" serializeAs="String">\r
-        <value/>\r
+        <value />\r
       </setting>\r
       <setting name="growlQueue" serializeAs="String">\r
         <value>False</value>\r
         <value>False</value>\r
       </setting>\r
       <setting name="CliExeHash" serializeAs="String">\r
-        <value/>\r
+        <value />\r
       </setting>\r
       <setting name="previewScanCount" serializeAs="String">\r
         <value>10</value>\r
index 64ce8c05850a4a33a4ad8b6318c87e4752deaf18..1323ff73456dd3820f341336064b5a41b089d996 100644 (file)
@@ -1787,17 +1787,14 @@ namespace Handbrake
                 switch (DVD_Save.FilterIndex)\r
                 {\r
                     case 1:\r
-                        if (\r
-                            !Path.GetExtension(DVD_Save.FileName).Equals(".mp4",\r
-                                                                         StringComparison.InvariantCultureIgnoreCase))\r
-                            if (Properties.Settings.Default.useM4v)\r
+                        if (!Path.GetExtension(DVD_Save.FileName).Equals(".mp4", StringComparison.InvariantCultureIgnoreCase))\r
+                            if (Properties.Settings.Default.useM4v == 2 || Properties.Settings.Default.useM4v == 0)\r
                                 DVD_Save.FileName = DVD_Save.FileName.Replace(".mp4", ".m4v").Replace(".mkv", ".m4v");\r
                             else\r
                                 DVD_Save.FileName = DVD_Save.FileName.Replace(".m4v", ".mp4").Replace(".mkv", ".mp4");\r
                         break;\r
                     case 2:\r
-                        if (\r
-                            !Path.GetExtension(DVD_Save.FileName).Equals(".mkv", StringComparison.InvariantCultureIgnoreCase))\r
+                        if (!Path.GetExtension(DVD_Save.FileName).Equals(".mkv", StringComparison.InvariantCultureIgnoreCase))\r
                             DVD_Save.FileName = DVD_Save.FileName.Replace(".mp4", ".mkv").Replace(".m4v", ".mkv");\r
                         break;\r
                     default:\r
@@ -1827,11 +1824,7 @@ namespace Handbrake
             switch (drop_format.SelectedIndex)\r
             {\r
                 case 0:\r
-                    if (Properties.Settings.Default.useM4v || Check_ChapterMarkers.Checked ||\r
-                        AudioSettings.RequiresM4V() || Subtitles.RequiresM4V())\r
-                        SetExtension(".m4v");\r
-                    else\r
-                        SetExtension(".mp4");\r
+                    SetExtension(".mp4");\r
                     break;\r
                 case 1:\r
                     SetExtension(".mkv");\r
@@ -1855,9 +1848,8 @@ namespace Handbrake
         public void SetExtension(string newExtension)\r
         {\r
             if (newExtension == ".mp4" || newExtension == ".m4v")\r
-                if (Properties.Settings.Default.useM4v || Check_ChapterMarkers.Checked || AudioSettings.RequiresM4V() ||\r
-                    Subtitles.RequiresM4V())\r
-                    newExtension = ".m4v";\r
+                if (Check_ChapterMarkers.Checked || AudioSettings.RequiresM4V() || Subtitles.RequiresM4V() || Properties.Settings.Default.useM4v == 2) \r
+                    newExtension = Properties.Settings.Default.useM4v == 1 ? ".mp4" : ".m4v";\r
                 else\r
                     newExtension = ".mp4";\r
 \r
@@ -2062,7 +2054,7 @@ namespace Handbrake
             }\r
             else\r
             {\r
-                if (drop_format.SelectedIndex != 1 && !Properties.Settings.Default.useM4v)\r
+                if (drop_format.SelectedIndex != 1)\r
                     SetExtension(".mp4");\r
                 data_chpt.Enabled = false;\r
                 btn_importChapters.Enabled = false;\r
index 51a7cc904186238d160f3e1a480c1223f9de42fe..c304e4d3519318c064956e8f6826c170110cc9f0 100644 (file)
@@ -39,12 +39,13 @@ namespace Handbrake
             this.drp_completeOption = new System.Windows.Forms.ComboBox();\r
             this.tab_options = new System.Windows.Forms.TabControl();\r
             this.tab_general = new System.Windows.Forms.TabPage();\r
+            this.label35 = new System.Windows.Forms.Label();\r
+            this.cb_mp4FileMode = new System.Windows.Forms.ComboBox();\r
             this.label34 = new System.Windows.Forms.Label();\r
             this.check_TitleCase = new System.Windows.Forms.CheckBox();\r
             this.check_removeUnderscores = new System.Windows.Forms.CheckBox();\r
             this.check_growlEncode = new System.Windows.Forms.CheckBox();\r
             this.check_GrowlQueue = new System.Windows.Forms.CheckBox();\r
-            this.check_m4v = new System.Windows.Forms.CheckBox();\r
             this.label1 = new System.Windows.Forms.Label();\r
             this.label7 = new System.Windows.Forms.Label();\r
             this.drop_updateCheckDays = new System.Windows.Forms.ComboBox();\r
@@ -198,12 +199,13 @@ namespace Handbrake
             // \r
             // tab_general\r
             // \r
+            this.tab_general.Controls.Add(this.label35);\r
+            this.tab_general.Controls.Add(this.cb_mp4FileMode);\r
             this.tab_general.Controls.Add(this.label34);\r
             this.tab_general.Controls.Add(this.check_TitleCase);\r
             this.tab_general.Controls.Add(this.check_removeUnderscores);\r
             this.tab_general.Controls.Add(this.check_growlEncode);\r
             this.tab_general.Controls.Add(this.check_GrowlQueue);\r
-            this.tab_general.Controls.Add(this.check_m4v);\r
             this.tab_general.Controls.Add(this.label1);\r
             this.tab_general.Controls.Add(this.label7);\r
             this.tab_general.Controls.Add(this.drp_completeOption);\r
@@ -226,6 +228,30 @@ namespace Handbrake
             this.tab_general.Text = "General";\r
             this.tab_general.UseVisualStyleBackColor = true;\r
             // \r
+            // label35\r
+            // \r
+            this.label35.AutoSize = true;\r
+            this.label35.Location = new System.Drawing.Point(105, 323);\r
+            this.label35.Name = "label35";\r
+            this.label35.Size = new System.Drawing.Size(100, 13);\r
+            this.label35.TabIndex = 104;\r
+            this.label35.Text = "MP4 File Extension:";\r
+            // \r
+            // cb_mp4FileMode\r
+            // \r
+            this.cb_mp4FileMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;\r
+            this.cb_mp4FileMode.FormattingEnabled = true;\r
+            this.cb_mp4FileMode.Items.AddRange(new object[] {\r
+            "Automatic",\r
+            "Always use MP4",\r
+            "Always use M4V"});\r
+            this.cb_mp4FileMode.Location = new System.Drawing.Point(211, 320);\r
+            this.cb_mp4FileMode.Name = "cb_mp4FileMode";\r
+            this.cb_mp4FileMode.Size = new System.Drawing.Size(150, 21);\r
+            this.cb_mp4FileMode.TabIndex = 103;\r
+            this.ToolTip.SetToolTip(this.cb_mp4FileMode, resources.GetString("cb_mp4FileMode.ToolTip"));\r
+            this.cb_mp4FileMode.SelectedIndexChanged += new System.EventHandler(this.cb_mp4FileMode_SelectedIndexChanged);\r
+            // \r
             // label34\r
             // \r
             this.label34.AutoSize = true;\r
@@ -292,18 +318,6 @@ namespace Handbrake
             this.check_GrowlQueue.UseVisualStyleBackColor = false;\r
             this.check_GrowlQueue.CheckedChanged += new System.EventHandler(this.check_GrowlQueue_CheckedChanged);\r
             // \r
-            // check_m4v\r
-            // \r
-            this.check_m4v.AutoSize = true;\r
-            this.check_m4v.Location = new System.Drawing.Point(108, 321);\r
-            this.check_m4v.Name = "check_m4v";\r
-            this.check_m4v.Size = new System.Drawing.Size(319, 17);\r
-            this.check_m4v.TabIndex = 82;\r
-            this.check_m4v.Text = "Always use iPod/iTunes friendly file extension (.m4v) for MP4";\r
-            this.ToolTip.SetToolTip(this.check_m4v, resources.GetString("check_m4v.ToolTip"));\r
-            this.check_m4v.UseVisualStyleBackColor = true;\r
-            this.check_m4v.CheckedChanged += new System.EventHandler(this.check_m4v_CheckedChanged);\r
-            // \r
             // label1\r
             // \r
             this.label1.AutoSize = true;\r
@@ -1569,7 +1583,6 @@ namespace Handbrake
         internal System.Windows.Forms.CheckBox check_trayStatusAlerts;\r
         private System.Windows.Forms.Button btn_viewLogs;\r
         private System.Windows.Forms.Button btn_clearLogs;\r
-        internal System.Windows.Forms.CheckBox check_m4v;\r
         internal System.Windows.Forms.ComboBox drop_updateCheckDays;\r
         private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;\r
         internal System.Windows.Forms.ComboBox drp_Priority;\r
@@ -1596,5 +1609,7 @@ namespace Handbrake
         private System.Windows.Forms.RadioButton radio_preferredAudioAndSubs;\r
         private System.Windows.Forms.CheckBox check_AddCCTracks;\r
         private System.Windows.Forms.Label label34;\r
+        internal System.Windows.Forms.Label label35;\r
+        internal System.Windows.Forms.ComboBox cb_mp4FileMode;\r
     }\r
 }
\ No newline at end of file
index 968534cf1060ca3bf934bb4c61772d0d5bc42683..1a3fd19196a8e71976b42e7e1d7a05ca9b92b96e 100644 (file)
@@ -88,8 +88,7 @@ namespace Handbrake
             txt_autoNameFormat.Text = Properties.Settings.Default.autoNameFormat;\r
 \r
             // Use iPod/iTunes friendly .m4v extension for MP4 files.\r
-            if (Properties.Settings.Default.useM4v)\r
-                check_m4v.CheckState = CheckState.Checked;\r
+            cb_mp4FileMode.SelectedIndex = Properties.Settings.Default.useM4v;\r
 \r
             // Remove Underscores\r
             check_removeUnderscores.Checked = Properties.Settings.Default.AutoNameRemoveUnderscore;\r
@@ -287,9 +286,10 @@ namespace Handbrake
             }\r
         }\r
 \r
-        private void check_m4v_CheckedChanged(object sender, EventArgs e)\r
+        private void cb_mp4FileMode_SelectedIndexChanged(object sender, EventArgs e)\r
         {\r
-            Properties.Settings.Default.useM4v = check_m4v.Checked;\r
+\r
+            Properties.Settings.Default.useM4v = cb_mp4FileMode.SelectedIndex;\r
         }\r
 \r
         private void check_removeUnderscores_CheckedChanged(object sender, EventArgs e)\r
index 2bfb5c9f45587db78efee7186a3d961602979101..7407b50052abca167a0ed0430f5ce3368111a389 100644 (file)
   <metadata name="ToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
     <value>132, 18</value>\r
   </metadata>\r
-  <data name="check_m4v.ToolTip" xml:space="preserve">\r
-    <value>Use .m4v instead of .mp4 for MP4 files\r
+  <data name="cb_mp4FileMode.ToolTip" xml:space="preserve">\r
+    <value>The default file extension for MP4 Files.\r
+Automatic   - This will use M4v when AC3 Audio, SRT Subtitles or Chapters are present, otherwise MP4.\r
+Always MP4 - The MP4 extension will always be used.\r
+Always M4V - The M4V extension will always be used.\r
 \r
-Chapter Markers, AC3 Audio and SRT Subtitles will require the m4v extension if you are using QuickTime for playback.\r
-When this option is disabled, Chapter Markers, AC3 audio and SRT subtitiles will still automatically change the file extension to m4v.\r
-</value>\r
+Note, the file itself is identical. This simply changes the default extension for MP4 files.</value>\r
   </data>\r
   <data name="text_an_path.ToolTip" xml:space="preserve">\r
     <value>This is the default location where your encoded files will be stored if "Automatically name output files" is enabled.\r