reactos/sdk/lib/drivers/sound/mmebuddy/auxiliary/auxMessage.c
Oleg Dubinskiy 9046cc97ee
[AUDIO] Implement volume control support (#6922)
Implement volume level changing for Aux/MidiOut/WaveOut devices. It's represented the following WINMM functions:
- auxGetVolume,
- auxSetVolume,
- midiOutGetVolume,
- midiOutSetVolume,
- waveOutGetVolume,
- waveOutSetVolume,
which are calling the followind messages appropriately:
- AUXDM_GETVOLUME,
- AUXDM_SETVOLUME,
- MODM_GETVOLUME,
- MODM_SETVOLUME,
- WODM_GETVOLUME,
- WODM_SETVOLUME.
This fixes volume control for several 3rd-party programs (like Fox Audio Player 0.10.2 from Rapps, Winamp 2.95 with WaveOut plugin). However it does not fix changing the volume in system volume mixers (SndVol32, MMSys), since they are using their own functionality instead. They technically do the same things, but apart from the functions mentioned above.
CORE-14780
2024-06-01 12:30:33 +02:00

74 lines
1.9 KiB
C

/*
* PROJECT: ReactOS Sound System "MME Buddy" Library
* LICENSE: GPL - See COPYING in the top level directory
* FILE: lib/sound/mmebuddy/auxiliary/auxMessage.c
*
* PURPOSE: Provides the auxMessage exported function, as required by
* the MME API, for auxiliary device support.
*
* PROGRAMMERS: Andrew Greenwood (silverblade@reactos.org)
*/
#include "precomp.h"
/*
Standard MME driver entry-point for messages relating to auxiliary devices.
*/
DWORD
APIENTRY
auxMessage(
UINT DeviceId,
UINT Message,
DWORD_PTR PrivateHandle,
DWORD_PTR Parameter1,
DWORD_PTR Parameter2)
{
MMRESULT Result = MMSYSERR_NOTSUPPORTED;
AcquireEntrypointMutex(AUX_DEVICE_TYPE);
SND_TRACE(L"auxMessage - Message type %d\n", Message);
switch ( Message )
{
case AUXDM_GETNUMDEVS :
{
Result = GetSoundDeviceCount(AUX_DEVICE_TYPE);
break;
}
case AUXDM_GETDEVCAPS :
{
Result = MmeGetSoundDeviceCapabilities(AUX_DEVICE_TYPE,
DeviceId,
(PVOID) Parameter1,
Parameter2);
break;
}
case AUXDM_GETVOLUME:
{
Result = MmeGetVolume(AUX_DEVICE_TYPE,
DeviceId,
PrivateHandle,
Parameter1);
break;
}
case AUXDM_SETVOLUME:
{
Result = MmeSetVolume(AUX_DEVICE_TYPE,
DeviceId,
PrivateHandle,
Parameter1);
break;
}
}
SND_TRACE(L"auxMessage returning MMRESULT %d\n", Result);
ReleaseEntrypointMutex(AUX_DEVICE_TYPE);
return Result;
}