]> git.sesse.net Git - kdenlive/blob - src/beziercurve/beziersplinewidget.h
Integrate with the required MLT hooks for getting Movit to work.
[kdenlive] / src / beziercurve / beziersplinewidget.h
1 /***************************************************************************
2  *   Copyright (C) 2010 by Till Theato (root@ttill.de)                     *
3  *   This file is part of Kdenlive (www.kdenlive.org).                     *
4  *                                                                         *
5  *   Kdenlive is free software: you can redistribute it and/or modify      *
6  *   it under the terms of the GNU General Public License as published by  *
7  *   the Free Software Foundation, either version 2 of the License, or     *
8  *   (at your option) any later version.                                   *
9  *                                                                         *
10  *   Kdenlive is distributed in the hope that it will be useful,           *
11  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
12  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
13  *   GNU General Public License for more details.                          *
14  *                                                                         *
15  *   You should have received a copy of the GNU General Public License     *
16  *   along with Kdenlive.  If not, see <http://www.gnu.org/licenses/>.     *
17  ***************************************************************************/
18
19 #ifndef BEZIERSPLINEWIDGET_H
20 #define BEZIERSPLINEWIDGET_H
21
22 #include "cubicbezierspline.h"
23 #include "beziersplineeditor.h"
24 #include "ui_bezierspline_ui.h"
25
26 #include <QWidget>
27
28 class DragValue;
29
30 class BezierSplineWidget : public QWidget
31 {
32     Q_OBJECT
33     
34 public:
35     /** @brief Sets up the UI and sets the spline to @param spline. */
36     explicit BezierSplineWidget(const QString &spline, QWidget* parent = 0);
37
38     /** @brief Returns the current spline. */
39     QString spline() const;
40
41     /** The curvemodes refer to the usage of the spline.
42      * As this widget is currently only used for frei0r.curves the modes are the channels this filter accepts. */
43     enum CurveModes { ModeRed, ModeGreen, ModeBlue, ModeAlpha, ModeLuma, ModeRGB, ModeHue, ModeSaturation };
44
45     /** @brief Sets the mode to @param mode and updates the editors background pixmap if necessary. */
46     void setMode(CurveModes mode);
47
48 private slots:
49     /** @brief Sets the spinboxes for modifing the selected point to @param p. */
50     void slotUpdatePointEntries(const BPoint &p);
51
52     /** @brief Updates the spline if the current point's p was modified using the spinboxes.
53      * @param value (optional) not used, neccessary to be able to connect to DragValue's valueChanged.
54      * @param final (default = true) emit signal modified? */
55     void slotUpdatePointP(double value = 1, bool final = true);
56     /** @brief Updates the spline if the current point's h1 was modified using the spinboxes.
57      * @param value (optional) not used, neccessary to be able to connect to DragValue's valueChanged.
58      * @param final (default = true) emit signal modified? */
59     void slotUpdatePointH1(double value = 1, bool final = true);
60     /** @brief Updates the spline if the current point's h2 was modified using the spinboxes.
61      * @param value (optional) not used, neccessary to be able to connect to DragValue's valueChanged.
62      * @param final (default = true) emit signal modified? */
63     void slotUpdatePointH2(double value = 1, bool final = true);
64
65     /** @brief Increases the number of lines in the editor's grid. If there are already 8 lines the number is set to 0. */
66     void slotGridChange();
67     /** @brief Turns showing the background pixmap in the editor on/off. */
68     void slotShowPixmap(bool show = true);
69     /** @brief Resets the current spline. */
70     void slotResetSpline();
71     /** @brief Linkes the handles. This will always make them stay in one line through p. */
72     void slotSetHandlesLinked(bool linked);
73
74     void slotShowAllHandles(bool show);
75
76 private:
77     Ui::BezierSpline_UI m_ui;
78     DragValue *m_pX;
79     DragValue *m_pY;
80     DragValue *m_h1X;
81     DragValue *m_h1Y;
82     DragValue *m_h2X;
83     DragValue *m_h2Y;
84     BezierSplineEditor m_edit;
85     CurveModes m_mode;
86     bool m_showPixmap;
87
88 signals:
89     void modified();
90 };
91
92 #endif