Skyscraper 2.0
|
#include <sound.h>
Classes | |
struct | SoundEntry |
Public Member Functions | |
Sound (Object *parent, const std::string &name, bool permanent) | |
~Sound () | |
void | SetVolume (Real value) |
Real | GetVolume () |
void | SetDistances (Real min, Real max) |
Real | GetMinimumDistance () |
Real | GetMaximumDistance () |
void | SetDirection (const Vector3 &direction) |
Vector3 | GetDirection () |
void | SetLoopState (bool value) |
bool | GetLoopState () |
void | Pause (bool value=true) |
bool | IsPaused () |
void | Stop () |
bool | Play (bool reset=true) |
void | Reset () |
void | SetSpeed (int percent) |
int | GetSpeed () |
bool | Load (const std::string &filename, bool force=false) |
bool | IsPlaying () |
Real | GetPlayPosition () |
void | SetPlayPosition (Real percent) |
void | SetConeSettings (Real inside_angle=360.0, Real outside_angle=360.0, Real outside_volume=1.0) |
void | SetDopplerLevel (Real level) |
bool | IsLoaded () |
void | PlayQueued (const std::string &filename, bool stop=true, bool loop=false) |
void | ProcessQueue () |
void | Report (const std::string &message) |
bool | ReportError (const std::string &message) |
void | OnMove (bool parent) |
void | OnRotate (bool parent) |
void | Unload () |
void | Enabled (bool value) |
bool | IsEnabled () |
FMOD::Channel * | GetChannel () |
bool | GetNearestReverbPosition (Vector3 &position) |
![]() | |
Object (Object *parent) | |
virtual | ~Object () |
void | SetValues (const std::string &type, const std::string &name, bool is_permanent, bool is_movable=true) |
bool | IsPermanent () |
bool | IsMovable () |
const std::string & | GetType () |
int | GetNumber () |
void | AddChild (Object *object) |
Object * | GetChild (int index) |
int | GetChildrenCount () |
void | RemoveChild (Object *object) |
SceneNode * | GetSceneNode () |
void | ShowBoundingBox (bool value) |
virtual void | Move (const Vector3 &vector, Real speed=1.0) |
virtual void | Move (Real X, Real Y, Real Z, Real speed=1.0) |
virtual void | SetPosition (const Vector3 &position) |
void | SetPositionRelative (const Vector3 &position) |
virtual void | SetPosition (Real X, Real Y, Real Z) |
void | SetPositionRelative (Real X, Real Y, Real Z) |
virtual void | SetPositionY (Real value) |
virtual Vector3 | GetPosition (bool relative=false) |
virtual void | Rotate (const Vector3 &vector, Real speed=1.0) |
virtual void | Rotate (Real X, Real Y, Real Z, Real speed=1.0) |
virtual void | SetRotation (const Vector3 &rotation) |
virtual void | SetRotation (Real X, Real Y, Real Z) |
virtual Vector3 | GetRotation () |
Quaternion | GetOrientation (bool relative=false) |
void | SetOrientation (const Quaternion &q, bool relative=false) |
virtual void | OnClick (Vector3 &position, bool shift, bool ctrl, bool alt, bool right) |
virtual void | OnUnclick (bool right) |
virtual void | OnHit () |
void | NotifyMove (bool parent=false) |
void | NotifyRotate (bool parent=false) |
virtual void | ResetState () |
void | ChangeParent (Object *new_parent) |
bool | IsGlobal () |
void | Init (bool children=true) |
virtual void | OnInit () |
virtual void | Loop () |
void | RegisterLoop (Object *object) |
void | UnregisterLoop (Object *object) |
std::string | GetNameBase () |
template<typename T > | |
bool | IsType () |
template<typename T > | |
T * | ConvertTo () |
![]() | |
ObjectBase (Object *parent) | |
virtual | ~ObjectBase () |
Object * | GetParent () |
SBS * | GetRoot () |
void | SetName (const std::string &name) |
const std::string & | GetName () |
std::string | GetNameBase () |
Public Attributes | |
bool | SetVelocity |
![]() | |
std::string | command |
std::string | command_processed |
std::string | context |
int | linenum |
std::string | includefile |
bool | parent_deleting |
Private Member Functions | |
bool | IsValid () |
Private Attributes | |
FMOD::Channel * | channel |
SoundData * | sound |
SoundSystem * | system |
Vector3 | Position |
Vector3 | Velocity |
float | Volume |
float | MaxDistance |
float | MinDistance |
Vector3 | Direction |
bool | SoundLoop |
int | Speed |
float | Percent |
std::string | Filename |
float | default_speed |
float | doppler_level |
bool | position_queued |
bool | enabled |
std::vector< SoundEntry > | queue |
Additional Inherited Members | |
![]() | |
void | EnableLoop (bool value) |
void | LoopChildren () |
bool | SelfDestruct () |
![]() | |
SBS * | sbs |
SBS::Sound::Sound | ( | Object * | parent, |
const std::string & | name, | ||
bool | permanent ) |
Definition at line 37 of file sound.cpp.
References channel, default_speed, Direction, doppler_level, enabled, SBS::SBS::GetConfigBool(), SBS::SBS::GetConfigFloat(), SBS::SBS::GetConfigInt(), SBS::SBS::GetSoundSystem(), SBS::SBS::IncrementSoundCount(), MaxDistance, MinDistance, Percent, Position, position_queued, Report(), SBS::ObjectBase::sbs, SBS::Object::SetValues(), SetVelocity, sound, SoundLoop, Speed, system, SBS::SBS::Verbose, and Volume.
SBS::Sound::~Sound | ( | ) |
Definition at line 67 of file sound.cpp.
References SBS::SBS::DecrementSoundCount(), SBS::SBS::FastDelete, SBS::ObjectBase::GetParent(), SBS::Object::GetType(), SBS::Object::parent_deleting, SBS::SBS::RemoveSound(), SBS::ObjectBase::sbs, Stop(), system, and Unload().
|
virtual |
Reimplemented from SBS::Object.
Definition at line 620 of file sound.cpp.
References enabled, and Stop().
Referenced by Skyscraper::SoundManager::On_bEnabled_Click().
FMOD::Channel * SBS::Sound::GetChannel | ( | ) |
Definition at line 558 of file sound.cpp.
References channel.
Referenced by SBS::SoundData::RemoveHandle().
Vector3 SBS::Sound::GetDirection | ( | ) |
bool SBS::Sound::GetLoopState | ( | ) |
Definition at line 218 of file sound.cpp.
References SoundLoop.
Referenced by Skyscraper::SoundManager::Loop(), and Skyscraper::SoundManager::On_bSetLoop_Click().
Real SBS::Sound::GetMaximumDistance | ( | ) |
Definition at line 174 of file sound.cpp.
References MaxDistance.
Real SBS::Sound::GetMinimumDistance | ( | ) |
Definition at line 169 of file sound.cpp.
References MinDistance.
bool SBS::Sound::GetNearestReverbPosition | ( | Vector3 & | position | ) |
Definition at line 564 of file sound.cpp.
References SBS::ObjectBase::GetParent(), SBS::Object::GetPosition(), SBS::ElevatorCar::GetReverb(), SBS::Floor::GetReverb(), SBS::SBS::GetReverb(), SBS::Floor::GetReverbCount(), SBS::SBS::GetReverbCount(), SBS::Object::GetType(), and SBS::ObjectBase::sbs.
Real SBS::Sound::GetPlayPosition | ( | ) |
Definition at line 414 of file sound.cpp.
References channel, SBS::SoundSystem::GetLength(), IsValid(), Percent, sound, and system.
Referenced by Skyscraper::SoundManager::Loop().
int SBS::Sound::GetSpeed | ( | ) |
Definition at line 287 of file sound.cpp.
References Speed.
Referenced by Skyscraper::SoundManager::Loop().
Real SBS::Sound::GetVolume | ( | ) |
Definition at line 152 of file sound.cpp.
References Volume.
Referenced by Skyscraper::SoundManager::Loop().
bool SBS::Sound::IsEnabled | ( | ) |
Definition at line 630 of file sound.cpp.
References enabled.
Referenced by Skyscraper::SoundManager::Loop(), and Skyscraper::SoundManager::On_bEnabled_Click().
bool SBS::Sound::IsLoaded | ( | ) |
Definition at line 475 of file sound.cpp.
References sound.
Referenced by SBS::Elevator::Loop(), and SBS::ElevatorCar::Loop().
bool SBS::Sound::IsPaused | ( | ) |
Definition at line 242 of file sound.cpp.
References channel, and IsValid().
Referenced by IsPlaying(), Skyscraper::SoundManager::Loop(), and Skyscraper::SoundManager::On_bSetPause_Click().
bool SBS::Sound::IsPlaying | ( | ) |
Definition at line 254 of file sound.cpp.
References channel, IsPaused(), and IsValid().
Referenced by SBS::Escalator::Enabled(), SBS::MovingWalkway::Enabled(), SBS::Elevator::Loop(), SBS::ElevatorCar::Loop(), SBS::Escalator::Loop(), SBS::MovingWalkway::Loop(), Skyscraper::SoundManager::Loop(), SBS::Elevator::PlayMovingSounds(), SBS::ElevatorCar::PlayMovingSounds(), and ProcessQueue().
|
private |
Definition at line 303 of file sound.cpp.
References channel, SBS::SoundData::RemoveChannel(), and sound.
Referenced by GetPlayPosition(), IsPaused(), IsPlaying(), Pause(), and Play().
bool SBS::Sound::Load | ( | const std::string & | filename, |
bool | force = false ) |
Definition at line 386 of file sound.cpp.
References SBS::SoundData::AddHandle(), enabled, Filename, SBS::SoundSystem::Load(), Report(), SBS::ObjectBase::sbs, sound, system, Unload(), and SBS::SBS::Verbose.
Referenced by SBS::ElevatorCar::AddSound(), SBS::Floor::AddSound(), SBS::SBS::AddSound(), SBS::ElevatorCar::Alarm(), SBS::ElevatorDoor::Chime(), SBS::Door::Close(), SBS::Control::Control(), SBS::ElevatorDoor::EarlyChime(), SBS::ElevatorDoor::EnableNudgeMode(), SBS::Escalator::Escalator(), SBS::Elevator::Loop(), SBS::ElevatorCar::Loop(), SBS::ElevatorDoor::MoveDoors(), SBS::MovingWalkway::MovingWalkway(), SBS::RevolvingDoor::OnHit(), SBS::Door::Open(), SBS::ElevatorCar::PlayFloorBeep(), SBS::Elevator::PlayMovingSounds(), SBS::ElevatorCar::PlayMovingSounds(), SBS::Indicator::PlaySound(), SBS::Elevator::PlayStartingSounds(), SBS::ElevatorCar::PlayStartingSounds(), SBS::Elevator::PlayStoppingSounds(), SBS::ElevatorCar::PlayStoppingSounds(), ProcessQueue(), and SBS::Trigger::Trigger().
|
virtual |
Reimplemented from SBS::Object.
Definition at line 97 of file sound.cpp.
References channel, SBS::SBS::GetElapsedTime(), SBS::Object::GetPosition(), Position, SBS::ObjectBase::sbs, SetVelocity, SBS::SBS::ToGlobal(), and Velocity.
Referenced by OnRotate().
|
virtual |
Reimplemented from SBS::Object.
Definition at line 132 of file sound.cpp.
References OnMove().
void SBS::Sound::Pause | ( | bool | value = true | ) |
Definition at line 223 of file sound.cpp.
References channel, IsValid(), Report(), SBS::ObjectBase::sbs, and SBS::SBS::Verbose.
Referenced by SBS::ElevatorCar::Loop(), and Skyscraper::SoundManager::On_bSetPause_Click().
bool SBS::Sound::Play | ( | bool | reset = true | ) |
Definition at line 321 of file sound.cpp.
References SBS::SoundData::AddHandle(), channel, default_speed, Direction, doppler_level, enabled, Filename, SBS::SoundSystem::GetSoundData(), IsValid(), MaxDistance, MinDistance, Percent, Position, position_queued, SBS::SoundSystem::Prepare(), Report(), ReportError(), Reset(), SBS::ObjectBase::sbs, SetDirection(), SetDistances(), SetDopplerLevel(), SetLoopState(), SetPlayPosition(), SBS::Object::SetPosition(), SetSpeed(), SetVolume(), sound, SoundLoop, Speed, system, SBS::SBS::Verbose, and Volume.
Referenced by SBS::ElevatorCar::AddSound(), SBS::Floor::AddSound(), SBS::SBS::AddSound(), SBS::ElevatorCar::Alarm(), SBS::ElevatorDoor::Chime(), SBS::Door::Close(), SBS::ElevatorDoor::EarlyChime(), SBS::ElevatorDoor::EnableNudgeMode(), SBS::Elevator::Loop(), SBS::ElevatorCar::Loop(), SBS::Escalator::Loop(), SBS::MovingWalkway::Loop(), SBS::ElevatorDoor::MoveDoors(), Skyscraper::SoundManager::On_bPlay_Click(), SBS::RevolvingDoor::OnHit(), SBS::Door::Open(), SBS::ElevatorCar::PlayFloorBeep(), SBS::Elevator::PlayMovingSounds(), SBS::ElevatorCar::PlayMovingSounds(), SBS::Control::PlaySound(), SBS::Indicator::PlaySound(), SBS::Trigger::PlaySound(), SBS::Elevator::PlayStartingSounds(), SBS::ElevatorCar::PlayStartingSounds(), SBS::Elevator::PlayStoppingSounds(), SBS::ElevatorCar::PlayStoppingSounds(), and ProcessQueue().
void SBS::Sound::PlayQueued | ( | const std::string & | filename, |
bool | stop = true, | ||
bool | loop = false ) |
Definition at line 490 of file sound.cpp.
References SBS::Sound::SoundEntry::filename, SBS::Sound::SoundEntry::loop, SBS::Sound::SoundEntry::played, ProcessQueue(), queue, Report(), SBS::ObjectBase::sbs, Stop(), and SBS::SBS::Verbose.
Referenced by SBS::ElevatorCar::PlayFloorSound(), and SBS::ElevatorCar::PlayMessageSound().
void SBS::Sound::ProcessQueue | ( | ) |
Definition at line 512 of file sound.cpp.
References SBS::Sound::SoundEntry::filename, IsPlaying(), Load(), SBS::Sound::SoundEntry::loop, Play(), SBS::Sound::SoundEntry::played, queue, Report(), SBS::ObjectBase::sbs, SetLoopState(), and SBS::SBS::Verbose.
Referenced by SBS::ElevatorCar::Loop(), and PlayQueued().
|
virtual |
Reimplemented from SBS::ObjectBase.
Definition at line 480 of file sound.cpp.
References SBS::ObjectBase::GetName(), SBS::ObjectBase::GetParent(), and SBS::ObjectBase::Report().
Referenced by Load(), Pause(), Play(), PlayQueued(), ProcessQueue(), Reset(), SetPlayPosition(), SetSpeed(), SetVolume(), Sound(), Stop(), and Unload().
|
virtual |
Reimplemented from SBS::ObjectBase.
Definition at line 485 of file sound.cpp.
References SBS::ObjectBase::GetName(), SBS::ObjectBase::GetParent(), and SBS::ObjectBase::ReportError().
Referenced by Play().
void SBS::Sound::Reset | ( | ) |
Definition at line 378 of file sound.cpp.
References Report(), SBS::ObjectBase::sbs, SetPlayPosition(), and SBS::SBS::Verbose.
Referenced by Skyscraper::SoundManager::On_bReset_Click(), Play(), SBS::Elevator::PlayStoppingSounds(), and SBS::ElevatorCar::PlayStoppingSounds().
void SBS::Sound::SetConeSettings | ( | Real | inside_angle = 360.0, |
Real | outside_angle = 360.0, | ||
Real | outside_volume = 1.0 ) |
Definition at line 196 of file sound.cpp.
References channel.
Referenced by SBS::ElevatorCar::AddSound(), SBS::Floor::AddSound(), and SBS::SBS::AddSound().
void SBS::Sound::SetDirection | ( | const Vector3 & | direction | ) |
Definition at line 179 of file sound.cpp.
References channel, Direction, SBS::Object::GetOrientation(), and SBS::ObjectBase::sbs.
Referenced by SBS::ElevatorCar::AddSound(), SBS::Floor::AddSound(), SBS::SBS::AddSound(), and Play().
Definition at line 158 of file sound.cpp.
References channel, MaxDistance, and MinDistance.
Referenced by SBS::ElevatorCar::AddSound(), SBS::Floor::AddSound(), SBS::SBS::AddSound(), and Play().
void SBS::Sound::SetDopplerLevel | ( | Real | level | ) |
Definition at line 462 of file sound.cpp.
References channel, and doppler_level.
Referenced by SBS::ElevatorCar::AddSound(), SBS::Floor::AddSound(), SBS::SBS::AddSound(), and Play().
void SBS::Sound::SetLoopState | ( | bool | value | ) |
Definition at line 204 of file sound.cpp.
References channel, and SoundLoop.
Referenced by SBS::ElevatorCar::AddSound(), SBS::Floor::AddSound(), SBS::SBS::AddSound(), SBS::ElevatorCar::Alarm(), SBS::ElevatorDoor::Chime(), SBS::ElevatorDoor::EarlyChime(), SBS::ElevatorDoor::EnableNudgeMode(), SBS::Elevator::Loop(), SBS::ElevatorCar::Loop(), SBS::Escalator::Loop(), SBS::MovingWalkway::Loop(), Skyscraper::SoundManager::On_bSetLoop_Click(), Play(), SBS::ElevatorCar::PlayFloorBeep(), SBS::Elevator::PlayMovingSounds(), SBS::ElevatorCar::PlayMovingSounds(), SBS::Control::PlaySound(), SBS::Indicator::PlaySound(), SBS::Trigger::PlaySound(), SBS::Elevator::PlayStartingSounds(), SBS::ElevatorCar::PlayStartingSounds(), SBS::Elevator::PlayStoppingSounds(), SBS::ElevatorCar::PlayStoppingSounds(), and ProcessQueue().
void SBS::Sound::SetPlayPosition | ( | Real | percent | ) |
Definition at line 439 of file sound.cpp.
References channel, SBS::SoundSystem::GetLength(), Percent, position_queued, Report(), SBS::ObjectBase::sbs, sound, system, SBS::ToString(), and SBS::SBS::Verbose.
Referenced by Play(), SBS::Elevator::PlayStoppingSounds(), SBS::ElevatorCar::PlayStoppingSounds(), and Reset().
void SBS::Sound::SetSpeed | ( | int | percent | ) |
Definition at line 273 of file sound.cpp.
References channel, default_speed, Report(), SBS::ObjectBase::sbs, Speed, SBS::ToString(), and SBS::SBS::Verbose.
Referenced by SBS::ElevatorCar::AddSound(), SBS::Floor::AddSound(), SBS::SBS::AddSound(), Skyscraper::SoundManager::On_bSetSpeed_Click(), and Play().
void SBS::Sound::SetVolume | ( | Real | value | ) |
Definition at line 138 of file sound.cpp.
References channel, Report(), SBS::ObjectBase::sbs, SBS::ToString(), SBS::SBS::Verbose, and Volume.
Referenced by SBS::ElevatorCar::AddSound(), SBS::Floor::AddSound(), SBS::SBS::AddSound(), SBS::ElevatorCar::Loop(), Skyscraper::SoundManager::On_bSetVolume_Click(), and Play().
void SBS::Sound::Stop | ( | ) |
Definition at line 292 of file sound.cpp.
References channel, Report(), SBS::ObjectBase::sbs, and SBS::SBS::Verbose.
Referenced by SBS::ElevatorCar::Alarm(), SBS::Escalator::Enabled(), SBS::MovingWalkway::Enabled(), Enabled(), SBS::ElevatorDoor::EnableNudgeMode(), SBS::Elevator::Loop(), SBS::ElevatorCar::Loop(), SBS::ElevatorDoor::Loop(), SBS::Escalator::Loop(), SBS::MovingWalkway::Loop(), Skyscraper::SoundManager::On_bStop_Click(), SBS::ElevatorCar::PlayFloorBeep(), PlayQueued(), SBS::Indicator::PlaySound(), SBS::Elevator::PlayStartingSounds(), SBS::ElevatorCar::PlayStartingSounds(), SBS::Elevator::PlayStoppingSounds(), SBS::ElevatorCar::PlayStoppingSounds(), SBS::ElevatorCar::StopCarSound(), SBS::Elevator::StopSounds(), Unload(), and ~Sound().
void SBS::Sound::Unload | ( | ) |
Definition at line 540 of file sound.cpp.
References channel, SBS::SoundData::RemoveHandle(), Report(), SBS::ObjectBase::sbs, sound, Stop(), and SBS::SBS::Verbose.
Referenced by Load(), Skyscraper::SoundManager::On_bUnload_Click(), and ~Sound().
|
private |
Definition at line 80 of file sound.h.
Referenced by GetChannel(), GetPlayPosition(), IsPaused(), IsPlaying(), IsValid(), OnMove(), Pause(), Play(), SetConeSettings(), SetDirection(), SetDistances(), SetDopplerLevel(), SetLoopState(), SetPlayPosition(), SetSpeed(), SetVolume(), Sound(), Stop(), and Unload().
|
private |
Definition at line 99 of file sound.h.
Referenced by Play(), SetSpeed(), and Sound().
|
private |
Definition at line 94 of file sound.h.
Referenced by GetDirection(), Play(), SetDirection(), and Sound().
|
private |
Definition at line 100 of file sound.h.
Referenced by Play(), SetDopplerLevel(), and Sound().
|
private |
|
private |
|
private |
Definition at line 92 of file sound.h.
Referenced by GetMaximumDistance(), Play(), SetDistances(), and Sound().
|
private |
Definition at line 93 of file sound.h.
Referenced by GetMinimumDistance(), Play(), SetDistances(), and Sound().
|
private |
Definition at line 97 of file sound.h.
Referenced by GetPlayPosition(), Play(), SetPlayPosition(), and Sound().
|
private |
|
private |
Definition at line 101 of file sound.h.
Referenced by Play(), SetPlayPosition(), and Sound().
|
private |
Definition at line 111 of file sound.h.
Referenced by PlayQueued(), and ProcessQueue().
bool SBS::Sound::SetVelocity |
|
private |
Definition at line 84 of file sound.h.
Referenced by GetPlayPosition(), IsLoaded(), IsValid(), Load(), Play(), SetPlayPosition(), Sound(), and Unload().
|
private |
Definition at line 95 of file sound.h.
Referenced by GetLoopState(), Play(), SetLoopState(), and Sound().
|
private |
Definition at line 96 of file sound.h.
Referenced by GetSpeed(), Play(), SetSpeed(), and Sound().
|
private |
Definition at line 86 of file sound.h.
Referenced by GetPlayPosition(), Load(), Play(), SetPlayPosition(), Sound(), and ~Sound().
|
private |
Definition at line 91 of file sound.h.
Referenced by GetVolume(), Play(), SetVolume(), and Sound().