29 #include "nomlib/audio/AL/Sound.hpp"
34 Sound::Sound (
void ) : buffer ( nullptr )
36 NOM_LOG_TRACE ( NOM );
39 Sound::Sound (
const SoundBuffer& copy ) : buffer ( nullptr )
41 this->setBuffer ( copy );
44 Sound::~Sound (
void )
46 NOM_LOG_TRACE ( NOM );
54 void Sound::setBuffer (
const SoundBuffer& copy )
56 NOM_LOG_TRACE ( NOM );
72 void Sound::Play (
void )
74 AL_CHECK_ERR ( alSourcePlay (
source_id ) );
77 void Sound::Stop (
void )
79 AL_CHECK_ERR ( alSourceStop (
source_id ) );
82 void Sound::Pause (
void )
84 AL_CHECK_ERR ( alSourcePause (
source_id ) );
108 AL_CHECK_ERR ( alSourcei (
source_id, AL_BUFFER, 0 ) );
uint32 get(void) const
Obtain buffer data.
void detach(Sound *sound) const
Internally used for detaching a sound from our list.
uint32 source_id
Source identification; used by OpenAL.
void attach(Sound *sound) const
Internally used for attaching a sound to our list.
const SoundBuffer * buffer
Buffer that this sound is attached to.
void reset(void)
Obtain the current playback position of source in seconds.