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>

Inheritance diagram for AudioDial:
Collaboration diagram for AudioDial:

Public Slots

void setKnobColor (const QColor &color)
 Set the colour of the knob. More...
 
void setMeterColor (const QColor &color)
 Set the colour of the meter (the highlighted area around the knob that shows the current value). More...
 
void setMouseDial (bool mouseDial)
 Specify that the dial should respond to radial mouse movements in the same way as QDial. More...
 
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::AudioDial ( QWidget *  parent = 0)

Definition at line 75 of file AudioDial.cpp.

References m_mouseDial, and m_mousePressed.

◆ ~AudioDial()

AudioDial::~AudioDial ( void  )

Definition at line 93 of file AudioDial.cpp.

References m_rangeMapper.

Member Function Documentation

◆ getKnobColor()

const QColor& AudioDial::getKnobColor ( ) const
inline

Definition at line 70 of file AudioDial.h.

References m_knobColor.

◆ getMeterColor()

const QColor& AudioDial::getMeterColor ( ) const
inline

Definition at line 71 of file AudioDial.h.

References m_meterColor.

◆ getMouseDial()

bool AudioDial::getMouseDial ( ) const
inline

Definition at line 72 of file AudioDial.h.

References m_mouseDial.

◆ setRangeMapper()

void AudioDial::setRangeMapper ( RangeMapper *  mapper)

◆ rangeMapper()

const RangeMapper* AudioDial::rangeMapper ( ) const
inline

◆ mappedValue()

float AudioDial::mappedValue ( ) const

◆ defaultValue()

int AudioDial::defaultValue ( ) const
inline

Definition at line 78 of file AudioDial.h.

References m_defaultValue.

Referenced by setDefaultValue().

◆ setShowToolTip()

void AudioDial::setShowToolTip ( bool  show)

◆ mouseEntered

void AudioDial::mouseEntered ( )
signal

Referenced by enterEvent().

◆ mouseLeft

void AudioDial::mouseLeft ( )
signal

Referenced by leaveEvent().

◆ setKnobColor

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.

◆ setMeterColor

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

◆ setMouseDial

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.

◆ setDefaultValue

void AudioDial::setDefaultValue ( int  defaultValue)
slot

◆ setValue

◆ setDefaultMappedValue

void AudioDial::setDefaultMappedValue ( float  mappedValue)
slot

Definition at line 353 of file AudioDial.cpp.

References m_defaultMappedValue, m_defaultValue, and m_rangeMapper.

◆ setMappedValue

void AudioDial::setMappedValue ( float  mappedValue)
slot

◆ setToDefault

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

◆ drawTick()

void AudioDial::drawTick ( QPainter &  paint,
float  angle,
int  size,
bool  internal 
)
protected

Definition at line 291 of file AudioDial.cpp.

Referenced by paintEvent().

◆ paintEvent()

void AudioDial::paintEvent ( QPaintEvent *  )
protectedvirtual

◆ mousePressEvent()

void AudioDial::mousePressEvent ( QMouseEvent *  pMouseEvent)
protectedvirtual

Definition at line 438 of file AudioDial.cpp.

References m_mouseDial, m_mousePressed, m_posMouse, and setToDefault().

◆ mouseMoveEvent()

void AudioDial::mouseMoveEvent ( QMouseEvent *  pMouseEvent)
protectedvirtual

Definition at line 527 of file AudioDial.cpp.

References m_mouseDial, m_mousePressed, and m_posMouse.

◆ mouseReleaseEvent()

void AudioDial::mouseReleaseEvent ( QMouseEvent *  pMouseEvent)
protectedvirtual

Definition at line 547 of file AudioDial.cpp.

References m_mouseDial, and m_mousePressed.

◆ mouseDoubleClickEvent()

void AudioDial::mouseDoubleClickEvent ( QMouseEvent *  pMouseEvent)
protectedvirtual

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

◆ enterEvent()

void AudioDial::enterEvent ( QEvent *  e)
protectedvirtual

Definition at line 557 of file AudioDial.cpp.

References mouseEntered().

◆ leaveEvent()

void AudioDial::leaveEvent ( QEvent *  e)
protectedvirtual

Definition at line 564 of file AudioDial.cpp.

References mouseLeft().

◆ updateMappedValue

void AudioDial::updateMappedValue ( int  value)
protectedslot

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

◆ m_knobColor

QColor AudioDial::m_knobColor
private

Definition at line 132 of file AudioDial.h.

Referenced by getKnobColor(), paintEvent(), and setKnobColor().

◆ m_meterColor

QColor AudioDial::m_meterColor
private

Definition at line 133 of file AudioDial.h.

Referenced by getMeterColor(), paintEvent(), and setMeterColor().

◆ m_defaultValue

int AudioDial::m_defaultValue
private

Definition at line 135 of file AudioDial.h.

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

◆ m_defaultMappedValue

float AudioDial::m_defaultMappedValue
private

Definition at line 136 of file AudioDial.h.

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

◆ m_mappedValue

float AudioDial::m_mappedValue
private

Definition at line 137 of file AudioDial.h.

Referenced by mappedValue(), mouseDoubleClickEvent(), setMappedValue(), and updateMappedValue().

◆ m_noMappedUpdate

bool AudioDial::m_noMappedUpdate
private

Definition at line 138 of file AudioDial.h.

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

◆ m_mouseDial

bool AudioDial::m_mouseDial
private

◆ m_mousePressed

bool AudioDial::m_mousePressed
private

Definition at line 142 of file AudioDial.h.

Referenced by AudioDial(), mouseMoveEvent(), mousePressEvent(), and mouseReleaseEvent().

◆ m_posMouse

QPoint AudioDial::m_posMouse
private

Definition at line 143 of file AudioDial.h.

Referenced by mouseMoveEvent(), and mousePressEvent().

◆ m_showTooltip

bool AudioDial::m_showTooltip
private

Definition at line 145 of file AudioDial.h.

Referenced by setShowToolTip(), and updateMappedValue().

◆ m_rangeMapper

Property Documentation

◆ knobColor

QColor AudioDial::knobColor
readwrite

Definition at line 62 of file AudioDial.h.

Referenced by paintEvent().

◆ meterColor

QColor AudioDial::meterColor
readwrite

Definition at line 63 of file AudioDial.h.

Referenced by paintEvent().

◆ mouseDial

bool AudioDial::mouseDial
readwrite

Definition at line 64 of file AudioDial.h.

Referenced by setMouseDial().


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