HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CL_RecordQueue.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: CL Library (C++)
7  *
8  * COMMENTS: Records samples, pushing old ones out of the queue if no
9  * space is available.
10  *
11  */
12 #ifndef CL_RECORD_QUEUE_H
13 #define CL_RECORD_QUEUE_H
14 
15 #include "CL_API.h"
16 #include <SYS/SYS_Types.h>
17 
18 #define CL_RECORD_MODE_OVERWRITE 0
19 #define CL_RECORD_MODE_EXTEND 1
20 #define CL_RECORD_MODE_ADD 2
21 #define CL_RECORD_MODE_CYCLE 3
22 
23 class UT_IStream;
24 class UT_OStream;
25 
27 {
28 public:
29  CL_RecordQueue(int mode, int size);
30  virtual ~CL_RecordQueue();
31 
32  void reset();
33 
34  void setRecordMode(int mode);
35  void addSamples(int num, const fpreal *samples);
36 
37  int getFullRangeSize();
38  int getTimeSliceSize();
39 
40  int getFullRange(int max, fpreal *samples);
41  int getTimeSlice(int max, fpreal *samples);
42  fpreal getCurrentFrame();
43 
44  fpreal getSample(fpreal index);
45 
46  fpreal *getData() { return myData; }
47  int size() { return myRecordPos+1; }
48  int actualSize() { return mySize; }
49 
50  void resize(int size, int clear = 0);
51 
52  void save(UT_OStream &os);
53  bool load(UT_IStream &is, int version);
54 
55 private:
56 
57 
58  int myRecordMode;
59  int mySize;
60  int myChunk;
61  int myRecordPos;
62  int myLastRecordPos;
63  int myLastTimeSliceLength;
64  int myCumulativeLength;
65  fpreal *myData;
66 };
67 
68 
69 #endif
GLsizeiptr size
Definition: glcorearb.h:663
#define CL_API
Definition: CL_API.h:10
const std::enable_if<!VecTraits< T >::IsVec, T >::type & max(const T &a, const T &b)
Definition: Composite.h:133
GLsizei samples
Definition: glcorearb.h:1297
GLenum mode
Definition: glcorearb.h:98
GT_API const UT_StringHolder version
double fpreal
Definition: SYS_Types.h:270
GLuint index
Definition: glcorearb.h:785
fpreal * getData()
png_infop png_uint_32 int num
Definition: png.h:2158