Results 1 to 2 of 2

Thread: CD Player - determining track number

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Posts
    2
    I'm writing a cd player in VB6 using API calls - I have been using code to detect which track is currently playing but it doesn't appear to work.

    I have created a playlist feature which means that the tracks do not have to have any particular order therefore I need to know what the ACTUAL track is rather than guess using listindexes.

    The code I have been using contains this section but today it's screwing up and telling me the wrong track number - is there a better way??

    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))

  2. #2
    Junior Member
    Join Date
    Jun 2000
    Posts
    25
    so it worked before?

    remember that when u get status the returnd string it`s filled with "0" after the actual value that u were looking for ... hope that helps ... anyways u could use
    "status current track" string ...


    http://msdn.microsoft.com/library/ps...mdstr_6tyl.htm

    here`s a piece of similar code I`m using

    Public Property Get status() As String 'get current status of the song .. (playing ,stopped etc)
    If opened = False Then Exit Property
    Dim start As Integer
    mciReturnLong = mciSendString("Status song mode ", mciReturnString, 255, 0)
    start = Val#(InStr(mciReturnString, Chr$(0)))
    status = Left$(mciReturnString, start - 1)
    End Property

    give me the handle and I`ll give you the world
    Adam
    junior programmer

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