ReactOS 0.4.15-dev-5672-gf73ac17
mmixer.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  MIXER_CONTEXT
 

Typedefs

typedef PVOID(* PMIXER_ALLOC) (IN ULONG NumberOfBytes)
 
typedef VOID(* PMIXER_FREE) (IN PVOID Block)
 
typedef MIXER_STATUS(* PMIXER_ENUM) (IN PVOID EnumContext, IN ULONG DeviceIndex, OUT LPWSTR *DeviceName, OUT PHANDLE OutHandle, OUT PHANDLE OutDevInterfaceKey)
 
typedef MIXER_STATUS(* PMIXER_DEVICE_CONTROL) (IN HANDLE hMixer, IN ULONG dwIoControlCode, IN PVOID lpInBuffer, IN ULONG nInBufferSize, OUT PVOID lpOutBuffer, ULONG nOutBufferSize, PULONG lpBytesReturned)
 
typedef MIXER_STATUS(* PMIXER_OPEN) (IN LPWSTR DevicePath, OUT PHANDLE hDevice)
 
typedef MIXER_STATUS(* PMIXER_CLOSE) (IN HANDLE hDevice)
 
typedef MIXER_STATUS(* PMIXER_CLOSEKEY) (IN HANDLE hKey)
 
typedef VOID(CALLBACKPMIXER_EVENT) (IN PVOID MixerEventContext, IN HANDLE hMixer, IN ULONG NotificationType, IN ULONG Value)
 
typedef VOID(* PMIXER_COPY) (IN PVOID Dst, IN PVOID Src, IN ULONG Length)
 
typedef MIXER_STATUS(* PMIXER_QUERY_KEY_VALUE) (IN HANDLE hKey, IN LPWSTR KeyName, OUT PVOID *ResultBuffer, OUT PULONG ResultLength, OUT PULONG KeyType)
 
typedef MIXER_STATUS(* PMIXER_OPEN_KEY) (IN HANDLE hKey, IN LPWSTR SubKey, IN ULONG DesiredAccess, OUT PHANDLE OutKey)
 
typedef PVOID(* PMIXER_ALLOC_EVENT_DATA) (IN ULONG ExtraBytes)
 
typedef VOID(* PMIXER_FREE_EVENT_DATA) (IN PVOID EventData)
 
typedef MIXER_STATUS(* PIN_CREATE_CALLBACK) (IN PVOID Context, IN ULONG DeviceId, IN ULONG PinId, IN HANDLE hFilter, IN PKSPIN_CONNECT PinConnect, IN ACCESS_MASK DesiredAccess, OUT PHANDLE PinHandle)
 
typedef struct MIXER_CONTEXTPMIXER_CONTEXT
 

Enumerations

enum  MIXER_STATUS {
  MM_STATUS_SUCCESS = 0 , MM_STATUS_NOTINITIALIZED , MM_STATUS_NOT_IMPLEMENTED , MM_STATUS_NO_MORE_DEVICES ,
  MM_STATUS_MORE_ENTRIES , MM_STATUS_INVALID_PARAMETER , MM_STATUS_UNSUCCESSFUL , MM_STATUS_NO_MEMORY
}
 

Functions

MIXER_STATUS MMixerInitialize (IN PMIXER_CONTEXT MixerContext, IN PMIXER_ENUM EnumFunction, IN PVOID EnumContext)
 
ULONG MMixerGetCount (IN PMIXER_CONTEXT MixerContext)
 
ULONG MMixerGetWaveInCount (IN PMIXER_CONTEXT MixerContext)
 
ULONG MMixerGetWaveOutCount (IN PMIXER_CONTEXT MixerContext)
 
ULONG MMixerGetMidiInCount (IN PMIXER_CONTEXT MixerContext)
 
ULONG MMixerGetMidiOutCount (IN PMIXER_CONTEXT MixerContext)
 
MIXER_STATUS MMixerGetCapabilities (IN PMIXER_CONTEXT MixerContext, IN ULONG MixerIndex, OUT LPMIXERCAPSW MixerCaps)
 
MIXER_STATUS MMixerOpen (IN PMIXER_CONTEXT MixerContext, IN ULONG MixerId, IN PVOID MixerEventContext, IN PMIXER_EVENT MixerEventRoutine, OUT PHANDLE MixerHandle)
 
MIXER_STATUS MMixerClose (IN PMIXER_CONTEXT MixerContext, IN ULONG MixerId, IN PVOID MixerEventContext, IN PMIXER_EVENT MixerEventRoutine)
 
MIXER_STATUS MMixerGetLineInfo (IN PMIXER_CONTEXT MixerContext, IN HANDLE MixerHandle, IN ULONG MixerId, IN ULONG Flags, OUT LPMIXERLINEW MixerLine)
 
MIXER_STATUS MMixerGetLineControls (IN PMIXER_CONTEXT MixerContext, IN HANDLE MixerHandle, IN ULONG MixerId, IN ULONG Flags, OUT LPMIXERLINECONTROLSW MixerLineControls)
 
MIXER_STATUS MMixerSetControlDetails (IN PMIXER_CONTEXT MixerContext, IN HANDLE MixerHandle, IN ULONG MixerId, IN ULONG Flags, OUT LPMIXERCONTROLDETAILS MixerControlDetails)
 
MIXER_STATUS MMixerGetControlDetails (IN PMIXER_CONTEXT MixerContext, IN HANDLE MixerHandle, IN ULONG MixerId, IN ULONG Flags, OUT LPMIXERCONTROLDETAILS MixerControlDetails)
 
MIXER_STATUS MMixerWaveOutCapabilities (IN PMIXER_CONTEXT MixerContext, IN ULONG DeviceIndex, OUT LPWAVEOUTCAPSW Caps)
 
MIXER_STATUS MMixerWaveInCapabilities (IN PMIXER_CONTEXT MixerContext, IN ULONG DeviceIndex, OUT LPWAVEINCAPSW Caps)
 
MIXER_STATUS MMixerOpenWave (IN PMIXER_CONTEXT MixerContext, IN ULONG DeviceIndex, IN ULONG bWaveIn, IN LPWAVEFORMATEX WaveFormat, IN PIN_CREATE_CALLBACK CreateCallback, IN PVOID Context, OUT PHANDLE PinHandle)
 
MIXER_STATUS MMixerSetWaveStatus (IN PMIXER_CONTEXT MixerContext, IN HANDLE PinHandle, IN KSSTATE State)
 
MIXER_STATUS MMixerSetWaveResetState (IN PMIXER_CONTEXT MixerContext, IN HANDLE PinHandle, IN ULONG bBegin)
 
MIXER_STATUS MMixerGetWaveDevicePath (IN PMIXER_CONTEXT MixerContext, IN ULONG bWaveIn, IN ULONG DeviceId, OUT LPWSTR *DevicePath)
 
MIXER_STATUS MMixerMidiOutCapabilities (IN PMIXER_CONTEXT MixerContext, IN ULONG DeviceIndex, OUT LPMIDIOUTCAPSW Caps)
 
MIXER_STATUS MMixerMidiInCapabilities (IN PMIXER_CONTEXT MixerContext, IN ULONG DeviceIndex, OUT LPMIDIINCAPSW Caps)
 
MIXER_STATUS MMixerGetMidiDevicePath (IN PMIXER_CONTEXT MixerContext, IN ULONG bMidiIn, IN ULONG DeviceId, OUT LPWSTR *DevicePath)
 
MIXER_STATUS MMixerSetMidiStatus (IN PMIXER_CONTEXT MixerContext, IN HANDLE PinHandle, IN KSSTATE State)
 
MIXER_STATUS MMixerOpenMidi (IN PMIXER_CONTEXT MixerContext, IN ULONG DeviceIndex, IN ULONG bMidiIn, IN PIN_CREATE_CALLBACK CreateCallback, IN PVOID Context, OUT PHANDLE PinHandle)
 

Typedef Documentation

◆ PIN_CREATE_CALLBACK

typedef MIXER_STATUS(* PIN_CREATE_CALLBACK) (IN PVOID Context, IN ULONG DeviceId, IN ULONG PinId, IN HANDLE hFilter, IN PKSPIN_CONNECT PinConnect, IN ACCESS_MASK DesiredAccess, OUT PHANDLE PinHandle)

