GNU Info

Info Node: (python2.1-lib.info)Player Objects

(python2.1-lib.info)Player Objects


Next: Parser Objects Prev: cd Up: cd
Enter node , (file) or (file)node

Player Objects
--------------

Player objects (returned by `open()') have the following methods:

`allowremoval()'
     Unlocks the eject button on the CD-ROM drive permitting the user to
     eject the caddy if desired.

`bestreadsize()'
     Returns the best value to use for the NUM_FRAMES parameter of the
     `readda()' method.  Best is defined as the value that permits a
     continuous flow of data from the CD-ROM drive.

`close()'
     Frees the resources associated with the player object.  After
     calling `close()', the methods of the object should no longer be
     used.

`eject()'
     Ejects the caddy from the CD-ROM drive.

`getstatus()'
     Returns information pertaining to the current state of the CD-ROM
     drive.  The returned information is a tuple with the following
     values: STATE, TRACK, RTIME, ATIME, TTIME, FIRST, LAST,
     SCSI_AUDIO, CUR_BLOCK.  RTIME is the time relative to the start of
     the current track; ATIME is the time relative to the beginning of
     the disc; TTIME is the total time on the disc.  For more
     information on the meaning of the values, see the man page
     `CDgetstatus(3dm)'.  The value of STATE is one of the following:
     `ERROR', `NODISC', `READY', `PLAYING', `PAUSED', `STILL', or
     `CDROM'.

`gettrackinfo(track)'
     Returns information about the specified track.  The returned
     information is a tuple consisting of two elements, the start time
     of the track and the duration of the track.

`msftoblock(min, sec, frame)'
     Converts a minutes, seconds, frames triple representing a time in
     absolute time code into the corresponding logical block number for
     the given CD-ROM drive.  You should use `msftoframe()' rather than
     `msftoblock()' for comparing times.  The logical block number
     differs from the frame number by an offset required by certain
     CD-ROM drives.

`play(start, play)'
     Starts playback of an audio CD in the CD-ROM drive at the specified
     track.  The audio output appears on the CD-ROM drive's headphone
     and audio jacks (if fitted).  Play stops at the end of the disc.
     START is the number of the track at which to start playing the CD;
     if PLAY is 0, the CD will be set to an initial paused state.  The
     method `togglepause()' can then be used to commence play.

`playabs(minutes, seconds, frames, play)'
     Like `play()', except that the start is given in minutes, seconds,
     and frames instead of a track number.

`playtrack(start, play)'
     Like `play()', except that playing stops at the end of the track.

`playtrackabs(track, minutes, seconds, frames, play)'
     Like `play()', except that playing begins at the specified
     absolute time and ends at the end of the specified track.

`preventremoval()'
     Locks the eject button on the CD-ROM drive thus preventing the user
     from arbitrarily ejecting the caddy.

`readda(num_frames)'
     Reads the specified number of frames from an audio CD mounted in
     the CD-ROM drive.  The return value is a string representing the
     audio frames.  This string can be passed unaltered to the
     `parseframe()' method of the parser object.

`seek(minutes, seconds, frames)'
     Sets the pointer that indicates the starting point of the next
     read of digital audio data from a CD-ROM.  The pointer is set to
     an absolute time code location specified in MINUTES, SECONDS, and
     FRAMES.  The return value is the logical block number to which the
     pointer has been set.

`seekblock(block)'
     Sets the pointer that indicates the starting point of the next
     read of digital audio data from a CD-ROM.  The pointer is set to
     the specified logical block number.  The return value is the
     logical block number to which the pointer has been set.

`seektrack(track)'
     Sets the pointer that indicates the starting point of the next
     read of digital audio data from a CD-ROM.  The pointer is set to
     the specified track.  The return value is the logical block number
     to which the pointer has been set.

`stop()'
     Stops the current playing operation.

`togglepause()'
     Pauses the CD if it is playing, and makes it play if it is paused.


automatically generated by info2www version 1.2.2.9