[WDMAUD.DRV]
authorJohannes Anderwald <johannes.anderwald@reactos.org>
Sun, 20 Dec 2009 00:55:52 +0000 (00:55 +0000)
committerJohannes Anderwald <johannes.anderwald@reactos.org>
Sun, 20 Dec 2009 00:55:52 +0000 (00:55 +0000)
- Implement support of using mmixer wave in/out library functions (not yet used)
- Not yet used
- Remove DIGCF_PRESENT flag from device list as setupapi cannot handle this yet properly

svn path=/trunk/; revision=44663

reactos/dll/win32/wdmaud.drv/mmixer.c
reactos/dll/win32/wdmaud.drv/wdmaud.c
reactos/dll/win32/wdmaud.drv/wdmaud.h
reactos/dll/win32/wdmaud.drv/wdmaud.rbuild

index 991454e..1c8c046 100644 (file)
@@ -295,7 +295,7 @@ WdmAudInitUserModeMixer()
     DeviceHandle = SetupDiGetClassDevs(&CategoryGuid,
                                        NULL,
                                        NULL,
-                                       DIGCF_DEVICEINTERFACE|DIGCF_PRESENT);
+                                       DIGCF_DEVICEINTERFACE/* FIXME |DIGCF_PRESENT*/);
 
     if (DeviceHandle == INVALID_HANDLE_VALUE)
     {
@@ -408,3 +408,54 @@ WdmAudGetControlDetails(
 
     return MMSYSERR_ERROR;
 }
+
+ULONG
+WdmAudGetWaveOutCount()
+{
+    return MMixerGetWaveOutCount(&MixerContext);
+}
+
+ULONG
+WdmAudGetWaveInCount()
+{
+    return MMixerGetWaveInCount(&MixerContext);
+}
+
+MMRESULT
+WdmAudGetWaveOutCapabilities(
+    IN ULONG DeviceId, 
+    LPWAVEOUTCAPSW Capabilities)
+{
+    if (MMixerWaveOutCapabilities(&MixerContext, DeviceId, Capabilities) == MM_STATUS_SUCCESS)
+        return MMSYSERR_NOERROR;
+
+    return MMSYSERR_ERROR;
+
+}
+
+MMRESULT
+WdmAudGetWaveInCapabilities(
+    IN ULONG DeviceId, 
+    LPWAVEINCAPSW Capabilities)
+{
+    if (MMixerWaveInCapabilities(&MixerContext, DeviceId, Capabilities) == MM_STATUS_SUCCESS)
+        return MMSYSERR_NOERROR;
+
+    return MMSYSERR_ERROR;
+}
+
+MMRESULT
+WdmAudOpenWave(
+    OUT PHANDLE hPin,
+    IN DWORD DeviceId,
+    IN PWAVEFORMATEX WaveFormat,
+    IN DWORD bWaveIn)
+{
+    if (MMixerOpenWave(&MixerContext, DeviceId, bWaveIn, WaveFormat, hPin) == MM_STATUS_SUCCESS)
+    {
+        //fixme
+        // start stream if waveout
+        return MMSYSERR_NOERROR;
+    }
+    return MMSYSERR_ERROR;
+}
index 462000b..99c78ac 100644 (file)
@@ -44,7 +44,20 @@ GetNumWdmDevs(
 {
 #ifdef USE_MMIXER_LIB
 
-    *DeviceCount = WdmAudGetMixerCount();
+    switch(DeviceType)
+    {
+        case MIXER_DEVICE_TYPE:
+            *DeviceCount = WdmAudGetMixerCount();
+            break;
+        case WAVE_OUT_DEVICE_TYPE:
+            *DeviceCount = WdmAudGetWaveOutCount();
+            break;
+        case WAVE_IN_DEVICE_TYPE:
+            *DeviceCount = WdmAudGetWaveInCount();
+            break;
+        default:
+            *DeviceCount = 0;
+    }
     return MMSYSERR_NOERROR;
 #else
 
@@ -106,8 +119,17 @@ GetWdmDeviceCapabilities(
 #ifdef USE_MMIXER_LIB
     if (DeviceType == MIXER_DEVICE_TYPE)
     {
-        return WdmAudGetMixerCapabilties(DeviceId, (LPMIXERCAPSW)Capabilities);
+        return WdmAudGetMixerCapabilities(DeviceId, (LPMIXERCAPSW)Capabilities);
+    }
+    else if (DeviceType == WAVE_OUT_DEVICE_TYPE)
+    {
+        return WdmAudGetWaveOutCapabilities(DeviceId, (LPWAVEOUTCAPSW)Capabilities);
+    }
+    else if (DeviceType == WAVE_IN_DEVICE_TYPE)
+    {
+        return WdmAudGetWaveInCapabilities(DeviceId, (LPWAVEINCAPSW)Capabilities);
     }
+
 #endif
 
 
@@ -459,8 +481,13 @@ SetWdmWaveDeviceFormat(
         return MMSYSERR_NOERROR;
     }
 
-
     Result = GetSoundDeviceType(SoundDevice, &DeviceType);
+
+#ifdef USE_MMIXER_LIB
+    return WdmAudOpenWavePin(Instance, DeviceId, WaveFormat, DeviceType);
+#endif
+
+
     SND_ASSERT( Result == MMSYSERR_NOERROR );
 
     ZeroMemory(&DeviceInfo, sizeof(WDMAUD_DEVICE_INFO));
index 366c17a..38d92e8 100644 (file)
 BOOL
 WdmAudInitUserModeMixer();
 
+ULONG
+WdmAudGetWaveOutCount();
+
+ULONG
+WdmAudGetWaveInCount();
+
 ULONG
 WdmAudGetMixerCount();
 
@@ -25,6 +31,16 @@ WdmAudGetMixerCapabilties(
     IN ULONG DeviceId, 
     LPMIXERCAPSW Capabilities);
 
+MMRESULT
+WdmAudGetWaveOutCapabilities(
+    IN ULONG DeviceId, 
+    LPWAVEOUTCAPSW Capabilities);
+
+MMRESULT
+WdmAudGetWaveInCapabilities(
+    IN ULONG DeviceId, 
+    LPWAVEINCAPSW Capabilities);
+
 MMRESULT
 WdmAudCloseMixer(
     IN HMIXER Handle,
@@ -36,6 +52,14 @@ WdmAudOpenMixer(
     IN ULONG DeviceId, 
     IN HANDLE hNotifyEvent);
 
+MMRESULT
+WdmAudOpenWave(
+    OUT PHANDLE hPin,
+    IN DWORD DeviceId,
+    IN PWAVEFORMATEX WaveFormat,
+    IN DWORD bWaveIn);
+
+
 MMRESULT
 WdmAudGetLineInfo(
     IN HANDLE hMixer,
index a2d0ccc..360eb61 100644 (file)
@@ -16,6 +16,7 @@
        <library>msvcrt</library>
        <library>mmixer</library>
        <library>setupapi</library>
+       <library>ksuser</library>
        <file>wdmaud.c</file>
        <file>mixer.c</file>
        <file>mmixer.c</file>