HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HUSD_EditClips.h
Go to the documentation of this file.
1 /*
2  * Copyright 2019 Side Effects Software Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 
18 #ifndef __HUSD_EditClips_h__
19 #define __HUSD_EditClips_h__
20 
21 #include "HUSD_API.h"
22 #include "HUSD_DataHandle.h"
23 #include <UT/UT_StringHolder.h>
24 
26 {
27 public:
28  HUSD_ClipSegment(int clipindex,
30  : myClipIndex(clipindex),
31  myForcedClipStartTime(0.0),
32  myDuration(duration),
33  myFirstAndLastFramesMatch(false),
34  myUseForcedClipStartTime(false),
35  myResetClipTime(false)
36  { }
37 
38  int clipIndex() const
39  { return myClipIndex; }
40 
42  { myDuration = duration; }
43  fpreal duration() const
44  {
45  if (SYSisLessOrEqual(myDuration, 1.0) ||
46  !myFirstAndLastFramesMatch)
47  return myDuration;
48 
49  return myDuration - 1.0;
50  }
51 
52  void setFirstAndLastFramesMatch(bool match)
53  { myFirstAndLastFramesMatch = match; }
55  { return myFirstAndLastFramesMatch; }
56 
57  void setForcedClipStartTime(fpreal clip_start_time)
58  {
59  myForcedClipStartTime = clip_start_time;
60  myUseForcedClipStartTime = true;
61  }
63  { return myUseForcedClipStartTime; }
65  { return myForcedClipStartTime; }
66 
68  { myResetClipTime = reset; }
69  bool resetClipTime() const
70  { return myResetClipTime; }
71 
72 private:
73  int myClipIndex;
74  fpreal myForcedClipStartTime;
75  fpreal myDuration;
76  bool myFirstAndLastFramesMatch;
77  bool myUseForcedClipStartTime;
78  bool myResetClipTime;
79 };
80 
82 
84 {
85 public:
87  ~HUSD_EditClips();
88 
89  bool setClipPrimPath(const UT_StringRef &primpath,
90  const UT_StringRef &clipsetname,
91  const UT_StringRef &clipprimpath) const;
92  bool setClipManifestFile(const UT_StringRef &primpath,
93  const UT_StringRef &clipsetname,
94  const UT_StringRef &manifestfile) const;
95  bool setClipFiles(const UT_StringRef &primpath,
96  const UT_StringRef &clipsetname,
97  const UT_StringArray &clipfiles) const;
98  bool setClipSegments(const UT_StringRef &primpath,
99  const UT_StringRef &clipsetname,
100  fpreal starttime,
101  fpreal clipstarttime,
102  fpreal cliptimescale,
103  const HUSD_ClipSegmentArray &segments,
104  bool set_fake_manifest = false) const;
105 
106  bool flattenClipFiles(const UT_StringRef &primpath,
107  const UT_StringRef &clipsetname,
108  const UT_StringArray &clipfilesavepaths) const;
109  bool createClipTopologyFile(const UT_StringRef &primpath,
110  const UT_StringRef &clipsetname,
111  const UT_StringRef &topologyfile,
112  bool use_single_file = false) const;
113  bool getMissingClipManifests(const UT_StringRef &primpath,
115  bool createClipManifestFile(const UT_StringRef &primpath,
116  const UT_StringRef &clipsetname,
117  const UT_StringRef &manifestfile,
118  bool use_single_file = false) const;
119  bool compactFlattenedClipFiles(const UT_StringRef &primpath,
120  const UT_StringRef &clipsetname) const;
121  bool authorExistenceTrackingVisibility(
122  const UT_StringRef &primpath,
123  const UT_StringRef &clipsetname) const;
124 
125 private:
126  HUSD_AutoWriteLock &myWriteLock;
127 };
128 
129 #endif
130 
void setResetClipTime(bool reset)
HUSD_ClipSegment(int clipindex, fpreal duration)
fpreal forcedClipStartTime() const
#define HUSD_API
Definition: HUSD_API.h:32
void setForcedClipStartTime(fpreal clip_start_time)
GLboolean reset
Definition: glad.h:5138
void setDuration(fpreal duration)
UT_Array< HUSD_ClipSegment > HUSD_ClipSegmentArray
fpreal duration() const
bool resetClipTime() const
void setFirstAndLastFramesMatch(bool match)
int clipIndex() const
bool firstAndLastFramesMatch() const
fpreal64 fpreal
Definition: SYS_Types.h:277
bool useForcedClipStartTime() const