ReactOS  0.4.13-dev-482-ge57f103
precomp.h File Reference
#include <wdm.h>
#include <windef.h>
#include <mmreg.h>
#include <ks.h>
#include <ksmedia.h>
#include <mmsystem.h>
#include "mmixer.h"
Include dependency graph for precomp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  __TOPOLOGY_NODE__
 
struct  PIN
 
struct  TOPOLOGY
 
struct  MIXER_INFO
 
struct  MIXERCONTROL_EXT
 
struct  MIXERLINE_EXT
 
struct  MIXERCONTROL_DATA
 
struct  MIXERVOLUME_DATA
 
struct  MIXER_DATA
 
struct  WAVE_INFO
 
struct  MIDI_INFO
 
struct  MIXER_LIST
 
struct  EVENT_NOTIFICATION_ENTRY
 

Macros

#define NOBITMAP
 
#define DESTINATION_LINE   (0xFFFF0000)
 
#define SOURCE_LINE   (0x10000)
 

Typedefs

typedef struct __TOPOLOGY_NODE__ TOPOLOGY_NODE
 
typedef struct __TOPOLOGY_NODE__PTOPOLOGY_NODE
 
typedef struct PINPPIN
 
typedef struct TOPOLOGYPTOPOLOGY
 
typedef struct MIXER_INFOLPMIXER_INFO
 
typedef struct MIXERCONTROL_EXTLPMIXERCONTROL_EXT
 
typedef struct MIXERLINE_EXTLPMIXERLINE_EXT
 
typedef struct MIXERCONTROL_DATALPMIXERCONTROL_DATA
 
typedef struct MIXERVOLUME_DATALPMIXERVOLUME_DATA
 
typedef struct MIXER_DATALPMIXER_DATA
 
typedef struct WAVE_INFOLPWAVE_INFO
 
typedef struct MIDI_INFOLPMIDI_INFO
 
typedef struct MIXER_LISTPMIXER_LIST
 
typedef struct EVENT_NOTIFICATION_ENTRYPEVENT_NOTIFICATION_ENTRY
 

Functions

ULONG MMixerGetFilterPinCount (IN PMIXER_CONTEXT MixerContext, IN HANDLE hMixer)
 
LPGUID MMixerGetNodeType (IN PKSMULTIPLE_ITEM MultipleItem, IN ULONG Index)
 
MIXER_STATUS MMixerGetNodeIndexes (IN PMIXER_CONTEXT MixerContext, IN PKSMULTIPLE_ITEM MultipleItem, IN ULONG NodeIndex, IN ULONG bNode, IN ULONG bFrom, OUT PULONG NodeReferenceCount, OUT PULONG *NodeReference)
 
PKSTOPOLOGY_CONNECTION MMixerGetConnectionByIndex (IN PKSMULTIPLE_ITEM MultipleItem, IN ULONG Index)
 
ULONG MMixerGetControlTypeFromTopologyNode (IN LPGUID NodeType)
 
LPMIXERLINE_EXT MMixerGetSourceMixerLineByLineId (LPMIXER_INFO MixerInfo, DWORD dwLineID)
 
MIXER_STATUS MMixerGetFilterTopologyProperty (IN PMIXER_CONTEXT MixerContext, IN HANDLE hMixer, IN ULONG PropertyId, OUT PKSMULTIPLE_ITEM *OutMultipleItem)
 
VOID MMixerFreeMixerInfo (IN PMIXER_CONTEXT MixerContext, IN LPMIXER_INFO MixerInfo)
 
MIXER_STATUS MMixerGetPhysicalConnection (IN PMIXER_CONTEXT MixerContext, IN HANDLE hMixer, IN ULONG PinId, OUT PKSPIN_PHYSICALCONNECTION *OutConnection)
 
MIXER_STATUS MMixerSetupFilter (IN PMIXER_CONTEXT MixerContext, IN PMIXER_LIST MixerList, IN LPMIXER_DATA MixerData, IN PULONG DeviceCount)
 
PKSPIN_CONNECT MMixerAllocatePinConnect (IN PMIXER_CONTEXT MixerContext, ULONG DataFormatSize)
 
MIXER_STATUS MMixerGetAudioPinDataRanges (IN PMIXER_CONTEXT MixerContext, IN HANDLE hDevice, IN ULONG PinId, IN OUT PKSMULTIPLE_ITEM *OutMultipleItem)
 
VOID MMixerInitializeMidiForFilter (IN PMIXER_CONTEXT MixerContext, IN PMIXER_LIST MixerList, IN LPMIXER_DATA MixerData, IN PTOPOLOGY Topology)
 
MIXER_STATUS MMixerVerifyContext (IN PMIXER_CONTEXT MixerContext)
 
LPMIXER_INFO MMixerGetMixerInfoByIndex (IN PMIXER_CONTEXT MixerContext, IN ULONG MixerIndex)
 
LPMIXERLINE_EXT MMixerGetSourceMixerLineByComponentType (LPMIXER_INFO MixerInfo, DWORD dwComponentType)
 
MIXER_STATUS MMixerGetMixerControlById (LPMIXER_INFO MixerInfo, DWORD dwControlID, LPMIXERLINE_EXT *MixerLine, LPMIXERCONTROL_EXT *MixerControl, PULONG NodeId)
 
MIXER_STATUS MMixerSetGetMuteControlDetails (IN PMIXER_CONTEXT MixerContext, IN LPMIXER_INFO MixerInfo, IN LPMIXERCONTROL_EXT MixerControl, IN ULONG dwLineID, IN LPMIXERCONTROLDETAILS MixerControlDetails, IN ULONG bSet)
 
MIXER_STATUS MMixerSetGetVolumeControlDetails (IN PMIXER_CONTEXT MixerContext, IN LPMIXER_INFO MixerInfo, IN ULONG NodeId, IN ULONG bSet, LPMIXERCONTROL_EXT MixerControl, IN LPMIXERCONTROLDETAILS MixerControlDetails, LPMIXERLINE_EXT MixerLine)
 
MIXER_STATUS MMixerSetGetMuxControlDetails (IN PMIXER_CONTEXT MixerContext, IN LPMIXER_INFO MixerInfo, IN ULONG NodeId, IN ULONG bSet, IN ULONG Flags, LPMIXERCONTROL_EXT MixerControl, IN LPMIXERCONTROLDETAILS MixerControlDetails, LPMIXERLINE_EXT MixerLine)
 
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)
 
LPMIXER_DATA MMixerGetDataByDeviceId (IN PMIXER_LIST MixerList, IN ULONG DeviceId)
 
LPMIXER_DATA MMixerGetDataByDeviceName (IN PMIXER_LIST MixerList, IN LPWSTR DeviceName)
 
MIXER_STATUS MMixerCreateMixerData (IN PMIXER_CONTEXT MixerContext, IN PMIXER_LIST MixerList, IN ULONG DeviceId, IN LPWSTR DeviceName, IN HANDLE hDevice, IN HANDLE hKey)
 
MIXER_STATUS MMixerInitializeWaveInfo (IN PMIXER_CONTEXT MixerContext, IN PMIXER_LIST MixerList, IN LPMIXER_DATA MixerData, IN LPWSTR DeviceName, IN ULONG bWaveIn, IN ULONG PinCount, IN PULONG Pins)
 
MIXER_STATUS MMixerAddEvent (IN PMIXER_CONTEXT MixerContext, IN OUT LPMIXER_INFO MixerInfo, IN PVOID MixerEvent, IN PMIXER_EVENT MixerEventRoutine)
 
MIXER_STATUS MMixerRemoveEvent (IN PMIXER_CONTEXT MixerContext, IN OUT LPMIXER_INFO MixerInfo, IN PVOID MixerEventContext, IN PMIXER_EVENT MixerEventRoutine)
 
MIXER_STATUS MMixerGetDeviceName (IN PMIXER_CONTEXT MixerContext, OUT LPWSTR DeviceName, IN HANDLE hKey)
 
MIXER_STATUS MMixerGetDeviceNameWithComponentId (IN PMIXER_CONTEXT MixerContext, IN HANDLE hMixer, OUT LPWSTR DeviceName)
 
VOID MMixerInitializePinConnect (IN OUT PKSPIN_CONNECT PinConnect, IN ULONG PinId)
 
MIXER_STATUS MMixerGetPinDataFlowAndCommunication (IN PMIXER_CONTEXT MixerContext, IN HANDLE hDevice, IN ULONG PinId, OUT PKSPIN_DATAFLOW DataFlow, OUT PKSPIN_COMMUNICATION Communication)
 
VOID MMixerHandleAlternativeMixers (IN PMIXER_CONTEXT MixerContext, IN PMIXER_LIST MixerList, IN LPMIXER_DATA MixerData, IN PTOPOLOGY Topology)
 
MIXER_STATUS MMixerGetMixerByName (IN PMIXER_LIST MixerList, IN LPWSTR MixerName, OUT LPMIXER_INFO *MixerInfo)
 
MIXER_STATUS MMixerCreateTopology (IN PMIXER_CONTEXT MixerContext, IN ULONG PinCount, IN PKSMULTIPLE_ITEM NodeConnections, IN PKSMULTIPLE_ITEM NodeTypes, OUT PTOPOLOGY *OutTopology)
 
VOID MMixerGetAllUpOrDownstreamPinsFromNodeIndex (IN PMIXER_CONTEXT MixerContext, IN PTOPOLOGY Topology, IN ULONG NodeIndex, IN ULONG bUpStream, OUT PULONG OutPinsCount, OUT PULONG OutPins)
 
MIXER_STATUS MMixerGetAllUpOrDownstreamPinsFromPinIndex (IN PMIXER_CONTEXT MixerContext, IN PTOPOLOGY Topology, IN ULONG PinIndex, IN ULONG bUpStream, OUT PULONG OutPinsCount, OUT PULONG OutPins)
 
VOID MMixerGetNextNodesFromPinIndex (IN PMIXER_CONTEXT MixerContext, IN PTOPOLOGY Topology, IN ULONG PinIndex, IN ULONG bUpStream, OUT PULONG OutNodesCount, OUT PULONG OutNodes)
 
MIXER_STATUS MMixerAllocateTopologyPinArray (IN PMIXER_CONTEXT MixerContext, IN PTOPOLOGY Topology, OUT PULONG *OutPins)
 
MIXER_STATUS MMixerAllocateTopologyNodeArray (IN PMIXER_CONTEXT MixerContext, IN PTOPOLOGY Topology, OUT PULONG *OutPins)
 
VOID MMixerGetAllUpOrDownstreamNodesFromPinIndex (IN PMIXER_CONTEXT MixerContext, IN PTOPOLOGY Topology, IN ULONG PinIndex, IN ULONG bUpStream, OUT PULONG OutNodesCount, OUT PULONG OutNodes)
 
VOID MMixerIsNodeTerminator (IN PTOPOLOGY Topology, IN ULONG NodeIndex, OUT ULONG *bTerminator)
 
VOID MMixerGetNextNodesFromNodeIndex (IN PMIXER_CONTEXT MixerContext, IN PTOPOLOGY Topology, IN ULONG NodeIndex, IN ULONG bUpStream, OUT PULONG OutNodesCount, OUT PULONG OutNodes)
 
LPGUID MMixerGetNodeTypeFromTopology (IN PTOPOLOGY Topology, IN ULONG NodeIndex)
 
MIXER_STATUS MMixerGetAllUpOrDownstreamNodesFromNodeIndex (IN PMIXER_CONTEXT MixerContext, IN PTOPOLOGY Topology, IN ULONG NodeIndex, IN ULONG bUpStream, OUT PULONG OutNodesCount, OUT PULONG OutNodes)
 
MIXER_STATUS MMixerIsNodeConnectedToPin (IN PMIXER_CONTEXT MixerContext, IN PTOPOLOGY Topology, IN ULONG NodeIndex, IN ULONG PinId, IN ULONG bUpStream, OUT PULONG bConnected)
 
ULONG MMixerGetNodeIndexFromGuid (IN PTOPOLOGY Topology, IN const GUID *NodeType)
 
VOID MMixerSetTopologyNodeReserved (IN PTOPOLOGY Topology, IN ULONG NodeIndex)
 
VOID MMixerIsTopologyNodeReserved (IN PTOPOLOGY Topology, IN ULONG NodeIndex, OUT PULONG bReserved)
 
VOID MMixerSetTopologyPinReserved (IN PTOPOLOGY Topology, IN ULONG PinId)
 
VOID MMixerIsTopologyPinReserved (IN PTOPOLOGY Topology, IN ULONG PinId, OUT PULONG bReserved)
 
VOID MMixerGetTopologyPinCount (IN PTOPOLOGY Topology, OUT PULONG PinCount)
 
VOID MMixerGetConnectedFromLogicalTopologyPins (IN PTOPOLOGY Topology, IN ULONG NodeIndex, OUT PULONG OutPinCount, OUT PULONG OutPins)
 
VOID MMixerPrintTopology ()
 

Macro Definition Documentation

◆ DESTINATION_LINE

#define DESTINATION_LINE   (0xFFFF0000)

Definition at line 176 of file precomp.h.

◆ NOBITMAP

#define NOBITMAP

Definition at line 6 of file precomp.h.

◆ SOURCE_LINE

#define SOURCE_LINE   (0x10000)

Definition at line 177 of file precomp.h.

Typedef Documentation

◆ LPMIDI_INFO

◆ LPMIXER_DATA

◆ LPMIXER_INFO

◆ LPMIXERCONTROL_DATA

◆ LPMIXERCONTROL_EXT

