add haupauge-1657 dual usb capture support, add deinterlace to recordmonitor, asset...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / samples.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2009 Adam Williams <broadcast at earthling dot net>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  *
20  */
21
22
23 #ifndef SAMPLES_H
24 #define SAMPLES_H
25
26 // An object which contains samples
27
28
29
30 class Samples
31 {
32 public:
33 // Allocate 0 samples
34         Samples();
35 // Allocate number of samples
36         Samples(int samples);
37 // Share memory with another buffer
38         Samples(Samples *src);
39         virtual ~Samples();
40
41         void reset();
42         void clear_objects();
43         void share(int shmid);
44         void allocate(int samples, int use_shm);
45 // Get the buffer
46         double* get_data();
47 // Get number of samples allocated
48         int get_allocated();
49         void set_allocated(int allocated);
50         int get_shmid();
51         void set_offset(int offset);
52         int get_offset();
53
54 private:
55         int shmid;
56         double *data;
57         int allocated;
58 // Offset to 1st sample in samples.
59         int offset;
60         int use_shm;
61 };
62
63
64
65 #endif
66
67
68
69