Audacity 3.2.0
Typedefs | Functions | Variables
anonymous_namespace{DynamicRangeProcessorEditor.cpp} Namespace Reference

Typedefs

using TFPanel = DynamicRangeProcessorTransferFunctionPanel
 
using HistPanel = DynamicRangeProcessorHistoryPanel
 

Functions

float GetDbRange (float maxCompressionDb)
 
DynamicRangeProcessorSettings GetSettings (EffectSettingsAccess &access)
 
auto MakeRulerPanel (wxWindow *parent, wxOrientation orientation, float dbRange, int id=wxID_ANY)
 
auto MapExponentially (double x)
 
auto MapExponentially (double min, double max, double x)
 
auto MapLogarithmically (double x)
 
auto MapLogarithmically (double min, double max, double x)
 
auto SliderToTextValue (double value, const ExtendedCompressorParameter &setting)
 
auto TextToSliderValue (ExtendedCompressorParameter &setting)
 

Variables

constexpr auto historyPanelId = wxID_HIGHEST + 1
 
constexpr auto historyRulerPanelId = wxID_HIGHEST + 2
 
constexpr auto transferFunctionPanelId = wxID_HIGHEST + 3
 
constexpr auto checkboxId = wxID_HIGHEST + 4
 
constexpr auto compressionMeterRulerPanelId = wxID_HIGHEST + 5
 
constexpr auto compressionMeterPanelId = wxID_HIGHEST + 6
 
constexpr auto clipIndicatorId = wxID_HIGHEST + 7
 
constexpr auto rulerWidth = 30
 
constexpr auto borderSize = 5
 
constexpr auto compressionMeterPanelWidth = 30
 
constexpr auto C = 5.
 

Typedef Documentation

◆ HistPanel

using anonymous_namespace{DynamicRangeProcessorEditor.cpp}::HistPanel = typedef DynamicRangeProcessorHistoryPanel

Definition at line 29 of file DynamicRangeProcessorEditor.cpp.

◆ TFPanel

using anonymous_namespace{DynamicRangeProcessorEditor.cpp}::TFPanel = typedef DynamicRangeProcessorTransferFunctionPanel

Definition at line 28 of file DynamicRangeProcessorEditor.cpp.

Function Documentation

◆ GetDbRange()

float anonymous_namespace{DynamicRangeProcessorEditor.cpp}::GetDbRange ( float  maxCompressionDb)

Definition at line 42 of file DynamicRangeProcessorEditor.cpp.

43{
44 constexpr auto minRange = 3.f;
45 return std::max(minRange, maxCompressionDb / 2);
46}

Referenced by DynamicRangeProcessorEditor::PopulateOrExchange().

Here is the caller graph for this function:

◆ GetSettings()

DynamicRangeProcessorSettings anonymous_namespace{DynamicRangeProcessorEditor.cpp}::GetSettings ( EffectSettingsAccess access)

Definition at line 48 of file DynamicRangeProcessorEditor.cpp.

49{
50 const CompressorSettings* compressorSettings =
51 access.Get().cast<CompressorSettings>();
52 const LimiterSettings* limiterSettings =
53 access.Get().cast<LimiterSettings>();
54 return compressorSettings ?
55 DynamicRangeProcessorSettings { *compressorSettings } :
56 DynamicRangeProcessorSettings { *limiterSettings };
57}
virtual const EffectSettings & Get()=0
const T * cast() const noexcept
Like pointer-valued any_cast but a non-static member function.
Definition: TypedAny.h:68

References audacity::TypedAny< Tag >::cast(), and EffectSettingsAccess::Get().

Referenced by LV2Editor::BuildPlain(), LV2EffectBase::CopySettingsContents(), EVT_COMMAND_RANGE(), LadspaInstance::GetLatency(), LadspaInstance::GetSettings(), LV2EffectBase::LoadFactoryPreset(), LV2EffectBase::LoadSettings(), LV2Instance::MakeMaster(), LV2EffectBase::MakeSettings(), LV2Instance::MakeWrapper(), LV2Editor::OnChoice(), LV2Editor::OnIdle(), LV2Editor::OnSlider(), LV2Editor::OnText(), LV2Editor::OnToggle(), LV2Editor::OnTrigger(), DynamicRangeProcessorEditor::PopulateOrExchange(), LV2Instance::RealtimeAddProcessor(), LV2EffectBase::SaveSettings(), LV2Editor::suil_port_write(), LV2Editor::UpdateUI(), and anonymous_namespace{LoadLV2.cpp}::LV2PluginValidator::Validate().

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

