platformAL.h
Engine/source/platformX86UNIX/platformAL.h
Namespaces:
namespace
Public Defines
define
AL_EXT_FUNCTION(ext_name, fn_return, fn_name, fn_args) extern fn_return ( *fn_name)fn_args;
define
AL_EXTENSION(ext_name) extern bool gDoesSupport_##ext_name;
define
AL_FUNCTION(fn_return, fn_name, fn_args) extern fn_return ( *fn_name)fn_args;
define
Public Enumerations
enum
_Anonymous_ { AL_CONTEXT_ALREADY_INSTANTIATED = 0xbaadf00d AL_ENVIRONMENT_ALREADY_INSTANTIATED AL_UNSUPPORTED AL_INVALID_BUFFER AL_ERROR ALC_PROVIDER ALC_PROVIDER_COUNT ALC_PROVIDER_NAME ALC_SPEAKER ALC_SPEAKER_COUNT ALC_SPEAKER_NAME ALC_BUFFER_DYNAMIC_MEMORY_SIZE ALC_BUFFER_DYNAMIC_MEMORY_USAGE ALC_BUFFER_DYNAMIC_COUNT ALC_BUFFER_MEMORY_USAGE ALC_BUFFER_COUNT ALC_BUFFER_LATENCY AL_MIN_DISTANCE AL_MAX_DISTANCE AL_CONE_OUTER_GAIN AL_SOURCE_AMBIENT AL_PAN AL_BUFFER_KEEP_RESIDENT AL_FORMAT_WAVE_EXT AL_ENV_EFFECT_VOLUME_EXT AL_ENV_FLAGS_EXT AL_ENV_DAMPING_EXT AL_ENV_ENVIRONMENT_SIZE_EXT AL_ENV_ROOM_VOLUME_EXT }
enum
_Anonymous_ { AL_ENV_SAMPLE_REVERB_MIX_EXT = 0 AL_ENV_SAMPLE_DIRECT_EXT AL_ENV_SAMPLE_DIRECT_HF_EXT AL_ENV_SAMPLE_ROOM_EXT AL_ENV_SAMPLE_ROOM_HF_EXT AL_ENV_SAMPLE_OBSTRUCTION_EXT AL_ENV_SAMPLE_OBSTRUCTION_LF_RATIO_EXT AL_ENV_SAMPLE_OCCLUSION_EXT AL_ENV_SAMPLE_OCCLUSION_LF_RATIO_EXT AL_ENV_SAMPLE_OCCLUSION_ROOM_RATIO_EXT AL_ENV_SAMPLE_ROOM_ROLLOFF_EXT AL_ENV_SAMPLE_AIR_ABSORPTION_EXT AL_ENV_SAMPLE_OUTSIDE_VOLUME_HF_EXT AL_ENV_SAMPLE_FLAGS_EXT AL_ENV_SAMPLE_COUNT }
enum
_Anonymous_ { AL_ENVIRONMENT_GENERIC = 0 AL_ENVIRONMENT_PADDEDCELL AL_ENVIRONMENT_ROOM AL_ENVIRONMENT_BATHROOM AL_ENVIRONMENT_LIVINGROOM AL_ENVIRONMENT_STONEROOM AL_ENVIRONMENT_AUDITORIUM AL_ENVIRONMENT_CONCERTHALL AL_ENVIRONMENT_CAVE AL_ENVIRONMENT_ARENA AL_ENVIRONMENT_HANGAR AL_ENVIRONMENT_CARPETEDHALLWAY AL_ENVIRONMENT_HALLWAY AL_ENVIRONMENT_STONECORRIDOR AL_ENVIRONMENT_ALLEY AL_ENVIRONMENT_FOREST AL_ENVIRONMENT_CITY AL_ENVIRONMENT_MOUNTAINS AL_ENVIRONMENT_QUARRY AL_ENVIRONMENT_PLAIN AL_ENVIRONMENT_PARKINGLOT AL_ENVIRONMENT_SEWERPIPE AL_ENVIRONMENT_UNDERWATER AL_ENVIRONMENT_DRUGGED AL_ENVIRONMENT_DIZZY AL_ENVIRONMENT_PSYCHOTIC AL_ENVIRONMENT_COUNT }
Detailed Description
Public Defines
AL_EXT_FUNCTION(ext_name, fn_return, fn_name, fn_args) extern fn_return ( *fn_name)fn_args;
AL_EXTENSION(ext_name) extern bool gDoesSupport_##ext_name;
AL_FUNCTION(fn_return, fn_name, fn_args) extern fn_return ( *fn_name)fn_args;
AL_NO_PROTOTYPES()
Public Enumerations
@145
Enumerator
- AL_CONTEXT_ALREADY_INSTANTIATED = 0xbaadf00d
- AL_ENVIRONMENT_ALREADY_INSTANTIATED
- AL_UNSUPPORTED
- AL_INVALID_BUFFER
- AL_ERROR
- ALC_PROVIDER
- ALC_PROVIDER_COUNT
- ALC_PROVIDER_NAME
- ALC_SPEAKER
- ALC_SPEAKER_COUNT
- ALC_SPEAKER_NAME
- ALC_BUFFER_DYNAMIC_MEMORY_SIZE
- ALC_BUFFER_DYNAMIC_MEMORY_USAGE
- ALC_BUFFER_DYNAMIC_COUNT
- ALC_BUFFER_MEMORY_USAGE
- ALC_BUFFER_COUNT
- ALC_BUFFER_LATENCY
- AL_MIN_DISTANCE
- AL_MAX_DISTANCE
- AL_CONE_OUTER_GAIN
- AL_SOURCE_AMBIENT
- AL_PAN
- AL_BUFFER_KEEP_RESIDENT
- AL_FORMAT_WAVE_EXT
- AL_ENV_EFFECT_VOLUME_EXT
- AL_ENV_FLAGS_EXT
- AL_ENV_DAMPING_EXT
- AL_ENV_ENVIRONMENT_SIZE_EXT
- AL_ENV_ROOM_VOLUME_EXT
@146
Enumerator
- AL_ENV_SAMPLE_REVERB_MIX_EXT = 0
- AL_ENV_SAMPLE_DIRECT_EXT
- AL_ENV_SAMPLE_DIRECT_HF_EXT
- AL_ENV_SAMPLE_ROOM_EXT
- AL_ENV_SAMPLE_ROOM_HF_EXT
- AL_ENV_SAMPLE_OBSTRUCTION_EXT
- AL_ENV_SAMPLE_OBSTRUCTION_LF_RATIO_EXT
- AL_ENV_SAMPLE_OCCLUSION_EXT
- AL_ENV_SAMPLE_OCCLUSION_LF_RATIO_EXT
- AL_ENV_SAMPLE_OCCLUSION_ROOM_RATIO_EXT
- AL_ENV_SAMPLE_ROOM_ROLLOFF_EXT
- AL_ENV_SAMPLE_AIR_ABSORPTION_EXT
- AL_ENV_SAMPLE_OUTSIDE_VOLUME_HF_EXT
- AL_ENV_SAMPLE_FLAGS_EXT
- AL_ENV_SAMPLE_COUNT
@147
Enumerator
- AL_ENVIRONMENT_GENERIC = 0
- AL_ENVIRONMENT_PADDEDCELL
- AL_ENVIRONMENT_ROOM
- AL_ENVIRONMENT_BATHROOM
- AL_ENVIRONMENT_LIVINGROOM
- AL_ENVIRONMENT_STONEROOM
- AL_ENVIRONMENT_AUDITORIUM
- AL_ENVIRONMENT_CONCERTHALL
- AL_ENVIRONMENT_CAVE
- AL_ENVIRONMENT_ARENA
- AL_ENVIRONMENT_HANGAR
- AL_ENVIRONMENT_CARPETEDHALLWAY
- AL_ENVIRONMENT_HALLWAY
- AL_ENVIRONMENT_STONECORRIDOR
- AL_ENVIRONMENT_ALLEY
- AL_ENVIRONMENT_FOREST
- AL_ENVIRONMENT_CITY
- AL_ENVIRONMENT_MOUNTAINS
- AL_ENVIRONMENT_QUARRY
- AL_ENVIRONMENT_PLAIN
- AL_ENVIRONMENT_PARKINGLOT
- AL_ENVIRONMENT_SEWERPIPE
- AL_ENVIRONMENT_UNDERWATER
- AL_ENVIRONMENT_DRUGGED
- AL_ENVIRONMENT_DIZZY
- AL_ENVIRONMENT_PSYCHOTIC
- AL_ENVIRONMENT_COUNT
1 2//----------------------------------------------------------------------------- 3// Copyright (c) 2012 GarageGames, LLC 4// 5// Permission is hereby granted, free of charge, to any person obtaining a copy 6// of this software and associated documentation files (the "Software"), to 7// deal in the Software without restriction, including without limitation the 8// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 9// sell copies of the Software, and to permit persons to whom the Software is 10// furnished to do so, subject to the following conditions: 11// 12// The above copyright notice and this permission notice shall be included in 13// all copies or substantial portions of the Software. 14// 15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21// IN THE SOFTWARE. 22//----------------------------------------------------------------------------- 23 24#ifndef _PLATFORMAL_H_ 25#define _PLATFORMAL_H_ 26 27#ifndef _PLATFORM_H_ 28#include "platform/platform.h" 29#endif 30#define AL_NO_PROTOTYPES 31#include <al/al.h> 32#include <al/alc.h> 33#include <al/alut.h> 34 35// extra enums for win32/miles implementation 36enum { 37 // error values 38 AL_CONTEXT_ALREADY_INSTANTIATED = 0xbaadf00d, 39 AL_ENVIRONMENT_ALREADY_INSTANTIATED, 40 AL_UNSUPPORTED, 41 AL_INVALID_BUFFER, 42 AL_ERROR, 43 44 // context extention 45 ALC_PROVIDER, 46 ALC_PROVIDER_COUNT, 47 ALC_PROVIDER_NAME, 48 ALC_SPEAKER, 49 ALC_SPEAKER_COUNT, 50 ALC_SPEAKER_NAME, 51 ALC_BUFFER_DYNAMIC_MEMORY_SIZE, 52 ALC_BUFFER_DYNAMIC_MEMORY_USAGE, 53 ALC_BUFFER_DYNAMIC_COUNT, 54 ALC_BUFFER_MEMORY_USAGE, 55 ALC_BUFFER_COUNT, 56 ALC_BUFFER_LATENCY, 57 58 // misc 3d params 59 AL_MIN_DISTANCE, 60 AL_MAX_DISTANCE, 61 AL_CONE_OUTER_GAIN, 62 63 // relative with pos(0,0,0) won't work for ambient sounds with miles 64 AL_SOURCE_AMBIENT, 65 AL_PAN, 66 67 // other extensions 68 AL_BUFFER_KEEP_RESIDENT, 69 AL_FORMAT_WAVE_EXT, 70 71 // Environment extensions: 72 AL_ENV_EFFECT_VOLUME_EXT, 73 AL_ENV_FLAGS_EXT, 74 AL_ENV_DAMPING_EXT, 75 AL_ENV_ENVIRONMENT_SIZE_EXT, 76 AL_ENV_ROOM_VOLUME_EXT, 77}; 78 79enum { 80 // sample level environment: 81 AL_ENV_SAMPLE_REVERB_MIX_EXT = 0, 82 AL_ENV_SAMPLE_DIRECT_EXT, 83 AL_ENV_SAMPLE_DIRECT_HF_EXT, 84 AL_ENV_SAMPLE_ROOM_EXT, 85 AL_ENV_SAMPLE_ROOM_HF_EXT, 86 AL_ENV_SAMPLE_OBSTRUCTION_EXT, 87 AL_ENV_SAMPLE_OBSTRUCTION_LF_RATIO_EXT, 88 AL_ENV_SAMPLE_OCCLUSION_EXT, 89 AL_ENV_SAMPLE_OCCLUSION_LF_RATIO_EXT, 90 AL_ENV_SAMPLE_OCCLUSION_ROOM_RATIO_EXT, 91 AL_ENV_SAMPLE_ROOM_ROLLOFF_EXT, 92 AL_ENV_SAMPLE_AIR_ABSORPTION_EXT, 93 AL_ENV_SAMPLE_OUTSIDE_VOLUME_HF_EXT, 94 AL_ENV_SAMPLE_FLAGS_EXT, 95 96 AL_ENV_SAMPLE_COUNT, 97}; 98 99// room types: same as miles/eax 100enum { 101 AL_ENVIRONMENT_GENERIC = 0, 102 AL_ENVIRONMENT_PADDEDCELL, 103 AL_ENVIRONMENT_ROOM, 104 AL_ENVIRONMENT_BATHROOM, 105 AL_ENVIRONMENT_LIVINGROOM, 106 AL_ENVIRONMENT_STONEROOM, 107 AL_ENVIRONMENT_AUDITORIUM, 108 AL_ENVIRONMENT_CONCERTHALL, 109 AL_ENVIRONMENT_CAVE, 110 AL_ENVIRONMENT_ARENA, 111 AL_ENVIRONMENT_HANGAR, 112 AL_ENVIRONMENT_CARPETEDHALLWAY, 113 AL_ENVIRONMENT_HALLWAY, 114 AL_ENVIRONMENT_STONECORRIDOR, 115 AL_ENVIRONMENT_ALLEY, 116 AL_ENVIRONMENT_FOREST, 117 AL_ENVIRONMENT_CITY, 118 AL_ENVIRONMENT_MOUNTAINS, 119 AL_ENVIRONMENT_QUARRY, 120 AL_ENVIRONMENT_PLAIN, 121 AL_ENVIRONMENT_PARKINGLOT, 122 AL_ENVIRONMENT_SEWERPIPE, 123 AL_ENVIRONMENT_UNDERWATER, 124 AL_ENVIRONMENT_DRUGGED, 125 AL_ENVIRONMENT_DIZZY, 126 AL_ENVIRONMENT_PSYCHOTIC, 127 128 AL_ENVIRONMENT_COUNT 129}; 130 131// declare OpenAL functions 132#define AL_EXTENSION(ext_name) extern bool gDoesSupport_##ext_name; 133#define AL_FUNCTION(fn_return,fn_name,fn_args) extern fn_return (FN_CDECL *fn_name)fn_args; 134#define AL_EXT_FUNCTION(ext_name,fn_return,fn_name,fn_args) extern fn_return (FN_CDECL *fn_name)fn_args; 135#ifndef _OPENALFN_H_ 136#include <openALFn.h> 137#endif 138 139namespace Audio 140{ 141 142bool libraryInit(const char *library); 143void libraryInitExtensions(); 144void libraryShutdown(); 145 146inline bool doesSupportIASIG() 147{ 148 return gDoesSupport_AL_EXT_IASIG; 149} 150 151inline bool doesSupportDynamix() 152{ 153 return gDoesSupport_AL_EXT_DYNAMIX; 154} 155 156// helpers 157F32 DBToLinear(F32 value); 158F32 linearToDB(F32 value); 159 160} // end namespace Audio 161 162 163#endif // _H_PLATFORMAL_ 164