1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-07 08:24:43 -04:00

FCDProPlus: use Qt for FCD audio device handling. Fixes start up error

This commit is contained in:
f4exb
2018-11-19 02:33:44 +01:00
parent 865d26cc15
commit a10b29d6d3
7 changed files with 98 additions and 131 deletions
@@ -21,32 +21,36 @@
#include <QThread>
#include <QMutex>
#include <QWaitCondition>
#include <alsa/asoundlib.h>
#include "dsp/inthalfbandfilter.h"
#include "dsp/samplesinkfifo.h"
#include "dsp/decimators.h"
#include "fcdtraits.h"
class AudioFifo;
class FCDProPlusThread : public QThread {
Q_OBJECT
public:
FCDProPlusThread(SampleSinkFifo* sampleFifo, snd_pcm_t *fcd_handle, QObject* parent = nullptr);
FCDProPlusThread(SampleSinkFifo* sampleFifo, AudioFifo *fcdFIFO, QObject* parent = nullptr);
~FCDProPlusThread();
void startWork();
void stopWork();
private:
snd_pcm_t* m_fcd_handle;
AudioFifo* m_fcdFIFO;
QMutex m_startWaitMutex;
QWaitCondition m_startWaiter;
bool m_running;
qint16 m_buf[fcd_traits<ProPlus>::convBufSize*2]; // stereo (I, Q)
SampleVector m_convertBuffer;
SampleSinkFifo* m_sampleFifo;
Decimators<qint32, qint16, SDR_RX_SAMP_SZ, 16> m_decimators;
void run();
int work(int n_items);
void work(unsigned int n_items);
};
#endif // INCLUDE_FCDTHREAD_H