working on new sub format

This commit is contained in:
niksedk 2015-07-30 15:35:24 +02:00
parent bc1653f582
commit 27fb069d80

View File

@ -183,6 +183,11 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
} }
NumberOfDialogPresentationSegments = (buffer[idx] << 8) + buffer[idx + 1]; NumberOfDialogPresentationSegments = (buffer[idx] << 8) + buffer[idx + 1];
} }
public void WriteToStream(Stream stream)
{
}
} }
public class SubtitleRegion public class SubtitleRegion
@ -195,6 +200,14 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
public class DialogPresentationSegment public class DialogPresentationSegment
{ {
public int Length { get; set; }
public UInt64 StartPts { get; set; }
public UInt64 EndPts { get; set; }
public bool PaletteUpdate { get; set; }
public int NumberOfPaletteEntries { get; set; }
public List<SubtitleRegion> Regions { get; set; }
public DialogPresentationSegment(byte[] buffer) public DialogPresentationSegment(byte[] buffer)
{ {
StartPts = buffer[13]; StartPts = buffer[13];
@ -306,13 +319,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
Regions.Add(region); Regions.Add(region);
} }
} }
public int Length { get; set; }
public UInt64 StartPts { get; set; }
public UInt64 EndPts { get; set; }
public bool PaletteUpdate { get; set; }
public int NumberOfPaletteEntries { get; set; }
public List<SubtitleRegion> Regions { get; set; }
public string PlainText public string PlainText
{ {
get get
@ -333,11 +340,16 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
{ {
get { return (ulong)Math.Round((StartPts) / 90.0); } get { return (ulong)Math.Round((StartPts) / 90.0); }
} }
public ulong EndPtsMilliseconds public ulong EndPtsMilliseconds
{ {
get { return (ulong)Math.Round((EndPts) / 90.0); } get { return (ulong)Math.Round((EndPts) / 90.0); }
} }
public static void WriteToStream(Stream stream, string text, TimeCode start, TimeCode end, int regionStyleId, bool forced)
{
}
} }
public DialogStyleSegment StyleSegment; public DialogStyleSegment StyleSegment;
@ -417,7 +429,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
var tc = (m2TsTimeCodeBuffer[0] << 24) + (m2TsTimeCodeBuffer[1] << 16) + (m2TsTimeCodeBuffer[2] << 8) + (m2TsTimeCodeBuffer[3] & Helper.B00111111); var tc = (m2TsTimeCodeBuffer[0] << 24) + (m2TsTimeCodeBuffer[1] << 16) + (m2TsTimeCodeBuffer[2] << 8) + (m2TsTimeCodeBuffer[3] & Helper.B00111111);
// should m2ts time code be used in any way? // should m2ts time code be used in any way?
var msecs = (ulong)Math.Round((tc) / 27.0); // 27 or 90? var msecs = (ulong)Math.Round((tc) / 27.0); // 27 or 90?
TimeCode tc2 = new TimeCode(msecs); var tc2 = new TimeCode(msecs);
System.Diagnostics.Debug.WriteLine(tc2); System.Diagnostics.Debug.WriteLine(tc2);
position += m2TsTimeCodeBuffer.Length; position += m2TsTimeCodeBuffer.Length;
} }