fbtime.h

Go to the documentation of this file.
00001 #ifndef __FBTIME_H__
fbtime.h
00002 #define __FBTIME_H__
00003 /**************************************************************************
00004  Copyright (c) 1994 - 2009 Autodesk, Inc. and/or its licensors.
00005  All Rights Reserved.
00006  
00007  The coded instructions, statements, computer programs, and/or related 
00008  material (collectively the "Data") in these files contain unpublished 
00009  information proprietary to Autodesk, Inc. and/or its licensors, which is 
00010  protected by Canada and United States of America federal copyright law 
00011  and by international treaties.
00012  
00013  The Data may not be disclosed or distributed to third parties, in whole 
00014  or in part, without the prior written consent of Autodesk, Inc. 
00015  ("Autodesk").
00016  
00017  THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
00018  ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO 
00019  WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR 
00020  ARISING BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES 
00021  OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR 
00022  PURPOSE OR USE. WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT 
00023  WARRANT THAT THE OPERATION OF THE DATA WILL BE UNINTERRUPTED OR ERROR 
00024  FREE.
00025  
00026  IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS 
00027  OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR 
00028  EXPENSES OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE 
00029  DAMAGES OR OTHER SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS 
00030  OF PROFITS, REVENUE OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR 
00031  DAMAGES OF ANY KIND), HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF 
00032  LIABILITY, WHETHER DERIVED FROM CONTRACT, TORT (INCLUDING, BUT NOT 
00033  LIMITED TO, NEGLIGENCE), OR OTHERWISE, ARISING OUT OF OR RELATING TO THE 
00034  DATA OR ITS USE OR ANY OTHER PERFORMANCE, WHETHER OR NOT AUTODESK HAS 
00035  BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGE.
00036  
00037 **************************************************************************/
00038 
00043 #include <kaydaradef.h>
00044 
00045 #ifndef FBSDK_DLL
00046 
00049   #define FBSDK_DLL K_DLLIMPORT
00050 #endif
00051 
00052 #include <fbsdk/fbstring.h>
00053 
00054 #ifdef FBSDKUseNamespace
00055     namespace FBSDKNamespace {
00056 #endif
00057 
00059 // FBTime
00061 
00063 enum FBTimeMode {   
00064     kFBTimeModeDefault,         
00065     kFBTimeModeCinema,          
00066     kFBTimeModePAL,             
00067     kFBTimeMode30Frames,        
00068     kFBTimeModeNTSC_Drop,       
00069     kFBTimeMode50Frames,        
00070     kFBTimeMode60Frames,        
00071     kFBTimeMode100Frames,       
00072     kFBTimeMode120Frames,       
00073     kFBTimeModeFullFrame,       
00074     kFBTimeModeCinemaND,            
00075     kFBTimeModeCustom           
00076 };
00077 
00078 FB_FORWARD( FBTime );
00079 
00081 class FBSDK_DLL FBTime 
00082 {
00083   private:
00084     kLongLong   mTime;          
00085   public:
00086     /*  Constructor.
00087     *   \param  pTime   Time to initialize with(default=0).
00088     */
00089     FBTime( kLongLong pTime=0);
00090 
00100     FBTime (int pHour,int pMinute,int pSecond=0,int pFrame=0,int pField=0, FBTimeMode pTimeMode=kFBTimeModeDefault, double pFramerate = 0.0);
00101 
00105     FBString    GetTimeString();
00106 
00110     void        SetTimeString(char *pTime);
00111 
00123     bool        GetTime(kLongLong &pHour,  kLongLong &pMinute, kLongLong &pSecond, kLongLong &pFrame, kLongLong &pField,  kLongLong &pMilliSecond, FBTimeMode pTimeMode=kFBTimeModeDefault, double pFramerate =0.0 );
00127     kLongLong   GetMilliSeconds();
00128 
00132     void        SetMilliSeconds(kLongLong pMilliSeconds);
00133 
00137     kLongLong&  Get();
00138 
00142     const kLongLong& Get() const;
00143 
00147     void        Set( kLongLong pTime );
00148 
00152     double      GetSecondDouble();
00153 
00157     void        SetSecondDouble(double pTime);
00158 
00168     void        SetTime (int pHour,int pMinute=0,int pSecond=0,int pFrame=0,int pField=0, FBTimeMode pTimeMode=kFBTimeModeDefault, double pFramerate = 0.0);
00169 
00171 
00175     FBTime& operator=   (const FBTime& pTime);
00176     FBTime& operator+=  (const FBTime& pTime);
00177     FBTime& operator-=  (const FBTime& pTime);
00178     FBTime& operator*=  (const FBTime& pTime);
00179     FBTime& operator/=  (const FBTime& pTime);
00181 
00183 
00187     FBTime& operator=   (double pConstant);
00188     FBTime& operator+=  (double pConstant);
00189     FBTime& operator-=  (double pConstant);
00190     FBTime& operator*=  (double pConstant);
00191     FBTime& operator/=  (double pConstant);
00193 
00195 
00199     FBTime  operator- (const FBTime &pTime);
00200     FBTime  operator+ (const FBTime &pTime);
00201     FBTime  operator/ (const FBTime &pTime);
00202     FBTime  operator* (const FBTime &pTime);
00204 
00206 
00210     FBTime  operator- (double pConstant);
00211     FBTime  operator+ (double pConstant);
00212     FBTime  operator/ (double pConstant);
00213     FBTime  operator* (double pConstant);
00215 
00217 
00221     bool    operator==  (const FBTime& pTime);
00222     bool    operator!=  (const FBTime& pTime);
00223     bool    operator>=  (const FBTime& pTime);
00224     bool    operator<=  (const FBTime& pTime);
00225     bool    operator>   (const FBTime& pTime);
00226     bool    operator<   (const FBTime& pTime);
00228 
00236     kLongLong   GetFrame(bool pCummul=false, FBTimeMode pTimeMode=kFBTimeModeDefault, double pFramerate=0.0);
00237 
00239     static const FBTime Infinity;
00240 
00242     static const FBTime MinusInfinity;
00243 
00245     static const FBTime Zero;
00246 
00248     static const FBTime Epsilon;
00249 
00251     static const FBTime OneSecond;
00252 
00254     static const FBTime OneMinute;
00255 
00257     static const FBTime OneHour;
00258 };
00259 
00261 // FBTimeSpan
00263 
00264 FB_FORWARD( FBTimeSpan )
00265 
00266 
00267 class FBSDK_DLL FBTimeSpan 
00268 {
00269   private:
00270     FBTime       mStart;        
00271     FBTime       mStop;         
00272   public:
00277     FBTimeSpan( FBTime pStart=0,FBTime pStop=0);
00278 
00280 
00283     FBTime& GetStart();
00284     FBTime& GetStop();
00285     const FBTime& GetStart() const;
00286     const FBTime& GetStop() const;
00288 
00293     void    Set( FBTime pStart, FBTime pStop );
00294 
00298     FBTime  GetDuration();      
00299 
00303     FBTime  GetSignedDuration(); 
00304 
00309     int     GetDirection();
00310 
00315     bool    operator& (FBTime &pTime);
00316     
00320     FBTimeSpan operator& (FBTimeSpan &pTimeSpan);   
00321 };
00323 // Global
00325 #ifdef FBSDKUseNamespace
00326     }
00327 #endif
00328 
00329 #endif
00330 

Please send us your comments about this page.