Remove Router code and test

The router is mostly unuseable in its current state and is unneeded, for the
purposes of this project. A new one should be made from scratch if needed.
This commit is contained in:
Chris Robinson
2007-11-30 02:30:15 -08:00
parent 3bedb2b4e9
commit 87242c6ab3
9 changed files with 0 additions and 6014 deletions
-135
View File
@@ -1,135 +0,0 @@
/**
* OpenAL cross platform audio library
* Copyright (C) 1999-2000 by authors.
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
* Or go to http://www.gnu.org/copyleft/lgpl.html
*/
#include <windows.h>
#include "OpenAL32.h"
void CleanDeviceEnumeration();
void CleanDeviceList(ALDEVICE *pDeviceList);
//*****************************************************************************
// DllMain
//*****************************************************************************
//
BOOL APIENTRY DllMain(HANDLE module, DWORD reason, LPVOID reserved)
{
BOOL result = TRUE;
// Perform actions based on the reason for calling.
switch(reason)
{
case DLL_PROCESS_ATTACH:
// Create the context list lock so I can safely add/remove contexts.
result = alListCreate(&alContextList);
break;
case DLL_THREAD_ATTACH:
// Do thread-specific initialization.
break;
case DLL_THREAD_DETACH:
// Do thread-specific cleanup.
break;
case DLL_PROCESS_DETACH:
// Perform any necessary cleanup.
CleanDeviceEnumeration();
alListFree(alContextList);
alContextList = 0;
break;
}
return TRUE;
}
void CleanDeviceEnumeration()
{
if (pszDefaultDeviceSpecifier)
{
free(pszDefaultDeviceSpecifier);
pszDefaultDeviceSpecifier = NULL;
}
if (pszDeviceSpecifierList)
{
free(pszDeviceSpecifierList);
pszDeviceSpecifierList = NULL;
}
if (pszDefaultCaptureDeviceSpecifier)
{
free(pszDefaultCaptureDeviceSpecifier);
pszDefaultCaptureDeviceSpecifier = NULL;
}
if (pszCaptureDeviceSpecifierList)
{
free(pszCaptureDeviceSpecifierList);
pszCaptureDeviceSpecifierList = NULL;
}
if (pszDefaultAllDevicesSpecifier)
{
free(pszDefaultAllDevicesSpecifier);
pszDefaultAllDevicesSpecifier = NULL;
}
if (pszAllDevicesSpecifierList)
{
free(pszAllDevicesSpecifierList);
pszAllDevicesSpecifierList = NULL;
}
CleanDeviceList(g_pDeviceList);
g_pDeviceList = NULL;
CleanDeviceList(g_pCaptureDeviceList);
g_pCaptureDeviceList = NULL;
CleanDeviceList(g_pAllDevicesList);
g_pAllDevicesList = NULL;
}
void CleanDeviceList(ALDEVICE *pDeviceList)
{
ALDEVICE *pDevice, *pNextDevice;
pDevice = pDeviceList;
while (pDevice)
{
pNextDevice = pDevice->pNextDevice;
if (pDevice->pszHostDLLFilename)
free(pDevice->pszHostDLLFilename);
if (pDevice->pszDeviceName)
free(pDevice->pszDeviceName);
free(pDevice);
pDevice = pNextDevice;
}
}
-341
View File
@@ -1,341 +0,0 @@
/**
* OpenAL cross platform audio library
* Copyright (C) 1999-2000 by authors.
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
* Or go to http://www.gnu.org/copyleft/lgpl.html
*/
#ifndef _OPENAL32_H_
#define _OPENAL32_H_
#ifdef __cplusplus
extern "C" {
#endif
#define AL_BUILD_LIBRARY
#include "al\al.h"
// ALAPI
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_ENABLE)(ALenum capability);
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_DISABLE)(ALenum capability);
typedef ALAPI ALboolean (ALAPIENTRY *ALAPI_IS_ENABLED)(ALenum capability);
typedef ALAPI const ALchar* (ALAPIENTRY *ALAPI_GET_STRING)(ALenum param);
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_GET_BOOLEANV)(ALenum param, ALboolean* data);
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_GET_INTEGERV)(ALenum param, ALint* data);
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_GET_FLOATV)(ALenum param, ALfloat* data);
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_GET_DOUBLEV)(ALenum param, ALdouble* data);
typedef ALAPI ALboolean (ALAPIENTRY *ALAPI_GET_BOOLEAN)(ALenum param);
typedef ALAPI ALint (ALAPIENTRY *ALAPI_GET_INTEGER)(ALenum param);
typedef ALAPI ALfloat (ALAPIENTRY *ALAPI_GET_FLOAT)(ALenum param);
typedef ALAPI ALdouble (ALAPIENTRY *ALAPI_GET_DOUBLE)(ALenum param);
typedef ALAPI ALenum (ALAPIENTRY *ALAPI_GET_ERROR)(ALvoid);
typedef ALAPI ALboolean (ALAPIENTRY *ALAPI_IS_EXTENSION_PRESENT)(const ALchar* ename);
typedef ALAPI ALvoid* (ALAPIENTRY *ALAPI_GET_PROC_ADDRESS)(const ALchar* fname);
typedef ALAPI ALenum (ALAPIENTRY *ALAPI_GET_ENUM_VALUE)(const ALchar* ename);
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_LISTENERF)(ALenum param, ALfloat value);
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_LISTENER3F)(ALenum param, ALfloat v1, ALfloat v2, ALfloat v3);
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_LISTENERFV)(ALenum param, const ALfloat* values);
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_LISTENERI)(ALenum param, ALint value);
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_LISTENER3I)( ALenum param, ALint value1, ALint value2, ALint value3 );
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_LISTENERIV)( ALenum param, const ALint* values );
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_GET_LISTENERF)(ALenum param, ALfloat* value);
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_GET_LISTENER3F)(ALenum param, ALfloat* v1, ALfloat* v2, ALfloat* v3);
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_GET_LISTENERFV)(ALenum param, ALfloat* values);
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_GET_LISTENERI)(ALenum param, ALint* value);
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_GET_LISTENER3I)( ALenum param, ALint *value1, ALint *value2, ALint *value3 );
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_GET_LISTENERIV)( ALenum param, ALint* values );
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_GEN_SOURCES)(ALsizei n, ALuint* sourceNames);
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_DELETE_SOURCES)(ALsizei n, const ALuint* sourceNames);
typedef ALAPI ALboolean (ALAPIENTRY *ALAPI_IS_SOURCE)(ALuint id);
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_SOURCEF)(ALuint sourceName, ALenum param, ALfloat value);
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_SOURCE3F)(ALuint sourceName, ALenum param, ALfloat v1, ALfloat v2, ALfloat v3);
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_SOURCEFV)(ALuint sourceName, ALenum param, const ALfloat* values);
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_SOURCEI)(ALuint sourceName, ALenum param, ALint value);
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_SOURCE3I)( ALuint sid, ALenum param, ALint value1, ALint value2, ALint value3 );
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_SOURCEIV)( ALuint sid, ALenum param, const ALint* values );
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_GET_SOURCEF)(ALuint sourceName, ALenum param, ALfloat* value);
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_GET_SOURCE3F)(ALuint sourceName, ALenum param, ALfloat* v1, ALfloat* v2, ALfloat* v3);
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_GET_SOURCEFV)(ALuint sourceName, ALenum param, const ALfloat* values);
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_GET_SOURCEI)(ALuint sourceName, ALenum param, ALint* value);
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_GET_SOURCE3I)( ALuint sid, ALenum param, ALint* value1, ALint* value2, ALint* value3);
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_GET_SOURCEIV)( ALuint sid, ALenum param, ALint* values );
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_SOURCE_PLAYV)(ALsizei n, const ALuint* sources);
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_SOURCE_STOPV)(ALsizei n, const ALuint* sources);
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_SOURCE_REWINDV)(ALsizei n, const ALuint* sources);
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_SOURCE_PAUSEV)(ALsizei n, const ALuint* sources);
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_SOURCE_PLAY)(ALuint sourceName);
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_SOURCE_STOP)(ALuint sourceName);
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_SOURCE_REWIND)(ALuint sourceName);
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_SOURCE_PAUSE)(ALuint sourceName);
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_SOURCE_QUEUE_BUFFERS)(ALuint sourceName, ALsizei n, const ALuint* bufferNames);
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_SOURCE_UNQUEUE_BUFFERS)(ALuint sourceName, ALsizei n, ALuint* bufferNames);
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_GEN_BUFFERS)(ALsizei n, ALuint* bufferNames);
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_DELETE_BUFFERS)(ALsizei n, const ALuint* bufferNames);
typedef ALAPI ALboolean (ALAPIENTRY *ALAPI_IS_BUFFER)(ALuint bufferName);
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_BUFFER_DATA)(ALuint bufferName, ALenum format, const ALvoid* data, ALsizei size, ALuint freq);
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_BUFFERF)( ALuint bid, ALenum param, ALfloat value);
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_BUFFER3F)( ALuint bid, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 );
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_BUFFERFV)( ALuint bid, ALenum param, const ALfloat* values );
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_BUFFERI)( ALuint bid, ALenum param, ALint value);
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_BUFFER3I)( ALuint bid, ALenum param, ALint value1, ALint value2, ALint value3 );
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_BUFFERIV)( ALuint bid, ALenum param, const ALint* values );
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_GET_BUFFERF)( ALuint bid, ALenum param, ALfloat* value );
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_GET_BUFFER3F)( ALuint bid, ALenum param, ALfloat* value1, ALfloat* value2, ALfloat* value3);
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_GET_BUFFERFV)( ALuint bid, ALenum param, ALfloat* values );
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_GET_BUFFERI)( ALuint bid, ALenum param, ALint* value );
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_GET_BUFFER3I)( ALuint bid, ALenum param, ALint* value1, ALint* value2, ALint* value3);
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_GET_BUFFERIV)( ALuint bid, ALenum param, ALint* values );
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_DOPPLER_FACTOR)(ALfloat value);
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_DOPPLER_VELOCITY)(ALfloat value);
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_SPEED_OF_SOUND)(ALfloat value);
typedef ALAPI ALvoid (ALAPIENTRY *ALAPI_DISTANCE_MODEL)(ALenum value);
typedef struct ALAPI_FXN_TABLE_STRUCT
{
ALAPI_ENABLE alEnable;
ALAPI_DISABLE alDisable;
ALAPI_IS_ENABLED alIsEnabled;
ALAPI_GET_STRING alGetString;
ALAPI_GET_BOOLEANV alGetBooleanv;
ALAPI_GET_INTEGERV alGetIntegerv;
ALAPI_GET_FLOATV alGetFloatv;
ALAPI_GET_DOUBLEV alGetDoublev;
ALAPI_GET_BOOLEAN alGetBoolean;
ALAPI_GET_INTEGER alGetInteger;
ALAPI_GET_FLOAT alGetFloat;
ALAPI_GET_DOUBLE alGetDouble;
ALAPI_GET_ERROR alGetError;
ALAPI_IS_EXTENSION_PRESENT alIsExtensionPresent;
ALAPI_GET_PROC_ADDRESS alGetProcAddress;
ALAPI_GET_ENUM_VALUE alGetEnumValue;
ALAPI_LISTENERF alListenerf;
ALAPI_LISTENER3F alListener3f;
ALAPI_LISTENERFV alListenerfv;
ALAPI_LISTENERI alListeneri;
ALAPI_LISTENER3I alListener3i;
ALAPI_LISTENERIV alListeneriv;
ALAPI_GET_LISTENERF alGetListenerf;
ALAPI_GET_LISTENER3F alGetListener3f;
ALAPI_GET_LISTENERFV alGetListenerfv;
ALAPI_GET_LISTENERI alGetListeneri;
ALAPI_GET_LISTENER3I alGetListener3i;
ALAPI_GET_LISTENERIV alGetListeneriv;
ALAPI_GEN_SOURCES alGenSources;
ALAPI_DELETE_SOURCES alDeleteSources;
ALAPI_IS_SOURCE alIsSource;
ALAPI_SOURCEF alSourcef;
ALAPI_SOURCE3F alSource3f;
ALAPI_SOURCEFV alSourcefv;
ALAPI_SOURCEI alSourcei;
ALAPI_SOURCE3I alSource3i;
ALAPI_SOURCEIV alSourceiv;
ALAPI_GET_SOURCEF alGetSourcef;
ALAPI_GET_SOURCE3F alGetSource3f;
ALAPI_GET_SOURCEFV alGetSourcefv;
ALAPI_GET_SOURCEI alGetSourcei;
ALAPI_GET_SOURCE3I alGetSource3i;
ALAPI_GET_SOURCEIV alGetSourceiv;
ALAPI_SOURCE_PLAYV alSourcePlayv;
ALAPI_SOURCE_STOPV alSourceStopv;
ALAPI_SOURCE_REWINDV alSourceRewindv;
ALAPI_SOURCE_PAUSEV alSourcePausev;
ALAPI_SOURCE_PLAY alSourcePlay;
ALAPI_SOURCE_STOP alSourceStop;
ALAPI_SOURCE_REWIND alSourceRewind;
ALAPI_SOURCE_PAUSE alSourcePause;
ALAPI_SOURCE_QUEUE_BUFFERS alSourceQueueBuffers;
ALAPI_SOURCE_UNQUEUE_BUFFERS alSourceUnqueueBuffers;
ALAPI_GEN_BUFFERS alGenBuffers;
ALAPI_DELETE_BUFFERS alDeleteBuffers;
ALAPI_IS_BUFFER alIsBuffer;
ALAPI_BUFFER_DATA alBufferData;
ALAPI_BUFFERF alBufferf;
ALAPI_BUFFER3F alBuffer3f;
ALAPI_BUFFERFV alBufferfv;
ALAPI_BUFFERI alBufferi;
ALAPI_BUFFER3I alBuffer3i;
ALAPI_BUFFERIV alBufferiv;
ALAPI_GET_BUFFERF alGetBufferf;
ALAPI_GET_BUFFER3F alGetBuffer3f;
ALAPI_GET_BUFFERFV alGetBufferfv;
ALAPI_GET_BUFFERI alGetBufferi;
ALAPI_GET_BUFFER3I alGetBuffer3i;
ALAPI_GET_BUFFERIV alGetBufferiv;
ALAPI_DOPPLER_FACTOR alDopplerFactor;
ALAPI_DOPPLER_VELOCITY alDopplerVelocity;
ALAPI_SPEED_OF_SOUND alSpeedOfSound;
ALAPI_DISTANCE_MODEL alDistanceModel;
} ALAPI_FXN_TABLE;
#include "al\alc.h"
// ALCAPI
typedef struct ALCdevice_struct ALCdevice;
typedef struct ALCcontext_struct ALCcontext;
typedef ALCAPI ALCcontext* (ALCAPIENTRY *ALCAPI_CREATE_CONTEXT)(ALCdevice* device, const ALint* attrList);
typedef ALCAPI ALboolean (ALCAPIENTRY *ALCAPI_MAKE_CONTEXT_CURRENT)(ALCcontext* context);
typedef ALCAPI ALvoid (ALCAPIENTRY *ALCAPI_PROCESS_CONTEXT)(ALCcontext* context);
typedef ALCAPI ALCvoid (ALCAPIENTRY *ALCAPI_SUSPEND_CONTEXT)(ALCcontext* context);
typedef ALCAPI ALvoid (ALCAPIENTRY *ALCAPI_DESTROY_CONTEXT)(ALCcontext* context);
typedef ALCAPI ALCcontext* (ALCAPIENTRY *ALCAPI_GET_CURRENT_CONTEXT)(ALvoid);
typedef ALCAPI ALCdevice* (ALCAPIENTRY *ALCAPI_GET_CONTEXTS_DEVICE)(ALCcontext* context);
typedef ALCAPI ALCdevice* (ALCAPIENTRY *ALCAPI_OPEN_DEVICE)(const ALCchar* deviceName);
typedef ALCAPI ALCboolean (ALCAPIENTRY *ALCAPI_CLOSE_DEVICE)(ALCdevice* device);
typedef ALCAPI ALenum (ALCAPIENTRY *ALCAPI_GET_ERROR)(ALCdevice* device);
typedef ALCAPI ALboolean (ALCAPIENTRY *ALCAPI_IS_EXTENSION_PRESENT)(ALCdevice* device, const ALCchar* eName);
typedef ALCAPI ALvoid* (ALCAPIENTRY *ALCAPI_GET_PROC_ADDRESS)(ALCdevice* device, const ALCchar* fName);
typedef ALCAPI ALenum (ALCAPIENTRY *ALCAPI_GET_ENUM_VALUE)(ALCdevice* device, const ALCchar* eName);
typedef ALCAPI const ALCchar* (ALCAPIENTRY *ALCAPI_GET_STRING)(ALCdevice* device, ALenum param);
typedef ALCAPI ALvoid (ALCAPIENTRY *ALCAPI_GET_INTEGERV)(ALCdevice* device, ALenum param, ALsizei size, ALint* data);
typedef ALCAPI ALCdevice * (ALCAPIENTRY *ALCAPI_CAPTURE_OPEN_DEVICE)( const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize );
typedef ALCAPI ALCboolean (ALCAPIENTRY *ALCAPI_CAPTURE_CLOSE_DEVICE)( ALCdevice *device );
typedef ALCAPI void (ALCAPIENTRY *ALCAPI_CAPTURE_START)( ALCdevice *device );
typedef ALCAPI void (ALCAPIENTRY *ALCAPI_CAPTURE_STOP)( ALCdevice *device );
typedef ALCAPI void (ALCAPIENTRY *ALCAPI_CAPTURE_SAMPLES)( ALCdevice *device, ALCvoid *buffer, ALCsizei samples );
typedef struct ALCAPI_FXN_TABLE_STRUCT
{
ALCAPI_CREATE_CONTEXT alcCreateContext;
ALCAPI_MAKE_CONTEXT_CURRENT alcMakeContextCurrent;
ALCAPI_PROCESS_CONTEXT alcProcessContext;
ALCAPI_SUSPEND_CONTEXT alcSuspendContext;
ALCAPI_DESTROY_CONTEXT alcDestroyContext;
ALCAPI_GET_CURRENT_CONTEXT alcGetCurrentContext;
ALCAPI_GET_CONTEXTS_DEVICE alcGetContextsDevice;
ALCAPI_OPEN_DEVICE alcOpenDevice;
ALCAPI_CLOSE_DEVICE alcCloseDevice;
ALCAPI_GET_ERROR alcGetError;
ALCAPI_IS_EXTENSION_PRESENT alcIsExtensionPresent;
ALCAPI_GET_PROC_ADDRESS alcGetProcAddress;
ALCAPI_GET_ENUM_VALUE alcGetEnumValue;
ALCAPI_GET_STRING alcGetString;
ALCAPI_GET_INTEGERV alcGetIntegerv;
ALCAPI_CAPTURE_OPEN_DEVICE alcCaptureOpenDevice;
ALCAPI_CAPTURE_CLOSE_DEVICE alcCaptureCloseDevice;
ALCAPI_CAPTURE_START alcCaptureStart;
ALCAPI_CAPTURE_STOP alcCaptureStop;
ALCAPI_CAPTURE_SAMPLES alcCaptureSamples;
} ALCAPI_FXN_TABLE;
#include "windows.h"
#include "alList.h"
//*****************************************************************************
// Additional Defines
//*****************************************************************************
typedef struct ALCdevice_struct
{
//
// These variables must always be initialized.
//
ALenum LastError;
ALint InUse;
//
// Support for 3rd party OpenAL implementations.
//
HINSTANCE Dll;
ALCAPI_FXN_TABLE AlcApi;
// Capture Device
ALCdevice* CaptureDevice;
struct ALCdevice_struct* DllDevice;
} ALCdevice;
typedef struct ALCcontext_struct
{
//
// These variables are always initialized.
//
ALlistEntry ListEntry;
ALboolean Suspended;
ALenum LastError;
ALCdevice* Device;
ALAPI_FXN_TABLE AlApi;
CRITICAL_SECTION Lock;
struct ALCcontext_struct* DllContext;
} ALCcontext;
extern ALlist* alContextList;
extern ALCcontext* alCurrentContext;
// Device Enumeration structures, strings and variables
typedef struct _ALDEVICE
{
ALchar *pszDeviceName;
TCHAR *pszHostDLLFilename;
struct _ALDEVICE *pNextDevice;
} ALDEVICE;
extern ALchar *pszDefaultDeviceSpecifier;
extern ALchar *pszDeviceSpecifierList;
extern ALchar *pszDefaultCaptureDeviceSpecifier;
extern ALchar *pszCaptureDeviceSpecifierList;
extern ALchar *pszDefaultAllDevicesSpecifier;
extern ALchar *pszAllDevicesSpecifierList;
extern ALDEVICE *g_pDeviceList;
extern ALDEVICE *g_pCaptureDeviceList;
extern ALDEVICE *g_pAllDevicesList;
#ifdef __cplusplus
}
#endif
#endif
-101
View File
@@ -1,101 +0,0 @@
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 6,14,357,23
PRODUCTVERSION 6,14,357,23
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "Portions (C) Creative Labs Inc. and NVIDIA Corp."
VALUE "FileDescription", "Standard OpenAL(TM) Implementation"
VALUE "FileVersion", "6.14.0357.23"
VALUE "LegalCopyright", "Copyright (C) 2000-2006"
VALUE "OriginalFilename", "OpenAL32.dll"
VALUE "ProductName", "Standard OpenAL(TM) Library"
VALUE "ProductVersion", "6.14.0357.23"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
-981
View File
@@ -1,981 +0,0 @@
/**
* OpenAL cross platform audio library
* Copyright (C) 1999-2003 by authors.
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
* Or go to http://www.gnu.org/copyleft/lgpl.html
*/
#include <al\alc.h>
#include "OpenAL32.h"
typedef struct ALfunction_struct
{
ALchar *funcName;
ALvoid *address;
} ALfunction;
static ALfunction function[]= {
{ "alEnable", (ALvoid *) alEnable },
{ "alDisable", (ALvoid *) alDisable },
{ "alIsEnabled", (ALvoid *) alIsEnabled },
{ "alGetString", (ALvoid *) alGetString },
{ "alGetBooleanv", (ALvoid *) alGetBooleanv },
{ "alGetIntegerv", (ALvoid *) alGetIntegerv },
{ "alGetFloatv", (ALvoid *) alGetFloatv },
{ "alGetDoublev", (ALvoid *) alGetDoublev },
{ "alGetBoolean", (ALvoid *) alGetBoolean },
{ "alGetInteger", (ALvoid *) alGetInteger },
{ "alGetFloat", (ALvoid *) alGetFloat },
{ "alGetDouble", (ALvoid *) alGetDouble },
{ "alGetError", (ALvoid *) alGetError },
{ "alIsExtensionPresent", (ALvoid *) alIsExtensionPresent },
{ "alGetProcAddress", (ALvoid *) alGetProcAddress },
{ "alGetEnumValue", (ALvoid *) alGetEnumValue },
{ "alListenerf", (ALvoid *) alListenerf },
{ "alListener3f", (ALvoid *) alListener3f },
{ "alListenerfv", (ALvoid *) alListenerfv },
{ "alListeneri", (ALvoid *) alListeneri },
{ "alListener3i", (ALvoid *) alListener3i },
{ "alListeneriv", (ALvoid *) alListeneriv },
{ "alGetListenerf", (ALvoid *) alGetListenerf },
{ "alGetListener3f", (ALvoid *) alGetListener3f },
{ "alGetListenerfv", (ALvoid *) alGetListenerfv },
{ "alGetListeneri", (ALvoid *) alGetListeneri },
{ "alGetListener3i", (ALvoid *) alGetListener3i },
{ "alGetListeneriv", (ALvoid *) alGetListeneriv },
{ "alGenSources", (ALvoid *) alGenSources },
{ "alDeleteSources", (ALvoid *) alDeleteSources },
{ "alIsSource", (ALvoid *) alIsSource },
{ "alSourcef", (ALvoid *) alSourcef },
{ "alSource3f", (ALvoid *) alSource3f },
{ "alSourcefv", (ALvoid *) alSourcefv },
{ "alSourcei", (ALvoid *) alSourcei },
{ "alSource3i", (ALvoid *) alSource3i },
{ "alSourceiv", (ALvoid *) alSourceiv },
{ "alGetSourcef", (ALvoid *) alGetSourcef },
{ "alGetSource3f", (ALvoid *) alGetSource3f },
{ "alGetSourcefv", (ALvoid *) alGetSourcefv },
{ "alGetSourcei", (ALvoid *) alGetSourcei },
{ "alGetSource3i", (ALvoid *) alGetSource3i },
{ "alGetSourceiv", (ALvoid *) alGetSourceiv },
{ "alSourcePlayv", (ALvoid *) alSourcePlayv },
{ "alSourceStopv", (ALvoid *) alSourceStopv },
{ "alSourceRewindv", (ALvoid *) alSourceRewindv },
{ "alSourcePausev", (ALvoid *) alSourcePausev },
{ "alSourcePlay", (ALvoid *) alSourcePlay },
{ "alSourceStop", (ALvoid *) alSourceStop },
{ "alSourceRewind", (ALvoid *) alSourceRewind },
{ "alSourcePause", (ALvoid *) alSourcePause },
{ "alSourceQueueBuffers", (ALvoid *) alSourceQueueBuffers },
{ "alSourceUnqueueBuffers", (ALvoid *) alSourceUnqueueBuffers },
{ "alGenBuffers", (ALvoid *) alGenBuffers },
{ "alDeleteBuffers", (ALvoid *) alDeleteBuffers },
{ "alIsBuffer", (ALvoid *) alIsBuffer },
{ "alBufferData", (ALvoid *) alBufferData },
{ "alBufferf", (ALvoid *) alBufferf },
{ "alBuffer3f", (ALvoid *) alBuffer3f },
{ "alBufferfv", (ALvoid *) alBufferfv },
{ "alBufferi", (ALvoid *) alBufferi },
{ "alBuffer3i", (ALvoid *) alBuffer3i },
{ "alBufferiv", (ALvoid *) alBufferiv },
{ "alGetBufferf", (ALvoid *) alGetBufferf },
{ "alGetBuffer3f", (ALvoid *) alGetBuffer3f },
{ "alGetBufferfv", (ALvoid *) alGetBufferfv },
{ "alGetBufferi", (ALvoid *) alGetBufferi },
{ "alGetBuffer3i", (ALvoid *) alGetBuffer3i },
{ "alGetBufferiv", (ALvoid *) alGetBufferiv },
{ "alDopplerFactor", (ALvoid *) alDopplerFactor },
{ "alDopplerVelocity", (ALvoid *) alDopplerVelocity },
{ "alSpeedOfSound", (ALvoid *) alSpeedOfSound },
{ "alDistanceModel", (ALvoid *) alDistanceModel },
{ NULL, (ALvoid *) NULL } };
//*****************************************************************************
//*****************************************************************************
//
// Defines
//
//*****************************************************************************
//*****************************************************************************
#ifdef __MINGW32__
// fix for Mingw32.
#define AL_VOID_FXN(fxn) \
ALCcontext* context; \
\
alListAcquireLock(alContextList); \
if(!alCurrentContext) \
{ \
alListReleaseLock(alContextList); \
return; \
} \
\
context = alCurrentContext; \
EnterCriticalSection(&context->Lock); \
alListReleaseLock(alContextList); \
\
context->AlApi.fxn; \
LeaveCriticalSection(&context->Lock); \
return
#define AL_RESULT_FXN(fxn, resultType, resultDefVal) \
resultType result = resultDefVal; \
ALCcontext* context; \
\
alListAcquireLock(alContextList); \
if(!alCurrentContext) \
{ \
alListReleaseLock(alContextList); \
return result; \
} \
\
context = alCurrentContext; \
EnterCriticalSection(&context->Lock); \
alListReleaseLock(alContextList); \
\
result = context->AlApi.fxn; \
LeaveCriticalSection(&context->Lock); \
return result
#else
#define AL_RESULT_FXN(fxn, resultType, resultDefVal) \
resultType result = resultDefVal; \
ALCcontext* context; \
\
alListAcquireLock(alContextList); \
if(!alCurrentContext) \
{ \
alListReleaseLock(alContextList); \
return result; \
} \
\
context = alCurrentContext; \
EnterCriticalSection(&context->Lock); \
alListReleaseLock(alContextList); \
\
result = context->AlApi.##fxn; \
LeaveCriticalSection(&context->Lock); \
return result
#define AL_VOID_FXN(fxn) \
ALCcontext* context; \
\
alListAcquireLock(alContextList); \
if(!alCurrentContext) \
{ \
alListReleaseLock(alContextList); \
return; \
} \
\
context = alCurrentContext; \
EnterCriticalSection(&context->Lock); \
alListReleaseLock(alContextList); \
\
context->AlApi.##fxn; \
LeaveCriticalSection(&context->Lock); \
return
#endif
//*****************************************************************************
//*****************************************************************************
//
// AL API Buffer Entry Points
//
//*****************************************************************************
//*****************************************************************************
//*****************************************************************************
// alGenBuffers
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alGenBuffers(ALsizei n, ALuint* bufferNames)
{
AL_VOID_FXN(alGenBuffers(n, bufferNames));
}
//*****************************************************************************
// alDeleteBuffers
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alDeleteBuffers(ALsizei n, const ALuint* bufferNames)
{
AL_VOID_FXN(alDeleteBuffers(n, bufferNames));
}
//*****************************************************************************
// alIsBuffer
//*****************************************************************************
//
ALAPI ALboolean ALAPIENTRY alIsBuffer(ALuint bufferName)
{
AL_RESULT_FXN(alIsBuffer(bufferName), ALboolean, AL_FALSE);
}
//*****************************************************************************
// alBuffer3f
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alBuffer3f(ALuint bufferName, ALenum param, ALfloat v1, ALfloat v2, ALfloat v3)
{
AL_VOID_FXN(alBuffer3f(bufferName, param, v1, v2, v3));
}
//*****************************************************************************
// alBuffer3i
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alBuffer3i(ALuint bufferName, ALenum param, ALint v1, ALint v2, ALint v3)
{
AL_VOID_FXN(alBuffer3i(bufferName, param, v1, v2, v3));
}
//*****************************************************************************
// alBufferData
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alBufferData(ALuint bufferName, ALenum format, const ALvoid* data, ALsizei size, ALsizei freq)
{
AL_VOID_FXN(alBufferData(bufferName, format, data, size, freq));
}
//*****************************************************************************
// alBufferf
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alBufferf(ALuint bufferName, ALenum param, ALfloat value)
{
AL_VOID_FXN(alBufferf(bufferName, param, value));
}
//*****************************************************************************
// alBufferfv
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alBufferfv(ALuint bufferName, ALenum param, const ALfloat* values)
{
AL_VOID_FXN(alBufferfv(bufferName, param, values));
}
//*****************************************************************************
// alBufferi
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alBufferi(ALuint bufferName, ALenum param, ALint value)
{
AL_VOID_FXN(alBufferi(bufferName, param, value));
}
//*****************************************************************************
// alBufferiv
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alBufferiv(ALuint bufferName, ALenum param, const ALint* values)
{
AL_VOID_FXN(alBufferiv(bufferName, param, values));
}
//*****************************************************************************
// alGetBuffer3f
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alGetBuffer3f(ALuint bufferName, ALenum param, ALfloat *v1, ALfloat *v2, ALfloat *v3)
{
AL_VOID_FXN(alGetBuffer3f(bufferName, param, v1, v2, v3));
}
//*****************************************************************************
// alGetBuffer3i
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alGetBuffer3i(ALuint bufferName, ALenum param, ALint *v1, ALint *v2, ALint *v3)
{
AL_VOID_FXN(alGetBuffer3i(bufferName, param, v1, v2, v3));
}
//*****************************************************************************
// alGetBufferf
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alGetBufferf(ALuint bufferName, ALenum param, ALfloat* value)
{
AL_VOID_FXN(alGetBufferf(bufferName, param, value));
}
//*****************************************************************************
// alGetBufferfv
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alGetBufferfv(ALuint bufferName, ALenum param, ALfloat* values)
{
AL_VOID_FXN(alGetBufferfv(bufferName, param, values));
}
//*****************************************************************************
// alGetBufferi
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alGetBufferi(ALuint bufferName, ALenum param, ALint* value)
{
AL_VOID_FXN(alGetBufferi(bufferName, param, value));
}
//*****************************************************************************
// alGetBufferiv
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alGetBufferiv(ALuint bufferName, ALenum param, ALint* values)
{
AL_VOID_FXN(alGetBufferiv(bufferName, param, values));
}
//*****************************************************************************
//*****************************************************************************
//
// AL API Generic Entry Points
//
//*****************************************************************************
//*****************************************************************************
//*****************************************************************************
// alEnable
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alEnable(ALenum capability)
{
AL_VOID_FXN(alEnable(capability));
}
//*****************************************************************************
// alDisable
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alDisable(ALenum capability)
{
AL_VOID_FXN(alDisable(capability));
}
//*****************************************************************************
// alDopplerFactor
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alDopplerFactor(ALfloat value)
{
AL_VOID_FXN(alDopplerFactor(value));
}
//*****************************************************************************
// alDopplerVelocity
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alDopplerVelocity(ALfloat value)
{
AL_VOID_FXN(alDopplerVelocity(value));
}
//*****************************************************************************
// alSpeedOfSound
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alSpeedOfSound(ALfloat value)
{
ALCcontext* context;
alListAcquireLock(alContextList);
if(!alCurrentContext)
{
alListReleaseLock(alContextList);
return;
}
context = alCurrentContext;
EnterCriticalSection(&context->Lock);
alListReleaseLock(alContextList);
if (context->AlApi.alSpeedOfSound) { // protect against talking to a 1.0 lib
context->AlApi.alSpeedOfSound(value);
}
LeaveCriticalSection(&context->Lock);
return;
}
//*****************************************************************************
// alDistanceModel
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alDistanceModel(ALenum value)
{
AL_VOID_FXN(alDistanceModel(value));
}
//*****************************************************************************
// alGetBoolean
//*****************************************************************************
//
ALAPI ALboolean ALAPIENTRY alGetBoolean(ALenum param)
{
AL_RESULT_FXN(alGetBoolean(param), ALboolean, AL_FALSE);
}
//*****************************************************************************
// alGetBooleanv
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alGetBooleanv(ALenum param, ALboolean* data)
{
AL_VOID_FXN(alGetBooleanv(param, data));
}
//*****************************************************************************
// alGetDouble
//*****************************************************************************
//
ALAPI ALdouble ALAPIENTRY alGetDouble(ALenum param)
{
AL_RESULT_FXN(alGetDouble(param), ALdouble, 0.0);
}
//*****************************************************************************
// alGetDoublev
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alGetDoublev(ALenum param, ALdouble* data)
{
AL_VOID_FXN(alGetDoublev(param, data));
}
//*****************************************************************************
// alGetFloat
//*****************************************************************************
//
ALAPI ALfloat ALAPIENTRY alGetFloat(ALenum param)
{
AL_RESULT_FXN(alGetFloat(param), ALfloat, 0.0f);
}
//*****************************************************************************
// alGetFloatv
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alGetFloatv(ALenum param, ALfloat* data)
{
AL_VOID_FXN(alGetFloatv(param, data));
}
//*****************************************************************************
// alGetInteger
//*****************************************************************************
//
ALAPI ALint ALAPIENTRY alGetInteger(ALenum param)
{
AL_RESULT_FXN(alGetInteger(param), ALint, 0);
}
//*****************************************************************************
// alGetIntegerv
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alGetIntegerv(ALenum param, ALint* data)
{
AL_VOID_FXN(alGetIntegerv(param, data));
}
//*****************************************************************************
// alGetEnumValue
//*****************************************************************************
//
ALAPI ALenum ALAPIENTRY alGetEnumValue(const ALCchar* ename)
{
AL_RESULT_FXN(alGetEnumValue(ename), ALenum, AL_INVALID_ENUM);
}
//*****************************************************************************
// alGetError
//*****************************************************************************
//
ALAPI ALenum ALAPIENTRY alGetError(ALvoid)
{
AL_RESULT_FXN(alGetError(), ALenum, AL_NO_ERROR);
}
//*****************************************************************************
// alGetProcAddress
//*****************************************************************************
//
ALAPI ALvoid* ALAPIENTRY alGetProcAddress(const ALCchar* fname)
{
// return router's address if available
ALsizei i=0;
ALvoid *pAddress;
while ((function[i].funcName)&&(strcmp((char *)function[i].funcName,(char *)fname)))
i++;
pAddress = function[i].address;
if (pAddress != NULL) {
return pAddress;
}
// router doesn't have this entry point, so go to the device...
AL_RESULT_FXN(alGetProcAddress(fname), ALvoid*, 0);
return pAddress;
}
//*****************************************************************************
// alGetString
//*****************************************************************************
//
ALAPI const ALCchar* ALAPIENTRY alGetString(ALenum param)
{
AL_RESULT_FXN(alGetString(param), const ALCchar*, 0);
}
//*****************************************************************************
// alIsExtensionPresent
//*****************************************************************************
//
ALAPI ALboolean ALAPIENTRY alIsExtensionPresent(const ALCchar* ename)
{
AL_RESULT_FXN(alIsExtensionPresent(ename), ALboolean, AL_FALSE);
}
//*****************************************************************************
// alIsEnabled
//*****************************************************************************
//
ALAPI ALboolean ALAPIENTRY alIsEnabled(ALenum capability)
{
AL_RESULT_FXN(alIsEnabled(capability), ALboolean, AL_FALSE);
}
//*****************************************************************************
//*****************************************************************************
//
// AL API Listener Entry Points
//
//*****************************************************************************
//*****************************************************************************
//*****************************************************************************
// alListenerf
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alListenerf(ALenum param, ALfloat value)
{
AL_VOID_FXN(alListenerf(param, value));
}
//*****************************************************************************
// alListener3f
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alListener3f(ALenum param, ALfloat v1, ALfloat v2, ALfloat v3)
{
AL_VOID_FXN(alListener3f(param, v1, v2, v3));
}
//*****************************************************************************
// alListener3i
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alListener3i(ALenum param, ALint v1, ALint v2, ALint v3)
{
AL_VOID_FXN(alListener3i(param, v1, v2, v3));
}
//*****************************************************************************
// alListenerfv
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alListenerfv(ALenum param, const ALfloat* values)
{
AL_VOID_FXN(alListenerfv(param, values));
}
//*****************************************************************************
// alListeneri
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alListeneri(ALenum param, ALint value)
{
AL_VOID_FXN(alListeneri(param, value));
}
//*****************************************************************************
// alListeneriv
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alListeneriv(ALenum param, const ALint *values)
{
AL_VOID_FXN(alListeneriv(param, values));
}
//*****************************************************************************
// alGetListenerf
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alGetListenerf(ALenum param, ALfloat* value)
{
AL_VOID_FXN(alGetListenerf(param, value));
}
//*****************************************************************************
// alGetListener3f
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alGetListener3f(ALenum param, ALfloat* v1, ALfloat* v2, ALfloat* v3)
{
AL_VOID_FXN(alGetListener3f(param, v1, v2, v3));
}
//*****************************************************************************
// alGetListener3i
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alGetListener3i(ALenum param, ALint* v1, ALint* v2, ALint* v3)
{
AL_VOID_FXN(alGetListener3i(param, v1, v2, v3));
}
//*****************************************************************************
// alGetListenerfv
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alGetListenerfv(ALenum param, ALfloat* values)
{
AL_VOID_FXN(alGetListenerfv(param, values));
}
//*****************************************************************************
// alGetListeneri
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alGetListeneri(ALenum param, ALint* value)
{
AL_VOID_FXN(alGetListeneri(param, value));
}
//*****************************************************************************
// alGetListeneriv
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alGetListeneriv(ALenum param, ALint* values)
{
AL_VOID_FXN(alGetListeneriv(param, values));
}
//*****************************************************************************
//*****************************************************************************
//
// AL API Source Entry Points
//
//*****************************************************************************
//*****************************************************************************
//*****************************************************************************
// alGenSources
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alGenSources(ALsizei n, ALuint* sourceNames)
{
AL_VOID_FXN(alGenSources(n, sourceNames));
}
//*****************************************************************************
// alDeleteSources
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alDeleteSources(ALsizei n, const ALuint* sourceNames)
{
AL_VOID_FXN(alDeleteSources(n, sourceNames));
}
//*****************************************************************************
// alIsSource
//*****************************************************************************
//
ALAPI ALboolean ALAPIENTRY alIsSource(ALuint sourceName)
{
AL_RESULT_FXN(alIsSource(sourceName), ALboolean, AL_FALSE);
}
//*****************************************************************************
// alSourcef
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alSourcef(ALuint sourceName, ALenum param, ALfloat value)
{
AL_VOID_FXN(alSourcef(sourceName, param, value));
}
//*****************************************************************************
// alSourcefv
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alSourcefv(ALuint sourceName, ALenum param, const ALfloat* values)
{
AL_VOID_FXN(alSourcefv(sourceName, param, values));
}
//*****************************************************************************
// alSource3f
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alSource3f(ALuint sourceName, ALenum param, ALfloat v1, ALfloat v2, ALfloat v3)
{
AL_VOID_FXN(alSource3f(sourceName, param, v1, v2, v3));
}
//*****************************************************************************
// alSource3i
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alSource3i(ALuint sourceName, ALenum param, ALint v1, ALint v2, ALint v3)
{
AL_VOID_FXN(alSource3i(sourceName, param, v1, v2, v3));
}
//*****************************************************************************
// alSourcei
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alSourcei(ALuint sourceName, ALenum param, ALint value)
{
AL_VOID_FXN(alSourcei(sourceName, param, value));
}
//*****************************************************************************
// alSourceiv
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alSourceiv(ALuint sourceName, ALenum param, const ALint* values)
{
AL_VOID_FXN(alSourceiv(sourceName, param, values));
}
//*****************************************************************************
// alGetSourcef
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alGetSourcef(ALuint sourceName, ALenum param, ALfloat* value)
{
AL_VOID_FXN(alGetSourcef(sourceName, param, value));
}
//*****************************************************************************
// alGetSource3f
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alGetSource3f(ALuint sourceName, ALenum param, ALfloat* v1, ALfloat* v2, ALfloat* v3)
{
AL_VOID_FXN(alGetSource3f(sourceName, param, v1, v2, v3));
}
//*****************************************************************************
// alGetSource3i
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alGetSource3i(ALuint sourceName, ALenum param, ALint* v1, ALint* v2, ALint* v3)
{
AL_VOID_FXN(alGetSource3i(sourceName, param, v1, v2, v3));
}
//*****************************************************************************
// alGetSourcefv
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alGetSourcefv(ALuint sourceName, ALenum param, ALfloat* values)
{
AL_VOID_FXN(alGetSourcefv(sourceName, param, values));
}
//*****************************************************************************
// alGetSourcei
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alGetSourcei(ALuint sourceName, ALenum param, ALint* value)
{
AL_VOID_FXN(alGetSourcei(sourceName, param, value));
}
//*****************************************************************************
// alGetSourceiv
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alGetSourceiv(ALuint sourceName, ALenum param, ALint* values)
{
AL_VOID_FXN(alGetSourceiv(sourceName, param, values));
}
//*****************************************************************************
// alSourcePlay
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alSourcePlay(ALuint sourceName)
{
AL_VOID_FXN(alSourcePlay(sourceName));
}
//*****************************************************************************
// alSourcePlayv
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alSourcePlayv(ALsizei n, const ALuint* sourceNames)
{
AL_VOID_FXN(alSourcePlayv(n, sourceNames));
}
//*****************************************************************************
// alSourcePause
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alSourcePause(ALuint sourceName)
{
AL_VOID_FXN(alSourcePause(sourceName));
}
//*****************************************************************************
// alSourcePausev
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alSourcePausev(ALsizei n, const ALuint* sourceNames)
{
AL_VOID_FXN(alSourcePausev(n, sourceNames));
}
//*****************************************************************************
// alSourceStop
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alSourceStop(ALuint sourceName)
{
AL_VOID_FXN(alSourceStop(sourceName));
}
//*****************************************************************************
// alSourceStopv
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alSourceStopv(ALsizei n, const ALuint* sourceNames)
{
AL_VOID_FXN(alSourceStopv(n, sourceNames));
}
//*****************************************************************************
// alSourceRewind
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alSourceRewind(ALuint sourceName)
{
AL_VOID_FXN(alSourceRewind(sourceName));
}
//*****************************************************************************
// alSourceRewindv
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alSourceRewindv(ALsizei n, const ALuint* sourceNames)
{
AL_VOID_FXN(alSourceRewindv(n, sourceNames));
}
//*****************************************************************************
// alSourceQueueBuffers
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alSourceQueueBuffers(ALuint sourceName, ALsizei n, const ALuint* buffers)
{
AL_VOID_FXN(alSourceQueueBuffers(sourceName, n, buffers));
}
//*****************************************************************************
// alSourceUnqueueBuffers
//*****************************************************************************
//
ALAPI ALvoid ALAPIENTRY alSourceUnqueueBuffers(ALuint sourceName, ALsizei n, ALuint* buffers)
{
AL_VOID_FXN(alSourceUnqueueBuffers(sourceName, n, buffers));
}
-1029
View File
File diff suppressed because it is too large Load Diff
-433
View File
@@ -1,433 +0,0 @@
/**
* OpenAL cross platform audio library
* Copyright (C) 1999-2003 by authors.
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
* Or go to http://www.gnu.org/copyleft/lgpl.html
*/
#ifndef _AL_LIST_H_
#define _AL_LIST_H_
#include <al/al.h>
#ifdef __cplusplus
extern "C" {
#endif
#include <windows.h>
//*****************************************************************************
//*****************************************************************************
//
// Defines
//
//*****************************************************************************
//*****************************************************************************
//
// Some useful things to track parameters.
//
#ifndef IN
#define IN
#endif
#ifndef OPTIONAL
#define OPTIONAL
#endif
#ifndef OUT
#define OUT
#endif
//
// The list entry. This should not be modified outside the list routines.
//
typedef struct ALlistEntry_Struct
{
//
// The previous list entry.
//
struct ALlistEntry_Struct* Previous;
//
// The next list entry.
//
struct ALlistEntry_Struct* Next;
//
// The data for the current entry.
//
ALvoid* Data;
} ALlistEntry;
//
// This is the context to pass to all the list calls. It must be initialized
// before any list calls are made.
//
typedef struct //ALlist_Struct
{
//
// This is the pointer to the first item in the list.
//
ALlistEntry* Head;
//
// This is the pointer to the last item in the list.
//
ALlistEntry* Tail;
//
// This is the list iterator.
//
ALlistEntry* Current;
//
// This is the list lock to prevent simultaneous addition and removal
// of entries.
//
CRITICAL_SECTION Lock;
//
// This maintains a count of the number of entries in the list.
//
ALint NumberOfEntries;
//
// This is set if the list is locked. For debug use only.
//
#if(DBG)
ALint Locked;
#endif
} ALlist;
//*****************************************************************************
//*****************************************************************************
//
// List Functions
//
//*****************************************************************************
//*****************************************************************************
//*****************************************************************************
// alListAddEntry
//*****************************************************************************
// Adds an entry to the tail of the list. Each entry must be unique.
//
ALvoid alListAddEntry
(
IN ALlist* pList,
IN ALlistEntry* pEntry
);
//*****************************************************************************
// alListAddEntryToHead
//*****************************************************************************
// Adds an entry to the head of the list. Each entry must be unique.
//
ALvoid alListAddEntryToHead
(
IN ALlist* pList,
IN ALlistEntry* pEntry
);
//*****************************************************************************
// alListAcquireLock
//*****************************************************************************
// This is called to acquire the list lock for operations that span multiple
// list calls like iterating over the list.
//
ALvoid alListAcquireLock
(
IN ALlist* pList
);
//*****************************************************************************
// alListCreate
//*****************************************************************************
// Creates and initializes a list.
//
ALboolean alListCreate
(
OUT ALlist** ppList
);
//*****************************************************************************
// alListFree
//*****************************************************************************
// Destroys the list. Dynamically allocated entries are not freed.
//
ALvoid alListFree
(
IN ALlist* pList
);
//*****************************************************************************
// alListGetData
//*****************************************************************************
// Returns the data from the list entry.
//
ALvoid* alListGetData
(
IN ALlistEntry* pEntry
);
//*****************************************************************************
// alListGetEntryAt
//*****************************************************************************
// Returns the entry in the list at the specified index of the list.
//
ALlistEntry* alListGetEntryAt
(
IN ALlist* pList,
IN ALint Index
);
//*****************************************************************************
// alListGetEntryCount
//*****************************************************************************
// Returns the number of items stored in the list.
//
ALint alListGetEntryCount
(
IN ALlist* pList
);
//*****************************************************************************
// alListGetHead
//*****************************************************************************
// Returns the first entry in the list.
//
ALlistEntry* alListGetHead
(
IN ALlist* pList
);
//*****************************************************************************
// alListGetNext
//*****************************************************************************
// Returns the entry after to the entry pointed to by the iterator. If
// the iterator is at the last entry (or has finished iterating over the
// list), the returned entry will be 0.
//
ALlistEntry* alListGetNext
(
IN ALlist* pList
);
//*****************************************************************************
// alListGetPrevious
//*****************************************************************************
// Returns the entry previous to the entry pointed to by the iterator. If
// the iterator is at the first entry, the returned entry will be 0.
//
ALlistEntry* alListGetPrevious
(
IN ALlist* pList
);
//*****************************************************************************
// alListGetTail
//*****************************************************************************
// Returns the last entry in the list.
//
ALlistEntry* alListGetTail
(
IN ALlist* pList
);
//*****************************************************************************
// alListInitializeEntry
//*****************************************************************************
// Initializes a preallocated list entry.
//
ALvoid alListInitializeEntry
(
IN ALlistEntry* pListEntry,
IN ALvoid* pData
);
//*****************************************************************************
// alListIsEmpty
//*****************************************************************************
// Returns the TRUE if the list is empty.
//
ALboolean alListIsEmpty
(
IN ALlist* pList
);
//*****************************************************************************
// alListIteratorGet
//*****************************************************************************
// Returns the entry pointed to by the iterator.
//
ALlistEntry* alListIteratorGet
(
IN ALlist* pList
);
//*****************************************************************************
// alListIteratorFindData
//*****************************************************************************
// Searches the list for the matching item and return the pointer to the
// entry. If the match is not found, the return will be 0.
//
ALlistEntry* alListIteratorFindData
(
IN ALlist* pList,
IN ALvoid* pData
);
//*****************************************************************************
// alListIteratorNext
//*****************************************************************************
// This is called to advance the list iterator to the next entry in the list
// and return that entry.
//
ALlistEntry* alListIteratorNext
(
IN ALlist* pList
);
//*****************************************************************************
// alListIteratorPrevious
//*****************************************************************************
// This is called to advance the list iterator to the previous entry in the
// list and return that entry.
//
ALlistEntry* alListIteratorPrevious
(
IN ALlist* pList
);
//*****************************************************************************
// alListIteratorReset
//*****************************************************************************
// Returns the list iterator to the head of the list and returns the head
// entry.
//
ALlistEntry* alListIteratorReset
(
IN ALlist* pList
);
//*****************************************************************************
// alListIteratorRemove
//*****************************************************************************
// Removes the current item from the list and returns it. The iterator will
// equal the next item in the list.
//
ALlistEntry* alListIteratorRemove
(
IN ALlist* pList
);
//*****************************************************************************
// alListIteratorSet
//*****************************************************************************
// Sets the current entry pointer to the entry passed in. If the entry is not
// found, the current entry will be 0.
//
ALlistEntry* alListIteratorSet
(
IN ALlist* pList,
IN ALlistEntry* pEntry
);
//*****************************************************************************
// alListMatchEntry
//*****************************************************************************
// Matches the entry to an item in the list and returns the data in that
// entry. If the match is not found, the return will be 0.
//
ALvoid* alListMatchEntry
(
IN ALlist* pList,
IN ALlistEntry* pEntry
);
//*****************************************************************************
// alListMatchData
//*****************************************************************************
// Searches the list for the matching item and return the pointer to the
// entry. If the match is not found, the return will be 0.
//
ALlistEntry* alListMatchData
(
IN ALlist* pList,
IN ALvoid* pData
);
//*****************************************************************************
// alListReleaseLock
//*****************************************************************************
// This is called to release the list lock.
//
ALvoid alListReleaseLock
(
IN ALlist* pList
);
//*****************************************************************************
// alListRemoveEntry
//*****************************************************************************
// Removes the item from the list and returns the data from the item. If
// this is the current item, the current item will equal the next item in the
// list.
//
ALvoid* alListRemoveEntry
(
IN ALlist* pList,
IN ALlistEntry* pEntry
);
//*****************************************************************************
// alListRemoveHead
//*****************************************************************************
// Removes the list entry at the head of the list. If this is the current
// item, the current item will equal the next item in the list.
//
ALlistEntry* alListRemoveHead
(
IN ALlist* pList
);
//*****************************************************************************
// alListRemoveTail
//*****************************************************************************
// Removes the list entry at the tail of the list. If this is the current
// item, the current item will be null.
//
ALlistEntry* alListRemoveTail
(
IN ALlist* pList
);
#ifdef __cplusplus
}
#endif
#endif
-2332
View File
File diff suppressed because it is too large Load Diff
-15
View File
@@ -1,15 +0,0 @@
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by openal32.rc
//
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 101
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
-647
View File
@@ -1,647 +0,0 @@
#include <al.h>
#include <alc.h>
#include <stdio.h>
#include <conio.h>
#include <string.h>
#include <windows.h>
#include <mmsystem.h>
int main(int argc, char* argv[])
{
const ALchar *szNames = NULL;
long lErrorCount = 0;
///////////////////////////////////////////////////////////////////
// TEST : Enumerate the playback devices
//
printf("--------------------------------------\n");
printf("TESTING ALC_ENUMERATION_EXT EXTENSION\n\n");
if (alcIsExtensionPresent(NULL, "ALC_ENUMERATION_EXT") == AL_TRUE)
{
printf("ALC_ENUMERATION_EXT Device List:-\n\n");
szNames = alcGetString(NULL, ALC_DEVICE_SPECIFIER);
if (strlen(szNames) == 0)
printf("NO DEVICES FOUND\n");
else
{
while (szNames && *szNames)
{
printf("%s ", szNames);
// Try opening each device
ALCdevice *pDevice = alcOpenDevice(szNames);
if (pDevice)
{
printf("- Opened Successfully\n");
alcCloseDevice(pDevice);
}
else
{
printf("- FAILED to open\n");
lErrorCount++;
}
szNames += (strlen(szNames) + 1);
}
}
}
else
{
printf("!!!ERROR!!! : ALC_ENUMERATION_EXT NOT FOUND!\n");
lErrorCount++;
}
printf("--------------------------------------\n\n");
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
// TEST : Get Default Playback Device
//
printf("--------------------------------------\n");
printf("TESTING GET DEFAULT PLAYBACK DEVICE\n\n");
szNames = alcGetString(NULL, ALC_DEFAULT_DEVICE_SPECIFIER);
if (szNames && strlen(szNames))
{
printf("\nDEFAULT DEVICE is %s\n", szNames);
}
else
{
if (waveOutGetNumDevs())
{
printf("\n!!!ERROR!!! DEFAULT DEVICE NOT FOUND!\n");
lErrorCount++;
}
else
{
printf("\nDEFAULT DEVICE NOT FOUND!\n");
}
}
printf("--------------------------------------\n\n");
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
// TEST : Enumerate all the capture devices
//
printf("--------------------------------------\n");
printf("TESTING CAPTURE ENUMERATION EXTENSION\n\n");
if (alcIsExtensionPresent(NULL, "ALC_ENUMERATION_EXT") == AL_TRUE)
{
printf("ALC_ENUMERATION_EXT Capture Device List:-\n\n");
szNames = alcGetString(NULL, ALC_CAPTURE_DEVICE_SPECIFIER);
if (strlen(szNames) == 0)
printf("NO DEVICES FOUND\n");
else
{
while (szNames && *szNames)
{
printf("%s ", szNames);
// Try opening each device
ALCdevice *pDevice = alcCaptureOpenDevice(szNames, 11025, AL_FORMAT_STEREO16, 8192);
if (pDevice)
{
printf("- Opened Successfully\n");
alcCaptureCloseDevice(pDevice);
}
else
{
printf("- FAILED to open\n");
lErrorCount++;
}
szNames += (strlen(szNames) + 1);
}
}
}
else
{
printf("!!!ERROR!!! : ALC_ENUMERATION_EXT NOT FOUND!\n");
lErrorCount++;
}
printf("--------------------------------------\n\n");
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
// TEST : Get Default Capture Device
//
printf("--------------------------------------\n");
printf("TESTING DEFAULT CAPTURE DEVICE\n\n");
szNames = alcGetString(NULL, ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER);
if (szNames && strlen(szNames))
{
printf("\nDEFAULT CAPTURE DEVICE IS %s\n", szNames);
}
else
{
if (waveInGetNumDevs())
{
printf("\n!!!ERROR!!! DEFAULT CAPTURE DEVICE NOT FOUND!\n");
lErrorCount++;
}
else
{
printf("\nDEFAULT CAPTURE DEVICE NOT FOUND!\n");
}
}
printf("--------------------------------------\n\n");
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
// TEST : Enumerate *all* the playback devices
//
printf("--------------------------------------\n");
printf("TESTING PLAYBACK ENUMERATE ALL EXTENSION\n\n");
if (alcIsExtensionPresent(NULL, "ALC_ENUMERATE_ALL_EXT") == AL_TRUE)
{
printf("ALC_ENUMERATE_ALL_EXT DEVICE LIST:-\n\n");
szNames = alcGetString(NULL, ALC_ALL_DEVICES_SPECIFIER);
if (strlen(szNames) == 0)
printf("NO DEVICES FOUND\n");
else
{
while (szNames && *szNames)
{
printf("%s ", szNames);
// Try opening each device
ALCdevice *pDevice = alcOpenDevice(szNames);
if (pDevice)
{
printf("- Opened Successfully\n");
alcCloseDevice(pDevice);
}
else
{
printf("- FAILED to open\n");
lErrorCount++;
}
szNames += (strlen(szNames) + 1);
}
}
}
else
{
printf("!!!ERROR!!! : ALC_ENUMERATE_ALL_EXT NOT FOUND!\n");
lErrorCount++;
}
printf("--------------------------------------\n\n");
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
// TEST : Get Default *All* Playback Device
//
printf("--------------------------------------\n");
printf("TESTING DEFAULT ALL PLAYBACK DEVICE\n\n");
szNames = alcGetString(NULL, ALC_DEFAULT_ALL_DEVICES_SPECIFIER);
if (szNames && strlen(szNames))
{
printf("\nDEFAULT ALL DEVICES IS %s\n", szNames);
}
else
{
if (waveOutGetNumDevs())
{
printf("\n!!!ERROR!!! DEFAULT ALL DEVICE NOT FOUND!\n");
lErrorCount++;
}
else
{
printf("\nDEFAULT ALL DEVICES NOT FOUND!\n");
}
}
printf("--------------------------------------\n\n");
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
// TEST : Open 'Generic Hardware' device
//
printf("--------------------------------------\n");
printf("TESTING 'Generic Hardware' DEVICE\n\n");
ALCdevice *pDevice = alcOpenDevice("Generic Hardware");
if (pDevice)
{
printf("OPENED 'Generic Hardware' DEVICE ... GOT %s\n", alcGetString(pDevice, ALC_DEVICE_SPECIFIER));
alcCloseDevice(pDevice);
}
else
{
if (waveOutGetNumDevs())
{
printf("!!!ERROR!!! : FAILED TO OPEN 'Generic Hardware' DEVICE\n");
lErrorCount++;
}
else
{
printf("FAILED TO OPEN 'Generic Hardware' DEVICE\n");
}
}
printf("--------------------------------------\n\n");
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
// TEST : Open 'Generic Software' device
//
printf("--------------------------------------\n");
printf("TESTING 'Generic Software' DEVICE\n\n");
pDevice = alcOpenDevice("Generic Software");
if (pDevice)
{
printf("OPENED 'Generic Software' DEVICE ... GOT %s\n", alcGetString(pDevice, ALC_DEVICE_SPECIFIER));
alcCloseDevice(pDevice);
}
else
{
if (waveOutGetNumDevs())
{
printf("!!!ERROR!!! : FAILED TO OPEN 'Generic Software' DEVICE\n");
lErrorCount++;
}
else
{
printf("FAILED TO OPEN 'Generic Software' DEVICE\n");
}
}
printf("--------------------------------------\n\n");
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
// TEST : Open legacy 'DirectSound3D' device
//
printf("--------------------------------------\n");
printf("TESTING LEGACY 'DirectSound3D' DEVICE\n\n");
pDevice = alcOpenDevice("DirectSound3D");
if (pDevice)
{
printf("OPENED 'DirectSound3D' DEVICE ... GOT %s\n", alcGetString(pDevice, ALC_DEVICE_SPECIFIER));
alcCloseDevice(pDevice);
}
else
{
if (waveOutGetNumDevs())
{
printf("!!!ERROR!!! : FAILED TO OPEN 'DirectSound3D' DEVICE\n");
lErrorCount++;
}
else
{
printf("FAILED TO OPEN 'DirectSound3D' DEVICE\n");
}
}
printf("--------------------------------------\n\n");
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
// TEST : Open legacy 'DirectSound' device
//
printf("--------------------------------------\n");
printf("TESTING LEGACY 'DirectSound' DEVICE\n\n");
pDevice = alcOpenDevice("DirectSound");
if (pDevice)
{
printf("OPENED 'DirectSound' DEVICE ... GOT %s\n", alcGetString(pDevice, ALC_DEVICE_SPECIFIER));
alcCloseDevice(pDevice);
}
else
{
if (waveOutGetNumDevs())
{
printf("!!!ERROR!!! : FAILED TO OPEN 'DirectSound' DEVICE\n");
lErrorCount++;
}
else
{
printf("FAILED TO OPEN 'DirectSound' DEVICE\n");
}
}
printf("--------------------------------------\n\n");
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
// TEST : Open legacy 'MMSYSTEM' device
//
printf("--------------------------------------\n");
printf("TESTING LEGACY 'MMSYSTEM' DEVICE\n\n");
pDevice = alcOpenDevice("MMSYSTEM");
if (pDevice)
{
printf("OPENED 'MMSYSTEM' DEVICE ... GOT %s\n", alcGetString(pDevice, ALC_DEVICE_SPECIFIER));
alcCloseDevice(pDevice);
}
else
{
if (waveOutGetNumDevs())
{
printf("!!!ERROR!!! : FAILED TO OPEN 'MMSYSTEM' DEVICE\n");
lErrorCount++;
}
else
{
printf("FAILED TO OPEN 'MMSYSTEM' DEVICE\n");
}
}
printf("--------------------------------------\n\n");
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
// TEST : Open NULL device
//
printf("--------------------------------------\n");
printf("TESTING NULL DEVICE\n\n");
pDevice = alcOpenDevice(NULL);
if (pDevice)
{
printf("OPENED NULL DEVICE ... GOT %s\n", alcGetString(pDevice, ALC_DEVICE_SPECIFIER));
alcCloseDevice(pDevice);
}
else
{
if (waveOutGetNumDevs())
{
printf("!!!ERROR!!! : FAILED TO OPEN NULL DEVICE\n");
lErrorCount++;
}
else
{
printf("FAILED TO OPEN NULL DEVICE\n");
}
}
printf("--------------------------------------\n\n");
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
// TEST : Open "" device
//
printf("--------------------------------------\n");
printf("TESTING EMPTY DEVICE\n\n");
pDevice = alcOpenDevice("");
if (pDevice)
{
printf("OPENED \"\" DEVICE ... GOT %s\n", alcGetString(pDevice, ALC_DEVICE_SPECIFIER));
alcCloseDevice(pDevice);
}
else
{
if (waveOutGetNumDevs())
{
printf("!!!ERROR!!! : FAILED TO OPEN EMPTY DEVICE\n");
lErrorCount++;
}
else
{
printf("FAILED TO OPEN EMPTY DEVICE\n");
}
}
printf("--------------------------------------\n\n");
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
// TEST : Open "A Random Name" device
//
printf("--------------------------------------\n");
printf("TESTING 'A Random Name' DEVICE\n\n");
pDevice = alcOpenDevice("A Random Name");
if (pDevice)
{
printf("!!!ERROR!!! : OPENED 'A Random Name' DEVICE ... GOT %s\n", alcGetString(pDevice, ALC_DEVICE_SPECIFIER));
lErrorCount++;
alcCloseDevice(pDevice);
}
else
{
printf("FAILED TO OPEN 'A Random Name' DEVICE\n");
}
printf("--------------------------------------\n\n");
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
// TEST : Open NULL Capture device
//
printf("--------------------------------------\n");
printf("TESTING NULL CAPTURE DEVICE\n\n");
pDevice = alcCaptureOpenDevice(NULL, 22500, AL_FORMAT_MONO16, 4096);
if (pDevice)
{
printf("OPENED NULL CAPTURE DEVICE ... GOT %s\n", alcGetString(pDevice, ALC_CAPTURE_DEVICE_SPECIFIER));
alcCaptureCloseDevice(pDevice);
}
else
{
if (waveInGetNumDevs())
{
printf("!!!ERROR!!! : FAILED TO OPEN NULL CAPTURE DEVICE\n");
lErrorCount++;
}
else
{
printf("FAILED TO OPEN NULL CAPTURE DEVICE\n");
}
}
printf("--------------------------------------\n\n");
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
// TEST : Open "" capture device
//
printf("--------------------------------------\n");
printf("TESTING EMPTY CAPTURE DEVICE\n\n");
pDevice = alcCaptureOpenDevice("", 22500, AL_FORMAT_MONO16, 4096);
if (pDevice)
{
printf("OPENED \"\" CAPTURE DEVICE ... GOT %s\n", alcGetString(pDevice, ALC_CAPTURE_DEVICE_SPECIFIER));
alcCaptureCloseDevice(pDevice);
}
else
{
if (waveInGetNumDevs())
{
printf("!!!ERROR!!! : FAILED TO OPEN EMPTY CAPTURE DEVICE\n");
lErrorCount++;
}
else
{
printf("FAILED TO OPEN EMPTY CAPTURE DEVICE\n");
}
}
printf("--------------------------------------\n\n");
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
// TEST : Open "A Random Name" capture device
//
printf("--------------------------------------\n");
printf("TESTING 'A Random Name' CAPTURE DEVICE\n\n");
pDevice = alcCaptureOpenDevice("A Random Name", 22500, AL_FORMAT_MONO16, 4096);
if (pDevice)
{
printf("!!!ERROR!!! : OPENED 'A Random Name' CAPTURE DEVICE ... GOT %s\n", alcGetString(pDevice, ALC_CAPTURE_DEVICE_SPECIFIER));
lErrorCount++;
alcCaptureCloseDevice(pDevice);
}
else
{
printf("FAILED TO OPEN 'A Random Name' CAPTURE DEVICE\n");
}
printf("--------------------------------------\n\n");
///////////////////////////////////////////////////////////////////
printf("\nFOUND %d ERRORS\n", lErrorCount);
printf("\nPress a key to quit\n");
char ch = _getch();
return 0;
}
/*
ALboolean InitOpenAL(ALCdevice **ppDevice, ALCcontext **ppContext)
{
ALchar szDeviceNames[10][1024];
ALchar *szNames;
ALint lNumDevices;
ALint lLoop;
ALint lLength;
ALbyte ch;
ALboolean bInit;
bInit = AL_FALSE;
memset(szDeviceNames, 0, sizeof(ALchar) * 10 * 1024);
lNumDevices = 0;
if (!szNames)
{
szNames = (char *)alcGetString(NULL, ALC_DEFAULT_DEVICE_SPECIFIER);
if (szNames && *szNames && (strlen(szNames) < 1024))
strcpy(szDeviceNames[lNumDevices++], szNames);
}
for (lLoop = 0; lLoop < lNumDevices; lLoop++)
printf("Press %d for '%s' Device\n", lLoop+1, szDeviceNames[lLoop]);
printf("Press Q to quit\n");
do
{
ch = _getch();
if (ch == 'q' || ch == 'Q')
exit(0);
else if ((ch >= '1') && (ch < ('1' + lNumDevices)))
break;
} while (1);
*ppDevice = alcOpenDevice(szDeviceNames[ch - '1']);
if (*ppDevice)
{
*ppContext = alcCreateContext(*ppDevice,NULL);
if (*ppContext)
{
alcGetError(*ppDevice);
alcMakeContextCurrent(*ppContext);
if (alcGetError(*ppDevice) == ALC_NO_ERROR)
bInit = AL_TRUE;
}
else
{
alcCloseDevice(*ppDevice);
}
}
return bInit;
}
ALboolean InitOpenALEx(ALCdevice **ppDevice, ALCcontext **ppContext)
{
ALchar szDeviceNames[32][1024];
const ALchar *szNames;
const ALchar *szDefaultName = NULL;
const ALchar *szDefaultAllName = NULL;
ALint lNumDevices = 0;
ALint lLoop;
ALint lLength;
ALbyte ch;
ALboolean bInit;
bInit = AL_FALSE;
memset(szDeviceNames, 0, sizeof(ALchar) * 32 * 1024);
// Get legacy enumeration list and Default Device
if (alcIsExtensionPresent(NULL, "ALC_ENUMERATION_EXT") == AL_TRUE)
{
szNames = alcGetString(NULL, ALC_DEVICE_SPECIFIER);
while (szNames && *szNames)
{
if ((lLength = strlen(szNames)) < 1024)
strcpy(szDeviceNames[lNumDevices++], szNames);
szNames += lLength + 1;
}
szDefaultName = alcGetString(NULL, ALC_DEFAULT_DEVICE_SPECIFIER);
}
// Get new uber enumeration list and Default Device
if (alcIsExtensionPresent(NULL, "ALC_ENUMERATE_ALL_EXT") == AL_TRUE)
{
szNames = alcGetString(NULL, alcGetEnumValue(NULL, "ALC_ALL_DEVICES_SPECIFIER"));
while (szNames && *szNames)
{
if ((lLength = strlen(szNames)) < 1024)
strcpy(szDeviceNames[lNumDevices++], szNames);
szNames += lLength + 1;
}
szDefaultAllName = alcGetString(NULL, alcGetEnumValue(NULL, "ALC_DEFAULT_ALL_DEVICES_SPECIFIER"));
}
for (lLoop = 0; lLoop < lNumDevices; lLoop++)
printf("Press %d for '%s' Device %s\n", lLoop+1, szDeviceNames[lLoop],
(strcmp(szDeviceNames[lLoop], szDefaultName?szDefaultName:"") == 0) ? "*" : (strcmp(szDeviceNames[lLoop], szDefaultAllName?szDefaultAllName:"") == 0) ? "**" : "");
printf("Press Q to quit\n");
do
{
ch = _getch();
if (ch == 'q' || ch == 'Q')
exit(0);
else if ((ch >= '1') && (ch < ('1' + lNumDevices)))
break;
} while (1);
*ppDevice = alcOpenDevice(szDeviceNames[ch - '1']);
if (*ppDevice)
{
*ppContext = alcCreateContext(*ppDevice,NULL);
if (*ppContext)
{
alcGetError(*ppDevice);
alcMakeContextCurrent(*ppContext);
if (alcGetError(*ppDevice) == ALC_NO_ERROR)
bInit = AL_TRUE;
}
else
{
alcCloseDevice(*ppDevice);
}
}
return bInit;
}
*/