9#include <unordered_map>
44 hashCombine(res, t.
path);
105 void Clean()
override;
The base class for all assets.
Definition Asset.h:9
Represents a sound asset.
Definition Audio.h:54
float volume
Definition Audio.h:58
void Stop()
Stops the sound.
Definition Audio.cpp:96
bool isPlaying
Definition Audio.h:61
Asset * LoadFromFile(const char *path, void *id)
Loads the sound asset from a file.
Definition Audio.cpp:40
Asset * GetFromCache(void *id)
Gets the sound asset from the cache.
Definition Audio.cpp:33
bool isLooping
Definition Audio.h:60
void Clean() override
Cleans up the sound.
Definition Audio.cpp:78
void SetVolume(float volume)
Sets the volume of the sound.
Definition Audio.cpp:102
void Play()
Plays the sound.
Definition Audio.cpp:90
float frequency
Definition Audio.h:59
NW_DECL_RES_LIST(SoundIdentifier, Sound)
Declares the resource list for SoundIdentifier and Sound.
void SetFrequency(float frequency)
Sets the frequency of the sound.
Definition Audio.cpp:114
bool HasFinished()
Checks if the sound has finished playing.
Definition Audio.cpp:108
Sound()=default
Default constructor for the Sound class.
uint32 _buffID
Definition Audio.h:56
static void Destroy()
Destroys the Sound class.
Definition Audio.cpp:25
uint32 _source
Definition Audio.h:57
Asset * LoadFromBuffer(void *alBuffer, void *id)
Loads the sound asset from a buffer.
Definition Audio.cpp:67
static bool Init()
Initializes the Sound class.
Definition Audio.cpp:9
void SetLoop(bool loop)
Sets whether the sound should loop or not.
Definition Audio.cpp:121
Structure representing a sound identifier.
Definition Audio.h:17
uint64 runtimeID
Definition Audio.h:19
bool operator==(const SoundIdentifier &other) const
Overloaded equality operator for comparing SoundIdentifier objects.
Definition Audio.h:26
std::string path
Definition Audio.h:18
std::size_t operator()(const SoundIdentifier &t) const
Calculates the hash value for a SoundIdentifier object.
Definition Audio.h:42