wfview/rxaudiohandler.h
roeland jansen 0e0480b0ed Added support for various spectrum sizes and rig capability support.
wfview has been tested with the following Icom radios over USB port:
IC-7300, IC-7610, IC-7851 (and IC-7850), and IC-9700. It likely works
fine with the IC-705 as well. At this time, the rig's CIV address must
be changed in the preference file to indicate the rig you are using, and
this must be in integer, not hex.
2021-02-10 17:32:56 +00:00

47 lines
841 B
C++

#ifndef RXAUDIOHANDLER_H
#define RXAUDIOHANDLER_H
#include <QObject>
#include <QtMultimedia/QAudioOutput>
#include <QMutexLocker>
#include <QIODevice>
#include <QDebug>
class rxAudioHandler : public QObject
{
Q_OBJECT
public:
rxAudioHandler();
~rxAudioHandler();
public slots:
void process();
void setup(const QAudioFormat format, const quint16 bufferSize, const bool isulaw);
void incomingAudio(const QByteArray data);
void changeBufferSize(const quint16 newSize);
void getBufferSize();
signals:
void audioMessage(QString message);
void sendBufferSize(quint16 newSize);
private:
QByteArray uLawDecode(const QByteArray in);
QAudioOutput* audio;
QAudioFormat format;
QIODevice* device;
int bufferSize;
QMutex mutex;
bool isUlaw;
};
#endif // RXAUDIOHANDLER_H