/// <summary>
        /// Stop playing on the device.
        /// </summary>
        public void Stop()
        {
            if (deviceCommunication == null)
            {
                return;
            }

            switch (deviceState)
            {
            case DeviceState.Playing:
            case DeviceState.LoadingMedia:
            case DeviceState.Buffering:
            case DeviceState.Paused:
                devicePlayedWhenStopped = deviceState == DeviceState.Playing;
                deviceCommunication.Stop();
                SetDeviceState(DeviceState.Closed);
                break;

            default:
                break;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Stop playing on the device.
        /// </summary>
        public void Stop(bool changeUserMode = false)
        {
            if (deviceCommunication == null)
            {
                return;
            }

            switch (GetDeviceState())
            {
            case DeviceState.Playing:
            case DeviceState.LoadingMedia:
            case DeviceState.Buffering:
            case DeviceState.Paused:
                devicePlayedWhenStopped = GetDeviceState() == DeviceState.Playing;
                deviceCommunication.Stop(changeUserMode);
                SetDeviceState(DeviceState.Closed);
                break;

            default:
                break;
            }
        }