Version
menu_open
link
Wwise SDK 2021.1.14
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  Version: v2021.1.14 Build: 6590
25  Copyright (c) 2006-2023 Audiokinetic Inc.
26 *******************************************************************************/
27 
28 // AkTypes.h
29 
30 /// \file
31 /// Data type definitions.
32 
33 #pragma once
34 
35 #if defined(_GAMING_XBOX_SCARLETT)
36  #define AK_XBOXSERIESX
37  #define AK_WEM_OPUS_HW_SUPPORTED
38 #elif defined(_GAMING_XBOX_XBOXONE)
39  #define AK_XBOXONEGC
40 #else
41 #error "Unsupported version of Gaming.Xbox platform"
42 #endif
43 
44 #include <limits.h>
45 #include <winapifamily.h>
46 
47 #ifndef __cplusplus
48  #include <wchar.h> // wchar_t not a built-in type in C
49 #endif
50 
51 #define AK_XBOX
52 #define AK_XBOXGC
53 #define AK_HARDWARE_DECODING_SUPPORTED //For XMA
54 #define AK_CPU_X86_64 ///< Compiling for 64-bit x86 CPU
55 
56 #define AK_XMA_SUPPORTED ///< Supports XMA codec
57 #define AK_DVR_BYPASS_SUPPORTED ///< Supports feature which blocks DVRs from recording BGM
58 
59 #define AK_DEVICE_MEMORY_SUPPORTED ///< Supports special memory allocations shared with special hardware co-processors
60 
61 #define AK_XAUDIO2_FLAGS XAUDIO2_DO_NOT_USE_SHAPE
62 
63 #define AK_WASAPI ///< Enable WASAPI sink
64 
65 #define AK_COMM_NO_DYNAMIC_PORTS ///< Platform does not support dynamic/ephemeral ports for communication
66 #define AK_DEVICE_CACHE_SUPPORT ///< Supports output device notifications & cache
67 
68 #define AK_SUPPORT_WCHAR ///< Can support wchar
69 #define AK_OS_WCHAR ///< Use wchar natively
70 
71 #define AK_RESTRICT __restrict ///< Refers to the __restrict compilation flag available on some platforms
72 #define AK_EXPECT_FALSE( _x ) (_x)
73 #define AkForceInline __forceinline ///< Force inlining
74 #define AkNoInline __declspec(noinline) ///< Disable inlining
75 
76 #define AK_SIMD_ALIGNMENT 16 ///< Platform-specific alignment requirement for SIMD data
77 #define AK_ALIGN_SIMD( _declaration_ ) AK_ALIGN( _declaration_, AK_SIMD_ALIGNMENT ) ///< Platform-specific alignment requirement for SIMD data
78 #define AK_BUFFER_ALIGNMENT AK_SIMD_ALIGNMENT
79 
80 /// These flags define that a given class of SIMD extensions is available.
81 /// Note that runtime checks MUST be done before entering code that explicitly utilizes one of these classes
82 #define AKSIMD_V4F32_SUPPORTED
83 #if defined(_GAMING_XBOX_XBOXONE)
84 #define AKSIMD_AVX_SUPPORTED // AVX supported on XB1
85 #elif defined(_GAMING_XBOX_SCARLETT)
86 #define AKSIMD_AVX_SUPPORTED // AVX supported on Xbox Series X
87 #define AKSIMD_AVX2_SUPPORTED // ..and AVX2 as welll
88 #endif
89 
90 
91 #define AK_DLLEXPORT __declspec(dllexport)
92 #define AK_DLLIMPORT __declspec(dllimport)
93 
94 typedef unsigned char AkUInt8; ///< Unsigned 8-bit integer
95 typedef unsigned short AkUInt16; ///< Unsigned 16-bit integer
96 typedef unsigned long AkUInt32; ///< Unsigned 32-bit integer
97 typedef unsigned __int64 AkUInt64; ///< Unsigned 64-bit integer
98 
99 typedef __int64 AkIntPtr; ///< Integer type for pointers
100 typedef unsigned __int64 AkUIntPtr; ///< Integer (unsigned) type for pointers
101 
102 typedef char AkInt8; ///< Signed 8-bit integer
103 typedef short AkInt16; ///< Signed 16-bit integer
104 typedef long AkInt32; ///< Signed 32-bit integer
105 typedef __int64 AkInt64; ///< Signed 64-bit integer
106 
107 typedef wchar_t AkOSChar; ///< Generic character string
108 
109 typedef float AkReal32; ///< 32-bit floating point
110 typedef double AkReal64; ///< 64-bit floating point
111 
112 typedef void * AkThread; ///< Thread handle
113 typedef AkUInt32 AkThreadID; ///< Thread ID
114 typedef AkUInt32 (__stdcall *AkThreadRoutine)( void* lpThreadParameter ); ///< Thread routine
115 typedef void * AkEvent; ///< Event handle
116 typedef void * AkSemaphore; ///< Semaphore handle
117 
118 typedef void * AkFileHandle; ///< File handle
119 typedef wchar_t AkUtf16; ///< Type for 2 byte chars. Used for communication
120  ///< with the authoring tool.
121 
122 typedef void* AkStackTrace[ 64 ];
123 
124 #define AK_UINT_MAX UINT_MAX
125 
126 // For strings.
127 #define AK_MAX_PATH 260 ///< Maximum path length.
128 
129 typedef AkUInt32 AkFourcc; ///< Riff chunk
130 
131 /// Create Riff chunk
132 #define AkmmioFOURCC( ch0, ch1, ch2, ch3 ) \
133  ( (AkFourcc)(AkUInt8)(ch0) | ( (AkFourcc)(AkUInt8)(ch1) << 8 ) | \
134  ( (AkFourcc)(AkUInt8)(ch2) << 16 ) | ( (AkFourcc)(AkUInt8)(ch3) << 24 ) )
135 
136 #define AK_BANK_PLATFORM_DATA_ALIGNMENT (2048) ///< Required memory alignment for bank loading by memory address (see LoadBank()); equivalent to SHAPE_XMA_INPUT_BUFFER_ALIGNMENT on XboxOne.
137 #define AK_BANK_PLATFORM_ALLOC_TYPE AkAPUAlloc
138 
139 #define AK_VM_DEVICE_PAGE_SIZE (2048) ///< Page size of device memory; equivalent to SHAPE_XMA_INPUT_BUFFER_ALIGNMENT.
140 
141 /// Format for printing AkOSChar string using OutputDebugMsgV
142 /// Corresponds to "%ls" if AK_OS_WCHAR, else "%s".
143 /// \remark Usage: AKPLATFORM::OutputDebugMsgV(AKTEXT("Print this string: " AK_OSCHAR_FMT "\n", msg));
144 #define AK_OSCHAR_FMT "%ls"
145 
146 /// Macro that takes a string litteral and changes it to an AkOSChar string at compile time
147 /// \remark This is similar to the TEXT() and _T() macros that can be used to turn string litterals into wchar_t strings
148 /// \remark Usage: AKTEXT( "Some Text" )
149 #define AKTEXT(x) L ## x
150 
151 /// Default open should be asyunchronous on Xbox.
152 #define AK_ASYNC_OPEN_DEFAULT (true) ///< Refers to asynchronous file opening in default low-level IO.
153 
154 #define AK_COMM_NO_DYNAMIC_PORTS ///< Debugging ports must be defined in advance in MicrosoftGame.config
155 
156 #define AK_COMM_DISABLE_ON_SUSPEND ///< Platform requires that networking resources be cleaned up on suspend
157 
158 #define AK_WWISE_XMEMALLOC_ALLOCATORID 215 ///< eXALLOCAllocatorId_MiddlewareReservedMin + 23 (...as in "W" for Wwise)
float AkReal32
32-bit floating point
Definition: AkTypes.h:70
pthread_t AkThread
Thread handle.
Definition: AkTypes.h:73
semaphore_t AkEvent
Definition: AkTypes.h:73
pthread_t AkThreadID
Thread ID.
Definition: AkTypes.h:74
intptr_t AkIntPtr
Definition: AkTypes.h:66
uint8_t AkUInt8
Unsigned 8-bit integer.
Definition: AkTypes.h:57
uintptr_t AkUIntPtr
Definition: AkTypes.h:61
double AkReal64
64-bit floating point
Definition: AkTypes.h:71
char AkOSChar
Generic character string.
Definition: AkTypes.h:68
FILE * AkFileHandle
File handle.
Definition: AkTypes.h:80
AkUInt16 AkUtf16
Definition: AkTypes.h:82
int16_t AkInt16
Signed 16-bit integer.
Definition: AkTypes.h:63
uint64_t AkUInt64
Unsigned 64-bit integer.
Definition: AkTypes.h:60
nn::os::ThreadFunction AkThreadRoutine
Thread routine.
Definition: AkTypes.h:99
int8_t AkInt8
Signed 8-bit integer.
Definition: AkTypes.h:62
uint16_t AkUInt16
Unsigned 16-bit integer.
Definition: AkTypes.h:58
uint32_t AkUInt32
Unsigned 32-bit integer.
Definition: AkTypes.h:59
void * AkStackTrace[64]
Definition: AkTypes.h:58
AkUInt32 AkFourcc
Riff chunk.
Definition: AkTypes.h:90
int32_t AkInt32
Signed 32-bit integer.
Definition: AkTypes.h:64
semaphore_t AkSemaphore
Definition: AkTypes.h:74
int64_t AkInt64
Signed 64-bit integer.
Definition: AkTypes.h:65

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