Sound Meter 0.9.0
Fully resizing logarithmic JUCE meter module.
|
Class responsible for the fader. More...
#include <sd_MeterFader.h>
Public Member Functions | |
Fader ()=default | |
void | flash () noexcept |
Show the fader briefly and fade out (unless overridden and shown longer). More... | |
bool | isVisible () const noexcept |
Check if the fader is visible. More... | |
void | setVisible (bool visible=true) noexcept |
Show or hide the fader. More... | |
bool | isEnabled () const noexcept |
Check if the 'fader' overlay is enabled. More... | |
void | enable (bool enabled=true) noexcept |
Enable or disable the 'fader' overlay. More... | |
void | setBounds (const juce::Rectangle< int > &bounds) noexcept |
Set the fader bounds. More... | |
juce::Rectangle< int > | getBounds () const noexcept |
Get the fader bounds. More... | |
float | getValue () const noexcept |
Get the value of the meter fader. More... | |
bool | setValue (float value, NotificationOptions notificationOption=NotificationOptions::notify) |
Set fader value. More... | |
void | setValueFromPos (int position, NotificationOptions notificationOption=NotificationOptions::notify) |
Set fader value according to a supplied mouse position. More... | |
bool | isFading () const noexcept |
Check whether the fader is currently fading out. More... | |
void | draw (juce::Graphics &g, const MeterColours &meterColours) |
Draw the fader. More... | |
bool | needsRedrawing () noexcept |
Check if the fader needs redrawing. More... | |
Public Attributes | |
std::function< void()> | onFaderValueChanged { nullptr } |
Class responsible for the fader.
The fader overlay displayed on top of the 'meter' part (in combination with the 'mute' buttons in the 'header' part) can be used by the user to control gain or any other parameter.
|
default |
|
noexcept |
Show the fader briefly and fade out (unless overridden and shown longer).
|
noexcept |
Check if the fader is visible.
|
noexcept |
|
noexcept |
Check if the 'fader' overlay is enabled.
|
noexcept |
Enable or disable the 'fader' overlay.
enabled | True, when the fader needs to be enabled. |
|
noexcept |
|
noexcept |
|
noexcept |
Get the value of the meter fader.
Referenced by draw().
bool sd::SoundMeter::Fader::setValue | ( | float | value, |
NotificationOptions | notificationOption = NotificationOptions::notify |
||
) |
Set fader value.
value | The value [0..1] the fader needs to be set to. |
notificationOption | Select whether to notify the listeners. |
References sd::SoundMeter::notify, and onFaderValueChanged.
Referenced by setValueFromPos().
void sd::SoundMeter::Fader::setValueFromPos | ( | int | position, |
NotificationOptions | notificationOption = NotificationOptions::notify |
||
) |
Set fader value according to a supplied mouse position.
position | The mouse position (y coordinate) to use to calculate the fader value. |
notificationOption | Select whether to notify the listeners. |
References setValue().
|
noexcept |
Check whether the fader is currently fading out.
Referenced by needsRedrawing().
void sd::SoundMeter::Fader::draw | ( | juce::Graphics & | g, |
const MeterColours & | meterColours | ||
) |
Draw the fader.
[in,out] | g | The juce graphics context to use. |
meterColours | Colours to draw the fader with. |
References sd::SoundMeter::MeterColours::faderColour, getValue(), sd::SoundMeter::Constants::kFaderAlphaMax, and sd::SoundMeter::Constants::kFaderFadeTime_ms.
|
noexcept |
Check if the fader needs redrawing.
References isFading().
std::function<void()> sd::SoundMeter::Fader::onFaderValueChanged { nullptr } |
Referenced by setValue().