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
This commit is contained in:
Andrew Greenwood 2009-02-22 22:31:26 +00:00
parent 141ec3a682
commit 63a2507150
3 changed files with 44 additions and 7 deletions

View file

@ -20,8 +20,13 @@
#include <mment4.h>
//#include <debug.h>
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;

View file

@ -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;
}
};

View file

@ -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) )