comparison widgets/AudioDial.h @ 168:d4be66d61c04

* Make audio dial remember its more accurate mapped value as well as its display position * Add tool tip support to audio dial to show values
author Chris Cannam
date Tue, 17 Oct 2006 13:04:49 +0000
parents 53b9c7656798
children dbd34ff746c7
comparison
equal deleted inserted replaced
167:53b9c7656798 168:d4be66d61c04
70 const QColor& getKnobColor() const { return m_knobColor; } 70 const QColor& getKnobColor() const { return m_knobColor; }
71 const QColor& getMeterColor() const { return m_meterColor; } 71 const QColor& getMeterColor() const { return m_meterColor; }
72 bool getMouseDial() const { return m_mouseDial; } 72 bool getMouseDial() const { return m_mouseDial; }
73 73
74 void setRangeMapper(RangeMapper *mapper); // I take ownership, will delete 74 void setRangeMapper(RangeMapper *mapper); // I take ownership, will delete
75 const RangeMapper *rangeMapper() const { return m_rangeMapper; }
76 float mappedValue() const;
75 77
76 float mappedValue() const; 78 void setShowToolTip(bool show);
77 79
78 public slots: 80 public slots:
79 /** 81 /**
80 * Set the colour of the knob. The default is to inherit the 82 * Set the colour of the knob. The default is to inherit the
81 * colour from the widget's palette. 83 * colour from the widget's palette.
105 virtual void mousePressEvent(QMouseEvent *pMouseEvent); 107 virtual void mousePressEvent(QMouseEvent *pMouseEvent);
106 virtual void mouseMoveEvent(QMouseEvent *pMouseEvent); 108 virtual void mouseMoveEvent(QMouseEvent *pMouseEvent);
107 virtual void mouseReleaseEvent(QMouseEvent *pMouseEvent); 109 virtual void mouseReleaseEvent(QMouseEvent *pMouseEvent);
108 virtual void mouseDoubleClickEvent(QMouseEvent *pMouseEvent); 110 virtual void mouseDoubleClickEvent(QMouseEvent *pMouseEvent);
109 111
112 protected slots:
113 void updateMappedValue(int value);
114
110 private: 115 private:
111 QColor m_knobColor; 116 QColor m_knobColor;
112 QColor m_meterColor; 117 QColor m_meterColor;
113 118
114 int m_defaultValue; 119 int m_defaultValue;
120 float m_mappedValue;
121 bool m_noMappedUpdate;
115 122
116 // Alternate mouse behavior tracking. 123 // Alternate mouse behavior tracking.
117 bool m_mouseDial; 124 bool m_mouseDial;
118 bool m_mousePressed; 125 bool m_mousePressed;
119 QPoint m_posMouse; 126 QPoint m_posMouse;
127
128 bool m_showTooltip;
120 129
121 RangeMapper *m_rangeMapper; 130 RangeMapper *m_rangeMapper;
122 }; 131 };
123 132
124 133