cangine
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
cangine::Sound Struct Reference

Describes an audio source: its file path, name and volume. More...

#include <sound.hpp>

Public Member Functions

 Sound (std::string path, std::string name)
 Constructs a sound with an explicit path and name.
 
 Sound (std::string path)
 Constructs a sound from a path, deriving the name from it.
 

Public Attributes

std::string name
 Identifier used to reference the sound.
 
std::string path
 Path to the audio file.
 
float volume = 1.0f
 Playback volume (0.0 = silent, 1.0 = full).
 

Detailed Description

Describes an audio source: its file path, name and volume.

Used by AudioManager to load and reference playable sounds.

Constructor & Destructor Documentation

◆ Sound() [1/2]

cangine::Sound::Sound ( std::string  path,
std::string  name 
)
inline

Constructs a sound with an explicit path and name.

Parameters
pathPath to the audio file.
nameIdentifier for the sound.

◆ Sound() [2/2]

cangine::Sound::Sound ( std::string  path)

Constructs a sound from a path, deriving the name from it.

Parameters
pathPath to the audio file.

Member Data Documentation

◆ name

std::string cangine::Sound::name

Identifier used to reference the sound.

◆ path

std::string cangine::Sound::path

Path to the audio file.

◆ volume

float cangine::Sound::volume = 1.0f

Playback volume (0.0 = silent, 1.0 = full).


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