Overload  1.1
Game engine with editor
Public Member Functions | List of all members
OvCore::ECS::Components::CAudioSource Class Reference

#include <CAudioSource.h>

Inheritance diagram for OvCore::ECS::Components::CAudioSource:
OvCore::ECS::Components::AComponent OvCore::API::IInspectorItem OvCore::API::ISerializable

Public Member Functions

 CAudioSource (ECS::Actor &p_owner)
 
std::string GetName () override
 
void SetSound (OvAudio::Resources::Sound *p_sound)
 
void SetAutoplay (bool p_autoplay)
 
void SetVolume (float p_volume)
 
void SetPan (float p_pan)
 
void SetLooped (bool p_looped)
 
void SetPitch (float p_pitch)
 
void SetSpatial (bool p_value)
 
void SetAttenuationThreshold (float p_distance)
 
OvAudio::Resources::SoundGetSound () const
 
bool IsAutoplayed () const
 
float GetVolume () const
 
float GetPan () const
 
bool IsLooped () const
 
float GetPitch () const
 
bool IsFinished () const
 
bool IsSpatial () const
 
float GetAttenuationThreshold () const
 
void Play ()
 
void Resume ()
 
void Pause ()
 
void Stop ()
 
virtual void OnSerialize (tinyxml2::XMLDocument &p_doc, tinyxml2::XMLNode *p_node) override
 
virtual void OnDeserialize (tinyxml2::XMLDocument &p_doc, tinyxml2::XMLNode *p_node) override
 
virtual void OnInspector (OvUI::Internal::WidgetContainer &p_root) override
 
- Public Member Functions inherited from OvCore::ECS::Components::AComponent
 AComponent (ECS::Actor &p_owner)
 
virtual ~AComponent ()
 
virtual void OnAwake ()
 
virtual void OnStart ()
 
virtual void OnDestroy ()
 
virtual void OnUpdate (float p_deltaTime)
 
virtual void OnFixedUpdate (float p_deltaTime)
 
virtual void OnLateUpdate (float p_deltaTime)
 
virtual void OnCollisionEnter (Components::CPhysicalObject &p_otherObject)
 
virtual void OnCollisionStay (Components::CPhysicalObject &p_otherObject)
 
virtual void OnCollisionExit (Components::CPhysicalObject &p_otherObject)
 
virtual void OnTriggerEnter (Components::CPhysicalObject &p_otherObject)
 
virtual void OnTriggerStay (Components::CPhysicalObject &p_otherObject)
 
virtual void OnTriggerExit (Components::CPhysicalObject &p_otherObject)
 

Additional Inherited Members

- Public Attributes inherited from OvCore::ECS::Components::AComponent
ECS::Actorowner
 

Detailed Description

Represents an audio source. Its position in the world is important if the spatial sound settings is on

Constructor & Destructor Documentation

◆ CAudioSource()

OvCore::ECS::Components::CAudioSource::CAudioSource ( ECS::Actor p_owner)

Constructor

Parameters
p_owner@project: Overload
Author
: Overload Tech. @restrictions: This software may not be resold, redistributed or otherwise conveyed to a third party.

Member Function Documentation

◆ GetAttenuationThreshold()

float OvCore::ECS::Components::CAudioSource::GetAttenuationThreshold ( ) const

Returns the audio source attenuation threshold (Minimum distance before applying sound attenuation)

◆ GetName()

std::string OvCore::ECS::Components::CAudioSource::GetName ( )
overridevirtual

Returns the name of the component

Implements OvCore::ECS::Components::AComponent.

◆ GetPan()

float OvCore::ECS::Components::CAudioSource::GetPan ( ) const

Returns the audio source pan (Left / Right)

◆ GetPitch()

float OvCore::ECS::Components::CAudioSource::GetPitch ( ) const

Returns the audio source pitch (= frequency or playback speed)

◆ GetSound()

OvAudio::Resources::Sound * OvCore::ECS::Components::CAudioSource::GetSound ( ) const

Returns the sound attached to the audio source

◆ GetVolume()

float OvCore::ECS::Components::CAudioSource::GetVolume ( ) const

Returns the audio source volume

◆ IsAutoplayed()

bool OvCore::ECS::Components::CAudioSource::IsAutoplayed ( ) const

Returns true if the audio source should call "Play" OnEnable

◆ IsFinished()

bool OvCore::ECS::Components::CAudioSource::IsFinished ( ) const

Returns true if the audio source sound has finished

◆ IsLooped()

bool OvCore::ECS::Components::CAudioSource::IsLooped ( ) const

Returns if the audio source is looping

◆ IsSpatial()

bool OvCore::ECS::Components::CAudioSource::IsSpatial ( ) const

Returns true if the audio source is spatialized

◆ OnDeserialize()

void OvCore::ECS::Components::CAudioSource::OnDeserialize ( tinyxml2::XMLDocument &  p_doc,
tinyxml2::XMLNode *  p_node 
)
overridevirtual

Deserialize the component

Parameters
p_doc
p_node

Implements OvCore::API::ISerializable.

◆ OnInspector()

void OvCore::ECS::Components::CAudioSource::OnInspector ( OvUI::Internal::WidgetContainer p_root)
overridevirtual

Defines how the component should be drawn in the inspector

Parameters
p_root

Implements OvCore::API::IInspectorItem.

◆ OnSerialize()

void OvCore::ECS::Components::CAudioSource::OnSerialize ( tinyxml2::XMLDocument &  p_doc,
tinyxml2::XMLNode *  p_node 
)
overridevirtual

Serialize the component

Parameters
p_doc
p_node

Implements OvCore::API::ISerializable.

◆ Pause()

void OvCore::ECS::Components::CAudioSource::Pause ( )

Pause the audio source

◆ Play()

void OvCore::ECS::Components::CAudioSource::Play ( )

Play the audio source attached sound

◆ Resume()

void OvCore::ECS::Components::CAudioSource::Resume ( )

Resume the audio source

◆ SetAttenuationThreshold()

void OvCore::ECS::Components::CAudioSource::SetAttenuationThreshold ( float  p_distance)

Defines the audio source attenuation threshold (Minimum distance before applying sound attenuation)

Parameters
p_distance

◆ SetAutoplay()

void OvCore::ECS::Components::CAudioSource::SetAutoplay ( bool  p_autoplay)

Defines if the audio source should autoplay (Play sound on enable)

◆ SetLooped()

void OvCore::ECS::Components::CAudioSource::SetLooped ( bool  p_looped)

Defines if the audio source should loop

Parameters
p_looped

◆ SetPan()

void OvCore::ECS::Components::CAudioSource::SetPan ( float  p_pan)

Defines the audio source pan (Left / Right)

Parameters
p_pan

◆ SetPitch()

void OvCore::ECS::Components::CAudioSource::SetPitch ( float  p_pitch)

Defines the audio source pitch (= frequency or playback speed)

Parameters
p_pitch

◆ SetSound()

void OvCore::ECS::Components::CAudioSource::SetSound ( OvAudio::Resources::Sound p_sound)

Defines the sound to play on the audio source

Parameters
p_sound

◆ SetSpatial()

void OvCore::ECS::Components::CAudioSource::SetSpatial ( bool  p_value)

Defines if the audio source should be spatialized or not

Parameters
p_value

◆ SetVolume()

void OvCore::ECS::Components::CAudioSource::SetVolume ( float  p_volume)

Defines the audio source volume

Parameters
p_volume

◆ Stop()

void OvCore::ECS::Components::CAudioSource::Stop ( )

Stop the audio source


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