Audacity 3.2.0
DynamicRangeProcessorEffectUtils.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 DynamicRangeProcessorEffectUtils.cpp
7
8 Matthieu Hodgkinson
9
10**********************************************************************/
12#include "CompressorEditor.h"
13#include "CompressorInstance.h"
15#include "LimiterEditor.h"
16#include "ShuttleGui.h"
17
18namespace
19{
20template <typename EditorType, typename SettingType>
21std::unique_ptr<EffectEditor> MakeEditor(
23 const EffectUIServices& services, const EffectOutputs* pOutputs,
24 SettingType settings)
25{
26 auto& compressorInstance = *dynamic_cast<CompressorInstance*>(&instance);
27 const auto isRealtime = pOutputs != nullptr;
28 auto result = std::make_unique<EditorType>(
29 S.GetParent(), compressorInstance, isRealtime, services, access,
30 std::move(settings));
31 result->PopulateOrExchange(S);
32 return result;
33}
34} // namespace
35
36std::unique_ptr<EffectEditor>
39 const EffectUIServices& services, const EffectOutputs* pOutputs,
41{
42 return MakeEditor<CompressorEditor>(
43 S, instance, access, services, pOutputs, std::move(settings));
44}
45
46std::unique_ptr<EffectEditor>
49 const EffectUIServices& services, const EffectOutputs* pOutputs,
51{
52 return MakeEditor<LimiterEditor>(
53 S, instance, access, services, pOutputs, std::move(settings));
54}
#define S(N)
Definition: ToChars.cpp:64
static Settings & settings()
Definition: TrackInfo.cpp:51
Performs effect computation.
Hold values to send to effect output meters.
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:640
std::unique_ptr< EffectEditor > MakeCompressorEditor(ShuttleGui &S, EffectInstance &instance, EffectSettingsAccess &access, const EffectUIServices &services, const EffectOutputs *pOutputs, CompressorSettings settings)
std::unique_ptr< EffectEditor > MakeLimiterEditor(ShuttleGui &S, EffectInstance &instance, EffectSettingsAccess &access, const EffectUIServices &services, const EffectOutputs *pOutputs, LimiterSettings settings)
std::unique_ptr< EffectEditor > MakeEditor(ShuttleGui &S, EffectInstance &instance, EffectSettingsAccess &access, const EffectUIServices &services, const EffectOutputs *pOutputs, SettingType settings)