X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Ftimecodedisplay.h;h=97bd353eaf1f1dbb2f84fdeb8fe56b4cc76dc1a4;hb=fe156af311a975e3a4be1b9a736d0436010cae59;hp=241b5db9cf53aba390db4c62666d08064e058be9;hpb=f8fc9aef061d85a6a86c1cd834307917db79c57d;p=kdenlive diff --git a/src/timecodedisplay.h b/src/timecodedisplay.h index 241b5db9..97bd353e 100644 --- a/src/timecodedisplay.h +++ b/src/timecodedisplay.h @@ -20,10 +20,10 @@ #ifndef TIMECODEDISPLAY_H_ #define TIMECODEDISPLAY_H_ -#include "ui_timecodedisplay_ui.h" #include "timecode.h" #include "gentime.h" +#include /** * @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(Timecode t, QWidget *parent = 0); /** @brief Returns the minimum value, which can be entered. * default is 0 */ @@ -57,17 +57,24 @@ 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; /** @brief Returs the widget's timecode object. */ 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 */ @@ -76,6 +83,7 @@ private: bool m_frametimecode; int m_minimum; int m_maximum; + int m_value; public slots: /** @brief Sets the value. @@ -85,13 +93,12 @@ public slots: void setValue(const QString &value); void setValue(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: /** @@ -101,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; };