From 63a25071505c390bee90a9fe011edd134cb6a2d9 Mon Sep 17 00:00:00 2001 From: Andrew Greenwood Date: Sun, 22 Feb 2009 22:31:26 +0000 Subject: [PATCH] Added GETDEVCAPS support for MIDI, mixer and aux devices, within MME Buddy and sndblst.dll - this just lets you see the device names etc. but adds no extra functionality apart from this. svn path=/trunk/; revision=39717 --- reactos/dll/win32/sndblst/sndblst.c | 33 +++++++++++++++++-- .../lib/drivers/sound/mmebuddy/capabilities.c | 13 ++++++-- reactos/lib/drivers/sound/mmebuddy/mmewrap.c | 5 +-- 3 files changed, 44 insertions(+), 7 deletions(-) diff --git a/reactos/dll/win32/sndblst/sndblst.c b/reactos/dll/win32/sndblst/sndblst.c index 9ce2e28c2e0..d27205245d1 100644 --- a/reactos/dll/win32/sndblst/sndblst.c +++ b/reactos/dll/win32/sndblst/sndblst.c @@ -20,8 +20,13 @@ #include //#include -PWSTR SBWaveOutDeviceName = L"ROS Sound Blaster Out"; -PWSTR SBWaveInDeviceName = L"ROS Sound Blaster In"; +/* TODO: Give individual device names if someone has > 1 card */ +PWSTR SBWaveOutDeviceName = L"ROS Sound Blaster Wave Out"; +PWSTR SBWaveInDeviceName = L"ROS Sound Blaster Wave In"; +PWSTR SBMidiOutDeviceName = L"ROS Sound Blaster Midi Out"; +PWSTR SBMidiInDeviceName = L"ROS Sound Blaster Midi In"; +PWSTR SBAuxDeviceName = L"ROS Sound Blaster Aux"; +PWSTR SBMixerDeviceName = L"ROS Sound Blaster Mixer"; /* TODO: Mixer etc */ MMRESULT @@ -64,6 +69,30 @@ GetSoundBlasterDeviceCapabilities( CopyWideString(WaveInCaps->szPname, SBWaveInDeviceName); break; } + case MIDI_OUT_DEVICE_TYPE : + { + LPMIDIOUTCAPS MidiOutCaps = (LPMIDIOUTCAPS) Capabilities; + CopyWideString(MidiOutCaps->szPname, SBMidiOutDeviceName); + break; + } + case MIDI_IN_DEVICE_TYPE : + { + LPMIDIINCAPS MidiInCaps = (LPMIDIINCAPS) Capabilities; + CopyWideString(MidiInCaps->szPname, SBMidiInDeviceName); + break; + } + case AUX_DEVICE_TYPE : + { + LPAUXCAPS AuxCaps = (LPAUXCAPS) Capabilities; + CopyWideString(AuxCaps->szPname, SBAuxDeviceName); + break; + } + case MIXER_DEVICE_TYPE : + { + LPMIXERCAPS MixerCaps = (LPMIXERCAPS) Capabilities; + CopyWideString(MixerCaps->szPname, SBMixerDeviceName); + break; + } } return MMSYSERR_NOERROR; diff --git a/reactos/lib/drivers/sound/mmebuddy/capabilities.c b/reactos/lib/drivers/sound/mmebuddy/capabilities.c index fa69d2e87a2..a2dec7f4fd0 100644 --- a/reactos/lib/drivers/sound/mmebuddy/capabilities.c +++ b/reactos/lib/drivers/sound/mmebuddy/capabilities.c @@ -54,6 +54,8 @@ GetSoundDeviceCapabilities( if ( ! MMSUCCESS(Result) ) return TranslateInternalMmResult(Result); + SND_ASSERT( IS_VALID_SOUND_DEVICE_TYPE(DeviceType) ); + /* Check that the capabilities structure is of a valid size */ switch ( DeviceType ) { @@ -77,10 +79,15 @@ GetSoundDeviceCapabilities( GoodSize = CapabilitiesSize >= sizeof(MIDIINCAPS); break; } - /* TODO: Others... */ - default : + case AUX_DEVICE_TYPE : { - SND_ASSERT(FALSE); + GoodSize = CapabilitiesSize >= sizeof(AUXCAPS); + break; + } + case MIXER_DEVICE_TYPE : + { + GoodSize = CapabilitiesSize >= sizeof(MIXERCAPS); + break; } }; diff --git a/reactos/lib/drivers/sound/mmebuddy/mmewrap.c b/reactos/lib/drivers/sound/mmebuddy/mmewrap.c index 03bce223c86..321efbb21a6 100644 --- a/reactos/lib/drivers/sound/mmebuddy/mmewrap.c +++ b/reactos/lib/drivers/sound/mmebuddy/mmewrap.c @@ -60,11 +60,12 @@ MmeGetSoundDeviceCapabilities( SND_TRACE(L"MME *_GETCAPS for device %d of type %d\n", DeviceId, DeviceType); - /* FIXME: Validate device type and ID */ + /* FIXME: Validate device ID */ VALIDATE_MMSYS_PARAMETER( Capabilities ); - VALIDATE_MMSYS_PARAMETER( CapabilitiesSize > 0 ); + VALIDATE_MMSYS_PARAMETER( IS_VALID_SOUND_DEVICE_TYPE(DeviceType) ); /* Our parameter checks are done elsewhere */ + Result = GetSoundDevice(DeviceType, DeviceId, &SoundDevice); if ( ! MMSUCCESS(Result) )