Definition at line 80 of file mmixer.h.

◆ PMIXER_ALLOC

typedef PVOID(* PMIXER_ALLOC) (IN ULONG NumberOfBytes)

Definition at line 18 of file mmixer.h.

◆ PMIXER_ALLOC_EVENT_DATA

typedef PVOID(* PMIXER_ALLOC_EVENT_DATA) (IN ULONG ExtraBytes)

Definition at line 74 of file mmixer.h.

◆ PMIXER_CLOSE

typedef MIXER_STATUS(* PMIXER_CLOSE) (IN HANDLE hDevice)

Definition at line 44 of file mmixer.h.

◆ PMIXER_CLOSEKEY

typedef MIXER_STATUS(* PMIXER_CLOSEKEY) (IN HANDLE hKey)

Definition at line 47 of file mmixer.h.

◆ PMIXER_CONTEXT

◆ PMIXER_COPY

typedef VOID(* PMIXER_COPY) (IN PVOID Dst, IN PVOID Src, IN ULONG Length)

Definition at line 56 of file mmixer.h.

◆ PMIXER_DEVICE_CONTROL

typedef MIXER_STATUS(* PMIXER_DEVICE_CONTROL) (IN HANDLE hMixer, IN ULONG dwIoControlCode, IN PVOID lpInBuffer, IN ULONG nInBufferSize, OUT PVOID lpOutBuffer, ULONG nOutBufferSize, PULONG lpBytesReturned)

Definition at line 31 of file mmixer.h.

◆ PMIXER_ENUM

typedef MIXER_STATUS(* PMIXER_ENUM) (IN PVOID EnumContext, IN ULONG DeviceIndex, OUT LPWSTR *DeviceName, OUT PHANDLE OutHandle, OUT PHANDLE OutDevInterfaceKey)

Definition at line 24 of file mmixer.h.

◆ PMIXER_EVENT

typedef VOID(CALLBACK * PMIXER_EVENT) (IN PVOID MixerEventContext, IN HANDLE hMixer, IN ULONG NotificationType, IN ULONG Value)

Definition at line 50 of file mmixer.h.

◆ PMIXER_FREE

typedef VOID(* PMIXER_FREE) (IN PVOID Block)

Definition at line 21 of file mmixer.h.

◆ PMIXER_FREE_EVENT_DATA

typedef VOID(* PMIXER_FREE_EVENT_DATA) (IN PVOID EventData)

Definition at line 77 of file mmixer.h.

◆ PMIXER_OPEN

typedef MIXER_STATUS(* PMIXER_OPEN) (IN LPWSTR DevicePath, OUT PHANDLE hDevice)

Definition at line 40 of file mmixer.h.

◆ PMIXER_OPEN_KEY

typedef MIXER_STATUS(* PMIXER_OPEN_KEY) (IN HANDLE hKey, IN LPWSTR SubKey, IN ULONG DesiredAccess, OUT PHANDLE OutKey)

Definition at line 68 of file mmixer.h.

◆ PMIXER_QUERY_KEY_VALUE

typedef MIXER_STATUS(* PMIXER_QUERY_KEY_VALUE) (IN HANDLE hKey, IN LPWSTR KeyName, OUT PVOID *ResultBuffer, OUT PULONG ResultLength, OUT PULONG KeyType)

Definition at line 61 of file mmixer.h.

Enumeration Type Documentation

◆ MIXER_STATUS

Enumerator
MM_STATUS_SUCCESS 
MM_STATUS_NOTINITIALIZED 
MM_STATUS_NOT_IMPLEMENTED 
MM_STATUS_NO_MORE_DEVICES 
MM_STATUS_MORE_ENTRIES 
MM_STATUS_INVALID_PARAMETER 
MM_STATUS_UNSUCCESSFUL 
MM_STATUS_NO_MEMORY 

Definition at line 3 of file mmixer.h.

4{
13
14
MIXER_STATUS
Definition: mmixer.h:4
@ MM_STATUS_NOT_IMPLEMENTED
Definition: mmixer.h:7
@ MM_STATUS_UNSUCCESSFUL
Definition: mmixer.h:11
@ MM_STATUS_INVALID_PARAMETER
Definition: mmixer.h:10
@ MM_STATUS_NO_MEMORY
Definition: mmixer.h:12
@ MM_STATUS_NOTINITIALIZED
Definition: mmixer.h:6
@ MM_STATUS_SUCCESS
Definition: mmixer.h:5
@ MM_STATUS_NO_MORE_DEVICES
Definition: mmixer.h:8
@ MM_STATUS_MORE_ENTRIES
Definition: mmixer.h:9

Function Documentation

◆ MMixerClose()

MIXER_STATUS MMixerClose ( IN PMIXER_CONTEXT  MixerContext,
IN ULONG  MixerId,
IN PVOID  MixerEventContext,
IN PMIXER_EVENT  MixerEventRoutine 
)

Definition at line 116 of file mixer.c.

121{
123 LPMIXER_INFO MixerInfo;
124
125 /* verify mixer context */
127
129 {
130 /* invalid context passed */
131 DPRINT1("invalid context\n");
132 return Status;
133 }
134
135 /* get mixer info */
136 MixerInfo = MMixerGetMixerInfoByIndex(MixerContext, MixerId);
137 if (!MixerInfo)
138 {
139 /* invalid mixer id */
140 DPRINT1("invalid mixer id %lu\n", MixerId);
142 }
143
144 /* remove event from list */
145 return MMixerRemoveEvent(MixerContext, MixerInfo, MixerEventContext, MixerEventRoutine);
146}
#define DPRINT1
Definition: precomp.h:8
MIXER_STATUS MMixerRemoveEvent(IN PMIXER_CONTEXT MixerContext, IN OUT LPMIXER_INFO MixerInfo, IN PVOID MixerEventContext, IN PMIXER_EVENT MixerEventRoutine)
Definition: controls.c:1882
MIXER_CONTEXT MixerContext
Definition: mmixer.c:41
Status
Definition: gdiplustypes.h:25
LPMIXER_INFO MMixerGetMixerInfoByIndex(IN PMIXER_CONTEXT MixerContext, IN ULONG MixerIndex)
Definition: sup.c:161
MIXER_STATUS MMixerVerifyContext(IN PMIXER_CONTEXT MixerContext)
Definition: sup.c:41

Referenced by WdmAudCloseAllMixers(), and WdmAudControlCloseMixer().

◆ MMixerGetCapabilities()

MIXER_STATUS MMixerGetCapabilities ( IN PMIXER_CONTEXT  MixerContext,
IN ULONG  MixerIndex,
OUT LPMIXERCAPSW  MixerCaps 
)

Definition at line 38 of file mixer.c.

42{
44 LPMIXER_INFO MixerInfo;
45
46 /* verify mixer context */
48
50 {
51 /* invalid context passed */
52 return Status;
53 }
54
55 /* get mixer info */
56 MixerInfo = MMixerGetMixerInfoByIndex(MixerContext, MixerIndex);
57
58 if (!MixerInfo)
59 {
60 // invalid device index
62 }
63
64 MixerCaps->wMid = MixerInfo->MixCaps.wMid;
65 MixerCaps->wPid = MixerInfo->MixCaps.wPid;
66 MixerCaps->vDriverVersion = MixerInfo->MixCaps.vDriverVersion;
67 MixerCaps->fdwSupport = MixerInfo->MixCaps.fdwSupport;
68 MixerCaps->cDestinations = MixerInfo->MixCaps.cDestinations;
69
70 ASSERT(MixerInfo->MixCaps.szPname[MAXPNAMELEN-1] == 0);
71 wcscpy(MixerCaps->szPname, MixerInfo->MixCaps.szPname);
72
73 return MM_STATUS_SUCCESS;
74}
#define MAXPNAMELEN
Definition: mmsystem.h:24
#define ASSERT(a)
Definition: mode.c:44
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
MIXERCAPSW MixCaps
Definition: precomp.h:70
DWORD cDestinations
Definition: mmsystem.h:1228
MMVERSION vDriverVersion
Definition: mmsystem.h:1225
DWORD fdwSupport
Definition: mmsystem.h:1227
WCHAR szPname[MAXPNAMELEN]
Definition: mmsystem.h:1226

Referenced by WdmAudGetMixerCapabilities(), and WdmAudMixerCapabilities().

◆ MMixerGetControlDetails()

MIXER_STATUS MMixerGetControlDetails ( IN PMIXER_CONTEXT  MixerContext,
IN HANDLE  MixerHandle,
IN ULONG  MixerId,
IN ULONG  Flags,
OUT LPMIXERCONTROLDETAILS  MixerControlDetails 
)

Definition at line 566 of file mixer.c.

572{
574 ULONG NodeId;
575 LPMIXER_INFO MixerInfo;
576 LPMIXERLINE_EXT MixerLine;
577 LPMIXERCONTROL_EXT MixerControl;
578
579 /* verify mixer context */
581
583 {
584 /* invalid context passed */
585 return Status;
586 }
587
589 {
590 /* caller passed mixer id */
591 MixerHandle = (HANDLE)MMixerGetMixerInfoByIndex(MixerContext, MixerId);
592
593 if (!MixerHandle)
594 {
595 /* invalid parameter */
597 }
598 }
599
600 /* get mixer info */
601 MixerInfo = (LPMIXER_INFO)MixerHandle;
602
603 /* get mixer control */
604 Status = MMixerGetMixerControlById(MixerInfo, MixerControlDetails->dwControlID, &MixerLine, &MixerControl, &NodeId);
605
606 /* check for success */
608 {
609 /* failed to find control id */
611 }
612
613 switch(MixerControl->Control.dwControlType)
614 {
616 Status = MMixerSetGetMuteControlDetails(MixerContext, MixerInfo, MixerControl, MixerLine->Line.dwLineID, MixerControlDetails, FALSE);
617 break;
619 Status = MMixerSetGetVolumeControlDetails(MixerContext, MixerInfo, NodeId, FALSE, MixerControl, MixerControlDetails, MixerLine);
620 break;
622 DPRINT1("Not Implemented MIXERCONTROL_CONTROLTYPE_ONOFF\n");
623 break;
625 Status = MMixerSetGetMuxControlDetails(MixerContext, MixerInfo, NodeId, FALSE, Flags, MixerControl, MixerControlDetails, MixerLine);
626 break;
627
628 default:
630 DPRINT1("ControlType %lx not implemented\n", MixerControl->Control.dwControlType);
631 }
632
633 return Status;
634}
#define FALSE
Definition: types.h:117
#define MIXER_OBJECTF_MIXER
Definition: mmsystem.h:300
#define MIXERCONTROL_CONTROLTYPE_ONOFF
Definition: mmsystem.h:383
#define MIXERCONTROL_CONTROLTYPE_MUX
Definition: mmsystem.h:403
#define MIXERCONTROL_CONTROLTYPE_VOLUME
Definition: mmsystem.h:398
#define MIXER_OBJECTF_HMIXER
Definition: mmsystem.h:301
#define MIXERCONTROL_CONTROLTYPE_MUTE
Definition: mmsystem.h:384
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 MMixerSetGetMuteControlDetails(IN PMIXER_CONTEXT MixerContext, IN LPMIXER_INFO MixerInfo, IN LPMIXERCONTROL_EXT MixerControl, IN ULONG dwLineID, IN LPMIXERCONTROLDETAILS MixerControlDetails, IN ULONG bSet)
Definition: sup.c:367
MIXER_STATUS MMixerGetMixerControlById(LPMIXER_INFO MixerInfo, DWORD dwControlID, LPMIXERLINE_EXT *MixerLine, LPMIXERCONTROL_EXT *MixerControl, PULONG NodeId)
Definition: sup.c:281
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: sup.c:668
struct MIXER_INFO * LPMIXER_INFO
MIXERCONTROLW Control
Definition: precomp.h:79
MIXERLINEW Line
Definition: precomp.h:89
DWORD dwControlType
Definition: mmsystem.h:1306
DWORD dwLineID
Definition: mmsystem.h:1258
PVOID HANDLE
Definition: typedefs.h:73
uint32_t ULONG
Definition: typedefs.h:59
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170

Referenced by WdmAudGetControlDetails().

◆ MMixerGetCount()

ULONG MMixerGetCount ( IN PMIXER_CONTEXT  MixerContext)

Definition at line 15 of file mixer.c.

17{
18 PMIXER_LIST MixerList;
20
21 /* verify mixer context */
23
25 {
26 /* invalid context passed */
27 return Status;
28 }
29
30 /* grab mixer list */
32
33 // return number of mixers
34 return MixerList->MixerListCount;
35}
struct MIXER_LIST * PMIXER_LIST
PVOID MixerContext
Definition: mmixer.h:92
ULONG MixerListCount
Definition: precomp.h:149

Referenced by WdmAudGetMixerDeviceCount(), and WdmAudGetNumWdmDevsByMMixer().

◆ MMixerGetLineControls()

MIXER_STATUS MMixerGetLineControls ( IN PMIXER_CONTEXT  MixerContext,
IN HANDLE  MixerHandle,
IN ULONG  MixerId,
IN ULONG  Flags,
OUT LPMIXERLINECONTROLSW  MixerLineControls 
)

Definition at line 332 of file mixer.c.

338{
339 LPMIXER_INFO MixerInfo;
340 LPMIXERLINE_EXT MixerLineSrc;
341 LPMIXERCONTROL_EXT MixerControl;
344 ULONG Index;
345
346 /* verify mixer context */
348
350 {
351 /* invalid context passed */
352 return Status;
353 }
354
355 if (MixerLineControls->cbStruct != sizeof(MIXERLINECONTROLSW))
356 {
357 DPRINT1("Invalid MixerLineControls cbStruct passed %lu expected %lu\n", MixerLineControls->cbStruct, sizeof(MIXERLINECONTROLSW));
358 /* invalid parameter */
360 }
361
362 if (MixerLineControls->cbmxctrl != sizeof(MIXERCONTROLW))
363 {
364 DPRINT1("Invalid MixerLineControls cbmxctrl passed %lu expected %lu\n", MixerLineControls->cbmxctrl, sizeof(MIXERCONTROLW));
365 /* invalid parameter */
367 }
368
370 {
371 /* caller passed mixer id */
372 MixerHandle = (HANDLE)MMixerGetMixerInfoByIndex(MixerContext, MixerId);
373
374 if (!MixerHandle)
375 {
376 /* invalid parameter */
378 }
379 }
380
381 Flags &= ~MIXER_OBJECTF_HMIXER;
382
383 DPRINT("MMixerGetLineControls MixerId %lu Flags %lu\n", MixerId, Flags);
384
386 {
387 /* cast to mixer info */
388 MixerInfo = (LPMIXER_INFO)MixerHandle;
389
390 /* get mixer line */
391 MixerLineSrc = MMixerGetSourceMixerLineByLineId(MixerInfo, MixerLineControls->dwLineID);
392
393 if (!MixerLineSrc)
394 {
395 /* invalid line id */
396 DPRINT("MMixerGetLineControls Line not found %lx\n", MixerLineControls->dwLineID);
398 }
399
400 if (MixerLineSrc->Line.cControls != MixerLineControls->cControls)
401 {
402 /* invalid parameter */
403 DPRINT1("Invalid control count %lu expected %lu\n", MixerLineControls->cControls, MixerLineSrc->Line.cControls);
405 }
406
407 /* copy line control(s) */
408 Entry = MixerLineSrc->ControlsList.Flink;
409 Index = 0;
410 while(Entry != &MixerLineSrc->ControlsList)
411 {
412 /* get mixer control */
414
415 /* copy mixer control */
416 MixerContext->Copy(&MixerLineControls->pamxctrl[Index], &MixerControl->Control, sizeof(MIXERCONTROLW));
417
418 /* move to next */
419 Entry = Entry->Flink;
420
421 /* increment mixer control offset */
422 Index++;
423 }
424 return MM_STATUS_SUCCESS;
425 }
427 {
428 /* cast to mixer info */
429 MixerInfo = (LPMIXER_INFO)MixerHandle;
430
431 /* get mixer line */
432 MixerLineSrc = MMixerGetSourceMixerLineByLineId(MixerInfo, MixerLineControls->dwLineID);
433
434 if (!MixerLineSrc)
435 {
436 /* invalid line id */
437 DPRINT1("MMixerGetLineControls Line not found %lx\n", MixerLineControls->dwLineID);
439 }
440
441 /* sanity checks */
442 ASSERT(MixerLineControls->cControls == 1);
443 ASSERT(MixerLineControls->cbmxctrl == sizeof(MIXERCONTROLW));
444 ASSERT(MixerLineControls->pamxctrl != NULL);
445
446 Entry = MixerLineSrc->ControlsList.Flink;
447 while(Entry != &MixerLineSrc->ControlsList)
448 {
450 if (MixerLineControls->dwControlType == MixerControl->Control.dwControlType)
451 {
452 /* found a control with that type */
453 MixerContext->Copy(MixerLineControls->pamxctrl, &MixerControl->Control, sizeof(MIXERCONTROLW));
454 return MM_STATUS_SUCCESS;
455 }
456
457 /* move to next entry */
458 Entry = Entry->Flink;
459 }
460
461 DPRINT("DeviceInfo->u.MixControls.dwControlType %x not found in Line %x cControls %u \n", MixerLineControls->dwControlType, MixerLineControls->dwLineID, MixerLineSrc->Line.cControls);
463 }
465 {
466 /* cast to mixer info */
467 MixerInfo = (LPMIXER_INFO)MixerHandle;
468
469 Status = MMixerGetMixerControlById(MixerInfo, MixerLineControls->dwControlID, NULL, &MixerControl, NULL);
470
472 {
473 /* invalid parameter */
474 DPRINT("MMixerGetLineControls ControlID not found %lx\n", MixerLineControls->dwLineID);
476 }
477
478 ASSERT(MixerLineControls->cControls == 1);
479 ASSERT(MixerLineControls->cbmxctrl == sizeof(MIXERCONTROLW));
480 ASSERT(MixerLineControls->pamxctrl != NULL);
481
482 DPRINT("MMixerGetLineControls ControlID %lx ControlType %lx Name %S\n", MixerControl->Control.dwControlID, MixerControl->Control.dwControlType, MixerControl->Control.szName);
483
484 /* copy the controls */
485 MixerContext->Copy(MixerLineControls->pamxctrl, &MixerControl->Control, sizeof(MIXERCONTROLW));
486 MixerLineControls->pamxctrl->szName[MIXER_LONG_NAME_CHARS-1] = L'\0';
487 MixerLineControls->pamxctrl->szShortName[MIXER_SHORT_NAME_CHARS-1] = L'\0';
488
489 return MM_STATUS_SUCCESS;
490 }
493}
#define UNIMPLEMENTED
Definition: debug.h:115
#define NULL
Definition: types.h:112
#define MIXER_GETLINECONTROLSF_ONEBYID
Definition: mmsystem.h:409
#define MIXER_LONG_NAME_CHARS
Definition: mmsystem.h:294
#define MIXER_GETLINECONTROLSF_ALL
Definition: mmsystem.h:408
#define MIXER_GETLINECONTROLSF_ONEBYTYPE
Definition: mmsystem.h:410
#define MIXER_SHORT_NAME_CHARS
Definition: mmsystem.h:293
#define L(x)
Definition: ntvdm.h:50
struct MIXERCONTROL_EXT * LPMIXERCONTROL_EXT
LPMIXERLINE_EXT MMixerGetSourceMixerLineByLineId(LPMIXER_INFO MixerInfo, DWORD dwLineID)
Definition: sup.c:221
#define DPRINT
Definition: sndvol32.h:71
base of all file and directory entries
Definition: entries.h:83
LIST_ENTRY ControlsList
Definition: precomp.h:90
PMIXER_COPY Copy
Definition: mmixer.h:99
Definition: typedefs.h:120
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
WCHAR szName[MIXER_LONG_NAME_CHARS]
Definition: mmsystem.h:1310
DWORD cControls
Definition: mmsystem.h:1264
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
_In_ WDFCOLLECTION _In_ ULONG Index

Referenced by WdmAudGetLineControls().

◆ MMixerGetLineInfo()

MIXER_STATUS MMixerGetLineInfo ( IN PMIXER_CONTEXT  MixerContext,
IN HANDLE  MixerHandle,
IN ULONG  MixerId,
IN ULONG  Flags,
OUT LPMIXERLINEW  MixerLine 
)

Definition at line 149 of file mixer.c.

155{
157 LPMIXER_INFO MixerInfo;
158 LPMIXERLINE_EXT MixerLineSrc;
159 ULONG DestinationLineID;
160
161 /* verify mixer context */
163
165 {
166 /* invalid context passed */
167 return Status;
168 }
170 {
171 /* caller passed mixer id */
172 MixerHandle = (HANDLE)MMixerGetMixerInfoByIndex(MixerContext, MixerId);
173
174 if (!MixerHandle)
175 {
176 /* invalid parameter */
178 }
179 }
180
181 if (MixerLine->cbStruct != sizeof(MIXERLINEW))
182 {
183 DPRINT1("MixerLine Expected %lu but got %lu\n", sizeof(MIXERLINEW), MixerLine->cbStruct);
185 }
186
187 /* clear hmixer from flags */
188 Flags &=~MIXER_OBJECTF_HMIXER;
189
190 DPRINT("MMixerGetLineInfo MixerId %lu Flags %lu\n", MixerId, Flags);
191
193 {
194 /* cast to mixer info */
195 MixerInfo = (LPMIXER_INFO)MixerHandle;
196
197 /* calculate destination line id */
198 DestinationLineID = (MixerLine->dwDestination + DESTINATION_LINE);
199
200 /* get destination line */
201 MixerLineSrc = MMixerGetSourceMixerLineByLineId(MixerInfo, DestinationLineID);
202
203 if (MixerLineSrc == NULL)
204 {
205 DPRINT1("MixerCaps Name %S DestinationLineCount %lu dwDestination %lu not found\n", MixerInfo->MixCaps.szPname, MixerInfo->MixCaps.cDestinations, MixerLine->dwDestination);
207 }
208 /* copy mixer line */
209 MixerContext->Copy(MixerLine, &MixerLineSrc->Line, sizeof(MIXERLINEW));
210
211 /* make sure it is null terminated */
212 MixerLine->szName[MIXER_LONG_NAME_CHARS-1] = L'\0';
213 MixerLine->szShortName[MIXER_SHORT_NAME_CHARS-1] = L'\0';
214 MixerLine->Target.szPname[MAXPNAMELEN-1] = L'\0';
215
216 /* done */
217 return MM_STATUS_SUCCESS;
218 }
220 {
221 /* cast to mixer info */
222 MixerInfo = (LPMIXER_INFO)MixerHandle;
223
224 /* calculate destination line id */
225 DestinationLineID = (MixerLine->dwDestination + DESTINATION_LINE);
226
227 /* get destination line */
228 MixerLineSrc = MMixerGetSourceMixerLineByLineId(MixerInfo, DestinationLineID);
229
230 if (MixerLineSrc == NULL)
231 {
232 DPRINT1("MixerCaps Name %S DestinationLineCount %lu dwDestination %lu not found\n", MixerInfo->MixCaps.szPname, MixerInfo->MixCaps.cDestinations, MixerLine->dwDestination);
234 }
235
236 /* check if dwSource is out of bounds */
237 if (MixerLine->dwSource >= MixerLineSrc->Line.cConnections)
238 {
239 DPRINT1("MixerCaps Name %S MixerLineName %S Connections %lu dwSource %lu not found\n", MixerInfo->MixCaps.szPname, MixerLineSrc->Line.szName, MixerLineSrc->Line.cConnections, MixerLine->dwSource);
241 }
242
243 /* calculate destination line id */
244 DestinationLineID = (MixerLine->dwSource * SOURCE_LINE) + MixerLine->dwDestination;
245
246 DPRINT("MixerName %S cDestinations %lu MixerLineName %S cConnections %lu dwSource %lu dwDestination %lu ID %lx\n", MixerInfo->MixCaps.szPname, MixerInfo->MixCaps.cDestinations,
247 MixerLineSrc->Line.szName, MixerLineSrc->Line.cConnections,
248 MixerLine->dwSource, MixerLine->dwDestination,
249 DestinationLineID);
250 /* get target destination line id */
251 MixerLineSrc = MMixerGetSourceMixerLineByLineId(MixerInfo, DestinationLineID);
252
253 /* sanity check */
254 ASSERT(MixerLineSrc);
255
256 DPRINT("Line %u Name %S\n", MixerLineSrc->Line.dwSource, MixerLineSrc->Line.szName);
257
258 /* copy mixer line */
259 MixerContext->Copy(MixerLine, &MixerLineSrc->Line, sizeof(MIXERLINEW));
260
261 /* make sure it is null terminated */
262 MixerLine->szName[MIXER_LONG_NAME_CHARS-1] = L'\0';
263 MixerLine->szShortName[MIXER_SHORT_NAME_CHARS-1] = L'\0';
264 MixerLine->Target.szPname[MAXPNAMELEN-1] = L'\0';
265
266 /* done */
267 return MM_STATUS_SUCCESS;
268 }
270 {
271 /* cast to mixer info */
272 MixerInfo = (LPMIXER_INFO)MixerHandle;
273
274 /* try to find line */
275 MixerLineSrc = MMixerGetSourceMixerLineByLineId(MixerInfo, MixerLine->dwLineID);
276 if (!MixerLineSrc)
277 {
278 /* invalid parameter */
279 DPRINT1("MMixerGetLineInfo: MixerName %S Line not found 0x%lx\n", MixerInfo->MixCaps.szPname, MixerLine->dwLineID);
281 }
282
283 DPRINT("Line %u Name %S\n", MixerLineSrc->Line.dwSource, MixerLineSrc->Line.szName);
284
285 /* copy mixer line*/
286 MixerContext->Copy(MixerLine, &MixerLineSrc->Line, sizeof(MIXERLINEW));
287
288 /* make sure it is null terminated */
289 MixerLine->szName[MIXER_LONG_NAME_CHARS-1] = L'\0';
290 MixerLine->szShortName[MIXER_SHORT_NAME_CHARS-1] = L'\0';
291 MixerLine->Target.szPname[MAXPNAMELEN-1] = L'\0';
292
293 return MM_STATUS_SUCCESS;
294 }
296 {
297 /* cast to mixer info */
298 MixerInfo = (LPMIXER_INFO)MixerHandle;
299
300 /* find mixer line by component type */
301 MixerLineSrc = MMixerGetSourceMixerLineByComponentType(MixerInfo, MixerLine->dwComponentType);
302 if (!MixerLineSrc)
303 {
304 DPRINT1("Failed to find component type %x\n", MixerLine->dwComponentType);
306 }
307
308 /* copy mixer line */
309 MixerContext->Copy(MixerLine, &MixerLineSrc->Line, sizeof(MIXERLINEW));
310
311 /* make sure it is null terminated */
312 MixerLine->szName[MIXER_LONG_NAME_CHARS-1] = L'\0';
313 MixerLine->szShortName[MIXER_SHORT_NAME_CHARS-1] = L'\0';
314 MixerLine->Target.szPname[MAXPNAMELEN-1] = L'\0';
315
316 /* done */
317 return MM_STATUS_SUCCESS;
318 }
320 {
321 DPRINT1("MIXER_GETLINEINFOF_TARGETTYPE handling is unimplemented\n");
322 }
323 else
324 {
325 DPRINT1("Unknown Flags %lx handling is unimplemented\n", Flags);
326 }
327
329}
#define MIXER_GETLINEINFOF_LINEID
Definition: mmsystem.h:346
#define MIXER_GETLINEINFOF_TARGETTYPE
Definition: mmsystem.h:348
#define MIXER_GETLINEINFOF_DESTINATION
Definition: mmsystem.h:344
#define MIXER_GETLINEINFOF_COMPONENTTYPE
Definition: mmsystem.h:347
#define MIXER_GETLINEINFOF_SOURCE
Definition: mmsystem.h:345
LPMIXERLINE_EXT MMixerGetSourceMixerLineByComponentType(LPMIXER_INFO MixerInfo, DWORD dwComponentType)
Definition: sup.c:258
#define DESTINATION_LINE
Definition: precomp.h:176
#define SOURCE_LINE
Definition: precomp.h:177
DWORD dwSource
Definition: mmsystem.h:1257
WCHAR szName[MIXER_LONG_NAME_CHARS]
Definition: mmsystem.h:1266
DWORD cConnections
Definition: mmsystem.h:1263

Referenced by WdmAudGetLineInfo().

◆ MMixerGetMidiDevicePath()

MIXER_STATUS MMixerGetMidiDevicePath ( IN PMIXER_CONTEXT  MixerContext,
IN ULONG  bMidiIn,
IN ULONG  DeviceId,
OUT LPWSTR DevicePath 
)

Definition at line 380 of file midi.c.

385{
386 PMIXER_LIST MixerList;
387 LPMIXER_DATA MixerData;
388 LPMIDI_INFO MidiInfo;
391
392 /* verify mixer context */
394
396 {
397 /* invalid context passed */
398 return Status;
399 }
400
401 /* grab mixer list */
403
404 /* find destination midi */
405 Status = MMixerGetMidiInfoByIndexAndType(MixerList, DeviceId, bMidiIn, &MidiInfo);
407 {
408 /* failed to find midi info */
410 }
411
412 /* get associated device id */
413 MixerData = MMixerGetDataByDeviceId(MixerList, MidiInfo->DeviceId);
414 if (!MixerData)
416
417 /* calculate length */
418 Length = wcslen(MixerData->DeviceName)+1;
419
420 /* allocate destination buffer */
421 *DevicePath = MixerContext->Alloc(Length * sizeof(WCHAR));
422
423 if (!*DevicePath)
424 {
425 /* no memory */
426 return MM_STATUS_NO_MEMORY;
427 }
428
429 /* copy device path */
430 MixerContext->Copy(*DevicePath, MixerData->DeviceName, Length * sizeof(WCHAR));
431
432 /* done */
433 return MM_STATUS_SUCCESS;
434}
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
MIXER_STATUS MMixerGetMidiInfoByIndexAndType(IN PMIXER_LIST MixerList, IN ULONG DeviceIndex, IN ULONG bMidiInputType, OUT LPMIDI_INFO *OutMidiInfo)
Definition: midi.c:273
LPMIXER_DATA MMixerGetDataByDeviceId(IN PMIXER_LIST MixerList, IN ULONG DeviceId)
Definition: sup.c:738
ULONG DeviceId
Definition: precomp.h:137
PMIXER_ALLOC Alloc
Definition: mmixer.h:94
LPWSTR DeviceName
Definition: precomp.h:117
ULONG_PTR SIZE_T
Definition: typedefs.h:80
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by WdmAudGetPnpNameByIndexAndType().

◆ MMixerGetMidiInCount()

ULONG MMixerGetMidiInCount ( IN PMIXER_CONTEXT  MixerContext)

Definition at line 502 of file midi.c.

504{
505 PMIXER_LIST MixerList;
507
508 /* verify mixer context */
510
512 {
513 /* invalid context passed */
514 return Status;
515 }
516
517 /* grab mixer list */
519
520 return MixerList->MidiInListCount;
521}
ULONG MidiInListCount
Definition: precomp.h:161

Referenced by WdmAudGetMidiInDeviceCount().

◆ MMixerGetMidiOutCount()

ULONG MMixerGetMidiOutCount ( IN PMIXER_CONTEXT  MixerContext)

Definition at line 524 of file midi.c.

526{
527 PMIXER_LIST MixerList;
529
530 /* verify mixer context */
532
534 {
535 /* invalid context passed */
536 return Status;
537 }
538
539 /* grab mixer list */
541
542 return MixerList->MidiOutListCount;
543}
ULONG MidiOutListCount
Definition: precomp.h:164

◆ MMixerGetWaveDevicePath()

MIXER_STATUS MMixerGetWaveDevicePath ( IN PMIXER_CONTEXT  MixerContext,
IN ULONG  bWaveIn,
IN ULONG  DeviceId,
OUT LPWSTR DevicePath 
)

Definition at line 659 of file wave.c.

664{
665 PMIXER_LIST MixerList;
666 LPMIXER_DATA MixerData;
667 LPWAVE_INFO WaveInfo;
670
671 /* verify mixer context */
673
675 {
676 /* invalid context passed */
677 return Status;
678 }
679
680 /* grab mixer list */
682
683 /* find destination wave */
684 Status = MMixerGetWaveInfoByIndexAndType(MixerList, DeviceId, bWaveIn, &WaveInfo);
686 {
687 /* failed to find wave info */
689 }
690
691 /* get associated device id */
692 MixerData = MMixerGetDataByDeviceId(MixerList, WaveInfo->DeviceId);
693 if (!MixerData)
695
696 /* calculate length */
697 Length = wcslen(MixerData->DeviceName)+1;
698
699 /* allocate destination buffer */
700 *DevicePath = MixerContext->Alloc(Length * sizeof(WCHAR));
701
702 if (!*DevicePath)
703 {
704 /* no memory */
705 return MM_STATUS_NO_MEMORY;
706 }
707
708 /* copy device path */
709 MixerContext->Copy(*DevicePath, MixerData->DeviceName, Length * sizeof(WCHAR));
710
711 /* done */
712 return MM_STATUS_SUCCESS;
713}
MIXER_STATUS MMixerGetWaveInfoByIndexAndType(IN PMIXER_LIST MixerList, IN ULONG DeviceIndex, IN ULONG bWaveInType, OUT LPWAVE_INFO *OutWaveInfo)
Definition: wave.c:80
ULONG DeviceId
Definition: precomp.h:125

Referenced by WdmAudGetPnpNameByIndexAndType().

◆ MMixerGetWaveInCount()

ULONG MMixerGetWaveInCount ( IN PMIXER_CONTEXT  MixerContext)

Definition at line 563 of file wave.c.

565{
566 PMIXER_LIST MixerList;
568
569 /* verify mixer context */
571
573 {
574 /* invalid context passed */
575 return Status;
576 }
577
578 /* grab mixer list */
580
581 return MixerList->WaveInListCount;
582}
ULONG WaveInListCount
Definition: precomp.h:155

Referenced by WdmAudGetNumWdmDevsByMMixer(), and WdmAudGetWaveInDeviceCount().

◆ MMixerGetWaveOutCount()

ULONG MMixerGetWaveOutCount ( IN PMIXER_CONTEXT  MixerContext)

Definition at line 585 of file wave.c.

587{
588 PMIXER_LIST MixerList;
590
591 /* verify mixer context */
593
595 {
596 /* invalid context passed */
597 return Status;
598 }
599
600 /* grab mixer list */
602
603 return MixerList->WaveOutListCount;
604}
ULONG WaveOutListCount
Definition: precomp.h:158

Referenced by WdmAudGetMidiOutDeviceCount(), WdmAudGetNumWdmDevsByMMixer(), and WdmAudGetWaveOutDeviceCount().

◆ MMixerInitialize()

MIXER_STATUS MMixerInitialize ( IN PMIXER_CONTEXT  MixerContext,
IN PMIXER_ENUM  EnumFunction,
IN PVOID  EnumContext 
)

Definition at line 770 of file mixer.c.

774{
777 ULONG DeviceIndex, Count;
779 LPMIXER_DATA MixerData;
780 PMIXER_LIST MixerList;
782
783 if (!MixerContext || !EnumFunction || !EnumContext)
784 {
785 /* invalid parameter */
787 }
788
792 {
793 /* invalid parameter */
795 }
796
797 /* allocate a mixer list */
798 MixerList = (PMIXER_LIST)MixerContext->Alloc(sizeof(MIXER_LIST));
799 if (!MixerList)
800 {
801 /* no memory */
802 return MM_STATUS_NO_MEMORY;
803 }
804
805 /* initialize mixer list */
806 MixerList->MixerListCount = 0;
807 MixerList->MixerDataCount = 0;
808 MixerList->WaveInListCount = 0;
809 MixerList->WaveOutListCount = 0;
810 MixerList->MidiInListCount = 0;
811 MixerList->MidiOutListCount = 0;
812 InitializeListHead(&MixerList->MixerList);
813 InitializeListHead(&MixerList->MixerData);
814 InitializeListHead(&MixerList->WaveInList);
815 InitializeListHead(&MixerList->WaveOutList);
816 InitializeListHead(&MixerList->MidiInList);
817 InitializeListHead(&MixerList->MidiOutList);
818
819 /* store mixer list */
820 MixerContext->MixerContext = (PVOID)MixerList;
821
822 /* start enumerating all available devices */
823 Count = 0;
824 DeviceIndex = 0;
825
826 do
827 {
828 /* enumerate a device */
829 Status = EnumFunction(EnumContext, DeviceIndex, &DeviceName, &hMixer, &hKey);
830
832 {
833 /* check error code */
835 {
836 /* enumeration has finished */
837 break;
838 }
839 else
840 {
841 DPRINT1("Failed to enumerate device %lu\n", DeviceIndex);
842
843 /* TODO cleanup */
844 return Status;
845 }
846 }
847 else
848 {
849 /* create a mixer data entry */
850 Status = MMixerCreateMixerData(MixerContext, MixerList, DeviceIndex, DeviceName, hMixer, hKey);
852 break;
853 }
854
855 /* increment device index */
856 DeviceIndex++;
857 }while(TRUE);
858
859 /* now all filters have been pre-opened
860 * lets enumerate the filters
861 */
862 Entry = MixerList->MixerData.Flink;
863 while(Entry != &MixerList->MixerData)
864 {
866 MMixerSetupFilter(MixerContext, MixerList, MixerData, &Count);
867 Entry = Entry->Flink;
868 }
869
870 Entry = MixerList->MixerData.Flink;
871 while(Entry != &MixerList->MixerData)
872 {
874
875 /* now handle alternative mixer types */
876 MMixerHandleAlternativeMixers(MixerContext, MixerList, MixerData, MixerData->Topology);
877 Entry = Entry->Flink;
878 }
879
880 //MMixerPrintMixers(MixerContext, MixerList);
881
882 /* done */
883 return MM_STATUS_SUCCESS;
884}
VOID MMixerHandleAlternativeMixers(IN PMIXER_CONTEXT MixerContext, IN PMIXER_LIST MixerList, IN LPMIXER_DATA MixerData, IN PTOPOLOGY Topology)
Definition: controls.c:1682
MIXER_STATUS MMixerSetupFilter(IN PMIXER_CONTEXT MixerContext, IN PMIXER_LIST MixerList, IN LPMIXER_DATA MixerData, IN PULONG DeviceCount)
Definition: controls.c:1755
#define TRUE
Definition: types.h:120
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
FxAutoRegKey hKey
HMIXER hMixer
Definition: test.c:10
int Count
Definition: noreturn.cpp:7
struct MIXER_DATA * LPMIXER_DATA
MIXER_STATUS MMixerCreateMixerData(IN PMIXER_CONTEXT MixerContext, IN PMIXER_LIST MixerList, IN ULONG DeviceId, IN LPWSTR DeviceName, IN HANDLE hDevice, IN HANDLE hKey)
Definition: sup.c:781
PMIXER_ALLOC_EVENT_DATA AllocEventData
Definition: mmixer.h:103
PMIXER_OPEN_KEY OpenKey
Definition: mmixer.h:100
PMIXER_DEVICE_CONTROL Control
Definition: mmixer.h:95
PMIXER_CLOSE Close
Definition: mmixer.h:98
PMIXER_CLOSEKEY CloseKey
Definition: mmixer.h:102
PMIXER_QUERY_KEY_VALUE QueryKeyValue
Definition: mmixer.h:101
PMIXER_FREE_EVENT_DATA FreeEventData
Definition: mmixer.h:104
PMIXER_OPEN Open
Definition: mmixer.h:97
PMIXER_FREE Free
Definition: mmixer.h:96
PTOPOLOGY Topology
Definition: precomp.h:118
ULONG MixerDataCount
Definition: precomp.h:152
LIST_ENTRY MidiOutList
Definition: precomp.h:165
LIST_ENTRY MidiInList
Definition: precomp.h:162
LIST_ENTRY WaveInList
Definition: precomp.h:156
LIST_ENTRY MixerData
Definition: precomp.h:153
LIST_ENTRY WaveOutList
Definition: precomp.h:159
LIST_ENTRY MixerList
Definition: precomp.h:150
void * PVOID
Definition: typedefs.h:50
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
Definition: wdfdevice.h:3275
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by WdmAudInitUserModeMixer(), and WdmAudMixerInitialize().

◆ MMixerMidiInCapabilities()

MIXER_STATUS MMixerMidiInCapabilities ( IN PMIXER_CONTEXT  MixerContext,
IN ULONG  DeviceIndex,
OUT LPMIDIINCAPSW  Caps 
)

Definition at line 344 of file midi.c.

348{
349 PMIXER_LIST MixerList;
351 LPMIDI_INFO MidiInfo;
352
353 /* verify mixer context */
355
357 {
358 /* invalid context passed */
359 return Status;
360 }
361
362 /* grab mixer list */
364
365 /* find destination midi */
366 Status = MMixerGetMidiInfoByIndexAndType(MixerList, DeviceIndex, TRUE, &MidiInfo);
368 {
369 /* failed to find midi info */
371 }
372
373 /* copy capabilities */
374 MixerContext->Copy(Caps, &MidiInfo->u.InCaps, sizeof(MIDIINCAPSW));
375
376 return MM_STATUS_SUCCESS;
377}
union MIDI_INFO::@4119 u
MIDIINCAPSW InCaps
Definition: precomp.h:142

Referenced by WdmAudMidiCapabilities().

◆ MMixerMidiOutCapabilities()

MIXER_STATUS MMixerMidiOutCapabilities ( IN PMIXER_CONTEXT  MixerContext,
IN ULONG  DeviceIndex,
OUT LPMIDIOUTCAPSW  Caps 
)

Definition at line 308 of file midi.c.

312{
313 PMIXER_LIST MixerList;
315 LPMIDI_INFO MidiInfo;
316
317 /* verify mixer context */
319
321 {
322 /* invalid context passed */
323 return Status;
324 }
325
326 /* grab mixer list */
328
329 /* find destination midi */
330 Status = MMixerGetMidiInfoByIndexAndType(MixerList, DeviceIndex, FALSE, &MidiInfo);
332 {
333 /* failed to find midi info */
335 }
336
337 /* copy capabilities */
338 MixerContext->Copy(Caps, &MidiInfo->u.OutCaps, sizeof(MIDIOUTCAPSW));
339
340 return MM_STATUS_SUCCESS;
341}
MIDIOUTCAPSW OutCaps
Definition: precomp.h:141

Referenced by WdmAudMidiCapabilities().

◆ MMixerOpen()

MIXER_STATUS MMixerOpen ( IN PMIXER_CONTEXT  MixerContext,
IN ULONG  MixerId,
IN PVOID  MixerEventContext,
IN PMIXER_EVENT  MixerEventRoutine,
OUT PHANDLE  MixerHandle 
)

Definition at line 77 of file mixer.c.

83{
85 LPMIXER_INFO MixerInfo;
86
87 /* verify mixer context */
89
91 {
92 /* invalid context passed */
93 DPRINT1("invalid context\n");
94 return Status;
95 }
96
97 /* get mixer info */
99 if (!MixerInfo)
100 {
101 /* invalid mixer id */
102 DPRINT1("invalid mixer id %lu\n", MixerId);
104 }
105
106 /* add the event */
107 Status = MMixerAddEvent(MixerContext, MixerInfo, MixerEventContext, MixerEventRoutine);
108
109
110 /* store result */
111 *MixerHandle = (HANDLE)MixerInfo;
112 return MM_STATUS_SUCCESS;
113}
MIXER_STATUS MMixerAddEvent(IN PMIXER_CONTEXT MixerContext, IN OUT LPMIXER_INFO MixerInfo, IN PVOID MixerEventContext, IN PMIXER_EVENT MixerEventRoutine)
Definition: controls.c:1834

Referenced by WdmAudControlOpenMixer(), and WdmAudSetMixerDeviceFormatByMMixer().

◆ MMixerOpenMidi()

MIXER_STATUS MMixerOpenMidi ( IN PMIXER_CONTEXT  MixerContext,
IN ULONG  DeviceIndex,
IN ULONG  bMidiIn,
IN PIN_CREATE_CALLBACK  CreateCallback,
IN PVOID  Context,
OUT PHANDLE  PinHandle 
)

Definition at line 454 of file midi.c.

461{
462 PMIXER_LIST MixerList;
464 LPMIDI_INFO MidiInfo;
466
467 /* verify mixer context */
469
471 {
472 /* invalid context passed */
473 return Status;
474 }
475
476 /* grab mixer list */
478
479 /* find destination midi */
480 Status = MMixerGetMidiInfoByIndexAndType(MixerList, DeviceIndex, bMidiIn, &MidiInfo);
482 {
483 /* failed to find midi info */
485 }
486
487 /* get desired access */
488 if (bMidiIn)
489 {
491 }
492 else
493 {
495 }
496
497 /* now try open the pin */
498 return MMixerOpenMidiPin(MixerContext, MixerList, MidiInfo->DeviceId, MidiInfo->PinId, DesiredAccess, CreateCallback, Context, PinHandle);
499}
#define GENERIC_READ
Definition: compat.h:135
ULONG ACCESS_MASK
Definition: nt_native.h:40
#define GENERIC_WRITE
Definition: nt_native.h:90
MIXER_STATUS MMixerOpenMidiPin(IN PMIXER_CONTEXT MixerContext, IN PMIXER_LIST MixerList, IN ULONG DeviceId, IN ULONG PinId, IN ACCESS_MASK DesiredAccess, IN PIN_CREATE_CALLBACK CreateCallback, IN PVOID Context, OUT PHANDLE PinHandle)
Definition: midi.c:209
ULONG PinId
Definition: precomp.h:138
_Must_inspect_result_ _In_ WDFDEVICE _In_ ULONG _In_ ACCESS_MASK DesiredAccess
Definition: wdfdevice.h:2658

Referenced by WdmAudControlOpenMidi().

◆ MMixerOpenWave()

MIXER_STATUS MMixerOpenWave ( IN PMIXER_CONTEXT  MixerContext,
IN ULONG  DeviceIndex,
IN ULONG  bWaveIn,
IN LPWAVEFORMATEX  WaveFormat,
IN PIN_CREATE_CALLBACK  CreateCallback,
IN PVOID  Context,
OUT PHANDLE  PinHandle 
)

Definition at line 436 of file wave.c.

444{
445 PMIXER_LIST MixerList;
447 LPWAVE_INFO WaveInfo;
449
450 /* verify mixer context */
452
454 {
455 /* invalid context passed */
456 return Status;
457 }
458
459 /* grab mixer list */
461
462 if (WaveFormat->wFormatTag != WAVE_FORMAT_PCM)
463 {
464 /* not implemented */
466 }
467
468 /* find destination wave */
469 Status = MMixerGetWaveInfoByIndexAndType(MixerList, DeviceIndex, bWaveIn, &WaveInfo);
471 {
472 /* failed to find wave info */
474 }
475
476 /* get desired access */
477 if (bWaveIn)
478 {
480 }
481 else
482 {
484 }
485
486 /* now try open the pin */
487 return MMixerOpenWavePin(MixerContext, MixerList, WaveInfo->DeviceId, WaveInfo->PinId, WaveFormat, DesiredAccess, CreateCallback, Context, PinHandle);
488}
#define WAVE_FORMAT_PCM
Definition: constants.h:425
if(dx< 0)
Definition: linetemp.h:194
MIXER_STATUS MMixerOpenWavePin(IN PMIXER_CONTEXT MixerContext, IN PMIXER_LIST MixerList, IN ULONG DeviceId, IN ULONG PinId, IN LPWAVEFORMATEX WaveFormatEx, IN ACCESS_MASK DesiredAccess, IN PIN_CREATE_CALLBACK CreateCallback, IN PVOID Context, OUT PHANDLE PinHandle)
Definition: wave.c:217
ULONG PinId
Definition: precomp.h:126

Referenced by WdmAudControlOpenWave(), and WdmAudSetWaveDeviceFormatByMMixer().

◆ MMixerSetControlDetails()

MIXER_STATUS MMixerSetControlDetails ( IN PMIXER_CONTEXT  MixerContext,
IN HANDLE  MixerHandle,
IN ULONG  MixerId,
IN ULONG  Flags,
OUT LPMIXERCONTROLDETAILS  MixerControlDetails 
)

Definition at line 496 of file mixer.c.

502{
504 ULONG NodeId;
505 LPMIXER_INFO MixerInfo;
506 LPMIXERLINE_EXT MixerLine;
507 LPMIXERCONTROL_EXT MixerControl;
508
509 /* verify mixer context */
511
513 {
514 /* invalid context passed */
515 DPRINT1("invalid context\n");
516 return Status;
517 }
518
520 {
521 /* caller passed mixer id */
522 MixerHandle = (HANDLE)MMixerGetMixerInfoByIndex(MixerContext, MixerId);
523
524 if (!MixerHandle)
525 {
526 /* invalid parameter */
527 DPRINT1("invalid handle\n");
529 }
530 }
531
532 /* get mixer info */
533 MixerInfo = (LPMIXER_INFO)MixerHandle;
534
535 /* get mixer control */
536 Status = MMixerGetMixerControlById(MixerInfo, MixerControlDetails->dwControlID, &MixerLine, &MixerControl, &NodeId);
537
538 /* check for success */
540 {
541 /* failed to find control id */
542 DPRINT1("invalid control id %lu\n", MixerControlDetails->dwControlID);
544 }
545
546 DPRINT("MMixerSetControlDetails ControlType %lx MixerControlName %S MixerLineName %S NodeID %lu\n", MixerControl->Control.dwControlType, MixerControl->Control.szName, MixerLine->Line.szName, NodeId);
547 switch(MixerControl->Control.dwControlType)
548 {
550 Status = MMixerSetGetMuteControlDetails(MixerContext, MixerInfo, MixerControl, MixerLine->Line.dwLineID, MixerControlDetails, TRUE);
551 break;
553 Status = MMixerSetGetVolumeControlDetails(MixerContext, MixerInfo, NodeId, TRUE, MixerControl, MixerControlDetails, MixerLine);
554 break;
556 Status = MMixerSetGetMuxControlDetails(MixerContext, MixerInfo, NodeId, TRUE, Flags, MixerControl, MixerControlDetails, MixerLine);
557 break;
558 default:
560 }
561
562 return Status;
563}

Referenced by WdmAudSetControlDetails().

◆ MMixerSetMidiStatus()

MIXER_STATUS MMixerSetMidiStatus ( IN PMIXER_CONTEXT  MixerContext,
IN HANDLE  PinHandle,
IN KSSTATE  State 
)

Definition at line 437 of file midi.c.

441{
444
445 /* setup property request */
449
450 return MixerContext->Control(PinHandle, IOCTL_KS_PROPERTY, &Property, sizeof(KSPROPERTY), &State, sizeof(KSSTATE), &Length);
451}
#define KSPROPERTY_TYPE_SET
Definition: dmksctrl.h:43
@ KSPROPERTY_CONNECTION_STATE
Definition: ks.h:349
#define IOCTL_KS_PROPERTY
Definition: ks.h:127
KSSTATE
Definition: ks.h:1214
#define KSPROPSETID_Connection
Definition: ks.h:346

Referenced by WdmAudSetWaveStateByMMixer().

◆ MMixerSetWaveResetState()

MIXER_STATUS MMixerSetWaveResetState ( IN PMIXER_CONTEXT  MixerContext,
IN HANDLE  PinHandle,
IN ULONG  bBegin 
)

Definition at line 634 of file wave.c.

638{
641 KSRESET Reset;
642
643 /* verify mixer context */
645
647 {
648 /* invalid context passed */
649 return Status;
650 }
651
652 /* begin / stop reset */
653 Reset = (bBegin ? KSRESET_BEGIN : KSRESET_END);
654
655 return MixerContext->Control(PinHandle, IOCTL_KS_RESET_STATE, &Reset, sizeof(KSRESET), NULL, 0, &Length);
656}
KSRESET
Definition: ks.h:1226
@ KSRESET_BEGIN
Definition: ks.h:1227
@ KSRESET_END
Definition: ks.h:1228
#define IOCTL_KS_RESET_STATE
Definition: ks.h:145

Referenced by WdmAudResetStreamByMMixer().

◆ MMixerSetWaveStatus()

MIXER_STATUS MMixerSetWaveStatus ( IN PMIXER_CONTEXT  MixerContext,
IN HANDLE  PinHandle,
IN KSSTATE  State 
)

Definition at line 607 of file wave.c.

611{
615
616 /* verify mixer context */
618
620 {
621 /* invalid context passed */
622 return Status;
623 }
624
625 /* setup property request */
629
630 return MixerContext->Control(PinHandle, IOCTL_KS_PROPERTY, &Property, sizeof(KSPROPERTY), &State, sizeof(KSSTATE), &Length);
631}
const GUID KSPROPSETID_Connection
Definition: wave.c:14

Referenced by WdmAudCloseSoundDeviceByMMixer(), WdmAudSetWaveDeviceFormatByMMixer(), and WdmAudSetWaveStateByMMixer().

◆ MMixerWaveInCapabilities()

MIXER_STATUS MMixerWaveInCapabilities ( IN PMIXER_CONTEXT  MixerContext,
IN ULONG  DeviceIndex,
OUT LPWAVEINCAPSW  Caps 
)

Definition at line 491 of file wave.c.

495{
496 PMIXER_LIST MixerList;
498 LPWAVE_INFO WaveInfo;
499
500 /* verify mixer context */
502
504 {
505 /* invalid context passed */
506 return Status;
507 }
508
509 /* grab mixer list */
511
512 /* find destination wave */
513 Status = MMixerGetWaveInfoByIndexAndType(MixerList, DeviceIndex, TRUE, &WaveInfo);
515 {
516 /* failed to find wave info */
518 }
519
520 /* copy capabilities */
521 MixerContext->Copy(Caps, &WaveInfo->u.InCaps, sizeof(WAVEINCAPSW));
522
523 return MM_STATUS_SUCCESS;
524}
WAVEINCAPSW InCaps
Definition: precomp.h:130
union WAVE_INFO::@4118 u

Referenced by WdmAudGetWaveInCapabilities(), and WdmAudWaveCapabilities().

◆ MMixerWaveOutCapabilities()

MIXER_STATUS MMixerWaveOutCapabilities ( IN PMIXER_CONTEXT  MixerContext,
IN ULONG  DeviceIndex,
OUT LPWAVEOUTCAPSW  Caps 
)

Definition at line 527 of file wave.c.

531{
532 PMIXER_LIST MixerList;
534 LPWAVE_INFO WaveInfo;
535
536 /* verify mixer context */
538
540 {
541 /* invalid context passed */
542 return Status;
543 }
544
545 /* grab mixer list */
547
548 /* find destination wave */
549 Status = MMixerGetWaveInfoByIndexAndType(MixerList, DeviceIndex, FALSE, &WaveInfo);
551 {
552 /* failed to find wave info */
554 }
555
556 /* copy capabilities */
557 MixerContext->Copy(Caps, &WaveInfo->u.OutCaps, sizeof(WAVEOUTCAPSW));
558
559 return MM_STATUS_SUCCESS;
560}
WAVEOUTCAPSW OutCaps
Definition: precomp.h:129

Referenced by WdmAudGetWaveOutCapabilities(), and WdmAudWaveCapabilities().