[ros-diffs] [silverblade] 39717: 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.

silverblade at svn.reactos.org silverblade at svn.reactos.org
Sun Feb 22 23:31:26 CET 2009


Author: silverblade
Date: Mon Feb 23 01:31:26 2009
New Revision: 39717

URL: http://svn.reactos.org/svn/reactos?rev=39717&view=rev
Log:
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.


Modified:
    trunk/reactos/dll/win32/sndblst/sndblst.c
    trunk/reactos/lib/drivers/sound/mmebuddy/capabilities.c
    trunk/reactos/lib/drivers/sound/mmebuddy/mmewrap.c

Modified: trunk/reactos/dll/win32/sndblst/sndblst.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/sndblst/sndblst.c?rev=39717&r1=39716&r2=39717&view=diff
==============================================================================
--- trunk/reactos/dll/win32/sndblst/sndblst.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/sndblst/sndblst.c [iso-8859-1] Mon Feb 23 01:31:26 2009
@@ -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
@@ -62,6 +67,30 @@
         {
             LPWAVEINCAPS WaveInCaps = (LPWAVEINCAPS) Capabilities;
             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;
         }
     }

Modified: trunk/reactos/lib/drivers/sound/mmebuddy/capabilities.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/mmebuddy/capabilities.c?rev=39717&r1=39716&r2=39717&view=diff
==============================================================================
--- trunk/reactos/lib/drivers/sound/mmebuddy/capabilities.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/sound/mmebuddy/capabilities.c [iso-8859-1] Mon Feb 23 01:31:26 2009
@@ -54,6 +54,8 @@
     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 @@
             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;
         }
     };
 

Modified: trunk/reactos/lib/drivers/sound/mmebuddy/mmewrap.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/mmebuddy/mmewrap.c?rev=39717&r1=39716&r2=39717&view=diff
==============================================================================
--- trunk/reactos/lib/drivers/sound/mmebuddy/mmewrap.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/sound/mmebuddy/mmewrap.c [iso-8859-1] Mon Feb 23 01:31:26 2009
@@ -60,11 +60,12 @@
 
     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) )



More information about the Ros-diffs mailing list