Results 1 to 9 of 9

Thread: CD Track Lenght

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715

    Exclamation

    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

  2. #2
    Guest
    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

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    how about line1 & line2 how do I link the code for that?
    NXSupport - Your one-stop source for computer help

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    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

  5. #5
    Guest
    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.

  6. #6

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    can you pleese give me some sample code, and I can explore from there
    NXSupport - Your one-stop source for computer help

  7. #7
    Guest
    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.

  8. #8

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    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

  9. #9
    Guest
    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
  •  



Click Here to Expand Forum to Full Width