Module: wine Branch: master Commit: 096fb434eb7ceed5879249e5094b7aeb0140d7ca URL: http://source.winehq.org/git/wine.git/?a=commit;h=096fb434eb7ceed5879249e509...
Author: Andrew Eikum aeikum@codeweavers.com Date: Fri Jun 17 15:49:48 2011 -0500
winecoreaudio: Set AudioQueue volume, not AudioDevice volume.
We want to control the volume for each particular stream, not the entire system-wide device.
---
dlls/winecoreaudio.drv/mmdevdrv.c | 12 ++++-------- 1 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/dlls/winecoreaudio.drv/mmdevdrv.c b/dlls/winecoreaudio.drv/mmdevdrv.c index 26c9286..fd5e5ad 100644 --- a/dlls/winecoreaudio.drv/mmdevdrv.c +++ b/dlls/winecoreaudio.drv/mmdevdrv.c @@ -2289,7 +2289,6 @@ static const IAudioSessionControl2Vtbl AudioSessionControl2_Vtbl = /* index == -1 means set all channels, otherwise sets only the given channel */ static HRESULT ca_setvol(ACImpl *This, UINT32 index) { - AudioObjectPropertyAddress addr; float level; OSStatus sc;
@@ -2308,14 +2307,9 @@ static HRESULT ca_setvol(ACImpl *This, UINT32 index) level = This->session->master_vol * This->session->channel_vols[index] * This->vols[index];
- addr.mScope = This->scope; - addr.mSelector = kAudioDevicePropertyVolumeScalar; - addr.mElement = index + 1; - - sc = AudioObjectSetPropertyData(This->adevid, &addr, 0, NULL, - sizeof(float), &level); + sc = AudioQueueSetParameter(This->aqueue, kAudioQueueParam_Volume, level); if(sc != noErr){ - WARN("Setting _VolumeScalar property failed: %lx\n", sc); + WARN("Setting _Volume property failed: %lx\n", sc); return E_FAIL; }
@@ -2514,6 +2508,7 @@ static HRESULT WINAPI AudioStreamVolume_SetChannelVolume(
This->vols[index] = level;
+ WARN("AudioQueue doesn't support per-channel volume control\n"); ret = ca_setvol(This, index);
OSSpinLockUnlock(&This->lock); @@ -2675,6 +2670,7 @@ static HRESULT WINAPI ChannelAudioVolume_SetChannelVolume(
session->channel_vols[index] = level;
+ WARN("AudioQueue doesn't support per-channel volume control\n"); ret = ca_session_setvol(session, index);
LeaveCriticalSection(&session->lock);