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

bool K3bDevice::Device::indexScan ( K3bDevice::Toc toc  )  const

For now this just searches index 0 for all tracks and sets the value in the tracks. In the future this should scan for all indices.

Definition at line 3010 of file k3bdevice.cpp.

References close(), isOpen(), and open().

{
  // if the device is already opened we do not close it
  // to allow fast multible method calls in a row
  bool needToClose = !isOpen();

  if( !open() )
    return false;

  bool ret = true;

  for( Toc::iterator it = toc.begin(); it != toc.end(); ++it ) {
    Track& track = *it;
    if( track.type() == Track::AUDIO ) {
      track.m_indices.clear();
      long index0 = -1;
      if( searchIndex0( track.firstSector().lba(), track.lastSector().lba(), index0 ) ) {
      kdDebug() << "(K3bDevice::Device) found index 0: " << index0 << endl;
      }
      if( index0 > 0 )
      track.m_index0 = K3b::Msf( index0 - track.firstSector().lba() );
      else
      track.m_index0 = 0;

      if( index0 > 0 )
      searchIndexTransitions( track.firstSector().lba(), index0-1, track );
      else
      searchIndexTransitions( track.firstSector().lba(), track.lastSector().lba(), track );
    }
  }

  if( needToClose )
    close();

  return ret;
}


Generated by  Doxygen 1.6.0   Back to index