2009-01-31 22:11:09 +00:00
|
|
|
/*
|
|
|
|
* PROJECT: ReactOS Sound System "MME Buddy" Library
|
|
|
|
* LICENSE: GPL - See COPYING in the top level directory
|
|
|
|
* FILE: lib/sound/mmebuddy/midi/modMessage.c
|
|
|
|
*
|
|
|
|
* PURPOSE: Provides the modMessage exported function, as required by
|
|
|
|
* the MME API, for MIDI output device support.
|
|
|
|
*
|
|
|
|
* PROGRAMMERS: Andrew Greenwood (silverblade@reactos.org)
|
|
|
|
*/
|
|
|
|
|
2011-07-28 16:17:04 +00:00
|
|
|
#include "precomp.h"
|
2009-01-31 22:11:09 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
Standard MME driver entry-point for messages relating to MIDI output.
|
|
|
|
*/
|
2009-08-03 13:46:37 +00:00
|
|
|
DWORD
|
|
|
|
APIENTRY
|
2009-01-31 22:11:09 +00:00
|
|
|
modMessage(
|
2010-06-04 18:37:14 +00:00
|
|
|
UINT DeviceId,
|
|
|
|
UINT Message,
|
|
|
|
DWORD_PTR PrivateHandle,
|
|
|
|
DWORD_PTR Parameter1,
|
|
|
|
DWORD_PTR Parameter2)
|
2009-01-31 22:11:09 +00:00
|
|
|
{
|
|
|
|
MMRESULT Result = MMSYSERR_NOTSUPPORTED;
|
|
|
|
|
|
|
|
AcquireEntrypointMutex(MIDI_OUT_DEVICE_TYPE);
|
|
|
|
|
|
|
|
SND_TRACE(L"modMessage - Message type %d\n", Message);
|
|
|
|
|
|
|
|
switch ( Message )
|
|
|
|
{
|
|
|
|
case MODM_GETNUMDEVS :
|
|
|
|
{
|
|
|
|
Result = GetSoundDeviceCount(MIDI_OUT_DEVICE_TYPE);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case MODM_GETDEVCAPS :
|
|
|
|
{
|
|
|
|
Result = MmeGetSoundDeviceCapabilities(MIDI_OUT_DEVICE_TYPE,
|
|
|
|
DeviceId,
|
|
|
|
(PVOID) Parameter1,
|
|
|
|
Parameter2);
|
|
|
|
break;
|
|
|
|
}
|
2009-10-27 23:28:09 +00:00
|
|
|
|
|
|
|
case DRV_QUERYDEVICEINTERFACESIZE :
|
|
|
|
{
|
|
|
|
Result = MmeGetDeviceInterfaceString(MIDI_OUT_DEVICE_TYPE, DeviceId, NULL, 0, (DWORD*)Parameter1); //FIXME DWORD_PTR
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case DRV_QUERYDEVICEINTERFACE :
|
|
|
|
{
|
|
|
|
Result = MmeGetDeviceInterfaceString(MIDI_OUT_DEVICE_TYPE, DeviceId, (LPWSTR)Parameter1, Parameter2, NULL); //FIXME DWORD_PTR
|
|
|
|
break;
|
|
|
|
}
|
2010-10-31 13:20:11 +00:00
|
|
|
|
|
|
|
case MODM_OPEN :
|
|
|
|
{
|
|
|
|
Result = MmeOpenDevice(MIDI_OUT_DEVICE_TYPE,
|
|
|
|
DeviceId,
|
|
|
|
(LPWAVEOPENDESC) Parameter1, /* unused */
|
|
|
|
Parameter2,
|
|
|
|
(DWORD_PTR*)PrivateHandle);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case MODM_CLOSE :
|
|
|
|
{
|
|
|
|
Result = MmeCloseDevice(PrivateHandle);
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
[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
|
|
|
case MODM_GETVOLUME:
|
|
|
|
{
|
|
|
|
Result = MmeGetVolume(MIDI_OUT_DEVICE_TYPE,
|
|
|
|
DeviceId,
|
|
|
|
PrivateHandle,
|
|
|
|
Parameter1);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case MODM_SETVOLUME:
|
|
|
|
{
|
|
|
|
Result = MmeSetVolume(MIDI_OUT_DEVICE_TYPE,
|
|
|
|
DeviceId,
|
|
|
|
PrivateHandle,
|
|
|
|
Parameter1);
|
|
|
|
break;
|
|
|
|
}
|
2009-01-31 22:11:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
SND_TRACE(L"modMessage returning MMRESULT %d\n", Result);
|
|
|
|
|
|
|
|
ReleaseEntrypointMutex(MIDI_OUT_DEVICE_TYPE);
|
|
|
|
|
|
|
|
return Result;
|
|
|
|
}
|