ReactOS 0.4.15-dev-7953-g1f49173
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 1827 of file controls.c.

1832{
1833 //KSE_NODE Property;
1834 //KSEVENTDATA EventData
1835 //ULONG BytesReturned;
1836 //MIXER_STATUS Status;
1837 PEVENT_NOTIFICATION_ENTRY EventNotification;
1838
1840 if (!EventNotification)
1841 {
1842 /* not enough memory */
1843 return MM_STATUS_NO_MEMORY;
1844 }
1845
1846 /* FIXME: what is it supposed to happen with KSEVENTDATA ? */
1847#if 0
1848 /* setup request */
1852
1853 Property.NodeId = NodeId;
1854 Property.Reserved = 0;
1855
1856 Status = MixerContext->Control(MixerInfo->hMixer, IOCTL_KS_ENABLE_EVENT, (PVOID)&Property, sizeof(KSP_NODE), (PVOID)EventData, sizeof(KSEVENTDATA), &BytesReturned);
1858 {
1859 /* failed to add event */
1860 MixerContext->FreeEventData(EventData);
1861 return Status;
1862 }
1863#endif
1864
1865 /* initialize notification entry */
1866 EventNotification->MixerEventContext = MixerEventContext;
1867 EventNotification->MixerEventRoutine = MixerEventRoutine;
1868
1869 /* store event */
1870 InsertTailList(&MixerInfo->EventList, &EventNotification->Entry);
1871 return MM_STATUS_SUCCESS;
1872}
MIXER_CONTEXT MixerContext
Definition: mmixer.c:41
#define InsertTailList(ListHead, Entry)
Status
Definition: gdiplustypes.h:25
#define KSEVENT_TYPE_TOPOLOGY
Definition: ks.h:1796
#define KSEVENT_TYPE_ENABLE
Definition: ks.h:1789
#define IOCTL_KS_ENABLE_EVENT
Definition: ks.h:130
@ KSEVENT_CONTROL_CHANGE
Definition: ksmedia.h:1120
#define KSEVENTSETID_AudioControlChange
Definition: ksmedia.h:1117
@ MM_STATUS_NO_MEMORY
Definition: mmixer.h:12
@ MM_STATUS_SUCCESS
Definition: mmixer.h:5
struct EVENT_NOTIFICATION_ENTRY * PEVENT_NOTIFICATION_ENTRY
Definition: precomp.h:169
PVOID MixerEventContext
Definition: precomp.h:171
LIST_ENTRY Entry
Definition: precomp.h:170
PMIXER_EVENT MixerEventRoutine
Definition: precomp.h:172
Definition: ks.h:2074
PMIXER_DEVICE_CONTROL Control
Definition: mmixer.h:95
PMIXER_FREE_EVENT_DATA FreeEventData
Definition: mmixer.h:104
PMIXER_ALLOC Alloc
Definition: mmixer.h:94
_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 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}

Referenced by MMixerOpenMidiPin(), and MMixerOpenWavePin().

◆ MMixerAllocateTopologyNodeArray()

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

Definition at line 1045 of file topology.c.

1049{
1050 PULONG Nodes;
1051 ULONG Index;
1052
1053 /* sanity check */
1054 ASSERT(Topology->TopologyNodesCount != 0);
1055
1056 /* allocate topology pins */
1057 Nodes = MixerContext->Alloc(Topology->TopologyNodesCount * sizeof(ULONG));
1058
1059 if (!Nodes)
1060 {
1061 /* out of memory */
1062 return MM_STATUS_NO_MEMORY;
1063 }
1064
1065 /* mark index as unused */
1066 for(Index = 0; Index < Topology->TopologyNodesCount; Index++)
1067 Nodes[Index] = MAXULONG;
1068
1069 /* store result */
1070 *OutNodes = Nodes;
1071
1072 /* done */
1073 return MM_STATUS_SUCCESS;
1074}
#define ASSERT(a)
Definition: mode.c:44
#define MAXULONG
Definition: typedefs.h:251
uint32_t * PULONG
Definition: typedefs.h:59
uint32_t ULONG
Definition: typedefs.h:59
_In_ WDFCOLLECTION _In_ ULONG Index

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 1013 of file topology.c.

1017{
1018 PULONG Pins;
1019 ULONG Index;
1020
1021 /* sanity check */
1022 ASSERT(Topology->TopologyPinsCount != 0);
1023
1024 /* allocate topology pins */
1025 Pins = MixerContext->Alloc(Topology->TopologyPinsCount * sizeof(ULONG));
1026
1027 if (!Pins)
1028 {
1029 /* out of memory */
1030 return MM_STATUS_NO_MEMORY;
1031 }
1032
1033 /* mark index as unused */
1034 for(Index = 0; Index < Topology->TopologyPinsCount; Index++)
1035 Pins[Index] = MAXULONG;
1036
1037 /* store result */
1038 *OutPins = Pins;
1039
1040 /* done */
1041 return MM_STATUS_SUCCESS;
1042}

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 778 of file sup.c.

785{
786 LPMIXER_DATA MixerData;
787
788 MixerData = (LPMIXER_DATA)MixerContext->Alloc(sizeof(MIXER_DATA));
789 if (!MixerData)
790 return MM_STATUS_NO_MEMORY;
791
792 MixerData->DeviceId = DeviceId;
793 MixerData->DeviceName = DeviceName;
794 MixerData->hDevice = hDevice;
795 MixerData->hDeviceInterfaceKey = hKey;
796 MixerData->Topology = NULL;
797
798 InsertTailList(&MixerList->MixerData, &MixerData->Entry);
799 MixerList->MixerDataCount++;
800 return MM_STATUS_SUCCESS;
801}
#define NULL
Definition: types.h:112
FxAutoRegKey hKey
struct MIXER_DATA * LPMIXER_DATA
LIST_ENTRY Entry
Definition: precomp.h:113
HANDLE hDevice
Definition: precomp.h:115
HANDLE hDeviceInterfaceKey
Definition: precomp.h:116
LPWSTR DeviceName
Definition: precomp.h:117
ULONG DeviceId
Definition: precomp.h:114
PTOPOLOGY Topology
Definition: precomp.h:118
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
Definition: wdfdevice.h:3275

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 1245 of file topology.c.

1251{
1253 PTOPOLOGY Topology;
1254
1255 /* allocate topology */
1256 Status = MMixerAllocateTopology(MixerContext, NodeTypes->Count, PinCount, &Topology);
1257
1259 {
1260 /* failed to allocate topology */
1261 return Status;
1262 }
1263
1264 /* initialize topology nodes */
1265 MMixerInitializeTopologyNodes(MixerContext, NodeTypes, Topology);
1266
1267 /* explore topology */
1268 Status = MMixerExploreTopology(MixerContext, NodeConnections, NodeTypes, Topology);
1269
1271 {
1272 /* failed to allocate topology */
1273 return Status;
1274 }
1275
1276 MMixerPrintTopology(Topology);
1277
1278 /* store result */
1279 *OutTopology = Topology;
1280
1281 /* done */
1282 return MM_STATUS_SUCCESS;
1283}
MIXER_STATUS
Definition: mmixer.h:4
VOID MMixerPrintTopology()
MIXER_STATUS MMixerExploreTopology(IN PMIXER_CONTEXT MixerContext, IN PKSMULTIPLE_ITEM NodeConnections, IN PKSMULTIPLE_ITEM NodeTypes, IN OUT PTOPOLOGY Topology)
Definition: topology.c:521
VOID MMixerInitializeTopologyNodes(IN PMIXER_CONTEXT MixerContext, IN PKSMULTIPLE_ITEM NodeTypes, IN OUT PTOPOLOGY Topology)
Definition: topology.c:119
MIXER_STATUS MMixerAllocateTopology(IN PMIXER_CONTEXT MixerContext, IN ULONG NodesCount, IN ULONG PinCount, OUT PTOPOLOGY *OutTopology)
Definition: topology.c:43
_In_ const GUID _In_ ULONG PinCount
Definition: strmini.h:505

Referenced by MMixerBuildTopology().

◆ MMixerFreeMixerInfo()

VOID MMixerFreeMixerInfo ( IN PMIXER_CONTEXT  MixerContext,
IN LPMIXER_INFO  MixerInfo 
)

Definition at line 115 of file sup.c.

118{
119 /* UNIMPLEMENTED;
120 * FIXME
121 * free all lines
122 */
123
124 MixerContext->Free((PVOID)MixerInfo);
125}
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 781 of file topology.c.

788{
789 PTOPOLOGY_NODE TopologyNode;
790
791 /* reset visited status */
793
794 /* sanity check */
795 ASSERT(Topology->TopologyNodesCount > NodeIndex);
796
797 /* get topology node */
798 TopologyNode = &Topology->TopologyNodes[NodeIndex];
799
800 /* now visit all upstream pins & nodes */
801 MMixerGetUpOrDownstreamNodes(MixerContext, Topology, TopologyNode, bUpStream, OutNodesCount, OutNodes);
802
803 /* done */
804 return MM_STATUS_SUCCESS;
805
806}
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:733
VOID MMixerResetTopologyVisitStatus(IN OUT PTOPOLOGY Topology)
Definition: topology.c:100

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 873 of file topology.c.

880{
881 ULONG Index, TopologyNodesCount;
882 PPIN Pin;
884
885 /* mark them as empty */
886 *OutNodesCount = 0;
887
888 /* get pin */
889 Pin = &Topology->TopologyPins[PinIndex];
890
891 if (bUpStream)
892 {
893 /* use nodes to which a pin is attached to */
894 TopologyNodes = Pin->NodesConnectedFrom;
895 TopologyNodesCount = Pin->NodesConnectedFromCount;
896 }
897 else
898 {
899 /* use nodes which are attached to a node */
900 TopologyNodes = Pin->NodesConnectedTo;
901 TopologyNodesCount = Pin->NodesConnectedToCount;
902 }
903
904 /* reset visited status */
906
907 /* sanity check */
908 ASSERT(Topology->TopologyPinsCount > PinIndex);
909
910 /* now visit all up / down stream pins & nodes */
911 for(Index = 0; Index < TopologyNodesCount; Index++)
912 {
913 /* add node to array */
914 MMixerAddPinIndexToArray(MixerContext, TopologyNodes[Index]->NodeIndex, Topology->TopologyNodesCount, OutNodesCount, OutNodes);
915
916 /* explore all connected nodes with helper */
917 MMixerGetAllUpOrDownstreamNodesFromNodeIndex(MixerContext, Topology, TopologyNodes[Index]->NodeIndex, bUpStream, OutNodesCount, OutNodes);
918 }
919}
IN PDCB IN VBO IN ULONG IN BOOLEAN Pin
Definition: fatprocs.h:427
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:568
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:781
Definition: precomp.h:37

◆ 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 709 of file topology.c.

716{
717 PTOPOLOGY_NODE TopologyNode;
718
719 /* reset visited status */
721
722 /* sanity check */
723 ASSERT(Topology->TopologyNodesCount > NodeIndex);
724
725 /* get topology node */
726 TopologyNode = &Topology->TopologyNodes[NodeIndex];
727
728 /* now visit all upstream pins & nodes */
729 MMixerGetUpOrDownStreamPins(MixerContext, Topology, TopologyNode, bUpStream, OutPinsCount, OutPins);
730}
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:611

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 809 of file topology.c.

816{
817 ULONG Index, TopologyNodesCount, TopologyPinsCount;
818 PPIN Pin;
820 PULONG TopologyPins;
821
822 /* get pin */
823 Pin = &Topology->TopologyPins[PinIndex];
824
825 if (bUpStream)
826 {
827 /* use nodes to which this pin is attached to */
828 TopologyNodes = Pin->NodesConnectedFrom;
829 TopologyNodesCount = Pin->NodesConnectedFromCount;
830
831 /* use pins to which this pin is attached to */
832 TopologyPins = Pin->PinConnectedFrom;
833 TopologyPinsCount = Pin->PinConnectedFromCount;
834
835 }
836 else
837 {
838 /* use nodes which are attached to a pin */
839 TopologyNodes = Pin->NodesConnectedTo;
840 TopologyNodesCount = Pin->NodesConnectedToCount;
841
842 /* use pins which are attached to this pin */
843 TopologyPins = Pin->PinConnectedTo;
844 TopologyPinsCount = Pin->PinConnectedToCount;
845 }
846
847 /* reset visited status */
849
850 /* sanity check */
851 ASSERT(Topology->TopologyPinsCount > PinIndex);
852
853 /* add pins which are directly connected to this pin */
854 for(Index = 0; Index < TopologyPinsCount; Index++)
855 {
856 /* add them to pin array */
857 MMixerAddPinIndexToArray(MixerContext, TopologyPins[Index], Topology->TopologyPinsCount, OutPinsCount, OutPins);
858 }
859
860 /* now visit all up / down stream pins & nodes */
861 for(Index = 0; Index < TopologyNodesCount; Index++)
862 {
863 /* explore all connected pins with helper */
864 MMixerGetAllUpOrDownstreamPinsFromNodeIndex(MixerContext, Topology, TopologyNodes[Index]->NodeIndex, bUpStream, OutPinsCount, OutPins);
865 }
866
867 /* done */
868 return MM_STATUS_SUCCESS;
869
870}
VOID MMixerGetAllUpOrDownstreamPinsFromNodeIndex(IN PMIXER_CONTEXT MixerContext, IN PTOPOLOGY Topology, IN ULONG NodeIndex, IN ULONG bUpStream, OUT PULONG OutPinsCount, OUT PULONG OutPins)
Definition: topology.c:709

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 157 of file wave.c.

