Horizontal audio fader and meter widget. More...

#include <Fader.h>

Inheritance diagram for Fader:
Inheritance graph
Collaboration diagram for Fader:
Collaboration graph

Signals

void valueChanged (float)
 
void mouseEntered ()
 
void mouseLeft ()
 

Public Member Functions

 Fader (QWidget *parent, bool withoutKnob=false)
 Horizontal audio fader and meter widget. More...
 
 ~Fader ()
 
void setValue (float newValue)
 
float getValue ()
 
void setPeakLeft (float)
 
float getPeakLeft ()
 
void setPeakRight (float)
 
float getPeakRight ()
 

Protected Member Functions

void mousePressEvent (QMouseEvent *ev) override
 
void mouseDoubleClickEvent (QMouseEvent *ev) override
 
void mouseMoveEvent (QMouseEvent *ev) override
 
void mouseReleaseEvent (QMouseEvent *ev) override
 
void wheelEvent (QWheelEvent *ev) override
 
void paintEvent (QPaintEvent *ev) override
 
void enterEvent (QEvent *) override
 
void leaveEvent (QEvent *) override
 
int getMaxX () const
 

Protected Attributes

bool m_withoutKnob
 
float m_value
 
float m_peakLeft
 
float m_peakRight
 
bool m_mousePressed
 
int m_mousePressX
 
float m_mousePressValue
 
QPixmap m_back
 
QPixmap m_leds
 
QPixmap m_knob
 
QPixmap m_clip
 

Detailed Description

Horizontal audio fader and meter widget.

Based on the vertical fader and meter widget from:

Hydrogen Copyright(c) 2002-2005 by Alex >Comix< Cominu [comix.nosp@m.@use.nosp@m.rs.so.nosp@m.urce.nosp@m.forge.nosp@m..net] http://www.hydrogen-music.org

Definition at line 39 of file Fader.h.

Constructor & Destructor Documentation

Fader::Fader ( QWidget *  parent,
bool  withoutKnob = false 
)

Horizontal audio fader and meter widget.

Based on the vertical fader and meter widget from the Hydrogen drum machine. (Any poor taste that has crept in during the modifications for this application is entirely my own, however.) The following copyright notice applies to code from this file, and also to the files in icons/fader_*.png (also modified by me). –cc Hydrogen Copyright(c) 2002-2005 by Alex >Comix< Cominu [comix.nosp@m.@use.nosp@m.rs.so.nosp@m.urce.nosp@m.forge.nosp@m..net] http://www.hydrogen-music.org

Definition at line 45 of file Fader.cpp.

References m_back, m_clip, m_knob, and m_leds.

Fader::~Fader ( )

Definition at line 84 of file Fader.cpp.

Member Function Documentation

void Fader::setValue ( float  newValue)

Definition at line 204 of file Fader.cpp.

References m_value.

Referenced by mouseDoubleClickEvent(), mouseMoveEvent(), mousePressEvent(), and wheelEvent().

float Fader::getValue ( )

Definition at line 235 of file Fader.cpp.

References m_value.

Referenced by mousePressEvent(), and wheelEvent().

void Fader::setPeakLeft ( float  peak)

Definition at line 243 of file Fader.cpp.

References m_peakLeft.

float Fader::getPeakLeft ( )
inline

Definition at line 51 of file Fader.h.

References m_peakLeft, and setPeakRight().

void Fader::setPeakRight ( float  peak)

Definition at line 253 of file Fader.cpp.

References m_peakRight.

Referenced by getPeakLeft().

void Fader::valueChanged ( float  )
signal
void Fader::mouseEntered ( )
signal

Referenced by enterEvent(), and getPeakRight().

void Fader::mouseLeft ( )
signal

Referenced by getPeakRight(), and leaveEvent().

void Fader::mousePressEvent ( QMouseEvent *  ev)
overrideprotected

Definition at line 156 of file Fader.cpp.

References getValue(), m_mousePressed, m_mousePressValue, m_mousePressX, setValue(), and valueChanged().

Referenced by getPeakRight().

void Fader::mouseDoubleClickEvent ( QMouseEvent *  ev)
overrideprotected

Definition at line 132 of file Fader.cpp.

References getMaxX(), m_value, setValue(), and valueChanged().

Referenced by getPeakRight().

void Fader::mouseMoveEvent ( QMouseEvent *  ev)
overrideprotected
void Fader::mouseReleaseEvent ( QMouseEvent *  ev)
overrideprotected

Definition at line 123 of file Fader.cpp.

References m_mousePressed, and mouseMoveEvent().

Referenced by getPeakRight().

void Fader::wheelEvent ( QWheelEvent *  ev)
overrideprotected

!! needs improvement

Definition at line 175 of file Fader.cpp.

References getValue(), m_value, setValue(), and valueChanged().

Referenced by getPeakRight().

void Fader::paintEvent ( QPaintEvent *  ev)
overrideprotected

Definition at line 263 of file Fader.cpp.

References m_back, m_clip, m_knob, m_leds, m_peakLeft, m_peakRight, m_value, and m_withoutKnob.

Referenced by getPeakRight().

void Fader::enterEvent ( QEvent *  )
overrideprotected

Definition at line 192 of file Fader.cpp.

References mouseEntered().

Referenced by getPeakRight().

void Fader::leaveEvent ( QEvent *  )
overrideprotected

Definition at line 198 of file Fader.cpp.

References mouseLeft().

Referenced by getPeakRight().

int Fader::getMaxX ( ) const
protected

Definition at line 299 of file Fader.cpp.

Referenced by getPeakRight(), mouseDoubleClickEvent(), and mouseMoveEvent().

Member Data Documentation

bool Fader::m_withoutKnob
protected

Definition at line 74 of file Fader.h.

Referenced by paintEvent().

float Fader::m_value
protected

Definition at line 75 of file Fader.h.

Referenced by getValue(), mouseDoubleClickEvent(), paintEvent(), setValue(), and wheelEvent().

float Fader::m_peakLeft
protected

Definition at line 76 of file Fader.h.

Referenced by getPeakLeft(), paintEvent(), and setPeakLeft().

float Fader::m_peakRight
protected

Definition at line 77 of file Fader.h.

Referenced by getPeakRight(), paintEvent(), and setPeakRight().

bool Fader::m_mousePressed
protected

Definition at line 79 of file Fader.h.

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

int Fader::m_mousePressX
protected

Definition at line 80 of file Fader.h.

Referenced by mouseMoveEvent(), and mousePressEvent().

float Fader::m_mousePressValue
protected

Definition at line 81 of file Fader.h.

Referenced by mouseMoveEvent(), and mousePressEvent().

QPixmap Fader::m_back
protected

Definition at line 83 of file Fader.h.

Referenced by Fader(), and paintEvent().

QPixmap Fader::m_leds
protected

Definition at line 84 of file Fader.h.

Referenced by Fader(), and paintEvent().

QPixmap Fader::m_knob
protected

Definition at line 85 of file Fader.h.

Referenced by Fader(), and paintEvent().

QPixmap Fader::m_clip
protected

Definition at line 86 of file Fader.h.

Referenced by Fader(), and paintEvent().


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