◆ LPMIXERLINE_EXT

◆ LPMIXERVOLUME_DATA

◆ LPWAVE_INFO

◆ PEVENT_NOTIFICATION_ENTRY

◆ PMIXER_LIST

◆ PPIN

typedef struct PIN * PPIN

◆ PTOPOLOGY

◆ PTOPOLOGY_NODE

◆ TOPOLOGY_NODE

Function Documentation

◆ MMixerAddEvent()

MIXER_STATUS MMixerAddEvent ( IN PMIXER_CONTEXT  MixerContext,
IN OUT LPMIXER_INFO  MixerInfo,
IN PVOID  MixerEvent,
IN PMIXER_EVENT  MixerEventRoutine 
)

Definition at line 1830 of file controls.c.

1835 {
1836  //KSE_NODE Property;
1837  //KSEVENTDATA EventData
1838  //ULONG BytesReturned;
1839  //MIXER_STATUS Status;
1840  PEVENT_NOTIFICATION_ENTRY EventNotification;
1841 
1843  if (!EventNotification)
1844  {
1845  /* not enough memory */
1846  return MM_STATUS_NO_MEMORY;
1847  }
1848 
1849  /* FIXME: what is it supposed to happen with KSEVENTDATA ? */
1850 #if 0
1851  /* setup request */
1854  Property.Event.Id = KSEVENT_CONTROL_CHANGE;
1855 
1856  Property.NodeId = NodeId;
1857  Property.Reserved = 0;
1858 
1859  Status = MixerContext->Control(MixerInfo->hMixer, IOCTL_KS_ENABLE_EVENT, (PVOID)&Property, sizeof(KSP_NODE), (PVOID)EventData, sizeof(KSEVENTDATA), &BytesReturned);
1860  if (Status != MM_STATUS_SUCCESS)
1861  {
1862  /* failed to add event */
1863  MixerContext->FreeEventData(EventData);
1864  return Status;
1865  }
1866 #endif
1867 
1868  /* initialize notification entry */
1869  EventNotification->MixerEventContext = MixerEventContext;
1870  EventNotification->MixerEventRoutine = MixerEventRoutine;
1871 
1872  /* store event */
1873  InsertTailList(&MixerInfo->EventList, &EventNotification->Entry);
1874  return MM_STATUS_SUCCESS;
1875 }
#define KSEVENT_TYPE_TOPOLOGY
Definition: ks.h:1826
const GUID KSEVENTSETID_AudioControlChange
Definition: sup.c:33
#define InsertTailList(ListHead, Entry)
MIXER_CONTEXT MixerContext
Definition: mmixer.c:46
PMIXER_DEVICE_CONTROL Control
Definition: mmixer.h:95
PVOID MixerEventContext
Definition: precomp.h:171
Definition: ks.h:2104
#define KSEVENT_TYPE_ENABLE
Definition: ks.h:1819
PMIXER_FREE_EVENT_DATA FreeEventData
Definition: mmixer.h:104
Definition: precomp.h:168
struct EVENT_NOTIFICATION_ENTRY * PEVENT_NOTIFICATION_ENTRY
#define IOCTL_KS_ENABLE_EVENT
Definition: ks.h:134
PMIXER_ALLOC Alloc
Definition: mmixer.h:94
LIST_ENTRY Entry
Definition: precomp.h:170
Status
Definition: gdiplustypes.h:24
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
PMIXER_EVENT MixerEventRoutine
Definition: precomp.h:172

Referenced by MMixerOpen().

◆ MMixerAllocatePinConnect()

PKSPIN_CONNECT MMixerAllocatePinConnect ( IN PMIXER_CONTEXT  MixerContext,
ULONG  DataFormatSize 
)

Definition at line 72 of file wave.c.

75 {
76  return MixerContext->Alloc(sizeof(KSPIN_CONNECT) + DataFormatSize);
77 }
MIXER_CONTEXT MixerContext
Definition: mmixer.c:46
PMIXER_ALLOC Alloc
Definition: mmixer.h:94

Referenced by MMixerOpenMidiPin(), and MMixerOpenWavePin().

◆ MMixerAllocateTopologyNodeArray()

MIXER_STATUS MMixerAllocateTopologyNodeArray ( IN PMIXER_CONTEXT  MixerContext,
IN PTOPOLOGY  Topology,
OUT PULONG OutPins 
)

Definition at line 1052 of file topology.c.

1056 {
1057  PULONG Nodes;
1058  ULONG Index;
1059 
1060  /* sanity check */
1061  ASSERT(Topology->TopologyNodesCount != 0);
1062 
1063  /* allocate topology pins */
1064  Nodes = MixerContext->Alloc(Topology->TopologyNodesCount * sizeof(ULONG));
1065 
1066  if (!Nodes)
1067  {
1068  /* out of memory */
1069  return MM_STATUS_NO_MEMORY;
1070  }
1071 
1072  /* mark index as unused */
1073  for(Index = 0; Index < Topology->TopologyNodesCount; Index++)
1074  Nodes[Index] = MAXULONG;
1075 
1076  /* store result */
1077  *OutNodes = Nodes;
1078 
1079  /* done */
1080  return MM_STATUS_SUCCESS;
1081 }
MIXER_CONTEXT MixerContext
Definition: mmixer.c:46
static const UCHAR Index[8]
Definition: usbohci.c:18
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
PMIXER_ALLOC Alloc
Definition: mmixer.h:94
#define MAXULONG
Definition: typedefs.h:250
unsigned int * PULONG
Definition: retypes.h:1
unsigned int ULONG
Definition: retypes.h:1

Referenced by MMixerAddMixerControl(), MMixerAddMixerControlsToDestinationLine(), MMixerAddMixerSourceLines(), MMixerCountMixerControls(), and MMixerSetGetMuxControlDetails().

◆ MMixerAllocateTopologyPinArray()

MIXER_STATUS MMixerAllocateTopologyPinArray ( IN PMIXER_CONTEXT  MixerContext,
IN PTOPOLOGY  Topology,
OUT PULONG OutPins 
)

Definition at line 1020 of file topology.c.

1024 {
1025  PULONG Pins;
1026  ULONG Index;
1027 
1028  /* sanity check */
1029  ASSERT(Topology->TopologyPinsCount != 0);
1030 
1031  /* allocate topology pins */
1032  Pins = MixerContext->Alloc(Topology->TopologyPinsCount * sizeof(ULONG));
1033 
1034  if (!Pins)
1035  {
1036  /* out of memory */
1037  return MM_STATUS_NO_MEMORY;
1038  }
1039 
1040  /* mark index as unused */
1041  for(Index = 0; Index < Topology->TopologyPinsCount; Index++)
1042  Pins[Index] = MAXULONG;
1043 
1044  /* store result */
1045  *OutPins = Pins;
1046 
1047  /* done */
1048  return MM_STATUS_SUCCESS;
1049 }
MIXER_CONTEXT MixerContext
Definition: mmixer.c:46
static const UCHAR Index[8]
Definition: usbohci.c:18
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
PMIXER_ALLOC Alloc
Definition: mmixer.h:94
#define MAXULONG
Definition: typedefs.h:250
unsigned int * PULONG
Definition: retypes.h:1
unsigned int ULONG
Definition: retypes.h:1

Referenced by MMixerAddMixerSourceLines(), MMixerHandlePhysicalConnection(), MMixerHandleTopologyFilter(), MMixerInitializeFilter(), and MMixerIsNodeConnectedToPin().

◆ MMixerCreateMixerData()

MIXER_STATUS MMixerCreateMixerData ( IN PMIXER_CONTEXT  MixerContext,
IN PMIXER_LIST  MixerList,
IN ULONG  DeviceId,
IN LPWSTR  DeviceName,
IN HANDLE  hDevice,
IN HANDLE  hKey 
)

Definition at line 779 of file sup.c.

786 {
787  LPMIXER_DATA MixerData;
788 
789  MixerData = (LPMIXER_DATA)MixerContext->Alloc(sizeof(MIXER_DATA));
790  if (!MixerData)
791  return MM_STATUS_NO_MEMORY;
792 
793  MixerData->DeviceId = DeviceId;
794  MixerData->DeviceName = DeviceName;
795  MixerData->hDevice = hDevice;
796  MixerData->hDeviceInterfaceKey = hKey;
797  MixerData->Topology = NULL;
798 
799  InsertTailList(&MixerList->MixerData, &MixerData->Entry);
800  MixerList->MixerDataCount++;
801  return MM_STATUS_SUCCESS;
802 }
LPWSTR DeviceName
Definition: precomp.h:117
WCHAR DeviceName[]
Definition: adapter.cpp:21
#define InsertTailList(ListHead, Entry)
struct MIXER_DATA * LPMIXER_DATA
MIXER_CONTEXT MixerContext
Definition: mmixer.c:46
smooth NULL
Definition: ftsmooth.c:416
HANDLE hDeviceInterfaceKey
Definition: precomp.h:116
HANDLE hDevice
Definition: precomp.h:115
ULONG DeviceId
Definition: precomp.h:114
PTOPOLOGY Topology
Definition: precomp.h:118
PMIXER_ALLOC Alloc
Definition: mmixer.h:94
LIST_ENTRY Entry
Definition: precomp.h:113

Referenced by MMixerInitialize().

◆ MMixerCreateTopology()

MIXER_STATUS MMixerCreateTopology ( IN PMIXER_CONTEXT  MixerContext,
IN ULONG  PinCount,
IN PKSMULTIPLE_ITEM  NodeConnections,
IN PKSMULTIPLE_ITEM  NodeTypes,
OUT PTOPOLOGY OutTopology 
)

Definition at line 1253 of file topology.c.

1259 {
1261  PTOPOLOGY Topology;
1262 
1263  /* allocate topology */
1264  Status = MMixerAllocateTopology(MixerContext, NodeTypes->Count, PinCount, &Topology);
1265 
1266  if (Status != MM_STATUS_SUCCESS)
1267  {
1268  /* failed to allocate topology */
1269  return Status;
1270  }
1271 
1272  /* initialize topology nodes */
1273  MMixerInitializeTopologyNodes(MixerContext, NodeTypes, Topology);
1274 
1275  /* explore topology */
1276  Status = MMixerExploreTopology(MixerContext, NodeConnections, NodeTypes, Topology);
1277 
1278  if (Status != MM_STATUS_SUCCESS)
1279  {
1280  /* failed to allocate topology */
1281  return Status;
1282  }
1283 
1284  MMixerPrintTopology(Topology);
1285 
1286  /* store result */
1287  *OutTopology = Topology;
1288 
1289  /* done */
1290  return MM_STATUS_SUCCESS;
1291 }
MIXER_STATUS MMixerExploreTopology(IN PMIXER_CONTEXT MixerContext, IN PKSMULTIPLE_ITEM NodeConnections, IN PKSMULTIPLE_ITEM NodeTypes, IN OUT PTOPOLOGY Topology)
Definition: topology.c:524
VOID MMixerPrintTopology(PTOPOLOGY Topology)
Definition: topology.c:15
_In_ const GUID _In_ ULONG PinCount
Definition: strmini.h:504
MIXER_CONTEXT MixerContext
Definition: mmixer.c:46
VOID MMixerInitializeTopologyNodes(IN PMIXER_CONTEXT MixerContext, IN PKSMULTIPLE_ITEM NodeTypes, IN OUT PTOPOLOGY Topology)
Definition: topology.c:122
Status
Definition: gdiplustypes.h:24
MIXER_STATUS
Definition: mmixer.h:3
MIXER_STATUS MMixerAllocateTopology(IN PMIXER_CONTEXT MixerContext, IN ULONG NodesCount, IN ULONG PinCount, OUT PTOPOLOGY *OutTopology)
Definition: topology.c:46

Referenced by MMixerBuildTopology().

◆ MMixerFreeMixerInfo()

VOID MMixerFreeMixerInfo ( IN PMIXER_CONTEXT  MixerContext,
IN LPMIXER_INFO  MixerInfo 
)

Definition at line 116 of file sup.c.

119 {
120  /* UNIMPLEMENTED;
121  * FIXME
122  * free all lines
123  */
124 
125  MixerContext->Free((PVOID)MixerInfo);
126 }
MIXER_CONTEXT MixerContext
Definition: mmixer.c:46
PMIXER_FREE Free
Definition: mmixer.h:96

◆ MMixerGetAllUpOrDownstreamNodesFromNodeIndex()

MIXER_STATUS MMixerGetAllUpOrDownstreamNodesFromNodeIndex ( IN PMIXER_CONTEXT  MixerContext,
IN PTOPOLOGY  Topology,
IN ULONG  NodeIndex,
IN ULONG  bUpStream,
OUT PULONG  OutNodesCount,
OUT PULONG  OutNodes 
)

Definition at line 785 of file topology.c.

792 {
793  PTOPOLOGY_NODE TopologyNode;
794 
795  /* reset visited status */
797 
798  /* sanity check */
799  ASSERT(Topology->TopologyNodesCount > NodeIndex);
800 
801  /* get topology node */
802  TopologyNode = &Topology->TopologyNodes[NodeIndex];
803 
804  /* now visit all upstream pins & nodes */
805  MMixerGetUpOrDownstreamNodes(MixerContext, Topology, TopologyNode, bUpStream, OutNodesCount, OutNodes);
806 
807  /* done */
808  return MM_STATUS_SUCCESS;
809 
810 }
VOID MMixerResetTopologyVisitStatus(IN OUT PTOPOLOGY Topology)
Definition: topology.c:103
MIXER_CONTEXT MixerContext
Definition: mmixer.c:46
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
VOID MMixerGetUpOrDownstreamNodes(IN PMIXER_CONTEXT MixerContext, IN PTOPOLOGY Topology, IN PTOPOLOGY_NODE TopologyNode, IN ULONG bUpStream, OUT PULONG OutNodeCount, OUT PULONG OutNodes)
Definition: topology.c:737

