Exemplo n.º 1
0
        public static void setupPlay(Mp3_Container container)
        {
            if (container.gui.songList.SelectedRows.Count == 0)
            {
                return;
            }
            if (container.songlists.nowPlaying != null && container.songlists.nowPlaying.equals(Create.createSelectedSong(container)))
            {
                SongControl.play_pause(container);
                return;
            }

            if (container.trackers.nowPlayingRow == -1 || (container.trackers.nowPlayingRow != container.gui.songList.SelectedRows[0].Index))
            {
                container.trackers.nowPlayingRow = container.gui.songList.SelectedRows[0].Index;
            }

            if (container.gui.shuffle.Checked)
            {
                SongControl.shuffleSong(container);
            }
            else if (container.gui.songList.SelectedRows.Count == 0)
            {
                DataGridViewRow row = container.gui.songList.Rows[0];
                row.Selected = true;
                if (Miscellaneous.checkNull(row))
                {
                    return;
                }
                container.trackers.nowPlayingRow = row.Index;
            }
            stop(container);
            SongControl.play(container);
            GuiControl.fillLabels(container);
        }
Exemplo n.º 2
0
 public static void next(Mp3_Container container)
 {
     stop(container);
     container.gui.songList.SelectedRows[0].Selected = false;
     if (container.gui.shuffle.Checked)
     {
         SongControl.shuffleSong(container);
     }
     else
     {
         container.trackers.nowPlayingRow++;
         if (container.trackers.nowPlayingRow >= container.gui.songList.RowCount && container.gui.repeatAll.Checked)
         {
             container.trackers.nowPlayingRow = 0;
         }
         else if (container.gui.repeat.Checked)
         {
             container.trackers.nowPlayingRow--;
         }
         else if (container.trackers.nowPlayingRow >= container.gui.songList.RowCount && !container.gui.repeatAll.Checked)
         {
             return;
         }
         else
         {
             SongControl.play(container);
         }
     }
     SongControl.play(container);
     if (container.songlists.nowPlaying != null)
     {
         GuiControl.fillLabels(container);
     }
 }
Exemplo n.º 3
0
        public static void previous(Mp3_Container container, MouseEventArgs e)
        {
            if (container.trackers.listPosition == -1)
            {
                return;
            }
            container.trackers.listPosition--;

            if (e.Clicks > 1)
            {
                if (container.trackers.listPosition < 0 && container.gui.repeat.Checked)
                {
                    container.trackers.listPosition  = 0;
                    container.trackers.nowPlayingRow = container.songlists.previousSongsPlaylist.ElementAt(container.trackers.listPosition).Item2;
                }
                else if (container.trackers.listPosition >= 0 && container.gui.repeat.Checked)
                {
                    container.trackers.listPosition++;
                }
                else if (container.trackers.listPosition < 0)
                {
                    stop(container);
                    return;
                }
                container.trackers.nowPlayingRow = container.songlists.previousSongsPlaylist.ElementAt(container.trackers.listPosition).Item2;

                stop(container);
                SongControl.play(container);
            }
            else
            {
                if ((container.trackers.listPosition < 0 && container.gui.repeat.Checked) || container.gui.repeat.Checked || container.player.progressBar.Value >= 3)
                {
                    container.trackers.listPosition++;
                }
                else if (container.trackers.listPosition < 0)
                {
                    stop(container);
                    return;
                }
                container.trackers.nowPlayingRow = container.songlists.previousSongsPlaylist.ElementAt(container.trackers.listPosition).Item2;
                stop(container);
                SongControl.play(container);
            }

            if (container.songlists.nowPlaying != null)
            {
                GuiControl.fillLabels(container);
            }
        }