From: Davide Beatrici git@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;