midiOutGetVolume

  MMRESULT midiOutGetVolume(wDeviceID, lpdwVolume)    
  UINT wDeviceID;    
  LPDWORD lpdwVolume;    

The midiOutGetVolume function returns the current volume setting of a MIDI output device.

Parameters

wDeviceID

Identifies the MIDI output device.

lpdwVolume

Specifies a far pointer to a location to be filled with the current volume setting. The low-order UINT of this location contains the left channel volume setting, and the high-order UINT contains the right channel setting. A value of 0xFFFF represents full volume, and a value of 0x0000 is silence.

If a device does not support both left and right volume control, the low-order UINT of the specified location contains the mono volume level.

The full 16-bit setting(s)set with midiOutSetVolume is returned, regardless of whether the device supports the full 16 bits of volume level control.

Return Value

Returns zero if the function was successful. Otherwise, it returns an error number. Possible error returns are:

Value Meaning

MMSYSERR_INVALHANDLE Specified device handle is invalid.
MMSYSERR_NOTSUPPORTED Function isn't supported.
MMSYSERR_NODRIVER The driver was not installed.

Comments

Not all devices support volume control. To determine whether the device supports volume control, use the MIDICAPS_VOLUME flag to test the dwSupport field of the MIDIOUTCAPS structure (filled by midiOutGetDevCaps).

To determine whether the device supports volume control on both the left and right channels, use the MIDICAPS_LRVOLUME flag to test the dwSupport field of the MIDIOUTCAPS structure (filled by midiOutGetDevCaps).

See Also

midiOutSetVolume