Sound:
[blender.git] / intern / audaspace / intern / AUD_C-API.cpp
index 45faebc7e97752c4d6827eb8f083f07b18cc61c5..afa1568d6dc2750131e7f5af21934543ff7b16a5 100644 (file)
@@ -516,21 +516,40 @@ AUD_Device* AUD_openReadDevice(AUD_Specs specs)
        }
 }
 
-int AUD_playDevice(AUD_Device* device, AUD_Sound* sound)
+AUD_Handle* AUD_playDevice(AUD_Device* device, AUD_Sound* sound)
 {
        assert(device);
        assert(sound);
 
        try
        {
-               return device->play(sound) != NULL;
+               return device->play(sound);
        }
        catch(AUD_Exception)
        {
-               return false;
+               return NULL;
        }
 }
 
+int AUD_setDeviceSoundVolume(AUD_Device* device, AUD_Handle* handle,
+                                                        float volume)
+{
+       if(handle)
+       {
+               assert(device);
+               AUD_SourceCaps caps;
+               caps.handle = handle;
+               caps.value = volume;
+
+               try
+               {
+                       return device->setCapability(AUD_CAPS_SOURCE_VOLUME, &caps);
+               }
+               catch(AUD_Exception) {}
+       }
+       return false;
+}
+
 int AUD_readDevice(AUD_Device* device, sample_t* buffer, int length)
 {
        assert(device);