2012-05-22 13:09:48 -04:00
|
|
|
#ifndef SOUNDOUT_H
|
|
|
|
#define SOUNDOUT_H
|
|
|
|
#include <QtCore>
|
|
|
|
#include <QDebug>
|
|
|
|
|
|
|
|
// An instance of this thread sends audio data to a specified soundcard.
|
|
|
|
// Output can be muted while underway, preserving waveform timing when
|
|
|
|
// transmission is resumed.
|
|
|
|
|
|
|
|
class SoundOutThread : public QThread
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void run();
|
|
|
|
|
|
|
|
public:
|
|
|
|
// Constructs (but does not start) a SoundOutThread
|
|
|
|
SoundOutThread()
|
|
|
|
: quitExecution(false) // Initialize some private members
|
|
|
|
, m_txOK(false)
|
|
|
|
, m_txMute(false)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
|
|
|
void setOutputDevice(qint32 n);
|
2012-09-25 20:48:49 -04:00
|
|
|
void setPeriod(int ntrperiod, int nsps);
|
2012-10-05 15:14:45 -04:00
|
|
|
void setTxFreq(int n);
|
2013-07-08 09:17:22 -04:00
|
|
|
void setXIT(int n);
|
2012-10-26 10:03:43 -04:00
|
|
|
void setTxSNR(double snr);
|
2013-04-14 10:11:20 -04:00
|
|
|
void setTune(bool b);
|
2012-11-13 15:23:03 -05:00
|
|
|
double samFacOut();
|
2012-05-22 13:09:48 -04:00
|
|
|
bool quitExecution; //If true, thread exits gracefully
|
2013-07-08 09:17:22 -04:00
|
|
|
QString m_modeTx;
|
2012-05-22 13:09:48 -04:00
|
|
|
|
|
|
|
// Private members
|
|
|
|
private:
|
2012-10-26 10:03:43 -04:00
|
|
|
double m_txsnrdb; //if < 0, add noise to Tx audio
|
2012-11-13 15:23:03 -05:00
|
|
|
double m_SamFacOut; //(Output sample rate)/48000.0
|
2013-07-08 09:17:22 -04:00
|
|
|
|
2012-05-22 13:09:48 -04:00
|
|
|
qint32 m_nDevOut; //Output device number
|
2012-10-05 13:13:21 -04:00
|
|
|
qint32 m_TRperiod; //T/R period (s)
|
2012-09-25 20:48:49 -04:00
|
|
|
qint32 m_nsps; //Samples per symbol (at 12000 Hz)
|
2012-10-05 15:14:45 -04:00
|
|
|
qint32 m_txFreq;
|
2013-07-08 09:17:22 -04:00
|
|
|
qint32 m_xit;
|
|
|
|
|
2012-10-26 10:03:43 -04:00
|
|
|
bool m_txOK; //Enable Tx audio
|
|
|
|
bool m_txMute; //Mute temporarily
|
2013-04-14 10:11:20 -04:00
|
|
|
bool m_tune;
|
2012-05-22 13:09:48 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|