[Added] Services for assets and audio, main screen, simplified drawing, [Updated] Dockerfile, so the libraries get their own folder
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
#include "AudioService.h"
|
||||
#include "AssetService.h"
|
||||
|
||||
AudioService::~AudioService()
|
||||
{
|
||||
if (!music.has_value())
|
||||
return;
|
||||
UnloadMusicStream(music.value());
|
||||
}
|
||||
|
||||
void AudioService::setMusic(EMusic music)
|
||||
{
|
||||
if (currentTrack == music)
|
||||
return;
|
||||
|
||||
this->currentTrack = music;
|
||||
this->music = AssetService::getInstance().getMusic(music);
|
||||
}
|
||||
|
||||
void AudioService::playMusic()
|
||||
{
|
||||
if (!music.has_value())
|
||||
return;
|
||||
PlayMusicStream(music.value());
|
||||
}
|
||||
|
||||
void AudioService::pauseMusic()
|
||||
{
|
||||
if (!music.has_value())
|
||||
return;
|
||||
PauseMusicStream(music.value());
|
||||
}
|
||||
|
||||
void AudioService::stopMusic()
|
||||
{
|
||||
if (music.has_value())
|
||||
{
|
||||
StopMusicStream(music.value());
|
||||
}
|
||||
this->currentTrack = EMusic::NONE;
|
||||
}
|
||||
|
||||
void AudioService::playSound()
|
||||
{
|
||||
}
|
||||
|
||||
void AudioService::stopSounds()
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user