ReactOS 0.4.15-dev-5667-ged97270
filter.c File Reference
#include "precomp.h"
#include <debug.h>
Include dependency graph for filter.c:

Go to the source code of this file.

Macros

#define YDEBUG
 

Functions

ULONG MMixerGetFilterPinCount (IN PMIXER_CONTEXT MixerContext, IN HANDLE hMixer)
 
MIXER_STATUS MMixerGetFilterTopologyProperty (IN PMIXER_CONTEXT MixerContext, IN HANDLE hMixer, IN ULONG PropertyId, OUT PKSMULTIPLE_ITEM *OutMultipleItem)
 
MIXER_STATUS MMixerGetPhysicalConnection (IN PMIXER_CONTEXT MixerContext, IN HANDLE hMixer, IN ULONG PinId, OUT PKSPIN_PHYSICALCONNECTION *OutConnection)
 
ULONG MMixerGetControlTypeFromTopologyNode (IN LPGUID NodeType)
 
MIXER_STATUS MMixerSetGetControlDetails (IN PMIXER_CONTEXT MixerContext, IN HANDLE hMixer, IN ULONG NodeId, IN ULONG bSet, IN ULONG PropertyId, IN ULONG Channel, IN PLONG InputValue)
 
ULONG MMixerGetPinInstanceCount (PMIXER_CONTEXT MixerContext, HANDLE hFilter, ULONG PinId)
 

Macro Definition Documentation

◆ YDEBUG

#define YDEBUG

Definition at line 11 of file filter.c.

Function Documentation

◆ MMixerGetControlTypeFromTopologyNode()

ULONG MMixerGetControlTypeFromTopologyNode ( IN LPGUID  NodeType)

Definition at line 139 of file filter.c.

141{
143 {
144 /* automatic gain control */
146 }
148 {
149 /* loudness control */
151 }
153 {
154 /* mute control */
156 }
158 {
159 /* tone control
160 * FIXME
161 * MIXERCONTROL_CONTROLTYPE_ONOFF if KSPROPERTY_AUDIO_BASS_BOOST is supported
162 * MIXERCONTROL_CONTROLTYPE_BASS if KSPROPERTY_AUDIO_BASS is supported
163 * MIXERCONTROL_CONTROLTYPE_TREBLE if KSPROPERTY_AUDIO_TREBLE is supported
164 */
167 }
169 {
170 /* volume control */
172 }
174 {
175 /* peakmeter control */
177 }
179 {
180 /* mux control */
182 }
184 {
185 /* mux control */
187 }
189 {
190 /* stero wide control */
192 }
194 {
195 /* chorus control */
197 }
199 {
200 /* reverb control */
202 }
204 {
205 /* supermix control
206 * MIXERCONTROL_CONTROLTYPE_MUTE if KSPROPERTY_AUDIO_MUTE is supported
207 */
210 }
211 /* TODO
212 * check for other supported node types
213 */
214 //UNIMPLEMENTED;
215 return 0;
216}
NodeType
Definition: Node.h:6
#define UNIMPLEMENTED
Definition: debug.h:115
#define KSNODETYPE_TONE
Definition: ksmedia.h:453
#define KSNODETYPE_LOUDNESS
Definition: ksmedia.h:398
#define KSNODETYPE_MUX
Definition: ksmedia.h:433
#define KSNODETYPE_REVERB
Definition: ksmedia.h:312
#define KSNODETYPE_CHORUS
Definition: ksmedia.h:307
#define KSNODETYPE_VOLUME
Definition: ksmedia.h:338
#define KSNODETYPE_MUTE
Definition: ksmedia.h:348
#define KSNODETYPE_AGC
Definition: ksmedia.h:267
#define KSNODETYPE_SUPERMIX
Definition: ksmedia.h:277
#define KSNODETYPE_PEAKMETER
Definition: ksmedia.h:443
#define KSNODETYPE_STEREO_WIDE
Definition: ksmedia.h:448
#define MIXERCONTROL_CONTROLTYPE_ONOFF
Definition: mmsystem.h:383
#define MIXERCONTROL_CONTROLTYPE_MUX
Definition: mmsystem.h:403
#define MIXERCONTROL_CONTROLTYPE_LOUDNESS
Definition: mmsystem.h:386
#define MIXERCONTROL_CONTROLTYPE_FADER
Definition: mmsystem.h:397
#define MIXERCONTROL_CONTROLTYPE_VOLUME
Definition: mmsystem.h:398
#define MIXERCONTROL_CONTROLTYPE_PEAKMETER
Definition: mmsystem.h:380
#define MIXERCONTROL_CONTROLTYPE_MUTE
Definition: mmsystem.h:384
#define IsEqualGUIDAligned(guid1, guid2)
Definition: wdm.template.h:235

