Lumiverse  2.5
A framework for creating lighting control applications
ArnoldFrameManager.h
Go to the documentation of this file.
1 
5 #ifndef _ArnoldFRAMEMANAGER_H_
6 #define _ArnoldFRAMEMANAGER_H_
7 
8 #pragma once
9 
10 #include "LumiverseCoreConfig.h"
11 
12 #ifdef USE_ARNOLD
13 
14 #include <atomic>
15 #include <iostream>
16 
17 namespace Lumiverse {
26  class ArnoldFrameManager
27  {
28  public:
34  ArnoldFrameManager(int fps = 24) : m_fps(fps), m_current(0) { }
35 
39  virtual ~ArnoldFrameManager() { }
40 
45  virtual void dump(time_t time, float *frame, size_t width, size_t height) = 0;
46 
52  virtual float *getCurrentFrameBuffer() = 0;
53 
59  virtual time_t getCurrentTime() const = 0;
60 
67  virtual time_t getNextTime() const = 0;
68 
74  virtual bool hasNext() const = 0;
75 
80  virtual bool isEmpty() const = 0;
81 
87  virtual size_t getFrameNum() const = 0;
88 
92  virtual void reset() {
93  m_current = 0;
94  }
95 
99  virtual void next() {
100  if (hasNext())
101  m_current++;
102  }
103 
109  virtual void clear() {
110  reset();
111  }
112 
118  virtual std::string getType() { return "ArnoldFrameManager"; }
119 
120  virtual void setFps(int fps) { m_fps = fps; }
121  virtual int getFps() { return m_fps; }
122 
123  protected:
124  // An atomic counter to implement the cursor.
125  std::atomic<unsigned int> m_current;
126  int m_fps;
127  };
128 
129 }
130 #endif
131 
132 #endif
Contains all core Lumiverse functions and variables.
Definition: Device.cpp:2