CoriEngine
Loading...
Searching...
No Matches
Cori::Audio::Sound Class Reference

Sound asset to be played on a Track. More...

#include <Sound.hpp>

Inheritance diagram for Cori::Audio::Sound:
Collaboration diagram for Cori::Audio::Sound:

Classes

class  Descriptor
 Sound Descriptor meant to be used with AssetManager only. More...

Public Member Functions

 ~Sound ()
bool IsValid () const
 Check if the Sound is valid.
bool IsPlaceholder () const
 Checks if the sound was created with a placeholder.
SoundID GetID () const
 Returns the SoundID associated with Sound.

Static Public Member Functions

static std::shared_ptr< SoundCreate (const std::string &name, const std::filesystem::path &path, const bool preDecode=true)
 Creates a Sound object.

Public Attributes

const std::string m_Name

Detailed Description

Sound asset to be played on a Track.

Definition at line 12 of file Sound.hpp.

Constructor & Destructor Documentation

◆ ~Sound()

Cori::Audio::Sound::~Sound ( )

Definition at line 6 of file Sound.cpp.

Member Function Documentation

◆ Create()

std::shared_ptr< Sound > Cori::Audio::Sound::Create ( const std::string & name,
const std::filesystem::path & path,
const bool preDecode = true )
staticnodiscard

Creates a Sound object.

Parameters
nameName to be assigned to the Sound.
pathPath to the audio asset.
preDecodeWhether to precede the audio or no. Generally you want to leave it at default.
Returns
Shared pointer to the loaded Sound asset.

Definition at line 25 of file Sound.cpp.

◆ GetID()

SoundID Cori::Audio::Sound::GetID ( ) const
nodiscard

Returns the SoundID associated with Sound.

Definition at line 21 of file Sound.cpp.

◆ IsPlaceholder()

bool Cori::Audio::Sound::IsPlaceholder ( ) const
nodiscard

Checks if the sound was created with a placeholder.

Returns
Placeholder state.

Definition at line 17 of file Sound.cpp.

◆ IsValid()

bool Cori::Audio::Sound::IsValid ( ) const
nodiscard

Check if the Sound is valid.

Returns
Validity state.
Note
Generally there is no need to explicitly check for sound validity, because Track already does so.

Definition at line 13 of file Sound.cpp.

Member Data Documentation

◆ m_Name

const std::string Cori::Audio::Sound::m_Name

Definition at line 75 of file Sound.hpp.


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