mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-06 10:17:26 +00:00
mmdevapi: Integrate winecoreaudio's additions in unixlib.h.
The data type for "done" was accidentally changed in e29dc33aeb
.
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.
This commit is contained in:
parent
013f662c05
commit
2fa22538a5
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* 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
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -126,7 +126,7 @@ struct get_capture_buffer_params
|
|||
struct release_capture_buffer_params
|
||||
{
|
||||
stream_handle stream;
|
||||
BOOL done;
|
||||
UINT32 done;
|
||||
HRESULT result;
|
||||
};
|
||||
|
||||
|
@ -161,7 +161,7 @@ struct get_buffer_size_params
|
|||
{
|
||||
stream_handle stream;
|
||||
HRESULT result;
|
||||
UINT32 *size;
|
||||
UINT32 *frames;
|
||||
};
|
||||
|
||||
struct get_latency_params
|
||||
|
@ -207,6 +207,7 @@ struct set_volumes_params
|
|||
float master_volume;
|
||||
const float *volumes;
|
||||
const float *session_volumes;
|
||||
int channel;
|
||||
};
|
||||
|
||||
struct set_event_handle_params
|
||||
|
@ -240,6 +241,11 @@ struct get_prop_value_params
|
|||
unsigned int *buffer_size;
|
||||
};
|
||||
|
||||
struct midi_init_params
|
||||
{
|
||||
UINT *err;
|
||||
};
|
||||
|
||||
struct notify_context
|
||||
{
|
||||
BOOL send_notify;
|
||||
|
@ -321,6 +327,7 @@ enum unix_funcs
|
|||
test_connect,
|
||||
is_started,
|
||||
get_prop_value,
|
||||
midi_init,
|
||||
midi_release,
|
||||
midi_out_message,
|
||||
midi_in_message,
|
||||
|
|
|
@ -2098,7 +2098,7 @@ static NTSTATUS alsa_get_buffer_size(void *args)
|
|||
|
||||
alsa_lock(stream);
|
||||
|
||||
*params->size = stream->bufsize_frames;
|
||||
*params->frames = stream->bufsize_frames;
|
||||
|
||||
return alsa_unlock_result(stream, ¶ms->result, S_OK);
|
||||
}
|
||||
|
@ -2459,6 +2459,7 @@ unixlib_entry_t __wine_unix_call_funcs[] =
|
|||
NULL,
|
||||
alsa_is_started,
|
||||
alsa_get_prop_value,
|
||||
NULL,
|
||||
alsa_midi_release,
|
||||
alsa_midi_out_message,
|
||||
alsa_midi_in_message,
|
||||
|
@ -2647,12 +2648,12 @@ static NTSTATUS alsa_wow64_get_buffer_size(void *args)
|
|||
{
|
||||
stream_handle stream;
|
||||
HRESULT result;
|
||||
PTR32 size;
|
||||
PTR32 frames;
|
||||
} *params32 = args;
|
||||
struct get_buffer_size_params params =
|
||||
{
|
||||
.stream = params32->stream,
|
||||
.size = ULongToPtr(params32->size)
|
||||
.frames = ULongToPtr(params32->frames)
|
||||
};
|
||||
alsa_get_buffer_size(¶ms);
|
||||
params32->result = params.result;
|
||||
|
@ -2761,13 +2762,15 @@ static NTSTATUS alsa_wow64_set_volumes(void *args)
|
|||
float master_volume;
|
||||
PTR32 volumes;
|
||||
PTR32 session_volumes;
|
||||
int channel;
|
||||
} *params32 = args;
|
||||
struct set_volumes_params params =
|
||||
{
|
||||
.stream = params32->stream,
|
||||
.master_volume = params32->master_volume,
|
||||
.volumes = ULongToPtr(params32->volumes),
|
||||
.session_volumes = ULongToPtr(params32->session_volumes)
|
||||
.session_volumes = ULongToPtr(params32->session_volumes),
|
||||
.channel = params32->channel
|
||||
};
|
||||
return alsa_set_volumes(¶ms);
|
||||
}
|
||||
|
@ -2877,6 +2880,7 @@ unixlib_entry_t __wine_unix_call_wow64_funcs[] =
|
|||
NULL,
|
||||
alsa_is_started,
|
||||
alsa_wow64_get_prop_value,
|
||||
NULL,
|
||||
alsa_midi_release,
|
||||
alsa_wow64_midi_out_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
|
|||
}
|
||||
}
|
||||
|
||||
static UINT midi_init(void)
|
||||
static UINT alsa_midi_init(void)
|
||||
{
|
||||
static BOOL init_done;
|
||||
snd_seq_client_info_t *cinfo;
|
||||
|
@ -1398,7 +1398,7 @@ NTSTATUS alsa_midi_out_message(void *args)
|
|||
switch (params->msg)
|
||||
{
|
||||
case DRVM_INIT:
|
||||
*params->err = midi_init();
|
||||
*params->err = alsa_midi_init();
|
||||
break;
|
||||
case DRVM_EXIT:
|
||||
case DRVM_ENABLE:
|
||||
|
@ -1456,7 +1456,7 @@ NTSTATUS alsa_midi_in_message(void *args)
|
|||
switch (params->msg)
|
||||
{
|
||||
case DRVM_INIT:
|
||||
*params->err = midi_init();
|
||||
*params->err = alsa_midi_init();
|
||||
break;
|
||||
case DRVM_EXIT:
|
||||
case DRVM_ENABLE:
|
||||
|
|
|
@ -325,6 +325,7 @@ static void set_stream_volumes(ACImpl *This)
|
|||
params.master_volume = (This->session->mute ? 0.0f : This->session->master_vol);
|
||||
params.volumes = This->vols;
|
||||
params.session_volumes = This->session->channel_vols;
|
||||
params.channel = 0;
|
||||
|
||||
ALSA_CALL(set_volumes, ¶ms);
|
||||
}
|
||||
|
@ -801,7 +802,7 @@ static HRESULT WINAPI AudioClient_GetBufferSize(IAudioClient3 *iface,
|
|||
return AUDCLNT_E_NOT_INITIALIZED;
|
||||
|
||||
params.stream = This->stream;
|
||||
params.size = out;
|
||||
params.frames = out;
|
||||
|
||||
ALSA_CALL(get_buffer_size, ¶ms);
|
||||
|
||||
|
|
|
@ -343,6 +343,7 @@ static void set_stream_volumes(ACImpl *This)
|
|||
params.master_volume = (This->session->mute ? 0.0f : This->session->master_vol);
|
||||
params.volumes = This->vols;
|
||||
params.session_volumes = This->session->channel_vols;
|
||||
params.channel = 0;
|
||||
OSS_CALL(set_volumes, ¶ms);
|
||||
}
|
||||
|
||||
|
@ -772,7 +773,7 @@ static HRESULT WINAPI AudioClient_GetBufferSize(IAudioClient3 *iface,
|
|||
return AUDCLNT_E_NOT_INITIALIZED;
|
||||
|
||||
params.stream = This->stream;
|
||||
params.size = frames;
|
||||
params.frames = frames;
|
||||
|
||||
OSS_CALL(get_buffer_size, ¶ms);
|
||||
TRACE("buffer size: %u\n", *frames);
|
||||
|
|
|
@ -1247,7 +1247,7 @@ static NTSTATUS oss_get_buffer_size(void *args)
|
|||
|
||||
oss_lock(stream);
|
||||
|
||||
*params->size = stream->bufsize_frames;
|
||||
*params->frames = stream->bufsize_frames;
|
||||
|
||||
return oss_unlock_result(stream, ¶ms->result, S_OK);
|
||||
}
|
||||
|
@ -1640,6 +1640,7 @@ unixlib_entry_t __wine_unix_call_funcs[] =
|
|||
oss_test_connect,
|
||||
oss_is_started,
|
||||
NULL,
|
||||
NULL,
|
||||
oss_midi_release,
|
||||
oss_midi_out_message,
|
||||
oss_midi_in_message,
|
||||
|
@ -1844,12 +1845,12 @@ static NTSTATUS oss_wow64_get_buffer_size(void *args)
|
|||
{
|
||||
stream_handle stream;
|
||||
HRESULT result;
|
||||
PTR32 size;
|
||||
PTR32 frames;
|
||||
} *params32 = args;
|
||||
struct get_buffer_size_params params =
|
||||
{
|
||||
.stream = params32->stream,
|
||||
.size = ULongToPtr(params32->size)
|
||||
.frames = ULongToPtr(params32->frames)
|
||||
};
|
||||
oss_get_buffer_size(¶ms);
|
||||
params32->result = params.result;
|
||||
|
@ -1958,13 +1959,15 @@ static NTSTATUS oss_wow64_set_volumes(void *args)
|
|||
float master_volume;
|
||||
PTR32 volumes;
|
||||
PTR32 session_volumes;
|
||||
int channel;
|
||||
} *params32 = args;
|
||||
struct set_volumes_params params =
|
||||
{
|
||||
.stream = params32->stream,
|
||||
.master_volume = params32->master_volume,
|
||||
.volumes = ULongToPtr(params32->volumes),
|
||||
.session_volumes = ULongToPtr(params32->session_volumes)
|
||||
.session_volumes = ULongToPtr(params32->session_volumes),
|
||||
.channel = params32->channel
|
||||
};
|
||||
return oss_set_volumes(¶ms);
|
||||
}
|
||||
|
@ -2041,6 +2044,7 @@ unixlib_entry_t __wine_unix_call_wow64_funcs[] =
|
|||
oss_wow64_test_connect,
|
||||
oss_is_started,
|
||||
NULL,
|
||||
NULL,
|
||||
oss_midi_release,
|
||||
oss_wow64_midi_out_message,
|
||||
oss_wow64_midi_in_message,
|
||||
|
|
|
@ -303,7 +303,7 @@ static int seq_close(int fd)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static UINT midi_init(void)
|
||||
static UINT oss_midi_init(void)
|
||||
{
|
||||
int i, status, synth_devs = 255, midi_devs = 255, fd, len;
|
||||
struct synth_info sinfo;
|
||||
|
@ -1694,7 +1694,7 @@ NTSTATUS oss_midi_out_message(void *args)
|
|||
switch (params->msg)
|
||||
{
|
||||
case DRVM_INIT:
|
||||
*params->err = midi_init();
|
||||
*params->err = oss_midi_init();
|
||||
break;
|
||||
case DRVM_EXIT:
|
||||
*params->err = midi_exit();
|
||||
|
@ -1754,7 +1754,7 @@ NTSTATUS oss_midi_in_message(void *args)
|
|||
switch (params->msg)
|
||||
{
|
||||
case DRVM_INIT:
|
||||
*params->err = midi_init();
|
||||
*params->err = oss_midi_init();
|
||||
break;
|
||||
case DRVM_EXIT:
|
||||
*params->err = midi_exit();
|
||||
|
|
|
@ -370,6 +370,7 @@ static void set_stream_volumes(ACImpl *This)
|
|||
params.master_volume = This->session->mute ? 0.0f : This->session->master_vol;
|
||||
params.volumes = This->vol;
|
||||
params.session_volumes = This->session->channel_vols;
|
||||
params.channel = 0;
|
||||
pulse_call(set_volumes, ¶ms);
|
||||
}
|
||||
|
||||
|
@ -930,7 +931,7 @@ static HRESULT WINAPI AudioClient_GetBufferSize(IAudioClient3 *iface,
|
|||
return AUDCLNT_E_NOT_INITIALIZED;
|
||||
|
||||
params.stream = This->pulse_stream;
|
||||
params.size = out;
|
||||
params.frames = out;
|
||||
pulse_call(get_buffer_size, ¶ms);
|
||||
return params.result;
|
||||
}
|
||||
|
|
|
@ -2095,7 +2095,7 @@ static NTSTATUS pulse_get_buffer_size(void *args)
|
|||
if (!pulse_stream_valid(stream))
|
||||
params->result = AUDCLNT_E_DEVICE_INVALIDATED;
|
||||
else
|
||||
*params->size = stream->bufsize_frames;
|
||||
*params->frames = stream->bufsize_frames;
|
||||
pulse_unlock();
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
|
@ -2393,6 +2393,7 @@ const unixlib_entry_t __wine_unix_call_funcs[] =
|
|||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
};
|
||||
|
||||
#ifdef _WIN64
|
||||
|
@ -2587,12 +2588,12 @@ static NTSTATUS pulse_wow64_get_buffer_size(void *args)
|
|||
{
|
||||
stream_handle stream;
|
||||
HRESULT result;
|
||||
PTR32 size;
|
||||
PTR32 frames;
|
||||
} *params32 = args;
|
||||
struct get_buffer_size_params params =
|
||||
{
|
||||
.stream = params32->stream,
|
||||
.size = ULongToPtr(params32->size)
|
||||
.frames = ULongToPtr(params32->frames)
|
||||
};
|
||||
pulse_get_buffer_size(¶ms);
|
||||
params32->result = params.result;
|
||||
|
@ -2701,13 +2702,15 @@ static NTSTATUS pulse_wow64_set_volumes(void *args)
|
|||
float master_volume;
|
||||
PTR32 volumes;
|
||||
PTR32 session_volumes;
|
||||
int channel;
|
||||
} *params32 = args;
|
||||
struct set_volumes_params params =
|
||||
{
|
||||
.stream = params32->stream,
|
||||
.master_volume = params32->master_volume,
|
||||
.volumes = ULongToPtr(params32->volumes),
|
||||
.session_volumes = ULongToPtr(params32->session_volumes)
|
||||
.session_volumes = ULongToPtr(params32->session_volumes),
|
||||
.channel = params32->channel
|
||||
};
|
||||
return pulse_set_volumes(¶ms);
|
||||
}
|
||||
|
@ -2837,6 +2840,7 @@ const unixlib_entry_t __wine_unix_call_wow64_funcs[] =
|
|||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
};
|
||||
|
||||
#endif /* _WIN64 */
|
||||
|
|
Loading…
Reference in a new issue