Skip to content

Commit

Permalink
removed if statments from closeing audio
Browse files Browse the repository at this point in the history
  • Loading branch information
jontio committed Jul 27, 2021
1 parent 7b87374 commit d9794d4
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 21 deletions.
5 changes: 1 addition & 4 deletions JAERO/audioburstmskdemodulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ void AudioBurstMskDemodulator::start()

void AudioBurstMskDemodulator::stop()
{
if(!settings.zmqAudio)
{
if(m_audioInput)m_audioInput->stop();
}
if(m_audioInput)m_audioInput->stop();
BurstMskDemodulator::stop();
}

Expand Down
5 changes: 1 addition & 4 deletions JAERO/audioburstoqpskdemodulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@ void AudioBurstOqpskDemodulator::start()
void AudioBurstOqpskDemodulator::stop()
{
if(m_audioInput)m_audioInput->stop();
if(!settings.zmqAudio)
{
BurstOqpskDemodulator::stop();
}
BurstOqpskDemodulator::stop();
demod2->stop();
}

Expand Down
5 changes: 1 addition & 4 deletions JAERO/audiomskdemodulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ void AudioMskDemodulator::start()

void AudioMskDemodulator::stop()
{
if(!settings.zmqAudio)
{
if(m_audioInput)m_audioInput->stop();
}
if(m_audioInput)m_audioInput->stop();
MskDemodulator::stop();
}

Expand Down
5 changes: 1 addition & 4 deletions JAERO/audiooqpskdemodulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ void AudioOqpskDemodulator::start()

void AudioOqpskDemodulator::stop()
{
if(!settings.zmqAudio)
{
if(m_audioInput)m_audioInput->stop();
}
if(m_audioInput)m_audioInput->stop();
OqpskDemodulator::stop();
}

Expand Down
4 changes: 3 additions & 1 deletion JAERO/oqpskdemodulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,9 @@ qint64 OqpskDemodulator::writeData(const char *data, qint64 len)
ebnomeasure->Update(dabval);

//AGC
sig2*=agc->Update(dabval); //clipping
sig2*=agc->Update(dabval);

//clipping
double abval=std::abs(sig2);
if(abval>2.84)sig2=(2.84/abval)*sig2;

Expand Down
4 changes: 0 additions & 4 deletions JAERO/zmq_audiosender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,10 @@ void ZMQAudioSender::Start(QString &address, QString &topic)
this->topic=topic;
connected_url=address.toUtf8().constData();
zmqStatus=zmq_bind(publisher, connected_url.c_str() );
qDebug()<<"ZMQAudioSender::Start";
}

void ZMQAudioSender::Stop()
{
qDebug()<<"ZMQAudioSender::Stop";
if(zmqStatus == 0)
{
zmqStatus = zmq_disconnect(publisher, connected_url.c_str());
Expand All @@ -40,7 +38,6 @@ void ZMQAudioSender::Stop()

void ZMQAudioSender::Voiceslot(QByteArray &data, QString &hex)
{
qDebug()<<"ZMQAudioSender::Voiceslot";
std::string topic_text = topic.toUtf8().constData();
zmq_setsockopt(publisher, ZMQ_IDENTITY, topic_text.c_str(), topic_text.length());

Expand All @@ -52,4 +49,3 @@ void ZMQAudioSender::Voiceslot(QByteArray &data, QString &hex)
zmq_send(publisher, topic_text.c_str(), 5, ZMQ_SNDMORE);
zmq_send(publisher, hex.toStdString().c_str(), 6, 0 );
}

0 comments on commit d9794d4

Please sign in to comment.