Referenced by MMixerAddMixerSourceLines(), and MMixerGetAllUpOrDownstreamNodesFromPinIndex().

◆ MMixerGetAllUpOrDownstreamNodesFromPinIndex()

VOID MMixerGetAllUpOrDownstreamNodesFromPinIndex ( IN PMIXER_CONTEXT  MixerContext,
IN PTOPOLOGY  Topology,
IN ULONG  PinIndex,
IN ULONG  bUpStream,
OUT PULONG  OutNodesCount,
OUT PULONG  OutNodes 
)

Definition at line 878 of file topology.c.

885 {
886  ULONG Index, TopologyNodesCount;
887  PPIN Pin;
889 
890  /* mark them as empty */
891  *OutNodesCount = 0;
892 
893  /* get pin */
894  Pin = &Topology->TopologyPins[PinIndex];
895 
896  if (bUpStream)
897  {
898  /* use nodes to which a pin is attached to */
899  TopologyNodes = Pin->NodesConnectedFrom;
900  TopologyNodesCount = Pin->NodesConnectedFromCount;
901  }
902  else
903  {
904  /* use nodes which are attached to a node */
905  TopologyNodes = Pin->NodesConnectedTo;
906  TopologyNodesCount = Pin->NodesConnectedToCount;
907  }
908 
909 
910  /* reset visited status */
912 
913  /* sanity check */
914  ASSERT(Topology->TopologyPinsCount > PinIndex);
915 
916  /* now visit all up / down stream pins & nodes */
917  for(Index = 0; Index < TopologyNodesCount; Index++)
918  {
919  /* add node to array */
920  MMixerAddPinIndexToArray(MixerContext, TopologyNodes[Index]->NodeIndex, Topology->TopologyNodesCount, OutNodesCount, OutNodes);
921 
922  /* explore all connected nodes with helper */
923  MMixerGetAllUpOrDownstreamNodesFromNodeIndex(MixerContext, Topology, TopologyNodes[Index]->NodeIndex, bUpStream, OutNodesCount, OutNodes);
924  }
925 }
VOID MMixerResetTopologyVisitStatus(IN OUT PTOPOLOGY Topology)
Definition: topology.c:103
Definition: precomp.h:36
MIXER_CONTEXT MixerContext
Definition: mmixer.c:46
IN PDCB IN VBO IN ULONG IN BOOLEAN Pin
Definition: fatprocs.h:415
static const UCHAR Index[8]
Definition: usbohci.c:18
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
static PCNODE_DESCRIPTOR TopologyNodes[]
VOID MMixerAddPinIndexToArray(IN PMIXER_CONTEXT MixerContext, IN ULONG PinId, IN ULONG MaxPins, OUT PULONG OutPinCount, OUT PULONG OutPins)
Definition: topology.c:571
unsigned int ULONG
Definition: retypes.h:1
MIXER_STATUS MMixerGetAllUpOrDownstreamNodesFromNodeIndex(IN PMIXER_CONTEXT MixerContext, IN PTOPOLOGY Topology, IN ULONG NodeIndex, IN ULONG bUpStream, OUT PULONG OutNodesCount, OUT PULONG OutNodes)
Definition: topology.c:785

◆ MMixerGetAllUpOrDownstreamPinsFromNodeIndex()

VOID MMixerGetAllUpOrDownstreamPinsFromNodeIndex ( IN PMIXER_CONTEXT  MixerContext,
IN PTOPOLOGY  Topology,
IN ULONG  NodeIndex,
IN ULONG  bUpStream,
OUT PULONG  OutPinsCount,
OUT PULONG  OutPins 
)

Definition at line 713 of file topology.c.

720 {
721  PTOPOLOGY_NODE TopologyNode;
722 
723  /* reset visited status */
725 
726  /* sanity check */
727  ASSERT(Topology->TopologyNodesCount > NodeIndex);
728 
729  /* get topology node */
730  TopologyNode = &Topology->TopologyNodes[NodeIndex];
731 
732  /* now visit all upstream pins & nodes */
733  MMixerGetUpOrDownStreamPins(MixerContext, Topology, TopologyNode, bUpStream, OutPinsCount, OutPins);
734 }
VOID MMixerResetTopologyVisitStatus(IN OUT PTOPOLOGY Topology)
Definition: topology.c:103
MIXER_CONTEXT MixerContext
Definition: mmixer.c:46
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
VOID MMixerGetUpOrDownStreamPins(IN PMIXER_CONTEXT MixerContext, IN PTOPOLOGY Topology, IN PTOPOLOGY_NODE TopologyNode, IN ULONG bUpStream, OUT PULONG OutPinCount, OUT PULONG OutPins)
Definition: topology.c:614

Referenced by MMixerAddMixerSourceLines(), MMixerGetAllUpOrDownstreamPinsFromPinIndex(), MMixerInitializeFilter(), and MMixerIsNodeConnectedToPin().

◆ MMixerGetAllUpOrDownstreamPinsFromPinIndex()

MIXER_STATUS MMixerGetAllUpOrDownstreamPinsFromPinIndex ( IN PMIXER_CONTEXT  MixerContext,
IN PTOPOLOGY  Topology,
IN ULONG  PinIndex,
IN ULONG  bUpStream,
OUT PULONG  OutPinsCount,
OUT PULONG  OutPins 
)

Definition at line 813 of file topology.c.

820 {
821  ULONG Index, TopologyNodesCount, TopologyPinsCount;
822  PPIN Pin;
824  PULONG TopologyPins;
825 
826  /* get pin */
827  Pin = &Topology->TopologyPins[PinIndex];
828 
829  if (bUpStream)
830  {
831  /* use nodes to which this pin is attached to */
832  TopologyNodes = Pin->NodesConnectedFrom;
833  TopologyNodesCount = Pin->NodesConnectedFromCount;
834 
835  /* use pins to which this pin is attached to */
836  TopologyPins = Pin->PinConnectedFrom;
837  TopologyPinsCount = Pin->PinConnectedFromCount;
838 
839  }
840  else
841  {
842  /* use nodes which are attached to a pin */
843  TopologyNodes = Pin->NodesConnectedTo;
844  TopologyNodesCount = Pin->NodesConnectedToCount;
845 
846  /* use pins which are attached to this pin */
847  TopologyPins = Pin->PinConnectedTo;
848  TopologyPinsCount = Pin->PinConnectedToCount;
849  }
850 
851 
852  /* reset visited status */
854 
855  /* sanity check */
856  ASSERT(Topology->TopologyPinsCount > PinIndex);
857 
858  /* add pins which are directly connected to this pin */
859  for(Index = 0; Index < TopologyPinsCount; Index++)
860  {
861  /* add them to pin array */
862  MMixerAddPinIndexToArray(MixerContext, TopologyPins[Index], Topology->TopologyPinsCount, OutPinsCount, OutPins);
863  }
864 
865  /* now visit all up / down stream pins & nodes */
866  for(Index = 0; Index < TopologyNodesCount; Index++)
867  {
868  /* explore all connected pins with helper */
869  MMixerGetAllUpOrDownstreamPinsFromNodeIndex(MixerContext, Topology, TopologyNodes[Index]->NodeIndex, bUpStream, OutPinsCount, OutPins);
870  }
871 
872  /* done */
873  return MM_STATUS_SUCCESS;
874 
875 }
VOID MMixerResetTopologyVisitStatus(IN OUT PTOPOLOGY Topology)
Definition: topology.c:103
Definition: precomp.h:36
MIXER_CONTEXT MixerContext
Definition: mmixer.c:46
IN PDCB IN VBO IN ULONG IN BOOLEAN Pin
Definition: fatprocs.h:415
static const UCHAR Index[8]
Definition: usbohci.c:18
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
unsigned int * PULONG
Definition: retypes.h:1
static PCNODE_DESCRIPTOR TopologyNodes[]
VOID MMixerAddPinIndexToArray(IN PMIXER_CONTEXT MixerContext, IN ULONG PinId, IN ULONG MaxPins, OUT PULONG OutPinCount, OUT PULONG OutPins)
Definition: topology.c:571
unsigned int ULONG
Definition: retypes.h:1
VOID MMixerGetAllUpOrDownstreamPinsFromNodeIndex(IN PMIXER_CONTEXT MixerContext, IN PTOPOLOGY Topology, IN ULONG NodeIndex, IN ULONG bUpStream, OUT PULONG OutPinsCount, OUT PULONG OutPins)
Definition: topology.c:713

Referenced by MMixerHandlePhysicalConnection(), and MMixerHandleTopologyFilter().

◆ MMixerGetAudioPinDataRanges()

MIXER_STATUS MMixerGetAudioPinDataRanges ( IN PMIXER_CONTEXT  MixerContext,
IN HANDLE  hDevice,
IN ULONG  PinId,
IN OUT PKSMULTIPLE_ITEM OutMultipleItem 
)

Definition at line 142 of file wave.c.

147 {
148  KSP_PIN PinProperty;
149  ULONG BytesReturned = 0;
151  PKSMULTIPLE_ITEM MultipleItem;
152 
153  /* retrieve size of data ranges buffer */
154  PinProperty.Reserved = 0;
155  PinProperty.PinId = PinId;
156  PinProperty.Property.Set = KSPROPSETID_Pin;
157  PinProperty.Property.Id = KSPROPERTY_PIN_DATARANGES;
158  PinProperty.Property.Flags = KSPROPERTY_TYPE_GET;
159 
160  Status = MixerContext->Control(hDevice, IOCTL_KS_PROPERTY, (PVOID)&PinProperty, sizeof(KSP_PIN), (PVOID)NULL, 0, &BytesReturned);
162  {
163  return Status;
164  }
165 
166  MultipleItem = MixerContext->Alloc(BytesReturned);
167  if (!MultipleItem)
168  {
169  /* not enough memory */
170  return MM_STATUS_NO_MEMORY;
171  }
172 
173  Status = MixerContext->Control(hDevice, IOCTL_KS_PROPERTY, (PVOID)&PinProperty, sizeof(KSP_PIN), (PVOID)MultipleItem, BytesReturned, &BytesReturned);
174  if (Status != MM_STATUS_SUCCESS)
175  {
176  /* failed */
177  MixerContext->Free(MultipleItem);
178  return Status;
179  }
180 
181  /* save result */
182  *OutMultipleItem = MultipleItem;
183  return Status;
184 }
#define IOCTL_KS_PROPERTY
Definition: ks.h:150
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
GUID Set
Definition: dmksctrl.h:76
MIXER_CONTEXT MixerContext
Definition: mmixer.c:46
PMIXER_DEVICE_CONTROL Control
Definition: mmixer.h:95
KSPROPERTY Property
Definition: ks.h:673
smooth NULL
Definition: ftsmooth.c:416
ULONG PinId
Definition: ks.h:674
Definition: ks.h:672
PMIXER_FREE Free
Definition: mmixer.h:96
ULONG Id
Definition: dmksctrl.h:77
ULONG Flags
Definition: dmksctrl.h:78
ULONG Reserved
Definition: ks.h:675
PMIXER_ALLOC Alloc
Definition: mmixer.h:94
Status
Definition: gdiplustypes.h:24
MIXER_STATUS
Definition: mmixer.h:3
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
#define KSPROPSETID_Pin
Definition: ks.h:647
unsigned int ULONG
Definition: retypes.h:1

Referenced by MMixerInitializeMidiForFilter(), and MMixerInitializeWaveInfo().

◆ MMixerGetConnectedFromLogicalTopologyPins()

VOID MMixerGetConnectedFromLogicalTopologyPins ( IN PTOPOLOGY  Topology,
IN ULONG  NodeIndex,
OUT PULONG  OutPinCount,
OUT PULONG  OutPins 
)

Definition at line 1165 of file topology.c.

1170 {
1171  ULONG Index;
1173 
1174  /* sanity check */
1175  ASSERT(NodeIndex < Topology->TopologyNodesCount);
1176 
1177  /* get node */
1178  Node = &Topology->TopologyNodes[NodeIndex];
1179 
1180  for(Index = 0; Index < Node->NodeConnectedFromCount; Index++)
1181  {
1182  /* copy logical pin id */
1183  OutPins[Index] = Node->LogicalPinNodeConnectedFrom[Index];
1184  }
1185 
1186  /* store pin count */
1187  *OutPinCount = Node->NodeConnectedFromCount;
1188 }
union node Node
Definition: types.h:1255
static const UCHAR Index[8]
Definition: usbohci.c:18
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
unsigned int ULONG
Definition: retypes.h:1
Definition: dlist.c:348

Referenced by MMixerSetGetMuxControlDetails().

◆ MMixerGetConnectionByIndex()

PKSTOPOLOGY_CONNECTION MMixerGetConnectionByIndex ( IN PKSMULTIPLE_ITEM  MultipleItem,
IN ULONG  Index 
)

