]> git.tdb.fi Git - libs/al.git/blob - source/waveform.h
Split Sound into SoundDecoder and Waveform parts
[libs/al.git] / source / waveform.h
1 #ifndef MSP_AL_WAVEFORM_H_
2 #define MSP_AL_WAVEFORM_H_
3
4 #include <string>
5 #include "format.h"
6
7 namespace Msp {
8 namespace AL {
9
10 class SoundDecoder;
11
12 class Waveform
13 {
14 private:
15         Format format;
16         unsigned freq;
17         unsigned size;
18         char *data;
19
20 public:
21         Waveform();
22         ~Waveform();
23
24         void load_file(const std::string &);
25         void load_memory(const void *, unsigned);
26         void load(SoundDecoder &);
27
28         Format get_format() const { return format; }
29         unsigned get_frequency() const { return freq; }
30         unsigned get_size() const { return size; }
31         const char *get_data() const { return data; }
32 };
33
34 } // namespace AL
35 } // namespace Msp
36
37 #endif