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");
        }
Exemplo n.º 2
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");
        }