forked from rtpHarry/Sokoban
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SoundCache.h
40 lines (31 loc) · 882 Bytes
/
SoundCache.h
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#pragma once
// loads samples into and out of the OpenAL cache
//////////////////////////////////////////////////////////////////////////
// TODO: presumes that sound system is enabled and working - implement a
// way to make this more resiliant to errors!
// TODO: make singleton
#include <string>
#include <vector>
using namespace std;
#include <al/alut.h>
// clean name for a reference to a sound
typedef ALuint SampleID;
// simple structure to hold together information about a sound sample
struct SoundCacheSample
{
SampleID OpenALSampleID;
string FileName;
unsigned int References;
};
class SoundCache
{
public:
SoundCache(void);
~SoundCache(void);
// Load a new sample into the system
SampleID LoadSample(string FileName);
private:
vector<SoundCacheSample> m_SoundCache;
// Load a sample from a file
SampleID _LoadSampleFromFile(string FileName);
};