Mercurial > hg > svgui
comparison widgets/Thumbwheel.h @ 133:9e6b3e239b9d
* Add zoom thumbwheels to Pane. Implement horizontal thumbwheel, and
vertical depending on layer type (supported for waveform and spectrogram,
though wrong for log-scale spectrogram at the moment).
* Add bare bones of a spectrum layer.
* Add window icon
* Add shortcut for "insert time instant" on laptops without keypad enter (";")
* Delete FFT processing thread when it exits (at least, next time we're asked
for something interesting)
* Get audio file extensions from the file readers, and thus from libsndfile for
the wave file reader -- leads to rather a wide combo box in file dialog though
* Better refresh order for spectrogram (redraw centre section first)
author | Chris Cannam |
---|---|
date | Fri, 04 Aug 2006 17:01:37 +0000 |
parents | 5d3a483856ff |
children | 793df5f0c6cb |
comparison
equal
deleted
inserted
replaced
132:5d3a483856ff | 133:9e6b3e239b9d |
---|---|
21 class Thumbwheel : public QWidget | 21 class Thumbwheel : public QWidget |
22 { | 22 { |
23 Q_OBJECT | 23 Q_OBJECT |
24 | 24 |
25 public: | 25 public: |
26 Thumbwheel(int min, int max, int defaultValue, | 26 Thumbwheel(Qt::Orientation orientation, QWidget *parent = 0); |
27 Qt::Orientation orientation, QWidget *parent = 0); | |
28 virtual ~Thumbwheel(); | 27 virtual ~Thumbwheel(); |
29 | 28 |
30 void setSpeed(float speed); | 29 int getMinimumValue() const; |
30 int getMaximumValue() const; | |
31 int getDefaultValue() const; | |
31 float getSpeed() const; | 32 float getSpeed() const; |
32 | |
33 void setTracking(bool tracking); | |
34 bool getTracking() const; | 33 bool getTracking() const; |
35 | |
36 void setShowScale(bool show); | |
37 bool getShowScale() const; | 34 bool getShowScale() const; |
38 | |
39 void setValue(int value); | |
40 int getValue() const; | 35 int getValue() const; |
41 | 36 |
42 virtual void mousePressEvent(QMouseEvent *e); | 37 virtual void mousePressEvent(QMouseEvent *e); |
43 virtual void mouseDoubleClickEvent(QMouseEvent *e); | 38 virtual void mouseDoubleClickEvent(QMouseEvent *e); |
44 virtual void mouseMoveEvent(QMouseEvent *e); | 39 virtual void mouseMoveEvent(QMouseEvent *e); |
49 QSize sizeHint() const; | 44 QSize sizeHint() const; |
50 | 45 |
51 signals: | 46 signals: |
52 void valueChanged(int); | 47 void valueChanged(int); |
53 | 48 |
49 public slots: | |
50 void setMinimumValue(int min); | |
51 void setMaximumValue(int max); | |
52 void setDefaultValue(int deft); | |
53 void setSpeed(float speed); | |
54 void setTracking(bool tracking); | |
55 void setShowScale(bool show); | |
56 void setValue(int value); | |
57 void resetToDefault(); | |
58 | |
54 private: | 59 private: |
55 int m_min; | 60 int m_min; |
56 int m_max; | 61 int m_max; |
57 int m_default; | 62 int m_default; |
58 int m_value; | 63 int m_value; |
59 Qt::Orientation m_orientation; | 64 Qt::Orientation m_orientation; |
60 float m_speed; | 65 float m_speed; |
61 bool m_tracking; | 66 bool m_tracking; |
62 bool m_showScale; | 67 bool m_showScale; |
63 bool m_clicked; | 68 bool m_clicked; |
69 bool m_atDefault; | |
64 QPoint m_clickPos; | 70 QPoint m_clickPos; |
65 int m_clickValue; | 71 int m_clickValue; |
66 }; | 72 }; |
67 | 73 |
68 #endif | 74 #endif |