MCPcopy Create free account
hub / github.com/aethersdr/AetherSDR / buildUI

Method buildUI

src/gui/ClientGateApplet.cpp:131–242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129}
130
131void ClientGateApplet::buildUI()
132{
133 setStyleSheet("QWidget { background: transparent; }");
134
135 auto* outer = new QVBoxLayout(this);
136 outer->setContentsMargins(4, 4, 4, 4);
137 outer->setSpacing(4);
138
139 m_curve = new ClientGateCurveWidget;
140 m_curve->setCompactMode(true);
141 m_curve->setMinimumHeight(90);
142 outer->addWidget(m_curve, 1);
143
144 m_grBar = new ClientGateGrBar;
145 outer->addWidget(m_grBar);
146
147 // Enable / Edit buttons removed — the CHAIN widget now handles
148 // bypass (single-click) and opens the editor (double-click).
149
150 // Five-knob tuning row — Thresh, Ratio, Attack, Release, Floor.
151 // Mappings mirror ClientGateEditor so turning a knob here gives
152 // identical DSP results.
153 {
154 auto* row = new QHBoxLayout;
155 row->setSpacing(4);
156
157 auto makeKnob = [](const QString& label) {
158 auto* k = new ClientCompKnob;
159 k->setLabel(label);
160 k->setCenterLabelMode(true);
161 k->setInlineEditEnabled(false);
162 k->setFixedSize(38, 48);
163 return k;
164 };
165
166 m_thresh = makeKnob("Thresh");
167 m_thresh->setRange(-80.0f, 0.0f);
168 m_thresh->setDefault(-40.0f);
169 m_thresh->setValueFromNorm([](float n) { return -80.0f + n * 80.0f; });
170 m_thresh->setNormFromValue([](float v) { return (v + 80.0f) / 80.0f; });
171 m_thresh->setLabelFormat([](float v) {
172 return QString::number(v, 'f', 1) + " dB";
173 });
174 row->addWidget(m_thresh);
175
176 m_ratio = makeKnob("Ratio");
177 m_ratio->setRange(1.0f, 10.0f);
178 m_ratio->setDefault(2.0f);
179 m_ratio->setValueFromNorm([](float n) { return 1.0f + n * 9.0f; });
180 m_ratio->setNormFromValue([](float v) { return (v - 1.0f) / 9.0f; });
181 m_ratio->setLabelFormat([](float v) {
182 return QString::number(v, 'f', 1) + ":1";
183 });
184 row->addWidget(m_ratio);
185
186 m_return = makeKnob("Return");
187 m_return->setRange(0.0f, 20.0f);
188 m_return->setDefault(2.0f);

Callers

nothing calls this directly

Calls 10

logFunction · 0.85
setCenterLabelModeMethod · 0.80
setInlineEditEnabledMethod · 0.80
setDefaultMethod · 0.80
setValueFromNormMethod · 0.80
setNormFromValueMethod · 0.80
setLabelFormatMethod · 0.80
setCompactModeMethod · 0.45
setLabelMethod · 0.45
setRangeMethod · 0.45

Tested by

no test coverage detected