1/****************************************************************************************
2
3 Copyright (C) 2015 Autodesk, Inc.
4 All rights reserved.
5
6 Use of this software is subject to the terms of the Autodesk license agreement
7 provided at the time of installation or download, or which otherwise accompanies
8 this software in either electronic or hard copy form.
9
10****************************************************************************************/
11
12//! \file fbxvideo.h
13#ifndef _FBXSDK_SCENE_VIDEO_H_
14#define _FBXSDK_SCENE_VIDEO_H_
15
16#include <fbxsdk/fbxsdk_def.h>
17
18#include <fbxsdk/core/fbxobject.h>
19
20#include <fbxsdk/fbxsdk_nsbegin.h>
21
22/** FBX SDK video class.
23 * \nosubgrouping
24 */
25class FBXSDK_DLL FbxVideo : public FbxObject
26{
27 FBXSDK_OBJECT_DECLARE(FbxVideo, FbxObject);
28
29public:
30 /**
31 *\name Reset video
32 */
33 //@{
34 //! Reset the video to default values.
35 void Reset();
36 //@}
37
38 /**
39 * \name Video attributes Management
40 */
41 //@{
42 /** Set the use of MipMap on the video.
43 * \param pUseMipMap If \c true, use MipMap on the video.
44 */
45 void ImageTextureSetMipMap(bool pUseMipMap);
46
47 /** Retrieve use MipMap state.
48 * \return MipMap flag state.
49 */
50 bool ImageTextureGetMipMap() const;
51
52 /** Specify the Video full filename.
53 * \param pName Video full filename.
54 * \return \c True,if update successfully, \c false otherwise.
55 * \remarks Update the texture filename if the connection exists.
56 */
57 bool SetFileName(const char* pName);
58
59 /** Retrieve the Video full filename.
60 * \return Video full filename.
61 */
62 FbxString GetFileName () const;
63
64 /** Specify the Video relative filename.
65 * \param pName Video relative filename.
66 * \return \c True, if update successfully, \c false otherwise.
67 * \remarks Update the texture filename if the connection exists.
68 */
69 bool SetRelativeFileName(const char* pName);
70
71 /** Retrieve the Video relative filename.
72 * \return Video relative filename.
73 */
74 const char* GetRelativeFileName() const;
75
76 /**
77 * \name Image sequence attributes Management
78 * Besides storing video clips, the FbxVideo object can also store image sequences. This section contains
79 * the manipulation methods used in this specialized mode. Note that, except for the GetFileName(),
80 * SetFileName(), GetRelativeFileName(), SetRelativeFileName() and the methods in this section, all the
81 * other ones are not mandatory therefore could contain uninitialized or default data values.
82 *
83 */
84 //@{
85 /** Specify if this video object is holding the starting point of an image sequence.
86 * \param pImageSequence If \c true, this object is holding an image sequence.
87 * \remarks When this object is used as image sequence, the FBX SDK
88 * will automatically exclude it from the embedding mechanism.
89 */
90 void SetImageSequence(bool pImageSequence);
91
92 /** Get the current state of the ImageSequence property.
93 * \return ImageSequence property value.
94 */
95 bool GetImageSequence() const;
96
97 /** Specify the frame offset to be applied to the image sequence.
98 * \param pOffset The frame offset value.
99 */
100 void SetImageSequenceOffset(int pOffset);
101
102 /** Get the current value of the ImageSequenceOffset property.
103 * \return ImageSequenceOffset property value.
104 */
105 int GetImageSequenceOffset() const;
106 //@}
107
108 /** Retrieve the Frame rate of the video clip.
109 * \return Frame rate.
110 */
111 double GetFrameRate() const;
112
113 /** Retrieve the last frame of the video clip.
114 * \return Last frame number.
115 */
116 int GetLastFrame() const;
117
118 /** Retrieve the clip width.
119 * \return Video image width.
120 */
121 int GetWidth() const;
122
123 /** Retrieve the clip height.
124 * \return Video image height.
125 */
126 int GetHeight() const;
127
128 /** Set the start frame of the video clip.
129 * \param pStartFrame Start frame number.
130 * \remarks The parameter value is not checked. It is the responsibility
131 * of the caller to deal with bad frame numbers.
132 */
133 void SetStartFrame(int pStartFrame);
134
135 /** Retrieve the start frame of the video clip.
136 * \return Start frame number.
137 */
138 int GetStartFrame() const;
139
140 /** Set the stop frame of the video clip.
141 * \param pStopFrame Stop frame number.
142 * \remarks The parameter value is not checked. It is the responsibility
143 * of the caller to deal with bad frame numbers.
144 */
145 void SetStopFrame(int pStopFrame);
146
147 /** Retrieve the stop frame of the video clip.
148 * \return Stop frame number.
149 */
150 int GetStopFrame() const;
151
152 /** Set the play speed of the video clip.
153 * \param pPlaySpeed Playback speed of the clip.
154 * \remarks The parameter value is not checked. It is the responsibility
155 * of the caller to deal with bad playback speed values.
156 */
157 void SetPlaySpeed(double pPlaySpeed);
158
159 /** Retrieve the play speed of the video clip.
160 * \return Playback speed.
161 */
162 double GetPlaySpeed() const;
163
164 /** Set the time offset.
165 * The offset can be used to shift the playback start time of the clip.
166 * \param pTime Time offset of the clip.
167 */
168 void SetOffset(FbxTime pTime);
169
170 /* Retrieve the time offset.
171 * \return The current time shift.
172 */
173 FbxTime GetOffset() const;
174
175 /** Set the Free Running state of the video clip.
176 * The Free Running flag can be used by a client application to implement a
177 * playback scheme that is independent of the main timeline.
178 * \param pState State of the Free running flag.
179 */
180 void SetFreeRunning(bool pState);
181
182 /** Retrieve the Free Running state.
183 * \return Current free running flag.
184 */
185 bool GetFreeRunning() const;
186
187
188 /** Set the Loop state of the video clip.
189 * The Loop flag can be used by a client application to implement the loop
190 * playback of the video clip.
191 * \param pLoop State of the loop flag.
192 */
193 void SetLoop(bool pLoop);
194
195 /** Retrieve the Loop state.
196 * \return Current loop flag.
197 */
198 bool GetLoop() const;
199
200
201 /** Video interlace modes.
202 */
203 enum EInterlaceMode
204 {
205 eNone, //!< Progressive frame (full frame).
206 eFields, //!< Alternate even/odd fields.
207 eHalfEven, //!< Half of a frame, even fields only.
208 eHalfOdd, //!< Half of a frame, odd fields only.
209 eFullEven, //!< Extract and use the even field of a full frame.
210 eFullOdd, //!< Extract and use the odd field of a full frame.
211 eFullEvenOdd, //!< Extract eFields and make full frame with each one beginning with Odd (60fps).
212 eFullOddEven //!< Extract eFields and make full frame with each one beginning with Even (60fps).
213 };
214
215 /** Set the Interlace mode.
216 * \param pInterlaceMode Interlace mode identifier.
217 */
218 void SetInterlaceMode(EInterlaceMode pInterlaceMode);
219
220 /** Retrieve the Interlace mode.
221 * \return Interlace mode identifier.
222 */
223 EInterlaceMode GetInterlaceMode() const;
224
225
226 /** Video clip access mode.
227 */
228 enum EAccessMode
229 {
230 eDisk,
231 eMemory,
232 eDiskAsync
233 };
234
235 /** Set the clip Access Mode.
236 * \param pAccessMode Clip access mode identifier.
237 */
238 void SetAccessMode(EAccessMode pAccessMode);
239
240 /** Retrieve the clip Access Mode.
241 * \return Clip access mode identifier.
242 */
243 EAccessMode GetAccessMode() const;
244 //@}
245
246/*****************************************************************************************************************************
247** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
248*****************************************************************************************************************************/
249#ifndef DOXYGEN_SHOULD_SKIP_THIS
250protected:
251 virtual void Construct(const FbxObject* pFrom);
252 virtual void ConstructProperties(bool pForceSet);
253 virtual bool ConnectNotify(FbxConnectEvent const &pEvent);
254
255public:
256 virtual FbxObject& Copy(const FbxObject& pObject);
257
258 virtual FbxStringList GetTypeFlags() const;
259
260 void SetOriginalFormat(bool pState);
261 bool GetOriginalFormat() const;
262 void SetOriginalFilename(const char* pOriginalFilename);
263 const char* GetOriginalFilename() const;
264
265 FbxPropertyT<FbxBool> ImageSequence;
266 FbxPropertyT<FbxInt> ImageSequenceOffset;
267 FbxPropertyT<FbxDouble> FrameRate;
268 FbxPropertyT<FbxInt> LastFrame;
269 FbxPropertyT<FbxInt> Width;
270 FbxPropertyT<FbxInt> Height;
271 FbxPropertyT<FbxString> Path;
272 FbxPropertyT<FbxInt> StartFrame;
273 FbxPropertyT<FbxInt> StopFrame;
274 FbxPropertyT<FbxDouble> PlaySpeed;
275 FbxPropertyT<FbxTime> Offset;
276 FbxPropertyT<EInterlaceMode> InterlaceMode;
277 FbxPropertyT<FbxBool> FreeRunning;
278 FbxPropertyT<FbxBool> Loop;
279 FbxPropertyT<EAccessMode> AccessMode;
280
281protected:
282 void Init();
283
284 bool mUseMipMap;
285 bool mOriginalFormat;
286 FbxString mOriginalFilename;
287 FbxString mRelativeFilename;
288#endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
289};
290
291inline EFbxType FbxTypeOf(const FbxVideo::EInterlaceMode&){ return eFbxEnum; }
292inline EFbxType FbxTypeOf(const FbxVideo::EAccessMode&){ return eFbxEnum; }
293
294#include <fbxsdk/fbxsdk_nsend.h>
295
296#endif /* _FBXSDK_SCENE_VIDEO_H_ */
297