Files
2021-06-09 11:14:53 +02:00

58 lines
964 B
C++

/*
** EPITECH PROJECT, 2021
** Bomberman
** File description:
** Sound
*/
#include "Audio/Sound.hpp"
RAY::Cache<::Sound> RAY::Audio::Sound::_soundsCache(LoadSound, UnloadSound);
RAY::Audio::Sound::Sound(const std::string &path, bool lonely):
_sound(_soundsCache.fetch(path, lonely))
{
}
bool RAY::Audio::Sound::isPlaying(void)
{
return IsSoundPlaying(*_sound);
}
RAY::Audio::Sound &RAY::Audio::Sound::play(void)
{
PlaySound(*_sound);
return *this;
}
RAY::Audio::Sound &RAY::Audio::Sound::stop(void)
{
StopSound(*_sound);
return *this;
}
RAY::Audio::Sound &RAY::Audio::Sound::pause(void)
{
PauseSound(*_sound);
return *this;
}
RAY::Audio::Sound &RAY::Audio::Sound::resume(void)
{
ResumeSound(*_sound);
return *this;
}
RAY::Audio::Sound &RAY::Audio::Sound::setVolume(float volume)
{
SetSoundVolume(*_sound, volume);
return *this;
}
RAY::Audio::Sound &RAY::Audio::Sound::setPitch(float pitch)
{
SetSoundPitch(*_sound, pitch);
return *this;
}