Sarah W
Jul 17th, 2000, 11:19 AM
I am creating a CD player in VB - I need to be able to create playlists containing the tracks in the order of the users choosing.
I know that I should be able to use the MCI_NOTIFY_SUCCESSFUL call to find out when the track is finished but so far I have only been successful in playing WAV files this way - when I play CD's, any track (not the one I've requested) is played and only a very short part of it...what am I doing wrong?
This is a sample of my code:
Private Sub Command1_Click()
PlayNext = False
pOldProc = SetWindowLong(Form2.hwnd, GWL_WNDPROC, AddressOf WindowProc)
If (Send("open cdaudio alias cd wait shareable", True) = False) Then
Send "Close all", False
End
End If
cmd = "play cd from 1 to 2 notify"
Send cmd, True
Timer1.Enabled = True
End Sub
When the module finds that the MCI_NOTIFY is successful PlayNext becomes true and a timer in the main form checks for this and plays another specific track when it's true.
The pOLdProc is also a problem - it seems to freeze VB not allowing me to stop the program except by Control-Alt-Delete, is there any way round this? Please help!
I know that I should be able to use the MCI_NOTIFY_SUCCESSFUL call to find out when the track is finished but so far I have only been successful in playing WAV files this way - when I play CD's, any track (not the one I've requested) is played and only a very short part of it...what am I doing wrong?
This is a sample of my code:
Private Sub Command1_Click()
PlayNext = False
pOldProc = SetWindowLong(Form2.hwnd, GWL_WNDPROC, AddressOf WindowProc)
If (Send("open cdaudio alias cd wait shareable", True) = False) Then
Send "Close all", False
End
End If
cmd = "play cd from 1 to 2 notify"
Send cmd, True
Timer1.Enabled = True
End Sub
When the module finds that the MCI_NOTIFY is successful PlayNext becomes true and a timer in the main form checks for this and plays another specific track when it's true.
The pOLdProc is also a problem - it seems to freeze VB not allowing me to stop the program except by Control-Alt-Delete, is there any way round this? Please help!