mirror of https://github.com/python/cpython.git
Logical markup.
Convert a {description} list to a {tableii} environment.
This commit is contained in:
parent
ae25be2e4d
commit
d98329cdf0
|
@ -6,9 +6,9 @@ This module provides an interface to the Silicon Graphics CD library.
|
||||||
It is available only on Silicon Graphics systems.
|
It is available only on Silicon Graphics systems.
|
||||||
|
|
||||||
The way the library works is as follows. A program opens the CD-ROM
|
The way the library works is as follows. A program opens the CD-ROM
|
||||||
device with \code{cd.open()} and creates a parser to parse the data
|
device with \function{open()} and creates a parser to parse the data
|
||||||
from the CD with \code{cd.createparser()}. The object returned by
|
from the CD with \function{createparser()}. The object returned by
|
||||||
\code{cd.open()} can be used to read data from the CD, but also to get
|
\function{open()} can be used to read data from the CD, but also to get
|
||||||
status information for the CD-ROM device, and to get information about
|
status information for the CD-ROM device, and to get information about
|
||||||
the CD, such as the table of contents. Data from the CD is passed to
|
the CD, such as the table of contents. Data from the CD is passed to
|
||||||
the parser, which parses the frames, and calls any callback
|
the parser, which parses the frames, and calls any callback
|
||||||
|
@ -27,34 +27,34 @@ functions use the latter representation. Positions can be both
|
||||||
relative to the beginning of the CD, and to the beginning of the
|
relative to the beginning of the CD, and to the beginning of the
|
||||||
track.
|
track.
|
||||||
|
|
||||||
Module \code{cd} defines the following functions and constants:
|
Module \module{cd} defines the following functions and constants:
|
||||||
|
|
||||||
\setindexsubitem{(in module cd)}
|
|
||||||
|
|
||||||
\begin{funcdesc}{createparser}{}
|
\begin{funcdesc}{createparser}{}
|
||||||
Create and return an opaque parser object. The methods of the parser
|
Create and return an opaque parser object. The methods of the parser
|
||||||
object are described below.
|
object are described below.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{msftoframe}{min\, sec\, frame}
|
\begin{funcdesc}{msftoframe}{minutes, seconds, frames}
|
||||||
Converts a \code{(minutes, seconds, frames)} triple representing time
|
Converts a \code{(\var{minutes}, \var{seconds}, \var{frames})} triple
|
||||||
in absolute time code into the corresponding CD frame number.
|
representing time in absolute time code into the corresponding CD
|
||||||
|
frame number.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{open}{\optional{device\optional{\, mode}}}
|
\begin{funcdesc}{open}{\optional{device\optional{, mode}}}
|
||||||
Open the CD-ROM device. The return value is an opaque player object;
|
Open the CD-ROM device. The return value is an opaque player object;
|
||||||
methods of the player object are described below. The device is the
|
methods of the player object are described below. The device is the
|
||||||
name of the SCSI device file, e.g. /dev/scsi/sc0d4l0, or \code{None}.
|
name of the SCSI device file, e.g. \code{'/dev/scsi/sc0d4l0'}, or
|
||||||
If omited or \code{None}, the hardware inventory is consulted to
|
\code{None}. If omitted or \code{None}, the hardware inventory is
|
||||||
locate a CD-ROM drive. The \code{mode}, if not omited, should be the
|
consulted to locate a CD-ROM drive. The \var{mode}, if not omited,
|
||||||
string 'r'.
|
should be the string \code{'r'}.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
The module defines the following variables:
|
The module defines the following variables:
|
||||||
|
|
||||||
\begin{datadesc}{error}
|
\begin{excdesc}{error}
|
||||||
Exception raised on various errors.
|
Exception raised on various errors.
|
||||||
\end{datadesc}
|
\end{excdesc}
|
||||||
|
|
||||||
\begin{datadesc}{DATASIZE}
|
\begin{datadesc}{DATASIZE}
|
||||||
The size of one frame's worth of audio data. This is the size of the
|
The size of one frame's worth of audio data. This is the size of the
|
||||||
|
@ -65,7 +65,8 @@ audio data as passed to the callback of type \code{audio}.
|
||||||
The size of one uninterpreted frame of audio data.
|
The size of one uninterpreted frame of audio data.
|
||||||
\end{datadesc}
|
\end{datadesc}
|
||||||
|
|
||||||
The following variables are states as returned by \code{getstatus}:
|
The following variables are states as returned by
|
||||||
|
\function{getstatus()}:
|
||||||
|
|
||||||
\begin{datadesc}{READY}
|
\begin{datadesc}{READY}
|
||||||
The drive is ready for operation loaded with an audio CD.
|
The drive is ready for operation loaded with an audio CD.
|
||||||
|
@ -95,7 +96,7 @@ The drive is in CD layer mode with play paused.
|
||||||
\end{datadesc}
|
\end{datadesc}
|
||||||
|
|
||||||
\begin{datadesc}{STILL}
|
\begin{datadesc}{STILL}
|
||||||
The equivalent of \code{PAUSED} on older (non 3301) model Toshiba
|
The equivalent of \constant{PAUSED} on older (non 3301) model Toshiba
|
||||||
CD-ROM drives. Such drives have never been shipped by SGI.
|
CD-ROM drives. Such drives have never been shipped by SGI.
|
||||||
\end{datadesc}
|
\end{datadesc}
|
||||||
|
|
||||||
|
@ -108,14 +109,14 @@ CD-ROM drives. Such drives have never been shipped by SGI.
|
||||||
\dataline{ident}
|
\dataline{ident}
|
||||||
\dataline{control}
|
\dataline{control}
|
||||||
Integer constants describing the various types of parser callbacks
|
Integer constants describing the various types of parser callbacks
|
||||||
that can be set by the \code{addcallback()} method of CD parser
|
that can be set by the \method{addcallback()} method of CD parser
|
||||||
objects (see below).
|
objects (see below).
|
||||||
\end{datadesc}
|
\end{datadesc}
|
||||||
|
|
||||||
Player objects (returned by \code{cd.open()}) have the following
|
Player objects (returned by \function{open()}) have the following
|
||||||
methods:
|
methods:
|
||||||
|
|
||||||
\setindexsubitem{(CD player object method)}
|
\setindexsubitem{(CD player method)}
|
||||||
|
|
||||||
\begin{funcdesc}{allowremoval}{}
|
\begin{funcdesc}{allowremoval}{}
|
||||||
Unlocks the eject button on the CD-ROM drive permitting the user to
|
Unlocks the eject button on the CD-ROM drive permitting the user to
|
||||||
|
@ -123,14 +124,14 @@ eject the caddy if desired.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{bestreadsize}{}
|
\begin{funcdesc}{bestreadsize}{}
|
||||||
Returns the best value to use for the \code{num_frames} parameter of
|
Returns the best value to use for the \var{num_frames} parameter of
|
||||||
the \code{readda} method. Best is defined as the value that permits a
|
the \method{readda()} method. Best is defined as the value that
|
||||||
continuous flow of data from the CD-ROM drive.
|
permits a continuous flow of data from the CD-ROM drive.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{close}{}
|
\begin{funcdesc}{close}{}
|
||||||
Frees the resources associated with the player object. After calling
|
Frees the resources associated with the player object. After calling
|
||||||
\code{close}, the methods of the object should no longer be used.
|
\method{close()}, the methods of the object should no longer be used.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{eject}{}
|
\begin{funcdesc}{eject}{}
|
||||||
|
@ -140,15 +141,15 @@ Ejects the caddy from the CD-ROM drive.
|
||||||
\begin{funcdesc}{getstatus}{}
|
\begin{funcdesc}{getstatus}{}
|
||||||
Returns information pertaining to the current state of the CD-ROM
|
Returns information pertaining to the current state of the CD-ROM
|
||||||
drive. The returned information is a tuple with the following values:
|
drive. The returned information is a tuple with the following values:
|
||||||
\code{state}, \code{track}, \code{rtime}, \code{atime}, \code{ttime},
|
\var{state}, \var{track}, \var{rtime}, \var{atime}, \var{ttime},
|
||||||
\code{first}, \code{last}, \code{scsi_audio}, \code{cur_block}.
|
\var{first}, \var{last}, \var{scsi_audio}, \var{cur_block}.
|
||||||
\code{rtime} is the time relative to the start of the current track;
|
\var{rtime} is the time relative to the start of the current track;
|
||||||
\code{atime} is the time relative to the beginning of the disc;
|
\var{atime} is the time relative to the beginning of the disc;
|
||||||
\code{ttime} is the total time on the disc. For more information on
|
\var{ttime} is the total time on the disc. For more information on
|
||||||
the meaning of the values, see the manual for CDgetstatus.
|
the meaning of the values, see the man page \manpage{CDgetstatus}{3dm}.
|
||||||
The value of \code{state} is one of the following: \code{cd.ERROR},
|
The value of \var{state} is one of the following: \constant{ERROR},
|
||||||
\code{cd.NODISC}, \code{cd.READY}, \code{cd.PLAYING},
|
\constant{NODISC}, \constant{READY}, \constant{PLAYING},
|
||||||
\code{cd.PAUSED}, \code{cd.STILL}, or \code{cd.CDROM}.
|
\constant{PAUSED}, \constant{STILL}, or \constant{CDROM}.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{gettrackinfo}{track}
|
\begin{funcdesc}{gettrackinfo}{track}
|
||||||
|
@ -157,36 +158,37 @@ information is a tuple consisting of two elements, the start time of
|
||||||
the track and the duration of the track.
|
the track and the duration of the track.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{msftoblock}{min\, sec\, frame}
|
\begin{funcdesc}{msftoblock}{min, sec, frame}
|
||||||
Converts a minutes, seconds, frames triple representing a time in
|
Converts a minutes, seconds, frames triple representing a time in
|
||||||
absolute time code into the corresponding logical block number for the
|
absolute time code into the corresponding logical block number for the
|
||||||
given CD-ROM drive. You should use \code{cd.msftoframe()} rather than
|
given CD-ROM drive. You should use \function{msftoframe()} rather than
|
||||||
\code{msftoblock()} for comparing times. The logical block number
|
\method{msftoblock()} for comparing times. The logical block number
|
||||||
differs from the frame number by an offset required by certain CD-ROM
|
differs from the frame number by an offset required by certain CD-ROM
|
||||||
drives.
|
drives.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{play}{start\, play}
|
\begin{funcdesc}{play}{start, play}
|
||||||
Starts playback of an audio CD in the CD-ROM drive at the specified
|
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
|
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.
|
audio jacks (if fitted). Play stops at the end of the disc.
|
||||||
\code{start} is the number of the track at which to start playing the
|
\var{start} is the number of the track at which to start playing the
|
||||||
CD; if \code{play} is 0, the CD will be set to an initial paused
|
CD; if \var{play} is 0, the CD will be set to an initial paused
|
||||||
state. The method \code{togglepause()} can then be used to commence
|
state. The method \method{togglepause()} can then be used to commence
|
||||||
play.
|
play.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{playabs}{min\, sec\, frame\, play}
|
\begin{funcdesc}{playabs}{minutes, seconds, frames, play}
|
||||||
Like \code{play()}, except that the start is given in minutes,
|
Like \method{play()}, except that the start is given in minutes,
|
||||||
seconds, frames instead of a track number.
|
seconds, and frames instead of a track number.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{playtrack}{start\, play}
|
\begin{funcdesc}{playtrack}{start, play}
|
||||||
Like \code{play()}, except that playing stops at the end of the track.
|
Like \method{play()}, except that playing stops at the end of the
|
||||||
|
track.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{playtrackabs}{track\, min\, sec\, frame\, play}
|
\begin{funcdesc}{playtrackabs}{track, minutes, seconds, frames, play}
|
||||||
Like \code{play()}, except that playing begins at the spcified
|
Like \method{play()}, except that playing begins at the spcified
|
||||||
absolute time and ends at the end of the specified track.
|
absolute time and ends at the end of the specified track.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
|
@ -198,16 +200,16 @@ from arbitrarily ejecting the caddy.
|
||||||
\begin{funcdesc}{readda}{num_frames}
|
\begin{funcdesc}{readda}{num_frames}
|
||||||
Reads the specified number of frames from an audio CD mounted in the
|
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
|
CD-ROM drive. The return value is a string representing the audio
|
||||||
frames. This string can be passed unaltered to the \code{parseframe}
|
frames. This string can be passed unaltered to the
|
||||||
method of the parser object.
|
\method{parseframe()} method of the parser object.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{seek}{min\, sec\, frame}
|
\begin{funcdesc}{seek}{minutes, seconds, frames}
|
||||||
Sets the pointer that indicates the starting point of the next read of
|
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
|
digital audio data from a CD-ROM. The pointer is set to an absolute
|
||||||
time code location specified in minutes, seconds, and frames. The
|
time code location specified in \var{minutes}, \var{seconds}, and
|
||||||
return value is the logical block number to which the pointer has been
|
\var{frames}. The return value is the logical block number to which
|
||||||
set.
|
the pointer has been set.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{seekblock}{block}
|
\begin{funcdesc}{seekblock}{block}
|
||||||
|
@ -232,46 +234,40 @@ Stops the current playing operation.
|
||||||
Pauses the CD if it is playing, and makes it play if it is paused.
|
Pauses the CD if it is playing, and makes it play if it is paused.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
Parser objects (returned by \code{cd.createparser()}) have the
|
Parser objects (returned by \function{createparser()}) have the
|
||||||
following methods:
|
following methods:
|
||||||
|
|
||||||
\setindexsubitem{(CD parser object method)}
|
\setindexsubitem{(CD parser method)}
|
||||||
|
|
||||||
\begin{funcdesc}{addcallback}{type\, func\, arg}
|
\begin{funcdesc}{addcallback}{type, func, arg}
|
||||||
Adds a callback for the parser. The parser has callbacks for eight
|
Adds a callback for the parser. The parser has callbacks for eight
|
||||||
different types of data in the digital audio data stream. Constants
|
different types of data in the digital audio data stream. Constants
|
||||||
for these types are defined at the \code{cd} module level (see above).
|
for these types are defined at the \module{cd} module level (see above).
|
||||||
The callback is called as follows: \code{func(arg, type, data)}, where
|
The callback is called as follows: \code{\var{func}(\var{arg}, type,
|
||||||
\code{arg} is the user supplied argument, \code{type} is the
|
data)}, where \var{arg} is the user supplied argument, \var{type} is
|
||||||
particular type of callback, and \code{data} is the data returned for
|
the particular type of callback, and \var{data} is the data returned
|
||||||
this \code{type} of callback. The type of the data depends on the
|
for this \var{type} of callback. The type of the data depends on the
|
||||||
\code{type} of callback as follows:
|
\var{type} of callback as follows:
|
||||||
\begin{description}
|
|
||||||
\item[\code{cd.audio}: ]
|
\begin{tableii}{|l|l|}{code}{Type}{Value}
|
||||||
The argument is a string which can be passed unmodified to
|
\lineii{audio}{String which can be passed unmodified to
|
||||||
\code{al.writesamps()}.
|
\function{al.writesamps()}.}
|
||||||
\item[\code{cd.pnum}: ]
|
\lineii{pnum}{Integer giving the program (track) number.}
|
||||||
The argument is an integer giving the program (track) number.
|
\lineii{index}{Integer giving the index number.}
|
||||||
\item[\code{cd.index}: ]
|
\lineii{ptime}{Tuple consisting of the program time in minutes,
|
||||||
The argument is an integer giving the index number.
|
seconds, and frames.}
|
||||||
\item[\code{cd.ptime}: ]
|
\lineii{atime}{Tuple consisting of the absolute time in minutes,
|
||||||
The argument is a tuple consisting of the program time in minutes,
|
seconds, and frames.}
|
||||||
seconds, and frames.
|
\lineii{catalog}{String of 13 characters, giving the catalog number
|
||||||
\item[\code{cd.atime}: ]
|
of the CD.}
|
||||||
The argument is a tuple consisting of the absolute time in minutes,
|
\lineii{ident}{String of 12 characters, giving the ISRC
|
||||||
seconds, and frames.
|
identification number of the recording. \\
|
||||||
\item[\code{cd.catalog}: ]
|
&The string consists of two characters country code, three characters
|
||||||
The argument is a string of 13 characters, giving the catalog number
|
owner code, \\
|
||||||
of the CD.
|
&two characters giving the year, and five characters giving a serial number.}
|
||||||
\item[\code{cd.ident}: ]
|
\lineii{control}{Integer giving the control bits from the CD
|
||||||
The argument is a string of 12 characters, giving the ISRC
|
subcode data}
|
||||||
identification number of the recording. The string consists of two
|
\end{tableii}
|
||||||
characters country code, three characters owner code, two characters
|
|
||||||
giving the year, and five characters giving a serial number.
|
|
||||||
\item[\code{cd.control}: ]
|
|
||||||
The argument is an integer giving the control bits from the CD subcode
|
|
||||||
data.
|
|
||||||
\end{description}
|
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{deleteparser}{}
|
\begin{funcdesc}{deleteparser}{}
|
||||||
|
@ -282,20 +278,20 @@ when the last reference to the object is removed.
|
||||||
|
|
||||||
\begin{funcdesc}{parseframe}{frame}
|
\begin{funcdesc}{parseframe}{frame}
|
||||||
Parses one or more frames of digital audio data from a CD such as
|
Parses one or more frames of digital audio data from a CD such as
|
||||||
returned by \code{readda}. It determines which subcodes are present
|
returned by \method{readda()}. It determines which subcodes are
|
||||||
in the data. If these subcodes have changed since the last frame,
|
present in the data. If these subcodes have changed since the last
|
||||||
then \code{parseframe} executes a callback of the appropriate type
|
frame, then \method{parseframe()} executes a callback of the
|
||||||
passing to it the subcode data found in the frame.
|
appropriate type passing to it the subcode data found in the frame.
|
||||||
Unlike the C function, more than one frame of digital audio data can
|
Unlike the \C{} function, more than one frame of digital audio data
|
||||||
be passed to this method.
|
can be passed to this method.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{removecallback}{type}
|
\begin{funcdesc}{removecallback}{type}
|
||||||
Removes the callback for the given \code{type}.
|
Removes the callback for the given \var{type}.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{resetparser}{}
|
\begin{funcdesc}{resetparser}{}
|
||||||
Resets the fields of the parser used for tracking subcodes to an
|
Resets the fields of the parser used for tracking subcodes to an
|
||||||
initial state. \code{resetparser} should be called after the disc has
|
initial state. \method{resetparser()} should be called after the disc
|
||||||
been changed.
|
has been changed.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
190
Doc/libcd.tex
190
Doc/libcd.tex
|
@ -6,9 +6,9 @@ This module provides an interface to the Silicon Graphics CD library.
|
||||||
It is available only on Silicon Graphics systems.
|
It is available only on Silicon Graphics systems.
|
||||||
|
|
||||||
The way the library works is as follows. A program opens the CD-ROM
|
The way the library works is as follows. A program opens the CD-ROM
|
||||||
device with \code{cd.open()} and creates a parser to parse the data
|
device with \function{open()} and creates a parser to parse the data
|
||||||
from the CD with \code{cd.createparser()}. The object returned by
|
from the CD with \function{createparser()}. The object returned by
|
||||||
\code{cd.open()} can be used to read data from the CD, but also to get
|
\function{open()} can be used to read data from the CD, but also to get
|
||||||
status information for the CD-ROM device, and to get information about
|
status information for the CD-ROM device, and to get information about
|
||||||
the CD, such as the table of contents. Data from the CD is passed to
|
the CD, such as the table of contents. Data from the CD is passed to
|
||||||
the parser, which parses the frames, and calls any callback
|
the parser, which parses the frames, and calls any callback
|
||||||
|
@ -27,34 +27,34 @@ functions use the latter representation. Positions can be both
|
||||||
relative to the beginning of the CD, and to the beginning of the
|
relative to the beginning of the CD, and to the beginning of the
|
||||||
track.
|
track.
|
||||||
|
|
||||||
Module \code{cd} defines the following functions and constants:
|
Module \module{cd} defines the following functions and constants:
|
||||||
|
|
||||||
\setindexsubitem{(in module cd)}
|
|
||||||
|
|
||||||
\begin{funcdesc}{createparser}{}
|
\begin{funcdesc}{createparser}{}
|
||||||
Create and return an opaque parser object. The methods of the parser
|
Create and return an opaque parser object. The methods of the parser
|
||||||
object are described below.
|
object are described below.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{msftoframe}{min\, sec\, frame}
|
\begin{funcdesc}{msftoframe}{minutes, seconds, frames}
|
||||||
Converts a \code{(minutes, seconds, frames)} triple representing time
|
Converts a \code{(\var{minutes}, \var{seconds}, \var{frames})} triple
|
||||||
in absolute time code into the corresponding CD frame number.
|
representing time in absolute time code into the corresponding CD
|
||||||
|
frame number.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{open}{\optional{device\optional{\, mode}}}
|
\begin{funcdesc}{open}{\optional{device\optional{, mode}}}
|
||||||
Open the CD-ROM device. The return value is an opaque player object;
|
Open the CD-ROM device. The return value is an opaque player object;
|
||||||
methods of the player object are described below. The device is the
|
methods of the player object are described below. The device is the
|
||||||
name of the SCSI device file, e.g. /dev/scsi/sc0d4l0, or \code{None}.
|
name of the SCSI device file, e.g. \code{'/dev/scsi/sc0d4l0'}, or
|
||||||
If omited or \code{None}, the hardware inventory is consulted to
|
\code{None}. If omitted or \code{None}, the hardware inventory is
|
||||||
locate a CD-ROM drive. The \code{mode}, if not omited, should be the
|
consulted to locate a CD-ROM drive. The \var{mode}, if not omited,
|
||||||
string 'r'.
|
should be the string \code{'r'}.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
The module defines the following variables:
|
The module defines the following variables:
|
||||||
|
|
||||||
\begin{datadesc}{error}
|
\begin{excdesc}{error}
|
||||||
Exception raised on various errors.
|
Exception raised on various errors.
|
||||||
\end{datadesc}
|
\end{excdesc}
|
||||||
|
|
||||||
\begin{datadesc}{DATASIZE}
|
\begin{datadesc}{DATASIZE}
|
||||||
The size of one frame's worth of audio data. This is the size of the
|
The size of one frame's worth of audio data. This is the size of the
|
||||||
|
@ -65,7 +65,8 @@ audio data as passed to the callback of type \code{audio}.
|
||||||
The size of one uninterpreted frame of audio data.
|
The size of one uninterpreted frame of audio data.
|
||||||
\end{datadesc}
|
\end{datadesc}
|
||||||
|
|
||||||
The following variables are states as returned by \code{getstatus}:
|
The following variables are states as returned by
|
||||||
|
\function{getstatus()}:
|
||||||
|
|
||||||
\begin{datadesc}{READY}
|
\begin{datadesc}{READY}
|
||||||
The drive is ready for operation loaded with an audio CD.
|
The drive is ready for operation loaded with an audio CD.
|
||||||
|
@ -95,7 +96,7 @@ The drive is in CD layer mode with play paused.
|
||||||
\end{datadesc}
|
\end{datadesc}
|
||||||
|
|
||||||
\begin{datadesc}{STILL}
|
\begin{datadesc}{STILL}
|
||||||
The equivalent of \code{PAUSED} on older (non 3301) model Toshiba
|
The equivalent of \constant{PAUSED} on older (non 3301) model Toshiba
|
||||||
CD-ROM drives. Such drives have never been shipped by SGI.
|
CD-ROM drives. Such drives have never been shipped by SGI.
|
||||||
\end{datadesc}
|
\end{datadesc}
|
||||||
|
|
||||||
|
@ -108,14 +109,14 @@ CD-ROM drives. Such drives have never been shipped by SGI.
|
||||||
\dataline{ident}
|
\dataline{ident}
|
||||||
\dataline{control}
|
\dataline{control}
|
||||||
Integer constants describing the various types of parser callbacks
|
Integer constants describing the various types of parser callbacks
|
||||||
that can be set by the \code{addcallback()} method of CD parser
|
that can be set by the \method{addcallback()} method of CD parser
|
||||||
objects (see below).
|
objects (see below).
|
||||||
\end{datadesc}
|
\end{datadesc}
|
||||||
|
|
||||||
Player objects (returned by \code{cd.open()}) have the following
|
Player objects (returned by \function{open()}) have the following
|
||||||
methods:
|
methods:
|
||||||
|
|
||||||
\setindexsubitem{(CD player object method)}
|
\setindexsubitem{(CD player method)}
|
||||||
|
|
||||||
\begin{funcdesc}{allowremoval}{}
|
\begin{funcdesc}{allowremoval}{}
|
||||||
Unlocks the eject button on the CD-ROM drive permitting the user to
|
Unlocks the eject button on the CD-ROM drive permitting the user to
|
||||||
|
@ -123,14 +124,14 @@ eject the caddy if desired.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{bestreadsize}{}
|
\begin{funcdesc}{bestreadsize}{}
|
||||||
Returns the best value to use for the \code{num_frames} parameter of
|
Returns the best value to use for the \var{num_frames} parameter of
|
||||||
the \code{readda} method. Best is defined as the value that permits a
|
the \method{readda()} method. Best is defined as the value that
|
||||||
continuous flow of data from the CD-ROM drive.
|
permits a continuous flow of data from the CD-ROM drive.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{close}{}
|
\begin{funcdesc}{close}{}
|
||||||
Frees the resources associated with the player object. After calling
|
Frees the resources associated with the player object. After calling
|
||||||
\code{close}, the methods of the object should no longer be used.
|
\method{close()}, the methods of the object should no longer be used.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{eject}{}
|
\begin{funcdesc}{eject}{}
|
||||||
|
@ -140,15 +141,15 @@ Ejects the caddy from the CD-ROM drive.
|
||||||
\begin{funcdesc}{getstatus}{}
|
\begin{funcdesc}{getstatus}{}
|
||||||
Returns information pertaining to the current state of the CD-ROM
|
Returns information pertaining to the current state of the CD-ROM
|
||||||
drive. The returned information is a tuple with the following values:
|
drive. The returned information is a tuple with the following values:
|
||||||
\code{state}, \code{track}, \code{rtime}, \code{atime}, \code{ttime},
|
\var{state}, \var{track}, \var{rtime}, \var{atime}, \var{ttime},
|
||||||
\code{first}, \code{last}, \code{scsi_audio}, \code{cur_block}.
|
\var{first}, \var{last}, \var{scsi_audio}, \var{cur_block}.
|
||||||
\code{rtime} is the time relative to the start of the current track;
|
\var{rtime} is the time relative to the start of the current track;
|
||||||
\code{atime} is the time relative to the beginning of the disc;
|
\var{atime} is the time relative to the beginning of the disc;
|
||||||
\code{ttime} is the total time on the disc. For more information on
|
\var{ttime} is the total time on the disc. For more information on
|
||||||
the meaning of the values, see the manual for CDgetstatus.
|
the meaning of the values, see the man page \manpage{CDgetstatus}{3dm}.
|
||||||
The value of \code{state} is one of the following: \code{cd.ERROR},
|
The value of \var{state} is one of the following: \constant{ERROR},
|
||||||
\code{cd.NODISC}, \code{cd.READY}, \code{cd.PLAYING},
|
\constant{NODISC}, \constant{READY}, \constant{PLAYING},
|
||||||
\code{cd.PAUSED}, \code{cd.STILL}, or \code{cd.CDROM}.
|
\constant{PAUSED}, \constant{STILL}, or \constant{CDROM}.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{gettrackinfo}{track}
|
\begin{funcdesc}{gettrackinfo}{track}
|
||||||
|
@ -157,36 +158,37 @@ information is a tuple consisting of two elements, the start time of
|
||||||
the track and the duration of the track.
|
the track and the duration of the track.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{msftoblock}{min\, sec\, frame}
|
\begin{funcdesc}{msftoblock}{min, sec, frame}
|
||||||
Converts a minutes, seconds, frames triple representing a time in
|
Converts a minutes, seconds, frames triple representing a time in
|
||||||
absolute time code into the corresponding logical block number for the
|
absolute time code into the corresponding logical block number for the
|
||||||
given CD-ROM drive. You should use \code{cd.msftoframe()} rather than
|
given CD-ROM drive. You should use \function{msftoframe()} rather than
|
||||||
\code{msftoblock()} for comparing times. The logical block number
|
\method{msftoblock()} for comparing times. The logical block number
|
||||||
differs from the frame number by an offset required by certain CD-ROM
|
differs from the frame number by an offset required by certain CD-ROM
|
||||||
drives.
|
drives.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{play}{start\, play}
|
\begin{funcdesc}{play}{start, play}
|
||||||
Starts playback of an audio CD in the CD-ROM drive at the specified
|
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
|
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.
|
audio jacks (if fitted). Play stops at the end of the disc.
|
||||||
\code{start} is the number of the track at which to start playing the
|
\var{start} is the number of the track at which to start playing the
|
||||||
CD; if \code{play} is 0, the CD will be set to an initial paused
|
CD; if \var{play} is 0, the CD will be set to an initial paused
|
||||||
state. The method \code{togglepause()} can then be used to commence
|
state. The method \method{togglepause()} can then be used to commence
|
||||||
play.
|
play.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{playabs}{min\, sec\, frame\, play}
|
\begin{funcdesc}{playabs}{minutes, seconds, frames, play}
|
||||||
Like \code{play()}, except that the start is given in minutes,
|
Like \method{play()}, except that the start is given in minutes,
|
||||||
seconds, frames instead of a track number.
|
seconds, and frames instead of a track number.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{playtrack}{start\, play}
|
\begin{funcdesc}{playtrack}{start, play}
|
||||||
Like \code{play()}, except that playing stops at the end of the track.
|
Like \method{play()}, except that playing stops at the end of the
|
||||||
|
track.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{playtrackabs}{track\, min\, sec\, frame\, play}
|
\begin{funcdesc}{playtrackabs}{track, minutes, seconds, frames, play}
|
||||||
Like \code{play()}, except that playing begins at the spcified
|
Like \method{play()}, except that playing begins at the spcified
|
||||||
absolute time and ends at the end of the specified track.
|
absolute time and ends at the end of the specified track.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
|
@ -198,16 +200,16 @@ from arbitrarily ejecting the caddy.
|
||||||
\begin{funcdesc}{readda}{num_frames}
|
\begin{funcdesc}{readda}{num_frames}
|
||||||
Reads the specified number of frames from an audio CD mounted in the
|
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
|
CD-ROM drive. The return value is a string representing the audio
|
||||||
frames. This string can be passed unaltered to the \code{parseframe}
|
frames. This string can be passed unaltered to the
|
||||||
method of the parser object.
|
\method{parseframe()} method of the parser object.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{seek}{min\, sec\, frame}
|
\begin{funcdesc}{seek}{minutes, seconds, frames}
|
||||||
Sets the pointer that indicates the starting point of the next read of
|
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
|
digital audio data from a CD-ROM. The pointer is set to an absolute
|
||||||
time code location specified in minutes, seconds, and frames. The
|
time code location specified in \var{minutes}, \var{seconds}, and
|
||||||
return value is the logical block number to which the pointer has been
|
\var{frames}. The return value is the logical block number to which
|
||||||
set.
|
the pointer has been set.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{seekblock}{block}
|
\begin{funcdesc}{seekblock}{block}
|
||||||
|
@ -232,46 +234,40 @@ Stops the current playing operation.
|
||||||
Pauses the CD if it is playing, and makes it play if it is paused.
|
Pauses the CD if it is playing, and makes it play if it is paused.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
Parser objects (returned by \code{cd.createparser()}) have the
|
Parser objects (returned by \function{createparser()}) have the
|
||||||
following methods:
|
following methods:
|
||||||
|
|
||||||
\setindexsubitem{(CD parser object method)}
|
\setindexsubitem{(CD parser method)}
|
||||||
|
|
||||||
\begin{funcdesc}{addcallback}{type\, func\, arg}
|
\begin{funcdesc}{addcallback}{type, func, arg}
|
||||||
Adds a callback for the parser. The parser has callbacks for eight
|
Adds a callback for the parser. The parser has callbacks for eight
|
||||||
different types of data in the digital audio data stream. Constants
|
different types of data in the digital audio data stream. Constants
|
||||||
for these types are defined at the \code{cd} module level (see above).
|
for these types are defined at the \module{cd} module level (see above).
|
||||||
The callback is called as follows: \code{func(arg, type, data)}, where
|
The callback is called as follows: \code{\var{func}(\var{arg}, type,
|
||||||
\code{arg} is the user supplied argument, \code{type} is the
|
data)}, where \var{arg} is the user supplied argument, \var{type} is
|
||||||
particular type of callback, and \code{data} is the data returned for
|
the particular type of callback, and \var{data} is the data returned
|
||||||
this \code{type} of callback. The type of the data depends on the
|
for this \var{type} of callback. The type of the data depends on the
|
||||||
\code{type} of callback as follows:
|
\var{type} of callback as follows:
|
||||||
\begin{description}
|
|
||||||
\item[\code{cd.audio}: ]
|
\begin{tableii}{|l|l|}{code}{Type}{Value}
|
||||||
The argument is a string which can be passed unmodified to
|
\lineii{audio}{String which can be passed unmodified to
|
||||||
\code{al.writesamps()}.
|
\function{al.writesamps()}.}
|
||||||
\item[\code{cd.pnum}: ]
|
\lineii{pnum}{Integer giving the program (track) number.}
|
||||||
The argument is an integer giving the program (track) number.
|
\lineii{index}{Integer giving the index number.}
|
||||||
\item[\code{cd.index}: ]
|
\lineii{ptime}{Tuple consisting of the program time in minutes,
|
||||||
The argument is an integer giving the index number.
|
seconds, and frames.}
|
||||||
\item[\code{cd.ptime}: ]
|
\lineii{atime}{Tuple consisting of the absolute time in minutes,
|
||||||
The argument is a tuple consisting of the program time in minutes,
|
seconds, and frames.}
|
||||||
seconds, and frames.
|
\lineii{catalog}{String of 13 characters, giving the catalog number
|
||||||
\item[\code{cd.atime}: ]
|
of the CD.}
|
||||||
The argument is a tuple consisting of the absolute time in minutes,
|
\lineii{ident}{String of 12 characters, giving the ISRC
|
||||||
seconds, and frames.
|
identification number of the recording. \\
|
||||||
\item[\code{cd.catalog}: ]
|
&The string consists of two characters country code, three characters
|
||||||
The argument is a string of 13 characters, giving the catalog number
|
owner code, \\
|
||||||
of the CD.
|
&two characters giving the year, and five characters giving a serial number.}
|
||||||
\item[\code{cd.ident}: ]
|
\lineii{control}{Integer giving the control bits from the CD
|
||||||
The argument is a string of 12 characters, giving the ISRC
|
subcode data}
|
||||||
identification number of the recording. The string consists of two
|
\end{tableii}
|
||||||
characters country code, three characters owner code, two characters
|
|
||||||
giving the year, and five characters giving a serial number.
|
|
||||||
\item[\code{cd.control}: ]
|
|
||||||
The argument is an integer giving the control bits from the CD subcode
|
|
||||||
data.
|
|
||||||
\end{description}
|
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{deleteparser}{}
|
\begin{funcdesc}{deleteparser}{}
|
||||||
|
@ -282,20 +278,20 @@ when the last reference to the object is removed.
|
||||||
|
|
||||||
\begin{funcdesc}{parseframe}{frame}
|
\begin{funcdesc}{parseframe}{frame}
|
||||||
Parses one or more frames of digital audio data from a CD such as
|
Parses one or more frames of digital audio data from a CD such as
|
||||||
returned by \code{readda}. It determines which subcodes are present
|
returned by \method{readda()}. It determines which subcodes are
|
||||||
in the data. If these subcodes have changed since the last frame,
|
present in the data. If these subcodes have changed since the last
|
||||||
then \code{parseframe} executes a callback of the appropriate type
|
frame, then \method{parseframe()} executes a callback of the
|
||||||
passing to it the subcode data found in the frame.
|
appropriate type passing to it the subcode data found in the frame.
|
||||||
Unlike the C function, more than one frame of digital audio data can
|
Unlike the \C{} function, more than one frame of digital audio data
|
||||||
be passed to this method.
|
can be passed to this method.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{removecallback}{type}
|
\begin{funcdesc}{removecallback}{type}
|
||||||
Removes the callback for the given \code{type}.
|
Removes the callback for the given \var{type}.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{resetparser}{}
|
\begin{funcdesc}{resetparser}{}
|
||||||
Resets the fields of the parser used for tracking subcodes to an
|
Resets the fields of the parser used for tracking subcodes to an
|
||||||
initial state. \code{resetparser} should be called after the disc has
|
initial state. \method{resetparser()} should be called after the disc
|
||||||
been changed.
|
has been changed.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
Loading…
Reference in New Issue