Some doc improvements.
[libsub.git] / src / time_pair.h
index 404c143e8076f4eec6e2c71a8a1b6d169263019f..626548077ccad502e12f6a21c94609eb768f0d3a 100644 (file)
 
 */
 
+/** @file  src/time_pair.h
+ *  @brief TimePair class.
+ */
+
 #ifndef LIBSUB_TIME_PAIR_H
 #define LIBSUB_TIME_PAIR_H
 
 
 namespace sub {
 
+/** @class TimePair
+ *  @brief A time, expressed either in metric (h:m:s:ms) or frames (h:m:s:f).
+ */
 class TimePair
 {
 public:
+       TimePair () {}
+       
+       TimePair (FrameTime t)
+               : _frame (t)
+       {}
+       
+       TimePair (MetricTime t)
+               : _metric (t)
+       {}
+       
        void set_frame (FrameTime t) {
                _frame = t;
                _metric = boost::optional<MetricTime> ();
@@ -47,8 +64,11 @@ public:
                return _metric;
        }
        
-       FrameTime  frame  (float frames_per_second) const;
-       MetricTime metric (float frames_per_second) const;
+       FrameTime  frame  (float fps) const;
+       MetricTime metric (float fps) const;
+
+       void add (FrameTime t, float fps);
+       void scale (float f, float fps);
 
        bool operator== (TimePair const & other) const;
        
@@ -57,6 +77,8 @@ private:
        boost::optional<MetricTime> _metric;
 };
 
+std::ostream& operator<< (std::ostream & s, TimePair const &); 
+
 }
 
 #endif