xsi_time.h Source File
 
 
 
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 
00095         CTime(double in_time, CTime::Unit in_units, Format in_format, double in_customrate = 1.0);
00096 
00100         CTime(const CTime& in_time);
00101 
00104         ~CTime();
00105 
00110         double GetTime(Unit in_units = CTime::Frames ) const;
00111 
00116         void PutTime(double in_time, CTime::Unit units = CTime::Frames );
00117 
00121         CTime::Format GetFormat(void) const;
00122 
00126         double GetFrameRate(void) const;
00127 
00132         void PutFormat(CTime::Format in_format, double in_customrate = 1.0 );
00133 
00148         CString GetAsText(void) const;
00149 
00164         void SetAsText(const CString& in_str);
00165 
00170         CTime& operator= ( const CTime& in_time );
00171 
00176         CTime& operator= ( double in_time );
00177 
00182         bool  operator== ( const CTime& rhs ) const;
00183 
00188         bool  operator== ( const double rhs ) const;
00189 
00194         bool  operator!= ( const CTime& rhs ) const;
00195 
00200         bool  operator!= ( const double rhs ) const;
00201 
00205     operator double() const ;
00206 
00211         CTime Round() const;
00212 
00217         static CTime::Format ConvertFromPlayControlFormat( const long lFormat );
00218 
00223         static LONG ConvertToPlayControlFormat( const CTime::Format eFormat );
00224 
00225 private:
00226         void* m_pvoid;
00227 };
00228 
00234 SICPPSDKDECL bool  operator== ( const double lhs, const CTime& rhs);
00235 
00241 SICPPSDKDECL bool  operator!= ( const double lhs, const CTime& rhs);
00242 
00243 //*************************************************************************
00252 //*************************************************************************
00253 class SICPPSDKDECL CTimeArray
00254 {
00255 public:
00259         CTimeArray( LONG in_size=0);
00260 
00264         CTimeArray(const CTimeArray& in_array);
00265 
00267         ~CTimeArray();
00268 
00273         CTimeArray& operator=( const CTimeArray& in_array );
00274 
00278         LONG GetCount() const;
00279 
00284         CStatus Add( const CTime& in_item );
00285 
00289         CStatus Clear();
00290 
00296         CStatus Resize( LONG in_size);
00297 
00304         const CTime& operator[]( LONG in_index ) const;
00305 
00311         CTime& operator[]( LONG in_index );
00312 
00318         bool operator==(const CTimeArray& in_array) const;
00319 
00325         bool operator!=(const CTimeArray& in_array) const;
00326 
00327 private:
00328 
00329         void* m_ptr;
00330 };
00331 
00332 
00333 };
00334 
00335 #endif // __XSITIME_H__