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 <UT/UT_NonCopyable.h>
17 #include <SYS/SYS_Types.h>
18 
19 #define CL_RECORD_MODE_OVERWRITE 0
20 #define CL_RECORD_MODE_EXTEND 1
21 #define CL_RECORD_MODE_ADD 2
22 #define CL_RECORD_MODE_CYCLE 3
23 
24 class UT_IStream;
25 class UT_OStream;
26 
28 {
29 public:
30  CL_RecordQueue(int mode, int size);
31  virtual ~CL_RecordQueue();
32 
34 
35  void reset();
36 
37  void setRecordMode(int mode);
38  void addSamples(int num, const fpreal *samples);
39 
40  int getFullRangeSize();
41  int getTimeSliceSize();
42 
43  int getFullRange(int max, fpreal *samples);
44  int getTimeSlice(int max, fpreal *samples);
45  fpreal getCurrentFrame();
46 
47  fpreal getSample(fpreal index);
48 
49  fpreal *getData() { return myData; }
50  int size() { return myRecordPos+1; }
51  int actualSize() { return mySize; }
52 
53  void resize(int size, int clear = 0);
54 
55  void save(UT_OStream &os);
56  bool load(UT_IStream &is, int version);
57 
58 private:
59 
60 
61  int myRecordMode;
62  int mySize;
63  int myChunk;
64  int myRecordPos;
65  int myLastRecordPos;
66  int myLastTimeSliceLength;
67  int myCumulativeLength;
68  fpreal *myData;
69 };
70 
71 
72 #endif
#define CL_API
Definition: CL_API.h:10
GLboolean reset
Definition: glad.h:5138
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
GLsizei samples
Definition: glcorearb.h:1298
GLenum mode
Definition: glcorearb.h:99
GT_API const UT_StringHolder version
GLsizeiptr size
Definition: glcorearb.h:664
ImageBuf OIIO_API resize(const ImageBuf &src, string_view filtername="", float filterwidth=0.0f, ROI roi={}, int nthreads=0)
fpreal64 fpreal
Definition: SYS_Types.h:277
GLuint index
Definition: glcorearb.h:786
fpreal * getData()
ImageBuf OIIO_API max(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)