Mercurial > hg > svgui
comparison widgets/LevelPanWidget.h @ 1177:916b62baf7ac levelpanwidget
Add monitoring to level-pan widget (though not well, yet)
author | Chris Cannam |
---|---|
date | Mon, 05 Dec 2016 15:47:32 +0000 |
parents | 77110abca8a1 |
children | 6a6a63506e3f |
comparison
equal
deleted
inserted
replaced
1176:125748a569fa | 1177:916b62baf7ac |
---|---|
51 void setLevel(float); | 51 void setLevel(float); |
52 | 52 |
53 /// Set pan in the range [-1,1] -- will be rounded | 53 /// Set pan in the range [-1,1] -- will be rounded |
54 void setPan(float); | 54 void setPan(float); |
55 | 55 |
56 /// Set left and right peak monitoring levels in the range [0,1] | |
57 void setMonitoringLevels(float, float); | |
58 | |
56 /// Specify whether the widget is editable or read-only (default editable) | 59 /// Specify whether the widget is editable or read-only (default editable) |
57 void setEditable(bool); | 60 void setEditable(bool); |
58 | 61 |
59 /// Specify whether the level range should include muting or not | 62 /// Specify whether the level range should include muting or not |
60 void setIncludeMute(bool); | 63 void setIncludeMute(bool); |
61 | 64 |
62 signals: | 65 signals: |
63 void levelChanged(float); | 66 void levelChanged(float); // range [0,1] |
64 void panChanged(float); | 67 void panChanged(float); // range [-1,1] |
65 | 68 |
66 protected: | 69 protected: |
67 virtual void mousePressEvent(QMouseEvent *ev); | 70 virtual void mousePressEvent(QMouseEvent *ev); |
68 virtual void mouseMoveEvent(QMouseEvent *ev); | 71 virtual void mouseMoveEvent(QMouseEvent *ev); |
69 virtual void mouseReleaseEvent(QMouseEvent *ev); | 72 virtual void mouseReleaseEvent(QMouseEvent *ev); |
73 void emitLevelChanged(); | 76 void emitLevelChanged(); |
74 void emitPanChanged(); | 77 void emitPanChanged(); |
75 | 78 |
76 int m_level; | 79 int m_level; |
77 int m_pan; | 80 int m_pan; |
81 float m_monitorLeft; | |
82 float m_monitorRight; | |
78 bool m_editable; | 83 bool m_editable; |
79 bool m_includeMute; | 84 bool m_includeMute; |
80 | 85 |
86 static int audioLevelToLevel(float audioLevel, bool withMute); | |
87 static float levelToAudioLevel(int level, bool withMute); | |
88 | |
89 static int audioPanToPan(float audioPan); | |
90 static float panToAudioPan(int pan); | |
91 | |
81 QSizeF cellSize(QRectF) const; | 92 QSizeF cellSize(QRectF) const; |
82 QPointF cellCentre(QRectF, int level, int pan) const; | 93 QPointF cellCentre(QRectF, int level, int pan) const; |
83 QSizeF cellLightSize(QRectF) const; | 94 QSizeF cellLightSize(QRectF) const; |
84 QRectF cellLightRect(QRectF, int level, int pan) const; | 95 QRectF cellLightRect(QRectF, int level, int pan) const; |
85 double thinLineWidth(QRectF) const; | 96 double thinLineWidth(QRectF) const; |