1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-08 00:44:48 -04:00

GLSpectrum: added a freeze button

This commit is contained in:
f4exb
2020-07-05 10:03:41 +02:00
parent 3e6ea404e1
commit 3c7a39f71e
9 changed files with 67 additions and 12 deletions
+19 -1
View File
@@ -43,11 +43,13 @@ MESSAGE_CLASS_DEFINITION(SpectrumVis::MsgConfigureSpectrumVis, Message)
MESSAGE_CLASS_DEFINITION(SpectrumVis::MsgConfigureScalingFactor, Message)
MESSAGE_CLASS_DEFINITION(SpectrumVis::MsgConfigureWSpectrumOpenClose, Message)
MESSAGE_CLASS_DEFINITION(SpectrumVis::MsgConfigureWSpectrum, Message)
MESSAGE_CLASS_DEFINITION(SpectrumVis::MsgStartStop, Message)
const Real SpectrumVis::m_mult = (10.0f / log2f(10.0f));
SpectrumVis::SpectrumVis(Real scalef) :
BasebandSampleSink(),
m_running(true),
m_fft(nullptr),
m_fftEngineSequence(0),
m_fftBuffer(MAX_FFT_SIZE),
@@ -285,8 +287,11 @@ void SpectrumVis::feed(const Complex *begin, unsigned int length)
void SpectrumVis::feed(const SampleVector::const_iterator& cbegin, const SampleVector::const_iterator& end, bool positiveOnly)
{
// if no visualisation is set, send the samples to /dev/null
if (!m_running) {
return;
}
// if no visualisation is set, send the samples to /dev/null
if (!m_glSpectrum && !m_wsSpectrum.socketOpened()) {
return;
}
@@ -587,10 +592,12 @@ void SpectrumVis::feed(const SampleVector::const_iterator& cbegin, const SampleV
void SpectrumVis::start()
{
m_running = true;
}
void SpectrumVis::stop()
{
m_running = false;
}
bool SpectrumVis::handleMessage(const Message& message)
@@ -629,6 +636,17 @@ bool SpectrumVis::handleMessage(const Message& message)
handleConfigureWSSpectrum(conf.getAddress(), conf.getPort());
return true;
}
else if (MsgStartStop::match(message)) {
MsgStartStop& cmd = (MsgStartStop&) message;
if (cmd.getStartStop()) {
start();
} else {
stop();
}
return true;
}
else
{
return false;