-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmtrk_arrays.h
82 lines (62 loc) · 1.47 KB
/
mtrk_arrays.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#ifndef mtrk_arrays_h
#define mtrk_arrays_h 1
#include "cJSON.h"
namespace SEQ_NAMESPACE
{
class mtrk_state;
class mtrk_array
{
public:
enum
{
INVALID=-1,
INT=0,
FLOAT=1,
COMPLEX_FLOAT=2,
DOUBLE=3,
COMPLEX_DOUBLE=4
};
enum
{
TEXT=0,
BASE64=1
};
mtrk_array();
virtual ~mtrk_array();
void clear();
bool allocate(int dataType, int dataSize);
bool load(cJSON* dataItem, int encoding);
bool loadText(cJSON* dataItem);
bool loadBase64(cJSON* dataItem);
double getDouble (int index);
int getInt (int index);
double getFrequency(int index);
double getAbsolute (int index);
double getPhase (int index);
float* getData();
void dump();
void* data;
int size;
int type;
size_t elementSize;
};
inline double mtrk_array::getAbsolute(int index)
{
return getFrequency(index);
}
class mtrk_arrays
{
public:
mtrk_arrays();
virtual ~mtrk_arrays();
void clear();
bool prepare(cJSON* section);
mtrk_array* getArray(int index);
mtrk_array* getArray(char* name);
void dumpAll();
mtrk_array** arrayData;
cJSON* arrays;
int count;
};
}
#endif