diff --git a/include-gpl/gui/glspectrum.h b/include-gpl/gui/glspectrum.h index ce0c7f180..e83277bdf 100644 --- a/include-gpl/gui/glspectrum.h +++ b/include-gpl/gui/glspectrum.h @@ -56,6 +56,9 @@ public: void newSpectrum(const std::vector& spectrum, int fftSize); void clearSpectrumHistogram(); + Real getWaterfallShare() const { return m_waterfallShare; } + void setWaterfallShare(Real waterfallShare); + private: struct ChannelMarkerState { ChannelMarker* m_channelMarker; diff --git a/sdrbase/gui/glspectrum.cpp b/sdrbase/gui/glspectrum.cpp index b8ff4d34c..5c90cd96a 100644 --- a/sdrbase/gui/glspectrum.cpp +++ b/sdrbase/gui/glspectrum.cpp @@ -1530,3 +1530,16 @@ void GLSpectrum::channelMarkerDestroyed(QObject* object) { removeChannelMarker((ChannelMarker*)object); } + +void GLSpectrum::setWaterfallShare(Real waterfallShare) +{ + if (waterfallShare < 0.1f) { + m_waterfallShare = 0.1f; + } + else if (waterfallShare > 0.8f) { + m_waterfallShare = 0.8f; + } else { + m_waterfallShare = waterfallShare; + } + m_changesPending = true; +} diff --git a/sdrbase/gui/glspectrumgui.cpp b/sdrbase/gui/glspectrumgui.cpp index 7a07ad91f..8cc49c6e5 100644 --- a/sdrbase/gui/glspectrumgui.cpp +++ b/sdrbase/gui/glspectrumgui.cpp @@ -89,6 +89,7 @@ QByteArray GLSpectrumGUI::serialize() const s.writeS32(15, m_histogramStroke); s.writeBool(16, m_displayCurrent); s.writeS32(17, m_displayTraceIntensity); + s.writeReal(18, m_glSpectrum->getWaterfallShare()); return s.final(); } @@ -119,6 +120,9 @@ bool GLSpectrumGUI::deserialize(const QByteArray& data) d.readS32(15, &m_histogramStroke, 40); d.readBool(16, &m_displayCurrent, false); d.readS32(17, &m_displayTraceIntensity, 50); + Real waterfallShare; + d.readReal(18, &waterfallShare, 0.66); + m_glSpectrum->setWaterfallShare(waterfallShare); applySettings(); return true; } else {