forked from ChrisVeigl/BrainBay
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathob_average.h
53 lines (32 loc) · 1.19 KB
/
ob_average.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
/* -----------------------------------------------------------------------------
BrainBay - Version 1.7, GPL 2003-2010
MODULE: OB_AVERAGE.H declarations for the Averager-Object
Author: Chris Veigl
This Object outputs the Average of n Samples captured from it's input-port
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; See the
GNU General Public License for more details.
-------------------------------------------------------------------------------------*/
#define AVGSAMPLES 20000
class AVERAGEOBJ : public BASE_CL
{
protected:
float accumulator;
float samples[AVGSAMPLES];
int interval, writepos, added;
public:
AVERAGEOBJ(int num);
void session_start(void);
void session_reset(void);
void session_pos(long pos);
void make_dialog(void);
void load(HANDLE hFile);
void incoming_data(int port, float value);
void save(HANDLE hFile);
void work(void);
~AVERAGEOBJ();
friend LRESULT CALLBACK AverageDlgHandler(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
private:
void change_interval(int newinterval);
};