Permalink
Browse files

Initial Open Source Release

  • Loading branch information...
0 parents commit bdd66bd8114dccb53cd1b980c250391d8e07fad9 Frictional Games committed May 12, 2010
Showing with 8,295 additions and 0 deletions.
  1. +5 −0 .gitignore
  2. +12 −0 CMakeLists.txt
  3. +23 −0 LICENSE
  4. +398 −0 OALWrapper.xcodeproj/project.pbxproj
  5. +5 −0 TODO
  6. +86 −0 include/OpenAL/OAL_AudioData.h
  7. +47 −0 include/OpenAL/OAL_Buffer.h
  8. +120 −0 include/OpenAL/OAL_Device.h
  9. +75 −0 include/OpenAL/OAL_EFX.h
  10. +91 −0 include/OpenAL/OAL_EFXManager.h
  11. +49 −0 include/OpenAL/OAL_Effect.h
  12. +64 −0 include/OpenAL/OAL_EffectSlot.h
  13. +148 −0 include/OpenAL/OAL_Effect_Reverb.h
  14. +48 −0 include/OpenAL/OAL_Filter.h
  15. +59 −0 include/OpenAL/OAL_Funcs.h
  16. +78 −0 include/OpenAL/OAL_Helper.h
  17. +85 −0 include/OpenAL/OAL_Init.h
  18. +37 −0 include/OpenAL/OAL_Loaders.h
  19. +73 −0 include/OpenAL/OAL_LoggerObject.h
  20. +58 −0 include/OpenAL/OAL_LowLevelObject.h
  21. +11 −0 include/OpenAL/OAL_OggHelper.h
  22. +33 −0 include/OpenAL/OAL_OggSample.h
  23. +51 −0 include/OpenAL/OAL_OggStream.h
  24. +71 −0 include/OpenAL/OAL_Playback.h
  25. +55 −0 include/OpenAL/OAL_Sample.h
  26. +197 −0 include/OpenAL/OAL_Source.h
  27. +67 −0 include/OpenAL/OAL_SourceManager.h
  28. +68 −0 include/OpenAL/OAL_Stream.h
  29. +198 −0 include/OpenAL/OAL_Types.h
  30. +33 −0 include/OpenAL/OAL_WAVSample.h
  31. +73 −0 sources/OpenAL/OAL_AudioData.cpp
  32. +124 −0 sources/OpenAL/OAL_Buffer.cpp
  33. +637 −0 sources/OpenAL/OAL_Device.cpp
  34. +451 −0 sources/OpenAL/OAL_EFX.cpp
  35. +397 −0 sources/OpenAL/OAL_EFXManager.cpp
  36. +68 −0 sources/OpenAL/OAL_Effect.cpp
  37. +130 −0 sources/OpenAL/OAL_EffectSlot.cpp
  38. +573 −0 sources/OpenAL/OAL_Effect_Reverb.cpp
  39. +176 −0 sources/OpenAL/OAL_Filter.cpp
  40. +186 −0 sources/OpenAL/OAL_Helper.cpp
  41. +341 −0 sources/OpenAL/OAL_Init.cpp
  42. +149 −0 sources/OpenAL/OAL_Loaders.cpp
  43. +161 −0 sources/OpenAL/OAL_LoggerObject.cpp
  44. +28 −0 sources/OpenAL/OAL_OggHelper.cpp
  45. +120 −0 sources/OpenAL/OAL_OggSample.cpp
  46. +200 −0 sources/OpenAL/OAL_OggStream.cpp
  47. +452 −0 sources/OpenAL/OAL_Playback.cpp
  48. +120 −0 sources/OpenAL/OAL_Sample.cpp
  49. +924 −0 sources/OpenAL/OAL_Source.cpp
  50. +357 −0 sources/OpenAL/OAL_SourceManager.cpp
  51. +180 −0 sources/OpenAL/OAL_Stream.cpp
  52. +7 −0 sources/OpenAL/OAL_Types.cpp
  53. +96 −0 sources/OpenAL/OAL_WAVSample.cpp
