Anklang 0.3.0-460-gc4ef46ba
ASE — Anklang Sound Engine (C++)

« « « Anklang Documentation
Loading...
Searching...
No Matches
defs.hh
Go to the documentation of this file.
1 // This Source Code Form is licensed MPL-2.0: http://mozilla.org/MPL/2.0
2#ifndef __ASE_DEFS_HH__
3#define __ASE_DEFS_HH__
4
5#include <ase/cxxaux.hh>
6
7namespace Ase {
8
9// = Constants ==
10static constexpr uint64_t U64MAX = +18446744073709551615ull; // 2^64-1
11static constexpr int64_t I63MAX = +9223372036854775807; // 2^63-1
12static constexpr int64_t I63MIN = -9223372036854775807 - 1; // -2^63
13static constexpr uint32_t U32MAX = +4294967295u; // 2^32-1
14static constexpr int32_t I31MAX = +2147483647; // 2^31-1
15static constexpr int32_t I31MIN = -2147483648; // -2^31
16static constexpr float M23MAX = 16777216; // 2^(1+23); IEEE-754 Float Mantissa maximum
17static constexpr float F32EPS = 5.9604644775390625e-08; // 2^-24, round-off error at 1.0
18static constexpr float F32MAX = 3.40282347e+38; // 7f7fffff, 2^128 * (1 - F32EPS)
19static constexpr double M52MAX = 9007199254740992; // 2^(1+52); IEEE-754 Double Mantissa maximum
20static constexpr double D64MAX = 1.7976931348623157e+308; // 0x7fefffff ffffffff, IEEE-754 Double Maximum
21static constexpr int64_t AUDIO_BLOCK_MAX_RENDER_SIZE = 2048;
22
23// == Forward Declarations ==
24enum class Error;
25
26// == Struct Forward Declarations ==
27ASE_STRUCT_DECLS (AudioProcessorInfo);
28ASE_STRUCT_DECLS (Choice);
29ASE_STRUCT_DECLS (ClapParamUpdate);
30ASE_STRUCT_DECLS (ClipNote);
31ASE_STRUCT_DECLS (DeviceInfo);
32ASE_STRUCT_DECLS (DriverEntry);
33ASE_STRUCT_DECLS (Parameter);
34ASE_STRUCT_DECLS (Resource);
35ASE_STRUCT_DECLS (TelemetryField);
36ASE_STRUCT_DECLS (TelemetrySegment);
37ASE_STRUCT_DECLS (UserNote);
38
39// == Class Forward Declarations ==
40ASE_CLASS_DECLS (AudioChain);
41ASE_CLASS_DECLS (AudioCombo);
42ASE_CLASS_DECLS (AudioCombo);
43ASE_CLASS_DECLS (AudioEngineThread);
44ASE_CLASS_DECLS (AudioProcessor);
45ASE_CLASS_DECLS (ClapDeviceImpl);
46ASE_CLASS_DECLS (ClapPluginHandle);
47ASE_CLASS_DECLS (Clip);
48ASE_CLASS_DECLS (ClipImpl);
49ASE_CLASS_DECLS (Device);
50ASE_CLASS_DECLS (DeviceImpl);
51ASE_CLASS_DECLS (Emittable);
52ASE_CLASS_DECLS (FileCrawler);
53ASE_CLASS_DECLS (Gadget);
54ASE_CLASS_DECLS (GadgetImpl);
55ASE_CLASS_DECLS (Monitor);
56ASE_CLASS_DECLS (NativeDevice);
57ASE_CLASS_DECLS (NativeDeviceImpl);
58ASE_CLASS_DECLS (Object);
59ASE_CLASS_DECLS (Preference);
60ASE_CLASS_DECLS (Project);
61ASE_CLASS_DECLS (ProjectImpl);
62ASE_CLASS_DECLS (Property);
63ASE_CLASS_DECLS (PropertyImpl);
64ASE_CLASS_DECLS (ResourceCrawler);
65ASE_CLASS_DECLS (Server);
66ASE_CLASS_DECLS (ServerImpl);
67ASE_CLASS_DECLS (SharedBase);
68ASE_CLASS_DECLS (StreamReader);
69ASE_CLASS_DECLS (StreamWriter);
70ASE_CLASS_DECLS (Track);
71ASE_CLASS_DECLS (TrackImpl);
72
73class AudioEngine;
74class CustomDataContainer;
75
76using CallbackS = std::vector<std::function<void()>>;
77using DCallbackS = std::vector<std::function<void(double)>>;
78
79struct Event;
80class EventConnection;
81using EventConnectionW = std::weak_ptr<EventConnection>;
82using EventConnectionP = std::shared_ptr<EventConnection>;
83using EventHandler = std::function<void (const Event&)>;
84
85class SharedBase;
86using InstanceP = std::shared_ptr<SharedBase>;
87
88struct Value;
89using ValueP = std::shared_ptr<Value>;
90// ValueS derives std::vector<ValueP>
91
92class WritNode;
93using WritNodeS = std::vector<WritNode>;
94
95// == Serializable ==
97class Serializable : public virtual VirtualBase {
98 friend WritNode;
99protected:
100 virtual void serialize (WritNode &xs) = 0;
101 // see serialize.cc
102};
103
104// == IconString ==
105struct IconString : String {};
106
107} // Ase
108
109#endif // __ASE_DEFS_HH__
Interface for serializable objects with Reflink support.
Definition defs.hh:97
virtual void serialize(WritNode &xs)=0
Serialize members and childern.
Definition serialize.cc:379
One entry in a Writ serialization document.
Definition serialize.hh:24
The Anklang C++ API namespace.
Definition api.hh:9
Error
Enum representing Error states.
Definition api.hh:22
typedef uint64_t
Common base type to allow casting between polymorphic classes.
Definition cxxaux.hh:214