Ejemplo n.º 1
0
 public void MusicPlay(string m_fName, bool m_bPlay)
 {
     if (mPlay != null && m_fName == "")
     {
         //MessageBox.Show("关闭");
         mPlay.StopT();
     }
     else if (mPlay != null && m_fName != "" && (m_bPlay == false))
     {
         //MessageBox.Show("关闭");
         mPlay.StopT();
     }
     else if (mPlay != null && m_fName != "" && (m_bPlay == true))
     {
         //MessageBox.Show("播放");
         mPlay          = new MusicPlay();
         mPlay.FileName = m_fName;
         mPlay.play();
     }
     else
     {
         MessageBox.Show("调用音乐错误");
     }
     //MessageBox.Show("mPlay " + mPlay.FileName);
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 播放音乐,只能在UI主线程上播放
        /// </summary>
        /// <param name="none"></param>
        private void PlayMusic(string none)
        {
            //MessageBox.Show("currMusic = " + currMusic + " bCurrPlay = " + bCurrPlay);
            //Common.mBox.MusicPlay(Common.mBox.fMusicName3, Common.mBox.bPlay3);

            if (mPlay != null && currMusic == "")
            {
                //MessageBox.Show("关闭");
                mPlay.StopT();
            }
            else if (mPlay != null && currMusic != "" && (bCurrPlay == false))
            {
                //MessageBox.Show("关闭");
                mPlay.StopT();
            }
            else if (mPlay != null && currMusic != "" && (bCurrPlay == true))
            {
                mPlay          = new MusicPlay();
                mPlay.FileName = currMusic;
                mPlay.play();
            }
            else
            {
                MessageBox.Show("调用音乐错误");
            }
            //MessageBox.Show("mPlay " + mPlay.FileName);
        }