2012-05-22 13:09:48 -04:00
|
|
|
#ifndef SOUNDIN_H
|
|
|
|
#define SOUNDIN_H
|
|
|
|
|
|
|
|
#include <QtCore>
|
|
|
|
#include <QDebug>
|
|
|
|
|
|
|
|
|
|
|
|
// Thread gets audio data from soundcard and signals when a buffer of
|
|
|
|
// specified size is available.
|
|
|
|
class SoundInThread : public QThread
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
bool quitExecution; // if true, thread exits gracefully
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void run();
|
|
|
|
|
|
|
|
public:
|
|
|
|
bool m_dataSinkBusy;
|
|
|
|
|
|
|
|
SoundInThread():
|
|
|
|
quitExecution(false),
|
2012-07-04 12:27:57 -04:00
|
|
|
m_dataSinkBusy(false)
|
2012-05-22 13:09:48 -04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void setInputDevice(qint32 n);
|
|
|
|
void setMonitoring(bool b);
|
2012-09-25 20:48:49 -04:00
|
|
|
void setPeriod(int ntrperiod, int nsps);
|
2012-07-04 12:27:57 -04:00
|
|
|
int mstep();
|
2012-11-13 15:23:03 -05:00
|
|
|
double samFacIn();
|
2012-05-22 13:09:48 -04:00
|
|
|
|
|
|
|
signals:
|
|
|
|
void readyForFFT(int k);
|
|
|
|
void error(const QString& message);
|
|
|
|
void status(const QString& message);
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void quit();
|
|
|
|
|
|
|
|
private:
|
2012-11-13 15:23:03 -05:00
|
|
|
double m_SamFacIn; //(Input sample rate)/12000.0
|
2012-07-04 12:27:57 -04:00
|
|
|
qint32 m_step;
|
2012-05-22 13:09:48 -04:00
|
|
|
qint32 m_nDevIn;
|
2012-09-24 15:11:31 -04:00
|
|
|
qint32 m_TRperiod;
|
|
|
|
qint32 m_TRperiod0;
|
2012-09-25 20:48:49 -04:00
|
|
|
qint32 m_nsps;
|
2012-11-13 15:23:03 -05:00
|
|
|
bool m_monitoring;
|
2012-05-22 13:09:48 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
extern "C" {
|
|
|
|
void recvpkt_(int* nsam, quint16* iblk, qint8* nrx, int* k, double s1[],
|
|
|
|
double s2[], double s3[]);
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // SOUNDIN_H
|