Author: janderwald
Date: Sun Jul 12 03:21:09 2009
New Revision: 41899
URL:
http://svn.reactos.org/svn/reactos?rev=41899&view=rev
Log:
- Implement retrieving position
Modified:
trunk/reactos/lib/drivers/sound/mmebuddy/mmewrap.c
trunk/reactos/lib/drivers/sound/mmebuddy/wave/format.c
trunk/reactos/lib/drivers/sound/mmebuddy/wave/wodMessage.c
Modified: trunk/reactos/lib/drivers/sound/mmebuddy/mmewrap.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/mmebuddy…
==============================================================================
--- trunk/reactos/lib/drivers/sound/mmebuddy/mmewrap.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/sound/mmebuddy/mmewrap.c [iso-8859-1] Sun Jul 12 03:21:09
2009
@@ -121,7 +121,7 @@
if ( ! MMSUCCESS(Result) )
return TranslateInternalMmResult(Result);
- Result = SetWaveDeviceFormat(SoundDeviceInstance, Format, sizeof(WAVEFORMATEX));
+ Result = SetWaveDeviceFormat(SoundDeviceInstance, DeviceId, Format,
sizeof(WAVEFORMATEX));
if ( ! MMSUCCESS(Result) )
{
/* TODO: Destroy sound instance */
@@ -204,3 +204,46 @@
return StopStreaming(SoundDeviceInstance);
}
+
+MMRESULT
+MmeGetPosition(
+ IN MMDEVICE_TYPE DeviceType,
+ IN DWORD DeviceId,
+ IN DWORD PrivateHandle,
+ IN MMTIME* Time,
+ IN DWORD Size)
+{
+ MMRESULT Result;
+ PSOUND_DEVICE_INSTANCE SoundDeviceInstance;
+ PSOUND_DEVICE SoundDevice;
+ PMMFUNCTION_TABLE FunctionTable;
+
+ VALIDATE_MMSYS_PARAMETER( PrivateHandle );
+ SoundDeviceInstance = (PSOUND_DEVICE_INSTANCE) PrivateHandle;
+
+ if ( ! IsValidSoundDeviceInstance(SoundDeviceInstance) )
+ return MMSYSERR_INVALHANDLE;
+
+ Result = GetSoundDeviceFromInstance(SoundDeviceInstance, &SoundDevice);
+ if ( ! MMSUCCESS(Result) )
+ return TranslateInternalMmResult(Result);
+
+ if ( Size != sizeof(MMTIME) )
+ return MMSYSERR_INVALPARAM;
+
+ Result = GetSoundDeviceFunctionTable(SoundDevice, &FunctionTable);
+ if ( ! MMSUCCESS(Result) )
+ return TranslateInternalMmResult(Result);
+
+ if ( FunctionTable->GetPos == NULL )
+ {
+ /* This indicates bad practice, really! If you can open, why not close?! */
+ return MMSYSERR_NOTSUPPORTED;
+ }
+
+ /* Call the driver */
+ Result = FunctionTable->GetPos(SoundDeviceInstance, Time);
+
+ return Result;
+}
+
Modified: trunk/reactos/lib/drivers/sound/mmebuddy/wave/format.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/mmebuddy…
==============================================================================
--- trunk/reactos/lib/drivers/sound/mmebuddy/wave/format.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/sound/mmebuddy/wave/format.c [iso-8859-1] Sun Jul 12
03:21:09 2009
@@ -53,6 +53,7 @@
MMRESULT
SetWaveDeviceFormat(
IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance,
+ IN DWORD DeviceId,
IN LPWAVEFORMATEX Format,
IN DWORD FormatSize)
{
@@ -87,5 +88,5 @@
if ( ! FunctionTable->SetWaveFormat )
return MMSYSERR_NOTSUPPORTED;
- return FunctionTable->SetWaveFormat(SoundDeviceInstance, Format, FormatSize);
+ return FunctionTable->SetWaveFormat(SoundDeviceInstance, DeviceId, Format,
FormatSize);
}
Modified: trunk/reactos/lib/drivers/sound/mmebuddy/wave/wodMessage.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/mmebuddy…
==============================================================================
--- trunk/reactos/lib/drivers/sound/mmebuddy/wave/wodMessage.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/sound/mmebuddy/wave/wodMessage.c [iso-8859-1] Sun Jul 12
03:21:09 2009
@@ -113,6 +113,7 @@
case WODM_GETPOS :
{
+ Result = MmeGetPosition(WAVE_OUT_DEVICE_TYPE, DeviceId, PrivateHandle,
(MMTIME*)Parameter1, Parameter2);
break;
}
}