Luanti 5.16.0-dev
Loading...
Searching...
No Matches
sound::ISoundDataOpen Struct Referenceabstract

Stores sound pcm data buffers. More...

#include <sound_data.h>

Inheritance diagram for sound::ISoundDataOpen:
Collaboration diagram for sound::ISoundDataOpen:

Public Member Functions

 ISoundDataOpen (const OggFileDecodeInfo &decode_info)
virtual ~ISoundDataOpen ()=default
virtual bool isStreaming () const noexcept=0
 Iff the data is streaming, there is more than one buffer.
virtual std::tuple< ALuint, ALuint, ALuint > getOrLoadBufferAt (ALuint offset)=0
 Load a buffer containing data starting at the given offset.

Static Public Member Functions

static std::shared_ptr< ISoundDataOpenfromOggFile (std::unique_ptr< RAIIOggFile > oggfile, const std::string &filename_for_logging)

Public Attributes

OggFileDecodeInfo m_decode_info

Detailed Description

Stores sound pcm data buffers.

Constructor & Destructor Documentation

◆ ISoundDataOpen()

sound::ISoundDataOpen::ISoundDataOpen ( const OggFileDecodeInfo & decode_info)
inlineexplicit

References m_decode_info.

Referenced by sound::SoundDataOpenBuffer::SoundDataOpenBuffer(), sound::SoundDataOpenStream::SoundDataOpenStream(), and getOrLoadBufferAt().

Here is the caller graph for this function:

◆ ~ISoundDataOpen()

virtual sound::ISoundDataOpen::~ISoundDataOpen ( )
virtualdefault

Member Function Documentation

◆ fromOggFile()

std::shared_ptr< ISoundDataOpen > sound::ISoundDataOpen::fromOggFile ( std::unique_ptr< RAIIOggFile > oggfile,
const std::string & filename_for_logging )
static

References sound::SOUND_DURATION_MAX_SINGLE, and warningstream.

Referenced by getOrLoadBufferAt(), sound::SoundDataUnopenBuffer::open(), and sound::SoundDataUnopenFile::open().

Here is the caller graph for this function:

◆ getOrLoadBufferAt()

virtual std::tuple< ALuint, ALuint, ALuint > sound::ISoundDataOpen::getOrLoadBufferAt ( ALuint offset)
pure virtual

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.

Implemented in sound::SoundDataOpenBuffer, and sound::SoundDataOpenStream.

References ISoundDataOpen(), fromOggFile(), and getOrLoadBufferAt().

Referenced by getOrLoadBufferAt().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isStreaming()

virtual bool sound::ISoundDataOpen::isStreaming ( ) const
pure virtualnoexcept

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

Returns
Whether it's streaming data.

Implemented in sound::SoundDataOpenBuffer, and sound::SoundDataOpenStream.

Member Data Documentation

◆ m_decode_info


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