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

Function agcThresholdToControllerValue

src/gui/MainWindow_Controllers.cpp:101–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101float agcThresholdToControllerValue(const SliceModel* slice)
102{
103 if (!slice) {
104 return 0.0f;
105 }
106 if (!usesExternalReceiveControls(slice)) {
107 return static_cast<float>(slice->agcThreshold());
108 }
109 constexpr float kUiSpan = 100.0f;
110 const float agcSpan =
111 static_cast<float>(KiwiSdrProtocol::kAgcThresholdMaxDb
112 - KiwiSdrProtocol::kAgcThresholdMinDb);
113 return std::clamp(
114 static_cast<float>(slice->receiveAgcThreshold()
115 - KiwiSdrProtocol::kAgcThresholdMinDb)
116 * kUiSpan / agcSpan,
117 0.0f, kUiSpan);
118}
119
120int agcThresholdOverlayValue(const SliceModel* slice, int threshold)
121{

Callers 1

registerMidiParamsMethod · 0.85

Calls 3

agcThresholdMethod · 0.80
receiveAgcThresholdMethod · 0.80

Tested by

no test coverage detected