5 .gitignore
@@ -0,0 +1,5 @@
+/build
+*~
+.DS_Store
+/*.xcodeproj/*.mode1v3
+/*.xcodeproj/*.pbxuser
12 CMakeLists.txt
@@ -0,0 +1,12 @@
+cmake_minimum_required (VERSION 2.6)
+project (OALWrapper)
+
+set(OALWrapper_VERSION_MAJOR 1)
+set(OALWrapper_VERSION_MINOR 0)
+
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/../dependencies/include)
+file(GLOB_RECURSE all_sources
+ ${CMAKE_CURRENT_SOURCE_DIR}/sources/OpenAL/*.cpp
+
+add_library(OALWrapper STATIC ${all_sources})
+
23 LICENSE
@@ -0,0 +1,23 @@
+OALWrapper - a C++ Wrapper around OpenAL and ALUT
+
+Copyright (C) 2007-2010 - Frictional Games
+
+This software is provided 'as-is', without any express or implied
+warranty. In no event will the authors be held liable for any damages
+arising from the use of this software.
+
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it
+freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+
+ 3. This notice may not be removed or altered from any source
+ distribution.
+
398 OALWrapper.xcodeproj/project.pbxproj
@@ -0,0 +1,398 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 45;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ DBF9A2DC119A602200CCFDC9 /* OAL_AudioData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DBF9A2BE119A5FFC00CCFDC9 /* OAL_AudioData.cpp */; };
+ DBF9A2DD119A602300CCFDC9 /* OAL_Buffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DBF9A2BF119A5FFC00CCFDC9 /* OAL_Buffer.cpp */; };
+ DBF9A2DE119A602300CCFDC9 /* OAL_Device.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DBF9A2C0119A5FFC00CCFDC9 /* OAL_Device.cpp */; };
+ DBF9A2DF119A602400CCFDC9 /* OAL_Effect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DBF9A2C1119A5FFC00CCFDC9 /* OAL_Effect.cpp */; };
+ DBF9A2E0119A602500CCFDC9 /* OAL_Effect_Reverb.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DBF9A2C2119A5FFC00CCFDC9 /* OAL_Effect_Reverb.cpp */; };
+ DBF9A2E1119A602500CCFDC9 /* OAL_EffectSlot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DBF9A2C3119A5FFC00CCFDC9 /* OAL_EffectSlot.cpp */; };
+ DBF9A2E2119A602600CCFDC9 /* OAL_EFX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DBF9A2C4119A5FFC00CCFDC9 /* OAL_EFX.cpp */; };
+ DBF9A2E3119A602600CCFDC9 /* OAL_EFXManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DBF9A2C5119A5FFC00CCFDC9 /* OAL_EFXManager.cpp */; };
+ DBF9A2E4119A602700CCFDC9 /* OAL_Helper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DBF9A2C7119A5FFC00CCFDC9 /* OAL_Helper.cpp */; };
+ DBF9A2E5119A602700CCFDC9 /* OAL_Init.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DBF9A2C8119A5FFC00CCFDC9 /* OAL_Init.cpp */; };
+ DBF9A2E6119A602800CCFDC9 /* OAL_Filter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DBF9A2C6119A5FFC00CCFDC9 /* OAL_Filter.cpp */; };
+ DBF9A2E7119A602A00CCFDC9 /* OAL_Loaders.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DBF9A2C9119A5FFC00CCFDC9 /* OAL_Loaders.cpp */; };
+ DBF9A2E8119A602A00CCFDC9 /* OAL_LoggerObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DBF9A2CA119A5FFC00CCFDC9 /* OAL_LoggerObject.cpp */; };
+ DBF9A2E9119A602B00CCFDC9 /* OAL_OggHelper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DBF9A2CB119A5FFC00CCFDC9 /* OAL_OggHelper.cpp */; };
+ DBF9A2EA119A602B00CCFDC9 /* OAL_OggSample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DBF9A2CC119A5FFC00CCFDC9 /* OAL_OggSample.cpp */; };
+ DBF9A2EB119A602C00CCFDC9 /* OAL_OggStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DBF9A2CD119A5FFC00CCFDC9 /* OAL_OggStream.cpp */; };
+ DBF9A2EC119A602C00CCFDC9 /* OAL_Playback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DBF9A2CE119A5FFC00CCFDC9 /* OAL_Playback.cpp */; };
+ DBF9A2ED119A602D00CCFDC9 /* OAL_Sample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DBF9A2CF119A5FFC00CCFDC9 /* OAL_Sample.cpp */; };
+ DBF9A2EE119A602D00CCFDC9 /* OAL_Source.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DBF9A2D0119A5FFC00CCFDC9 /* OAL_Source.cpp */; };
+ DBF9A2EF119A602E00CCFDC9 /* OAL_SourceManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DBF9A2D1119A5FFC00CCFDC9 /* OAL_SourceManager.cpp */; };
+ DBF9A2F0119A602F00CCFDC9 /* OAL_Stream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DBF9A2D2119A5FFC00CCFDC9 /* OAL_Stream.cpp */; };
+ DBF9A2F1119A602F00CCFDC9 /* OAL_Types.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DBF9A2D3119A5FFC00CCFDC9 /* OAL_Types.cpp */; };
+ DBF9A2F2119A603000CCFDC9 /* OAL_WAVSample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DBF9A2D4119A5FFC00CCFDC9 /* OAL_WAVSample.cpp */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+ DBF9A2A3119A5FFC00CCFDC9 /* OAL_AudioData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OAL_AudioData.h; sourceTree = "<group>"; };
+ DBF9A2A4119A5FFC00CCFDC9 /* OAL_Buffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OAL_Buffer.h; sourceTree = "<group>"; };
+ DBF9A2A5119A5FFC00CCFDC9 /* OAL_Device.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OAL_Device.h; sourceTree = "<group>"; };
+ DBF9A2A6119A5FFC00CCFDC9 /* OAL_Effect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OAL_Effect.h; sourceTree = "<group>"; };
+ DBF9A2A7119A5FFC00CCFDC9 /* OAL_Effect_Reverb.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OAL_Effect_Reverb.h; sourceTree = "<group>"; };
+ DBF9A2A8119A5FFC00CCFDC9 /* OAL_EffectSlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OAL_EffectSlot.h; sourceTree = "<group>"; };
+ DBF9A2A9119A5FFC00CCFDC9 /* OAL_EFX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OAL_EFX.h; sourceTree = "<group>"; };
+ DBF9A2AA119A5FFC00CCFDC9 /* OAL_EFXManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OAL_EFXManager.h; sourceTree = "<group>"; };
+ DBF9A2AB119A5FFC00CCFDC9 /* OAL_Filter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OAL_Filter.h; sourceTree = "<group>"; };
+ DBF9A2AC119A5FFC00CCFDC9 /* OAL_Funcs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OAL_Funcs.h; sourceTree = "<group>"; };
+ DBF9A2AD119A5FFC00CCFDC9 /* OAL_Helper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OAL_Helper.h; sourceTree = "<group>"; };
+ DBF9A2AE119A5FFC00CCFDC9 /* OAL_Init.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OAL_Init.h; sourceTree = "<group>"; };
+ DBF9A2AF119A5FFC00CCFDC9 /* OAL_Loaders.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OAL_Loaders.h; sourceTree = "<group>"; };
+ DBF9A2B0119A5FFC00CCFDC9 /* OAL_LoggerObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OAL_LoggerObject.h; sourceTree = "<group>"; };
+ DBF9A2B1119A5FFC00CCFDC9 /* OAL_LowLevelObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OAL_LowLevelObject.h; sourceTree = "<group>"; };
+ DBF9A2B2119A5FFC00CCFDC9 /* OAL_OggHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OAL_OggHelper.h; sourceTree = "<group>"; };
+ DBF9A2B3119A5FFC00CCFDC9 /* OAL_OggSample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OAL_OggSample.h; sourceTree = "<group>"; };
+ DBF9A2B4119A5FFC00CCFDC9 /* OAL_OggStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OAL_OggStream.h; sourceTree = "<group>"; };
+ DBF9A2B5119A5FFC00CCFDC9 /* OAL_Playback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OAL_Playback.h; sourceTree = "<group>"; };
+ DBF9A2B6119A5FFC00CCFDC9 /* OAL_Sample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OAL_Sample.h; sourceTree = "<group>"; };
+ DBF9A2B7119A5FFC00CCFDC9 /* OAL_Source.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OAL_Source.h; sourceTree = "<group>"; };
+ DBF9A2B8119A5FFC00CCFDC9 /* OAL_SourceManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OAL_SourceManager.h; sourceTree = "<group>"; };
+ DBF9A2B9119A5FFC00CCFDC9 /* OAL_Stream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OAL_Stream.h; sourceTree = "<group>"; };
+ DBF9A2BA119A5FFC00CCFDC9 /* OAL_Types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OAL_Types.h; sourceTree = "<group>"; };
+ DBF9A2BB119A5FFC00CCFDC9 /* OAL_WAVSample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OAL_WAVSample.h; sourceTree = "<group>"; };
+ DBF9A2BE119A5FFC00CCFDC9 /* OAL_AudioData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OAL_AudioData.cpp; sourceTree = "<group>"; };
+ DBF9A2BF119A5FFC00CCFDC9 /* OAL_Buffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OAL_Buffer.cpp; sourceTree = "<group>"; };
+ DBF9A2C0119A5FFC00CCFDC9 /* OAL_Device.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OAL_Device.cpp; sourceTree = "<group>"; };
+ DBF9A2C1119A5FFC00CCFDC9 /* OAL_Effect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OAL_Effect.cpp; sourceTree = "<group>"; };
+ DBF9A2C2119A5FFC00CCFDC9 /* OAL_Effect_Reverb.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OAL_Effect_Reverb.cpp; sourceTree = "<group>"; };
+ DBF9A2C3119A5FFC00CCFDC9 /* OAL_EffectSlot.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OAL_EffectSlot.cpp; sourceTree = "<group>"; };
+ DBF9A2C4119A5FFC00CCFDC9 /* OAL_EFX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OAL_EFX.cpp; sourceTree = "<group>"; };
+ DBF9A2C5119A5FFC00CCFDC9 /* OAL_EFXManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OAL_EFXManager.cpp; sourceTree = "<group>"; };
+ DBF9A2C6119A5FFC00CCFDC9 /* OAL_Filter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OAL_Filter.cpp; sourceTree = "<group>"; };
+ DBF9A2C7119A5FFC00CCFDC9 /* OAL_Helper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OAL_Helper.cpp; sourceTree = "<group>"; };
+ DBF9A2C8119A5FFC00CCFDC9 /* OAL_Init.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OAL_Init.cpp; sourceTree = "<group>"; };
+ DBF9A2C9119A5FFC00CCFDC9 /* OAL_Loaders.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OAL_Loaders.cpp; sourceTree = "<group>"; };
+ DBF9A2CA119A5FFC00CCFDC9 /* OAL_LoggerObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OAL_LoggerObject.cpp; sourceTree = "<group>"; };
+ DBF9A2CB119A5FFC00CCFDC9 /* OAL_OggHelper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OAL_OggHelper.cpp; sourceTree = "<group>"; };
+ DBF9A2CC119A5FFC00CCFDC9 /* OAL_OggSample.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OAL_OggSample.cpp; sourceTree = "<group>"; };
+ DBF9A2CD119A5FFC00CCFDC9 /* OAL_OggStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OAL_OggStream.cpp; sourceTree = "<group>"; };
+ DBF9A2CE119A5FFC00CCFDC9 /* OAL_Playback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OAL_Playback.cpp; sourceTree = "<group>"; };
+ DBF9A2CF119A5FFC00CCFDC9 /* OAL_Sample.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OAL_Sample.cpp; sourceTree = "<group>"; };
+ DBF9A2D0119A5FFC00CCFDC9 /* OAL_Source.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OAL_Source.cpp; sourceTree = "<group>"; };
+ DBF9A2D1119A5FFC00CCFDC9 /* OAL_SourceManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OAL_SourceManager.cpp; sourceTree = "<group>"; };
+ DBF9A2D2119A5FFC00CCFDC9 /* OAL_Stream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OAL_Stream.cpp; sourceTree = "<group>"; };
+ DBF9A2D3119A5FFC00CCFDC9 /* OAL_Types.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OAL_Types.cpp; sourceTree = "<group>"; };
+ DBF9A2D4119A5FFC00CCFDC9 /* OAL_WAVSample.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OAL_WAVSample.cpp; sourceTree = "<group>"; };
+ DBF9A2D9119A601600CCFDC9 /* libOALWrapper.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libOALWrapper.a; sourceTree = BUILT_PRODUCTS_DIR; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ DBF9A2D7119A601600CCFDC9 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ DBF848380AC76CC500BB15CD = {
+ isa = PBXGroup;
+ children = (
+ DBF9A2A1119A5FFC00CCFDC9 /* include */,
+ DBF9A2BC119A5FFC00CCFDC9 /* sources */,
+ DBF8484C0AC76D1A00BB15CD /* Products */,
+ );
+ sourceTree = "<group>";
+ };
+ DBF8484C0AC76D1A00BB15CD /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ DBF9A2D9119A601600CCFDC9 /* libOALWrapper.a */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ DBF9A2A1119A5FFC00CCFDC9 /* include */ = {
+ isa = PBXGroup;
+ children = (
+ DBF9A2A2119A5FFC00CCFDC9 /* OpenAL */,
+ );
+ path = include;
+ sourceTree = "<group>";
+ };
+ DBF9A2A2119A5FFC00CCFDC9 /* OpenAL */ = {
+ isa = PBXGroup;
+ children = (
+ DBF9A2A3119A5FFC00CCFDC9 /* OAL_AudioData.h */,
+ DBF9A2A4119A5FFC00CCFDC9 /* OAL_Buffer.h */,
+ DBF9A2A5119A5FFC00CCFDC9 /* OAL_Device.h */,
+ DBF9A2A6119A5FFC00CCFDC9 /* OAL_Effect.h */,
+ DBF9A2A7119A5FFC00CCFDC9 /* OAL_Effect_Reverb.h */,
+ DBF9A2A8119A5FFC00CCFDC9 /* OAL_EffectSlot.h */,
+ DBF9A2A9119A5FFC00CCFDC9 /* OAL_EFX.h */,
+ DBF9A2AA119A5FFC00CCFDC9 /* OAL_EFXManager.h */,
+ DBF9A2AB119A5FFC00CCFDC9 /* OAL_Filter.h */,
+ DBF9A2AC119A5FFC00CCFDC9 /* OAL_Funcs.h */,
+ DBF9A2AD119A5FFC00CCFDC9 /* OAL_Helper.h */,
+ DBF9A2AE119A5FFC00CCFDC9 /* OAL_Init.h */,
+ DBF9A2AF119A5FFC00CCFDC9 /* OAL_Loaders.h */,
+ DBF9A2B0119A5FFC00CCFDC9 /* OAL_LoggerObject.h */,
+ DBF9A2B1119A5FFC00CCFDC9 /* OAL_LowLevelObject.h */,
+ DBF9A2B2119A5FFC00CCFDC9 /* OAL_OggHelper.h */,
+ DBF9A2B3119A5FFC00CCFDC9 /* OAL_OggSample.h */,
+ DBF9A2B4119A5FFC00CCFDC9 /* OAL_OggStream.h */,
+ DBF9A2B5119A5FFC00CCFDC9 /* OAL_Playback.h */,
+ DBF9A2B6119A5FFC00CCFDC9 /* OAL_Sample.h */,
+ DBF9A2B7119A5FFC00CCFDC9 /* OAL_Source.h */,
+ DBF9A2B8119A5FFC00CCFDC9 /* OAL_SourceManager.h */,
+ DBF9A2B9119A5FFC00CCFDC9 /* OAL_Stream.h */,
+ DBF9A2BA119A5FFC00CCFDC9 /* OAL_Types.h */,
+ DBF9A2BB119A5FFC00CCFDC9 /* OAL_WAVSample.h */,
+ );
+ path = OpenAL;
+ sourceTree = "<group>";
+ };
+ DBF9A2BC119A5FFC00CCFDC9 /* sources */ = {
+ isa = PBXGroup;
+ children = (
+ DBF9A2BD119A5FFC00CCFDC9 /* OpenAL */,
+ );
+ path = sources;
+ sourceTree = "<group>";
+ };
+ DBF9A2BD119A5FFC00CCFDC9 /* OpenAL */ = {
+ isa = PBXGroup;
+ children = (
+ DBF9A2BE119A5FFC00CCFDC9 /* OAL_AudioData.cpp */,
+ DBF9A2BF119A5FFC00CCFDC9 /* OAL_Buffer.cpp */,
+ DBF9A2C0119A5FFC00CCFDC9 /* OAL_Device.cpp */,
+ DBF9A2C1119A5FFC00CCFDC9 /* OAL_Effect.cpp */,
+ DBF9A2C2119A5FFC00CCFDC9 /* OAL_Effect_Reverb.cpp */,
+ DBF9A2C3119A5FFC00CCFDC9 /* OAL_EffectSlot.cpp */,
+ DBF9A2C4119A5FFC00CCFDC9 /* OAL_EFX.cpp */,
+ DBF9A2C5119A5FFC00CCFDC9 /* OAL_EFXManager.cpp */,
+ DBF9A2C6119A5FFC00CCFDC9 /* OAL_Filter.cpp */,
+ DBF9A2C7119A5FFC00CCFDC9 /* OAL_Helper.cpp */,
+ DBF9A2C8119A5FFC00CCFDC9 /* OAL_Init.cpp */,
+ DBF9A2C9119A5FFC00CCFDC9 /* OAL_Loaders.cpp */,
+ DBF9A2CA119A5FFC00CCFDC9 /* OAL_LoggerObject.cpp */,
+ DBF9A2CB119A5FFC00CCFDC9 /* OAL_OggHelper.cpp */,
+ DBF9A2CC119A5FFC00CCFDC9 /* OAL_OggSample.cpp */,
+ DBF9A2CD119A5FFC00CCFDC9 /* OAL_OggStream.cpp */,
+ DBF9A2CE119A5FFC00CCFDC9 /* OAL_Playback.cpp */,
+ DBF9A2CF119A5FFC00CCFDC9 /* OAL_Sample.cpp */,
+ DBF9A2D0119A5FFC00CCFDC9 /* OAL_Source.cpp */,
+ DBF9A2D1119A5FFC00CCFDC9 /* OAL_SourceManager.cpp */,
+ DBF9A2D2119A5FFC00CCFDC9 /* OAL_Stream.cpp */,
+ DBF9A2D3119A5FFC00CCFDC9 /* OAL_Types.cpp */,
+ DBF9A2D4119A5FFC00CCFDC9 /* OAL_WAVSample.cpp */,
+ );
+ path = OpenAL;
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXHeadersBuildPhase section */
+ DBF9A2D5119A601600CCFDC9 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXHeadersBuildPhase section */
+
+/* Begin PBXNativeTarget section */
+ DBF9A2D8119A601600CCFDC9 /* OALWrapper */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = DBF9A2F5119A604E00CCFDC9 /* Build configuration list for PBXNativeTarget "OALWrapper" */;
+ buildPhases = (
+ DBF9A2D5119A601600CCFDC9 /* Headers */,
+ DBF9A2D6119A601600CCFDC9 /* Sources */,
+ DBF9A2D7119A601600CCFDC9 /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = OALWrapper;
+ productName = OALWrapper;
+ productReference = DBF9A2D9119A601600CCFDC9 /* libOALWrapper.a */;
+ productType = "com.apple.product-type.library.static";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ DBF8483A0AC76CC500BB15CD /* Project object */ = {
+ isa = PBXProject;
+ buildConfigurationList = DBF8483B0AC76CC500BB15CD /* Build configuration list for PBXProject "OALWrapper" */;
+ compatibilityVersion = "Xcode 3.1";
+ hasScannedForEncodings = 0;
+ mainGroup = DBF848380AC76CC500BB15CD;
+ productRefGroup = DBF8484C0AC76D1A00BB15CD /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ DBF9A2D8119A601600CCFDC9 /* OALWrapper */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXSourcesBuildPhase section */
+ DBF9A2D6119A601600CCFDC9 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ DBF9A2DC119A602200CCFDC9 /* OAL_AudioData.cpp in Sources */,
+ DBF9A2DD119A602300CCFDC9 /* OAL_Buffer.cpp in Sources */,
+ DBF9A2DE119A602300CCFDC9 /* OAL_Device.cpp in Sources */,
+ DBF9A2DF119A602400CCFDC9 /* OAL_Effect.cpp in Sources */,
+ DBF9A2E0119A602500CCFDC9 /* OAL_Effect_Reverb.cpp in Sources */,
+ DBF9A2E1119A602500CCFDC9 /* OAL_EffectSlot.cpp in Sources */,
+ DBF9A2E2119A602600CCFDC9 /* OAL_EFX.cpp in Sources */,
+ DBF9A2E3119A602600CCFDC9 /* OAL_EFXManager.cpp in Sources */,
+ DBF9A2E4119A602700CCFDC9 /* OAL_Helper.cpp in Sources */,
+ DBF9A2E5119A602700CCFDC9 /* OAL_Init.cpp in Sources */,
+ DBF9A2E6119A602800CCFDC9 /* OAL_Filter.cpp in Sources */,
+ DBF9A2E7119A602A00CCFDC9 /* OAL_Loaders.cpp in Sources */,
+ DBF9A2E8119A602A00CCFDC9 /* OAL_LoggerObject.cpp in Sources */,
+ DBF9A2E9119A602B00CCFDC9 /* OAL_OggHelper.cpp in Sources */,
+ DBF9A2EA119A602B00CCFDC9 /* OAL_OggSample.cpp in Sources */,
+ DBF9A2EB119A602C00CCFDC9 /* OAL_OggStream.cpp in Sources */,
+ DBF9A2EC119A602C00CCFDC9 /* OAL_Playback.cpp in Sources */,
+ DBF9A2ED119A602D00CCFDC9 /* OAL_Sample.cpp in Sources */,
+ DBF9A2EE119A602D00CCFDC9 /* OAL_Source.cpp in Sources */,
+ DBF9A2EF119A602E00CCFDC9 /* OAL_SourceManager.cpp in Sources */,
+ DBF9A2F0119A602F00CCFDC9 /* OAL_Stream.cpp in Sources */,
+ DBF9A2F1119A602F00CCFDC9 /* OAL_Types.cpp in Sources */,
+ DBF9A2F2119A603000CCFDC9 /* OAL_WAVSample.cpp in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin XCBuildConfiguration section */
+ DBF8483C0AC76CC500BB15CD /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = i386;
+ COPY_PHASE_STRIP = NO;
+ GCC_MODEL_TUNING = G5;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ __MACOSX__,
+ AS_MAX_PORTABILITY,
+ );
+ GCC_VERSION = 4.0;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
+ GCC_WARN_MISSING_PARENTHESES = YES;
+ GCC_WARN_SIGN_COMPARE = YES;
+ GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VALUE = YES;
+ GCC_WARN_UNUSED_VARIABLE = NO;
+ PREBINDING = NO;
+ SDKROOT = macosx10.4;
+ SKIP_INSTALL = YES;
+ };
+ name = Debug;
+ };
+ DBF8483D0AC76CC500BB15CD /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = (
+ i386,
+ ppc,
+ );
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ GCC_MODEL_TUNING = G5;
+ GCC_OPTIMIZATION_LEVEL = 3;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ __MACOSX__,
+ AS_MAX_PORTABILITY,
+ );
+ GCC_VERSION = 4.0;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES;
+ GCC_WARN_MISSING_PARENTHESES = YES;
+ GCC_WARN_SIGN_COMPARE = YES;
+ GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VALUE = YES;
+ GCC_WARN_UNUSED_VARIABLE = NO;
+ PREBINDING = NO;
+ SDKROOT = macosx10.4;
+ SEPARATE_STRIP = YES;
+ SKIP_INSTALL = YES;
+ };
+ name = Release;
+ };
+ DBF9A2DA119A601700CCFDC9 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ COPY_PHASE_STRIP = NO;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = YES;
+ GCC_MODEL_TUNING = G5;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ HEADER_SEARCH_PATHS = (
+ ../dependencies/include,
+ include,
+ ../HPL1Engine/include,
+ );
+ INSTALL_PATH = /usr/local/lib;
+ PREBINDING = NO;
+ PRODUCT_NAME = OALWrapper;
+ };
+ name = Debug;
+ };
+ DBF9A2DB119A601700CCFDC9 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ COPY_PHASE_STRIP = YES;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ GCC_ENABLE_FIX_AND_CONTINUE = NO;
+ GCC_MODEL_TUNING = G5;
+ HEADER_SEARCH_PATHS = (
+ ../dependencies/include,
+ include,
+ ../HPL1Engine/include,
+ );
+ INSTALL_PATH = /usr/local/lib;
+ PREBINDING = NO;
+ PRODUCT_NAME = OALWrapper;
+ ZERO_LINK = NO;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ DBF8483B0AC76CC500BB15CD /* Build configuration list for PBXProject "OALWrapper" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ DBF8483C0AC76CC500BB15CD /* Debug */,
+ DBF8483D0AC76CC500BB15CD /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ DBF9A2F5119A604E00CCFDC9 /* Build configuration list for PBXNativeTarget "OALWrapper" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ DBF9A2DA119A601700CCFDC9 /* Debug */,
+ DBF9A2DB119A601700CCFDC9 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = DBF8483A0AC76CC500BB15CD /* Project object */;
+}
5 TODO
@@ -0,0 +1,5 @@
+* remove dependency on HPL1Engine core
+ - Memory wrappers
+ - String processing (cString class)
+* Update WAVE loading to not use old Deprecated OpenAL APIs
+* Use system include paths for OpenAL headers instead of dependencies bundle
86 include/OpenAL/OAL_AudioData.h
@@ -0,0 +1,86 @@
+/*
+ * Copyright 2007-2010 (C) - Frictional Games
+ *
+ * This file is part of OALWrapper
+ *
+ * For conditions of distribution and use, see copyright notice in LICENSE
+ */
+#ifndef _OAL_AUDIODATA_H
+#define _OAL_AUDIODATA_H
+
+#include "OAL_Types.h"
+
+//-------------------------------------------------------------------------------
+
+class cOAL_Buffer;
+class cOAL_Source;
+
+enum eOAL_AudioDataType
+{
+ eOAL_AudioDataType_None,
+ eOAL_AudioDataType_Sample,
+ eOAL_AudioDataType_Stream,
+};
+
+//-------------------------------------------------------------------------------
+
+class iOAL_AudioData
+{
+ friend class cOAL_Buffer;
+public:
+ iOAL_AudioData(eOAL_AudioDataType aType, int alBuffersToCreate);
+ virtual ~iOAL_AudioData();
+
+ virtual void Reset();
+ virtual bool CreateFromFile(const wstring& asFilename) = 0;
+ virtual void Destroy() = 0;
+
+ inline eOAL_AudioDataType GetType() { return mType; }
+ inline wstring& GetFilename() { return msFilename; }
+
+ inline ALint GetChannels() { return mlChannels; }
+ inline ALenum GetFormat() { return mFormat; }
+ inline ALint GetFrequency() { return mlFrequency; }
+ inline double GetTotalTime() { return mfTotalTime; }
+ inline bool GetStatus() { return mbStatus; }
+ int GetBytesPerSample();
+ virtual double GetProcessedBuffersTime()=0;
+
+ inline void SetLoop(bool abLoop) { mbLoop = abLoop; }
+
+ const tBufferVec& GetBuffers() { return mvBuffers; }
+ cOAL_Buffer* GetBufferByID(ALuint alID);
+ virtual ALuint* GetOALBufferPointer()=0;
+
+ virtual void Update() = 0;
+ virtual void AddBoundSource(cOAL_Source* apSource) = 0;
+ virtual void RemoveBoundSource(cOAL_Source* apSource) = 0;
+
+ inline int GetBuffersUsed() { return mlBuffersUsed; }
+
+ inline bool IsEOF() { return mbEOF; }
+ virtual bool HasBufferUnderrun()=0;
+
+ virtual bool NeedsRebuffering()=0;
+
+protected:
+ eOAL_AudioDataType mType;
+
+ tBufferVec mvBuffers;
+ int mlBuffersUsed;
+ long int mlSamples;
+ bool mbLoop;
+ bool mbEOF;
+ bool mbStatus;
+
+ double mfTotalTime;
+ ALint mlFrequency;
+ ALint mlChannels;
+ ALenum mFormat;
+
+ wstring msFilename;
+};
+
+//-------------------------------------------------------------------------------
+
+#endif
47 include/OpenAL/OAL_Buffer.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2007-2010 (C) - Frictional Games
+ *
+ * This file is part of OALWrapper
+ *
+ * For conditions of distribution and use, see copyright notice in LICENSE
+ */
+#ifndef _OAL_BUFFER_H
+#define _OAL_BUFFER_H
+
+//----------------------------------------------------------------
+
+#include "OAL_Types.h"
+#include "OAL_LowLevelObject.h"
+#include "OAL_AudioData.h"
+
+class iOAL_AudioData;
+
+//----------------------------------------------------------------
+
+class cOAL_Buffer : public iOAL_LowLevelObject
+{
+public:
+ cOAL_Buffer(iOAL_AudioData* apParent);
+ ~cOAL_Buffer();
+
+ ////////////////////////////////////
+ // iOAL_LowLevelObject impl
+ bool CreateLowLevelID();
+ bool DestroyLowLevelID();
+
+ void SaveObjectState(){}
+ void RestoreObjectState(){}
+
+ bool IsValidObject();
+
+ bool Feed(ALvoid* apPCMData, int alDataSize, double afStartTime=0.0);
+ double GetStartTime() { return mfStartTime; }
+ double GetBufferTime() { return mfBufferTime; }
+
+protected:
+ iOAL_AudioData* mpParent;
+ double mfStartTime;
+ double mfBufferTime;
+};
+
+#endif // _OAL_BUFFER_H
120 include/OpenAL/OAL_Device.h
@@ -0,0 +1,120 @@
+/*
+ * Copyright 2007-2010 (C) - Frictional Games
+ *
+ * This file is part of OALWrapper
+ *
+ * For conditions of distribution and use, see copyright notice in LICENSE
+ */
+/**
+ @file OAL_Device.h
+ @author Luis Rodero
+ @date 2006-10-27
+ @version 0.1
+ Class used for management of OpenAL Devices
+*/
+
+#ifndef _OAL_DEVICE_H
+#define _OAL_DEVICE_H
+
+#include "OAL_Types.h"
+#include "OAL_Init.h"
+#include "OAL_Helper.h"
+#include "OAL_SourceManager.h"
+#include "OAL_EFXManager.h"
+#include "OAL_LoggerObject.h"
+
+
+class cOAL_Device : public iOAL_LoggerObject
+{
+public:
+
+ cOAL_Device ();
+ ~cOAL_Device ();
+
+
+ ///////////////////////////////////////////////////////
+ // Init methods
+ bool Init(cOAL_Init_Params& acParams);
+ void Close();
+
+ bool ReInit ( const char* asDeviceName, const int alOutputFreq = 44100,
+ int alSourceNumHint = 32, int alReqMajorVersion = 1,
+ int alReqMinorVersion = 1,
+ int alMaxMonoSourceHint=0, int alMaxStereoSourceHint =0);
+
+ ///////////////////////////////////////////////////////
+ // Info methods
+
+ inline string& GetDeviceName () { return msDeviceName; }
+ inline string& GetVendorName () { return msVendorName; }
+ inline string& GetRenderer () { return msRenderer; }
+ inline int GetMajorVersion () { return mlMajorVersion;}
+ inline int GetMinorVersion () { return mlMinorVersion;}
+ inline int GetNumSources () { if (mpSourceManager) return mpSourceManager->GetNumVoices(); else return 0; }
+ inline bool* GetExtensions () { return mvbExtensions; }
+ inline bool IsExtensionAvailable (int alWhich) { if ( (alWhich >= 0) && (alWhich < NUM_EXTENSIONS) ) return mvbExtensions[alWhich]; else return false; }
+ inline bool IsEFXActive () { return (mbEFXActive && (mpEFXManager!=NULL)); }
+ inline int GetEFXSends() { return mlEFXSends; }
+ string& GetExtensionName(int alWhich);
+ vector<string>GetOutputDevices();
+
+
+
+ inline const ALCdevice* GetDevice() { return mpDevice; }
+ inline cOAL_SourceManager* GetSourceManager() { return mpSourceManager; }
+ inline cOAL_EFXManager* GetEFXManager() { return mpEFXManager; }
+
+ bool RegainContext ();
+
+ void SetDistanceModel ( eOAL_DistanceModel aeModel );
+
+ ///////////////////////////////////////////////////////
+ // Loaders
+ cOAL_Sample* LoadSample(const string& asFileName);
+ cOAL_Sample* LoadSample(const wstring& asFileName);
+ cOAL_Stream* LoadStream(const string& asFileName);
+ cOAL_Stream* LoadStream(const wstring& asFileName);
+ void UnloadSample(cOAL_Sample* apSample);
+ void UnloadStream(cOAL_Stream* apStream);
+
+ ///////////////////////////////////////////////////////
+ // Playback / Source Management
+ int PlaySample( int alSource, cOAL_Sample *apSample, int alPriority, float afVolume, bool abStartPaused );
+ int PlayStream ( int alSource, cOAL_Stream *apStream, float afVolume, bool abStartPaused );
+
+ cOAL_Source* GetSource ( int alSourceHandle );
+
+ ///////////////////////////////////////////////////////
+ // Listener Management
+ void SetListenerGain ( const float afGain );
+ void SetListenerPosition (const float* apPos );
+ void SetListenerVelocity (const float* apVel );
+ void SetListenerOrientation (const float* apForward, const float* apUp);
+
+
+ ////////////////////////////////////////////////////////
+ // Logging stuff
+ string GetIDString();
+
+private:
+ string msDeviceName;
+ string msVendorName;
+ string msRenderer;
+ int mlMajorVersion;
+ int mlMinorVersion;
+ bool mvbExtensions[NUM_EXTENSIONS];
+ ALCdevice* mpDevice;
+ ALCcontext* mpContext;
+
+
+ cOAL_SourceManager* mpSourceManager;
+
+ cOAL_EFXManager* mpEFXManager;
+ bool mbEFXActive;
+ int mlEFXSends;
+
+ tSampleList mlstSamples;
+ tStreamList mlstStreams;
+};
+
+#endif // _OAL_DEVICE_H
75 include/OpenAL/OAL_EFX.h
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2007-2010 (C) - Frictional Games
+ *
+ * This file is part of OALWrapper
+ *
+ * For conditions of distribution and use, see copyright notice in LICENSE
+ */
+#ifndef _OAL_EFX_H
+#define _OAL_EFX_H
+
+#include "OAL_Types.h"
+#include "OAL_Device.h"
+#include "OAL_SourceManager.h"
+#include "OAL_EFXManager.h"
+
+extern cOAL_Device* gpDevice;
+
+cOAL_Filter* OAL_Filter_Create ();
+void OAL_Filter_SetGain ( cOAL_Filter* apFilter, float afGain);
+void OAL_Filter_SetGainHF ( cOAL_Filter* apFilter, float afGainHF );
+void OAL_Filter_SetType ( cOAL_Filter* apFilter, eOALFilterType aeType );
+
+
+cOAL_Effect_Reverb* OAL_Effect_Reverb_Create();
+void OAL_Effect_Reverb_SetDensity( cOAL_Effect_Reverb* apEffect, float afDensity);
+void OAL_Effect_Reverb_SetDiffusion ( cOAL_Effect_Reverb* apEffect, float afDiffusion);
+void OAL_Effect_Reverb_SetGain ( cOAL_Effect_Reverb* apEffect, float afGain);
+void OAL_Effect_Reverb_SetGainHF ( cOAL_Effect_Reverb* apEffect, float afGainHF);
+void OAL_Effect_Reverb_SetGainLF ( cOAL_Effect_Reverb* apEffect, float afGainLF);
+void OAL_Effect_Reverb_SetDecayTime ( cOAL_Effect_Reverb* apEffect, float afDecayTime);
+void OAL_Effect_Reverb_SetDecayHFRatio ( cOAL_Effect_Reverb* apEffect, float afDecayHFRatio );
+void OAL_Effect_Reverb_SetDecayLFRatio ( cOAL_Effect_Reverb* apEffect, float afDecayLFRatio );
+void OAL_Effect_Reverb_SetReflectionsGain ( cOAL_Effect_Reverb* apEffect, float afReflectionsGain );
+void OAL_Effect_Reverb_SetReflectionsDelay( cOAL_Effect_Reverb* apEffect, float afReflectionsDelay );
+void OAL_Effect_Reverb_SetReflectionsPan( cOAL_Effect_Reverb* apEffect, float afReflectionsPan[3] );
+void OAL_Effect_Reverb_SetLateReverbGain( cOAL_Effect_Reverb* apEffect, float afLateReverbGain);
+void OAL_Effect_Reverb_SetLateReverbDelay ( cOAL_Effect_Reverb* apEffect, float afLateReverbDelay);
+void OAL_Effect_Reverb_SetLateReverbPan (cOAL_Effect_Reverb* apEffect, float afLateReverbPan[3]);
+void OAL_Effect_Reverb_SetEchoTime (cOAL_Effect_Reverb* apEffect, float afEchoTime);
+void OAL_Effect_Reverb_SetEchoDepth (cOAL_Effect_Reverb* apEffect, float afEchoDepth);
+void OAL_Effect_Reverb_SetModulationTime (cOAL_Effect_Reverb* apEffect, float afModulationTime);
+void OAL_Effect_Reverb_SetModulationDepth (cOAL_Effect_Reverb* apEffect, float afModulationDepth);
+void OAL_Effect_Reverb_SetAirAbsorptionGainHF (cOAL_Effect_Reverb* apEffect, float afAirAbsorptionGainHF);
+void OAL_Effect_Reverb_SetHFReference (cOAL_Effect_Reverb* apEffect, float afHFReference);
+void OAL_Effect_Reverb_SetLFReference (cOAL_Effect_Reverb* apEffect, float afLFReference);
+void OAL_Effect_Reverb_SetRoomRolloffFactor (cOAL_Effect_Reverb* apEffect, float afRoomRolloffFactor);
+void OAL_Effect_Reverb_SetDecayHFLimit (cOAL_Effect_Reverb* apEffect, ALboolean abDecayHFLimit);
+
+
+void OAL_Filter_Destroy( cOAL_Filter* apFilter );
+void OAL_Effect_Destroy( cOAL_Effect* apEffect );
+
+////////////////////////////////////////////
+// Effect Slot Management
+
+// OAL_UseEffect : Will return an integer value referencing to the Effect Slot to which the Effect passed as parameter will attach, -1 if failure
+int OAL_UseEffect ( cOAL_Effect* apEffect );
+bool OAL_EffectSlot_AttachEffect(int alSlotId, cOAL_Effect* apEffect);
+void OAL_EffectSlot_SetGain ( int alSlotHandle, float afGain );
+void OAL_EffectSlot_SetAutoAdjust ( int alSlotHandle, bool abAutoAdjust );
+void OAL_UpdateEffectSlots();
+////////////////////////////////////////////
+// Source EFX stuff
+
+void OAL_Source_SetDirectFilter( int alSourceHandle, cOAL_Filter* apFilter );
+void OAL_Source_SetAuxSend ( int alSourceHandle, int alAuxSend, int alSlotHandle, cOAL_Filter* apFilter );
+void OAL_Source_SetAuxSendSlot ( int alSourceHandle, int alAuxSend, int alSlotHandle);
+void OAL_Source_SetAuxSendFilter ( int alSourceHandle, int alAuxSend, cOAL_Filter* apFilter );
+
+void OAL_Source_SetFiltering( int alSourceHandle, bool abEnabled, int alFlags);
+void OAL_Source_SetFilterType( int alSourceHandle, eOALFilterType aeType);
+void OAL_Source_SetFilterGain( int alSourceHandle, float afGain);
+void OAL_Source_SetFilterGainHF( int alSourceHandle, float afGainHF);
+
+#endif // _OAL_EFX_H
91 include/OpenAL/OAL_EFXManager.h
@@ -0,0 +1,91 @@
+/*
+ * Copyright 2007-2010 (C) - Frictional Games
+ *
+ * This file is part of OALWrapper
+ *
+ * For conditions of distribution and use, see copyright notice in LICENSE
+ */
+#ifndef _OAL_EFXMANAGER_H
+#define _OAL_EFXMANAGER_H
+
+#include "OpenAL/OAL_Types.h"
+#include "OpenAL/OAL_Helper.h"
+#include "OpenAL/OAL_LoggerObject.h"
+
+#include <SDL/SDL.h>
+
+typedef enum
+{
+ OAL_Effect_Type_Reverb,
+ OAL_Effect_Type_Default
+} OAL_Effect_Type;
+
+typedef enum
+{
+ OAL_Filter_Type_LowPass,
+ OAL_Filter_Type_HighPass,
+ OAL_Filter_Type_BandPass,
+ OAL_Filter_Type_Default
+} OAL_Filter_Type;
+
+
+class cOAL_EFXManager : public iOAL_LoggerObject
+{
+public:
+ cOAL_EFXManager();
+ ~cOAL_EFXManager();
+
+ cOAL_EffectSlot* GetEffectSlot ( int alSlotHandle )
+ {
+ if ((alSlotHandle >= 0) && ((unsigned int) alSlotHandle < mpvSlots->size()) )
+ return (*mpvSlots)[alSlotHandle];
+ else
+ return NULL;
+ }
+
+ bool Initialize(int alNumSlotsHint, int alNumSends, bool abUseThread, int alSlotUpdateFreq);
+ void Destroy();
+
+ cOAL_Effect_Reverb* CreateReverbEffect ();
+
+ cOAL_Filter* CreateFilter();
+ /*
+ cOAL_Filter_LowPass* CreateLowPassFilter ();
+ cOAL_Filter_HighPass* CreateHighPassFilter ();
+ cOAL_Filter_BandPass* CreateBandPassFilter ();
+*/
+
+ void DestroyEffect ( cOAL_Effect* apEffect );
+ void DestroyFilter ( cOAL_Filter* apFilter );
+
+ int AssignSlot( cOAL_Effect* apEffect );
+
+ inline int GetNumSlots() { return mlNumSlots; }
+ inline int GetNumSends() { return mlNumSends; }
+
+ int UseEffect ( cOAL_Effect *apEffect );
+
+ void UpdateSlots();
+
+ inline bool IsThreadAlive () { return mbUsingThread; }
+ int GetThreadWaitTime();
+
+ string GetIDString();
+
+private:
+
+ int mlNumSlots;
+ int mlNumSends;
+
+ tSlotVector* mpvSlots;
+ tOALEffectList* mplstEffectList;
+ tOALFilterList* mplstFilterList;
+
+ bool mbUsingThread;
+ SDL_Thread* mpUpdaterThread;
+ int mlThreadWaitTime;
+
+};
+
+
+#endif // _OAL_EFXMANAGER_H
49 include/OpenAL/OAL_Effect.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2007-2010 (C) - Frictional Games
+ *
+ * This file is part of OALWrapper
+ *
+ * For conditions of distribution and use, see copyright notice in LICENSE
+ */
+#ifndef _OAL_EFFECT_H
+#define _OAL_EFFECT_H
+
+#include "OpenAL/OAL_LowLevelObject.h"
+
+#include <SDL/SDL.h>
+
+class cOAL_Effect : public iOAL_LowLevelObject
+{
+public:
+ cOAL_Effect();
+ ~cOAL_Effect();
+
+ bool CreateLowLevelID();
+ bool DestroyLowLevelID();
+
+ void SaveObjectState(){}
+ void RestoreObjectState(){}
+
+ bool IsValidObject();
+
+ inline ALuint GetEffectID() { return mlEffectId; }
+
+ inline bool NeedsUpdate () { return mbNeedsUpdate; }
+ inline void SetUpdated() { mbNeedsUpdate = false; }
+
+// virtual void SetParams( cOAL_Effect_Params& aParams ){}
+// virtual cOAL_Effect_Params GetParams(){};
+
+ void Lock();
+ void Unlock();
+
+protected:
+ ALuint mlEffectId;
+ bool mbNeedsUpdate;
+
+ SDL_mutex* mpMutex;
+};
+
+#endif // _OAL_EFFECT_H
+
+
64 include/OpenAL/OAL_EffectSlot.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2007-2010 (C) - Frictional Games
+ *
+ * This file is part of OALWrapper
+ *
+ * For conditions of distribution and use, see copyright notice in LICENSE
+ */
+#ifndef _OAL_EFFECTSLOT_H
+#define _OAL_EFFECTSLOT_H
+
+#include "OpenAL/OAL_Types.h"
+#include "OpenAL/OAL_LowLevelObject.h"
+
+#include <SDL/SDL.h>
+
+class cOAL_EFXManager;
+
+class cOAL_EffectSlot : public iOAL_LowLevelObject
+{
+public:
+ cOAL_EffectSlot ( cOAL_EFXManager* apEFXManager, int alId );
+ ~cOAL_EffectSlot();
+
+ bool CreateLowLevelID();
+ bool DestroyLowLevelID();
+
+ void SaveObjectState(){}
+ void RestoreObjectState(){}
+
+ bool IsValidObject();
+
+ bool AttachEffect ( cOAL_Effect* apEffect );
+ inline bool IsFree() { return (mpEffect == NULL); }
+
+ void SetGain ( float afGain );
+ inline float GetGain () { return mfGain; }
+
+ void SetAutoAdjust (bool abAuto);
+ bool GetAutoAdjust () { return mbAutoAdjust; }
+
+ void Update();
+ void Reset();
+
+ void Lock();
+ void Unlock();
+
+private:
+ int mlId;
+ cOAL_Effect* mpEffect;
+ float mfGain;
+ bool mbAutoAdjust;
+ cOAL_EFXManager* mpEFXManager;
+
+ SDL_mutex* mpMutex;
+
+};
+
+#endif // _OAL_EFFECTSLOT_H
+
+
+
+
+
+
148 include/OpenAL/OAL_Effect_Reverb.h
@@ -0,0 +1,148 @@
+/*
+ * Copyright 2007-2010 (C) - Frictional Games
+ *
+ * This file is part of OALWrapper
+ *
+ * For conditions of distribution and use, see copyright notice in LICENSE
+ */
+#ifndef _OAL_EFFECT_REVERB_H
+#define _OAL_EFFECT_REVERB_H
+
+#include "OpenAL/OAL_Effect.h"
+#include "OpenAL/OAL_Types.h"
+#include "OpenAL/OAL_Helper.h"
+
+class cOAL_Effect_Reverb : public cOAL_Effect
+{
+public:
+ cOAL_Effect_Reverb(bool abForceEFXReverb = false):
+ mfDensity(1.0f),
+ mfDiffusion(1.0f),
+ mfGain(0.32f),
+ mfGainHF(0.89f),
+ mfGainLF(0.0f),
+ mfDecayTime(1.49f),
+ mfDecayHFRatio(0.83f),
+ mfDecayLFRatio(1.0f),
+ mfReflectionsGain(0.05f),
+ mfReflectionsDelay(0.007f),
+ mfLateReverbGain(1.25f),
+ mfLateReverbDelay(0.011f),
+ mfEchoTime(0.25f),
+ mfEchoDepth(0.0f),
+ mfModulationTime(0.25f),
+ mfModulationDepth(0.0f),
+ mfAirAbsorptionGainHF(0.994f),
+ mfHFReference(5000.0f),
+ mfLFReference(250.0f),
+ mfRoomRolloffFactor(0.0f),
+ mbDecayHFLimit(AL_TRUE),
+ mbEAXReverb ( false )
+ {
+ DEF_FUNC_NAME("cOAL_Effect_Reverb::cOAL_Effect_Reverb");
+ FUNC_USES_AL;
+
+ mfReflectionsPan[0] = 0.0f;
+ mfReflectionsPan[1] = 0.0f;
+ mfReflectionsPan[2] = 0.0f;
+ mfLateReverbPan[0] = 0.0f;
+ mfLateReverbPan[1] = 0.0f;
+ mfLateReverbPan[2] = 0.0f;
+
+ if ( !abForceEFXReverb )
+ {
+ RUN_AL_FUNC( alEffecti(mlEffectId, AL_EFFECT_TYPE, AL_EFFECT_EAXREVERB) );
+ mbEAXReverb = !AL_ERROR_OCCURED;
+ mbStatus = !AL_ERROR_OCCURED;
+ }
+
+ if ( abForceEFXReverb || !mbEAXReverb )
+ {
+ RUN_AL_FUNC ( alEffecti ( mlEffectId, AL_EFFECT_TYPE, AL_EFFECT_REVERB) );
+ mbStatus = !AL_ERROR_OCCURED;
+ }
+ }
+
+ ~cOAL_Effect_Reverb(){}
+
+ inline float GetDensity( ) { return mfDensity; }
+ inline float GetDiffusion ( ) { return mfDiffusion; }
+ inline float GetGain ( ) { return mfGain; }
+ inline float GetGainHF ( ) { return mfGainHF; }
+ inline float GetGainLF ( ) { return mfGainLF; }
+ inline float GetDecayTime ( ) { return mfDecayTime; }
+ inline float GetDecayHFRatio ( ) { return mfDecayHFRatio; }
+ inline float GetDecayLFRatio ( ) { return mfDecayLFRatio; }
+ inline float GetReflectionsGain ( ) { return mfReflectionsGain; }
+ inline float GetReflectionsDelay( ) { return mfReflectionsDelay; }
+ inline float* GetReflectionsPan( ) { return mfReflectionsPan; }
+ inline float GetLateReverbGain( ) { return mfLateReverbGain; }
+ inline float GetLateReverbDelay ( ) { return mfLateReverbDelay; }
+ inline float* GetLateReverbPan () { return mfLateReverbPan; }
+ inline float GetEchoTime () { return mfEchoTime; }
+ inline float GetEchoDepth () { return mfEchoDepth; }
+ inline float GetModulationTime () { return mfModulationTime; }
+ inline float GetModulationDepth () { return mfModulationDepth; }
+ inline float GetAirAbsorptionGainHF () { return mfAirAbsorptionGainHF; }
+ inline float GetHFReference () { return mfHFReference; }
+ inline float GetLFReference () { return mfLFReference; }
+ inline float GetRoomRolloffFactor () { return mfRoomRolloffFactor; }
+ inline ALboolean GetDecayHFLimit () { return mbDecayHFLimit; }
+
+ void SetDensity( float afDensity);
+ void SetDiffusion ( float afDiffusion);
+ void SetGain ( float afGain);
+ void SetGainHF ( float afGainHF);
+ void SetGainLF ( float afGainLF);
+ void SetDecayTime ( float afDecayTime);
+ void SetDecayHFRatio ( float afDecayHFRatio );
+ void SetDecayLFRatio ( float afDecayLFRatio );
+ void SetReflectionsGain ( float afReflectionsGain );
+ void SetReflectionsDelay( float afReflectionsDelay );
+ void SetReflectionsPan( float afReflectionsPan[3] );
+ void SetLateReverbGain( float afLateReverbGain);
+ void SetLateReverbDelay ( float afLateReverbDelay);
+ void SetLateReverbPan (float afLateReverbPan[3]);
+ void SetEchoTime (float afEchoTime);
+ void SetEchoDepth (float afEchoDepth);
+ void SetModulationTime (float afModulationTime);
+ void SetModulationDepth (float afModulationDepth);
+ void SetAirAbsorptionGainHF (float afAirAbsorptionGainHF);
+ void SetHFReference (float afHFReference);
+ void SetLFReference (float afLFReference);
+ void SetRoomRolloffFactor (float afRoomRolloffFactor);
+ void SetDecayHFLimit (ALboolean abDecayHFLimit);
+
+
+private:
+
+ float mfDensity;
+ float mfDiffusion;
+ float mfGain;
+ float mfGainHF;
+ float mfGainLF;
+ float mfDecayTime;
+ float mfDecayHFRatio;
+ float mfDecayLFRatio;
+ float mfReflectionsGain;
+ float mfReflectionsDelay;
+ float mfReflectionsPan[3];
+ float mfLateReverbGain;
+ float mfLateReverbDelay;
+ float mfLateReverbPan[3];
+ float mfEchoTime;
+ float mfEchoDepth;
+ float mfModulationTime;
+ float mfModulationDepth;
+ float mfAirAbsorptionGainHF;
+ float mfHFReference;
+ float mfLFReference;
+ float mfRoomRolloffFactor;
+ ALboolean mbDecayHFLimit;
+
+ bool mbEAXReverb;
+
+};
+
+
+#endif // _OAL_EFFECT_REVERB_H
48 include/OpenAL/OAL_Filter.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2007-2010 (C) - Frictional Games
+ *
+ * This file is part of OALWrapper
+ *
+ * For conditions of distribution and use, see copyright notice in LICENSE
+ */
+#ifndef _OAL_FILTER_H
+#define _OAL_FILTER_H
+
+#include "OpenAL/OAL_Types.h"
+#include "OAL_LowLevelObject.h"
+
+
+
+class cOAL_Filter : public iOAL_LowLevelObject
+{
+public:
+ cOAL_Filter();
+ ~cOAL_Filter();
+
+ bool CreateLowLevelID();
+ bool DestroyLowLevelID();
+
+ void SaveObjectState(){}
+ void RestoreObjectState(){}
+
+ bool IsValidObject();
+
+ void SetType ( eOALFilterType aeType );
+ void SetGain ( float afGain );
+ void SetGainHF ( float afGainHF );
+ void SetGainLF ( float afGainHF );
+
+ inline eOALFilterType GetType () { return mType; }
+ inline float GetGain () { return mfGain; }
+ inline float GetGainHF() { return mfGainHF; }
+ inline float GetGainLF() { return mfGainLF; }
+
+protected:
+ float mfGain;
+ float mfGainHF;
+ float mfGainLF;
+ eOALFilterType mType;
+};
+
+#endif
+
59 include/OpenAL/OAL_Funcs.h
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2007-2010 (C) - Frictional Games
+ *
+ * This file is part of OALWrapper
+ *
+ * For conditions of distribution and use, see copyright notice in LICENSE
+ */
+/**
+ @file OAL_Funcs.h
+ @author Luis Rodero
+ @date 2006-10-02
+ @version 0.1
+ Main header for the OpenAL Wrapper
+*/
+
+#ifndef _OAL_FUNCS_H
+#define _OAL_FUNCS_H
+
+#ifdef WIN32
+#pragma comment(lib, "libvorbis.lib")
+#pragma comment(lib, "libvorbisfile.lib")
+#pragma comment(lib, "alut.lib")
+#pragma comment(lib, "openal32.lib")
+#pragma comment(lib, "SDL.lib")
+#endif
+
+#include "OAL_Types.h"
+
+//#include "OAL_WAVSample.h"
+//#include "OAL_OggSample.h"
+//#include "OAL_OggStream.h"
+
+
+////////////////////////////////////////////
+// Init / Shutdown funcs
+////////////////////////////////////////////
+
+#include "OAL_Init.h"
+
+////////////////////////////////////////////
+// Playback and Source Management Funcs
+////////////////////////////////////////////
+
+#include "OAL_Playback.h"
+
+////////////////////////////////////////////
+// Sound Data Loaders
+////////////////////////////////////////////
+
+#include "OAL_Loaders.h"
+
+////////////////////////////////////////////
+// EFX Specific Funcs
+////////////////////////////////////////////
+
+#include "OAL_EFX.h"
+
+
+#endif // _OALFUNCS_H
78 include/OpenAL/OAL_Helper.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2007-2010 (C) - Frictional Games
+ *
+ * This file is part of OALWrapper
+ *
+ * For conditions of distribution and use, see copyright notice in LICENSE
+ */
+/**
+ @file OAL_Helper.h
+ @author Luis Rodero
+ @date 2006-10-02
+ @version 0.1
+ Set of Helper functions
+*/
+#ifndef _OAL_HELPER_H
+#define _OAL_HELPER_H
+
+//-----------------------------------------------------------------------------------------
+
+extern bool gbLogSounds;
+
+extern void OAL_Log(int alMessageType, const char *asMessage,...);
+extern void OAL_Source_Log(int mlSourceId, int alMessageType, const char *asMessage,...);
+
+//-----------------------------------------------------------------------------------------
+
+#include "OAL_Types.h"
+
+//-----------------------------------------------------------------------------------------
+
+#define DEF_FUNC_NAME(X) string sFuncName(#X);
+
+#define FUNC_USES_AL bool bALError = false; ClearALErrors(sFuncName);
+#define FUNC_USES_ALC bool bALCError = false; ClearALCErrors(sFuncName);
+
+#define RUN_AL_FUNC(f) \
+ f; \
+ bALError = OAL_GetALError(); \
+ if ( bALError && iOAL_LoggerObject::IsLogEnabled() ) \
+ iOAL_LoggerObject::LogMsg("",eOAL_LogVerbose_None,eOAL_LogMsg_Error, "%s: %s raised %s\n", #f, sFuncName.c_str(), OAL_GetALErrorString().c_str());
+
+#define RUN_ALC_FUNC(f) \
+ f; \
+ bALCError = OAL_GetALCError(); \
+ if ( bALCError && iOAL_LoggerObject::IsLogEnabled() ) \
+ iOAL_LoggerObject::LogMsg("", eOAL_LogVerbose_None,eOAL_LogMsg_Error, "%s: %s raised %s\n", #f, sFuncName.c_str(), OAL_GetALCErrorString().c_str());
+
+#define AL_ERROR_OCCURED bALError
+#define ALC_ERROR_OCCURED bALCError
+
+//-----------------------------------------------------------------------------------------
+
+string GetExtension(const string& asFilename);
+wstring GetExtensionW(const wstring& asFilename);
+
+//-----------------------------------------------------------------------------------------
+
+bool OAL_GetALError ();
+string OAL_GetALErrorString();
+
+bool OAL_GetALCError ();
+string OAL_GetALCErrorString();
+
+string WString2String(const wstring& asWString);
+wstring String2WString(const string& asString);
+
+//-----------------------------------------------------------------------------------------
+
+void ClearALErrors( const string& asFunction );
+bool CheckALErrors( const string& asFunc1, const string& asFunc2 );
+void ClearALCErrors( const string& asFunction );
+bool CheckALCErrors( const string& asFunction );
+
+//-----------------------------------------------------------------------------------------
+
+
+
+#endif // _OAL_HELPER_H
85 include/OpenAL/OAL_Init.h
@@ -0,0 +1,85 @@
+/*
+ * Copyright 2007-2010 (C) - Frictional Games
+ *
+ * This file is part of OALWrapper
+ *
+ * For conditions of distribution and use, see copyright notice in LICENSE
+ */
+/**
+ @file OAL_Init.h
+ @author Luis Rodero
+ @date 2006-10-10
+ @version 0.1
+ Set of functions for Initialization/Shutdown, plus misc funcs
+*/
+#ifndef _OAL_INIT_H
+#define _OAL_INIT_H
+
+#include "OAL_Types.h"
+#include "OAL_LoggerObject.h"
+
+
+/////////////////////////////////////////
+// Initialization Parameters
+
+class cOAL_Init_Params
+{
+public:
+ cOAL_Init_Params() : msDeviceName("NULL"), mlMajorVersionReq(1), mlMinorVersionReq(0),
+ mlOutputFreq(44100), mbUseThread(true), mlUpdateFreq(10),
+ mlNumSourcesHint(32), mbVoiceManagement(true), mlMinMonoSourcesHint(0),
+ mlMinStereoSourcesHint(0), mlStreamingBufferSize(1), mlStreamingBufferCount(4),
+ mbUseEFX(false), mlNumSlotsHint(4), mlNumSendsHint(4), mlSlotUpdateFreq(15)
+ {
+ }
+
+ ~cOAL_Init_Params(){}
+
+ string msDeviceName;
+ int mlMajorVersionReq;
+ int mlMinorVersionReq;
+ int mlOutputFreq;
+ bool mbUseThread;
+ int mlUpdateFreq;
+ int mlNumSourcesHint;
+ bool mbVoiceManagement;
+ int mlMinMonoSourcesHint;
+ int mlMinStereoSourcesHint;
+ int mlStreamingBufferSize;
+ int mlStreamingBufferCount;
+ bool mbUseEFX;
+ int mlNumSlotsHint;
+ int mlNumSendsHint;
+ int mlSlotUpdateFreq;
+};
+
+/////////////////////////////////////////
+
+/*bool OAL_Init ( const char* asDeviceName = NULL, int alOutputFreq = 44100,
+ bool abUseThread = true, int alUpdateFreq = 100,
+ int alReqMajorVersion = 1, int alReqMinorVersion = 1,
+ int alNumSourcesHint = 32, bool mbVoiceManagement = true,
+ int alMinMonoSourceHint = 0, int alMinStereoSourceHint = 0,
+ int alStreamingBufferSize = 1, int alStreamingBufferCount = 4);
+*/
+bool OAL_Init ( cOAL_Init_Params& acParams );
+void OAL_Close ( void );
+
+void OAL_Update ( void );
+void OAL_SetRollOffFactor ( const float afFactor );
+void OAL_SetDistanceModel ( eOAL_DistanceModel aeModel );
+
+
+const char* OAL_Info_GetDeviceName();
+const char* OAL_Info_GetVendorName();
+const char* OAL_Info_GetRendererName();
+const int OAL_Info_GetMajorVersion();
+const int OAL_Info_GetMinorVersion();
+const int OAL_Info_GetNumSources();
+const bool OAL_Info_IsEFXActive();
+vector<string> OAL_Info_GetOutputDevices();
+
+void OAL_LogSourcePoolStatus();
+void OAL_SetupLogging ( bool abLogSounds, eOAL_LogOutput aeOutput = eOAL_LogOutput_File, eOAL_LogVerbose aVerbose = eOAL_LogVerbose_Low, string asLogFilename = "OAL.Log" );
+void OAL_Log(eOAL_LogVerbose aVerboseLevelReq, eOAL_LogMsg aMsg, const char* asMessage, ... );
+#endif // _OAL_INIT_H
37 include/OpenAL/OAL_Loaders.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2007-2010 (C) - Frictional Games
+ *
+ * This file is part of OALWrapper
+ *
+ * For conditions of distribution and use, see copyright notice in LICENSE
+ */
+/**
+ @file OAL_Loaders.h
+ @author Luis Rodero
+ @date 2006-10-02
+ @version 0.1
+ Set of functions to load and unload samples and streams in OpenAL
+*/
+
+#ifndef _OAL_LOADERS_H
+#define _OAL_LOADERS_H
+
+#include "OAL_Types.h"
+
+cOAL_Sample* OAL_Sample_Load ( const string &asFilename );
+cOAL_Sample* OAL_Sample_Load ( const wstring &asFilename );
+void OAL_Sample_Unload ( cOAL_Sample* apSample );
+
+
+cOAL_Stream* OAL_Stream_Load ( const string &asFilename );
+cOAL_Stream* OAL_Stream_Load ( const wstring &asFilename );
+void OAL_Stream_Unload ( cOAL_Stream* apStream );
+
+void OAL_Sample_SetLoop ( cOAL_Sample* apSample, bool abLoop );
+void OAL_Stream_SetLoop ( cOAL_Stream* apStream, bool abLoop );
+
+int OAL_Sample_GetChannels (cOAL_Sample* apSample);
+int OAL_Stream_GetChannels (cOAL_Stream* apStream);
+
+
+#endif // _OAL_PLAYBACK_H
73 include/OpenAL/OAL_LoggerObject.h
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2007-2010 (C) - Frictional Games
+ *
+ * This file is part of OALWrapper
+ *
+ * For conditions of distribution and use, see copyright notice in LICENSE
+ */
+#ifndef _OAL_LOGGEROBJECT_H
+#define _OAL_LOGGEROBJECT_H
+
+#include "OAL_Types.h"
+
+//---------------------------------------------------------------------------------------
+
+typedef enum
+{
+ eOAL_LogMsg_Text,
+ eOAL_LogMsg_Command,
+ eOAL_LogMsg_Info,
+ eOAL_LogMsg_Error,
+ eOAL_LogMsg_Default,
+} eOAL_LogMsg;
+
+
+typedef enum
+{
+ eOAL_LogVerbose_None,
+ eOAL_LogVerbose_Low,
+ eOAL_LogVerbose_Medium,
+ eOAL_LogVerbose_High,
+ eOAL_LogVerbose_Default,
+} eOAL_LogVerbose;
+
+
+typedef enum
+{
+ eOAL_LogOutput_File,
+ eOAL_LogOutput_Console,
+ eOAL_LogOutput_Default,
+} eOAL_LogOutput;
+
+//---------------------------------------------------------------------------------------
+
+class iOAL_LoggerObject
+{
+public:
+ static void LogMsg(const string& asIDStr,eOAL_LogVerbose aVerbose, eOAL_LogMsg aType, const char* asMessage, ...);
+
+ static void Write(const string& asMessage);
+
+ inline static void SetLogEnabled ( bool abEnable ) { mbLogEnabled = abEnable; }
+ inline static void SetLogOutput ( eOAL_LogOutput aOutput ) { mLogOutput = aOutput; }
+ inline static void SetLogVerbose ( eOAL_LogVerbose aLevel ) { mLogVerboseLevel = aLevel; }
+ static void SetLogFilename ( const string& asLogFilename );
+
+
+ inline static bool IsLogEnabled () { return mbLogEnabled; }
+ inline static eOAL_LogOutput GetLogOutput ( ) { return mLogOutput; }
+ inline static eOAL_LogVerbose GetLogVerboseLevel () { return mLogVerboseLevel; }
+ inline static wstring GetLogFilename ( ) { return msLogFile; }
+
+protected:
+ static bool mbLogEnabled;
+ static eOAL_LogOutput mLogOutput;
+ static eOAL_LogVerbose mLogVerboseLevel;
+ static wstring msLogFile;
+
+};
+
+//---------------------------------------------------------------------------------------
+
+#endif
+
58 include/OpenAL/OAL_LowLevelObject.h
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2007-2010 (C) - Frictional Games
+ *
+ * This file is part of OALWrapper
+ *
+ * For conditions of distribution and use, see copyright notice in LICENSE
+ */
+/**
+ @file OAL_Init.h
+ @author Luis Rodero
+ @date 2007-04-10
+ @version 0.1
+ Interface for classes handling any OpenAL Object
+*/
+
+#ifndef _OAL_LOWLEVELOBJECT_H
+#define _OAL_LOWLEVELOBJECT_H
+
+#include "OAL_LoggerObject.h"
+
+class iOAL_LowLevelObject : public iOAL_LoggerObject
+{
+public:
+
+ iOAL_LowLevelObject(const string& asObjType) {}
+ ~iOAL_LowLevelObject() {}
+
+ ////////////////////////////////////////////
+ // Creation / destruction of OpenAL Objects
+
+ virtual bool CreateLowLevelID(void) = 0;
+ virtual bool DestroyLowLevelID(void) = 0;
+
+ ////////////////////////////////////////////
+ // Methods for helping in the reinitialization process (not implemented)
+ virtual void SaveObjectState(void) = 0;
+ virtual void RestoreObjectState(void) = 0;
+
+ ////////////////////////////////////////////
+ // Method for checking if object is valid
+ virtual bool IsValidObject() = 0;
+
+ ////////////////////////////////////////////
+ // Method for returning the low level ID
+ ALuint GetObjectID() { return mlObjectId; }
+ ALuint* GetObjectIDPointer() { return &mlObjectId; }
+
+ bool GetStatus() { return mbStatus; }
+
+protected:
+ ALuint mlObjectId;
+ bool mbStatus;
+};
+
+
+#endif
+
+
11 include/OpenAL/OAL_OggHelper.h
@@ -0,0 +1,11 @@
+/*
+ * Copyright 2007-2010 (C) - Frictional Games
+ *
+ * This file is part of OALWrapper
+ *
+ * For conditions of distribution and use, see copyright notice in LICENSE
+ */
+#include <vorbis/codec.h>
+#include <vorbis/vorbisfile.h>
+
+int _fseek64_wrap(FILE *f,ogg_int64_t off,int whence);
33 include/OpenAL/OAL_OggSample.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2007-2010 (C) - Frictional Games
+ *
+ * This file is part of OALWrapper
+ *
+ * For conditions of distribution and use, see copyright notice in LICENSE
+ */
+/**
+ @file OAL_OggSample.h
+ @author Luis Rodero
+ @date 2006-10-02
+ @version 0.1
+ Derived class for containing Ogg Vorbis Sample data
+*/
+
+#ifndef _OAL_OGGSAMPLE_H
+#define _OAL_OGGSAMPLE_H
+
+#include "OAL_Sample.h"
+
+#include "OAL_OggHelper.h"
+//-------------------------------------------------------------------------------
+
+class cOAL_OggSample : public cOAL_Sample
+{
+public:
+ bool CreateFromFile(const wstring& asFilename);
+protected:
+};
+
+//-------------------------------------------------------------------------------
+
+#endif // _OAL_SAMPLE_H
51 include/OpenAL/OAL_OggStream.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2007-2010 (C) - Frictional Games
+ *
+ * This file is part of OALWrapper
+ *
+ * For conditions of distribution and use, see copyright notice in LICENSE
+ */
+/**
+ @file OAL_OggStream.h
+ @author Luis Rodero
+ @date 2006-10-06
+ @version 0.1
+ Declaration of class for containing Ogg Vorbis streams
+*/
+
+#ifndef _OAL_OGGSTREAM_H
+#define _OAL_OGGSTREAM_H
+
+#include "OAL_Stream.h"
+#include "OAL_Helper.h"
+
+#include "OAL_OggHelper.h"
+
+#include "system/MemoryManager.h"
+#include "system/LowLevelSystem.h"
+
+//------------------------------------------------------------------------
+
+class cOAL_OggStream : public cOAL_Stream
+{
+public:
+ cOAL_OggStream();
+ ~cOAL_OggStream();
+
+ void Seek(float afWhere, bool abForceRebuffer);
+
+protected:
+ bool CreateFromFile(const wstring &asFileName);
+ void Destroy();
+
+ bool Stream(cOAL_Buffer* apDestBuffer);
+ double GetTime();
+
+ OggVorbis_File movStreamHandle;
+ int mlCurrent_section;
+ bool mbIsValidHandle;
+};
+
+//------------------------------------------------------------------------
+
+#endif // _OAL_SAMPLE_H
71 include/OpenAL/OAL_Playback.h
@@ -0,0 +1,71 @@
+/*
+ * Copyright 2007-2010 (C) - Frictional Games
+ *
+ * This file is part of OALWrapper
+ *
+ * For conditions of distribution and use, see copyright notice in LICENSE
+ */
+/**
+ @file OAL_Playback.h
+ @author Luis Rodero
+ @date 2006-10-02
+ @version 0.1
+ Set of functions to manage playback and such in OpenAL
+*/
+
+#ifndef _OAL_PLAYBACK_H
+#define _OAL_PLAYBACK_H
+
+#include "OAL_Types.h"
+
+//
+
+//#include "OAL_Sample.h"
+//#include "OAL_Stream.h"
+
+#include <string>
+
+//class cOAL_Sample;
+//class cOAL_Stream;
+
+using namespace std;
+
+
+void OAL_Test_Sample_Play ( cOAL_Sample* apSample );
+void OAL_Test_Stream_Play ( cOAL_Stream* apStream );
+
+int OAL_Sample_Play ( int alSource, cOAL_Sample* apSample, float afVolume, bool abStartPaused , int alPriority);
+int OAL_Stream_Play ( int alSource, cOAL_Stream* apStream, float afVolume, bool abStartPaused );
+
+void OAL_Source_Stop ( int alSource );
+void OAL_Source_SetPaused( int alSource, const bool abPaused );
+void OAL_Source_SetVolume ( int alSource, float afVolume );
+void OAL_Source_SetPitch ( int alSource, float afPitch );
+void OAL_Source_SetLoop ( int alSource, const bool abLoop );
+void OAL_Source_SetAttributes ( const int alSource, const float* apPos, const float* apVel );
+void OAL_Source_SetMinMaxDistance ( const int alSource, const float afMin, const float afMax );
+void OAL_Source_SetPositionRelative ( const int alSource, const bool abRelative );
+void OAL_Source_SetPriority ( const int alSource, const unsigned int alPriority );
+
+unsigned int OAL_Source_GetPriority ( const int alSource );
+float OAL_Source_GetPitch(const int alSource);
+float OAL_Source_GetGain(const int alSource);
+const bool OAL_Source_IsPlaying ( const int alSource );
+const bool OAL_Source_IsBufferUnderrun ( const int alSource );
+
+
+
+void OAL_Listener_SetAttributes ( const float* apPos, const float* apVel, const float* apForward, const float* apUpward );
+void OAL_Listener_SetMasterVolume ( const float afVolume );
+
+
+void OAL_Source_SetElapsedTime( const int alSource, double afTime );
+double OAL_Source_GetElapsedTime( const int alSource );
+double OAL_Source_GetTotalTime( const int alSource );
+
+void OAL_Source_Log ( int alSourceId, int alMessageType, const char* asMessage, ... );
+
+
+
+
+#endif // _OAL_PLAYBACK_H
55 include/OpenAL/OAL_Sample.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2007-2010 (C) - Frictional Games
+ *
+ * This file is part of OALWrapper
+ *
+ * For conditions of distribution and use, see copyright notice in LICENSE
+ */
+/**
+ @file OAL_Sample.h
+ @author Luis Rodero
+ @date 2006-10-02
+ @version 0.1
+ Declaration of Base class for containing samples
+*/
+
+#ifndef _OAL_SAMPLE_H
+#define _OAL_SAMPLE_H
+
+#include "OAL_Types.h"
+#include "OAL_Helper.h"
+#include "OAL_Source.h"
+#include "OAL_AudioData.h"
+
+class cOAL_Sample : public iOAL_AudioData
+{
+public:
+
+ cOAL_Sample();
+ ~cOAL_Sample();
+
+ void Destroy(){}
+
+ void AddBoundSource(cOAL_Source* apSource) { if(apSource) mlstBoundSources.push_back(apSource); }
+ void RemoveBoundSource(cOAL_Source* apSource) { if(apSource) mlstBoundSources.remove(apSource); }
+
+ void Update(){}
+
+ ALuint* GetOALBufferPointer();
+
+ double GetProcessedBuffersTime() { return 0; }
+
+ bool HasBufferUnderrun() { return false; }
+ bool NeedsRebuffering() { return false; }
+
+ //void LogMsg("",eOAL_LogVerbose aVerboseLevelReq, eOAL_LogMsg aeMessageType, const char* asMessage, ...);
+
+ //string GetDebugInfo();
+protected:
+ tSourceList mlstBoundSources;
+};
+
+
+
+
+#endif // _OAL_SAMPLE_H
197 include/OpenAL/OAL_Source.h
@@ -0,0 +1,197 @@
+/*
+ * Copyright 2007-2010 (C) - Frictional Games
+ *
+ * This file is part of OALWrapper
+ *
+ * For conditions of distribution and use, see copyright notice in LICENSE
+ */
+/**
+ @file OAL_Source.h
+ @author Luis Rodero
+ @date 2006-10-10
+ @version 0.1
+ Wrapping for OpenAL Source Objects
+*/
+
+#ifndef _OAL_SOURCE_H
+#define _OAL_SOURCE_H
+
+class cOAL_SourceManager;
+
+#include "OAL_Types.h"
+#include "OAL_AudioData.h"
+#include "OAL_LowLevelObject.h"
+#include "OAL_SourceManager.h"
+#include "OAL_EffectSlot.h"
+#include "OAL_Effect.h"
+#include "OAL_Filter.h"
+
+#include "system/MemoryManager.h"
+#include "system/LowLevelSystem.h"
+
+
+#define OAL_SEND_DIRECT 0x10000000h
+#define OAL_SEND_AUX0 1
+#define OAL_SEND_AUX1 2
+#define OAL_SEND_AUX2 4
+#define OAL_SEND_AUX3 8
+
+
+typedef enum
+{
+ eOAL_SourceParam_Gain,
+ eOAL_SourceParam_Pitch,
+ eOAL_SourceParam_Position,
+ eOAL_SourceParam_Velocity,
+ eOAL_SourceParam_Buffer,
+ eOAL_SourceParam_Default
+} eOAL_SourceParam;
+
+
+class cOAL_SourceSend
+{
+public:
+ cOAL_SourceSend(): mpSlot(NULL), mpFilter(NULL)
+ {}
+ ~cOAL_SourceSend(){}
+
+ ALuint GetSlot() { if (mpSlot) return mpSlot->GetObjectID(); return AL_EFFECTSLOT_NULL; }
+ ALuint GetFilter() { if (mpFilter) return mpFilter->GetObjectID(); return AL_FILTER_NULL; }
+
+ inline void SetSlot(cOAL_EffectSlot* apSlot) { mpSlot = apSlot; }
+ inline void SetFilter(cOAL_Filter* apFilter) { mpFilter = apFilter; }
+
+private:
+ cOAL_EffectSlot* mpSlot;
+ cOAL_Filter* mpFilter;
+};
+
+
+class cOAL_Source : public iOAL_LowLevelObject
+{
+public:
+ cOAL_Source(cOAL_SourceManager *apSourceManager, int alId, int alSends);
+
+ ~cOAL_Source();
+
+ //////////////////////////////////////
+ // iOAL_LowLevelObject impl.
+
+ bool CreateLowLevelID();
+ bool DestroyLowLevelID();
+
+ void SaveObjectState(){}
+ void RestoreObjectState(){}
+
+ bool IsValidObject() ;
+
+ //////////////////////////////////////
+ // Threading stuff
+ void Lock();
+ void Unlock();
+
+ /////////////////////////////////////
+ // Playback management
+ int BindData ( cOAL_Sample* apSample );
+ int BindData ( cOAL_Stream* apStream );
+ void Play ();
+ void Stop (bool abRemove = true);
+ void Pause ( bool abPaused );
+
+ ////////////////////////////////////
+ // Attribute modifiers
+ void SetGain(float afGain);
+ void SetPitch(float afPitch);
+ void SetPosition(const float* apPos);
+ void SetVelocity(const float* apVel);
+ void SetLoop(bool abLoop);
+
+ void SetElapsedTime(double afTime);
+
+ void SetPriority(const ALuint alX);
+
+ inline float GetGain() { return mfGain; }
+ inline float GetPitch() { return mfPitch; }
+
+
+ ///////////////////////////////////
+ // Methods for retrieving information
+ inline const int GetId() { return mlId; }
+ inline const ALuint GetPriority () { return mlPriority; }
+ eOAL_SourceStatus GetSourceStatus();
+ eOAL_AudioDataType GetSourceType();
+ int GetProcessedBuffers();
+ int GetQueuedBuffers();
+ double GetElapsedTime();
+ double GetTotalTime();
+
+ inline unsigned int GetRefCount() { return mlRefCount; }
+
+ // EFX related methods
+
+ void SetDirectFilter(cOAL_Filter* apFilter);
+ void SetAuxSend(int alSendId, cOAL_EffectSlot* apSlot, cOAL_Filter* apFilter);
+ void SetAuxSendSlot(int alSendId, cOAL_EffectSlot* apSlot );
+ void SetAuxSendFilter(int alSendId, cOAL_Filter* apFilter );
+
+ // Built in filter methods
+ void SetFilterType ( eOALFilterType aeType );
+ void SetFilterGain ( float afGain );
+ void SetFilterGainHF ( float afGainHF );
+ void SetFilterGainLF ( float afGainLF );
+ void SetFilterEnabled ( bool abEnabled, int alFlags );
+
+ void UpdateFiltering(unsigned int alSends);
+ void UpdateFiltering();
+
+ // Misc methods
+ void Update();
+
+ // Logging
+ //void LogMsg("",eOAL_LogVerbose aeVerboseLevelReq, eOAL_LogMsg aeMessageType, const char* asMessage, ...);
+
+
+private:
+ friend class cOAL_Stream;
+
+ int mlId;
+ unsigned int mlPriority;
+ unsigned int mlRefCount;
+
+ SDL_mutex* mpSourceMutex;
+
+ cOAL_SourceManager* mpSourceManager;
+
+ iOAL_AudioData* mpAudioData;
+
+ bool mbLoop;
+ bool mbPlaying;
+ bool mbPaused;
+
+ bool mbNeedsReset;
+
+ float mfGain;
+ float mfPitch;
+ float mvPos[3];
+ float mvVel[3];
+
+ vector<cOAL_SourceSend*> mvSends;
+
+ cOAL_Filter* mpFilter;
+ cOAL_Filter* mpDirectFilter;
+
+ void Queue(cOAL_Buffer* apBuffer);
+ cOAL_Buffer* Unqueue();
+
+ void LowLevelPlay();
+ void LowLevelPause();
+ void LowLevelStop();
+ bool LowLevelSet(eOAL_SourceParam aeParam);
+ void LowLevelSetMuted( bool abX );
+
+ inline void IncRefCount();
+ int GetPackedHandle(int alRef, int alId);
+};
+#endif
+
+
67 include/OpenAL/OAL_SourceManager.h
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2007-2010 (C) - Frictional Games
+ *
+ * This file is part of OALWrapper
+ *
+ * For conditions of distribution and use, see copyright notice in LICENSE
+ */
+#ifndef _OAL_SOURCEMANAGER_H
+#define _OAL_SOURCEMANAGER_H
+
+#include "OAL_Types.h"
+#include "OAL_Helper.h"
+#include "OAL_LoggerObject.h"
+
+#include <SDL/SDL.h>
+
+class cOAL_SourceManager : public iOAL_LoggerObject
+{
+public:
+
+ cOAL_SourceManager();
+ ~cOAL_SourceManager();
+
+ cOAL_Source* GetSource ( int alSourceHandle, bool abUsingAbsoluteIndex = false );
+ cOAL_Source* GetAvailableSource ( unsigned int alPriority, int alNumOfVoices );
+
+ bool Initialize( bool abManageVoices, int alNumSourcesHint, bool abUseThreading, int alUpdateFreq, int alEFXSends = 0 );
+ void Destroy ( );
+
+ void AddActiveStream ( cOAL_Source *apSource );
+ void UpdateStreaming ( );
+
+ inline void ReserveVoices ( int alNum ) { if (!mbManageVoices) alNum = 1; mlAvailableVoices -= alNum; }
+ inline void ReleaseVoices ( int alNum ) { if (!mbManageVoices) alNum = 1; mlAvailableVoices += alNum; }
+
+ inline bool IsThreadAlive ( ) { return mbUseThreading; }
+ inline int GetThreadWaitTime ( ) { return mlThreadWaitTime; }
+
+ inline int GetNumVoices() { return mlNumOfVoices; }
+
+private:
+
+ void LockStreamList();
+ void UnlockStreamList();
+
+ int GetUnpackedSourceId(int alHandle);
+ int GetUnpackedRefCount(int alHandle);
+
+ bool mbManageVoices;
+
+ int mlNumOfVoices;
+ int mlAvailableVoices;
+
+ SDL_mutex* mpStreamListMutex;
+ SDL_Thread* mpUpdaterThread;
+ int mlThreadWaitTime;
+ bool mbUseThreading;
+
+ tSourceVec mvSources;
+ tSourceList mlstStreamingSources;
+
+};
+
+
+#endif
+
+
68 include/OpenAL/OAL_Stream.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2007-2010 (C) - Frictional Games
+ *
+ * This file is part of OALWrapper
+ *
+ * For conditions of distribution and use, see copyright notice in LICENSE
+ */
+#ifndef _OAL_STREAM_H
+#define _OAL_STREAM_H
+
+#include "OAL_AudioData.h"
+
+//-----------------------------------------------------------------------------------
+
+class cOAL_Stream : public iOAL_AudioData
+{
+public:
+
+ cOAL_Stream();
+ ~cOAL_Stream();
+
+ /////////////////////////////////////
+
+ void AddBoundSource(cOAL_Source* apSource) { if(apSource) mpBoundSource = apSource; }
+ void RemoveBoundSource(cOAL_Source* apSource) { if(apSource && (apSource == mpBoundSource)) mpBoundSource = NULL; }
+
+ void Update();
+
+ void DoBuffering();
+
+ virtual void Seek(float afWhere, bool abForceRebuffer=true)=0;
+ virtual double GetTime()=0;
+
+ inline bool IsLocked() { return mpBoundSource != NULL; }
+
+ // Streaming Config stuff
+ static inline void SetBufferCount(unsigned int alBufferCount) { if(alBufferCount >= 1) mlBufferCount = alBufferCount; }
+ static inline void SetBufferSize(unsigned int alBufferSize) { if(alBufferSize >= 1) mlBufferSize = alBufferSize * STREAMING_BLOCK_SIZE; }
+
+ static inline unsigned int GetBufferSize() { return mlBufferSize; }
+ static inline unsigned int GetBufferCount() { return mlBufferCount; }
+
+ ALuint* GetOALBufferPointer() { return mvOALBufferIDs; }
+
+ double GetProcessedBuffersTime() { return mfProcessedBuffersTime; }
+
+ bool HasBufferUnderrun();
+ bool NeedsRebuffering() { return mbNeedsRebuffering; }
+
+protected:
+ virtual bool Stream(cOAL_Buffer* apDestBuffer)=0;
+
+ cOAL_Source* mpBoundSource;
+
+ static unsigned int mlBufferCount;
+ static unsigned int mlBufferSize;
+
+ bool mbNeedsRebuffering;
+
+ double mfProcessedBuffersTime;
+
+ char* mpPCMBuffer;
+ ALuint* mvOALBufferIDs;
+};
+
+//-----------------------------------------------------------------------------------
+
+#endif // _OAL_STREAM_H
198 include/OpenAL/OAL_Types.h
@@ -0,0 +1,198 @@
+/*
+ * Copyright 2007-2010 (C) - Frictional Games
+ *
+ * This file is part of OALWrapper
+ *
+ * For conditions of distribution and use, see copyright notice in LICENSE
+ */
+/**
+ @file OAL_Types.h
+ @author Luis Rodero
+ @date 2006-10-02
+ @version 0.1
+ Types for OpenAL
+*/
+
+
+#ifndef _OAL_TYPES_H
+#define _OAL_TYPES_H
+
+
+////////////////////////////////
+// Extension stuff
+
+#define NUM_EXTENSIONS 13
+#define NUM_ALC_EXTENSIONS 4
+//#define NUM_AL_EXTENSIONS 9
+
+#define OAL_ALC_EXT_CAPTURE 0
+#define OAL_ALC_EXT_EFX 1
+#define OAL_AL_EXT_OFFSET 2
+#define OAL_AL_EXT_LINEAR_DISTANCE 3
+#define OAL_AL_EXT_EXPONENT_DISTANCE 4
+#define OAL_EAX 5
+#define OAL_EAX2_0 6
+#define OAL_EAX3_0 7
+#define OAL_EAX4_0 8
+#define OAL_EAX5_0 9
+#define OAL_EAX_RAM 10
+
+////////////////////////////////////////////////////
+// Specifies the size of the memory unit in streaming ( currently 4 KB )
+// (buffer sizes are set using multiples of this unit)
+#define STREAMING_BLOCK_SIZE 4096
+//#define BUFFERCOUNT 8
+
+#if defined(__ppc__)
+ #define SYS_ENDIANNESS 1
+#else
+ #define SYS_ENDIANNESS 0
+#endif
+
+#define OAL_FREE -3
+#define OAL_ALL -2
+
+#include <string>
+#include <vector>
+#include <list>
+
+#include <AL/al.h>
+#include <AL/alc.h>
+#include <AL/alut.h>
+#include <AL/alext.h>
+#include <AL/efx.h>
+#include <AL/efx-creative.h>
+
+using namespace std;
+
+class cOAL_Source;
+class cOAL_Sample;
+class cOAL_Stream;
+class cOAL_Buffer;
+
+typedef vector<cOAL_Source*> tSourceVec;
+typedef tSourceVec::iterator tSourceVecIt;
+
+//typedef set<cOAL_Source*> tSourceSet;
+//typedef set<cOAL_Source*>::iterator tSourceSetIt;
+
+typedef list<cOAL_Source*> tSourceList;
+typedef tSourceList::iterator tSourceListIt;
+
+typedef list<cOAL_Sample*> tSampleList;
+typedef tSampleList::iterator tSampleListIt;
+
+typedef list<cOAL_Stream*> tStreamList;
+typedef tStreamList::iterator tStreamListIt;
+
+typedef vector<cOAL_Buffer*> tBufferVec;
+typedef tBufferVec::iterator tBufferVecIt;
+
+
+class cOAL_EffectSlot;
+
+class cOAL_Filter;
+class cOAL_Filter_LowPass;
+class cOAL_Filter_HighPass;
+class cOAL_Filter_BandPass;
+
+class cOAL_Effect;
+class cOAL_Effect_Reverb;
+
+class cOAL_SourceSend;
+
+typedef vector<cOAL_EffectSlot*> tSlotVector;
+typedef vector<cOAL_EffectSlot*>::iterator tSlotVectorIt;
+
+typedef list<cOAL_Effect*> tOALEffectList;
+typedef list<cOAL_Effect*>::iterator tOALEffectListIt;
+
+typedef list<cOAL_Filter*> tOALFilterList;
+typedef list<cOAL_Filter*>::iterator tOALFilterListIt;
+
+typedef vector<cOAL_SourceSend*> tSendVector;
+typedef vector<cOAL_SourceSend*>::iterator tSendVectorIt;
+
+typedef enum
+{
+ eOAL_SourceStatus_Free,
+ eOAL_SourceStatus_Busy,
+ eOAL_SourceStatus_Busy_BufferUnderrun,
+ eOAL_SourceStatus_Default
+} eOAL_SourceStatus;
+
+typedef enum
+{
+ eOAL_DistanceModel_Inverse,
+ eOAL_DistanceModel_Inverse_Clamped,
+ eOAL_DistanceModel_Linear,
+ eOAL_DistanceModel_Linear_Clamped,
+ eOAL_DistanceModel_Exponent,
+ eOAL_DistanceModel_Exponent_Clamped,
+ eOAL_DistanceModel_None,
+ eOAL_DistanceModel_Default,
+} eOAL_DistanceModel;
+
+
+
+//////////////////////////////////////////
+/// EFX Stuff
+//////////////////////////////////////////
+
+
+// Function pointers
+////////////////////
+
+// Effect slots
+
+extern LPALGENAUXILIARYEFFECTSLOTS alGenAuxiliaryEffectSlots;
+extern LPALDELETEAUXILIARYEFFECTSLOTS alDeleteAuxiliaryEffectSlots;
+extern LPALISAUXILIARYEFFECTSLOT alIsAuxiliaryEffectSlot;
+extern LPALAUXILIARYEFFECTSLOTI alAuxiliaryEffectSloti;
+extern LPALAUXILIARYEFFECTSLOTIV alAuxiliaryEffectSlotiv;
+extern LPALAUXILIARYEFFECTSLOTF alAuxiliaryEffectSlotf;
+extern LPALAUXILIARYEFFECTSLOTFV alAuxiliaryEffectSlotfv;
+extern LPALGETAUXILIARYEFFECTSLOTI alGetAuxiliaryEffectSloti;
+extern LPALGETAUXILIARYEFFECTSLOTIV alGetAuxiliaryEffectSlotiv;
+extern LPALGETAUXILIARYEFFECTSLOTF alGetAuxiliaryEffectSlotf;
+extern LPALGETAUXILIARYEFFECTSLOTFV alGetAuxiliaryEffectSlotfv;
+
+// Effects
+
+extern LPALGENEFFECTS alGenEffects;
+extern LPALDELETEEFFECTS alDeleteEffects;
+extern LPALISEFFECT alIsEffect;
+extern LPALEFFECTI alEffecti;
+extern LPALEFFECTIV alEffectiv;
+extern LPALEFFECTF alEffectf;
+extern LPALEFFECTFV alEffectfv;
+extern LPALGETEFFECTI alGetEffecti;
+extern LPALGETEFFECTIV alGetEffectiv;
+extern LPALGETEFFECTF alGetEffectf;
+extern LPALGETEFFECTFV alGetEffectfv;
+
+// Filters
+
+extern LPALGENFILTERS alGenFilters;
+extern LPALDELETEFILTERS alDeleteFilters;
+extern LPALISFILTER alIsFilter;
+extern LPALFILTERI alFilteri;
+extern LPALFILTERIV alFilteriv;
+extern LPALFILTERF alFilterf;
+extern LPALFILTERFV alFilterfv;
+extern LPALGETFILTERI alGetFilteri;
+extern LPALGETFILTERIV alGetFilteriv;
+extern LPALGETFILTERF alGetFilterf;
+extern LPALGETFILTERFV alGetFilterfv;
+
+
+typedef enum _eOALFilterType
+{
+ eOALFilterType_LowPass,
+ eOALFilterType_HighPass,
+ eOALFilterType_BandPass,
+ eOALFilterType_Null,
+} eOALFilterType;
+
+
+#endif // _OAL_TYPES_H
33 include/OpenAL/OAL_WAVSample.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2007-2010 (C) - Frictional Games
+ *
+ * This file is part of OALWrapper
+ *
+ * For conditions of distribution and use, see copyright notice in LICENSE
+ */
+/**
+ @file OAL_OggSample.h
+ @author Luis Rodero
+ @date 2006-10-02
+ @version 0.1
+ Derived class for containing WAV Sample data
+*/
+
+#ifndef _OAL_WAVSAMPLE_H
+#define _OAL_WAVSAMPLE_H
+
+#include "OpenAL/OAL_Sample.h"
+#include "OpenAL/OAL_Helper.h"
+
+//-----------------------------------------------------------
+
+class cOAL_WAVSample : public cOAL_Sample
+{
+public:
+ bool CreateFromFile(const wstring& asFilename);
+protected:
+};
+
+//-----------------------------------------------------------
+
+#endif // _OAL_SAMPLE_H
73 sources/OpenAL/OAL_AudioData.cpp
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2007-2010 (C) - Frictional Games
+ *
+ * This file is part of OALWrapper
+ *
+ * For conditions of distribution and use, see copyright notice in LICENSE
+ */
+#include "OpenAL/OAL_AudioData.h"
+
+#include "OpenAL/OAL_Buffer.h"
+
+#include "system/LowLevelSystem.h"
+
+//-------------------------------------------------------------------------------
+
+class cOAL_Buffer;
+class cOAL_Source;
+
+iOAL_AudioData::iOAL_AudioData(eOAL_AudioDataType aType, int alBuffersToCreate)
+{
+ mType = aType;
+ for(int i=0;i<alBuffersToCreate;++i)
+ mvBuffers.push_back(hplNew(cOAL_Buffer,(this)));
+
+ Reset();
+}
+
+iOAL_AudioData::~iOAL_AudioData()
+{
+ for(int i=0;i<(int)mvBuffers.size();++i)