svgui
1.9
|
AudioDial is a nicer-looking QDial that by default reacts to mouse movement on horizontal and vertical axes instead of in a radial motion. More...
#include <AudioDial.h>
Public Slots | |
void | setKnobColor (const QColor &color) |
Set the colour of the knob. | |
void | setMeterColor (const QColor &color) |
Set the colour of the meter (the highlighted area around the knob that shows the current value). | |
void | setMouseDial (bool mouseDial) |
Specify that the dial should respond to radial mouse movements in the same way as QDial. | |
void | setDefaultValue (int defaultValue) |
void | setValue (int value) |
void | setDefaultMappedValue (float mappedValue) |
void | setMappedValue (float mappedValue) |
void | setToDefault () |
Signals | |
void | mouseEntered () |
void | mouseLeft () |
Public Member Functions | |
AudioDial (QWidget *parent=0) | |
~AudioDial () | |
const QColor & | getKnobColor () const |
const QColor & | getMeterColor () const |
bool | getMouseDial () const |
void | setRangeMapper (RangeMapper *mapper) |
const RangeMapper * | rangeMapper () const |
float | mappedValue () const |
int | defaultValue () const |
void | setShowToolTip (bool show) |
Protected Slots | |
void | updateMappedValue (int value) |
Protected Member Functions | |
void | drawTick (QPainter &paint, float angle, int size, bool internal) |
virtual void | paintEvent (QPaintEvent *) |
virtual void | mousePressEvent (QMouseEvent *pMouseEvent) |
virtual void | mouseMoveEvent (QMouseEvent *pMouseEvent) |
virtual void | mouseReleaseEvent (QMouseEvent *pMouseEvent) |
virtual void | mouseDoubleClickEvent (QMouseEvent *pMouseEvent) |
virtual void | enterEvent (QEvent *) |
virtual void | leaveEvent (QEvent *) |
Properties | |
QColor | knobColor |
QColor | meterColor |
bool | mouseDial |
Private Attributes | |
QColor | m_knobColor |
QColor | m_meterColor |
int | m_defaultValue |
float | m_defaultMappedValue |
float | m_mappedValue |
bool | m_noMappedUpdate |
bool | m_mouseDial |
bool | m_mousePressed |
QPoint | m_posMouse |
bool | m_showTooltip |
RangeMapper * | m_rangeMapper |
AudioDial is a nicer-looking QDial that by default reacts to mouse movement on horizontal and vertical axes instead of in a radial motion.
Move the mouse up or right to increment the value, down or left to decrement it. AudioDial also responds to the mouse wheel.
The programming interface for this widget is compatible with QDial, with the addition of properties for the knob colour and meter colour and a boolean property mouseDial that determines whether to respond to radial mouse motion in the same way as QDial (the default is no).
Definition at line 59 of file AudioDial.h.
AudioDial::AudioDial | ( | QWidget * | parent = 0 | ) |
Definition at line 75 of file AudioDial.cpp.
References m_mouseDial, and m_mousePressed.
AudioDial::~AudioDial | ( | void | ) |
Definition at line 93 of file AudioDial.cpp.
References m_rangeMapper.
const QColor& AudioDial::getKnobColor | ( | ) | const [inline] |
Definition at line 70 of file AudioDial.h.
References m_knobColor.
const QColor& AudioDial::getMeterColor | ( | ) | const [inline] |
Definition at line 71 of file AudioDial.h.
References m_meterColor.
bool AudioDial::getMouseDial | ( | ) | const [inline] |
Definition at line 72 of file AudioDial.h.
References m_mouseDial.
void AudioDial::setRangeMapper | ( | RangeMapper * | mapper | ) |
Definition at line 100 of file AudioDial.cpp.
References m_rangeMapper, and updateMappedValue().
Referenced by PluginParameterBox::populate(), PropertyBox::populateViewPlayFrame(), and PropertyBox::updatePropertyEditor().
const RangeMapper* AudioDial::rangeMapper | ( | ) | const [inline] |
Definition at line 75 of file AudioDial.h.
References m_rangeMapper.
Referenced by PluginParameterBox::dialChanged(), PluginParameterBox::spinBoxChanged(), and PropertyBox::updateContextHelp().
float AudioDial::mappedValue | ( | ) | const |
Definition at line 390 of file AudioDial.cpp.
References m_mappedValue, and m_rangeMapper.
Referenced by PluginParameterBox::dialChanged(), setMappedValue(), and PropertyBox::updateContextHelp().
int AudioDial::defaultValue | ( | ) | const [inline] |
Definition at line 78 of file AudioDial.h.
References m_defaultValue.
Referenced by setDefaultValue().
void AudioDial::setShowToolTip | ( | bool | show | ) |
Definition at line 381 of file AudioDial.cpp.
References m_noMappedUpdate, m_showTooltip, and updateMappedValue().
Referenced by PluginParameterBox::populate(), PropertyBox::populateViewPlayFrame(), and PropertyBox::updatePropertyEditor().
void AudioDial::mouseEntered | ( | ) | [signal] |
Referenced by enterEvent().
void AudioDial::mouseLeft | ( | ) | [signal] |
Referenced by leaveEvent().
void AudioDial::setKnobColor | ( | const QColor & | color | ) | [slot] |
Set the colour of the knob.
The default is to inherit the colour from the widget's palette.
Definition at line 319 of file AudioDial.cpp.
References m_knobColor.
void AudioDial::setMeterColor | ( | const QColor & | color | ) | [slot] |
Set the colour of the meter (the highlighted area around the knob that shows the current value).
The default is to inherit the colour from the widget's palette.
Definition at line 326 of file AudioDial.cpp.
References m_meterColor.
Referenced by PropertyBox::populateViewPlayFrame().
void AudioDial::setMouseDial | ( | bool | mouseDial | ) | [slot] |
Specify that the dial should respond to radial mouse movements in the same way as QDial.
Definition at line 333 of file AudioDial.cpp.
References m_mouseDial, and mouseDial.
void AudioDial::setDefaultValue | ( | int | defaultValue | ) | [slot] |
Definition at line 339 of file AudioDial.cpp.
References defaultValue(), m_defaultMappedValue, m_defaultValue, and m_rangeMapper.
Referenced by PluginParameterBox::populate(), PropertyBox::populateViewPlayFrame(), and PropertyBox::updatePropertyEditor().
void AudioDial::setValue | ( | int | value | ) | [slot] |
Definition at line 347 of file AudioDial.cpp.
References updateMappedValue().
Referenced by mouseDoubleClickEvent(), mouseMoveEvent(), PluginParameterBox::populate(), setMappedValue(), setToDefault(), PluginParameterBox::spinBoxChanged(), and PropertyBox::updatePropertyEditor().
void AudioDial::setDefaultMappedValue | ( | float | mappedValue | ) | [slot] |
Definition at line 353 of file AudioDial.cpp.
References m_defaultMappedValue, m_defaultValue, and m_rangeMapper.
void AudioDial::setMappedValue | ( | float | mappedValue | ) | [slot] |
Definition at line 361 of file AudioDial.cpp.
References m_mappedValue, m_noMappedUpdate, m_rangeMapper, mappedValue(), and setValue().
Referenced by mouseDoubleClickEvent(), setToDefault(), and PluginParameterBox::spinBoxChanged().
void AudioDial::setToDefault | ( | ) | [slot] |
Definition at line 425 of file AudioDial.cpp.
References m_defaultMappedValue, m_defaultValue, m_rangeMapper, setMappedValue(), and setValue().
Referenced by mousePressEvent().
void AudioDial::drawTick | ( | QPainter & | paint, |
float | angle, | ||
int | size, | ||
bool | internal | ||
) | [protected] |
Definition at line 291 of file AudioDial.cpp.
Referenced by paintEvent().
void AudioDial::paintEvent | ( | QPaintEvent * | ) | [protected, virtual] |
Definition at line 118 of file AudioDial.cpp.
References AUDIO_DIAL_MAX, AUDIO_DIAL_MIN, AUDIO_DIAL_RANGE, drawTick(), knobColor, m_knobColor, m_meterColor, and meterColor.
void AudioDial::mousePressEvent | ( | QMouseEvent * | pMouseEvent | ) | [protected, virtual] |
Definition at line 438 of file AudioDial.cpp.
References m_mouseDial, m_mousePressed, m_posMouse, and setToDefault().
void AudioDial::mouseMoveEvent | ( | QMouseEvent * | pMouseEvent | ) | [protected, virtual] |
Definition at line 527 of file AudioDial.cpp.
References m_mouseDial, m_mousePressed, m_posMouse, and setValue().
void AudioDial::mouseReleaseEvent | ( | QMouseEvent * | pMouseEvent | ) | [protected, virtual] |
Definition at line 547 of file AudioDial.cpp.
References m_mouseDial, and m_mousePressed.
void AudioDial::mouseDoubleClickEvent | ( | QMouseEvent * | pMouseEvent | ) | [protected, virtual] |
!! needs a common base class with Thumbwheel
Definition at line 453 of file AudioDial.cpp.
References m_mappedValue, m_mouseDial, m_rangeMapper, setMappedValue(), and setValue().
void AudioDial::enterEvent | ( | QEvent * | e | ) | [protected, virtual] |
Definition at line 557 of file AudioDial.cpp.
References mouseEntered().
Referenced by leaveEvent().
void AudioDial::leaveEvent | ( | QEvent * | e | ) | [protected, virtual] |
Definition at line 564 of file AudioDial.cpp.
References enterEvent(), and mouseLeft().
void AudioDial::updateMappedValue | ( | int | value | ) | [protected, slot] |
Definition at line 400 of file AudioDial.cpp.
References m_mappedValue, m_noMappedUpdate, m_rangeMapper, and m_showTooltip.
Referenced by setRangeMapper(), setShowToolTip(), and setValue().
QColor AudioDial::m_knobColor [private] |
Definition at line 132 of file AudioDial.h.
Referenced by getKnobColor(), paintEvent(), and setKnobColor().
QColor AudioDial::m_meterColor [private] |
Definition at line 133 of file AudioDial.h.
Referenced by getMeterColor(), paintEvent(), and setMeterColor().
int AudioDial::m_defaultValue [private] |
Definition at line 135 of file AudioDial.h.
Referenced by defaultValue(), setDefaultMappedValue(), setDefaultValue(), and setToDefault().
float AudioDial::m_defaultMappedValue [private] |
Definition at line 136 of file AudioDial.h.
Referenced by setDefaultMappedValue(), setDefaultValue(), and setToDefault().
float AudioDial::m_mappedValue [private] |
Definition at line 137 of file AudioDial.h.
Referenced by mappedValue(), mouseDoubleClickEvent(), setMappedValue(), and updateMappedValue().
bool AudioDial::m_noMappedUpdate [private] |
Definition at line 138 of file AudioDial.h.
Referenced by setMappedValue(), setShowToolTip(), and updateMappedValue().
bool AudioDial::m_mouseDial [private] |
Definition at line 141 of file AudioDial.h.
Referenced by AudioDial(), getMouseDial(), mouseDoubleClickEvent(), mouseMoveEvent(), mousePressEvent(), mouseReleaseEvent(), and setMouseDial().
bool AudioDial::m_mousePressed [private] |
Definition at line 142 of file AudioDial.h.
Referenced by AudioDial(), mouseMoveEvent(), mousePressEvent(), and mouseReleaseEvent().
QPoint AudioDial::m_posMouse [private] |
Definition at line 143 of file AudioDial.h.
Referenced by mouseMoveEvent(), and mousePressEvent().
bool AudioDial::m_showTooltip [private] |
Definition at line 145 of file AudioDial.h.
Referenced by setShowToolTip(), and updateMappedValue().
RangeMapper* AudioDial::m_rangeMapper [private] |
Definition at line 147 of file AudioDial.h.
Referenced by mappedValue(), mouseDoubleClickEvent(), rangeMapper(), setDefaultMappedValue(), setDefaultValue(), setMappedValue(), setRangeMapper(), setToDefault(), updateMappedValue(), and ~AudioDial().
QColor AudioDial::knobColor [read, write] |
Definition at line 62 of file AudioDial.h.
Referenced by paintEvent().
QColor AudioDial::meterColor [read, write] |
Definition at line 63 of file AudioDial.h.
Referenced by paintEvent().
bool AudioDial::mouseDial [read, write] |
Definition at line 64 of file AudioDial.h.
Referenced by setMouseDial().