正在阅读:制作自动循环播放的MP3播放器(上)制作自动循环播放的MP3播放器(上)

2004-05-25 10:30 出处:CSDN 作者:happyparrot 责任编辑:linjixiong


                                    "媒体播放表(*.asx;*.wax;*.m3u;*.wvx)|*.asx;*.wax;*.m3u;*.wvx|" +

                                    "电影文件(*.mpeg;*.mpg;*.m1v;*.mp3)|*.mpeg;*.mpg;*.m1v;*.mp3|" +

                                    "视频文件(*.avi;*.wmv)|*.avi;*.wmv)|" +

                                    "音频文件(*.wav;*.snd;*.au;*.aif;*.aifc)|*.wav;*.snd;*.au;*.aif;*.aifc|" +

                                    "所有文件(*.*)|*.*|";

       CFileDialog music(TRUE,NULL,NULL,OFN_HIDEREADONLY|OFN_ALLOWMULTISELECT,filter);

       if(music.DoModal() == IDOK)

       {

              POSITION pos = music.GetStartPosition();

              while (pos != NULL)

              {

                     CString str = music.GetNextPathName(pos);

                     m_MusicAry.Add(str);

                     int index = str.ReverseFind('\\');

                     if(index == -1)

                            m_MusicList.AddString(str);

                     else

                     {

                            CString name = str.Mid(index + 1);

                            m_MusicList.AddString(name);

                     }

              }

       }

  }




  void CMp3PlayerDlg::Play(int index)//播放函数,index为曲目的序号

  {

       m_Music.Close();

       m_MusicList.SetCurSel(index);

 





察看评论详细内容 我要发表评论
作者笔名简短内容 发表时间
:

键盘也能翻页,试试“← →”键

关注我们

最新资讯离线随时看 聊天吐槽赢奖品