Table des matières

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