mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-10-28 06:52:35 +01:00
remove trailing whitespace
git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@1186 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
parent
8d136715d1
commit
a7d2c9a656
@ -542,7 +542,7 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
public string WaveformPlaySelection { get; set; }
|
||||
public string WaveformSearchSilenceForward { get; set; }
|
||||
public string WaveformSearchSilenceBack { get; set; }
|
||||
public string WaveformAddTextHere { get; set; }
|
||||
public string WaveformAddTextHere { get; set; }
|
||||
|
||||
public Shortcuts()
|
||||
{
|
||||
|
@ -49,7 +49,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
|
||||
var fs = new FileStream(fileName, FileMode.Create, FileAccess.Write);
|
||||
fs.Write(buffer, 0, buffer.Length);
|
||||
|
||||
|
||||
p = null;
|
||||
for (int i=0; i<subtitle.Paragraphs.Count; i++)
|
||||
{
|
||||
@ -59,16 +59,16 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
WriteTime(fs, p.StartTime);
|
||||
|
||||
buffer = new byte[] { // styles 00 00 80 BF 00 00 00 C0 02 00 01 00
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0x80, //horizontal align, 0x80BF= center, 0x0000=left, 0x00c0=right
|
||||
0xBF,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0xBF,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0xC0, // vertical pos: C0=bottom, 0=top
|
||||
2, //justification, 1=left, 2=center
|
||||
0,
|
||||
0,
|
||||
1, //1=normal font, 3=italic
|
||||
0 };
|
||||
|
||||
@ -114,7 +114,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
text = text.Substring(0, 118);
|
||||
fs.WriteByte((byte)(text.Length));
|
||||
buffer = Encoding.GetEncoding(1252).GetBytes(text);
|
||||
fs.Write(buffer, 0, buffer.Length);
|
||||
fs.Write(buffer, 0, buffer.Length);
|
||||
|
||||
for (int j=0; j<74; j++)
|
||||
fs.WriteByte(0);
|
||||
@ -128,9 +128,9 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
}
|
||||
if (p != null)
|
||||
{
|
||||
WriteTime(fs, p.EndTime);
|
||||
buffer = new byte[] { 0, 0, 0x80, 0xBF, 0, 0, 0, 0xC0, 0x02, 0, 0x01, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x40, 0x40, 0x40, 0, 0xFF, 0xFF, 0xFF, 0, 0, 0, 0, 0, 0x80, 0x80, 0x80, 0, 0x01, 0, 0, 0, 0xFF, 0, 0, 0, 0x01, 0, 0, 0, 0x02, 0, 0, 0, 0x48, 0, 0, 0, 0x30, 0, 0, 0, 0x48, 0, 0, 0, 0x30, 0, 0, 0, 0x01, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
fs.Write(buffer, 0, buffer.Length);
|
||||
}
|
||||
fs.Close();
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
|
||||
buffer = Encoding.ASCII.GetBytes("00000617");
|
||||
fs.Write(buffer, 0, buffer.Length);
|
||||
|
||||
|
||||
buffer = Encoding.ASCII.GetBytes("00011818");
|
||||
fs.Write(buffer, 0, buffer.Length);
|
||||
|
||||
@ -182,9 +182,9 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
}
|
||||
}
|
||||
while (i < buffer.Length && buffer[i] != 0xa)
|
||||
i++;
|
||||
i++;
|
||||
i++;
|
||||
|
||||
|
||||
if (buffer[i] == 0xfe)
|
||||
{
|
||||
string endTime = Encoding.ASCII.GetString(buffer, i+ 4, 8);
|
||||
|
@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
@ -38,7 +38,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
int numberOfLines = subtitle.Paragraphs.Count;
|
||||
fs.WriteByte((byte)(numberOfLines % 256)); // paragraphs - low byte
|
||||
fs.WriteByte((byte)(numberOfLines / 256)); // paragraphs - high byte
|
||||
|
||||
|
||||
|
||||
buffer = new byte[] { 9, 0xA8, 0xAF, 0x4F }; // ?
|
||||
fs.Write(buffer, 0, buffer.Length);
|
||||
@ -52,8 +52,8 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
string text = p.Text.Replace(Environment.NewLine, "\0\0\0\0");
|
||||
|
||||
//styles + ?
|
||||
buffer = new byte[] {
|
||||
0x12,
|
||||
buffer = new byte[] {
|
||||
0x12,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
@ -107,7 +107,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
fs.WriteByte(0x62); // ?
|
||||
|
||||
WriteTime(fs, p.StartTime);
|
||||
WriteTime(fs, p.EndTime);
|
||||
WriteTime(fs, p.EndTime);
|
||||
|
||||
|
||||
fs.Write(buffer, 0, buffer.Length);
|
||||
|
@ -6,7 +6,7 @@ using System.Text.RegularExpressions;
|
||||
namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
{
|
||||
/// <summary>
|
||||
/// SoftNi - http://www.softni.com/
|
||||
/// SoftNi - http://www.softni.com/
|
||||
/// </summary>
|
||||
public class SoftNiSub : SubtitleFormat
|
||||
{
|
||||
|
@ -49,7 +49,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
|
||||
buffer = buffer = Encoding.ASCII.GetBytes("Subtitle Edit");
|
||||
fs.Write(buffer, 0, buffer.Length);
|
||||
|
||||
|
||||
while (fs.Length < 512)
|
||||
fs.WriteByte(0);
|
||||
|
||||
@ -66,7 +66,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
if (italic)
|
||||
{
|
||||
sb.Append(Convert.ToChar(0x11).ToString());
|
||||
sb.Append(Convert.ToChar(0x2E).ToString());
|
||||
sb.Append(Convert.ToChar(0x2E).ToString());
|
||||
}
|
||||
int y = 0x74 - (numberOfNewLines * 0x20);
|
||||
for (int j=0; j<text.Length; j++)
|
||||
@ -101,14 +101,14 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
|
||||
|
||||
// codes?
|
||||
buffer = new byte[] {
|
||||
buffer = new byte[] {
|
||||
0x14,
|
||||
0x20,
|
||||
0x20,
|
||||
0x14,
|
||||
0x2E,
|
||||
0x14,
|
||||
(byte)(0x74 - (numberOfNewLines * 0x20)),
|
||||
0x17,
|
||||
0x2E,
|
||||
0x14,
|
||||
(byte)(0x74 - (numberOfNewLines * 0x20)),
|
||||
0x17,
|
||||
0x21,
|
||||
};
|
||||
|
||||
@ -141,17 +141,17 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
//}
|
||||
|
||||
fs.WriteByte(0xF1); //ID of start record
|
||||
|
||||
|
||||
// length
|
||||
int length = text.Length + 15;
|
||||
fs.WriteByte((byte)(length));
|
||||
fs.WriteByte(0);
|
||||
fs.WriteByte((byte)(length));
|
||||
fs.WriteByte(0);
|
||||
|
||||
// start time
|
||||
WriteTime(fs, p.StartTime);
|
||||
fs.Write(buffer, 0, buffer.Length);
|
||||
|
||||
// text
|
||||
// text
|
||||
buffer = Encoding.ASCII.GetBytes(text);
|
||||
fs.Write(buffer, 0, buffer.Length); // Text starter på index 19 (0 baseret)
|
||||
fs.WriteByte(0x14);
|
||||
@ -160,7 +160,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
|
||||
// end time
|
||||
fs.WriteByte(0xF1); // id of start record
|
||||
fs.WriteByte(7); // length of end time
|
||||
fs.WriteByte(7); // length of end time
|
||||
fs.WriteByte(0);
|
||||
WriteTime(fs, p.EndTime);
|
||||
fs.WriteByte(0x14);
|
||||
@ -220,7 +220,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
Paragraph last = null;
|
||||
while (i < buffer.Length - 25)
|
||||
{
|
||||
var p = new Paragraph();
|
||||
var p = new Paragraph();
|
||||
int length = buffer[i+1];
|
||||
|
||||
p.StartTime = DecodeTimeStamp(buffer, i + 3);
|
||||
@ -229,14 +229,14 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
|
||||
if (length > 22)
|
||||
{
|
||||
int start = i + 7;
|
||||
int start = i + 7;
|
||||
var sb = new StringBuilder();
|
||||
int skipCount = 0;
|
||||
for (int k = start; k < length + i; k++)
|
||||
{
|
||||
byte b = buffer[k];
|
||||
if (skipCount > 0)
|
||||
{
|
||||
{
|
||||
skipCount--;
|
||||
}
|
||||
else if (b < 0x1F)
|
||||
@ -254,7 +254,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
||||
sb.Append(Convert.ToChar(b).ToString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
p.Text = sb.ToString();
|
||||
p.Text = p.Text.Replace(Environment.NewLine + Environment.NewLine, Environment.NewLine);
|
||||
p.Text = p.Text.Replace(Environment.NewLine + Environment.NewLine, Environment.NewLine);
|
||||
|
Loading…
Reference in New Issue
Block a user