githubのコードからのfolk
Revision | bc0df09b7da5a601d8e96fcab43a0c66f9b84981 (tree) |
---|---|
Time | 2011-02-20 04:14:12 |
Author | sr55 <sr55@b64f...> |
Commiter | sr55 |
WinGui:
- Give more control over MP4 file extensions. (Automatic, Always use MP4, Always use M4v)
git-svn-id: svn://localhost/HandBrake/trunk@3801 b64f7644-9d1e-0410-96f1-a4d463321fa5
@@ -240,7 +240,7 @@ namespace Handbrake.Functions | ||
240 | 240 | // Add the appropriate file extension |
241 | 241 | if (mainWindow.drop_format.SelectedIndex == 0) |
242 | 242 | { |
243 | - destinationFilename += Properties.Settings.Default.useM4v || mainWindow.Check_ChapterMarkers.Checked || | |
243 | + destinationFilename += Properties.Settings.Default.useM4v == 0 || Properties.Settings.Default.useM4v == 2 || mainWindow.Check_ChapterMarkers.Checked || | |
244 | 244 | mainWindow.AudioSettings.RequiresM4V() || mainWindow.Subtitles.RequiresM4V() |
245 | 245 | ? ".m4v" |
246 | 246 | : ".mp4"; |
@@ -336,10 +336,10 @@ namespace Handbrake.Properties { | ||
336 | 336 | |
337 | 337 | [global::System.Configuration.UserScopedSettingAttribute()] |
338 | 338 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
339 | - [global::System.Configuration.DefaultSettingValueAttribute("True")] | |
340 | - public bool useM4v { | |
339 | + [global::System.Configuration.DefaultSettingValueAttribute("0")] | |
340 | + public int useM4v { | |
341 | 341 | get { |
342 | - return ((bool)(this["useM4v"])); | |
342 | + return ((int)(this["useM4v"])); | |
343 | 343 | } |
344 | 344 | set { |
345 | 345 | this["useM4v"] = value; |
@@ -80,8 +80,8 @@ | ||
80 | 80 | <Setting Name="daysBetweenUpdateCheck" Type="System.Int32" Scope="User"> |
81 | 81 | <Value Profile="(Default)">7</Value> |
82 | 82 | </Setting> |
83 | - <Setting Name="useM4v" Type="System.Boolean" Scope="User"> | |
84 | - <Value Profile="(Default)">True</Value> | |
83 | + <Setting Name="useM4v" Type="System.Int32" Scope="User"> | |
84 | + <Value Profile="(Default)">0</Value> | |
85 | 85 | </Setting> |
86 | 86 | <Setting Name="PromptOnUnmatchingQueries" Type="System.Boolean" Scope="User"> |
87 | 87 | <Value Profile="(Default)">True</Value> |
@@ -26,7 +26,7 @@ | ||
26 | 26 | <value>Do Nothing</value> |
27 | 27 | </setting> |
28 | 28 | <setting name="defaultPreset" serializeAs="String"> |
29 | - <value/> | |
29 | + <value /> | |
30 | 30 | </setting> |
31 | 31 | <setting name="hb_build" serializeAs="String"> |
32 | 32 | <value>0</value> |
@@ -38,7 +38,7 @@ | ||
38 | 38 | <value>True</value> |
39 | 39 | </setting> |
40 | 40 | <setting name="autoNamePath" serializeAs="String"> |
41 | - <value/> | |
41 | + <value /> | |
42 | 42 | </setting> |
43 | 43 | <setting name="appcast" serializeAs="String"> |
44 | 44 | <value>http://handbrake.fr/appcast.xml</value> |
@@ -53,7 +53,7 @@ | ||
53 | 53 | <value>False</value> |
54 | 54 | </setting> |
55 | 55 | <setting name="saveLogPath" serializeAs="String"> |
56 | - <value/> | |
56 | + <value /> | |
57 | 57 | </setting> |
58 | 58 | <setting name="saveLogWithVideo" serializeAs="String"> |
59 | 59 | <value>False</value> |
@@ -83,13 +83,13 @@ | ||
83 | 83 | <value>True</value> |
84 | 84 | </setting> |
85 | 85 | <setting name="lastUpdateCheckDate" serializeAs="String"> |
86 | - <value/> | |
86 | + <value /> | |
87 | 87 | </setting> |
88 | 88 | <setting name="daysBetweenUpdateCheck" serializeAs="String"> |
89 | 89 | <value>7</value> |
90 | 90 | </setting> |
91 | 91 | <setting name="useM4v" serializeAs="String"> |
92 | - <value>True</value> | |
92 | + <value>0</value> | |
93 | 93 | </setting> |
94 | 94 | <setting name="PromptOnUnmatchingQueries" serializeAs="String"> |
95 | 95 | <value>True</value> |
@@ -101,7 +101,7 @@ | ||
101 | 101 | <value>0</value> |
102 | 102 | </setting> |
103 | 103 | <setting name="hb_platform" serializeAs="String"> |
104 | - <value/> | |
104 | + <value /> | |
105 | 105 | </setting> |
106 | 106 | <setting name="growlQueue" serializeAs="String"> |
107 | 107 | <value>False</value> |
@@ -110,7 +110,7 @@ | ||
110 | 110 | <value>False</value> |
111 | 111 | </setting> |
112 | 112 | <setting name="CliExeHash" serializeAs="String"> |
113 | - <value/> | |
113 | + <value /> | |
114 | 114 | </setting> |
115 | 115 | <setting name="previewScanCount" serializeAs="String"> |
116 | 116 | <value>10</value> |
@@ -1787,17 +1787,14 @@ namespace Handbrake | ||
1787 | 1787 | switch (DVD_Save.FilterIndex) |
1788 | 1788 | { |
1789 | 1789 | case 1: |
1790 | - if ( | |
1791 | - !Path.GetExtension(DVD_Save.FileName).Equals(".mp4", | |
1792 | - StringComparison.InvariantCultureIgnoreCase)) | |
1793 | - if (Properties.Settings.Default.useM4v) | |
1790 | + if (!Path.GetExtension(DVD_Save.FileName).Equals(".mp4", StringComparison.InvariantCultureIgnoreCase)) | |
1791 | + if (Properties.Settings.Default.useM4v == 2 || Properties.Settings.Default.useM4v == 0) | |
1794 | 1792 | DVD_Save.FileName = DVD_Save.FileName.Replace(".mp4", ".m4v").Replace(".mkv", ".m4v"); |
1795 | 1793 | else |
1796 | 1794 | DVD_Save.FileName = DVD_Save.FileName.Replace(".m4v", ".mp4").Replace(".mkv", ".mp4"); |
1797 | 1795 | break; |
1798 | 1796 | case 2: |
1799 | - if ( | |
1800 | - !Path.GetExtension(DVD_Save.FileName).Equals(".mkv", StringComparison.InvariantCultureIgnoreCase)) | |
1797 | + if (!Path.GetExtension(DVD_Save.FileName).Equals(".mkv", StringComparison.InvariantCultureIgnoreCase)) | |
1801 | 1798 | DVD_Save.FileName = DVD_Save.FileName.Replace(".mp4", ".mkv").Replace(".m4v", ".mkv"); |
1802 | 1799 | break; |
1803 | 1800 | default: |
@@ -1827,11 +1824,7 @@ namespace Handbrake | ||
1827 | 1824 | switch (drop_format.SelectedIndex) |
1828 | 1825 | { |
1829 | 1826 | case 0: |
1830 | - if (Properties.Settings.Default.useM4v || Check_ChapterMarkers.Checked || | |
1831 | - AudioSettings.RequiresM4V() || Subtitles.RequiresM4V()) | |
1832 | - SetExtension(".m4v"); | |
1833 | - else | |
1834 | - SetExtension(".mp4"); | |
1827 | + SetExtension(".mp4"); | |
1835 | 1828 | break; |
1836 | 1829 | case 1: |
1837 | 1830 | SetExtension(".mkv"); |
@@ -1855,9 +1848,8 @@ namespace Handbrake | ||
1855 | 1848 | public void SetExtension(string newExtension) |
1856 | 1849 | { |
1857 | 1850 | if (newExtension == ".mp4" || newExtension == ".m4v") |
1858 | - if (Properties.Settings.Default.useM4v || Check_ChapterMarkers.Checked || AudioSettings.RequiresM4V() || | |
1859 | - Subtitles.RequiresM4V()) | |
1860 | - newExtension = ".m4v"; | |
1851 | + if (Check_ChapterMarkers.Checked || AudioSettings.RequiresM4V() || Subtitles.RequiresM4V() || Properties.Settings.Default.useM4v == 2) | |
1852 | + newExtension = Properties.Settings.Default.useM4v == 1 ? ".mp4" : ".m4v"; | |
1861 | 1853 | else |
1862 | 1854 | newExtension = ".mp4"; |
1863 | 1855 |
@@ -2062,7 +2054,7 @@ namespace Handbrake | ||
2062 | 2054 | } |
2063 | 2055 | else |
2064 | 2056 | { |
2065 | - if (drop_format.SelectedIndex != 1 && !Properties.Settings.Default.useM4v) | |
2057 | + if (drop_format.SelectedIndex != 1) | |
2066 | 2058 | SetExtension(".mp4"); |
2067 | 2059 | data_chpt.Enabled = false; |
2068 | 2060 | btn_importChapters.Enabled = false; |
@@ -39,12 +39,13 @@ namespace Handbrake | ||
39 | 39 | this.drp_completeOption = new System.Windows.Forms.ComboBox(); |
40 | 40 | this.tab_options = new System.Windows.Forms.TabControl(); |
41 | 41 | this.tab_general = new System.Windows.Forms.TabPage(); |
42 | + this.label35 = new System.Windows.Forms.Label(); | |
43 | + this.cb_mp4FileMode = new System.Windows.Forms.ComboBox(); | |
42 | 44 | this.label34 = new System.Windows.Forms.Label(); |
43 | 45 | this.check_TitleCase = new System.Windows.Forms.CheckBox(); |
44 | 46 | this.check_removeUnderscores = new System.Windows.Forms.CheckBox(); |
45 | 47 | this.check_growlEncode = new System.Windows.Forms.CheckBox(); |
46 | 48 | this.check_GrowlQueue = new System.Windows.Forms.CheckBox(); |
47 | - this.check_m4v = new System.Windows.Forms.CheckBox(); | |
48 | 49 | this.label1 = new System.Windows.Forms.Label(); |
49 | 50 | this.label7 = new System.Windows.Forms.Label(); |
50 | 51 | this.drop_updateCheckDays = new System.Windows.Forms.ComboBox(); |
@@ -198,12 +199,13 @@ namespace Handbrake | ||
198 | 199 | // |
199 | 200 | // tab_general |
200 | 201 | // |
202 | + this.tab_general.Controls.Add(this.label35); | |
203 | + this.tab_general.Controls.Add(this.cb_mp4FileMode); | |
201 | 204 | this.tab_general.Controls.Add(this.label34); |
202 | 205 | this.tab_general.Controls.Add(this.check_TitleCase); |
203 | 206 | this.tab_general.Controls.Add(this.check_removeUnderscores); |
204 | 207 | this.tab_general.Controls.Add(this.check_growlEncode); |
205 | 208 | this.tab_general.Controls.Add(this.check_GrowlQueue); |
206 | - this.tab_general.Controls.Add(this.check_m4v); | |
207 | 209 | this.tab_general.Controls.Add(this.label1); |
208 | 210 | this.tab_general.Controls.Add(this.label7); |
209 | 211 | this.tab_general.Controls.Add(this.drp_completeOption); |
@@ -226,6 +228,30 @@ namespace Handbrake | ||
226 | 228 | this.tab_general.Text = "General"; |
227 | 229 | this.tab_general.UseVisualStyleBackColor = true; |
228 | 230 | // |
231 | + // label35 | |
232 | + // | |
233 | + this.label35.AutoSize = true; | |
234 | + this.label35.Location = new System.Drawing.Point(105, 323); | |
235 | + this.label35.Name = "label35"; | |
236 | + this.label35.Size = new System.Drawing.Size(100, 13); | |
237 | + this.label35.TabIndex = 104; | |
238 | + this.label35.Text = "MP4 File Extension:"; | |
239 | + // | |
240 | + // cb_mp4FileMode | |
241 | + // | |
242 | + this.cb_mp4FileMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; | |
243 | + this.cb_mp4FileMode.FormattingEnabled = true; | |
244 | + this.cb_mp4FileMode.Items.AddRange(new object[] { | |
245 | + "Automatic", | |
246 | + "Always use MP4", | |
247 | + "Always use M4V"}); | |
248 | + this.cb_mp4FileMode.Location = new System.Drawing.Point(211, 320); | |
249 | + this.cb_mp4FileMode.Name = "cb_mp4FileMode"; | |
250 | + this.cb_mp4FileMode.Size = new System.Drawing.Size(150, 21); | |
251 | + this.cb_mp4FileMode.TabIndex = 103; | |
252 | + this.ToolTip.SetToolTip(this.cb_mp4FileMode, resources.GetString("cb_mp4FileMode.ToolTip")); | |
253 | + this.cb_mp4FileMode.SelectedIndexChanged += new System.EventHandler(this.cb_mp4FileMode_SelectedIndexChanged); | |
254 | + // | |
229 | 255 | // label34 |
230 | 256 | // |
231 | 257 | this.label34.AutoSize = true; |
@@ -292,18 +318,6 @@ namespace Handbrake | ||
292 | 318 | this.check_GrowlQueue.UseVisualStyleBackColor = false; |
293 | 319 | this.check_GrowlQueue.CheckedChanged += new System.EventHandler(this.check_GrowlQueue_CheckedChanged); |
294 | 320 | // |
295 | - // check_m4v | |
296 | - // | |
297 | - this.check_m4v.AutoSize = true; | |
298 | - this.check_m4v.Location = new System.Drawing.Point(108, 321); | |
299 | - this.check_m4v.Name = "check_m4v"; | |
300 | - this.check_m4v.Size = new System.Drawing.Size(319, 17); | |
301 | - this.check_m4v.TabIndex = 82; | |
302 | - this.check_m4v.Text = "Always use iPod/iTunes friendly file extension (.m4v) for MP4"; | |
303 | - this.ToolTip.SetToolTip(this.check_m4v, resources.GetString("check_m4v.ToolTip")); | |
304 | - this.check_m4v.UseVisualStyleBackColor = true; | |
305 | - this.check_m4v.CheckedChanged += new System.EventHandler(this.check_m4v_CheckedChanged); | |
306 | - // | |
307 | 321 | // label1 |
308 | 322 | // |
309 | 323 | this.label1.AutoSize = true; |
@@ -1569,7 +1583,6 @@ namespace Handbrake | ||
1569 | 1583 | internal System.Windows.Forms.CheckBox check_trayStatusAlerts; |
1570 | 1584 | private System.Windows.Forms.Button btn_viewLogs; |
1571 | 1585 | private System.Windows.Forms.Button btn_clearLogs; |
1572 | - internal System.Windows.Forms.CheckBox check_m4v; | |
1573 | 1586 | internal System.Windows.Forms.ComboBox drop_updateCheckDays; |
1574 | 1587 | private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; |
1575 | 1588 | internal System.Windows.Forms.ComboBox drp_Priority; |
@@ -1596,5 +1609,7 @@ namespace Handbrake | ||
1596 | 1609 | private System.Windows.Forms.RadioButton radio_preferredAudioAndSubs; |
1597 | 1610 | private System.Windows.Forms.CheckBox check_AddCCTracks; |
1598 | 1611 | private System.Windows.Forms.Label label34; |
1612 | + internal System.Windows.Forms.Label label35; | |
1613 | + internal System.Windows.Forms.ComboBox cb_mp4FileMode; | |
1599 | 1614 | } |
1600 | 1615 | } |
\ No newline at end of file |
@@ -88,8 +88,7 @@ namespace Handbrake | ||
88 | 88 | txt_autoNameFormat.Text = Properties.Settings.Default.autoNameFormat; |
89 | 89 | |
90 | 90 | // Use iPod/iTunes friendly .m4v extension for MP4 files. |
91 | - if (Properties.Settings.Default.useM4v) | |
92 | - check_m4v.CheckState = CheckState.Checked; | |
91 | + cb_mp4FileMode.SelectedIndex = Properties.Settings.Default.useM4v; | |
93 | 92 | |
94 | 93 | // Remove Underscores |
95 | 94 | check_removeUnderscores.Checked = Properties.Settings.Default.AutoNameRemoveUnderscore; |
@@ -287,9 +286,10 @@ namespace Handbrake | ||
287 | 286 | } |
288 | 287 | } |
289 | 288 | |
290 | - private void check_m4v_CheckedChanged(object sender, EventArgs e) | |
289 | + private void cb_mp4FileMode_SelectedIndexChanged(object sender, EventArgs e) | |
291 | 290 | { |
292 | - Properties.Settings.Default.useM4v = check_m4v.Checked; | |
291 | + | |
292 | + Properties.Settings.Default.useM4v = cb_mp4FileMode.SelectedIndex; | |
293 | 293 | } |
294 | 294 | |
295 | 295 | private void check_removeUnderscores_CheckedChanged(object sender, EventArgs e) |
@@ -120,12 +120,13 @@ | ||
120 | 120 | <metadata name="ToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> |
121 | 121 | <value>132, 18</value> |
122 | 122 | </metadata> |
123 | - <data name="check_m4v.ToolTip" xml:space="preserve"> | |
124 | - <value>Use .m4v instead of .mp4 for MP4 files | |
123 | + <data name="cb_mp4FileMode.ToolTip" xml:space="preserve"> | |
124 | + <value>The default file extension for MP4 Files. | |
125 | +Automatic - This will use M4v when AC3 Audio, SRT Subtitles or Chapters are present, otherwise MP4. | |
126 | +Always MP4 - The MP4 extension will always be used. | |
127 | +Always M4V - The M4V extension will always be used. | |
125 | 128 | |
126 | -Chapter Markers, AC3 Audio and SRT Subtitles will require the m4v extension if you are using QuickTime for playback. | |
127 | -When this option is disabled, Chapter Markers, AC3 audio and SRT subtitiles will still automatically change the file extension to m4v. | |
128 | -</value> | |
129 | +Note, the file itself is identical. This simply changes the default extension for MP4 files.</value> | |
129 | 130 | </data> |
130 | 131 | <data name="text_an_path.ToolTip" xml:space="preserve"> |
131 | 132 | <value>This is the default location where your encoded files will be stored if "Automatically name output files" is enabled. |