[Contents] [Index] [Help] [Retrace] [Browse <] [Browse >]


   NAME
       CD_QCODELSN -- Report current disk position.

   IO REQUEST
       io_Device       preset by the call to OpenDevice()
       io_Unit         preset by the call to OpenDevice()
       io_Command      CD_QCODELSN
       io_Data         pointer to QCode structure
       io_Length       0 - MUST be zero (for future compatability)

   RESULTS
       io_Error        0 for success, or an error code as defined in
                       <devices/cd.h>

   FUNCTION
       This command reports current subcode Q channel time information.  This
       command only returns data when CD Audio is playing (or paused).  At
       any other time, an error is returned.  The Q-Code packet consists of:

       struct QCode {

           UBYTE        CtlAdr;        /* Data type / QCode type           */
           UBYTE        Track;         /* Track number                     */
           UBYTE        Index;         /* Track subindex number            */
           UBYTE        Zero;          /* The "Zero" byte of Q-Code packet */
           union LSNMSF TrackPosition; /* Position from start of track     */
           union LSNMSF DiskPosition;  /* Position from start of disk      */
           };

   EXAMPLE

       struct QCode qcode;

       ior->io_Command = CD_QCODELSN;  /* Retrieve TOC information */
       ior->io_Length  = 0;            /* MUST be zero             */
       ior->io_Data    = (APTR)qcode;  /* Here's where we want it  */
       DoIO (ior);

       if (!ior->io_Error) {           /* Command succeeded        */

           printf("Current position is: %ldn", qcode.DiskPosition.LSN);
           }

   NOTES
       This function may not return immediately.  It may take several frames
       to pass by before a valid Q-Code packet can be returned.  Use SendIO()
       and CheckIO() if response time is critical, and the information is
       not.

   BUGS

   SEE ALSO
       CD_PLAYMSF, CD_PLAYLSN, CD_PLAYTRACK, <devices/cd.h>