|
lmms
Cross-platform music production software
|
#include <Fader.h>
Public Types | |
| enum class | AdjustmentDirection { Up , Down } |
Signals | |
| void | peakChanged (float peak) |
Public Member Functions | |
| Fader (FloatModel *model, const QString &name, QWidget *parent, bool modelIsLinear=true) | |
| Fader (FloatModel *model, const QString &name, QWidget *parent, const QPixmap &knob, bool modelIsLinear=true) | |
| ~Fader () override=default | |
| void | setPeak_L (float fPeak) |
| float | getPeak_L () |
| void | setPeak_R (float fPeak) |
| float | getPeak_R () |
| float | getMinPeak () const |
| void | setMinPeak (float minPeak) |
| float | getMaxPeak () const |
| void | setMaxPeak (float maxPeak) |
| bool | getRenderUnityLine () const |
| void | setRenderUnityLine (bool value=true) |
| void | adjust (const Qt::KeyboardModifiers &modifiers, AdjustmentDirection direction) |
| void | adjustByDecibelDelta (float value) |
| void | adjustByDialog () |
| void | setDisplayConversion (bool b) |
| void | setHintText (const QString &txt_before, const QString &txt_after) |
| Public Member Functions inherited from lmms::gui::TypedModelView< FloatModel > | |
| TypedModelView (Model *model, QWidget *_this) | |
| FloatModel * | model () |
| const FloatModel * | model () const |
| Public Member Functions inherited from lmms::gui::AutomatableModelView | |
| AutomatableModelView (Model *model, QWidget *_this) | |
| ~AutomatableModelView () override=default | |
| AutomatableModel * | modelUntyped () |
| const AutomatableModel * | modelUntyped () const |
| void | setModel (Model *model, bool isOldModelValid=true) override |
| void | unsetModel () override |
| template<typename T> | |
| T | value () const |
| void | setDescription (const QString &desc) |
| void | setUnit (const QString &unit) |
| void | addDefaultActions (QMenu *menu) |
| void | setConversionFactor (float factor) |
| float | getConversionFactor () |
| Public Member Functions inherited from lmms::gui::ModelView | |
| ModelView (Model *model, QWidget *widget) | |
| virtual | ~ModelView () |
| Model * | model () |
| const Model * | model () const |
| template<class T> | |
| T * | castModel () |
| template<class T> | |
| const T * | castModel () const |
Properties | |
| QColor | peakOk |
| QColor | peakClip |
| QColor | peakWarn |
| bool | levelsDisplayedInDBFS |
| bool | renderUnityLine |
| QColor | unityMarker |
Private Member Functions | |
| void | contextMenuEvent (QContextMenuEvent *me) override |
| void | mousePressEvent (QMouseEvent *ev) override |
| void | mouseDoubleClickEvent (QMouseEvent *mouseEvent) override |
| void | mouseMoveEvent (QMouseEvent *ev) override |
| void | mouseReleaseEvent (QMouseEvent *me) override |
| void | wheelEvent (QWheelEvent *ev) override |
| void | paintEvent (QPaintEvent *ev) override |
| void | paintLevels (QPaintEvent *ev, QPainter &painter, bool linear=false) |
| void | paintFaderTicks (QPainter &painter) |
| float | determineAdjustmentDelta (const Qt::KeyboardModifiers &modifiers) const |
| void | adjustModelByDBDelta (float value) |
| int | calculateKnobPosYFromModel () const |
| void | setVolumeByLocalPixelValue (int y) |
| float | computeScaledRatio (float dBValue) const |
| Computes the scaled ratio between the maximum dB value supported by the model and the minimum dB value that's supported by the fader from the given actual dB value. | |
| void | setPeak (float fPeak, float &targetPeak, float &persistentPeak, QElapsedTimer &lastPeakTimer) |
| void | updateTextFloat () |
| void | modelValueChanged () |
| QString | getModelValueAsDbString () const |
| bool | modelIsLinear () const |
Private Attributes | |
| float | m_fPeakValue_L {0.} |
| float | m_fPeakValue_R {0.} |
| float | m_persistentPeak_L {0.} |
| float | m_persistentPeak_R {0.} |
| float | m_fMinPeak {dbfsToAmp(-42)} |
| float | m_fMaxPeak {dbfsToAmp(9)} |
| QElapsedTimer | m_lastPeakTimer_L |
| QElapsedTimer | m_lastPeakTimer_R |
| QPixmap | m_knob {embed::getIconPixmap("fader_knob")} |
| QSize | m_knobSize |
| int | m_knobCenterOffset {0} |
| Stores the offset to the knob center when the user drags the fader knob. | |
| bool | m_levelsDisplayedInDBFS {true} |
| bool | m_modelIsLinear {false} |
| QColor | m_peakOk {10, 212, 92} |
| QColor | m_peakClip {193, 32, 56} |
| QColor | m_peakWarn {214, 236, 82} |
| QColor | m_unityMarker {63, 63, 63, 255} |
| bool | m_renderUnityLine {true} |
Static Private Attributes | |
| static SimpleTextFloat * | s_textFloat = nullptr |
Additional Inherited Members | |
| Protected Member Functions inherited from lmms::gui::ModelView | |
| virtual void | modelChanged () |
| QWidget * | widget () |
| virtual void | doConnections () |
| Protected Attributes inherited from lmms::gui::AutomatableModelView | |
| QString | m_description |
| QString | m_unit |
| float | m_conversionFactor |
|
strong |
| lmms::gui::Fader::Fader | ( | FloatModel * | model, |
| const QString & | name, | ||
| QWidget * | parent, | ||
| bool | modelIsLinear = true ) |
| lmms::gui::Fader::Fader | ( | FloatModel * | model, |
| const QString & | name, | ||
| QWidget * | parent, | ||
| const QPixmap & | knob, | ||
| bool | modelIsLinear = true ) |
|
overridedefault |
| void lmms::gui::Fader::adjust | ( | const Qt::KeyboardModifiers & | modifiers, |
| AdjustmentDirection | direction ) |
| void lmms::gui::Fader::adjustByDecibelDelta | ( | float | value | ) |
| void lmms::gui::Fader::adjustByDialog | ( | ) |
|
private |
|
private |
|
private |
Computes the scaled ratio between the maximum dB value supported by the model and the minimum dB value that's supported by the fader from the given actual dB value.
If the provided input value lies inside the aforementioned interval then the result will be a value between 0 (value == minimum value) and 1 (value == maximum model value). If you look at the graphical representation of the fader then 0 represents a point at the bottom of the fader and 1 a point at the top of the fader. The ratio is scaled by an internal exponent which is an implementation detail that cannot be changed for now.
|
overrideprivate |
|
private |
|
inline |
|
inline |
|
private |
|
inline |
|
inline |
|
inline |
|
inlineprivate |
|
private |
|
overrideprivate |
|
overrideprivate |
|
overrideprivatevirtual |
Reimplemented from lmms::gui::AutomatableModelView.
|
overrideprivate |
|
overrideprivate |
|
private |
|
private |
|
signal |
|
inline |
|
inline |
|
inline |
|
inline |
|
private |
Set peak value (0.0 .. 1.0)
| void lmms::gui::Fader::setPeak_L | ( | float | fPeak | ) |
| void lmms::gui::Fader::setPeak_R | ( | float | fPeak | ) |
|
inline |
|
private |
|
private |
|
overrideprivate |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Stores the offset to the knob center when the user drags the fader knob.
This is needed to make it feel like the users drag the knob without it jumping immediately to the click position.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
staticprivate |
| bool lmms::gui::Fader::levelsDisplayedInDBFS |
| QColor lmms::gui::Fader::peakClip |
| QColor lmms::gui::Fader::peakOk |
| QColor lmms::gui::Fader::peakWarn |
|
readwrite |
| QColor lmms::gui::Fader::unityMarker |