Debian Codegraph @

source/mainthr.h

raw
1 // ----------------------------------------------------------------------------
2 //
3 // Copyright (C) 2003-2013 Fons Adriaensen <[email protected]>
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 //
18 // ----------------------------------------------------------------------------
19
20
21 #ifndef __MAINTHR_H
22 #define __MAINTHR_H
23
24
25 #include <clthreads.h>
26 #include "impdata.h"
27 #include "shdata.h"
28 #include "shmem.h"
29
30
31 class Mainthr : public A_thread
32 {
33 public:
34
35 Mainthr (Shdata *shdata);
36 ~Mainthr (void);
37 virtual void thr_main (void);
38 void stop (void);
39
40 private:
41
42 enum { INIT, TERM, EXIT };
43 enum { DONE = 1, TRIG = 2 };
44
45 int inittest (void);
46 int initcapt (void);
47 int iohandle (void);
48 int rdopdata (int nfrm);
49 int wripdata (int nfrm);
50 void stopplay (void);
51 void stopcapt (bool rm);
52
53 int _state;
54 int _count;
55 Shdata *_shdata;
56 Impdata _opfile;
57 Impdata _ipfile [8];
58 int _op_it;
59 int _op_si;
60 int _ip_it;
61 int _ip_si;
62 float _buff [8192];
63 };
64
65
66 #endif