VAE - Virtual Audio Engine 1
Small Data Driven Audio Engine
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
vae_types.hpp
Go to the documentation of this file.
1/**
2 * @file vae_types.hpp
3 * @author Tobias Kozel (t.kozel@pm.me)
4 * @brief Internal types used across VAE
5 * @version 0.1
6 * @date 2021-11-29
7 *
8 * @copyright Copyright (c) 2021
9 *
10 */
11
12#ifndef _VAE_TYPES
13#define _VAE_TYPES
14
15/**
16 * @brief Forward these to tklb
17 * TODO find a better place for this
18 *
19 */
20#ifdef VAE_NO_SIMD
21 #define TKLB_NO_SIMD
22#endif
23
24#ifdef VAE_NO_STDIO
25 #define TKLB_NO_STDIO
26#endif
27
28
29#include "../../include/vae/vae.hpp"
30#include "../wrapped/vae_profiler.hpp"
31#include "./vae_config.hpp"
32#include "../../external/glm/glm/glm.hpp"
33#include "../../external/tklb/src/types/audio/TAudioBuffer.hpp"
34#include "../../external/tklb/src/types/audio/TAudioRingBuffer.hpp"
35#include "../../external/tklb/src/types/TString.hpp"
36#include "./vae_allocators.hpp"
37
38#ifndef VAE_NO_AUDIO_THREAD
39 #include <mutex>
40#else
41 #include "../../external/tklb/src/types/TSpinLock.hpp"
42#endif // !VAE_NO_AUDIO_THREAD
43
44namespace vae { namespace core {
45 using Uchar = unsigned char;
46 using Uint = unsigned int;
47 using Vec3 = glm::vec3;
48 using Real = float;
49 #ifndef VAE_USE_PROFILER
50 // vae_profiler.hpp provides wrapped versions for tracking
51 #ifndef VAE_NO_AUDIO_THREAD
52 using Mutex = std::mutex;
53 using Lock = std::unique_lock<Mutex>;
54 #else
55 using Mutex = tklb::SpinLock;
57 #endif // !#ifndef VAE_NO_AUDIO_THREAD
58 #endif // !VAE_USE_PROFILER
59
60 // Buffer used for internal packed structs like Event, Bank Voice etc
62
63 /**
64 * @brief Buffer type to hold all the audio data meant for playback
65 */
69 >
70 >;
71
72 /**
73 * @brief Buffer type to do all the work like mixing, filtering and so on
74 */
78 >
79 >;
80
84 >
85 >;
86
87 using SampleIndex = AudioBuffer::Size; // Time stored in samples
88
89 #ifdef VAE_RELEASE
90 using NameString = tklb::StackString<0>; ///< Used for debug names
91 #else
92 using NameString = tklb::StackString<16>; ///< Used for debug names
93 #endif // VAE_RELEASE
95 using PathString = tklb::String<HeapBuffer<char>>; ///< Non optional string used for locations, maybe replaceable with a unique_ptr or something
96 using IdString = tklb::StackString<16>; ///< Non optional string used to id things
97
98} } // namespace vae::core
99
100
101#endif // _VAE_TYPES
Basically a bad std::vector without exceptions which can also work with foreign memory.
Definition: THeapBuffer.hpp:49
Spinlock ! probably not thread safe.
Definition: TSpinLock.hpp:12
constexpr size_t DEFAULT_ALIGNMENT
AudioBuffer::Size SampleIndex
Definition: vae_types.hpp:87
float Real
Definition: vae_types.hpp:48
glm::vec3 Vec3
Definition: vae_types.hpp:47
unsigned char Uchar
Definition: vae_types.hpp:45
std::mutex Mutex
Definition: vae_types.hpp:52
std::unique_lock< Mutex > Lock
Definition: vae_types.hpp:53
unsigned int Uint
Definition: vae_types.hpp:46
Contains Typedefinitions and basic structures use by the public API and internally.
Definition: vae.hpp:31
float Sample
Default sample types used where ever possible, changing this means the engine needs to be recompiled,...
Definition: vae.hpp:32
Allocator used for all heapbuffers in VAE.