|
-
Jul 14th, 2000, 07:42 PM
#1
Thread Starter
Frenzied Member
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]
NXSupport - Your one-stop source for computer help
-
Jul 14th, 2000, 08:23 PM
#2
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
-
Jul 14th, 2000, 08:24 PM
#3
Thread Starter
Frenzied Member
how about line1 & line2 how do I link the code for that?
NXSupport - Your one-stop source for computer help
-
Jul 16th, 2000, 09:45 PM
#4
Thread Starter
Frenzied Member
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?
NXSupport - Your one-stop source for computer help
-
Jul 16th, 2000, 09:58 PM
#5
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.
-
Jul 16th, 2000, 10:45 PM
#6
Thread Starter
Frenzied Member
can you pleese give me some sample code, and I can explore from there
NXSupport - Your one-stop source for computer help
-
Jul 16th, 2000, 10:58 PM
#7
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.
-
Jul 16th, 2000, 11:02 PM
#8
Thread Starter
Frenzied Member
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?
NXSupport - Your one-stop source for computer help
-
Jul 17th, 2000, 12:06 AM
#9
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!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|