Private Sub picGuitarNeck_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim Ret As String, NoteX As Long, NoteY As Long, DS As DSCURSORS
Static PGIndex As Long, PGTime As Single
Static PDIndex As Long, PDTime As Single
Static PAIndex As Long, PATime As Single
Static PEIndex As Long, PETime As Single
lnX.X1 = X
lnX.X2 = X
lnY.Y1 = Y
lnY.Y2 = Y
Ret = GetNote(X, Y)
NoteX = Val(Mid(Ret, 3))
NoteY = Val(Left(Ret, 1))
Select Case NoteY
Case 0
Me.Caption = "G-" & NoteX
Case 1
Me.Caption = "D-" & NoteX
Case 2
Me.Caption = "A-" & NoteX
Case 3
Me.Caption = "E-" & NoteX
End Select
If Button = 1 Then
Select Case NoteY
Case 0
GBuff(NoteX).GetCurrentPosition DS
If DS.lPlay = 0 Then
If PGIndex = NoteX And PGTime + 0.2 >= Timer Then Exit Sub
PGIndex = NoteX
PGTime = Timer
GBuff(NoteX).Play DSBPLAY_DEFAULT
Text1.Text = Text1.Text + (Val(NoteX) & "-")
If NoteX >= 10 Then
Text2.Text = Text2.Text + "---"
Text3.Text = Text3.Text + "---"
Text4.Text = Text4.Text + "---"
Else
Text2.Text = Text2.Text + "--"
Text3.Text = Text3.Text + "--"
Text4.Text = Text4.Text + "--"
End If
End If
Case 1
DBuff(NoteX).GetCurrentPosition DS
If DS.lPlay = 0 Then
If PDIndex = NoteX And PDTime + 0.2 >= Timer Then Exit Sub
PDIndex = NoteX
PDTime = Timer
DBuff(NoteX).Play DSBPLAY_DEFAULT
Text2.Text = Text2.Text + (Val(NoteX) & "-")
If NoteX >= 10 Then
Text1.Text = Text1.Text + "---"
Text3.Text = Text3.Text + "---"
Text4.Text = Text4.Text + "---"
Else
Text1.Text = Text1.Text + "--"
Text3.Text = Text3.Text + "--"
Text4.Text = Text4.Text + "--"
End If
End If
Case 2
ABuff(NoteX).GetCurrentPosition DS
If DS.lPlay = 0 Then
If PAIndex = NoteX And PATime + 0.2 >= Timer Then Exit Sub
PAIndex = NoteX
PATime = Timer
ABuff(NoteX).Play DSBPLAY_DEFAULT
Text3.Text = Text3.Text + (Val(NoteX) & "-")
If NoteX >= 10 Then
Text1.Text = Text1.Text + "---"
Text2.Text = Text2.Text + "---"
Text4.Text = Text4.Text + "---"
Else
Text1.Text = Text1.Text + "--"
Text2.Text = Text2.Text + "--"
Text4.Text = Text4.Text + "--"
End If
End If
Case 3
EBuff(NoteX).GetCurrentPosition DS
If DS.lPlay = 0 Then
If PEIndex = NoteX And PETime + 0.2 >= Timer Then Exit Sub
PEIndex = NoteX
PETime = Timer
EBuff(NoteX).Play DSBPLAY_DEFAULT
Text4.Text = Text4.Text + (Val(NoteX) & "-")
If NoteX >= 10 Then
Text1.Text = Text1.Text + "---"
Text2.Text = Text2.Text + "---"
Text3.Text = Text3.Text + "---"
Else
Text1.Text = Text1.Text + "--"
Text2.Text = Text2.Text + "--"
Text3.Text = Text3.Text + "--"
End If
End If
End Select
End If
End Sub