1 #ifndef XT_API_STREAM_HPP
2 #define XT_API_STREAM_HPP
6 #include <xt/cpp/Core.hpp>
7 #include <xt/cpp/Error.hpp>
25 _s(
nullptr), _params(params), _user(user) { }
31 bool IsRunning()
const;
32 void* GetHandle()
const;
33 int32_t GetFrames()
const;
34 bool IsInterleaved()
const;
36 Format const& GetFormat()
const;
41 friend void XT_CALLBACK
42 Detail::ForwardOnXRun(XtStream
const* coreStream, int32_t index,
void* user);
43 friend uint32_t XT_CALLBACK
44 Detail::ForwardOnBuffer(XtStream
const* coreStream, XtBuffer
const* coreBuffer,
void* user);
45 friend void XT_CALLBACK
46 Detail::ForwardOnRunning(XtStream
const* coreStream, XtBool running, uint64_t error,
void* user);
52 { Detail::HandleError(XtStreamStart(_s)); }
55 { Detail::HandleAssert(XtStreamStop, _s); }
58 { Detail::HandleDestroy(XtStreamDestroy, _s); }
61 {
return Detail::HandleAssert(XtStreamGetHandle(_s)); }
64 {
return Detail::HandleAssert(XtStreamIsRunning(_s)); }
70 Detail::HandleError(XtStreamGetFrames(_s, &frames));
78 auto coreLatency =
reinterpret_cast<XtLatency*
>(&latency);
79 Detail::HandleError(XtStreamGetLatency(_s, coreLatency));
86 auto coreFormat = Detail::HandleAssert(XtStreamGetFormat(_s));
87 return *
reinterpret_cast<Format const*
>(coreFormat);
93 auto coreInterleaved = Detail::HandleAssert(XtStreamIsInterleaved(_s));
94 return coreInterleaved != XtFalse;
98 #endif // XT_API_STREAM_HPP
Format const & GetFormat() const
Definition: XtStream.hpp:84
bool IsInterleaved() const
Definition: XtStream.hpp:91
void * GetHandle() const
Definition: XtStream.hpp:60
Definition: Structs.hpp:25
void Stop()
Definition: XtStream.hpp:54
bool IsRunning() const
Definition: XtStream.hpp:63
~Stream()
Definition: XtStream.hpp:57
int32_t GetFrames() const
Definition: XtStream.hpp:67
Definition: XtService.hpp:23
void Start()
Definition: XtStream.hpp:51
Latency GetLatency() const
Definition: XtStream.hpp:75
Definition: Callbacks.hpp:10
Definition: XtStream.hpp:18
Definition: XtDevice.hpp:20
Definition: Structs.hpp:94