Version
menu_open
link
Target Platform(s):
Wwise SDK 2022.1.4
AkTypes.h
Go to the documentation of this file.
1 /*******************************************************************************
2 The content of this file includes portions of the AUDIOKINETIC Wwise Technology
3 released in source code form as part of the SDK installer package.
4 
5 Commercial License Usage
6 
7 Licensees holding valid commercial licenses to the AUDIOKINETIC Wwise Technology
8 may use this file in accordance with the end user license agreement provided
9 with the software or, alternatively, in accordance with the terms contained in a
10 written agreement between you and Audiokinetic Inc.
11 
12 Apache License Usage
13 
14 Alternatively, this file may be used under the Apache License, Version 2.0 (the
15 "Apache License"); you may not use this file except in compliance with the
16 Apache License. You may obtain a copy of the Apache License at
17 http://www.apache.org/licenses/LICENSE-2.0.
18 
19 Unless required by applicable law or agreed to in writing, software distributed
20 under the Apache License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
21 OR CONDITIONS OF ANY KIND, either express or implied. See the Apache License for
22 the specific language governing permissions and limitations under the License.
23 
24  Copyright (c) 2023 Audiokinetic Inc.
25 *******************************************************************************/
26 
27 // AkTypes.h
28 
29 /// \file
30 /// Data type definitions.
31 
32 #pragma once
33 
35 
36 #include <limits.h>
37 
38 #ifndef __cplusplus
39  #include <wchar.h> // wchar_t not a built-in type in C
40 #endif
41 
42 #define AK_WIN ///< Compiling for Windows
43 
44 #if defined _M_IX86
45  #define AK_CPU_X86 ///< Compiling for 32-bit x86 CPU
46 #elif defined _M_AMD64
47  #define AK_CPU_X86_64 ///< Compiling for 64-bit x86 CPU
48 #elif defined _M_ARM
49  #define AK_CPU_ARM
50  #define AK_CPU_ARM_NEON
51 #elif defined _M_ARM64
52  #define AK_CPU_ARM_64
53  #define AK_CPU_ARM_NEON
54 #endif
55 
56 #ifdef WINAPI_FAMILY
57  #include <winapifamily.h>
58  #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
59  #define AK_USE_UWP_API
60  #define AK_USE_METRO_API // deprecated
61  #ifdef __cplusplus_winrt
62  #define AK_UWP_CPP_CX // To test for UWP code which uses Microsoft's C++/CX extended language (not all projects do)
63  #endif
64  #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PC_APP)
65  #define AK_WIN_UNIVERSAL_APP
66  #endif
67  #endif
68 #endif
69 
70 #ifndef _WIN32_WINNT
71  #ifdef AK_WIN_UNIVERSAL_APP
72  #define _WIN32_WINNT 0x0A00 // _WIN32_WINNT_WIN10
73  #else
74  #define _WIN32_WINNT 0x0602
75  #endif
76 #endif
77 
78 #define AK_71FROMSTEREOMIXER
79 #define AK_51FROMSTEREOMIXER
80 
81 #define AK_SUPPORT_THREADS
82 #define AK_SUPPORT_WCHAR ///< Can support wchar
83 #define AK_OS_WCHAR ///< Use wchar natively
84 
85 #define AK_SUPPORT_THREAD_LOCAL ///< Support thread_local C++11 keyword with no restrictions
86 
87 #define AK_RESTRICT __restrict ///< Refers to the __restrict compilation flag available on some platforms
88 #define AK_EXPECT_FALSE( _x ) (_x)
89 #define AkForceInline __forceinline ///< Force inlining
90 #define AkNoInline __declspec(noinline) ///< Disable inlining
91 
92 #define AK_SIMD_ALIGNMENT 16 ///< Platform-specific alignment requirement for SIMD data
93 #define AK_ALIGN_SIMD( _declaration_ ) AK_ALIGN( _declaration_, AK_SIMD_ALIGNMENT ) ///< Platform-specific alignment requirement for SIMD data
94 #define AK_BUFFER_ALIGNMENT AK_SIMD_ALIGNMENT
95 #define AK_XAUDIO2_FLAGS 0
96 
97 #ifdef AK_USE_UWP_API
98 #define AK_WINRT_DEVICENOTIFICATION
99 #else
100 #define AK_DEVICE_CACHE_SUPPORT ///< Supports output device notifications & cache
101 #endif
102 
103 #if defined AK_CPU_X86 || defined AK_CPU_X86_64 || defined AK_CPU_ARM_NEON
104 #define AKSIMD_V4F32_SUPPORTED
105 #endif
106 
107 /// These flags defined that a given class of SIMD extensions is available.
108 /// Note that runtime checks MUST be done before entering code that explicitly utilizes one of these classes
109 #if defined AK_CPU_X86_64
110 #define AKSIMD_AVX2_SUPPORTED
111 #define AKSIMD_AVX_SUPPORTED
112 #endif
113 
114 #define AKSOUNDENGINE_CALL __cdecl ///< Calling convention for the Wwise API
115 
116 #define AK_DLLEXPORT __declspec(dllexport)
117 #define AK_DLLIMPORT __declspec(dllimport)
118 
119 typedef wchar_t AkOSChar; ///< Generic character string
120 typedef wchar_t AkUtf16; ///< Type for 2 byte chars. Used for communication
121  ///< with the authoring tool.
122 
123 typedef void * AkThread; ///< Thread handle
124 typedef unsigned long AkThreadID; ///< Thread ID
125 typedef unsigned long (__stdcall *AkThreadRoutine)( void* lpThreadParameter ); ///< Thread routine
126 
127 typedef void * AkEvent; ///< Event handle
128 typedef void * AkSemaphore; ///< Semaphore handle
129 
130 typedef void * AkFileHandle; ///< File handle
131 
132 typedef void* AkStackTrace[ 64 ];
133 
134 #define AK_UINT_MAX UINT_MAX
135 
136 // For strings.
137 #define AK_MAX_PATH 260 ///< Maximum path length.
138 
139 typedef AkUInt32 AkFourcc; ///< Riff chunk
140 
141 /// Create Riff chunk
142 #define AkmmioFOURCC( ch0, ch1, ch2, ch3 ) \
143  ( (AkFourcc)(AkUInt8)(ch0) | ( (AkFourcc)(AkUInt8)(ch1) << 8 ) | \
144  ( (AkFourcc)(AkUInt8)(ch2) << 16 ) | ( (AkFourcc)(AkUInt8)(ch3) << 24 ) )
145 
146 #define AK_BANK_PLATFORM_DATA_ALIGNMENT (16) ///< Required memory alignment for bank loading by memory address (see LoadBank())
147 
148 /// Format for printing AkOSChar string using OutputDebugMsgV
149 /// Corresponds to "%ls" if AK_OS_WCHAR, else "%s".
150 /// \remark Usage: AKPLATFORM::OutputDebugMsgV(AKTEXT("Print this string: " AK_OSCHAR_FMT "\n", msg));
151 #define AK_OSCHAR_FMT "%ls"
152 
153 /// Macro that takes a string litteral and changes it to an AkOSChar string at compile time
154 /// \remark This is similar to the TEXT() and _T() macros that can be used to turn string litterals into wchar_t strings
155 /// \remark Usage: AKTEXT( "Some Text" )
156 #define AKTEXT(x) L ## x
semaphore_t AkEvent
Definition: AkTypes.h:73
int AkThreadID
Definition: AkTypes.h:69
char AkOSChar
Generic character string.
Definition: AkTypes.h:60
FILE * AkFileHandle
File handle.
Definition: AkTypes.h:77
AkUInt16 AkUtf16
Definition: AkTypes.h:61
nn::os::ThreadFunction AkThreadRoutine
Thread routine.
Definition: AkTypes.h:85
int AkThread
Definition: AkTypes.h:68
uint32_t AkUInt32
Unsigned 32-bit integer.
Definition: AkNumeralTypes.h:38
void * AkStackTrace[64]
Definition: AkTypes.h:59
AkUInt32 AkFourcc
Riff chunk.
Definition: AkTypes.h:84
semaphore_t AkSemaphore
Definition: AkTypes.h:74

Was this page helpful?

Need Support?

Questions? Problems? Need more info? Contact us, and we can help!

Visit our Support page

Tell us about your project. We're here to help.

Register your project and we'll help you get started with no strings attached!

Get started with Wwise