public SetPlayModeCommand(int playerId, RepeatState repeatState, ShuffleState shuffleState)
     : base($"player/set_play_mode?pid={playerId}&repeat={repeatState.ToCommandString()}&shuffle={shuffleState.ToString().ToLower()}")
 {
     PlayerId     = playerId;
     RepeatState  = repeatState;
     ShuffleState = shuffleState;
 }
Exemple #2
0
        private void ButtonShuffle_Click(object sender, EventArgs e)
        {
            if (Music.Count != 0)
            {
                if (ShuffleState == ShuffleState.On)
                {
                    ShuffleState = ShuffleState.Off;
                    ShuffleToolStripMenuItem.Checked = false;
                    ButtonShuffle.BackgroundImage    = Properties.Resources.shuffleOff;

                    //  Order the list on the last SortedMethode
                    if (LastSortedMethode == SortedMethode.Title)
                    {
                        SortByTitleToolContextMenuStriItem.PerformClick();
                    }
                    else if (LastSortedMethode == SortedMethode.Album)
                    {
                        SortByAlbumToolContextMenuStriItem.PerformClick();
                    }
                    else if (LastSortedMethode == SortedMethode.Artist)
                    {
                        SortByArtistToolContextMenuStriItem.PerformClick();
                    }
                }
                else if (ShuffleState == ShuffleState.Off)
                {
                    ShuffleState = ShuffleState.On;
                    ShuffleToolStripMenuItem.Checked = true;
                    ButtonShuffle.BackgroundImage    = Properties.Resources.shuffleOn;

                    SortByTitleToolContextMenuStriItem.Checked  = false;
                    SortByArtistToolContextMenuStriItem.Checked = false;
                    SortByAlbumToolContextMenuStriItem.Checked  = false;

                    TitleToolStripMenuItem.Checked  = false;
                    ArtistToolStripMenuItem.Checked = false;
                    AlbumToolStripMenuItem.Checked  = false;

                    //  Shuffle the List
                    List <string> ShuffledList = Music.OrderBy((item) => RandomValue.Next()).ToList();

                    // Clear the Lists and initialize the index and waveoutevent to null
                    ClearListToolStripMenuItem.PerformClick();

                    //  Initialize the list and Play the first music
                    AddItemsInListToTheMainList(ShuffledList);
                }
            }
        }
Exemple #3
0
        private void MusicPlayer_Load(object sender, EventArgs e)
        {
            Music                    = new List <string>();
            RandomValue              = new Random();
            MusicState               = MusicState.Pause;
            ShuffleState             = ShuffleState.Off;
            LoopState                = LoopState.Off;
            CurrentPlayingMusicIndex = 0;
            IsFileGenerateException  = false;
            LastSortedMethode        = SortedMethode.Title;

            AudioExtensions = new List <string>()
            {
                ".mp3", ".m4a", ".ogg", ".wav", ".3gp", ".flac", ".m4b", ".m4p", ".mpeg", ".mp4"
            };

            PlaybackBarControl.ChangedProgressPanel.MouseMove += ChangedProgressPanel_MouseMove;
        }
 public PlayModeResponse(RepeatState repeatState, ShuffleState shuffleState)
 {
     RepeatState  = repeatState;
     ShuffleState = shuffleState;
 }