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

float AUD_SoftwareDevice::getPosition ( AUD_Handle handle  )  [virtual]

Retrieves the current playback position of a sound.

Parameters:
handle The handle returned by the play function.
Returns:
The playback position in seconds, or 0.0 if the handle is invalid.

Implements AUD_IDevice.

Definition at line 353 of file AUD_SoftwareDevice.cpp.

References AUD_IReader::getPosition(), isValid(), lock(), m_specs, AUD_Specs::rate, AUD_SoftwareHandle::reader, and unlock().

{
      lock();

      float position = 0.0f;

      if(isValid(handle))
      {
            AUD_SoftwareHandle* h = (AUD_SoftwareHandle*)handle;
            position = h->reader->getPosition() / (float)m_specs.rate;
      }

      unlock();

      return position;
}


Generated by  Doxygen 1.6.0   Back to index