1 #ifndef XT_API_AUDIO_HPP
2 #define XT_API_AUDIO_HPP
6 #include <xt/cpp/Core.hpp>
7 #include <xt/cpp/Error.hpp>
26 static void SetOnError(
OnError onError);
27 static ErrorInfo GetErrorInfo(uint64_t error);
29 static std::unique_ptr<Platform> Init(std::string
const&
id,
void* window);
35 auto result = Detail::HandleAssert(XtAudioGetVersion());
36 return *
reinterpret_cast<Version*
>(&result);
43 auto info = Detail::HandleAssert(XtAudioGetErrorInfo(error));
44 result.
fault = info.fault;
46 result.
service.
text = std::string(info.service.text);
55 auto coreSample =
static_cast<XtSample
>(sample);
56 auto attrs = Detail::HandleAssert(XtAudioGetSampleAttributes(coreSample));
57 result.
size = attrs.size;
58 result.
count = attrs.count;
59 result.
isFloat = attrs.isFloat != XtFalse;
60 result.
isSigned = attrs.isSigned != XtFalse;
64 inline std::unique_ptr<Platform>
67 XtPlatform* result = Detail::HandleAssert(XtAudioInit(
id.c_str(), window));
68 return std::unique_ptr<Platform>(
new Platform(result));
74 Detail::_onError = onError;
75 XtOnError coreOnError = onError ==
nullptr?
nullptr: &Detail::ForwardOnError;
76 Detail::HandleAssert(XtAudioSetOnError, coreOnError);
80 #endif // XT_API_AUDIO_HPP
ServiceError service
Definition: Structs.hpp:47
std::string text
Definition: Structs.hpp:40
Cause cause
Definition: Structs.hpp:39
Definition: Structs.hpp:31
Cause
Definition: Enums.hpp:10
System system
Definition: Structs.hpp:46
int32_t size
Definition: Structs.hpp:59
static std::unique_ptr< Platform > Init(std::string const &id, void *window)
Definition: XtAudio.hpp:65
Definition: Structs.hpp:57
void(* OnError)(std::string const &message)
Definition: Callbacks.hpp:13
int32_t count
Definition: Structs.hpp:60
Definition: XtAudio.hpp:21
static ErrorInfo GetErrorInfo(uint64_t error)
Definition: XtAudio.hpp:40
static Attributes GetSampleAttributes(Sample sample)
Definition: XtAudio.hpp:52
bool isSigned
Definition: Structs.hpp:62
bool isFloat
Definition: Structs.hpp:61
Definition: Structs.hpp:43
static void SetOnError(OnError onError)
Definition: XtAudio.hpp:72
Definition: Callbacks.hpp:10
Sample
Definition: Enums.hpp:9
System
Definition: Enums.hpp:11
uint32_t fault
Definition: Structs.hpp:45
static Version GetVersion()
Definition: XtAudio.hpp:33