diff options
Diffstat (limited to 'intern/audaspace/intern/AUD_C-API.cpp')
-rw-r--r-- | intern/audaspace/intern/AUD_C-API.cpp | 38 |
1 files changed, 35 insertions, 3 deletions
diff --git a/intern/audaspace/intern/AUD_C-API.cpp b/intern/audaspace/intern/AUD_C-API.cpp index 45faebc7e97..255d1d2f1f6 100644 --- a/intern/audaspace/intern/AUD_C-API.cpp +++ b/intern/audaspace/intern/AUD_C-API.cpp @@ -516,19 +516,51 @@ 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_setDeviceVolume(AUD_Device* device, float volume) +{ + assert(device); + + try + { + return device->setCapability(AUD_CAPS_VOLUME, &volume); + } + catch(AUD_Exception) {} + + return false; +} + +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) |