mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-10-27 22:42:38 +01:00
remove trailing whitespace
git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@1013 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
parent
ad6f6cf1e3
commit
1ba3e38e9d
@ -372,7 +372,7 @@ namespace Nikse.SubtitleEdit.Controls
|
||||
}
|
||||
|
||||
public void SelectIndexAndEnsureVisible(int index)
|
||||
{
|
||||
{
|
||||
if (index < 0 || index >= Items.Count || Items.Count == 0)
|
||||
return;
|
||||
|
||||
@ -389,7 +389,7 @@ namespace Nikse.SubtitleEdit.Controls
|
||||
if (afterIndex >= Items.Count)
|
||||
afterIndex = Items.Count - 1;
|
||||
|
||||
SelectNone();
|
||||
SelectNone();
|
||||
if (TopItem.Index <= beforeIndex && bottomIndex > afterIndex)
|
||||
{
|
||||
Items[index].Selected = true;
|
||||
@ -403,7 +403,7 @@ namespace Nikse.SubtitleEdit.Controls
|
||||
EnsureVisible(afterIndex);
|
||||
Items[index].Selected = true;
|
||||
Items[index].EnsureVisible();
|
||||
}
|
||||
}
|
||||
|
||||
public void SelectIndexAndEnsureVisible(Paragraph p)
|
||||
{
|
||||
|
@ -690,7 +690,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
if (IfoParser.ArrayOfLanguageCode[i] == languageCode)
|
||||
comboBoxLanguage.SelectedIndex = i;
|
||||
}
|
||||
comboBoxLanguage.SelectedIndex = 25;
|
||||
comboBoxLanguage.SelectedIndex = 25;
|
||||
}
|
||||
comboBoxImageFormat.Visible = exportType == "FAB";
|
||||
labelImageFormat.Visible = exportType == "FAB";
|
||||
|
@ -925,7 +925,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
p.Text = p.Text.Trim();
|
||||
p.Text = p.Text.Replace(Environment.NewLine + " ", Environment.NewLine);
|
||||
|
||||
|
||||
|
||||
if (p.Text.Contains("- ") && p.Text.Length > 5)
|
||||
{
|
||||
int idx = p.Text.IndexOf("- ", 2);
|
||||
|
@ -121,7 +121,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
Keys _mainMergeDialogue = Keys.None;
|
||||
Keys _mainGoToNext = Keys.None;
|
||||
Keys _mainGoToPrevious = Keys.None;
|
||||
Keys _mainToggleFocus = Keys.None;
|
||||
Keys _mainToggleFocus = Keys.None;
|
||||
Keys _mainListViewToggleDashes = Keys.None;
|
||||
Keys _waveformVerticalZoom = Keys.None;
|
||||
Keys _waveformZoomIn = Keys.None;
|
||||
@ -671,7 +671,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
toolStripMenuItemWaveFormPlaySelection.Visible = false;
|
||||
toolStripSeparator24.Visible = false;
|
||||
contextMenuStripWaveForm.Show(MousePosition.X, MousePosition.Y);
|
||||
}
|
||||
}
|
||||
|
||||
void AudioWaveForm_OnDoubleClickNonParagraph(double seconds, Paragraph paragraph)
|
||||
{
|
||||
@ -1087,7 +1087,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
textCharssecToolStripMenuItem.Visible = false;
|
||||
}
|
||||
|
||||
|
||||
toolStripMenuItemShowOriginalInPreview.Text = _language.Menu.Tools.ShowOriginalTextInAudioAndVideoPreview;
|
||||
toolStripMenuItemMakeEmptyFromCurrent.Text = _language.Menu.Tools.MakeNewEmptyTranslationFromCurrentSubtitle;
|
||||
splitToolStripMenuItem.Text = _language.Menu.Tools.SplitSubtitle;
|
||||
@ -2384,7 +2384,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
}
|
||||
}
|
||||
textBoxSource.TextChanged -= TextBoxSourceTextChanged;
|
||||
textBoxSource.Text = string.Empty;
|
||||
textBoxSource.Text = string.Empty;
|
||||
textBoxSource.TextChanged += TextBoxSourceTextChanged;
|
||||
}
|
||||
|
||||
@ -4942,7 +4942,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
UpdateListSyntaxColoring();
|
||||
FixVerticalScrollBars(textBoxListViewTextAlternate);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void TextBoxListViewTextKeyDown(object sender, KeyEventArgs e)
|
||||
|
@ -911,7 +911,7 @@ namespace Nikse.SubtitleEdit.Logic.OCR
|
||||
input = input.Replace(",...", "...");
|
||||
|
||||
if (input.StartsWith("..") && !input.StartsWith("..."))
|
||||
input = "." + input;
|
||||
input = "." + input;
|
||||
|
||||
string pre = string.Empty;
|
||||
if (input.StartsWith("- "))
|
||||
|
@ -58,7 +58,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
private string EncodeTimeCode(TimeCode time)
|
||||
{
|
||||
//00:50:39:13 (last is frame)
|
||||
int frames = MillisecondsToFrames(time.Milliseconds);
|
||||
int frames = MillisecondsToFrames(time.Milliseconds);
|
||||
return string.Format("{0:00}:{1:00}:{2:00}:{3:00}", time.Hours, time.Minutes, time.Seconds, frames);
|
||||
}
|
||||
|
||||
|
@ -589,7 +589,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
}
|
||||
return sb.ToString().Trim();
|
||||
}
|
||||
return text;
|
||||
return text;
|
||||
}
|
||||
|
||||
public override string ToText(Subtitle subtitle, string title)
|
||||
@ -717,12 +717,12 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
|
||||
private string ToTimeCode(double totalMilliseconds)
|
||||
{
|
||||
TimeSpan ts = TimeSpan.FromMilliseconds(totalMilliseconds);
|
||||
TimeSpan ts = TimeSpan.FromMilliseconds(totalMilliseconds);
|
||||
return string.Format("{0:00}:{1:00}:{2:00}:{3:00}", ts.Hours, ts.Minutes, ts.Seconds, MillisecondsToFrames(ts.Milliseconds));
|
||||
}
|
||||
|
||||
private SCCPositionAndStyle GetColorAndPosition(string code)
|
||||
{
|
||||
{
|
||||
switch (code.ToLower())
|
||||
{
|
||||
case "91d0": return new SCCPositionAndStyle(Color.White, FontStyle.Regular, 1, 0);
|
||||
@ -770,7 +770,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
case "92cb": return new SCCPositionAndStyle(Color.Yellow, FontStyle.Underline, 3, 0);
|
||||
case "924c": return new SCCPositionAndStyle(Color.Magenta, FontStyle.Regular, 3, 0);
|
||||
case "92cd": return new SCCPositionAndStyle(Color.Magenta, FontStyle.Underline, 3, 0);
|
||||
|
||||
|
||||
case "9270": return new SCCPositionAndStyle(Color.White, FontStyle.Regular, 4, 0);
|
||||
case "92f1": return new SCCPositionAndStyle(Color.White, FontStyle.Underline, 4, 0);
|
||||
case "9262": return new SCCPositionAndStyle(Color.Green, FontStyle.Regular, 4, 0);
|
||||
@ -832,7 +832,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
case "16cb": return new SCCPositionAndStyle(Color.Yellow, FontStyle.Underline, 7, 0);
|
||||
case "164c": return new SCCPositionAndStyle(Color.Magenta, FontStyle.Regular, 7, 0);
|
||||
case "16cd": return new SCCPositionAndStyle(Color.Magenta, FontStyle.Underline, 7, 0);
|
||||
|
||||
|
||||
case "1670": return new SCCPositionAndStyle(Color.White, FontStyle.Regular, 8, 0);
|
||||
case "16f1": return new SCCPositionAndStyle(Color.White, FontStyle.Underline, 8, 0);
|
||||
case "1662": return new SCCPositionAndStyle(Color.Green, FontStyle.Regular, 8, 0);
|
||||
@ -863,7 +863,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
case "97cb": return new SCCPositionAndStyle(Color.Yellow, FontStyle.Underline, 9, 0);
|
||||
case "974c": return new SCCPositionAndStyle(Color.Magenta, FontStyle.Regular, 9, 0);
|
||||
case "97cd": return new SCCPositionAndStyle(Color.Magenta, FontStyle.Underline, 9, 0);
|
||||
|
||||
|
||||
case "9770": return new SCCPositionAndStyle(Color.White, FontStyle.Regular, 10, 0);
|
||||
case "97f1": return new SCCPositionAndStyle(Color.White, FontStyle.Underline, 10, 0);
|
||||
case "9762": return new SCCPositionAndStyle(Color.Green, FontStyle.Regular, 10, 0);
|
||||
@ -910,7 +910,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
case "13cb": return new SCCPositionAndStyle(Color.Yellow, FontStyle.Underline, 12, 0);
|
||||
case "134c": return new SCCPositionAndStyle(Color.Magenta, FontStyle.Regular, 12, 0);
|
||||
case "13cd": return new SCCPositionAndStyle(Color.Magenta, FontStyle.Underline, 12, 0);
|
||||
|
||||
|
||||
case "1370": return new SCCPositionAndStyle(Color.White, FontStyle.Regular, 13, 0);
|
||||
case "13f1": return new SCCPositionAndStyle(Color.White, FontStyle.Underline, 13, 0);
|
||||
case "1362": return new SCCPositionAndStyle(Color.Green, FontStyle.Regular, 13, 0);
|
||||
@ -941,7 +941,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
case "94cb": return new SCCPositionAndStyle(Color.Yellow, FontStyle.Underline, 14, 0);
|
||||
case "944c": return new SCCPositionAndStyle(Color.Magenta, FontStyle.Regular, 14, 0);
|
||||
case "94cd": return new SCCPositionAndStyle(Color.Magenta, FontStyle.Underline, 14, 0);
|
||||
|
||||
|
||||
case "9470": return new SCCPositionAndStyle(Color.White, FontStyle.Regular, 15, 0);
|
||||
case "94f1": return new SCCPositionAndStyle(Color.White, FontStyle.Underline, 15, 0);
|
||||
case "9462": return new SCCPositionAndStyle(Color.Green, FontStyle.Regular, 15, 0);
|
||||
@ -1194,11 +1194,11 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
case "947f": return new SCCPositionAndStyle(Color.Transparent, FontStyle.Underline, 15, 28);
|
||||
|
||||
|
||||
// mid-row commands
|
||||
// mid-row commands
|
||||
case "9120": return new SCCPositionAndStyle(Color.White, FontStyle.Regular, -1, -1);
|
||||
case "91a1": return new SCCPositionAndStyle(Color.White, FontStyle.Underline, -1, -1);
|
||||
case "91a2": return new SCCPositionAndStyle(Color.Green, FontStyle.Regular, -1, -1);
|
||||
case "9123": return new SCCPositionAndStyle(Color.Green, FontStyle.Underline, -1, -1);
|
||||
case "9123": return new SCCPositionAndStyle(Color.Green, FontStyle.Underline, -1, -1);
|
||||
case "91a4": return new SCCPositionAndStyle(Color.Blue, FontStyle.Regular, -1, -1);
|
||||
case "9125": return new SCCPositionAndStyle(Color.Blue, FontStyle.Underline, -1, -1);
|
||||
case "9126": return new SCCPositionAndStyle(Color.Cyan, FontStyle.Regular, -1, -1);
|
||||
@ -1215,7 +1215,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
|
||||
case "94a8": return new SCCPositionAndStyle(Color.Transparent, FontStyle.Regular, -1, -1); // turn flash on
|
||||
}
|
||||
return null;
|
||||
return null;
|
||||
}
|
||||
|
||||
public override void LoadSubtitle(Subtitle subtitle, List<string> lines, string fileName)
|
||||
@ -1301,7 +1301,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
sb.AppendLine();
|
||||
}
|
||||
else if (part == "2c94"|| part == "2c52")
|
||||
{
|
||||
{
|
||||
}
|
||||
else if (result == null)
|
||||
{
|
||||
|
@ -13,7 +13,7 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers
|
||||
private bool _paused;
|
||||
private bool _loaded = false;
|
||||
private bool _ended = false;
|
||||
private string _videoFileName;
|
||||
private string _videoFileName;
|
||||
private bool _waitForChange = false;
|
||||
public int Width { get; private set; }
|
||||
public int Height { get; private set; }
|
||||
@ -21,7 +21,7 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers
|
||||
public string VideoFormat { get; private set; }
|
||||
public string VideoCodec { get; private set; }
|
||||
private double? _pausePosition = null; // Hack to hold precise seeking when paused
|
||||
private int _pauseCounts = 0;
|
||||
private int _pauseCounts = 0;
|
||||
private double _speed = 1.0;
|
||||
|
||||
public override string PlayerName
|
||||
@ -92,17 +92,17 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers
|
||||
|
||||
public override void Play()
|
||||
{
|
||||
_mplayer.StandardInput.WriteLine("pause");
|
||||
_pauseCounts = 0;
|
||||
_mplayer.StandardInput.WriteLine("pause");
|
||||
_pauseCounts = 0;
|
||||
_paused = false;
|
||||
_pausePosition = null;
|
||||
}
|
||||
|
||||
public override void Pause()
|
||||
{
|
||||
if (!_paused)
|
||||
_mplayer.StandardInput.WriteLine("pause");
|
||||
_pauseCounts = 0;
|
||||
if (!_paused)
|
||||
_mplayer.StandardInput.WriteLine("pause");
|
||||
_pauseCounts = 0;
|
||||
_paused = true;
|
||||
}
|
||||
|
||||
@ -110,8 +110,8 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers
|
||||
{
|
||||
CurrentPosition = 0;
|
||||
Pause();
|
||||
_mplayer.StandardInput.WriteLine(string.Format("pausing_keep_force seek 0 2", 0));
|
||||
_pauseCounts = 0;
|
||||
_mplayer.StandardInput.WriteLine(string.Format("pausing_keep_force seek 0 2", 0));
|
||||
_pauseCounts = 0;
|
||||
_paused = true;
|
||||
_lastLengthInSeconds = _lengthInSeconds;
|
||||
_pausePosition = null;
|
||||
@ -130,7 +130,7 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers
|
||||
public override void Initialize(System.Windows.Forms.Control ownerControl, string videoFileName, EventHandler onVideoLoaded, EventHandler onVideoEnded)
|
||||
{
|
||||
_loaded = false;
|
||||
_videoFileName = videoFileName;
|
||||
_videoFileName = videoFileName;
|
||||
string mplayerExeName = GetMPlayerFileName;
|
||||
if (!string.IsNullOrEmpty(mplayerExeName))
|
||||
{
|
||||
@ -190,7 +190,7 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers
|
||||
_mplayer.StandardInput.WriteLine("pausing_keep_force get_property pause");
|
||||
|
||||
if (!_ended && OnVideoEnded != null && _lengthInSeconds.TotalSeconds == Duration)
|
||||
{
|
||||
{
|
||||
// _ended = true;
|
||||
// OnVideoEnded.Invoke(this, null);
|
||||
}
|
||||
@ -221,23 +221,23 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers
|
||||
System.Diagnostics.Debug.WriteLine("MPlayer: " + e.Data);
|
||||
|
||||
if (e.Data.StartsWith("Playing "))
|
||||
{
|
||||
{
|
||||
_loaded = true;
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (e.Data.StartsWith("Exiting..."))
|
||||
{
|
||||
_ended = true;
|
||||
if (_loaded)
|
||||
{
|
||||
_mplayer.StandardInput.WriteLine("loadfile " + _videoFileName);
|
||||
if (OnVideoEnded != null)
|
||||
OnVideoEnded.Invoke(this, null);
|
||||
|
||||
}
|
||||
return;
|
||||
}
|
||||
{
|
||||
_ended = true;
|
||||
if (_loaded)
|
||||
{
|
||||
_mplayer.StandardInput.WriteLine("loadfile " + _videoFileName);
|
||||
if (OnVideoEnded != null)
|
||||
OnVideoEnded.Invoke(this, null);
|
||||
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
int indexOfEqual = e.Data.IndexOf("=");
|
||||
if (indexOfEqual > 0 && indexOfEqual + 1 < e.Data.Length && e.Data.StartsWith("ANS_"))
|
||||
@ -275,19 +275,19 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers
|
||||
_volume = (float)Convert.ToDouble(value);
|
||||
break;
|
||||
case "ANS_pause":
|
||||
if (value == "yes" || value == "1")
|
||||
_pauseCounts++;
|
||||
else
|
||||
_pauseCounts--;
|
||||
if (_pauseCounts > 3)
|
||||
_paused = true;
|
||||
else if (_pauseCounts < -3)
|
||||
{
|
||||
_paused = false;
|
||||
_pausePosition = null;
|
||||
}
|
||||
else if (Math.Abs(_pauseCounts) > 10)
|
||||
_pauseCounts = 0;
|
||||
if (value == "yes" || value == "1")
|
||||
_pauseCounts++;
|
||||
else
|
||||
_pauseCounts--;
|
||||
if (_pauseCounts > 3)
|
||||
_paused = true;
|
||||
else if (_pauseCounts < -3)
|
||||
{
|
||||
_paused = false;
|
||||
_pausePosition = null;
|
||||
}
|
||||
else if (Math.Abs(_pauseCounts) > 10)
|
||||
_pauseCounts = 0;
|
||||
break;
|
||||
}
|
||||
_waitForChange = false;
|
||||
|
Loading…
Reference in New Issue
Block a user