2015-09-03 01:57:54 +00:00
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
2015-09-04 02:10:38 +00:00
|
|
|
// Copyright (C) 2015 Edouard Griffiths, F4EXB //
|
2015-09-03 01:57:54 +00:00
|
|
|
// //
|
|
|
|
// This program is free software; you can redistribute it and/or modify //
|
|
|
|
// it under the terms of the GNU General Public License as published by //
|
|
|
|
// the Free Software Foundation as version 3 of the License, or //
|
|
|
|
// //
|
|
|
|
// This program is distributed in the hope that it will be useful, //
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
|
|
|
// GNU General Public License V3 for more details. //
|
|
|
|
// //
|
|
|
|
// You should have received a copy of the GNU General Public License //
|
|
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2015-09-04 02:10:38 +00:00
|
|
|
#ifndef INCLUDE_FCDPROTHREAD_H
|
|
|
|
#define INCLUDE_FCDPROTHREAD_H
|
2015-09-03 01:57:54 +00:00
|
|
|
|
|
|
|
#include <QThread>
|
|
|
|
#include <QMutex>
|
|
|
|
#include <QWaitCondition>
|
|
|
|
#include "dsp/inthalfbandfilter.h"
|
|
|
|
#include <alsa/asoundlib.h>
|
2017-10-22 17:12:43 +00:00
|
|
|
#include "dsp/samplesinkfifo.h"
|
2015-09-03 01:57:54 +00:00
|
|
|
|
2015-09-04 02:10:38 +00:00
|
|
|
class FCDProThread : public QThread {
|
2015-09-03 01:57:54 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2016-10-06 17:18:02 +00:00
|
|
|
FCDProThread(SampleSinkFifo* sampleFifo, QObject* parent = NULL);
|
2015-09-04 02:10:38 +00:00
|
|
|
~FCDProThread();
|
2015-09-03 01:57:54 +00:00
|
|
|
|
2015-09-03 06:39:57 +00:00
|
|
|
void startWork();
|
2015-09-03 01:57:54 +00:00
|
|
|
void stopWork();
|
|
|
|
bool OpenSource(const char *filename);
|
|
|
|
void CloseSource();
|
2015-09-03 06:39:57 +00:00
|
|
|
|
2015-09-03 01:57:54 +00:00
|
|
|
private:
|
|
|
|
snd_pcm_t* fcd_handle;
|
|
|
|
|
|
|
|
QMutex m_startWaitMutex;
|
|
|
|
QWaitCondition m_startWaiter;
|
|
|
|
bool m_running;
|
|
|
|
|
|
|
|
SampleVector m_convertBuffer;
|
2016-10-06 17:18:02 +00:00
|
|
|
SampleSinkFifo* m_sampleFifo;
|
2015-09-03 01:57:54 +00:00
|
|
|
|
|
|
|
void run();
|
2015-09-03 06:39:57 +00:00
|
|
|
int work(int n_items);
|
2015-09-03 01:57:54 +00:00
|
|
|
};
|
2015-09-04 02:10:38 +00:00
|
|
|
#endif // INCLUDE_FCDPROTHREAD_H
|