X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fkeyframeedit.h;h=a0ba5dc9ea139df9cf974c48d3557269fb9b9857;hb=1404e8f1d631c81399e0e92ffce7dfac0195fabb;hp=54f4e99587d8eb16ef4e390d989154f4b8db9e01;hpb=480f1a1466bc87a050a04dcb8ee5176ee9ec7747;p=kdenlive diff --git a/src/keyframeedit.h b/src/keyframeedit.h index 54f4e995..a0ba5dc9 100644 --- a/src/keyframeedit.h +++ b/src/keyframeedit.h @@ -25,7 +25,7 @@ #include #include -class QButtonGroup; +class PositionEdit; #include "ui_keyframeeditor_ui.h" #include "definitions.h" @@ -35,7 +35,8 @@ class KeyItemDelegate: public QItemDelegate { Q_OBJECT public: - KeyItemDelegate(int min, int max, QAbstractItemView* parent = 0): QItemDelegate(parent), m_min(min), m_max(max) { + KeyItemDelegate(int min, int max, QAbstractItemView* parent = 0) + : QItemDelegate(parent), m_min(min), m_max(max) { } QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const { @@ -80,9 +81,9 @@ class KeyframeEdit : public QWidget, public Ui::KeyframeEditor_UI { Q_OBJECT public: - explicit KeyframeEdit(QDomElement e, int minFrame, int maxFrame, Timecode tc, int activeKeyframe, QWidget* parent = 0); + explicit KeyframeEdit(const QDomElement &e, int minFrame, int maxFrame, const Timecode &tc, int activeKeyframe, QWidget* parent = 0); virtual ~KeyframeEdit(); - void addParameter(QDomElement e, int activeKeyframe = -1); + virtual void addParameter(const QDomElement &e, int activeKeyframe = -1); const QString getValue(const QString &name); /** @brief Updates the timecode display according to settings (frame number or hh:mm:ss:ff) */ void updateTimecodeFormat(); @@ -93,29 +94,38 @@ public: /** @brief Makes the first parameter visible in timeline if no parameter is selected. */ void checkVisibleParam(); -private: - QList m_params; - int m_min; - int m_max; - Timecode m_timecode; - QGridLayout *m_slidersLayout; - QButtonGroup *m_showButtons; +public slots: - void generateAllParams(); + void slotUpdateRange(int inPoint, int outPoint); + +protected: /** @brief Gets the position of a keyframe from the table. - * @param row Row of the keyframe in the table */ + * @param row Row of the keyframe in the table */ int getPos(int row); /** @brief Converts a frame value to timecode considering the frames vs. HH:MM:SS:FF setting. - * @return timecode */ + * @return timecode */ QString getPosString(int pos); + void generateAllParams(); + + int m_min; + int m_max; + +protected slots: + void slotAdjustKeyframeInfo(bool seek = true); + +private: + QList m_params; + Timecode m_timecode; + QGridLayout *m_slidersLayout; + PositionEdit *m_position; + private slots: void slotDeleteKeyframe(); void slotAddKeyframe(); void slotGenerateParams(int row, int column); - void slotAdjustKeyframeInfo(bool seek = true); void slotAdjustKeyframePos(int value); - void slotAdjustKeyframeValue(int value); + void slotAdjustKeyframeValue(double value); /** @brief Turns the seek to keyframe position setting on/off. * @param seek true = seeking on */ void slotSetSeeking(bool seek); @@ -132,7 +142,7 @@ private slots: signals: void parameterChanged(); void seekToPos(int); - void showComments(); + void showComments(bool show); }; #endif