HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CH_Bookmark.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: CH Bookmark (C++)
7  *
8  * COMMENTS: Bookmark which marks a frame range in the playback, allowing
9  * quickly jumping to relevant animation sequences
10  *
11  */
12 
13 #ifndef __CH_Bookmark_h__
14 #define __CH_Bookmark_h__
15 
16 #include "CH_API.h"
17 #include "CH_Types.h"
18 #include <UT/UT_Color.h>
19 #include <UT/UT_StringHolder.h>
20 
22 public:
24  fpreal start,
25  fpreal end,
26  const UT_Color &color);
27  ~CH_Bookmark();
28 
29  CH_Bookmark(const CH_Bookmark &other);
30  CH_Bookmark(CH_Bookmark &&other) = default;
31 
32  CH_Bookmark &operator=(const CH_Bookmark &other);
33  CH_Bookmark &operator=(CH_Bookmark &&other) = default;
34 
35  const UT_StringHolder &getName() const { return myName; }
36  void setName(const UT_StringHolder &name) { myName = name; }
37 
38  const UT_StringHolder &getComment() const { return myComment; }
39  void setComment(const UT_StringHolder &comment) { myComment = comment; }
40 
41  fpreal getStartTime() const { return myStart; }
42  void setStartTime(fpreal t) { myStart = t; }
43  fpreal getEndTime() const { return myEnd; }
44  void setEndTime(fpreal t) { myEnd = t; }
45  int getIndex() const;
46 
47  UT_Color getColor() const { return myColor; }
48  void setColor(const UT_Color &color) { myColor = color; }
49 
50  bool isVisible() const { return myVisible; }
51  void setVisible(bool visible) { myVisible = visible; }
52 
53  int64 sessionId() const { return myId; }
54 
55  bool save(UT_JSONWriter &w) const;
56  bool load(UT_JSONParser &p);
57  bool loadOTIOFormat(UT_JSONParser &p);
58 
59 private:
60  UT_StringHolder myName;
61  UT_StringHolder myComment;
62  UT_Color myColor;
63  fpreal myStart;
64  fpreal myEnd;
65 
66  // whether or not this bookmark is shown in the playbar, graph editor, and
67  // dopesheet
68  bool myVisible;
69 
70  // Ephemeral (per-session) id, used to help track bookmarks. This is more useful than
71  // the index into the CH_Manager's bookmark list, as that often changes when bookmarks
72  // are manipulated.
73  int64 myId;
74 
75  static SYS_AtomicInt64 theNextId;
76 
77  static int64 nextId();
78 };
79 
80 #endif
void setVisible(bool visible)
Definition: CH_Bookmark.h:51
fpreal getEndTime() const
Definition: CH_Bookmark.h:43
GLuint start
Definition: glcorearb.h:475
void setStartTime(fpreal t)
Definition: CH_Bookmark.h:42
fpreal getStartTime() const
Definition: CH_Bookmark.h:41
JSON reader class which handles parsing of JSON or bJSON files.
Definition: UT_JSONParser.h:87
int64 sessionId() const
Definition: CH_Bookmark.h:53
Class which writes ASCII or binary JSON streams.
Definition: UT_JSONWriter.h:37
GLuint GLuint end
Definition: glcorearb.h:475
void setName(const UT_StringHolder &name)
Definition: CH_Bookmark.h:36
long long int64
Definition: SYS_Types.h:116
GLuint const GLchar * name
Definition: glcorearb.h:786
bool isVisible() const
Definition: CH_Bookmark.h:50
GLdouble t
Definition: glad.h:2397
UT_Color getColor() const
Definition: CH_Bookmark.h:47
void setEndTime(fpreal t)
Definition: CH_Bookmark.h:44
void setComment(const UT_StringHolder &comment)
Definition: CH_Bookmark.h:39
const UT_StringHolder & getComment() const
Definition: CH_Bookmark.h:38
GLuint color
Definition: glcorearb.h:1261
fpreal64 fpreal
Definition: SYS_Types.h:277
#define CH_API
Definition: CH_API.h:10
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:857
const UT_StringHolder & getName() const
Definition: CH_Bookmark.h:35
void setColor(const UT_Color &color)
Definition: CH_Bookmark.h:48