midimap: Allow GetVolume by device identifier.

This commit is contained in:
Jörg Höhle 2010-02-20 12:54:48 +01:00 committed by Alexandre Julliard
parent fb8812db89
commit 104cc7c28e
2 changed files with 5 additions and 1 deletions

View File

@ -446,7 +446,6 @@ static DWORD modUnprepare(MIDIMAPDATA* mom, LPMIDIHDR lpMidiHdr, DWORD_PTR dwPar
static DWORD modGetVolume(MIDIMAPDATA* mom, DWORD* lpdwVolume) static DWORD modGetVolume(MIDIMAPDATA* mom, DWORD* lpdwVolume)
{ {
if (MIDIMAP_IsBadData(mom)) return MMSYSERR_ERROR;
if (!lpdwVolume) return MMSYSERR_INVALPARAM; if (!lpdwVolume) return MMSYSERR_INVALPARAM;
*lpdwVolume = 0xFFFFFFFF; /* tests show this initial value */ *lpdwVolume = 0xFFFFFFFF; /* tests show this initial value */
return MMSYSERR_NOERROR; return MMSYSERR_NOERROR;

View File

@ -230,6 +230,11 @@ static void test_midiOut_device(UINT udev, HWND hwnd)
* real devices with the volume GUI SW-synth settings. */ * real devices with the volume GUI SW-synth settings. */
if (!rc) trace("Current volume %x on device %d\n", ovolume, udev); if (!rc) trace("Current volume %x on device %d\n", ovolume, udev);
/* The W95 ESFM Synthesis device reports NOTENABLED although
* GetVolume by handle works and music plays. */
rc = midiOutGetVolume((HMIDIOUT)udev, &ovolume);
ok((capsA.dwSupport & MIDICAPS_VOLUME) ? rc==MMSYSERR_NOERROR || broken(rc==MMSYSERR_NOTENABLED) : rc==MMSYSERR_NOTSUPPORTED, "midiOutGetVolume(dev=%d) rc=%s\n", udev, mmsys_error(rc));
/* Tests with midiOutSetvolume show that the midi mapper forwards /* Tests with midiOutSetvolume show that the midi mapper forwards
* the value to the real device, but Get initially always reports * the value to the real device, but Get initially always reports
* FFFFFFFF. Therefore, a Get+SetVolume pair with the mapper is * FFFFFFFF. Therefore, a Get+SetVolume pair with the mapper is