git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@493 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
niksedk 2011-06-14 19:54:20 +00:00
parent 69e9187746
commit abe3440ec2
55 changed files with 45 additions and 135 deletions

View File

@ -17,11 +17,13 @@ Subtitle Edit Changelog
* Text box context menu -> Split line at cursor position (thx dr. Jackson) * Text box context menu -> Split line at cursor position (thx dr. Jackson)
* Import+ocr of blu-ray sup files inside matroska files * Import+ocr of blu-ray sup files inside matroska files
* Now remembers undocked controls pos/size * 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: * IMPROVED:
* OCR unknown words highlighting now works better (thx sialivi) * OCR unknown words highlighting now works better (thx sialivi)
* Merge short lines can now also merge lines ending with ".", "?", or "!" (optional) * Merge short lines can now also merge lines ending with ".", "?", or "!" (optional)
* Can now read Adobe Encore files starting with line numbers (thx Pier) * Can now read Adobe Encore files starting with line numbers (thx Pier)
* Advanced Sub Station Alpha (and SSA) now keep original styles (thx Rebecca) * Advanced Sub Station Alpha (and SSA) now keep original styles (thx Rebecca)
* Improved Remove text for HI (thx sialivi)
* FIXED: * FIXED:
* Adjust all times did not work for MicroDvd (thx Wolf) * Adjust all times did not work for MicroDvd (thx Wolf)
* Now removes empty unicode white spaces from Google translate * Now removes empty unicode white spaces from Google translate

View File

@ -407,7 +407,7 @@ namespace Nikse.SubtitleEdit.Controls
if (currentRegionWidth > 40) if (currentRegionWidth > 40)
{ {
SolidBrush textBrush = new SolidBrush(Color.Turquoise); 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), Configuration.Settings.Language.WaveForm.Seconds),
Font, textBrush, new PointF(currentRegionLeft + 3, Height - 32)); Font, textBrush, new PointF(currentRegionLeft + 3, Height - 32));
} }

View File

@ -6,7 +6,6 @@ using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using Nikse.SubtitleEdit.Controls; using Nikse.SubtitleEdit.Controls;
using Nikse.SubtitleEdit.Logic; using Nikse.SubtitleEdit.Logic;
using Nikse.SubtitleEdit.Logic.SubtitleFormats;
namespace Nikse.SubtitleEdit.Forms namespace Nikse.SubtitleEdit.Forms
{ {

View File

@ -344,7 +344,7 @@ namespace Nikse.SubtitleEdit.Forms
pre = "0010"; pre = "0010";
long newPts = addPresentationTimeStamp + ((long)vsp.PacketizedElementaryStream.PresentationTimeStamp.Value); 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"; string fiveBytesString = pre + bString.Substring(0, 3) + "1" + bString.Substring(3, 15) + "1" + bString.Substring(18, 15) + "1";

View File

@ -1,15 +1,12 @@
using System; using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing; using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Text;
using System.IO;
using System.Text; using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using System.Drawing.Text;
using System.Drawing.Drawing2D;
using Nikse.SubtitleEdit.Logic;
using System.Xml; using System.Xml;
using System.IO; using Nikse.SubtitleEdit.Logic;
namespace Nikse.SubtitleEdit.Forms namespace Nikse.SubtitleEdit.Forms
{ {

View File

@ -2,7 +2,6 @@
using System.Windows.Forms; using System.Windows.Forms;
using Nikse.SubtitleEdit.Logic; using Nikse.SubtitleEdit.Logic;
using System.Drawing; using System.Drawing;
using System.ComponentModel;
namespace Nikse.SubtitleEdit.Forms namespace Nikse.SubtitleEdit.Forms
{ {

View File

@ -398,7 +398,7 @@ namespace Nikse.SubtitleEdit.Forms
return; return;
} }
MicrosoftTranslationService.SoapService client = MsTranslationServiceClient; // MicrosoftTranslationService.SoapService client = MsTranslationServiceClient;
//string[] locales = client.GetLanguagesForTranslate(BingApiId); //string[] locales = client.GetLanguagesForTranslate(BingApiId);
string[] locales = GetMsLocales(); string[] locales = GetMsLocales();

View File

@ -1,13 +1,11 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing; using System.Drawing;
using System.IO;
using System.Text; using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using System.IO;
using Nikse.SubtitleEdit.Logic;
using System.Xml; using System.Xml;
using Nikse.SubtitleEdit.Logic;
namespace Nikse.SubtitleEdit.Forms namespace Nikse.SubtitleEdit.Forms
{ {

View File

@ -111,7 +111,7 @@ namespace Nikse.SubtitleEdit.Forms
if (versionInfo.Length >= 3 && versionInfo[2] != "0") if (versionInfo.Length >= 3 && versionInfo[2] != "0")
_title += "." + versionInfo[2]; _title += "." + versionInfo[2];
} }
return _title + " Beta 1"; return _title + " Beta 2";
} }
} }
@ -10267,7 +10267,6 @@ namespace Nikse.SubtitleEdit.Forms
if (firstSelectedIndex >= 0) if (firstSelectedIndex >= 0)
{ {
Paragraph p = _subtitle.GetParagraphOrDefault(firstSelectedIndex); Paragraph p = _subtitle.GetParagraphOrDefault(firstSelectedIndex);
Paragraph normalParagraph = p;
if (p != null) if (p != null)
{ {
string defaultFromLanguage = Utilities.AutoDetectGoogleLanguage(_subtitle); string defaultFromLanguage = Utilities.AutoDetectGoogleLanguage(_subtitle);
@ -10462,7 +10461,8 @@ namespace Nikse.SubtitleEdit.Forms
private void textBoxListViewText_MouseDoubleClick(object sender, MouseEventArgs e) 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)) if (!string.IsNullOrEmpty(selText))
{ {
for (int i = 0; i < 5; i++) for (int i = 0; i < 5; i++)
@ -10476,27 +10476,19 @@ namespace Nikse.SubtitleEdit.Forms
selText = selText.TrimEnd(';'); selText = selText.TrimEnd(';');
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) private void textBoxListViewTextAlternate_MouseDoubleClick(object sender, MouseEventArgs e)
{ {
string selText = (sender as TextBox).SelectedText; textBoxListViewText_MouseDoubleClick(sender, e);
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;
}
} }
} }

