ReactOS  0.4.13-dev-100-gc8611ae
wodMessage.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS Sound System "MME Buddy" Library
3  * LICENSE: GPL - See COPYING in the top level directory
4  * FILE: lib/drivers/sound/mmebuddy/wave/wodMessage.c
5  *
6  * PURPOSE: Provides the wodMessage exported function, as required by
7  * the MME API, for wave output device support.
8  *
9  * PROGRAMMERS: Andrew Greenwood (silverblade@reactos.org)
10 */
11 
12 #include "precomp.h"
13 
14 #if 0
16 {
17  PWSTR WString = (PWSTR) String;
18  SND_TRACE(WString);
19  return MMSYSERR_NOTSUPPORTED;
20 }
21 #endif
22 
23 /*
24  Standard MME driver entry-point for messages relating to wave audio
25  output.
26 */
27 DWORD
30  UINT DeviceId,
31  UINT Message,
32  DWORD_PTR PrivateHandle,
33  DWORD_PTR Parameter1,
34  DWORD_PTR Parameter2)
35 {
37 
39 
40  SND_TRACE(L"wodMessage - Message type %d\n", Message);
41 
42  switch ( Message )
43  {
44  case WODM_GETNUMDEVS :
45  {
47  break;
48  }
49 
50  case WODM_GETDEVCAPS :
51  {
53  DeviceId,
54  (PVOID) Parameter1,
55  Parameter2);
56  break;
57  }
58 
59  case WODM_OPEN :
60  {
62  DeviceId,
63  (LPWAVEOPENDESC) Parameter1,
64  Parameter2,
65  (DWORD_PTR*)PrivateHandle);
66  break;
67  }
68 
69  case WODM_CLOSE :
70  {
71  Result = MmeCloseDevice(PrivateHandle);
72 
73  break;
74  }
75 
76  case WODM_PREPARE :
77  {
78  /* TODO: Do we need to pass 2nd parameter? */
79  Result = MmePrepareWaveHeader(PrivateHandle, Parameter1);
80  break;
81  }
82 
83  case WODM_UNPREPARE :
84  {
85  Result = MmeUnprepareWaveHeader(PrivateHandle, Parameter1);
86  break;
87  }
88 
89  case WODM_WRITE :
90  {
91  Result = MmeWriteWaveHeader(PrivateHandle, Parameter1);
92  break;
93  }
94 
95  case WODM_RESET :
96  {
97  /* Stop playback, reset position to zero */
98  Result = MmeResetWavePlayback(PrivateHandle);
99  break;
100  }
101 
102  case WODM_RESTART :
103  {
104  /* Continue playback when paused */
105  Result = MmeSetState(PrivateHandle, TRUE);
106  break;
107  }
108  case WODM_PAUSE :
109  {
110  /* pause playback */
111  Result = MmeSetState(PrivateHandle, FALSE);
112  break;
113  }
114 
115  case WODM_GETPOS :
116  {
117  Result = MmeGetPosition(WAVE_OUT_DEVICE_TYPE, DeviceId, PrivateHandle, (MMTIME*)Parameter1, Parameter2);
118  break;
119  }
120 
122  {
123  Result = MmeGetDeviceInterfaceString(WAVE_OUT_DEVICE_TYPE, DeviceId, NULL, 0, (DWORD*)Parameter1); //FIXME DWORD_PTR
124  break;
125  }
126 
128  {
129  Result = MmeGetDeviceInterfaceString(WAVE_OUT_DEVICE_TYPE, DeviceId, (LPWSTR)Parameter1, Parameter2, NULL); //FIXME DWORD_PTR
130  break;
131  }
132  }
133 
134  SND_TRACE(L"wodMessage returning MMRESULT %d\n", Result);
135 
137 
138  return Result;
139 }
MMRESULT MmeGetDeviceInterfaceString(IN MMDEVICE_TYPE DeviceType, IN DWORD DeviceId, IN LPWSTR Interface, IN DWORD InterfaceLength, OUT DWORD *InterfaceSize)
Definition: mmewrap.c:294
#define WODM_PAUSE
Definition: mmddk.h:115
#define TRUE
Definition: types.h:120
#define WODM_GETDEVCAPS
Definition: mmddk.h:109
uint16_t * PWSTR
Definition: typedefs.h:54
DWORD APIENTRY wodMessage(UINT DeviceId, UINT Message, DWORD_PTR PrivateHandle, DWORD_PTR Parameter1, DWORD_PTR Parameter2)
Definition: wodMessage.c:29
#define WODM_RESTART
Definition: mmddk.h:116
UINT MMRESULT
Definition: mmsystem.h:962
#define DRV_QUERYDEVICEINTERFACESIZE
Definition: mmddk.h:97
static WCHAR String[]
Definition: stringtable.c:55
#define WODM_OPEN
Definition: mmddk.h:110
MMRESULT MmeGetSoundDeviceCapabilities(IN MMDEVICE_TYPE DeviceType, IN DWORD DeviceId, IN PVOID Capabilities, IN DWORD CapabilitiesSize)
Definition: mmewrap.c:103
#define MmeUnprepareWaveHeader(private_handle, header)
Definition: mmebuddy.h:391
VOID AcquireEntrypointMutex(IN MMDEVICE_TYPE DeviceType)
Definition: reentrancy.c:75
smooth NULL
Definition: ftsmooth.c:416
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:426
ULONG GetSoundDeviceCount(IN MMDEVICE_TYPE DeviceType)
Definition: devicelist.c:67
#define WODM_PREPARE
Definition: mmddk.h:112
#define MmeWriteWaveHeader(private_handle, header)
Definition: mmebuddy.h:394
#define WODM_WRITE
Definition: mmddk.h:114
MMRESULT MmeGetPosition(IN MMDEVICE_TYPE DeviceType, IN DWORD DeviceId, IN DWORD_PTR PrivateHandle, IN MMTIME *Time, IN DWORD Size)
Definition: mmewrap.c:327
unsigned long DWORD
Definition: ntddk_ex.h:95
#define MMSYSERR_NOTSUPPORTED
Definition: mmsystem.h:104
CHAR Message[80]
Definition: alive.c:5
MMRESULT MmeCloseDevice(IN DWORD_PTR PrivateHandle)
Definition: mmewrap.c:225
static const WCHAR L[]
Definition: oid.c:1250
uint32_t DWORD_PTR
Definition: typedefs.h:63
#define WODM_CLOSE
Definition: mmddk.h:111
MMRESULT MmeOpenDevice(IN MMDEVICE_TYPE DeviceType, IN UINT DeviceId, IN LPWAVEOPENDESC OpenParameters, IN DWORD Flags, OUT DWORD_PTR *PrivateHandle)
Definition: mmewrap.c:132
MMRESULT MmeSetState(IN DWORD_PTR PrivateHandle, IN BOOL bStart)
Definition: mmewrap.c:19
#define WODM_UNPREPARE
Definition: mmddk.h:113
unsigned int UINT
Definition: ndis.h:50
IN PVOID Instance
Definition: pci.h:359
#define WODM_GETPOS
Definition: mmddk.h:118
VOID ReleaseEntrypointMutex(IN MMDEVICE_TYPE DeviceType)
Definition: reentrancy.c:92
WCHAR * LPWSTR
Definition: xmlstorage.h:184
MMRESULT MmeResetWavePlayback(IN DWORD_PTR PrivateHandle)
Definition: mmewrap.c:280
#define MmePrepareWaveHeader(private_handle, header)
Definition: mmebuddy.h:388
#define DRV_QUERYDEVICEINTERFACE
Definition: mmddk.h:96
#define SND_TRACE(...)
#define APIENTRY
Definition: api.h:79
#define WODM_RESET
Definition: mmddk.h:117
#define WODM_GETNUMDEVS
Definition: mmddk.h:108