Commit 2fa22538 authored by Davide Beatrici's avatar Davide Beatrici Committed by Alexandre Julliard

mmdevapi: Integrate winecoreaudio's additions in unixlib.h.

The data type for "done" was accidentally changed in e29dc33a. BOOL is basically the same as UINT32, but it should only be used for flags. BOOLEAN would be better for that though, as it's single-byte.
parent 013f662c
/* /*
* Copyright 2021 Jacek Caban for CodeWeavers * Copyright 2021 Jacek Caban for CodeWeavers
* Copyright 2022 Huw Davies * Copyright 2021-2022 Huw Davies
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
...@@ -126,7 +126,7 @@ struct get_capture_buffer_params ...@@ -126,7 +126,7 @@ struct get_capture_buffer_params
struct release_capture_buffer_params struct release_capture_buffer_params
{ {
stream_handle stream; stream_handle stream;
BOOL done; UINT32 done;
HRESULT result; HRESULT result;
}; };
...@@ -161,7 +161,7 @@ struct get_buffer_size_params ...@@ -161,7 +161,7 @@ struct get_buffer_size_params
{ {
stream_handle stream; stream_handle stream;
HRESULT result; HRESULT result;
UINT32 *size; UINT32 *frames;
}; };
struct get_latency_params struct get_latency_params
...@@ -207,6 +207,7 @@ struct set_volumes_params ...@@ -207,6 +207,7 @@ struct set_volumes_params
float master_volume; float master_volume;
const float *volumes; const float *volumes;
const float *session_volumes; const float *session_volumes;
int channel;
}; };
struct set_event_handle_params struct set_event_handle_params
...@@ -240,6 +241,11 @@ struct get_prop_value_params ...@@ -240,6 +241,11 @@ struct get_prop_value_params
unsigned int *buffer_size; unsigned int *buffer_size;
}; };
struct midi_init_params
{
UINT *err;
};
struct notify_context struct notify_context
{ {
BOOL send_notify; BOOL send_notify;
...@@ -321,6 +327,7 @@ enum unix_funcs ...@@ -321,6 +327,7 @@ enum unix_funcs
test_connect, test_connect,
is_started, is_started,
get_prop_value, get_prop_value,
midi_init,
midi_release, midi_release,
midi_out_message, midi_out_message,
midi_in_message, midi_in_message,
......
...@@ -2098,7 +2098,7 @@ static NTSTATUS alsa_get_buffer_size(void *args) ...@@ -2098,7 +2098,7 @@ static NTSTATUS alsa_get_buffer_size(void *args)
alsa_lock(stream); alsa_lock(stream);
*params->size = stream->bufsize_frames; *params->frames = stream->bufsize_frames;
return alsa_unlock_result(stream, &params->result, S_OK); return alsa_unlock_result(stream, &params->result, S_OK);
} }
...@@ -2459,6 +2459,7 @@ unixlib_entry_t __wine_unix_call_funcs[] = ...@@ -2459,6 +2459,7 @@ unixlib_entry_t __wine_unix_call_funcs[] =
NULL, NULL,
alsa_is_started, alsa_is_started,
alsa_get_prop_value, alsa_get_prop_value,
NULL,
alsa_midi_release, alsa_midi_release,
alsa_midi_out_message, alsa_midi_out_message,
alsa_midi_in_message, alsa_midi_in_message,
...@@ -2647,12 +2648,12 @@ static NTSTATUS alsa_wow64_get_buffer_size(void *args) ...@@ -2647,12 +2648,12 @@ static NTSTATUS alsa_wow64_get_buffer_size(void *args)
{ {
stream_handle stream; stream_handle stream;
HRESULT result; HRESULT result;
PTR32 size; PTR32 frames;
} *params32 = args; } *params32 = args;
struct get_buffer_size_params params = struct get_buffer_size_params params =
{ {
.stream = params32->stream, .stream = params32->stream,
.size = ULongToPtr(params32->size) .frames = ULongToPtr(params32->frames)
}; };
alsa_get_buffer_size(&params); alsa_get_buffer_size(&params);
params32->result = params.result; params32->result = params.result;
...@@ -2761,13 +2762,15 @@ static NTSTATUS alsa_wow64_set_volumes(void *args) ...@@ -2761,13 +2762,15 @@ static NTSTATUS alsa_wow64_set_volumes(void *args)
float master_volume; float master_volume;
PTR32 volumes; PTR32 volumes;
PTR32 session_volumes; PTR32 session_volumes;
int channel;
} *params32 = args; } *params32 = args;
struct set_volumes_params params = struct set_volumes_params params =
{ {
.stream = params32->stream, .stream = params32->stream,
.master_volume = params32->master_volume, .master_volume = params32->master_volume,
.volumes = ULongToPtr(params32->volumes), .volumes = ULongToPtr(params32->volumes),
.session_volumes = ULongToPtr(params32->session_volumes) .session_volumes = ULongToPtr(params32->session_volumes),
.channel = params32->channel
}; };
return alsa_set_volumes(&params); return alsa_set_volumes(&params);
} }
...@@ -2877,6 +2880,7 @@ unixlib_entry_t __wine_unix_call_wow64_funcs[] = ...@@ -2877,6 +2880,7 @@ unixlib_entry_t __wine_unix_call_wow64_funcs[] =
NULL, NULL,
alsa_is_started, alsa_is_started,
alsa_wow64_get_prop_value, alsa_wow64_get_prop_value,
NULL,
alsa_midi_release, alsa_midi_release,
alsa_wow64_midi_out_message, alsa_wow64_midi_out_message,
alsa_wow64_midi_in_message, alsa_wow64_midi_in_message,
......
...@@ -414,7 +414,7 @@ static void port_add(snd_seq_client_info_t* cinfo, snd_seq_port_info_t* pinfo, u ...@@ -414,7 +414,7 @@ static void port_add(snd_seq_client_info_t* cinfo, snd_seq_port_info_t* pinfo, u
} }
} }
static UINT midi_init(void) static UINT alsa_midi_init(void)
{ {
static BOOL init_done; static BOOL init_done;
snd_seq_client_info_t *cinfo; snd_seq_client_info_t *cinfo;
...@@ -1398,7 +1398,7 @@ NTSTATUS alsa_midi_out_message(void *args) ...@@ -1398,7 +1398,7 @@ NTSTATUS alsa_midi_out_message(void *args)
switch (params->msg) switch (params->msg)
{ {
case DRVM_INIT: case DRVM_INIT:
*params->err = midi_init(); *params->err = alsa_midi_init();
break; break;
case DRVM_EXIT: case DRVM_EXIT:
case DRVM_ENABLE: case DRVM_ENABLE:
...@@ -1456,7 +1456,7 @@ NTSTATUS alsa_midi_in_message(void *args) ...@@ -1456,7 +1456,7 @@ NTSTATUS alsa_midi_in_message(void *args)
switch (params->msg) switch (params->msg)
{ {
case DRVM_INIT: case DRVM_INIT:
*params->err = midi_init(); *params->err = alsa_midi_init();
break; break;
case DRVM_EXIT: case DRVM_EXIT:
case DRVM_ENABLE: case DRVM_ENABLE:
......
...@@ -325,6 +325,7 @@ static void set_stream_volumes(ACImpl *This) ...@@ -325,6 +325,7 @@ static void set_stream_volumes(ACImpl *This)
params.master_volume = (This->session->mute ? 0.0f : This->session->master_vol); params.master_volume = (This->session->mute ? 0.0f : This->session->master_vol);
params.volumes = This->vols; params.volumes = This->vols;
params.session_volumes = This->session->channel_vols; params.session_volumes = This->session->channel_vols;
params.channel = 0;
ALSA_CALL(set_volumes, &params); ALSA_CALL(set_volumes, &params);
} }
...@@ -801,7 +802,7 @@ static HRESULT WINAPI AudioClient_GetBufferSize(IAudioClient3 *iface, ...@@ -801,7 +802,7 @@ static HRESULT WINAPI AudioClient_GetBufferSize(IAudioClient3 *iface,
return AUDCLNT_E_NOT_INITIALIZED; return AUDCLNT_E_NOT_INITIALIZED;
params.stream = This->stream; params.stream = This->stream;
params.size = out; params.frames = out;
ALSA_CALL(get_buffer_size, &params); ALSA_CALL(get_buffer_size, &params);
......
...@@ -343,6 +343,7 @@ static void set_stream_volumes(ACImpl *This) ...@@ -343,6 +343,7 @@ static void set_stream_volumes(ACImpl *This)
params.master_volume = (This->session->mute ? 0.0f : This->session->master_vol); params.master_volume = (This->session->mute ? 0.0f : This->session->master_vol);
params.volumes = This->vols; params.volumes = This->vols;
params.session_volumes = This->session->channel_vols; params.session_volumes = This->session->channel_vols;
params.channel = 0;
OSS_CALL(set_volumes, &params); OSS_CALL(set_volumes, &params);
} }
...@@ -772,7 +773,7 @@ static HRESULT WINAPI AudioClient_GetBufferSize(IAudioClient3 *iface, ...@@ -772,7 +773,7 @@ static HRESULT WINAPI AudioClient_GetBufferSize(IAudioClient3 *iface,
return AUDCLNT_E_NOT_INITIALIZED; return AUDCLNT_E_NOT_INITIALIZED;
params.stream = This->stream; params.stream = This->stream;
params.size = frames; params.frames = frames;
OSS_CALL(get_buffer_size, &params); OSS_CALL(get_buffer_size, &params);
TRACE("buffer size: %u\n", *frames); TRACE("buffer size: %u\n", *frames);
......
...@@ -1247,7 +1247,7 @@ static NTSTATUS oss_get_buffer_size(void *args) ...@@ -1247,7 +1247,7 @@ static NTSTATUS oss_get_buffer_size(void *args)
oss_lock(stream); oss_lock(stream);
*params->size = stream->bufsize_frames; *params->frames = stream->bufsize_frames;
return oss_unlock_result(stream, &params->result, S_OK); return oss_unlock_result(stream, &params->result, S_OK);
} }
...@@ -1640,6 +1640,7 @@ unixlib_entry_t __wine_unix_call_funcs[] = ...@@ -1640,6 +1640,7 @@ unixlib_entry_t __wine_unix_call_funcs[] =
oss_test_connect, oss_test_connect,
oss_is_started, oss_is_started,
NULL, NULL,
NULL,
oss_midi_release, oss_midi_release,
oss_midi_out_message, oss_midi_out_message,
oss_midi_in_message, oss_midi_in_message,
...@@ -1844,12 +1845,12 @@ static NTSTATUS oss_wow64_get_buffer_size(void *args) ...@@ -1844,12 +1845,12 @@ static NTSTATUS oss_wow64_get_buffer_size(void *args)
{ {
stream_handle stream; stream_handle stream;
HRESULT result; HRESULT result;
PTR32 size; PTR32 frames;
} *params32 = args; } *params32 = args;
struct get_buffer_size_params params = struct get_buffer_size_params params =
{ {
.stream = params32->stream, .stream = params32->stream,
.size = ULongToPtr(params32->size) .frames = ULongToPtr(params32->frames)
}; };
oss_get_buffer_size(&params); oss_get_buffer_size(&params);
params32->result = params.result; params32->result = params.result;
...@@ -1958,13 +1959,15 @@ static NTSTATUS oss_wow64_set_volumes(void *args) ...@@ -1958,13 +1959,15 @@ static NTSTATUS oss_wow64_set_volumes(void *args)
float master_volume; float master_volume;
PTR32 volumes; PTR32 volumes;
PTR32 session_volumes; PTR32 session_volumes;
int channel;
} *params32 = args; } *params32 = args;
struct set_volumes_params params = struct set_volumes_params params =
{ {
.stream = params32->stream, .stream = params32->stream,
.master_volume = params32->master_volume, .master_volume = params32->master_volume,
.volumes = ULongToPtr(params32->volumes), .volumes = ULongToPtr(params32->volumes),
.session_volumes = ULongToPtr(params32->session_volumes) .session_volumes = ULongToPtr(params32->session_volumes),
.channel = params32->channel
}; };
return oss_set_volumes(&params); return oss_set_volumes(&params);
} }
...@@ -2041,6 +2044,7 @@ unixlib_entry_t __wine_unix_call_wow64_funcs[] = ...@@ -2041,6 +2044,7 @@ unixlib_entry_t __wine_unix_call_wow64_funcs[] =
oss_wow64_test_connect, oss_wow64_test_connect,
oss_is_started, oss_is_started,
NULL, NULL,
NULL,
oss_midi_release, oss_midi_release,
oss_wow64_midi_out_message, oss_wow64_midi_out_message,
oss_wow64_midi_in_message, oss_wow64_midi_in_message,
......
...@@ -303,7 +303,7 @@ static int seq_close(int fd) ...@@ -303,7 +303,7 @@ static int seq_close(int fd)
return 0; return 0;
} }
static UINT midi_init(void) static UINT oss_midi_init(void)
{ {
int i, status, synth_devs = 255, midi_devs = 255, fd, len; int i, status, synth_devs = 255, midi_devs = 255, fd, len;
struct synth_info sinfo; struct synth_info sinfo;
...@@ -1694,7 +1694,7 @@ NTSTATUS oss_midi_out_message(void *args) ...@@ -1694,7 +1694,7 @@ NTSTATUS oss_midi_out_message(void *args)
switch (params->msg) switch (params->msg)
{ {
case DRVM_INIT: case DRVM_INIT:
*params->err = midi_init(); *params->err = oss_midi_init();
break; break;
case DRVM_EXIT: case DRVM_EXIT:
*params->err = midi_exit(); *params->err = midi_exit();
...@@ -1754,7 +1754,7 @@ NTSTATUS oss_midi_in_message(void *args) ...@@ -1754,7 +1754,7 @@ NTSTATUS oss_midi_in_message(void *args)
switch (params->msg) switch (params->msg)
{ {
case DRVM_INIT: case DRVM_INIT:
*params->err = midi_init(); *params->err = oss_midi_init();
break; break;
case DRVM_EXIT: case DRVM_EXIT:
*params->err = midi_exit(); *params->err = midi_exit();
......
...@@ -370,6 +370,7 @@ static void set_stream_volumes(ACImpl *This) ...@@ -370,6 +370,7 @@ static void set_stream_volumes(ACImpl *This)
params.master_volume = This->session->mute ? 0.0f : This->session->master_vol; params.master_volume = This->session->mute ? 0.0f : This->session->master_vol;
params.volumes = This->vol; params.volumes = This->vol;
params.session_volumes = This->session->channel_vols; params.session_volumes = This->session->channel_vols;
params.channel = 0;
pulse_call(set_volumes, &params); pulse_call(set_volumes, &params);
} }
...@@ -930,7 +931,7 @@ static HRESULT WINAPI AudioClient_GetBufferSize(IAudioClient3 *iface, ...@@ -930,7 +931,7 @@ static HRESULT WINAPI AudioClient_GetBufferSize(IAudioClient3 *iface,
return AUDCLNT_E_NOT_INITIALIZED; return AUDCLNT_E_NOT_INITIALIZED;
params.stream = This->pulse_stream; params.stream = This->pulse_stream;
params.size = out; params.frames = out;
pulse_call(get_buffer_size, &params); pulse_call(get_buffer_size, &params);
return params.result; return params.result;
} }
......
...@@ -2095,7 +2095,7 @@ static NTSTATUS pulse_get_buffer_size(void *args) ...@@ -2095,7 +2095,7 @@ static NTSTATUS pulse_get_buffer_size(void *args)
if (!pulse_stream_valid(stream)) if (!pulse_stream_valid(stream))
params->result = AUDCLNT_E_DEVICE_INVALIDATED; params->result = AUDCLNT_E_DEVICE_INVALIDATED;
else else
*params->size = stream->bufsize_frames; *params->frames = stream->bufsize_frames;
pulse_unlock(); pulse_unlock();
return STATUS_SUCCESS; return STATUS_SUCCESS;
...@@ -2393,6 +2393,7 @@ const unixlib_entry_t __wine_unix_call_funcs[] = ...@@ -2393,6 +2393,7 @@ const unixlib_entry_t __wine_unix_call_funcs[] =
NULL, NULL,
NULL, NULL,
NULL, NULL,
NULL,
}; };
#ifdef _WIN64 #ifdef _WIN64
...@@ -2587,12 +2588,12 @@ static NTSTATUS pulse_wow64_get_buffer_size(void *args) ...@@ -2587,12 +2588,12 @@ static NTSTATUS pulse_wow64_get_buffer_size(void *args)
{ {
stream_handle stream; stream_handle stream;
HRESULT result; HRESULT result;
PTR32 size; PTR32 frames;
} *params32 = args; } *params32 = args;
struct get_buffer_size_params params = struct get_buffer_size_params params =
{ {
.stream = params32->stream, .stream = params32->stream,
.size = ULongToPtr(params32->size) .frames = ULongToPtr(params32->frames)
}; };
pulse_get_buffer_size(&params); pulse_get_buffer_size(&params);
params32->result = params.result; params32->result = params.result;
...@@ -2701,13 +2702,15 @@ static NTSTATUS pulse_wow64_set_volumes(void *args) ...@@ -2701,13 +2702,15 @@ static NTSTATUS pulse_wow64_set_volumes(void *args)
float master_volume; float master_volume;
PTR32 volumes; PTR32 volumes;
PTR32 session_volumes; PTR32 session_volumes;
int channel;
} *params32 = args; } *params32 = args;
struct set_volumes_params params = struct set_volumes_params params =
{ {
.stream = params32->stream, .stream = params32->stream,
.master_volume = params32->master_volume, .master_volume = params32->master_volume,
.volumes = ULongToPtr(params32->volumes), .volumes = ULongToPtr(params32->volumes),
.session_volumes = ULongToPtr(params32->session_volumes) .session_volumes = ULongToPtr(params32->session_volumes),
.channel = params32->channel
}; };
return pulse_set_volumes(&params); return pulse_set_volumes(&params);
} }
...@@ -2837,6 +2840,7 @@ const unixlib_entry_t __wine_unix_call_wow64_funcs[] = ...@@ -2837,6 +2840,7 @@ const unixlib_entry_t __wine_unix_call_wow64_funcs[] =
NULL, NULL,
NULL, NULL,
NULL, NULL,
NULL,
}; };
#endif /* _WIN64 */ #endif /* _WIN64 */
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