CdPlayer




Private Sub Command1_Click()
'Open the CD device -- the disc must already be in the drive.

MMControl1.Command = "Open"
On Error Goto 0
'Set the time format.

MMControl1.TimeFormat = vbMCIFormatTmsf
'Disable the Load command button.

Command1.Enabled = False
Exit Sub
Resume MCI_EXIT
MCI_EXIT:
Unload CD
End Sub

Private Sub Form_Load()
MMControl1.Wait = True
MMControl1.UpdateInterval = 0
'Set the DeviceType property to a musical CD device.

MMControl1.DeviceType = "CDAudio"
End Sub

Private Sub Form_Unload(Cancel As Integer)
MCITest.Show
End Sub

Private Sub MMControl1_EjectClick(Cancel As Integer)
'Enable the Load command button, and display the

'"disc out of drive" bitmap.

Command1.Enabled = True
MMControl1.UpdateInterval = 0
'Eject the disc from the CD drive, and close the device.

MMControl1.Command = "Eject"
MMControl1.Command = "Close"
On Error Goto 0
Exit Sub
End Sub

Private Sub MMControl1_PauseClick(Cancel As Integer)
MMControl1.UpdateInterval = 0
'Set the "play indicator" to off.

End Sub

Private Sub MMControl1_PlayClick(Cancel As Integer)
MMControl1.UpdateInterval = 1000
'Set the track number to the current track.

End Sub

Private Sub MMControl1_StopClick(Cancel As Integer)
MMControl1.UpdateInterval = 0
'Set the "play indicator" to off.

'Reset the CD to track 1.

MMControl1.To = MMControl1.Start
MMControl1.Command = "Seek"
MMControl1.Track = 1
End Sub










( cdplayer.html )- by Paolo Puglisi - Modifica del 17/12/2023