]> git.sesse.net Git - kdenlive/blobdiff - src/timecode.h
Integrate with the required MLT hooks for getting Movit to work.
[kdenlive] / src / timecode.h
index 3d310eb6df7e37a1e67528d971bd1a30e010be66..23469756bbb8f3f4daec0f8e623a63243100da1c 100644 (file)
@@ -17,7 +17,7 @@
 #ifndef TIMECODE_H
 #define TIMECODE_H
 
-#include <qstring.h>
+#include <QString>
 
 #include "gentime.h"
 
@@ -31,16 +31,12 @@ class Timecode
 public:
     enum Formats { HH_MM_SS_FF, HH_MM_SS_HH, Frames, Seconds };
 
-    explicit Timecode(Formats format = HH_MM_SS_FF, double framesPerSecond =
-                          25, bool dropFrame = false);
+    explicit Timecode(Formats format = HH_MM_SS_FF, double framesPerSecond = 25);
 
-    /** Set the current timecode format; this is the output format for this timecode. */
-    void setFormat(double framesPerSecond, bool dropFrame = false, Formats format = HH_MM_SS_FF) {
-        m_displayedFramesPerSecond = (int) (framesPerSecond + 0.5);
-        m_dropFrame = dropFrame;
-        m_format = format;
-       m_realFps = framesPerSecond;
-    }
+    /**
+     * Set the current timecode format; this is the output format for this timecode.
+     */
+    void setFormat(double framesPerSecond, Formats format = HH_MM_SS_FF);
 
     Formats format() const {
         return m_format;
@@ -49,27 +45,35 @@ public:
     ~Timecode();
 
     /** Returns the timecode for a given time */
+    QString getDisplayTimecode(const GenTime & time, bool frameDisplay) const;
     QString getTimecode(const GenTime & time) const;
-    int getFrameCount(const QString duration) const;
+    int getDisplayFrameCount(const QString &duration, bool frameDisplay) const;
+    int getFrameCount(const QString &duration) const;
     static QString getEasyTimecode(const GenTime & time, const double &fps);
-    static QString getStringTimecode(int frames, const double &fps);
-    QString getTimecodeFromFrames(int frames) const;
-    int fps() const;
+    static QString getStringTimecode(int frames, const double &fps, bool showFrames = false);
+    const QString getDisplayTimecodeFromFrames(int frames, bool frameDisplay) const;
+    const QString getTimecodeFromFrames(int frames) const;
+    double fps() const;
+    bool df() const;
+    const QString mask(const GenTime &t = GenTime()) const;
+    QString reformatSeparators(QString duration) const;
 
 private:
     Formats m_format;
-    bool m_dropFrame;
+    bool m_dropFrameTimecode;
     int m_displayedFramesPerSecond;
     double m_realFps;
+    double m_dropFrames;
+    int m_framesPer10Minutes;
+
+    const QString getTimecodeHH_MM_SS_FF(const GenTime & time) const;
+    const QString getTimecodeHH_MM_SS_FF(int frames) const;
 
-    QString getTimecodeHH_MM_SS_FF(const GenTime & time) const;
-    QString getTimecodeHH_MM_SS_FF(int frames) const;
-    
-    QString getTimecodeHH_MM_SS_HH(const GenTime & time) const;
-    QString getTimecodeFrames(const GenTime & time) const;
-    QString getTimecodeSeconds(const GenTime & time) const;
-    QString getTimecodeDropFrame(const GenTime & time) const;
-    QString getTimecodeDropFrame(int frames) const;
+    const QString getTimecodeHH_MM_SS_HH(const GenTime & time) const;
+    const QString getTimecodeFrames(const GenTime & time) const;
+    const QString getTimecodeSeconds(const GenTime & time) const;
+    const QString getTimecodeDropFrame(const GenTime & time) const;
+    const QString getTimecodeDropFrame(int framenumber) const;
 };
 
 #endif