20 #ifndef LIBSUB_SUB_TIME_H
21 #define LIBSUB_SUB_TIME_H
23 #include <boost/optional.hpp>
30 Rational (
int numerator_,
int denominator_)
31 : numerator (numerator_)
32 , denominator (denominator_)
38 double fraction ()
const {
39 return double (numerator) / denominator;
56 int milliseconds ()
const;
58 double all_as_seconds ()
const;
60 static Time from_hmsf (
int h,
int m,
int s,
int f, boost::optional<Rational> rate = boost::optional<Rational> ());
61 static Time from_hms (
int h,
int m,
int s,
int ms);
64 friend bool operator< (
Time const & a,
Time const & b);
65 friend bool operator> (
Time const & a,
Time const & b);
66 friend bool operator== (
Time const & a,
Time const & b);
67 friend std::ostream& operator<< (std::ostream& s,
Time const & t);
69 Time (
int seconds,
int frames, boost::optional<Rational> rate)
77 boost::optional<Rational> _rate;
80 bool operator< (
Time const & a,
Time const & b);
81 bool operator> (
Time const & a,
Time const & b);
82 bool operator== (
Time const & a,
Time const & b);
83 bool operator!= (
Time const & a,
Time const & b);
84 std::ostream& operator<< (std::ostream& s,
Time const & t);
Definition: sub_time.h:43
Definition: sub_time.h:27