Audacity 3.2.0
CompressorEditor.cpp
Go to the documentation of this file.
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*!********************************************************************
3
4 Audacity: A Digital Audio Editor
5
6 CompressorEditor.cpp
7
8 Matthieu Hodgkinson
9
10**********************************************************************/
11#include "CompressorEditor.h"
12#include "CompressorInstance.h"
13#include "ShuttleGui.h"
14
15namespace
16{
17static constexpr auto lookaheadMinMs = 0.;
18static constexpr auto lookaheadMaxMs = 1000.;
19static constexpr auto compressionRatioMax = 20.;
20
22{
23public:
25 : mParameter { parameter }
26 {
27 }
28
29 double Min() const override
30 {
31 return mParameter.min / mParameter.scale;
32 }
33
34 double Max() const override
35 {
36 return mParameter.max / mParameter.scale;
37 }
38
39 double SliderMin() const override
40 {
41 return mParameter.min;
42 }
43
44 double SliderMax() const override
45 {
46 return mParameter.max;
47 }
48
49 double TextToSlider() const override
50 {
51 return mParameter.scale;
52 }
53
55};
56} // namespace
57
59 wxWindow* parent, CompressorInstance& instance, bool isRealtime,
60 const EffectUIServices& services, EffectSettingsAccess& access,
62 : DynamicRangeProcessorEditor { parent, instance, isRealtime, services,
63 access }
64 , mSettings { std::move(settings) }
65{
67 std::make_shared<ParameterWrapper>(thresholdDb),
70 std::make_shared<ParameterWrapper>(makeupGainDb),
73 std::make_shared<ParameterWrapper>(kneeWidthDb),
76 std::make_shared<ParameterWrapper>(compressionRatio),
79 std::make_shared<ParameterWrapper>(lookaheadMs),
82 std::make_shared<ParameterWrapper>(attackMs),
85 std::make_shared<ParameterWrapper>(releaseMs),
87}
static const DynamicRangeProcessorParameterAttributes compressorMakupGainDbAttributes
static const DynamicRangeProcessorParameterAttributes compressionRatioAttributes
static const DynamicRangeProcessorParameterAttributes lookaheadMsAttributes
static const DynamicRangeProcessorParameterAttributes kneeWidthDbAttributes
static const DynamicRangeProcessorParameterAttributes attackMsAttributes
static const DynamicRangeProcessorParameterAttributes compressorThresholdDbAttributes
static const DynamicRangeProcessorParameterAttributes releaseMsAttributes
static Settings & settings()
Definition: TrackInfo.cpp:51
static constexpr CompressorParameter releaseMs
static constexpr CompressorParameter compressionRatio
static constexpr CompressorParameter thresholdDb
CompressorSettings mSettings
static constexpr CompressorParameter lookaheadMs
CompressorEditor(wxWindow *parent, CompressorInstance &instance, bool isRealtime, const EffectUIServices &services, EffectSettingsAccess &access, CompressorSettings settings)
static constexpr CompressorParameter makeupGainDb
static constexpr CompressorParameter attackMs
static constexpr CompressorParameter kneeWidthDb
void Initialize(std::vector< ExtendedCompressorParameter > parameters)
STL namespace.