From 608a4fddd418a3ae3d5760d6c2835192267fec60 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Wed, 31 Jul 2013 00:03:26 +0000 Subject: [PATCH] Minor code cleanup. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3511 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- soundin.cpp | 11 +++-------- soundin.h | 8 ++++---- wsjtx.pro | 2 +- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/soundin.cpp b/soundin.cpp index 7217713a1..c5c58b903 100644 --- a/soundin.cpp +++ b/soundin.cpp @@ -77,7 +77,7 @@ SoundInput::SoundInput() m_monitoring(false), m_intervalTimer(this) { - connect(&m_intervalTimer, &QTimer::timeout, this, &SoundInput::intervalNotify); + connect(&m_intervalTimer, SIGNAL(timeout()), this,SLOT(intervalNotify())); } void SoundInput::start(qint32 device) @@ -246,7 +246,7 @@ SoundInput::SoundInput() m_monitoring(false), m_intervalTimer(this) { - connect(&m_intervalTimer, &QTimer::timeout, this, &SoundInput::intervalNotify); + connect(&m_intervalTimer, SIGNAL(timeout()), this,SLOT(intervalNotify())); } void SoundInput::start(qint32 device) @@ -319,14 +319,12 @@ void SoundInput::intervalNotify() Q_ASSERT(bytesReady >= 0); Q_ASSERT(bytesReady % 2 == 0); if (bytesReady == 0) { -// msleep(50); return; } - // Get the new samples qint32 bytesRead; qint16 buf0[4096]; - bytesRead = stream->read((char*)buf0, bytesReady); + bytesRead = stream->read((char*)buf0, bytesReady); // Get the new samples Q_ASSERT(bytesRead <= bytesReady); if (bytesRead < 0) { emit error(tr("audio stream QIODevice::read returned -1.")); @@ -342,14 +340,11 @@ void SoundInput::intervalNotify() if(m_monitoring) { int kstep=m_nsps/2; - // m_step=k/kstep; m_step=(k-1)/kstep; if(m_step != m_nstep0) { if(m_dataSinkBusy) { m_nBusy++; } else { - // m_dataSinkBusy=true; - // emit readyForFFT(k); //Signal to compute new FFTs emit readyForFFT(k-1); //Signal to compute new FFTs } m_nstep0=m_step; diff --git a/soundin.h b/soundin.h index 551567016..bff938d1a 100644 --- a/soundin.h +++ b/soundin.h @@ -109,7 +109,7 @@ public slots: private: bool m_dataSinkBusy; - double m_SamFacIn; //(Input sample rate)/12000.0 + double m_SamFacIn; //(Input sample rate)/12000.0 qint32 m_step; qint32 m_TRperiod; qint32 m_TRperiod0; @@ -122,17 +122,17 @@ private: int m_nsps0; QTimer m_intervalTimer; - QAudioDeviceInfo inputDevice; // audioinput device name + QAudioDeviceInfo inputDevice; // audioinput device name QAudioInput* audioInput; QIODevice* stream; struct CallbackData { - int kin; //Parameters sent to/from the portaudio callback function + int kin; int ncall; bool bzero; bool monitoring; - } m_callbackData; + } m_callbackData; //Parameters sent to/from the Notify function }; #endif // SOUNDIN_H #endif // QAUDIO_INPUT diff --git a/wsjtx.pro b/wsjtx.pro index dcbe650b8..e63148730 100644 --- a/wsjtx.pro +++ b/wsjtx.pro @@ -16,7 +16,7 @@ VERSION = 1.1 TEMPLATE = app #DEFINES = QT4 DEFINES = QT5 -#DEFINES += QAUDIO_INPUT +DEFINES += QAUDIO_INPUT win32 { DEFINES += WIN32