Save the waterfall share percentage of the screen in the preset

This commit is contained in:
f4exb 2015-07-24 01:30:00 +02:00
parent a5bf0c2720
commit ad2b941529
3 changed files with 20 additions and 0 deletions

View File

@ -56,6 +56,9 @@ public:
void newSpectrum(const std::vector<Real>& spectrum, int fftSize);
void clearSpectrumHistogram();
Real getWaterfallShare() const { return m_waterfallShare; }
void setWaterfallShare(Real waterfallShare);
private:
struct ChannelMarkerState {
ChannelMarker* m_channelMarker;

View File

@ -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;
}

View File

@ -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 {