Audacity 3.2.0
Functions | Variables
DynamicRangeProcessorPanel Namespace Reference

Functions

std::unique_ptr< wxGraphicsContext > MakeGraphicsContext (const wxPaintDC &dc)
 
wxColor GetColorMix (const wxColor &a, const wxColor &b, double aWeight)
 
float GetGraphDbRange (int height)
 
wxGraphicsBrush GetGraphBackgroundBrush (wxGraphicsContext &gc, int height)
 
wxRect GetPanelRect (const wxPanelWrapper &panel)
 

Variables

static const wxColour backgroundColor { 43, 43, 75 }
 
static const wxColour attackColor { 255, 0, 0, 100 }
 
static const wxColour releaseColor { 190, 120, 255, 100 }
 
static const wxColour lineColor { 72, 72, 72 }
 
static const wxColour targetCompressionColor { 255, 255, 255 }
 
static const wxColour inputColor { 86, 86, 149 }
 
static const wxColour outputColor { 182, 182, 244, 70 }
 
static const wxColour actualCompressionColor { 252, 220, 151 }
 
static constexpr auto targetCompressionLineWidth = 2
 
static constexpr auto outputLineWidth = 2
 
static constexpr auto graphMinHeight = 270
 
static constexpr auto graphMinRangeDb = 20.f
 

Detailed Description


Audacity: A Digital Audio Editor

DynamicRangeProcessorPanelCommon.cpp

Matthieu Hodgkinson

Function Documentation

◆ GetColorMix()

wxColor DynamicRangeProcessorPanel::GetColorMix ( const wxColor &  a,
const wxColor &  b,
double  aWeight 
)

Definition at line 26 of file DynamicRangeProcessorPanelCommon.cpp.

27{
28 return wxColor(
29 a.Red() * aWeight + b.Red() * (1 - aWeight),
30 a.Green() * aWeight + b.Green() * (1 - aWeight),
31 a.Blue() * aWeight + b.Blue() * (1 - aWeight),
32 a.Alpha() * aWeight + b.Alpha() * (1 - aWeight));
33}

Referenced by anonymous_namespace{DynamicRangeProcessorTransferFunctionPanel.cpp}::GetBrush(), GetGraphBackgroundBrush(), ClipIndicatorPanel::OnPaint(), DynamicRangeProcessorHistoryPanel::OnPaint(), and CompressionMeterPanel::PaintMeter().

Here is the caller graph for this function:

◆ GetGraphBackgroundBrush()

wxGraphicsBrush DynamicRangeProcessorPanel::GetGraphBackgroundBrush ( wxGraphicsContext &  gc,
int  height 
)

Definition at line 41 of file DynamicRangeProcessorPanelCommon.cpp.

42{
43 // It looks like we're not going to use a gradient for the background after
44 // all, but keep the way we had it available for a while, in case we change
45 // our mind. (Whoever still sees this code in this state in the future please
46 // feel free to clean up.)
47 constexpr auto useGradient = false;
48 return useGradient ? gc.CreateLinearGradientBrush(
49 0, 0, 0, height, backgroundColor,
50 GetColorMix(backgroundColor, *wxWHITE, 0.75)) :
51 gc.CreateBrush(backgroundColor);
52}
wxColor GetColorMix(const wxColor &a, const wxColor &b, double aWeight)

References backgroundColor, and GetColorMix().

Referenced by CompressionMeterPanel::OnPaint(), and DynamicRangeProcessorHistoryPanel::OnPaint().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetGraphDbRange()

float DynamicRangeProcessorPanel::GetGraphDbRange ( int  height)

Definition at line 35 of file DynamicRangeProcessorPanelCommon.cpp.

36{
37 const auto factor = std::max(1.f, 1.f * height / graphMinHeight);
38 return factor * graphMinRangeDb;
39}

References graphMinHeight, and graphMinRangeDb.

Referenced by DynamicRangeProcessorHistoryPanel::OnPaint(), and DynamicRangeProcessorHistoryPanel::OnSize().

Here is the caller graph for this function:

◆ GetPanelRect()

wxRect DynamicRangeProcessorPanel::GetPanelRect ( const wxPanelWrapper panel)

Definition at line 54 of file DynamicRangeProcessorPanelCommon.cpp.

55{
56#ifndef __WXMAC__
57 return panel.GetClientRect();
58#else
59 auto rect = panel.GetClientRect();
60 rect.SetX(rect.GetX() + 1);
61 rect.SetY(rect.GetY() + 1);
62 rect.SetWidth(rect.GetWidth() - 1);
63 rect.SetHeight(rect.GetHeight() - 1);
64 return rect;
65#endif
66}

Referenced by ClipIndicatorPanel::OnPaint(), CompressionMeterPanel::OnPaint(), DynamicRangeProcessorHistoryPanel::OnPaint(), and DynamicRangeProcessorTransferFunctionPanel::OnPaint().

Here is the caller graph for this function:

◆ MakeGraphicsContext()

std::unique_ptr< wxGraphicsContext > DynamicRangeProcessorPanel::MakeGraphicsContext ( const wxPaintDC &  dc)

Definition at line 18 of file DynamicRangeProcessorPanelCommon.cpp.

19{
20 auto gc = wxGraphicsContext::Create(dc);
21 gc->SetAntialiasMode(wxANTIALIAS_DEFAULT);
22 gc->SetInterpolationQuality(wxINTERPOLATION_BEST);
23 return std::unique_ptr<wxGraphicsContext>(gc);
24}

Referenced by anonymous_namespace{DynamicRangeProcessorTransferFunctionPanel.cpp}::DrawTransferFunction(), CompressionMeterPanel::OnPaint(), DynamicRangeProcessorHistoryPanel::OnPaint(), and CompressionMeterPanel::PaintMeter().

Here is the caller graph for this function:

Variable Documentation

◆ actualCompressionColor

const wxColour DynamicRangeProcessorPanel::actualCompressionColor { 252, 220, 151 }
static

◆ attackColor

const wxColour DynamicRangeProcessorPanel::attackColor { 255, 0, 0, 100 }
static

◆ backgroundColor

const wxColour DynamicRangeProcessorPanel::backgroundColor { 43, 43, 75 }
static

◆ graphMinHeight

constexpr auto DynamicRangeProcessorPanel::graphMinHeight = 270
staticconstexpr

◆ graphMinRangeDb

constexpr auto DynamicRangeProcessorPanel::graphMinRangeDb = 20.f
staticconstexpr

◆ inputColor

const wxColour DynamicRangeProcessorPanel::inputColor { 86, 86, 149 }
static

◆ lineColor

const wxColour DynamicRangeProcessorPanel::lineColor { 72, 72, 72 }
static

◆ outputColor

const wxColour DynamicRangeProcessorPanel::outputColor { 182, 182, 244, 70 }
static

◆ outputLineWidth

constexpr auto DynamicRangeProcessorPanel::outputLineWidth = 2
staticconstexpr

Definition at line 33 of file DynamicRangeProcessorPanelCommon.h.

◆ releaseColor

const wxColour DynamicRangeProcessorPanel::releaseColor { 190, 120, 255, 100 }
static

◆ targetCompressionColor

const wxColour DynamicRangeProcessorPanel::targetCompressionColor { 255, 255, 255 }
static

◆ targetCompressionLineWidth

constexpr auto DynamicRangeProcessorPanel::targetCompressionLineWidth = 2
staticconstexpr