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

int K3bDevice::Device::currentProfile (  )  const

Tries to get the current profile from the drive.

-1 on error (command failed or unknown profile) MediaType otherwise (MEDIA_NONE means: no current profile)

Definition at line 1603 of file k3bdevice.cpp.

Referenced by diskInfo(), dvdMediaType(), and readToc().

  unsigned char profileBuf[8];
  ::memset( profileBuf, 0, 8 );

  ScsiCommand cmd( this );
  cmd[1] = 1;
  cmd[8] = 8;

  if( cmd.transport( TR_DIR_READ, profileBuf, 8 ) ) {
    kdDebug() << "(K3bDevice::Device) GET_CONFIGURATION failed." << endl;

    return MEDIA_UNKNOWN;
  else {
    short profile = from2Byte( &profileBuf[6] );
    switch (profile) {
    case 0x00: return MEDIA_NONE;
    case 0x10: return MEDIA_DVD_ROM;
    case 0x11: return MEDIA_DVD_R_SEQ;
    case 0x12: return MEDIA_DVD_RAM;
    case 0x13: return MEDIA_DVD_RW_OVWR;
    case 0x14: return MEDIA_DVD_RW_SEQ;
    case 0x15: return MEDIA_DVD_R_DL_SEQ;
    case 0x16: return MEDIA_DVD_R_DL_JUMP;
    case 0x1A: return MEDIA_DVD_PLUS_RW;
    case 0x1B: return MEDIA_DVD_PLUS_R;
    case 0x2B: return MEDIA_DVD_PLUS_R_DL;
    case 0x08: return MEDIA_CD_ROM;
    case 0x09: return MEDIA_CD_R;
    case 0x0A: return MEDIA_CD_RW;
    default: return MEDIA_UNKNOWN;

Generated by  Doxygen 1.6.0   Back to index