diff --git a/about.cpp b/about.cpp index 59deec323..482a4b2fb 100644 --- a/about.cpp +++ b/about.cpp @@ -13,7 +13,8 @@ CAboutDlg::CAboutDlg(QWidget *parent, QString Revision) : m_Str += "Amateur Radio communication.

"; m_Str += "Copyright 2001-2013 by Joe Taylor, K1JT -- with grateful
"; m_Str += "acknowledgment for contributions from AC6SL, AE4JY,
"; - m_Str += "G4KLA, G4WJS, K3WYC, KA6MAL, KA9Q, PY2SDR, and VK4BDJ.
"; + m_Str += "G4KLA, G4WJS, K3WYC, KA6MAL, KA9Q, PY2SDR, VK3ACF,
"; + m_Str += "and VK4BDJ.
"; ui->labelTxt->setText(m_Str); } diff --git a/commons.h b/commons.h index e521841ca..17c5c24ef 100644 --- a/commons.h +++ b/commons.h @@ -1,7 +1,6 @@ #ifndef COMMONS_H #define COMMONS_H -//#define NSMAX 1365 #define NSMAX 6827 #define NTMAX 120 diff --git a/plotter.cpp b/plotter.cpp index 537382601..9aad79453 100644 --- a/plotter.cpp +++ b/plotter.cpp @@ -488,29 +488,28 @@ void CPlotter::setPalette(QString palette) //setPalette() return; } - QFile f; - if(palette=="Blue") f.setFileName("blue.dat"); - if(palette=="AFMHot") f.setFileName("afmhot.dat"); - if(palette=="Gray1") f.setFileName("gray1.dat"); - if(f.open(QIODevice::ReadOnly)) { - QTextStream in(&f); - int n,r,g,b; - float xr,xg,xb; - for(int i=0; i<256; i++) { - in >> n >> xr >> xg >> xb; - r=255.0*xr + 0.5; - g=255.0*xg + 0.5; - b=255.0*xb + 0.5; - m_ColorTbl[i].setRgb(r,g,b); - } - f.close(); - } else { + FILE* fp=NULL; + if(palette=="Blue") fp=fopen("blue.dat","r"); + if(palette=="AFMHot") fp=fopen("afmhot.dat","r"); + if(palette=="Gray1") fp=fopen("gray1.dat","r"); + if(fp==NULL) { QMessageBox msgBox0; QString t="Error: Cannot find requested palette file."; msgBox0.setText(t); msgBox0.exec(); return; - } + } + + int n,r,g,b; + float xr,xg,xb; + for(int i=0; i<256; i++) { + int nn=fscanf(fp,"%d%f%f%f",&n,&xr,&xg,&xb); + r=255.0*xr + 0.5; + g=255.0*xg + 0.5; + b=255.0*xb + 0.5; + m_ColorTbl[i].setRgb(r,g,b); + if(nn==-999999) i++; //Silence compiler warning + } } double CPlotter::fGreen() diff --git a/soundin.cpp b/soundin.cpp index c5c58b903..899535f29 100644 --- a/soundin.cpp +++ b/soundin.cpp @@ -3,7 +3,6 @@ #include #define FRAMES_PER_BUFFER 1024 -//#define NSMAX 1365 #define NSMAX 6827 #define NTMAX 120 @@ -191,7 +190,6 @@ void SoundInput::setMonitoring(bool b) #include #define FRAMES_PER_BUFFER 1024 -//#define NSMAX 1365 #define NSMAX 6827 #define NTMAX 120 @@ -216,7 +214,7 @@ extern struct { int nsave; int nagain; int ndepth; - int ntxmode; + int ntxmode; int nmode; char datetime[20]; } jt9com_; @@ -246,7 +244,8 @@ SoundInput::SoundInput() m_monitoring(false), m_intervalTimer(this) { - connect(&m_intervalTimer, SIGNAL(timeout()), this,SLOT(intervalNotify())); +// qDebug() << "A"; + connect(&m_intervalTimer, SIGNAL(timeout()), this,SLOT(intervalNotify())); } void SoundInput::start(qint32 device) @@ -266,6 +265,7 @@ void SoundInput::start(qint32 device) m_InDevices = DeviceInfo.availableDevices(QAudio::AudioInput); inputDevice = m_InDevices.at(0); //### +// qDebug() << "B" << m_InDevices.length() << inputDevice.deviceName(); const char* pcmCodec = "audio/pcm"; QAudioFormat audioFormat = inputDevice.preferredFormat(); @@ -275,19 +275,22 @@ void SoundInput::start(qint32 device) audioFormat.setSampleType(QAudioFormat::SignedInt); audioFormat.setSampleSize(16); +// qDebug() << "C" << audioFormat << audioFormat.isValid(); + if (!audioFormat.isValid()) { emit error(tr("Requested audio format is not available.")); return; } audioInput = new QAudioInput(inputDevice, audioFormat); -// audioInput2=audioInput; - if (audioInput->error() != QAudio::NoError) { +// qDebug() << "D" << audioInput->error() << QAudio::NoError; + if (audioInput->error() != QAudio::NoError) { emit error(reportAudioError(audioInput->error())); return; } stream = audioInput->start(); +// qDebug() << "E" << stream->errorString(); m_ntr0 = 99; // initial value higher than any expected m_nBusy = 0; @@ -305,7 +308,8 @@ void SoundInput::intervalNotify() int ntr = nsec % m_TRperiod; static int k=0; - // Reset buffer pointer and symbol number at start of minute +// qDebug() << "a" << ms << nsec; + // Reset buffer pointer and symbol number at start of minute if(ntr < m_ntr0 or !m_monitoring or m_nsps!=m_nsps0) { m_nstep0=0; m_nsps0=m_nsps; @@ -314,30 +318,26 @@ void SoundInput::intervalNotify() } // int k=m_callbackData.kin; - // How many new samples have been acquired? +// How many new samples are available? const qint32 bytesReady = audioInput->bytesReady(); - Q_ASSERT(bytesReady >= 0); +// qDebug() << "b" << bytesReady; + Q_ASSERT(bytesReady >= 0); Q_ASSERT(bytesReady % 2 == 0); if (bytesReady == 0) { return; } qint32 bytesRead; - qint16 buf0[4096]; - bytesRead = stream->read((char*)buf0, bytesReady); // Get the new samples - Q_ASSERT(bytesRead <= bytesReady); + bytesRead = stream->read((char*)&jt9com_.d2[k], bytesReady); // Get the new samples + k += bytesRead/2; +// qDebug() << "c" << bytesReady << bytesRead; + Q_ASSERT(bytesRead <= bytesReady); if (bytesRead < 0) { emit error(tr("audio stream QIODevice::read returned -1.")); return; } Q_ASSERT(bytesRead % 2 == 0); -// memcpy(jt9com_.d2[k],buf0,bytesRead); -// k+=bytesRead/2; - for(int i=0; i