| '显示歌曲总长 ret=Left(ret,8) If ret<>"" Then ProgressBar1.Min=0 ProgressBar1.Max=Val(ret) Label3.Caption=gettime(Val(ret)) End If play.Enabled=False pause.Enabled=True stopplay.Enabled=True back.Enabled=True prew.Enabled=True t=mciSendString("status " + mfn +" mode",ret,128,0) '得到设备的当前状态,是播放还是暂停等等 ret=Left(ret,8) StatusBar1.Panels(1).text=ret '在状态栏显示播放状态 t=mciSendString("play " + mfn + " form " + Str(ProgressBar1.Value),0&,0,0) '开始播放 Timer1.Enabled=True End Sub |
| Private Sub pause_Click() t%=mciSendString("pause " + mfn,0&,0,0) '发出暂停的命令 play.Enable=True pause.Enabled=False stopplay.Enabled=True back.Enabled=False prew.Enabled=False End Sub |
| Private Sub stopplay_Click() t%=mciSendString("stop " + mfn,0&,0,0) t%=mciSendString("close " + mfn,0&,0,0) '停止播放 play.Enabled=True pause.Enabled=False stopplay.Enabled=False back.Enabled=False prew.Enabled=False End Sub |
| Private Sub back_Click() t%=mciSendString("play " + mfn + " from " + Str(ProgressBar1.Value-(ProgressBar1.Max\10)),0&,0,0) '向后跳一小段再播放 End Sub |
| Private Sub prew_Click() t%=mciSendString("play " + mfn + " from " + Stri(ProgressBar1.Value+(ProgressBar1.Max\10)),0&,0,0) '向前跳一小段再播放 End Sub |
|