Skip to content

File AudioSource.hpp

File List > Components > AudioSource.hpp

Go to the documentation of this file

#ifndef ENGINE_COMPONENTS_AUDIOSOURCE_HPP_
#define ENGINE_COMPONENTS_AUDIOSOURCE_HPP_

#include <string>

namespace Engine {
struct AudioSource {
    std::string assetId;
    bool isMusic = false; // True if it's a music stream, False if it's a sound effect

    // Triggers (Systems react to these and reset them)
    bool shouldPlay = false;
    bool shouldStop = false;

    // State (Systems update this to reflect reality)
    bool isPlaying = false;

    bool loop = false;
    float volume = 1.0f;
};
} // namespace Engine

#endif // ENGINE_COMPONENTS_AUDIOSOURCE_HPP_