Open Reality Reference Guide
fbplayercontrol.h
Go to the documentation of this file.
1 #ifndef __FBPLAYERCONTROL_H__
2 #define __FBPLAYERCONTROL_H__
3 /**************************************************************************
4 Copyright (c) 1994 - 2013 Autodesk, Inc. and/or its licensors.
5 All Rights Reserved.
6 
7 The coded instructions, statements, computer programs, and/or related
8 material (collectively the "Data") in these files contain unpublished
9 information proprietary to Autodesk, Inc. and/or its licensors, which is
10 protected by Canada and United States of America federal copyright law
11 and by international treaties.
12 
13 The Data may not be disclosed or distributed to third parties, in whole
14 or in part, without the prior written consent of Autodesk, Inc.
15 ("Autodesk").
16 
17 THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
18 ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO
19 WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR
20 ARISING BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES
21 OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR
22 PURPOSE OR USE. WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT
23 WARRANT THAT THE OPERATION OF THE DATA WILL BE UNINTERRUPTED OR ERROR
24 FREE.
25 
26 IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS
27 OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR
28 EXPENSES OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE
29 DAMAGES OR OTHER SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS
30 OF PROFITS, REVENUE OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR
31 DAMAGES OF ANY KIND), HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF
32 LIABILITY, WHETHER DERIVED FROM CONTRACT, TORT (INCLUDING, BUT NOT
33 LIMITED TO, NEGLIGENCE), OR OTHERWISE, ARISING OUT OF OR RELATING TO THE
34 DATA OR ITS USE OR ANY OTHER PERFORMANCE, WHETHER OR NOT AUTODESK HAS
35 BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGE.
36 
37 **************************************************************************/
38 
43 #include <kaydaradef.h>
44 #ifndef FBSDK_DLL
48 #define FBSDK_DLL K_DLLIMPORT
49 #endif
50 
51 // Essential includes
52 #include <fbsdk/fbcomponent.h>
53 #include <fbsdk/fbcommand.h>
54 
55 #ifdef FBSDKUseNamespace
56 namespace FBSDKNamespace {;
57 #endif
58 
61  kFBTransportPlay, kFBTransportPlayPrepare, kFBTransportPlayReady,
62  kFBTransportStop, kFBTransportStopPost, kFBTransportStopReady,
63  kFBTransportShuttle, kFBTransportShuttlePrepare, kFBTransportShuttleReady,
64  kFBTransportPlayReverse, kFBTransportPlayReversePrepare, kFBTransportPlayReverseReady,
65  kFBTransportJog, kFBTransportJogPrepare, kFBTransportJogReady,
66  kFBTransportGoto, kFBTransportGotoPrepare, kFBTransportGotoReady,
67  kFBTransportStepForward, kFBTransportStepForwardPrepare, kFBTransportStepForwardReady,
68  kFBTransportStepBackward, kFBTransportStepBackwardPrepare,kFBTransportStepBackwardReady
69 };
70 FB_DEFINE_ENUM( FBSDK_DLL, TransportMode );
71 
74 {
77 };
78 
79 FB_DEFINE_ENUM(FBSDK_DLL, TransportTimeFormat);
80 
81 
84 {
98 };
99 FB_DEFINE_ENUM( FBSDK_DLL, TransportPlaySpeed);
100 
103 {
108 };
109 FB_DEFINE_ENUM( FBSDK_DLL, TransportSnapMode );
110 
116 };
117 FB_DEFINE_ENUM( FBSDK_DLL, TransportLoopMode );
118 
130 };
131 FB_DEFINE_ENUM( FBSDK_DLL, PlayerControlChangeType );
132 
134 // FBEventPlayerControlChange
137 
139 {
140  public:
144  FBEventPlayerControlChange( HKEventBase pEvent );
145 
146  FBPropertyPlayerControlChangeType Type;
147 };
148 
149 
151 // FBPlayerControl
154 
171 public:
172 
176  FBPlayerControl(HIObject pObject=NULL);
177 
182  bool Play(bool pUseMarkers = false);
183 
188  bool PlayReverse(bool pUseMarkers = false);
189 
193  void SetPlaySpeedMode (FBTransportPlaySpeed pPlaySpeedMode);
194 
198  void SetPlaySpeed(double pSpeed);
199 
204 
208  double GetPlaySpeed();
209 
213  bool Stop();
214 
218  bool GotoStart();
219 
223  bool GotoEnd();
224 
229  bool Goto( FBTime pTime );
230 
234  bool StepForward();
235 
239  bool StepBackward();
240 
246  bool Record( bool pOverrideTake=false,bool pCopyData=true );
247 
252  void LockTransport( bool pLock );
253 
257  bool IsLocked();
258 
263 
268  void SetTransportFps ( FBTimeMode pTimeMode, double pCustom=0.0);
269 
274 
280 
284  void Key();
285 
288  void GotoNextKey();
289 
293 
297 
301 
302  /* K_DEPRECATED_2019 */ FBPropertyBool LoopActive;
303  FBPropertyTransportLoopMode LoopMode;
306 
309 
312 
316 
317  FBPropertyTransportSnapMode SnapMode;
318 
319  FBPropertyTransportTimeFormat TransportTimeFormat;
320 
323 
325 
330 
337 
343 
349 
355 
361 
366 
370  void SetTimeReferential(FBTimeReferential pTimeReferential);
371 
376 
381 
385  void SetEditStart(FBTime pTime);
386 
391 
395  void SetEditStop(FBTime pTime);
396 
401 
406 
411 
415  void SetEditZoomStop(FBTime pTime);
416 
423  int AddGlobalTimeMark( FBTime pTime, const char* pName = NULL );
424 
430  bool DeleteGlobalTimeMark( int pIndex );
431 
435 
440 
446 
453  int SetGlobalTimeMarkTime( int pIndex, FBTime pTime );
454 
459  const char* GetGlobalTimeMarkName( int pIndex );
460 
466  bool SetGlobalTimeMarkName( int pIndex, const char* pName );
467 
473 
479  bool SetGlobalTimeMarkAction( int pIndex, FBTimeMarkAction pAction );
480 
486 
492  bool SetGlobalTimeMarkColor( int pIndex, FBColor pColor );
493 
498 
503 };
504 
506 // FBReferenceTime
509 
518 public:
522  FBReferenceTime(HIObject pObject=NULL);
523 
528  int Add( const char *pName );
529 
533  void Remove( int pID );
534 
540  void SetTime( int pID, FBTime pReferenceTime, FBTime pSystem );
546  FBTime GetTime( int pID, FBTime pSystem );
547 
552  const char *operator[](int pID);
553 
558 
563  const char * GetReferenceTimeName( int pID );
564 
565  /*K_DEPRECATED_2019*/ FBPropertyInt Count;
566  /*K_DEPRECATED_2019*/ FBPropertyInt ItemIndex;
567 
570 };
571 
572 #ifdef FBSDKUseNamespace
573 } // namespace FBSDKNamespace
574 #endif
575 
576 #endif
Template class to contain an array of items.
Definition: fbarray.h:78
Color vector.
Definition: fbtypes.h:448
MotionBuilder SDK base class.
Definition: fbcomponent.h:651
Base Event class.
Definition: fbcomponent.h:940
FBPropertyPlayerControlChangeType Type
Read Only Property: Type of event.
FBEventPlayerControlChange(HKEventBase pEvent)
Constructor.
Player control.
int GetNextGlobalTimeMarkIndex()
Returns the next global time mark index, based on the current local time.
FBPropertyTime NextMarker
Read Only Property: Next marked time.
bool StepForward()
Step one frame ahead.
bool Goto(FBTime pTime)
Goto a time specified by pTime.
int GetGlobalTimeMarkCount()
Returns the number of global time marks.
FBPropertyTime PlotSamplingPeriod
Read Write Property: Sampling period for the model plotting.
bool StepBackward(FBTimeReferential)
Step one frame backward.
bool StepBackward()
Step one frame backward.
int GetPreviousGlobalTimeMarkIndex()
Returns the previous global time mark index, based on the current local time.
FBTransportMode GetTransportMode()
Get Transport Mode.
bool Goto(FBTime, FBTimeReferential)
Goto a time specified by pTime.
void SetEditZoomStop(FBTime pTime)
Set Edit Zoom Stop.
void EvaluationResume()
Resume device evaluation thread.
FBPropertyBool IsRecording
Read Only Property: Is there a recording in progress?
int SetGlobalTimeMarkTime(int pIndex, FBTime pTime)
Sets a new time for an existing global time mark.
FBPropertyTransportTimeFormat TransportTimeFormat
Read Write Property: Current Time Mode of the transport controls.
void GotoPreviousKey()
Go to the previous key.
void SetPlaySpeedMode(FBTransportPlaySpeed pPlaySpeedMode)
Set Play Speed Mode.
FBColor GetGlobalTimeMarkColor(int pIndex)
Returns the color associated with a global time mark.
FBTimeReferential GetTimeReferential()
Get Time Referential.
FBPropertyTransportLoopMode LoopMode
Read Write Property: Loop mode.
bool Play(bool pUseMarkers=false)
Play button.
void LockTransport(bool pLock)
Lock the transport control.
const char * GetGlobalTimeMarkName(int pIndex)
Returns the name associated with a global time mark.
FBPropertyTime RecordingSamplingPeriod
Read Write Property: Sampling period for the model recording.
bool GotoStart(FBTimeReferential)
GotoStart button (Rewind).
FBTime GetEditStart()
Get Edit Start.
void SetPlaySpeed(double pSpeed)
Set Play Speed.
void Key()
Key default data.
FBTime GetEditStop()
Get Edit Stop.
bool SetGlobalTimeMarkColor(int pIndex, FBColor pColor)
Sets a new color for an existing global time mark.
FBPropertyBool IsPlotting
Read Only Property: Is there a plotting in progress?
bool Stop()
Stop button.
bool GotoStart()
GotoStart button (Rewind).
bool GotoEnd(FBTimeReferential)
GotoEnd button (FastForward).
void SetEditZoomStart(FBTime pTime)
Set Edit Zoom Start.
FBTime GetEditZoomStart()
Get Edit Zoom Start.
FBPropertyBool IsPlaying
Read Only Property: Is the transport control playing?
FBPropertyTime ZoomWindowStart
Read Write Property: Starting time of the transport control zoom window.
void EvaluationPause()
Pause device evaluation thread.
void DeleteAllGlobalTimeMarks()
Delete all global time marks.
FBTime GetGlobalTimeMarkTime(int pIndex)
Returns the time associated with a global time mark.
FBPropertyTime ZoomWindowStop
Read Write Property: Stopping time of the transport control zoom window.
bool SetGlobalTimeMarkName(int pIndex, const char *pName)
Sets a new name for an existing global time mark.
bool IsLocked()
Return the current locking state of the transport.
FBPropertyTime LoopStop
Read Write Property: Loop end time.
FBPropertyTransportSnapMode SnapMode
Read Write Property: Set the transport control snap mode.
bool StepForward(FBTimeReferential)
Step one frame ahead.
FBPropertyBool LoopActive
Read Write Property: Is looping active?
void SetTransportFps(FBTimeMode pTimeMode, double pCustom=0.0)
Set the system frame rate use for display.
FBPlayerControl(HIObject pObject=NULL)
Constructor.
static FBPlayerControl & TheOne()
Get the global object for this class.
FBTimeMode GetTransportFps()
Get the UI frame rate use for display configure in the system.
bool Record(bool pOverrideTake=false, bool pCopyData=true)
Begin recording.
FBTransportPlaySpeed GetPlaySpeedMode()
Get Play Speed Mode.
FBTime GetEditZoomStop()
Get Edit Zoom Stop.
double GetPlaySpeed()
Get Play Speed .
void SetEditStart(FBTime pTime)
Set Edit Start.
bool SetGlobalTimeMarkAction(int pIndex, FBTimeMarkAction pAction)
Sets a new action for an existing global time mark.
void SetTimeReferential(FBTimeReferential pTimeReferential)
Set Time Referential.
bool DeleteGlobalTimeMark(int pIndex)
Delete a global time mark.
FBTimeMarkAction GetGlobalTimeMarkAction(int pIndex)
Returns the action associated with a global time mark.
bool PlayReverse(bool pUseMarkers=false)
Play Reverse button.
void GotoNextKey()
Go to the next key.
FBTime GetEditCurrentTime()
Get Edit Current Time.
bool GotoEnd()
GotoEnd button (FastForward).
FBPropertyTime PreviousMarker
Read Only Property: Previous marked time.
FBPropertyEvent OnChange
Event Property: Fired when something in the player control has changed. (see FBEventPlayerControlChan...
void SetEditStop(FBTime pTime)
Set Edit Stop.
int AddGlobalTimeMark(FBTime pTime, const char *pName=NULL)
Add a global time mark.
FBPropertyTime LoopStart
Read Write Property: Loop begin time.
double GetTransportFpsValue(FBTimeMode pTimeMode=kFBTimeModeDefault)
Get the UI frame rate value.
PropertyEvent: Base event class.
Definition: fbproperties.h:515
Reference time class.
void Remove(int pID)
Remove a reference time from the list.
int Add(const char *pName)
Add a reference time to list.
FBReferenceTime(HIObject pObject=NULL)
Constructor.
FBPropertyInt Count
Read Only Property: Number of reference times.
FBTime GetTime(int pID, FBTime pSystem)
Get a reference time.
void SetTime(int pID, FBTime pReferenceTime, FBTime pSystem)
Set a reference time.
const char * operator[](int pID)
Overloaded [] operator.
FBPropertyBool UseRelativeLocalTime
Read Write Property: True to show the relative local time, false otherwise. This will only be effecti...
void GetUniqueIDList(FBArrayTemplate< int > *pIDArray)
Get list of currently available IDs.
FBPropertyInt ItemIndex
Read Write Property: Current reference time index.
const char * GetReferenceTimeName(int pID)
Get the name of a time reference.
FBPropertyInt CurrentTimeReferenceID
Read Write Property: Current reference time ID
Time data structure.
Definition: fbtime.h:88
Declaration for the FBCommand class.
FBTimeReferential
FBCommandState.
Definition: fbcommand.h:116
Basic class definitions.
#define __FBClassDeclare(Name, Parent)
For internal use only.
Definition: fbcomponent.h:131
FBTimeMarkAction
Time (Global & Take) Mark assigned action.
Definition: fbdata.h:1664
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
FBTransportPlaySpeed
Available transport control play speed.
@ kFBSpeed_3x
3x
@ kFBSpeed_1_4x
0.25x
@ kFBSpeed_5x
5x
@ kFBSpeed_1_5x
0.20x
@ kFBSpeed_2x
2x
@ kFBSpeed_1_3x
0.33x
@ kFBSpeed_10x
10x
@ kFBSpeed_4x
4x
@ kFBSpeed_ALL_FR
All frames.
@ kFBSpeed_Custom
Custom speed.
@ kFBSpeed_1_10x
0.10x
@ kFBSpeed_1x
1x
@ kFBSpeed_1_2x
0.50x
FBTransportTimeFormat
Available transport control time display.
@ kFBTimeFormatTimecode
Timecode time display mode.
@ kFBTimeFormatFrame
Frame time display mode.
FBTransportSnapMode
Available snap methods for the transport control.
@ kFBTransportSnapModeNoSnap
No snapping is applied.
@ kFBTransportSnapModePlayOnFrames
When playing, plays to exact frames.
@ kFBTransportSnapModeSnapOnFrames
Snaps to an exact frame when modifying the current time.
@ kFBTransportSnapModeSnapAndPlayOnFrames
Combines both Snap and Play on frames modes.
FBPlayerControlChangeType
Types of player control change events.
@ kFBPlayerControlNone
None.
@ kFBPlayerControlPlayReverse
Play reverse.
@ kFBPlayerControlRecordModeOff
Record mode off.
@ kFBPlayerControlStop
Stop.
@ kFBPlayerControlStepForward
Step forward.
@ kFBPlayerControlGoto
Goto.
@ kFBPlayerControlRecordModeOn
Record mode on.
@ kFBPlayerControlStepBackward
Step backward.
@ kFBPlayerControlPlay
Play.
FBTransportMode
Transport modes.
@ kFBTransportPlayReversePrepare
!< Play reverse.
@ kFBTransportStepBackwardPrepare
!< Step backward.
@ kFBTransportStopPost
!< Stop mode
@ kFBTransportJogPrepare
!< Jog.
@ kFBTransportStepForwardPrepare
!< Step forward
@ kFBTransportPlayPrepare
!< Play mode
@ kFBTransportShuttlePrepare
!< Shuttle mode
@ kFBTransportGotoPrepare
!< Goto.
FBTransportLoopMode
Available loop modes for the transport control.
@ kFBTransportLoopCurrentTake
Playback looping the current take.
@ kFBTransportNoLoop
Playback not looping.
@ kFBTransportLoopThroughAllTakes
Playback from the current take through all takes in order then stops.
class K_DLLIMPORT FBPropertyBase< int, kFBPT_int > FBPropertyInt
Property: int
class K_DLLIMPORT FBPropertyBase< bool, kFBPT_bool > FBPropertyBool
Property: bool
class K_DLLIMPORT FBPropertyBase< FBTime, kFBPT_Time > FBPropertyTime
Property: FBTime
#define FB_DEFINE_ENUM(DllTag, Type)
Define an enum and give it the ability to be a property.
Definition: fbproperties.h:150
FBTimeMode
Different time modes available.
Definition: fbtime.h:63
@ kFBTimeModeDefault
Default Time Mode.
Definition: fbtime.h:64
#define __FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
Definition: fbtypes.h:68