Author: silverblade
Date: Sat Jul 12 16:44:10 2008
New Revision: 34440
URL:
http://svn.reactos.org/svn/reactos?rev=34440&view=rev
Log:
Structural and formatting changes only. Moved all device-type-specific code
including MME entrypoint routines into relevantly-named directories and split
a few functions from files where they didn't really belong. Changed formatting
of comments at top of my source and header files to be the same as described
on the ReactOS wiki.
Added:
branches/silverblade-audio/lib/drivers/sound/mmebuddy/auxiliary/
branches/silverblade-audio/lib/drivers/sound/mmebuddy/auxiliary/auxMessage.c
- copied, changed from r34432,
branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/auxMessage.c
branches/silverblade-audio/lib/drivers/sound/mmebuddy/capabilities.c (with props)
branches/silverblade-audio/lib/drivers/sound/mmebuddy/midi/midMessage.c
- copied, changed from r34432,
branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/midMessage.c
branches/silverblade-audio/lib/drivers/sound/mmebuddy/midi/modMessage.c
- copied, changed from r34432,
branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/modMessage.c
branches/silverblade-audio/lib/drivers/sound/mmebuddy/mixer/
branches/silverblade-audio/lib/drivers/sound/mmebuddy/mixer/mxdMessage.c
- copied, changed from r34432,
branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/mxdMessage.c
branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/callback.c (with props)
branches/silverblade-audio/lib/drivers/sound/mmebuddy/wave/format.c (with props)
branches/silverblade-audio/lib/drivers/sound/mmebuddy/wave/streamcontrol.c (with
props)
branches/silverblade-audio/lib/drivers/sound/mmebuddy/wave/streaming.c
- copied, changed from r34432,
branches/silverblade-audio/lib/drivers/sound/mmebuddy/wave/wavethread.c
branches/silverblade-audio/lib/drivers/sound/mmebuddy/wave/wave.h (with props)
branches/silverblade-audio/lib/drivers/sound/mmebuddy/wave/widMessage.c
- copied, changed from r34432,
branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/widMessage.c
branches/silverblade-audio/lib/drivers/sound/mmebuddy/wave/wodMessage.c
- copied, changed from r34432,
branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/wodMessage.c
Removed:
branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/auxMessage.c
branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/midMessage.c
branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/modMessage.c
branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/mxdMessage.c
branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/widMessage.c
branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/wodMessage.c
branches/silverblade-audio/lib/drivers/sound/mmebuddy/wave/wavethread.c
Modified:
branches/silverblade-audio/dll/win32/mmdrv/entry.c
branches/silverblade-audio/lib/drivers/sound/mmebuddy/devices.c
branches/silverblade-audio/lib/drivers/sound/mmebuddy/instances.c
branches/silverblade-audio/lib/drivers/sound/mmebuddy/kernel.c
branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/DriverProc.c
branches/silverblade-audio/lib/drivers/sound/mmebuddy/mmebuddy.rbuild
branches/silverblade-audio/lib/drivers/sound/mmebuddy/nt4.c
branches/silverblade-audio/lib/drivers/sound/mmebuddy/thread.c
branches/silverblade-audio/lib/drivers/sound/mmebuddy/utility.c
Modified: branches/silverblade-audio/dll/win32/mmdrv/entry.c
URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/dll/win32/mmd…
==============================================================================
--- branches/silverblade-audio/dll/win32/mmdrv/entry.c [iso-8859-1] (original)
+++ branches/silverblade-audio/dll/win32/mmdrv/entry.c [iso-8859-1] Sat Jul 12 16:44:10
2008
@@ -1,21 +1,18 @@
/*
- ReactOS Sound System
- Default MME Driver
-
- Purpose:
- MME driver entry-point
-
- Author:
- Andrew Greenwood (silverblade(a)reactos.org)
-
- History:
- 4 July 2008 - Created
+ * PROJECT: ReactOS Sound System "MME Buddy" Library
+ * LICENSE: GPL - See COPYING in the top level directory
+ * FILE: dll/win32/mmdrv/entry.c
+ *
+ * PURPOSE: MME generic low-level audio device support library DriverProc
+ * entry-point.
+ *
+ * PROGRAMMERS: Andrew Greenwood (silverblade(a)reactos.org)
*/
#include <windows.h>
#include <mmddk.h>
+
#include <mmebuddy.h>
-#include <debug.h>
APIENTRY LONG
DriverProc(
@@ -28,11 +25,11 @@
switch ( message )
{
case DRV_LOAD :
- DPRINT("DRV_LOAD\n");
+ TRACE_("DRV_LOAD\n");
return 1L;
case DRV_FREE :
- DPRINT("DRV_FREE\n");
+ TRACE_("DRV_FREE\n");
return 1L;
default :
Copied: branches/silverblade-audio/lib/drivers/sound/mmebuddy/auxiliary/auxMessage.c (from
r34432, branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/auxMessage.c)
URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/lib/drivers/s…
==============================================================================
--- branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/auxMessage.c [iso-8859-1]
(original)
+++ branches/silverblade-audio/lib/drivers/sound/mmebuddy/auxiliary/auxMessage.c
[iso-8859-1] Sat Jul 12 16:44:10 2008
@@ -1,15 +1,12 @@
/*
- ReactOS Sound System
- MME Interface
-
- Purpose:
- Auxiliary device message handler
-
- Author:
- Andrew Greenwood (silverblade(a)reactos.org)
-
- History:
- 4 July 2008 - Created
+ * PROJECT: ReactOS Sound System "MME Buddy" Library
+ * LICENSE: GPL - See COPYING in the top level directory
+ * FILE: lib/sound/mmebuddy/auxiliary/auxMessage.c
+ *
+ * PURPOSE: Provides the auxMessage exported function, as required by
+ * the MME API, for auxiliary functionality support.
+ *
+ * PROGRAMMERS: Andrew Greenwood (silverblade(a)reactos.org)
*/
#include <windows.h>
Added: branches/silverblade-audio/lib/drivers/sound/mmebuddy/capabilities.c
URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/lib/drivers/s…
==============================================================================
--- branches/silverblade-audio/lib/drivers/sound/mmebuddy/capabilities.c (added)
+++ branches/silverblade-audio/lib/drivers/sound/mmebuddy/capabilities.c [iso-8859-1] Sat
Jul 12 16:44:10 2008
@@ -1,0 +1,102 @@
+/*
+ * PROJECT: ReactOS Sound System "MME Buddy" Library
+ * LICENSE: GPL - See COPYING in the top level directory
+ * FILE: lib/sound/mmebuddy/capabilities.c
+ *
+ * PURPOSE: Queries sound devices for their capabilities.
+ *
+ * PROGRAMMERS: Andrew Greenwood (silverblade(a)reactos.org)
+*/
+
+#include <windows.h>
+#include <mmsystem.h>
+#include <ntddk.h> /* needed for ioctl stuff */
+#include <ntddsnd.h>
+
+#include <mmebuddy.h>
+
+MMRESULT
+GetSoundDeviceCapabilities(
+ IN PSOUND_DEVICE Device,
+ OUT PUNIVERSAL_CAPS Capabilities)
+{
+ if ( ! Device )
+ return MMSYSERR_INVALPARAM;
+
+ if ( ! Capabilities )
+ return MMSYSERR_INVALPARAM;
+
+ return Device->Functions.GetCapabilities(Device, Capabilities);
+}
+
+MMRESULT
+DefaultGetSoundDeviceCapabilities(
+ IN PSOUND_DEVICE Device,
+ OUT PUNIVERSAL_CAPS Capabilities)
+{
+ PVOID RawCapsPtr = NULL;
+ ULONG CapsSize = 0;
+ DWORD Ioctl;
+ MMRESULT Result;
+ DWORD BytesReturned;
+
+ ZeroMemory(Capabilities, sizeof(UNIVERSAL_CAPS));
+
+ if ( ! Device )
+ return MMSYSERR_INVALPARAM;
+
+ if ( ! Capabilities )
+ return MMSYSERR_INVALPARAM;
+
+ /* Select appropriate IOCTL and capabilities structure */
+ switch ( Device->DeviceType )
+ {
+ case WAVE_OUT_DEVICE_TYPE :
+ Ioctl = IOCTL_WAVE_GET_CAPABILITIES;
+ RawCapsPtr = (PVOID) &Capabilities->WaveOut;
+ CapsSize = sizeof(WAVEOUTCAPS);
+ break;
+
+ case WAVE_IN_DEVICE_TYPE :
+ Ioctl = IOCTL_WAVE_GET_CAPABILITIES;
+ RawCapsPtr = (PVOID) &Capabilities->WaveIn;
+ CapsSize = sizeof(WAVEINCAPS);
+ break;
+
+ case MIDI_OUT_DEVICE_TYPE :
+ Ioctl = IOCTL_MIDI_GET_CAPABILITIES;
+ RawCapsPtr = (PVOID) &Capabilities->MidiOut;
+ CapsSize = sizeof(MIDIOUTCAPS);
+ break;
+
+ case MIDI_IN_DEVICE_TYPE :
+ Ioctl = IOCTL_MIDI_GET_CAPABILITIES;
+ RawCapsPtr = (PVOID) &Capabilities->MidiIn;
+ CapsSize = sizeof(MIDIINCAPS);
+ break;
+
+ case MIXER_DEVICE_TYPE :
+ /* TODO */
+ /*Ioctl = IOCTL_MIX_GET_CAPABILITIES;*/
+ return MMSYSERR_NOTSUPPORTED;
+
+ case AUX_DEVICE_TYPE :
+ /* TODO */
+ Ioctl = IOCTL_AUX_GET_CAPABILITIES;
+ return MMSYSERR_NOTSUPPORTED;
+
+ default :
+ return MMSYSERR_NOTSUPPORTED;
+ }
+
+ /* Call the driver */
+ Result = ReadSoundDevice(
+ Device,
+ Ioctl,
+ (LPVOID) RawCapsPtr,
+ CapsSize,
+ &BytesReturned,
+ NULL);
+
+ return Result;
+}
Propchange: branches/silverblade-audio/lib/drivers/sound/mmebuddy/capabilities.c
------------------------------------------------------------------------------
svn:eol-style = native
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] Sat Jul
12 16:44:10 2008
@@ -1,19 +1,12 @@
/*
- ReactOS Sound System
- MME Driver Helper
-
- Purpose:
- Device list manager
-
- Author:
- Andrew Greenwood (silverblade(a)reactos.org)
-
- History:
- 4 July 2008 - Created
- 5 July 2008 - Implemented format support
- 6 July 2008 - Added default instance constructor/destructor
+ * PROJECT: ReactOS Sound System "MME Buddy" Library
+ * LICENSE: GPL - See COPYING in the top level directory
+ * FILE: lib/sound/mmebuddy/devices.c
+ *
+ * PURPOSE: Manages lists of sound devices.
+ *
+ * PROGRAMMERS: Andrew Greenwood (silverblade(a)reactos.org)
*/
-
/*
TODO:
@@ -335,188 +328,6 @@
/* Should these go somewhere else? */
MMRESULT
-GetSoundDeviceCapabilities(
- IN PSOUND_DEVICE Device,
- OUT PUNIVERSAL_CAPS Capabilities)
-{
- if ( ! Device )
- return MMSYSERR_INVALPARAM;
-
- if ( ! Capabilities )
- return MMSYSERR_INVALPARAM;
-
- return Device->Functions.GetCapabilities(Device, Capabilities);
-}
-
-MMRESULT
-DefaultGetSoundDeviceCapabilities(
- IN PSOUND_DEVICE Device,
- OUT PUNIVERSAL_CAPS Capabilities)
-{
- PVOID RawCapsPtr = NULL;
- ULONG CapsSize = 0;
- DWORD Ioctl;
- MMRESULT Result;
- DWORD BytesReturned;
-
- ZeroMemory(Capabilities, sizeof(UNIVERSAL_CAPS));
-
- if ( ! Device )
- return MMSYSERR_INVALPARAM;
-
- if ( ! Capabilities )
- return MMSYSERR_INVALPARAM;
-
- /* Select appropriate IOCTL and capabilities structure */
- switch ( Device->DeviceType )
- {
- case WAVE_OUT_DEVICE_TYPE :
- Ioctl = IOCTL_WAVE_GET_CAPABILITIES;
- RawCapsPtr = (PVOID) &Capabilities->WaveOut;
- CapsSize = sizeof(WAVEOUTCAPS);
- break;
-
- case WAVE_IN_DEVICE_TYPE :
- Ioctl = IOCTL_WAVE_GET_CAPABILITIES;
- RawCapsPtr = (PVOID) &Capabilities->WaveIn;
- CapsSize = sizeof(WAVEINCAPS);
- break;
-
- case MIDI_OUT_DEVICE_TYPE :
- Ioctl = IOCTL_MIDI_GET_CAPABILITIES;
- RawCapsPtr = (PVOID) &Capabilities->MidiOut;
- CapsSize = sizeof(MIDIOUTCAPS);
- break;
-
- case MIDI_IN_DEVICE_TYPE :
- Ioctl = IOCTL_MIDI_GET_CAPABILITIES;
- RawCapsPtr = (PVOID) &Capabilities->MidiIn;
- CapsSize = sizeof(MIDIINCAPS);
- break;
-
- case MIXER_DEVICE_TYPE :
- /* TODO */
- /*Ioctl = IOCTL_MIX_GET_CAPABILITIES;*/
- return MMSYSERR_NOTSUPPORTED;
-
- case AUX_DEVICE_TYPE :
- /* TODO */
- Ioctl = IOCTL_AUX_GET_CAPABILITIES;
- return MMSYSERR_NOTSUPPORTED;
-
- default :
- return MMSYSERR_NOTSUPPORTED;
- }
-
- /* Call the driver */
- Result = ReadSoundDevice(
- Device,
- Ioctl,
- (LPVOID) RawCapsPtr,
- CapsSize,
- &BytesReturned,
- NULL);
-
- return Result;
-}
-
-MMRESULT
-QueryWaveDeviceFormatSupport(
- IN PSOUND_DEVICE Device,
- IN PWAVEFORMATEX WaveFormat,
- IN DWORD WaveFormatSize)
-{
- if ( ! Device )
- return MMSYSERR_INVALPARAM;
-
- if ( ! WaveFormat )
- return MMSYSERR_INVALPARAM;
-
- /* TODO: Should we check the size? */
-
- return Device->Functions.QueryWaveFormat(Device, WaveFormat, WaveFormatSize);
-}
-
-MMRESULT
-DefaultQueryWaveDeviceFormatSupport(
- IN PSOUND_DEVICE Device,
- IN PWAVEFORMATEX WaveFormat,
- IN DWORD WaveFormatSize)
-{
- MMRESULT Result;
- DWORD BytesReturned = 0;
-
- if ( ! Device )
- return MMSYSERR_INVALPARAM;
-
- if ( ! WaveFormat )
- return MMSYSERR_INVALPARAM;
-
- /* Make sure we have a wave device */
- if ( ! IS_WAVE_DEVICE_TYPE(Device->DeviceType) )
- {
- return MMSYSERR_INVALPARAM;
- }
-
- Result = WriteSoundDevice(Device,
- IOCTL_WAVE_QUERY_FORMAT,
- (LPVOID) WaveFormat,
- WaveFormatSize,
- &BytesReturned,
- NULL);
-
- return Result;
-}
-
-MMRESULT
-SetWaveDeviceFormat(
- IN PSOUND_DEVICE_INSTANCE Instance,
- IN PWAVEFORMATEX WaveFormat,
- IN DWORD WaveFormatSize)
-{
- if ( ! Instance )
- return MMSYSERR_INVALPARAM;
-
- if ( ! WaveFormat )
- return MMSYSERR_INVALPARAM;
-
- /* TODO: Should we check the size? */
-
- return Instance->Device->Functions.SetWaveFormat(Instance, WaveFormat,
WaveFormatSize);
-}
-
-MMRESULT
-DefaultSetWaveDeviceFormat(
- IN PSOUND_DEVICE_INSTANCE Instance,
- IN PWAVEFORMATEX WaveFormat,
- IN DWORD WaveFormatSize)
-{
- MMRESULT Result;
- DWORD BytesReturned = 0;
-
- if ( ! Instance )
- return MMSYSERR_INVALPARAM;
-
- if ( ! WaveFormat )
- return MMSYSERR_INVALPARAM;
-
- /* Make sure we have a wave device */
- if ( ! IS_WAVE_DEVICE_TYPE(Instance->Device->DeviceType) )
- {
- return MMSYSERR_INVALPARAM;
- }
-
- Result = WriteSoundDevice(Instance->Device,
- IOCTL_WAVE_SET_FORMAT,
- (LPVOID) WaveFormat,
- WaveFormatSize,
- &BytesReturned,
- NULL);
-
- return Result;
-}
-
-MMRESULT
DefaultInstanceConstructor(
IN struct _SOUND_DEVICE_INSTANCE* SoundDeviceInstance)
{
Modified: branches/silverblade-audio/lib/drivers/sound/mmebuddy/instances.c
URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/lib/drivers/s…
==============================================================================
--- branches/silverblade-audio/lib/drivers/sound/mmebuddy/instances.c [iso-8859-1]
(original)
+++ branches/silverblade-audio/lib/drivers/sound/mmebuddy/instances.c [iso-8859-1] Sat Jul
12 16:44:10 2008
@@ -1,16 +1,12 @@
/*
- ReactOS Sound System
- MME Driver Helper
-
- Purpose:
- Device instance manager
-
- Author:
- Andrew Greenwood (silverblade(a)reactos.org)
-
- History:
- 4 July 2008 - Created
- 6 July 2008 - Re-structured
+ * PROJECT: ReactOS Sound System "MME Buddy" Library
+ * LICENSE: GPL - See COPYING in the top level directory
+ * FILE: lib/sound/mmebuddy/instances.c
+ *
+ * PURPOSE: Handles construction/destruction of sound device instances,
+ * along with tracking of existing instances.
+ *
+ * PROGRAMMERS: Andrew Greenwood (silverblade(a)reactos.org)
*/
#include <windows.h>
Modified: branches/silverblade-audio/lib/drivers/sound/mmebuddy/kernel.c
URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/lib/drivers/s…
==============================================================================
--- branches/silverblade-audio/lib/drivers/sound/mmebuddy/kernel.c [iso-8859-1]
(original)
+++ branches/silverblade-audio/lib/drivers/sound/mmebuddy/kernel.c [iso-8859-1] Sat Jul 12
16:44:10 2008
@@ -1,15 +1,12 @@
/*
- ReactOS Sound System
- MME Driver Helper
-
- Purpose:
- Kernel device I/O
-
- Author:
- Andrew Greenwood (silverblade(a)reactos.org)
-
- History:
- 4 July 2008 - Created
+ * PROJECT: ReactOS Sound System "MME Buddy" Library
+ * LICENSE: GPL - See COPYING in the top level directory
+ * FILE: lib/sound/mmebuddy/kernel.c
+ *
+ * PURPOSE: Routines assisting with device I/O between user-mode and
+ * kernel-mode.
+ *
+ * PROGRAMMERS: Andrew Greenwood (silverblade(a)reactos.org)
*/
#include <windows.h>
Copied: branches/silverblade-audio/lib/drivers/sound/mmebuddy/midi/midMessage.c (from
r34432, branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/midMessage.c)
URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/lib/drivers/s…
==============================================================================
--- branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/midMessage.c [iso-8859-1]
(original)
+++ branches/silverblade-audio/lib/drivers/sound/mmebuddy/midi/midMessage.c [iso-8859-1]
Sat Jul 12 16:44:10 2008
@@ -1,15 +1,12 @@
/*
- ReactOS Sound System
- MME Interface
-
- Purpose:
- MIDI Input device message handler
-
- Author:
- Andrew Greenwood (silverblade(a)reactos.org)
-
- History:
- 4 July 2008 - Created
+ * PROJECT: ReactOS Sound System "MME Buddy" Library
+ * LICENSE: GPL - See COPYING in the top level directory
+ * FILE: lib/sound/mmebuddy/midi/midMessage.c
+ *
+ * PURPOSE: Provides the midMessage exported function, as required by
+ * the MME API, for MIDI input device support.
+ *
+ * PROGRAMMERS: Andrew Greenwood (silverblade(a)reactos.org)
*/
#include <windows.h>
Copied: branches/silverblade-audio/lib/drivers/sound/mmebuddy/midi/modMessage.c (from
r34432, branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/modMessage.c)
URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/lib/drivers/s…
==============================================================================
--- branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/modMessage.c [iso-8859-1]
(original)
+++ branches/silverblade-audio/lib/drivers/sound/mmebuddy/midi/modMessage.c [iso-8859-1]
Sat Jul 12 16:44:10 2008
@@ -1,15 +1,12 @@
/*
- ReactOS Sound System
- MME Interface
-
- Purpose:
- MIDI Output device message handler
-
- Author:
- Andrew Greenwood (silverblade(a)reactos.org)
-
- History:
- 4 July 2008 - Created
+ * PROJECT: ReactOS Sound System "MME Buddy" Library
+ * LICENSE: GPL - See COPYING in the top level directory
+ * FILE: lib/sound/mmebuddy/midi/modMessage.c
+ *
+ * PURPOSE: Provides the modMessage exported function, as required by
+ * the MME API, for MIDI output device support.
+ *
+ * PROGRAMMERS: Andrew Greenwood (silverblade(a)reactos.org)
*/
#include <windows.h>
Copied: branches/silverblade-audio/lib/drivers/sound/mmebuddy/mixer/mxdMessage.c (from
r34432, branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/mxdMessage.c)
URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/lib/drivers/s…
==============================================================================
--- branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/mxdMessage.c [iso-8859-1]
(original)
+++ branches/silverblade-audio/lib/drivers/sound/mmebuddy/mixer/mxdMessage.c [iso-8859-1]
Sat Jul 12 16:44:10 2008
@@ -1,15 +1,12 @@
/*
- ReactOS Sound System
- MME Interface
-
- Purpose:
- Mixer device message handler
-
- Author:
- Andrew Greenwood (silverblade(a)reactos.org)
-
- History:
- 4 July 2008 - Created
+ * PROJECT: ReactOS Sound System "MME Buddy" Library
+ * LICENSE: GPL - See COPYING in the top level directory
+ * FILE: lib/sound/mmebuddy/mixer/mxdMessage.c
+ *
+ * PURPOSE: Provides the mxdMessage exported function, as required by
+ * the MME API, for mixer support.
+ *
+ * PROGRAMMERS: Andrew Greenwood (silverblade(a)reactos.org)
*/
#include <windows.h>
Modified: branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/DriverProc.c
URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/lib/drivers/s…
==============================================================================
--- branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/DriverProc.c [iso-8859-1]
(original)
+++ branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/DriverProc.c [iso-8859-1]
Sat Jul 12 16:44:10 2008
@@ -1,15 +1,14 @@
/*
- ReactOS Sound System
- MME Interface
-
- Purpose:
- Default DriverProc implementation
-
- Author:
- Andrew Greenwood (silverblade(a)reactos.org)
-
- History:
- 4 July 2008 - Created
+ * PROJECT: ReactOS Sound System "MME Buddy" Library
+ * LICENSE: GPL - See COPYING in the top level directory
+ * FILE: lib/sound/mmebuddy/mme/DriverProc.c
+ *
+ * PURPOSE: Provides a default/boilerplate implementation of the DriverProc
+ * export function. (NOTE: This file may be fairly redundant
+ * because the MME API can provide default functionality anyway.)
+ * This file will be removed from future revisions.
+ *
+ * PROGRAMMERS: Andrew Greenwood (silverblade(a)reactos.org)
*/
#include <windows.h>
Removed: branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/auxMessage.c
URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/lib/drivers/s…
==============================================================================
--- branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/auxMessage.c [iso-8859-1]
(original)
+++ branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/auxMessage.c (removed)
@@ -1,32 +1,0 @@
-/*
- ReactOS Sound System
- MME Interface
-
- Purpose:
- Auxiliary device message handler
-
- Author:
- Andrew Greenwood (silverblade(a)reactos.org)
-
- History:
- 4 July 2008 - Created
-*/
-
-#include <windows.h>
-#include <mmsystem.h>
-#include <mmddk.h>
-
-#include <mmebuddy.h>
-
-APIENTRY DWORD
-auxMessage(
- DWORD device_id,
- DWORD message,
- DWORD private_handle,
- DWORD parameter1,
- DWORD parameter2)
-{
- TRACE_("auxMessageStub called\n");
- /* TODO */
- return MMSYSERR_NOTSUPPORTED;
-}
Added: branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/callback.c
URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/lib/drivers/s…
==============================================================================
--- branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/callback.c (added)
+++ branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/callback.c [iso-8859-1] Sat
Jul 12 16:44:10 2008
@@ -1,0 +1,21 @@
+/*
+ * PROJECT: ReactOS Sound System "MME Buddy" Library
+ * LICENSE: GPL - See COPYING in the top level directory
+ * FILE: lib/sound/mmebuddy/mme/callback.c
+ *
+ * PURPOSE: Calls an MME API client application, usually to return
+ * buffers which have been processed etc.
+ *
+ * PROGRAMMERS: Andrew Greenwood (silverblade(a)reactos.org)
+*/
+
+#include <windows.h>
+#include <mmsystem.h>
+
+VOID
+NotifySoundClient(
+ DWORD Message,
+ DWORD Parameter)
+{
+ /* TODO... DriverCallback */
+}
Propchange: branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/callback.c
------------------------------------------------------------------------------
svn:eol-style = native
Removed: branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/midMessage.c
URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/lib/drivers/s…
==============================================================================
--- branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/midMessage.c [iso-8859-1]
(original)
+++ branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/midMessage.c (removed)
@@ -1,50 +1,0 @@
-/*
- ReactOS Sound System
- MME Interface
-
- Purpose:
- MIDI Input device message handler
-
- Author:
- Andrew Greenwood (silverblade(a)reactos.org)
-
- History:
- 4 July 2008 - Created
-*/
-
-#include <windows.h>
-#include <mmsystem.h>
-#include <mmddk.h>
-
-#include <mmebuddy.h>
-
-APIENTRY DWORD
-midMessage(
- DWORD device_id,
- DWORD message,
- DWORD private_handle,
- DWORD parameter1,
- DWORD parameter2)
-{
- TRACE_("midMessageStub called\n");
-
- switch ( message )
- {
- case MIDM_GETNUMDEVS :
- return 0;
-
- case MIDM_GETDEVCAPS :
- case MIDM_OPEN :
- return MMSYSERR_BADDEVICEID;
-
- case MIDM_CLOSE :
- case MIDM_ADDBUFFER :
- case MIDM_START :
- case MIDM_STOP :
- case MIDM_RESET :
- return MMSYSERR_INVALHANDLE;
-
- default :
- return MMSYSERR_NOTSUPPORTED;
- }
-}
Removed: branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/modMessage.c
URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/lib/drivers/s…
==============================================================================
--- branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/modMessage.c [iso-8859-1]
(original)
+++ branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/modMessage.c (removed)
@@ -1,49 +1,0 @@
-/*
- ReactOS Sound System
- MME Interface
-
- Purpose:
- MIDI Output device message handler
-
- Author:
- Andrew Greenwood (silverblade(a)reactos.org)
-
- History:
- 4 July 2008 - Created
-*/
-
-#include <windows.h>
-#include <mmsystem.h>
-#include <mmddk.h>
-
-#include <mmebuddy.h>
-
-APIENTRY DWORD
-modMessage(
- DWORD device_id,
- DWORD message,
- DWORD private_handle,
- DWORD parameter1,
- DWORD parameter2)
-{
- TRACE_("modMessageStub called\n");
-
- switch ( message )
- {
- case MODM_GETNUMDEVS :
- return 0;
-
- case MODM_GETDEVCAPS :
- case MODM_OPEN :
- return MMSYSERR_BADDEVICEID;
-
- case MODM_CLOSE :
- case MODM_DATA :
- case MODM_LONGDATA :
- case MODM_RESET :
- return MMSYSERR_INVALHANDLE;
-
- default :
- return MMSYSERR_NOTSUPPORTED;
- }
-}
Removed: branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/mxdMessage.c
URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/lib/drivers/s…
==============================================================================
--- branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/mxdMessage.c [iso-8859-1]
(original)
+++ branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/mxdMessage.c (removed)
@@ -1,32 +1,0 @@
-/*
- ReactOS Sound System
- MME Interface
-
- Purpose:
- Mixer device message handler
-
- Author:
- Andrew Greenwood (silverblade(a)reactos.org)
-
- History:
- 4 July 2008 - Created
-*/
-
-#include <windows.h>
-#include <mmsystem.h>
-#include <mmddk.h>
-
-#include <mmebuddy.h>
-
-APIENTRY DWORD
-mxdMessage(
- DWORD device_id,
- DWORD message,
- DWORD private_handle,
- DWORD parameter1,
- DWORD parameter2)
-{
- TRACE_("mxdMessageStub called\n");
- /* TODO */
- return MMSYSERR_NOTSUPPORTED;
-}
Removed: branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/widMessage.c
URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/lib/drivers/s…
==============================================================================
--- branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/widMessage.c [iso-8859-1]
(original)
+++ branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/widMessage.c (removed)
@@ -1,49 +1,0 @@
-/*
- ReactOS Sound System
- MME Interface
-
- Purpose:
- Wave input device message handler
-
- Author:
- Andrew Greenwood (silverblade(a)reactos.org)
-
- History:
- 4 July 2008 - Created
-*/
-
-#include <windows.h>
-#include <mmsystem.h>
-#include <mmddk.h>
-#include <ntddsnd.h>
-
-#include <mmebuddy.h>
-
-APIENTRY DWORD
-widMessage(
- DWORD device_id,
- DWORD message,
- DWORD private_handle,
- DWORD parameter1,
- DWORD parameter2)
-{
- TRACE_("widMessageStub called\n");
-
- switch ( message )
- {
- case WIDM_GETNUMDEVS :
- return GetSoundDeviceCount(WAVE_IN_DEVICE_TYPE);
-
- case WIDM_GETDEVCAPS :
- case WIDM_OPEN :
- return MMSYSERR_BADDEVICEID;
-
- case WIDM_CLOSE :
- case WIDM_START :
- case WIDM_RESET :
- return MMSYSERR_INVALHANDLE;
-
- default :
- return MMSYSERR_NOTSUPPORTED;
- }
-}
Removed: branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/wodMessage.c
URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/lib/drivers/s…
==============================================================================
--- branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/wodMessage.c [iso-8859-1]
(original)
+++ branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/wodMessage.c (removed)
@@ -1,142 +1,0 @@
-/*
- ReactOS Sound System
- MME Interface
-
- Purpose:
- Wave output device message handler
-
- Author:
- Andrew Greenwood (silverblade(a)reactos.org)
-
- History:
- 4 July 2008 - Created
-*/
-
-#include <windows.h>
-#include <mmsystem.h>
-#include <mmddk.h>
-
-#include <ntddsnd.h>
-#include <mmebuddy.h>
-
-APIENTRY DWORD
-wodMessage(
- DWORD device_id,
- DWORD message,
- DWORD private_handle,
- DWORD parameter1,
- DWORD parameter2)
-{
- MMRESULT Result = MMSYSERR_NOERROR;
- PSOUND_DEVICE Device = NULL;
- PSOUND_DEVICE_INSTANCE Instance =
- (PSOUND_DEVICE_INSTANCE)private_handle;
-
- TRACE_("wodMessageStub called\n");
-
- switch ( message )
- {
- case WODM_GETNUMDEVS :
- return GetSoundDeviceCount(WAVE_OUT_DEVICE_TYPE);
-
- case WODM_GETDEVCAPS :
- {
- UNIVERSAL_CAPS Capabilities;
-
- if ( parameter2 < sizeof(WAVEOUTCAPS) )
- return MMSYSERR_INVALPARAM;
-
- Result = GetSoundDevice(WAVE_OUT_DEVICE_TYPE, device_id, &Device);
- if ( Result != MMSYSERR_NOERROR )
- return Result;
-
- Result = GetSoundDeviceCapabilities(Device, &Capabilities);
- if ( Result != MMSYSERR_NOERROR )
- return Result;
-
- CopyMemory((LPWAVEOUTCAPS)parameter1, &Capabilities.WaveOut,
parameter2);
-
- return Result;
- }
-
- case WODM_OPEN :
- {
- WAVEOPENDESC* OpenParameters = (WAVEOPENDESC*) parameter1;
-
- TRACE_("In WODM_OPEN\n");
- Result = GetSoundDevice(WAVE_OUT_DEVICE_TYPE, device_id, &Device);
- if ( Result != MMSYSERR_NOERROR )
- return Result;
-
- if ( parameter2 & WAVE_FORMAT_QUERY )
- {
- Result = QueryWaveDeviceFormatSupport(Device,
- OpenParameters->lpFormat,
- sizeof(WAVEFORMATEX));
-
- return Result;
- }
-
- ASSERT(private_handle != 0);
-
- Result = CreateSoundDeviceInstance(Device, &Instance);
- if ( Result != MMSYSERR_NOERROR )
- return Result;
-
- Result = SetWaveDeviceFormat(Instance,
- OpenParameters->lpFormat,
- sizeof(WAVEFORMATEX));
-
- if ( Result != MMSYSERR_NOERROR )
- {
- DestroySoundDeviceInstance(Instance);
- return Result;
- }
-
- /* Provide winmm with instance handle */
- *((PSOUND_DEVICE_INSTANCE*)private_handle) = Instance;
-
- /* TODO: Send callback... */
-
- return MMSYSERR_NOERROR;
- }
-
- case WODM_CLOSE :
- {
- //SOUND_DEBUG_HEX(Instance);
- ASSERT(Instance != NULL);
-
- /* TODO: Ensure its OK to close */
-
- Result = DestroySoundDeviceInstance(Instance);
- /*SOUND_DEBUG_HEX(Result);*/
-
- /* TODO: When do we send the callback? */
-
- return Result;
- /* CloseSoundDevice() */
- }
-
- case WODM_WRITE :
- {
- ASSERT(Instance != NULL);
- ASSERT(parameter1 != 0);
-
- return QueueWaveDeviceBuffer(Instance, (PWAVEHDR) parameter1);
- }
-
- case WODM_PAUSE :
- case WODM_RESTART :
- case WODM_RESET :
- case WODM_BREAKLOOP :
- return MMSYSERR_INVALHANDLE;
-
- /* Let WINMM take care of these */
- case WODM_PREPARE :
- case WODM_UNPREPARE :
- return MMSYSERR_NOTSUPPORTED;
-
- default :
- return MMSYSERR_NOTSUPPORTED;
- }
-}
Modified: branches/silverblade-audio/lib/drivers/sound/mmebuddy/mmebuddy.rbuild
URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/lib/drivers/s…
==============================================================================
--- branches/silverblade-audio/lib/drivers/sound/mmebuddy/mmebuddy.rbuild [iso-8859-1]
(original)
+++ branches/silverblade-audio/lib/drivers/sound/mmebuddy/mmebuddy.rbuild [iso-8859-1] Sat
Jul 12 16:44:10 2008
@@ -2,24 +2,31 @@
<!DOCTYPE module SYSTEM "../../../../tools/rbuild/project.dtd">
<module name="mmebuddy" type="staticlibrary"
allowwarnings="false" unicode="yes">
<include base="ReactOS">include/reactos/libs/sound</include>
+ <file>kernel.c</file>
+ <file>nt4.c</file>
<file>devices.c</file>
<file>instances.c</file>
- <file>kernel.c</file>
- <file>nt4.c</file>
+ <file>capabilities.c</file>
+ <file>thread.c</file>
<file>utility.c</file>
- <file>thread.c</file>
<directory name="mme">
<file>DriverProc.c</file>
+ </directory>
+ <directory name="wave">
<file>wodMessage.c</file>
<file>widMessage.c</file>
+ <file>format.c</file>
+ <file>streaming.c</file>
+ <file>streamcontrol.c</file>
+ </directory>
+ <directory name="midi">
<file>modMessage.c</file>
<file>midMessage.c</file>
+ </directory>
+ <directory name="mixer">
<file>mxdMessage.c</file>
+ </directory>
+ <directory name="auxiliary">
<file>auxMessage.c</file>
</directory>
- <directory name="wave">
- <file>wavethread.c</file>
- </directory>
- <directory name="midi">
- </directory>
</module>
Modified: branches/silverblade-audio/lib/drivers/sound/mmebuddy/nt4.c
URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/lib/drivers/s…
==============================================================================
--- branches/silverblade-audio/lib/drivers/sound/mmebuddy/nt4.c [iso-8859-1] (original)
+++ branches/silverblade-audio/lib/drivers/sound/mmebuddy/nt4.c [iso-8859-1] Sat Jul 12
16:44:10 2008
@@ -1,20 +1,14 @@
/*
- ReactOS Sound System
- MME Driver Helper
-
- Purpose:
- Legacy (NT4) sound device support
-
- Author:
- Andrew Greenwood (silverblade(a)reactos.org)
-
- History:
- 4 July 2008 - Created
-*/
-
-/*
- A better way of detecting sound devices...
- Search the appropriate registry key!
+ * PROJECT: ReactOS Sound System "MME Buddy" Library
+ * LICENSE: GPL - See COPYING in the top level directory
+ * FILE: lib/sound/mmebuddy/nt4.c
+ *
+ * PURPOSE: Assists in locating Windows NT4 compatible sound devices,
+ * which mostly use the same device naming convention and/or
+ * store their created device names within their service key
+ * within the registry.
+ *
+ * PROGRAMMERS: Andrew Greenwood (silverblade(a)reactos.org)
*/
#include <windows.h>
Modified: branches/silverblade-audio/lib/drivers/sound/mmebuddy/thread.c
URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/lib/drivers/s…
==============================================================================
--- branches/silverblade-audio/lib/drivers/sound/mmebuddy/thread.c [iso-8859-1]
(original)
+++ branches/silverblade-audio/lib/drivers/sound/mmebuddy/thread.c [iso-8859-1] Sat Jul 12
16:44:10 2008
@@ -1,18 +1,11 @@
/*
- ReactOS Sound System
- MME Driver Helper
-
- Purpose:
- Sound device processing thread
-
- Author:
- Andrew Greenwood (silverblade(a)reactos.org)
-
- History:
- 4 July 2008 - Created
- 5 July 2008 - Implemented basic request processing
- 6 July 2008 - Added I/O completion handling
- 9 July 2008 - Rewritten to have a single streaming thread
+ * PROJECT: ReactOS Sound System "MME Buddy" Library
+ * LICENSE: GPL - See COPYING in the top level directory
+ * FILE: lib/sound/mmebuddy/thread.c
+ *
+ * PURPOSE: Manages a thread to assist with the streaming of sound data.
+ *
+ * PROGRAMMERS: Andrew Greenwood (silverblade(a)reactos.org)
*/
#include <windows.h>
Modified: branches/silverblade-audio/lib/drivers/sound/mmebuddy/utility.c
URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/lib/drivers/s…
==============================================================================
--- branches/silverblade-audio/lib/drivers/sound/mmebuddy/utility.c [iso-8859-1]
(original)
+++ branches/silverblade-audio/lib/drivers/sound/mmebuddy/utility.c [iso-8859-1] Sat Jul
12 16:44:10 2008
@@ -1,15 +1,11 @@
/*
- ReactOS Sound System
- MME Driver Helper
-
- Purpose:
- Utility functions
-
- Author:
- Andrew Greenwood (silverblade(a)reactos.org)
-
- History:
- 4 July 2008 - Created
+ * PROJECT: ReactOS Sound System "MME Buddy" Library
+ * LICENSE: GPL - See COPYING in the top level directory
+ * FILE: lib/sound/mmebuddy/utility.c
+ *
+ * PURPOSE: Provides utility functions used by the library.
+ *
+ * PROGRAMMERS: Andrew Greenwood (silverblade(a)reactos.org)
*/
#include <windows.h>
Added: branches/silverblade-audio/lib/drivers/sound/mmebuddy/wave/format.c
URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/lib/drivers/s…
==============================================================================
--- branches/silverblade-audio/lib/drivers/sound/mmebuddy/wave/format.c (added)
+++ branches/silverblade-audio/lib/drivers/sound/mmebuddy/wave/format.c [iso-8859-1] Sat
Jul 12 16:44:10 2008
@@ -1,0 +1,112 @@
+/*
+ * PROJECT: ReactOS Sound System "MME Buddy" Library
+ * LICENSE: GPL - See COPYING in the top level directory
+ * FILE: lib/sound/mmebuddy/wave/format.c
+ *
+ * PURPOSE: Queries/sets format for wave audio devices.
+ *
+ * PROGRAMMERS: Andrew Greenwood (silverblade(a)reactos.org)
+*/
+
+#include <windows.h>
+#include <mmsystem.h>
+#include <ntddk.h> /* for IOCTL stuff */
+#include <ntddsnd.h>
+
+#include <mmebuddy.h>
+
+MMRESULT
+QueryWaveDeviceFormatSupport(
+ IN PSOUND_DEVICE Device,
+ IN PWAVEFORMATEX WaveFormat,
+ IN DWORD WaveFormatSize)
+{
+ if ( ! Device )
+ return MMSYSERR_INVALPARAM;
+
+ if ( ! WaveFormat )
+ return MMSYSERR_INVALPARAM;
+
+ /* TODO: Should we check the size? */
+
+ return Device->Functions.QueryWaveFormat(Device, WaveFormat, WaveFormatSize);
+}
+
+MMRESULT
+DefaultQueryWaveDeviceFormatSupport(
+ IN PSOUND_DEVICE Device,
+ IN PWAVEFORMATEX WaveFormat,
+ IN DWORD WaveFormatSize)
+{
+ MMRESULT Result;
+ DWORD BytesReturned = 0;
+
+ if ( ! Device )
+ return MMSYSERR_INVALPARAM;
+
+ if ( ! WaveFormat )
+ return MMSYSERR_INVALPARAM;
+
+ /* Make sure we have a wave device */
+ if ( ! IS_WAVE_DEVICE_TYPE(Device->DeviceType) )
+ {
+ return MMSYSERR_INVALPARAM;
+ }
+
+ Result = WriteSoundDevice(Device,
+ IOCTL_WAVE_QUERY_FORMAT,
+ (LPVOID) WaveFormat,
+ WaveFormatSize,
+ &BytesReturned,
+ NULL);
+
+ return Result;
+}
+
+MMRESULT
+SetWaveDeviceFormat(
+ IN PSOUND_DEVICE_INSTANCE Instance,
+ IN PWAVEFORMATEX WaveFormat,
+ IN DWORD WaveFormatSize)
+{
+ if ( ! Instance )
+ return MMSYSERR_INVALPARAM;
+
+ if ( ! WaveFormat )
+ return MMSYSERR_INVALPARAM;
+
+ /* TODO: Should we check the size? */
+
+ return Instance->Device->Functions.SetWaveFormat(Instance, WaveFormat,
WaveFormatSize);
+}
+
+MMRESULT
+DefaultSetWaveDeviceFormat(
+ IN PSOUND_DEVICE_INSTANCE Instance,
+ IN PWAVEFORMATEX WaveFormat,
+ IN DWORD WaveFormatSize)
+{
+ MMRESULT Result;
+ DWORD BytesReturned = 0;
+
+ if ( ! Instance )
+ return MMSYSERR_INVALPARAM;
+
+ if ( ! WaveFormat )
+ return MMSYSERR_INVALPARAM;
+
+ /* Make sure we have a wave device */
+ if ( ! IS_WAVE_DEVICE_TYPE(Instance->Device->DeviceType) )
+ {
+ return MMSYSERR_INVALPARAM;
+ }
+
+ Result = WriteSoundDevice(Instance->Device,
+ IOCTL_WAVE_SET_FORMAT,
+ (LPVOID) WaveFormat,
+ WaveFormatSize,
+ &BytesReturned,
+ NULL);
+
+ return Result;
+}
Propchange: branches/silverblade-audio/lib/drivers/sound/mmebuddy/wave/format.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: 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 (added)
+++ branches/silverblade-audio/lib/drivers/sound/mmebuddy/wave/streamcontrol.c
[iso-8859-1] Sat Jul 12 16:44:10 2008
@@ -1,0 +1,45 @@
+/*
+ * PROJECT: ReactOS Sound System "MME Buddy" Library
+ * LICENSE: GPL - See COPYING in the top level directory
+ * FILE: lib/sound/mmebuddy/wave/streamcontrol.c
+ *
+ * PURPOSE: Controls the wave streaming thread.
+ *
+ * PROGRAMMERS: Andrew Greenwood (silverblade(a)reactos.org)
+*/
+
+#include <windows.h>
+#include <mmsystem.h>
+
+#include <mmebuddy.h>
+#include "wave.h"
+
+MMRESULT
+QueueWaveDeviceBuffer(
+ IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance,
+ IN PWAVEHDR BufferHeader)
+{
+ if ( ! SoundDeviceInstance )
+ return MMSYSERR_INVALPARAM;
+
+ if ( ! BufferHeader )
+ return MMSYSERR_INVALPARAM;
+
+ if ( ! BufferHeader->lpData )
+ return MMSYSERR_INVALPARAM;
+
+ if ( ! BufferHeader->dwBufferLength )
+ return MMSYSERR_INVALPARAM;
+
+ if ( ! (BufferHeader->dwFlags & WHDR_PREPARED ) )
+ return WAVERR_UNPREPARED;
+
+ /* TODO: WHDR_INQUEUE */
+
+ BufferHeader->dwFlags &= ~WHDR_DONE;
+ BufferHeader->lpNext = NULL;
+
+ return CallUsingSoundThread(SoundDeviceInstance,
+ QueueBuffer_Request,
+ BufferHeader);
+}
Propchange: branches/silverblade-audio/lib/drivers/sound/mmebuddy/wave/streamcontrol.c
------------------------------------------------------------------------------
svn:eol-style = native
Copied: branches/silverblade-audio/lib/drivers/sound/mmebuddy/wave/streaming.c (from
r34432, branches/silverblade-audio/lib/drivers/sound/mmebuddy/wave/wavethread.c)
URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/lib/drivers/s…
==============================================================================
--- branches/silverblade-audio/lib/drivers/sound/mmebuddy/wave/wavethread.c [iso-8859-1]
(original)
+++ branches/silverblade-audio/lib/drivers/sound/mmebuddy/wave/streaming.c [iso-8859-1]
Sat Jul 12 16:44:10 2008
@@ -1,19 +1,12 @@
/*
- ReactOS Sound System
- MME Driver Helper
-
- Purpose:
- Wave thread operations
-
- Author:
- Andrew Greenwood (silverblade(a)reactos.org)
-
- History:
- 4 July 2008 - Created
- 6 July 2008 - Restructured to hide some of the low-level threading
-
- TODO:
- Track if a buffer has already been inserted?
+ * PROJECT: ReactOS Sound System "MME Buddy" Library
+ * LICENSE: GPL - See COPYING in the top level directory
+ * FILE: lib/sound/mmebuddy/wave/streaming.c
+ *
+ * PURPOSE: Streams wave audio data to/from a sound driver, within
+ * a separate thread.
+ *
+ * PROGRAMMERS: Andrew Greenwood (silverblade(a)reactos.org)
*/
#include <windows.h>
@@ -227,34 +220,3 @@
return MMSYSERR_NOERROR;
}
-
-
-MMRESULT
-QueueWaveDeviceBuffer(
- IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance,
- IN PWAVEHDR BufferHeader)
-{
- if ( ! SoundDeviceInstance )
- return MMSYSERR_INVALPARAM;
-
- if ( ! BufferHeader )
- return MMSYSERR_INVALPARAM;
-
- if ( ! BufferHeader->lpData )
- return MMSYSERR_INVALPARAM;
-
- if ( ! BufferHeader->dwBufferLength )
- return MMSYSERR_INVALPARAM;
-
- if ( ! (BufferHeader->dwFlags & WHDR_PREPARED ) )
- return WAVERR_UNPREPARED;
-
- /* TODO: WHDR_INQUEUE */
-
- BufferHeader->dwFlags &= ~WHDR_DONE;
- BufferHeader->lpNext = NULL;
-
- return CallUsingSoundThread(SoundDeviceInstance,
- QueueBuffer_Request,
- BufferHeader);
-}
Added: 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 (added)
+++ branches/silverblade-audio/lib/drivers/sound/mmebuddy/wave/wave.h [iso-8859-1] Sat Jul
12 16:44:10 2008
@@ -1,0 +1,20 @@
+/*
+ * PROJECT: ReactOS Sound System "MME Buddy" Library
+ * LICENSE: GPL - See COPYING in the top level directory
+ * FILE: lib/sound/mmebuddy/wave/wave.h
+ *
+ * PURPOSE: Provides prototypes and structures relevant to the internal
+ * implementation of the MME wave device support functions.
+ *
+ * PROGRAMMERS: Andrew Greenwood (silverblade(a)reactos.org)
+*/
+
+#ifndef ROS_MMEBUDDY_WAVE_H
+#define ROS_MMEBUDDY_WAVE_H
+
+MMRESULT
+QueueBuffer_Request(
+ IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance,
+ IN PVOID Parameter);
+
+#endif
Propchange: branches/silverblade-audio/lib/drivers/sound/mmebuddy/wave/wave.h
------------------------------------------------------------------------------
svn:eol-style = native
Removed: branches/silverblade-audio/lib/drivers/sound/mmebuddy/wave/wavethread.c
URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/lib/drivers/s…
==============================================================================
--- branches/silverblade-audio/lib/drivers/sound/mmebuddy/wave/wavethread.c [iso-8859-1]
(original)
+++ branches/silverblade-audio/lib/drivers/sound/mmebuddy/wave/wavethread.c (removed)
@@ -1,260 +1,0 @@
-/*
- ReactOS Sound System
- MME Driver Helper
-
- Purpose:
- Wave thread operations
-
- Author:
- Andrew Greenwood (silverblade(a)reactos.org)
-
- History:
- 4 July 2008 - Created
- 6 July 2008 - Restructured to hide some of the low-level threading
-
- TODO:
- Track if a buffer has already been inserted?
-*/
-
-#include <windows.h>
-#include <mmsystem.h>
-
-#include <mmebuddy.h>
-
-
-/*
- How much we can feed to the driver at a time. For example, 2 buffers
- of 65536 would mean we can send 65536 bytes in a single I/O operation,
- and a total of 2 buffers (not necessarily full).
-
- If a single WAVEHDR is larger than MAX_SOUND_BUFFER_SIZE then a second
- buffer will be used.
-*/
-#define MAX_SOUND_BUFFER_SIZE 65536
-#define MAX_SOUND_BUFFERS 2
-
-VOID
-CompleteWaveBuffer(
- IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance,
- IN PVOID Parameter,
- IN DWORD BytesWritten);
-
-BOOLEAN
-StreamReadyForData(
- IN PWAVE_STREAM_INFO StreamInfo)
-{
- ASSERT(StreamInfo);
-
- return (StreamInfo->BuffersOutstanding < MAX_SOUND_BUFFERS);
-}
-
-BOOLEAN
-StreamHasBuffersQueued(
- IN PWAVE_STREAM_INFO StreamInfo)
-{
- ASSERT(StreamInfo);
-
- return (StreamInfo->CurrentBuffer != NULL);
-}
-
-DWORD
-PerformWaveIo(
- IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance)
-{
- PWAVE_STREAM_INFO StreamInfo;
- DWORD BytesToStream, BytesStreamed = 0;
-
- TRACE_("PerformWaveIo\n");
-
- ASSERT(SoundDeviceInstance);
-
- StreamInfo = &SoundDeviceInstance->Streaming.Wave;
-
- /* If we're out of buffers, mark stream as stopped and do nothing */
- if ( ! StreamInfo->CurrentBuffer )
- {
- TRACE_("*** NOTHING TO DO ***\n");
- return 0;
- }
-
- /* Work out how much buffer can be submitted */
- BytesToStream = MinimumOf(StreamInfo->CurrentBuffer->dwBufferLength -
- StreamInfo->CurrentBuffer->reserved,
- MAX_SOUND_BUFFER_SIZE);
-
- TRACE_("About to report what I'm about to write...\n");
-
- TRACE_("Writing %p + %d (%d bytes) - buffer length is %d bytes\n",
- StreamInfo->CurrentBuffer->lpData,
- (int) StreamInfo->CurrentBuffer->reserved,
- (int) BytesToStream,
- (int) StreamInfo->CurrentBuffer->dwBufferLength);
-
- /* TODO: Error checking */
- OverlappedSoundDeviceIo(SoundDeviceInstance,
- (PCHAR) StreamInfo->CurrentBuffer->lpData +
- StreamInfo->CurrentBuffer->reserved,
- BytesToStream,
- CompleteWaveBuffer,
- (PVOID) StreamInfo->CurrentBuffer);
-
- /* FIXME? - find out how much was actually sent? */
- BytesStreamed = BytesToStream;
-
- /* Advance the offset */
- StreamInfo->CurrentBuffer->reserved += BytesStreamed;
-
- /* If we've hit the end of the buffer, move to the next one */
- if ( StreamInfo->CurrentBuffer->reserved ==
- StreamInfo->CurrentBuffer->dwBufferLength )
- {
- TRACE_("Advancing to next buffer\n");
- StreamInfo->CurrentBuffer = StreamInfo->CurrentBuffer->lpNext;
- }
-
- /* Increase the number of outstanding buffers */
- ++ StreamInfo->BuffersOutstanding;
-
- return BytesStreamed;
-}
-
-MMRESULT
-StreamWaveBuffers(
- IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance)
-{
- PWAVE_STREAM_INFO StreamInfo;
- ASSERT(SoundDeviceInstance);
-
- StreamInfo = &SoundDeviceInstance->Streaming.Wave;
-
- TRACE_("<== Streaming wave I/O ==>\n");
- while ( StreamReadyForData(StreamInfo) &&
- StreamHasBuffersQueued(StreamInfo) )
- {
- TRACE_("Performing wave I/O ...\n");
- PerformWaveIo(SoundDeviceInstance);
- }
- TRACE_("<== Done streaming ==>\n");
-
- return MMSYSERR_NOERROR;
-}
-
-VOID
-CompleteWaveBuffer(
- IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance,
- IN PVOID Parameter,
- IN DWORD BytesWritten)
-{
- PWAVE_STREAM_INFO StreamInfo;
-
- TRACE_("CompleteWaveBuffer(%p, %p, %d)\n",
- SoundDeviceInstance,
- Parameter,
- (int) BytesWritten);
-
- ASSERT(SoundDeviceInstance);
-
- StreamInfo = &SoundDeviceInstance->Streaming.Wave;
-
- /* Decrease the number of outstanding buffers */
- ASSERT(StreamInfo->BuffersOutstanding > 0);
- -- StreamInfo->BuffersOutstanding;
-
- PerformWaveIo(SoundDeviceInstance);
-
- TRACE_("Wave completion routine done\n");
-}
-
-MMRESULT
-QueueBuffer_Request(
- IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance,
- IN PVOID Parameter)
-{
- PWAVEHDR WaveHeader = (PWAVEHDR) Parameter;
- PWAVE_STREAM_INFO StreamInfo;
-
- if ( ! SoundDeviceInstance )
- return MMSYSERR_INVALPARAM;
-
- if ( ! WaveHeader )
- return MMSYSERR_INVALPARAM;
-
- /* To avoid stupidly long variable names we alias this */
- StreamInfo = &SoundDeviceInstance->Streaming.Wave;
-
- TRACE_("QueueBuffer_Request\n");
-
- /* Initialise fields of interest to us */
- WaveHeader->lpNext = NULL;
- WaveHeader->reserved = 0;
-
- /*
- Is this the first buffer being queued? Streaming only needs to be
- done here if there's nothing else playing.
- */
- if ( ! StreamInfo->BufferQueueHead )
- {
- TRACE_("This is the first buffer being queued\n");
-
- /* Set head, tail and current to this buffer */
- StreamInfo->BufferQueueHead = WaveHeader;
- StreamInfo->BufferQueueTail = WaveHeader;
- StreamInfo->CurrentBuffer = WaveHeader;
-
- /* Initialise the stream state */
- //StreamInfo->BufferOffset = 0;
- //StreamInfo->BytesOutstanding = 0;
- StreamInfo->BuffersOutstanding = 0;
-
- /* Get the streaming started */
- StreamWaveBuffers(SoundDeviceInstance);
- }
- else
- {
- TRACE_("This is not the first buffer being queued\n");
-
- /* Point the existing tail to the new buffer */
- StreamInfo->BufferQueueTail->lpNext = WaveHeader;
- /* ...and set the buffer as the new tail */
- StreamInfo->BufferQueueTail = WaveHeader;
-
- if ( ! StreamInfo->CurrentBuffer )
- {
- /* All buffers so far have been committed to the sound driver */
- StreamInfo->CurrentBuffer = WaveHeader;
- }
- }
-
- return MMSYSERR_NOERROR;
-}
-
-
-MMRESULT
-QueueWaveDeviceBuffer(
- IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance,
- IN PWAVEHDR BufferHeader)
-{
- if ( ! SoundDeviceInstance )
- return MMSYSERR_INVALPARAM;
-
- if ( ! BufferHeader )
- return MMSYSERR_INVALPARAM;
-
- if ( ! BufferHeader->lpData )
- return MMSYSERR_INVALPARAM;
-
- if ( ! BufferHeader->dwBufferLength )
- return MMSYSERR_INVALPARAM;
-
- if ( ! (BufferHeader->dwFlags & WHDR_PREPARED ) )
- return WAVERR_UNPREPARED;
-
- /* TODO: WHDR_INQUEUE */
-
- BufferHeader->dwFlags &= ~WHDR_DONE;
- BufferHeader->lpNext = NULL;
-
- return CallUsingSoundThread(SoundDeviceInstance,
- QueueBuffer_Request,
- BufferHeader);
-}
Copied: branches/silverblade-audio/lib/drivers/sound/mmebuddy/wave/widMessage.c (from
r34432, branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/widMessage.c)
URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/lib/drivers/s…
==============================================================================
--- branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/widMessage.c [iso-8859-1]
(original)
+++ branches/silverblade-audio/lib/drivers/sound/mmebuddy/wave/widMessage.c [iso-8859-1]
Sat Jul 12 16:44:10 2008
@@ -1,15 +1,12 @@
/*
- ReactOS Sound System
- MME Interface
-
- Purpose:
- Wave input device message handler
-
- Author:
- Andrew Greenwood (silverblade(a)reactos.org)
-
- History:
- 4 July 2008 - Created
+ * 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(a)reactos.org)
*/
#include <windows.h>
Copied: branches/silverblade-audio/lib/drivers/sound/mmebuddy/wave/wodMessage.c (from
r34432, branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/wodMessage.c)
URL:
http://svn.reactos.org/svn/reactos/branches/silverblade-audio/lib/drivers/s…
==============================================================================
--- branches/silverblade-audio/lib/drivers/sound/mmebuddy/mme/wodMessage.c [iso-8859-1]
(original)
+++ branches/silverblade-audio/lib/drivers/sound/mmebuddy/wave/wodMessage.c [iso-8859-1]
Sat Jul 12 16:44:10 2008
@@ -1,15 +1,12 @@
/*
- ReactOS Sound System
- MME Interface
-
- Purpose:
- Wave output device message handler
-
- Author:
- Andrew Greenwood (silverblade(a)reactos.org)
-
- History:
- 4 July 2008 - Created
+ * PROJECT: ReactOS Sound System "MME Buddy" Library
+ * LICENSE: GPL - See COPYING in the top level directory
+ * FILE: lib/sound/mmebuddy/wave/wodMessage.c
+ *
+ * PURPOSE: Provides the wodMessage exported function, as required by
+ * the MME API, for wave output device support.
+ *
+ * PROGRAMMERS: Andrew Greenwood (silverblade(a)reactos.org)
*/
#include <windows.h>