◆ 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 }
#define MIXERCONTROL_CONTROLTYPE_MUX
Definition: mmsystem.h:403
const GUID KSNODETYPE_TONE
Definition: sup.c:20
const GUID KSNODETYPE_PEAKMETER
Definition: sup.c:22
const GUID KSNODETYPE_MUTE
Definition: sup.c:19
const GUID KSNODETYPE_VOLUME
Definition: sup.c:21
const GUID KSNODETYPE_MUX
Definition: sup.c:23
#define IsEqualGUIDAligned(guid1, guid2)
Definition: wdm.template.h:233
const GUID KSNODETYPE_LOUDNESS
Definition: sup.c:18
const GUID KSNODETYPE_SUPERMIX
Definition: sup.c:27
const GUID KSNODETYPE_STEREO_WIDE
Definition: sup.c:24
NodeType
Definition: Node.h:5
#define MIXERCONTROL_CONTROLTYPE_LOUDNESS
Definition: mmsystem.h:386
const GUID KSNODETYPE_AGC
Definition: sup.c:17
const GUID KSNODETYPE_REVERB
Definition: sup.c:26
#define MIXERCONTROL_CONTROLTYPE_VOLUME
Definition: mmsystem.h:398
#define MIXERCONTROL_CONTROLTYPE_FADER
Definition: mmsystem.h:397
#define MIXERCONTROL_CONTROLTYPE_MUTE
Definition: mmsystem.h:384
const GUID KSNODETYPE_CHORUS
Definition: sup.c:25
#define MIXERCONTROL_CONTROLTYPE_ONOFF
Definition: mmsystem.h:383
#define UNIMPLEMENTED
Definition: debug.h:114
#define MIXERCONTROL_CONTROLTYPE_PEAKMETER
Definition: mmsystem.h:380

Referenced by MMixerAddMixerControl().

◆ MMixerGetDataByDeviceId()

LPMIXER_DATA MMixerGetDataByDeviceId ( IN PMIXER_LIST  MixerList,
IN ULONG  DeviceId 
)

Definition at line 736 of file sup.c.

739 {
741  LPMIXER_DATA MixerData;
742 
743  Entry = MixerList->MixerData.Flink;
744  while(Entry != &MixerList->MixerData)
745  {
747  if (MixerData->DeviceId == DeviceId)
748  {
749  return MixerData;
750  }
751  Entry = Entry->Flink;
752  }
753  return NULL;
754 }
struct _Entry Entry
Definition: kefuncs.h:640
struct MIXER_DATA * LPMIXER_DATA
smooth NULL
Definition: ftsmooth.c:416
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
ULONG DeviceId
Definition: precomp.h:114
Definition: typedefs.h:117
base of all file and directory entries
Definition: entries.h:82

Referenced by MMixerGetMidiDevicePath(), MMixerGetWaveDevicePath(), MMixerOpenMidiPin(), and MMixerOpenWavePin().

◆ MMixerGetDataByDeviceName()

LPMIXER_DATA MMixerGetDataByDeviceName ( IN PMIXER_LIST  MixerList,
IN LPWSTR  DeviceName 
)

Definition at line 757 of file sup.c.

760 {
762  LPMIXER_DATA MixerData;
763 
764  Entry = MixerList->MixerData.Flink;
765  while(Entry != &MixerList->MixerData)
766  {
768  if (wcsicmp(&DeviceName[2], &MixerData->DeviceName[2]) == 0)
769  {
770  /* found entry */
771  return MixerData;
772  }
773  Entry = Entry->Flink;
774  }
775  return NULL;
776 }
struct _Entry Entry
Definition: kefuncs.h:640
LPWSTR DeviceName
Definition: precomp.h:117
WCHAR DeviceName[]
Definition: adapter.cpp:21
struct MIXER_DATA * LPMIXER_DATA
smooth NULL
Definition: ftsmooth.c:416
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
Definition: typedefs.h:117
#define wcsicmp
Definition: string.h:1152
base of all file and directory entries
Definition: entries.h:82

Referenced by MMixerHandlePhysicalConnection().

◆ MMixerGetDeviceName()

MIXER_STATUS MMixerGetDeviceName ( IN PMIXER_CONTEXT  MixerContext,
OUT LPWSTR  DeviceName,
IN HANDLE  hKey 
)

Definition at line 852 of file sup.c.

856 {
857  LPWSTR Name;
858  HANDLE hTemp;
859  ULONG Length;
860  ULONG Type;
862 
863  Status = MixerContext->QueryKeyValue(hKey, L"FriendlyName", (PVOID*)&Name, &Length, &Type);
864  if (Status == MM_STATUS_SUCCESS)
865  {
866  /* copy device name */
868 
869  /* make sure its null terminated */
870  DeviceName[MAXPNAMELEN-1] = L'\0';
871 
872  /* free device name */
874 
875  /* done */
876  return Status;
877  }
878 
879  Status = MixerContext->OpenKey(hKey, L"Device Parameters", KEY_READ, &hTemp);
880  if (Status != MM_STATUS_SUCCESS)
881  return Status;
882 
883  Status = MixerContext->QueryKeyValue(hTemp, L"FriendlyName", (PVOID*)&Name, &Length, &Type);
884  if (Status == MM_STATUS_SUCCESS)
885  {
886  /* copy device name */
888 
889  /* make sure its null terminated */
890  DeviceName[MAXPNAMELEN-1] = L'\0';
891 
892  /* free device name */
894  }
895 
896  MixerContext->CloseKey(hTemp);
897  return Status;
898 }
Type
Definition: Type.h:6
#define KEY_READ
Definition: nt_native.h:1023
PMIXER_OPEN_KEY OpenKey
Definition: mmixer.h:100
WCHAR DeviceName[]
Definition: adapter.cpp:21
MIXER_CONTEXT MixerContext
Definition: mmixer.c:46
struct NameRec_ * Name
Definition: cdprocs.h:464
PMIXER_FREE Free
Definition: mmixer.h:96
PMIXER_QUERY_KEY_VALUE QueryKeyValue
Definition: mmixer.h:101
__wchar_t WCHAR
Definition: xmlstorage.h:180
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
static const WCHAR L[]
Definition: oid.c:1250
Status
Definition: gdiplustypes.h:24
MIXER_STATUS
Definition: mmixer.h:3
#define min(a, b)
Definition: monoChain.cc:55
PMIXER_CLOSEKEY CloseKey
Definition: mmixer.h:102
#define MAXPNAMELEN
Definition: mmsystem.h:24
unsigned int ULONG
Definition: retypes.h:1
WCHAR * LPWSTR
Definition: xmlstorage.h:184
PMIXER_COPY Copy
Definition: mmixer.h:99
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)

Referenced by MMixerInitializeFilter(), and MMixerInitializeMidiForFilter().

◆ MMixerGetDeviceNameWithComponentId()

MIXER_STATUS MMixerGetDeviceNameWithComponentId ( IN PMIXER_CONTEXT  MixerContext,
IN HANDLE  hMixer,
OUT LPWSTR  DeviceName 
)

Definition at line 805 of file sup.c.

809 {
813  ULONG Length;
815  ULONG ResultLength, KeyType;
816  HANDLE hMediaKey, hGuidKey;
818 
819  /* prepare property */
823 
824  /* try get component id */
826 
827  if (Status == MM_STATUS_SUCCESS)
828  {
829  Status = MixerContext->OpenKey(NULL, L"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Control\\MediaCategories", KEY_READ, &hMediaKey);
830  if (Status == MM_STATUS_SUCCESS)
831  {
833  Status = MixerContext->OpenKey(hMediaKey, GuidString.Buffer, KEY_READ, &hGuidKey);
835  if (Status == MM_STATUS_SUCCESS)
836  {
837  Status = MixerContext->QueryKeyValue(hGuidKey, L"Name", (PVOID*)&DeviceName, &ResultLength, &KeyType);
838  if (Status == MM_STATUS_SUCCESS)
839  {
840  MixerContext->Copy(OutDeviceName, DeviceName, min(ResultLength, (MAXPNAMELEN-1)*2));
841  }
842 
843  MixerContext->CloseKey(hGuidKey);
844  }
845  MixerContext->CloseKey(hMediaKey);
846  }
847  }
848  return Status;
849 }
IN CINT OUT PVOID IN ULONG OUT PULONG ResultLength
Definition: conport.c:47
static PWSTR GuidString
Definition: apphelp.c:91
#define IOCTL_KS_PROPERTY
Definition: ks.h:150
#define KEY_READ
Definition: nt_native.h:1023
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char UINT32 ACPI_STATUS const char UINT32 const char const char UINT32 ComponentId
Definition: acpixf.h:1252
PMIXER_OPEN_KEY OpenKey
Definition: mmixer.h:100
WCHAR DeviceName[]
Definition: adapter.cpp:21
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
MIXER_CONTEXT MixerContext
Definition: mmixer.c:46
PMIXER_DEVICE_CONTROL Control
Definition: mmixer.h:95
HMIXER hMixer
Definition: test.c:10
smooth NULL
Definition: ftsmooth.c:416
PMIXER_QUERY_KEY_VALUE QueryKeyValue
Definition: mmixer.h:101
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
static const WCHAR L[]
Definition: oid.c:1250
NTSYSAPI NTSTATUS WINAPI RtlStringFromGUID(REFGUID, PUNICODE_STRING)
Status
Definition: gdiplustypes.h:24
_In_ DWORD Property
Definition: setupapi.h:1545
MIXER_STATUS
Definition: mmixer.h:3
#define min(a, b)
Definition: monoChain.cc:55
const GUID KSPROPSETID_General
Definition: sup.c:31
PMIXER_CLOSEKEY CloseKey
Definition: mmixer.h:102
#define MAXPNAMELEN
Definition: mmsystem.h:24
unsigned int ULONG
Definition: retypes.h:1
WCHAR * LPWSTR
Definition: xmlstorage.h:184
PMIXER_COPY Copy
Definition: mmixer.h:99

Referenced by MMixerInitializeFilter().

◆ 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 }
#define IOCTL_KS_PROPERTY
Definition: ks.h:150
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
MIXER_CONTEXT MixerContext
Definition: mmixer.c:46
PMIXER_DEVICE_CONTROL Control
Definition: mmixer.h:95
HMIXER hMixer
Definition: test.c:10
const GUID KSPROPSETID_Pin
Definition: filter.c:47
IN PDCB IN VBO IN ULONG IN BOOLEAN Pin
Definition: fatprocs.h:415
ULONG Flags
Definition: ntfs.h:520
Status
Definition: gdiplustypes.h:24
MIXER_STATUS
Definition: mmixer.h:3
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
unsigned int * PULONG
Definition: retypes.h:1
unsigned int ULONG
Definition: retypes.h:1

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 */
51  Property.Id = PropertyId;
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 */
70  return MM_STATUS_NO_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 }
#define IOCTL_KS_PROPERTY
Definition: ks.h:150
_In_ PSTORAGE_PROPERTY_ID PropertyId
Definition: classpnp.h:966
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
MIXER_CONTEXT MixerContext
Definition: mmixer.c:46
PMIXER_DEVICE_CONTROL Control
Definition: mmixer.h:95
HMIXER hMixer
Definition: test.c:10
smooth NULL
Definition: ftsmooth.c:416
PMIXER_FREE Free
Definition: mmixer.h:96
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
struct KSMULTIPLE_ITEM * PKSMULTIPLE_ITEM
PMIXER_ALLOC Alloc
Definition: mmixer.h:94
const GUID KSPROPSETID_Topology
Definition: filter.c:46
Status
Definition: gdiplustypes.h:24
_In_ DWORD Property
Definition: setupapi.h:1545
MIXER_STATUS
Definition: mmixer.h:3
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
unsigned int ULONG
Definition: retypes.h:1

Referenced by MMixerBuildTopology().

◆ MMixerGetMixerByName()

MIXER_STATUS MMixerGetMixerByName ( IN PMIXER_LIST  MixerList,
IN LPWSTR  MixerName,
OUT LPMIXER_INFO MixerInfo 
)

Definition at line 194 of file sup.c.

198 {
199  LPMIXER_INFO MixerInfo;
201 
202  Entry = MixerList->MixerList.Flink;
203  while(Entry != &MixerList->MixerList)
204  {
206 
207  DPRINT1("MixerName %S MixerName %S\n", MixerInfo->MixCaps.szPname, MixerName);
208  if (wcsicmp(MixerInfo->MixCaps.szPname, MixerName) == 0)
209  {
210  *OutMixerInfo = MixerInfo;
211  return MM_STATUS_SUCCESS;
212  }
213  /* move to next mixer entry */
214  Entry = Entry->Flink;
215  }
216 
217  return MM_STATUS_UNSUCCESSFUL;
218 }
struct _Entry Entry
Definition: kefuncs.h:640
MIXERCAPSW MixCaps
Definition: precomp.h:70
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
Definition: typedefs.h:117
#define wcsicmp
Definition: string.h:1152
#define DPRINT1
Definition: precomp.h:8
struct MIXER_INFO * LPMIXER_INFO
WCHAR szPname[MAXPNAMELEN]
Definition: mmsystem.h:1226
base of all file and directory entries
Definition: entries.h:82

◆ MMixerGetMixerControlById()

MIXER_STATUS MMixerGetMixerControlById ( LPMIXER_INFO  MixerInfo,
DWORD  dwControlID,
LPMIXERLINE_EXT MixerLine,
LPMIXERCONTROL_EXT MixerControl,
PULONG  NodeId 
)

Definition at line 281 of file sup.c.

