blob: 30b015775acc5d929955682dc07f0dd094c8d1ed (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
#include "SoundSystem.h"
#include <memory>
using namespace crepe;
SoundSystem SoundSystem::instance { };
std::unique_ptr<Sound> SoundSystem::sound(const std::string & src) {
auto res = std::make_unique<api::Resource>(src);
return SoundSystem::sound(std::move(res));
}
std::unique_ptr<Sound> SoundSystem::sound(std::unique_ptr<api::Resource> res) {
Sound * out = new Sound(std::move(res), SoundSystem::instance);
return std::unique_ptr<Sound>(out);
}
SoundSystem::SoundSystem() {
engine.init();
}
SoundSystem::~SoundSystem() {
engine.deinit();
}
|