Beispiel #1
0
        private void sldViewPort_OnValueChanged(object sender, RoutedPropertyChangedEventArgs <double> e)
        {
            Slider slider = (Slider)sender;

            timePanel.ViewPort = TimeSpan.FromSeconds(slider.Value);
            timePanel.Offset   = VideoPlayer.GetPosition() - timePanel.ViewPort.Divide(2);
        }
Beispiel #2
0
        private void btnAddBeat_Click(object sender, RoutedEventArgs e)
        {
            BeatContainer container = new BeatContainer();

            TimePanel.SetPosition(container, VideoPlayer.GetPosition());
            TimePanel.SetDuration(container, TimeSpan.FromSeconds(1));
            timePanel.Children.Add(container);
        }
Beispiel #3
0
        private void MainWindow_OnPreviewKeyDown(object sender, KeyEventArgs e)
        {
            bool handled = true;

            switch (e.Key)
            {
            case Key.Enter:
            {
                ToggleFullscreen();
                break;
            }

            case Key.Escape:
            {
                SetFullscreen(false);
                break;
            }

            case Key.Space:
            {
                TogglePlayback();
                break;
            }

            case Key.Left:
            {
                VideoPlayer.SetPosition(VideoPlayer.GetPosition() - TimeSpan.FromSeconds(5));
                ShowPosition();
                break;
            }

            case Key.Right:
            {
                VideoPlayer.SetPosition(VideoPlayer.GetPosition() + TimeSpan.FromSeconds(5));
                ShowPosition();
                break;
            }

            case Key.NumPad0:
            {
                break;
            }

            case Key.NumPad1:
            {
                VideoPlayer.ChangeZoom(-0.02);
                break;
            }

            case Key.NumPad2:
            {
                VideoPlayer.Move(new Point(0, 1));
                break;
            }

            case Key.NumPad3:
            {
                break;
            }

            case Key.NumPad4:
            {
                VideoPlayer.Move(new Point(-1, 0));
                break;
            }

            case Key.NumPad5:
            {
                VideoPlayer.ResetTransform();
                break;
            }

            case Key.NumPad6:
            {
                VideoPlayer.Move(new Point(1, 0));
                break;
            }

            case Key.NumPad7:
            {
                break;
            }

            case Key.NumPad8:
            {
                VideoPlayer.Move(new Point(0, -1));
                break;
            }

            case Key.NumPad9:
                VideoPlayer.ChangeZoom(0.02);
                {
                    break;
                }

            default:
            {
                handled = false;
                break;
            }
            }

            e.Handled = handled;
        }