LMMS
Loading...
Searching...
No Matches
lmms::gui::VolumeKnob Class Reference

#include <Knob.h>

Inheritance diagram for lmms::gui::VolumeKnob:
lmms::gui::Knob lmms::gui::FloatModelEditorBase lmms::gui::TypedModelView< FloatModel > lmms::gui::AutomatableModelView lmms::gui::ModelView lmms::gui::OrganicVolumeKnob

Public Member Functions

auto zeroDbfsPoint () const -> float
 The value where the volume model is at 0 dBFS (default is 100).
void setZeroDbfsPoint (float zeroDbfsPoint)
 Knob (KnobType _knob_num, QWidget *_parent=nullptr, const QString &_name=QString())
 Construct a Knob with the given style and no label.
 Knob (KnobType knobNum, const QString &labelText, QWidget *parent=nullptr, LabelRendering labelRendering=LabelRendering::WidgetFont, const QString &name=QString())
 Construct a Knob with the given style and label text.
 Knob (KnobType knobNum, const QString &labelText, int labelPixelSize, QWidget *parent, const QString &name=QString())
 Constructs a knob with a label font in the pixel size.
 Knob (QWidget *_parent=nullptr, const QString &_name=QString())
 default ctor
 Knob (const Knob &other)=delete
Public Member Functions inherited from lmms::gui::Knob
 Knob (KnobType _knob_num, QWidget *_parent=nullptr, const QString &_name=QString())
 Construct a Knob with the given style and no label.
 Knob (KnobType knobNum, const QString &labelText, QWidget *parent=nullptr, LabelRendering labelRendering=LabelRendering::WidgetFont, const QString &name=QString())
 Construct a Knob with the given style and label text.
 Knob (KnobType knobNum, const QString &labelText, int labelPixelSize, QWidget *parent, const QString &name=QString())
 Constructs a knob with a label font in the pixel size.
 Knob (QWidget *_parent=nullptr, const QString &_name=QString())
 default ctor
 Knob (const Knob &other)=delete
const QString & getLabel () const
void setLabel (const QString &txt)
void setTotalAngle (float angle)
float innerRadius () const
void setInnerRadius (float r)
float outerRadius () const
void setOuterRadius (float r)
KnobType knobNum () const
void setknobNum (KnobType k)
QPointF centerPoint () const
float centerPointX () const
void setCenterPointX (float c)
float centerPointY () const
void setCenterPointY (float c)
float lineWidth () const
void setLineWidth (float w)
QColor outerColor () const
void setOuterColor (const QColor &c)
QColor textColor () const
void setTextColor (const QColor &c)
Public Member Functions inherited from lmms::gui::FloatModelEditorBase
 FloatModelEditorBase (DirectionOfManipulation directionOfManipulation=DirectionOfManipulation::Vertical, QWidget *_parent=nullptr, const QString &_name=QString())
 default ctor
 FloatModelEditorBase (const FloatModelEditorBase &other)=delete
void setHintText (const QString &txt_before, const QString &txt_after)
void setToolTip (const QString &tip)
 Sets the tooltip displayed when the mouse hovers over the control.
QString toolTip () const
void unsetToolTip ()
Public Member Functions inherited from lmms::gui::TypedModelView< FloatModel >
 TypedModelView (Model *model, QWidget *_this)
FloatModelmodel ()
const FloatModelmodel () const
Public Member Functions inherited from lmms::gui::AutomatableModelView
 AutomatableModelView (Model *model, QWidget *_this)
 ~AutomatableModelView () override=default
AutomatableModelmodelUntyped ()
const AutomatableModelmodelUntyped () const
void setModel (Model *model, bool isOldModelValid=true) override
void unsetModel () override
template<typename 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 ()
Modelmodel ()
const Modelmodel () const
template<class T>
T * castModel ()
template<class T>
const T * castModel () const

Protected Member Functions

QString currentValueToText () override
QString getDynamicFloatingText (const QString &currentValue) const
 Provides the text to be shown in dynamic floating text.
void enterValue () override
Protected Member Functions inherited from lmms::gui::Knob
void paintEvent (QPaintEvent *) override
void changeEvent (QEvent *ev) override
bool fixedFontSizeLabelRendering () const
void setFixedFontSizeLabelRendering ()
Protected Member Functions inherited from lmms::gui::FloatModelEditorBase
void contextMenuEvent (QContextMenuEvent *me) override
void dragEnterEvent (QDragEnterEvent *dee) override
void dropEvent (QDropEvent *de) override
void focusOutEvent (QFocusEvent *fe) override
void mousePressEvent (QMouseEvent *me) override
void mouseReleaseEvent (QMouseEvent *me) override
void mouseMoveEvent (QMouseEvent *me) override
void mouseDoubleClickEvent (QMouseEvent *me) override
void paintEvent (QPaintEvent *me) override
void wheelEvent (QWheelEvent *me) override
void enterEvent (QEnterEvent *) override
void leaveEvent (QEvent *event) override
virtual float getValue (const QPoint &p)
virtual std::optional< QString > currentValueToTextUpdate ()
void doConnections () override
void showTextFloat (int msecBeforeDisplay, int msecDisplayTime, bool forceTextUpdate=false)
void showTextFloat (bool forceTextUpdate=false)
const SimpleTextFloattextFloat () const
void setPosition (const QPoint &p)
float pageSize () const
DirectionOfManipulation directionOfManipulation () const
InteractionType currentInteraction () const
void updateInteractionState (QEvent *event)
 Updates m_interaction based on the event and current state.
