diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-01-13 23:04:11 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-01-13 23:04:11 +0000 |
| commit | f1ba458a19a9b998ecdb1db726106876953abcc0 (patch) | |
| tree | 1e414103fec758275f92dff3b7973cc02dbf39a3 /src/sub_time.h | |
| parent | d15ef17dccf87b633d1971c38032a2049abe3db0 (diff) | |
Various development / fixes.rework
Diffstat (limited to 'src/sub_time.h')
| -rw-r--r-- | src/sub_time.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/sub_time.h b/src/sub_time.h index 4b3f0e1..48a868c 100644 --- a/src/sub_time.h +++ b/src/sub_time.h @@ -40,6 +40,10 @@ public: int minutes; int seconds; + boost::optional<int> frames () const { + return _frames; + } + /** @return the frames part of the time at a particular frame rate */ int frames (FrameRate r) const; @@ -50,14 +54,21 @@ public: static Time from_hmsf (int h, int m, int s, int f, FrameRate r); static Time from_hms (int h, int m, double s); static Time from_hmsm (int h, int m, int s, int ms); + static Time from_frames (int64_t f, FrameRate r); + static Time from_milliseconds (int64_t ms); bool operator== (Time const & other) const; bool operator!= (Time const & other) const; bool operator< (Time const & other) const; + bool operator<= (Time const & other) const; bool operator> (Time const & other) const; + bool operator>= (Time const & other) const; private: friend std::ostream & operator<< (std::ostream& s, Time const & t); + friend Time operator+ (Time const & a, Time const & b); + friend Time operator- (Time const & a, Time const & b); + friend double operator/ (Time const & a, Time const & b); friend struct ::time_construction_test; @@ -69,6 +80,9 @@ private: }; std::ostream& operator<< (std::ostream& s, Time const & t); +Time operator+ (Time const & a, Time const & b); +Time operator- (Time const & a, Time const & b); +double operator/ (Time const & a, Time const & b); } |
