6#include "Util/AssetStore.hpp"
26 explicit SFX(
const std::string &path);
80 void Play(
int loop = 0,
int duration = -1);
92 void FadeIn(
unsigned int tick,
int oop = -1,
unsigned int duration = -1);
98 std::shared_ptr<Mix_Chunk> m_Chunk;
A class template for managing assets.
Definition: AssetStore.hpp:20
Class for handling sound effects.
Definition: SFX.hpp:17
void Play(int loop=0, int duration=-1)
Plays the sound effect.
SFX(const std::string &path)
Constructor that initializes the SFX object and loads the sound effect from the specified file path.
SFX(const SFX &)=delete
Deleted copy constructor to prevent copying of SFX objects.
int GetVolume() const
Retrieves the current volume of the sound effect.
SFX & operator=(const SFX &)=delete
Deleted copy assignment operator to prevent copying of SFX objects.
void FadeIn(unsigned int tick, int oop=-1, unsigned int duration=-1)
Fades in the sound effect gradually.
void LoadMedia(const std::string &path)
Loads the sound effect from the specified file path.
void VolumeUp(int step=1)
Increases the volume of the sound effect by one.
void VolumeDown(int step=1)
Decreases the volume of the sound effect by one.
void SetVolume(int volume)
Sets the volume of the background music.
Useful tools for development.
Definition: Animation.hpp:12