]> git.sesse.net Git - kdenlive/blobdiff - src/timecodedisplay.h
Fix label
[kdenlive] / src / timecodedisplay.h
index 4a4232ed7798d4180bd1616f88dfb4df30c6230f..285bde74c7b2245353e6b4cd74aa9fc1aa9b528b 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
 
@@ -41,7 +41,7 @@ public:
     /** @brief Constructor for the widget, sets value to 0.
     * @param t Timecode object used to setup correct input (frames or HH:MM:SS:FF)
     * @param parent parent Widget */
-    TimecodeDisplay(Timecode t, QWidget *parent = 0);
+    explicit TimecodeDisplay(const Timecode& t, QWidget *parent = 0);
 
     /** @brief Returns the minimum value, which can be entered.
     * default is 0 */
@@ -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;
@@ -72,15 +72,18 @@ public:
 
     /** @brief Sets timecode for current project.
      * @param t the new timecode */
-    void updateTimeCode(Timecode t);
+    void updateTimeCode(const Timecode &t);
+
+    virtual void stepBy(int steps);
 
 private:
     /** timecode for widget */
     Timecode m_timecode;
-    /** Should we display the timecode in frames or in format hh:mm:ss:ff */
+    /** Should we display the timecode in frames or in format hh:mm:ss:ff */
     bool m_frametimecode;
     int m_minimum;
     int m_maximum;
+    int m_value;
 
 public slots:
     /** @brief Sets the value.
@@ -88,15 +91,14 @@ public slots:
     * The value actually set is forced to be within the legal range: minimum <= value <= maximum */
     void setValue(int value);
     void setValue(const QString &value);
-    void setValue(GenTime value);
+    void setValue(const GenTime &value);
 
-    /** @brief Sets value's format accorrding to Kdenlive's settings.
+    /** @brief Sets value's format according to Kdenlive's settings.
     * @param t (optional, if already existing) Timecode object to use */
     void slotUpdateTimeCodeFormat();
 
 private slots:
-    void slotValueUp();
-    void slotValueDown();
+    void slotEditingFinished();
 
 signals:
     /**
@@ -106,11 +108,13 @@ signals:
      * @param final if the value is final ie not produced during sliding (on slider release it's final)
      */
     void valueChanged(int value, bool final);
-    void editingFinished();
+    void timeCodeEditingFinished();
 
 protected:
     virtual void keyPressEvent(QKeyEvent *e);
+    virtual void mouseReleaseEvent(QMouseEvent *);
     virtual void wheelEvent(QWheelEvent *e);
+    virtual QAbstractSpinBox::StepEnabled stepEnabled () const;
 
 };