diff --git a/src/Logic/Subtitle.cs b/src/Logic/Subtitle.cs index 82a1a6c63..b90482526 100644 --- a/src/Logic/Subtitle.cs +++ b/src/Logic/Subtitle.cs @@ -178,7 +178,7 @@ namespace Nikse.SubtitleEdit.Logic return FileName; } - internal string ToText(SubtitleFormat format) + public string ToText(SubtitleFormat format) { return format.ToText(this, Path.GetFileNameWithoutExtension(FileName)); } @@ -254,7 +254,7 @@ namespace Nikse.SubtitleEdit.Logic } } - internal void ChangeFramerate(double oldFramerate, double newFramerate) + public void ChangeFramerate(double oldFramerate, double newFramerate) { foreach (Paragraph p in Paragraphs) { @@ -279,7 +279,7 @@ namespace Nikse.SubtitleEdit.Logic } } - internal void AdjustDisplayTimeUsingPercent(double percent, System.Windows.Forms.ListView.SelectedIndexCollection selectedIndexes) + public void AdjustDisplayTimeUsingPercent(double percent, System.Windows.Forms.ListView.SelectedIndexCollection selectedIndexes) { for (int i = 0; i < _paragraphs.Count; i++) { @@ -298,7 +298,7 @@ namespace Nikse.SubtitleEdit.Logic } } - internal void AdjustDisplayTimeUsingSeconds(double seconds, System.Windows.Forms.ListView.SelectedIndexCollection selectedIndexes) + public void AdjustDisplayTimeUsingSeconds(double seconds, System.Windows.Forms.ListView.SelectedIndexCollection selectedIndexes) { for (int i = 0; i < _paragraphs.Count; i++) { @@ -327,7 +327,7 @@ namespace Nikse.SubtitleEdit.Logic } } - internal void RecalculateDisplayTimes(double maxCharactersPerSecond, System.Windows.Forms.ListView.SelectedIndexCollection selectedIndexes) + public void RecalculateDisplayTimes(double maxCharactersPerSecond, System.Windows.Forms.ListView.SelectedIndexCollection selectedIndexes) { for (int i = 0; i < _paragraphs.Count; i++) { @@ -354,8 +354,7 @@ namespace Nikse.SubtitleEdit.Logic } } - - internal void Renumber(int startNumber) + public void Renumber(int startNumber) { int i = startNumber; foreach (Paragraph p in _paragraphs) @@ -365,7 +364,7 @@ namespace Nikse.SubtitleEdit.Logic } } - internal int GetIndex(Paragraph p) + public int GetIndex(Paragraph p) { if (p == null) return -1; @@ -389,7 +388,7 @@ namespace Nikse.SubtitleEdit.Logic return -1; } - internal Paragraph GetFirstAlike(Paragraph p) + public Paragraph GetFirstAlike(Paragraph p) { foreach (Paragraph item in _paragraphs) { @@ -401,7 +400,7 @@ namespace Nikse.SubtitleEdit.Logic return null; } - internal Paragraph GetFirstParagraphByLineNumber(int number) + public Paragraph GetFirstParagraphByLineNumber(int number) { foreach (Paragraph p in _paragraphs) { @@ -411,7 +410,7 @@ namespace Nikse.SubtitleEdit.Logic return null; } - internal int RemoveEmptyLines() + public int RemoveEmptyLines() { int count = 0; if (_paragraphs.Count > 0) @@ -506,7 +505,7 @@ namespace Nikse.SubtitleEdit.Logic } } - internal void InsertParagraphInCorrectTimeOrder(Paragraph newParagraph) + public void InsertParagraphInCorrectTimeOrder(Paragraph newParagraph) { for (int i=0; i /// GSI block (1024 bytes) /// - internal class EbuGeneralSubtitleInformation + public class EbuGeneralSubtitleInformation { public string CodePageNumber { get; set; } // 0..2 public string DiskFormatCode { get; set; } // 3..10 @@ -174,7 +174,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats CommentFlag = 0; } - internal byte[] GetBytes(EbuGeneralSubtitleInformation header) + public byte[] GetBytes(EbuGeneralSubtitleInformation header) { byte[] buffer = new byte[128]; // Text and Timing Information (TTI) block consists of 128 bytes diff --git a/src/Logic/Utilities.cs b/src/Logic/Utilities.cs index c3f925263..67910cad4 100644 --- a/src/Logic/Utilities.cs +++ b/src/Logic/Utilities.cs @@ -18,7 +18,7 @@ namespace Nikse.SubtitleEdit.Logic { public static class Utilities { - internal const string WinXp2kUnicodeFontName = "Times New Roman"; + public const string WinXp2kUnicodeFontName = "Times New Roman"; public static byte[] ReadAllBytes(String path) { @@ -184,7 +184,7 @@ namespace Nikse.SubtitleEdit.Logic return false; } - internal static SubtitleFormat GetSubtitleFormatByFriendlyName(string friendlyName) + public static SubtitleFormat GetSubtitleFormatByFriendlyName(string friendlyName) { foreach (SubtitleFormat format in SubtitleFormat.AllSubtitleFormats) { @@ -720,7 +720,7 @@ namespace Nikse.SubtitleEdit.Logic return RemoveHtmlFontTag(s); } - internal static string RemoveHtmlFontTag(string s) + public static string RemoveHtmlFontTag(string s) { s = s.Replace("", string.Empty); s = s.Replace("", string.Empty); @@ -737,7 +737,7 @@ namespace Nikse.SubtitleEdit.Logic return s; } - internal static string RemoveParagraphTag(string s) + public static string RemoveParagraphTag(string s) { s = s.Replace("

", string.Empty); s = s.Replace("

", string.Empty); @@ -1575,7 +1575,7 @@ namespace Nikse.SubtitleEdit.Logic } } - internal static void GetLineLengths(Label label, string text) + public static void GetLineLengths(Label label, string text) { label.ForeColor = Color.Black; string cleanText = Utilities.RemoveHtmlTags(text).Replace(Environment.NewLine, "|"); @@ -1609,7 +1609,7 @@ namespace Nikse.SubtitleEdit.Logic label.Text = sb.ToString(); } - //internal static void DisplayLineLengths(Panel panelSingleLine, string text) + //public static void DisplayLineLengths(Panel panelSingleLine, string text) //{ // string cleanText = RemoveHtmlTags(text).Replace(Environment.NewLine, "|"); // string[] lines = cleanText.Split('|'); @@ -1761,7 +1761,7 @@ namespace Nikse.SubtitleEdit.Logic } - internal static void LoadGlobalNamesEtc(List namesEtcList, List namesEtcMultiWordList) + public static void LoadGlobalNamesEtc(List namesEtcList, List namesEtcMultiWordList) { // Load names etc list (names/noise words) var namesEtcDoc = new XmlDocument(); @@ -1800,7 +1800,7 @@ namespace Nikse.SubtitleEdit.Logic } } - internal static void LoadGlobalNamesEtc(HashSet namesEtcList, HashSet namesEtcMultiWordList) + public static void LoadGlobalNamesEtc(HashSet namesEtcList, HashSet namesEtcMultiWordList) { // Load names etc list (names/noise words) var namesEtcDoc = new XmlDocument(); @@ -1840,7 +1840,7 @@ namespace Nikse.SubtitleEdit.Logic } - internal static string LoadLocalNamesEtc(List namesEtcList, List namesEtcMultiWordList, string languageName) + public static string LoadLocalNamesEtc(List namesEtcList, List namesEtcMultiWordList, string languageName) { string userNamesEtcXmlFileName = DictionaryFolder + languageName + "_names_etc.xml"; if (languageName.Length == 2) @@ -1872,7 +1872,7 @@ namespace Nikse.SubtitleEdit.Logic return userNamesEtcXmlFileName; } - internal static string LoadLocalNamesEtc(HashSet namesEtcList, HashSet namesEtcMultiWordList, string languageName) + public static string LoadLocalNamesEtc(HashSet namesEtcList, HashSet namesEtcMultiWordList, string languageName) { string userNamesEtcXmlFileName = DictionaryFolder + languageName + "_names_etc.xml"; if (languageName.Length == 2) @@ -1905,7 +1905,7 @@ namespace Nikse.SubtitleEdit.Logic } - internal static bool IsInNamesEtcMultiWordList(List namesEtcMultiWordList, string line, string word) + public static bool IsInNamesEtcMultiWordList(List namesEtcMultiWordList, string line, string word) { string text = line.Replace(Environment.NewLine, " "); text = text.Replace(" ", " "); @@ -1923,7 +1923,7 @@ namespace Nikse.SubtitleEdit.Logic return false; } - internal static bool IsInNamesEtcMultiWordList(HashSet namesEtcMultiWordList, string line, string word) + public static bool IsInNamesEtcMultiWordList(HashSet namesEtcMultiWordList, string line, string word) { string text = line.Replace(Environment.NewLine, " "); text = text.Replace(" ", " "); @@ -1999,7 +1999,7 @@ namespace Nikse.SubtitleEdit.Logic return sb.ToString(); } - internal static Color GetColorFromUserName(string userName) + public static Color GetColorFromUserName(string userName) { if (string.IsNullOrEmpty(userName)) return Color.Pink; @@ -2037,7 +2037,7 @@ namespace Nikse.SubtitleEdit.Logic } } - internal static int GetNumber0To7FromUserName(string userName) + public static int GetNumber0To7FromUserName(string userName) { if (string.IsNullOrEmpty(userName)) return 0; @@ -2050,7 +2050,7 @@ namespace Nikse.SubtitleEdit.Logic return (int)(number % 8); } - internal static string GetRegExGroup(string regEx) + public static string GetRegExGroup(string regEx) { int start = regEx.IndexOf("(?<"); if (start >= 0 && regEx.IndexOf(")", start) > start) @@ -2066,7 +2066,7 @@ namespace Nikse.SubtitleEdit.Logic return null; } - internal static string LowerCaseVowels + public static string LowerCaseVowels { get { @@ -2074,7 +2074,7 @@ namespace Nikse.SubtitleEdit.Logic } } - internal static void SetButtonHeight(Control control, int newHeight, int level) + public static void SetButtonHeight(Control control, int newHeight, int level) { if (level > 6) return; @@ -2093,7 +2093,7 @@ namespace Nikse.SubtitleEdit.Logic control.Height = newHeight; } - internal static int CountTagInText(string text, string tag) + public static int CountTagInText(string text, string tag) { int count = 0; int index = text.IndexOf(tag); @@ -2105,7 +2105,7 @@ namespace Nikse.SubtitleEdit.Logic return count; } - internal static string FixInvalidItalicTags(string text) + public static string FixInvalidItalicTags(string text) { const string beginTag = ""; const string endTag = ""; @@ -2218,7 +2218,7 @@ namespace Nikse.SubtitleEdit.Logic return text; } - internal static Paragraph GetOriginalParagraph(int index, Paragraph paragraph, List originalParagraphs) + public static Paragraph GetOriginalParagraph(int index, Paragraph paragraph, List originalParagraphs) { if (index < 0) return null; @@ -2246,7 +2246,7 @@ namespace Nikse.SubtitleEdit.Logic /// /// Text string to encode /// HTML-encoded text - internal static string HtmlEncode(string text) + public static string HtmlEncode(string text) { if (text == null) return string.Empty; @@ -2284,7 +2284,7 @@ namespace Nikse.SubtitleEdit.Logic /// /// Text string to encode /// HTML-decoded text - internal static string HtmlDecode(string text) + public static string HtmlDecode(string text) { if (text == null) return string.Empty; @@ -2611,7 +2611,7 @@ namespace Nikse.SubtitleEdit.Logic return System.Uri.UnescapeDataString(text); } - internal static bool IsWordInUserPhrases(List userPhraseList, int index, string[] words) + public static bool IsWordInUserPhrases(List userPhraseList, int index, string[] words) { string current = words[index]; string prev = "-"; @@ -2630,7 +2630,7 @@ namespace Nikse.SubtitleEdit.Logic return false; } - internal static void CheckAutoWrap(TextBox textBox, KeyEventArgs e, int numberOfNewLines) + public static void CheckAutoWrap(TextBox textBox, KeyEventArgs e, int numberOfNewLines) { if (e.Modifiers == Keys.None && e.KeyCode != Keys.Enter && numberOfNewLines < 1 && textBox.Text.Length >= Configuration.Settings.General.SubtitleLineMaximumLength) { diff --git a/src/SubtitleEdit.csproj b/src/SubtitleEdit.csproj index 7581f9861..cba7496ae 100644 --- a/src/SubtitleEdit.csproj +++ b/src/SubtitleEdit.csproj @@ -837,6 +837,8 @@ + +