Referenced by MMixerAddMixerControl().

◆ MMixerGetFilterPinCount()

ULONG MMixerGetFilterPinCount ( IN PMIXER_CONTEXT  MixerContext,
IN HANDLE  hMixer 
)

Definition at line 15 of file filter.c.

18{
21 ULONG NumPins, BytesReturned;
22
23 /* setup property request */
25 Pin.Set = KSPROPSETID_Pin;
27
28 /* query pin count */
30
31 /* check for success */
33 return 0;
34
35 return NumPins;
36}
MIXER_CONTEXT MixerContext
Definition: mmixer.c:41
const GUID KSPROPSETID_Pin
Definition: filter.c:47
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
IN PDCB IN VBO IN ULONG IN BOOLEAN Pin
Definition: fatprocs.h:427
Status
Definition: gdiplustypes.h:25
#define IOCTL_KS_PROPERTY
Definition: ks.h:127
@ KSPROPERTY_PIN_CTYPES
Definition: ks.h:626
MIXER_STATUS
Definition: mmixer.h:4
@ MM_STATUS_SUCCESS
Definition: mmixer.h:5
HMIXER hMixer
Definition: test.c:10
PMIXER_DEVICE_CONTROL Control
Definition: mmixer.h:95
ULONG Flags
Definition: ntfs.h:536
uint32_t * PULONG
Definition: typedefs.h:59
uint32_t ULONG
Definition: typedefs.h:59
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_ ULONG _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesReturned
Definition: wdfiotarget.h:1052

Referenced by MMixerBuildTopology().

◆ MMixerGetFilterTopologyProperty()

MIXER_STATUS MMixerGetFilterTopologyProperty ( IN PMIXER_CONTEXT  MixerContext,
IN HANDLE  hMixer,
IN ULONG  PropertyId,
OUT PKSMULTIPLE_ITEM OutMultipleItem 
)

Definition at line 39 of file filter.c.

44{
46 PKSMULTIPLE_ITEM MultipleItem;
49
50 /* setup property request */
54
55 /* query for the size */
57
59 return Status;
60
61 /* sanity check */
63
64 /* allocate an result buffer */
66
67 if (!MultipleItem)
68 {
69 /* not enough memory */
71 }
72
73 /* query again with allocated buffer */
75
77 {
78 /* failed */
79 MixerContext->Free((PVOID)MultipleItem);
80 return Status;
81 }
82
83 /* store result */
84 *OutMultipleItem = MultipleItem;
85
86 /* done */
87 return Status;
88}
_In_ PSTORAGE_PROPERTY_ID PropertyId
Definition: cdrom.h:932
#define NULL
Definition: types.h:112
const GUID KSPROPSETID_Topology
Definition: filter.c:46
struct KSIDENTIFIER KSPROPERTY
struct KSMULTIPLE_ITEM * PKSMULTIPLE_ITEM
@ MM_STATUS_NO_MEMORY
Definition: mmixer.h:12
@ MM_STATUS_MORE_ENTRIES
Definition: mmixer.h:9
#define ASSERT(a)
Definition: mode.c:44
PMIXER_FREE Free
Definition: mmixer.h:96
PMIXER_ALLOC Alloc
Definition: mmixer.h:94

Referenced by MMixerBuildTopology().

◆ MMixerGetPhysicalConnection()

MIXER_STATUS MMixerGetPhysicalConnection ( IN PMIXER_CONTEXT  MixerContext,
IN HANDLE  hMixer,
IN ULONG  PinId,
OUT PKSPIN_PHYSICALCONNECTION OutConnection 
)

Definition at line 91 of file filter.c.

