summaryrefslogtreecommitdiffstats
path: root/Doc/lib/libcd.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/lib/libcd.tex')
-rw-r--r--Doc/lib/libcd.tex106
1 files changed, 55 insertions, 51 deletions
diff --git a/Doc/lib/libcd.tex b/Doc/lib/libcd.tex
index e2571cc..fc32da5 100644
--- a/Doc/lib/libcd.tex
+++ b/Doc/lib/libcd.tex
@@ -1,4 +1,4 @@
-\section{Built-in Module \sectcode{cd}}
+\section{Built-in Module \module{cd}}
\label{module-cd}
\bimodindex{cd}
@@ -113,32 +113,34 @@ that can be set by the \method{addcallback()} method of CD parser
objects (see below).
\end{datadesc}
+
+\subsection{Player Objects}
+\label{player-objects}
+
Player objects (returned by \function{open()}) have the following
methods:
-\setindexsubitem{(CD player method)}
-
-\begin{funcdesc}{allowremoval}{}
+\begin{methoddesc}[CD player]{allowremoval}{}
Unlocks the eject button on the CD-ROM drive permitting the user to
eject the caddy if desired.
-\end{funcdesc}
+\end{methoddesc}
-\begin{funcdesc}{bestreadsize}{}
+\begin{methoddesc}[CD player]{bestreadsize}{}
Returns the best value to use for the \var{num_frames} parameter of
the \method{readda()} method. Best is defined as the value that
permits a continuous flow of data from the CD-ROM drive.
-\end{funcdesc}
+\end{methoddesc}
-\begin{funcdesc}{close}{}
+\begin{methoddesc}[CD player]{close}{}
Frees the resources associated with the player object. After calling
\method{close()}, the methods of the object should no longer be used.
-\end{funcdesc}
+\end{methoddesc}
-\begin{funcdesc}{eject}{}
+\begin{methoddesc}[CD player]{eject}{}
Ejects the caddy from the CD-ROM drive.
-\end{funcdesc}
+\end{methoddesc}
-\begin{funcdesc}{getstatus}{}
+\begin{methoddesc}[CD player]{getstatus}{}
Returns information pertaining to the current state of the CD-ROM
drive. The returned information is a tuple with the following values:
\var{state}, \var{track}, \var{rtime}, \var{atime}, \var{ttime},
@@ -150,24 +152,24 @@ the meaning of the values, see the man page \manpage{CDgetstatus}{3dm}.
The value of \var{state} is one of the following: \constant{ERROR},
\constant{NODISC}, \constant{READY}, \constant{PLAYING},
\constant{PAUSED}, \constant{STILL}, or \constant{CDROM}.
-\end{funcdesc}
+\end{methoddesc}
-\begin{funcdesc}{gettrackinfo}{track}
+\begin{methoddesc}[CD player]{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.
-\end{funcdesc}
+\end{methoddesc}
-\begin{funcdesc}{msftoblock}{min, sec, frame}
+\begin{methoddesc}[CD player]{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 \function{msftoframe()} rather than
\method{msftoblock()} for comparing times. The logical block number
differs from the frame number by an offset required by certain CD-ROM
drives.
-\end{funcdesc}
+\end{methoddesc}
-\begin{funcdesc}{play}{start, play}
+\begin{methoddesc}[CD player]{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.
@@ -175,71 +177,73 @@ audio jacks (if fitted). Play stops at the end of the disc.
CD; if \var{play} is 0, the CD will be set to an initial paused
state. The method \method{togglepause()} can then be used to commence
play.
-\end{funcdesc}
+\end{methoddesc}
-\begin{funcdesc}{playabs}{minutes, seconds, frames, play}
+\begin{methoddesc}[CD player]{playabs}{minutes, seconds, frames, play}
Like \method{play()}, except that the start is given in minutes,
seconds, and frames instead of a track number.
-\end{funcdesc}
+\end{methoddesc}
-\begin{funcdesc}{playtrack}{start, play}
+\begin{methoddesc}[CD player]{playtrack}{start, play}
Like \method{play()}, except that playing stops at the end of the
track.
-\end{funcdesc}
+\end{methoddesc}
-\begin{funcdesc}{playtrackabs}{track, minutes, seconds, frames, play}
+\begin{methoddesc}[CD player]{playtrackabs}{track, minutes, seconds, frames, play}
Like \method{play()}, except that playing begins at the spcified
absolute time and ends at the end of the specified track.
-\end{funcdesc}
+\end{methoddesc}
-\begin{funcdesc}{preventremoval}{}
+\begin{methoddesc}[CD player]{preventremoval}{}
Locks the eject button on the CD-ROM drive thus preventing the user
from arbitrarily ejecting the caddy.
-\end{funcdesc}
+\end{methoddesc}
-\begin{funcdesc}{readda}{num_frames}
+\begin{methoddesc}[CD player]{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
\method{parseframe()} method of the parser object.
-\end{funcdesc}
+\end{methoddesc}
-\begin{funcdesc}{seek}{minutes, seconds, frames}
+\begin{methoddesc}[CD player]{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 \var{minutes}, \var{seconds}, and
\var{frames}. The return value is the logical block number to which
the pointer has been set.
-\end{funcdesc}
+\end{methoddesc}
-\begin{funcdesc}{seekblock}{block}
+\begin{methoddesc}[CD player]{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.
-\end{funcdesc}
+\end{methoddesc}
-\begin{funcdesc}{seektrack}{track}
+\begin{methoddesc}[CD player]{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.
-\end{funcdesc}
+\end{methoddesc}
-\begin{funcdesc}{stop}{}
+\begin{methoddesc}[CD player]{stop}{}
Stops the current playing operation.
-\end{funcdesc}
+\end{methoddesc}
-\begin{funcdesc}{togglepause}{}
+\begin{methoddesc}[CD player]{togglepause}{}
Pauses the CD if it is playing, and makes it play if it is paused.
-\end{funcdesc}
+\end{methoddesc}
+
+
+\subsection{Parser Objects}
+\label{cd-parser-objects}
Parser objects (returned by \function{createparser()}) have the
following methods:
-\setindexsubitem{(CD parser method)}
-
-\begin{funcdesc}{addcallback}{type, func, arg}
+\begin{methoddesc}[CD parser]{addcallback}{type, func, arg}
Adds a callback for the parser. The parser has callbacks for eight
different types of data in the digital audio data stream. Constants
for these types are defined at the \module{cd} module level (see above).
@@ -268,15 +272,15 @@ owner code, \\
\lineii{control}{Integer giving the control bits from the CD
subcode data}
\end{tableii}
-\end{funcdesc}
+\end{methoddesc}
-\begin{funcdesc}{deleteparser}{}
+\begin{methoddesc}[CD parser]{deleteparser}{}
Deletes the parser and frees the memory it was using. The object
should not be used after this call. This call is done automatically
when the last reference to the object is removed.
-\end{funcdesc}
+\end{methoddesc}
-\begin{funcdesc}{parseframe}{frame}
+\begin{methoddesc}[CD parser]{parseframe}{frame}
Parses one or more frames of digital audio data from a CD such as
returned by \method{readda()}. It determines which subcodes are
present in the data. If these subcodes have changed since the last
@@ -284,14 +288,14 @@ frame, then \method{parseframe()} executes a callback of the
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 be passed to this method.
-\end{funcdesc}
+\end{methoddesc}
-\begin{funcdesc}{removecallback}{type}
+\begin{methoddesc}[CD parser]{removecallback}{type}
Removes the callback for the given \var{type}.
-\end{funcdesc}
+\end{methoddesc}
-\begin{funcdesc}{resetparser}{}
+\begin{methoddesc}[CD parser]{resetparser}{}
Resets the fields of the parser used for tracking subcodes to an
initial state. \method{resetparser()} should be called after the disc
has been changed.
-\end{funcdesc}
+\end{methoddesc}