/** @class Time
* @brief A representation of time within a DCP.
*/
-
class Time
{
public:
+ /** Construct a zero Time */
Time () : h (0), m (0), s (0), e (0), tcr (1) {}
- /** Construct a Time from a frame index (starting from 0),
- * a frames per second count and a timecode rate.
+ /** Construct a Time.
+ * @param Frame index (starting from 0).
+ * @param frames_per_second Frames per second.
+ * @param tcr Timecode rate.
*/
Time (int frame, int frames_per_second, int tcr);
int e; ///< editable units (where 1 editable unit is 1 / tcr_ seconds)
int tcr; ///< timecode rate: the number of editable units per second.
- std::string to_string () const;
- double to_seconds () const;
- int64_t to_editable_units (int tcr_) const;
+ std::string as_string () const;
+ double as_seconds () const;
+ int64_t as_editable_units (int tcr_) const;
Time rebase (int tcr_) const;
private:
extern bool operator> (Time const & a, Time const & b);
extern bool operator>= (Time const & a, Time const & b);
extern std::ostream & operator<< (std::ostream & s, Time const & t);
-extern Time operator+ (Time a, Time b);
+extern Time operator+ (Time a, Time b);
extern Time operator- (Time a, Time b);
extern float operator/ (Time a, Time const & b);