Holger's Java API

## com.antelmann.cddb
Class CDDrive

    java.lang.Object
      com.antelmann.cddb.CDDrive

Direct Known Subclasses:
  CDDriveSample, CDDriveWin

    public abstract class CDDrive

extends Object

The class CDDrive represents the physical CD-ROM drive in a platform independent way. The drive can be queried on certain properties that are available from the device. In particular, it can generate a CDID object.

This class has one abstract method that needs to be implemented in a platform dependent manner (most probably with a native method) by classes that implement an actual drive. The method is:
`String getCDDBQuery()`

This method returns a string that contains all information about the inserted CD in a way that is conform with a query according to the CDDB protocol. An example return value would be: "cddb query a10c9b0c 12 150 15767 32142 52485 79740 102907 121765 141400 161912 184252 204920 238702 3229"

Author:
  Holger Antelmann
See Also:
  `CDID`

Method Summary
`abstract void` `backward()`
`abstract void` `eject()`
`abstract void` `forward()`
`CDID` `getCDID()`
`String` `getQueryString()` returns the exact query string as specified by the CDDB query format.
`boolean` `isCDAvailable()` also performs a refresh()
`abstract void` `pause()`
`abstract void` `play()`
`void` `refresh()` (re-)queries the CD-ROM drive
`abstract void` `stop()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### eject

    public abstract void eject()

### play

    public abstract void play()

### stop

    public abstract void stop()

### backward

    public abstract void backward()

### forward

    public abstract void forward()

### pause

    public abstract void pause()

### isCDAvailable

    public boolean isCDAvailable()

  also performs a refresh()

### refresh

    public void refresh()

  (re-)queries the CD-ROM drive

### getCDID

    public CDID getCDID()

### getQueryString

    public String getQueryString()

  returns the exact query string as specified by the CDDB query format. This format is as follows:
  <discid> <numberOfTracks> <trackOffset1> <trackOffset2> ... <..n> <lengthInSeconds>

  Where <discid> is the calculated discID according to CDDB specification (see http://www.freedb.org for details on the entire query string).

(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads