|
oveRTOS C++ API
C++20 RAII wrappers for the oveRTOS C API
|
C++ wrapper around ove_audio_graph. More...
#include <audio.hpp>
Public Member Functions | |
| Result< void > | init (unsigned int frames_per_period) noexcept |
| Initialise the audio graph with the given period size. | |
| template<unsigned Nodes, unsigned Frames, unsigned Channels = 1, unsigned SampleBytes = 2> | |
| Result< void > | create () noexcept |
| Result< int > | add_node (const struct ove_audio_node_ops *ops, void *ctx, const char *name, enum ove_audio_node_type type) noexcept |
| Result< void > | connect (unsigned int from, unsigned int to) noexcept |
Connect two nodes (output of from to input of to). | |
| Result< void > | build () noexcept |
| Finalize the graph topology. | |
| Result< void > | start () noexcept |
| Start audio processing. | |
| Result< void > | stop () noexcept |
| Stop audio processing. | |
| Result< void > | process () noexcept |
| Run one processing period through the graph. | |
| Result< struct ove_audio_graph_stats > | get_stats () const noexcept |
| Result< int > | device_source (const struct ove_audio_device_cfg *cfg, const char *name) noexcept |
| Result< int > | device_sink (const struct ove_audio_device_cfg *cfg, const char *name) noexcept |
| struct ove_audio_graph * | raw () |
| Access the underlying C graph struct. | |
| template<typename T > | |
| Result< int > | add_processor (T &node, const char *name) |
C++ wrapper around ove_audio_graph.
Provides RAII-style init/deinit and forwarding to the C graph API.
|
inlinenoexcept |
Initialise the graph in a way that works for both heap and zero-heap builds. In zero-heap mode, emits a per-call-site static backing array sized by OVE_AUDIO_GRAPH_STORAGE_BYTES(Nodes, Frames, Channels,
SampleBytes) and attaches it via set_buf_storage(). Mirrors the C ove_audio_graph_create macro — callers can use .init() + manual set_buf_storage() for dynamic sizing, or this helper for the common statically-known case.
All template arguments must be compile-time constants.
|
inlinenoexcept |
Add a processing node to the graph.
unexpected Error.
|
inlinenoexcept |
Query runtime statistics.
ove_audio_graph_stats.
|
inlinenoexcept |
Add an audio input device as a source node.
|
inlinenoexcept |
Add an audio output device as a sink node.
|
inline |
Register a custom processor node using a typed C++ object.
T must have: int process(const ove_audio_buf *in, ove_audio_buf *out) The binding layer generates trampolines — no raw function pointers needed.