Logo Search packages:      
Sourcecode: k9copy version File versions  Download package

bool K3bDevice::Device::readCdMsf ( unsigned char *  data,
int  dataLen,
int  sectorType,
bool  dap,
const K3b::Msf startAdress,
const K3b::Msf endAdress,
bool  sync,
bool  header,
bool  subHeader,
bool  userData,
bool  edcEcc,
int  c2,
int  subChannel 
) const

Parameters:
sectorType,: 
  • 000b - all types
  • 001b - CD-DA
  • 010b - Mode 1
  • 011b - Mode 2 formless
  • 100b - Mode 2 form 1
  • 101b - Mode 2 form 2
startAdress Lba 0 is mapped to msf 00:00:00 so this method uses startAdress+150 as the starting msf.
endAdress This is the ending adress which is NOT included in the read operation. Lba 0 is mapped to msf 00:00:00 so this method uses endAdress+150 as the ending msf.
c2,: 
  • 00b - No error info
  • 01b - 294 bytes, one bit for every byte of the 2352 bytes
  • 10b - 296 bytes, xor of all c2 bits, zero pad bit, 294 c2 bits
subChannel,: 
  • 000b - No Sub-channel data
  • 001b - RAW P-W Sub-channel (96 bytes)
  • 010b - Formatted Q Sub-channel (16 bytes)
  • 100b - Corrected and de-interleaved R-W Sub-channel (96 bytes)

Definition at line 414 of file k3bdevice_mmc.cpp.

References blockDeviceName().

Referenced by getDataMode().

{
  ::memset( data, 0, dataLen );

  ScsiCommand cmd( this );
  cmd[0] = MMC_READ_CD_MSF;
  cmd[1] = (sectorType<<2 & 0x1c) | ( dap ? 0x2 : 0x0 );
  cmd[3] = (startAdress+150).minutes();
  cmd[4] = (startAdress+150).seconds();
  cmd[5] = (startAdress+150).frames();
  cmd[6] = (endAdress+150).minutes();
  cmd[7] = (endAdress+150).seconds();
  cmd[8] = (endAdress+150).frames();
  cmd[9] = ( ( sync      ? 0x80 : 0x0 ) |
           ( subHeader ? 0x40 : 0x0 ) |
           ( header    ? 0x20 : 0x0 ) |
           ( userData  ? 0x10 : 0x0 ) |
           ( edcEcc    ? 0x8  : 0x0 ) |
           ( c2<<1 & 0x6 ) );
  cmd[10] = subChannel & 0x7;

  if( cmd.transport( TR_DIR_READ, data, dataLen ) ) {
    kdDebug() << "(K3bDevice::Device) " << blockDeviceName() << ": READ CD MSF failed!" << endl;
    return false;
  }
  else
    return true;
}


Generated by  Doxygen 1.6.0   Back to index