Sound Meter 0.9.0
Fully resizing logarithmic JUCE meter module.
Loading...
Searching...
No Matches
sd::SoundMeter::Segment Class Referencefinal

#include <sd_MeterSegment.h>

Public Member Functions

 Segment (const Options &meterOptions, const SegmentOptions &segmentOptions)
 Construct a segment using the supplied options. More...
 
void setLevel (float level_db)
 Set the level in decibels. More...
 
void draw (juce::Graphics &g, const MeterColours &meterColours)
 Draw the segment. More...
 
void setMeterBounds (juce::Rectangle< int > meterBounds)
 Set the bounds of the total meter (all segments) More...
 
juce::Rectangle< int > getSegmentBounds () const noexcept
 Get the bounding box of this segment. More...
 
void resetPeakHold () noexcept
 Reset the peak hold. More...
 
float getPeakHold () const noexcept
 Get the peak hold level. More...
 
bool isDirty () const noexcept
 Check if the segment needs to be re-drawn (dirty). More...
 
void setIsLabelStrip (bool isLabelStrip=false) noexcept
 Set whether this meter is a label strip. More...
 
void setMinimalMode (bool minimalMode) noexcept
 Set the meter in 'minimal' mode. More...
 
void setSegmentOptions (SegmentOptions segmentOptions)
 Set the segment options, describing the range and colour of the segment. More...
 
SegmentOptions getSegmentOptions () const noexcept
 Get the segment options, describing the range and colour of the segment. More...
 
void setMeterOptions (const Options &meterOptions)
 Set meter options. More...
 
Options getMeterOptions () const
 Get segment options. More...
 

Constructor & Destructor Documentation

◆ Segment()

sd::SoundMeter::Segment::Segment ( const Options meterOptions,
const SegmentOptions segmentOptions 
)

Construct a segment using the supplied options.

References setMeterOptions(), and setSegmentOptions().

Member Function Documentation

◆ setLevel()

void sd::SoundMeter::Segment::setLevel ( float  level_db)

Set the level in decibels.

◆ draw()

◆ setMeterBounds()

void sd::SoundMeter::Segment::setMeterBounds ( juce::Rectangle< int >  meterBounds)

◆ getSegmentBounds()

juce::Rectangle< int > sd::SoundMeter::Segment::getSegmentBounds ( ) const
noexcept

Get the bounding box of this segment.

◆ resetPeakHold()

void sd::SoundMeter::Segment::resetPeakHold ( )
noexcept

Reset the peak hold.

References sd::SoundMeter::Constants::kMinLevel_db.

◆ getPeakHold()

float sd::SoundMeter::Segment::getPeakHold ( ) const
noexcept

Get the peak hold level.

◆ isDirty()

bool sd::SoundMeter::Segment::isDirty ( ) const
noexcept

Check if the segment needs to be re-drawn (dirty).

◆ setIsLabelStrip()

void sd::SoundMeter::Segment::setIsLabelStrip ( bool  isLabelStrip = false)
noexcept

Set whether this meter is a label strip.

A label strip only draws the value labels (at the tick-marks), but does not display any level.

Parameters
isLabelStripwhen set, this meter behave like a label strip.

◆ setMinimalMode()

void sd::SoundMeter::Segment::setMinimalMode ( bool  minimalMode)
noexcept

Set the meter in 'minimal' mode.

In minimal mode, the meter is in it's cleanest state possible. This means no header, no tick-marks, no value, no faders and no indicator.

Parameters
minimalModeWhen set to true, 'minimal' mode will be enabled.
See also
isMinimalModeActive, autoSetMinimalMode

◆ setSegmentOptions()

void sd::SoundMeter::Segment::setSegmentOptions ( SegmentOptions  segmentOptions)

Set the segment options, describing the range and colour of the segment.

References sd::SoundMeter::SegmentOptions::levelRange, sd::SoundMeter::SegmentOptions::meterRange, and setMeterBounds().

Referenced by Segment().

◆ getSegmentOptions()

SegmentOptions sd::SoundMeter::Segment::getSegmentOptions ( ) const
noexcept

Get the segment options, describing the range and colour of the segment.

◆ setMeterOptions()

void sd::SoundMeter::Segment::setMeterOptions ( const Options meterOptions)

◆ getMeterOptions()

Options sd::SoundMeter::Segment::getMeterOptions ( ) const

Get segment options.


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