View File

@ -1,7 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.Text.RegularExpressions;
using System.Windows.Forms; using System.Windows.Forms;
using Nikse.SubtitleEdit.Logic; using Nikse.SubtitleEdit.Logic;

View File

@ -1,5 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.Text; using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;

View File

@ -1,7 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using Nikse.SubtitleEdit.Logic; using Nikse.SubtitleEdit.Logic;

View File

@ -1,9 +1,4 @@
using System; using System.Drawing;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using Nikse.SubtitleEdit.Logic; using Nikse.SubtitleEdit.Logic;

View File

@ -1,7 +1,6 @@
using System.Drawing; using System.Drawing;
using System.Windows.Forms; using System.Windows.Forms;
using Nikse.SubtitleEdit.Logic; using Nikse.SubtitleEdit.Logic;
using Nikse.SubtitleEdit.Controls;
namespace Nikse.SubtitleEdit.Forms namespace Nikse.SubtitleEdit.Forms
{ {

View File

@ -1,9 +1,4 @@
using System; using System.Drawing;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using Nikse.SubtitleEdit.Logic; using Nikse.SubtitleEdit.Logic;

View File

@ -3,7 +3,6 @@ namespace MultiLanguage
using System; using System;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Security;
[ComImport, ClassInterface((short) 0), TypeLibType((short) 2), Guid("D66D6F99-CDAA-11D0-B822-00C04FC9B31F")] [ComImport, ClassInterface((short) 0), TypeLibType((short) 2), Guid("D66D6F99-CDAA-11D0-B822-00C04FC9B31F")]
public class CMLangConvertCharsetClass : IMLangConvertCharset, CMLangConvertCharset public class CMLangConvertCharsetClass : IMLangConvertCharset, CMLangConvertCharset

View File

@ -3,7 +3,6 @@ namespace MultiLanguage
using System; using System;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Security;
[ComImport, Guid("C04D65CF-B70D-11D0-B188-00AA0038C969"), ComConversionLoss, ClassInterface((short) 0), TypeLibType((short) 2)] [ComImport, Guid("C04D65CF-B70D-11D0-B188-00AA0038C969"), ComConversionLoss, ClassInterface((short) 0), TypeLibType((short) 2)]
public class CMLangStringClass : IMLangString, CMLangString, IMLangStringWStr, IMLangStringAStr public class CMLangStringClass : IMLangString, CMLangString, IMLangStringWStr, IMLangStringAStr

View File

@ -3,7 +3,6 @@ namespace MultiLanguage
using System; using System;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Security;
[ComImport, TypeLibType((short) 2), ClassInterface((short) 0), Guid("275C23E2-3747-11D0-9FEA-00AA003F8646")] [ComImport, TypeLibType((short) 2), ClassInterface((short) 0), Guid("275C23E2-3747-11D0-9FEA-00AA003F8646")]
public class CMultiLanguageClass : IMultiLanguage, CMultiLanguage, IMLangCodePages, IMLangFontLink, IMLangLineBreakConsole, IMultiLanguage2, IMLangFontLink2, IMultiLanguage3 public class CMultiLanguageClass : IMultiLanguage, CMultiLanguage, IMLangCodePages, IMLangFontLink, IMLangLineBreakConsole, IMultiLanguage2, IMLangFontLink2, IMultiLanguage3

View File

@ -3,7 +3,6 @@ namespace MultiLanguage
using System; using System;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Security;
[ComImport, Guid("275C23E3-3747-11D0-9FEA-00AA003F8646"), InterfaceType((short) 1)] [ComImport, Guid("275C23E3-3747-11D0-9FEA-00AA003F8646"), InterfaceType((short) 1)]
public interface IEnumCodePage public interface IEnumCodePage

View File

@ -3,7 +3,6 @@ namespace MultiLanguage
using System; using System;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Security;
[ComImport, Guid("3DC39D1D-C030-11D0-B81B-00C04FC9B31F"), InterfaceType((short) 1)] [ComImport, Guid("3DC39D1D-C030-11D0-B81B-00C04FC9B31F"), InterfaceType((short) 1)]
public interface IEnumRfc1766 public interface IEnumRfc1766

View File

@ -3,7 +3,6 @@ namespace MultiLanguage
using System; using System;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Security;
[ComImport, Guid("AE5F1430-388B-11D2-8380-00C04F8F5DA1"), InterfaceType((short) 1)] [ComImport, Guid("AE5F1430-388B-11D2-8380-00C04F8F5DA1"), InterfaceType((short) 1)]
public interface IEnumScript public interface IEnumScript

View File

@ -3,7 +3,6 @@ namespace MultiLanguage
using System; using System;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Security;
[ComImport, Guid("359F3443-BD4A-11D0-B188-00AA0038C969"), InterfaceType((short) 1)] [ComImport, Guid("359F3443-BD4A-11D0-B188-00AA0038C969"), InterfaceType((short) 1)]
public interface IMLangCodePages public interface IMLangCodePages

View File

@ -3,7 +3,6 @@ namespace MultiLanguage
using System; using System;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Security;
[ComImport, Guid("D66D6F98-CDAA-11D0-B822-00C04FC9B31F"), InterfaceType((short) 1)] [ComImport, Guid("D66D6F98-CDAA-11D0-B822-00C04FC9B31F"), InterfaceType((short) 1)]
public interface IMLangConvertCharset public interface IMLangConvertCharset

View File

@ -5,7 +5,6 @@ namespace MultiLanguage
using System; using System;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Security;
[ComImport, InterfaceType((short) 1), ComConversionLoss, Guid("359F3441-BD4A-11D0-B188-00AA0038C969")] [ComImport, InterfaceType((short) 1), ComConversionLoss, Guid("359F3441-BD4A-11D0-B188-00AA0038C969")]
public interface IMLangFontLink : IMLangCodePages public interface IMLangFontLink : IMLangCodePages

View File

@ -5,7 +5,6 @@ namespace MultiLanguage
using System; using System;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Security;
[ComImport, ComConversionLoss, InterfaceType((short) 1), Guid("DCCFC162-2B38-11D2-B7EC-00C04F8F5D9A")] [ComImport, ComConversionLoss, InterfaceType((short) 1), Guid("DCCFC162-2B38-11D2-B7EC-00C04F8F5D9A")]
public interface IMLangFontLink2 : IMLangCodePages public interface IMLangFontLink2 : IMLangCodePages

View File

@ -3,7 +3,6 @@ namespace MultiLanguage
using System; using System;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Security;
[ComImport, InterfaceType((short) 1), Guid("F5BE2EE1-BFD7-11D0-B188-00AA0038C969")] [ComImport, InterfaceType((short) 1), Guid("F5BE2EE1-BFD7-11D0-B188-00AA0038C969")]
public interface IMLangLineBreakConsole public interface IMLangLineBreakConsole

View File

@ -5,7 +5,6 @@ namespace MultiLanguage
using System; using System;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Security;
[ComImport, Guid("0000000C-0000-0000-C000-000000000046"), InterfaceType((short) 1)] [ComImport, Guid("0000000C-0000-0000-C000-000000000046"), InterfaceType((short) 1)]
public interface IStream : ISequentialStream public interface IStream : ISequentialStream

View File

@ -1,8 +1,6 @@
namespace MultiLanguage namespace MultiLanguage
{ {
using System;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Security;
[StructLayout(LayoutKind.Sequential, Pack=4)] [StructLayout(LayoutKind.Sequential, Pack=4)]
public struct _FILETIME public struct _FILETIME

View File

@ -1,8 +1,6 @@
namespace MultiLanguage namespace MultiLanguage
{ {
using System;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Security;
[StructLayout(LayoutKind.Sequential, Pack=8)] [StructLayout(LayoutKind.Sequential, Pack=8)]
public struct _LARGE_INTEGER public struct _LARGE_INTEGER

View File

@ -1,8 +1,6 @@
namespace MultiLanguage namespace MultiLanguage
{ {
using System;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Security;
[StructLayout(LayoutKind.Sequential, Pack=4)] [StructLayout(LayoutKind.Sequential, Pack=4)]
public struct _RemotableHandle public struct _RemotableHandle

View File

@ -1,8 +1,6 @@
namespace MultiLanguage namespace MultiLanguage
{ {
using System;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Security;
[StructLayout(LayoutKind.Sequential, Pack=8)] [StructLayout(LayoutKind.Sequential, Pack=8)]
public struct _ULARGE_INTEGER public struct _ULARGE_INTEGER

View File

@ -1,8 +1,6 @@
namespace MultiLanguage namespace MultiLanguage
{ {
using System;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Security;
[StructLayout(LayoutKind.Explicit, Pack=4)] [StructLayout(LayoutKind.Explicit, Pack=4)]
public struct __MIDL_IWinTypes_0009 public struct __MIDL_IWinTypes_0009

View File

@ -1,7 +1,4 @@
using System; 
using System.Collections.Generic;
using System.Text;
namespace Nikse.SubtitleEdit.Logic.Enums namespace Nikse.SubtitleEdit.Logic.Enums
{ {
public enum SubtitleSortCriteria public enum SubtitleSortCriteria

View File

@ -343,11 +343,6 @@ namespace Nikse.SubtitleEdit.Logic
} }
} }
private int StrToInt(string s, int number)
{
return int.Parse(s);
}
private int TimeToMs(int time) private int TimeToMs(int time)
{ {
int result; int result;
@ -362,7 +357,7 @@ namespace Nikse.SubtitleEdit.Logic
fps = 30; fps = 30;
else else
fps = 25; 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; return result;
} }

View File

@ -1,7 +1,4 @@
using System; using System.Collections.Generic;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
namespace Nikse.SubtitleEdit.Logic.OCR namespace Nikse.SubtitleEdit.Logic.OCR
{ {

View File

@ -1,7 +1,4 @@
using System; using System.Drawing;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
namespace Nikse.SubtitleEdit.Logic namespace Nikse.SubtitleEdit.Logic
{ {

View File

@ -1,6 +1,4 @@
using System;
using System.Collections.Generic; using System.Collections.Generic;
using NHunspell;
namespace Nikse.SubtitleEdit.Logic.SpellCheck namespace Nikse.SubtitleEdit.Logic.SpellCheck
{ {

View File

@ -58,7 +58,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
private string EncodeTimeCode(TimeCode time) private string EncodeTimeCode(TimeCode time)
{ {
//00:03:15:22 (last is frame) //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); 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 seconds = parts[2];
string frames = parts[3]; 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) if (milliseconds > 999)
milliseconds = 999; milliseconds = 999;

View File

@ -5,7 +5,7 @@ using System.Text.RegularExpressions;
namespace Nikse.SubtitleEdit.Logic.SubtitleFormats namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
{ {
class AdobeEncoreTab : SubtitleFormat class AdobeEncoreTabs : SubtitleFormat
{ {
public override string Extension public override string Extension
{ {
@ -55,7 +55,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
private string EncodeTimeCode(TimeCode time) private string EncodeTimeCode(TimeCode time)
{ {
//00:03:15:22 (last is frame) //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); 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 seconds = parts[2];
string frames = parts[3]; 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) if (milliseconds > 999)
milliseconds = 999; milliseconds = 999;

View File

@ -58,7 +58,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
private string EncodeTimeCode(TimeCode time) private string EncodeTimeCode(TimeCode time)
{ {
//00:03:15:22 (last is frame) //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); 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 seconds = parts[2];
string frames = parts[3]; 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) if (milliseconds > 999)
milliseconds = 999; milliseconds = 999;

View File

@ -109,7 +109,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
} }
catch (Exception ex) catch (Exception ex)
{ {
string s = ex.Message; System.Diagnostics.Debug.WriteLine(ex.Message);
_errorCount++; _errorCount++;
} }
} }

View File

@ -84,7 +84,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
string text = Utilities.RemoveHtmlTags(p.Text); string text = Utilities.RemoveHtmlTags(p.Text);
paragraph.InnerText = p.Text; paragraph.InnerText = p.Text;
paragraph.InnerXml = "<![CDATA[<sub>" + p.Text.Replace(Environment.NewLine, "<br />") + "</sub>]]>"; paragraph.InnerXml = "<![CDATA[<sub>" + text.Replace(Environment.NewLine, "<br />") + "</sub>]]>";
XmlAttribute start = xml.CreateAttribute("begin"); XmlAttribute start = xml.CreateAttribute("begin");
start.InnerText = ConvertToTimeString(p.StartTime); start.InnerText = ConvertToTimeString(p.StartTime);

View File

@ -17,7 +17,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
new SubRip(), new SubRip(),
new AbcIViewer(), new AbcIViewer(),
new AdobeEncore(), new AdobeEncore(),
new AdobeEncoreTab(), new AdobeEncoreTabs(),
new AdobeEncoreWithLineNumbers(), new AdobeEncoreWithLineNumbers(),
new AdvancedSubStationAlpha(), new AdvancedSubStationAlpha(),
new AQTitle(), new AQTitle(),

View File

@ -2129,7 +2129,6 @@ namespace Nikse.SubtitleEdit.Logic
if (autobreakIndex > 0) if (autobreakIndex > 0)
{ {
int selectionStart = textBox.SelectionStart; int selectionStart = textBox.SelectionStart;
int selectionLength = textBox.SelectionLength;
textBox.Text = newText; textBox.Text = newText;
if (selectionStart > autobreakIndex) if (selectionStart > autobreakIndex)
selectionStart += Environment.NewLine.Length-1; selectionStart += Environment.NewLine.Length-1;

View File

@ -1,6 +1,5 @@
using System; using System;
using System.IO; using System.IO;
using System.Runtime.InteropServices;
using System.Runtime.Serialization; using System.Runtime.Serialization;
/// <copyright> /// <copyright>

View File

@ -1,10 +1,8 @@
using System; using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
using System.ComponentModel;
using System.Threading;
using System.IO; using System.IO;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
namespace Nikse.SubtitleEdit.Logic.VideoPlayers namespace Nikse.SubtitleEdit.Logic.VideoPlayers
{ {

View File

@ -1,10 +1,7 @@
using System; using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.ComponentModel; using System.Text;
using System.Threading; using System.Threading;
using System.IO;
namespace Nikse.SubtitleEdit.Logic.VideoPlayers namespace Nikse.SubtitleEdit.Logic.VideoPlayers
{ {

View File

@ -295,15 +295,6 @@ namespace Nikse.SubtitleEdit.Logic
return result; 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) private int ReadValue24Bit(ref int index)
{ {
byte[] buffer = new byte[4]; byte[] buffer = new byte[4];

View File

@ -106,7 +106,7 @@ namespace System.IO.Compression
/// <returns>A valid ZipStorer object</returns> /// <returns>A valid ZipStorer object</returns>
public static ZipExtractor Open(string _filename) 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); ZipExtractor zip = Open(stream);
return zip; return zip;
} }

View File

@ -1,7 +1,3 @@
using System;
namespace ComponentAce.Compression.Libs.zlib namespace ComponentAce.Compression.Libs.zlib
{ {
public class SupportClass public class SupportClass

View File

@ -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) * Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu)
* and contributors of zlib. * and contributors of zlib.
*/ */
using System;
namespace ComponentAce.Compression.Libs.zlib namespace ComponentAce.Compression.Libs.zlib
{ {

View File

@ -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) * Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu)
* and contributors of zlib. * and contributors of zlib.
*/ */
using System;
namespace ComponentAce.Compression.Libs.zlib namespace ComponentAce.Compression.Libs.zlib
{ {

View File

@ -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) * Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu)
* and contributors of zlib. * and contributors of zlib.
*/ */
using System;
namespace ComponentAce.Compression.Libs.zlib namespace ComponentAce.Compression.Libs.zlib
{ {

View File

@ -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) * Jean-loup Gailly(jloup@gzip.org) and Mark Adler(madler@alumni.caltech.edu)
* and contributors of zlib. * and contributors of zlib.
*/ */
using System;
namespace ComponentAce.Compression.Libs.zlib namespace ComponentAce.Compression.Libs.zlib
{ {

View File

@ -1,6 +1,5 @@
using Nikse.SubtitleEdit.Forms; using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.VisualStudio.TestTools.UnitTesting; using Nikse.SubtitleEdit.Forms;
using System;
namespace Test namespace Test
{ {