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

bool AUD_SoftwareDevice::getCapability ( int  capability,
void *  value 
) [virtual]

Retrieves a value of a capability. The data behind the pointer depends on the capability.

Parameters:
capability The capability.
value The value.
Returns:
Whether the action succeeded or not.

Implements AUD_IDevice.

Definition at line 457 of file AUD_SoftwareDevice.cpp.

References AUD_SourceCaps::handle, isValid(), lock(), m_volume, unlock(), and AUD_SourceCaps::value.

{
      bool result = false;

      switch(capability)
      {
      case AUD_CAPS_VOLUME:
            lock();
            *((float*)value) = m_volume;
            unlock();
            return true;
      case AUD_CAPS_SOURCE_VOLUME:
            {
                  AUD_SourceCaps* caps = (AUD_SourceCaps*) value;

                  lock();

                  if(isValid(caps->handle))
                  {
                        caps->value = ((AUD_SoftwareHandle*)caps->handle)->volume;
                        result = true;
                  }

                  unlock();
            }
            break;
      }

      return result;
}


Generated by  Doxygen 1.6.0   Back to index