SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
fcdprothread.h
Go to the documentation of this file.
1 // Copyright (C) 2015-2018 Edouard Griffiths, F4EXB //
3 // //
4 // This program is free software; you can redistribute it and/or modify //
5 // it under the terms of the GNU General Public License as published by //
6 // the Free Software Foundation as version 3 of the License, or //
7 // (at your option) any later version. //
8 // //
9 // This program is distributed in the hope that it will be useful, //
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of //
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
12 // GNU General Public License V3 for more details. //
13 // //
14 // You should have received a copy of the GNU General Public License //
15 // along with this program. If not, see <http://www.gnu.org/licenses/>. //
17 
18 #ifndef INCLUDE_FCDPROTHREAD_H
19 #define INCLUDE_FCDPROTHREAD_H
20 
21 #include <QThread>
22 #include <QMutex>
23 #include <QWaitCondition>
24 
25 #include "dsp/samplesinkfifo.h"
26 #include "dsp/decimators.h"
27 #include "fcdtraits.h"
28 
29 class AudioFifo;
30 
31 class FCDProThread : public QThread {
32  Q_OBJECT
33 
34 public:
35  FCDProThread(SampleSinkFifo* sampleFifo, AudioFifo *fcdFIFO, QObject* parent = nullptr);
36  ~FCDProThread();
37 
38  void startWork();
39  void stopWork();
40  void setLog2Decimation(unsigned int log2_decim);
41  void setFcPos(int fcPos);
42 
43 private:
45 
47  QWaitCondition m_startWaiter;
48  bool m_running;
49  unsigned int m_log2Decim;
50  int m_fcPos;
51 
52  qint16 m_buf[fcd_traits<Pro>::convBufSize*2]; // stereo (I, Q)
56 
57  void run();
58  void work(unsigned int n_items);
59 };
60 
61 #endif // INCLUDE_FCDPROTHREAD_H
void setLog2Decimation(unsigned int log2_decim)
std::vector< Sample > SampleVector
Definition: dsptypes.h:96
void work(unsigned int n_items)
SampleSinkFifo * m_sampleFifo
Definition: fcdprothread.h:54
unsigned int m_log2Decim
Definition: fcdprothread.h:49
QMutex m_startWaitMutex
Definition: fcdprothread.h:46
SampleVector m_convertBuffer
Definition: fcdprothread.h:53
QWaitCondition m_startWaiter
Definition: fcdprothread.h:47
void setFcPos(int fcPos)
FCDProThread(SampleSinkFifo *sampleFifo, AudioFifo *fcdFIFO, QObject *parent=nullptr)
Decimators< qint32, qint16, SDR_RX_SAMP_SZ, 16 > m_decimators
Definition: fcdprothread.h:55
void startWork()
AudioFifo * m_fcdFIFO
Definition: fcdprothread.h:44
qint16 m_buf[fcd_traits< Pro >::convBufSize *2]
Definition: fcdprothread.h:52