comparison widgets/LevelPanWidget.h @ 929:20698aa6a517 tonioni

Introduce level/pan toolbar buttons
author Chris Cannam
date Wed, 25 Mar 2015 10:33:19 +0000
parents 2a9f1eb6e0ed
children 77110abca8a1
comparison
equal deleted inserted replaced
928:3fb91da7d98d 929:20698aa6a517
17 17
18 #include <QWidget> 18 #include <QWidget>
19 19
20 /** 20 /**
21 * A simple widget for coarse level and pan control. 21 * A simple widget for coarse level and pan control.
22 *
23 * For this initial implementation at least, pan is in five steps only
24 * (hard left, mid-left, centre, mid-right, hard right) and level is
25 * in five plus mute.
26 */ 22 */
27 23
28 class LevelPanWidget : public QWidget 24 class LevelPanWidget : public QWidget
29 { 25 {
30 Q_OBJECT 26 Q_OBJECT
40 float getPan() const; 36 float getPan() const;
41 37
42 /// Find out whether the widget is editable 38 /// Find out whether the widget is editable
43 bool isEditable() const; 39 bool isEditable() const;
44 40
41 /// Draw a suitably sized copy of the widget's contents to the given device
42 void renderTo(QPaintDevice *, QRectF, bool asIfEditable) const;
43
44 QSize sizeHint() const;
45
45 public slots: 46 public slots:
46 /// Set level in the range [0,1] -- will be rounded 47 /// Set level in the range [0,1] -- will be rounded
47 void setLevel(float); 48 void setLevel(float);
48 49
49 /// Set pan in the range [-1,1] -- will be rounded 50 /// Set pan in the range [-1,1] -- will be rounded
68 69
69 int m_level; 70 int m_level;
70 int m_pan; 71 int m_pan;
71 bool m_editable; 72 bool m_editable;
72 73
73 QSizeF cellSize() const; 74 QSizeF cellSize(QRectF) const;
74 QPointF cellCentre(int level, int pan) const; 75 QPointF cellCentre(QRectF, int level, int pan) const;
75 QSizeF cellLightSize() const; 76 QSizeF cellLightSize(QRectF) const;
76 QRectF cellLightRect(int level, int pan) const; 77 QRectF cellLightRect(QRectF, int level, int pan) const;
77 double thinLineWidth() const; 78 double thinLineWidth(QRectF) const;
78 void toCell(QPointF loc, int &level, int &pan) const; 79 void toCell(QRectF, QPointF loc, int &level, int &pan) const;
79 }; 80 };
80 81
81 #endif 82 #endif