Add appearance dialog for SubRip subtitles.
[dcpomatic.git] / src / lib / dcpomatic_time.h
index 4fa6db0a4c690311dbb31974861ec349ad2d2392..90e79de0a7b4cec45cee0a495d63554f2a6fa2c6 100644 (file)
@@ -242,6 +242,10 @@ public:
        T from;
        T to;
 
+       T duration () const {
+               return to - from;
+       }
+
        TimePeriod<T> operator+ (T const & o) const {
                return TimePeriod<T> (from + o, to + o);
        }
@@ -254,7 +258,7 @@ public:
                return (from <= other && other < to);
        }
 
-       bool operator== (TimePeriod<T> const & other) {
+       bool operator== (TimePeriod<T> const & other) const {
                return from == other.from && to == other.to;
        }
 };
@@ -268,5 +272,6 @@ ContentTime min (ContentTime a, ContentTime b);
 ContentTime max (ContentTime a, ContentTime b);
 std::ostream& operator<< (std::ostream& s, ContentTime t);
 std::ostream& operator<< (std::ostream& s, DCPTime t);
+std::ostream& operator<< (std::ostream& s, DCPTimePeriod p);
 
 #endif