2009-01-31 22:11:09 +00:00
|
|
|
/*
|
|
|
|
* PROJECT: ReactOS Sound System "MME Buddy" Library
|
|
|
|
* LICENSE: GPL - See COPYING in the top level directory
|
|
|
|
* FILE: lib/drivers/sound/mmebuddy/wave/wodMessage.c
|
|
|
|
*
|
|
|
|
* PURPOSE: Provides the wodMessage exported function, as required by
|
|
|
|
* the MME API, for wave output device support.
|
|
|
|
*
|
|
|
|
* PROGRAMMERS: Andrew Greenwood (silverblade@reactos.org)
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <windows.h>
|
|
|
|
#include <mmsystem.h>
|
|
|
|
#include <mmddk.h>
|
|
|
|
|
|
|
|
#include <ntddsnd.h>
|
2009-02-15 13:31:52 +00:00
|
|
|
#include <sndtypes.h>
|
2009-01-31 22:11:09 +00:00
|
|
|
|
|
|
|
#include <mmebuddy.h>
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
MMRESULT HelloWorld(PSOUND_DEVICE_INSTANCE Instance, PVOID String)
|
|
|
|
{
|
|
|
|
PWSTR WString = (PWSTR) String;
|
|
|
|
SND_TRACE(WString);
|
|
|
|
return MMSYSERR_NOTSUPPORTED;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*
|
|
|
|
Standard MME driver entry-point for messages relating to wave audio
|
|
|
|
output.
|
|
|
|
*/
|
2009-08-03 13:46:37 +00:00
|
|
|
DWORD
|
|
|
|
APIENTRY
|
2009-01-31 22:11:09 +00:00
|
|
|
wodMessage(
|
2010-06-04 18:37:14 +00:00
|
|
|
UINT DeviceId,
|
|
|
|
UINT Message,
|
|
|
|
DWORD_PTR PrivateHandle,
|
|
|
|
DWORD_PTR Parameter1,
|
|
|
|
DWORD_PTR Parameter2)
|
2009-01-31 22:11:09 +00:00
|
|
|
{
|
|
|
|
MMRESULT Result = MMSYSERR_NOTSUPPORTED;
|
|
|
|
|
|
|
|
AcquireEntrypointMutex(WAVE_OUT_DEVICE_TYPE);
|
|
|
|
|
|
|
|
SND_TRACE(L"wodMessage - Message type %d\n", Message);
|
|
|
|
|
|
|
|
switch ( Message )
|
|
|
|
{
|
|
|
|
case WODM_GETNUMDEVS :
|
|
|
|
{
|
|
|
|
Result = GetSoundDeviceCount(WAVE_OUT_DEVICE_TYPE);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case WODM_GETDEVCAPS :
|
|
|
|
{
|
|
|
|
Result = MmeGetSoundDeviceCapabilities(WAVE_OUT_DEVICE_TYPE,
|
|
|
|
DeviceId,
|
|
|
|
(PVOID) Parameter1,
|
|
|
|
Parameter2);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case WODM_OPEN :
|
|
|
|
{
|
|
|
|
Result = MmeOpenWaveDevice(WAVE_OUT_DEVICE_TYPE,
|
|
|
|
DeviceId,
|
|
|
|
(LPWAVEOPENDESC) Parameter1,
|
|
|
|
Parameter2,
|
2010-06-04 18:37:14 +00:00
|
|
|
(DWORD_PTR*)PrivateHandle);
|
2009-01-31 22:11:09 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case WODM_CLOSE :
|
|
|
|
{
|
|
|
|
Result = MmeCloseDevice(PrivateHandle);
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case WODM_PREPARE :
|
|
|
|
{
|
|
|
|
/* TODO: Do we need to pass 2nd parameter? */
|
|
|
|
Result = MmePrepareWaveHeader(PrivateHandle, Parameter1);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case WODM_UNPREPARE :
|
|
|
|
{
|
|
|
|
Result = MmeUnprepareWaveHeader(PrivateHandle, Parameter1);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case WODM_WRITE :
|
|
|
|
{
|
2009-02-18 19:10:02 +00:00
|
|
|
Result = MmeWriteWaveHeader(PrivateHandle, Parameter1);
|
2009-01-31 22:11:09 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2009-02-22 21:14:54 +00:00
|
|
|
case WODM_RESET :
|
|
|
|
{
|
|
|
|
/* Stop playback, reset position to zero */
|
|
|
|
Result = MmeResetWavePlayback(PrivateHandle);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case WODM_RESTART :
|
|
|
|
{
|
|
|
|
/* Continue playback when paused */
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2009-01-31 22:11:09 +00:00
|
|
|
case WODM_GETPOS :
|
|
|
|
{
|
2009-07-11 23:21:09 +00:00
|
|
|
Result = MmeGetPosition(WAVE_OUT_DEVICE_TYPE, DeviceId, PrivateHandle, (MMTIME*)Parameter1, Parameter2);
|
2009-01-31 22:11:09 +00:00
|
|
|
break;
|
|
|
|
}
|
2009-10-26 23:10:05 +00:00
|
|
|
|
|
|
|
case DRV_QUERYDEVICEINTERFACESIZE :
|
|
|
|
{
|
|
|
|
Result = MmeGetDeviceInterfaceString(WAVE_OUT_DEVICE_TYPE, DeviceId, NULL, 0, (DWORD*)Parameter1); //FIXME DWORD_PTR
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case DRV_QUERYDEVICEINTERFACE :
|
|
|
|
{
|
|
|
|
Result = MmeGetDeviceInterfaceString(WAVE_OUT_DEVICE_TYPE, DeviceId, (LPWSTR)Parameter1, Parameter2, NULL); //FIXME DWORD_PTR
|
|
|
|
break;
|
|
|
|
}
|
2009-01-31 22:11:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
SND_TRACE(L"wodMessage returning MMRESULT %d\n", Result);
|
|
|
|
|
|
|
|
ReleaseEntrypointMutex(WAVE_OUT_DEVICE_TYPE);
|
|
|
|
|
|
|
|
return Result;
|
|
|
|
}
|