diff --git a/src/ChangeLog.txt b/src/ChangeLog.txt index 937a2ef0a..bf6e3e9ac 100644 --- a/src/ChangeLog.txt +++ b/src/ChangeLog.txt @@ -17,11 +17,13 @@ Subtitle Edit Changelog * Text box context menu -> Split line at cursor position (thx dr. Jackson) * Import+ocr of blu-ray sup files inside matroska files * Now remembers undocked controls pos/size + * New customizable shortcut for Adjust mode: Set current subtitle end time at video pos, keep duration, and go to next sub (Shift+End, thx Bavo) * IMPROVED: * OCR unknown words highlighting now works better (thx sialivi) * Merge short lines can now also merge lines ending with ".", "?", or "!" (optional) * Can now read Adobe Encore files starting with line numbers (thx Pier) * Advanced Sub Station Alpha (and SSA) now keep original styles (thx Rebecca) + * Improved Remove text for HI (thx sialivi) * FIXED: * Adjust all times did not work for MicroDvd (thx Wolf) * Now removes empty unicode white spaces from Google translate diff --git a/src/Controls/AudioVisualizer.cs b/src/Controls/AudioVisualizer.cs index 4d5e3500d..d55db8f10 100644 --- a/src/Controls/AudioVisualizer.cs +++ b/src/Controls/AudioVisualizer.cs @@ -407,7 +407,7 @@ namespace Nikse.SubtitleEdit.Controls if (currentRegionWidth > 40) { SolidBrush textBrush = new SolidBrush(Color.Turquoise); - e.Graphics.DrawString(string.Format("{0:0.###} {1}", (double)((double)currentRegionWidth / _wavePeaks.Header.SampleRate / _zoomFactor), + e.Graphics.DrawString(string.Format("{0:0.###} {1}",((double)currentRegionWidth / _wavePeaks.Header.SampleRate / _zoomFactor), Configuration.Settings.Language.WaveForm.Seconds), Font, textBrush, new PointF(currentRegionLeft + 3, Height - 32)); } diff --git a/src/Forms/Compare.cs b/src/Forms/Compare.cs index 129b671b2..2dd5b4d39 100644 --- a/src/Forms/Compare.cs +++ b/src/Forms/Compare.cs @@ -6,7 +6,6 @@ using System.Text; using System.Windows.Forms; using Nikse.SubtitleEdit.Controls; using Nikse.SubtitleEdit.Logic; -using Nikse.SubtitleEdit.Logic.SubtitleFormats; namespace Nikse.SubtitleEdit.Forms { diff --git a/src/Forms/DvdSubRip.cs b/src/Forms/DvdSubRip.cs index 372af4f0b..d72498c78 100644 --- a/src/Forms/DvdSubRip.cs +++ b/src/Forms/DvdSubRip.cs @@ -344,7 +344,7 @@ namespace Nikse.SubtitleEdit.Forms pre = "0010"; long newPts = addPresentationTimeStamp + ((long)vsp.PacketizedElementaryStream.PresentationTimeStamp.Value); - string bString = Convert.ToString((long)newPts, 2).PadLeft(33, '0'); + string bString = Convert.ToString(newPts, 2).PadLeft(33, '0'); string fiveBytesString = pre + bString.Substring(0, 3) + "1" + bString.Substring(3, 15) + "1" + bString.Substring(18, 15) + "1"; diff --git a/src/Forms/ExportPngXml.cs b/src/Forms/ExportPngXml.cs index 57152c40d..9866fe831 100644 --- a/src/Forms/ExportPngXml.cs +++ b/src/Forms/ExportPngXml.cs @@ -1,15 +1,12 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; using System.Drawing; +using System.Drawing.Drawing2D; +using System.Drawing.Text; +using System.IO; using System.Text; using System.Windows.Forms; -using System.Drawing.Text; -using System.Drawing.Drawing2D; -using Nikse.SubtitleEdit.Logic; using System.Xml; -using System.IO; +using Nikse.SubtitleEdit.Logic; namespace Nikse.SubtitleEdit.Forms { diff --git a/src/Forms/GoogleOrMicrosoftTranslate.cs b/src/Forms/GoogleOrMicrosoftTranslate.cs index 3ef91fe22..def61ee5c 100644 --- a/src/Forms/GoogleOrMicrosoftTranslate.cs +++ b/src/Forms/GoogleOrMicrosoftTranslate.cs @@ -2,7 +2,6 @@ using System.Windows.Forms; using Nikse.SubtitleEdit.Logic; using System.Drawing; -using System.ComponentModel; namespace Nikse.SubtitleEdit.Forms { diff --git a/src/Forms/GoogleTranslate.cs b/src/Forms/GoogleTranslate.cs index f38c6446b..527df78da 100644 --- a/src/Forms/GoogleTranslate.cs +++ b/src/Forms/GoogleTranslate.cs @@ -398,7 +398,7 @@ namespace Nikse.SubtitleEdit.Forms return; } - MicrosoftTranslationService.SoapService client = MsTranslationServiceClient; + // MicrosoftTranslationService.SoapService client = MsTranslationServiceClient; //string[] locales = client.GetLanguagesForTranslate(BingApiId); string[] locales = GetMsLocales(); diff --git a/src/Forms/ImportText.cs b/src/Forms/ImportText.cs index 3b9c13c4f..01db1a4ba 100644 --- a/src/Forms/ImportText.cs +++ b/src/Forms/ImportText.cs @@ -1,13 +1,11 @@ using System; using System.Collections.Generic; -using System.ComponentModel; -using System.Data; using System.Drawing; +using System.IO; using System.Text; using System.Windows.Forms; -using System.IO; -using Nikse.SubtitleEdit.Logic; using System.Xml; +using Nikse.SubtitleEdit.Logic; namespace Nikse.SubtitleEdit.Forms { diff --git a/src/Forms/Main.cs b/src/Forms/Main.cs index bf170d93c..47a5d66a1 100644 --- a/src/Forms/Main.cs +++ b/src/Forms/Main.cs @@ -111,7 +111,7 @@ namespace Nikse.SubtitleEdit.Forms if (versionInfo.Length >= 3 && versionInfo[2] != "0") _title += "." + versionInfo[2]; } - return _title + " Beta 1"; + return _title + " Beta 2"; } } @@ -10267,7 +10267,6 @@ namespace Nikse.SubtitleEdit.Forms if (firstSelectedIndex >= 0) { Paragraph p = _subtitle.GetParagraphOrDefault(firstSelectedIndex); - Paragraph normalParagraph = p; if (p != null) { string defaultFromLanguage = Utilities.AutoDetectGoogleLanguage(_subtitle); @@ -10462,7 +10461,8 @@ namespace Nikse.SubtitleEdit.Forms private void textBoxListViewText_MouseDoubleClick(object sender, MouseEventArgs e) { - string selText = (sender as TextBox).SelectedText; + TextBox tb = (sender as TextBox); + string selText = tb.SelectedText; if (!string.IsNullOrEmpty(selText)) { for (int i = 0; i < 5; i++) @@ -10476,27 +10476,19 @@ namespace Nikse.SubtitleEdit.Forms selText = selText.TrimEnd(';'); selText = selText.TrimEnd(' '); } - (sender as TextBox).SelectionLength = selText.Length; + tb.SelectionLength = selText.Length; + if ((selText.StartsWith("(") || selText.StartsWith("[")) && selText.Length > 1) + { + int l = tb.SelectionLength -1; + tb.SelectionStart++; + tb.SelectionLength = l; + } } } private void textBoxListViewTextAlternate_MouseDoubleClick(object sender, MouseEventArgs e) { - string selText = (sender as TextBox).SelectedText; - if (!string.IsNullOrEmpty(selText)) - { - for (int i = 0; i < 5; i++) - { - selText = selText.TrimEnd('.'); - selText = selText.TrimEnd('!'); - selText = selText.TrimEnd('?'); - selText = selText.TrimEnd(','); - selText = selText.TrimEnd(':'); - selText = selText.TrimEnd(';'); - selText = selText.TrimEnd(' '); - } - (sender as TextBox).SelectionLength = selText.Length; - } + textBoxListViewText_MouseDoubleClick(sender, e); } } diff --git a/src/Forms/OCRSpellCheck.cs b/src/Forms/OCRSpellCheck.cs index 6cb474851..268194655 100644 --- a/src/Forms/OCRSpellCheck.cs +++ b/src/Forms/OCRSpellCheck.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Drawing; -using System.Text.RegularExpressions; using System.Windows.Forms; using Nikse.SubtitleEdit.Logic; diff --git a/src/Forms/RemoveTextFromHearImpaired.cs b/src/Forms/RemoveTextFromHearImpaired.cs index a773f70c2..d51cb351f 100644 --- a/src/Forms/RemoveTextFromHearImpaired.cs +++ b/src/Forms/RemoveTextFromHearImpaired.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.Drawing; using System.Text; using System.Text.RegularExpressions; diff --git a/src/Forms/SplitLongLines.cs b/src/Forms/SplitLongLines.cs index cdc635653..280b3b13c 100644 --- a/src/Forms/SplitLongLines.cs +++ b/src/Forms/SplitLongLines.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Drawing; -using System.Text; using System.Windows.Forms; using Nikse.SubtitleEdit.Logic; diff --git a/src/Forms/VideoControlsUndocked.cs b/src/Forms/VideoControlsUndocked.cs index 70460d625..5e4a9f195 100644 --- a/src/Forms/VideoControlsUndocked.cs +++ b/src/Forms/VideoControlsUndocked.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Text; +using System.Drawing; using System.Windows.Forms; using Nikse.SubtitleEdit.Logic; diff --git a/src/Forms/VideoPlayerUnDocked.cs b/src/Forms/VideoPlayerUnDocked.cs index 9a0b5bc55..84f3c2e56 100644 --- a/src/Forms/VideoPlayerUnDocked.cs +++ b/src/Forms/VideoPlayerUnDocked.cs @@ -1,7 +1,6 @@ using System.Drawing; using System.Windows.Forms; using Nikse.SubtitleEdit.Logic; -using Nikse.SubtitleEdit.Controls; namespace Nikse.SubtitleEdit.Forms { diff --git a/src/Forms/WaveFormUnDocked.cs b/src/Forms/WaveFormUnDocked.cs index 6caf4e088..a3871e3f4 100644 --- a/src/Forms/WaveFormUnDocked.cs +++ b/src/Forms/WaveFormUnDocked.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Text; +using System.Drawing; using System.Windows.Forms; using Nikse.SubtitleEdit.Logic; diff --git a/src/Logic/DetectEncoding/Multilang/CMLangConvertCharsetClass.cs b/src/Logic/DetectEncoding/Multilang/CMLangConvertCharsetClass.cs index 681bba466..f75585b34 100644 --- a/src/Logic/DetectEncoding/Multilang/CMLangConvertCharsetClass.cs +++ b/src/Logic/DetectEncoding/Multilang/CMLangConvertCharsetClass.cs @@ -3,7 +3,6 @@ namespace MultiLanguage using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; - using System.Security; [ComImport, ClassInterface((short) 0), TypeLibType((short) 2), Guid("D66D6F99-CDAA-11D0-B822-00C04FC9B31F")] public class CMLangConvertCharsetClass : IMLangConvertCharset, CMLangConvertCharset diff --git a/src/Logic/DetectEncoding/Multilang/CMLangStringClass.cs b/src/Logic/DetectEncoding/Multilang/CMLangStringClass.cs index 5a4eab329..09e4aac20 100644 --- a/src/Logic/DetectEncoding/Multilang/CMLangStringClass.cs +++ b/src/Logic/DetectEncoding/Multilang/CMLangStringClass.cs @@ -3,7 +3,6 @@ namespace MultiLanguage using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; - using System.Security; [ComImport, Guid("C04D65CF-B70D-11D0-B188-00AA0038C969"), ComConversionLoss, ClassInterface((short) 0), TypeLibType((short) 2)] public class CMLangStringClass : IMLangString, CMLangString, IMLangStringWStr, IMLangStringAStr diff --git a/src/Logic/DetectEncoding/Multilang/CMultiLanguageClass.cs b/src/Logic/DetectEncoding/Multilang/CMultiLanguageClass.cs index 62afdd022..692e913a6 100644 --- a/src/Logic/DetectEncoding/Multilang/CMultiLanguageClass.cs +++ b/src/Logic/DetectEncoding/Multilang/CMultiLanguageClass.cs @@ -3,7 +3,6 @@ namespace MultiLanguage using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; - using System.Security; [ComImport, TypeLibType((short) 2), ClassInterface((short) 0), Guid("275C23E2-3747-11D0-9FEA-00AA003F8646")] public class CMultiLanguageClass : IMultiLanguage, CMultiLanguage, IMLangCodePages, IMLangFontLink, IMLangLineBreakConsole, IMultiLanguage2, IMLangFontLink2, IMultiLanguage3 diff --git a/src/Logic/DetectEncoding/Multilang/IEnumCodePage.cs b/src/Logic/DetectEncoding/Multilang/IEnumCodePage.cs index 209d89854..129503148 100644 --- a/src/Logic/DetectEncoding/Multilang/IEnumCodePage.cs +++ b/src/Logic/DetectEncoding/Multilang/IEnumCodePage.cs @@ -3,7 +3,6 @@ namespace MultiLanguage using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; - using System.Security; [ComImport, Guid("275C23E3-3747-11D0-9FEA-00AA003F8646"), InterfaceType((short) 1)] public interface IEnumCodePage diff --git a/src/Logic/DetectEncoding/Multilang/IEnumRfc1766.cs b/src/Logic/DetectEncoding/Multilang/IEnumRfc1766.cs index c27ac75c6..71dd41f2a 100644 --- a/src/Logic/DetectEncoding/Multilang/IEnumRfc1766.cs +++ b/src/Logic/DetectEncoding/Multilang/IEnumRfc1766.cs @@ -3,7 +3,6 @@ namespace MultiLanguage using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; - using System.Security; [ComImport, Guid("3DC39D1D-C030-11D0-B81B-00C04FC9B31F"), InterfaceType((short) 1)] public interface IEnumRfc1766 diff --git a/src/Logic/DetectEncoding/Multilang/IEnumScript.cs b/src/Logic/DetectEncoding/Multilang/IEnumScript.cs index 1638d719f..55decefb6 100644 --- a/src/Logic/DetectEncoding/Multilang/IEnumScript.cs +++ b/src/Logic/DetectEncoding/Multilang/IEnumScript.cs @@ -3,7 +3,6 @@ namespace MultiLanguage using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; - using System.Security; [ComImport, Guid("AE5F1430-388B-11D2-8380-00C04F8F5DA1"), InterfaceType((short) 1)] public interface IEnumScript diff --git a/src/Logic/DetectEncoding/Multilang/IMLangCodePages.cs b/src/Logic/DetectEncoding/Multilang/IMLangCodePages.cs index 7ec542a0e..6b44deb39 100644 --- a/src/Logic/DetectEncoding/Multilang/IMLangCodePages.cs +++ b/src/Logic/DetectEncoding/Multilang/IMLangCodePages.cs @@ -3,7 +3,6 @@ namespace MultiLanguage using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; - using System.Security; [ComImport, Guid("359F3443-BD4A-11D0-B188-00AA0038C969"), InterfaceType((short) 1)] public interface IMLangCodePages diff --git a/src/Logic/DetectEncoding/Multilang/IMLangConvertCharset.cs b/src/Logic/DetectEncoding/Multilang/IMLangConvertCharset.cs index 253ec71df..2b73720d9 100644 --- a/src/Logic/DetectEncoding/Multilang/IMLangConvertCharset.cs +++ b/src/Logic/DetectEncoding/Multilang/IMLangConvertCharset.cs @@ -3,7 +3,6 @@ namespace MultiLanguage using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; - using System.Security; [ComImport, Guid("D66D6F98-CDAA-11D0-B822-00C04FC9B31F"), InterfaceType((short) 1)] public interface IMLangConvertCharset diff --git a/src/Logic/DetectEncoding/Multilang/IMLangFontLink.cs b/src/Logic/DetectEncoding/Multilang/IMLangFontLink.cs index b317a33e5..ad53e1726 100644 --- a/src/Logic/DetectEncoding/Multilang/IMLangFontLink.cs +++ b/src/Logic/DetectEncoding/Multilang/IMLangFontLink.cs @@ -5,7 +5,6 @@ namespace MultiLanguage using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; - using System.Security; [ComImport, InterfaceType((short) 1), ComConversionLoss, Guid("359F3441-BD4A-11D0-B188-00AA0038C969")] public interface IMLangFontLink : IMLangCodePages diff --git a/src/Logic/DetectEncoding/Multilang/IMLangFontLink2.cs b/src/Logic/DetectEncoding/Multilang/IMLangFontLink2.cs index e929d3d87..22e0c6245 100644 --- a/src/Logic/DetectEncoding/Multilang/IMLangFontLink2.cs +++ b/src/Logic/DetectEncoding/Multilang/IMLangFontLink2.cs @@ -5,7 +5,6 @@ namespace MultiLanguage using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; - using System.Security; [ComImport, ComConversionLoss, InterfaceType((short) 1), Guid("DCCFC162-2B38-11D2-B7EC-00C04F8F5D9A")] public interface IMLangFontLink2 : IMLangCodePages diff --git a/src/Logic/DetectEncoding/Multilang/IMLangLineBreakConsole.cs b/src/Logic/DetectEncoding/Multilang/IMLangLineBreakConsole.cs index 608438b06..6abeb9d17 100644 --- a/src/Logic/DetectEncoding/Multilang/IMLangLineBreakConsole.cs +++ b/src/Logic/DetectEncoding/Multilang/IMLangLineBreakConsole.cs @@ -3,7 +3,6 @@ namespace MultiLanguage using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; - using System.Security; [ComImport, InterfaceType((short) 1), Guid("F5BE2EE1-BFD7-11D0-B188-00AA0038C969")] public interface IMLangLineBreakConsole diff --git a/src/Logic/DetectEncoding/Multilang/IStream.cs b/src/Logic/DetectEncoding/Multilang/IStream.cs index b05ca992d..95f8b6fc3 100644 --- a/src/Logic/DetectEncoding/Multilang/IStream.cs +++ b/src/Logic/DetectEncoding/Multilang/IStream.cs @@ -5,7 +5,6 @@ namespace MultiLanguage using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; - using System.Security; [ComImport, Guid("0000000C-0000-0000-C000-000000000046"), InterfaceType((short) 1)] public interface IStream : ISequentialStream diff --git a/src/Logic/DetectEncoding/Multilang/_FILETIME.cs b/src/Logic/DetectEncoding/Multilang/_FILETIME.cs index 1456eaedc..a3b15e604 100644 --- a/src/Logic/DetectEncoding/Multilang/_FILETIME.cs +++ b/src/Logic/DetectEncoding/Multilang/_FILETIME.cs @@ -1,8 +1,6 @@ namespace MultiLanguage { - using System; using System.Runtime.InteropServices; - using System.Security; [StructLayout(LayoutKind.Sequential, Pack=4)] public struct _FILETIME diff --git a/src/Logic/DetectEncoding/Multilang/_LARGE_INTEGER.cs b/src/Logic/DetectEncoding/Multilang/_LARGE_INTEGER.cs index 989b62d19..3a230f62f 100644 --- a/src/Logic/DetectEncoding/Multilang/_LARGE_INTEGER.cs +++ b/src/Logic/DetectEncoding/Multilang/_LARGE_INTEGER.cs @@ -1,8 +1,6 @@ namespace MultiLanguage { - using System; using System.Runtime.InteropServices; - using System.Security; [StructLayout(LayoutKind.Sequential, Pack=8)] public struct _LARGE_INTEGER diff --git a/src/Logic/DetectEncoding/Multilang/_RemotableHandle.cs b/src/Logic/DetectEncoding/Multilang/_RemotableHandle.cs index 998481322..058e8d94d 100644 --- a/src/Logic/DetectEncoding/Multilang/_RemotableHandle.cs +++ b/src/Logic/DetectEncoding/Multilang/_RemotableHandle.cs @@ -1,8 +1,6 @@ namespace MultiLanguage { - using System; using System.Runtime.InteropServices; - using System.Security; [StructLayout(LayoutKind.Sequential, Pack=4)] public struct _RemotableHandle diff --git a/src/Logic/DetectEncoding/Multilang/_ULARGE_INTEGER.cs b/src/Logic/DetectEncoding/Multilang/_ULARGE_INTEGER.cs index 26985a4fa..b200ed78e 100644 --- a/src/Logic/DetectEncoding/Multilang/_ULARGE_INTEGER.cs +++ b/src/Logic/DetectEncoding/Multilang/_ULARGE_INTEGER.cs @@ -1,8 +1,6 @@ namespace MultiLanguage { - using System; using System.Runtime.InteropServices; - using System.Security; [StructLayout(LayoutKind.Sequential, Pack=8)] public struct _ULARGE_INTEGER diff --git a/src/Logic/DetectEncoding/Multilang/__MIDL_IWinTypes_0009.cs b/src/Logic/DetectEncoding/Multilang/__MIDL_IWinTypes_0009.cs index 42cc4e126..cfcc4b67e 100644 --- a/src/Logic/DetectEncoding/Multilang/__MIDL_IWinTypes_0009.cs +++ b/src/Logic/DetectEncoding/Multilang/__MIDL_IWinTypes_0009.cs @@ -1,8 +1,6 @@ namespace MultiLanguage { - using System; using System.Runtime.InteropServices; - using System.Security; [StructLayout(LayoutKind.Explicit, Pack=4)] public struct __MIDL_IWinTypes_0009 diff --git a/src/Logic/Enums/SubtitleSortCriteria.cs b/src/Logic/Enums/SubtitleSortCriteria.cs index b3c92161d..ad8732bc9 100644 --- a/src/Logic/Enums/SubtitleSortCriteria.cs +++ b/src/Logic/Enums/SubtitleSortCriteria.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; - + namespace Nikse.SubtitleEdit.Logic.Enums { public enum SubtitleSortCriteria diff --git a/src/Logic/IfoParser.cs b/src/Logic/IfoParser.cs index c47b1c53a..0896f0afc 100644 --- a/src/Logic/IfoParser.cs +++ b/src/Logic/IfoParser.cs @@ -343,11 +343,6 @@ namespace Nikse.SubtitleEdit.Logic } } - private int StrToInt(string s, int number) - { - return int.Parse(s); - } - private int TimeToMs(int time) { int result; @@ -362,7 +357,7 @@ namespace Nikse.SubtitleEdit.Logic fps = 30; else fps = 25; - result += (int) Math.Round((double)(1000.0/fps)*StrToFloat(IntToHex(BinToInt(MidStr(temp,26,6)),3))); + result += (int) Math.Round((1000.0 / fps) * StrToFloat(IntToHex(BinToInt(MidStr(temp, 26, 6)), 3))); return result; } diff --git a/src/Logic/OCR/ModiLanguage.cs b/src/Logic/OCR/ModiLanguage.cs index 9a9d88074..14d1e34ae 100644 --- a/src/Logic/OCR/ModiLanguage.cs +++ b/src/Logic/OCR/ModiLanguage.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Windows.Forms; +using System.Collections.Generic; namespace Nikse.SubtitleEdit.Logic.OCR { diff --git a/src/Logic/PositionAndSize.cs b/src/Logic/PositionAndSize.cs index e03b396b3..d9dc0a36b 100644 --- a/src/Logic/PositionAndSize.cs +++ b/src/Logic/PositionAndSize.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Drawing; +using System.Drawing; namespace Nikse.SubtitleEdit.Logic { diff --git a/src/Logic/Spellcheck/WindowsHunspell.cs b/src/Logic/Spellcheck/WindowsHunspell.cs index a98d18d5d..bfd31c86c 100644 --- a/src/Logic/Spellcheck/WindowsHunspell.cs +++ b/src/Logic/Spellcheck/WindowsHunspell.cs @@ -1,6 +1,4 @@ -using System; using System.Collections.Generic; -using NHunspell; namespace Nikse.SubtitleEdit.Logic.SpellCheck { diff --git a/src/Logic/SubtitleFormats/AdobeEncore.cs b/src/Logic/SubtitleFormats/AdobeEncore.cs index 4f102208e..59168c1e5 100644 --- a/src/Logic/SubtitleFormats/AdobeEncore.cs +++ b/src/Logic/SubtitleFormats/AdobeEncore.cs @@ -58,7 +58,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats private string EncodeTimeCode(TimeCode time) { //00:03:15:22 (last is frame) - int frames = time.Milliseconds / (1000 / 30); + int frames = (int)(time.Milliseconds / (1000.0 / Configuration.Settings.General.CurrentFrameRate)); return string.Format("{0:00}:{1:00}:{2:00}:{3:00}", time.Hours, time.Minutes, time.Seconds, frames); } @@ -110,7 +110,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats string seconds = parts[2]; string frames = parts[3]; - int milliseconds = (int)((1000 / 30.0) * int.Parse(frames)); + int milliseconds = (int)((1000.0 / Configuration.Settings.General.CurrentFrameRate) * int.Parse(frames)); if (milliseconds > 999) milliseconds = 999; diff --git a/src/Logic/SubtitleFormats/AdobeEncoreTabs.cs b/src/Logic/SubtitleFormats/AdobeEncoreTabs.cs index 92e0782e5..68f58e054 100644 --- a/src/Logic/SubtitleFormats/AdobeEncoreTabs.cs +++ b/src/Logic/SubtitleFormats/AdobeEncoreTabs.cs @@ -5,7 +5,7 @@ using System.Text.RegularExpressions; namespace Nikse.SubtitleEdit.Logic.SubtitleFormats { - class AdobeEncoreTab : SubtitleFormat + class AdobeEncoreTabs : SubtitleFormat { public override string Extension { @@ -55,7 +55,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats private string EncodeTimeCode(TimeCode time) { //00:03:15:22 (last is frame) - int frames = time.Milliseconds / (1000 / 30); + int frames = (int) (time.Milliseconds / (1000.0 / Configuration.Settings.General.CurrentFrameRate)); return string.Format("{0:00}:{1:00}:{2:00}:{3:00}", time.Hours, time.Minutes, time.Seconds, frames); } @@ -106,7 +106,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats string seconds = parts[2]; string frames = parts[3]; - int milliseconds = (int)((1000 / 30.0) * int.Parse(frames)); + int milliseconds = (int)((1000.0 / Configuration.Settings.General.CurrentFrameRate) * int.Parse(frames)); if (milliseconds > 999) milliseconds = 999; diff --git a/src/Logic/SubtitleFormats/AdobeEncoreWithLineNumbers.cs b/src/Logic/SubtitleFormats/AdobeEncoreWithLineNumbers.cs index 9b93a7b8b..8f8b5cfca 100644 --- a/src/Logic/SubtitleFormats/AdobeEncoreWithLineNumbers.cs +++ b/src/Logic/SubtitleFormats/AdobeEncoreWithLineNumbers.cs @@ -58,7 +58,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats private string EncodeTimeCode(TimeCode time) { //00:03:15:22 (last is frame) - int frames = time.Milliseconds / (1000 / 30); + int frames = (int)(time.Milliseconds / (1000.0 / Configuration.Settings.General.CurrentFrameRate)); return string.Format("{0:00}:{1:00}:{2:00}:{3:00}", time.Hours, time.Minutes, time.Seconds, frames); } @@ -111,7 +111,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats string seconds = parts[2]; string frames = parts[3]; - int milliseconds = (int)((1000 / 30.0) * int.Parse(frames)); + int milliseconds = (int)((1000.0 / Configuration.Settings.General.CurrentFrameRate) * int.Parse(frames)); if (milliseconds > 999) milliseconds = 999; diff --git a/src/Logic/SubtitleFormats/CaraokeXml.cs b/src/Logic/SubtitleFormats/CaraokeXml.cs index ab259a816..4389dfb2b 100644 --- a/src/Logic/SubtitleFormats/CaraokeXml.cs +++ b/src/Logic/SubtitleFormats/CaraokeXml.cs @@ -109,7 +109,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats } catch (Exception ex) { - string s = ex.Message; + System.Diagnostics.Debug.WriteLine(ex.Message); _errorCount++; } } diff --git a/src/Logic/SubtitleFormats/FlashXml.cs b/src/Logic/SubtitleFormats/FlashXml.cs index abdfcc206..e92e75caa 100644 --- a/src/Logic/SubtitleFormats/FlashXml.cs +++ b/src/Logic/SubtitleFormats/FlashXml.cs @@ -84,7 +84,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats string text = Utilities.RemoveHtmlTags(p.Text); paragraph.InnerText = p.Text; - paragraph.InnerXml = "" + p.Text.Replace(Environment.NewLine, "
") + "]]>"; + paragraph.InnerXml = "" + text.Replace(Environment.NewLine, "
") + "]]>"; XmlAttribute start = xml.CreateAttribute("begin"); start.InnerText = ConvertToTimeString(p.StartTime); diff --git a/src/Logic/SubtitleFormats/SubtitleFormat.cs b/src/Logic/SubtitleFormats/SubtitleFormat.cs index cf829aa0a..cb72b0ced 100644 --- a/src/Logic/SubtitleFormats/SubtitleFormat.cs +++ b/src/Logic/SubtitleFormats/SubtitleFormat.cs @@ -17,7 +17,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats new SubRip(), new AbcIViewer(), new AdobeEncore(), - new AdobeEncoreTab(), + new AdobeEncoreTabs(), new AdobeEncoreWithLineNumbers(), new AdvancedSubStationAlpha(), new AQTitle(), diff --git a/src/Logic/Utilities.cs b/src/Logic/Utilities.cs index 6c9bdf2a0..ce1b53daf 100644 --- a/src/Logic/Utilities.cs +++ b/src/Logic/Utilities.cs @@ -2129,7 +2129,6 @@ namespace Nikse.SubtitleEdit.Logic if (autobreakIndex > 0) { int selectionStart = textBox.SelectionStart; - int selectionLength = textBox.SelectionLength; textBox.Text = newText; if (selectionStart > autobreakIndex) selectionStart += Environment.NewLine.Length-1; diff --git a/src/Logic/VideoFormats/RiffParser.cs b/src/Logic/VideoFormats/RiffParser.cs index 65c2808d6..2e2c16461 100644 --- a/src/Logic/VideoFormats/RiffParser.cs +++ b/src/Logic/VideoFormats/RiffParser.cs @@ -1,6 +1,5 @@ using System; using System.IO; -using System.Runtime.InteropServices; using System.Runtime.Serialization; /// diff --git a/src/Logic/VideoPlayers/LibVlcDynamic.cs b/src/Logic/VideoPlayers/LibVlcDynamic.cs index 6e575c476..4025ad256 100644 --- a/src/Logic/VideoPlayers/LibVlcDynamic.cs +++ b/src/Logic/VideoPlayers/LibVlcDynamic.cs @@ -1,10 +1,8 @@ using System; -using System.Collections.Generic; -using System.Text; -using System.Runtime.InteropServices; -using System.ComponentModel; -using System.Threading; using System.IO; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading; namespace Nikse.SubtitleEdit.Logic.VideoPlayers { diff --git a/src/Logic/VideoPlayers/LibVlcMono.cs b/src/Logic/VideoPlayers/LibVlcMono.cs index f4bcdbfc7..cd1a3e66c 100644 --- a/src/Logic/VideoPlayers/LibVlcMono.cs +++ b/src/Logic/VideoPlayers/LibVlcMono.cs @@ -1,10 +1,7 @@ using System; -using System.Collections.Generic; -using System.Text; using System.Runtime.InteropServices; -using System.ComponentModel; +using System.Text; using System.Threading; -using System.IO; namespace Nikse.SubtitleEdit.Logic.VideoPlayers { diff --git a/src/Logic/WaveToVisualizer.cs b/src/Logic/WaveToVisualizer.cs index 2d8fdb5dd..c8b7e9fa9 100644 --- a/src/Logic/WaveToVisualizer.cs +++ b/src/Logic/WaveToVisualizer.cs @@ -295,15 +295,6 @@ namespace Nikse.SubtitleEdit.Logic return result; } - private int Read16BitValueFromStream(ref int index) - { - byte[] buffer = new byte[2]; - _stream.Read(buffer, 0, 2); - int result = BitConverter.ToInt16(buffer, 0); - index += 2; - return result; - } - private int ReadValue24Bit(ref int index) { byte[] buffer = new byte[4]; diff --git a/src/Logic/ZipExtractor.cs b/src/Logic/ZipExtractor.cs index dff5f8e84..f9b599276 100644 --- a/src/Logic/ZipExtractor.cs +++ b/src/Logic/ZipExtractor.cs @@ -106,7 +106,7 @@ namespace System.IO.Compression /// A valid ZipStorer object public static ZipExtractor Open(string _filename) { - Stream stream = (Stream)new FileStream(_filename, FileMode.Open, FileAccess.Read); + Stream stream = new FileStream(_filename, FileMode.Open, FileAccess.Read); ZipExtractor zip = Open(stream); return zip; } diff --git a/src/Logic/zlib/SupportClass.cs b/src/Logic/zlib/SupportClass.cs index d31551eef..e2abbddeb 100644 --- a/src/Logic/zlib/SupportClass.cs +++ b/src/Logic/zlib/SupportClass.cs @@ -1,7 +1,3 @@ - -using System; - - namespace ComponentAce.Compression.Libs.zlib { public class SupportClass diff --git a/src/Logic/zlib/ZInputStream.cs b/src/Logic/zlib/ZInputStream.cs index ad5f32ce0..4c23e2993 100644 --- a/src/Logic/zlib/ZInputStream.cs +++ b/src/Logic/zlib/ZInputStream.cs @@ -41,7 +41,6 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu) * and contributors of zlib. */ -using System; namespace ComponentAce.Compression.Libs.zlib { diff --git a/src/Logic/zlib/ZOutputStream.cs b/src/Logic/zlib/ZOutputStream.cs index c10edf744..3468732ac 100644 --- a/src/Logic/zlib/ZOutputStream.cs +++ b/src/Logic/zlib/ZOutputStream.cs @@ -42,7 +42,6 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu) * and contributors of zlib. */ -using System; namespace ComponentAce.Compression.Libs.zlib { diff --git a/src/Logic/zlib/ZStreamException.cs b/src/Logic/zlib/ZStreamException.cs index 9698cd420..3175d947e 100644 --- a/src/Logic/zlib/ZStreamException.cs +++ b/src/Logic/zlib/ZStreamException.cs @@ -41,7 +41,6 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu) * and contributors of zlib. */ -using System; namespace ComponentAce.Compression.Libs.zlib { diff --git a/src/Logic/zlib/Zlib.cs b/src/Logic/zlib/Zlib.cs index e3394a399..e223ae83f 100644 --- a/src/Logic/zlib/Zlib.cs +++ b/src/Logic/zlib/Zlib.cs @@ -41,7 +41,6 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu) * and contributors of zlib. */ -using System; namespace ComponentAce.Compression.Libs.zlib { diff --git a/src/Test/RemoveTextForHearImpairedTest.cs b/src/Test/RemoveTextForHearImpairedTest.cs index 24caa93c9..52f96e27f 100644 --- a/src/Test/RemoveTextForHearImpairedTest.cs +++ b/src/Test/RemoveTextForHearImpairedTest.cs @@ -1,6 +1,5 @@ -using Nikse.SubtitleEdit.Forms; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Nikse.SubtitleEdit.Forms; namespace Test {