-
I'm making another program, a CD Player. I got most code from reading the MSDN liabrary on VB Help, so I got things like play, stop, eject, etc. to work, now what I would like to do is make 2 lines (line1 & line2) example:
___|________________
****|
(*'s dont count, I just need then to take up room)
the line accross is line1, and the one that is vertical is line2, now how do I get line2 to show at what place in track, the user is at now.
If you dont know what I'm trying to say, you know how the Real Player has the thing that shows at what part of the song the thing is at, well I'm trying to make that for my program
thanks in advance
[Edited by dimava on 07-14-2000 at 08:45 PM]
-
Not sure if this'll work but you could try it.
Code:
Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
Sub GetCDPosition(Track%, Min%, Sec%)
Dim s As String * 30
mciSendString "status cd position", s, Len(s), 0
Track = CInt(Mid$(s, 1, 2))
Min = CInt(Mid$(s, 4, 2))
Sec = CInt(Mid$(s, 7, 2))
End Sub
-
how about line1 & line2 how do I link the code for that?
-
yes matt, you are right, You gave me code above, and maybe it will work, but how do you link the code above with the 2 lines?
-
I don't exactly know the code, but I have an idea. You'd have to fool around with the Line's properties X1, X2, Y1, Y2. I think X1 and Y1 will be used though.
-
can you pleese give me some sample code, and I can explore from there
-
Code:
_______|____
*******|
Code:
Sub GetCDPosition(Track%, Min%, Sec%)
Dim s As String * 30
mciSendString "status cd position", s, Len(s), 0
Line2.X1 = CInt(Mid$(s, 1, 2))
Line1.X1 = CInt(Mid$(s, 4, 2))
Line1.Y1 = CInt(Mid$(s, 7, 2))
End Sub
That's just a guess. I don't know if it will work. Hope it works. Goodluck.
-
one more question:
where do I put that code? cause I have a command button that says PLAY
so where do I insert the code above?
-
First you need to take note of where the vertical line (vline) is.
Since horizontal line (hline) is not moving at all.
So the code will go into play.
How long the song takes has to be taken into concern because you need to know when to actually stop the vline.
In the stop button, when the music stops, the vline will go back to its original place.
The code should go in the PLAY button...right where the music starts...or your CD Player is going to be way off. Good luck!