Streaming opened sound data. More...
#include <sound_data.h>
Classes | |
| struct | SoundBufferUntil |
| An OpenAL buffer that goes until m_end (exclusive). More... | |
| struct | ContiguousBuffers |
| A sorted non-empty vector of contiguous buffers. More... | |
Public Member Functions | |
| SoundDataOpenStream (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 | |
| std::unique_ptr< RAIIOggFile > | m_oggfile |
| std::vector< ContiguousBuffers > | m_bufferss |
| Public Attributes inherited from sound::ISoundDataOpen | |
| OggFileDecodeInfo | m_decode_info |
Private Member Functions | |
| std::tuple< ALuint, ALuint, ALuint > | loadBufferAt (ALuint offset, std::vector< ContiguousBuffers >::iterator after_it) |
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) |
Streaming opened sound data.
Uses a sorted list of contiguous sound data regions (ContiguousBufferss) for efficient seeking.
| sound::SoundDataOpenStream::SoundDataOpenStream | ( | std::unique_ptr< RAIIOggFile > | oggfile, |
| const OggFileDecodeInfo & | decode_info ) |
References sound::ISoundDataOpen::ISoundDataOpen(), and m_oggfile.
|
overridevirtual |
Load a buffer containing data starting at the given offset.
Or just get it if it was already loaded.
This function returns multiple values:
| offset | The start of the buffer. |
Implements sound::ISoundDataOpen.
References loadBufferAt(), sound::SoundDataOpenStream::ContiguousBuffers::m_buffers, m_bufferss, and sound::ISoundDataOpen::m_decode_info.
|
inlineoverridevirtualnoexcept |
Iff the data is streaming, there is more than one buffer.
Implements sound::ISoundDataOpen.
|
private |
References m_bufferss, sound::ISoundDataOpen::m_decode_info, m_oggfile, and sound::MIN_STREAM_BUFFER_LENGTH.
Referenced by getOrLoadBufferAt().
| std::vector<ContiguousBuffers> sound::SoundDataOpenStream::m_bufferss |
Referenced by getOrLoadBufferAt(), and loadBufferAt().
| std::unique_ptr<RAIIOggFile> sound::SoundDataOpenStream::m_oggfile |
Referenced by SoundDataOpenStream(), and loadBufferAt().