private void Me_MediaOpened(object sender, MediaOpenedEventArgs e)
        {
            TimeSpan?duration = me.NaturalDuration;

            sld.Maximum      = duration.HasValue ? duration.Value.TotalMilliseconds : 0;
            tblDuration.Text = FomratTimeSpan(duration.GetValueOrDefault());
            tblPosition.Text = FomratTimeSpan(me.Position);

            gidSlider.Visibility = Visibility.Visible;
        }
예제 #2
0
        private void Media_MediaOpened(object sender, MediaOpenedEventArgs e)
        {
            var appState = this.ServiceProvider.GetRequiredService <AppState>();

            appState.Project.ProjectData.CursorMs          = (long)this.Media.Position.TotalMilliseconds;
            appState.Project.ProjectData.ViewMs.MaxStartMs = 0;
            appState.Project.ProjectData.ViewMs.MaxEndMs   = (long)this.Media.NaturalDuration.Value.TotalMilliseconds;
            appState.Project.ProjectData.ViewMs.StartMs    = 0;
            appState.Project.ProjectData.ViewMs.EndMs      = (long)this.Media.NaturalDuration.Value.TotalMilliseconds;
        }
예제 #3
0
        private void Media_MediaOpened(object sender, MediaOpenedEventArgs e)
        {
            var projectData = this.ServiceProvider.GetRequiredService <IVideoPlayerProjectData>();

            projectData.CursorMs = (long)this.Media.Position.TotalMilliseconds;
            var timelineProjectData = this.ServiceProvider.GetRequiredService <ITimelineProjectData>();

            timelineProjectData.ViewMs.MaxStartMs = 0;
            timelineProjectData.ViewMs.MaxEndMs   = (long)this.Media.NaturalDuration.Value.TotalMilliseconds;
            timelineProjectData.ViewMs.StartMs    = 0;
            timelineProjectData.ViewMs.EndMs      = (long)this.Media.NaturalDuration.Value.TotalMilliseconds;
        }
예제 #4
0
        private async void Player_MediaOpened(object sender, MediaOpenedEventArgs e)
        {
            ViewModel.MainWindow.textBoxLoopStart.IsEnabled     = true;
            ViewModel.MainWindow.textBoxLoopEnd.IsEnabled       = true;
            ViewModel.MainWindow.toggleSwitchLoopTime.IsEnabled = true;
            sliderProgress.IsEnabled = true;

            await ViewModel.Play();

            ViewModel.position     = player.NaturalDuration.Value;
            sliderProgress.Minimum = 0;
            sliderProgress.Maximum = ViewModel.position.TotalSeconds;

            ViewModel.EnablePlayPause();
            ViewModel.EnableStop();

            ViewModel.ProgressTimer.Start();
        }
예제 #5
0
 /// <summary>
 /// Handles the media changed event.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The <see cref="MediaOpenedEventArgs"/> instance containing the event data.</param>
 private void OnMediaChanged(object sender, MediaOpenedEventArgs e)
 {
     ViewModel.NotificationMessage = "Media updated.";
 }
예제 #6
0
 /// <summary>
 /// Handles the MediaOpened event of the Media control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
 private void OnMediaOpened(object sender, MediaOpenedEventArgs e)
 {
     // This will fire when the media has opened.
 }
예제 #7
0
 private void Me_MediaOpened(object sender, MediaOpenedEventArgs e)
 {
     sld.Maximum = me.NaturalDuration.HasValue ? me.NaturalDuration.Value.TotalMilliseconds : 0;
 }