40#include "wine/unicode.h"
84 TRACE(
"(%p %u %ld %lx %lx);\n",
hWave, uMsg, dwInstance, dwParam1, dwParam2);
92 ERR(
"Shouldn't happen (%p %p)\n",
hWave, wom->
u.
out.hInnerWave);
111 ERR(
"Unknown msg %u\n", uMsg);
169 WARN(
"invalid parameter: dwFlags WAVE_MAPPED\n");
183 wom->
u.
out.hOuterWave = (HWAVEOUT)lpDesc->
hWave;
187 for (
i = ndlo;
i < ndhi;
i++) {
206#define TRY(sps,bps) wfx.nSamplesPerSec = (sps); wfx.wBitsPerSample = (bps); \
207 switch (res=wodOpenHelper(wom, i, lpDesc, &wfx, dwFlags | WAVE_FORMAT_DIRECT)) { \
208 case MMSYSERR_NOERROR: wom->avgSpeedInner = wfx.nAvgBytesPerSec; wom->nSamplesPerSecInner = wfx.nSamplesPerSec; goto found; \
209 case WAVERR_BADFORMAT: break; \
210 default: goto error; \
217 for (
i = ndlo;
i < ndhi;
i++) {
227 for (
i = ndlo;
i < ndhi;
i++) {
237 for (
i = ndlo;
i < ndhi;
i++) {
275 WARN(
"ret = WAVERR_BADFORMAT\n");
289 WARN(
"ret = WAVERR_BADFORMAT\n");
300 TRACE(
"(%p)\n", wom);
319 TRACE(
"(%p %p %08x)\n", wom, lpWaveHdrSrc, dwParam2);
330 WARN(
"acmStreamConvert failed\n");
336 FIXME(
"Not all src buffer has been written, expect bogus sound\n");
338 ERR(
"Codec has read more data than it is allowed to\n");
342 FIXME(
"Got 0 length\n");
346 return waveOutWrite(wom->
u.
out.hInnerWave, lpWaveHdrDst,
sizeof(*lpWaveHdrDst));
356 TRACE(
"(%p %p %08x)\n", wom, lpWaveHdrSrc, dwParam2);
362 WARN(
"acmStreamSize failed\n");
385 WARN(
"acmStreamPrepareHeader failed\n");
396 WARN(
"waveOutPrepareHeader failed\n");
405 TRACE(
"=> (%d)\n", dwRet);
414 DWORD dwRet1, dwRet2;
416 TRACE(
"(%p %p %08x)\n", wom, lpWaveHdrSrc, dwParam2);
429 lpWaveHdrSrc->
dwFlags &= ~WHDR_PREPARED;
437 TRACE(
"(%p %p %08x)\n", wom, lpTime, dwParam2);
451 if (dwInnerSamplesPerOuter > 0)
454 DWORD dwInnerBytesPerOuterSample = dwInnerBytesPerSample * dwInnerSamplesPerOuter;
474 timepos.
u.
cb += dwInnerBytesPerOuterSample;
490 lpTime->
u = timepos.
u;
497 static const WCHAR name[] = {
'W',
'i',
'n',
'e',
' ',
'w',
'a',
'v',
'e',
' ',
'o',
'u',
't',
' ',
'm',
'a',
'p',
'p',
'e',
'r',0};
499 TRACE(
"(%04x %p %p %08x)\n",wDevID, wom, lpWaveCaps, dwParam2);
506 WARN(
"bad device id\n");
510 if (wDevID == (
UINT)-1 || wDevID == (
UINT16)-1) {
525 memcpy(lpWaveCaps, &woc,
min(dwParam2,
sizeof(woc)));
529 ERR(
"This shouldn't happen\n");
535 TRACE(
"(%04x %p %p)\n",wDevID, wom, lpVol);
544 TRACE(
"(%04x %p %08x)\n",wDevID, wom, vol);
610 FIXME(
"(%p %08x %08x) stub!\n", wom, dwParam1, dwParam2);
621 TRACE(
"(%u, %04X, %08lX, %08lX, %08lX);\n",
622 wDevID, wMsg, dwUser, dwParam1, dwParam2);
656 FIXME(
"unknown message %d!\n", wMsg);
670 TRACE(
"(%p %u %lx %lx %lx);\n",
hWave, uMsg, dwInstance, dwParam1, dwParam2);
678 ERR(
"Shouldn't happen (%p %p)\n",
hWave, wim->
u.
in.hInnerWave);
693 ERR(
"ACM conversion failed\n");
699 lpWaveHdrDst->
dwFlags &= ~WHDR_INQUEUE;
706 ERR(
"Unknown msg %u\n", uMsg);
760 wim->
u.
in.hOuterWave = (HWAVEIN)lpDesc->
hWave;
775 for (
i = ndlo;
i < ndhi;
i++) {
792#define TRY(sps,bps) wfx.nSamplesPerSec = (sps); wfx.wBitsPerSample = (bps); \
793 switch (res=widOpenHelper(wim, i, lpDesc, &wfx, dwFlags | WAVE_FORMAT_DIRECT)) { \
794 case MMSYSERR_NOERROR: wim->avgSpeedInner = wfx.nAvgBytesPerSec; wim->nSamplesPerSecInner = wfx.nSamplesPerSec; goto found; \
795 case WAVERR_BADFORMAT: break; \
796 default: goto error; \
799 for (
i = ndlo;
i < ndhi;
i++) {
810 for (
i = ndlo;
i < ndhi;
i++) {
848 WARN(
"ret = WAVERR_BADFORMAT\n");
862 WARN(
"ret = WAVERR_BADFORMAT\n");
873 TRACE(
"(%p)\n", wim);
892 TRACE(
"(%p %p %08x)\n", wim, lpWaveHdrDst, dwParam2);
912 TRACE(
"(%p %p %08x)\n", wim, lpWaveHdrDst, dwParam2);
919 WARN(
"acmStreamSize failed\n");
942 WARN(
"acmStreamPrepareHeader failed\n");
953 WARN(
"waveInPrepareHeader failed\n");
962 TRACE(
"=> (%d)\n", dwRet);
971 DWORD dwRet1, dwRet2;
973 TRACE(
"(%p %p %08x)\n", wim, lpWaveHdrDst, dwParam2);
986 lpWaveHdrDst->
dwFlags &= ~WHDR_PREPARED;
994 TRACE(
"(%p %p %08x)\n", wim, lpTime, dwParam2);
1008 if (dwInnerSamplesPerOuter > 0)
1011 DWORD dwInnerBytesPerOuterSample = dwInnerBytesPerSample * dwInnerSamplesPerOuter;
1031 timepos.
u.
cb += dwInnerBytesPerOuterSample;
1047 lpTime->
u = timepos.
u;
1054 TRACE(
"(%04x, %p %p %08x)\n", wDevID, wim, lpWaveCaps, dwParam2);
1061 WARN(
"bad device id\n");
1065 if (wDevID == (
UINT)-1 || wDevID == (
UINT16)-1) {
1067 static const WCHAR init[] = {
'W',
'i',
'n',
'e',
' ',
'w',
'a',
'v',
'e',
' ',
'i',
'n',
' ',
'm',
'a',
'p',
'p',
'e',
'r',0};
1080 memcpy(lpWaveCaps, &wic,
min(dwParam2,
sizeof(wic)));
1084 ERR(
"This shouldn't happen\n");
1090 TRACE(
"(%p)\n", wim);
1097 TRACE(
"(%p)\n", wim);
1104 TRACE(
"(%p)\n", wim);
1140 FIXME(
"(%p %08x %08x) stub!\n", wim, dwParam1, dwParam2);
1151 TRACE(
"(%u, %04X, %08lX, %08lX, %08lX);\n",
1152 wDevID, wMsg, dwUser, dwParam1, dwParam2);
1181 FIXME(
"unknown message %u!\n", wMsg);
1203 oss = (
struct WINE_WAVEMAP*)1;
1212 TRACE(
"(%08lx)\n", dwDevID);
1227 TRACE(
"(%08lX, %p, %08X, %08lX, %08lX)\n",
1228 dwDevID, hDriv, wMsg, dwParam1, dwParam2);
1242 return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2);
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
#define HeapFree(x, y, z)
BOOL WINAPI IsBadReadPtr(IN LPCVOID lp, IN UINT_PTR ucb)
#define WAVEIN_MAPPER_STATUS_MAPPED
#define WODM_MAPPER_STATUS
#define DRV_QUERYDEVICEINTERFACESIZE
#define WAVEIN_MAPPER_STATUS_FORMAT
#define WIDM_MAPPER_STATUS
#define WAVEOUT_MAPPER_STATUS_FORMAT
#define WODM_SETPLAYBACKRATE
#define WODM_GETPLAYBACKRATE
#define DRVM_MAPPER_RECONFIGURE
BOOL WINAPI DriverCallback(DWORD dwCallBack, UINT uFlags, HDRVR hDev, UINT wMsg, DWORD dwUser, DWORD dwParam1, DWORD dwParam2)
#define WAVEOUT_MAPPER_STATUS_MAPPED
#define WAVEIN_MAPPER_STATUS_DEVICE
#define DRV_QUERYDEVICEINTERFACE
#define WAVEOUT_MAPPER_STATUS_DEVICE
MMRESULT WINAPI acmStreamClose(HACMSTREAM has, DWORD fdwClose)
MMRESULT WINAPI acmStreamPrepareHeader(HACMSTREAM has, PACMSTREAMHEADER pash, DWORD fdwPrepare)
MMRESULT WINAPI acmStreamConvert(HACMSTREAM has, PACMSTREAMHEADER pash, DWORD fdwConvert)
MMRESULT WINAPI acmStreamSize(HACMSTREAM has, DWORD cbInput, LPDWORD pdwOutputBytes, DWORD fdwSize)
MMRESULT WINAPI acmStreamUnprepareHeader(HACMSTREAM has, PACMSTREAMHEADER pash, DWORD fdwUnprepare)
MMRESULT WINAPI acmStreamOpen(PHACMSTREAM phas, HACMDRIVER had, PWAVEFORMATEX pwfxSrc, PWAVEFORMATEX pwfxDst, PWAVEFILTER pwfltr, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen)
LRESULT WINAPI DefDriverProc(DWORD_PTR dwDriverIdentifier, HDRVR hDrv, UINT Msg, LPARAM lParam1, LPARAM lParam2)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
double __cdecl remainder(double, double)
#define memcpy(s1, s2, n)
struct wavehdr_tag WAVEHDR
struct wavehdr_tag * LPWAVEHDR
#define CALLBACK_TYPEMASK
#define DRV_QUERYCONFIGURE
#define MMSYSERR_NOTSUPPORTED
#define WAVE_FORMAT_QUERY
#define MMSYSERR_INVALPARAM
#define WAVECAPS_LRVOLUME
#define CALLBACK_FUNCTION
#define MMSYSERR_BADDEVICEID
#define WAVE_FORMAT_DIRECT
#define ACM_STREAMOPENF_QUERY
struct _ACMSTREAMHEADER ACMSTREAMHEADER
#define ACMERR_NOTPOSSIBLE
#define ACM_STREAMSIZEF_SOURCE
#define ACM_STREAMSIZEF_DESTINATION
struct _ACMSTREAMHEADER * PACMSTREAMHEADER
unsigned __int3264 UINT_PTR
INT WINAPI MulDiv(INT nNumber, INT nNumerator, INT nDenominator)
union mmtime_tag::@3036 u
WCHAR szPname[MAXPNAMELEN]
union tagWAVEMAPDATA::@477 u
DWORD nSamplesPerSecOuter
struct tagWAVEMAPDATA::@477::@478 out
DWORD_PTR dwClientInstance
DWORD nSamplesPerSecInner
struct tagWAVEMAPDATA * self
struct tagWAVEMAPDATA::@477::@479 in
WCHAR szPname[MAXPNAMELEN]
static DWORD wodClose(WAVEMAPDATA *wom)
static DWORD wodOpenHelper(WAVEMAPDATA *wom, UINT idx, LPWAVEOPENDESC lpDesc, LPWAVEFORMATEX lpwfx, DWORD dwFlags)
static void CALLBACK widCallback(HWAVEIN hWave, UINT uMsg, DWORD_PTR dwInstance, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
static DWORD wodRestart(WAVEMAPDATA *wom)
static DWORD widOpen(DWORD_PTR *lpdwUser, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
static DWORD wodMapperReconfigure(WAVEMAPDATA *wom, DWORD dwParam1, DWORD dwParam2)
LRESULT CALLBACK WAVEMAP_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg, LPARAM dwParam1, LPARAM dwParam2)
static DWORD widStop(WAVEMAPDATA *wim)
static DWORD wodBreakLoop(WAVEMAPDATA *wom)
static DWORD wodUnprepare(WAVEMAPDATA *wom, LPWAVEHDR lpWaveHdrSrc, DWORD dwParam2)
static DWORD wodGetVolume(UINT wDevID, WAVEMAPDATA *wom, LPDWORD lpVol)
static DWORD widOpenHelper(WAVEMAPDATA *wim, UINT idx, LPWAVEOPENDESC lpDesc, LPWAVEFORMATEX lpwfx, DWORD dwFlags)
static DWORD widReset(WAVEMAPDATA *wim)
static DWORD widMapperStatus(WAVEMAPDATA *wim, DWORD flags, LPVOID ptr)
static DWORD wodGetDevCaps(UINT wDevID, WAVEMAPDATA *wom, LPWAVEOUTCAPSW lpWaveCaps, DWORD dwParam2)
static DWORD wodPause(WAVEMAPDATA *wom)
static DWORD widClose(WAVEMAPDATA *wim)
static LRESULT WAVEMAP_drvClose(DWORD_PTR dwDevID)
static void CALLBACK wodCallback(HWAVEOUT hWave, UINT uMsg, DWORD_PTR dwInstance, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
static BOOL WAVEMAP_IsData(const WAVEMAPDATA *wm)
static DWORD widStart(WAVEMAPDATA *wim)
static DWORD widMapperReconfigure(WAVEMAPDATA *wim, DWORD dwParam1, DWORD dwParam2)
static DWORD wodSetVolume(UINT wDevID, WAVEMAPDATA *wom, DWORD vol)
static DWORD widAddBuffer(WAVEMAPDATA *wim, LPWAVEHDR lpWaveHdrDst, DWORD dwParam2)
static DWORD widPrepare(WAVEMAPDATA *wim, LPWAVEHDR lpWaveHdrDst, DWORD dwParam2)
static DWORD wodReset(WAVEMAPDATA *wom)
static DWORD widGetDevCaps(UINT wDevID, WAVEMAPDATA *wim, LPWAVEINCAPSW lpWaveCaps, DWORD dwParam2)
static DWORD widGetPosition(WAVEMAPDATA *wim, LPMMTIME lpTime, DWORD dwParam2)
DWORD WINAPI WAVEMAP_wodMessage(UINT wDevID, UINT wMsg, DWORD_PTR dwUser, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
static DWORD widUnprepare(WAVEMAPDATA *wim, LPWAVEHDR lpWaveHdrDst, DWORD dwParam2)
DWORD WINAPI WAVEMAP_widMessage(WORD wDevID, WORD wMsg, DWORD_PTR dwUser, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
static DWORD wodPrepare(WAVEMAPDATA *wom, LPWAVEHDR lpWaveHdrSrc, DWORD dwParam2)
static DWORD wodOpen(DWORD_PTR *lpdwUser, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
struct tagWAVEMAPDATA WAVEMAPDATA
static DWORD wodMapperStatus(WAVEMAPDATA *wom, DWORD flags, LPVOID ptr)
static struct WINE_WAVEMAP * oss
static DWORD wodWrite(WAVEMAPDATA *wom, LPWAVEHDR lpWaveHdrSrc, DWORD dwParam2)
static DWORD wodGetPosition(WAVEMAPDATA *wom, LPMMTIME lpTime, DWORD dwParam2)
static LRESULT WAVEMAP_drvOpen(LPSTR str)
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
UINT WINAPI waveInGetPosition(HWAVEIN hWaveIn, LPMMTIME lpTime, UINT uSize)
UINT WINAPI waveOutReset(HWAVEOUT hWaveOut)
UINT WINAPI waveInAddBuffer(HWAVEIN hWaveIn, WAVEHDR *lpWaveInHdr, UINT uSize)
UINT WINAPI waveInPrepareHeader(HWAVEIN hWaveIn, WAVEHDR *lpWaveInHdr, UINT uSize)
UINT WINAPI waveInStop(HWAVEIN hWaveIn)
UINT WINAPI waveOutSetVolume(HWAVEOUT hWaveOut, DWORD dw)
UINT WINAPI waveInUnprepareHeader(HWAVEIN hWaveIn, WAVEHDR *lpWaveInHdr, UINT uSize)
UINT WINAPI waveOutGetNumDevs(void)
UINT WINAPI waveOutGetPosition(HWAVEOUT hWaveOut, LPMMTIME lpTime, UINT uSize)
UINT WINAPI waveInGetID(HWAVEIN hWaveIn, UINT *lpuDeviceID)
UINT WINAPI waveInReset(HWAVEIN hWaveIn)
UINT WINAPI waveOutBreakLoop(HWAVEOUT hWaveOut)
UINT WINAPI waveOutWrite(HWAVEOUT hWaveOut, LPWAVEHDR lpWaveOutHdr, UINT uSize)
UINT WINAPI waveOutUnprepareHeader(HWAVEOUT hWaveOut, LPWAVEHDR lpWaveOutHdr, UINT uSize)
MMRESULT WINAPI waveOutOpen(LPHWAVEOUT lphWaveOut, UINT uDeviceID, LPCWAVEFORMATEX lpFormat, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD dwFlags)
UINT WINAPI waveOutRestart(HWAVEOUT hWaveOut)
UINT WINAPI waveOutGetDevCapsW(UINT_PTR uDeviceID, LPWAVEOUTCAPSW lpCaps, UINT uSize)
MMRESULT WINAPI waveInOpen(HWAVEIN *lphWaveIn, UINT uDeviceID, LPCWAVEFORMATEX lpFormat, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD dwFlags)
UINT WINAPI waveOutGetID(HWAVEOUT hWaveOut, UINT *lpuDeviceID)
UINT WINAPI waveInGetNumDevs(void)
UINT WINAPI waveInClose(HWAVEIN hWaveIn)
UINT WINAPI waveOutPrepareHeader(HWAVEOUT hWaveOut, WAVEHDR *lpWaveOutHdr, UINT uSize)
UINT WINAPI waveInStart(HWAVEIN hWaveIn)
UINT WINAPI waveOutPause(HWAVEOUT hWaveOut)
UINT WINAPI waveOutGetVolume(HWAVEOUT hWaveOut, LPDWORD lpdw)
UINT WINAPI waveOutClose(HWAVEOUT hWaveOut)
UINT WINAPI waveInGetDevCapsW(UINT_PTR uDeviceID, LPWAVEINCAPSW lpCaps, UINT uSize)
#define WAVE_FORMAT_48S16
#define WAVE_FORMAT_48M16
#define WAVE_FORMAT_96S08
#define WAVE_FORMAT_96M16
#define WAVE_FORMAT_96S16
#define WAVE_FORMAT_48M08
#define WAVE_FORMAT_48S08
#define WAVE_FORMAT_96M08
int WINAPI MessageBoxA(_In_opt_ HWND hWnd, _In_opt_ LPCSTR lpText, _In_opt_ LPCSTR lpCaption, _In_ UINT uType)