C# Класс SubLib.Core.Timing.SyncUtil

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
AreSyncPointsValid ( Subtitles subtitles, SyncPoint start, SyncPoint end ) : bool
Scale ( System.TimeSpan currentTime, System.TimeSpan baseTime, double factor ) : System.TimeSpan
Scale ( double currentFrame, double baseFrame, double factor ) : double
Sync ( Subtitles subtitles, SyncPoint start, SyncPoint end, bool syncLast ) : bool
Sync ( Subtitles subtitles, int startIndex, System.TimeSpan startTime, int endIndex, System.TimeSpan endTime, bool syncLast ) : bool

Auto syncs a range of subtitles given their first and last correct times.

The subtitles are first shifted to the first subtitle's correct time, and then proportionally adjusted using the last subtitle's correct time.

Sync ( Subtitles subtitles, int startIndex, int startFrame, int endIndex, int endFrame, bool syncLast ) : bool

Auto syncs a range of subtitles given their first and last correct frames.

The subtitles are first shifted to the first subtitle's correct frame, and then proportionally adjusted using the last subtitle's correct frame.

Приватные методы

Метод Описание
AreSyncArgsValid ( Subtitles subtitles, int startIndex, System.TimeSpan startTime, int endIndex, System.TimeSpan endTime ) : bool
AreSyncArgsValid ( Subtitles subtitles, int startIndex, int startTime, int endIndex, int endTime ) : bool
AreSyncIndicesValid ( Subtitles subtitles, int startIndex, int endIndex ) : bool

Описание методов

AreSyncPointsValid() публичный статический Метод

public static AreSyncPointsValid ( Subtitles subtitles, SyncPoint start, SyncPoint end ) : bool
subtitles SubLib.Core.Domain.Subtitles
start SubLib.Core.Domain.SyncPoint
end SubLib.Core.Domain.SyncPoint
Результат bool

Scale() публичный статический Метод

public static Scale ( System.TimeSpan currentTime, System.TimeSpan baseTime, double factor ) : System.TimeSpan
currentTime System.TimeSpan
baseTime System.TimeSpan
factor double
Результат System.TimeSpan

Scale() публичный статический Метод

public static Scale ( double currentFrame, double baseFrame, double factor ) : double
currentFrame double
baseFrame double
factor double
Результат double

Sync() публичный статический Метод

public static Sync ( Subtitles subtitles, SyncPoint start, SyncPoint end, bool syncLast ) : bool
subtitles SubLib.Core.Domain.Subtitles
start SubLib.Core.Domain.SyncPoint
end SubLib.Core.Domain.SyncPoint
syncLast bool
Результат bool

Sync() публичный статический Метод

Auto syncs a range of subtitles given their first and last correct times.
The subtitles are first shifted to the first subtitle's correct time, and then proportionally adjusted using the last subtitle's correct time.
public static Sync ( Subtitles subtitles, int startIndex, System.TimeSpan startTime, int endIndex, System.TimeSpan endTime, bool syncLast ) : bool
subtitles SubLib.Core.Domain.Subtitles The subtitles to sync.
startIndex int The subtitle index to start the adjustment with.
startTime System.TimeSpan The correct start time for the first subtitle.
endIndex int The subtitle index to end the adjustment with.
endTime System.TimeSpan The correct start time for the last subtitle.
syncLast bool Whether to sync the last subtitle.
Результат bool

Sync() публичный статический Метод

Auto syncs a range of subtitles given their first and last correct frames.
The subtitles are first shifted to the first subtitle's correct frame, and then proportionally adjusted using the last subtitle's correct frame.
public static Sync ( Subtitles subtitles, int startIndex, int startFrame, int endIndex, int endFrame, bool syncLast ) : bool
subtitles SubLib.Core.Domain.Subtitles The subtitles to sync.
startIndex int The subtitle index to start the adjustment with.
startFrame int The correct start frame for the first subtitle.
endIndex int The subtitle index to end the adjustment with.
endFrame int The correct start frame for the last subtitle.
syncLast bool Whether to sync the last subtitle.
Результат bool