[MMIXER]
authorJohannes Anderwald <johannes.anderwald@reactos.org>
Wed, 23 Dec 2009 02:49:18 +0000 (02:49 +0000)
committerJohannes Anderwald <johannes.anderwald@reactos.org>
Wed, 23 Dec 2009 02:49:18 +0000 (02:49 +0000)
- Implement a function for controlling the wave pin state

svn path=/trunk/; revision=44720

reactos/lib/drivers/sound/mmixer/mmixer.h
reactos/lib/drivers/sound/mmixer/wave.c

index 1965613..d5c0a46 100644 (file)
@@ -166,4 +166,10 @@ MMixerOpenWave(
     IN LPWAVEFORMATEX WaveFormat,
     OUT PHANDLE PinHandle);
 
+MIXER_STATUS
+MMixerSetWaveStatus(
+    IN PMIXER_CONTEXT MixerContext,
+    IN HANDLE PinHandle,
+    IN KSSTATE State);
+
 #endif
index 9fb7533..498c61b 100644 (file)
@@ -8,6 +8,7 @@
 
 #include "priv.h"
 
+const GUID KSPROPSETID_Connection               = {0x1D58C920L, 0xAC9B, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}};
 const GUID KSDATAFORMAT_SPECIFIER_WAVEFORMATEX  = {0x05589f81L, 0xc356, 0x11ce, {0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a}};
 const GUID KSDATAFORMAT_SUBTYPE_PCM             = {0x00000001L, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
 const GUID KSDATAFORMAT_TYPE_AUDIO              = {0x73647561L, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}};
@@ -576,3 +577,20 @@ MMixerGetWaveOutCount(
 
     return MixerList->WaveOutListCount;
 }
+
+MIXER_STATUS
+MMixerSetWaveStatus(
+    IN PMIXER_CONTEXT MixerContext,
+    IN HANDLE PinHandle,
+    IN KSSTATE State)
+{
+    KSPROPERTY Property;
+    ULONG Length;
+
+    /* setup property request */
+    Property.Set = KSPROPSETID_Connection;
+    Property.Id = KSPROPERTY_CONNECTION_STATE;
+    Property.Flags = KSPROPERTY_TYPE_SET;
+
+    return MixerContext->Control(PinHandle, IOCTL_KS_PROPERTY, &Property, sizeof(KSPROPERTY), &State, sizeof(KSSTATE), &Length);
+}