Table of Contents

Wwise SDK 2019.1.8
AkTypes.h
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: <VERSION> Build: <BUILDNUMBER>
25  Copyright (c) <COPYRIGHTYEAR> Audiokinetic Inc.
26 *******************************************************************************/
27 
28 // AkTypes.h
29 
30 /// \file
31 /// Data type definitions.
32 
33 #pragma once
34 
35 #include <stdint.h>
36 #include <limits.h>
37 #include <stddef.h>
38 #include <libdbg.h>
39 #include <sceconst.h>
40 #include <scetypes.h>
41 #include <kernel\eventflag.h>
42 #include <fios2.h>
43 #include <kernel.h>
44 
45 #define AK_PS4 ///< Compiling for PS4
46 #define AK_SONY ///< Sony platform
47 
48 #define AK_SONY_ACP_SUPPORTED ///< Supports Sony Audio co-processor
49 #define AK_ATRAC9_SUPPORTED ///< Supports ATRAC9 codec
50 #define AK_DVR_BYPASS_SUPPORTED ///< Supports feature which blocks DVRs from recording BGM
51 
52 #define AK_LFECENTER ///< Internal use
53 #define AK_REARCHANNELS ///< Internal use
54 #define AK_SUPPORT_WCHAR ///< Can support wchar
55 #define AK_71FROM51MIXER ///< Internal use
56 #define AK_71FROMSTEREOMIXER ///< Internal use
57 #define AK_71AUDIO ///< Internal use
58 //#define AK_OS_WCHAR
59 
60 //#define AK_ENABLE_RAZOR_PROFILING
61 
62 #define AK_CPU_X86_64
63 
64 #define AK_RESTRICT __restrict ///< Refers to the __restrict compilation flag available on some platforms
65 #define AK_EXPECT_FALSE( _x ) ( _x )
66 #define AkRegister
67 #define AkForceInline inline __attribute__((always_inline)) ///< Force inlining
68 #define AkNoInline __attribute__((noinline))
69 
70 #define AK_SIMD_ALIGNMENT 16 ///< Platform-specific alignment requirement for SIMD data
71 #define AK_ALIGN_SIMD( __Declaration__ ) __Declaration__ __attribute__((aligned(AK_SIMD_ALIGNMENT))) ///< Platform-specific alignment requirement for SIMD data
72 #define AK_ALIGN_DMA ///< Platform-specific data alignment for DMA transfers
73 #define AK_ALIGN_FASTDMA ///< Platform-specific data alignment for faster DMA transfers
74 #define AK_ALIGN_SIZE_FOR_DMA( __Size__ ) (__Size__) ///< Used to align sizes to next 16 byte boundary on platfroms that require it
75 #define AK_BUFFER_ALIGNMENT AK_SIMD_ALIGNMENT
76 #define AKSIMD_V4F32_SUPPORTED
77 
78 #define AK_DLLEXPORT __declspec(dllexport)
79 #define AK_DLLIMPORT __declspec(dllimport)
80 
81 typedef uint8_t AkUInt8; ///< Unsigned 8-bit integer
82 typedef uint16_t AkUInt16; ///< Unsigned 16-bit integer
83 typedef uint32_t AkUInt32; ///< Unsigned 32-bit integer
84 typedef uint64_t AkUInt64; ///< Unsigned 64-bit integer
85 
86 #ifdef AK_CPU_X86_64
87 typedef int64_t AkIntPtr;
88 typedef uint64_t AkUIntPtr;
89 #else
90 typedef int AkIntPtr;
91 typedef unsigned int AkUIntPtr;
92 #endif
93 
94 typedef int8_t AkInt8; ///< Signed 8-bit integer
95 typedef int16_t AkInt16; ///< Signed 16-bit integer
96 typedef int32_t AkInt32; ///< Signed 32-bit integer
97 typedef int64_t AkInt64; ///< Signed 64-bit integer
98 
99 typedef char AkOSChar; ///< Generic character string
100 
101 typedef float AkReal32; ///< 32-bit floating point
102 typedef double AkReal64; ///< 64-bit floating point
103 
104 typedef ScePthread AkThread; ///< Thread handle
105 typedef ScePthread AkThreadID; ///< Thread ID
106 typedef void* (*AkThreadRoutine)( void* lpThreadParameter ); ///< Thread routine
107 typedef SceKernelEventFlag AkEvent; ///< Event handle
108 
109 typedef SceFiosFH AkFileHandle; ///< File handle
110 
111 typedef wchar_t AkUtf16; ///< Type for 2 byte chars. Used for communication
112  ///< with the authoring tool.
113 
114 #define AK_UINT_MAX UINT_MAX
115 
116 // For strings.
117 #define AK_MAX_PATH SCE_FIOS_PATH_MAX ///< Maximum path length (each file/dir name is max 255 char)
118 
119 typedef AkUInt32 AkFourcc; ///< Riff chunk
120 
121 /// Create Riff chunk
122 #define AkmmioFOURCC( ch0, ch1, ch2, ch3 ) \
123  ( (AkFourcc)(AkUInt8)(ch0) | ( (AkFourcc)(AkUInt8)(ch1) << 8 ) | \
124  ( (AkFourcc)(AkUInt8)(ch2) << 16 ) | ( (AkFourcc)(AkUInt8)(ch3) << 24 ) )
125 
126 #define AK_BANK_PLATFORM_DATA_ALIGNMENT (256) ///< Required memory alignment for bank loading by memory address for ATRAC9 (see LoadBank())
127 #define AK_BANK_PLATFORM_DATA_NON_ATRAC9_ALIGNMENT (16) ///< Required memory alignment for bank loading by memory address for non-ATRAC9 formats (see LoadBank())
128 
129 #define AK_BANK_PLATFORM_ALLOC_TYPE AkMalloc
130 
131 /// Macro that takes a string litteral and changes it to an AkOSChar string at compile time
132 /// \remark This is similar to the TEXT() and _T() macros that can be used to turn string litterals into Unicode strings
133 /// \remark Usage: AKTEXT( "Some Text" )
134 #define AKTEXT(x) x