Non-streaming opened sound data. More...
#include <sound_data.h>
Public Member Functions | |
SoundDataOpenBuffer (std::unique_ptr< RAIIOggFile > oggfile, const OggFileDecodeInfo &decode_info) | |
bool | isStreaming () const noexcept override |
Iff the data is streaming, there is more than one buffer. | |
std::tuple< ALuint, ALuint, ALuint > | getOrLoadBufferAt (ALuint offset) override |
Load a buffer containing data starting at the given offset. | |
Public Member Functions inherited from sound::ISoundDataOpen | |
ISoundDataOpen (const OggFileDecodeInfo &decode_info) | |
virtual | ~ISoundDataOpen ()=default |
Public Attributes | |
RAIIALSoundBuffer | m_buffer |
Public Attributes inherited from sound::ISoundDataOpen | |
OggFileDecodeInfo | m_decode_info |
Additional Inherited Members | |
Static Public Member Functions inherited from sound::ISoundDataOpen | |
static std::shared_ptr< ISoundDataOpen > | fromOggFile (std::unique_ptr< RAIIOggFile > oggfile, const std::string &filename_for_logging) |
Non-streaming opened sound data.
All data is completely loaded in one buffer.
sound::SoundDataOpenBuffer::SoundDataOpenBuffer | ( | std::unique_ptr< RAIIOggFile > | oggfile, |
const OggFileDecodeInfo & | decode_info ) |
References sound::RAIIALSoundBuffer::get(), sound::OggFileDecodeInfo::length_samples, m_buffer, sound::ISoundDataOpen::m_decode_info, sound::OggFileDecodeInfo::name_for_logging, and warningstream.
|
inlineoverridevirtual |
Load a buffer containing data starting at the given offset.
Or just get it if it was already loaded.
This function returns multiple values:
buffer
: The OpenAL buffer.buffer_end
: The offset (in the file) where buffer
ends (exclusive).offset_in_buffer
: Offset relative to buffer
's start where the requested offset
is. offset_in_buffer == 0
is guaranteed if some loaded buffer ends at offset
.offset | The start of the buffer. |
{buffer, buffer_end, offset_in_buffer}
or {0, sound_data_end, 0}
if offset
is invalid. Implements sound::ISoundDataOpen.
References sound::RAIIALSoundBuffer::get(), and sound::OggFileDecodeInfo::length_samples.
|
inlineoverridevirtualnoexcept |
Iff the data is streaming, there is more than one buffer.
Implements sound::ISoundDataOpen.
RAIIALSoundBuffer sound::SoundDataOpenBuffer::m_buffer |
Referenced by SoundDataOpenBuffer().