-class DCPTime : public Time
-{
-public:
- DCPTime () : Time () {}
- explicit DCPTime (Type t) : Time (t) {}
- DCPTime (ContentTime t, FrameRateChange c) : Time (rint (t.get() / c.speed_up)) {}
-
- bool operator< (DCPTime const & o) const {
- return _t < o._t;
- }
-
- bool operator<= (DCPTime const & o) const {
- return _t <= o._t;
- }
-
- bool operator== (DCPTime const & o) const {
- return _t == o._t;
- }
-
- bool operator!= (DCPTime const & o) const {
- return _t != o._t;
- }
-
- bool operator>= (DCPTime const & o) const {
- return _t >= o._t;
- }
-
- bool operator> (DCPTime const & o) const {
- return _t > o._t;
- }
-
- DCPTime operator+ (DCPTime const & o) const {
- return DCPTime (_t + o._t);
- }
-
- DCPTime & operator+= (DCPTime const & o) {
- _t += o._t;
- return *this;
- }
-
- DCPTime operator- () const {
- return DCPTime (-_t);
- }
-
- DCPTime operator- (DCPTime const & o) const {
- return DCPTime (_t - o._t);
- }
-
- DCPTime & operator-= (DCPTime const & o) {
- _t -= o._t;
- return *this;
- }
-
- /** Round up to the nearest sampling interval
- * at some sampling rate.
- * @param r Sampling rate.
- */
- DCPTime round_up (float r) {
- Type const n = rint (HZ / r);
- Type const a = _t + n - 1;
- return DCPTime (a - (a % n));
- }
-
- DCPTime abs () const {
- return DCPTime (std::abs (_t));
- }
-
- static DCPTime from_seconds (double s) {
- return DCPTime (s * HZ);
- }
-
- template <class T>
- static DCPTime from_frames (int64_t f, T r) {
- assert (r > 0);
- return DCPTime (f * HZ / r);
- }
-
- static DCPTime delta () {
- return DCPTime (1);
- }
-
- static DCPTime max () {
- return DCPTime (INT64_MAX);
- }
-};
-