winepulse: Move pulse_set_event_handle to unix lib.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Andrew Eikum <aeikum@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
24a7c33fc1
commit
a5997bece7
|
@ -943,28 +943,15 @@ static HRESULT WINAPI AudioClient_SetEventHandle(IAudioClient3 *iface,
|
|||
HANDLE event)
|
||||
{
|
||||
ACImpl *This = impl_from_IAudioClient3(iface);
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, event);
|
||||
|
||||
if (!event)
|
||||
return E_INVALIDARG;
|
||||
if (!This->pulse_stream)
|
||||
return AUDCLNT_E_NOT_INITIALIZED;
|
||||
|
||||
pulse->lock();
|
||||
hr = pulse_stream_valid(This);
|
||||
if (FAILED(hr)) {
|
||||
pulse->unlock();
|
||||
return hr;
|
||||
}
|
||||
|
||||
if (!(This->pulse_stream->flags & AUDCLNT_STREAMFLAGS_EVENTCALLBACK))
|
||||
hr = AUDCLNT_E_EVENTHANDLE_NOT_EXPECTED;
|
||||
else if (This->pulse_stream->event)
|
||||
hr = HRESULT_FROM_WIN32(ERROR_INVALID_NAME);
|
||||
else
|
||||
This->pulse_stream->event = event;
|
||||
pulse->unlock();
|
||||
return hr;
|
||||
return pulse->set_event_handle(This->pulse_stream, event);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI AudioClient_GetService(IAudioClient3 *iface, REFIID riid,
|
||||
|
|
|
@ -1541,6 +1541,24 @@ static void WINAPI pulse_set_volumes(struct pulse_stream *stream, float master_v
|
|||
stream->vol[i] = volumes[i] * master_volume * session_volumes[i];
|
||||
}
|
||||
|
||||
static HRESULT WINAPI pulse_set_event_handle(struct pulse_stream *stream, HANDLE event)
|
||||
{
|
||||
HRESULT hr = S_OK;
|
||||
|
||||
pulse_lock();
|
||||
if (!pulse_stream_valid(stream))
|
||||
hr = AUDCLNT_E_DEVICE_INVALIDATED;
|
||||
else if (!(stream->flags & AUDCLNT_STREAMFLAGS_EVENTCALLBACK))
|
||||
hr = AUDCLNT_E_EVENTHANDLE_NOT_EXPECTED;
|
||||
else if (stream->event)
|
||||
hr = HRESULT_FROM_WIN32(ERROR_INVALID_NAME);
|
||||
else
|
||||
stream->event = event;
|
||||
pulse_unlock();
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
static const struct unix_funcs unix_funcs =
|
||||
{
|
||||
pulse_lock,
|
||||
|
@ -1556,6 +1574,7 @@ static const struct unix_funcs unix_funcs =
|
|||
pulse_get_render_buffer,
|
||||
pulse_release_render_buffer,
|
||||
pulse_set_volumes,
|
||||
pulse_set_event_handle,
|
||||
pulse_test_connect,
|
||||
};
|
||||
|
||||
|
|
|
@ -86,5 +86,6 @@ struct unix_funcs
|
|||
DWORD flags);
|
||||
void (WINAPI *set_volumes)(struct pulse_stream *stream, float master_volume,
|
||||
const float *volumes, const float *session_volumes);
|
||||
HRESULT (WINAPI *set_event_handle)(struct pulse_stream *stream, HANDLE event);
|
||||
HRESULT (WINAPI *test_connect)(const char *name, struct pulse_config *config);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue