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

#include <FadeButton.h>

Inheritance diagram for lmms::gui::FadeButton:

Public Types

enum class  State { Normal , Corrupted }

Public Slots

void activate ()
void activateOnce ()
void noteEnd ()

Public Member Functions

 FadeButton (const QColor &inactiveColor, const QColor &normalColor, const QColor &corruptedColor, const QColor &mutedColor, const QColor &holdColor, QWidget *parent=nullptr)
 Creates a fade button with the given color palette.
 FadeButton (QWidget *parent=nullptr)
 Creates a fade button with the default application colors.
 ~FadeButton () override=default
 Destroys the fade button.
auto state () const -> State
auto muted () const -> bool
void setState (State state)
 Set the state of the fade button to state.
void setMuted (bool mute)
 Mute or unmute the fade button.

Private Member Functions

void paintEvent (QPaintEvent *pe) override
QColor fadeToColor (QColor, QColor, QElapsedTimer, float)
QColor activeColor () const

Private Attributes

State m_state = State::Normal
QElapsedTimer m_stateTimer
QElapsedTimer m_releaseTimer
QColor m_inactiveColor
QColor m_normalColor
QColor m_corruptedColor
QColor m_mutedColor
QColor m_holdColor
int activeNotes
bool m_muted = false

Member Enumeration Documentation

◆ State

enum class lmms::gui::FadeButton::State
strong
Enumerator
Normal 
Corrupted 

Constructor & Destructor Documentation

◆ FadeButton() [1/2]

lmms::gui::FadeButton::FadeButton ( const QColor & inactiveColor,
const QColor & normalColor,
const QColor & corruptedColor,
const QColor & mutedColor,
const QColor & holdColor,
QWidget * parent = nullptr )

Creates a fade button with the given color palette.

Parameters
inactiveColorThe default color for the widget
normalColorThe color to use on activation when in the Normal state
corruptedColorThe color to use on activation when in the Corrupted state
mutedColorThe color to use when the fade button is muted
holdColorThe color after the "play" fade is done but a note is still playing

◆ FadeButton() [2/2]

lmms::gui::FadeButton::FadeButton ( QWidget * parent = nullptr)

Creates a fade button with the default application colors.

◆ ~FadeButton()

lmms::gui::FadeButton::~FadeButton ( )
overridedefault

Destroys the fade button.

Member Function Documentation

◆ activate

void lmms::gui::FadeButton::activate ( )
slot

◆ activateOnce

void lmms::gui::FadeButton::activateOnce ( )
slot

◆ activeColor()

QColor lmms::gui::FadeButton::activeColor ( ) const
private

◆ fadeToColor()

QColor lmms::gui::FadeButton::fadeToColor ( QColor startCol,
QColor endCol,
QElapsedTimer timer,
float duration )
private

◆ muted()

auto lmms::gui::FadeButton::muted ( ) const -> bool
Returns
true if the fade button is muted.

◆ noteEnd

void lmms::gui::FadeButton::noteEnd ( )
slot

◆ paintEvent()

void lmms::gui::FadeButton::paintEvent ( QPaintEvent * pe)
overrideprivate

◆ setMuted()

void lmms::gui::FadeButton::setMuted ( bool mute)

Mute or unmute the fade button.

◆ setState()

void lmms::gui::FadeButton::setState ( State state)

Set the state of the fade button to state.

◆ state()

auto lmms::gui::FadeButton::state ( ) const -> State
Returns
the current state of the fade button.

Member Data Documentation

◆ activeNotes

int lmms::gui::FadeButton::activeNotes
private

◆ m_corruptedColor

QColor lmms::gui::FadeButton::m_corruptedColor
private

◆ m_holdColor

QColor lmms::gui::FadeButton::m_holdColor
private

◆ m_inactiveColor

QColor lmms::gui::FadeButton::m_inactiveColor
private

◆ m_muted

bool lmms::gui::FadeButton::m_muted = false
private

◆ m_mutedColor

QColor lmms::gui::FadeButton::m_mutedColor
private

◆ m_normalColor

QColor lmms::gui::FadeButton::m_normalColor
private

◆ m_releaseTimer

QElapsedTimer lmms::gui::FadeButton::m_releaseTimer
private

◆ m_state

State lmms::gui::FadeButton::m_state = State::Normal
private

◆ m_stateTimer

QElapsedTimer lmms::gui::FadeButton::m_stateTimer
private

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