#include <SoundEffect.h>
Inheritance diagram for SoundEffect:

Public Member Functions | |
| SoundEffect (std::string name) | |
| ~SoundEffect () | |
Private Member Functions | |
| void | Play () |
| void | Pause () |
| void | Stop () |
| void | Update (unsigned int ticks) |
| void | InitializeSource () |
Private Attributes | |
| SoundResource * | m_resource |
Definition at line 14 of file SoundEffect.h.
| SoundEffect::SoundEffect | ( | std::string | name | ) |
Definition at line 18 of file SoundEffect.cpp.
References IResource::ConstructKey(), m_resource, ResourceManager::s_resourceManager, and SoundResource::s_type.
00018 : ISound() { 00019 m_resource = (SoundResource *) ResourceManager::s_resourceManager->Acquire(IResource::ConstructKey(SoundResource::s_type, name)); 00020 }
| SoundEffect::~SoundEffect | ( | ) |
Definition at line 22 of file SoundEffect.cpp.
References m_resource, ResourceManager::Release(), SoundSystem::ReleaseSound(), ResourceManager::s_resourceManager, SoundSystem::s_soundSystem, and Stop().
00022 { 00023 Stop(); 00024 SoundSystem::s_soundSystem->ReleaseSound(this); 00025 ResourceManager::s_resourceManager->Release(m_resource); 00026 }
| void SoundEffect::InitializeSource | ( | ) | [private, virtual] |
Implements ISound.
Definition at line 52 of file SoundEffect.cpp.
References SoundResource::GetBuffer(), OpenALSource::GetSource(), m_resource, ISound::m_source, Log::Message(), and Log::s_log.
00052 { 00053 if (m_source == NULL) { 00054 Log::s_log->Message("Warning: Attempt to initialize NULL source"); 00055 return; 00056 } 00057 alSourcei(m_source->GetSource(), AL_BUFFER, m_resource->GetBuffer()); 00058 }
| void SoundEffect::Pause | ( | ) | [private, virtual] |
Implements ISound.
Definition at line 36 of file SoundEffect.cpp.
References OpenALSource::GetSource(), and ISound::m_source.
| void SoundEffect::Play | ( | ) | [private, virtual] |
Implements ISound.
Definition at line 28 of file SoundEffect.cpp.
References OpenALSource::GetSource(), ISound::m_source, Log::Message(), and Log::s_log.
00028 { 00029 if (m_source != NULL) { 00030 alSourcePlay(m_source->GetSource()); 00031 } else { 00032 Log::s_log->Message("Warning: SoundEffect Play without source set"); 00033 } 00034 }
| void SoundEffect::Stop | ( | ) | [private, virtual] |
Implements ISound.
Definition at line 42 of file SoundEffect.cpp.
References OpenALSource::GetSource(), and ISound::m_source.
Referenced by ~SoundEffect().
| void SoundEffect::Update | ( | unsigned int | ticks | ) | [private, virtual] |
SoundResource* SoundEffect::m_resource [private] |
Definition at line 20 of file SoundEffect.h.
Referenced by InitializeSource(), SoundEffect(), and ~SoundEffect().
1.4.7