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();
            }
        }
Exemple #2
0
        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();
            }
        }