FloatingTextType floatingTextType () const
Protected Member Functions inherited from lmms::gui::ModelView
virtual void modelChanged ()
QWidget * widget ()

Private Attributes

float m_zeroDbfsPoint = 100.f

Additional Inherited Members

Public Types inherited from lmms::gui::Knob
enum class  LabelRendering { WidgetFont , LegacyFixedFontSize }
 Determines how the label of the knob is rendered. More...
Public Types inherited from lmms::gui::FloatModelEditorBase
enum class  DirectionOfManipulation : bool { Vertical , Horizontal }
Signals inherited from lmms::gui::FloatModelEditorBase
void sliderPressed ()
void sliderReleased ()
void sliderMoved (float value)
Protected Types inherited from lmms::gui::FloatModelEditorBase
enum class  InteractionType : std::uint8_t { None , MouseHover , MouseDrag , MouseWheel }
 Types of user interaction with the control. More...
enum class  FloatingTextType : std::uint8_t { None , Static , Dynamic }
Protected Attributes inherited from lmms::gui::FloatModelEditorBase
QPoint m_lastMousePos
 mouse position in last mouseMoveEvent
float m_leftOver
Protected Attributes inherited from lmms::gui::AutomatableModelView
QString m_description
QString m_unit
float m_conversionFactor
Properties inherited from lmms::gui::Knob
float innerRadius
float outerRadius
float centerPointX
float centerPointY
float lineWidth
QColor outerColor
QColor lineActiveColor
QColor lineInactiveColor
QColor arcActiveColor
QColor arcInactiveColor
KnobType knobNum
QColor textColor

Detailed Description

Volume knob specialization

Notes:

  • The units displayed in the tooltip and the enterValue() dialog box are hardcoded to dBFS, but units shown in the context menu must be set via setUnit(). Usually this should be "%".
  • The model's value of 0 must mean -inf dBFS and the value zeroDbfsPoint() (whose default is 100) must mean 0 dBFS.
  • Models with both positive and negative values are allowed. A negative value is assumed to have the same effect as its corresponding positive value, but with inverted phase. See Flanger's feedback knob for an example.

Member Function Documentation

◆ currentValueToText()

QString lmms::gui::VolumeKnob::currentValueToText ( )
overrideprotectedvirtual
Returns
the current value of the model as a string
Note
This method is called just prior to displaying dynamic floating text in order to set its value. If the currentValueToTextUpdate method is not overridden, this method is also called to periodically update the floating text.

Reimplemented from lmms::gui::FloatModelEditorBase.

◆ enterValue()

void lmms::gui::VolumeKnob::enterValue ( )
overrideprotectedvirtual

Reimplemented from lmms::gui::FloatModelEditorBase.

◆ getDynamicFloatingText()

QString lmms::gui::VolumeKnob::getDynamicFloatingText ( const QString & currentValue) const
protectedvirtual

Provides the text to be shown in dynamic floating text.

Parameters
currentValuetext from currentValueToText or currentValueToTextUpdate
Returns
formatted text to display in dynamic floating text
Note
The default format is: "[description] [current value][unit]"

Reimplemented from lmms::gui::FloatModelEditorBase.

◆ Knob() [1/5]

lmms::gui::Knob::Knob ( const Knob & other)
delete

◆ Knob() [2/5]

lmms::gui::Knob::Knob ( KnobType _knob_num,
QWidget * _parent = nullptr,
const QString & _name = QString() )

Construct a Knob with the given style and no label.

Parameters
_knob_numStyle of the knob
_parentParent widget
_nameObject name of the widget

◆ Knob() [3/5]

lmms::gui::Knob::Knob ( KnobType knobNum,
const QString & labelText,
int labelPixelSize,
QWidget * parent,
const QString & name = QString() )

Constructs a knob with a label font in the pixel size.

Parameters
knobNumStyle of the knob
labelTextText for the label
labelPixelSizePixel size for the label
parentParent widget
nameObject name of the widget

◆ Knob() [4/5]

lmms::gui::Knob::Knob ( KnobType knobNum,
const QString & labelText,
QWidget * parent = nullptr,
LabelRendering labelRendering = LabelRendering::WidgetFont,
const QString & name = QString() )

Construct a Knob with the given style and label text.

Parameters
knobNumStyle of the knob
labelTextText for the label
parentParent widget
labelRenderingDetermines if the label uses the widget font or a font with a fixed size of 12 pixels (LegacyFixedFontSize). The default is to use the widget font.
nameObject name of the widget

◆ Knob() [5/5]

lmms::gui::Knob::Knob ( QWidget * _parent = nullptr,
const QString & _name = QString() )

default ctor

◆ setZeroDbfsPoint()

void lmms::gui::VolumeKnob::setZeroDbfsPoint ( float zeroDbfsPoint)
inline

◆ zeroDbfsPoint()

auto lmms::gui::VolumeKnob::zeroDbfsPoint ( ) const -> float
inline

The value where the volume model is at 0 dBFS (default is 100).

Member Data Documentation

◆ m_zeroDbfsPoint

float lmms::gui::VolumeKnob::m_zeroDbfsPoint = 100.f
private

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