Commit graph

299 commits

Author SHA1 Message Date
Davide Beatrici 8537b72202 winecoreaudio: Switch to mmdevapi's unixlib.h. 2022-09-16 19:15:05 +02:00
Davide Beatrici af1257f741 winecoreaudio: Adapt "get_capture_buffer_params" struct to mmdevapi's. 2022-09-16 19:15:05 +02:00
Davide Beatrici 0987d1b002 winecoreaudio: Adapt "release_render_buffer_params" struct to mmdevapi's. 2022-09-16 19:15:05 +02:00
Davide Beatrici 9a30a71e3b winecoreaudio: Adapt "release_stream_params" struct to mmdevapi's. 2022-09-16 19:15:05 +02:00
Davide Beatrici de9da9bcdb winecoreaudio: Adapt "create_stream_params" struct to mmdevapi's. 2022-09-16 19:15:05 +02:00
Davide Beatrici bc404b6c9c winecoreaudio: Drop "unix_" prefix in unixlib enum, apply it to the functions instead. 2022-09-16 19:15:05 +02:00
Davide Beatrici 013f662c05 winecoreaudio: Switch to string as device identifier, to match other drivers. 2022-09-16 19:15:05 +02:00
Davide Beatrici 93d3ecb90f winecoreaudio: Fix RegEnumKeyExW() call passing wrong unit for the buffer size.
The function takes the number of (wide) characters in input, not bytes.
2022-09-16 19:15:05 +02:00
Alexandre Julliard 194e09baec makefiles: Add separate variables for Unix flags and libraries.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-06-29 23:23:41 +02:00
Akihiro Sagawa ee56317d9d winecoreaudio: Handle MIDI running status.
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-31 22:52:45 +02:00
Eric Pouech ae39289ca7 winecoreaudio: Enable compilation with long types.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-11 19:33:23 +02:00
Huw Davies ca1e298f52 winecoreaudio: Remove DWORDs from the midi syscall interface.
This makes it consistent with the other drivers.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-05-11 19:33:23 +02:00
Huw Davies 860a5f69b8 winecoreaudio: Implement Wow64 midi entry points in the Unix libraray.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-25 20:33:23 +02:00
Huw Davies b20c658f24 winecoreaudio: Implement Wow64 mmdevapi entry points in the Unix libraray.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-25 20:33:18 +02:00
Huw Davies c4682a0893 winecoreaudio: Limit Wow64 buffer allocations to 32-bit addresses.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-25 20:33:14 +02:00
Huw Davies ae296bf12f winecoreaudio: Return offsets rather than ptrs to the strings.
This will make the Wow64 syscall rather simpler.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-25 20:33:10 +02:00
Huw Davies 90e9379f2a winecoreaudio: Use UINT64 handles to represent the stream.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-25 20:33:06 +02:00
Huw Davies c66d694c4b winecoreaudio: Pass a ptr to receive the stream in create_stream.
This matches the other drivers.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-04-25 20:33:02 +02:00
Alexandre Julliard f0cd33c69e include: Add support for defining Win32 types as 'long' where possible.
Add -DWINE_NO_LONG_TYPES to modules that still have compilation
warnings with long types.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-27 20:38:22 +01:00
Huw Davies aa3df3f75e winecoreaudio: Remove unnecessary buffer sizes.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-27 17:57:49 +01:00
Andrew Eikum 9bc545451b winecoreaudio.drv: Fix memory leak.
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2022-01-14 17:30:30 +01:00
Huw Davies a7f0647dec winecoreaudio: Actually free the stream.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-22 18:57:26 +01:00
Huw Davies e03611ee59 winecoreaudio: Set the buffer to NULL after freeing.
This ensures the subsequent allocation is free to pick a new location.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52202
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-22 18:57:24 +01:00
Alexandre Julliard 143bd63b27 include: Remove some no longer used Unicode functions.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-01 18:13:54 +01:00
Huw Davies ce0e6ccb32 winecoreaudio: Build with msvcrt.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-01 18:13:54 +01:00
Huw Davies 14029a47c9 winecoreaudio: Always start the notification thread.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-01 18:13:54 +01:00
Huw Davies 61337a1d16 winecoreaudio: Switch midi_in_lock() away from a syscall prototype.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-01 18:13:54 +01:00
Huw Davies 92f7c86f68 winecoreaudio: Move the midi input event processing to the unixlib.
Notifications of incoming data are now directly added to a notify
ring-buffer by macOS's midi read callback.  The ring-buffer is
implemented with an unused sentinel directly before the read ptr to
distinguish between the full vs empty state.  Notifications are
processed by the client's notify thread via the midi_notify_wait
syscall.

