Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > DoxygenwidMessage.c
Go to the documentation of this file.
00001 /* 00002 * PROJECT: ReactOS Sound System "MME Buddy" Library 00003 * LICENSE: GPL - See COPYING in the top level directory 00004 * FILE: lib/sound/mmebuddy/wave/widMessage.c 00005 * 00006 * PURPOSE: Provides the widMessage exported function, as required by 00007 * the MME API, for wave input device support. 00008 * 00009 * PROGRAMMERS: Andrew Greenwood (silverblade@reactos.org) 00010 */ 00011 00012 #include "precomp.h" 00013 00014 /* 00015 Standard MME driver entry-point for messages relating to wave audio 00016 input. 00017 */ 00018 DWORD 00019 APIENTRY 00020 widMessage( 00021 UINT DeviceId, 00022 UINT Message, 00023 DWORD_PTR PrivateHandle, 00024 DWORD_PTR Parameter1, 00025 DWORD_PTR Parameter2) 00026 { 00027 MMRESULT Result = MMSYSERR_NOTSUPPORTED; 00028 00029 AcquireEntrypointMutex(WAVE_IN_DEVICE_TYPE); 00030 00031 SND_TRACE(L"widMessage - Message type %d\n", Message); 00032 00033 switch ( Message ) 00034 { 00035 case WIDM_GETNUMDEVS : 00036 { 00037 Result = GetSoundDeviceCount(WAVE_IN_DEVICE_TYPE); 00038 break; 00039 } 00040 00041 case WIDM_START : 00042 { 00043 Result = MmeSetState(PrivateHandle, TRUE); 00044 break; 00045 } 00046 00047 case WIDM_STOP : 00048 { 00049 Result = MmeSetState(PrivateHandle, FALSE); 00050 break; 00051 } 00052 00053 case WIDM_GETDEVCAPS : 00054 { 00055 00056 Result = MmeGetSoundDeviceCapabilities(WAVE_IN_DEVICE_TYPE, 00057 DeviceId, 00058 (PVOID) Parameter1, 00059 Parameter2); 00060 break; 00061 } 00062 case WIDM_OPEN : 00063 { 00064 Result = MmeOpenDevice(WAVE_IN_DEVICE_TYPE, 00065 DeviceId, 00066 (LPWAVEOPENDESC) Parameter1, 00067 Parameter2, 00068 (DWORD_PTR*) PrivateHandle); 00069 break; 00070 } 00071 00072 case WIDM_CLOSE : 00073 { 00074 Result = MmeCloseDevice(PrivateHandle); 00075 00076 break; 00077 } 00078 00079 case WIDM_PREPARE : 00080 { 00081 /* TODO: Do we need to pass 2nd parameter? */ 00082 Result = MmePrepareWaveHeader(PrivateHandle, Parameter1); 00083 break; 00084 } 00085 00086 case WIDM_UNPREPARE : 00087 { 00088 Result = MmeUnprepareWaveHeader(PrivateHandle, Parameter1); 00089 break; 00090 } 00091 00092 case WIDM_RESET : 00093 { 00094 /* Stop playback, reset position to zero */ 00095 Result = MmeResetWavePlayback(PrivateHandle); 00096 break; 00097 } 00098 00099 case WIDM_ADDBUFFER : 00100 { 00101 Result = MmeWriteWaveHeader(PrivateHandle, Parameter1); 00102 break; 00103 } 00104 00105 case DRV_QUERYDEVICEINTERFACESIZE : 00106 { 00107 Result = MmeGetDeviceInterfaceString(WAVE_IN_DEVICE_TYPE, DeviceId, NULL, 0, (DWORD*)Parameter1); //FIXME DWORD_PTR 00108 break; 00109 } 00110 00111 case DRV_QUERYDEVICEINTERFACE : 00112 { 00113 Result = MmeGetDeviceInterfaceString(WAVE_IN_DEVICE_TYPE, DeviceId, (LPWSTR)Parameter1, Parameter2, NULL); //FIXME DWORD_PTR 00114 break; 00115 } 00116 00117 00118 } 00119 00120 SND_TRACE(L"widMessage returning MMRESULT %d\n", Result); 00121 00122 ReleaseEntrypointMutex(WAVE_IN_DEVICE_TYPE); 00123 00124 return Result; 00125 } Generated on Sun May 27 2012 04:36:12 for ReactOS by
1.7.6.1
|