展开全部
'这是我写的一个循环播放的代码,数组p_play()存放的是所要播放的音乐的路径,p_nplay 的值是当前播放的音乐在数组p_play()的下标!
Private Sub MMControl1_Done(NotifyCode As Integer)
Dim i As Long, fhz As Long
If NotifyCode = 1 And p_play(0) <> "" Then
fhz = UBound(p_play)
If fhz = 0 Or fhz = p_nplay Then
MMControl1.Command = "close"
MMControl1.FileName = p_play(0)
MMControl1.Command = "open"
MMControl1.Command = "play"
p_nplay = 0
ElseIf p_nplay + 1 = fhz Then
MMControl1.Command = "close"
MMControl1.FileName = p_play(fhz)
MMControl1.Command = "open"
MMControl1.Command = "play"
p_nplay = fhz
ElseIf p_nplay + 1 < fhz Then
MMControl1.Command = "close"
MMControl1.FileName = p_play(p_nplay + 1)
MMControl1.Command = "open"
MMControl1.Command = "play"
p_nplay = p_nplay + 1
End If
End If
Private Sub MMControl1_Done(NotifyCode As Integer)
Dim i As Long, fhz As Long
If NotifyCode = 1 And p_play(0) <> "" Then
fhz = UBound(p_play)
If fhz = 0 Or fhz = p_nplay Then
MMControl1.Command = "close"
MMControl1.FileName = p_play(0)
MMControl1.Command = "open"
MMControl1.Command = "play"
p_nplay = 0
ElseIf p_nplay + 1 = fhz Then
MMControl1.Command = "close"
MMControl1.FileName = p_play(fhz)
MMControl1.Command = "open"
MMControl1.Command = "play"
p_nplay = fhz
ElseIf p_nplay + 1 < fhz Then
MMControl1.Command = "close"
MMControl1.FileName = p_play(p_nplay + 1)
MMControl1.Command = "open"
MMControl1.Command = "play"
p_nplay = p_nplay + 1
End If
End If
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询