162{
163 KSP_PIN PinProperty;
166 PKSMULTIPLE_ITEM MultipleItem;
167
168 /* retrieve size of data ranges buffer */
169 PinProperty.Reserved = 0;
170 PinProperty.PinId = PinId;
171 PinProperty.Property.Set = KSPROPSETID_Pin;
173 PinProperty.Property.Flags = KSPROPERTY_TYPE_GET;
174
175 Status = MixerContext->Control(hDevice, IOCTL_KS_PROPERTY, (PVOID)&PinProperty, sizeof(KSP_PIN), (PVOID)NULL, 0, &BytesReturned);
177 {
178 return Status;
179 }
180
181 MultipleItem = MixerContext->Alloc(BytesReturned);
182 if (!MultipleItem)
183 {
184 /* not enough memory */
185 return MM_STATUS_NO_MEMORY;
186 }
187
188 Status = MixerContext->Control(hDevice, IOCTL_KS_PROPERTY, (PVOID)&PinProperty, sizeof(KSP_PIN), (PVOID)MultipleItem, BytesReturned, &BytesReturned);
190 {
191 /* failed */
192 MixerContext->Free(MultipleItem);
193 return Status;
194 }
195
196 /* save result */
197 *OutMultipleItem = MultipleItem;
198 return Status;
199}
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
#define IOCTL_KS_PROPERTY
Definition: ks.h:127
#define KSPROPSETID_Pin
Definition: ks.h:617
@ KSPROPERTY_PIN_DATARANGES
Definition: ks.h:628
@ MM_STATUS_MORE_ENTRIES
Definition: mmixer.h:9
ULONG Id
Definition: dmksctrl.h:77
ULONG Flags
Definition: dmksctrl.h:78
GUID Set
Definition: dmksctrl.h:76
Definition: ks.h:642
ULONG Reserved
Definition: ks.h:645
KSPROPERTY Property
Definition: ks.h:643
ULONG PinId
Definition: ks.h:644

Referenced by MMixerInitializeMidiForFilter(), and MMixerInitializeWaveInfo().

◆ MMixerGetConnectedFromLogicalTopologyPins()

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

Definition at line 1158 of file topology.c.

1163{
1164 ULONG Index;
1166
1167 /* sanity check */
1168 ASSERT(NodeIndex < Topology->TopologyNodesCount);
1169
1170 /* get node */
1171 Node = &Topology->TopologyNodes[NodeIndex];
1172
1173 for(Index = 0; Index < Node->NodeConnectedFromCount; Index++)
1174 {
1175 /* copy logical pin id */
1176 OutPins[Index] = Node->LogicalPinNodeConnectedFrom[Index];
1177 }
1178
1179 /* store pin count */
1180 *OutPinCount = Node->NodeConnectedFromCount;
1181}
union node Node
Definition: types.h:1255
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}
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().

◆ MMixerGetDataByDeviceId()

LPMIXER_DATA MMixerGetDataByDeviceId ( IN PMIXER_LIST  MixerList,
IN ULONG  DeviceId 
)

Definition at line 735 of file sup.c.

738{
740 LPMIXER_DATA MixerData;
741
742 Entry = MixerList->MixerData.Flink;
743 while(Entry != &MixerList->MixerData)
744 {
746 if (MixerData->DeviceId == DeviceId)
747 {
748 return MixerData;
749 }
750 Entry = Entry->Flink;
751 }
752 return NULL;
753}
base of all file and directory entries
Definition: entries.h:83
Definition: typedefs.h:120
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

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

◆ MMixerGetDataByDeviceName()

LPMIXER_DATA MMixerGetDataByDeviceName ( IN PMIXER_LIST  MixerList,
IN LPWSTR  DeviceName 
)

Definition at line 756 of file sup.c.

759{
761 LPMIXER_DATA MixerData;
762
763 Entry = MixerList->MixerData.Flink;
764 while(Entry != &MixerList->MixerData)
765 {
767 if (wcsicmp(&DeviceName[2], &MixerData->DeviceName[2]) == 0)
768 {
769 /* found entry */
770 return MixerData;
771 }
772 Entry = Entry->Flink;
773 }
774 return NULL;
775}
#define wcsicmp
Definition: compat.h:15

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;
860 ULONG Type;
862
863 Status = MixerContext->QueryKeyValue(hKey, L"FriendlyName", (PVOID*)&Name, &Length, &Type);
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);
881 return Status;
882
883 Status = MixerContext->QueryKeyValue(hTemp, L"FriendlyName", (PVOID*)&Name, &Length, &Type);
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:7
struct NameRec_ * Name
Definition: cdprocs.h:460
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define MAXPNAMELEN
Definition: mmsystem.h:24
#define min(a, b)
Definition: monoChain.cc:55
#define KEY_READ
Definition: nt_native.h:1023
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
#define L(x)
Definition: ntvdm.h:50
PMIXER_OPEN_KEY OpenKey
Definition: mmixer.h:100
PMIXER_CLOSEKEY CloseKey
Definition: mmixer.h:102
PMIXER_COPY Copy
Definition: mmixer.h:99
PMIXER_QUERY_KEY_VALUE QueryKeyValue
Definition: mmixer.h:101
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by MMixerInitializeFilter(), and MMixerInitializeMidiForFilter().

◆ MMixerGetDeviceNameWithComponentId()

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

Definition at line 804 of file sup.c.

808{
814 ULONG ResultLength, KeyType;
815 HANDLE hMediaKey, hGuidKey;
817
818 /* prepare property */
822
823 /* try get component id */
825
827 {
828 Status = MixerContext->OpenKey(NULL, L"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Control\\MediaCategories", KEY_READ, &hMediaKey);
830 {
832 Status = MixerContext->OpenKey(hMediaKey, GuidString.Buffer, KEY_READ, &hGuidKey);
835 {
836 Status = MixerContext->QueryKeyValue(hGuidKey, L"Name", (PVOID*)&DeviceName, &ResultLength, &KeyType);
838 {
839 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}
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:1281
NTSYSAPI NTSTATUS WINAPI RtlStringFromGUID(REFGUID, PUNICODE_STRING)
@ KSPROPERTY_GENERAL_COMPONENTID
Definition: ks.h:447
static PWSTR GuidString
Definition: apphelp.c:93
HMIXER hMixer
Definition: test.c:10
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
const GUID KSPROPSETID_General
Definition: sup.c:31
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG _Out_ PULONG ResultLength
Definition: wdfdevice.h:3776

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}
@ KSPROPERTY_PIN_CTYPES
Definition: ks.h:626
ULONG Flags
Definition: ntfs.h:536

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
struct KSIDENTIFIER KSPROPERTY
#define KSPROPSETID_Topology
Definition: ks.h:842
struct KSMULTIPLE_ITEM * PKSMULTIPLE_ITEM

Referenced by MMixerBuildTopology().

◆ MMixerGetMixerByName()

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

Definition at line 191 of file sup.c.

195{
196 LPMIXER_INFO MixerInfo;
198
199 Entry = MixerList->MixerList.Flink;
200 while(Entry != &MixerList->MixerList)
201 {
203
204 DPRINT1("MixerName %S MixerName %S\n", MixerInfo->MixCaps.szPname, MixerName);
205 if (wcsicmp(MixerInfo->MixCaps.szPname, MixerName) == 0)
206 {
207 *OutMixerInfo = MixerInfo;
208 return MM_STATUS_SUCCESS;
209 }
210 /* move to next mixer entry */
211 Entry = Entry->Flink;
212 }
213
215}
#define DPRINT1
Definition: precomp.h:8
@ MM_STATUS_UNSUCCESSFUL
Definition: mmixer.h:11
struct MIXER_INFO * LPMIXER_INFO
MIXERCAPSW MixCaps
Definition: precomp.h:70
WCHAR szPname[MAXPNAMELEN]
Definition: mmsystem.h:1226

◆ MMixerGetMixerControlById()

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

Definition at line 278 of file sup.c.

284{
285 PLIST_ENTRY Entry, ControlEntry;
286 LPMIXERLINE_EXT MixerLineSrc;
287 LPMIXERCONTROL_EXT MixerControl;
288
289 /* get first entry */
290 Entry = MixerInfo->LineList.Flink;
291
292 while(Entry != &MixerInfo->LineList)
293 {
295
296 ControlEntry = MixerLineSrc->ControlsList.Flink;
297 while(ControlEntry != &MixerLineSrc->ControlsList)
298 {
299 MixerControl = (LPMIXERCONTROL_EXT)CONTAINING_RECORD(ControlEntry, MIXERCONTROL_EXT, Entry);
300 if (MixerControl->Control.dwControlID == dwControlID)
301 {
302 if (OutMixerLine)
303 *OutMixerLine = MixerLineSrc;
304 if (OutMixerControl)
305 *OutMixerControl = MixerControl;
306 if (NodeId)
307 *NodeId = MixerControl->NodeID;
308 return MM_STATUS_SUCCESS;
309 }
310 ControlEntry = ControlEntry->Flink;
311 }
312 Entry = Entry->Flink;
313 }
314
316}
struct MIXERLINE_EXT * LPMIXERLINE_EXT
struct MIXERCONTROL_EXT * LPMIXERCONTROL_EXT
MIXERCONTROLW Control
Definition: precomp.h:79
ULONG NodeID
Definition: precomp.h:80
LIST_ENTRY ControlsList
Definition: precomp.h:90
LIST_ENTRY LineList
Definition: precomp.h:71
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121

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

◆ MMixerGetMixerInfoByIndex()

LPMIXER_INFO MMixerGetMixerInfoByIndex ( IN PMIXER_CONTEXT  MixerContext,
IN ULONG  MixerIndex 
)

Definition at line 158 of file sup.c.

161{
162 LPMIXER_INFO MixerInfo;
164 PMIXER_LIST MixerList;
165 ULONG Index = 0;
166
167 /* get mixer list */
169
170 if (!MixerList->MixerListCount)
171 return NULL;
172
173 Entry = MixerList->MixerList.Flink;
174
175 while(Entry != &MixerList->MixerList)
176 {
178
179 if (Index == MixerIndex)
180 return MixerInfo;
181
182 /* move to next mixer entry */
183 Index++;
184 Entry = Entry->Flink;
185 }
186
187 return NULL;
188}
if(dx< 0)
Definition: linetemp.h:194
struct MIXER_LIST * PMIXER_LIST
PVOID MixerContext
Definition: mmixer.h:92
ULONG MixerListCount
Definition: precomp.h:149
LIST_ENTRY MixerList
Definition: precomp.h:150

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 965 of file topology.c.

972{
974 ULONG TopologyNodesCount;
975 ULONG Index;
976
977 /* sanity check */
978 ASSERT(NodeIndex < Topology->TopologyNodesCount);
979
980 if (bUpStream)
981 {
982 /* get up stream nodes */
983 TopologyNodes = Topology->TopologyNodes[NodeIndex].NodeConnectedFrom;
984 TopologyNodesCount = Topology->TopologyNodes[NodeIndex].NodeConnectedFromCount;
985 }
986 else
987 {
988 /* get down stream nodes */
989 TopologyNodes = Topology->TopologyNodes[NodeIndex].NodeConnectedTo;
990 TopologyNodesCount = Topology->TopologyNodes[NodeIndex].NodeConnectedToCount;
991 }
992
993 /* store topology nodes ids */
994 for(Index = 0; Index < TopologyNodesCount; Index++)
995 {
996 OutNodes[Index] = TopologyNodes[Index]->NodeIndex;
997 }
998
999 /* store topology nodes count */
1000 *OutNodesCount = TopologyNodesCount;
1001}

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 922 of file topology.c.

929{
930 PPIN Pin;
932 ULONG TopologyNodesCount;
933 ULONG Index;
934
935 /* sanity check */
936 ASSERT(PinIndex < Topology->TopologyPinsCount);
937
938 /* get pin */
939 Pin = &Topology->TopologyPins[PinIndex];
940
941 if (bUpStream)
942 {
943 /* get up stream nodes */
944 TopologyNodes = Pin->NodesConnectedFrom;
945 TopologyNodesCount = Pin->NodesConnectedFromCount;
946 }
947 else
948 {
949 /* get down stream nodes */
950 TopologyNodes = Pin->NodesConnectedTo;
951 TopologyNodesCount = Pin->NodesConnectedToCount;
952 }
953
954 /* store topology nodes ids */
955 for(Index = 0; Index < TopologyNodesCount; Index++)
956 {
957 OutNodes[Index] = TopologyNodes[Index]->NodeIndex;
958 }
959
960 /* store topology nodes count */
961 *OutNodesCount = TopologyNodesCount;
962}

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 691 of file topology.c.

694{
695 ULONG Index;
696
697 for(Index = 0; Index < Topology->TopologyNodesCount; Index++)
698 {
699 if (IsEqualGUIDAligned(NodeType, &Topology->TopologyNodes[Index].NodeType))
700 {
701 return Index;
702 }
703 }
704
705 return MAXULONG;
706}

Referenced by MMixerSetupFilter().

◆ MMixerGetNodeType()

LPGUID MMixerGetNodeType ( IN PKSMULTIPLE_ITEM  MultipleItem,
IN ULONG  Index 
)

Definition at line 242 of file sup.c.

245{
247
248 ASSERT(Index < MultipleItem->Count);
249
250 NodeType = (LPGUID)(MultipleItem + 1);
251 return &NodeType[Index];
252}
#define NodeType(P)
Definition: nodetype.h:51
int Count
Definition: noreturn.cpp:7
GUID * LPGUID
Definition: guiddef.h:81

◆ MMixerGetNodeTypeFromTopology()

LPGUID MMixerGetNodeTypeFromTopology ( IN PTOPOLOGY  Topology,
IN ULONG  NodeIndex 
)

Definition at line 1184 of file topology.c.

1187{
1188 /* sanity check */
1189 ASSERT(NodeIndex < Topology->TopologyNodesCount);
1190
1191 return &Topology->TopologyNodes[NodeIndex].NodeType;
1192}

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{
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
#define DPRINT
Definition: sndvol32.h:71

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{
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 */
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}
DataFlow
@ KSPROPERTY_PIN_COMMUNICATION
Definition: ks.h:632
@ KSPROPERTY_PIN_DATAFLOW
Definition: ks.h:627
KSPIN_DATAFLOW
Definition: ks.h:1248
KSPIN_COMMUNICATION
Definition: ks.h:1253

Referenced by MMixerCheckFilterPinMidiSupport(), and MMixerGetComponentAndTargetType().

◆ MMixerGetSourceMixerLineByComponentType()

LPMIXERLINE_EXT MMixerGetSourceMixerLineByComponentType ( LPMIXER_INFO  MixerInfo,
DWORD  dwComponentType 
)

Definition at line 255 of file sup.c.

258{
260 LPMIXERLINE_EXT MixerLineSrc;
261
262 /* get first entry */
263 Entry = MixerInfo->LineList.Flink;
264
265 while(Entry != &MixerInfo->LineList)
266 {
268 if (MixerLineSrc->Line.dwComponentType == dwComponentType)
269 return MixerLineSrc;
270
271 Entry = Entry->Flink;
272 }
273
274 return NULL;
275}
MIXERLINEW Line
Definition: precomp.h:89
DWORD dwComponentType
Definition: mmsystem.h:1261

Referenced by MMixerGetLineInfo().

◆ MMixerGetSourceMixerLineByLineId()

LPMIXERLINE_EXT MMixerGetSourceMixerLineByLineId ( LPMIXER_INFO  MixerInfo,
DWORD  dwLineID 
)

Definition at line 218 of file sup.c.

221{
223 LPMIXERLINE_EXT MixerLineSrc;
224
225 /* get first entry */
226 Entry = MixerInfo->LineList.Flink;
227
228 while(Entry != &MixerInfo->LineList)
229 {
231 DPRINT("dwLineID %x dwLineID %x MixerLineSrc %p\n", MixerLineSrc->Line.dwLineID, dwLineID, MixerLineSrc);
232 if (MixerLineSrc->Line.dwLineID == dwLineID)
233 return MixerLineSrc;
234
235 Entry = Entry->Flink;
236 }
237
238 return NULL;
239}
DWORD dwLineID
Definition: mmsystem.h:1258

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

◆ MMixerGetTopologyPinCount()

VOID MMixerGetTopologyPinCount ( IN PTOPOLOGY  Topology,
OUT PULONG  PinCount 
)

Definition at line 1004 of file topology.c.

1007{
1008 /* store pin count */
1009 *PinCount = Topology->TopologyPinsCount;
1010}

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 1676 of file controls.c.

1681{
1684 ULONG DestinationLineID, LineTerminator;
1685 LPMIXERLINE_EXT DstLine;
1686
1687 DPRINT("DeviceName %S\n", MixerData->DeviceName);
1688
1689 /* get topology pin count */
1691
1692 for(Index = 0; Index < PinCount; Index++)
1693 {
1695
1696 /* check if it has already been reserved */
1697 if (Reserved)
1698 {
1699 /* pin has already been reserved */
1700 continue;
1701 }
1702
1703 DPRINT("MixerName %S Available PinID %lu\n", MixerData->DeviceName, Index);
1704
1705 /* sanity check */
1706 //ASSERT(MixerData->MixerInfo);
1707
1708 if (!MixerData->MixerInfo)
1709 {
1710 DPRINT1("Expected mixer info\n");
1711 continue;
1712 }
1713
1714 /* build the destination line */
1715 Status = MMixerBuildMixerDestinationLine(MixerContext, MixerData->MixerInfo, MixerData->hDevice, Index, TRUE);
1717 {
1718 /* failed to build destination line */
1719 continue;
1720 }
1721
1722 /* calculate destination line id */
1723 DestinationLineID = (DESTINATION_LINE + MixerData->MixerInfo->MixCaps.cDestinations-1);
1724
1725 /* add mixer controls to destination line */
1726 Status = MMixerAddMixerControlsToDestinationLine(MixerContext, MixerData->MixerInfo, MixerData->hDevice, MixerData->Topology, Index, TRUE, DestinationLineID, &LineTerminator);
1728 {
1729 /* now add the rest of the source lines */
1730 Status = MMixerAddMixerSourceLines(MixerContext, MixerData->MixerInfo, MixerData->hDevice, MixerData->Topology, DestinationLineID, LineTerminator);
1731 }
1732
1733 /* mark pin as consumed */
1735
1736 /* now grab destination line */
1737 DstLine = MMixerGetSourceMixerLineByLineId(MixerData->MixerInfo, DestinationLineID);
1738
1739 /* set type and target as undefined */
1741 DstLine->Line.Target.dwType = MIXERLINE_TARGETTYPE_UNDEFINED;
1742 DstLine->Line.Target.vDriverVersion = 0;
1743 DstLine->Line.Target.wMid = 0;
1744 DstLine->Line.Target.wPid = 0;
1745 }
1746}
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:1030
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:1163
MIXER_STATUS MMixerBuildMixerDestinationLine(IN PMIXER_CONTEXT MixerContext, IN OUT LPMIXER_INFO MixerInfo, IN HANDLE hMixer, IN ULONG PinId, IN ULONG bInput)
Definition: controls.c:350
#define TRUE
Definition: types.h:120
#define MIXERLINE_COMPONENTTYPE_DST_UNDEFINED
Definition: mmsystem.h:315
#define MIXERLINE_TARGETTYPE_UNDEFINED
Definition: mmsystem.h:338
VOID MMixerGetTopologyPinCount(IN PTOPOLOGY Topology, OUT PULONG PinCount)
Definition: topology.c:1004
VOID MMixerIsTopologyPinReserved(IN PTOPOLOGY Topology, IN ULONG PinId, OUT PULONG bReserved)
Definition: topology.c:1207
VOID MMixerSetTopologyPinReserved(IN PTOPOLOGY Topology, IN ULONG PinId)
Definition: topology.c:1195
#define DESTINATION_LINE
Definition: precomp.h:176
LPMIXERLINE_EXT MMixerGetSourceMixerLineByLineId(LPMIXER_INFO MixerInfo, DWORD dwLineID)
Definition: sup.c:218
struct tagMIXERLINEW::@3046 Target
_Reserved_ PVOID Reserved
Definition: winddi.h:3974

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 */
201 {
202 /* check if there is support KSDATARANGE_MUSIC */
203 MMixerCheckFilterPinMidiSupport(MixerContext, MixerList, MixerData, Index, MultipleItem, szPname);
204 }
205 }
206}
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
MIXER_STATUS MMixerGetDeviceName(IN PMIXER_CONTEXT MixerContext, OUT LPWSTR DeviceName, IN HANDLE hKey)
Definition: sup.c:852
MIXER_STATUS MMixerGetAudioPinDataRanges(IN PMIXER_CONTEXT MixerContext, IN HANDLE hDevice, IN ULONG PinId, IN OUT PKSMULTIPLE_ITEM *OutMultipleItem)
Definition: wave.c:157

◆ 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:1386
#define KSMEDIUM_TYPE_ANYINSTANCE
Definition: ks.h:301
#define KSMEDIUMSETID_Standard
Definition: ks.h:306
@ KSINTERFACE_STANDARD_STREAMING
Definition: ks.h:283
#define KSINTERFACESETID_Standard
Definition: ks.h:280

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 347 of file wave.c.

355{
357 PKSMULTIPLE_ITEM MultipleItem;
358 PKSDATARANGE_AUDIO DataRangeAudio;
359 LPWAVE_INFO WaveInfo;
360
361 WaveInfo = (LPWAVE_INFO)MixerContext->Alloc(sizeof(WAVE_INFO));
362 if (!WaveInfo)
363 return MM_STATUS_NO_MEMORY;
364
365 if (PinCount > 1)
366 {
367 /* FIXME support multiple pins for wave device */
368 DPRINT1("Implement support for multiple pins\n");
369 //ASSERT(PinCount == 1);
370 }
371
372 /* initialize wave info */
373 WaveInfo->DeviceId = MixerData->DeviceId;
374 WaveInfo->PinId = Pins[0];
375
376 /* sanity check */
378
379 /* copy device name */
380 if (bWaveIn)
381 {
382 wcscpy(WaveInfo->u.InCaps.szPname, DeviceName);
383 }
384 else
385 {
386 wcscpy(WaveInfo->u.OutCaps.szPname, DeviceName);
387 }
388
389 /* FIXME determine manufacturer / product id */
390 if (bWaveIn)
391 {
392 WaveInfo->u.InCaps.wMid = MM_MICROSOFT;
393 WaveInfo->u.InCaps.wPid = MM_PID_UNMAPPED;
394 WaveInfo->u.InCaps.vDriverVersion = 1;
395 }
396 else
397 {
398 WaveInfo->u.OutCaps.wMid = MM_MICROSOFT;
399 WaveInfo->u.OutCaps.wPid = MM_PID_UNMAPPED;
400 WaveInfo->u.OutCaps.vDriverVersion = 1;
401 }
402
403 /* get audio pin data ranges */
404 Status = MMixerGetAudioPinDataRanges(MixerContext, MixerData->hDevice, Pins[0], &MultipleItem);
406 {
407 /* failed to get audio pin data ranges */
408 MixerContext->Free(WaveInfo);
410 }
411
412 /* find an KSDATARANGE_AUDIO range */
413 Status = MMixerFindAudioDataRange(MultipleItem, &DataRangeAudio);
415 {
416 /* failed to find audio pin data range */
417 MixerContext->Free(MultipleItem);
418 MixerContext->Free(WaveInfo);
420 }
421
422 /* store channel count */
423 if (bWaveIn)
424 {
425 WaveInfo->u.InCaps.wChannels = DataRangeAudio->MaximumChannels;
426 }
427 else
428 {
429 WaveInfo->u.OutCaps.wChannels = DataRangeAudio->MaximumChannels;
430 }
431
432 /* get all supported formats */
433 MMixerCheckFormat(DataRangeAudio, WaveInfo, bWaveIn);
434
435 /* free dataranges buffer */
436 MixerContext->Free(MultipleItem);
437
438 if (bWaveIn)
439 {
440 InsertTailList(&MixerList->WaveInList, &WaveInfo->Entry);
441 MixerList->WaveInListCount++;
442 }
443 else
444 {
445 InsertTailList(&MixerList->WaveOutList, &WaveInfo->Entry);
446 MixerList->WaveOutListCount++;
447 }
448
449 return MM_STATUS_SUCCESS;
450}
#define MM_PID_UNMAPPED
Definition: mmreg.h:141
#define MM_MICROSOFT
Definition: mmreg.h:144
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
struct WAVE_INFO * LPWAVE_INFO
VOID MMixerCheckFormat(IN PKSDATARANGE_AUDIO DataRangeAudio, IN LPWAVE_INFO WaveInfo, IN ULONG bInput)
Definition: wave.c:298
MIXER_STATUS MMixerFindAudioDataRange(PKSMULTIPLE_ITEM MultipleItem, PKSDATARANGE_AUDIO *OutDataRangeAudio)
Definition: wave.c:202
MIXER_STATUS MMixerGetAudioPinDataRanges(IN PMIXER_CONTEXT MixerContext, IN HANDLE hDevice, IN ULONG PinId, IN OUT PKSMULTIPLE_ITEM *OutMultipleItem)
Definition: wave.c:157
ULONG MaximumChannels
Definition: ksmedia.h:680
LIST_ENTRY Entry
Definition: precomp.h:124
ULONG DeviceId
Definition: precomp.h:125
ULONG PinId
Definition: precomp.h:126
WAVEOUTCAPSW OutCaps
Definition: precomp.h:129
union WAVE_INFO::@4335 u
WAVEINCAPSW InCaps
Definition: precomp.h:130
WCHAR szPname[MAXPNAMELEN]
Definition: mmsystem.h:1060
MMVERSION vDriverVersion
Definition: mmsystem.h:1059
MMVERSION vDriverVersion
Definition: mmsystem.h:1038
WCHAR szPname[MAXPNAMELEN]
Definition: mmsystem.h:1039

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 1112 of file topology.c.

1119{
1121 ULONG Index, PinsCount;
1122 PULONG Pins;
1123
1124 /* allocate pin index array */
1126
1128 {
1129 /* failed to allocate */
1130 return Status;
1131 }
1132
1133 /* now get connected pins */
1134 PinsCount = 0;
1135 MMixerGetAllUpOrDownstreamPinsFromNodeIndex(MixerContext, Topology, NodeIndex, bUpStream, &PinsCount, Pins);
1136
1137 /* set to false */
1138 *bConnected = FALSE;
1139
1140 for(Index = 0; Index < PinsCount; Index++)
1141 {
1142 if (Pins[Index] == PinId)
1143 {
1144 /* pin is connected */
1145 *bConnected = TRUE;
1146 break;
1147 }
1148 }
1149
1150 /* free pin index array */
1151 MixerContext->Free(Pins);
1152
1153 /* done */
1154 return MM_STATUS_SUCCESS;
1155}
#define FALSE
Definition: types.h:117
BOOL bConnected
Definition: fdebug.c:27
MIXER_STATUS MMixerAllocateTopologyPinArray(IN PMIXER_CONTEXT MixerContext, IN PTOPOLOGY Topology, OUT PULONG *OutPins)
Definition: topology.c:1013

Referenced by MMixerAddMixerSourceLines().

◆ MMixerIsNodeTerminator()

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

Definition at line 1077 of file topology.c.

1081{
1082 /* sanity check */
1083 ASSERT(NodeIndex < Topology->TopologyNodesCount);
1084
1085 /* check if node has multiple parents */
1086 if (Topology->TopologyNodes[NodeIndex].NodeConnectedFromCount > 1)
1087 {
1088 /* node is connected to multiple other nodes */
1089 *bTerminator = TRUE;
1090
1091 /* done */
1092 return;
1093 }
1094
1095 /* check if node is mux / sum node */
1096 if (IsEqualGUIDAligned(&Topology->TopologyNodes[NodeIndex].NodeType, &KSNODETYPE_SUM) ||
1097 IsEqualGUIDAligned(&Topology->TopologyNodes[NodeIndex].NodeType, &KSNODETYPE_MUX))
1098 {
1099 /* classic terminator */
1100 *bTerminator = TRUE;
1101
1102 /* done */
1103 return;
1104
1105 }
1106
1107 /* node is not a terminator */
1108 *bTerminator = FALSE;
1109}
#define KSNODETYPE_SUM
Definition: ksmedia.h:363

Referenced by MMixerCountMixerControls().

◆ MMixerIsTopologyNodeReserved()

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

Definition at line 1232 of file topology.c.

1236{
1237 /* sanity check */
1238 ASSERT(NodeIndex < Topology->TopologyNodesCount);
1239
1240 /* get reserved status */
1241 *bReserved = Topology->TopologyNodes[NodeIndex].Reserved;
1242}

Referenced by MMixerAddMixerControlsToMixerLineByNodeIndexArray().

◆ MMixerIsTopologyPinReserved()

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

Definition at line 1207 of file topology.c.

1211{
1212 /* sanity check */
1213 ASSERT(PinId < Topology->TopologyPinsCount);
1214
1215 /* get reserved status */
1216 *bReserved = Topology->TopologyPins[PinId].Reserved;
1217}

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 1875 of file controls.c.

1880{
1881 PLIST_ENTRY EventList;
1883
1884 /* Lookup through mixers */
1885 EventList = MixerInfo->EventList.Flink;
1886 while(EventList != &MixerInfo->EventList)
1887 {
1889 EventList = EventList->Flink;
1890 /* TODO: find a better way to identify an event ? */
1891 if(NotificationEntry->MixerEventRoutine == MixerEventRoutine &&
1892 NotificationEntry->MixerEventContext == MixerEventContext)
1893 {
1894 DPRINT1("Freeing entry %p\n", NotificationEntry);
1895 /* We found the event to remove */
1898 }
1899 }
1900 return MM_STATUS_SUCCESS;
1901}
#define RemoveEntryList(Entry)
Definition: env_spec_w32.h:986
_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

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}
#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().

◆ 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 364 of file sup.c.

371{
373 LONG Value;
375
376 if (MixerControlDetails->cbDetails != sizeof(MIXERCONTROLDETAILS_BOOLEAN))
378
379 /* get input */
380 Input = (LPMIXERCONTROLDETAILS_BOOLEAN)MixerControlDetails->paDetails;
381
382 /* FIXME SEH */
383 if (bSet)
384 Value = Input->fValue;
385
386 /* set control details */
387 Status = MMixerSetGetControlDetails(MixerContext, MixerControl->hDevice, MixerControl->NodeID, bSet, KSPROPERTY_AUDIO_MUTE, 0, &Value);
388
390 return Status;
391
392 /* FIXME SEH */
393 if (!bSet)
394 {
395 Input->fValue = Value;
396 return Status;
397 }
398 else
399 {
400 /* notify wdmaud clients MM_MIXM_LINE_CHANGE dwLineID */
402 }
403
404 return Status;
405}
@ KSPROPERTY_AUDIO_MUTE
Definition: ksmedia.h:1066
@ MM_STATUS_INVALID_PARAMETER
Definition: mmixer.h:10
struct tMIXERCONTROLDETAILS_BOOLEAN * LPMIXERCONTROLDETAILS_BOOLEAN
#define MM_MIXM_LINE_CHANGE
Definition: mmsystem.h:82
@ Input
Definition: arc.h:84
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
VOID MMixerNotifyControlChange(IN PMIXER_CONTEXT MixerContext, IN LPMIXER_INFO MixerInfo, IN ULONG NotificationType, IN ULONG Value)
Definition: sup.c:336

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 665 of file sup.c.

673{
675 LONG Value;
676 ULONG Index, Channel = 0;
677 ULONG dwValue;
679 LPMIXERVOLUME_DATA VolumeData;
680
681 if (MixerControlDetails->cbDetails != sizeof(MIXERCONTROLDETAILS_SIGNED))
683
684 VolumeData = (LPMIXERVOLUME_DATA)MixerControl->ExtraData;
685 if (!VolumeData)
687
688 /* get input */
689 Input = (LPMIXERCONTROLDETAILS_UNSIGNED)MixerControlDetails->paDetails;
690 if (!Input)
691 return MM_STATUS_UNSUCCESSFUL; /* to prevent dereferencing NULL */
692
693 if (bSet)
694 {
695 /* FIXME SEH */
696 Value = Input->dwValue;
697 Index = Value / VolumeData->InputSteppingDelta;
698
699 if (Index >= VolumeData->ValuesCount)
700 {
701 DPRINT1("Index %u out of bounds %u \n", Index, VolumeData->ValuesCount);
703 }
704
705 Value = VolumeData->Values[Index];
706 }
707
708 /* set control details */
709 if (bSet)
710 {
711 /* TODO */
714 }
715 else
716 {
718 }
719
720 if (!bSet)
721 {
722 dwValue = MMixerGetVolumeControlIndex(VolumeData, (LONG)Value);
723 /* FIXME SEH */
724 Input->dwValue = dwValue;
725 }
726 else
727 {
728 /* notify clients of a line change MM_MIXM_CONTROL_CHANGE with MixerControl->dwControlID */
730 }
731 return Status;
732}
@ KSPROPERTY_AUDIO_VOLUMELEVEL
Definition: ksmedia.h:1057
#define MM_MIXM_CONTROL_CHANGE
Definition: mmsystem.h:83
struct tMIXERCONTROLDETAILS_UNSIGNED * LPMIXERCONTROLDETAILS_UNSIGNED
struct MIXERVOLUME_DATA * LPMIXERVOLUME_DATA
ULONG MMixerGetVolumeControlIndex(LPMIXERVOLUME_DATA VolumeData, LONG Value)
Definition: sup.c:319
HANDLE hDevice
Definition: precomp.h:81
PVOID ExtraData
Definition: precomp.h:82
ULONG ValuesCount
Definition: precomp.h:107
ULONG InputSteppingDelta
Definition: precomp.h:106

Referenced by MMixerGetControlDetails(), and MMixerSetControlDetails().

◆ MMixerSetTopologyNodeReserved()

VOID MMixerSetTopologyNodeReserved ( IN PTOPOLOGY  Topology,
IN ULONG  NodeIndex 
)

Definition at line 1220 of file topology.c.

1223{
1224 /* sanity check */
1225 ASSERT(NodeIndex < Topology->TopologyNodesCount);
1226
1227 /* set reserved */
1228 Topology->TopologyNodes[NodeIndex].Reserved = TRUE;
1229}

Referenced by MMixerAddMixerControlsToMixerLineByNodeIndexArray().

◆ MMixerSetTopologyPinReserved()

VOID MMixerSetTopologyPinReserved ( IN PTOPOLOGY  Topology,
IN ULONG  PinId 
)

Definition at line 1195 of file topology.c.

1198{
1199 /* sanity check */
1200 ASSERT(PinId < Topology->TopologyPinsCount);
1201
1202 /* set reserved */
1203 Topology->TopologyPins[PinId].Reserved = TRUE;
1204}

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 1749 of file controls.c.

1754{
1756 PTOPOLOGY Topology;
1757 ULONG NodeIndex;
1758 LPMIXER_INFO MixerInfo = NULL;
1759
1760 /* check if topology has already been built */
1761 if (MixerData->Topology == NULL)
1762 {
1763 /* build topology */
1764 Status = MMixerBuildTopology(MixerContext, MixerData, &Topology);
1765
1767 {
1768 /* failed to build topology */
1769 return Status;
1770 }
1771
1772 /* store topology */
1773 MixerData->Topology = Topology;
1774 }
1775 else
1776 {
1777 /* re-use topology */
1778 Topology = MixerData->Topology;
1779 }
1780
1781 /* check if the filter has an wave out node */
1782 NodeIndex = MMixerGetNodeIndexFromGuid(Topology, &KSNODETYPE_DAC);
1783 if (NodeIndex != MAXULONG)
1784 {
1785 /* it has */
1786 Status = MMixerInitializeFilter(MixerContext, MixerList, MixerData, NULL, Topology, NodeIndex, FALSE, &MixerInfo);
1787
1788 /* check for success */
1790 {
1791 /* increment mixer count */
1792 (*DeviceCount)++;
1793 }
1794 else
1795 {
1796 /* reset mixer info in case of error */
1797 MixerInfo = NULL;
1798 }
1799 }
1800
1801 /* check if the filter has an wave in node */
1802 NodeIndex = MMixerGetNodeIndexFromGuid(Topology, &KSNODETYPE_ADC);
1803 if (NodeIndex != MAXULONG)
1804 {
1805 /* it has */
1806 Status = MMixerInitializeFilter(MixerContext, MixerList, MixerData, MixerInfo, Topology, NodeIndex, TRUE, &MixerInfo);
1807
1808 /* check for success */
1810 {
1811 /* increment mixer count */
1812 (*DeviceCount)++;
1813 }
1814
1815 }
1816
1817 /* TODO: apply hacks for Wave source line */
1818
1819 /* activate midi devices */
1820 //MMixerInitializeMidiForFilter(MixerContext, MixerList, MixerData, Topology);
1821
1822 /* done */
1823 return Status;
1824}
MIXER_STATUS MMixerBuildTopology(IN PMIXER_CONTEXT MixerContext, IN LPMIXER_DATA MixerData, OUT PTOPOLOGY *OutTopology)
Definition: controls.c:381
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:1514
#define KSNODETYPE_ADC
Definition: ksmedia.h:262
#define KSNODETYPE_DAC
Definition: ksmedia.h:287
ULONG MMixerGetNodeIndexFromGuid(IN PTOPOLOGY Topology, IN const GUID *NodeType)
Definition: topology.c:691

Referenced by MMixerInitialize().

◆ MMixerVerifyContext()

MIXER_STATUS MMixerVerifyContext ( IN PMIXER_CONTEXT  MixerContext)