287 {
288  PLIST_ENTRY Entry, ControlEntry;
289  LPMIXERLINE_EXT MixerLineSrc;
290  LPMIXERCONTROL_EXT MixerControl;
291 
292  /* get first entry */
293  Entry = MixerInfo->LineList.Flink;
294 
295  while(Entry != &MixerInfo->LineList)
296  {
298 
299  ControlEntry = MixerLineSrc->ControlsList.Flink;
300  while(ControlEntry != &MixerLineSrc->ControlsList)
301  {
302  MixerControl = (LPMIXERCONTROL_EXT)CONTAINING_RECORD(ControlEntry, MIXERCONTROL_EXT, Entry);
303  if (MixerControl->Control.dwControlID == dwControlID)
304  {
305  if (OutMixerLine)
306  *OutMixerLine = MixerLineSrc;
307  if (OutMixerControl)
308  *OutMixerControl = MixerControl;
309  if (NodeId)
310  *NodeId = MixerControl->NodeID;
311  return MM_STATUS_SUCCESS;
312  }
313  ControlEntry = ControlEntry->Flink;
314  }
315  Entry = Entry->Flink;
316  }
317 
318  return MM_STATUS_UNSUCCESSFUL;
319 }
MIXERCONTROLW Control
Definition: precomp.h:79
struct _Entry Entry
Definition: kefuncs.h:640
LIST_ENTRY LineList
Definition: precomp.h:71
struct MIXERCONTROL_EXT * LPMIXERCONTROL_EXT
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
ULONG NodeID
Definition: precomp.h:80
Definition: typedefs.h:117
LIST_ENTRY ControlsList
Definition: precomp.h:90
base of all file and directory entries
Definition: entries.h:82
struct MIXERLINE_EXT * LPMIXERLINE_EXT

Referenced by MMixerGetControlDetails(), MMixerGetLineControls(), and MMixerSetControlDetails().

◆ MMixerGetMixerInfoByIndex()

LPMIXER_INFO MMixerGetMixerInfoByIndex ( IN PMIXER_CONTEXT  MixerContext,
IN ULONG  MixerIndex 
)

Definition at line 161 of file sup.c.

164 {
165  LPMIXER_INFO MixerInfo;
167  PMIXER_LIST MixerList;
168  ULONG Index = 0;
169 
170  /* get mixer list */
171  MixerList = (PMIXER_LIST)MixerContext->MixerContext;
172 
173  if (!MixerList->MixerListCount)
174  return NULL;
175 
176  Entry = MixerList->MixerList.Flink;
177 
178  while(Entry != &MixerList->MixerList)
179  {
181 
182  if (Index == MixerIndex)
183  return MixerInfo;
184 
185  /* move to next mixer entry */
186  Index++;
187  Entry = Entry->Flink;
188  }
189 
190  return NULL;
191 }
struct _Entry Entry
Definition: kefuncs.h:640
LIST_ENTRY MixerList
Definition: precomp.h:150
MIXER_CONTEXT MixerContext
Definition: mmixer.c:46
smooth NULL
Definition: ftsmooth.c:416
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
if(!(yy_init))
Definition: macro.lex.yy.c:714
static const UCHAR Index[8]
Definition: usbohci.c:18
Definition: typedefs.h:117
PVOID MixerContext
Definition: mmixer.h:92
struct MIXER_LIST * PMIXER_LIST
struct MIXER_INFO * LPMIXER_INFO
unsigned int ULONG
Definition: retypes.h:1
base of all file and directory entries
Definition: entries.h:82
ULONG MixerListCount
Definition: precomp.h:149

Referenced by MMixerClose(), MMixerGetCapabilities(), MMixerGetControlDetails(), MMixerGetLineControls(), MMixerGetLineInfo(), MMixerOpen(), MMixerPrintMixers(), and MMixerSetControlDetails().

◆ MMixerGetNextNodesFromNodeIndex()

VOID MMixerGetNextNodesFromNodeIndex ( IN PMIXER_CONTEXT  MixerContext,
IN PTOPOLOGY  Topology,
IN ULONG  NodeIndex,
IN ULONG  bUpStream,
OUT PULONG  OutNodesCount,
OUT PULONG  OutNodes 
)

Definition at line 972 of file topology.c.

979 {
981  ULONG TopologyNodesCount;
982  ULONG Index;
983 
984  /* sanity check */
985  ASSERT(NodeIndex < Topology->TopologyNodesCount);
986 
987  if (bUpStream)
988  {
989  /* get up stream nodes */
990  TopologyNodes = Topology->TopologyNodes[NodeIndex].NodeConnectedFrom;
991  TopologyNodesCount = Topology->TopologyNodes[NodeIndex].NodeConnectedFromCount;
992  }
993  else
994  {
995  /* get down stream nodes */
996  TopologyNodes = Topology->TopologyNodes[NodeIndex].NodeConnectedTo;
997  TopologyNodesCount = Topology->TopologyNodes[NodeIndex].NodeConnectedToCount;
998  }
999 
1000  /* store topology nodes ids */
1001  for(Index = 0; Index < TopologyNodesCount; Index++)
1002  {
1003  OutNodes[Index] = TopologyNodes[Index]->NodeIndex;
1004  }
1005 
1006  /* store topology nodes count */
1007  *OutNodesCount = TopologyNodesCount;
1008 }
static const UCHAR Index[8]
Definition: usbohci.c:18
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
static PCNODE_DESCRIPTOR TopologyNodes[]
unsigned int ULONG
Definition: retypes.h:1

Referenced by MMixerAddMixerControl(), MMixerCountMixerControls(), and MMixerSetGetMuxControlDetails().

◆ MMixerGetNextNodesFromPinIndex()

VOID MMixerGetNextNodesFromPinIndex ( IN PMIXER_CONTEXT  MixerContext,
IN PTOPOLOGY  Topology,
IN ULONG  PinIndex,
IN ULONG  bUpStream,
OUT PULONG  OutNodesCount,
OUT PULONG  OutNodes 
)

Definition at line 929 of file topology.c.

936 {
937  PPIN Pin;
939  ULONG TopologyNodesCount;
940  ULONG Index;
941 
942  /* sanity check */
943  ASSERT(PinIndex < Topology->TopologyPinsCount);
944 
945  /* get pin */
946  Pin = &Topology->TopologyPins[PinIndex];
947 
948  if (bUpStream)
949  {
950  /* get up stream nodes */
951  TopologyNodes = Pin->NodesConnectedFrom;
952  TopologyNodesCount = Pin->NodesConnectedFromCount;
953  }
954  else
955  {
956  /* get down stream nodes */
957  TopologyNodes = Pin->NodesConnectedTo;
958  TopologyNodesCount = Pin->NodesConnectedToCount;
959  }
960 
961  /* store topology nodes ids */
962  for(Index = 0; Index < TopologyNodesCount; Index++)
963  {
964  OutNodes[Index] = TopologyNodes[Index]->NodeIndex;
965  }
966 
967  /* store topology nodes count */
968  *OutNodesCount = TopologyNodesCount;
969 }
Definition: precomp.h:36
IN PDCB IN VBO IN ULONG IN BOOLEAN Pin
Definition: fatprocs.h:415
static const UCHAR Index[8]
Definition: usbohci.c:18
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
static PCNODE_DESCRIPTOR TopologyNodes[]
unsigned int ULONG
Definition: retypes.h:1

Referenced by MMixerCountMixerControls().

◆ MMixerGetNodeIndexes()

MIXER_STATUS MMixerGetNodeIndexes ( IN PMIXER_CONTEXT  MixerContext,
IN PKSMULTIPLE_ITEM  MultipleItem,
IN ULONG  NodeIndex,
IN ULONG  bNode,
IN ULONG  bFrom,
OUT PULONG  NodeReferenceCount,
OUT PULONG NodeReference 
)

◆ MMixerGetNodeIndexFromGuid()

ULONG MMixerGetNodeIndexFromGuid ( IN PTOPOLOGY  Topology,
IN const GUID NodeType 
)

Definition at line 694 of file topology.c.

697 {
698  ULONG Index;
699 
700  for(Index = 0; Index < Topology->TopologyNodesCount; Index++)
701  {
702  if (IsEqualGUIDAligned(NodeType, &Topology->TopologyNodes[Index].NodeType))
703  {
704  return Index;
705  }
706  }
707 
708  return MAXULONG;
709 }
#define IsEqualGUIDAligned(guid1, guid2)
Definition: wdm.template.h:233
NodeType
Definition: Node.h:5
static const UCHAR Index[8]
Definition: usbohci.c:18
#define MAXULONG
Definition: typedefs.h:250
unsigned int ULONG
Definition: retypes.h:1

Referenced by MMixerSetupFilter().

◆ MMixerGetNodeType()

LPGUID MMixerGetNodeType ( IN PKSMULTIPLE_ITEM  MultipleItem,
IN ULONG  Index 
)

Definition at line 245 of file sup.c.

248 {
250 
251  ASSERT(Index < MultipleItem->Count);
252 
253  NodeType = (LPGUID)(MultipleItem + 1);
254  return &NodeType[Index];
255 }
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
NodeType
Definition: Node.h:5
static const UCHAR Index[8]
Definition: usbohci.c:18
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
GUID * LPGUID
Definition: guiddef.h:76

◆ MMixerGetNodeTypeFromTopology()

LPGUID MMixerGetNodeTypeFromTopology ( IN PTOPOLOGY  Topology,
IN ULONG  NodeIndex 
)

Definition at line 1191 of file topology.c.

1194 {
1195  /* sanity check */
1196  ASSERT(NodeIndex < Topology->TopologyNodesCount);
1197 
1198  return &Topology->TopologyNodes[NodeIndex].NodeType;
1199 }
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)

Referenced by MMixerAddMixerControl(), and MMixerAddMixerControlsToMixerLineByNodeIndexArray().

◆ 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 {
97  KSP_PIN Pin;
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 */
126  if (Status != MM_STATUS_SUCCESS)
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 }
#define IOCTL_KS_PROPERTY
Definition: ks.h:150
struct KSPIN_PHYSICALCONNECTION * PKSPIN_PHYSICALCONNECTION
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
MIXER_CONTEXT MixerContext
Definition: mmixer.c:46
PMIXER_DEVICE_CONTROL Control
Definition: mmixer.h:95
HMIXER hMixer
Definition: test.c:10
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
const GUID KSPROPSETID_Pin
Definition: filter.c:47
Definition: ks.h:672
PMIXER_FREE Free
Definition: mmixer.h:96
IN PDCB IN VBO IN ULONG IN BOOLEAN Pin
Definition: fatprocs.h:415
ULONG Flags
Definition: ntfs.h:520
PMIXER_ALLOC Alloc
Definition: mmixer.h:94
Status
Definition: gdiplustypes.h:24
MIXER_STATUS
Definition: mmixer.h:3
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
unsigned int ULONG
Definition: retypes.h:1

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

◆ MMixerGetPinDataFlowAndCommunication()

MIXER_STATUS MMixerGetPinDataFlowAndCommunication ( IN PMIXER_CONTEXT  MixerContext,
IN HANDLE  hDevice,
IN ULONG  PinId,
OUT PKSPIN_DATAFLOW  DataFlow,
OUT PKSPIN_COMMUNICATION  Communication 
)

Definition at line 15 of file midi.c.

21 {
22  KSP_PIN Pin;
25 
26  /* setup request */
27  Pin.PinId = PinId;
28  Pin.Reserved = 0;
29  Pin.Property.Flags = KSPROPERTY_TYPE_GET;
30  Pin.Property.Id = KSPROPERTY_PIN_DATAFLOW;
31  Pin.Property.Set = KSPROPSETID_Pin;
32 
33  /* get pin dataflow */
36  {
37  /* failed to retrieve dataflow */
38  return Status;
39  }
40 
41  /* setup communication request */
42  Pin.Property.Id = KSPROPERTY_PIN_COMMUNICATION;
43 
44  /* get pin communication */
45  Status = MixerContext->Control(hDevice, IOCTL_KS_PROPERTY, (PVOID)&Pin, sizeof(KSP_PIN), (PVOID)Communication, sizeof(KSPIN_COMMUNICATION), &BytesReturned);
46 
47  return Status;
48 }
#define IOCTL_KS_PROPERTY
Definition: ks.h:150
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
MIXER_CONTEXT MixerContext
Definition: mmixer.c:46
PMIXER_DEVICE_CONTROL Control
Definition: mmixer.h:95
KSPIN_DATAFLOW
Definition: ks.h:1278
Definition: ks.h:672
IN PDCB IN VBO IN ULONG IN BOOLEAN Pin
Definition: fatprocs.h:415
ULONG Flags
Definition: ntfs.h:520
Status
Definition: gdiplustypes.h:24
KSPIN_COMMUNICATION
Definition: ks.h:1283
MIXER_STATUS
Definition: mmixer.h:3
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
#define KSPROPSETID_Pin
Definition: ks.h:647
unsigned int ULONG
Definition: retypes.h:1
DataFlow

Referenced by MMixerCheckFilterPinMidiSupport(), and MMixerGetComponentAndTargetType().

◆ MMixerGetSourceMixerLineByComponentType()

LPMIXERLINE_EXT MMixerGetSourceMixerLineByComponentType ( LPMIXER_INFO  MixerInfo,
DWORD  dwComponentType 
)

Definition at line 258 of file sup.c.

261 {
263  LPMIXERLINE_EXT MixerLineSrc;
264 
265  /* get first entry */
266  Entry = MixerInfo->LineList.Flink;
267 
268  while(Entry != &MixerInfo->LineList)
269  {
271  if (MixerLineSrc->Line.dwComponentType == dwComponentType)
272  return MixerLineSrc;
273 
274  Entry = Entry->Flink;
275  }
276 
277  return NULL;
278 }
MIXERLINEW Line
Definition: precomp.h:89
struct _Entry Entry
Definition: kefuncs.h:640
LIST_ENTRY LineList
Definition: precomp.h:71
DWORD dwComponentType
Definition: mmsystem.h:1261
smooth NULL
Definition: ftsmooth.c:416
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
Definition: typedefs.h:117
base of all file and directory entries
Definition: entries.h:82
struct MIXERLINE_EXT * LPMIXERLINE_EXT

Referenced by MMixerGetLineInfo().

◆ MMixerGetSourceMixerLineByLineId()

LPMIXERLINE_EXT MMixerGetSourceMixerLineByLineId ( LPMIXER_INFO  MixerInfo,
DWORD  dwLineID 
)

Definition at line 221 of file sup.c.

224 {
226  LPMIXERLINE_EXT MixerLineSrc;
227 
228  /* get first entry */
229  Entry = MixerInfo->LineList.Flink;
230 
231  while(Entry != &MixerInfo->LineList)
232  {
234  DPRINT("dwLineID %x dwLineID %x MixerLineSrc %p\n", MixerLineSrc->Line.dwLineID, dwLineID, MixerLineSrc);
235  if (MixerLineSrc->Line.dwLineID == dwLineID)
236  return MixerLineSrc;
237 
238  Entry = Entry->Flink;
239  }
240 
241  return NULL;
242 }
MIXERLINEW Line
Definition: precomp.h:89
struct _Entry Entry
Definition: kefuncs.h:640
LIST_ENTRY LineList
Definition: precomp.h:71
DWORD dwLineID
Definition: mmsystem.h:1258
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
Definition: typedefs.h:117
base of all file and directory entries
Definition: entries.h:82
struct MIXERLINE_EXT * LPMIXERLINE_EXT

Referenced by MMixerAddMixerControlsToDestinationLine(), MMixerAddMixerSourceLines(), MMixerBuildMixerSourceLine(), MMixerGetLineControls(), MMixerGetLineInfo(), MMixerHandleAlternativeMixers(), and MMixerPrintMixers().

◆ MMixerGetTopologyPinCount()

VOID MMixerGetTopologyPinCount ( IN PTOPOLOGY  Topology,
OUT PULONG  PinCount 
)

Definition at line 1011 of file topology.c.

1014 {
1015  /* store pin count */
1016  *PinCount = Topology->TopologyPinsCount;
1017 }
_In_ const GUID _In_ ULONG PinCount
Definition: strmini.h:504

Referenced by MMixerHandleAlternativeMixers(), and MMixerInitializeMidiForFilter().

◆ MMixerHandleAlternativeMixers()

VOID MMixerHandleAlternativeMixers ( IN PMIXER_CONTEXT  MixerContext,
IN PMIXER_LIST  MixerList,
IN LPMIXER_DATA  MixerData,
IN PTOPOLOGY  Topology 
)

Definition at line 1678 of file controls.c.

1683 {
1686  ULONG DestinationLineID, LineTerminator;
1687  LPMIXERLINE_EXT DstLine;
1688 
1689  DPRINT("DeviceName %S\n", MixerData->DeviceName);
1690 
1691  /* get topology pin count */
1692  MMixerGetTopologyPinCount(Topology, &PinCount);
1693 
1694  for(Index = 0; Index < PinCount; Index++)
1695  {
1697 
1698  /* check if it has already been reserved */
1699  if (Reserved)
1700  {
1701  /* pin has already been reserved */
1702  continue;
1703  }
1704 
1705  DPRINT("MixerName %S Available PinID %lu\n", MixerData->DeviceName, Index);
1706 
1707  /* sanity check */
1708  //ASSERT(MixerData->MixerInfo);
1709 
1710  if (!MixerData->MixerInfo)
1711  {
1712  DPRINT1("Expected mixer info\n");
1713  continue;
1714  }
1715 
1716  /* build the destination line */
1717  Status = MMixerBuildMixerDestinationLine(MixerContext, MixerData->MixerInfo, MixerData->hDevice, Index, TRUE);
1718  if (Status != MM_STATUS_SUCCESS)
1719  {
1720  /* failed to build destination line */
1721  continue;
1722  }
1723 
1724  /* calculate destination line id */
1725  DestinationLineID = (DESTINATION_LINE + MixerData->MixerInfo->MixCaps.cDestinations-1);
1726 
1727  /* add mixer controls to destination line */
1728  Status = MMixerAddMixerControlsToDestinationLine(MixerContext, MixerData->MixerInfo, MixerData->hDevice, MixerData->Topology, Index, TRUE, DestinationLineID, &LineTerminator);
1729  if (Status == MM_STATUS_SUCCESS)
1730  {
1731  /* now add the rest of the source lines */
1732  Status = MMixerAddMixerSourceLines(MixerContext, MixerData->MixerInfo, MixerData->hDevice, MixerData->Topology, DestinationLineID, LineTerminator);
1733  }
1734 
1735  /* mark pin as consumed */
1737 
1738  /* now grab destination line */
1739  DstLine = MMixerGetSourceMixerLineByLineId(MixerData->MixerInfo, DestinationLineID);
1740 
1741  /* set type and target as undefined */
1743  DstLine->Line.Target.dwType = MIXERLINE_TARGETTYPE_UNDEFINED;
1744  DstLine->Line.Target.vDriverVersion = 0;
1745  DstLine->Line.Target.wMid = 0;
1746  DstLine->Line.Target.wPid = 0;
1747  }
1748 }
#define TRUE
Definition: types.h:120
MIXERLINEW Line
Definition: precomp.h:89
MIXER_STATUS MMixerAddMixerControlsToDestinationLine(IN PMIXER_CONTEXT MixerContext, IN OUT LPMIXER_INFO MixerInfo, IN HANDLE hMixer, IN PTOPOLOGY Topology, IN ULONG PinId, IN ULONG bInput, IN ULONG DestinationLineId, OUT PULONG OutLineTerminator)
Definition: controls.c:1168
_In_ const GUID _In_ ULONG PinCount
Definition: strmini.h:504
struct tagMIXERLINEW::@2912 Target
MIXER_STATUS MMixerAddMixerSourceLines(IN PMIXER_CONTEXT MixerContext, IN OUT LPMIXER_INFO MixerInfo, IN HANDLE hMixer, IN PTOPOLOGY Topology, IN ULONG DestinationLineID, IN ULONG LineTerminator)
Definition: controls.c:1034
MIXER_CONTEXT MixerContext
Definition: mmixer.c:46
VOID MMixerGetTopologyPinCount(IN PTOPOLOGY Topology, OUT PULONG PinCount)
Definition: topology.c:1011
DWORD dwComponentType
Definition: mmsystem.h:1261
LPMIXERLINE_EXT MMixerGetSourceMixerLineByLineId(LPMIXER_INFO MixerInfo, DWORD dwLineID)
Definition: sup.c:221
VOID MMixerSetTopologyPinReserved(IN PTOPOLOGY Topology, IN ULONG PinId)
Definition: topology.c:1202
void DPRINT(...)
Definition: polytest.cpp:61
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
#define MIXERLINE_COMPONENTTYPE_DST_UNDEFINED
Definition: mmsystem.h:315
#define MIXERLINE_TARGETTYPE_UNDEFINED
Definition: mmsystem.h:338
static const UCHAR Index[8]
Definition: usbohci.c:18
VOID MMixerIsTopologyPinReserved(IN PTOPOLOGY Topology, IN ULONG PinId, OUT PULONG bReserved)
Definition: topology.c:1214
#define DESTINATION_LINE
Definition: precomp.h:176
Status
Definition: gdiplustypes.h:24
MIXER_STATUS
Definition: mmixer.h:3
#define DPRINT1
Definition: precomp.h:8
unsigned int ULONG
Definition: retypes.h:1
MIXER_STATUS MMixerBuildMixerDestinationLine(IN PMIXER_CONTEXT MixerContext, IN OUT LPMIXER_INFO MixerInfo, IN HANDLE hMixer, IN ULONG PinId, IN ULONG bInput)
Definition: controls.c:352

Referenced by MMixerInitialize().

◆ MMixerInitializeMidiForFilter()

VOID MMixerInitializeMidiForFilter ( IN PMIXER_CONTEXT  MixerContext,
IN PMIXER_LIST  MixerList,
IN LPMIXER_DATA  MixerData,
IN PTOPOLOGY  Topology 
)

Definition at line 172 of file midi.c.

177 {
180  PKSMULTIPLE_ITEM MultipleItem;
181  WCHAR szPname[MAXPNAMELEN];
182 
183  /* get filter pin count */
185 
186  /* get mixer name */
187  if (MMixerGetDeviceName(MixerContext, szPname, MixerData->hDeviceInterfaceKey) != MM_STATUS_SUCCESS)
188  {
189  /* clear name */
190  szPname[0] = 0;
191  }
192 
193  /* iterate all pins and check for KSDATARANGE_MUSIC support */
194  for(Index = 0; Index < PinCount; Index++)
195  {
196  /* get audio pin data ranges */
197  Status = MMixerGetAudioPinDataRanges(MixerContext, MixerData->hDevice, Index, &MultipleItem);
198 
199  /* check for success */
200  if (Status == MM_STATUS_SUCCESS)
201  {
202  /* check if there is support KSDATARANGE_MUSIC */
203  MMixerCheckFilterPinMidiSupport(MixerContext, MixerList, MixerData, Index, MultipleItem, szPname);
204  }
205  }
206 }
MIXER_STATUS MMixerGetAudioPinDataRanges(IN PMIXER_CONTEXT MixerContext, IN HANDLE hDevice, IN ULONG PinId, IN OUT PKSMULTIPLE_ITEM *OutMultipleItem)
Definition: wave.c:142
_In_ const GUID _In_ ULONG PinCount
Definition: strmini.h:504
MIXER_CONTEXT MixerContext
Definition: mmixer.c:46
VOID MMixerGetTopologyPinCount(IN PTOPOLOGY Topology, OUT PULONG PinCount)
Definition: topology.c:1011
__wchar_t WCHAR
Definition: xmlstorage.h:180
static const UCHAR Index[8]
Definition: usbohci.c:18
VOID MMixerCheckFilterPinMidiSupport(IN PMIXER_CONTEXT MixerContext, IN PMIXER_LIST MixerList, IN LPMIXER_DATA MixerData, IN ULONG PinId, IN PKSMULTIPLE_ITEM MultipleItem, IN LPWSTR szPname)
Definition: midi.c:120
Status
Definition: gdiplustypes.h:24
MIXER_STATUS
Definition: mmixer.h:3
#define MAXPNAMELEN
Definition: mmsystem.h:24
unsigned int ULONG
Definition: retypes.h:1
MIXER_STATUS MMixerGetDeviceName(IN PMIXER_CONTEXT MixerContext, OUT LPWSTR DeviceName, IN HANDLE hKey)
Definition: sup.c:852

◆ MMixerInitializePinConnect()

VOID MMixerInitializePinConnect ( IN OUT PKSPIN_CONNECT  PinConnect,
IN ULONG  PinId 
)

Definition at line 901 of file sup.c.

904 {
905  PinConnect->Interface.Set = KSINTERFACESETID_Standard;
906  PinConnect->Interface.Id = KSINTERFACE_STANDARD_STREAMING;
907  PinConnect->Interface.Flags = 0;
908  PinConnect->Medium.Set = KSMEDIUMSETID_Standard;
909  PinConnect->Medium.Id = KSMEDIUM_TYPE_ANYINSTANCE;
910  PinConnect->Medium.Flags = 0;
911  PinConnect->PinToHandle = NULL;
912  PinConnect->PinId = PinId;
913  PinConnect->Priority.PriorityClass = KSPRIORITY_NORMAL;
914  PinConnect->Priority.PrioritySubClass = 1;
915 }
#define KSPRIORITY_NORMAL
Definition: ks.h:1416
#define KSINTERFACESETID_Standard
Definition: ks.h:310
#define KSMEDIUMSETID_Standard
Definition: ks.h:336
smooth NULL
Definition: ftsmooth.c:416
#define KSMEDIUM_TYPE_ANYINSTANCE
Definition: ks.h:331

Referenced by MMixerOpenMidiPin(), and MMixerOpenWavePin().

◆ MMixerInitializeWaveInfo()

MIXER_STATUS MMixerInitializeWaveInfo ( IN PMIXER_CONTEXT  MixerContext,
IN PMIXER_LIST  MixerList,
IN LPMIXER_DATA  MixerData,
IN LPWSTR  DeviceName,
IN ULONG  bWaveIn,
IN ULONG  PinCount,
IN PULONG  Pins 
)

Definition at line 330 of file wave.c.

338 {
340  PKSMULTIPLE_ITEM MultipleItem;
341  PKSDATARANGE_AUDIO DataRangeAudio;
342  LPWAVE_INFO WaveInfo;
343 
344  WaveInfo = (LPWAVE_INFO)MixerContext->Alloc(sizeof(WAVE_INFO));
345  if (!WaveInfo)
346  return MM_STATUS_NO_MEMORY;
347 
348  if (PinCount > 1)
349  {
350  /* FIXME support multiple pins for wave device */
351  DPRINT1("Implement support for multiple pins\n");
352  //ASSERT(PinCount == 1);
353  }
354 
355  /* initialize wave info */
356  WaveInfo->DeviceId = MixerData->DeviceId;
357  WaveInfo->PinId = Pins[0];
358 
359  /* sanity check */
361 
362  /* copy device name */
363  if (bWaveIn)
364  {
365  wcscpy(WaveInfo->u.InCaps.szPname, DeviceName);
366  }
367  else
368  {
369  wcscpy(WaveInfo->u.OutCaps.szPname, DeviceName);
370  }
371 
372  /* FIXME determine manufacturer / product id */
373  if (bWaveIn)
374  {
375  WaveInfo->u.InCaps.wMid = MM_MICROSOFT;
376  WaveInfo->u.InCaps.wPid = MM_PID_UNMAPPED;
377  WaveInfo->u.InCaps.vDriverVersion = 1;
378  }
379  else
380  {
381  WaveInfo->u.OutCaps.wMid = MM_MICROSOFT;
382  WaveInfo->u.OutCaps.wPid = MM_PID_UNMAPPED;
383  WaveInfo->u.OutCaps.vDriverVersion = 1;
384  }
385 
386  /* get audio pin data ranges */
387  Status = MMixerGetAudioPinDataRanges(MixerContext, MixerData->hDevice, Pins[0], &MultipleItem);
388  if (Status != MM_STATUS_SUCCESS)
389  {
390  /* failed to get audio pin data ranges */
391  MixerContext->Free(WaveInfo);
392  return MM_STATUS_UNSUCCESSFUL;
393  }
394 
395  /* find an KSDATARANGE_AUDIO range */
396  Status = MMixerFindAudioDataRange(MultipleItem, &DataRangeAudio);
397  if (Status != MM_STATUS_SUCCESS)
398  {
399  /* failed to find audio pin data range */
400  MixerContext->Free(MultipleItem);
401  MixerContext->Free(WaveInfo);
402  return MM_STATUS_UNSUCCESSFUL;
403  }
404 
405  /* store channel count */
406  if (bWaveIn)
407  {
408  WaveInfo->u.InCaps.wChannels = DataRangeAudio->MaximumChannels;
409  }
410  else
411  {
412  WaveInfo->u.OutCaps.wChannels = DataRangeAudio->MaximumChannels;
413  }
414 
415  /* get all supported formats */
416  MMixerCheckFormat(DataRangeAudio, WaveInfo, bWaveIn);
417 
418  /* free dataranges buffer */
419  MixerContext->Free(MultipleItem);
420 
421  if (bWaveIn)
422  {
423  InsertTailList(&MixerList->WaveInList, &WaveInfo->Entry);
424  MixerList->WaveInListCount++;
425  }
426  else
427  {
428  InsertTailList(&MixerList->WaveOutList, &WaveInfo->Entry);
429  MixerList->WaveOutListCount++;
430  }
431 
432  return MM_STATUS_SUCCESS;
433 }
WCHAR szPname[MAXPNAMELEN]
Definition: mmsystem.h:1060
struct WAVE_INFO * LPWAVE_INFO
MIXER_STATUS MMixerGetAudioPinDataRanges(IN PMIXER_CONTEXT MixerContext, IN HANDLE hDevice, IN ULONG PinId, IN OUT PKSMULTIPLE_ITEM *OutMultipleItem)
Definition: wave.c:142
LIST_ENTRY Entry
Definition: precomp.h:124
WCHAR DeviceName[]
Definition: adapter.cpp:21
#define InsertTailList(ListHead, Entry)
_In_ const GUID _In_ ULONG PinCount
Definition: strmini.h:504
ULONG DeviceId
Definition: precomp.h:125
ULONG PinId
Definition: precomp.h:126
MIXER_CONTEXT MixerContext
Definition: mmixer.c:46
MMVERSION vDriverVersion
Definition: mmsystem.h:1059
#define MM_PID_UNMAPPED
Definition: mmreg.h:141
MIXER_STATUS MMixerFindAudioDataRange(PKSMULTIPLE_ITEM MultipleItem, PKSDATARANGE_AUDIO *OutDataRangeAudio)
Definition: wave.c:187
VOID MMixerCheckFormat(IN PKSDATARANGE_AUDIO DataRangeAudio, IN LPWAVE_INFO WaveInfo, IN ULONG bInput)
Definition: wave.c:279
PMIXER_FREE Free
Definition: mmixer.h:96
WAVEINCAPSW InCaps
Definition: precomp.h:130
ULONG MaximumChannels
Definition: ksmedia.h:580
WCHAR szPname[MAXPNAMELEN]
Definition: mmsystem.h:1039
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
#define MM_MICROSOFT
Definition: mmreg.h:144
WAVEOUTCAPSW OutCaps
Definition: precomp.h:129
PMIXER_ALLOC Alloc
Definition: mmixer.h:94
union WAVE_INFO::@3942 u
Status
Definition: gdiplustypes.h:24
MMVERSION vDriverVersion
Definition: mmsystem.h:1038
MIXER_STATUS
Definition: mmixer.h:3
#define MAXPNAMELEN
Definition: mmsystem.h:24
#define DPRINT1
Definition: precomp.h:8
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)

Referenced by MMixerInitializeFilter().

◆ MMixerIsNodeConnectedToPin()

MIXER_STATUS MMixerIsNodeConnectedToPin ( IN PMIXER_CONTEXT  MixerContext,
IN PTOPOLOGY  Topology,
IN ULONG  NodeIndex,
IN ULONG  PinId,
IN ULONG  bUpStream,
OUT PULONG  bConnected 
)

Definition at line 1119 of file topology.c.

1126 {
1128  ULONG Index, PinsCount;
1129  PULONG Pins;
1130 
1131  /* allocate pin index array */
1133 
1134  if (Status != MM_STATUS_SUCCESS)
1135  {
1136  /* failed to allocate */
1137  return Status;
1138  }
1139 
1140  /* now get connected pins */
1141  PinsCount = 0;
1142  MMixerGetAllUpOrDownstreamPinsFromNodeIndex(MixerContext, Topology, NodeIndex, bUpStream, &PinsCount, Pins);
1143 
1144  /* set to false */
1145  *bConnected = FALSE;
1146 
1147  for(Index = 0; Index < PinsCount; Index++)
1148  {
1149  if (Pins[Index] == PinId)
1150  {
1151  /* pin is connected */
1152  *bConnected = TRUE;
1153  break;
1154  }
1155  }
1156 
1157  /* free pin index array */
1158  MixerContext->Free(Pins);
1159 
1160  /* done */
1161  return MM_STATUS_SUCCESS;
1162 }
#define TRUE
Definition: types.h:120
MIXER_STATUS MMixerAllocateTopologyPinArray(IN PMIXER_CONTEXT MixerContext, IN PTOPOLOGY Topology, OUT PULONG *OutPins)
Definition: topology.c:1020
MIXER_CONTEXT MixerContext
Definition: mmixer.c:46
PMIXER_FREE Free
Definition: mmixer.h:96
static const UCHAR Index[8]
Definition: usbohci.c:18
BOOL bConnected
Definition: fdebug.c:27
Status
Definition: gdiplustypes.h:24
MIXER_STATUS
Definition: mmixer.h:3
unsigned int * PULONG
Definition: retypes.h:1
unsigned int ULONG
Definition: retypes.h:1
VOID MMixerGetAllUpOrDownstreamPinsFromNodeIndex(IN PMIXER_CONTEXT MixerContext, IN PTOPOLOGY Topology, IN ULONG NodeIndex, IN ULONG bUpStream, OUT PULONG OutPinsCount, OUT PULONG OutPins)
Definition: topology.c:713

Referenced by MMixerAddMixerSourceLines().

◆ MMixerIsNodeTerminator()

VOID MMixerIsNodeTerminator ( IN PTOPOLOGY  Topology,
IN ULONG  NodeIndex,
OUT ULONG bTerminator 
)

Definition at line 1084 of file topology.c.

1088 {
1089  /* sanity check */
1090  ASSERT(NodeIndex < Topology->TopologyNodesCount);
1091 
1092  /* check if node has multiple parents */
1093  if (Topology->TopologyNodes[NodeIndex].NodeConnectedFromCount > 1)
1094  {
1095  /* node is connected to multiple other nodes */
1096  *bTerminator = TRUE;
1097 
1098  /* done */
1099  return;
1100  }
1101 
1102  /* check if node is mux / sum node */
1103  if (IsEqualGUIDAligned(&Topology->TopologyNodes[NodeIndex].NodeType, &KSNODETYPE_SUM) ||
1104  IsEqualGUIDAligned(&Topology->TopologyNodes[NodeIndex].NodeType, &KSNODETYPE_MUX))
1105  {
1106  /* classic terminator */
1107  *bTerminator = TRUE;
1108 
1109  /* done */
1110  return;
1111 
1112  }
1113 
1114  /* node is not a terminator */
1115  *bTerminator = FALSE;
1116 }
#define TRUE
Definition: types.h:120
const GUID KSNODETYPE_MUX
Definition: sup.c:23
#define IsEqualGUIDAligned(guid1, guid2)
Definition: wdm.template.h:233
const GUID KSNODETYPE_SUM
Definition: sup.c:14
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)

Referenced by MMixerCountMixerControls().

◆ MMixerIsTopologyNodeReserved()

VOID MMixerIsTopologyNodeReserved ( IN PTOPOLOGY  Topology,
IN ULONG  NodeIndex,
OUT PULONG  bReserved 
)

Definition at line 1239 of file topology.c.

1243 {
1244  /* sanity check */
1245  ASSERT(NodeIndex < Topology->TopologyNodesCount);
1246 
1247  /* get reserved status */
1248  *bReserved = Topology->TopologyNodes[NodeIndex].Reserved;
1249 }
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)

Referenced by MMixerAddMixerControlsToMixerLineByNodeIndexArray().

◆ MMixerIsTopologyPinReserved()

VOID MMixerIsTopologyPinReserved ( IN PTOPOLOGY  Topology,
IN ULONG  PinId,
OUT PULONG  bReserved 
)

Definition at line 1214 of file topology.c.

1218 {
1219  /* sanity check */
1220  ASSERT(PinId < Topology->TopologyPinsCount);
1221 
1222  /* get reserved status */
1223  *bReserved = Topology->TopologyPins[PinId].Reserved;
1224 }
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)

Referenced by MMixerHandleAlternativeMixers().

◆ MMixerPrintTopology()

VOID MMixerPrintTopology ( )

◆ MMixerRemoveEvent()

MIXER_STATUS MMixerRemoveEvent ( IN PMIXER_CONTEXT  MixerContext,
IN OUT LPMIXER_INFO  MixerInfo,
IN PVOID  MixerEventContext,
IN PMIXER_EVENT  MixerEventRoutine 
)

Definition at line 1878 of file controls.c.

1883 {
1884  PLIST_ENTRY EventList;
1886 
1887  /* Lookup through mixers */
1888  EventList = MixerInfo->EventList.Flink;
1889  while(EventList != &MixerInfo->EventList)
1890  {
1892  EventList = EventList->Flink;
1893  /* TODO: find a better way to identify an event ? */
1894  if(NotificationEntry->MixerEventRoutine == MixerEventRoutine &&
1895  NotificationEntry->MixerEventContext == MixerEventContext)
1896  {
1897  DPRINT1("Freeing entry %p\n", NotificationEntry);
1898  /* We found the event to remove */
1901  }
1902  }
1903  return MM_STATUS_SUCCESS;
1904 }
FORCEINLINE BOOLEAN RemoveEntryList(_In_ PLIST_ENTRY Entry)
Definition: rtlfuncs.h:105
_In_ ULONG _In_opt_ PVOID _In_ PDRIVER_OBJECT _In_ PDRIVER_NOTIFICATION_CALLBACK_ROUTINE _Inout_opt_ __drv_aliasesMem PVOID _Outptr_result_nullonfailure_ _At_ * NotificationEntry(return==0, __drv_allocatesMem(Mem))) PVOID *NotificationEntry
MIXER_CONTEXT MixerContext
Definition: mmixer.c:46
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
Definition: precomp.h:168
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
PMIXER_FREE Free
Definition: mmixer.h:96
Definition: typedefs.h:117
#define DPRINT1
Definition: precomp.h:8
base of all file and directory entries
Definition: entries.h:82

Referenced by MMixerClose().

◆ 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 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2327
#define IOCTL_KS_PROPERTY
Definition: ks.h:150
_In_ PSTORAGE_PROPERTY_ID PropertyId
Definition: classpnp.h:966
#define KSPROPSETID_Audio
Definition: ksmedia.h:951
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
MIXER_CONTEXT MixerContext
Definition: mmixer.c:46
PMIXER_DEVICE_CONTROL Control
Definition: mmixer.h:95
long LONG
Definition: pedump.c:60
HMIXER hMixer
Definition: test.c:10
void DPRINT(...)
Definition: polytest.cpp:61
Status
Definition: gdiplustypes.h:24
_In_ DWORD Property
Definition: setupapi.h:1545
MIXER_STATUS
Definition: mmixer.h:3
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
#define KSPROPERTY_TYPE_TOPOLOGY
Definition: dmksctrl.h:53
#define KSPROPERTY_TYPE_SET
Definition: dmksctrl.h:43
Property(long _type, long _tag, INREAL _value)
Definition: reader.h:125

Referenced by MMixerSetGetMuteControlDetails(), and MMixerSetGetVolumeControlDetails().

◆ MMixerSetGetMuteControlDetails()

MIXER_STATUS MMixerSetGetMuteControlDetails ( IN PMIXER_CONTEXT  MixerContext,
IN LPMIXER_INFO  MixerInfo,
IN LPMIXERCONTROL_EXT  MixerControl,
IN ULONG  dwLineID,
IN LPMIXERCONTROLDETAILS  MixerControlDetails,
IN ULONG  bSet 
)

Definition at line 367 of file sup.c.

374 {
376  LONG Value;
378 
379  if (MixerControlDetails->cbDetails != sizeof(MIXERCONTROLDETAILS_BOOLEAN))
381 
382  /* get input */
383  Input = (LPMIXERCONTROLDETAILS_BOOLEAN)MixerControlDetails->paDetails;
384 
385  /* FIXME SEH */
386  if (bSet)
387  Value = Input->fValue;
388 
389  /* set control details */
390  Status = MMixerSetGetControlDetails(MixerContext, MixerControl->hDevice, MixerControl->NodeID, bSet, KSPROPERTY_AUDIO_MUTE, 0, &Value);
391 
392  if (Status != MM_STATUS_SUCCESS)
393  return Status;
394 
395  /* FIXME SEH */
396  if (!bSet)
397  {
398  Input->fValue = Value;
399  return Status;
400  }
401  else
402  {
403  /* notify wdmaud clients MM_MIXM_LINE_CHANGE dwLineID */
405  }
406 
407  return Status;
408 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2327
VOID MMixerNotifyControlChange(IN PMIXER_CONTEXT MixerContext, IN LPMIXER_INFO MixerInfo, IN ULONG NotificationType, IN ULONG Value)
Definition: sup.c:339
struct tMIXERCONTROLDETAILS_BOOLEAN * LPMIXERCONTROLDETAILS_BOOLEAN
Definition: arc.h:84
MIXER_CONTEXT MixerContext
Definition: mmixer.c:46
long LONG
Definition: pedump.c:60
if(!(yy_init))
Definition: macro.lex.yy.c:714
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: filter.c:219
Status
Definition: gdiplustypes.h:24
MIXER_STATUS
Definition: mmixer.h:3
#define MM_MIXM_LINE_CHANGE
Definition: mmsystem.h:82

Referenced by MMixerGetControlDetails(), and MMixerSetControlDetails().

◆ MMixerSetGetMuxControlDetails()

MIXER_STATUS MMixerSetGetMuxControlDetails ( IN PMIXER_CONTEXT  MixerContext,
IN LPMIXER_INFO  MixerInfo,
IN ULONG  NodeId,
IN ULONG  bSet,
IN ULONG  Flags,
LPMIXERCONTROL_EXT  MixerControl,
IN LPMIXERCONTROLDETAILS  MixerControlDetails,
LPMIXERLINE_EXT  MixerLine 
)

◆ MMixerSetGetVolumeControlDetails()

MIXER_STATUS MMixerSetGetVolumeControlDetails ( IN PMIXER_CONTEXT  MixerContext,
IN LPMIXER_INFO  MixerInfo,
IN ULONG  NodeId,
IN ULONG  bSet,
LPMIXERCONTROL_EXT  MixerControl,
IN LPMIXERCONTROLDETAILS  MixerControlDetails,
LPMIXERLINE_EXT  MixerLine 
)

Definition at line 668 of file sup.c.

676 {
678  LONG Value;
679  ULONG Index, Channel = 0;
680  ULONG dwValue;
682  LPMIXERVOLUME_DATA VolumeData;
683 
684  if (MixerControlDetails->cbDetails != sizeof(MIXERCONTROLDETAILS_SIGNED))
686 
687  VolumeData = (LPMIXERVOLUME_DATA)MixerControl->ExtraData;
688  if (!VolumeData)
689  return MM_STATUS_UNSUCCESSFUL;
690 
691  /* get input */
692  Input = (LPMIXERCONTROLDETAILS_UNSIGNED)MixerControlDetails->paDetails;
693 
694  if (bSet)
695  {
696  /* FIXME SEH */
697  Value = Input->dwValue;
698  Index = Value / VolumeData->InputSteppingDelta;
699 
700  if (Index >= VolumeData->ValuesCount)
701  {
702  DPRINT1("Index %u out of bounds %u \n", Index, VolumeData->ValuesCount);
704  }
705 
706  Value = VolumeData->Values[Index];
707  }
708 
709  /* set control details */
710  if (bSet)
711  {
712  /* TODO */
715  }
716  else
717  {
718  Status = MMixerSetGetControlDetails(MixerContext, MixerControl->hDevice, NodeId, bSet, KSPROPERTY_AUDIO_VOLUMELEVEL, Channel, &Value);
719  }
720 
721  if (!bSet)
722  {
723  dwValue = MMixerGetVolumeControlIndex(VolumeData, (LONG)Value);
724  /* FIXME SEH */
725  Input->dwValue = dwValue;
726  }
727  else
728  {
729  /* notify clients of a line change MM_MIXM_CONTROL_CHANGE with MixerControl->dwControlID */
731  }
732  return Status;
733 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2327
VOID MMixerNotifyControlChange(IN PMIXER_CONTEXT MixerContext, IN LPMIXER_INFO MixerInfo, IN ULONG NotificationType, IN ULONG Value)
Definition: sup.c:339
MIXERCONTROLW Control
Definition: precomp.h:79
Definition: arc.h:84
ULONG ValuesCount
Definition: precomp.h:107
MIXER_CONTEXT MixerContext
Definition: mmixer.c:46
long LONG
Definition: pedump.c:60
PVOID ExtraData
Definition: precomp.h:82
HANDLE hDevice
Definition: precomp.h:81
if(!(yy_init))
Definition: macro.lex.yy.c:714
static const UCHAR Index[8]
Definition: usbohci.c:18
struct tMIXERCONTROLDETAILS_UNSIGNED * LPMIXERCONTROLDETAILS_UNSIGNED
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: filter.c:219
struct MIXERVOLUME_DATA * LPMIXERVOLUME_DATA
Status
Definition: gdiplustypes.h:24
MIXER_STATUS
Definition: mmixer.h:3
#define DPRINT1
Definition: precomp.h:8
unsigned int ULONG
Definition: retypes.h:1
ULONG InputSteppingDelta
Definition: precomp.h:106
ULONG MMixerGetVolumeControlIndex(LPMIXERVOLUME_DATA VolumeData, LONG Value)
Definition: sup.c:322
#define MM_MIXM_CONTROL_CHANGE
Definition: mmsystem.h:83

Referenced by MMixerGetControlDetails(), and MMixerSetControlDetails().

◆ MMixerSetTopologyNodeReserved()

VOID MMixerSetTopologyNodeReserved ( IN PTOPOLOGY  Topology,
IN ULONG  NodeIndex 
)

Definition at line 1227 of file topology.c.

1230 {
1231  /* sanity check */
1232  ASSERT(NodeIndex < Topology->TopologyNodesCount);
1233 
1234  /* set reserved */
1235  Topology->TopologyNodes[NodeIndex].Reserved = TRUE;
1236 }
#define TRUE
Definition: types.h:120
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)

Referenced by MMixerAddMixerControlsToMixerLineByNodeIndexArray().

◆ MMixerSetTopologyPinReserved()

VOID MMixerSetTopologyPinReserved ( IN PTOPOLOGY  Topology,
IN ULONG  PinId 
)

Definition at line 1202 of file topology.c.

1205 {
1206  /* sanity check */
1207  ASSERT(PinId < Topology->TopologyPinsCount);
1208 
1209  /* set reserved */
1210  Topology->TopologyPins[PinId].Reserved = TRUE;
1211 }
#define TRUE
Definition: types.h:120
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)

Referenced by MMixerAddMixerSourceLines(), MMixerHandleAlternativeMixers(), MMixerHandlePhysicalConnection(), MMixerHandleTopologyFilter(), and MMixerInitializeFilter().

◆ MMixerSetupFilter()

MIXER_STATUS MMixerSetupFilter ( IN PMIXER_CONTEXT  MixerContext,
IN PMIXER_LIST  MixerList,
IN LPMIXER_DATA  MixerData,
IN PULONG  DeviceCount 
)

Definition at line 1751 of file controls.c.

1756 {
1758  PTOPOLOGY Topology;
1759  ULONG NodeIndex;
1760  LPMIXER_INFO MixerInfo = NULL;
1761 
1762  /* check if topology has already been built */
1763  if (MixerData->Topology == NULL)
1764  {
1765  /* build topology */
1766  Status = MMixerBuildTopology(MixerContext, MixerData, &Topology);
1767 
1768  if (Status != MM_STATUS_SUCCESS)
1769  {
1770  /* failed to build topology */
1771  return Status;
1772  }
1773 
1774  /* store topology */
1775  MixerData->Topology = Topology;
1776  }
1777  else
1778  {
1779  /* re-use topology */
1780  Topology = MixerData->Topology;
1781  }
1782 
1783  /* check if the filter has an wave out node */
1784  NodeIndex = MMixerGetNodeIndexFromGuid(Topology, &KSNODETYPE_DAC);
1785  if (NodeIndex != MAXULONG)
1786  {
1787  /* it has */
1788  Status = MMixerInitializeFilter(MixerContext, MixerList, MixerData, NULL, Topology, NodeIndex, FALSE, &MixerInfo);
1789 
1790  /* check for success */
1791  if (Status == MM_STATUS_SUCCESS)
1792  {
1793  /* increment mixer count */
1794  (*DeviceCount)++;
1795  }
1796  else
1797  {
1798  /* reset mixer info in case of error */
1799  MixerInfo = NULL;
1800  }
1801  }
1802 
1803  /* check if the filter has an wave in node */
1804  NodeIndex = MMixerGetNodeIndexFromGuid(Topology, &KSNODETYPE_ADC);
1805  if (NodeIndex != MAXULONG)
1806  {
1807  /* it has */
1808  Status = MMixerInitializeFilter(MixerContext, MixerList, MixerData, MixerInfo, Topology, NodeIndex, TRUE, &MixerInfo);
1809 
1810  /* check for success */
1811  if (Status == MM_STATUS_SUCCESS)
1812  {
1813  /* increment mixer count */
1814  (*DeviceCount)++;
1815  }
1816 
1817  }
1818 
1819  /* TODO: apply hacks for Wave source line */
1820 
1821  /* activate midi devices */
1822  //MMixerInitializeMidiForFilter(MixerContext, MixerList, MixerData, Topology);
1823 
1824  /* done */
1825  return Status;
1826 }
ULONG MMixerGetNodeIndexFromGuid(IN PTOPOLOGY Topology, IN const GUID *NodeType)
Definition: topology.c:694
#define TRUE
Definition: types.h:120
MIXER_STATUS MMixerInitializeFilter(IN PMIXER_CONTEXT MixerContext, IN PMIXER_LIST MixerList, IN LPMIXER_DATA MixerData, IN LPMIXER_INFO MixerInfo, IN PTOPOLOGY Topology, IN ULONG NodeIndex, IN ULONG bInputMixer, IN OUT LPMIXER_INFO *OutMixerInfo)
Definition: controls.c:1519
MIXER_CONTEXT MixerContext
Definition: mmixer.c:46
smooth NULL
Definition: ftsmooth.c:416
const GUID KSNODETYPE_DAC
Definition: sup.c:15
Status
Definition: gdiplustypes.h:24
#define MAXULONG
Definition: typedefs.h:250
const GUID KSNODETYPE_ADC
Definition: sup.c:16
MIXER_STATUS
Definition: mmixer.h:3
unsigned int ULONG
Definition: retypes.h:1
MIXER_STATUS MMixerBuildTopology(IN PMIXER_CONTEXT MixerContext, IN LPMIXER_DATA MixerData, OUT PTOPOLOGY *OutTopology)
Definition: controls.c:383

Referenced by MMixerInitialize().

◆ MMixerVerifyContext()

MIXER_STATUS MMixerVerifyContext ( IN PMIXER_CONTEXT  MixerContext)

Definition at line 41 of file sup.c.

43 {
44  if (MixerContext->SizeOfStruct != sizeof(MIXER_CONTEXT))
46 
51 
54 
55  return MM_STATUS_SUCCESS;
56 }
ULONG SizeOfStruct
Definition: mmixer.h:91
PMIXER_OPEN_KEY OpenKey
Definition: mmixer.h:100
PMIXER_CLOSE Close
Definition: mmixer.h:98
MIXER_CONTEXT MixerContext
Definition: mmixer.c:46
PMIXER_DEVICE_CONTROL Control
Definition: mmixer.h:95
PMIXER_ALLOC_EVENT_DATA AllocEventData
Definition: mmixer.h:103
PMIXER_FREE_EVENT_DATA FreeEventData
Definition: mmixer.h:104
PMIXER_FREE Free
Definition: mmixer.h:96
PMIXER_QUERY_KEY_VALUE QueryKeyValue
Definition: mmixer.h:101
PMIXER_ALLOC Alloc
Definition: mmixer.h:94
PVOID MixerContext
Definition: mmixer.h:92
PMIXER_CLOSEKEY CloseKey
Definition: mmixer.h:102
PMIXER_OPEN Open
Definition: mmixer.h:97

Referenced by MMixerClose(), MMixerGetCapabilities(), MMixerGetControlDetails(), MMixerGetCount(), MMixerGetLineControls(), MMixerGetLineInfo(), MMixerGetMidiDevicePath(), MMixerGetMidiInCount(), MMixerGetMidiOutCount(), MMixerGetWaveDevicePath(), MMixerGetWaveInCount(), MMixerGetWaveOutCount(), MMixerMidiInCapabilities(), MMixerMidiOutCapabilities(), MMixerOpen(), MMixerOpenMidi(), MMixerOpenWave(), MMixerSetControlDetails(), MMixerSetWaveResetState(), MMixerSetWaveStatus(), MMixerWaveInCapabilities(), and MMixerWaveOutCapabilities().