summaryrefslogtreecommitdiff
path: root/src/sub_time.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/sub_time.h')
-rw-r--r--src/sub_time.h14
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);
}