Commit a5997bec authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

winepulse: Move pulse_set_event_handle to unix lib.

parent 24a7c33f
......@@ -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);
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment