X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Ftimecode.h;h=e4b32548e275886573e9d7025000df5e70e20fe3;hb=d99fc865a759d1909af9031903b0b8e87be5449c;hp=b71393bcebd54f217ab33cc29478c09316393b13;hpb=1ecbd5b62783247938e9873868e6ce625ef23b6c;p=kdenlive diff --git a/src/timecode.h b/src/timecode.h index b71393bc..e4b32548 100644 --- a/src/timecode.h +++ b/src/timecode.h @@ -26,32 +26,36 @@ Handles the conversion of a GenTime into a nicely formatted string, taking into @author Jason Wood */ -class Timecode { - public: +class Timecode +{ +public: enum Formats { HH_MM_SS_FF, HH_MM_SS_HH, Frames, Seconds }; - Timecode(Formats format = HH_MM_SS_FF, int framesPerSecond = - 25, bool dropFrame = false); + explicit Timecode(Formats format = HH_MM_SS_FF, int framesPerSecond = + 25, bool dropFrame = false); - /** Set the current timecode format; this is the output format for this timecode. */ + /** Set the current timecode format; this is the output format for this timecode. */ void setFormat(int framesPerSecond, bool dropFrame = false, Formats format = HH_MM_SS_FF) { - m_displayedFramesPerSecond = framesPerSecond; - m_dropFrame = dropFrame; - m_format = format; - } + m_displayedFramesPerSecond = framesPerSecond; + m_dropFrame = dropFrame; + m_format = format; + } Formats format() const { - return m_format; - } + return m_format; + } ~Timecode(); - /** Returns the timecode for a given time */ + /** Returns the timecode for a given time */ QString getTimecode(const GenTime & time, double fps) const; - int getFrameNumber(const QString duration, double fps) const; + int getFrameCount(const QString duration, double fps) const; static QString getEasyTimecode(const GenTime & time, const double &fps); - QString getTimecodeFromFrames(int frames); - private: + static QString getStringTimecode(int frames, const double &fps); + QString getTimecodeFromFrames(int frames) const; + int fps() const; + +private: Formats m_format; bool m_dropFrame; int m_displayedFramesPerSecond;