]> git.sesse.net Git - kdenlive/blobdiff - src/keyframeedit.h
Allow adding comments to bool parameters
[kdenlive] / src / keyframeedit.h
index b79498daa4695d213d0a11a7eea2af3171cd9e0e..4d1f1f5f2d67b9ff1a36ba05666a9270fdb11cd9 100644 (file)
@@ -25,6 +25,8 @@
 #include <QAbstractItemView>
 #include <QSpinBox>
 
+class QButtonGroup;
+class PositionEdit;
 
 #include "ui_keyframeeditor_ui.h"
 #include "definitions.h"
@@ -79,30 +81,37 @@ class KeyframeEdit : public QWidget, public Ui::KeyframeEditor_UI
 {
     Q_OBJECT
 public:
-    explicit KeyframeEdit(QDomElement e, int minFrame, int maxFrame, int minVal, int maxVal, Timecode tc, int active_keyframe, QWidget* parent = 0);
+    explicit KeyframeEdit(QDomElement e, int minFrame, int maxFrame, Timecode tc, int activeKeyframe, QWidget* parent = 0);
     virtual ~KeyframeEdit();
-    void setupParam();
-    void addParameter(QDomElement e);
+    virtual void addParameter(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();
 
+    /** @brief Returns true if the parameter @param name should be shown on the clip in timeline. */
+    bool isVisibleParam(const QString &name);
+
+    /** @brief Makes the first parameter visible in timeline if no parameter is selected. */
+    void checkVisibleParam();
+
+protected:
+    /** @brief Gets the position of a keyframe from the table.
+     * @param row Row of the keyframe in the table */
+    int getPos(int row);
+
+protected slots:
+    void slotAdjustKeyframeInfo(bool seek = true);
+
 private:
     QList <QDomElement> m_params;
     int m_min;
     int m_max;
-    int m_minVal;
-    int m_maxVal;
     Timecode m_timecode;
-    int m_previousPos;
-    //KeyItemDelegate *m_delegate;
-    void generateAllParams();
     QGridLayout *m_slidersLayout;
-    int m_active_keyframe;
+    QButtonGroup *m_showButtons;
+    PositionEdit *m_position;
 
-    /** @brief Gets the position of a keyframe from the table.
-    * @param row Row of the keyframe in the table */
-    int getPos(int row);
+    void generateAllParams();
     /** @brief Converts a frame value to timecode considering the frames vs. HH:MM:SS:FF setting.
     * @return timecode */
     QString getPosString(int pos);
@@ -111,17 +120,25 @@ 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);
     /** @brief Turns the seek to keyframe position setting on/off.
-    * @param state State of the associated checkbox */
-    void slotSetSeeking(int state);
-    //void slotSaveCurrentParam(QTreeWidgetItem *item, int column);
+    * @param seek true = seeking on */
+    void slotSetSeeking(bool seek);
+
+    /** @brief Shows the keyframe table and adds a second keyframe. */
+    void slotKeyframeMode();
+
+    /** @brief Resets all parameters of the selected keyframe to their default values. */
+    void slotResetKeyframe();
+
+    /** @brief Makes the parameter at column @param id the visible (in timeline) one. */
+    void slotUpdateVisibleParameter(int id, bool update = true);
 
 signals:
     void parameterChanged();
     void seekToPos(int);
+    void showComments(bool show);
 };
 
 #endif