Exemplo n.º 1
0
        /// <summary>
        /// Performs actions when the command has been executed.
        /// This is useful to notify exceptions or update the state of the media.
        /// </summary>
        public override void PostProcess()
        {
            MediaCore.State.UpdateFixedContainerProperties();

            if (ErrorException == null)
            {
                MediaCore.SendOnMediaChanged();
            }
            else
            {
                MediaCore.SendOnMediaFailed(ErrorException);
            }

            MediaCore.Log(MediaLogMessageType.Debug, $"Command {CommandType}: Completed");
        }
        /// <summary>
        /// Performs actions when the command has been executed.
        /// This is useful to notify exceptions or update the state of the media.
        /// </summary>
        public override void PostProcess()
        {
            MediaCore.State.UpdateFixedContainerProperties();

            if (ExceptionResult == null)
            {
                MediaCore.State.UpdateMediaState(PlaybackStatus.Stop);
                MediaCore.SendOnMediaOpened();
            }
            else
            {
                MediaCore.State.UpdateMediaState(PlaybackStatus.Close);
                MediaCore.SendOnMediaFailed(ExceptionResult);
            }

            MediaCore.Log(MediaLogMessageType.Debug, $"Command {CommandType}: Completed");
        }
Exemplo n.º 3
0
        /// <inheritdoc />
        public override void PostProcess()
        {
            MediaCore.State.UpdateFixedContainerProperties();

            if (ExceptionResult == null)
            {
                MediaCore.State.UpdateMediaState(PlaybackStatus.Stop);
                MediaCore.SendOnMediaOpened();
            }
            else
            {
                MediaCore.ResetPosition();
                MediaCore.State.UpdateMediaState(PlaybackStatus.Close);
                MediaCore.SendOnMediaFailed(ExceptionResult);
            }

            this.LogDebug(Aspects.EngineCommand, $"{CommandType} Completed");
        }
Exemplo n.º 4
0
        /// <inheritdoc />
        public override void PostProcess()
        {
            MediaCore.State.UpdateFixedContainerProperties();

            if (ErrorException == null)
            {
                MediaCore.SendOnMediaChanged();

                if (PlayWhenCompleted)
                {
                    MediaCore.Clock.Play();
                }

                MediaCore.State.UpdateMediaState(
                    MediaCore.Clock.IsRunning ? PlaybackStatus.Play : PlaybackStatus.Pause);
            }
            else
            {
                MediaCore.SendOnMediaFailed(ErrorException);
                MediaCore.State.UpdateMediaState(PlaybackStatus.Pause);
            }

            this.LogDebug(Aspects.EngineCommand, $"{CommandType} Completed");
        }