svgui  1.9
AudioDial Class Reference

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>

List of all members.

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

Detailed Description

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.


Constructor & Destructor Documentation

AudioDial::AudioDial ( QWidget *  parent = 0)

Definition at line 75 of file AudioDial.cpp.

References m_mouseDial, and m_mousePressed.

Definition at line 93 of file AudioDial.cpp.

References m_rangeMapper.


Member Function Documentation

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.

const RangeMapper* AudioDial::rangeMapper ( ) const [inline]
int AudioDial::defaultValue ( ) const [inline]

Definition at line 78 of file AudioDial.h.

References m_defaultValue.

Referenced by setDefaultValue().

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::setDefaultMappedValue ( float  mappedValue) [slot]

Definition at line 353 of file AudioDial.cpp.

References m_defaultMappedValue, m_defaultValue, and m_rangeMapper.

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]
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().


Member Data Documentation

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().

Definition at line 135 of file AudioDial.h.

Referenced by defaultValue(), setDefaultMappedValue(), setDefaultValue(), and setToDefault().

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().

Definition at line 138 of file AudioDial.h.

Referenced by setMappedValue(), setShowToolTip(), and updateMappedValue().

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().


Property Documentation

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().


The documentation for this class was generated from the following files: