sdljava.cdrom

Class SDLCdrom

public class SDLCdrom extends Object

Binding to the SDL Cdrom routines.

Version: $Id: SDLCdrom.java,v 1.5 2005/01/19 03:09:11 ivan_ganza Exp $

Field Summary
intdriveIndex
SDL_CDswigCdrom
Constructor Summary
SDLCdrom(SDL_CD swigCdrom, int driveIndex)
Method Summary
static voidcdClose(SDLCdrom cdrom)
Closes a cdrom
voidcdClose()
Close the cdrom
static voidcdEject(SDLCdrom cdrom)
Ejects a CDROM

Ejects the given cdrom.

voidcdEject()
Ejects a CDROM

Ejects the cdrom.

static StringcdName(int drive)
Returns a human-readable, system-dependent identifier for the CD-ROM.
static SDLCdromcdOpen(int drive)
Describe cdOpen method here.
static voidcdPause(SDLCdrom cdrom)
Pauses a CDROM

Pauses play on the given cdrom.

voidcdPause()
Pauses a CDROM

Pauses play

static voidcdPlay(SDLCdrom cdrom, int start, int length)
Play a CD

Plays the given cdrom, starting a frame start for length frames.

voidcdPlay(int start, int length)
Play a CD

Plays starting a frame start for length frames.

static voidcdPlayTracks(SDLCdrom cdrom, int start_track, int start_frame, int ntracks, int nframes)
Play the given CD track(s)

SDL_CDPlayTracks plays the given CD starting at track start_track, for ntracks tracks.

voidcdPlayTracks(int start_track, int start_frame, int ntracks, int nframes)
Play the given CD track(s)

SDL_CDPlayTracks plays the given CD starting at track start_track, for ntracks tracks.

static voidcdResume(SDLCdrom cdrom)
Resumes a CDROM

Resumes play on the given cdrom.

voidcdResume()
Resumes a CDROM

Resumes play

static CDstatuscdStatus(SDLCdrom cdrom)
Returns the current status of the given drive.
CDstatuscdStatus()
Returns the current status of this drive.
static voidcdStop(SDLCdrom cdrom)
Stops a CDROM

Stops play on the given cdrom.

voidcdStop()
Stops a CDROM

Stops play

protected voidfinalize()
intgetCurrentFrame()
Get the current frame offset within the track
FrameInfogetCurrentFrameInfo()
intgetCurrentTrack()
Get the current track
intgetDriveIndex()
intgetId()
Get the private drive identifier
intgetNumTracks()
Get the number of tracks on the CD
SDL_CDgetSwigCdrom()
ListgetTracks()
Get the list of tracks
static intnumDrives()
Returns the number of CD-ROM drives on the system.

Field Detail

driveIndex

int driveIndex

swigCdrom

SDL_CD swigCdrom

Constructor Detail

SDLCdrom

private SDLCdrom(SDL_CD swigCdrom, int driveIndex)

Method Detail

cdClose

public static void cdClose(SDLCdrom cdrom)
Closes a cdrom

Parameters: cdrom a SDLCdrom value

cdClose

public void cdClose()
Close the cdrom

cdEject

public static void cdEject(SDLCdrom cdrom)
Ejects a CDROM

Ejects the given cdrom.

Parameters: cdrom a SDLCdrom value

Throws: SDLException if an error occurs

cdEject

public void cdEject()
Ejects a CDROM

Ejects the cdrom.

Parameters: cdrom a SDLCdrom value

Throws: SDLException if an error occurs

cdName

public static String cdName(int drive)
Returns a human-readable, system-dependent identifier for the CD-ROM.

Parameters: drive drive is the index of the drive

Returns: a human-readable, system-dependent identifier for the CD-ROM

cdOpen

public static SDLCdrom cdOpen(int drive)
Describe cdOpen method here.

Opens a CD-ROM drive for access. It returns a SDL_CD structure on success, or NULL if the drive was invalid or busy. This newly opened CD-ROM becomes the default CD used when other CD functions are passed a NULL CD-ROM handle.

Drives are numbered starting with 0. Drive 0 is the system default CD-ROM.

Parameters: drive an int value

Returns: a SDLCdrom value

Throws: SDLException if an error occurs

cdPause

