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

int K3bDevice::Device::numSessions (  )  const

Returns:
The number of sessions on the media.

Definition at line 671 of file k3bdevice.cpp.

References blockDeviceName(), and readTocPmaAtip().

Referenced by diskInfo(), and fixupToc().

{
  //
  // Althought disk_info should get the real value without ide-scsi
  // I keep getting wrong values (the value is too high. I think the leadout
  // gets counted as session sometimes :()
  //

  //
  // Session Info
  // ============
  // Byte 0-1: Data Length
  // Byte   2: First Complete Session Number (Hex) - always 1
  // Byte   3: Last Complete Session Number (Hex)
  //

  int ret = -1;

  unsigned char* dat = 0;
  int len = 0;
  if( readTocPmaAtip( &dat, len, 1, 0, 0 ) ) {
    ret = dat[3];

    delete [] dat;
  }
  else {
    kdDebug() << "(K3bDevice::Device) " << blockDeviceName() << ": could not get session info !" << endl;
  }

  return ret;
}


Generated by  Doxygen 1.6.0   Back to index