From b25019ed0ab336b1c3f9013c9beb0117622ec30a Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Mon, 21 Apr 2014 14:39:39 +0000 Subject: [PATCH] Fix a regression introduced in r3986 - no decode after "Halt TX". The new suspend/resume approach to the received audio stream causes a reset to the input sample buffer on resume. This is desired behaviour except when the stream in not actually suspended. The monitor function was not checking this when resuming monitoring and this caused decodes for a period to be abandonded simply by using the "Halt TX" button to turn off automatic transmission mode. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@4059 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- mainwindow.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 443101fc9..d6c21a394 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -655,7 +655,8 @@ void MainWindow::on_monitorButton_clicked (bool checked) if (!m_transmitting) { auto prior = m_monitoring; - m_monitoring = checked; + monitor (checked); + if (!prior) { m_diskData = false; // no longer reading WAV files @@ -673,7 +674,6 @@ void MainWindow::on_monitorButton_clicked (bool checked) // mode // checking - monitor (checked); } else { @@ -684,15 +684,18 @@ void MainWindow::on_monitorButton_clicked (bool checked) void MainWindow::monitor (bool state) { ui->monitorButton->setChecked (state); - m_monitoring = state; if (state) { - Q_EMIT resumeAudioInputStream (); + if (!m_monitoring) + { + Q_EMIT resumeAudioInputStream (); + } } else { Q_EMIT suspendAudioInputStream (); } + m_monitoring = state; } void MainWindow::on_actionAbout_triggered() //Display "About"