Commit Graph

1591 Commits

Author SHA1 Message Date
Jacek Caban 12f6e8086b winmm: Introduce compare_uint helper.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-03 22:32:46 +02:00
Jacek Caban 72a36736a9 winmm/tests: Introduce compare_uint helper.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-03 22:32:42 +02:00
Andrew Eikum 0239026bf3 winmm/tests: Test using a device handle in wave{In,Out}GetDevCaps and wave{In,Out}Open.
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-08 20:52:14 +02:00
Andrew Eikum ae13a279e1 winmm: Accept open handles in wave{In,Out}GetDevCaps.
Based on a patch by Changping Yu <dead.ash@hotmail.com>.

Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-08 20:52:14 +02:00
Andrew Eikum ca092dcf81 winmm/tests: Test mmioOpen with long file name.
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-06 21:23:27 +02:00
Alistair Leslie-Hughes 5ee2ef5217 winmm: Use CreateFileA instead of OpenFile.
OpenFile has a filepath limit of 128. Use CreateFile which doesn't have
this limit.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48832
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=27324
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-06 21:23:13 +02:00
Serge Gautherie aa384d3642 tools: Remove 0x0501 API versions forced by winapi_test.
Signed-off-by: Serge Gautherie <winehq-git_serge_180711@gautherie.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-13 20:10:44 +01:00
Michael Stefaniuc cdec2413e2 winmm/tests: Get rid of strcmp_wa().
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-02-06 21:48:08 +01:00
Alexandre Julliard ef35796376 winmm/tests: Fix a constant conversion warning.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-17 16:55:16 +01:00
Rémi Bernon 0ef9ebde9f winmm: Fix int-to-pointer and pointer-to-int casts warnings.
The stream pointer was used as the DWORD id, which is only going to
work on 32bit. It may very well be that winmm is only used in 32bit,
but then we still build a 64bit version of it.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-14 21:04:00 +01:00
Sven Baars 5ecb8197b6 winmm: Pass the device to WINMM_Pause directly.
Signed-off-by: Sven Baars <sven.wine@gmail.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-23 21:04:06 +02:00
Francois Gouget 6a4347be37 winmm: Avoid a couple of unneeded lstrlenW() calls.
Note that since str is a buffer it cannot be NULL.

Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-16 22:58:42 +02:00
Jacek Caban f09c0e7c0d winmm: Build with msvcrt.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-07-05 18:37:41 +02:00
Jacek Caban f277ef7e68 winmm: Use condition variable to sleep in timer thread.
We have fast condition variable implementation now, so performance
should not be a problem.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-07-05 18:36:30 +02:00
Alexandre Julliard 1c7312a0c6 winmm/tests: Fix printf format warnings for the Windows build.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-04-05 22:16:30 +02:00
Piotr Caban b602787a93 winmm: Don't use toupper.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-27 22:01:35 +01:00
Isira Seneviratne 244a903310 winmm: Correct phrasing of some resource strings.
Signed-off-by: Isira Seneviratne <isirasen96@gmail.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-26 20:35:55 +01:00
Michael Stefaniuc de2854bebd winmm: Remove useless casts to self.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-04 14:50:02 +01:00
Michael Stefaniuc 0388828edf winmm/tests: Floating point numeric constants are by default doubles.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-19 20:33:55 +01:00
Serge Gautherie 175a2a0276 winmm: Add a WARNing when winejoystick.drv is missing.
Signed-off-by: Serge Gautherie <winehq-git_serge_180711@gautherie.fr>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-20 16:57:08 +01:00
Baruch Rutman ebae298aa4 winmm: Attempt only once to load the default joystick driver.
Signed-off-by: Baruch Rutman <peterooch@gmail.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-12 23:12:37 +01:00
Michael Stefaniuc 24f4781216 winmm: Use the ARRAY_SIZE() macro.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-09-20 16:37:19 +02:00
Fabian Maurer 7000af5547 winmm: Don't crash in waveOutOpen when nSamplesPerSec is 0 and add tests.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45530
Signed-off-by: Fabian Maurer <dark.shadow4@web.de>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-08-14 10:16:00 +02:00
Akihiro Sagawa 95c21f3f94 winmm: Support TIME_MIDI position in MIDI stream.
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>
2018-07-12 13:34:23 +02:00
Akihiro Sagawa ced8ce55b4 winmm: Make TIME_TICKS position continuous.
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>
2018-07-11 20:43:16 +02:00
Akihiro Sagawa 2ae0517209 winmm/tests: Add more MIDI stream position tests.
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>
2018-07-11 20:43:16 +02:00
Akihiro Sagawa 16808d432c winmm: Use microsecond unit in MIDI stream position variable to simplify the code.
Since 32-bit variable overflows after approximately 70 minutes,
we use 64-bit variable for this purpose. `remainder' member is removed.

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>
2018-07-11 20:43:16 +02:00
Michael Stefaniuc 8ce75cc5d4 winmm: Avoid an ARRAY_SIZE-like macro.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-07-10 18:58:55 +02:00
Akihiro Sagawa 381012f75d winmm: Preserve fractions in microseconds to compensate rounding errors.
Otherwise, a song is played faster than expected in some cases.

For instance, we assume that 40 pan control change (CC#10) messages are
expressed in 12.5ms each,
 * Prior art omits fractions, i.e. 12ms + 12ms + ... = 480ms.
 * Proposal technique saves fractions, i.e. 12ms + 13ms + ... = 500ms.
Ideal duration is 500ms. So, the proposed method is better than prior one.

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>
2018-07-10 10:34:20 +02:00
Akihiro Sagawa 2cb326260b winmm: Don't allow to set time division property while playing.
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>
2018-07-10 10:34:14 +02:00
Michael Stefaniuc 3f4906d19d winmm/tests: Use the available ARRAY_SIZE() macro.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-06-14 17:06:07 +02:00
Michael Stefaniuc b400d4326d winmm/tests: Avoid and ARRAY_SIZE-like macro.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-06-14 17:06:04 +02:00
Akihiro Sagawa 3840443958 winmm: Reset the tick counter after handling messages.
Otherwise, events might be triggered immediately after a resuming.

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>
2018-05-29 17:39:22 +02:00
Akihiro Sagawa 2e2ff80567 winmm: Return a continuous stream position in MIDI stream.
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>
2018-05-29 17:39:18 +02:00
Akihiro Sagawa 25f610f96a winmm: Synchronize player status and API calls.
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>
2018-05-29 17:14:02 +02:00
Akihiro Sagawa b70f0d723a winmm: Add playing status to MIDI stream structure and use it.
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>
2018-05-24 23:28:43 +02:00
Akihiro Sagawa 169d657d78 winmm: Protect MIDI stream info with critical section.
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>
2018-05-24 23:28:41 +02:00
Akihiro Sagawa 70e541a693 winmm/tests: Add tests regarding MIDI stream player clocks and positions.
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>
2018-05-24 23:28:39 +02:00
Akihiro Sagawa 1c38d47e4d winmm: Fix superfluous MOM_DONE callback messages.
This is a regression introduced by 185d98bbfd.
Because midiOutLongMsg's MOM_DONE callback message confuses an application,
we don't rely on midiOut callback routine anymore in MIDI stream processing.

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>
2018-05-15 23:12:33 +02:00
Akihiro Sagawa 107dba39a3 winmm: Avoid casting unsigned char to plain char.
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>
2018-05-11 20:13:27 +02:00
Akihiro Sagawa 1d49939618 winmm: Fix default time division value in MIDI stream.
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>
2018-05-11 20:13:25 +02:00
Louis Lenders 8dca6c35e1 winmm: Return error in waveInMessage if either dwParam1 or dwParam2 is null.
Signed-off-by: Louis Lenders <xerox.xerox2000x@gmail.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-05-02 21:55:52 +02:00
Louis Lenders d7bd861ae6 winmm: Return error in waveOutMessage if either dwParam1 or dwParam2 is null.
Signed-off-by: Louis Lenders <xerox.xerox2000x@gmail.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-04-24 17:08:54 +02:00
Akihiro Sagawa 185d98bbfd winmm: Fix MEVT_LONGMSG handling in MIDI stream.
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>
2018-04-09 09:53:47 +02:00
Akihiro Sagawa cc78101fea winmm/tests: Add more MIDI System Exclusive message tests.
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>
2018-04-09 09:53:44 +02:00
Akihiro Sagawa ec6bd187fe midimap: Open lower devices when opening MIDI Mapper.
Without this change, the lower device can't get a long message at the
beginning.  The mapper didn't open it before receiving a short message
in modData function.

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>
2018-04-09 09:53:40 +02:00
Akihiro Sagawa 96896023ff winmm/tests: Add MIDI System Exclusive message tests.
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>
2018-04-09 09:53:36 +02:00
Andrey Gusev 941d74a20a winmm/tests: Fix memory leak.
Signed-off-by: Andrey Gusev <andrey.goosev@gmail.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-01-19 16:40:55 +01:00
Alex Henrie 05111a34d5 winmm/tests: Give play from 0 to 0 more time to finish.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-10-19 16:53:50 +02:00
Bruno Jesus 0aaade2cec winmm: Dispatch MCI_BREAK to the driver.
Signed-off-by: Bruno Jesus <bjesus@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-06 19:43:13 +01:00