55 const std::
string &filename_for_logging);
67 virtual std::shared_ptr<ISoundDataOpen>
open(
const std::string &sound_name) && = 0;
79 std::shared_ptr<ISoundDataOpen> open(
const std::string &sound_name) &&
override;
91 std::shared_ptr<ISoundDataOpen> open(
const std::string &sound_name) &&
override;
152 std::tuple<ALuint, ALuint, ALuint> getOrLoadBufferAt(ALuint offset)
override;
158 std::tuple<ALuint, ALuint, ALuint> loadBufferAt(ALuint offset,
159 std::vector<ContiguousBuffers>::iterator after_it);
Definition al_extensions.cpp:11
Stores sound pcm data buffers.
Definition sound_data.h:22
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 std::shared_ptr< ISoundDataOpen > fromOggFile(std::unique_ptr< RAIIOggFile > oggfile, const std::string &filename_for_logging)
Definition sound_data.cpp:20
OggFileDecodeInfo m_decode_info
Definition sound_data.h:23
ISoundDataOpen(const OggFileDecodeInfo &decode_info)
Definition sound_data.h:25
Will be opened lazily when first used.
Definition sound_data.h:62
virtual ~ISoundDataUnopen()=default
virtual std::shared_ptr< ISoundDataOpen > open(const std::string &sound_name) &&=0
Metadata of an Ogg-Vorbis file, used for decoding.
Definition ogg_file.h:37
ALuint length_samples
Definition ogg_file.h:43
RAII wrapper for openal sound buffers.
Definition al_helpers.h:78
ALuint get() noexcept
Definition al_helpers.h:89
RAII wrapper for OggVorbis_File.
Definition ogg_file.h:50
Non-streaming opened sound data.
Definition sound_data.h:99
std::tuple< ALuint, ALuint, ALuint > getOrLoadBufferAt(ALuint offset) override
Load a buffer containing data starting at the given offset.
Definition sound_data.h:107
bool isStreaming() const noexcept override
Iff the data is streaming, there is more than one buffer.
Definition sound_data.h:105
RAIIALSoundBuffer m_buffer
Definition sound_data.h:100
A sorted non-empty vector of contiguous buffers.
Definition sound_data.h:138
ALuint m_start
Definition sound_data.h:139
std::vector< SoundBufferUntil > m_buffers
Definition sound_data.h:140
An OpenAL buffer that goes until m_end (exclusive).
Definition sound_data.h:127
ALuint m_end
Definition sound_data.h:128
RAIIALSoundBuffer m_buffer
Definition sound_data.h:129
Streaming opened sound data.
Definition sound_data.h:122
std::vector< ContiguousBuffers > m_bufferss
Definition sound_data.h:145
std::unique_ptr< RAIIOggFile > m_oggfile
Definition sound_data.h:143
bool isStreaming() const noexcept override
Iff the data is streaming, there is more than one buffer.
Definition sound_data.h:150
Sound file is in a memory buffer.
Definition sound_data.h:74
std::string m_buffer
Definition sound_data.h:75
SoundDataUnopenBuffer(std::string &&buffer)
Definition sound_data.h:77
Sound file is in file system.
Definition sound_data.h:86
SoundDataUnopenFile(const std::string &path)
Definition sound_data.h:89
std::string m_path
Definition sound_data.h:87