[PATCH 0/4] MR2764: wine{alsa,coreaudio,oss,pulse}: Move AudioStreamVolume into mmdevapi.
From: Davide Beatrici <git(a)davidebeatrici.dev> --- dlls/mmdevapi/Makefile.in | 1 + dlls/mmdevapi/session.c | 25 +++--- dlls/winealsa.drv/Makefile.in | 1 + dlls/winealsa.drv/mmdevdrv.c | 161 +--------------------------------- 4 files changed, 15 insertions(+), 173 deletions(-) diff --git a/dlls/mmdevapi/Makefile.in b/dlls/mmdevapi/Makefile.in index 120f9d81fa4..ee2848ff2de 100644 --- a/dlls/mmdevapi/Makefile.in +++ b/dlls/mmdevapi/Makefile.in @@ -4,6 +4,7 @@ IMPORTS = uuid ole32 oleaut32 user32 advapi32 C_SRCS = \ audiosessionmanager.c \ audiovolume.c \ + client.c \ devenum.c \ main.c \ session.c \ diff --git a/dlls/mmdevapi/session.c b/dlls/mmdevapi/session.c index 6a675a7656c..9c1b87a229b 100644 --- a/dlls/mmdevapi/session.c +++ b/dlls/mmdevapi/session.c @@ -13,6 +13,7 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ + #define COBJMACROS #include <audiopolicy.h> @@ -32,7 +33,17 @@ WINE_DEFAULT_DEBUG_CHANNEL(mmdevapi); extern void sessions_lock(void) DECLSPEC_HIDDEN; extern void sessions_unlock(void) DECLSPEC_HIDDEN; -extern const IAudioClient3Vtbl AudioClient3_Vtbl; +void set_stream_volumes(struct audio_client *This) +{ + struct set_volumes_params params; + + params.stream = This->stream; + params.master_volume = (This->session->mute ? 0.0f : This->session->master_vol); + params.volumes = This->vols; + params.session_volumes = This->session->channel_vols; + + WINE_UNIX_CALL(set_volumes, ¶ms); +} static inline struct audio_session_wrapper *impl_from_IAudioSessionControl2(IAudioSessionControl2 *iface) { @@ -49,18 +60,6 @@ static inline struct audio_session_wrapper *impl_from_ISimpleAudioVolume(ISimple return CONTAINING_RECORD(iface, struct audio_session_wrapper, ISimpleAudioVolume_iface); } -static void set_stream_volumes(struct audio_client *This) -{ - struct set_volumes_params params; - - params.stream = This->stream; - params.master_volume = (This->session->mute ? 0.0f : This->session->master_vol); - params.volumes = This->vols; - params.session_volumes = This->session->channel_vols; - - WINE_UNIX_CALL(set_volumes, ¶ms); -} - static HRESULT WINAPI control_QueryInterface(IAudioSessionControl2 *iface, REFIID riid, void **ppv) { TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv); diff --git a/dlls/winealsa.drv/Makefile.in b/dlls/winealsa.drv/Makefile.in index 39e378cb7df..9494858c4dd 100644 --- a/dlls/winealsa.drv/Makefile.in +++ b/dlls/winealsa.drv/Makefile.in @@ -8,6 +8,7 @@ UNIX_LIBS = $(ALSA_LIBS) $(PTHREAD_LIBS) C_SRCS = \ alsa.c \ alsamidi.c \ + client.c \ midi.c \ mmdevdrv.c \ session.c diff --git a/dlls/winealsa.drv/mmdevdrv.c b/dlls/winealsa.drv/mmdevdrv.c index 3952d2e6718..ec50c856e38 100644 --- a/dlls/winealsa.drv/mmdevdrv.c +++ b/dlls/winealsa.drv/mmdevdrv.c @@ -76,7 +76,7 @@ extern const IAudioSessionControl2Vtbl AudioSessionControl2_Vtbl; extern const ISimpleAudioVolumeVtbl SimpleAudioVolume_Vtbl; static const IAudioClockVtbl AudioClock_Vtbl; static const IAudioClock2Vtbl AudioClock2_Vtbl; -static const IAudioStreamVolumeVtbl AudioStreamVolume_Vtbl; +extern const IAudioStreamVolumeVtbl AudioStreamVolume_Vtbl; extern const IChannelAudioVolumeVtbl ChannelAudioVolume_Vtbl; static AudioSessionWrapper *AudioSessionWrapper_Create(ACImpl *client); @@ -116,11 +116,6 @@ static inline ACImpl *impl_from_IAudioClock2(IAudioClock2 *iface) return CONTAINING_RECORD(iface, ACImpl, IAudioClock2_iface); } -static inline ACImpl *impl_from_IAudioStreamVolume(IAudioStreamVolume *iface) -{ - return CONTAINING_RECORD(iface, ACImpl, IAudioStreamVolume_iface); -} - BOOL WINAPI DllMain(HINSTANCE dll, DWORD reason, void *reserved) { switch (reason) @@ -1500,160 +1495,6 @@ static AudioSessionWrapper *AudioSessionWrapper_Create(ACImpl *client) return ret; } -static HRESULT WINAPI AudioStreamVolume_QueryInterface( - IAudioStreamVolume *iface, REFIID riid, void **ppv) -{ - TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv); - - if(!ppv) - return E_POINTER; - *ppv = NULL; - - if(IsEqualIID(riid, &IID_IUnknown) || - IsEqualIID(riid, &IID_IAudioStreamVolume)) - *ppv = iface; - if(*ppv){ - IUnknown_AddRef((IUnknown*)*ppv); - return S_OK; - } - - WARN("Unknown interface %s\n", debugstr_guid(riid)); - return E_NOINTERFACE; -} - -static ULONG WINAPI AudioStreamVolume_AddRef(IAudioStreamVolume *iface) -{ - ACImpl *This = impl_from_IAudioStreamVolume(iface); - return IAudioClient3_AddRef(&This->IAudioClient3_iface); -} - -static ULONG WINAPI AudioStreamVolume_Release(IAudioStreamVolume *iface) -{ - ACImpl *This = impl_from_IAudioStreamVolume(iface); - return IAudioClient3_Release(&This->IAudioClient3_iface); -} - -static HRESULT WINAPI AudioStreamVolume_GetChannelCount( - IAudioStreamVolume *iface, UINT32 *out) -{ - ACImpl *This = impl_from_IAudioStreamVolume(iface); - - TRACE("(%p)->(%p)\n", This, out); - - if(!out) - return E_POINTER; - - *out = This->channel_count; - - return S_OK; -} - -static HRESULT WINAPI AudioStreamVolume_SetChannelVolume( - IAudioStreamVolume *iface, UINT32 index, float level) -{ - ACImpl *This = impl_from_IAudioStreamVolume(iface); - - TRACE("(%p)->(%d, %f)\n", This, index, level); - - if(level < 0.f || level > 1.f) - return E_INVALIDARG; - - if(index >= This->channel_count) - return E_INVALIDARG; - - TRACE("ALSA does not support volume control\n"); - - sessions_lock(); - - This->vols[index] = level; - set_stream_volumes(This); - - sessions_unlock(); - - return S_OK; -} - -static HRESULT WINAPI AudioStreamVolume_GetChannelVolume( - IAudioStreamVolume *iface, UINT32 index, float *level) -{ - ACImpl *This = impl_from_IAudioStreamVolume(iface); - - TRACE("(%p)->(%d, %p)\n", This, index, level); - - if(!level) - return E_POINTER; - - if(index >= This->channel_count) - return E_INVALIDARG; - - *level = This->vols[index]; - - return S_OK; -} - -static HRESULT WINAPI AudioStreamVolume_SetAllVolumes( - IAudioStreamVolume *iface, UINT32 count, const float *levels) -{ - ACImpl *This = impl_from_IAudioStreamVolume(iface); - unsigned int i; - - TRACE("(%p)->(%d, %p)\n", This, count, levels); - - if(!levels) - return E_POINTER; - - if(count != This->channel_count) - return E_INVALIDARG; - - TRACE("ALSA does not support volume control\n"); - - sessions_lock(); - - for(i = 0; i < count; ++i) - This->vols[i] = levels[i]; - set_stream_volumes(This); - - sessions_unlock(); - - return S_OK; -} - -static HRESULT WINAPI AudioStreamVolume_GetAllVolumes( - IAudioStreamVolume *iface, UINT32 count, float *levels) -{ - ACImpl *This = impl_from_IAudioStreamVolume(iface); - unsigned int i; - - TRACE("(%p)->(%d, %p)\n", This, count, levels); - - if(!levels) - return E_POINTER; - - if(count != This->channel_count) - return E_INVALIDARG; - - sessions_lock(); - - for(i = 0; i < count; ++i) - levels[i] = This->vols[i]; - - sessions_unlock(); - - return S_OK; -} - -static const IAudioStreamVolumeVtbl AudioStreamVolume_Vtbl = -{ - AudioStreamVolume_QueryInterface, - AudioStreamVolume_AddRef, - AudioStreamVolume_Release, - AudioStreamVolume_GetChannelCount, - AudioStreamVolume_SetChannelVolume, - AudioStreamVolume_GetChannelVolume, - AudioStreamVolume_SetAllVolumes, - AudioStreamVolume_GetAllVolumes -}; - HRESULT WINAPI AUDDRV_GetAudioSessionWrapper(const GUID *guid, IMMDevice *device, AudioSessionWrapper **out) { -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/2764
From: Davide Beatrici <git(a)davidebeatrici.dev> --- dlls/winecoreaudio.drv/Makefile.in | 1 + dlls/winecoreaudio.drv/mmdevdrv.c | 159 +---------------------------- 2 files changed, 2 insertions(+), 158 deletions(-) diff --git a/dlls/winecoreaudio.drv/Makefile.in b/dlls/winecoreaudio.drv/Makefile.in index 8b40ab19afe..01c5a3d0073 100644 --- a/dlls/winecoreaudio.drv/Makefile.in +++ b/dlls/winecoreaudio.drv/Makefile.in @@ -6,6 +6,7 @@ DELAYIMPORTS = winmm UNIX_LIBS = $(COREAUDIO_LIBS) C_SRCS = \ + client.c \ coreaudio.c \ coremidi.c \ midi.c \ diff --git a/dlls/winecoreaudio.drv/mmdevdrv.c b/dlls/winecoreaudio.drv/mmdevdrv.c index 835bfc6978e..7f7bb0ecfbb 100644 --- a/dlls/winecoreaudio.drv/mmdevdrv.c +++ b/dlls/winecoreaudio.drv/mmdevdrv.c @@ -58,7 +58,7 @@ extern const IAudioSessionControl2Vtbl AudioSessionControl2_Vtbl; extern const ISimpleAudioVolumeVtbl SimpleAudioVolume_Vtbl; static const IAudioClockVtbl AudioClock_Vtbl; static const IAudioClock2Vtbl AudioClock2_Vtbl; -static const IAudioStreamVolumeVtbl AudioStreamVolume_Vtbl; +extern const IAudioStreamVolumeVtbl AudioStreamVolume_Vtbl; extern const IChannelAudioVolumeVtbl ChannelAudioVolume_Vtbl; static WCHAR drv_key_devicesW[256]; @@ -110,11 +110,6 @@ static inline ACImpl *impl_from_IAudioClock2(IAudioClock2 *iface) return CONTAINING_RECORD(iface, ACImpl, IAudioClock2_iface); } -static inline ACImpl *impl_from_IAudioStreamVolume(IAudioStreamVolume *iface) -{ - return CONTAINING_RECORD(iface, ACImpl, IAudioStreamVolume_iface); -} - BOOL WINAPI DllMain(HINSTANCE dll, DWORD reason, void *reserved) { switch (reason) @@ -1450,158 +1445,6 @@ static AudioSessionWrapper *AudioSessionWrapper_Create(ACImpl *client) return ret; } -static HRESULT WINAPI AudioStreamVolume_QueryInterface( - IAudioStreamVolume *iface, REFIID riid, void **ppv) -{ - TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv); - - if(!ppv) - return E_POINTER; - *ppv = NULL; - - if(IsEqualIID(riid, &IID_IUnknown) || - IsEqualIID(riid, &IID_IAudioStreamVolume)) - *ppv = iface; - if(*ppv){ - IUnknown_AddRef((IUnknown*)*ppv); - return S_OK; - } - - WARN("Unknown interface %s\n", debugstr_guid(riid)); - return E_NOINTERFACE; -} - -static ULONG WINAPI AudioStreamVolume_AddRef(IAudioStreamVolume *iface) -{ - ACImpl *This = impl_from_IAudioStreamVolume(iface); - return IAudioClient3_AddRef(&This->IAudioClient3_iface); -} - -static ULONG WINAPI AudioStreamVolume_Release(IAudioStreamVolume *iface) -{ - ACImpl *This = impl_from_IAudioStreamVolume(iface); - return IAudioClient3_Release(&This->IAudioClient3_iface); -} - -static HRESULT WINAPI AudioStreamVolume_GetChannelCount( - IAudioStreamVolume *iface, UINT32 *out) -{ - ACImpl *This = impl_from_IAudioStreamVolume(iface); - - TRACE("(%p)->(%p)\n", This, out); - - if(!out) - return E_POINTER; - - *out = This->channel_count; - - return S_OK; -} - -static HRESULT WINAPI AudioStreamVolume_SetChannelVolume( - IAudioStreamVolume *iface, UINT32 index, float level) -{ - ACImpl *This = impl_from_IAudioStreamVolume(iface); - - TRACE("(%p)->(%d, %f)\n", This, index, level); - - if(level < 0.f || level > 1.f) - return E_INVALIDARG; - - if(index >= This->channel_count) - return E_INVALIDARG; - - sessions_lock(); - - This->vols[index] = level; - - set_stream_volumes(This); - - sessions_unlock(); - - return S_OK; -} - -static HRESULT WINAPI AudioStreamVolume_GetChannelVolume( - IAudioStreamVolume *iface, UINT32 index, float *level) -{ - ACImpl *This = impl_from_IAudioStreamVolume(iface); - - TRACE("(%p)->(%d, %p)\n", This, index, level); - - if(!level) - return E_POINTER; - - if(index >= This->channel_count) - return E_INVALIDARG; - - *level = This->vols[index]; - - return S_OK; -} - -static HRESULT WINAPI AudioStreamVolume_SetAllVolumes( - IAudioStreamVolume *iface, UINT32 count, const float *levels) -{ - ACImpl *This = impl_from_IAudioStreamVolume(iface); - UINT32 i; - - TRACE("(%p)->(%d, %p)\n", This, count, levels); - - if(!levels) - return E_POINTER; - - if(count != This->channel_count) - return E_INVALIDARG; - - sessions_lock(); - - for(i = 0; i < count; ++i) - This->vols[i] = levels[i]; - - set_stream_volumes(This); - - sessions_unlock(); - - return S_OK; -} - -static HRESULT WINAPI AudioStreamVolume_GetAllVolumes( - IAudioStreamVolume *iface, UINT32 count, float *levels) -{ - ACImpl *This = impl_from_IAudioStreamVolume(iface); - UINT32 i; - - TRACE("(%p)->(%d, %p)\n", This, count, levels); - - if(!levels) - return E_POINTER; - - if(count != This->channel_count) - return E_INVALIDARG; - - sessions_lock(); - - for(i = 0; i < count; ++i) - levels[i] = This->vols[i]; - - sessions_unlock(); - - return S_OK; -} - -static const IAudioStreamVolumeVtbl AudioStreamVolume_Vtbl = -{ - AudioStreamVolume_QueryInterface, - AudioStreamVolume_AddRef, - AudioStreamVolume_Release, - AudioStreamVolume_GetChannelCount, - AudioStreamVolume_SetChannelVolume, - AudioStreamVolume_GetChannelVolume, - AudioStreamVolume_SetAllVolumes, - AudioStreamVolume_GetAllVolumes -}; - HRESULT WINAPI AUDDRV_GetAudioSessionWrapper(const GUID *guid, IMMDevice *device, AudioSessionWrapper **out) { -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/2764
From: Davide Beatrici <git(a)davidebeatrici.dev> --- dlls/wineoss.drv/Makefile.in | 1 + dlls/wineoss.drv/mmdevdrv.c | 156 +---------------------------------- 2 files changed, 2 insertions(+), 155 deletions(-) diff --git a/dlls/wineoss.drv/Makefile.in b/dlls/wineoss.drv/Makefile.in index a6e56f3065c..121595a7c6c 100644 --- a/dlls/wineoss.drv/Makefile.in +++ b/dlls/wineoss.drv/Makefile.in @@ -7,6 +7,7 @@ UNIX_LIBS = $(OSS4_LIBS) $(PTHREAD_LIBS) UNIX_CFLAGS = $(OSS4_CFLAGS) C_SRCS = \ + client.c \ midi.c \ midipatch.c \ mmaux.c \ diff --git a/dlls/wineoss.drv/mmdevdrv.c b/dlls/wineoss.drv/mmdevdrv.c index ae9d879cb02..1940750d484 100644 --- a/dlls/wineoss.drv/mmdevdrv.c +++ b/dlls/wineoss.drv/mmdevdrv.c @@ -84,7 +84,7 @@ extern const IAudioSessionControl2Vtbl AudioSessionControl2_Vtbl; extern const ISimpleAudioVolumeVtbl SimpleAudioVolume_Vtbl; static const IAudioClockVtbl AudioClock_Vtbl; static const IAudioClock2Vtbl AudioClock2_Vtbl; -static const IAudioStreamVolumeVtbl AudioStreamVolume_Vtbl; +extern const IAudioStreamVolumeVtbl AudioStreamVolume_Vtbl; extern const IChannelAudioVolumeVtbl ChannelAudioVolume_Vtbl; void DECLSPEC_HIDDEN sessions_lock(void) @@ -1449,160 +1449,6 @@ static AudioSessionWrapper *AudioSessionWrapper_Create(ACImpl *client) return ret; } -static HRESULT WINAPI AudioStreamVolume_QueryInterface( - IAudioStreamVolume *iface, REFIID riid, void **ppv) -{ - TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv); - - if(!ppv) - return E_POINTER; - *ppv = NULL; - - if(IsEqualIID(riid, &IID_IUnknown) || - IsEqualIID(riid, &IID_IAudioStreamVolume)) - *ppv = iface; - if(*ppv){ - IUnknown_AddRef((IUnknown*)*ppv); - return S_OK; - } - - WARN("Unknown interface %s\n", debugstr_guid(riid)); - return E_NOINTERFACE; -} - -static ULONG WINAPI AudioStreamVolume_AddRef(IAudioStreamVolume *iface) -{ - ACImpl *This = impl_from_IAudioStreamVolume(iface); - return IAudioClient3_AddRef(&This->IAudioClient3_iface); -} - -static ULONG WINAPI AudioStreamVolume_Release(IAudioStreamVolume *iface) -{ - ACImpl *This = impl_from_IAudioStreamVolume(iface); - return IAudioClient3_Release(&This->IAudioClient3_iface); -} - -static HRESULT WINAPI AudioStreamVolume_GetChannelCount( - IAudioStreamVolume *iface, UINT32 *out) -{ - ACImpl *This = impl_from_IAudioStreamVolume(iface); - - TRACE("(%p)->(%p)\n", This, out); - - if(!out) - return E_POINTER; - - *out = This->channel_count; - - return S_OK; -} - -static HRESULT WINAPI AudioStreamVolume_SetChannelVolume( - IAudioStreamVolume *iface, UINT32 index, float level) -{ - ACImpl *This = impl_from_IAudioStreamVolume(iface); - - TRACE("(%p)->(%d, %f)\n", This, index, level); - - if(level < 0.f || level > 1.f) - return E_INVALIDARG; - - if(index >= This->channel_count) - return E_INVALIDARG; - - sessions_lock(); - - This->vols[index] = level; - - TRACE("OSS doesn't support setting volume\n"); - set_stream_volumes(This); - - sessions_unlock(); - - return S_OK; -} - -static HRESULT WINAPI AudioStreamVolume_GetChannelVolume( - IAudioStreamVolume *iface, UINT32 index, float *level) -{ - ACImpl *This = impl_from_IAudioStreamVolume(iface); - - TRACE("(%p)->(%d, %p)\n", This, index, level); - - if(!level) - return E_POINTER; - - if(index >= This->channel_count) - return E_INVALIDARG; - - *level = This->vols[index]; - - return S_OK; -} - -static HRESULT WINAPI AudioStreamVolume_SetAllVolumes( - IAudioStreamVolume *iface, UINT32 count, const float *levels) -{ - ACImpl *This = impl_from_IAudioStreamVolume(iface); - int i; - - TRACE("(%p)->(%d, %p)\n", This, count, levels); - - if(!levels) - return E_POINTER; - - if(count != This->channel_count) - return E_INVALIDARG; - - sessions_lock(); - - for(i = 0; i < count; ++i) - This->vols[i] = levels[i]; - - TRACE("OSS doesn't support setting volume\n"); - set_stream_volumes(This); - - sessions_unlock(); - - return S_OK; -} - -static HRESULT WINAPI AudioStreamVolume_GetAllVolumes( - IAudioStreamVolume *iface, UINT32 count, float *levels) -{ - ACImpl *This = impl_from_IAudioStreamVolume(iface); - int i; - - TRACE("(%p)->(%d, %p)\n", This, count, levels); - - if(!levels) - return E_POINTER; - - if(count != This->channel_count) - return E_INVALIDARG; - - sessions_lock(); - - for(i = 0; i < count; ++i) - levels[i] = This->vols[i]; - - sessions_unlock(); - - return S_OK; -} - -static const IAudioStreamVolumeVtbl AudioStreamVolume_Vtbl = -{ - AudioStreamVolume_QueryInterface, - AudioStreamVolume_AddRef, - AudioStreamVolume_Release, - AudioStreamVolume_GetChannelCount, - AudioStreamVolume_SetChannelVolume, - AudioStreamVolume_GetChannelVolume, - AudioStreamVolume_SetAllVolumes, - AudioStreamVolume_GetAllVolumes -}; - HRESULT WINAPI AUDDRV_GetAudioSessionWrapper(const GUID *guid, IMMDevice *device, AudioSessionWrapper **out) { -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/2764
From: Davide Beatrici <git(a)davidebeatrici.dev> --- dlls/winepulse.drv/Makefile.in | 1 + dlls/winepulse.drv/mmdevdrv.c | 168 +-------------------------------- 2 files changed, 2 insertions(+), 167 deletions(-) diff --git a/dlls/winepulse.drv/Makefile.in b/dlls/winepulse.drv/Makefile.in index 8a6d6f1ae91..f5593dbcc70 100644 --- a/dlls/winepulse.drv/Makefile.in +++ b/dlls/winepulse.drv/Makefile.in @@ -6,6 +6,7 @@ UNIX_LIBS = $(PULSE_LIBS) $(PTHREAD_LIBS) -lm UNIX_CFLAGS = $(PULSE_CFLAGS) C_SRCS = \ + client.c \ mmdevdrv.c \ pulse.c \ session.c diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c index 84ac537701b..333848e4242 100644 --- a/dlls/winepulse.drv/mmdevdrv.c +++ b/dlls/winepulse.drv/mmdevdrv.c @@ -132,7 +132,7 @@ extern const ISimpleAudioVolumeVtbl SimpleAudioVolume_Vtbl; extern const IChannelAudioVolumeVtbl ChannelAudioVolume_Vtbl; static const IAudioClockVtbl AudioClock_Vtbl; static const IAudioClock2Vtbl AudioClock2_Vtbl; -static const IAudioStreamVolumeVtbl AudioStreamVolume_Vtbl; +extern const IAudioStreamVolumeVtbl AudioStreamVolume_Vtbl; static AudioSessionWrapper *AudioSessionWrapper_Create(ACImpl *client); @@ -161,11 +161,6 @@ static inline ACImpl *impl_from_IAudioClock2(IAudioClock2 *iface) return CONTAINING_RECORD(iface, ACImpl, IAudioClock2_iface); } -static inline ACImpl *impl_from_IAudioStreamVolume(IAudioStreamVolume *iface) -{ - return CONTAINING_RECORD(iface, ACImpl, IAudioStreamVolume_iface); -} - static void pulse_call(enum unix_funcs code, void *params) { NTSTATUS status; @@ -1696,167 +1691,6 @@ static const IAudioClock2Vtbl AudioClock2_Vtbl = AudioClock2_GetDevicePosition }; -static HRESULT WINAPI AudioStreamVolume_QueryInterface( - IAudioStreamVolume *iface, REFIID riid, void **ppv) -{ - ACImpl *This = impl_from_IAudioStreamVolume(iface); - - TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv); - - if (!ppv) - return E_POINTER; - *ppv = NULL; - - if (IsEqualIID(riid, &IID_IUnknown) || - IsEqualIID(riid, &IID_IAudioStreamVolume)) - *ppv = iface; - if (*ppv) { - IUnknown_AddRef((IUnknown*)*ppv); - return S_OK; - } - - if (IsEqualIID(riid, &IID_IMarshal)) - return IUnknown_QueryInterface(This->marshal, riid, ppv); - - WARN("Unknown interface %s\n", debugstr_guid(riid)); - return E_NOINTERFACE; -} - -static ULONG WINAPI AudioStreamVolume_AddRef(IAudioStreamVolume *iface) -{ - ACImpl *This = impl_from_IAudioStreamVolume(iface); - return IAudioClient3_AddRef(&This->IAudioClient3_iface); -} - -static ULONG WINAPI AudioStreamVolume_Release(IAudioStreamVolume *iface) -{ - ACImpl *This = impl_from_IAudioStreamVolume(iface); - return IAudioClient3_Release(&This->IAudioClient3_iface); -} - -static HRESULT WINAPI AudioStreamVolume_GetChannelCount( - IAudioStreamVolume *iface, UINT32 *out) -{ - ACImpl *This = impl_from_IAudioStreamVolume(iface); - - TRACE("(%p)->(%p)\n", This, out); - - if (!out) - return E_POINTER; - - *out = This->channel_count; - - return S_OK; -} - -struct pulse_info_cb_data { - UINT32 n; - float *levels; -}; - -static HRESULT WINAPI AudioStreamVolume_SetAllVolumes( - IAudioStreamVolume *iface, UINT32 count, const float *levels) -{ - ACImpl *This = impl_from_IAudioStreamVolume(iface); - int i; - - TRACE("(%p)->(%d, %p)\n", This, count, levels); - - if (!levels) - return E_POINTER; - - if (!This->stream) - return AUDCLNT_E_NOT_INITIALIZED; - if (count != This->channel_count) - return E_INVALIDARG; - - sessions_lock(); - for (i = 0; i < count; ++i) - This->vols[i] = levels[i]; - - set_stream_volumes(This); - sessions_unlock(); - return S_OK; -} - -static HRESULT WINAPI AudioStreamVolume_GetAllVolumes( - IAudioStreamVolume *iface, UINT32 count, float *levels) -{ - ACImpl *This = impl_from_IAudioStreamVolume(iface); - int i; - - TRACE("(%p)->(%d, %p)\n", This, count, levels); - - if (!levels) - return E_POINTER; - - if (!This->stream) - return AUDCLNT_E_NOT_INITIALIZED; - if (count != This->channel_count) - return E_INVALIDARG; - - sessions_lock(); - for (i = 0; i < count; ++i) - levels[i] = This->vols[i]; - sessions_unlock(); - return S_OK; -} - -static HRESULT WINAPI AudioStreamVolume_SetChannelVolume( - IAudioStreamVolume *iface, UINT32 index, float level) -{ - ACImpl *This = impl_from_IAudioStreamVolume(iface); - - TRACE("(%p)->(%d, %f)\n", This, index, level); - - if (level < 0.f || level > 1.f) - return E_INVALIDARG; - - if (!This->stream) - return AUDCLNT_E_NOT_INITIALIZED; - if (index >= This->channel_count) - return E_INVALIDARG; - - sessions_lock(); - This->vols[index] = level; - set_stream_volumes(This); - sessions_unlock(); - return S_OK; -} - -static HRESULT WINAPI AudioStreamVolume_GetChannelVolume( - IAudioStreamVolume *iface, UINT32 index, float *level) -{ - ACImpl *This = impl_from_IAudioStreamVolume(iface); - - TRACE("(%p)->(%d, %p)\n", This, index, level); - - if (!level) - return E_POINTER; - - if (!This->stream) - return AUDCLNT_E_NOT_INITIALIZED; - if (index >= This->channel_count) - return E_INVALIDARG; - - sessions_lock(); - *level = This->vols[index]; - sessions_unlock(); - return S_OK; -} - -static const IAudioStreamVolumeVtbl AudioStreamVolume_Vtbl = -{ - AudioStreamVolume_QueryInterface, - AudioStreamVolume_AddRef, - AudioStreamVolume_Release, - AudioStreamVolume_GetChannelCount, - AudioStreamVolume_SetChannelVolume, - AudioStreamVolume_GetChannelVolume, - AudioStreamVolume_SetAllVolumes, - AudioStreamVolume_GetAllVolumes -}; - static AudioSessionWrapper *AudioSessionWrapper_Create(ACImpl *client) { AudioSessionWrapper *ret; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/2764
Hi, It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated. The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=132494 Your paranoid android. === debian11 (build log) === makedep: error: open client.c : No such file or directory config.status: error: could not create Makefile Task: The win32 Wine build failed === debian11b (build log) === makedep: error: open client.c : No such file or directory config.status: error: could not create Makefile Task: The wow64 Wine build failed
Davide Beatrici (@davidebeatrici) commented about dlls/winepulse.drv/mmdevdrv.c:
- ACImpl *This = impl_from_IAudioStreamVolume(iface); - - TRACE("(%p)->(%p)\n", This, out); - - if (!out) - return E_POINTER; - - *out = This->channel_count; - - return S_OK; -} - -struct pulse_info_cb_data { - UINT32 n; - float *levels; -}; It was unused.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/2764#note_32205
On Tue May 9 05:06:07 2023 +0000, **** wrote:
Marvin replied on the mailing list: ``` Hi, It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated. The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=132494 Your paranoid android. === debian11 (build log) === makedep: error: open client.c : No such file or directory config.status: error: could not create Makefile Task: The win32 Wine build failed === debian11b (build log) === makedep: error: open client.c : No such file or directory config.status: error: could not create Makefile Task: The wow64 Wine build failed ``` Oops, forgot to `git add` it.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/2764#note_32207
participants (3)
-
Davide Beatrici -
Davide Beatrici (@davidebeatrici) -
Marvin