DOSBox-X
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
Classes | Public Member Functions | Static Public Attributes
CDROM_Interface_Image Class Reference

Image CD-ROM interface. More...

#include <cdrom.h>

Inheritance diagram for CDROM_Interface_Image:
CDROM_Interface

List of all members.

Classes

class  AudioFile
class  BinaryFile
 Binary file reader for the image.
struct  imagePlayer
struct  Track
class  TrackFile

Public Member Functions

 CDROM_Interface_Image (Bit8u subUnit)
 Constructor, with parameter for subunit.
void InitNewMedia (void)
 TODO?
bool SetDevice (char *path, int forceCD)
 Set the device associated with this interface, if supported by emulation.
bool GetUPC (unsigned char &attr, char *upc)
 Get UPC string from the CD-ROM.
bool GetAudioTracks (int &stTrack, int &end, TMSF &leadOut)
 Retrieve start and end tracks and lead out position.
bool GetAudioTrackInfo (int track, TMSF &start, unsigned char &attr)
 Retrieve start and attributes for a specific track.
bool GetAudioSub (unsigned char &attr, unsigned char &track, unsigned char &index, TMSF &relPos, TMSF &absPos)
 Get subchannel data of the sectors at the current position, and retrieve current position.
bool GetAudioStatus (bool &playing, bool &pause)
 Get audio playback status.
bool GetMediaTrayStatus (bool &mediaPresent, bool &mediaChanged, bool &trayOpen)
 Get media tray status.
bool PlayAudioSector (unsigned long start, unsigned long len)
 Initiate audio playback starting at sector and for how many.
bool PauseAudio (bool resume)
 Pause audio playback.
bool StopAudio (void)
 Stop audio playback.
void ChannelControl (TCtrl ctrl)
 Set channel control data (TODO: clarify)
bool ReadSectors (PhysPt buffer, bool raw, unsigned long sector, unsigned long num)
 Read sector data into guest memory.
bool ReadSectorsHost (void *buffer, bool raw, unsigned long sector, unsigned long num)
 Read sector data into host memory (for IDE emulation)
bool LoadUnloadMedia (bool unload)
 Load (close/spin up) or unload (eject/spin down) media.
bool ReadSector (uint8_t *buffer, const bool raw, const uint32_t sector)
 Indicate whether the image has a data track.
bool HasDataTrack (void)
 Indicate whether the image has a data track.

Static Public Attributes

static bool images_init = false
 Flag to track if images have been initialized.
static CDROM_Interface_Imageimages [26] = {}
 Array of CD-ROM images, one per drive letter.

Detailed Description

Image CD-ROM interface.

This provides CD-ROM emulation from .ISO and .BIN/.CUE images on the host system

Definition at line 248 of file cdrom.h.


Member Function Documentation

bool CDROM_Interface_Image::GetAudioTracks ( int &  stTrack,
int &  end,
TMSF leadOut 
) [virtual]

Retrieve start and end tracks and lead out position.

Guard: A valid CD has atleast two tracks: the first plus the lead-out, so bail out if we have fewer than 2 tracks

Implements CDROM_Interface.

Definition at line 491 of file cdrom_image.cpp.

bool CDROM_Interface_Image::PlayAudioSector ( unsigned long  start,
unsigned long  len 
) [virtual]

Initiate audio playback starting at sector and for how many.

If the request falls in the pregap we deduct the difference from the playback duration, because we skip the pre-gap area and jump straight to the track start.

Guard: Before we update our player object with new track details, we lock access to it to prevent the Callback (which runs in a separate thread) from getting inconsistent or partial values.

Convert Redbook frames (len) to Track PCM frames, rounding up to whole integer frames. Note: the intermediate numerator in the calculation below can overflow uint32_t, so the variable types used must stay 64-bit.

Implements CDROM_Interface.

Definition at line 592 of file cdrom_image.cpp.

References StopAudio().


Member Data Documentation

Array of CD-ROM images, one per drive letter.

images[] is static and not specific to any C++ class instance.

Definition at line 365 of file cdrom.h.

bool CDROM_Interface_Image::images_init = false [static]

Flag to track if images have been initialized.

Whether images[] has been initialized. Note that images_init and images[] are static and they are not specific to any one C++ class instance.

Definition at line 361 of file cdrom.h.


The documentation for this class was generated from the following files: