ReactOS 0.4.15-dev-6644-g539123c
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 1834 of file controls.c.

1839{
1840 //KSE_NODE Property;
1841 //KSEVENTDATA EventData
1842 //ULONG BytesReturned;
1843 //MIXER_STATUS Status;
1844 PEVENT_NOTIFICATION_ENTRY EventNotification;
1845
1847 if (!EventNotification)
1848 {
1849 /* not enough memory */
1850 return MM_STATUS_NO_MEMORY;
1851 }
1852
1853 /* FIXME: what is it supposed to happen with KSEVENTDATA ? */
1854#if 0
1855 /* setup request */
1859
1860 Property.NodeId = NodeId;
1861 Property.Reserved = 0;
1862
1863 Status = MixerContext->Control(MixerInfo->hMixer, IOCTL_KS_ENABLE_EVENT, (PVOID)&Property, sizeof(KSP_NODE), (PVOID)EventData, sizeof(KSEVENTDATA), &BytesReturned);
1865 {
1866 /* failed to add event */
1867 MixerContext->FreeEventData(EventData);
1868 return Status;
1869 }
1870#endif
1871
1872 /* initialize notification entry */
1873 EventNotification->MixerEventContext = MixerEventContext;
1874 EventNotification->MixerEventRoutine = MixerEventRoutine;
1875
1876 /* store event */
1877 InsertTailList(&MixerInfo->EventList, &EventNotification->Entry);
1878 return MM_STATUS_SUCCESS;
1879}
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 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}
#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 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}

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

788{
789 LPMIXER_DATA MixerData;
790
791 MixerData = (LPMIXER_DATA)MixerContext->Alloc(sizeof(MIXER_DATA));
792 if (!MixerData)
793 return MM_STATUS_NO_MEMORY;
794
795 MixerData->DeviceId = DeviceId;
796 MixerData->DeviceName = DeviceName;
797 MixerData->hDevice = hDevice;
798 MixerData->hDeviceInterfaceKey = hKey;
799 MixerData->Topology = NULL;
800
801 InsertTailList(&MixerList->MixerData, &MixerData->Entry);
802 MixerList->MixerDataCount++;
803 return MM_STATUS_SUCCESS;
804}
#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 1253 of file topology.c.

1259{
1261 PTOPOLOGY Topology;
1262
1263 /* allocate topology */
1264 Status = MMixerAllocateTopology(MixerContext, NodeTypes->Count, PinCount, &Topology);
1265
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
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
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:524
VOID MMixerInitializeTopologyNodes(IN PMIXER_CONTEXT MixerContext, IN PKSMULTIPLE_ITEM NodeTypes, IN OUT PTOPOLOGY Topology)
Definition: topology.c:122
MIXER_STATUS MMixerAllocateTopology(IN PMIXER_CONTEXT MixerContext, IN ULONG NodesCount, IN ULONG PinCount, OUT PTOPOLOGY *OutTopology)
Definition: topology.c:46
_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 116 of file sup.c.

119{
120 /* UNIMPLEMENTED;
121 * FIXME
122 * free all lines
123 */
124
125 MixerContext->Free((PVOID)MixerInfo);
126}
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 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
VOID MMixerResetTopologyVisitStatus(IN OUT PTOPOLOGY Topology)
Definition: topology.c:103

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}
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:571
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
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 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 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 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;
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;
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);
175 {
176 /* failed */
177 MixerContext->Free(MultipleItem);
178 return Status;
179 }
180
181 /* save result */
182 *OutMultipleItem = MultipleItem;
183 return Status;
184}
#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 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
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 738 of file sup.c.

741{
743 LPMIXER_DATA MixerData;
744
745 Entry = MixerList->MixerData.Flink;
746 while(Entry != &MixerList->MixerData)
747 {
749 if (MixerData->DeviceId == DeviceId)
750 {
751 return MixerData;
752 }
753 Entry = Entry->Flink;
754 }
755 return NULL;
756}
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 759 of file sup.c.

762{
764 LPMIXER_DATA MixerData;
765
766 Entry = MixerList->MixerData.Flink;
767 while(Entry != &MixerList->MixerData)
768 {
770 if (wcsicmp(&DeviceName[2], &MixerData->DeviceName[2]) == 0)
771 {
772 /* found entry */
773 return MixerData;
774 }
775 Entry = Entry->Flink;
776 }
777 return NULL;
778}
#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 855 of file sup.c.

859{
860 LPWSTR Name;
861 HANDLE hTemp;
863 ULONG Type;
865
866 Status = MixerContext->QueryKeyValue(hKey, L"FriendlyName", (PVOID*)&Name, &Length, &Type);
868 {
869 /* copy device name */
871
872 /* make sure its null terminated */
873 DeviceName[MAXPNAMELEN-1] = L'\0';
874
875 /* free device name */
877
878 /* done */
879 return Status;
880 }
881
882 Status = MixerContext->OpenKey(hKey, L"Device Parameters", KEY_READ, &hTemp);
884 return Status;
885
886 Status = MixerContext->QueryKeyValue(hTemp, L"FriendlyName", (PVOID*)&Name, &Length, &Type);
888 {
889 /* copy device name */
891
892 /* make sure its null terminated */
893 DeviceName[MAXPNAMELEN-1] = L'\0';
894
895 /* free device name */
897 }
898
899 MixerContext->CloseKey(hTemp);
900 return Status;
901}
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 807 of file sup.c.

811{
817 ULONG ResultLength, KeyType;
818 HANDLE hMediaKey, hGuidKey;
820
821 /* prepare property */
825
826 /* try get component id */
828
830 {
831 Status = MixerContext->OpenKey(NULL, L"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Control\\MediaCategories", KEY_READ, &hMediaKey);
833 {
835 Status = MixerContext->OpenKey(hMediaKey, GuidString.Buffer, KEY_READ, &hGuidKey);
838 {
839 Status = MixerContext->QueryKeyValue(hGuidKey, L"Name", (PVOID*)&DeviceName, &ResultLength, &KeyType);
841 {
842 MixerContext->Copy(OutDeviceName, DeviceName, min(ResultLength, (MAXPNAMELEN-1)*2));
844 }
845
846 MixerContext->CloseKey(hGuidKey);
847 }
848 MixerContext->CloseKey(hMediaKey);
849 }
850 }
851 return Status;
852}
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 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
218}
#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 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
319}
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 161 of file sup.c.

164{
165 LPMIXER_INFO MixerInfo;
167 PMIXER_LIST MixerList;
168 ULONG Index = 0;
169
170 /* get mixer list */
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}
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 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}

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}

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}

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}
#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 1191 of file topology.c.

1194{
1195 /* sanity check */
1196 ASSERT(NodeIndex < Topology->TopologyNodesCount);
1197
1198 return &Topology->TopologyNodes[NodeIndex].NodeType;
1199}

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 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
DWORD dwComponentType
Definition: mmsystem.h:1261

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

1014{
1015 /* store pin count */
1016 *PinCount = Topology->TopologyPinsCount;
1017}

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

1687{
1690 ULONG DestinationLineID, LineTerminator;
1691 LPMIXERLINE_EXT DstLine;
1692
1693 DPRINT("DeviceName %S\n", MixerData->DeviceName);
1694
1695 /* get topology pin count */
1697
1698 for(Index = 0; Index < PinCount; Index++)
1699 {
1701
1702 /* check if it has already been reserved */
1703 if (Reserved)
1704 {
1705 /* pin has already been reserved */
1706 continue;
1707 }
1708
1709 DPRINT("MixerName %S Available PinID %lu\n", MixerData->DeviceName, Index);
1710
1711 /* sanity check */
1712 //ASSERT(MixerData->MixerInfo);
1713
1714 if (!MixerData->MixerInfo)
1715 {
1716 DPRINT1("Expected mixer info\n");
1717 continue;
1718 }
1719
1720 /* build the destination line */
1721 Status = MMixerBuildMixerDestinationLine(MixerContext, MixerData->MixerInfo, MixerData->hDevice, Index, TRUE);
1723 {
1724 /* failed to build destination line */
1725 continue;
1726 }
1727
1728 /* calculate destination line id */
1729 DestinationLineID = (DESTINATION_LINE + MixerData->MixerInfo->MixCaps.cDestinations-1);
1730
1731 /* add mixer controls to destination line */
1732 Status = MMixerAddMixerControlsToDestinationLine(MixerContext, MixerData->MixerInfo, MixerData->hDevice, MixerData->Topology, Index, TRUE, DestinationLineID, &LineTerminator);
1734 {
1735 /* now add the rest of the source lines */
1736 Status = MMixerAddMixerSourceLines(MixerContext, MixerData->MixerInfo, MixerData->hDevice, MixerData->Topology, DestinationLineID, LineTerminator);
1737 }
1738
1739 /* mark pin as consumed */
1741
1742 /* now grab destination line */
1743 DstLine = MMixerGetSourceMixerLineByLineId(MixerData->MixerInfo, DestinationLineID);
1744
1745 /* set type and target as undefined */
1747 DstLine->Line.Target.dwType = MIXERLINE_TARGETTYPE_UNDEFINED;
1748 DstLine->Line.Target.vDriverVersion = 0;
1749 DstLine->Line.Target.wMid = 0;
1750 DstLine->Line.Target.wPid = 0;
1751 }
1752}
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_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
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
#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:1011
VOID MMixerIsTopologyPinReserved(IN PTOPOLOGY Topology, IN ULONG PinId, OUT PULONG bReserved)
Definition: topology.c:1214
VOID MMixerSetTopologyPinReserved(IN PTOPOLOGY Topology, IN ULONG PinId)
Definition: topology.c:1202
#define DESTINATION_LINE
Definition: precomp.h:176
LPMIXERLINE_EXT MMixerGetSourceMixerLineByLineId(LPMIXER_INFO MixerInfo, DWORD dwLineID)
Definition: sup.c:221
struct tagMIXERLINEW::@3023 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:855
MIXER_STATUS MMixerGetAudioPinDataRanges(IN PMIXER_CONTEXT MixerContext, IN HANDLE hDevice, IN ULONG PinId, IN OUT PKSMULTIPLE_ITEM *OutMultipleItem)
Definition: wave.c:142

◆ MMixerInitializePinConnect()

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

Definition at line 904 of file sup.c.

907{
908 PinConnect->Interface.Set = KSINTERFACESETID_Standard;
909 PinConnect->Interface.Id = KSINTERFACE_STANDARD_STREAMING;
910 PinConnect->Interface.Flags = 0;
911 PinConnect->Medium.Set = KSMEDIUMSETID_Standard;
912 PinConnect->Medium.Id = KSMEDIUM_TYPE_ANYINSTANCE;
913 PinConnect->Medium.Flags = 0;
914 PinConnect->PinToHandle = NULL;
915 PinConnect->PinId = PinId;
916 PinConnect->Priority.PriorityClass = KSPRIORITY_NORMAL;
917 PinConnect->Priority.PrioritySubClass = 1;
918}
#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 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);
389 {
390 /* failed to get audio pin data ranges */
391 MixerContext->Free(WaveInfo);
393 }
394
395 /* find an KSDATARANGE_AUDIO range */
396 Status = MMixerFindAudioDataRange(MultipleItem, &DataRangeAudio);
398 {
399 /* failed to find audio pin data range */
400 MixerContext->Free(MultipleItem);
401 MixerContext->Free(WaveInfo);
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}
#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:279
MIXER_STATUS MMixerFindAudioDataRange(PKSMULTIPLE_ITEM MultipleItem, PKSDATARANGE_AUDIO *OutDataRangeAudio)
Definition: wave.c:187
MIXER_STATUS MMixerGetAudioPinDataRanges(IN PMIXER_CONTEXT MixerContext, IN HANDLE hDevice, IN ULONG PinId, IN OUT PKSMULTIPLE_ITEM *OutMultipleItem)
Definition: wave.c:142
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::@4130 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 1119 of file topology.c.

1126{
1128 ULONG Index, PinsCount;
1129 PULONG Pins;
1130
1131 /* allocate pin index array */
1133
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 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:1020

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 KSNODETYPE_SUM
Definition: ksmedia.h:363

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}

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}

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

1887{
1888 PLIST_ENTRY EventList;
1890
1891 /* Lookup through mixers */
1892 EventList = MixerInfo->EventList.Flink;
1893 while(EventList != &MixerInfo->EventList)
1894 {
1896 EventList = EventList->Flink;
1897 /* TODO: find a better way to identify an event ? */
1898 if(NotificationEntry->MixerEventRoutine == MixerEventRoutine &&
1899 NotificationEntry->MixerEventContext == MixerEventContext)
1900 {
1901 DPRINT1("Freeing entry %p\n", NotificationEntry);
1902 /* We found the event to remove */
1905 }
1906 }
1907 return MM_STATUS_SUCCESS;
1908}
#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 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
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}
@ 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:339

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)
690
691 /* get input */
692 Input = (LPMIXERCONTROLDETAILS_UNSIGNED)MixerControlDetails->paDetails;
693 if (!Input)
694 return MM_STATUS_UNSUCCESSFUL; /* to prevent dereferencing NULL */
695
696 if (bSet)
697 {
698 /* FIXME SEH */
699 Value = Input->dwValue;
700 Index = Value / VolumeData->InputSteppingDelta;
701
702 if (Index >= VolumeData->ValuesCount)
703 {
704 DPRINT1("Index %u out of bounds %u \n", Index, VolumeData->ValuesCount);
706 }
707
708 Value = VolumeData->Values[Index];
709 }
710
711 /* set control details */
712 if (bSet)
713 {
714 /* TODO */
717 }
718 else
719 {
721 }
722
723 if (!bSet)
724 {
725 dwValue = MMixerGetVolumeControlIndex(VolumeData, (LONG)Value);
726 /* FIXME SEH */
727 Input->dwValue = dwValue;
728 }
729 else
730 {
731 /* notify clients of a line change MM_MIXM_CONTROL_CHANGE with MixerControl->dwControlID */
733 }
734 return Status;
735}
@ 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:322
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 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}

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}

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

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

Referenced by MMixerInitialize().

◆ MMixerVerifyContext()

MIXER_STATUS MMixerVerifyContext ( IN PMIXER_CONTEXT  MixerContext)