Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > DoxygenwodMessage.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/drivers/sound/mmebuddy/wave/wodMessage.c 00005 * 00006 * PURPOSE: Provides the wodMessage exported function, as required by 00007 * the MME API, for wave output device support. 00008 * 00009 * PROGRAMMERS: Andrew Greenwood (silverblade@reactos.org) 00010 */ 00011 00012 #include "precomp.h" 00013 00014 #if 0 00015 MMRESULT HelloWorld(PSOUND_DEVICE_INSTANCE Instance, PVOID String) 00016 { 00017 PWSTR WString = (PWSTR) String; 00018 SND_TRACE(WString); 00019 return MMSYSERR_NOTSUPPORTED; 00020 } 00021 #endif 00022 00023 /* 00024 Standard MME driver entry-point for messages relating to wave audio 00025 output. 00026 */ 00027 DWORD 00028 APIENTRY 00029 wodMessage( 00030 UINT DeviceId, 00031 UINT Message, 00032 DWORD_PTR PrivateHandle, 00033 DWORD_PTR Parameter1, 00034 DWORD_PTR Parameter2) 00035 { 00036 MMRESULT Result = MMSYSERR_NOTSUPPORTED; 00037 00038 AcquireEntrypointMutex(WAVE_OUT_DEVICE_TYPE); 00039 00040 SND_TRACE(L"wodMessage - Message type %d\n", Message); 00041 00042 switch ( Message ) 00043 { 00044 case WODM_GETNUMDEVS : 00045 { 00046 Result = GetSoundDeviceCount(WAVE_OUT_DEVICE_TYPE); 00047 break; 00048 } 00049 00050 case WODM_GETDEVCAPS : 00051 { 00052 Result = MmeGetSoundDeviceCapabilities(WAVE_OUT_DEVICE_TYPE, 00053 DeviceId, 00054 (PVOID) Parameter1, 00055 Parameter2); 00056 break; 00057 } 00058 00059 case WODM_OPEN : 00060 { 00061 Result = MmeOpenDevice(WAVE_OUT_DEVICE_TYPE, 00062 DeviceId, 00063 (LPWAVEOPENDESC) Parameter1, 00064 Parameter2, 00065 (DWORD_PTR*)PrivateHandle); 00066 break; 00067 } 00068 00069 case WODM_CLOSE : 00070 { 00071 Result = MmeCloseDevice(PrivateHandle); 00072 00073 break; 00074 } 00075 00076 case WODM_PREPARE : 00077 { 00078 /* TODO: Do we need to pass 2nd parameter? */ 00079 Result = MmePrepareWaveHeader(PrivateHandle, Parameter1); 00080 break; 00081 } 00082 00083 case WODM_UNPREPARE : 00084 { 00085 Result = MmeUnprepareWaveHeader(PrivateHandle, Parameter1); 00086 break; 00087 } 00088 00089 case WODM_WRITE : 00090 { 00091 Result = MmeWriteWaveHeader(PrivateHandle, Parameter1); 00092 break; 00093 } 00094 00095 case WODM_RESET : 00096 { 00097 /* Stop playback, reset position to zero */ 00098 Result = MmeResetWavePlayback(PrivateHandle); 00099 break; 00100 } 00101 00102 case WODM_RESTART : 00103 { 00104 /* Continue playback when paused */ 00105 Result = MmeSetState(PrivateHandle, TRUE); 00106 break; 00107 } 00108 case WODM_PAUSE : 00109 { 00110 /* pause playback */ 00111 Result = MmeSetState(PrivateHandle, FALSE); 00112 break; 00113 } 00114 00115 case WODM_GETPOS : 00116 { 00117 Result = MmeGetPosition(WAVE_OUT_DEVICE_TYPE, DeviceId, PrivateHandle, (MMTIME*)Parameter1, Parameter2); 00118 break; 00119 } 00120 00121 case DRV_QUERYDEVICEINTERFACESIZE : 00122 { 00123 Result = MmeGetDeviceInterfaceString(WAVE_OUT_DEVICE_TYPE, DeviceId, NULL, 0, (DWORD*)Parameter1); //FIXME DWORD_PTR 00124 break; 00125 } 00126 00127 case DRV_QUERYDEVICEINTERFACE : 00128 { 00129 Result = MmeGetDeviceInterfaceString(WAVE_OUT_DEVICE_TYPE, DeviceId, (LPWSTR)Parameter1, Parameter2, NULL); //FIXME DWORD_PTR 00130 break; 00131 } 00132 } 00133 00134 SND_TRACE(L"wodMessage returning MMRESULT %d\n", Result); 00135 00136 ReleaseEntrypointMutex(WAVE_OUT_DEVICE_TYPE); 00137 00138 return Result; 00139 } Generated on Sat May 26 2012 04:35:02 for ReactOS by
1.7.6.1
|