public static Sync ( |
||
subtitles | ||
start | ||
end | ||
syncLast | bool | |
return | bool |
/* Public members */ public bool Sync (SyncPoints syncPoints, bool toSyncAll) { SyncPoints pointsToUse = AdaptForOperation(syncPoints, toSyncAll); if (!AreSyncArgsValid(pointsToUse)) { return false; } SyncPoint previous = pointsToUse[0]; for (int index = 1 ; index < pointsToUse.Count ; index++) { bool syncLast = (index == pointsToUse.Count - 1); SyncPoint current = pointsToUse[index]; SyncUtil.Sync(subtitles, previous, current, syncLast); previous = current; } return true; }
/// <summary>Auto adjusts a range of subtitles given their first and last correct frames.</summary> /// <remarks>The subtitles are first shifted to the first subtitle's correct frame, and then proportionally /// adjusted using the last subtitle's correct frame.</remarks> /// <param name="startIndex">The subtitle index to start the adjustment with.</param> /// <param name="startFrame">The correct start frame for the first subtitle.</param> /// <param name="endIndex">The subtitle index to end the adjustment with.</param> /// <param name="endFrame">The correct start frame for the last subtitle.</param> /// <returns>Whether the subtitles could be adjusted.</returns> public bool Adjust(int startIndex, int startFrame, int endIndex, int endFrame) { return(SyncUtil.Sync(subtitles, startIndex, startFrame, endIndex, endFrame, true)); }
/// <summary>Auto adjusts a range of subtitles given their first and last correct times.</summary> /// <remarks>The subtitles are first shifted to the first subtitle's correct time, and then proportionally /// adjusted using the last subtitle's correct time.</remarks> /// <param name="startIndex">The subtitle index to start the adjustment with.</param> /// <param name="startTime">The correct start time for the first subtitle.</param> /// <param name="endIndex">The subtitle index to end the adjustment with.</param> /// <param name="endTime">The correct start time for the last subtitle.</param> /// <returns>Whether the subtitles could be adjusted.</returns> public bool Adjust(int startIndex, TimeSpan startTime, int endIndex, TimeSpan endTime) { return(SyncUtil.Sync(subtitles, startIndex, startTime, endIndex, endTime, true)); }