Open Reality Reference Guide
 
Loading...
Searching...
No Matches
fbplayercontrol.h
Go to the documentation of this file.
1#ifndef __FBPLAYERCONTROL_H__
2#define __FBPLAYERCONTROL_H__
3/**************************************************************************
4Copyright (c) 1994 - 2013 Autodesk, Inc. and/or its licensors.
5All Rights Reserved.
6
7The coded instructions, statements, computer programs, and/or related
8material (collectively the "Data") in these files contain unpublished
9information proprietary to Autodesk, Inc. and/or its licensors, which is
10protected by Canada and United States of America federal copyright law
11and by international treaties.
12
13The Data may not be disclosed or distributed to third parties, in whole
14or in part, without the prior written consent of Autodesk, Inc.
15("Autodesk").
16
17THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
18ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO
19WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR
20ARISING BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES
21OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR
22PURPOSE OR USE. WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT
23WARRANT THAT THE OPERATION OF THE DATA WILL BE UNINTERRUPTED OR ERROR
24FREE.
25
26IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS
27OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR
28EXPENSES OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE
29DAMAGES OR OTHER SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS
30OF PROFITS, REVENUE OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR
31DAMAGES OF ANY KIND), HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF
32LIABILITY, WHETHER DERIVED FROM CONTRACT, TORT (INCLUDING, BUT NOT
33LIMITED TO, NEGLIGENCE), OR OTHERWISE, ARISING OUT OF OR RELATING TO THE
34DATA OR ITS USE OR ANY OTHER PERFORMANCE, WHETHER OR NOT AUTODESK HAS
35BEEN 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
56namespace 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};
70FB_DEFINE_ENUM( FBSDK_DLL, TransportMode );
71
74{
77};
78
79FB_DEFINE_ENUM(FBSDK_DLL, TransportTimeFormat);
80
81
84{
98};
99FB_DEFINE_ENUM( FBSDK_DLL, TransportPlaySpeed);
100
103{
108};
109FB_DEFINE_ENUM( FBSDK_DLL, TransportSnapMode );
110
116};
117FB_DEFINE_ENUM( FBSDK_DLL, TransportLoopMode );
118
130};
131FB_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
173public:
174
178 FBPlayerControl(HIObject pObject=NULL);
179
184 bool Play(bool pUseMarkers = false);
185
190 bool PlayReverse(bool pUseMarkers = false);
191
196
200 void SetPlaySpeed(double pSpeed);
201
206
210 double GetPlaySpeed();
211
215 bool Stop();
216
220 bool GotoStart();
221
225 bool GotoEnd();
226
231 bool Goto( FBTime pTime );
232
237
242
248 bool Record( bool pOverrideTake=false,bool pCopyData=true );
249
254 void LockTransport( bool pLock );
255
259 bool IsLocked();
260
265
270 void SetTransportFps ( FBTimeMode pTimeMode, double pCustom=0.0);
271
276
282
286 void Key();
287
291
295
299
303
304 FBPropertyTransportLoopMode LoopMode;
307
310
313
317
318 FBPropertyTransportSnapMode SnapMode;
319
320 FBPropertyTransportTimeFormat TransportTimeFormat;
321
324
326
331
338
344
350
356
362
367
371 void SetTimeReferential(FBTimeReferential pTimeReferential);
372
377
382
386 void SetEditStart(FBTime pTime);
387
392
396 void SetEditStop(FBTime pTime);
397
402
407
412
417
424 int AddGlobalTimeMark( FBTime pTime, const char* pName = NULL );
425
431 bool DeleteGlobalTimeMark( int pIndex );
432
436
441
447
454 int SetGlobalTimeMarkTime( int pIndex, FBTime pTime );
455
460 const char* GetGlobalTimeMarkName( int pIndex );
461
467 bool SetGlobalTimeMarkName( int pIndex, const char* pName );
468
474
480 bool SetGlobalTimeMarkAction( int pIndex, FBTimeMarkAction pAction );
481
487
493 bool SetGlobalTimeMarkColor( int pIndex, FBColor pColor );
494
499 bool GetGlobalTimeMarkLock( int pIndex );
500
506 bool SetGlobalTimeMarkLock( int pIndex, bool pLock );
507
512 bool SetAllGlobalTimeMarkLock( bool pLock );
513
518
523};
524
526// FBReferenceTime
529
541public:
545 FBReferenceTime(HIObject pObject=NULL);
546
551 int Add( const char *pName );
552
556 void Remove( int pID );
557
563 void SetTime( int pID, FBTime pReferenceTime, FBTime pSystem );
569 FBTime GetTime( int pID, FBTime pSystem );
570
575 const char *operator[](int pID);
576
581
586 const char * GetReferenceTimeName( int pID );
587
590};
591
592#ifdef FBSDKUseNamespace
593} // namespace FBSDKNamespace
594#endif
595
596#endif
Template class to contain an array of items.
Definition fbarray.h:78
Color vector.
Definition fbtypes.h:448
MotionBuilder SDK base class.
Base Event class.
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 SetGlobalTimeMarkLock(int pIndex, bool pLock)
Sets a new lock status for an existing global time mark.
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.
static FBPlayerControl & TheOne()
Get the global object for this class.
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.
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.
void SetTransportFps(FBTimeMode pTimeMode, double pCustom=0.0)
Set the system frame rate use for display.
FBPlayerControl(HIObject pObject=NULL)
Constructor.
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.
bool GetGlobalTimeMarkLock(int pIndex)
Returns the lock status associated with a global time mark.
double GetPlaySpeed()
Get Play Speed .
void SetEditStart(FBTime pTime)
Set Edit Start.
const char * GetGlobalTimeMarkName(int pIndex)
Returns the name associated with a global time mark.
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.
bool SetAllGlobalTimeMarkLock(bool pLock)
Sets the new lock status for all existing global time marks.
FBPropertyTime LoopStart
Read Write Property: Loop begin time.
double GetTransportFpsValue(FBTimeMode pTimeMode=kFBTimeModeDefault)
Get the UI frame rate value.
PropertyEvent: Base event class.
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.
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.
const char * GetReferenceTimeName(int pID)
Get the name of a time reference.
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 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.
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
FBTimeMarkAction
Time (Global & Take) Mark assigned action.
Definition fbdata.h:1664
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.
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