HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
UT_Playback.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: UT_Playback.h ( UT Library, C++)
7  *
8  * COMMENTS:
9  *
10  * This class is used to store framebar info for
11  * classes above the SI library.
12  *
13  */
14 
15 #ifndef __UT_Playback__
16 #define __UT_Playback__
17 
18 #include "UT_API.h"
19 #include <iosfwd>
20 #include <SYS/SYS_Types.h>
21 #include <SYS/SYS_StaticInit.h>
22 #include "UT_ValArray.h"
23 
24 class ut_PlayCB;
25 
26 // cbdata, UT_PlaybackMode, oldframe, newframe
27 typedef void (*UT_PlayCallback)(void *, int, fpreal, fpreal);
28 
30 {
31 public:
32 
33  UT_Playback();
34  ~UT_Playback();
35 
41  RESET
42  };
43 
44  void setPlaybackMode(UT_PlaybackMode mode);
45 
47  { return myPlayback; }
48 
49  int getStopCount() const
50  { return myStopCount; }
51 
52  void setRealtimeMode(bool mode)
53  { myRealtimeMode = mode; }
54 
55  bool getRealtimeMode() const
56  { return myRealtimeMode; }
57 
59  { myStartRange = start; myEndRange = end; }
60 
62  { start = myStartRange; end = myEndRange; }
63 
64  bool isPlaybackReset();
65  bool isPlaying() const { return (myPlayback == FORWARD ||
66  myPlayback == REVERSE); }
67 
68  void setCurrentFrame(fpreal frame);
69  fpreal getCurrentFrame() { return myCurrentFrame; }
70 
71  void resetAbsoluteFrame();
72  unsigned long getAbsoluteFrame() { return myAbsoluteFrame; }
73 
74  // tells SI_Playback to stop.
75  void stopPlayback();
76  void setStopCallback(void (*cb)(void *), void *data);
77 
78  void setInterceptMode(int mode) { myInterceptMode = mode; }
79  int getInterceptMode() const { return myInterceptMode; }
80 
81  // Callbacks are passed the UT_PlaybackMode and 'data'.
82  void addPlayCallback(UT_PlayCallback cb, void *cbdata);
83  void removePlayCallback(UT_PlayCallback cb, void *cbdata);
84 
85  static UT_Playback *getPlayback();
86 
87 private:
88 
89  UT_PlaybackMode myPlayback;
90  fpreal myStartRange;
91  fpreal myEndRange;
92  fpreal myCurrentFrame;
93  unsigned long myAbsoluteFrame;
94  bool myRealtimeMode;
95  bool myResetFlag;
96  int myInterceptMode;
97  UT_ValArray<ut_PlayCB *> myPlayCallbacks;
98 
99  int myStopCount;
100 };
101 
102 SYSdeclareStaticObject(UT_API, UTplaybackObject);
103 
104 #endif
105 
void setPlaybackRange(fpreal start, fpreal end)
Definition: UT_Playback.h:58
GLuint start
Definition: glcorearb.h:474
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
#define UT_API
Definition: UT_API.h:12
void getPlaybackRange(fpreal &start, fpreal &end) const
Definition: UT_Playback.h:61
UT_PlaybackMode getPlaybackMode() const
Definition: UT_Playback.h:46
void(* UT_PlayCallback)(void *, int, fpreal, fpreal)
Definition: UT_Playback.h:27
void setInterceptMode(int mode)
Definition: UT_Playback.h:78
void setRealtimeMode(bool mode)
Definition: UT_Playback.h:52
int getInterceptMode() const
Definition: UT_Playback.h:79
GLuint GLuint end
Definition: glcorearb.h:474
bool getRealtimeMode() const
Definition: UT_Playback.h:55
int getStopCount() const
Definition: UT_Playback.h:49
GLboolean * data
Definition: glcorearb.h:130
SYSdeclareStaticObject(UT_API, UTplaybackObject)
fpreal getCurrentFrame()
Definition: UT_Playback.h:69
GLenum mode
Definition: glcorearb.h:98
double fpreal
Definition: SYS_Types.h:269
typedef int
Definition: png.h:1175
unsigned long getAbsoluteFrame()
Definition: UT_Playback.h:72
bool isPlaying() const
Definition: UT_Playback.h:65