◆ MakeRulerPanel()

auto anonymous_namespace{DynamicRangeProcessorEditor.cpp}::MakeRulerPanel ( wxWindow *  parent,
wxOrientation  orientation,
float  dbRange,
int  id = wxID_ANY 
)

Definition at line 59 of file DynamicRangeProcessorEditor.cpp.

62{
63 // Overridden by `.MinSize()` calls
64 const wxSize minSize { -1, -1 };
65
66 return safenew RulerPanel(
67 parent, id, orientation, minSize,
68 orientation == wxVERTICAL ? RulerPanel::Range { 0.0, -dbRange } :
69 RulerPanel::Range { -dbRange, 0.0 },
72 .LabelEdges(false)
73 .TicksAtExtremes(true)
74 .Flip(orientation == wxVERTICAL)
75 .TickColour(theTheme.Colour(clrGraphLabels)));
76}
XO("Cut/Copy/Paste")
#define safenew
Definition: MemoryX.h:10
THEME_API Theme theTheme
Definition: Theme.cpp:82
static const LinearDBFormat & Instance()
RulerPanel class allows you to work with a Ruler like any other wxWindow.
Definition: RulerPanel.h:19
std::pair< double, double > Range
Definition: RulerPanel.h:23
wxColour & Colour(int iIndex)
Options & TickColour(const wxColour c)
Definition: RulerPanel.h:47
Options & TicksAtExtremes(bool t)
Definition: RulerPanel.h:44
Options & LabelEdges(bool l)
Definition: RulerPanel.h:41
Options & Flip(bool f)
Definition: RulerPanel.h:38

References ThemeBase::Colour(), RulerPanel::Options::Flip(), LinearDBFormat::Instance(), RulerPanel::Options::LabelEdges(), safenew, theTheme, RulerPanel::Options::TickColour(), RulerPanel::Options::TicksAtExtremes(), and XO().

Referenced by DynamicRangeProcessorEditor::AddCompressionCurvePanel(), and DynamicRangeProcessorEditor::PopulateOrExchange().

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

◆ MapExponentially() [1/2]

auto anonymous_namespace{DynamicRangeProcessorEditor.cpp}::MapExponentially ( double  min,
double  max,
double  x 
)

Definition at line 86 of file DynamicRangeProcessorEditor.cpp.

87{
88 // Map min and max to 0 and 1, and x accordingly, before applying
89 // exponential, or we may run into NaNs.
90 const auto a = 1.0 / (max - min);
91 const auto b = -min / (max - min);
92 const auto result = (MapExponentially(a * x + b) - b) / a;
93 // MH: Because we're using NumValidatorStyle::ONE_TRAILING_ZERO, we also
94 // quantize here to 0.1. (I think that's why.)
95 return std::round(result * 10) / 10;
96}
int min(int a, int b)
fastfloat_really_inline void round(adjusted_mantissa &am, callback cb) noexcept
Definition: fast_float.h:2512

References MapExponentially(), min(), and fast_float::round().

Referenced by MapExponentially(), and SliderToTextValue().

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

◆ MapExponentially() [2/2]

auto anonymous_namespace{DynamicRangeProcessorEditor.cpp}::MapExponentially ( double  x)

Definition at line 81 of file DynamicRangeProcessorEditor.cpp.

82{
83 return (std::exp(C * x) - 1) / (std::exp(C) - 1.);
84}

References C.

◆ MapLogarithmically() [1/2]

auto anonymous_namespace{DynamicRangeProcessorEditor.cpp}::MapLogarithmically ( double  min,
double  max,
double  x 
)

Definition at line 103 of file DynamicRangeProcessorEditor.cpp.

104{
105 const auto a = 1.0 / (max - min);
106 const auto b = -min / (max - min);
107 return (MapLogarithmically(a * x + b) - b) / a;
108}

References MapLogarithmically(), and min().

