[gnome-subtitles] Changed default subtitle duration to 1.5s.



commit d4b11c06c2396eabfc82dcbeef183515c41176f5
Author: Pedro Castro <mail pedrocastro org>
Date:   Fri Apr 22 13:30:53 2011 +0100

    Changed default subtitle duration to 1.5s.

 src/SubLib/Core/Domain/SubtitleCollection.cs |    8 ++++----
 src/SubLib/Core/Domain/SubtitleConstants.cs  |    6 +++++-
 2 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/src/SubLib/Core/Domain/SubtitleCollection.cs b/src/SubLib/Core/Domain/SubtitleCollection.cs
index 4d36081..ecac1e5 100644
--- a/src/SubLib/Core/Domain/SubtitleCollection.cs
+++ b/src/SubLib/Core/Domain/SubtitleCollection.cs
@@ -106,7 +106,7 @@ public class SubtitleCollection {
 		if (subtitleEnd < TimeSpan.Zero)
 			subtitleEnd = TimeSpan.FromSeconds(0);
 
-		TimeSpan subtitleStart = subtitleEnd - TimeSpan.FromSeconds(SubtitleConstants.MaxSingleLineSubtitleDuration);
+		TimeSpan subtitleStart = subtitleEnd - TimeSpan.FromSeconds(SubtitleConstants.AverageSubtitleDuration);
 		if (subtitleStart < TimeSpan.Zero)
 			subtitleStart = TimeSpan.FromSeconds(0);
 
@@ -129,7 +129,7 @@ public class SubtitleCollection {
 			return false;
 		
 		TimeSpan subtitleStart = existing.Times.End + TimeSpan.FromSeconds(SubtitleConstants.MinTimeBetweenSubtitles);
-		TimeSpan subtitleEnd = subtitleStart + TimeSpan.FromSeconds(SubtitleConstants.MaxSingleLineSubtitleDuration);
+		TimeSpan subtitleEnd = subtitleStart + TimeSpan.FromSeconds(SubtitleConstants.AverageSubtitleDuration);
 		Subtitle subtitle = new Subtitle(subtitleProperties, subtitleStart, subtitleEnd);
 		Add(subtitle, index + 1);
 		return true;
@@ -146,7 +146,7 @@ public class SubtitleCollection {
 			return false;
 		
 		TimeSpan subtitleStart = TimeSpan.FromSeconds(0);
-		TimeSpan subtitleEnd = TimeSpan.FromSeconds(SubtitleConstants.MaxSingleLineSubtitleDuration);
+		TimeSpan subtitleEnd = TimeSpan.FromSeconds(SubtitleConstants.AverageSubtitleDuration);
 		Subtitle subtitle = new Subtitle(subtitleProperties, subtitleStart, subtitleEnd);
 		Add(subtitle, index);
 		return true;
@@ -165,7 +165,7 @@ public class SubtitleCollection {
 			return false;
 
 		TimeSpan subtitleStart = start;
-		TimeSpan subtitleEnd = subtitleStart + TimeSpan.FromSeconds(SubtitleConstants.MaxSingleLineSubtitleDuration);
+		TimeSpan subtitleEnd = subtitleStart + TimeSpan.FromSeconds(SubtitleConstants.AverageSubtitleDuration);
 		Subtitle subtitle = new Subtitle(subtitleProperties, subtitleStart, subtitleEnd);
 		Add(subtitle, index);
 		return true;
diff --git a/src/SubLib/Core/Domain/SubtitleConstants.cs b/src/SubLib/Core/Domain/SubtitleConstants.cs
index 09f349d..0bc0b3d 100644
--- a/src/SubLib/Core/Domain/SubtitleConstants.cs
+++ b/src/SubLib/Core/Domain/SubtitleConstants.cs
@@ -1,6 +1,6 @@
 /*
  * This file is part of SubLib.
- * Copyright (C) 2006-2009 Pedro Castro
+ * Copyright (C) 2006-2009,2011 Pedro Castro
  *
  * SubLib is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -66,6 +66,10 @@ public class SubtitleConstants {
 	/// <remarks>The value of this property is 3.5.</remarks>
 	public const float MaxSingleLineSubtitleDuration = 3.5f;
 	
+	/// <summary>The average duration of a subtitle, in seconds.</summary>
+	/// <remarks>The value of this property is 1.5.</remarks>
+	public const float AverageSubtitleDuration = 1.5f;
+	
 	/// <summary>The maximum duration of a full two-line subtitle, in seconds.</summary>
 	/// <remarks>The value of this property is 6.</remarks>
 	public const float MaxTwoLineSubtitleDuration = 6;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]