CEBL
2.1
Main Page
Namespaces
Data Structures
Files
File List
Globals
model
EEGDataStream.hpp
Go to the documentation of this file.
1
/*
2
* CEBL : CSU EEG Brain-Computer Interface Lab
3
*
4
* Author: Jeshua Bratman - jeshuabratman@gmail.com
5
*
6
* This file is part of CEBL.
7
*
8
* CEBL is free software; you can redistribute it and/or modify it.
9
* We only ask that if you use our code that you cite the source in
10
* your project or publication.
11
*
12
* EEG Group (www.cs.colostate.edu/eeg)
13
* Department of Computer Science
14
* Colorado State University
15
*
16
*/
17
25
#ifndef EEGDATASTREAM_H
26
#define EEGDATASTREAM_H
27
28
#include "../CEBLIncludes.hpp"
29
#include "
EEGData.hpp
"
30
#include <boost/thread/thread.hpp>
31
#include <boost/thread/mutex.hpp>
32
#include "
TimeoutThread.hpp
"
33
34
class
EEGDataStream
:
public
TimeoutThread
35
{
36
private
:
37
void
timeoutFunction();
38
39
protected
:
40
EEGData
buffer
;
41
//samples per second
42
int
sample_rate
;
43
//updater
44
virtual
void
updater
() = 0;
45
virtual
void
onStart
() {};
46
virtual
void
onStop
() {};
47
48
public
:
49
EEGDataStream
();
50
virtual
~EEGDataStream
();
51
52
void
start
();
53
void
stop
();
54
55
void
setSampleRate
(
int
sr) {
sample_rate
= sr; }
56
57
bool
isStarted
() {
return
is_started
; }
58
int
getSamplesAvailable
() {
return
buffer
.
numSamples
(); }
60
EEGData
read
(
int
samples);
62
EEGData
readAll
();
63
};
64
65
66
67
#endif
Generated by
1.8.1.1