]> git.sesse.net Git - kdenlive/blob - src/parameterplotter.h
use parameterplotter for "complex" effects
[kdenlive] / src / parameterplotter.h
1 /***************************************************************************
2                           parameterplotter.h  -  description
3                              -------------------
4     begin                : Feb 15 2008
5     copyright            : (C) 2008 by Marco Gittler
6     email                : g.marco@freenet.de
7  ***************************************************************************/
8
9 /***************************************************************************
10  *                                                                         *
11  *   This program is free software; you can redistribute it and/or modify  *
12  *   it under the terms of the GNU General Public License as published by  *
13  *   the Free Software Foundation; either version 2 of the License, or     *
14  *   (at your option) any later version.                                   *
15  *                                                                         *
16  ***************************************************************************/
17
18 #include <KPlotWidget>
19 #include <QDomElement>
20 #include "ui_keyframewidget_ui.h"
21
22 class PlotWrapper : public KPlotWidget {
23         Q_OBJECT
24         public:
25                 PlotWrapper (QWidget *parent=0):KPlotWidget(parent){}
26                 QList<KPlotPoint*> pointsUnderPoint(const QPoint& p){
27                         return KPlotWidget::pointsUnderPoint( p );
28                 }
29 };
30
31
32 class ParameterPlotter : public QWidget , public Ui::KeyframeWidget_UI {
33         Q_OBJECT
34         public:
35                 ParameterPlotter (QWidget *parent=0);
36                 virtual ~ParameterPlotter(){}
37                 void replot(const QString& name="");
38         private:
39                 KPlotPoint* movepoint;
40                 PlotWrapper* kplotwidget;
41                 int activeIndexPlot;
42                 bool m_moveX,m_moveY,m_moveTimeline,m_newPoints;
43                 QPoint oldmousepoint;
44                 int maxx,maxy;
45                 QStringList parameterNameList;
46                 void createParametersNew();
47                 QList<KPlotObject*> plotobjects;
48                 QList<QColor> colors;
49                 QDomElement itemParameter;
50                 void updateButtonStatus();
51         protected:
52                 void mouseMoveEvent ( QMouseEvent * event );
53                 void mousePressEvent ( QMouseEvent * event );
54         public slots:
55                 void setPointLists(const QDomElement&,int ,int);
56                 void slotSetMoveX();
57                 void slotSetMoveY();
58                 void slotSetNew();
59                 void slotSetHelp();
60                 void slotShowInTimeline();
61                 void slotParameterChanged(const QString&);
62         signals:
63                 void parameterChanged(QDomElement );
64                 void updateFrame(int);
65         
66 };
67