Air-Trap 1.0.0
A multiplayer R-Type clone game engine built with C++23 and ECS architecture
Loading...
Searching...
No Matches
rtp::ecs::components::audio::AudioSource Struct Reference

Component for entities that emit continuous sound (music, loops, ambient) More...

#include <AudioSource.hpp>

Collaboration diagram for rtp::ecs::components::audio::AudioSource:

Public Attributes

std::string audioPath
 Path to the audio file.
 
float volume {1.0f}
 Volume level (0.0 - 1.0)
 
bool loop {false}
 Whether the audio should loop.
 
bool isPlaying {false}
 Current playback state.
 
float pitch {1.0f}
 Pitch multiplier.
 
bool dirty {true}
 Flag to indicate changes need to be applied.
 
uint32_t sourceId {0}
 Internal audio source identifier.
 

Detailed Description

Component for entities that emit continuous sound (music, loops, ambient)

This component manages persistent audio sources that can be played, paused, stopped, and have their volume adjusted in real-time.

Definition at line 21 of file AudioSource.hpp.

Member Data Documentation

◆ audioPath

std::string rtp::ecs::components::audio::AudioSource::audioPath

◆ dirty

bool rtp::ecs::components::audio::AudioSource::dirty {true}

Flag to indicate changes need to be applied.

Definition at line 27 of file AudioSource.hpp.

Referenced by rtp::client::scenes::MenuScene::onEnter(), and rtp::client::scenes::PlayingScene::onEnter().

◆ isPlaying

bool rtp::ecs::components::audio::AudioSource::isPlaying {false}

Current playback state.

Definition at line 25 of file AudioSource.hpp.

Referenced by rtp::client::scenes::MenuScene::onEnter(), and rtp::client::scenes::PlayingScene::onEnter().

◆ loop

bool rtp::ecs::components::audio::AudioSource::loop {false}

◆ pitch

float rtp::ecs::components::audio::AudioSource::pitch {1.0f}

Pitch multiplier.

Definition at line 26 of file AudioSource.hpp.

Referenced by rtp::client::AudioSystem::playAudioSource().

◆ sourceId

uint32_t rtp::ecs::components::audio::AudioSource::sourceId {0}

Internal audio source identifier.

Definition at line 28 of file AudioSource.hpp.

Referenced by rtp::client::AudioSystem::playAudioSource().

◆ volume

float rtp::ecs::components::audio::AudioSource::volume {1.0f}

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