winealsa: Move common unixlib.h content into mmdevapi.

This commit is contained in:
Davide Beatrici 2022-08-10 00:19:38 +02:00 committed by Alexandre Julliard
parent 9213faf996
commit 19baa29565
2 changed files with 282 additions and 262 deletions

281
dlls/mmdevapi/unixlib.h Normal file
View file

@ -0,0 +1,281 @@
/*
* Copyright 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
* 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
*/
#include "audioclient.h"
#include "mmdeviceapi.h"
typedef UINT64 stream_handle;
struct endpoint
{
unsigned int name;
unsigned int device;
};
struct get_endpoint_ids_params
{
EDataFlow flow;
struct endpoint *endpoints;
unsigned int size;
HRESULT result;
unsigned int num;
unsigned int default_idx;
};
struct create_stream_params
{
const char *device;
EDataFlow flow;
AUDCLNT_SHAREMODE share;
DWORD flags;
REFERENCE_TIME duration;
REFERENCE_TIME period;
const WAVEFORMATEX *fmt;
HRESULT result;
stream_handle *stream;
};
struct release_stream_params
{
stream_handle stream;
HANDLE timer_thread;
HRESULT result;
};
struct start_params
{
stream_handle stream;
HRESULT result;
};
struct stop_params
{
stream_handle stream;
HRESULT result;
};
struct reset_params
{
stream_handle stream;
HRESULT result;
};
struct timer_loop_params
{
stream_handle stream;
};
struct get_render_buffer_params
{
stream_handle stream;
UINT32 frames;
HRESULT result;
BYTE **data;
};
struct release_render_buffer_params
{
stream_handle stream;
UINT32 written_frames;
UINT flags;
HRESULT result;
};
struct get_capture_buffer_params
{
stream_handle stream;
HRESULT result;
BYTE **data;
UINT32 *frames;
UINT *flags;
UINT64 *devpos;
UINT64 *qpcpos;
};
struct release_capture_buffer_params
{
stream_handle stream;
UINT32 done;
HRESULT result;
};
struct is_format_supported_params
{
const char *device;
EDataFlow flow;
AUDCLNT_SHAREMODE share;
const WAVEFORMATEX *fmt_in;
WAVEFORMATEXTENSIBLE *fmt_out;
HRESULT result;
};
struct get_mix_format_params
{
const char *device;
EDataFlow flow;
WAVEFORMATEXTENSIBLE *fmt;
HRESULT result;
};
struct get_buffer_size_params
{
stream_handle stream;
HRESULT result;
UINT32 *size;
};
struct get_latency_params
{
stream_handle stream;
HRESULT result;
REFERENCE_TIME *latency;
};
struct get_current_padding_params
{
stream_handle stream;
HRESULT result;
UINT32 *padding;
};
struct get_next_packet_size_params
{
stream_handle stream;
HRESULT result;
UINT32 *frames;
};
struct get_frequency_params
{
stream_handle stream;
HRESULT result;
UINT64 *freq;
};
struct get_position_params
{
stream_handle stream;
HRESULT result;
UINT64 *pos;
UINT64 *qpctime;
};
struct set_volumes_params
{
stream_handle stream;
float master_volume;
const float *volumes;
const float *session_volumes;
};
struct set_event_handle_params
{
stream_handle stream;
HANDLE event;
HRESULT result;
};
struct is_started_params
{
stream_handle stream;
HRESULT result;
};
struct get_prop_value_params
{
const char *device;
EDataFlow flow;
const GUID *guid;
const PROPERTYKEY *prop;
HRESULT result;
PROPVARIANT *value;
void *buffer; /* caller allocated buffer to hold value's strings */
unsigned int *buffer_size;
};
struct notify_context
{
BOOL send_notify;
WORD dev_id;
WORD msg;
UINT_PTR param_1;
UINT_PTR param_2;
UINT_PTR callback;
UINT flags;
HANDLE device;
UINT_PTR instance;
};
struct midi_out_message_params
{
UINT dev_id;
UINT msg;
UINT_PTR user;
UINT_PTR param_1;
UINT_PTR param_2;
UINT *err;
struct notify_context *notify;
};
struct midi_in_message_params
{
UINT dev_id;
UINT msg;
UINT_PTR user;
UINT_PTR param_1;
UINT_PTR param_2;
UINT *err;
struct notify_context *notify;
};
struct midi_notify_wait_params
{
BOOL *quit;
struct notify_context *notify;
};
enum unix_funcs
{
get_endpoint_ids,
create_stream,
release_stream,
start,
stop,
reset,
timer_loop,
get_render_buffer,
release_render_buffer,
get_capture_buffer,
release_capture_buffer,
is_format_supported,
get_mix_format,
get_buffer_size,
get_latency,
get_current_padding,
get_next_packet_size,
get_frequency,
get_position,
set_volumes,
set_event_handle,
is_started,
get_prop_value,
midi_release,
midi_out_message,
midi_in_message,
midi_notify_wait,
};

View file

@ -16,268 +16,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "audioclient.h"
typedef UINT64 stream_handle;
struct endpoint
{
unsigned int name;
unsigned int device;
};
struct get_endpoint_ids_params
{
EDataFlow flow;
struct endpoint *endpoints;
unsigned int size;
HRESULT result;
unsigned int num;
unsigned int default_idx;
};
struct create_stream_params
{
const char *device;
EDataFlow flow;
AUDCLNT_SHAREMODE share;
DWORD flags;
REFERENCE_TIME duration;
REFERENCE_TIME period;
const WAVEFORMATEX *fmt;
HRESULT result;
stream_handle *stream;
};
struct release_stream_params
{
stream_handle stream;
HANDLE timer_thread;
HRESULT result;
};
struct start_params
{
stream_handle stream;
HRESULT result;
};
struct stop_params
{
stream_handle stream;
HRESULT result;
};
struct reset_params
{
stream_handle stream;
HRESULT result;
};
struct timer_loop_params
{
stream_handle stream;
};
struct get_render_buffer_params
{
stream_handle stream;
UINT32 frames;
HRESULT result;
BYTE **data;
};
struct release_render_buffer_params
{
stream_handle stream;
UINT32 written_frames;
UINT flags;
HRESULT result;
};
struct get_capture_buffer_params
{
stream_handle stream;
HRESULT result;
BYTE **data;
UINT32 *frames;
UINT *flags;
UINT64 *devpos;
UINT64 *qpcpos;
};
struct release_capture_buffer_params
{
stream_handle stream;
UINT32 done;
HRESULT result;
};
struct is_format_supported_params
{
const char *device;
EDataFlow flow;
AUDCLNT_SHAREMODE share;
const WAVEFORMATEX *fmt_in;
WAVEFORMATEXTENSIBLE *fmt_out;
HRESULT result;
};
struct get_mix_format_params
{
const char *device;
EDataFlow flow;
WAVEFORMATEXTENSIBLE *fmt;
HRESULT result;
};
struct get_buffer_size_params
{
stream_handle stream;
HRESULT result;
UINT32 *size;
};
struct get_latency_params
{
stream_handle stream;
HRESULT result;
REFERENCE_TIME *latency;
};
struct get_current_padding_params
{
stream_handle stream;
HRESULT result;
UINT32 *padding;
};
struct get_next_packet_size_params
{
stream_handle stream;
HRESULT result;
UINT32 *frames;
};
struct get_frequency_params
{
stream_handle stream;
HRESULT result;
UINT64 *freq;
};
struct get_position_params
{
stream_handle stream;
HRESULT result;
UINT64 *pos;
UINT64 *qpctime;
};
struct set_volumes_params
{
stream_handle stream;
float master_volume;
const float *volumes;
const float *session_volumes;
};
struct set_event_handle_params
{
stream_handle stream;
HANDLE event;
HRESULT result;
};
struct is_started_params
{
stream_handle stream;
HRESULT result;
};
struct get_prop_value_params
{
const char *device;
EDataFlow flow;
const GUID *guid;
const PROPERTYKEY *prop;
HRESULT result;
PROPVARIANT *value;
void *buffer; /* caller allocated buffer to hold value's strings */
unsigned int *buffer_size;
};
struct notify_context
{
BOOL send_notify;
WORD dev_id;
WORD msg;
UINT_PTR param_1;
UINT_PTR param_2;
UINT_PTR callback;
UINT flags;
HANDLE device;
UINT_PTR instance;
};
struct midi_out_message_params
{
UINT dev_id;
UINT msg;
UINT_PTR user;
UINT_PTR param_1;
UINT_PTR param_2;
UINT *err;
struct notify_context *notify;
};
struct midi_in_message_params
{
UINT dev_id;
UINT msg;
UINT_PTR user;
UINT_PTR param_1;
UINT_PTR param_2;
UINT *err;
struct notify_context *notify;
};
struct midi_notify_wait_params
{
BOOL *quit;
struct notify_context *notify;
};
enum unix_funcs
{
get_endpoint_ids,
create_stream,
release_stream,
start,
stop,
reset,
timer_loop,
get_render_buffer,
release_render_buffer,
get_capture_buffer,
release_capture_buffer,
is_format_supported,
get_mix_format,
get_buffer_size,
get_latency,
get_current_padding,
get_next_packet_size,
get_frequency,
get_position,
set_volumes,
set_event_handle,
is_started,
get_prop_value,
midi_release,
midi_out_message,
midi_in_message,
midi_notify_wait,
};
#include "../mmdevapi/unixlib.h"
NTSTATUS alsa_midi_release(void *args) DECLSPEC_HIDDEN;
NTSTATUS alsa_midi_out_message(void *args) DECLSPEC_HIDDEN;