public void changeSettings(bool autoDJ, bool equaliser, bool shuffle, RepeatMode repeat)
        {
            bool       autoDJMusicbee    = mbApiInterface_.Player_GetAutoDjEnabled();
            bool       equaliserMusicbee = mbApiInterface_.Player_GetEqualiserEnabled();
            RepeatMode repeatMusicbee    = mbApiInterface_.Player_GetRepeat();
            bool       shuffleMusicbee   = mbApiInterface_.Player_GetShuffle();

            if (autoDJ && autoDJMusicbee != autoDJ)
            {
                mbApiInterface_.Player_StartAutoDj();
            }
            else if (autoDJMusicbee != autoDJ)
            {
                mbApiInterface_.Player_SetShuffle(true);
                mbApiInterface_.Player_SetShuffle(false);
            }

            if (equaliserMusicbee != equaliser)
            {
                mbApiInterface_.Player_SetEqualiserEnabled(equaliser);
            }

            if (repeat != repeatMusicbee)
            {
                mbApiInterface_.Player_SetRepeat(repeat);
            }

            if (shuffle != shuffleMusicbee)
            {
                mbApiInterface_.Player_SetShuffle(shuffle);
            }
        }
        private void systemMediaControls_AutoRepeatModeChangeRequested(SystemMediaTransportControls smtc, AutoRepeatModeChangeRequestedEventArgs args)
        {
            switch (args.RequestedAutoRepeatMode)
            {
            case MediaPlaybackAutoRepeatMode.Track:
                mbApiInterface.Player_SetRepeat(RepeatMode.One);
                break;

            case MediaPlaybackAutoRepeatMode.List:
                mbApiInterface.Player_SetRepeat(RepeatMode.All);
                break;

            case MediaPlaybackAutoRepeatMode.None:
                mbApiInterface.Player_SetRepeat(RepeatMode.None);
                break;
            }
        }
Esempio n. 3
0
        /// <inheritdoc />
        public bool ToggleRepeatMode()
        {
            switch (_api.Player_GetRepeat())
            {
            case RepeatMode.None:
                return(_api.Player_SetRepeat(RepeatMode.All));

            case RepeatMode.All:
                return(_api.Player_SetRepeat(RepeatMode.None));

            case RepeatMode.One:
                return(_api.Player_SetRepeat(RepeatMode.None));

            default:
                return(false);
            }
        }
        public bool ToggleRepeatMode()
        {
            switch (_api.Player_GetRepeat())
            {
            case RepeatMode.None:
                return(_api.Player_SetRepeat(RepeatMode.All));

            case RepeatMode.All:
                return(_api.Player_SetRepeat(RepeatMode.None));

            case RepeatMode.One:
                return(_api.Player_SetRepeat(RepeatMode.None));

            default:
                throw new ArgumentOutOfRangeException();
            }
        }