]> git.sesse.net Git - kdenlive/blobdiff - src/timecodedisplay.h
Fix thumbnails loading (was loading several times the same ones), improve feedback
[kdenlive] / src / timecodedisplay.h
index 4a751afb2bf3c04a33279b93ce4b6bb4b7fe27e3..a18f757f08ddb464db497d33b7c06375be83bb61 100644 (file)
 #ifndef TIMECODEDISPLAY_H_
 #define TIMECODEDISPLAY_H_
 
-#include "ui_timecodedisplay_ui.h"
 #include "timecode.h"
 #include "gentime.h"
 
+#include <QAbstractSpinBox>
 
 /**
  * @class TimecodeDisplay
@@ -33,7 +33,7 @@
  * TimecodeDisplay can be used to insert eigther frames
  * or a timecode in the format HH:MM:SS:FF
  */
-class TimecodeDisplay : public QWidget, public Ui::TimecodeDisplay_UI
+class TimecodeDisplay : public QAbstractSpinBox
 {
     Q_OBJECT
 
@@ -57,7 +57,7 @@ public:
     void setRange(int min, int max);
 
     /** @brief Returns the current input in frames. */
-    int value() const;
+    int getValue() const;
 
     /** @brief Returns the current input as a GenTime object. */
     GenTime gentime() const;
@@ -66,13 +66,16 @@ public:
     Timecode timecode() const;
 
     /** @brief Sets value's format to frames or HH:MM:SS:FF according to @param frametimecode.
-    * @param frametimecode true = frames, false = HH:MM:SS:FF */
-    void setTimeCodeFormat(bool frametimecode);
+    * @param frametimecode true = frames, false = HH:MM:SS:FF
+    * @param init true = force the change, false = update only if the frametimecode param changed */
+    void setTimeCodeFormat(bool frametimecode, bool init = false);
 
     /** @brief Sets timecode for current project.
      * @param t the new timecode */
     void updateTimeCode(Timecode t);
 
+    virtual void stepBy(int steps);
+
 private:
     /** timecode for widget */
     Timecode m_timecode;
@@ -94,8 +97,12 @@ public slots:
     void slotUpdateTimeCodeFormat();
 
 private slots:
-    void slotValueUp();
-    void slotValueDown();
+    void slotEditingFinished();
+
+    /** @brief Updates the selection when the cursor position changed.
+     * The digit after the cursor will be selected.
+     * This makes it easier to edit the timecode. */
+    void slotCursorPositionChanged(int oldPos, int newPos);
 
 signals:
     /**
@@ -109,7 +116,9 @@ signals:
 
 protected:
     virtual void keyPressEvent(QKeyEvent *e);
-    virtual void wheelEvent(QWheelEvent *e);
+    virtual void mouseReleaseEvent(QMouseEvent *);
+//    virtual void wheelEvent(QWheelEvent *e);
+    virtual QAbstractSpinBox::StepEnabled stepEnabled () const;
 
 };