public static void cdPause(SDLCdrom cdrom)
Pauses a CDROM

Pauses play on the given cdrom.

Parameters: cdrom a SDLCdrom value

Throws: SDLException if an error occurs

cdPause

public void cdPause()
Pauses a CDROM

Pauses play

Parameters: cdrom a SDLCdrom value

Throws: SDLException if an error occurs

cdPlay

public static void cdPlay(SDLCdrom cdrom, int start, int length)
Play a CD

Plays the given cdrom, starting a frame start for length frames.

Parameters: cdrom a SDLCdrom value start an int value length an int value

Throws: SDLException if an error occurs

cdPlay

public void cdPlay(int start, int length)
Play a CD

Plays starting a frame start for length frames.

Parameters: start an int value length an int value

Throws: SDLException if an error occurs

cdPlayTracks

public static void cdPlayTracks(SDLCdrom cdrom, int start_track, int start_frame, int ntracks, int nframes)
Play the given CD track(s)

SDL_CDPlayTracks plays the given CD starting at track start_track, for ntracks tracks.

start_frame is the frame offset, from the beginning of the start_track, at which to start. nframes is the frame offset, from the beginning of the last track (start_track+ntracks), at which to end playing.

SDL_CDPlayTracks should only be called after calling SDL_CDStatus to get track information about the CD.

Parameters: cdrom a SDLCdrom value start_track an int value start_frame an int value ntrakcs an int value nframes an int value

Throws: SDLException if an error occurs

cdPlayTracks

public void cdPlayTracks(int start_track, int start_frame, int ntracks, int nframes)
Play the given CD track(s)

SDL_CDPlayTracks plays the given CD starting at track start_track, for ntracks tracks.

start_frame is the frame offset, from the beginning of the start_track, at which to start. nframes is the frame offset, from the beginning of the last track (start_track+ntracks), at which to end playing.

SDL_CDPlayTracks should only be called after calling SDL_CDStatus to get track information about the CD.

Parameters: cdrom a SDLCdrom value start_track an int value start_frame an int value ntrakcs an int value nframes an int value

Throws: SDLException if an error occurs

cdResume

public static void cdResume(SDLCdrom cdrom)
Resumes a CDROM

Resumes play on the given cdrom.

Parameters: cdrom a SDLCdrom value

Throws: SDLException if an error occurs

cdResume

public void cdResume()
Resumes a CDROM

Resumes play

Parameters: cdrom a SDLCdrom value

Throws: SDLException if an error occurs

cdStatus

public static CDstatus cdStatus(SDLCdrom cdrom)
Returns the current status of the given drive.

If the drive has a CD in it, the table of contents of the CD and current play position of the CD will be stored in the cdrom object.

Parameters: cdrom a SDLCdrom value

Returns: a CDstatus value

cdStatus

public CDstatus cdStatus()
Returns the current status of this drive.

If the drive has a CD in it, the table of contents of the CD and current play position of the CD will be stored in the cdrom object.

Parameters: cdrom a SDLCdrom value

Returns: a CDstatus value

cdStop

public static void cdStop(SDLCdrom cdrom)
Stops a CDROM

Stops play on the given cdrom.

Parameters: cdrom a SDLCdrom value

Throws: SDLException if an error occurs

cdStop

public void cdStop()
Stops a CDROM

Stops play

Parameters: cdrom a SDLCdrom value

Throws: SDLException if an error occurs

finalize

protected void finalize()

getCurrentFrame

public int getCurrentFrame()
Get the current frame offset within the track

Returns: the current frame offset within the track

getCurrentFrameInfo

public FrameInfo getCurrentFrameInfo()

getCurrentTrack

public int getCurrentTrack()
Get the current track

Returns: the current track

getDriveIndex

public int getDriveIndex()

getId

public int getId()
Get the private drive identifier

Returns: the private drive identifier

getNumTracks

public int getNumTracks()
Get the number of tracks on the CD

Returns: the number of tracks on the CD

getSwigCdrom

public SDL_CD getSwigCdrom()

getTracks

public List getTracks()
Get the list of tracks

Returns: the list of tracks

numDrives

public static int numDrives()
Returns the number of CD-ROM drives on the system.

Returns: Returns the number of CD-ROM drives on the system.