Private Sub cmdexit_Click()
mmcon1.Command = "Stop"
mmcon1.Command = "Close"
End
End Sub
Private Sub cmdplay_Click()
Dim CurrentlyPlaying
CurrentlyPlaying = "Currently Playing:" & vbNewLine
On Error GoTo openerror
mmcon1.Command = "Close"
mmcon1.FileName = File1.Path & "\" & File1.FileName
mmcon1.Command = "Open"
Select Case File1.FileName
Case 1
mmcon1.DeviceType = "Other"
Case 2
mmcon1.DeviceType = "Sequencer"
Case 3
mmcon1.DeviceType = "MP3Audio"
Case 4
mmcon1.DeviceType = "WaveAudio"
End Select
If mmcon1.Error > 0 Then
cmdplay.Enabled = False
cmdstop.Enabled = False
frm1.Caption = "Jordan Media Player ( No file is loaded )"
MsgBox "Cannot open " & File1.Path & "\" & File1.FileName, vbCritical, "Error"
Else
cmdplay.Enabled = True
cmdstop.Enabled = True
frm1.Caption = "Jordan Media Player ( " & File1.FileName & " )"
mmcon1.Command = "Play"
lbltrack.Caption = CurrentlyPlaying & File1.FileName
picprogress.ScaleWidth = mmcon1.Length
picprogress.Enabled = True
End If
Exit Sub
openerror:
Exit Sub
End Sub
Private Sub cmdstop_Click()
Dim CurrentlyPlaying
CurrentlyPlaying = "Currently Playing:" & vbNewLine
mmcon1.Command = "Stop"
mmcon1.Command = "Close"
picprogress.Refresh
lbltrack.Caption = CurrentlyPlaying & "None"
End Sub
Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub
Private Sub File1_DblClick()
Dim CurrentlyPlaying
CurrentlyPlaying = "Currently Playing:" & vbNewLine
On Error GoTo openerror
mmcon1.Command = "Close"
mmcon1.FileName = File1.Path & "\" & File1.FileName
mmcon1.Command = "Open"
Select Case File1.FileName
Case 1
mmcon1.DeviceType = "Other"
Case 2
mmcon1.DeviceType = "Sequencer"
Case 3
mmcon1.DeviceType = "MP3Audio"
Case 4
mmcon1.DeviceType = "WaveAudio"
End Select
If mmcon1.Error > 0 Then
cmdplay.Enabled = False
cmdstop.Enabled = False
frm1.Caption = "Jordan Media Player ( No file is loaded )"
MsgBox "Cannot open " & File1.Path & "\" & File1.FileName, vbCritical, "Error"
Else
cmdplay.Enabled = True
cmdstop.Enabled = True
frm1.Caption = "Jordan Media Player ( " & File1.FileName & " )"
mmcon1.Command = "Play"
lbltrack.Caption = CurrentlyPlaying & File1.FileName
picprogress.ScaleWidth = mmcon1.Length
picprogress.Enabled = True
End If
Exit Sub
openerror:
Exit Sub
End Sub
Private Sub Form_Load()
Dim CurrentlyPlaying
CurrentlyPlaying = "Currently Playing:" & vbNewLine
mmcon1.UpdateInterval = 250
lbltrack.Caption = CurrentlyPlaying & "None"
End Sub
Private Sub Form_Unload(Cancel As Integer)
mmcon1.Command = "Close"
End Sub
Private Sub mmcon1_Done(NotifyCode As Integer)
Dim CurrentlyPlaying
CurrentlyPlaying = "Currently Playing:" & vbNewLine
If mmcon1.Position = mmcon1.Length Then
mmcon1.Command = "Stop"
picprogress.Refresh
lbltrack.Caption = CurrentlyPlaying & "None"
End If
End Sub
Private Sub mmcon1_StatusUpdate()
On Error Resume Next
picprogress.ScaleWidth = mmcon1.Length
picprogress.Cls
picprogress.Line (0, 0)-(mmcon1.Position, picprogress.ScaleHeight), , BF
End Sub
Private Sub mnuexit_Click()
cmdexit_Click
End Sub
Private Sub picprogress_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
If Button = 1 Then
mmcon1.To = x
mmcon1.Command = "Seek"
mmcon1.Command = "Play"
End If
End Sub
Private Sub picprogress_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
If Button = 1 Then
mmcon1.To = x
mmcon1.Command = "Seek"
mmcon1.Command = "Play"
End If
End Sub
Private Sub sldvol_DragOver(Source As Control, x As Single, y As Single, State As Integer)
Dim Vol
Vol = sldvol.Value
mmcon1.Volume = Vol
End Sub
Private Sub sldvol_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
sldvol.MousePointer = ccSizeEW
End Sub
Private Sub sldvol_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
sldvol.MousePointer = ccArrow
End Sub