#include <LevelMeter.h>
Inherits Component, and Timer.
Classes | |
| class | Listener |
| DEPRECATED: Instead of using the Listener, use the new lambdas: More... | |
| class | LookAndFeelMethods |
| These methods define a interface for the LookAndFeel class of juce. More... | |
Public Types | |
| enum | MeterFlags { Default = 0x0000 , Horizontal = 0x0001 , Vintage = 0x0002 , SingleChannel = 0x0004 , HasBorder = 0x0008 , Reduction = 0x0010 , Minimal = 0x0020 , MaxNumber = 0x0040 } |
| enum | ColourIds { lmTextColour = 0x2200001 , lmTextDeactiveColour , lmTextClipColour , lmTicksColour , lmOutlineColour , lmBackgroundColour , lmBackgroundClipColour , lmMeterForegroundColour , lmMeterOutlineColour , lmMeterBackgroundColour , lmMeterMaxNormalColour , lmMeterMaxWarnColour , lmMeterMaxOverColour , lmMeterGradientLowColour , lmMeterGradientMidColour , lmMeterGradientMaxColour , lmMeterReductionColour } |
Public Member Functions | |
| LevelMeter (MeterFlags type=HasBorder) | |
| ~LevelMeter () override | |
| void | setMeterFlags (MeterFlags type) |
| Allows to change the meter's configuration by setting a combination of MeterFlags. | |
| void | paint (juce::Graphics &) override |
| void | resized () override |
| void | visibilityChanged () override |
| void | timerCallback () override |
| void | setMeterSource (foleys::LevelMeterSource *source) |
| Set a LevelMeterSource to display. | |
| void | setSelectedChannel (int c) |
| Set a specific channel to display. | |
| void | setFixedNumChannels (int numChannels) |
| If you don't know, how many channels will be in the processblock, you can set this number to avoid stretching the width of the channels. | |
| void | setRefreshRateHz (int newRefreshRate) |
| void | clearClipIndicator (int channel=-1) |
| Unset the clip indicator flag for a channel. | |
| void | clearMaxLevelDisplay (int channel=-1) |
| Set the max level display back to -inf for a channel. | |
| void | mouseDown (const juce::MouseEvent &event) override |
| void | parentHierarchyChanged () override |
| void | lookAndFeelChanged () override |
| void | addListener (foleys::LevelMeter::Listener *) |
| void | removeListener (foleys::LevelMeter::Listener *) |
Public Attributes | |
| std::function< void(foleys::LevelMeter &meter, int channel, juce::ModifierKeys mods)> | onClipLightClicked |
| This lambda is called when the user clicks on a clip light. | |
| std::function< void(foleys::LevelMeter &meter, int channel, juce::ModifierKeys mods)> | onMaxLevelClicked |
| This lambda is called when the user clicks on a max level display. | |
| enum MeterFlags |
| Enumerator | |
|---|---|
| Default | Default is showing all channels in the LevelMeterSource without a border. |
| Horizontal | Displays the level bars horizontally. |
| Vintage | Switches to a special mode of old school meters (to come) |
| SingleChannel | Display only one channel meter.
|
| HasBorder | Displays a rounded border around the meter. This is used with the default constructor |
| Reduction | This turns the bar into a reduction bar. The additional reduction bar is automatically added, as soon a reduction value < 1.0 is set in the LevelMeterSource. |
| Minimal | For a stereo meter, this tries to save space by showing only one line tickmarks in the middle and no max numbers. |
| MaxNumber | To add level meter to Minimal, set this flag. |
| enum ColourIds |
| LevelMeter | ( | MeterFlags | type = HasBorder | ) |
|
override |
| void setMeterFlags | ( | MeterFlags | type | ) |
Allows to change the meter's configuration by setting a combination of MeterFlags.
|
override |
|
override |
|
override |
|
override |
| void setMeterSource | ( | foleys::LevelMeterSource * | source | ) |
Set a LevelMeterSource to display.
This separation is used, so the source can work in the processing and the GUI can display the values.
| void setSelectedChannel | ( | int | c | ) |
Set a specific channel to display.
This is only useful, if MeterFlags::SingleChannel is set.
| void setFixedNumChannels | ( | int | numChannels | ) |
If you don't know, how many channels will be in the processblock, you can set this number to avoid stretching the width of the channels.
| void setRefreshRateHz | ( | int | newRefreshRate | ) |
| void clearClipIndicator | ( | int | channel = -1 | ) |
Unset the clip indicator flag for a channel.
Use -1 to reset all clip indicators.
Referenced by LevelMeter::LevelMeter().
| void clearMaxLevelDisplay | ( | int | channel = -1 | ) |
Set the max level display back to -inf for a channel.
Use -1 to reset all max levels.
Referenced by LevelMeter::LevelMeter().
|
override |
References LevelMeter::Listener::clipLightClicked(), LevelMeter::LookAndFeelMethods::getMeterInnerBounds(), LevelMeter::LookAndFeelMethods::hitTestClipIndicator(), LevelMeter::LookAndFeelMethods::hitTestMaxNumber(), LevelMeter::Listener::maxLevelClicked(), LevelMeter::onClipLightClicked, and LevelMeter::onMaxLevelClicked.
|
override |
References LevelMeter::lookAndFeelChanged().
|
override |
Referenced by LevelMeter::LevelMeter(), and LevelMeter::parentHierarchyChanged().
| void addListener | ( | foleys::LevelMeter::Listener * | listener | ) |
| void removeListener | ( | foleys::LevelMeter::Listener * | listener | ) |
| std::function<void(foleys::LevelMeter& meter, int channel, juce::ModifierKeys mods)> onClipLightClicked |
This lambda is called when the user clicks on a clip light.
It is initially set to clear all clip lights and max level numbers.
Referenced by LevelMeter::LevelMeter(), and LevelMeter::mouseDown().
| std::function<void(foleys::LevelMeter& meter, int channel, juce::ModifierKeys mods)> onMaxLevelClicked |
This lambda is called when the user clicks on a max level display.
It is initially set to clear all clip lights and max level numbers.
Referenced by LevelMeter::LevelMeter(), and LevelMeter::mouseDown().