Minetest 5.10.0-dev
 
Loading...
Searching...
No Matches
sound::SoundDataOpenBuffer Struct Referencefinal

Non-streaming opened sound data. More...

#include <sound_data.h>

+ Inheritance diagram for sound::SoundDataOpenBuffer:
+ Collaboration diagram for sound::SoundDataOpenBuffer:

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< ISoundDataOpenfromOggFile (std::unique_ptr< RAIIOggFile > oggfile, const std::string &filename_for_logging)
 

Detailed Description

Non-streaming opened sound data.

All data is completely loaded in one buffer.

Constructor & Destructor Documentation

◆ SoundDataOpenBuffer()

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.

+ Here is the call graph for this function:

Member Function Documentation

◆ getOrLoadBufferAt()

std::tuple< ALuint, ALuint, ALuint > sound::SoundDataOpenBuffer::getOrLoadBufferAt ( ALuint offset)
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.
Parameters
offsetThe start of the buffer.
Returns
{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.

+ Here is the call graph for this function:

◆ isStreaming()

bool sound::SoundDataOpenBuffer::isStreaming ( ) const
inlineoverridevirtualnoexcept

Iff the data is streaming, there is more than one buffer.

Returns
Whether it's streaming data.

Implements sound::ISoundDataOpen.

Member Data Documentation

◆ m_buffer

RAIIALSoundBuffer sound::SoundDataOpenBuffer::m_buffer

Referenced by SoundDataOpenBuffer().


The documentation for this struct was generated from the following files: