Author: silverblade
Date: Sun Feb 15 07:31:52 2009
New Revision: 39606
URL:
http://svn.reactos.org/svn/reactos?rev=39606&view=rev
Log:
Split custom ReactOS-only non-standard extensions from NTDDSND.H
Updated relevant code to include the new headers SNDTYPES.H and SNDNAMES.H
Corrected CTL_CODE macros and included SNDTYPES.H in WDMAUD interface header
A lot of this is just refactoring, hence the large number of files!
Added:
trunk/reactos/dll/win32/sndblst/
trunk/reactos/dll/win32/sndblst/sndblst.c (with props)
trunk/reactos/dll/win32/sndblst/sndblst.def (with props)
trunk/reactos/dll/win32/sndblst/sndblst.rbuild (with props)
trunk/reactos/include/reactos/libs/sound/sndnames.h (with props)
trunk/reactos/include/reactos/libs/sound/sndtypes.h (with props)
Modified:
trunk/reactos/dll/win32/win32.rbuild
trunk/reactos/drivers/wdm/audio/legacy/wdmaud/interface.h
trunk/reactos/drivers/wdm/audio/legacy/wdmaud/wdmaud.rbuild
trunk/reactos/include/ddk/ntddsnd.h
trunk/reactos/lib/drivers/directory.rbuild
trunk/reactos/lib/drivers/sound/legacy/devname.c
trunk/reactos/lib/drivers/sound/mmebuddy/auxiliary/auxMessage.c
trunk/reactos/lib/drivers/sound/mmebuddy/capabilities.c
trunk/reactos/lib/drivers/sound/mmebuddy/devicelist.c
trunk/reactos/lib/drivers/sound/mmebuddy/midi/midMessage.c
trunk/reactos/lib/drivers/sound/mmebuddy/midi/modMessage.c
trunk/reactos/lib/drivers/sound/mmebuddy/mixer/mxdMessage.c
trunk/reactos/lib/drivers/sound/mmebuddy/mmewrap.c
trunk/reactos/lib/drivers/sound/mmebuddy/reentrancy.c
trunk/reactos/lib/drivers/sound/mmebuddy/wave/format.c
trunk/reactos/lib/drivers/sound/mmebuddy/wave/widMessage.c
trunk/reactos/lib/drivers/sound/mmebuddy/wave/wodMessage.c
trunk/reactos/lib/drivers/sound/mment4/control.c
trunk/reactos/lib/drivers/sound/mment4/detect.c
trunk/reactos/lib/drivers/sound/mment4/registry.c
Added: trunk/reactos/dll/win32/sndblst/sndblst.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/sndblst/sndblst.…
==============================================================================
--- trunk/reactos/dll/win32/sndblst/sndblst.c (added)
+++ trunk/reactos/dll/win32/sndblst/sndblst.c [iso-8859-1] Sun Feb 15 07:31:52 2009
@@ -1,0 +1,226 @@
+/*
+ * PROJECT: ReactOS Sound System
+ * LICENSE: GPL - See COPYING in the top level directory
+ * FILE: dll/win32/sndblst/sndblst.c
+ *
+ * PURPOSE: Sound Blaster MME User-Mode Driver
+ *
+ * PROGRAMMERS: Andrew Greenwood (silverblade(a)reactos.org)
+ *
+ * NOTES: Currently very experimental and being used as a guinea-pig for
+ * changes to the MME-Buddy libraries.
+ * TODO: Adhere to maximum device name length!
+*/
+
+#include <windows.h>
+#include <ntddsnd.h>
+#include <reactos/sndtypes.h>
+#include <mmddk.h>
+#include <mmebuddy.h>
+#include <mment4.h>
+//#include <debug.h>
+
+PWSTR SBWaveOutDeviceName = L"ROS Sound Blaster Out";
+PWSTR SBWaveInDeviceName = L"ROS Sound Blaster In";
+/* TODO: Mixer etc */
+
+MMRESULT
+GetSoundBlasterDeviceCapabilities(
+ IN PSOUND_DEVICE SoundDevice,
+ OUT PVOID Capabilities,
+ IN DWORD CapabilitiesSize)
+{
+ MMRESULT Result;
+ MMDEVICE_TYPE DeviceType;
+
+ SND_ASSERT( SoundDevice );
+ SND_ASSERT( Capabilities );
+
+ SND_TRACE(L"Sndblst - GetSoundBlasterDeviceCapabilities\n");
+
+ Result = GetSoundDeviceType(SoundDevice, &DeviceType);
+ SND_ASSERT( Result == MMSYSERR_NOERROR );
+
+ /* Use the default method of obtaining device capabilities */
+ Result = GetNt4SoundDeviceCapabilities(SoundDevice,
+ Capabilities,
+ CapabilitiesSize);
+
+ if ( ! MMSUCCESS(Result) )
+ return Result;
+
+ /* Inject the appropriate device name */
+ switch ( DeviceType )
+ {
+ case WAVE_OUT_DEVICE_TYPE :
+ {
+ LPWAVEOUTCAPS WaveOutCaps = (LPWAVEOUTCAPS) Capabilities;
+ CopyWideString(WaveOutCaps->szPname, SBWaveOutDeviceName);
+ break;
+ }
+ case WAVE_IN_DEVICE_TYPE :
+ {
+ LPWAVEINCAPS WaveInCaps = (LPWAVEINCAPS) Capabilities;
+ CopyWideString(WaveInCaps->szPname, SBWaveInDeviceName);
+ break;
+ }
+ }
+
+ return MMSYSERR_NOERROR;
+}
+
+BOOLEAN FoundDevice(
+ UCHAR DeviceType,
+ PWSTR DevicePath)
+{
+ MMRESULT Result;
+ PSOUND_DEVICE SoundDevice = NULL;
+ MMFUNCTION_TABLE FuncTable;
+ PWSTR PathCopy;
+
+ SND_TRACE(L"(Callback) Found device: %wS\n", DevicePath);
+
+ PathCopy = AllocateWideString(wcslen(DevicePath));
+
+ if ( ! PathCopy )
+ return FALSE;
+
+ CopyWideString(PathCopy, DevicePath);
+
+ Result = ListSoundDevice(DeviceType, (PVOID) PathCopy, &SoundDevice);
+
+ if ( ! MMSUCCESS(Result) )
+ return FALSE;
+
+ /* Set up our function table */
+ FuncTable.GetCapabilities = GetSoundBlasterDeviceCapabilities;
+ FuncTable.QueryWaveFormatSupport = QueryNt4WaveDeviceFormatSupport;
+ FuncTable.SetWaveFormat = SetNt4WaveDeviceFormat;
+ FuncTable.Open = OpenNt4SoundDevice;
+ FuncTable.Close = CloseNt4SoundDevice;
+ FuncTable.PrepareWaveHeader = NULL;
+ FuncTable.UnprepareWaveHeader = NULL;
+ FuncTable.SubmitWaveHeader = NULL;
+
+ SetSoundDeviceFunctionTable(SoundDevice, &FuncTable);
+
+ return TRUE;
+}
+
+APIENTRY LONG
+DriverProc(
+ DWORD DriverId,
+ HANDLE DriverHandle,
+ UINT Message,
+ LONG Parameter1,
+ LONG Parameter2)
+{
+ MMRESULT Result;
+
+ switch ( Message )
+ {
+ case DRV_LOAD :
+ {
+ SND_TRACE(L"DRV_LOAD\n");
+
+ Result = InitEntrypointMutexes();
+
+ if ( ! MMSUCCESS(Result) )
+ return 0L;
+
+ Result = EnumerateNt4ServiceSoundDevices(L"sndblst",
+ 0,
+ FoundDevice);
+
+ if ( ! MMSUCCESS(Result) )
+ {
+ CleanupEntrypointMutexes();
+
+ UnlistAllSoundDevices();
+
+ return 0L;
+ }
+
+/*
+ PSOUND_DEVICE snd;
+ GetSoundDevice(WAVE_OUT_DEVICE_TYPE, 0, &snd);
+ GetSoundDevice(AUX_DEVICE_TYPE, 0, &snd);
+ GetSoundDevice(AUX_DEVICE_TYPE, 1, &snd);
+ GetSoundDevice(AUX_DEVICE_TYPE, 2, &snd);
+*/
+
+ SND_TRACE(L"Initialisation complete\n");
+
+ return 1L;
+ }
+
+ case DRV_FREE :
+ {
+ SND_TRACE(L"DRV_FREE\n");
+
+ /* TODO: Clean up the path names! */
+ UnlistAllSoundDevices();
+
+ CleanupEntrypointMutexes();
+
+ SND_TRACE(L"Unfreed memory blocks: %d\n",
+ GetMemoryAllocationCount());
+
+ return 1L;
+ }
+
+ case DRV_ENABLE :
+ case DRV_DISABLE :
+ {
+ SND_TRACE(L"DRV_ENABLE / DRV_DISABLE\n");
+ return 1L;
+ }
+
+ case DRV_OPEN :
+ case DRV_CLOSE :
+ {
+ SND_TRACE(L"DRV_OPEN / DRV_CLOSE\n");
+ return 1L;
+ }
+
+ case DRV_QUERYCONFIGURE :
+ {
+ SND_TRACE(L"DRV_QUERYCONFIGURE");
+ return 0L;
+ }
+ case DRV_CONFIGURE :
+ return DRVCNF_OK;
+
+ default :
+ SND_TRACE(L"Unhandled message %d\n", Message);
+ return DefDriverProc(DriverId,
+ DriverHandle,
+ Message,
+ Parameter1,
+ Parameter2);
+ }
+}
+
+BOOL WINAPI DllMain(
+ HINSTANCE hinstDLL,
+ DWORD fdwReason,
+ LPVOID lpvReserved)
+{
+ switch ( fdwReason )
+ {
+ case DLL_PROCESS_ATTACH :
+ SND_TRACE(L"DLL_PROCESS_ATTACH\n");
+ break;
+ case DLL_PROCESS_DETACH :
+ SND_TRACE(L"DLL_PROCESS_DETACH\n");
+ break;
+ case DLL_THREAD_ATTACH :
+ SND_TRACE(L"DLL_THREAD_ATTACH\n");
+ break;
+ case DLL_THREAD_DETACH :
+ SND_TRACE(L"DLL_THREAD_DETACH\n");
+ break;
+ }
+
+ return TRUE;
+}
Propchange: trunk/reactos/dll/win32/sndblst/sndblst.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/dll/win32/sndblst/sndblst.def
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/sndblst/sndblst.…
==============================================================================
--- trunk/reactos/dll/win32/sndblst/sndblst.def (added)
+++ trunk/reactos/dll/win32/sndblst/sndblst.def [iso-8859-1] Sun Feb 15 07:31:52 2009
@@ -1,0 +1,15 @@
+; $Id: sndblst.def 34299 2008-07-05 02:43:17Z silverblade $
+;
+; sndblst.def
+;
+; ReactOS Operating System
+;
+LIBRARY sndblst.dll
+EXPORTS
+DriverProc@20
+widMessage@20
+wodMessage@20
+midMessage@20
+modMessage@20
+mxdMessage@20
+auxMessage@20
Propchange: trunk/reactos/dll/win32/sndblst/sndblst.def
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/dll/win32/sndblst/sndblst.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/sndblst/sndblst.…
==============================================================================
--- trunk/reactos/dll/win32/sndblst/sndblst.rbuild (added)
+++ trunk/reactos/dll/win32/sndblst/sndblst.rbuild [iso-8859-1] Sun Feb 15 07:31:52 2009
@@ -1,0 +1,16 @@
+<!-- Temporarily compiling as a CUI app for testing purposes */
+<!--module name="mmdrv" type="win32dll"
baseaddress="${BASEADDRESS_MMDRV}" installbase="system32"
installname="mmdrv.dll" unicode="yes"-->
+<module name="sndblst" type="win32dll"
installbase="system32" installname="sndblst.dll"
unicode="yes">
+ <importlibrary definition="sndblst.def" />
+ <include base="ReactOS">include/reactos/libs/sound</include>
+ <include base="sndblst">.</include>
+ <define name="DEBUG_NT4" />
+ <library>mment4</library>
+ <library>mmebuddy</library>
+ <library>ntdll</library>
+ <library>kernel32</library>
+ <library>user32</library>
+ <library>winmm</library>
+ <library>advapi32</library>
+ <file>sndblst.c</file>
+</module>
Propchange: trunk/reactos/dll/win32/sndblst/sndblst.rbuild
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/reactos/dll/win32/win32.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/win32.rbuild?rev…
==============================================================================
--- trunk/reactos/dll/win32/win32.rbuild [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/win32.rbuild [iso-8859-1] Sun Feb 15 07:31:52 2009
@@ -394,6 +394,9 @@
<directory name="smdll">
<xi:include href="smdll/smdll.rbuild" />
</directory>
+<directory name="sndblst">
+ <xi:include href="sndblst/sndblst.rbuild" />
+</directory>
<directory name="snmpapi">
<xi:include href="snmpapi/snmpapi.rbuild" />
</directory>
Modified: trunk/reactos/drivers/wdm/audio/legacy/wdmaud/interface.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/legacy/w…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/legacy/wdmaud/interface.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/wdm/audio/legacy/wdmaud/interface.h [iso-8859-1] Sun Feb 15
07:31:52 2009
@@ -6,7 +6,8 @@
///
/// History: 12/02/2008 Created
-
+// These are now in sndtypes.h
+/*
typedef enum
{
DEVICE_TYPE_NONE = 0,
@@ -18,10 +19,13 @@
DEVICE_TYPE_AUX_OUT
}AUDIO_DEVICE_TYPE;
+*/
+
+#include <sndtypes.h>
typedef struct
{
- AUDIO_DEVICE_TYPE DeviceType;
+ SOUND_DEVICE_TYPE DeviceType;
ULONG DeviceIndex;
HANDLE hDevice;
@@ -55,7 +59,11 @@
/// Return Code: STATUS_SUCCESS indicates success, otherwise appropiate error code
/// Prequsites: none
-#define IOCTL_OPEN_WDMAUD CTL_CODE(FILE_DEVICE_SOUND,
FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS, 0, METHOD_BUFFERED);
+#define IOCTL_OPEN_WDMAUD \
+ CTL_CODE(FILE_DEVICE_SOUND, \
+ 0, \
+ METHOD_BUFFERED, \
+ FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS);
/// IOCTL_CLOSE_WDMAUD
@@ -68,7 +76,11 @@
/// ReturnCode: STATUS_SUCCESS indicates success
/// Prequsites: openend device
-#define IOCTL_CLOSE_WDMAUD CTL_CODE(FILE_DEVICE_SOUND,
FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS, 1, METHOD_BUFFERED);
+#define IOCTL_CLOSE_WDMAUD \
+ CTL_CODE(FILE_DEVICE_SOUND, \
+ 1, \
+ METHOD_BUFFERED, \
+ FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS); \
/// IOCTL_GETNUMDEVS_TYPE
@@ -82,8 +94,11 @@
/// ReturnCode: STATUS_SUCCESS indicates success
/// Prequsites: none
-#define IOCTL_GETNUMDEVS_TYPE CTL_CODE(FILE_DEVICE_SOUND,
FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS, 2, METHOD_BUFFERED);
-
+#define IOCTL_GETNUMDEVS_TYPE \
+ CTL_CODE(FILE_DEVICE_SOUND, \
+ 2, \
+ METHOD_BUFFERED, \
+ FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS);
/// IOCTL_SETDEVICE_STATE
@@ -96,7 +111,11 @@
/// ReturnCode: STATUS_SUCCESS indicates success
/// Prequsites: opened device
-#define IOCTL_SETDEVICE_STATE CTL_CODE(FILE_DEVICE_SOUND,
FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS, 3, METHOD_BUFFERED);
+#define IOCTL_SETDEVICE_STATE \
+ CTL_CODE(FILE_DEVICE_SOUND, \
+ 3, \
+ METHOD_BUFFERED, \
+ FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS);
/// IOCTL_GETDEVID
@@ -110,9 +129,11 @@
/// ReturnCode: STATUS_SUCCESS indicates success
/// Prequsites: opened device
-
-#define IOCTL_GETDEVID CTL_CODE(FILE_DEVICE_SOUND,
FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS, 4, METHOD_BUFFERED);
-
+#define IOCTL_GETDEVID \
+ CTL_CODE(FILE_DEVICE_SOUND, \
+ 4, \
+ METHOD_BUFFERED, \
+ FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS);
/// IOCTL_GETVOLUME
@@ -126,8 +147,11 @@
/// ReturnCode: STATUS_SUCCESS indicates success
/// Prequsites: opened device
-
-#define IOCTL_GETVOLUME CTL_CODE(FILE_DEVICE_SOUND,
FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS, 5, METHOD_BUFFERED);
+#define IOCTL_GETVOLUME \
+ CTL_CODE(FILE_DEVICE_SOUND, \
+ 5, \
+ METHOD_BUFFEERED, \
+ FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS);
/// IOCTL_SETVOLUME
@@ -140,8 +164,11 @@
/// ReturnCode: STATUS_SUCCESS indicates success
/// Prequsites: opened device
-
-#define IOCTL_SETVOLUME CTL_CODE(FILE_DEVICE_SOUND,
FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS, 6, METHOD_BUFFERED);
+#define IOCTL_SETVOLUME \
+ CTL_CODE(FILE_DEVICE_SOUND, \
+ 6, \
+ METHOD_BUFFERED, \
+ FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS);
/// IOCTL_GETCAPABILTIES
@@ -154,8 +181,11 @@
/// ReturnCode: STATUS_SUCCESS indicates success
/// Prequsites: none
-
-#define IOCTL_GETCAPABILTIES CTL_CODE(FILE_DEVICE_SOUND,
FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS, 7, METHOD_BUFFERED);
+#define IOCTL_GETCAPABILITIES \
+ CTL_CODE(FILE_DEVICE_SOUND, \
+ 7, \
+ METHOD_BUFFERED, \
+ FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS);
/// IOCTL_WRITEDATA
@@ -168,11 +198,11 @@
/// ReturnCode: STATUS_SUCCESS indicates success
/// Prequsites: opened device
-
-#define IOCTL_WRITEDATA CTL_CODE(FILE_DEVICE_SOUND,
FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS, 8, METHOD_BUFFERED);
-
-
-
+#define IOCTL_WRITEDATA \
+ CTL_CODE(FILE_DEVICE_SOUND, \
+ 8, \
+ METHOD_BUFFERED, \
+ FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS);
#endif
Modified: trunk/reactos/drivers/wdm/audio/legacy/wdmaud/wdmaud.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/legacy/w…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/legacy/wdmaud/wdmaud.rbuild [iso-8859-1] (original)
+++ trunk/reactos/drivers/wdm/audio/legacy/wdmaud/wdmaud.rbuild [iso-8859-1] Sun Feb 15
07:31:52 2009
@@ -2,6 +2,7 @@
<!DOCTYPE module SYSTEM "../../../../../tools/rbuild/project.dtd">
<module name="wdmaud_kernel" type="kernelmodedriver"
installbase="system32/drivers" installname="wdmaud.sys">
<include base="wdmaud_kernel">.</include>
+ <include base="ReactOS">include/reactos/libs/sound</include>
<library>ntoskrnl</library>
<library>ks</library>
<file>entry.c</file>
Modified: trunk/reactos/include/ddk/ntddsnd.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/ntddsnd.h?rev=…
==============================================================================
--- trunk/reactos/include/ddk/ntddsnd.h [iso-8859-1] (original)
+++ trunk/reactos/include/ddk/ntddsnd.h [iso-8859-1] Sun Feb 15 07:31:52 2009
@@ -9,6 +9,7 @@
24 May 2008 - Created
2 July 2008 - Added device names as seen from user-mode
5 July 2008 - Added macros for checking device type
+ 14 Feb 2009 - Added base control codes for nonstandard extensions
This file contains definitions and structures for Windows NT4 style
multimedia drivers. The NT4 DDK has these split across multiple header
@@ -23,108 +24,11 @@
type IDs).
*/
-#ifndef NTDDWAVE
-#define NTDDWAVE
+#ifndef NTDDSND_H
+#define NTDDSND_H
#define SOUND_MAX_DEVICES 100
-
-
-/*
- Device types
-
- Not part of the original DDK header, but based on the values stored in
- registry by sndblst
-*/
-
-#define WAVE_IN_DEVICE_TYPE 1
-#define WAVE_OUT_DEVICE_TYPE 2
-#define MIDI_IN_DEVICE_TYPE 3
-#define MIDI_OUT_DEVICE_TYPE 4
-#define AUX_DEVICE_TYPE 5
-#define MIXER_DEVICE_TYPE 6
-
-#define MIN_SOUND_DEVICE_TYPE WAVE_IN_DEVICE_TYPE
-#define MAX_SOUND_DEVICE_TYPE MIXER_DEVICE_TYPE
-#define SOUND_DEVICE_TYPES 6
-
-#define IS_VALID_SOUND_DEVICE_TYPE(x) \
- ( ( x >= MIN_SOUND_DEVICE_TYPE ) && ( x <= MAX_SOUND_DEVICE_TYPE ) )
-
-#define IS_WAVE_DEVICE_TYPE(x) \
- ( ( x == WAVE_IN_DEVICE_TYPE ) || ( x == WAVE_OUT_DEVICE_TYPE ) )
-
-#define IS_MIDI_DEVICE_TYPE(x) \
- ( ( x == MIDI_IN_DEVICE_TYPE ) || ( x == MIDI_OUT_DEVICE_TYPE ) )
-
-#define IS_AUX_DEVICE_TYPE(x) \
- ( x == AUX_DEVICE_TYPE )
-
-#define IS_MIXER_DEVICE_TYPE(x) \
- ( x == MIXER_DEVICE_TYPE )
-
-
-/*
- Base device names
-
- Each device name should be given a numerical suffix identifying that
- unique device, eg:
-
- \Device\WaveOut0 - First wave output device
- \Device\WaveOut1 - Second wave output device
-*/
-
-#define SOUND_MAX_DEVICE_NAME 80
-
-#define DD_WAVE_IN_DEVICE_NAME "\\Device\\WaveIn"
-#define DD_WAVE_IN_DEVICE_NAME_U L"\\Device\\WaveIn"
-#define DD_WAVE_IN_DOS_DEVICE_NAME "\\DosDevices\\WaveIn"
-#define DD_WAVE_IN_DOS_DEVICE_NAME_U L"\\DosDevices\\WaveIn"
-#define DD_WAVE_IN_WIN32_DEVICE_NAME "\\\\.\\WaveIn"
-#define DD_WAVE_IN_WIN32_DEVICE_NAME_U L"\\\\.\\WaveIn"
-
-#define DD_WAVE_OUT_DEVICE_NAME "\\Device\\WaveOut"
-#define DD_WAVE_OUT_DEVICE_NAME_U L"\\Device\\WaveOut"
-#define DD_WAVE_OUT_DOS_DEVICE_NAME "\\DosDevices\\WaveOut"
-#define DD_WAVE_OUT_DOS_DEVICE_NAME_U L"\\DosDevices\\WaveOut"
-#define DD_WAVE_OUT_WIN32_DEVICE_NAME "\\\\.\\WaveOut"
-#define DD_WAVE_OUT_WIN32_DEVICE_NAME_U L"\\\\.\\WaveOut"
-
-#define DD_MIDI_IN_DEVICE_NAME "\\Device\\MidiIn"
-#define DD_MIDI_IN_DEVICE_NAME_U L"\\Device\\MidiIn"
-#define DD_MIDI_IN_DOS_DEVICE_NAME "\\DosDevices\\MidiIn"
-#define DD_MIDI_IN_DOS_DEVICE_NAME_U L"\\DosDevices\\MidiIn"
-#define DD_MIDI_IN_WIN32_DEVICE_NAME "\\\\.\\MidiIn"
-#define DD_MIDI_IN_WIN32_DEVICE_NAME_U L"\\\\.\\MidiIn"
-
-#define DD_MIDI_OUT_DEVICE_NAME "\\Device\\MidiOut"
-#define DD_MIDI_OUT_DEVICE_NAME_U L"\\Device\\MidiOut"
-#define DD_MIDI_OUT_DOS_DEVICE_NAME "\\DosDevices\\MidiOut"
-#define DD_MIDI_OUT_DOS_DEVICE_NAME_U L"\\DosDevices\\MidiOut"
-#define DD_MIDI_OUT_WIN32_DEVICE_NAME "\\\\.\\MidiOut"
-#define DD_MIDI_OUT_WIN32_DEVICE_NAME_U L"\\\\.\\MidiOut"
-
-#define DD_MIX_DEVICE_NAME "\\Device\\MMMix"
-#define DD_MIX_DEVICE_NAME_U L"\\Device\\MMMix"
-#define DD_MIX_DOS_DEVICE_NAME "\\DosDevices\\MMMix"
-#define DD_MIX_DOS_DEVICE_NAME_U L"\\DosDevices\\MMMix"
-#define DD_MIX_WIN32_DEVICE_NAME "\\\\.\\MMMix"
-#define DD_MIX_WIN32_DEVICE_NAME_U L"\\\\.\\MMMix"
-
-#define DD_AUX_DEVICE_NAME "\\Device\\MMAux"
-#define DD_AUX_DEVICE_NAME_U L"\\Device\\MMAux"
-#define DD_AUX_DOS_DEVICE_NAME "\\DosDevices\\MMAux"
-#define DD_AUX_DOS_DEVICE_NAME_U L"\\DosDevices\\MMAux"
-#define DD_AUX_WIN32_DEVICE_NAME "\\\\.\\MMAux"
-#define DD_AUX_WIN32_DEVICE_NAME_U L"\\\\.\\MMAux"
-
-/*
- Registry keys
-*/
-
-#define REG_SERVICES_KEY_NAME_U
L"System\\CurrentControlSet\\Services"
-#define REG_PARAMETERS_KEY_NAME_U L"Parameters"
-#define REG_DEVICE_KEY_NAME_U L"Device"
-#define REG_DEVICES_KEY_NAME_U L"Devices"
+#define SOUND_MAX_DEVICE_NAME 80
/*
Added: trunk/reactos/include/reactos/libs/sound/sndnames.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/libs/sound…
==============================================================================
--- trunk/reactos/include/reactos/libs/sound/sndnames.h (added)
+++ trunk/reactos/include/reactos/libs/sound/sndnames.h [iso-8859-1] Sun Feb 15 07:31:52
2009
@@ -1,0 +1,80 @@
+/*
+ ReactOS Sound System
+ NT4 audio device and registry key names
+
+ Author:
+ Andrew Greenwood (silverblade(a)reactos.org)
+
+ History:
+ 14 Feb 2009 - Split from ntddsnd.h
+
+ These were enhancements to the original NT4 DDK audio device header
+ files.
+*/
+
+#ifndef SNDNAMES_H
+#define SNDNAMES_H
+
+/*
+ Base device names (NT4)
+
+ Each device name should be given a numerical suffix identifying that
+ unique device, eg:
+
+ \Device\WaveOut0 - First wave output device
+ \Device\WaveOut1 - Second wave output device
+*/
+
+#define DD_WAVE_IN_DEVICE_NAME "\\Device\\WaveIn"
+#define DD_WAVE_IN_DEVICE_NAME_U L"\\Device\\WaveIn"
+#define DD_WAVE_IN_DOS_DEVICE_NAME "\\DosDevices\\WaveIn"
+#define DD_WAVE_IN_DOS_DEVICE_NAME_U L"\\DosDevices\\WaveIn"
+#define DD_WAVE_IN_WIN32_DEVICE_NAME "\\\\.\\WaveIn"
+#define DD_WAVE_IN_WIN32_DEVICE_NAME_U L"\\\\.\\WaveIn"
+
+#define DD_WAVE_OUT_DEVICE_NAME "\\Device\\WaveOut"
+#define DD_WAVE_OUT_DEVICE_NAME_U L"\\Device\\WaveOut"
+#define DD_WAVE_OUT_DOS_DEVICE_NAME "\\DosDevices\\WaveOut"
+#define DD_WAVE_OUT_DOS_DEVICE_NAME_U L"\\DosDevices\\WaveOut"
+#define DD_WAVE_OUT_WIN32_DEVICE_NAME "\\\\.\\WaveOut"
+#define DD_WAVE_OUT_WIN32_DEVICE_NAME_U L"\\\\.\\WaveOut"
+
+#define DD_MIDI_IN_DEVICE_NAME "\\Device\\MidiIn"
+#define DD_MIDI_IN_DEVICE_NAME_U L"\\Device\\MidiIn"
+#define DD_MIDI_IN_DOS_DEVICE_NAME "\\DosDevices\\MidiIn"
+#define DD_MIDI_IN_DOS_DEVICE_NAME_U L"\\DosDevices\\MidiIn"
+#define DD_MIDI_IN_WIN32_DEVICE_NAME "\\\\.\\MidiIn"
+#define DD_MIDI_IN_WIN32_DEVICE_NAME_U L"\\\\.\\MidiIn"
+
+#define DD_MIDI_OUT_DEVICE_NAME "\\Device\\MidiOut"
+#define DD_MIDI_OUT_DEVICE_NAME_U L"\\Device\\MidiOut"
+#define DD_MIDI_OUT_DOS_DEVICE_NAME "\\DosDevices\\MidiOut"
+#define DD_MIDI_OUT_DOS_DEVICE_NAME_U L"\\DosDevices\\MidiOut"
+#define DD_MIDI_OUT_WIN32_DEVICE_NAME "\\\\.\\MidiOut"
+#define DD_MIDI_OUT_WIN32_DEVICE_NAME_U L"\\\\.\\MidiOut"
+
+#define DD_MIX_DEVICE_NAME "\\Device\\MMMix"
+#define DD_MIX_DEVICE_NAME_U L"\\Device\\MMMix"
+#define DD_MIX_DOS_DEVICE_NAME "\\DosDevices\\MMMix"
+#define DD_MIX_DOS_DEVICE_NAME_U L"\\DosDevices\\MMMix"
+#define DD_MIX_WIN32_DEVICE_NAME "\\\\.\\MMMix"
+#define DD_MIX_WIN32_DEVICE_NAME_U L"\\\\.\\MMMix"
+
+#define DD_AUX_DEVICE_NAME "\\Device\\MMAux"
+#define DD_AUX_DEVICE_NAME_U L"\\Device\\MMAux"
+#define DD_AUX_DOS_DEVICE_NAME "\\DosDevices\\MMAux"
+#define DD_AUX_DOS_DEVICE_NAME_U L"\\DosDevices\\MMAux"
+#define DD_AUX_WIN32_DEVICE_NAME "\\\\.\\MMAux"
+#define DD_AUX_WIN32_DEVICE_NAME_U L"\\\\.\\MMAux"
+
+
+/*
+ Registry keys (NT4)
+*/
+
+#define REG_SERVICES_KEY_NAME_U
L"System\\CurrentControlSet\\Services"
+#define REG_PARAMETERS_KEY_NAME_U L"Parameters"
+#define REG_DEVICE_KEY_NAME_U L"Device"
+#define REG_DEVICES_KEY_NAME_U L"Devices"
+
+#endif
Propchange: trunk/reactos/include/reactos/libs/sound/sndnames.h
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/include/reactos/libs/sound/sndtypes.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/libs/sound…
==============================================================================
--- trunk/reactos/include/reactos/libs/sound/sndtypes.h (added)
+++ trunk/reactos/include/reactos/libs/sound/sndtypes.h [iso-8859-1] Sun Feb 15 07:31:52
2009
@@ -1,0 +1,59 @@
+/*
+ ReactOS Sound System
+ Device type IDs and macros
+
+ Author:
+ Andrew Greenwood (silverblade(a)reactos.org)
+
+ History:
+ 14 Feb 2009 - Split from ntddsnd.h
+
+ These are enhancements to the original NT4 DDK audio device header
+ files.
+*/
+
+#ifndef SNDTYPES_H
+#define SNDTYPES_H
+
+/*
+ Device types
+
+ Based on the values stored into the registry by the NT4 sndblst
+ driver.
+*/
+
+typedef enum
+{
+ // The sound device types
+ WAVE_IN_DEVICE_TYPE = 1,
+ WAVE_OUT_DEVICE_TYPE = 2,
+ MIDI_IN_DEVICE_TYPE = 3,
+ MIDI_OUT_DEVICE_TYPE = 4,
+ AUX_DEVICE_TYPE = 5,
+ MIXER_DEVICE_TYPE = 6,
+
+ // Range of valid device type IDs
+ MIN_SOUND_DEVICE_TYPE = 1,
+ MAX_SOUND_DEVICE_TYPE = 6,
+
+ // Number of sound device types
+ SOUND_DEVICE_TYPES = 6
+} SOUND_DEVICE_TYPE;
+
+#define IS_VALID_SOUND_DEVICE_TYPE(x) \
+ ( ( x >= MIN_SOUND_DEVICE_TYPE ) && ( x <= MAX_SOUND_DEVICE_TYPE ) )
+
+#define IS_WAVE_DEVICE_TYPE(x) \
+ ( ( x == WAVE_IN_DEVICE_TYPE ) || ( x == WAVE_OUT_DEVICE_TYPE ) )
+
+#define IS_MIDI_DEVICE_TYPE(x) \
+ ( ( x == MIDI_IN_DEVICE_TYPE ) || ( x == MIDI_OUT_DEVICE_TYPE ) )
+
+#define IS_AUX_DEVICE_TYPE(x) \
+ ( x == AUX_DEVICE_TYPE )
+
+#define IS_MIXER_DEVICE_TYPE(x) \
+ ( x == MIXER_DEVICE_TYPE )
+
+
+#endif
Propchange: trunk/reactos/include/reactos/libs/sound/sndtypes.h
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/reactos/lib/drivers/directory.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/directory.rbui…
==============================================================================
--- trunk/reactos/lib/drivers/directory.rbuild [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/directory.rbuild [iso-8859-1] Sun Feb 15 07:31:52 2009
@@ -13,4 +13,7 @@
<directory name="chew">
<xi:include href="chew/chew.rbuild" />
</directory>
+ <directory name="sound">
+ <xi:include href="sound/sound.rbuild" />
+ </directory>
</group>
Modified: trunk/reactos/lib/drivers/sound/legacy/devname.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/legacy/d…
==============================================================================
--- trunk/reactos/lib/drivers/sound/legacy/devname.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/sound/legacy/devname.c [iso-8859-1] Sun Feb 15 07:31:52
2009
@@ -11,6 +11,7 @@
#include <ntddk.h>
#include <ntddsnd.h>
+#include <sndnames.h>
#include <debug.h>
Modified: trunk/reactos/lib/drivers/sound/mmebuddy/auxiliary/auxMessage.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/mmebuddy…
==============================================================================
--- trunk/reactos/lib/drivers/sound/mmebuddy/auxiliary/auxMessage.c [iso-8859-1]
(original)
+++ trunk/reactos/lib/drivers/sound/mmebuddy/auxiliary/auxMessage.c [iso-8859-1] Sun Feb
15 07:31:52 2009
@@ -14,6 +14,7 @@
#include <mmddk.h>
#include <ntddsnd.h>
+#include <sndtypes.h>
#include <mmebuddy.h>
Modified: trunk/reactos/lib/drivers/sound/mmebuddy/capabilities.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/mmebuddy…
==============================================================================
--- trunk/reactos/lib/drivers/sound/mmebuddy/capabilities.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/sound/mmebuddy/capabilities.c [iso-8859-1] Sun Feb 15
07:31:52 2009
@@ -12,6 +12,7 @@
#include <mmsystem.h>
#include <mmddk.h>
#include <ntddsnd.h>
+#include <sndtypes.h>
#include <mmebuddy.h>
/*
Modified: trunk/reactos/lib/drivers/sound/mmebuddy/devicelist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/mmebuddy…
==============================================================================
--- trunk/reactos/lib/drivers/sound/mmebuddy/devicelist.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/sound/mmebuddy/devicelist.c [iso-8859-1] Sun Feb 15 07:31:52
2009
@@ -12,6 +12,7 @@
#include <mmsystem.h>
#include <mmddk.h>
#include <ntddsnd.h>
+#include <sndtypes.h>
#include <mmebuddy.h>
ULONG SoundDeviceCounts[SOUND_DEVICE_TYPES];
Modified: trunk/reactos/lib/drivers/sound/mmebuddy/midi/midMessage.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/mmebuddy…
==============================================================================
--- trunk/reactos/lib/drivers/sound/mmebuddy/midi/midMessage.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/sound/mmebuddy/midi/midMessage.c [iso-8859-1] Sun Feb 15
07:31:52 2009
@@ -14,6 +14,7 @@
#include <mmddk.h>
#include <ntddsnd.h>
+#include <sndtypes.h>
#include <mmebuddy.h>
Modified: trunk/reactos/lib/drivers/sound/mmebuddy/midi/modMessage.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/mmebuddy…
==============================================================================
--- trunk/reactos/lib/drivers/sound/mmebuddy/midi/modMessage.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/sound/mmebuddy/midi/modMessage.c [iso-8859-1] Sun Feb 15
07:31:52 2009
@@ -14,6 +14,7 @@
#include <mmddk.h>
#include <ntddsnd.h>
+#include <sndtypes.h>
#include <mmebuddy.h>
Modified: trunk/reactos/lib/drivers/sound/mmebuddy/mixer/mxdMessage.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/mmebuddy…
==============================================================================
--- trunk/reactos/lib/drivers/sound/mmebuddy/mixer/mxdMessage.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/sound/mmebuddy/mixer/mxdMessage.c [iso-8859-1] Sun Feb 15
07:31:52 2009
@@ -14,6 +14,7 @@
#include <mmddk.h>
#include <ntddsnd.h>
+#include <sndtypes.h>
#include <mmebuddy.h>
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 Feb 15 07:31:52
2009
@@ -12,6 +12,7 @@
#include <mmsystem.h>
#include <mmddk.h>
#include <ntddsnd.h>
+#include <sndtypes.h>
#include <mmebuddy.h>
/*
Modified: trunk/reactos/lib/drivers/sound/mmebuddy/reentrancy.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/mmebuddy…
==============================================================================
--- trunk/reactos/lib/drivers/sound/mmebuddy/reentrancy.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/sound/mmebuddy/reentrancy.c [iso-8859-1] Sun Feb 15 07:31:52
2009
@@ -12,6 +12,7 @@
#include <mmsystem.h>
#include <mmddk.h>
#include <ntddsnd.h>
+#include <sndtypes.h>
#include <mmebuddy.h>
HANDLE EntrypointMutexes[SOUND_DEVICE_TYPES];
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 Feb 15
07:31:52 2009
@@ -12,6 +12,7 @@
#include <mmsystem.h>
#include <mmddk.h>
#include <ntddsnd.h>
+#include <sndtypes.h>
#include <mmebuddy.h>
MMRESULT
Modified: trunk/reactos/lib/drivers/sound/mmebuddy/wave/widMessage.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/mmebuddy…
==============================================================================
--- trunk/reactos/lib/drivers/sound/mmebuddy/wave/widMessage.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/sound/mmebuddy/wave/widMessage.c [iso-8859-1] Sun Feb 15
07:31:52 2009
@@ -14,6 +14,7 @@
#include <mmddk.h>
#include <ntddsnd.h>
+#include <sndtypes.h>
#include <mmebuddy.h>
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 Feb 15
07:31:52 2009
@@ -14,6 +14,7 @@
#include <mmddk.h>
#include <ntddsnd.h>
+#include <sndtypes.h>
#include <mmebuddy.h>
Modified: trunk/reactos/lib/drivers/sound/mment4/control.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/mment4/c…
==============================================================================
--- trunk/reactos/lib/drivers/sound/mment4/control.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/sound/mment4/control.c [iso-8859-1] Sun Feb 15 07:31:52
2009
@@ -12,6 +12,7 @@
#include <mmsystem.h>
#include <mmddk.h>
#include <ntddsnd.h>
+#include <reactos/sndtypes.h>
#include <mmebuddy.h>
#include <mment4.h>
Modified: trunk/reactos/lib/drivers/sound/mment4/detect.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/mment4/d…
==============================================================================
--- trunk/reactos/lib/drivers/sound/mment4/detect.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/sound/mment4/detect.c [iso-8859-1] Sun Feb 15 07:31:52 2009
@@ -15,6 +15,8 @@
#include <mmsystem.h>
#include <mmddk.h>
#include <ntddsnd.h>
+#include <reactos/sndnames.h>
+#include <reactos/sndtypes.h>
#include <mmebuddy.h>
#include <mment4.h>
Modified: trunk/reactos/lib/drivers/sound/mment4/registry.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/mment4/r…
==============================================================================
--- trunk/reactos/lib/drivers/sound/mment4/registry.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/sound/mment4/registry.c [iso-8859-1] Sun Feb 15 07:31:52
2009
@@ -12,6 +12,9 @@
#include <mmsystem.h>
#include <mmddk.h>
#include <ntddsnd.h>
+
+#include <reactos/sndnames.h>
+#include <reactos/sndtypes.h>
#include <mmebuddy.h>
#include <mment4.h>