Clean up ass_time.h a little

Originally committed to SVN as r6085.
This commit is contained in:
Thomas Goyne 2011-12-22 21:22:40 +00:00
parent ec63fad7c5
commit 7a2c461825

View file

@ -34,32 +34,24 @@
/// @ingroup subs_storage /// @ingroup subs_storage
/// ///
#pragma once #pragma once
///////////
// Headers
#ifndef AGI_PRE #ifndef AGI_PRE
#include <stdint.h> #include <stdint.h>
#include <wx/string.h> #include <wx/string.h>
#endif #endif
/// DOCME /// DOCME
/// @class AssTime /// @class AssTime
/// @brief DOCME /// @brief DOCME
/// ///
/// DOCME /// DOCME
class AssTime { class AssTime {
private: /// Time in miliseconds
int time;
/// DOCME
int time; // Miliseconds
public: public:
/// DOCME /// DOCME
static bool UseMSPrecision; static bool UseMSPrecision;
@ -72,10 +64,10 @@ public:
int GetTimeMiliseconds(); int GetTimeMiliseconds();
int GetTimeCentiseconds(); int GetTimeCentiseconds();
int GetMS() const; // Returns milliseconds int GetMS() const; ///< Returns milliseconds
void SetMS(int ms); // Sets values to 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 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 wxString GetASSFormated(bool ms=false) const; ///< Returns the ASS representation of time
}; };
// Comparison operators // 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);
AssTime operator - (const AssTime &t1, const AssTime &t2); AssTime operator - (const AssTime &t1, const AssTime &t2);
/// DOCME /// DOCME
/// @class FractionalTime /// @class FractionalTime
/// @brief DOCME /// @brief DOCME
/// ///
/// DOCME /// DOCME
class FractionalTime { class FractionalTime {
private: int time; ///< Time in miliseconds
int num; ///< Numerator
int den; ///< Denominator
bool drop; ///< Enable SMPTE dropframe handling
/// DOCME /// separator; someone might have separators of more than one character :V
int time; // milliseconds, like in AssTime wxString sep;
/// DOCME /// How often to drop frames when enabled
/// 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
static const int frames_per_period = 17982; static const int frames_per_period = 17982;
public: public:
// dumb assumption? I give no fuck /// dumb assumption? I give no fuck
// NOTE: separator can be a regex! at least if you only plan on doing SMPTE->somethingelse. /// 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(wxString separator, int numerator=30, int denominator=1, bool dropframe=false);
~FractionalTime(); ~FractionalTime();
@ -130,5 +110,3 @@ public:
wxString FromAssTime(AssTime time); wxString FromAssTime(AssTime time);
wxString FromMillisecs(int64_t msec); wxString FromMillisecs(int64_t msec);
}; };