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