Пример #1
0
        private void lvMusic_DragDrop(object sender, DragEventArgs e)
        {
            if (btnPlay.Enabled == false || btnPrevious.Enabled == false || btnNext.Enabled == false)
            {
                btnPrevious.Enabled = true;
                btnNext.Enabled     = true;
                btnPlay.Enabled     = true;

                form_Mini.btnMiniPrevious.Enabled = true;
                form_Mini.btnMiniNext.Enabled     = true;
                form_Mini.btnMiniPlay.Enabled     = true;
            }
            string[] filenames = (string[])e.Data.GetData(DataFormats.FileDrop, false);
            foreach (string filename in filenames)
            {
                try
                {
                    Load_Mp3Info(filename, lvMusic);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
            ExtensionClass.shuffleIndex(randomList, lvMusic);
            ExtensionClass.shuffle(randomList);
        }
Пример #2
0
        void fileDownloadCompleted(object sender, AsyncCompletedEventArgs e)
        {
            nowDownloading = false;

            if (btnPlay.Enabled == false || btnPrevious.Enabled == false || btnNext.Enabled == false)
            {
                btnPrevious.Enabled = true;
                btnNext.Enabled     = true;
                btnPlay.Enabled     = true;

                form_Mini.btnMiniPrevious.Enabled = true;
                form_Mini.btnMiniNext.Enabled     = true;
                form_Mini.btnMiniPlay.Enabled     = true;
            }

            try
            {
                Load_Mp3Info(downfileUrl, lvMusic);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            ExtensionClass.shuffleIndex(randomList, lvMusic);
            ExtensionClass.shuffle(randomList);

            Toast.show(this, "나도 가수다", System.IO.Path.GetFileName(downfileUrl) + "의 다운로드가 완료되었습니다.", ToastType.INFO, ToastDuration.SHORT);
            //MessageBox.Show("파일 다운로드 완료!", "오류", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
Пример #3
0
        private void LoadXml()
        {
            if (File.Exists(gStrXmlFilePath))
            {
                XDocument xdoc = XDocument.Load(gStrXmlFilePath);

                IEnumerable <XElement> emps = xdoc.Root.Elements();

                foreach (var emp in emps)
                {
                    string path      = emp.Element("MusicPath").Value;
                    int    count     = 0;
                    string playCount = emp.Element("PlayCount").Value;
                    try
                    {
                        if (path.StartsWith("http"))
                        {
                            ListViewItem lsv = new ListViewItem();
                            lsv.SubItems.Add(path);
                            lsv.SubItems.Add(path);
                            lsv.SubItems.Add(path);
                            lvMusic.Items.Add(lsv);

                            for (int i = 0; i < lvMusic.Items.Count; i++)
                            {
                                lvMusic.Items[i].SubItems[0].Text = (i + 1).ToString();
                            }
                        }
                        else if (path.EndsWith(".mp3"))
                        {
                            Load_Mp3Info(path, lvMusic);
                        }
                        lvMusic.Items[count].SubItems[4].Text = playCount;
                        count++;
                    }
                    catch (Exception ex)
                    {
                        //MessageBox.Show(ex.Message);
                    }
                }
            }
            if (lvMusic.Items.Count > 0)
            {
                btnPrevious.Enabled = true;
                btnNext.Enabled     = true;
                btnPlay.Enabled     = true;

                form_Mini.btnMiniPrevious.Enabled = true;
                form_Mini.btnMiniNext.Enabled     = true;
                form_Mini.btnMiniPlay.Enabled     = true;


                ExtensionClass.shuffleIndex(randomList, lvMusic);
                ExtensionClass.shuffle(randomList);
            }
        }