110,571
社区成员
发帖
与我相关
我的任务
分享
//播放状态,1=停止,2=暂停,3=播放,6=正在缓冲,9=正在连接,10=准备就绪
if(1==(int)this.SongPlayer.playState)
{
if (t.Equals("顺序播放"))
{
int row = (this.PlaySongRow + 1) % this.lstSong.Items.Count;
this.lstSong.Items[row].Selected = true;
this.SongPlayer.URL = this.lstSong.Items[row].SubItems[3].Text;
SongPlayer.Ctlcontrols.play(); //播放歌曲
ChangeSongColor();
//去掉以下这行代码后可以播放下一首歌曲,
//将其注释掉后就停止播放了。
MessageBox.Show(this.lstSong.Items[row].SubItems[3].Text);
}
}
//播放状态,1=停止,2=暂停,3=播放,6=正在缓冲,9=正在连接,10=准备就绪
if(1==(int)this.SongPlayer.playState)
{
if (t.Equals("顺序播放"))
{
int row = (this.PlaySongRow + 1) % this.lstSong.Items.Count;
this.lstSong.Items[row].Selected = true;
this.SongPlayer.URL = this.lstSong.Items[row].SubItems[3].Text;
Thread thd = new Thread (delegate() {
SongPlayer.Ctlcontrols.play(); //播放歌曲
});
thd.Start();
ChangeSongColor();
//去掉以下这行代码后可以播放下一首歌曲,
//将其注释掉后就停止播放了。
//MessageBox.Show(this.lstSong.Items[row].SubItems[3].Text);
}
}
//定时器,用时实现播放模式
private void timerPlay_Tick(object sender, EventArgs e)
{
string t = this.cmbPlayType.SelectedItem.ToString();
//播放状态,1=停止,2=暂停,3=播放,6=正在缓冲,9=正在连接,10=准备就绪
if (1 == (int)this.SongPlayer.playState&&bIsPlay)
{
if (t.Equals("顺序播放"))
{
int row = (this.PlaySongRow + 1) % this.lstSong.Items.Count;
this.lstSong.Items[row].Selected = true;
this.SongPlayer.URL = this.lstSong.Items[row].SubItems[3].Text;
this.SongPlayer.Ctlcontrols.play();
ChangeSongColor();
}
}
}
//using System.Runtime.InteropServices;
[DllImport("user32.dll", EntryPoint = "MessageBox")]
public static extern int MessageBox(int hWnd, String strMessage, String strCaption, uint uiType);
...
MessageBox(0, this.lstSong.Items[row].SubItems[3].Text, "caption", 0);
...