sdl2_impl 0.1.0
Vendor SDL2 2.32 : IGraphic2Module / IAudioModule
Loading...
Searching...
No Matches
SdlSoundBuffer Class Reference

Un echantillon decode en memoire, partageable par plusieurs sons. More...

#include <SdlSoundBuffer.hpp>

Inheritance diagram for SdlSoundBuffer:
Collaboration diagram for SdlSoundBuffer:

Public Member Functions

 SdlSoundBuffer (std::string path)
 
 ~SdlSoundBuffer ()
 
bool isReady () const override
 
float getLength () const override
 La duree, en secondes.
 
Mix_Chunk * handle () const
 

Detailed Description

Un echantillon decode en memoire, partageable par plusieurs sons.

Mix_Chunk EST le tampon : SDL_mixer le decode entierement au chargement, puis le joue sur le canal qu'on veut. C'est exactement le partage que le contrat decrit - un buffer, plusieurs ISound.

Constructor & Destructor Documentation

◆ SdlSoundBuffer()

SdlSoundBuffer::SdlSoundBuffer ( std::string  path)
inline

◆ ~SdlSoundBuffer()

SdlSoundBuffer::~SdlSoundBuffer ( )
inline

Member Function Documentation

◆ getLength()

float SdlSoundBuffer::getLength ( ) const
inlineoverride

La duree, en secondes.

SDL_mixer ne la donne pas : on la deduit de la taille brute et du format ouvert par le module. C'est exact tant que le tampon est au format du peripherique, ce que Mix_LoadWAV garantit puisqu'il reechantillonne au chargement.

◆ handle()

Mix_Chunk * SdlSoundBuffer::handle ( ) const
inline

◆ isReady()

bool SdlSoundBuffer::isReady ( ) const
inlineoverride

The documentation for this class was generated from the following file: