home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form CD
- BackColor = &H00C0C0C0&
- BorderStyle = 3 'Fixed Double
- Caption = "Shuffle CD Player Example"
- ClientHeight = 2070
- ClientLeft = 1095
- ClientTop = 1485
- ClientWidth = 5895
- Height = 2475
- Icon = CD.FRX:0000
- Left = 1035
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 2070
- ScaleWidth = 5895
- Top = 1140
- Width = 6015
- Begin CommandButton Command5
- Caption = "&More >>"
- Height = 375
- Left = 4440
- TabIndex = 50
- Top = 1560
- Width = 1335
- End
- Begin CommandButton Command4
- Caption = "&About CD"
- Height = 375
- Left = 120
- TabIndex = 48
- Top = 1080
- Width = 1455
- End
- Begin CommandButton Command3
- Caption = "E&xit"
- Height = 375
- Left = 120
- TabIndex = 3
- Top = 1560
- Width = 1455
- End
- Begin CommandButton Command2
- Caption = "&Shuffle Play"
- Height = 375
- Left = 120
- TabIndex = 2
- Top = 600
- Width = 1455
- End
- Begin CommandButton Command1
- Caption = "&Load CD"
- Height = 375
- Left = 120
- TabIndex = 1
- Top = 120
- Width = 1455
- End
- Begin PictureBox MMControl1
- BackColor = &H000000FF&
- Height = 1000
- Left = 0
- ScaleHeight = 975
- ScaleWidth = 975
- TabIndex = 0
- Top = 0
- Width = 1000
- End
- Begin Label Label10
- BackStyle = 0 'Transparent
- Caption = "Shuffle Play List:"
- Height = 255
- Left = 120
- TabIndex = 49
- Top = 2280
- Width = 1575
- End
- Begin Line Line5
- X1 = 1680
- X2 = 5040
- Y1 = 1440
- Y2 = 1440
- End
- Begin Line Line4
- X1 = 1680
- X2 = 5040
- Y1 = 1080
- Y2 = 1080
- End
- Begin Line Line3
- X1 = 1680
- X2 = 5280
- Y1 = 720
- Y2 = 720
- End
- Begin Line Line2
- X1 = 1680
- X2 = 5280
- Y1 = 360
- Y2 = 360
- End
- Begin Line Line1
- BorderWidth = 2
- X1 = 120
- X2 = 5760
- Y1 = 2160
- Y2 = 2160
- End
- Begin Label Label9
- BackColor = &H00FFFFFF&
- BackStyle = 0 'Transparent
- Caption = "Track:"
- Height = 255
- Left = 1680
- TabIndex = 47
- Top = 120
- Width = 2055
- End
- Begin Label Label8
- Alignment = 2 'Center
- BackColor = &H00FFFF00&
- BorderStyle = 1 'Fixed Single
- ForeColor = &H00000000&
- Height = 255
- Left = 5400
- TabIndex = 46
- Top = 120
- Width = 375
- End
- Begin Label Label7
- BackColor = &H00FFFFFF&
- BackStyle = 0 'Transparent
- Caption = "Total Track Time:"
- Height = 255
- Left = 1680
- TabIndex = 4
- Top = 1200
- Width = 1935
- End
- Begin Label Label6
- BackColor = &H00FFFFFF&
- BackStyle = 0 'Transparent
- Caption = "Elapsed Time:"
- Height = 255
- Left = 1680
- TabIndex = 45
- Top = 840
- Width = 1935
- End
- Begin Label Label5
- BackColor = &H00FFFFFF&
- BackStyle = 0 'Transparent
- Caption = "Total Tracks Availible:"
- Height = 255
- Left = 1680
- TabIndex = 44
- Top = 480
- Width = 2055
- End
- Begin Label Label4
- Alignment = 2 'Center
- BackColor = &H00FFFF00&
- BorderStyle = 1 'Fixed Single
- ForeColor = &H00000000&
- Height = 255
- Left = 5160
- TabIndex = 43
- Top = 1200
- Width = 615
- End
- Begin Label Label3
- Alignment = 2 'Center
- BackColor = &H00FFFF00&
- BorderStyle = 1 'Fixed Single
- ForeColor = &H00000000&
- Height = 255
- Left = 5160
- TabIndex = 42
- Top = 840
- Width = 615
- End
- Begin Label Label2
- Alignment = 2 'Center
- BackColor = &H00FFFF00&
- BorderStyle = 1 'Fixed Single
- ForeColor = &H00000000&
- Height = 255
- Left = 5400
- TabIndex = 41
- Top = 480
- Width = 375
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FFFF00&
- BorderStyle = 1 'Fixed Single
- ForeColor = &H00000000&
- Height = 255
- Index = 36
- Left = 5400
- TabIndex = 40
- Top = 3240
- Width = 375
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FFFF00&
- BorderStyle = 1 'Fixed Single
- ForeColor = &H00000000&
- Height = 255
- Index = 35
- Left = 4920
- TabIndex = 39
- Top = 3240
- Width = 375
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FFFF00&
- BorderStyle = 1 'Fixed Single
- ForeColor = &H00000000&
- Height = 255
- Index = 34
- Left = 4440
- TabIndex = 38
- Top = 3240
- Width = 375
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FFFF00&
- BorderStyle = 1 'Fixed Single
- ForeColor = &H00000000&
- Height = 255
- Index = 33
- Left = 3960
- TabIndex = 37
- Top = 3240
- Width = 375
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FFFF00&
- BorderStyle = 1 'Fixed Single
- ForeColor = &H00000000&
- Height = 255
- Index = 32
- Left = 3480
- TabIndex = 36
- Top = 3240
- Width = 375
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FFFF00&
- BorderStyle = 1 'Fixed Single
- ForeColor = &H00000000&
- Height = 255
- Index = 31
- Left = 3000
- TabIndex = 35
- Top = 3240
- Width = 375
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FFFF00&
- BorderStyle = 1 'Fixed Single
- ForeColor = &H00000000&
- Height = 255
- Index = 30
- Left = 2520
- TabIndex = 34
- Top = 3240
- Width = 375
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FFFF00&
- BorderStyle = 1 'Fixed Single
- ForeColor = &H00000000&
- Height = 255
- Index = 29
- Left = 2040
- TabIndex = 33
- Top = 3240
- Width = 375
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FFFF00&
- BorderStyle = 1 'Fixed Single
- ForeColor = &H00000000&
- Height = 255
- Index = 28
- Left = 1560
- TabIndex = 32
- Top = 3240
- Width = 375
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FFFF00&
- BorderStyle = 1 'Fixed Single
- ForeColor = &H00000000&
- Height = 255
- Index = 27
- Left = 1080
- TabIndex = 31
- Top = 3240
- Width = 375
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FFFF00&
- BorderStyle = 1 'Fixed Single
- ForeColor = &H00000000&
- Height = 255
- Index = 26
- Left = 600
- TabIndex = 30
- Top = 3240
- Width = 375
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FFFF00&
- BorderStyle = 1 'Fixed Single
- ForeColor = &H00000000&
- Height = 255
- Index = 25
- Left = 120
- TabIndex = 29
- Top = 3240
- Width = 375
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FFFF00&
- BorderStyle = 1 'Fixed Single
- ForeColor = &H00000000&
- Height = 255
- Index = 24
- Left = 5400
- TabIndex = 28
- Top = 2880
- Width = 375
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FFFF00&
- BorderStyle = 1 'Fixed Single
- ForeColor = &H00000000&
- Height = 255
- Index = 23
- Left = 4920
- TabIndex = 27
- Top = 2880
- Width = 375
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FFFF00&
- BorderStyle = 1 'Fixed Single
- ForeColor = &H00000000&
- Height = 255
- Index = 22
- Left = 4440
- TabIndex = 26
- Top = 2880
- Width = 375
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FFFF00&
- BorderStyle = 1 'Fixed Single
- ForeColor = &H00000000&
- Height = 255
- Index = 21
- Left = 3960
- TabIndex = 25
- Top = 2880
- Width = 375
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FFFF00&
- BorderStyle = 1 'Fixed Single
- ForeColor = &H00000000&
- Height = 255
- Index = 20
- Left = 3480
- TabIndex = 24
- Top = 2880
- Width = 375
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FFFF00&
- BorderStyle = 1 'Fixed Single
- ForeColor = &H00000000&
- Height = 255
- Index = 19
- Left = 3000
- TabIndex = 23
- Top = 2880
- Width = 375
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FFFF00&
- BorderStyle = 1 'Fixed Single
- ForeColor = &H00000000&
- Height = 255
- Index = 18
- Left = 2520
- TabIndex = 22
- Top = 2880
- Width = 375
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FFFF00&
- BorderStyle = 1 'Fixed Single
- ForeColor = &H00000000&
- Height = 255
- Index = 17
- Left = 2040
- TabIndex = 21
- Top = 2880
- Width = 375
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FFFF00&
- BorderStyle = 1 'Fixed Single
- ForeColor = &H00000000&
- Height = 255
- Index = 16
- Left = 1560
- TabIndex = 20
- Top = 2880
- Width = 375
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FFFF00&
- BorderStyle = 1 'Fixed Single
- ForeColor = &H00000000&
- Height = 255
- Index = 15
- Left = 1080
- TabIndex = 19
- Top = 2880
- Width = 375
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FFFF00&
- BorderStyle = 1 'Fixed Single
- ForeColor = &H00000000&
- Height = 255
- Index = 14
- Left = 600
- TabIndex = 18
- Top = 2880
- Width = 375
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FFFF00&
- BorderStyle = 1 'Fixed Single
- ForeColor = &H00000000&
- Height = 255
- Index = 13
- Left = 120
- TabIndex = 17
- Top = 2880
- Width = 375
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FFFF00&
- BorderStyle = 1 'Fixed Single
- ForeColor = &H00000000&
- Height = 255
- Index = 12
- Left = 5400
- TabIndex = 16
- Top = 2520
- Width = 375
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FFFF00&
- BorderStyle = 1 'Fixed Single
- ForeColor = &H00000000&
- Height = 255
- Index = 11
- Left = 4920
- TabIndex = 15
- Top = 2520
- Width = 375
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FFFF00&
- BorderStyle = 1 'Fixed Single
- ForeColor = &H00000000&
- Height = 255
- Index = 10
- Left = 4440
- TabIndex = 14
- Top = 2520
- Width = 375
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FFFF00&
- BorderStyle = 1 'Fixed Single
- ForeColor = &H00000000&
- Height = 255
- Index = 9
- Left = 3960
- TabIndex = 13
- Top = 2520
- Width = 375
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FFFF00&
- BorderStyle = 1 'Fixed Single
- ForeColor = &H00000000&
- Height = 255
- Index = 8
- Left = 3480
- TabIndex = 12
- Top = 2520
- Width = 375
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FFFF00&
- BorderStyle = 1 'Fixed Single
- ForeColor = &H00000000&
- Height = 255
- Index = 7
- Left = 3000
- TabIndex = 11
- Top = 2520
- Width = 375
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FFFF00&
- BorderStyle = 1 'Fixed Single
- ForeColor = &H00000000&
- Height = 255
- Index = 6
- Left = 2520
- TabIndex = 10
- Top = 2520
- Width = 375
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FFFF00&
- BorderStyle = 1 'Fixed Single
- ForeColor = &H00000000&
- Height = 255
- Index = 5
- Left = 2040
- TabIndex = 9
- Top = 2520
- Width = 375
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FFFF00&
- BorderStyle = 1 'Fixed Single
- ForeColor = &H00000000&
- Height = 255
- Index = 4
- Left = 1560
- TabIndex = 8
- Top = 2520
- Width = 375
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FFFF00&
- BorderStyle = 1 'Fixed Single
- ForeColor = &H00000000&
- Height = 255
- Index = 3
- Left = 1080
- TabIndex = 7
- Top = 2520
- Width = 375
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FFFF00&
- BorderStyle = 1 'Fixed Single
- ForeColor = &H00000000&
- Height = 255
- Index = 2
- Left = 600
- TabIndex = 6
- Top = 2520
- Width = 375
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00FFFF00&
- BorderStyle = 1 'Fixed Single
- ForeColor = &H00000000&
- Height = 255
- Index = 1
- Left = 120
- TabIndex = 5
- Top = 2520
- Width = 375
- End
- '============================================
- ' SHUFFLE CD PLAYER EXAMPLE
- ' Copyright(c) 1994 Larry Robert Seater
- '============================================
- ' Disclaimer of Warranty:
- ' This software and the accompanying files are 'as is'
- ' and without warranties as to performance of the
- ' software and the accompanying files or any other
- ' warranties whether expressed or implied.
- ' No warranty of fitness for a particular purpose
- ' is offered.
- ' You may not sell this software or it's source code.
- ' You may use this code in any way you find useful.
- ' Enough said!
- ' This is an example of some things I've learned
- ' about the MCI.VBX custom control from the Visual
- ' Basic Professional Edition. This is written in
- ' VB Pro 3.0 and needs to be run (I think) on the
- ' same. There may be a few bugs, but I knocked it
- ' out in a couple of hours. There are a few other
- ' tricks(?) in the code too.
- ' Please if you have any comments (good or bad) or
- ' any suggestions, or want to trade code write me or
- ' E-Mail me at:
- ' AOL: LarryS8302
- ' Land Mail: Larry Seater
- ' 2124 NE 36th Av.
- ' Portland, OR 97212
- ' Thanks!
- Sub ClearAll ()
- ' Clears all the label1(index) captions.
- For i = 1 To 36
- Label1(i).Caption = ""
- Next i
- End Sub
- Sub Command1_Click ()
- MousePointer = 11
- ' Open the CD device -- the disk must already be
- ' in the drive.
- On Error GoTo MCI_ERROR
- MMControl1.Command = "Open"
- On Error GoTo 0
- ' Set Shuf flag to false.
- Flag = False
- ' Set the time format
- MMControl1.TimeFormat = MCI_FORMAT_TMSF
- ' Disable the Load command button.
- Command1.Enabled = False
- Command2.Enabled = True
- Label2.Caption = Str$(MMControl1.Tracks)
- Label8.Caption = "1"
- If Label2.Caption = 1 Then
- msg = "One track, may not be an Audio CD!"
- MsgBox msg, 64, "CD Player"
- End If
- MousePointer = 0
- Exit Sub
- MCI_ERROR:
- DisplayErrorMessageBox
- Resume MCI_EXIT
- MCI_EXIT:
- Unload CD
- End Sub
- Sub Command2_Click ()
- Call ClearAll
- Flag = False
- TotalTrk = MMControl1.Tracks
- Select Case Val(TotalTrk)
- Case 1
- msg = "One track, may not be an Audio CD!"
- MsgBox msg, 64, "Shuffle CD Player Example"
- Call MMControl1_StopClick(-1)
- Case 2 To 36
- Call RandomOrder
- Case Is > 36
- msg = "Only support for 36 tracks! Unable to Shuffle!"
- MsgBox msg, 64, "Shuffle CD Player Example"
- Call MMControl1_StopClick(-1)
- End Select
- End Sub
- Sub Command3_Click ()
- MMControl1.Command = "Stop"
- MMControl1.Command = "Close"
- End
- End Sub
- Sub Command4_Click ()
- AboutBox.Show
- End Sub
- Sub Command5_Click ()
- If Command5.Caption = "&More >>" Then
- CD.Height = 4025
- Command5.Caption = "&Less <<"
- Else
- CD.Height = 2475
- Command5.Caption = "&More >>"
- End If
- End Sub
- Sub Form_Load ()
- 'See if CD is already running.
- If App.PrevInstance Then
- msg$ = "Shuffle CD Player Example already running!"
- MsgBox msg$, 48
- End
- End If
- ' Center Form on Screen.
- Move (Screen.Width - Width) / 2, (Screen.Height - Height) / 2.28
- ' Force the MCI control to complete before returning
- ' to the application.
- MMControl1.Wait = True
- MMControl1.UpdateInterval = 0
- Command2.Enabled = False
- Label2.Caption = "0"
- Label3.Caption = "00:00"
- Label4.Caption = "00:00"
- Label8.Caption = "0"
- ' Set the DeviceType to a musical CD device.
- MMControl1.DeviceType = "CDAudio"
- End Sub
- Sub Form_Unload (Cancel As Integer)
- MMControl1.Command = "Stop"
- MMControl1.Command = "Close"
- End
- End Sub
- Sub MMControl1_EjectClick (Cancel As Integer)
- Flag = False
- Call ClearAll
- Command1.Enabled = True
- Command2.Enabled = False
- Label2.Caption = "0"
- Label3.Caption = "00:00"
- Label4.Caption = "00:00"
- Label8.Caption = "0"
- MMControl1.UpdateInterval = 0
- ' Eject the disk from the CD drive, and close the device.
- On Error GoTo MCI_ERROR2
- MMControl1.Command = "Eject"
- MMControl1.Command = "Close"
- On Error GoTo 0
- Exit Sub
- MCI_ERROR2:
- DisplayErrorMessageBox
- Resume Next
- End Sub
- Sub MMControl1_NextClick (Cancel As Integer)
- Call ClearAll
- End Sub
- Sub MMControl1_PauseClick (Cancel As Integer)
- Flag = False
- Call ClearAll
- MMControl1.UpdateInterval = 0
- End Sub
- Sub MMControl1_PlayClick (Cancel As Integer)
- Flag = False
- Call ClearAll
- MMControl1.UpdateInterval = 1000
- End Sub
- Sub MMControl1_PrevClick (Cancel As Integer)
- Call ClearAll
- End Sub
- Sub MMControl1_StatusUpdate ()
- ' See article ID: Q94012 in new knowlege base.
- ' The least significant byte is stored in byte1 and the most significant byte
- ' is stored in byte4.
- byte1 = MMControl1.Position And &HFF&
- byte2 = (MMControl1.Position And &HFF00&) \ &H100
- byte3 = (MMControl1.Position And &HFF0000) \ &H10000
- byte4 = (MMControl1.Position And &H7F000000) \ &H1000000
- ' put sign bit back into byte4
- If (MMControl1.Position And &H80000000) <> 0 Then
- byte4 = byte4 + &H80
- End If
- ' Set the track number to the current track.
- Trk = byte1 'MMControl1.Position And &HFF
- Label8.Caption = Trk
- Label3.Caption = Format$(byte2, "00") + ":" + Format$(byte3, "00")
- MMControl1.Track = Trk 'Tells the TrackLength which track to measure.
- byteA = MMControl1.TrackLength And &HFF&
- byteB = (MMControl1.TrackLength And &HFF00&) \ &H100
- If (MMControl1.TrackLength And &H80000000) <> 0 Then
- byteB = byteB + &H80
- End If
- Label4.Caption = Format$(byteA, "00") + ":" + Format$(byteB, "00")
- ' See if Shuf should be called or not based on flag var.
- If MMControl1.Mode = MCI_MODE_STOP Then
- If Flag = True Then
- Call ShufflePlay
- Else
- Call MMControl1_StopClick(-1)
- End If
- End If
- End Sub
- Sub MMControl1_StopClick (Cancel As Integer)
- Flag = False
- Call ClearAll
- MMControl1.UpdateInterval = 0
- ' Reset the CD to track 1.
- MMControl1.To = MMControl1.Start
- MMControl1.Command = "Seek"
- MMControl1.Track = 1
- Trk = 1
- Label3.Caption = "00:00"
- Label4.Caption = "00:00"
- Label8.Caption = Trk
- End Sub
- Sub RandomOrder ()
- Dim TotalNum
- TotalNum = Val(Label2.Caption)
- Dim Top As Integer
- Dim i As Integer, J As Integer
- Dim IdxTemp As Integer
- ReDim TempArray(1 To TotalNum) As Integer
- ReDim Answer(1 To TotalNum) As Integer
- 'Generate hidden random sequence:
- Randomize
- For i = 1 To TotalNum
- TempArray(i) = i
- Next i
- Top = TotalNum
- For i = 1 To Top
- IdxTemp = Int(Top * Rnd + 1)
- Answer(i) = TempArray(IdxTemp)
- For J = IdxTemp To Top - 1
- TempArray(J) = TempArray(J + 1)
- Next J
- Top = Top - 1
- Next i
- ' Display the track order in Immediate Window
- ' for program testing:
- For i = 1 To TotalNum
- Debug.Print Answer(i); " ";
- Next i
- Debug.Print
- For i = 1 To TotalNum
- Label1(i) = Str$(Answer(i))
- Next i
- Call ShufflePlay
- End Sub
- Sub ShufflePlay ()
- MousePointer = 11
- If Flag = False Then
- NewCount = 0
- End If
- ' Force the MCI control to complete before returning
- ' to the application.
- MMControl1.Wait = True
- MMControl1.UpdateInterval = 0
- 'Set Flag to True for controlling Shuffle play.
- Flag = True
- ' Set the DeviceType to a musical CD device.
- MMControl1.DeviceType = "CDAudio"
- ' Open Device and set time format.
- MMControl1.Command = "Open"
- MMControl1.TimeFormat = MCI_FORMAT_TMSF
- ' Set var to the total number of tracks.
- TotalTrk = MMControl1.Tracks
- Do
- C = 1 + NewCount
- Trk = Label1(1).Caption
- If C = 1 Then
- Exit Do
- Else
- Select Case C
- Case 2
- Trk = Label1(2).Caption
- If Trk = "" Then
- MousePointer = 0
- Call MMControl1_StopClick(-1)
- Exit Sub
- End If
- Exit Do
- Case 3
- Trk = Label1(3).Caption
- If Trk = "" Then
- MousePointer = 0
- Call MMControl1_StopClick(-1)
- Exit Sub
- End If
- Exit Do
- Case 4
- Trk = Label1(4).Caption
- If Trk = "" Then
- MousePointer = 0
- Call MMControl1_StopClick(-1)
- Exit Sub
- End If
- Exit Do
- Case 5
- Trk = Label1(5).Caption
- If Trk = "" Then
- MousePointer = 0
- Call MMControl1_StopClick(-1)
- Exit Sub
- End If
- Exit Do
- Case 6
- Trk = Label1(6).Caption
- If Trk = "" Then
- MousePointer = 0
- Call MMControl1_StopClick(-1)
- Exit Sub
- End If
- Exit Do
- Case 7
- Trk = Label1(7).Caption
- If Trk = "" Then
- MousePointer = 0
- Call MMControl1_StopClick(-1)
- Exit Sub
- End If
- Exit Do
- Case 8
- Trk = Label1(8).Caption
- If Trk = "" Then
- MousePointer = 0
- Call MMControl1_StopClick(-1)
- Exit Sub
- End If
- Exit Do
- Case 9
- Trk = Label1(9).Caption
- If Trk = "" Then
- MousePointer = 0
- Call MMControl1_StopClick(-1)
- Exit Sub
- End If
- Exit Do
- Case 10
- Trk = Label1(10).Caption
- If Trk = "" Then
- MousePointer = 0
- Call MMControl1_StopClick(-1)
- Exit Sub
- End If
- Exit Do
- Case 11
- Trk = Label1(11).Caption
- If Trk = "" Then
- MousePointer = 0
- Call MMControl1_StopClick(-1)
- Exit Sub
- End If
- Exit Do
- Case 12
- Trk = Label1(12).Caption
- If Trk = "" Then
- MousePointer = 0
- Call MMControl1_StopClick(-1)
- Exit Sub
- End If
- Exit Do
- Case 13
- Trk = Label1(13).Caption
- If Trk = "" Then
- MousePointer = 0
- Call MMControl1_StopClick(-1)
- Exit Sub
- End If
- Exit Do
- Case 14
- Trk = Label1(14).Caption
- If Trk = "" Then
- MousePointer = 0
- Call MMControl1_StopClick(-1)
- Exit Sub
- End If
- Exit Do
- Case 15
- Trk = Label1(15).Caption
- If Trk = "" Then
- MousePointer = 0
- Call MMControl1_StopClick(-1)
- Exit Sub
- End If
- Exit Do
- Case 16
- Trk = Label1(16).Caption
- If Trk = "" Then
- MousePointer = 0
- Call MMControl1_StopClick(-1)
- Exit Sub
- End If
- Exit Do
- Case 17
- Trk = Label1(17).Caption
- If Trk = "" Then
- MousePointer = 0
- Call MMControl1_StopClick(-1)
- Exit Sub
- End If
- Exit Do
- Case 18
- Trk = Label1(18).Caption
- If Trk = "" Then
- MousePointer = 0
- Call MMControl1_StopClick(-1)
- Exit Sub
- End If
- Exit Do
- Case 19
- Trk = Label1(19).Caption
- If Trk = "" Then
- MousePointer = 0
- Call MMControl1_StopClick(-1)
- Exit Sub
- End If
- Exit Do
- Case 20
- Trk = Label1(20).Caption
- If Trk = "" Then
- MousePointer = 0
- Call MMControl1_StopClick(-1)
- Exit Sub
- End If
- Exit Do
- Case 21
- Trk = Label1(21).Caption
- If Trk = "" Then
- MousePointer = 0
- Call MMControl1_StopClick(-1)
- Exit Sub
- End If
- Exit Do
- Case 22
- Trk = Label1(22).Caption
- If Trk = "" Then
- MousePointer = 0
- Call MMControl1_StopClick(-1)
- Exit Sub
- End If
- Exit Do
- Case 23
- Trk = Label1(23).Caption
- If Trk = "" Then
- MousePointer = 0
- Call MMControl1_StopClick(-1)
- Exit Sub
- End If
- Exit Do
- Case 24
- Trk = Label1(24).Caption
- If Trk = "" Then
- MousePointer = 0
- Call MMControl1_StopClick(-1)
- Exit Sub
- End If
- Exit Do
- Case 25
- Trk = Label1(25).Caption
- If Trk = "" Then
- MousePointer = 0
- Call MMControl1_StopClick(-1)
- Exit Sub
- End If
- Exit Do
- Case 26
- Trk = Label1(26).Caption
- If Trk = "" Then
- MousePointer = 0
- Call MMControl1_StopClick(-1)
- Exit Sub
- End If
- Exit Do
- Case 27
- Trk = Label1(27).Caption
- If Trk = "" Then
- MousePointer = 0
- Call MMControl1_StopClick(-1)
- Exit Sub
- End If
- Exit Do
- Case 28
- Trk = Label1(28).Caption
- If Trk = "" Then
- MousePointer = 0
- Call MMControl1_StopClick(-1)
- Exit Sub
- End If
- Exit Do
- Case 29
- Trk = Label1(29).Caption
- If Trk = "" Then
- MousePointer = 0
- Call MMControl1_StopClick(-1)
- Exit Sub
- End If
- Exit Do
- Case 30
- Trk = Label1(30).Caption
- If Trk = "" Then
- MousePointer = 0
- Call MMControl1_StopClick(-1)
- Exit Sub
- End If
- Exit Do
- Case 31
- Trk = Label1(31).Caption
- If Trk = "" Then
- MousePointer = 0
- Call MMControl1_StopClick(-1)
- Exit Sub
- End If
- Exit Do
- Case 32
- Trk = Label1(32).Caption
- If Trk = "" Then
- MousePointer = 0
- Call MMControl1_StopClick(-1)
- Exit Sub
- End If
- Exit Do
- Case 33
- Trk = Label1(33).Caption
- If Trk = "" Then
- MousePointer = 0
- Call MMControl1_StopClick(-1)
- Exit Sub
- End If
- Exit Do
- Case 34
- Trk = Label1(34).Caption
- If Trk = "" Then
- MousePointer = 0
- Call MMControl1_StopClick(-1)
- Exit Sub
- End If
- Exit Do
- Case 35
- Trk = Label1(35).Caption
- If Trk = "" Then
- MousePointer = 0
- Call MMControl1_StopClick(-1)
- Exit Sub
- End If
- Exit Do
- Case 36
- Trk = Label1(36).Caption
- If Trk = "" Then
- MousePointer = 0
- Call MMControl1_StopClick(-1)
- Exit Sub
- End If
- Exit Do
- Case Is > 36
- Call MMControl1_StopClick(-1)
- Exit Sub
- End Select
- End If
- Loop
- NewCount = NewCount + 1
- MMControl1.UpdateInterval = 1000
- ' Assure that the last track is played.
- If Trk = Val(Label2.Caption) Then
- MMControl1.From = Trk
- MMControl1.Command = "Play"
- Else
- MMControl1.From = Trk
- MMControl1.To = Trk + 1
- MMControl1.Command = "Play"
- End If
- MousePointer = 0
- End Sub
-