Author: silverblade
Date: Mon Jul 14 17:52:11 2008
New Revision: 34512
URL:
http://svn.reactos.org/svn/reactos?rev=34512&view=rev
Log:
Implemented WODM_BREAKLOOP (as used by waveOutBreakLoop). When playback is
occurring between a buffer marked with WHDR_BEGINLOOP and a buffer marked
with WHDR_ENDLOOP and this is called, the "remaining loops" counter is set
to zero so that when the end buffer of the loop is reached, looping does not
occur.
Modified:
branches/silverblade-audio/dll/win32/sndblst/sndblst.c
branches/silverblade-audio/include/reactos/libs/sound/mmebuddy.h
branches/silverblade-audio/lib/drivers/sound/mmebuddy/devices.c
branches/silverblade-audio/lib/drivers/sound/mmebuddy/wave/streamcontrol.c
branches/silverblade-audio/lib/drivers/sound/mmebuddy/wave/streaming.c
branches/silverblade-audio/lib/drivers/sound/mmebuddy/wave/wave.h
branches/silverblade-audio/lib/drivers/sound/mmebuddy/wave/wodMessage.c
Modified: branches/silverblade-audio/dll/win32/sndblst/sndblst.c
URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/dll/win32/snd…
==============================================================================
--- branches/silverblade-audio/dll/win32/sndblst/sndblst.c [iso-8859-1] (original)
+++ branches/silverblade-audio/dll/win32/sndblst/sndblst.c [iso-8859-1] Mon Jul 14
17:52:11 2008
@@ -185,7 +185,7 @@
WaveHeaders[0].lpData = (PVOID) Buffer;
WaveHeaders[0].dwBufferLength = 1000000;
WaveHeaders[0].dwFlags = WHDR_PREPARED | WHDR_BEGINLOOP;
- WaveHeaders[0].dwLoops = 0;
+ WaveHeaders[0].dwLoops = 5;
WaveHeaders[1].lpData = (PVOID) ((PCHAR)Buffer + 1000000);
WaveHeaders[1].dwBufferLength = 1000000;
@@ -217,6 +217,9 @@
// SOUND_DEBUG_HEX(Result);
+ POPUP("Click for WODM_BREAKLOOP");
+ Result = wodMessage(0, WODM_BREAKLOOP, (DWORD) InstanceData, (DWORD) 0, 0);
+
POPUP("Click for WODM_PAUSE");
Result = wodMessage(0, WODM_PAUSE, (DWORD) InstanceData, (DWORD) 0, 0);
Modified: branches/silverblade-audio/include/reactos/libs/sound/mmebuddy.h
URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/include/react…
==============================================================================
--- branches/silverblade-audio/include/reactos/libs/sound/mmebuddy.h [iso-8859-1]
(original)
+++ branches/silverblade-audio/include/reactos/libs/sound/mmebuddy.h [iso-8859-1] Mon Jul
14 17:52:11 2008
@@ -236,6 +236,7 @@
MMSETWAVESTATE_FUNC PauseWaveDevice;
MMSETWAVESTATE_FUNC RestartWaveDevice;
MMSETWAVESTATE_FUNC ResetWaveDevice;
+ MMSETWAVESTATE_FUNC BreakWaveDeviceLoop;
} MMFUNCTION_TABLE, *PMMFUNCTION_TABLE;
@@ -676,6 +677,14 @@
DefaultResetWaveDevice(
IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance);
+MMRESULT
+BreakWaveDeviceLoop(
+ IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance);
+
+MMRESULT
+DefaultBreakWaveDeviceLoop(
+ IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance);
+
/*
wave/wodMessage.c
Modified: branches/silverblade-audio/lib/drivers/sound/mmebuddy/devices.c
URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/lib/drivers/s…
==============================================================================
--- branches/silverblade-audio/lib/drivers/sound/mmebuddy/devices.c [iso-8859-1]
(original)
+++ branches/silverblade-audio/lib/drivers/sound/mmebuddy/devices.c [iso-8859-1] Mon Jul
14 17:52:11 2008
@@ -67,6 +67,7 @@
Device->Functions.PauseWaveDevice = DefaultPauseWaveDevice;
Device->Functions.RestartWaveDevice = DefaultRestartWaveDevice;
Device->Functions.ResetWaveDevice = DefaultResetWaveDevice;
+ Device->Functions.BreakWaveDeviceLoop = DefaultBreakWaveDeviceLoop;
if ( ! SourceFunctionTable )
{
@@ -128,6 +129,12 @@
{
Device->Functions.ResetWaveDevice =
SourceFunctionTable->ResetWaveDevice;
+ }
+
+ if ( SourceFunctionTable->BreakWaveDeviceLoop )
+ {
+ Device->Functions.BreakWaveDeviceLoop =
+ SourceFunctionTable->BreakWaveDeviceLoop;
}
TRACE_EXIT(0);
Modified: branches/silverblade-audio/lib/drivers/sound/mmebuddy/wave/streamcontrol.c
URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/lib/drivers/s…
==============================================================================
--- branches/silverblade-audio/lib/drivers/sound/mmebuddy/wave/streamcontrol.c
[iso-8859-1] (original)
+++ branches/silverblade-audio/lib/drivers/sound/mmebuddy/wave/streamcontrol.c
[iso-8859-1] Mon Jul 14 17:52:11 2008
@@ -212,3 +212,30 @@
TRACE_EXIT(Result);
return Result;
}
+
+MMRESULT
+BreakWaveDeviceLoop(
+ IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance)
+{
+ VALIDATE_MMSYS_PARAMETER( IsValidSoundDeviceInstance(SoundDeviceInstance) );
+
+ return CallUsingSoundThread(SoundDeviceInstance,
+ BreakWaveDeviceLoop_Request,
+ NULL);
+}
+
+MMRESULT
+DefaultBreakWaveDeviceLoop(
+ IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance)
+{
+ ASSERT( SoundDeviceInstance );
+
+ /*
+ This will cause the loop to end. Note that the LoopHead member is
+ left intact otherwise the streaming routine may be processing the
+ start of the loop and think it's starting a new loop.
+ */
+ SoundDeviceInstance->Streaming.Wave.LoopsRemaining = 0;
+
+ return MMSYSERR_NOERROR;
+}
Modified: branches/silverblade-audio/lib/drivers/sound/mmebuddy/wave/streaming.c
URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/lib/drivers/s…
==============================================================================
--- branches/silverblade-audio/lib/drivers/sound/mmebuddy/wave/streaming.c [iso-8859-1]
(original)
+++ branches/silverblade-audio/lib/drivers/sound/mmebuddy/wave/streaming.c [iso-8859-1]
Mon Jul 14 17:52:11 2008
@@ -326,6 +326,8 @@
State);
}
+/* These are a bit repetitive... */
+
MMRESULT
PauseWaveDevice_Request(
IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance,
@@ -395,3 +397,25 @@
return Functions->ResetWaveDevice(SoundDeviceInstance);
}
+
+MMRESULT
+BreakWaveDeviceLoop_Request(
+ IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance,
+ IN PVOID Parameter)
+{
+ MMRESULT Result;
+ PSOUND_DEVICE SoundDevice;
+ PMMFUNCTION_TABLE Functions;
+
+ VALIDATE_MMSYS_PARAMETER( IsValidSoundDeviceInstance(SoundDeviceInstance) );
+
+ Result = GetSoundDeviceFromInstance(SoundDeviceInstance,
+ &SoundDevice);
+ ASSERT(Result == MMSYSERR_NOERROR);
+
+ Result = GetSoundDeviceFunctionTable(SoundDevice,
+ &Functions);
+ ASSERT(Result == MMSYSERR_NOERROR);
+
+ return Functions->BreakWaveDeviceLoop(SoundDeviceInstance);
+}
Modified: branches/silverblade-audio/lib/drivers/sound/mmebuddy/wave/wave.h
URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/lib/drivers/s…
==============================================================================
--- branches/silverblade-audio/lib/drivers/sound/mmebuddy/wave/wave.h [iso-8859-1]
(original)
+++ branches/silverblade-audio/lib/drivers/sound/mmebuddy/wave/wave.h [iso-8859-1] Mon Jul
14 17:52:11 2008
@@ -37,4 +37,9 @@
IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance,
IN PVOID Parameter);
+MMRESULT
+BreakWaveDeviceLoop_Request(
+ IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance,
+ IN PVOID Parameter);
+
#endif
Modified: branches/silverblade-audio/lib/drivers/sound/mmebuddy/wave/wodMessage.c
URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/lib/drivers/s…
==============================================================================
--- branches/silverblade-audio/lib/drivers/sound/mmebuddy/wave/wodMessage.c [iso-8859-1]
(original)
+++ branches/silverblade-audio/lib/drivers/sound/mmebuddy/wave/wodMessage.c [iso-8859-1]
Mon Jul 14 17:52:11 2008
@@ -157,7 +157,11 @@
}
case WODM_BREAKLOOP :
- return MMSYSERR_NOTSUPPORTED; /* yet */
+ {
+ ASSERT(Instance != NULL);
+
+ return BreakWaveDeviceLoop(Instance);
+ }
/* Let WINMM take care of these */
case WODM_PREPARE :