MCPcopy Create free account
hub / github.com/audacity/audacity / PopulateOrExchange

Method PopulateOrExchange

src/effects/DynamicRangeProcessorEditor.cpp:151–263  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149}
150
151void DynamicRangeProcessorEditor::PopulateOrExchange(ShuttleGui& S)
152{
153 S.SetBorder(borderSize);
154 S.AddSpace(0, borderSize);
155
156 const auto compressorSettings = GetCompressorSettings();
157 if (compressorSettings)
158 {
159 S.StartMultiColumn(2, wxEXPAND);
160 {
161 S.SetStretchyCol(0);
162 AddSliderPanel(S);
163 AddCompressionCurvePanel(S, *compressorSettings);
164 }
165 S.EndMultiColumn();
166 }
167 else
168 AddSliderPanel(S);
169
170 if (!mIsRealtime)
171 // Not a real-time effect editor, no need for a graph
172 return;
173
174 const auto settings = GetSettings(mAccess);
175
176 const auto rulerPanel = MakeRulerPanel(
177 mUIParent, wxVERTICAL,
178 GetDbRange(CompressorProcessor::GetMaxCompressionDb(settings)),
179 historyRulerPanelId);
180
181 const auto onDbRangeChanged = [this](float newDbRange) {
182 for (const auto id :
183 { historyRulerPanelId, compressionMeterRulerPanelId })
184 if (
185 const auto panel = dynamic_cast<RulerPanel*>(
186 wxWindow::FindWindowById(id, mUIParent)))
187 {
188 panel->ruler.SetRange(0., -newDbRange);
189 panel->Refresh();
190 }
191 if (
192 const auto compressionMeterPanel =
193 dynamic_cast<CompressionMeterPanel*>(
194 wxWindow::FindWindowById(compressionMeterPanelId, mUIParent)))
195 compressionMeterPanel->SetDbRange(newDbRange);
196 };
197
198 const auto histPanel = safenew HistPanel(
199 mUIParent, historyPanelId, mCompressorInstance, onDbRangeChanged);
200 histPanel->ShowInput(settings.showInput);
201 histPanel->ShowOutput(settings.showOutput);
202 histPanel->ShowActual(settings.showActual);
203 histPanel->ShowTarget(settings.showTarget);
204
205 S.StartMultiColumn(compressorSettings ? 3 : 1, wxEXPAND);
206 {
207 S.SetStretchyCol(0);
208 AddCheckboxPanel(S, settings);

Callers

nothing calls this directly

Calls 15

GetSettingsFunction · 0.85
MakeRulerPanelFunction · 0.85
GetDbRangeFunction · 0.85
SetStretchyColMethod · 0.80
ShowInputMethod · 0.80
ShowOutputMethod · 0.80
ShowActualMethod · 0.80
ShowTargetMethod · 0.80
SetStretchyRowMethod · 0.80
AddWindowMethod · 0.80
PositionMethod · 0.80

Tested by

no test coverage detected