From 7a2c4618257b1cfc17e77506d55cae12606a0b85 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Thu, 22 Dec 2011 21:22:40 +0000 Subject: [PATCH] Clean up ass_time.h a little Originally committed to SVN as r6085. --- aegisub/src/ass_time.h | 52 ++++++++++++------------------------------ 1 file changed, 15 insertions(+), 37 deletions(-) diff --git a/aegisub/src/ass_time.h b/aegisub/src/ass_time.h index 57f66e04d..57e848656 100644 --- a/aegisub/src/ass_time.h +++ b/aegisub/src/ass_time.h @@ -34,32 +34,24 @@ /// @ingroup subs_storage /// - #pragma once - -/////////// -// Headers #ifndef AGI_PRE #include #include #endif - /// DOCME /// @class AssTime /// @brief DOCME /// /// DOCME class AssTime { -private: - - /// DOCME - int time; // Miliseconds + /// Time in miliseconds + int time; public: - /// DOCME static bool UseMSPrecision; @@ -72,10 +64,10 @@ public: int GetTimeMiliseconds(); int GetTimeCentiseconds(); - int GetMS() const; // Returns milliseconds - void SetMS(int ms); // Sets values to milliseconds - void ParseASS(const wxString text); // Sets value to text-form time, in ASS format - wxString GetASSFormated(bool ms=false) const; // Returns the ASS representation of time + int GetMS() const; ///< Returns milliseconds + void SetMS(int ms); ///< Sets values to milliseconds with bounds-checking + void ParseASS(const wxString text); ///< Sets value to text-form time, in ASS format + wxString GetASSFormated(bool ms=false) const; ///< Returns the ASS representation of time }; // Comparison operators @@ -89,38 +81,26 @@ bool operator >= (const AssTime &t1, const AssTime &t2); AssTime operator + (const AssTime &t1, const AssTime &t2); AssTime operator - (const AssTime &t1, const AssTime &t2); - - - /// DOCME /// @class FractionalTime /// @brief DOCME /// /// DOCME class FractionalTime { -private: + int time; ///< Time in miliseconds + int num; ///< Numerator + int den; ///< Denominator + bool drop; ///< Enable SMPTE dropframe handling - /// DOCME - int time; // milliseconds, like in AssTime + /// separator; someone might have separators of more than one character :V + wxString sep; - /// DOCME - - /// DOCME - int num, den; // numerator/denominator - - /// DOCME - bool drop; // EVIL - - /// DOCME - wxString sep; // separator; someone might have separators of more than one character :V - - - /// DOCME + /// How often to drop frames when enabled static const int frames_per_period = 17982; public: - // dumb assumption? I give no fuck - // NOTE: separator can be a regex! at least if you only plan on doing SMPTE->somethingelse. + /// dumb assumption? I give no fuck + /// NOTE: separator can be a regex! at least if you only plan on doing SMPTE->somethingelse. FractionalTime(wxString separator, int numerator=30, int denominator=1, bool dropframe=false); ~FractionalTime(); @@ -130,5 +110,3 @@ public: wxString FromAssTime(AssTime time); wxString FromMillisecs(int64_t msec); }; - -