]> git.tdb.fi Git - libs/al.git/blobdiff - source/waveform.h
Split Sound into SoundDecoder and Waveform parts
[libs/al.git] / source / waveform.h
diff --git a/source/waveform.h b/source/waveform.h
new file mode 100644 (file)
index 0000000..c1f0a2d
--- /dev/null
@@ -0,0 +1,37 @@
+#ifndef MSP_AL_WAVEFORM_H_
+#define MSP_AL_WAVEFORM_H_
+
+#include <string>
+#include "format.h"
+
+namespace Msp {
+namespace AL {
+
+class SoundDecoder;
+
+class Waveform
+{
+private:
+       Format format;
+       unsigned freq;
+       unsigned size;
+       char *data;
+
+public:
+       Waveform();
+       ~Waveform();
+
+       void load_file(const std::string &);
+       void load_memory(const void *, unsigned);
+       void load(SoundDecoder &);
+
+       Format get_format() const { return format; }
+       unsigned get_frequency() const { return freq; }
+       unsigned get_size() const { return size; }
+       const char *get_data() const { return data; }
+};
+
+} // namespace AL
+} // namespace Msp
+
+#endif