Version
menu_open
link
Target Platform(s):
Wwise SDK 2022.1.11
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) 2024 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 #if !defined(AK_WIN )
43  #define AK_WIN ///< Compiling for Windows
44 #endif
45 
46 #if defined _M_IX86
47  #define AK_CPU_X86 ///< Compiling for 32-bit x86 CPU
48 #elif defined _M_AMD64
49  #define AK_CPU_X86_64 ///< Compiling for 64-bit x86 CPU
50 #elif defined _M_ARM
51  #define AK_CPU_ARM
52  #define AK_CPU_ARM_NEON
53 #elif defined _M_ARM64
54  #define AK_CPU_ARM_64
55  #define AK_CPU_ARM_NEON
56 #endif
57 
58 #ifdef WINAPI_FAMILY
59  #include <winapifamily.h>
60  #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
61  #define AK_USE_UWP_API
62  #define AK_USE_METRO_API // deprecated
63  #ifdef __cplusplus_winrt
64  #define AK_UWP_CPP_CX // To test for UWP code which uses Microsoft's C++/CX extended language (not all projects do)
65  #endif
66  #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PC_APP)
67  #if !defined(AK_WIN_UNIVERSAL_APP)
68  #define AK_WIN_UNIVERSAL_APP
69  #endif
70  #endif
71  #endif
72 #endif
73 
74 #ifndef _WIN32_WINNT
75  #ifdef AK_WIN_UNIVERSAL_APP
76  #define _WIN32_WINNT 0x0A00 // _WIN32_WINNT_WIN10
77  #else
78  #define _WIN32_WINNT 0x0602
79  #endif
80 #endif
81 
82 #define AK_71FROMSTEREOMIXER
83 #define AK_51FROMSTEREOMIXER
84 
85 #define AK_SUPPORT_THREADS
86 #define AK_SUPPORT_WCHAR ///< Can support wchar
87 #define AK_OS_WCHAR ///< Use wchar natively
88 
89 #define AK_SUPPORT_THREAD_LOCAL ///< Support thread_local C++11 keyword with no restrictions
90 
91 #define AK_RESTRICT __restrict ///< Refers to the __restrict compilation flag available on some platforms
92 #define AK_EXPECT_FALSE( _x ) (_x)
93 #define AkForceInline __forceinline ///< Force inlining
94 #define AkNoInline __declspec(noinline) ///< Disable inlining
95 
96 #define AK_SIMD_ALIGNMENT 16 ///< Platform-specific alignment requirement for SIMD data
97 #define AK_ALIGN_SIMD( _declaration_ ) AK_ALIGN( _declaration_, AK_SIMD_ALIGNMENT ) ///< Platform-specific alignment requirement for SIMD data
98 #define AK_BUFFER_ALIGNMENT AK_SIMD_ALIGNMENT
99 #define AK_XAUDIO2_FLAGS 0
100 
101 #ifdef AK_USE_UWP_API
102 #define AK_WINRT_DEVICENOTIFICATION
103 #else
104 #define AK_DEVICE_CACHE_SUPPORT ///< Supports output device notifications & cache
105 #endif
106 
107 #if defined AK_CPU_X86 || defined AK_CPU_X86_64 || defined AK_CPU_ARM_NEON
108 #define AKSIMD_V4F32_SUPPORTED
109 #endif
110 
111 /// These flags defined that a given class of SIMD extensions is available.
112 /// Note that runtime checks MUST be done before entering code that explicitly utilizes one of these classes
113 #if defined AK_CPU_X86_64
114 #define AKSIMD_AVX2_SUPPORTED
115 #define AKSIMD_AVX_SUPPORTED
116 #endif
117 
118 #define AKSOUNDENGINE_CALL __cdecl ///< Calling convention for the Wwise API
119 
120 #define AK_DLLEXPORT __declspec(dllexport)
121 #define AK_DLLIMPORT __declspec(dllimport)
122 
123 typedef wchar_t AkOSChar; ///< Generic character string
124 typedef wchar_t AkUtf16; ///< Type for 2 byte chars. Used for communication
125  ///< with the authoring tool.
126 
127 typedef void * AkThread; ///< Thread handle
128 typedef unsigned long AkThreadID; ///< Thread ID
129 typedef unsigned long (__stdcall *AkThreadRoutine)( void* lpThreadParameter ); ///< Thread routine
130 
131 typedef void * AkEvent; ///< Event handle
132 typedef void * AkSemaphore; ///< Semaphore handle
133 
134 typedef void * AkFileHandle; ///< File handle
135 
136 typedef void* AkStackTrace[ 64 ];
137 
138 #define AK_UINT_MAX UINT_MAX
139 
140 // For strings.
141 #define AK_MAX_PATH 260 ///< Maximum path length.
142 
143 typedef AkUInt32 AkFourcc; ///< Riff chunk
144 
145 /// Create Riff chunk
146 #define AkmmioFOURCC( ch0, ch1, ch2, ch3 ) \
147  ( (AkFourcc)(AkUInt8)(ch0) | ( (AkFourcc)(AkUInt8)(ch1) << 8 ) | \
148  ( (AkFourcc)(AkUInt8)(ch2) << 16 ) | ( (AkFourcc)(AkUInt8)(ch3) << 24 ) )
149 
150 #define AK_BANK_PLATFORM_DATA_ALIGNMENT (16) ///< Required memory alignment for bank loading by memory address (see LoadBank())
151 
152 /// Format for printing AkOSChar string using OutputDebugMsgV
153 /// Corresponds to "%ls" if AK_OS_WCHAR, else "%s".
154 /// \remark Usage: AKPLATFORM::OutputDebugMsgV(AKTEXT("Print this string: " AK_OSCHAR_FMT "\n", msg));
155 #define AK_OSCHAR_FMT "%ls"
156 
157 /// Macro that takes a string litteral and changes it to an AkOSChar string at compile time
158 /// \remark This is similar to the TEXT() and _T() macros that can be used to turn string litterals into wchar_t strings
159 /// \remark Usage: AKTEXT( "Some Text" )
160 #define AKTEXT(x) L ## x
semaphore_t AkEvent
Definition: AkTypes.h:84
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:87
int AkThread
Definition: AkTypes.h:68
uint32_t AkUInt32
Unsigned 32-bit integer.
void * AkStackTrace[64]
Definition: AkTypes.h:61
AkUInt32 AkFourcc
Riff chunk.
Definition: AkTypes.h:84
semaphore_t AkSemaphore
Definition: AkTypes.h:85

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