Make RT/PA a subclass of audioHandler

merge-requests/9/merge
Phil Taylor 2022-05-14 13:45:56 +01:00
rodzic bcde69c92b
commit b3f611543c
5 zmienionych plików z 12 dodań i 11 usunięć

Wyświetl plik

@ -18,6 +18,7 @@
/* Logarithmic taper for volume control */
#include "audiotaper.h"
#include "audiohandler.h"
/* Audio converter class*/
#include "audioconverter.h"
@ -25,7 +26,7 @@
#include <QDebug>
class paHandler : public QObject
class paHandler : public audioHandler
{
Q_OBJECT

Wyświetl plik

@ -25,14 +25,14 @@
/* Logarithmic taper for volume control */
#include "audiotaper.h"
#include "audiohandler.h"
/* Audio converter class*/
#include "audioconverter.h"
#include <QDebug>
class rtHandler : public QObject
class rtHandler : public audioHandler
{
Q_OBJECT

Wyświetl plik

@ -69,10 +69,10 @@ private:
uint16_t sendAudioSeq = 0;
QObject* rxaudio = Q_NULLPTR;
audioHandler* rxaudio = Q_NULLPTR;
QThread* rxAudioThread = Q_NULLPTR;
QObject* txaudio = Q_NULLPTR;
audioHandler* txaudio = Q_NULLPTR;
QThread* txAudioThread = Q_NULLPTR;
QTimer* txAudioTimer = Q_NULLPTR;

Wyświetl plik

@ -395,13 +395,13 @@ void udpServer::controlReceived()
connect(radio->txAudioThread, SIGNAL(finished()), radio->txaudio, SLOT(deleteLater()));
// Not sure how we make this work in QT5.9?
#if (QT_VERSION >= QT_VERSION_CHECK(7,10,0))
QMetaObject::invokeMethod((audioHandler*)radio->txaudio, [=]() {
#if (QT_VERSION >= QT_VERSION_CHECK(5,10,0))
QMetaObject::invokeMethod(radio->txaudio, [=]() {
radio->txaudio->init(radio->txAudioSetup);
}, Qt::QueuedConnection);
#else
emit setupTxAudio(radio->txAudioSetup);
//#warning "QT 5.9 is not fully supported multiple rigs will NOT work!"
#warning "QT 5.9 is not fully supported multiple rigs will NOT work!"
#endif
hasTxAudio = datagram.senderAddress();
@ -442,7 +442,7 @@ void udpServer::controlReceived()
connect(radio->rxAudioThread, SIGNAL(finished()), radio->rxaudio, SLOT(deleteLater()));
connect(radio->rxaudio, SIGNAL(haveAudioData(audioPacket)), this, SLOT(receiveAudioData(audioPacket)));
#if (QT_VERSION >= QT_VERSION_CHECK(7,10,0))
#if (QT_VERSION >= QT_VERSION_CHECK(5,10,0))
QMetaObject::invokeMethod(radio->rxaudio, [=]() {
radio->rxaudio->init(radio->rxAudioSetup);
}, Qt::QueuedConnection);

Wyświetl plik

@ -70,9 +70,9 @@ struct RIGCONFIG {
rigCapabilities rigCaps;
rigCommander* rig = Q_NULLPTR;
QThread* rigThread = Q_NULLPTR;
QObject* rxaudio = Q_NULLPTR;
audioHandler* rxaudio = Q_NULLPTR;
QThread* rxAudioThread = Q_NULLPTR;
QObject* txaudio = Q_NULLPTR;
audioHandler* txaudio = Q_NULLPTR;
QThread* txAudioThread = Q_NULLPTR;
QTimer* rxAudioTimer = Q_NULLPTR;
QTimer* connectTimer = Q_NULLPTR;