xsi_time.h

Go to the documentation of this file.
00001 //*****************************************************************************
00011 //*****************************************************************************
00012 
00013 #if (_MSC_VER > 1000) || defined(SGI_COMPILER)
00014 #pragma once
00015 #endif
00016 
00017 #ifndef __XSITIME_H__
00018 #define __XSITIME_H__
00019 
00020 
00021 #include "sicppsdk.h"
00022 #include "xsi_string.h"
00023 
00024 namespace XSI {
00025 
00026 
00027 //*****************************************************************************
00047 //*****************************************************************************
00048 
00049 class SICPPSDKDECL CTime
00050 {
00051 public:
00053     enum Format
00054     {
00055         NTSC,       
00056         PAL,        
00057         FILM,       
00058         CUSTOM      
00059     };
00060 
00062     enum Unit
00063     {
00064         Frames,      
00065         Hours,       
00066         Minutes,     
00067         Seconds,     
00068         Milliseconds 
00069     };
00070 
00074     CTime();
00075 
00080     CTime(double in_time);
00081 
00087     CTime(double in_time, Format in_format, double in_customrate = 1.0);
00088 
00092     CTime(const CTime& in_time);
00093 
00096     ~CTime();
00097 
00102     double GetTime(Unit in_units = CTime::Frames ) const;
00103 
00108     void PutTime(double in_time, CTime::Unit units = CTime::Frames );
00109 
00113     CTime::Format GetFormat(void) const;
00114 
00118     double GetFrameRate(void) const;
00119 
00124     void PutFormat(CTime::Format in_format, double in_customrate = 1.0 );
00125 
00140     CString GetAsText(void) const;
00141 
00156     void SetAsText(const CString& in_str);
00157 
00162     CTime& operator= ( const CTime& in_time );
00163 
00168     CTime& operator= ( double in_time );
00169 
00174     bool  operator== ( const CTime& rhs ) const;
00175 
00180     bool  operator== ( const double rhs ) const;
00181 
00186     bool  operator!= ( const CTime& rhs ) const;
00187 
00192     bool  operator!= ( const double rhs ) const;
00193 
00197     operator double() const ;
00198 
00199 private:
00200     void* m_pvoid;
00201 };
00202 
00208 SICPPSDKDECL bool  operator== ( const double lhs, const CTime& rhs);
00209 
00215 SICPPSDKDECL bool  operator!= ( const double lhs, const CTime& rhs);
00216 
00217 //*************************************************************************
00226 //*************************************************************************
00227 class SICPPSDKDECL CTimeArray
00228 {
00229 public:
00233     CTimeArray( LONG in_size=0);
00234 
00238     CTimeArray(const CTimeArray& in_array);
00239 
00241     ~CTimeArray();
00242 
00247     CTimeArray& operator=( const CTimeArray& in_array );
00248 
00252     LONG GetCount() const;
00253 
00258     CStatus Add( const CTime& in_item );
00259 
00263     CStatus Clear();
00264 
00270     CStatus Resize( LONG in_size);
00271 
00278     const CTime& operator[]( LONG in_index ) const;
00279 
00285     CTime& operator[]( LONG in_index );
00286 
00292     bool operator==(const CTimeArray& in_array) const;
00293 
00299     bool operator!=(const CTimeArray& in_array) const;
00300 
00301 private:
00302 
00303     void* m_ptr;
00304 };
00305 
00306 
00307 };
00308 
00309 #endif // __XSITIME_H__