Table of Contents

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