Movatterモバイル変換


[0]ホーム

URL:


Up one LevelPython Library ReferenceContentsModule IndexIndex

34.3cd -- CD-ROM access on SGI systems

Availability:IRIX.

This module provides an interface to the Silicon Graphics CD library.It is available only on Silicon Graphics systems.

The way the library works is as follows. A program opens the CD-ROMdevice withopen() and creates a parser to parse the datafrom the CD withcreateparser(). The object returned byopen() can be used to read data from the CD, but also to getstatus information for the CD-ROM device, and to get information aboutthe CD, such as the table of contents. Data from the CD is passed tothe parser, which parses the frames, and calls any callbackfunctions that have previously been added.

An audio CD is divided intotracks orprograms (the termsare used interchangeably). Tracks can be subdivided intoindices. An audio CD contains atable of contents whichgives the starts of the tracks on the CD. Index 0 is usually thepause before the start of a track. The start of the track as given bythe table of contents is normally the start of index 1.

Positions on a CD can be represented in two ways. Either a framenumber or a tuple of three values, minutes, seconds and frames. Mostfunctions use the latter representation. Positions can be bothrelative to the beginning of the CD, and to the beginning of thetrack.

Modulecd defines the following functions and constants:

createparser()
Create and return an opaque parser object. The methods of the parserobject are described below.

msftoframe(minutes, seconds, frames)
Converts a(minutes,seconds,frames) triplerepresenting time in absolute time code into the corresponding CDframe number.

open([device[, mode]])
Open the CD-ROM device. The return value is an opaque player object;methods of the player object are described below. The device is thename of the SCSI device file, e.g.'/dev/scsi/sc0d4l0', orNone. If omitted orNone, the hardware inventory isconsulted to locate a CD-ROM drive. Themode, if not omitted,should be the string'r'.

The module defines the following variables:

exception error
Exception raised on various errors.

DATASIZE
The size of one frame's worth of audio data. This is the size of theaudio data as passed to the callback of typeaudio.

BLOCKSIZE
The size of one uninterpreted frame of audio data.

The following variables are states as returned bygetstatus():

READY
The drive is ready for operation loaded with an audio CD.

NODISC
The drive does not have a CD loaded.

CDROM
The drive is loaded with a CD-ROM. Subsequent play or read operationswill return I/O errors.

ERROR
An error occurred while trying to read the disc or its table ofcontents.

PLAYING
The drive is in CD player mode playing an audio CD through its audiojacks.

PAUSED
The drive is in CD layer mode with play paused.

STILL
The equivalent ofPAUSED on older (non 3301) model ToshibaCD-ROM drives. Such drives have never been shipped by SGI.

audio
pnum
index
ptime
atime
catalog
ident
control
Integer constants describing the various types of parser callbacksthat can be set by theaddcallback() method of CD parserobjects (see below).



Subsections


Up one LevelPython Library ReferenceContentsModule IndexIndex

Release 2.5.2, documentation updated on 21st February, 2008.
SeeAbout this document... for information on suggesting changes.
[8]ページ先頭

©2009-2025 Movatter.jp