private void Player_TimeOriginChanged(object sender, EventArgs e) { if (!active || !synching) { return; } PlayerScreen player = sender as PlayerScreen; if (player == null) { return; } // Reinit synchronization. commonTimeline.Initialize(players[0], players[1]); currentTime = commonTimeline.GetCommonTime(player, player.LocalTime); view.SetupTrkFrame(0, commonTimeline.LastTime, currentTime); view.UpdateSyncPosition(currentTime); UpdateHairLines(); }
private void Player_HighSpeedFactorChanged(object sender, EventArgs e) { if (!active || !synching) { return; } if (PreferencesManager.PlayerPreferences.SyncLockSpeed) { double percentage = Math.Min(players[0].RealtimePercentage, players[1].RealtimePercentage); players[0].RealtimePercentage = percentage; players[1].RealtimePercentage = percentage; } // Synchronization must be reinitialized. commonTimeline.Initialize(players[0], players[0].LocalSyncTime, players[1], players[1].LocalSyncTime); // TODO: Check if current time is still in bounds. currentTime = Math.Min(currentTime, commonTimeline.GetCommonTime(players[0], players[0].LocalTime)); view.SetupTrkFrame(0, commonTimeline.LastTime, currentTime); view.UpdateSyncPosition(currentTime); }