MODM_SETVOLUME

The MODM_SETVOLUME message requests a user-mode MIDI output driver to set the volume level for the specified device.

Parameters

uDeviceId

Device identifier (0, 1, 2, and so on) for the target device.

uMsg

MODM_SETVOLUME

dwUser

Device instance identifier.

dwParam1

A DWORD containing the volume setting.

dwParam2

Not used.

Return Value

The driver should return MMSYSERR_NOERROR if the operation succeeds. Otherwise it should return one of the MMSYSERR or MIDIERR error codes defined in mmsystem.h. See midiOutSetVolume return values in the Win32 SDK.

Comments

A client sends the MODM_SETVOLUME message by calling the user-mode driver’s modMessage entry point, passing the specified parameters.

Support for this message by user-mode drivers is optional. If the driver supports MODM_SETVOLUME, it must support MODM_GETVOLUME.

The volume value is specified by dwParam1 as follows:

Channel Portion of dwParam1 Used
Left channel Low word
Right channel High word
Single channel Low word

A value of zero is silence, and a value of 0xFFFF is full volume.

The kernel-mode driver might not support the full 16 bits of volume control and can truncate the lower bits. However, the original value requested with AUXDM_SETVOLUME should be returned with AUXDM_GETVOLUME.

Typically, the user-mode driver calls DeviceIoControl to send the kernel-mode driver an IOCTL_MIDI_SET_VOLUME control code.

Only drivers for internal synthesizer devices can support volume level changes. Drivers for MIDI output ports should return a MMSYSERR_NOTSUPPORTED error for this message.