forked from AmurSU/TSProject
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtscurvebuffer.cpp
More file actions
57 lines (50 loc) · 1009 Bytes
/
tscurvebuffer.cpp
File metadata and controls
57 lines (50 loc) · 1009 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include "tscurvebuffer.h"
TSCurveBuffer::TSCurveBuffer(QObject *parent) :
QObject(parent)
{
ts_volume[0]=0;
ts_tempIn[0]=0;
ts_tempOut[0]=0;
ts_end = 0;
}
int TSCurveBuffer::end()
{
return ts_end;
}
int* TSCurveBuffer::volume()
{
return ts_volume;
}
int* TSCurveBuffer::tempIn()
{
return ts_tempIn;
}
int* TSCurveBuffer::tempOut()
{
return ts_tempOut;
}
void TSCurveBuffer::append(int v, int tI, int tO)
{
if(ts_end == 17999)
{
emit overflowed();
return;
}
CurvesSegnments segs;
segs.prevV = ts_volume[ts_end];
segs.prevTin = ts_tempIn[ts_end];
segs.prevTout = ts_tempOut[ts_end];
ts_end++;
ts_volume[ts_end] = segs.curV = v;
ts_tempIn[ts_end] = segs.curTin = tI;
ts_tempOut[ts_end] = segs.curTout = tO;
emit changed(segs);
}
void TSCurveBuffer::setValues(int *vol, int *tin, int *tout, int n)
{
if(ts_end != 0)return;
for(int i=0;i<n;i++)
{
append(vol[i],tin[i],tout[i]);
}
}