mirror of
https://github.com/reactos/reactos.git
synced 2025-06-01 23:48:12 +00:00

- Set the audio pin to KSSTATE_RUN if it is wave-out pin - Implement support for manually starting / stopping a pin, which is used for recording [WINMM] - Add a hack for handling requests with WAVE_MAPPER [PORTCLS] - Pass correct flags to KsProbeStreamIrp when the irp has not already been probed (DirectKs) [WDMAUD] - Set correct irp dispatch code [SYSAUDIO] - Remove a hack [MMEBUDDY] - Return no error for MXDM_INIT message - Add support for completing multiple wave headers at once - Use new functions to implement WIDM_START / WIDM_STOP - ReactOS now "supports" wave in recording. Tested with Audacity / sndrec32 @ XP, WIP svn path=/trunk/; revision=43765
119 lines
2.8 KiB
C
119 lines
2.8 KiB
C
/*
|
|
* PROJECT: ReactOS Sound System "MME Buddy" Library
|
|
* LICENSE: GPL - See COPYING in the top level directory
|
|
* FILE: lib/sound/mmebuddy/wave/widMessage.c
|
|
*
|
|
* PURPOSE: Provides the widMessage exported function, as required by
|
|
* the MME API, for wave input device support.
|
|
*
|
|
* PROGRAMMERS: Andrew Greenwood (silverblade@reactos.org)
|
|
*/
|
|
|
|
#include <windows.h>
|
|
#include <mmsystem.h>
|
|
#include <mmddk.h>
|
|
|
|
#include <ntddsnd.h>
|
|
#include <sndtypes.h>
|
|
|
|
#include <mmebuddy.h>
|
|
|
|
/*
|
|
Standard MME driver entry-point for messages relating to wave audio
|
|
input.
|
|
*/
|
|
DWORD
|
|
APIENTRY
|
|
widMessage(
|
|
DWORD DeviceId,
|
|
DWORD Message,
|
|
DWORD PrivateHandle,
|
|
DWORD Parameter1,
|
|
DWORD Parameter2)
|
|
{
|
|
MMRESULT Result = MMSYSERR_NOTSUPPORTED;
|
|
|
|
AcquireEntrypointMutex(WAVE_IN_DEVICE_TYPE);
|
|
|
|
SND_TRACE(L"widMessage - Message type %d\n", Message);
|
|
|
|
switch ( Message )
|
|
{
|
|
case WIDM_GETNUMDEVS :
|
|
{
|
|
Result = GetSoundDeviceCount(WAVE_IN_DEVICE_TYPE);
|
|
break;
|
|
}
|
|
|
|
case WIDM_START :
|
|
{
|
|
Result = MmeSetState(PrivateHandle, TRUE);
|
|
break;
|
|
}
|
|
|
|
case WIDM_STOP :
|
|
{
|
|
Result = MmeSetState(PrivateHandle, FALSE);
|
|
break;
|
|
}
|
|
|
|
case WIDM_GETDEVCAPS :
|
|
{
|
|
|
|
Result = MmeGetSoundDeviceCapabilities(WAVE_IN_DEVICE_TYPE,
|
|
DeviceId,
|
|
(PVOID) Parameter1,
|
|
Parameter2);
|
|
break;
|
|
}
|
|
case WIDM_OPEN :
|
|
{
|
|
Result = MmeOpenWaveDevice(WAVE_IN_DEVICE_TYPE,
|
|
DeviceId,
|
|
(LPWAVEOPENDESC) Parameter1,
|
|
Parameter2,
|
|
(DWORD*) PrivateHandle);
|
|
break;
|
|
}
|
|
|
|
case WIDM_CLOSE :
|
|
{
|
|
Result = MmeCloseDevice(PrivateHandle);
|
|
|
|
break;
|
|
}
|
|
|
|
case WIDM_PREPARE :
|
|
{
|
|
/* TODO: Do we need to pass 2nd parameter? */
|
|
Result = MmePrepareWaveHeader(PrivateHandle, Parameter1);
|
|
break;
|
|
}
|
|
|
|
case WIDM_UNPREPARE :
|
|
{
|
|
Result = MmeUnprepareWaveHeader(PrivateHandle, Parameter1);
|
|
break;
|
|
}
|
|
|
|
case WIDM_RESET :
|
|
{
|
|
/* Stop playback, reset position to zero */
|
|
Result = MmeResetWavePlayback(PrivateHandle);
|
|
break;
|
|
}
|
|
|
|
case WIDM_ADDBUFFER :
|
|
{
|
|
Result = MmeWriteWaveHeader(PrivateHandle, Parameter1);
|
|
break;
|
|
}
|
|
|
|
}
|
|
|
|
SND_TRACE(L"widMessage returning MMRESULT %d\n", Result);
|
|
|
|
ReleaseEntrypointMutex(WAVE_IN_DEVICE_TYPE);
|
|
|
|
return Result;
|
|
}
|