Allowing VERY large time codes (e.g. 99 hours...)

git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@1701 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
niksedk 2013-03-07 18:06:35 +00:00
parent a5cb8a13b2
commit 353d99eca1
3 changed files with 7 additions and 7 deletions

View File

@ -3931,7 +3931,7 @@
65536}); 65536});
this.numericUpDownDuration.Location = new System.Drawing.Point(123, 27); this.numericUpDownDuration.Location = new System.Drawing.Point(123, 27);
this.numericUpDownDuration.Maximum = new decimal(new int[] { this.numericUpDownDuration.Maximum = new decimal(new int[] {
99999, 999999999,
0, 0,
0, 0,
0}); 0});

View File

@ -681,7 +681,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAD2 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAD2
CAAAAk1TRnQBSQFMAgEBAgEAAaABHQGgAR0BEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo CAAAAk1TRnQBSQFMAgEBAgEAAagBHQGoAR0BEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA

View File

@ -55,7 +55,7 @@ namespace Nikse.SubtitleEdit.Logic
public int Hours public int Hours
{ {
get { return _time.Hours; } get { return _time.Hours + _time.Days * 24; }
set { _time = new TimeSpan(0, value, _time.Minutes, _time.Seconds, _time.Milliseconds); } set { _time = new TimeSpan(0, value, _time.Minutes, _time.Seconds, _time.Milliseconds); }
} }
@ -127,7 +127,7 @@ namespace Nikse.SubtitleEdit.Logic
public override string ToString() public override string ToString()
{ {
string s = string.Format("{0:00}:{1:00}:{2:00},{3:000}", _time.Hours, _time.Minutes, _time.Seconds, _time.Milliseconds); string s = string.Format("{0:00}:{1:00}:{2:00},{3:000}", _time.Hours + _time.Days * 24, _time.Minutes, _time.Seconds, _time.Milliseconds);
if (TotalMilliseconds >= 0) if (TotalMilliseconds >= 0)
return s; return s;
@ -138,12 +138,12 @@ namespace Nikse.SubtitleEdit.Logic
public string ToShortString() public string ToShortString()
{ {
string s; string s;
if (_time.Minutes == 0 && _time.Hours == 0) if (_time.Minutes == 0 && _time.Hours == 0 && _time.Days == 0)
s = string.Format("{0:0},{1:000}", _time.Seconds, _time.Milliseconds); s = string.Format("{0:0},{1:000}", _time.Seconds, _time.Milliseconds);
else if (_time.Hours == 0) else if (_time.Hours == 0 && _time.Days == 0)
s = string.Format("{0:0}:{1:00},{2:000}", _time.Minutes, _time.Seconds, _time.Milliseconds); s = string.Format("{0:0}:{1:00},{2:000}", _time.Minutes, _time.Seconds, _time.Milliseconds);
else else
s = string.Format("{0:0}:{1:00}:{2:00},{3:000}", _time.Hours, _time.Minutes, _time.Seconds, _time.Milliseconds); s = string.Format("{0:0}:{1:00}:{2:00},{3:000}", _time.Hours + _time.Days * 24, _time.Minutes, _time.Seconds, _time.Milliseconds);
if (TotalMilliseconds >= 0) if (TotalMilliseconds >= 0)
return s; return s;