kwave  18.07.70
CurveWidget.h
Go to the documentation of this file.
1 /***************************************************************************
2  CurveWidget.h - widget for editing an interpolated curve
3  -------------------
4  begin : Sep 16 2001
5  copyright : (C) 2001 by Thomas Eschenbacher
6  email : Thomas Eschenbacher <thomas.eschenbacher@gmx.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 #ifndef CURVE_WIDGET_H
19 #define CURVE_WIDGET_H
20 
21 #include "config.h"
22 
23 #include <QtGlobal>
24 #include <QMenu>
25 #include <QWidget>
26 
27 #include "libkwave/Curve.h"
28 
29 class QAction;
30 class QMouseEvent;
31 class QPaintEvent;
32 class QPixmap;
33 class QString;
34 
35 namespace Kwave
36 {
37  class Q_DECL_EXPORT CurveWidget: public QWidget
38  {
39  Q_OBJECT
40  public:
41 
43  explicit CurveWidget(QWidget *parent);
44 
46  virtual ~CurveWidget() Q_DECL_OVERRIDE;
47 
49  QString getCommand();
50 
52  void setCurve(const QString &command);
53 
59  void addPoint(double x, double y);
60 
68  Kwave::Curve::Point findPoint(int sx, int sy);
69 
70  public slots:
71 
76  void selectInterpolationType(QAction *action);
77 
82  void scaleFit();
83 
85  void VFlip();
86 
88  void HFlip();
89 
91  void deleteLast();
92 
94  void deleteSecond();
95 
102  void firstHalf();
103 
105  void secondHalf();
106 
107  void savePreset();
108 
113  void loadPreset(QAction *action);
114 
115  protected slots:
116 
117  virtual void mousePressEvent(QMouseEvent * ) Q_DECL_OVERRIDE;
118  virtual void mouseReleaseEvent(QMouseEvent * ) Q_DECL_OVERRIDE;
119  virtual void mouseMoveEvent(QMouseEvent * ) Q_DECL_OVERRIDE;
120  virtual void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
121 
122  protected:
123 
128  void loadPresetList();
129 
130  private:
131 
133  int m_width;
134 
136  int m_height;
137 
140 
142  QMenu *m_menu;
143 
149 
152 
155 
157  bool m_down;
158 
160  QPixmap m_knob;
161 
164 
165  };
166 }
167 
168 #endif // _CURVE_WIDGET_H_
169 
170 //***************************************************************************
171 //***************************************************************************
QPointF Point
Definition: Curve.h:48
Definition: App.h:33
Kwave::Curve m_curve
Definition: CurveWidget.h:139
Kwave::Curve::Point m_current
Definition: CurveWidget.h:151
QPixmap m_selected_knob
Definition: CurveWidget.h:163
Kwave::Curve::Point m_last
Definition: CurveWidget.h:154