예제 #1
0
        private void addToNowPlaying()
        {
            string selItem = null;

            NPlist = null;
            try
            {
                String[] tempList = new String[NPlistbox.Items.Count];
                int      i        = 0;
                int      count    = playlist.count;

                for (int j = 0; j < count; j++)
                {
                    playlist.removeItem(playlist.get_Item(0));
                }

                NPlistbox.Items.Clear();

                selItem = PLlistBox.SelectedItem.ToString();
                Boolean firstLoopTurn = false;
                foreach (String listItem in MyPlaylistData.getPlaylist(selItem))
                {
                    if (firstLoopTurn)
                    {
                        string value = listItem.Substring(listItem.LastIndexOf("\\") + 1);
                        value = "    " + value;
                        NPlistbox.Items.Add(value);

                        media = MediaPlayerControl.newMedia(listItem);
                        playlist.appendItem(media);
                    }
                    firstLoopTurn = true;
                }

                NPlist        = new String[MyPlaylistData.getPlaylist(selItem).Length - 1];
                i             = 0;
                firstLoopTurn = true;
                foreach (String listitem in MyPlaylistData.getPlaylist(selItem))
                {
                    if (firstLoopTurn)
                    {
                        firstLoopTurn = false;
                        continue;
                    }
                    NPlist[i] = listitem;
                    i++;
                }

                MediaPlayerControl.Ctlcontrols.play();
                tabControl1.SelectedTab = tabPage1;
                NPlistbox.SelectedIndex = 0;
            }

            catch (Exception ex)
            {
                MessageBox.Show("Unable to Play!\n\n" + ex.Message);
            }
        }
예제 #2
0
파일: Form1.cs 프로젝트: 8Tesla8/mp3-player
        private void Del_Click(object sender, EventArgs e)
        {
            if (List.Items.Count > 0)
            {
                WMPLib.IWMPMedia media = playlist.get_Item(List.SelectedIndex);
                playlist.removeItem(media);

                List.Items.RemoveAt(List.SelectedIndex);
            }
        }
예제 #3
0
 private void удалитьToolStripMenuItem_Click(object sender, EventArgs e)
 {
     p.removeItem(p.Item[selected]);
     ChangePL?.Invoke(this);
 }