Skyscraper 2.0
SBS::SoundSystem Class Reference

#include <soundsystem.h>

Inheritance diagram for SBS::SoundSystem:
Collaboration diagram for SBS::SoundSystem:

Classes

struct  Reverb
 

Public Member Functions

 SoundSystem (Object *parent, FMOD::System *fmodsystem)
 
 SoundSystem (Object *parent)
 
 ~SoundSystem ()
 
void SetListenerPosition (const Vector3 &position)
 
void SetListenerDirection (const Vector3 &front, const Vector3 &top)
 
Vector3 GetListenerPosition ()
 
void Loop ()
 
void Cleanup (int index=-1)
 
unsigned int GetLength (SoundData *data)
 
SoundDataLoad (const std::string &filename)
 
bool IsLoaded (std::string filename)
 
void Report (const std::string &message)
 
bool ReportError (const std::string &message)
 
FMOD::Channel * Prepare (SoundData *data)
 
FMOD::System * GetFmodSystem ()
 
SoundDataGetSoundData (std::string filename)
 
SoundDataGetSoundData (int number)
 
int GetPlayingCount ()
 
int GetSoundCount ()
 
void ShowLoadedSounds ()
 
void ShowPlayingSounds (bool verbose=true)
 
void ShowPlayingTotal ()
 
- Public Member Functions inherited from SBS::Object
 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)
 
ObjectGetChild (int index)
 
int GetChildrenCount ()
 
void RemoveChild (Object *object)
 
SceneNodeGetSceneNode ()
 
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 OnMove (bool parent)
 
virtual void OnRotate (bool parent)
 
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 ()
 
void RegisterLoop (Object *object)
 
void UnregisterLoop (Object *object)
 
virtual void Enabled (bool value)
 
std::string GetNameBase ()
 
template<typename T >
bool IsType ()
 
template<typename T >
T * ConvertTo ()
 
- Public Member Functions inherited from SBS::ObjectBase
 ObjectBase (Object *parent)
 
virtual ~ObjectBase ()
 
ObjectGetParent ()
 
SBSGetRoot ()
 
void SetName (const std::string &name)
 
const std::string & GetName ()
 
std::string GetNameBase ()
 

Private Attributes

FMOD::System * soundsys
 
Vector3 listener_position
 
Vector3 listener_velocity
 
Vector3 listener_forward
 
Vector3 listener_up
 
std::vector< SoundData * > sounds
 
Vector3 Position
 
std::vector< Reverbreverbs
 

Additional Inherited Members

- Public Attributes inherited from SBS::Object
std::string command
 
std::string command_processed
 
std::string context
 
int linenum
 
std::string includefile
 
bool parent_deleting
 
- Protected Member Functions inherited from SBS::Object
void EnableLoop (bool value)
 
void LoopChildren ()
 
bool SelfDestruct ()
 
- Protected Attributes inherited from SBS::ObjectBase
SBSsbs
 

Detailed Description

Definition at line 36 of file soundsystem.h.

Constructor & Destructor Documentation

◆ SoundSystem() [1/2]

SBS::SoundSystem::SoundSystem ( Object * parent,
FMOD::System * fmodsystem )

Definition at line 38 of file soundsystem.cpp.

References listener_forward, listener_position, listener_up, listener_velocity, Position, SBS::Object::SetValues(), and soundsys.

Here is the call graph for this function:

◆ SoundSystem() [2/2]

SBS::SoundSystem::SoundSystem ( Object * parent)

Definition at line 58 of file soundsystem.cpp.

References listener_forward, listener_position, listener_up, listener_velocity, Position, and SBS::Object::SetValues().

Here is the call graph for this function:

◆ ~SoundSystem()

SBS::SoundSystem::~SoundSystem ( )

Definition at line 69 of file soundsystem.cpp.

References sounds.

Member Function Documentation

◆ Cleanup()

void SBS::SoundSystem::Cleanup ( int index = -1)

Definition at line 191 of file soundsystem.cpp.

References GetSoundCount(), Report(), SBS::ObjectBase::sbs, sounds, and SBS::SBS::Verbose.

Referenced by Skyscraper::SoundManager::On_bCleanup_Click(), and Skyscraper::SoundManager::On_bUnload_Click().

Here is the call graph for this function:

◆ GetFmodSystem()

FMOD::System * SBS::SoundSystem::GetFmodSystem ( )

Definition at line 421 of file soundsystem.cpp.

References soundsys.

Referenced by SBS::Reverb::Reverb().

◆ GetLength()

unsigned int SBS::SoundSystem::GetLength ( SoundData * data)

◆ GetListenerPosition()

Vector3 SBS::SoundSystem::GetListenerPosition ( )
inline

Definition at line 45 of file soundsystem.h.

◆ GetPlayingCount()

int SBS::SoundSystem::GetPlayingCount ( )

Definition at line 353 of file soundsystem.cpp.

References soundsys.

Referenced by Skyscraper::SoundManager::Loop(), and ShowPlayingTotal().

◆ GetSoundCount()

int SBS::SoundSystem::GetSoundCount ( )

◆ GetSoundData() [1/2]

SoundData * SBS::SoundSystem::GetSoundData ( int number)

Definition at line 333 of file soundsystem.cpp.

References GetSoundCount(), and sounds.

Here is the call graph for this function:

◆ GetSoundData() [2/2]

SoundData * SBS::SoundSystem::GetSoundData ( std::string filename)

Definition at line 320 of file soundsystem.cpp.

References GetSoundCount(), SBS::SetCase(), and sounds.

Referenced by Skyscraper::SoundManager::BuildSoundList(), Load(), Skyscraper::SoundManager::Loop(), and SBS::Sound::Play().

Here is the call graph for this function:

◆ IsLoaded()

bool SBS::SoundSystem::IsLoaded ( std::string filename)

Definition at line 281 of file soundsystem.cpp.

References GetSoundCount(), SBS::SetCase(), and sounds.

Here is the call graph for this function:

◆ Load()

SoundData * SBS::SoundSystem::Load ( const std::string & filename)

◆ Loop()

◆ Prepare()

FMOD::Channel * SBS::SoundSystem::Prepare ( SoundData * data)

Definition at line 297 of file soundsystem.cpp.

References SBS::SoundData::AddChannel(), SBS::SoundData::sound, and soundsys.

Referenced by SBS::Sound::Play().

Here is the call graph for this function:

◆ Report()

void SBS::SoundSystem::Report ( const std::string & message)
virtual

Reimplemented from SBS::ObjectBase.

Definition at line 343 of file soundsystem.cpp.

References SBS::ObjectBase::Report().

Referenced by Cleanup().

Here is the call graph for this function:

◆ ReportError()

bool SBS::SoundSystem::ReportError ( const std::string & message)
virtual

Reimplemented from SBS::ObjectBase.

Definition at line 348 of file soundsystem.cpp.

References SBS::ObjectBase::ReportError().

Referenced by Load().

Here is the call graph for this function:

◆ SetListenerDirection()

void SBS::SoundSystem::SetListenerDirection ( const Vector3 & front,
const Vector3 & top )

Definition at line 155 of file soundsystem.cpp.

References listener_forward, listener_position, listener_up, listener_velocity, and soundsys.

Referenced by Loop().

◆ SetListenerPosition()

void SBS::SoundSystem::SetListenerPosition ( const Vector3 & position)

◆ ShowLoadedSounds()

void SBS::SoundSystem::ShowLoadedSounds ( )

Definition at line 369 of file soundsystem.cpp.

References GetSoundCount(), SBS::ObjectBase::Report(), sounds, and SBS::ToString().

Referenced by Skyscraper::ScriptProcessor::CommandsSection::Run().

Here is the call graph for this function:

◆ ShowPlayingSounds()

void SBS::SoundSystem::ShowPlayingSounds ( bool verbose = true)

◆ ShowPlayingTotal()

void SBS::SoundSystem::ShowPlayingTotal ( )

Definition at line 415 of file soundsystem.cpp.

References GetPlayingCount(), SBS::ObjectBase::Report(), and SBS::ToString().

Referenced by Skyscraper::VM::ListPlayingSounds(), and ShowPlayingSounds().

Here is the call graph for this function:

Member Data Documentation

◆ listener_forward

Vector3 SBS::SoundSystem::listener_forward
private

Definition at line 75 of file soundsystem.h.

Referenced by SetListenerDirection(), SetListenerPosition(), SoundSystem(), and SoundSystem().

◆ listener_position

Vector3 SBS::SoundSystem::listener_position
private

Definition at line 73 of file soundsystem.h.

Referenced by SetListenerDirection(), SetListenerPosition(), SoundSystem(), and SoundSystem().

◆ listener_up

Vector3 SBS::SoundSystem::listener_up
private

Definition at line 76 of file soundsystem.h.

Referenced by SetListenerDirection(), SetListenerPosition(), SoundSystem(), and SoundSystem().

◆ listener_velocity

Vector3 SBS::SoundSystem::listener_velocity
private

Definition at line 74 of file soundsystem.h.

Referenced by SetListenerDirection(), SetListenerPosition(), SoundSystem(), and SoundSystem().

◆ Position

Vector3 SBS::SoundSystem::Position
private

Definition at line 81 of file soundsystem.h.

Referenced by SetListenerPosition(), SoundSystem(), and SoundSystem().

◆ reverbs

std::vector<Reverb> SBS::SoundSystem::reverbs
private

Definition at line 91 of file soundsystem.h.

◆ sounds

std::vector<SoundData*> SBS::SoundSystem::sounds
private

◆ soundsys

FMOD::System* SBS::SoundSystem::soundsys
private

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