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

bool AUD_SoftwareDevice::pause ( AUD_Handle handle  )  [virtual]

Pauses a played back sound.

Parameters:
handle The handle returned by the play function.
Returns:
  • true if the sound has been paused.
  • false if the sound isn't playing back or the handle is invalid.

Implements AUD_IDevice.

Definition at line 204 of file AUD_SoftwareDevice.cpp.

References lock(), m_pausedSounds, m_playback, m_playingSounds, playing(), and unlock().

Referenced by mix().

{
      bool result = false;

      lock();

      // only songs that are played can be paused
      for(AUD_HandleIterator i = m_playingSounds->begin();
            i != m_playingSounds->end(); i++)
      {
            if(*i == handle)
            {
                  m_pausedSounds->push_back(*i);
                  m_playingSounds->erase(i);
                  if(m_playingSounds->empty())
                        playing(m_playback = false);
                  result = true;
                  break;
            }
      }

      unlock();

      return result;
}


Generated by  Doxygen 1.6.0   Back to index