C# Class SubLib.Core.Timing.SyncUtil

ファイルを表示 Open project: GNOME/gnome-subtitles Class Usage Examples

Public Methods

Method Description
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.

Private Methods

Method Description
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

Method Details

AreSyncPointsValid() public static method

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
return bool

Scale() public static method

public static Scale ( System.TimeSpan currentTime, System.TimeSpan baseTime, double factor ) : System.TimeSpan
currentTime System.TimeSpan
baseTime System.TimeSpan
factor double
return System.TimeSpan

Scale() public static method

public static Scale ( double currentFrame, double baseFrame, double factor ) : double
currentFrame double
baseFrame double
factor double
return double

Sync() public static method

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
return bool

Sync() public static method

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.
return bool

Sync() public static method

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.
return bool