X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fsynfig%2Ftime.h;h=8e198f6e4b46cce5d58e12c0df00627a42c0a163;hb=0809ba8eb14cf885c8f197d751c80cced84d9676;hp=86f66e75f9aa166d0a6ba486032904f7a51aa0dc;hpb=e8a065f2385c219c511b57dac52786120bfa097d;p=synfig.git diff --git a/synfig-core/trunk/src/synfig/time.h b/synfig-core/trunk/src/synfig/time.h index 86f66e7..8e198f6 100644 --- a/synfig-core/trunk/src/synfig/time.h +++ b/synfig-core/trunk/src/synfig/time.h @@ -55,7 +55,7 @@ public: FORMAT_NOSPACES=(1<<0), //!< Remove any whitespace FORMAT_FULL=(1<<1), //!< Do not remove units that have "zero" value FORMAT_VIDEO=(1<<2), //!< Use the HH:MM:SS.ff format - + FORMAT_END=(1<<4) //!< \internal Not used }; // END of enum Format @@ -75,7 +75,7 @@ public: //! Constructs Time from the given string. /*! \note If the string references frames, then the - ** frame rate (\afps) should be provided from the + ** frame rate (\a fps) should be provided from the ** correct source. (Which is most likely the RendDesc ** of the current Canvas) ** The frame count will be ignored if the @@ -84,30 +84,30 @@ public: //! Marks the exclusive negative boundary of time static const Time begin() { return static_cast(-32767.0f*512.0f); } - + //! Marks the exclusive positive boundary of time static const Time end() { return static_cast(32767.0f*512.0f); } //! Marks zero time static const Time zero() { return static_cast(0); } - + //! The amount of allowable error in calculations static const Time epsilon() { return static_cast(epsilon_()); } - + //! Returns a string describing the current time value /*! \see Format */ String get_string(float fps=0, Time::Format format=FORMAT_NORMAL)const; - + //! \writeme bool is_valid()const; - + //! Rounds time to the nearest frame for the given frame rate, \a fps Time round(float fps)const; bool is_equal(const Time& rhs)const { return (value_>rhs.value_)?value_-rhs.value_<=epsilon_():rhs.value_-value_<=epsilon_(); } bool is_less_than(const Time& rhs)const { return rhs.value_-value_ > epsilon_(); } bool is_more_than(const Time& rhs)const { return value_-rhs.value_ > epsilon_(); } - + operator double()const { return value_; } template bool operator<(const U& rhs)const { return value_ const Time& operator+=(const U &rhs) { value_+=static_cast(rhs); return *this; } template const Time& operator-=(const U &rhs) { value_-=static_cast(rhs); return *this; } template const Time& operator*=(const U &rhs) { value_*=static_cast(rhs); return *this; } @@ -142,7 +142,7 @@ public: template Time operator-(const U &rhs)const { return value_-static_cast(rhs); } template Time operator*(const U &rhs)const { return value_*static_cast(rhs); } template Time operator/(const U &rhs)const { return value_/static_cast(rhs); } - + Time operator-()const { return -value_; } }; // END of class Time @@ -159,7 +159,7 @@ inline bool operator<=(Time::Format lhs, Time::Format rhs) { return (static_cast(lhs) & static_cast(rhs))==static_cast(rhs); } }; // END of namespace synfig - + /* === E N D =============================================================== */ #endif