/// <inheritdoc/> public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { try { if (value is long longValue) { return(StringsHelper.MillisecondsToString(longValue)); } else if (value is TimeSpan timeSpan) { return(StringsHelper.MillisecondsToString((long)timeSpan.TotalMilliseconds)); } return(string.Empty); } catch (Exception ex) { return(string.Empty); } }
private void PlaceholderInteractionGrid_OnManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e) { if (isLocked) { return; } var cumulativeTranslationX = e.Cumulative.Translation.X; switch (currentGestureActionType) { case GestureActionType.Null: break; case GestureActionType.Volume: GestureTextBlockDescription.Text = Strings.Volume + " " + computeVolumeFromGesture(e.Cumulative) + "%"; break; case GestureActionType.Brightness: break; case GestureActionType.Seek: var seekInSeconds = Math.Floor(cumulativeTranslationX / 10); GestureTextBlockDescription.Text = StringsHelper.SecondsToString(seekInSeconds) + " (" + StringsHelper.MillisecondsToString(Locator.MediaPlaybackViewModel.Time) + ")"; break; default: throw new ArgumentOutOfRangeException(); } }
private void PlaceholderInteractionGrid_OnManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e) { if (isLocked) { return; } var cumulativeTranslationX = e.Cumulative.Translation.X; switch (currentGestureActionType) { case GestureActionType.Null: break; case GestureActionType.Volume: GestureTextBlockDescription.Text = Strings.Volume + " " + computeVolumeFromGesture(e.Cumulative) + "%"; break; case GestureActionType.Brightness: break; case GestureActionType.Seek: var seekInSeconds = Math.Floor(cumulativeTranslationX / 10); GestureTextBlockDescription.Text = StringsHelper.SecondsToString(seekInSeconds) + " (" + StringsHelper.MillisecondsToString(Locator.MediaPlaybackViewModel.Time) + ")"; break; case GestureActionType.Exlore3D: var scale = Math.Abs(e.Cumulative.Scale); if (scale > 1 || scale < 1) { _playbackService.UpdateViewpoint(new VideoViewpoint(0, 0, 0, scale < 1 ? 0.5f : -0.5f), false); } else { var yaw = (float)(DEFAULT_FOV * -e.Cumulative.Translation.X / App.RootPage.SwapChainPanel.ActualWidth) / DIVIDER; var pitch = (float)(DEFAULT_FOV * -e.Cumulative.Translation.Y / App.RootPage.SwapChainPanel.ActualHeight) / DIVIDER; var viewpoint = new VideoViewpoint(yaw, pitch, 0, 0); _playbackService.UpdateViewpoint(viewpoint, false); } break; default: throw new ArgumentOutOfRangeException(); } }
public object Convert(object value, Type targetType, object parameter, string language) { return(StringsHelper.MillisecondsToString((long)value)); }