96{
100 PKSPIN_PHYSICALCONNECTION Connection;
101
102 /* setup the request */
103 Pin.Property.Flags = KSPROPERTY_TYPE_GET;
105 Pin.Property.Set = KSPROPSETID_Pin;
106 Pin.PinId = PinId;
107
108 /* query the pin for the physical connection */
110
112 {
113 /* pin does not have a physical connection */
114 return Status;
115 }
116 DPRINT("Status %u BytesReturned %lu\n", Status, BytesReturned);
118 if (!Connection)
119 {
120 /* not enough memory */
121 return MM_STATUS_NO_MEMORY;
122 }
123
124 /* query the pin for the physical connection */
127 {
128 /* failed to query the physical connection */
129 MixerContext->Free(Connection);
130 return Status;
131 }
132
133 // store connection
134 *OutConnection = Connection;
135 return Status;
136}
struct KSPIN_PHYSICALCONNECTION * PKSPIN_PHYSICALCONNECTION
@ KSPROPERTY_PIN_PHYSICALCONNECTION
Definition: ks.h:635
@ MM_STATUS_UNSUCCESSFUL
Definition: mmixer.h:11
#define DPRINT
Definition: sndvol32.h:71
Definition: ks.h:642

Referenced by MMixerApplyOutputFilterHack(), MMixerGetComponentAndTargetType(), and MMixerInitializeFilter().

◆ MMixerGetPinInstanceCount()

ULONG MMixerGetPinInstanceCount ( PMIXER_CONTEXT  MixerContext,
HANDLE  hFilter,
ULONG  PinId 
)

Definition at line 264 of file filter.c.

268{
269 KSP_PIN PinRequest;
270 KSPIN_CINSTANCES PinInstances;
273
274 /* query the instance count */
275 PinRequest.Reserved = 0;
276 PinRequest.PinId = PinId;
277 PinRequest.Property.Set = KSPROPSETID_Pin;
280
281 Status = MixerContext->Control(hFilter, IOCTL_KS_PROPERTY, (PVOID)&PinRequest, sizeof(KSP_PIN), (PVOID)&PinInstances, sizeof(KSPIN_CINSTANCES), &BytesReturned);
283 return PinInstances.CurrentCount;
284}
@ KSPROPERTY_PIN_CINSTANCES
Definition: ks.h:625
ULONG Id
Definition: dmksctrl.h:77
ULONG Flags
Definition: dmksctrl.h:78
GUID Set
Definition: dmksctrl.h:76
ULONG Reserved
Definition: ks.h:645
KSPROPERTY Property
Definition: ks.h:643
ULONG PinId
Definition: ks.h:644

◆ MMixerSetGetControlDetails()

MIXER_STATUS MMixerSetGetControlDetails ( IN PMIXER_CONTEXT  MixerContext,
IN HANDLE  hMixer,
IN ULONG  NodeId,
IN ULONG  bSet,
IN ULONG  PropertyId,
IN ULONG  Channel,
IN PLONG  InputValue 
)

Definition at line 219 of file filter.c.

227{
230 LONG Value;
232
233 if (bSet)
234 Value = *InputValue;
235
236 /* setup the request */
238
239 Property.NodeProperty.NodeId = NodeId;
240 Property.NodeProperty.Property.Id = PropertyId;
241 Property.NodeProperty.Property.Flags = KSPROPERTY_TYPE_TOPOLOGY;
242 Property.NodeProperty.Property.Set = KSPROPSETID_Audio;
243 Property.Channel = Channel;
244 Property.Reserved = 0;
245
246 if (bSet)
247 Property.NodeProperty.Property.Flags |= KSPROPERTY_TYPE_SET;
248 else
249 Property.NodeProperty.Property.Flags |= KSPROPERTY_TYPE_GET;
250
251 /* send the request */
253
254 if (!bSet && Status == MM_STATUS_SUCCESS)
255 {
256 *InputValue = Value;
257 }
258
259 DPRINT("Status %x bSet %u NodeId %u Value %d PropertyId %u\n", Status, bSet, NodeId, Value, PropertyId);
260 return Status;
261}
#define KSPROPERTY_TYPE_SET
Definition: dmksctrl.h:43
#define KSPROPERTY_TYPE_TOPOLOGY
Definition: dmksctrl.h:53
#define KSPROPSETID_Audio
Definition: ksmedia.h:1051
long LONG
Definition: pedump.c:60
Property(long _type, long _tag, INREAL _value)
Definition: reader.h:125
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413

Referenced by MMixerSetGetMuteControlDetails(), and MMixerSetGetVolumeControlDetails().