Note that the read callback thread is not a Win32 thread, so the
Win32 api cannot be used in anything that it calls.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-01 18:13:54 +01:00
Huw Davies 06bb1bdb14 winecoreaudio: Introduce a notification thread.
Currently the thread just blocks until told to quit by midi_release.
Eventually, this thread will dispatch the MIM_DATA and MIM_LONGDATA
notifications and essentially replace the existing RunLoop-based
mechanism.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-01 18:13:54 +01:00
Huw Davies 3b043e72b5 winecoreaudio: Introduce a helper to retrieve the time.
The motivation is that this will need to be called from a
non-Win32 thread and so shouldn't use the Win32 API.  An
added benefit is that it will eliminate the 16ms jitter
associated with GetTickCount().

The instance of the helper on the user-side is temporary.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-12-01 18:13:54 +01:00
Huw Davies ac1059ff60 winecoreaudio: Move midi_in_reset to the unixlib.
The headers are removed one at a time so that each notification
can be reported back to the client-side.  If there are remaining
headers, the unixlib will return ERROR_RETRY to request that the
client calls again.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-29 23:25:46 +01:00
Huw Davies 01ad503004 winecoreaudio: Pass the time relative to the start time to the callback.
This matches the behaviour of the other instance of the invocation of
the MIM_LONGDATA callback.

It's rather difficult to reliably write a test for this, but it has
been observed to be the case on Windows.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-29 23:25:46 +01:00
Huw Davies 27bda12c99 winecoreaudio: Move midi_in_add_buffer to the unixlib.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-29 23:25:46 +01:00
Huw Davies 9eeee3ddbf winecoreaudio: Move the midi in lock to the unixlib.
The syscall itself is temporary.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-29 23:25:46 +01:00
Huw Davies 05731b14d3 winecoreaudio: Move midi_in_start and midi_in_stop to the unixlib.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-29 23:25:46 +01:00
Huw Davies 15bb0e79d6 winecoreaudio: Move midi_in_get_num_devs to the unixlib.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-29 23:25:46 +01:00
Huw Davies 6f0b73a68d winecoreaudio: Move midi_in_get_devcaps to the unixlib.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-29 23:25:46 +01:00
Huw Davies 4180aa9f9b winecoreaudio: Move midi_in_prepare and midi_in_unprepare to the unixlib.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-29 23:25:46 +01:00
Huw Davies a66199f560 winecoreaudio: Move midi_in_close to the unixlib.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-29 23:25:46 +01:00
Huw Davies a9dec89f49 winecoreaudio: Move midi_in_open to the unixlib.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-29 23:25:46 +01:00
Huw Davies b74a8ab202 winecoreaudio: Move midi_out_reset to the unixlib.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-26 18:10:48 +01:00
Huw Davies 5df38b4708 winecoreaudio: Move midi_out_[gs]et_volume to the unixlib.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-26 18:10:46 +01:00
Huw Davies 501cbc1944 winecoreaudio: Move midi_out_get_num_devs to the unixlib.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-26 18:10:44 +01:00
Huw Davies 266efe5c5d winecoreaudio: Move midi_out_get_devcaps to the unixlib.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-26 18:10:42 +01:00
Huw Davies 15e30a492e winecoreaudio: Move midi_out_prepare and midi_out_unprepare to the unixlib.
While these could be left on the user-side, it seems simplest to move
everything across.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-26 18:10:39 +01:00
Huw Davies 47c698fc14 winecoreaudio: Move midi_out_long_data to the unixlib.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-26 18:10:37 +01:00
Huw Davies 1a1ef23079 winecoreaudio: Move midi_out_data to the unixlib.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-26 18:10:35 +01:00
Huw Davies bf502e3685 winecoreaudio: Move midi_out_close to the unixlib.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-26 18:10:33 +01:00
Huw Davies ec9d2a7773 winecoreaudio: Move midi_out_open to the unixlib.
Notifications are filled out by the unixlib and returned to
the user-side for dispatch.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-26 18:10:30 +01:00
Huw Davies e506d99ceb winecoreaudio: Move midi_init and midi_release to the unixlib.
midi_init temporarily returns unix-side info, which will eventually
be removed.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-11-26 18:10:28 +01:00