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

bool AUD_SoftwareDevice::seek ( AUD_Handle handle,
float  position 
) [virtual]

Seeks in a played back sound.

Parameters:
handle The handle returned by the play function.
position The new position from where to play back, in seconds.
Returns:
  • true if the handle is valid.
  • false if the handle is invalid.
Warning:
Whether the seek works or not depends on the sound source.

Implements AUD_IDevice.

Definition at line 335 of file AUD_SoftwareDevice.cpp.

References AUD_IReader::getSpecs(), isValid(), lock(), AUD_Specs::rate, AUD_IReader::seek(), and unlock().

{
      lock();

      bool result = false;

      if(isValid(handle))
      {
            AUD_IReader* reader = ((AUD_SoftwareHandle*)handle)->reader;
            reader->seek((int)(position * reader->getSpecs().rate));
            result = true;
      }

      unlock();

      return result;
}


Generated by  Doxygen 1.6.0   Back to index