-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwavetree.h
More file actions
41 lines (30 loc) · 816 Bytes
/
Copy pathwavetree.h
File metadata and controls
41 lines (30 loc) · 816 Bytes
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
41
#ifndef awb_wavetree_h_
#define awb_wavetree_h_
#include <unistd.h>
#include <spug/RCBase.h>
#include <spug/RCPtr.h>
class WaveTreeNode;
struct WaveBuf {
size_t size;
float *buffer;
WaveBuf(size_t size) :
size(size),
buffer(new float[size]) {
}
~WaveBuf() { delete buffer; }
};
SPUG_RCPTR(WaveTree);
// WaveTree is a sparse tree of WaveBuf's.
// Every buffer must be of the same size WaveTree::framesPerBuffer.
class WaveTree : public spug::RCBase {
private:
WaveTreeNode *root;
public:
WaveTree() : root(0) {}
virtual ~WaveTree();
virtual WaveBuf *get(int pos, bool create = false);\
// Set the number of samples in a buffer.
static void setBufferSize(int nframes);
static int getBufferSize();
};
#endif