[c5c04b]: libgui / CurveWidget.h Maximize Restore History

Download this file

CurveWidget.h    84 lines (65 with data), 1.8 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#ifndef _CURVE_WIDGET_H_
#define _CURVE_WIDGET_H_ 1
#include <qstring.h>
#include <qstrlist.h>
#include <qwidget.h>
#include <qpainter.h>
#include "libkwave/Interpolation.h"
class Curve;
class QMouseEvent;
class QPaintEvent;
class QPopupMenu;
class Point;
class QPixmap;
class QDir;
class CurveWidget : public QWidget
{
Q_OBJECT
public:
CurveWidget(QWidget *parent = 0, const char *init = 0, int = false);
~CurveWidget();
QString getCommand();
void setCurve(const char *);
void addPoint(double, double);
Point* findPoint(int, int);
public slots:
/**
* Sets a new interpolation type
* @see Interpolation
* @see interpolation_t
*/
void setType(interpolation_t type);
void scaleFit();
void VFlip();
void HFlip();
void deleteLast();
void deleteSecond();
void firstHalf();
void secondHalf();
void savePreset();
void loadPreset(int);
signals:
protected:
void mousePressEvent(QMouseEvent * );
void mouseReleaseEvent(QMouseEvent * );
void mouseMoveEvent(QMouseEvent * );
void paintEvent(QPaintEvent *);
private:
int width, height; //of widget
int interpolationtype; //type of interpolation
int keepborder; //flag denying acces to first and last point...e
double x[7], y[7]; //buffer for polynomial coefficients
Curve *points; //Points set by User
QPopupMenu *menu;
Point *act;
Point *last; //last Point clicked remembered for deleting
QPainter p;
QPixmap *pixmap; //pixmap to be blitted to screen
QStrList namelist;
bool down;
int knobcount;
QPixmap *knob;
QPixmap *selectedknob;
};
//***********************************************************************
#endif // _CURVE_WIDGET_H_