StreamDecodeRequest struct
#include <nCine/Audio/IAudioDevice.h>
Request to decode one buffer of audio stream data, usually on the decoding thread.
Owned jointly by the requesting AudioStream and, while submitted, by the audio device. The shared ownership keeps the reader and the destination buffer alive even if the stream is moved or destroyed while the request is still being executed. One request is reused for the whole lifetime of a stream and holds at most one chunk of decoded data.
Public types
-
enum class State : std::
uint8_t { Idle, Pending, Ready } - State of the request.
Constructors, destructors, conversion operators
Public functions
- void Execute()
- Decodes one buffer of data and marks the request as ready.
Public variables
-
std::
shared_ptr<IAudioReader> reader - Reader that decodes the data, shared with the owning stream.
-
std::
unique_ptr<char[]> buffer - Destination buffer for the decoded data.
-
std::
int32_t bufferSize - Size of the destination buffer in bytes.
-
std::
int32_t bytesRead - Number of decoded bytes, valid when the state is State::
Ready. - bool looping
- Whether the reader rewinds and keeps decoding when the end of data is reached.
-
std::
atomic<State> state - Current state of the request.