Commit Graph

38 Commits

Author SHA1 Message Date
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 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 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
Huw Davies dcbbe18519 winecoreaudio: Combine MIDIIn_SendMessage into MIDIIn_ReadProc.
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:25 +01:00
Huw Davies 1f0591dd45 winecoreaudio: Temporarily move MIDIOut_Send() to audiounit.c.
This is to enable coremidi.c to become the unixlib, while still
enabling code on the user-side to be able to call MIDIOut_Send() for
the time being.  Eventually, its equivalent will move to the unixlib
and audiounit.c will disappear.

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:20 +01:00
Brendan Shanks 1fc8a8f234 winecoreaudio.drv: Only read 'length' bytes from received MIDIPackets.
The Core MIDI MIDIPacket struct is declared with a 256-byte data array,
but this is just for convenience. There may be only one accessible byte,
or there may be more than 256.
Only read 'length' bytes from the packet, and correctly handle a
length > 256.

Signed-off-by: Brendan Shanks <bshanks@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-11-09 20:15:11 +01:00
Charles Davis c8e87bd878 winecoreaudio.drv: Don't use pointer constants with an integer type (Clang).
Signed-off-by: Charles Davis <cdavis5x@gmail.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-02-23 11:55:15 +09:00
Alexandre Julliard 41d9d0a2f3 winecoreaudio.drv: Remove unnecessary ifdefs. 2011-03-28 22:15:12 +02:00
Francois Gouget 0216e3e6c6 winecoreaudio.drv: Remove an unused debug channel (midi). 2008-12-29 11:35:37 +01:00
Andrew Talbot 1d5d237800 winecoreaudio.drv: Do nothing if HAVE_AUDIOUNIT_AUDIOUNIT_H is not defined. 2008-12-22 10:28:58 +01:00
Emmanuel Maillard 622ee1c4cc winecoreaudio.drv: Implement MIDIOut_Data when device is a MOD_MIDIPORT.
Implement MIDIOut_Send.
2007-05-01 11:42:24 +02:00
Emmanuel Maillard dea9878c2d winecoreaudio.drv: Create only one MIDIOutPort and one MIDIInPort for all destinations and sources. 2007-05-01 11:42:24 +02:00
Francois Gouget 5a8fc34033 Assorted spelling fixes. 2007-04-30 12:35:11 +02:00
Emmanuel Maillard 1a47f36cb9 winecoreaudio: Initial MIDI In Mach message handling. 2007-04-26 15:00:36 +02:00
Emmanuel Maillard 4903fbedc9 winecoreaudio: Initial MIDI In support on Mac OS X. 2007-04-26 14:59:46 +02:00
Emmanuel Maillard 7ad29c8bb7 winecoreaudio: Initial MIDI support on Mac OS X. 2007-04-25 13:37:26 +02:00