public TimeStampPacket(TimeStamp timeStamp) { this.TimeStamp = timeStamp; }
/// <summary> /// Sets the Player's current position to that of the TimeStampPacket, /// if the following is true: /// - The delay is >= the maximum legal delay /// - The Player isn't stopped /// </summary> /// <param name="timeStampPacket"></param> private void HandleTimeStampPacket(TimeStampPacket timeStampPacket) { #region If the Player isn't stopped, Sync the host time and the watcher's time (if delay is illegal) if (CurrentPlayState != PlayState.STOP) { TimeStamp hostTime = timeStampPacket.TimeStamp; TimeStamp watchTime = new TimeStamp(Player.Ctlcontrols.currentPositionString); if (Math.Abs(hostTime.TotalSeconds - watchTime.TotalSeconds) >= MaxDelay) { Player.Ctlcontrols.currentPosition = hostTime.TotalSeconds; } } #endregion }