2021-11-17 16:08:49 +01:00
|
|
|
/*
|
|
|
|
* Unixlib header file for winecoreaudio driver.
|
|
|
|
*
|
|
|
|
* Copyright 2021 Huw Davies
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
2021-11-24 12:26:49 +01:00
|
|
|
struct coreaudio_stream;
|
2021-11-17 16:09:29 +01:00
|
|
|
|
2021-11-17 16:08:49 +01:00
|
|
|
struct endpoint
|
|
|
|
{
|
|
|
|
WCHAR *name;
|
|
|
|
DWORD id;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct get_endpoint_ids_params
|
|
|
|
{
|
|
|
|
EDataFlow flow;
|
|
|
|
struct endpoint *endpoints;
|
|
|
|
unsigned int size;
|
|
|
|
HRESULT result;
|
|
|
|
unsigned int num;
|
|
|
|
unsigned int default_idx;
|
|
|
|
};
|
|
|
|
|
2021-11-18 08:52:37 +01:00
|
|
|
struct create_stream_params
|
|
|
|
{
|
|
|
|
DWORD dev_id;
|
|
|
|
EDataFlow flow;
|
|
|
|
AUDCLNT_SHAREMODE share;
|
|
|
|
REFERENCE_TIME duration;
|
|
|
|
REFERENCE_TIME period;
|
|
|
|
const WAVEFORMATEX *fmt;
|
|
|
|
HRESULT result;
|
|
|
|
struct coreaudio_stream *stream;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct release_stream_params
|
|
|
|
{
|
|
|
|
struct coreaudio_stream *stream;
|
|
|
|
HRESULT result;
|
|
|
|
};
|
|
|
|
|
2021-11-23 08:55:03 +01:00
|
|
|
struct start_params
|
|
|
|
{
|
|
|
|
struct coreaudio_stream *stream;
|
|
|
|
HRESULT result;
|
|
|
|
};
|
|
|
|
|
2021-11-23 08:55:04 +01:00
|
|
|
struct stop_params
|
|
|
|
{
|
|
|
|
struct coreaudio_stream *stream;
|
|
|
|
HRESULT result;
|
|
|
|
};
|
|
|
|
|
2021-11-23 08:55:05 +01:00
|
|
|
struct reset_params
|
|
|
|
{
|
|
|
|
struct coreaudio_stream *stream;
|
|
|
|
HRESULT result;
|
|
|
|
};
|
|
|
|
|
2021-11-23 08:55:06 +01:00
|
|
|
struct get_render_buffer_params
|
|
|
|
{
|
|
|
|
struct coreaudio_stream *stream;
|
|
|
|
UINT32 frames;
|
|
|
|
HRESULT result;
|
|
|
|
BYTE **data;
|
|
|
|
};
|
|
|
|
|
2021-11-23 08:55:07 +01:00
|
|
|
struct release_render_buffer_params
|
|
|
|
{
|
|
|
|
struct coreaudio_stream *stream;
|
|
|
|
UINT32 frames;
|
|
|
|
DWORD flags;
|
|
|
|
HRESULT result;
|
|
|
|
};
|
|
|
|
|
2021-11-23 08:55:08 +01:00
|
|
|
struct get_capture_buffer_params
|
|
|
|
{
|
|
|
|
struct coreaudio_stream *stream;
|
|
|
|
HRESULT result;
|
|
|
|
BYTE **data;
|
|
|
|
UINT32 *frames;
|
|
|
|
DWORD *flags;
|
|
|
|
UINT64 *devpos;
|
|
|
|
UINT64 *qpcpos;
|
|
|
|
};
|
|
|
|
|
2021-11-23 08:55:09 +01:00
|
|
|
struct release_capture_buffer_params
|
|
|
|
{
|
|
|
|
struct coreaudio_stream *stream;
|
|
|
|
UINT32 done;
|
|
|
|
HRESULT result;
|
|
|
|
};
|
|
|
|
|
2021-11-18 08:52:38 +01:00
|
|
|
struct get_mix_format_params
|
|
|
|
{
|
|
|
|
EDataFlow flow;
|
|
|
|
DWORD dev_id;
|
|
|
|
WAVEFORMATEXTENSIBLE *fmt;
|
|
|
|
HRESULT result;
|
|
|
|
};
|
|
|
|
|
2021-11-23 08:54:58 +01:00
|
|
|
struct is_format_supported_params
|
|
|
|
{
|
|
|
|
EDataFlow flow;
|
|
|
|
DWORD dev_id;
|
|
|
|
AUDCLNT_SHAREMODE share;
|
|
|
|
const WAVEFORMATEX *fmt_in;
|
|
|
|
WAVEFORMATEXTENSIBLE *fmt_out;
|
|
|
|
HRESULT result;
|
|
|
|
};
|
|
|
|
|
2021-11-23 08:55:00 +01:00
|
|
|
struct get_buffer_size_params
|
|
|
|
{
|
|
|
|
struct coreaudio_stream *stream;
|
|
|
|
HRESULT result;
|
|
|
|
UINT32 *frames;
|
|
|
|
};
|
|
|
|
|
2021-11-23 08:55:01 +01:00
|
|
|
struct get_latency_params
|
|
|
|
{
|
|
|
|
struct coreaudio_stream *stream;
|
|
|
|
HRESULT result;
|
|
|
|
REFERENCE_TIME *latency;
|
|
|
|
};
|
|
|
|
|
2021-11-23 08:55:02 +01:00
|
|
|
struct get_current_padding_params
|
|
|
|
{
|
|
|
|
struct coreaudio_stream *stream;
|
|
|
|
HRESULT result;
|
|
|
|
UINT32 *padding;
|
|
|
|
};
|
|
|
|
|
2021-11-24 12:26:44 +01:00
|
|
|
struct get_next_packet_size_params
|
|
|
|
{
|
|
|
|
struct coreaudio_stream *stream;
|
|
|
|
HRESULT result;
|
|
|
|
UINT32 *frames;
|
|
|
|
};
|
|
|
|
|
2021-11-24 12:26:45 +01:00
|
|
|
struct get_position_params
|
|
|
|
{
|
|
|
|
struct coreaudio_stream *stream;
|
|
|
|
HRESULT result;
|
|
|
|
UINT64 *pos;
|
|
|
|
UINT64 *qpctime;
|
|
|
|
};
|
|
|
|
|
2021-11-24 12:26:46 +01:00
|
|
|
struct get_frequency_params
|
|
|
|
{
|
|
|
|
struct coreaudio_stream *stream;
|
|
|
|
HRESULT result;
|
|
|
|
UINT64 *freq;
|
|
|
|
};
|
|
|
|
|
2021-11-24 12:26:47 +01:00
|
|
|
struct is_started_params
|
|
|
|
{
|
|
|
|
struct coreaudio_stream *stream;
|
|
|
|
HRESULT result;
|
|
|
|
};
|
|
|
|
|
2021-11-24 12:26:48 +01:00
|
|
|
struct set_volumes_params
|
|
|
|
{
|
|
|
|
struct coreaudio_stream *stream;
|
|
|
|
float master_volume;
|
|
|
|
const float *volumes;
|
|
|
|
const float *session_volumes;
|
|
|
|
int channel;
|
|
|
|
};
|
|
|
|
|
2021-11-25 12:03:38 +01:00
|
|
|
struct midi_init_params
|
|
|
|
{
|
|
|
|
DWORD *err;
|
|
|
|
UINT num_dests, num_srcs;
|
|
|
|
void *dests, *srcs;
|
|
|
|
void *midi_out_port, *midi_in_port;
|
|
|
|
};
|
|
|
|
|
2021-11-17 16:08:49 +01:00
|
|
|
enum unix_funcs
|
|
|
|
{
|
|
|
|
unix_get_endpoint_ids,
|
2021-11-18 08:52:37 +01:00
|
|
|
unix_create_stream,
|
|
|
|
unix_release_stream,
|
2021-11-23 08:55:03 +01:00
|
|
|
unix_start,
|
2021-11-23 08:55:04 +01:00
|
|
|
unix_stop,
|
2021-11-23 08:55:05 +01:00
|
|
|
unix_reset,
|
2021-11-23 08:55:06 +01:00
|
|
|
unix_get_render_buffer,
|
2021-11-23 08:55:07 +01:00
|
|
|
unix_release_render_buffer,
|
2021-11-23 08:55:08 +01:00
|
|
|
unix_get_capture_buffer,
|
2021-11-23 08:55:09 +01:00
|
|
|
unix_release_capture_buffer,
|
2021-11-18 08:52:38 +01:00
|
|
|
unix_get_mix_format,
|
2021-11-23 08:54:58 +01:00
|
|
|
unix_is_format_supported,
|
2021-11-23 08:55:00 +01:00
|
|
|
unix_get_buffer_size,
|
2021-11-23 08:55:01 +01:00
|
|
|
unix_get_latency,
|
2021-11-23 08:55:02 +01:00
|
|
|
unix_get_current_padding,
|
2021-11-24 12:26:44 +01:00
|
|
|
unix_get_next_packet_size,
|
2021-11-24 12:26:45 +01:00
|
|
|
unix_get_position,
|
2021-11-24 12:26:46 +01:00
|
|
|
unix_get_frequency,
|
2021-11-24 12:26:47 +01:00
|
|
|
unix_is_started,
|
2021-11-24 12:26:48 +01:00
|
|
|
unix_set_volumes,
|
2021-11-25 12:03:38 +01:00
|
|
|
unix_midi_init,
|
|
|
|
unix_midi_release,
|
2021-11-17 16:08:49 +01:00
|
|
|
};
|
|
|
|
|
2021-11-25 12:03:38 +01:00
|
|
|
NTSTATUS midi_init( void * ) DECLSPEC_HIDDEN;
|
|
|
|
NTSTATUS midi_release( void * ) DECLSPEC_HIDDEN;
|
|
|
|
|
2021-11-17 16:08:49 +01:00
|
|
|
extern unixlib_handle_t coreaudio_handle;
|
|
|
|
|
|
|
|
#define UNIX_CALL( func, params ) __wine_unix_call( coreaudio_handle, unix_ ## func, params )
|