Referenced by MapLogarithmically(), and TextToSliderValue().

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

◆ MapLogarithmically() [2/2]

auto anonymous_namespace{DynamicRangeProcessorEditor.cpp}::MapLogarithmically ( double  x)

Definition at line 98 of file DynamicRangeProcessorEditor.cpp.

99{
100 return (std::log(x * (std::exp(C) - 1) + 1)) / C;
101}

References C.

◆ SliderToTextValue()

auto anonymous_namespace{DynamicRangeProcessorEditor.cpp}::SliderToTextValue ( double  value,
const ExtendedCompressorParameter setting 
)

Definition at line 110 of file DynamicRangeProcessorEditor.cpp.

111{
112 const auto scaled = value / setting.param->TextToSlider();
113 return setting.attributes.exponentialSlider ?
115 setting.param->SliderMin(), setting.param->SliderMax(),
116 scaled) :
117 scaled;
118}
const std::shared_ptr< DynamicRangeProcessorParameter > param
const DynamicRangeProcessorParameterAttributes & attributes

References ExtendedCompressorParameter::attributes, DynamicRangeProcessorParameterAttributes::exponentialSlider, MapExponentially(), and ExtendedCompressorParameter::param.

Referenced by DynamicRangeProcessorEditor::AddTextboxAndSlider().

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

◆ TextToSliderValue()

auto anonymous_namespace{DynamicRangeProcessorEditor.cpp}::TextToSliderValue ( ExtendedCompressorParameter setting)

Definition at line 120 of file DynamicRangeProcessorEditor.cpp.

121{
122 const auto unscaled = setting.attributes.exponentialSlider ?
124 setting.param->SliderMin(),
125 setting.param->SliderMax(), setting.value) :
126 setting.value;
127 return unscaled * setting.param->TextToSlider();
128}

References ExtendedCompressorParameter::attributes, DynamicRangeProcessorParameterAttributes::exponentialSlider, MapLogarithmically(), ExtendedCompressorParameter::param, and ExtendedCompressorParameter::value.

Referenced by DynamicRangeProcessorEditor::AddTextboxAndSlider(), and DynamicRangeProcessorEditor::UpdateUI().

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

Variable Documentation

◆ borderSize

constexpr auto anonymous_namespace{DynamicRangeProcessorEditor.cpp}::borderSize = 5
constexpr

◆ C

constexpr auto anonymous_namespace{DynamicRangeProcessorEditor.cpp}::C = 5.
constexpr

◆ checkboxId

constexpr auto anonymous_namespace{DynamicRangeProcessorEditor.cpp}::checkboxId = wxID_HIGHEST + 4
constexpr

Definition at line 34 of file DynamicRangeProcessorEditor.cpp.

◆ clipIndicatorId

constexpr auto anonymous_namespace{DynamicRangeProcessorEditor.cpp}::clipIndicatorId = wxID_HIGHEST + 7
constexpr

◆ compressionMeterPanelId

constexpr auto anonymous_namespace{DynamicRangeProcessorEditor.cpp}::compressionMeterPanelId = wxID_HIGHEST + 6
constexpr

◆ compressionMeterPanelWidth

constexpr auto anonymous_namespace{DynamicRangeProcessorEditor.cpp}::compressionMeterPanelWidth = 30
constexpr

◆ compressionMeterRulerPanelId

constexpr auto anonymous_namespace{DynamicRangeProcessorEditor.cpp}::compressionMeterRulerPanelId = wxID_HIGHEST + 5
constexpr

◆ historyPanelId

constexpr auto anonymous_namespace{DynamicRangeProcessorEditor.cpp}::historyPanelId = wxID_HIGHEST + 1
constexpr

◆ historyRulerPanelId

constexpr auto anonymous_namespace{DynamicRangeProcessorEditor.cpp}::historyRulerPanelId = wxID_HIGHEST + 2
constexpr

◆ rulerWidth

constexpr auto anonymous_namespace{DynamicRangeProcessorEditor.cpp}::rulerWidth = 30
constexpr

◆ transferFunctionPanelId

constexpr auto anonymous_namespace{DynamicRangeProcessorEditor.cpp}::transferFunctionPanelId = wxID_HIGHEST + 3
constexpr