kopia lustrzana https://gitlab.com/eliggett/wfview
Merge branch 'rtaudio' into shuttle
commit
7b9a911079
396
audiohandler.cpp
396
audiohandler.cpp
|
@ -7,76 +7,134 @@
|
|||
#include "logcategories.h"
|
||||
#include "ulaw.h"
|
||||
|
||||
audioHandler::audioHandler(QObject* parent) :
|
||||
isInitialized(false),
|
||||
isUlaw(false),
|
||||
audioLatency(0),
|
||||
isInput(0),
|
||||
chunkAvailable(false)
|
||||
audioHandler::audioHandler(QObject* parent)
|
||||
{
|
||||
Q_UNUSED(parent)
|
||||
}
|
||||
|
||||
audioHandler::~audioHandler()
|
||||
{
|
||||
//stop();
|
||||
|
||||
if (isInitialized) {
|
||||
#if defined(RTAUDIO)
|
||||
|
||||
try {
|
||||
audio->abortStream();
|
||||
audio->closeStream();
|
||||
}
|
||||
catch (RtAudioError& e) {
|
||||
qInfo(logAudio()) << "Error closing stream:" << aParams.deviceId << ":" << QString::fromStdString(e.getMessage());
|
||||
}
|
||||
delete audio;
|
||||
#elif defined(PORTAUDIO)
|
||||
#else
|
||||
stop();
|
||||
if (audioOutput != Q_NULLPTR) {
|
||||
//audioOutput->stop();
|
||||
delete audioOutput;
|
||||
qDebug(logAudio()) << "Audio output stopped";
|
||||
}
|
||||
if (audioInput != Q_NULLPTR) {
|
||||
//audioInput->stop();
|
||||
delete audioInput;
|
||||
qDebug(logAudio()) << "Audio input stopped";
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if (ringBuf != Q_NULLPTR) {
|
||||
delete ringBuf;
|
||||
}
|
||||
|
||||
if (resampler != Q_NULLPTR) {
|
||||
speex_resampler_destroy(resampler);
|
||||
qDebug(logAudio()) << "Resampler closed";
|
||||
}
|
||||
if (audio.isStreamRunning())
|
||||
{
|
||||
audio.stopStream();
|
||||
audio.closeStream();
|
||||
}
|
||||
if (ringBuf != Q_NULLPTR)
|
||||
delete ringBuf;
|
||||
|
||||
}
|
||||
|
||||
bool audioHandler::init(const quint8 bits, const quint8 radioChan, const quint16 samplerate, const quint16 latency, const bool ulaw, const bool isinput, int port, quint8 resampleQuality)
|
||||
bool audioHandler::init(audioSetup setupIn)
|
||||
{
|
||||
if (isInitialized) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this->audioLatency = latency;
|
||||
this->isUlaw = ulaw;
|
||||
this->isInput = isinput;
|
||||
this->radioSampleBits = bits;
|
||||
this->radioSampleRate = samplerate;
|
||||
this->radioChannels = radioChan;
|
||||
/*
|
||||
0x01 uLaw 1ch 8bit
|
||||
0x02 PCM 1ch 8bit
|
||||
0x04 PCM 1ch 16bit
|
||||
0x08 PCM 2ch 8bit
|
||||
0x10 PCM 2ch 16bit
|
||||
0x20 uLaw 2ch 8bit
|
||||
*/
|
||||
|
||||
// chunk size is always relative to Internal Sample Rate.
|
||||
setup = setupIn;
|
||||
setup.radioChan = 1;
|
||||
setup.bits = 8;
|
||||
|
||||
if (setup.codec == 0x01 || setup.codec == 0x20) {
|
||||
setup.ulaw = true;
|
||||
}
|
||||
if (setup.codec == 0x08 || setup.codec == 0x10 || setup.codec == 0x20) {
|
||||
setup.radioChan = 2;
|
||||
}
|
||||
if (setup.codec == 0x04 || setup.codec == 0x10) {
|
||||
setup.bits = 16;
|
||||
}
|
||||
|
||||
ringBuf = new wilt::Ring<audioPacket>(100); // Should be customizable.
|
||||
|
||||
tempBuf.sent = 0;
|
||||
|
||||
|
||||
|
||||
#if defined(RTAUDIO)
|
||||
#if !defined(Q_OS_MACX)
|
||||
options.flags = ((!RTAUDIO_HOG_DEVICE) | (RTAUDIO_MINIMIZE_LATENCY));
|
||||
#endif
|
||||
|
||||
#if defined(Q_OS_LINUX)
|
||||
audio = new RtAudio(RtAudio::Api::LINUX_ALSA);
|
||||
#elif defined(Q_OS_WIN)
|
||||
audio = new RtAudio(RtAudio::Api::WINDOWS_WASAPI);
|
||||
#elif defined(Q_OS_MACX)
|
||||
audio = new RtAudio(RtAudio::Api::MACOSX_CORE);
|
||||
#endif
|
||||
|
||||
if (port > 0) {
|
||||
aParams.deviceId = port;
|
||||
}
|
||||
else if (isInput) {
|
||||
aParams.deviceId = audio.getDefaultInputDevice();
|
||||
else if (setup.isinput) {
|
||||
aParams.deviceId = audio->getDefaultInputDevice();
|
||||
}
|
||||
else {
|
||||
aParams.deviceId = audio.getDefaultOutputDevice();
|
||||
aParams.deviceId = audio->getDefaultOutputDevice();
|
||||
}
|
||||
aParams.firstChannel = 0;
|
||||
|
||||
try {
|
||||
info = audio.getDeviceInfo(aParams.deviceId);
|
||||
info = audio->getDeviceInfo(aParams.deviceId);
|
||||
}
|
||||
catch (RtAudioError& e) {
|
||||
qInfo(logAudio()) << "Device error:" << aParams.deviceId << ":" << QString::fromStdString(e.getMessage());
|
||||
return false;
|
||||
return isInitialized;
|
||||
}
|
||||
|
||||
if (info.probed)
|
||||
{
|
||||
// Per channel chunk size.
|
||||
aParams.nChannels = 2; // Internally this is always 2 channels for TX and RX.
|
||||
this->chunkSize = (info.preferredSampleRate / 50);
|
||||
// if "preferred" sample rate is 44100, try 48K instead
|
||||
if (info.preferredSampleRate == (unsigned int)44100) {
|
||||
qDebug(logAudio()) << "Preferred sample rate 44100, trying 48000";
|
||||
this->nativeSampleRate = 48000;
|
||||
}
|
||||
else {
|
||||
this->nativeSampleRate = info.preferredSampleRate;
|
||||
}
|
||||
|
||||
qInfo(logAudio()) << (isInput ? "Input" : "Output") << QString::fromStdString(info.name) << "(" << aParams.deviceId << ") successfully probed";
|
||||
// Per channel chunk size.
|
||||
this->chunkSize = (this->nativeSampleRate / 50);
|
||||
|
||||
qInfo(logAudio()) << (setup.isinput ? "Input" : "Output") << QString::fromStdString(info.name) << "(" << aParams.deviceId << ") successfully probed";
|
||||
if (info.nativeFormats == 0)
|
||||
{
|
||||
qInfo(logAudio()) << " No natively supported data formats!";
|
||||
|
@ -92,9 +150,9 @@ bool audioHandler::init(const quint8 bits, const quint8 radioChan, const quint16
|
|||
(info.nativeFormats & RTAUDIO_FLOAT64 ? "64-bit float," : "");
|
||||
|
||||
qInfo(logAudio()) << " Preferred sample rate:" << info.preferredSampleRate;
|
||||
if (isInput) {
|
||||
if (setup.isinput) {
|
||||
devChannels = info.inputChannels;
|
||||
}
|
||||
}
|
||||
else {
|
||||
devChannels = info.outputChannels;
|
||||
}
|
||||
|
@ -105,54 +163,120 @@ bool audioHandler::init(const quint8 bits, const quint8 radioChan, const quint16
|
|||
aParams.nChannels = devChannels;
|
||||
}
|
||||
|
||||
qInfo(logAudio()) << " chunkSize: " << chunkSize;
|
||||
qInfo(logAudio()) << " chunkSize: " << chunkSize;
|
||||
try {
|
||||
if (setup.isinput) {
|
||||
audio->openStream(NULL, &aParams, RTAUDIO_SINT16, nativeSampleRate, &this->chunkSize, &staticWrite, this, &options);
|
||||
}
|
||||
else {
|
||||
audio->openStream(&aParams, NULL, RTAUDIO_SINT16, this->nativeSampleRate, &this->chunkSize, &staticRead, this, &options);
|
||||
}
|
||||
audio->startStream();
|
||||
isInitialized = true;
|
||||
qInfo(logAudio()) << (setup.isinput ? "Input" : "Output") << "device successfully opened";
|
||||
qInfo(logAudio()) << (setup.isinput ? "Input" : "Output") << "detected latency:" << audio->getStreamLatency();
|
||||
}
|
||||
catch (RtAudioError& e) {
|
||||
qInfo(logAudio()) << "Error opening:" << QString::fromStdString(e.getMessage());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
qCritical(logAudio()) << (isInput ? "Input" : "Output") << QString::fromStdString(info.name) << "(" << aParams.deviceId << ") could not be probed, check audio configuration!";
|
||||
qCritical(logAudio()) << (setup.isinput ? "Input" : "Output") << QString::fromStdString(info.name) << "(" << aParams.deviceId << ") could not be probed, check audio configuration!";
|
||||
}
|
||||
|
||||
|
||||
#elif defined(PORTAUDIO)
|
||||
#else
|
||||
|
||||
format.setSampleSize(16);
|
||||
format.setChannelCount(2);
|
||||
format.setSampleRate(INTERNAL_SAMPLE_RATE);
|
||||
format.setCodec("audio/pcm");
|
||||
format.setByteOrder(QAudioFormat::LittleEndian);
|
||||
format.setSampleType(QAudioFormat::SignedInt);
|
||||
if (setup.port.isNull())
|
||||
{
|
||||
qInfo(logAudio()) << (setup.isinput ? "Input" : "Output") << "No audio device was found. You probably need to install libqt5multimedia-plugins.";
|
||||
return false;
|
||||
}
|
||||
|
||||
int resample_error = 0;
|
||||
|
||||
if (isInput) {
|
||||
resampler = wf_resampler_init(devChannels, info.preferredSampleRate, samplerate, resampleQuality, &resample_error);
|
||||
try {
|
||||
audio.openStream(NULL, &aParams, RTAUDIO_SINT16, info.preferredSampleRate, &this->chunkSize, &staticWrite, this);
|
||||
audio.startStream();
|
||||
}
|
||||
catch (RtAudioError& e) {
|
||||
qInfo(logAudio()) << "Error opening:" << QString::fromStdString(e.getMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
else if (!setup.port.isFormatSupported(format))
|
||||
{
|
||||
resampler = wf_resampler_init(devChannels, samplerate, info.preferredSampleRate, resampleQuality, &resample_error);
|
||||
try {
|
||||
audio.openStream(&aParams, NULL, RTAUDIO_SINT16, info.preferredSampleRate, &this->chunkSize, &staticRead, this);
|
||||
audio.startStream();
|
||||
}
|
||||
catch (RtAudioError& e) {
|
||||
qInfo(logAudio()) << "Error opening:" << QString::fromStdString(e.getMessage());
|
||||
return false;
|
||||
}
|
||||
qInfo(logAudio()) << (setup.isinput ? "Input" : "Output") << "Format not supported, choosing nearest supported format - which may not work!";
|
||||
format=setup.port.nearestFormat(format);
|
||||
}
|
||||
qInfo(logAudio()) << (isInput ? "Input" : "Output") << "device successfully opened";
|
||||
if (format.channelCount() > 2) {
|
||||
format.setChannelCount(2);
|
||||
}
|
||||
devChannels = format.channelCount();
|
||||
nativeSampleRate = format.sampleRate();
|
||||
// chunk size is always relative to Internal Sample Rate.
|
||||
this->chunkSize = (nativeSampleRate / 50);
|
||||
|
||||
qInfo(logAudio()) << (isInput ? "Input" : "Output") << "detected latency:" <<audio.getStreamLatency();
|
||||
qInfo(logAudio()) << (setup.isinput ? "Input" : "Output") << "Internal: sample rate" << format.sampleRate() << "channel count" << format.channelCount();
|
||||
|
||||
// We "hopefully" now have a valid format that is supported so try connecting
|
||||
if (setup.isinput) {
|
||||
audioInput = new QAudioInput(setup.port, format, this);
|
||||
connect(audioInput, SIGNAL(notify()), SLOT(notified()));
|
||||
connect(audioInput, SIGNAL(stateChanged(QAudio::State)), SLOT(stateChanged(QAudio::State)));
|
||||
isInitialized = true;
|
||||
}
|
||||
else {
|
||||
audioOutput = new QAudioOutput(setup.port, format, this);
|
||||
connect(audioOutput, SIGNAL(notify()), SLOT(notified()));
|
||||
connect(audioOutput, SIGNAL(stateChanged(QAudio::State)), SLOT(stateChanged(QAudio::State)));
|
||||
isInitialized = true;
|
||||
}
|
||||
|
||||
#endif
|
||||
// Setup resampler if it is needed.
|
||||
int resample_error = 0;
|
||||
if (setup.isinput) {
|
||||
resampler = wf_resampler_init(devChannels, nativeSampleRate, setup.samplerate, setup.resampleQuality, &resample_error);
|
||||
}
|
||||
else {
|
||||
resampler = wf_resampler_init(devChannels, setup.samplerate, this->nativeSampleRate, setup.resampleQuality, &resample_error);
|
||||
}
|
||||
wf_resampler_get_ratio(resampler, &ratioNum, &ratioDen);
|
||||
qInfo(logAudio()) << (isInput ? "Input" : "Output") << "wf_resampler_init() returned: " << resample_error << " ratioNum" << ratioNum << " ratioDen" << ratioDen;
|
||||
qInfo(logAudio()) << (setup.isinput ? "Input" : "Output") << "wf_resampler_init() returned: " << resample_error << " ratioNum" << ratioNum << " ratioDen" << ratioDen;
|
||||
|
||||
qInfo(logAudio()) << (setup.isinput ? "Input" : "Output") << "thread id" << QThread::currentThreadId();
|
||||
|
||||
|
||||
if (isInitialized) {
|
||||
this->start();
|
||||
}
|
||||
|
||||
qInfo(logAudio()) << (isInput ? "Input" : "Output") << "thread id" << QThread::currentThreadId();
|
||||
return isInitialized;
|
||||
}
|
||||
|
||||
void audioHandler::start()
|
||||
{
|
||||
qInfo(logAudio()) << (setup.isinput ? "Input" : "Output") << "start() running";
|
||||
|
||||
if ((audioOutput == Q_NULLPTR || audioOutput->state() != QAudio::StoppedState) &&
|
||||
(audioInput == Q_NULLPTR || audioInput->state() != QAudio::StoppedState)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (setup.isinput) {
|
||||
this->open(QIODevice::WriteOnly | QIODevice::Unbuffered);
|
||||
//this->open(QIODevice::WriteOnly);
|
||||
audioInput->start(this);
|
||||
}
|
||||
else {
|
||||
this->open(QIODevice::ReadOnly | QIODevice::Unbuffered);
|
||||
//this->open(QIODevice::ReadOnly);
|
||||
audioOutput->start(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void audioHandler::setVolume(unsigned char volume)
|
||||
{
|
||||
this->volume = (qreal)volume/255.0;
|
||||
qInfo(logAudio()) << (isInput ? "Input" : "Output") << "setVolume: " << volume << "(" << this->volume << ")";
|
||||
qInfo(logAudio()) << (setup.isinput ? "Input" : "Output") << "setVolume: " << volume << "(" << this->volume << ")";
|
||||
}
|
||||
|
||||
|
||||
|
@ -163,17 +287,22 @@ void audioHandler::setVolume(unsigned char volume)
|
|||
/// <param name="data"></param>
|
||||
/// <param name="maxlen"></param>
|
||||
/// <returns></returns>
|
||||
#if defined(RTAUDIO)
|
||||
int audioHandler::readData(void* outputBuffer, void* inputBuffer, unsigned int nFrames, double streamTime, RtAudioStreamStatus status)
|
||||
{
|
||||
Q_UNUSED(inputBuffer);
|
||||
Q_UNUSED(streamTime);
|
||||
// Calculate output length, always full samples
|
||||
int sentlen = 0;
|
||||
quint8* buffer = (quint8*)outputBuffer;
|
||||
if (status == RTAUDIO_OUTPUT_UNDERFLOW)
|
||||
qDebug(logAudio()) << "Underflow detected";
|
||||
|
||||
int nBytes = nFrames * devChannels * 2; // This is ALWAYS 2 bytes per sample and 2 channels
|
||||
quint8* buffer = (quint8*)outputBuffer;
|
||||
#elif defined(PORTAUDIO)
|
||||
#else
|
||||
qint64 audioHandler::readData(char* buffer, qint64 nBytes)
|
||||
{
|
||||
#endif
|
||||
// Calculate output length, always full samples
|
||||
int sentlen = 0;
|
||||
|
||||
if (ringBuf->size()>0)
|
||||
{
|
||||
|
@ -206,7 +335,7 @@ int audioHandler::readData(void* outputBuffer, void* inputBuffer, unsigned int n
|
|||
}
|
||||
|
||||
if (currentLatency > (int)audioLatency) {
|
||||
qInfo(logAudio()) << (isInput ? "Input" : "Output") << "Packet " << hex << packet.seq <<
|
||||
qInfo(logAudio()) << (setup.isinput ? "Input" : "Output") << "Packet " << hex << packet.seq <<
|
||||
" arrived too late (increase output latency!) " <<
|
||||
dec << packet.time.msecsTo(QTime::currentTime()) << "ms";
|
||||
lastSeq = packet.seq;
|
||||
|
@ -228,10 +357,10 @@ int audioHandler::readData(void* outputBuffer, void* inputBuffer, unsigned int n
|
|||
}
|
||||
|
||||
if (packet.seq <= lastSeq) {
|
||||
qDebug(logAudio()) << (isInput ? "Input" : "Output") << "Duplicate/early audio packet: " << hex << lastSeq << " got " << hex << packet.seq;
|
||||
qDebug(logAudio()) << (setup.isinput ? "Input" : "Output") << "Duplicate/early audio packet: " << hex << lastSeq << " got " << hex << packet.seq;
|
||||
}
|
||||
else if (packet.seq != lastSeq + 1) {
|
||||
qDebug(logAudio()) << (isInput ? "Input" : "Output") << "Missing audio packet(s) from: " << hex << lastSeq + 1 << " to " << hex << packet.seq - 1;
|
||||
qDebug(logAudio()) << (setup.isinput ? "Input" : "Output") << "Missing audio packet(s) from: " << hex << lastSeq + 1 << " to " << hex << packet.seq - 1;
|
||||
}
|
||||
lastSeq = packet.seq;
|
||||
}
|
||||
|
@ -242,23 +371,34 @@ int audioHandler::readData(void* outputBuffer, void* inputBuffer, unsigned int n
|
|||
if (nBytes > sentlen) {
|
||||
memset(buffer+sentlen,0,nBytes-sentlen);
|
||||
}
|
||||
#if defined(RTAUDIO)
|
||||
return 0;
|
||||
#elif defined(PORTAUDIO)
|
||||
#else
|
||||
return nBytes;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
#if defined(RTAUDIO)
|
||||
int audioHandler::writeData(void* outputBuffer, void* inputBuffer, unsigned int nFrames, double streamTime, RtAudioStreamStatus status)
|
||||
{
|
||||
Q_UNUSED(outputBuffer);
|
||||
Q_UNUSED(streamTime);
|
||||
Q_UNUSED(status);
|
||||
int sentlen = 0;
|
||||
int nBytes = nFrames * devChannels * 2; // This is ALWAYS 2 bytes per sample
|
||||
int nBytes = nFrames * devChannels * 2; // This is ALWAYS 2 bytes per sample and 2 channels
|
||||
const char* data = (const char*)inputBuffer;
|
||||
#elif defined(PORTAUDIO)
|
||||
#else
|
||||
qint64 audioHandler::writeData(const char* data, qint64 nBytes)
|
||||
{
|
||||
#endif
|
||||
int sentlen = 0;
|
||||
//qDebug(logAudio()) << "nFrames" << nFrames << "nBytes" << nBytes;
|
||||
int chunkBytes = chunkSize * devChannels * 2;
|
||||
while (sentlen < nBytes) {
|
||||
if (tempBuf.sent != nBytes)
|
||||
if (tempBuf.sent != chunkBytes)
|
||||
{
|
||||
int send = qMin((int)(nBytes - sentlen), (int)nBytes - tempBuf.sent);
|
||||
int send = qMin((int)(nBytes - sentlen), chunkBytes - tempBuf.sent);
|
||||
tempBuf.data.append(QByteArray::fromRawData(data + sentlen, send));
|
||||
sentlen = sentlen + send;
|
||||
tempBuf.seq = 0; // Not used in TX
|
||||
|
@ -266,19 +406,25 @@ int audioHandler::writeData(void* outputBuffer, void* inputBuffer, unsigned int
|
|||
tempBuf.sent = tempBuf.sent + send;
|
||||
}
|
||||
else {
|
||||
ringBuf->write(tempBuf);
|
||||
/*
|
||||
if (!ringBuf->try_write(tempBuf))
|
||||
{
|
||||
qDebug(logAudio()) << "outgoing audio buffer full!";
|
||||
break;
|
||||
}
|
||||
} */
|
||||
tempBuf.data.clear();
|
||||
tempBuf.sent = 0;
|
||||
}
|
||||
}
|
||||
|
||||
//qDebug(logAudio()) << "sentlen" << sentlen;
|
||||
|
||||
return 0;
|
||||
#if defined(RTAUDIO)
|
||||
return 0;
|
||||
#elif defined(PORTAUDIO)
|
||||
#else
|
||||
return nBytes;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -288,21 +434,21 @@ void audioHandler::incomingAudio(audioPacket inPacket)
|
|||
// Regardless of the radio stream format, the buffered audio will ALWAYS be
|
||||
// 16bit sample interleaved stereo 48K (or whatever the native sample rate is)
|
||||
|
||||
if (!audio.isStreamRunning())
|
||||
if (!isInitialized)
|
||||
{
|
||||
qDebug(logAudio()) << "Packet received before stream was started";
|
||||
return;
|
||||
}
|
||||
//qDebug(logAudio()) << "Got" << radioSampleBits << "bits, length" << inPacket.data.length();
|
||||
// Incoming data is 8bits?
|
||||
if (radioSampleBits == 8)
|
||||
if (setup.bits == 8)
|
||||
{
|
||||
// Current packet is 8bit so need to create a new buffer that is 16bit
|
||||
QByteArray outPacket((int)inPacket.data.length() * 2 *(devChannels/radioChannels), (char)0xff);
|
||||
QByteArray outPacket((int)inPacket.data.length() * 2 *(devChannels/setup.radioChan), (char)0xff);
|
||||
qint16* out = (qint16*)outPacket.data();
|
||||
for (int f = 0; f < inPacket.data.length(); f++)
|
||||
{
|
||||
for (int g = radioChannels; g <= devChannels; g++)
|
||||
for (int g = setup.radioChan; g <= devChannels; g++)
|
||||
{
|
||||
if (isUlaw)
|
||||
*out++ = ulaw_decode[(quint8)inPacket.data[f]] * this->volume;
|
||||
|
@ -316,7 +462,7 @@ void audioHandler::incomingAudio(audioPacket inPacket)
|
|||
else
|
||||
{
|
||||
// This is already a 16bit stream, do we need to convert to stereo?
|
||||
if (radioChannels == 1 && devChannels > 1) {
|
||||
if (setup.radioChan == 1 && devChannels > 1) {
|
||||
// Yes
|
||||
QByteArray outPacket(inPacket.data.length() * 2, (char)0xff); // Preset the output buffer size.
|
||||
qint16* in = (qint16*)inPacket.data.data();
|
||||
|
@ -361,7 +507,7 @@ void audioHandler::incomingAudio(audioPacket inPacket)
|
|||
int err = 0;
|
||||
err = wf_resampler_process_interleaved_int(resampler, in, &inFrames, out, &outFrames);
|
||||
if (err) {
|
||||
qInfo(logAudio()) << (isInput ? "Input" : "Output") << "Resampler error " << err << " inFrames:" << inFrames << " outFrames:" << outFrames;
|
||||
qInfo(logAudio()) << (setup.isinput ? "Input" : "Output") << "Resampler error " << err << " inFrames:" << inFrames << " outFrames:" << outFrames;
|
||||
}
|
||||
inPacket.data.clear();
|
||||
inPacket.data = outPacket; // Replace incoming data with converted.
|
||||
|
@ -378,7 +524,7 @@ void audioHandler::incomingAudio(audioPacket inPacket)
|
|||
|
||||
void audioHandler::changeLatency(const quint16 newSize)
|
||||
{
|
||||
qInfo(logAudio()) << (isInput ? "Input" : "Output") << "Changing latency to: " << newSize << " from " << audioLatency;
|
||||
qInfo(logAudio()) << (setup.isinput ? "Input" : "Output") << "Changing latency to: " << newSize << " from " << audioLatency;
|
||||
audioLatency = newSize;
|
||||
}
|
||||
|
||||
|
@ -392,7 +538,7 @@ void audioHandler::getNextAudioChunk(QByteArray& ret)
|
|||
audioPacket packet;
|
||||
packet.sent = 0;
|
||||
|
||||
if (ringBuf != Q_NULLPTR && ringBuf->try_read(packet))
|
||||
if (isInitialized && ringBuf != Q_NULLPTR && ringBuf->try_read(packet))
|
||||
{
|
||||
|
||||
//qDebug(logAudio) << "Chunksize" << this->chunkSize << "Packet size" << packet.data.length();
|
||||
|
@ -409,7 +555,7 @@ void audioHandler::getNextAudioChunk(QByteArray& ret)
|
|||
int err = 0;
|
||||
err = wf_resampler_process_interleaved_int(resampler, in, &inFrames, out, &outFrames);
|
||||
if (err) {
|
||||
qInfo(logAudio()) << (isInput ? "Input" : "Output") << "Resampler error " << err << " inFrames:" << inFrames << " outFrames:" << outFrames;
|
||||
qInfo(logAudio()) << (setup.isinput ? "Input" : "Output") << "Resampler error " << err << " inFrames:" << inFrames << " outFrames:" << outFrames;
|
||||
}
|
||||
//qInfo(logAudio()) << "Resampler run " << err << " inFrames:" << inFrames << " outFrames:" << outFrames;
|
||||
//qInfo(logAudio()) << "Resampler run inLen:" << packet->datain.length() << " outLen:" << packet->dataout.length();
|
||||
|
@ -420,7 +566,7 @@ void audioHandler::getNextAudioChunk(QByteArray& ret)
|
|||
//qDebug(logAudio()) << "Now resampled, length" << packet.data.length();
|
||||
|
||||
// Do we need to convert mono to stereo?
|
||||
if (radioChannels == 1 && devChannels > 1)
|
||||
if (setup.radioChan == 1 && devChannels > 1)
|
||||
{
|
||||
// Strip out right channel?
|
||||
QByteArray outPacket(packet.data.length()/2, (char)0xff);
|
||||
|
@ -438,7 +584,7 @@ void audioHandler::getNextAudioChunk(QByteArray& ret)
|
|||
//qDebug(logAudio()) << "Now mono, length" << packet.data.length();
|
||||
|
||||
// Do we need to convert 16-bit to 8-bit?
|
||||
if (radioSampleBits == 8) {
|
||||
if (setup.bits == 8) {
|
||||
QByteArray outPacket((int)packet.data.length() / 2, (char)0xff);
|
||||
qint16* in = (qint16*)packet.data.data();
|
||||
for (int f = 0; f < outPacket.length(); f++)
|
||||
|
@ -469,4 +615,74 @@ void audioHandler::getNextAudioChunk(QByteArray& ret)
|
|||
}
|
||||
|
||||
|
||||
qint64 audioHandler::bytesAvailable() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool audioHandler::isSequential() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void audioHandler::notified()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void audioHandler::stateChanged(QAudio::State state)
|
||||
{
|
||||
// Process the state
|
||||
switch (state)
|
||||
{
|
||||
case QAudio::IdleState:
|
||||
{
|
||||
qInfo(logAudio()) << (setup.isinput ? "Input" : "Output") << "Audio now in idle state: " << audioBuffer.size() << " packets in buffer";
|
||||
if (audioOutput != Q_NULLPTR && audioOutput->error() == QAudio::UnderrunError)
|
||||
{
|
||||
qInfo(logAudio()) << (setup.isinput ? "Input" : "Output") << "buffer underrun";
|
||||
//audioOutput->suspend();
|
||||
}
|
||||
break;
|
||||
}
|
||||
case QAudio::ActiveState:
|
||||
{
|
||||
qInfo(logAudio()) << (setup.isinput ? "Input" : "Output") << "Audio now in active state: " << audioBuffer.size() << " packets in buffer";
|
||||
break;
|
||||
}
|
||||
case QAudio::SuspendedState:
|
||||
{
|
||||
qInfo(logAudio()) << (setup.isinput ? "Input" : "Output") << "Audio now in suspended state: " << audioBuffer.size() << " packets in buffer";
|
||||
break;
|
||||
}
|
||||
case QAudio::StoppedState:
|
||||
{
|
||||
qInfo(logAudio()) << (setup.isinput ? "Input" : "Output") << "Audio now in stopped state: " << audioBuffer.size() << " packets in buffer";
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
qInfo(logAudio()) << (setup.isinput ? "Input" : "Output") << "Unhandled audio state: " << audioBuffer.size() << " packets in buffer";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void audioHandler::stop()
|
||||
{
|
||||
if (audioOutput != Q_NULLPTR && audioOutput->state() != QAudio::StoppedState) {
|
||||
// Stop audio output
|
||||
audioOutput->stop();
|
||||
this->stop();
|
||||
this->close();
|
||||
}
|
||||
|
||||
if (audioInput != Q_NULLPTR && audioInput->state() != QAudio::StoppedState) {
|
||||
// Stop audio output
|
||||
audioInput->stop();
|
||||
this->stop();
|
||||
this->close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -3,12 +3,22 @@
|
|||
|
||||
#include <QObject>
|
||||
|
||||
#include <QtMultimedia/QAudioOutput>
|
||||
#include <QByteArray>
|
||||
#include <QMutex>
|
||||
#include <QtEndian>
|
||||
#include <QtMath>
|
||||
#include "rtaudio/RtAudio.h"
|
||||
|
||||
#if defined(RTAUDIO)
|
||||
#include "RtAudio.h"
|
||||
#elif defined (PORTAUDIO)
|
||||
#include "portaudio.h"
|
||||
#else
|
||||
#include <QAudioOutput>
|
||||
#include <QAudioFormat>
|
||||
#include <QAudioDeviceInfo>
|
||||
#include <QAudioInput>
|
||||
#include <QIODevice>
|
||||
#endif
|
||||
|
||||
typedef signed short MY_TYPE;
|
||||
#define FORMAT RTAUDIO_SINT16
|
||||
|
@ -40,7 +50,30 @@ struct audioPacket {
|
|||
QByteArray data;
|
||||
};
|
||||
|
||||
struct audioSetup {
|
||||
QString name;
|
||||
quint8 bits;
|
||||
quint8 radioChan;
|
||||
quint16 samplerate;
|
||||
quint16 latency;
|
||||
quint8 codec;
|
||||
bool ulaw;
|
||||
bool isinput;
|
||||
#if defined(RTAUDIO)
|
||||
int port;
|
||||
#elif defined(PORTAUDIO)
|
||||
#else
|
||||
QAudioDeviceInfo port;
|
||||
#endif
|
||||
quint8 resampleQuality;
|
||||
};
|
||||
|
||||
// For QtMultimedia, use a native QIODevice
|
||||
#if !defined(PORTAUDIO) && !defined(RTAUDIO)
|
||||
class audioHandler : public QIODevice
|
||||
#else
|
||||
class audioHandler : public QObject
|
||||
#endif
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
@ -50,14 +83,26 @@ public:
|
|||
|
||||
int getLatency();
|
||||
|
||||
bool setDevice(QAudioDeviceInfo deviceInfo);
|
||||
|
||||
void start();
|
||||
void flush();
|
||||
void stop();
|
||||
qint64 bytesAvailable() const;
|
||||
bool isSequential() const;
|
||||
|
||||
void getNextAudioChunk(QByteArray &data);
|
||||
|
||||
private slots:
|
||||
bool init(const quint8 bits, const quint8 channels, const quint16 samplerate, const quint16 latency, const bool isulaw, const bool isinput, int port, quint8 resampleQuality);
|
||||
public slots:
|
||||
bool init(audioSetup setup);
|
||||
void changeLatency(const quint16 newSize);
|
||||
void setVolume(unsigned char volume);
|
||||
void incomingAudio(const audioPacket data);
|
||||
|
||||
private slots:
|
||||
void notified();
|
||||
void stateChanged(QAudio::State state);
|
||||
|
||||
signals:
|
||||
void audioMessage(QString message);
|
||||
void sendLatency(quint16 newSize);
|
||||
|
@ -65,6 +110,8 @@ signals:
|
|||
|
||||
|
||||
private:
|
||||
|
||||
#if defined(RTAUDIO)
|
||||
int readData(void* outputBuffer, void* inputBuffer, unsigned int nFrames, double streamTime, RtAudioStreamStatus status);
|
||||
|
||||
static int staticRead(void* outputBuffer, void* inputBuffer, unsigned int nFrames, double streamTime, RtAudioStreamStatus status, void* userData) {
|
||||
|
@ -76,15 +123,29 @@ private:
|
|||
static int staticWrite(void* outputBuffer, void* inputBuffer, unsigned int nFrames, double streamTime, RtAudioStreamStatus status, void* userData) {
|
||||
return static_cast<audioHandler*>(userData)->writeData(outputBuffer, inputBuffer, nFrames, streamTime, status);
|
||||
}
|
||||
#elif defined(PORTAUDIO)
|
||||
|
||||
#else
|
||||
qint64 readData(char* data, qint64 nBytes);
|
||||
qint64 writeData(const char* data, qint64 nBytes);
|
||||
#endif
|
||||
|
||||
void reinit();
|
||||
bool isInitialized=false;
|
||||
|
||||
bool isInitialized;
|
||||
RtAudio audio;
|
||||
#if defined(RTAUDIO)
|
||||
RtAudio* audio = Q_NULLPTR;
|
||||
int audioDevice = 0;
|
||||
RtAudio::StreamParameters aParams;
|
||||
RtAudio::StreamOptions options;
|
||||
RtAudio::DeviceInfo info;
|
||||
|
||||
#elif defined(PORTAUDIO)
|
||||
#else
|
||||
QAudioOutput* audioOutput=Q_NULLPTR;
|
||||
QAudioInput* audioInput=Q_NULLPTR;
|
||||
QAudioFormat format;
|
||||
QAudioDeviceInfo deviceInfo;
|
||||
#endif
|
||||
SpeexResamplerState* resampler = Q_NULLPTR;
|
||||
|
||||
bool isUlaw;
|
||||
|
@ -93,10 +154,11 @@ private:
|
|||
unsigned int chunkSize;
|
||||
bool chunkAvailable;
|
||||
|
||||
quint32 lastSeq;
|
||||
quint32 lastSeq;
|
||||
|
||||
quint16 radioSampleRate;
|
||||
quint8 radioSampleBits;
|
||||
quint16 radioSampleRate;
|
||||
quint16 nativeSampleRate=0;
|
||||
quint8 radioSampleBits;
|
||||
quint8 radioChannels;
|
||||
|
||||
QMap<quint32, audioPacket>audioBuffer;
|
||||
|
@ -105,11 +167,13 @@ private:
|
|||
unsigned int ratioDen;
|
||||
|
||||
wilt::Ring<audioPacket> *ringBuf=Q_NULLPTR;
|
||||
|
||||
volatile bool ready = false;
|
||||
audioPacket tempBuf;
|
||||
quint16 currentLatency;
|
||||
qreal volume=1.0;
|
||||
int devChannels;
|
||||
audioSetup setup;
|
||||
};
|
||||
|
||||
#endif // AUDIOHANDLER_H
|
||||
|
|
|
@ -74,7 +74,7 @@ void rigCommander::commSetup(unsigned char rigCivAddr, QString rigSerialPort, qu
|
|||
|
||||
}
|
||||
|
||||
void rigCommander::commSetup(unsigned char rigCivAddr, udpPreferences prefs, QString vsp)
|
||||
void rigCommander::commSetup(unsigned char rigCivAddr, udpPreferences prefs, audioSetup rxSetup, audioSetup txSetup, QString vsp)
|
||||
{
|
||||
// construct
|
||||
// TODO: Bring this parameter and the comm port from the UI.
|
||||
|
@ -90,7 +90,7 @@ void rigCommander::commSetup(unsigned char rigCivAddr, udpPreferences prefs, QSt
|
|||
|
||||
if (udp == Q_NULLPTR) {
|
||||
|
||||
udp = new udpHandler(prefs);
|
||||
udp = new udpHandler(prefs,rxSetup,txSetup);
|
||||
|
||||
udpHandlerThread = new QThread(this);
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ public:
|
|||
public slots:
|
||||
void process();
|
||||
void commSetup(unsigned char rigCivAddr, QString rigSerialPort, quint32 rigBaudRate,QString vsp);
|
||||
void commSetup(unsigned char rigCivAddr, udpPreferences prefs, QString vsp);
|
||||
void commSetup(unsigned char rigCivAddr, udpPreferences prefs, audioSetup rxSetup, audioSetup txSetup, QString vsp);
|
||||
void closeComm();
|
||||
|
||||
// Power:
|
||||
|
|
|
@ -4,28 +4,22 @@
|
|||
#include "udphandler.h"
|
||||
#include "logcategories.h"
|
||||
|
||||
udpHandler::udpHandler(udpPreferences prefs) :
|
||||
udpHandler::udpHandler(udpPreferences prefs,audioSetup rx, audioSetup tx) :
|
||||
controlPort(prefs.controlLANPort),
|
||||
civPort(0),
|
||||
audioPort(0),
|
||||
rxSampleRate(prefs.audioRXSampleRate),
|
||||
txSampleRate(prefs.audioRXSampleRate),
|
||||
rxLatency(prefs.audioRXLatency),
|
||||
txLatency(prefs.audioTXLatency),
|
||||
rxCodec(prefs.audioRXCodec),
|
||||
txCodec(prefs.audioTXCodec),
|
||||
audioInputPort(prefs.audioInput),
|
||||
audioOutputPort(prefs.audioOutput),
|
||||
resampleQuality(prefs.resampleQuality)
|
||||
rxSetup(rx),
|
||||
txSetup(tx)
|
||||
{
|
||||
|
||||
|
||||
this->port = this->controlPort;
|
||||
this->username = prefs.username;
|
||||
this->password = prefs.password;
|
||||
this->compName = prefs.clientName.mid(0,8) + "-wfview";
|
||||
|
||||
qInfo(logUdp()) << "Starting udpHandler user:" << username << " rx latency:" << rxLatency << " tx latency:" << txLatency << " rx sample rate: " << rxSampleRate <<
|
||||
" rx codec: " << rxCodec << " tx sample rate: " << txSampleRate << " tx codec: " << txCodec;
|
||||
qInfo(logUdp()) << "Starting udpHandler user:" << username << " rx latency:" << rxSetup.latency << " tx latency:" << txSetup.latency << " rx sample rate: " << rxSetup.samplerate <<
|
||||
" rx codec: " << rxSetup.codec << " tx sample rate: " << txSetup.samplerate << " tx codec: " << txSetup.codec;
|
||||
|
||||
// Try to set the IP address, if it is a hostname then perform a DNS lookup.
|
||||
if (!radioIP.setAddress(prefs.ipAddress))
|
||||
|
@ -190,7 +184,7 @@ void udpHandler::dataReceived()
|
|||
}
|
||||
|
||||
QString tempLatency;
|
||||
if (rxLatency > audio->audioLatency)
|
||||
if (rxSetup.latency > audio->audioLatency)
|
||||
{
|
||||
tempLatency = QString("%1 ms").arg(audio->audioLatency,3);
|
||||
}
|
||||
|
@ -324,10 +318,11 @@ void udpHandler::dataReceived()
|
|||
|
||||
// TX is not supported
|
||||
if (txSampleRates <2 ) {
|
||||
txSampleRate = 0;
|
||||
txCodec = 0;
|
||||
txSetup.samplerate = 0;
|
||||
txSetup.codec = 0;
|
||||
}
|
||||
audio = new udpAudio(localIP, radioIP, audioPort, rxLatency, txLatency, rxSampleRate, rxCodec, txSampleRate, txCodec, audioOutputPort, audioInputPort,resampleQuality);
|
||||
|
||||
audio = new udpAudio(localIP, radioIP, audioPort, rxSetup, txSetup);
|
||||
|
||||
QObject::connect(civ, SIGNAL(receive(QByteArray)), this, SLOT(receiveFromCivStream(QByteArray)));
|
||||
QObject::connect(audio, SIGNAL(haveAudioData(audioPacket)), this, SLOT(receiveAudioData(audioPacket)));
|
||||
|
@ -425,15 +420,15 @@ void udpHandler::sendRequestStream()
|
|||
p.rxenable = 1;
|
||||
if (this->txSampleRates > 1) {
|
||||
p.txenable = 1;
|
||||
p.txcodec = txCodec;
|
||||
p.txcodec = txSetup.codec;
|
||||
}
|
||||
p.rxcodec = rxCodec;
|
||||
p.rxcodec = rxSetup.codec;
|
||||
memcpy(&p.username, usernameEncoded.constData(), usernameEncoded.length());
|
||||
p.rxsample = qToBigEndian((quint32)rxSampleRate);
|
||||
p.txsample = qToBigEndian((quint32)txSampleRate);
|
||||
p.rxsample = qToBigEndian((quint32)rxSetup.samplerate);
|
||||
p.txsample = qToBigEndian((quint32)txSetup.samplerate);
|
||||
p.civport = qToBigEndian((quint32)civPort);
|
||||
p.audioport = qToBigEndian((quint32)audioPort);
|
||||
p.txbuffer = qToBigEndian((quint32)txLatency);
|
||||
p.txbuffer = qToBigEndian((quint32)txSetup.latency);
|
||||
p.convert = 1;
|
||||
sendTrackedPacket(QByteArray::fromRawData((const char*)p.packet, sizeof(p)));
|
||||
return;
|
||||
|
@ -699,18 +694,12 @@ void udpCivData::dataReceived()
|
|||
|
||||
|
||||
// Audio stream
|
||||
udpAudio::udpAudio(QHostAddress local, QHostAddress ip, quint16 audioPort, quint16 rxlatency, quint16 txlatency, quint16 rxsample, quint8 rxcodec, quint16 txsample, quint8 txcodec, int outputPort, int inputPort, quint8 resampleQuality)
|
||||
udpAudio::udpAudio(QHostAddress local, QHostAddress ip, quint16 audioPort, audioSetup rxSetup, audioSetup txSetup)
|
||||
{
|
||||
qInfo(logUdp()) << "Starting udpAudio";
|
||||
this->localIP = local;
|
||||
this->port = audioPort;
|
||||
this->radioIP = ip;
|
||||
this->rxLatency = rxlatency;
|
||||
this->txLatency = txlatency;
|
||||
this->rxSampleRate = rxsample;
|
||||
this->txSampleRate = txsample;
|
||||
this->rxCodec = rxcodec;
|
||||
this->txCodec = txcodec;
|
||||
|
||||
if (txSampleRate == 0) {
|
||||
enableTx = false;
|
||||
|
@ -720,27 +709,6 @@ udpAudio::udpAudio(QHostAddress local, QHostAddress ip, quint16 audioPort, quint
|
|||
|
||||
QUdpSocket::connect(udp, &QUdpSocket::readyRead, this, &udpAudio::dataReceived);
|
||||
|
||||
/*
|
||||
0x72 is RX audio codec
|
||||
0x73 is TX audio codec (only single channel options)
|
||||
0x01 uLaw 1ch 8bit
|
||||
0x02 PCM 1ch 8bit
|
||||
0x04 PCM 1ch 16bit
|
||||
0x08 PCM 2ch 8bit
|
||||
0x10 PCM 2ch 16bit
|
||||
0x20 uLaw 2ch 8bit
|
||||
*/
|
||||
|
||||
if (rxCodec == 0x01 || rxCodec == 0x20) {
|
||||
rxIsUlawCodec = true;
|
||||
}
|
||||
if (rxCodec == 0x08 || rxCodec == 0x10 || rxCodec == 0x20) {
|
||||
rxChannelCount = 2;
|
||||
}
|
||||
if (rxCodec == 0x04 || rxCodec == 0x10) {
|
||||
rxNumSamples = 16;
|
||||
}
|
||||
|
||||
rxaudio = new audioHandler();
|
||||
rxAudioThread = new QThread(this);
|
||||
|
||||
|
@ -748,7 +716,7 @@ udpAudio::udpAudio(QHostAddress local, QHostAddress ip, quint16 audioPort, quint
|
|||
|
||||
rxAudioThread->start();
|
||||
|
||||
connect(this, SIGNAL(setupRxAudio(quint8,quint8,quint16,quint16,bool,bool,int,quint8)), rxaudio, SLOT(init(quint8,quint8,quint16,quint16,bool,bool,int,quint8)));
|
||||
connect(this, SIGNAL(setupRxAudio(audioSetup)), rxaudio, SLOT(init(audioSetup)));
|
||||
|
||||
// signal/slot not currently used.
|
||||
connect(this, SIGNAL(haveAudioData(audioPacket)), rxaudio, SLOT(incomingAudio(audioPacket)));
|
||||
|
@ -756,13 +724,7 @@ udpAudio::udpAudio(QHostAddress local, QHostAddress ip, quint16 audioPort, quint
|
|||
connect(this, SIGNAL(haveSetVolume(unsigned char)), rxaudio, SLOT(setVolume(unsigned char)));
|
||||
connect(rxAudioThread, SIGNAL(finished()), rxaudio, SLOT(deleteLater()));
|
||||
|
||||
|
||||
if (txCodec == 0x01)
|
||||
txIsUlawCodec = true;
|
||||
else if (txCodec == 0x04)
|
||||
txNumSamples = 16;
|
||||
|
||||
txChannelCount = 1; // Only 1 channel is supported.
|
||||
txSetup.radioChan = 1;
|
||||
|
||||
txaudio = new audioHandler();
|
||||
txAudioThread = new QThread(this);
|
||||
|
@ -771,7 +733,7 @@ udpAudio::udpAudio(QHostAddress local, QHostAddress ip, quint16 audioPort, quint
|
|||
|
||||
txAudioThread->start();
|
||||
|
||||
connect(this, SIGNAL(setupTxAudio(quint8,quint8,quint16,quint16,bool,bool,int,quint8)), txaudio, SLOT(init(quint8,quint8,quint16,quint16,bool,bool,int,quint8)));
|
||||
connect(this, SIGNAL(setupTxAudio(audioSetup)), txaudio, SLOT(init(audioSetup)));
|
||||
|
||||
connect(txAudioThread, SIGNAL(finished()), txaudio, SLOT(deleteLater()));
|
||||
|
||||
|
@ -782,10 +744,10 @@ udpAudio::udpAudio(QHostAddress local, QHostAddress ip, quint16 audioPort, quint
|
|||
pingTimer->start(PING_PERIOD); // send ping packets every 100ms
|
||||
|
||||
if (enableTx) {
|
||||
emit setupTxAudio(txNumSamples, txChannelCount, txSampleRate, txLatency, txIsUlawCodec, true, inputPort, resampleQuality);
|
||||
emit setupTxAudio(txSetup);
|
||||
}
|
||||
|
||||
emit setupRxAudio(rxNumSamples, rxChannelCount, rxSampleRate, txLatency, rxIsUlawCodec, false, outputPort,resampleQuality);
|
||||
emit setupRxAudio(rxSetup);
|
||||
|
||||
watchdogTimer = new QTimer();
|
||||
connect(watchdogTimer, &QTimer::timeout, this, &udpAudio::watchdog);
|
||||
|
|
23
udphandler.h
23
udphandler.h
|
@ -16,7 +16,6 @@
|
|||
#include <QtEndian>
|
||||
|
||||
// Needed for audio
|
||||
#include <QtMultimedia/QAudioOutput>
|
||||
#include <QBuffer>
|
||||
#include <QThread>
|
||||
|
||||
|
@ -175,7 +174,7 @@ class udpAudio : public udpBase
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
udpAudio(QHostAddress local, QHostAddress ip, quint16 aport, quint16 rxlatency, quint16 txlatency, quint16 rxsample, quint8 rxcodec, quint16 txsample, quint8 txcodec, int outputPort, int inputPort, quint8 resampleQuality);
|
||||
udpAudio(QHostAddress local, QHostAddress ip, quint16 aport, audioSetup rxSetup, audioSetup txSetup);
|
||||
~udpAudio();
|
||||
|
||||
int audioLatency = 0;
|
||||
|
@ -183,8 +182,8 @@ public:
|
|||
signals:
|
||||
void haveAudioData(audioPacket data);
|
||||
|
||||
void setupTxAudio(const quint8 samples, const quint8 channels, const quint16 samplerate, const quint16 latency, const bool isUlaw, const bool isInput, int port, quint8 resampleQuality);
|
||||
void setupRxAudio(const quint8 samples, const quint8 channels, const quint16 samplerate, const quint16 latency, const bool isUlaw, const bool isInput, int port, quint8 resampleQuality);
|
||||
void setupTxAudio(audioSetup setup);
|
||||
void setupRxAudio(audioSetup setup);
|
||||
|
||||
void haveChangeLatency(quint16 value);
|
||||
void haveSetVolume(unsigned char value);
|
||||
|
@ -199,7 +198,6 @@ private:
|
|||
void dataReceived();
|
||||
void watchdog();
|
||||
|
||||
QAudioFormat format;
|
||||
quint16 rxLatency;
|
||||
quint16 txLatency;
|
||||
quint16 rxSampleRate;
|
||||
|
@ -235,7 +233,7 @@ class udpHandler: public udpBase
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
udpHandler(udpPreferences prefs);
|
||||
udpHandler(udpPreferences prefs, audioSetup rxAudio, audioSetup txAudio);
|
||||
~udpHandler();
|
||||
|
||||
bool streamOpened = false;
|
||||
|
@ -284,17 +282,8 @@ private:
|
|||
quint16 civPort;
|
||||
quint16 audioPort;
|
||||
|
||||
quint16 rxSampleRate;
|
||||
quint16 txSampleRate;
|
||||
quint16 rxLatency;
|
||||
quint16 txLatency;
|
||||
quint8 rxCodec;
|
||||
quint8 txCodec;
|
||||
|
||||
int audioInputPort;
|
||||
int audioOutputPort;
|
||||
|
||||
quint8 resampleQuality;
|
||||
audioSetup rxSetup;
|
||||
audioSetup txSetup;
|
||||
|
||||
quint16 reauthInterval = 60000;
|
||||
QString devName;
|
||||
|
|
1071
udpserver.cpp
1071
udpserver.cpp
Plik diff jest za duży
Load Diff
18
udpserver.h
18
udpserver.h
|
@ -12,6 +12,7 @@
|
|||
#include <QByteArray>
|
||||
#include <QList>
|
||||
#include <QVector>
|
||||
#include <QMap>
|
||||
|
||||
// Allow easy endian-ness conversions
|
||||
#include <QtEndian>
|
||||
|
@ -38,7 +39,7 @@ class udpServer : public QObject
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
udpServer(SERVERCONFIG config);
|
||||
udpServer(SERVERCONFIG config,audioSetup outAudio, audioSetup inAudio);
|
||||
~udpServer();
|
||||
|
||||
public slots:
|
||||
|
@ -51,8 +52,8 @@ signals:
|
|||
void haveDataFromServer(QByteArray);
|
||||
void haveAudioData(audioPacket data);
|
||||
|
||||
void setupTxAudio(const quint8 samples, const quint8 channels, const quint16 samplerate, const quint16 latency, const bool isUlaw, const bool isInput, int device, quint8 resampleQuality);
|
||||
void setupRxAudio(const quint8 samples, const quint8 channels, const quint16 samplerate, const quint16 latency, const bool isUlaw, const bool isInput, int device, quint8 resampleQuality);
|
||||
void setupTxAudio(audioSetup);
|
||||
void setupRxAudio(audioSetup);
|
||||
|
||||
|
||||
|
||||
|
@ -102,9 +103,11 @@ private:
|
|||
quint16 txSampleRate;
|
||||
SERVERUSER user;
|
||||
|
||||
QVector <SEQBUFENTRY> txSeqBuf;
|
||||
QVector <quint16> rxSeqBuf;
|
||||
QVector <SEQBUFENTRY> rxMissing;
|
||||
|
||||
QMap<quint16, QTime> rxSeqBuf;
|
||||
QMap<quint16, SEQBUFENTRY> txSeqBuf;
|
||||
QMap<quint16, int> rxMissing;
|
||||
|
||||
QMutex txMutex;
|
||||
QMutex rxMutex;
|
||||
QMutex missMutex;
|
||||
|
@ -160,6 +163,9 @@ private:
|
|||
audioHandler* txaudio = Q_NULLPTR;
|
||||
QThread* txAudioThread = Q_NULLPTR;
|
||||
|
||||
audioSetup outAudio;
|
||||
audioSetup inAudio;
|
||||
|
||||
QTimer* rxAudioTimer=Q_NULLPTR;
|
||||
quint16 rxSampleRate = 0;
|
||||
quint16 txSampleRate = 0;
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
#include <QDialog>
|
||||
#include <QComboBox>
|
||||
#include <QList>
|
||||
#include <QAudioDeviceInfo>
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
|
|
169
wfmain.cpp
169
wfmain.cpp
|
@ -39,6 +39,7 @@ wfmain::wfmain(const QString serialPortCL, const QString hostCL, const QString s
|
|||
qRegisterMetaType<spectrumMode>();
|
||||
qRegisterMetaType<freqt>();
|
||||
qRegisterMetaType<audioPacket>();
|
||||
qRegisterMetaType <audioSetup>();
|
||||
|
||||
haveRigCaps = false;
|
||||
|
||||
|
@ -159,7 +160,8 @@ void wfmain::openRig()
|
|||
if (prefs.enableLAN)
|
||||
{
|
||||
ui->lanEnableBtn->setChecked(true);
|
||||
emit sendCommSetup(prefs.radioCIVAddr, udpPrefs,prefs.virtualSerialPort);
|
||||
// We need to setup the tx/rx audio:
|
||||
emit sendCommSetup(prefs.radioCIVAddr, udpPrefs, rxSetup, txSetup, prefs.virtualSerialPort);
|
||||
} else {
|
||||
ui->serialEnableBtn->setChecked(true);
|
||||
if( (prefs.serialPortRadio.toLower() == QString("auto")) && (serialPortCL.isEmpty()))
|
||||
|
@ -357,7 +359,7 @@ void wfmain::makeRig()
|
|||
connect(rig, SIGNAL(haveStatusUpdate(QString)), this, SLOT(receiveStatusUpdate(QString)));
|
||||
|
||||
// Rig comm setup:
|
||||
connect(this, SIGNAL(sendCommSetup(unsigned char, udpPreferences, QString)), rig, SLOT(commSetup(unsigned char, udpPreferences, QString)));
|
||||
connect(this, SIGNAL(sendCommSetup(unsigned char, udpPreferences, audioSetup, audioSetup, QString)), rig, SLOT(commSetup(unsigned char, udpPreferences, audioSetup, audioSetup, QString)));
|
||||
connect(this, SIGNAL(sendCommSetup(unsigned char, QString, quint32,QString)), rig, SLOT(commSetup(unsigned char, QString, quint32,QString)));
|
||||
|
||||
|
||||
|
@ -767,16 +769,8 @@ void wfmain::setServerToPrefs()
|
|||
// Start server if enabled in config
|
||||
if (serverConfig.enabled) {
|
||||
serverConfig.lan = prefs.enableLAN;
|
||||
if (!serverConfig.lan) {
|
||||
serverConfig.resampleQuality = udpPrefs.resampleQuality;
|
||||
serverConfig.audioInput = udpPrefs.audioInput;
|
||||
serverConfig.audioOutput = udpPrefs.audioOutput;
|
||||
serverConfig.baudRate = prefs.serialPortBaud;
|
||||
serverConfig.audioInput = udpPrefs.audioInput;
|
||||
serverConfig.audioOutput = udpPrefs.audioOutput;
|
||||
}
|
||||
|
||||
udp = new udpServer(serverConfig);
|
||||
udp = new udpServer(serverConfig,rxSetup,txSetup);
|
||||
|
||||
serverThread = new QThread(this);
|
||||
|
||||
|
@ -813,6 +807,18 @@ void wfmain::setUIToPrefs()
|
|||
|
||||
void wfmain::setAudioDevicesUI()
|
||||
{
|
||||
|
||||
#if defined(RTAUDIO)
|
||||
|
||||
#if defined(Q_OS_LINUX)
|
||||
RtAudio* audio = new RtAudio(RtAudio::Api::LINUX_ALSA);
|
||||
#elif defined(Q_OS_WIN)
|
||||
RtAudio* audio = new RtAudio(RtAudio::Api::WINDOWS_WASAPI);
|
||||
#elif defined(Q_OS_MACX)
|
||||
RtAudio* audio = new RtAudio(RtAudio::Api::MACOSX_CORE);
|
||||
#endif
|
||||
|
||||
|
||||
// Enumerate audio devices, need to do before settings are loaded.
|
||||
std::map<int, std::string> apiMap;
|
||||
apiMap[RtAudio::MACOSX_CORE] = "OS-X Core Audio";
|
||||
|
@ -836,13 +842,14 @@ void wfmain::setAudioDevicesUI()
|
|||
}
|
||||
|
||||
RtAudio::DeviceInfo info;
|
||||
qInfo(logAudio()) << "Current API: " << QString::fromStdString(apiMap[audio.getCurrentApi()]);
|
||||
|
||||
unsigned int devices = audio.getDeviceCount();
|
||||
qInfo(logAudio()) << "Current API: " << QString::fromStdString(apiMap[audio->getCurrentApi()]);
|
||||
|
||||
unsigned int devices = audio->getDeviceCount();
|
||||
qInfo(logAudio()) << "Found " << devices << " audio device(s) *=default";
|
||||
|
||||
for (unsigned int i = 1; i < devices; i++) {
|
||||
info = audio.getDeviceInfo(i);
|
||||
info = audio->getDeviceInfo(i);
|
||||
if (info.outputChannels > 0) {
|
||||
qInfo(logAudio()) << (info.isDefaultOutput ? "*" : " ") << "(" << i << ") Output Device : " << QString::fromStdString(info.name);
|
||||
ui->audioOutputCombo->addItem(QString::fromStdString(info.name), i);
|
||||
|
@ -852,6 +859,24 @@ void wfmain::setAudioDevicesUI()
|
|||
ui->audioInputCombo->addItem(QString::fromStdString(info.name), i);
|
||||
}
|
||||
}
|
||||
|
||||
delete audio;
|
||||
|
||||
#elif defined(PORTAUDIO)
|
||||
// Use PortAudio device enumeration
|
||||
#else
|
||||
|
||||
// If no external library is configured, use QTMultimedia
|
||||
// Enumerate audio devices, need to do before settings are loaded.
|
||||
const auto audioOutputs = QAudioDeviceInfo::availableDevices(QAudio::AudioOutput);
|
||||
for (const QAudioDeviceInfo& deviceInfo : audioOutputs) {
|
||||
ui->audioOutputCombo->addItem(deviceInfo.deviceName(), QVariant::fromValue(deviceInfo));
|
||||
}
|
||||
const auto audioInputs = QAudioDeviceInfo::availableDevices(QAudio::AudioInput);
|
||||
for (const QAudioDeviceInfo& deviceInfo : audioInputs) {
|
||||
ui->audioInputCombo->addItem(deviceInfo.deviceName(), QVariant::fromValue(deviceInfo));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void wfmain::setSerialDevicesUI()
|
||||
|
@ -1212,24 +1237,28 @@ void wfmain::loadSettings()
|
|||
ui->passwordTxt->setEnabled(ui->lanEnableBtn->isChecked());
|
||||
ui->passwordTxt->setText(QString("%1").arg(udpPrefs.password));
|
||||
|
||||
rxSetup.isinput = false;
|
||||
txSetup.isinput = true;
|
||||
|
||||
udpPrefs.audioRXLatency = settings->value("AudioRXLatency", udpDefPrefs.audioRXLatency).toInt();
|
||||
rxSetup.latency = settings->value("AudioRXLatency", "150").toInt();
|
||||
ui->rxLatencySlider->setEnabled(ui->lanEnableBtn->isChecked());
|
||||
ui->rxLatencySlider->setValue(udpPrefs.audioRXLatency);
|
||||
ui->rxLatencySlider->setValue(rxSetup.latency);
|
||||
ui->rxLatencySlider->setTracking(false); // Stop it sending value on every change.
|
||||
|
||||
udpPrefs.audioTXLatency = settings->value("AudioTXLatency", udpDefPrefs.audioTXLatency).toInt();
|
||||
txSetup.latency = settings->value("AudioTXLatency", "150").toInt();
|
||||
ui->txLatencySlider->setEnabled(ui->lanEnableBtn->isChecked());
|
||||
ui->txLatencySlider->setValue(udpPrefs.audioTXLatency);
|
||||
ui->txLatencySlider->setValue(rxSetup.latency);
|
||||
ui->txLatencySlider->setTracking(false); // Stop it sending value on every change.
|
||||
|
||||
udpPrefs.audioRXSampleRate = settings->value("AudioRXSampleRate", udpDefPrefs.audioRXSampleRate).toInt();
|
||||
udpPrefs.audioTXSampleRate = settings->value("AudioTXSampleRate",udpDefPrefs.audioTXSampleRate).toInt();
|
||||
ui->audioSampleRateCombo->blockSignals(true);
|
||||
rxSetup.samplerate = settings->value("AudioRXSampleRate", "48000").toInt();
|
||||
txSetup.samplerate = rxSetup.samplerate;
|
||||
ui->audioSampleRateCombo->setEnabled(ui->lanEnableBtn->isChecked());
|
||||
int audioSampleRateIndex = ui->audioSampleRateCombo->findText(QString::number(udpPrefs.audioRXSampleRate));
|
||||
int audioSampleRateIndex = ui->audioSampleRateCombo->findText(QString::number(rxSetup.samplerate));
|
||||
if (audioSampleRateIndex != -1) {
|
||||
ui->audioSampleRateCombo->setCurrentIndex(audioSampleRateIndex);
|
||||
}
|
||||
ui->audioSampleRateCombo->blockSignals(false);
|
||||
|
||||
// Add codec combobox items here so that we can add userdata!
|
||||
ui->audioRXCodecCombo->addItem("LPCM 1ch 16bit", 4);
|
||||
|
@ -1239,39 +1268,61 @@ void wfmain::loadSettings()
|
|||
ui->audioRXCodecCombo->addItem("uLaw 2ch 8bit", 32);
|
||||
ui->audioRXCodecCombo->addItem("PCM 2ch 8bit", 8);
|
||||
|
||||
udpPrefs.audioRXCodec = settings->value("AudioRXCodec", udpDefPrefs.audioRXCodec).toInt();
|
||||
ui->audioRXCodecCombo->blockSignals(true);
|
||||
rxSetup.codec = settings->value("AudioRXCodec", "4").toInt();
|
||||
ui->audioRXCodecCombo->setEnabled(ui->lanEnableBtn->isChecked());
|
||||
for (int f = 0; f < ui->audioRXCodecCombo->count(); f++)
|
||||
if (ui->audioRXCodecCombo->itemData(f).toInt() == udpPrefs.audioRXCodec)
|
||||
if (ui->audioRXCodecCombo->itemData(f).toInt() == rxSetup.codec)
|
||||
ui->audioRXCodecCombo->setCurrentIndex(f);
|
||||
ui->audioRXCodecCombo->blockSignals(false);
|
||||
|
||||
ui->audioTXCodecCombo->addItem("LPCM 1ch 16bit", 4);
|
||||
ui->audioTXCodecCombo->addItem("LPCM 1ch 8bit", 2);
|
||||
ui->audioTXCodecCombo->addItem("uLaw 1ch 8bit", 1);
|
||||
|
||||
udpPrefs.audioTXCodec = settings->value("AudioTXCodec", udpDefPrefs.audioTXCodec).toInt();
|
||||
ui->audioRXCodecCombo->blockSignals(true);
|
||||
txSetup.codec = settings->value("AudioTXCodec", "4").toInt();
|
||||
ui->audioTXCodecCombo->setEnabled(ui->lanEnableBtn->isChecked());
|
||||
for (int f = 0; f < ui->audioTXCodecCombo->count(); f++)
|
||||
if (ui->audioTXCodecCombo->itemData(f).toInt() == udpPrefs.audioTXCodec)
|
||||
if (ui->audioTXCodecCombo->itemData(f).toInt() == txSetup.codec)
|
||||
ui->audioTXCodecCombo->setCurrentIndex(f);
|
||||
ui->audioRXCodecCombo->blockSignals(false);
|
||||
|
||||
udpPrefs.audioOutputName = settings->value("AudioOutput", udpDefPrefs.audioOutputName).toString();
|
||||
qInfo(logGui()) << "Got Audio Output: " << udpPrefs.audioOutputName;
|
||||
int audioOutputIndex = ui->audioOutputCombo->findText(udpPrefs.audioOutputName);
|
||||
ui->audioOutputCombo->blockSignals(true);
|
||||
rxSetup.name = settings->value("AudioOutput", udpDefPrefs.audioOutputName).toString();
|
||||
qInfo(logGui()) << "Got Audio Output: " << rxSetup.name;
|
||||
int audioOutputIndex = ui->audioOutputCombo->findText(rxSetup.name);
|
||||
if (audioOutputIndex != -1) {
|
||||
ui->audioOutputCombo->setCurrentIndex(audioOutputIndex);
|
||||
udpPrefs.audioOutput = ui->audioOutputCombo->itemData(audioOutputIndex).toInt();
|
||||
#if defined(RTAUDIO)
|
||||
rxSetup.port = ui->audioOutputCombo->itemData(audioOutputIndex).toInt();
|
||||
#elif defined(PORTAUDIO)
|
||||
#else
|
||||
QVariant v = ui->audioOutputCombo->currentData();
|
||||
rxSetup.port = v.value<QAudioDeviceInfo>();
|
||||
#endif
|
||||
}
|
||||
ui->audioOutputCombo->blockSignals(false);
|
||||
|
||||
udpPrefs.audioInputName = settings->value("AudioInput", udpDefPrefs.audioInputName).toString();
|
||||
qInfo(logGui()) << "Got Audio Input: " << udpPrefs.audioInputName;
|
||||
int audioInputIndex = ui->audioInputCombo->findText(udpPrefs.audioInputName);
|
||||
ui->audioInputCombo->blockSignals(true);
|
||||
txSetup.name = settings->value("AudioInput", udpDefPrefs.audioInputName).toString();
|
||||
qInfo(logGui()) << "Got Audio Input: " << txSetup.name;
|
||||
int audioInputIndex = ui->audioInputCombo->findText(txSetup.name);
|
||||
if (audioInputIndex != -1) {
|
||||
ui->audioInputCombo->setCurrentIndex(audioInputIndex);
|
||||
udpPrefs.audioInput = ui->audioInputCombo->itemData(audioInputIndex).toInt();
|
||||
#if defined(RTAUDIO)
|
||||
txSetup.port = ui->audioInputCombo->itemData(audioInputIndex).toInt();
|
||||
#elif defined(PORTAUDIO)
|
||||
#else
|
||||
QVariant v = ui->audioInputCombo->currentData();
|
||||
txSetup.port = v.value<QAudioDeviceInfo>();
|
||||
#endif
|
||||
}
|
||||
ui->audioInputCombo->blockSignals(false);
|
||||
|
||||
rxSetup.resampleQuality = settings->value("ResampleQuality", udpDefPrefs.resampleQuality).toInt();
|
||||
txSetup.resampleQuality = rxSetup.resampleQuality;
|
||||
|
||||
udpPrefs.resampleQuality = settings->value("ResampleQuality", udpDefPrefs.resampleQuality).toInt();
|
||||
udpPrefs.clientName = settings->value("ClientName", udpDefPrefs.clientName).toString();
|
||||
|
||||
settings->endGroup();
|
||||
|
@ -1376,15 +1427,15 @@ void wfmain::saveSettings()
|
|||
settings->setValue("AudioLANPort", udpPrefs.audioLANPort);
|
||||
settings->setValue("Username", udpPrefs.username);
|
||||
settings->setValue("Password", udpPrefs.password);
|
||||
settings->setValue("AudioRXLatency", udpPrefs.audioRXLatency);
|
||||
settings->setValue("AudioTXLatency", udpPrefs.audioTXLatency);
|
||||
settings->setValue("AudioRXSampleRate", udpPrefs.audioRXSampleRate);
|
||||
settings->setValue("AudioRXCodec", udpPrefs.audioRXCodec);
|
||||
settings->setValue("AudioTXSampleRate", udpPrefs.audioTXSampleRate);
|
||||
settings->setValue("AudioTXCodec", udpPrefs.audioTXCodec);
|
||||
settings->setValue("AudioOutput", udpPrefs.audioOutputName);
|
||||
settings->setValue("AudioInput", udpPrefs.audioInputName);
|
||||
settings->setValue("ResampleQuality", udpPrefs.resampleQuality);
|
||||
settings->setValue("AudioRXLatency", rxSetup.latency);
|
||||
settings->setValue("AudioTXLatency", txSetup.latency);
|
||||
settings->setValue("AudioRXSampleRate", rxSetup.samplerate);
|
||||
settings->setValue("AudioRXCodec", rxSetup.codec);
|
||||
settings->setValue("AudioTXSampleRate", txSetup.samplerate);
|
||||
settings->setValue("AudioTXCodec", txSetup.codec);
|
||||
settings->setValue("AudioOutput", rxSetup.name);
|
||||
settings->setValue("AudioInput", txSetup.name);
|
||||
settings->setValue("ResampleQuality", rxSetup.resampleQuality);
|
||||
settings->setValue("ClientName", udpPrefs.clientName);
|
||||
settings->endGroup();
|
||||
|
||||
|
@ -3689,42 +3740,58 @@ void wfmain::on_passwordTxt_textChanged(QString text)
|
|||
|
||||
void wfmain::on_audioOutputCombo_currentIndexChanged(int value)
|
||||
{
|
||||
udpPrefs.audioOutput = ui->audioOutputCombo->itemData(value).toInt();
|
||||
udpPrefs.audioOutputName = ui->audioOutputCombo->itemText(value);
|
||||
#if defined(RTAUDIO)
|
||||
rxSetup.port = ui->audioOutputCombo->itemData(value).toInt();
|
||||
#elif defined(PORTAUDIO)
|
||||
#else
|
||||
QVariant v = ui->audioOutputCombo->itemData(value);
|
||||
rxSetup.port = v.value<QAudioDeviceInfo>();
|
||||
#endif
|
||||
rxSetup.name = ui->audioOutputCombo->itemText(value);
|
||||
qDebug(logGui()) << "Changed default audio output to:" << rxSetup.name;
|
||||
}
|
||||
|
||||
void wfmain::on_audioInputCombo_currentIndexChanged(int value)
|
||||
{
|
||||
udpPrefs.audioInput = ui->audioInputCombo->itemData(value).toInt();
|
||||
udpPrefs.audioInputName = ui->audioInputCombo->itemText(value);
|
||||
#if defined(RTAUDIO)
|
||||
txSetup.port = ui->audioInputCombo->itemData(value).toInt();
|
||||
#elif defined(PORTAUDIO)
|
||||
#else
|
||||
QVariant v = ui->audioInputCombo->itemData(value);
|
||||
txSetup.port = v.value<QAudioDeviceInfo>();
|
||||
#endif
|
||||
txSetup.name = ui->audioInputCombo->itemText(value);
|
||||
qDebug(logGui()) << "Changed default audio input to:" << txSetup.name;
|
||||
}
|
||||
|
||||
void wfmain::on_audioSampleRateCombo_currentIndexChanged(QString text)
|
||||
{
|
||||
udpPrefs.audioRXSampleRate = text.toInt();
|
||||
udpPrefs.audioTXSampleRate = text.toInt();
|
||||
rxSetup.samplerate = text.toInt();
|
||||
txSetup.samplerate = text.toInt();
|
||||
}
|
||||
|
||||
void wfmain::on_audioRXCodecCombo_currentIndexChanged(int value)
|
||||
{
|
||||
udpPrefs.audioRXCodec = ui->audioRXCodecCombo->itemData(value).toInt();
|
||||
rxSetup.codec = ui->audioRXCodecCombo->itemData(value).toInt();
|
||||
}
|
||||
|
||||
void wfmain::on_audioTXCodecCombo_currentIndexChanged(int value)
|
||||
{
|
||||
udpPrefs.audioTXCodec = ui->audioTXCodecCombo->itemData(value).toInt();
|
||||
txSetup.codec = ui->audioTXCodecCombo->itemData(value).toInt();
|
||||
}
|
||||
|
||||
void wfmain::on_rxLatencySlider_valueChanged(int value)
|
||||
{
|
||||
udpPrefs.audioRXLatency = value;
|
||||
rxSetup.latency = value;
|
||||
ui->rxLatencyValue->setText(QString::number(value));
|
||||
emit sendChangeLatency(value);
|
||||
}
|
||||
|
||||
void wfmain::on_txLatencySlider_valueChanged(int value)
|
||||
{
|
||||
udpPrefs.audioTXLatency = value;
|
||||
txSetup.latency = value;
|
||||
ui->txLatencyValue->setText(QString::number(value));
|
||||
}
|
||||
|
||||
|
|
10
wfmain.h
10
wfmain.h
|
@ -138,7 +138,7 @@ signals:
|
|||
void sayMode();
|
||||
void sayAll();
|
||||
void sendCommSetup(unsigned char rigCivAddr, QString rigSerialPort, quint32 rigBaudRate,QString vsp);
|
||||
void sendCommSetup(unsigned char rigCivAddr, udpPreferences prefs, QString vsp);
|
||||
void sendCommSetup(unsigned char rigCivAddr, udpPreferences prefs, audioSetup rxSetup, audioSetup txSetup, QString vsp);
|
||||
void sendCloseComm();
|
||||
void sendChangeLatency(quint16 latency);
|
||||
void initServer();
|
||||
|
@ -642,6 +642,10 @@ private:
|
|||
udpPreferences udpPrefs;
|
||||
udpPreferences udpDefPrefs;
|
||||
|
||||
// Configuration for audio output and input.
|
||||
audioSetup rxSetup;
|
||||
audioSetup txSetup;
|
||||
|
||||
colors defaultColors;
|
||||
|
||||
void setDefaultColors(); // populate with default values
|
||||
|
@ -731,7 +735,10 @@ private:
|
|||
SERVERCONFIG serverConfig;
|
||||
shuttle *shuttleDev = Q_NULLPTR;
|
||||
QThread *shuttleThread = Q_NULLPTR;
|
||||
#ifdef RTAUDIO
|
||||
RtAudio audio;
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE(struct rigCapabilities)
|
||||
|
@ -739,6 +746,7 @@ Q_DECLARE_METATYPE(struct freqt)
|
|||
Q_DECLARE_METATYPE(struct udpPreferences)
|
||||
Q_DECLARE_METATYPE(struct rigStateStruct)
|
||||
Q_DECLARE_METATYPE(struct audioPacket)
|
||||
Q_DECLARE_METATYPE(struct audioSetup)
|
||||
Q_DECLARE_METATYPE(enum rigInput)
|
||||
Q_DECLARE_METATYPE(enum meterKind)
|
||||
Q_DECLARE_METATYPE(enum spectrumMode)
|
||||
|
|
22
wfview.pro
22
wfview.pro
|
@ -15,12 +15,14 @@ TEMPLATE = app
|
|||
|
||||
CONFIG(debug, release|debug) {
|
||||
# For Debug builds only:
|
||||
QMAKE_CXXFLAGS += -faligned-new
|
||||
|
||||
} else {
|
||||
# For Release builds only:
|
||||
linux:QMAKE_CXXFLAGS += -s
|
||||
QMAKE_CXXFLAGS += -fvisibility=hidden
|
||||
QMAKE_CXXFLAGS += -fvisibility-inlines-hidden
|
||||
QMAKE_CXXFLAGS += -faligned-new
|
||||
linux:QMAKE_LFLAGS += -O2 -s
|
||||
}
|
||||
|
||||
|
@ -43,15 +45,6 @@ linux:DEFINES += __LINUX_ALSA__
|
|||
#linux:DEFINES += __LINUX_PULSE__
|
||||
macx:DEFINES += __MACOSX_CORE__
|
||||
|
||||
#option(RTAUDIO_API_DS "Build DirectSound API" OFF)
|
||||
#option(RTAUDIO_API_ASIO "Build ASIO API" OFF)
|
||||
#option(RTAUDIO_API_WASAPI "Build WASAPI API" ${WIN32})
|
||||
#option(RTAUDIO_API_OSS "Build OSS4 API" ${xBSD})
|
||||
#option(RTAUDIO_API_ALSA "Build ALSA API" ${LINUX})
|
||||
#option(RTAUDIO_API_PULSE "Build PulseAudio API" ${pulse_FOUND})
|
||||
#option(RTAUDIO_API_JACK "Build JACK audio server API" ${HAVE_JACK})
|
||||
#option(RTAUDIO_API_CORE "Build CoreAudio API" ${APPLE})
|
||||
|
||||
macx:INCLUDEPATH += /usr/local/include /opt/local/include
|
||||
macx:LIBS += -L/usr/local/lib -L/opt/local/lib
|
||||
|
||||
|
@ -98,18 +91,23 @@ CONFIG(debug, release|debug) {
|
|||
linux: QCPLIB = qcustomplot
|
||||
}
|
||||
|
||||
linux:LIBS += -L./ -l$$QCPLIB -lasound
|
||||
#linux:LIBS += -L./ -l$$QCPLIB -lpulse -lpulse-simple -lpthread
|
||||
linux:LIBS += -L./ -l$$QCPLIB
|
||||
macx:LIBS += -framework CoreAudio -framework CoreFoundation -lpthread
|
||||
|
||||
win32:LIBS += -L../hidapi/windows/release -lhidapi
|
||||
win32:INCLUDEPATH += ../hidapi/hidapi
|
||||
|
||||
#!linux:SOURCES += ../qcustomplot/qcustomplot.cpp rtaudio/RTAudio.cpp
|
||||
#!linux:HEADERS += ../qcustomplot/qcustomplot.h rtaudio/RTAUdio.h
|
||||
|
||||
!linux:SOURCES += ../qcustomplot/qcustomplot.cpp
|
||||
!linux:HEADERS += ../qcustomplot/qcustomplot.h
|
||||
|
||||
!linux:INCLUDEPATH += ../qcustomplot
|
||||
|
||||
INCLUDEPATH += opus-tools/src
|
||||
INCLUDEPATH += rtaudio
|
||||
!linux:INCLUDEPATH += rtaudio
|
||||
|
||||
SOURCES += main.cpp\
|
||||
wfmain.cpp \
|
||||
|
@ -130,7 +128,6 @@ SOURCES += main.cpp\
|
|||
opus-tools/src/resample.c \
|
||||
repeatersetup.cpp \
|
||||
rigctld.cpp \
|
||||
rtaudio/RtAudio.cpp \
|
||||
ring/ring.cpp \
|
||||
shuttle.cpp
|
||||
|
||||
|
@ -156,7 +153,6 @@ HEADERS += wfmain.h \
|
|||
repeatersetup.h \
|
||||
repeaterattributes.h \
|
||||
rigctld.h \
|
||||
rtaudio/RtAudio.h \
|
||||
ulaw.h \
|
||||
ring/ring.h \
|
||||
shuttle.h
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>.;..\hidapi\hidapi;..\qcustomplot;opus-tools\src;rtaudio;release;/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>.;..\qcustomplot;opus-tools\src;rtaudio;release;/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalOptions>-Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 %(AdditionalOptions)</AdditionalOptions>
|
||||
<AssemblerListingLocation>release\</AssemblerListingLocation>
|
||||
<BrowseInformation>false</BrowseInformation>
|
||||
|
@ -57,7 +57,7 @@
|
|||
<ExceptionHandling>Sync</ExceptionHandling>
|
||||
<ObjectFileName>release\</ObjectFileName>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;QT_DEPRECATED_WARNINGS;QCUSTOMPLOT_COMPILE_LIBRARY;OUTSIDE_SPEEX;RANDOM_PREFIX=wf;__WINDOWS_WASAPI__;GITSHORT="84a4e7c";HOST="wfview.org";UNAME="build";NDEBUG;QT_NO_DEBUG;QT_USB_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;QT_DEPRECATED_WARNINGS;QCUSTOMPLOT_COMPILE_LIBRARY;OUTSIDE_SPEEX;RANDOM_PREFIX=wf;__WINDOWS_WASAPI__;GITSHORT="24ce16b";HOST="wfview.org";UNAME="build";NDEBUG;QT_NO_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessToFile>false</PreprocessToFile>
|
||||
<ProgramDataBaseFileName></ProgramDataBaseFileName>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
|
@ -66,8 +66,8 @@
|
|||
<WarningLevel>Level3</WarningLevel>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation></ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>..\hidapi\windows\release\hidapi.lib;$(QTDIR)\lib\Qt5Usb.lib;shell32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>..\hidapi\windows\release;C:\opensslx86\lib;C:\Utils\my_sql\mysql-5.7.25-win32\lib;C:\Utils\postgresqlx86\pgsql\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>shell32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>C:\opensslx86\lib;C:\Utils\my_sql\mysql-5.7.25-win32\lib;C:\Utils\postgresqlx86\pgsql\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalOptions>"/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" %(AdditionalOptions)</AdditionalOptions>
|
||||
<DataExecutionPrevention>true</DataExecutionPrevention>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
|
@ -85,12 +85,12 @@
|
|||
<WarningLevel>0</WarningLevel>
|
||||
</Midl>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;QT_DEPRECATED_WARNINGS;QCUSTOMPLOT_COMPILE_LIBRARY;OUTSIDE_SPEEX;RANDOM_PREFIX=wf;__WINDOWS_WASAPI__;GITSHORT=\"84a4e7c\";HOST=\"wfview.org\";UNAME=\"build\";NDEBUG;QT_NO_DEBUG;QT_MULTIMEDIA_LIB;QT_PRINTSUPPORT_LIB;QT_WIDGETS_LIB;QT_GUI_LIB;QT_SERIALPORT_LIB;QT_NETWORK_LIB;QT_USB_LIB;QT_CORE_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;QT_DEPRECATED_WARNINGS;QCUSTOMPLOT_COMPILE_LIBRARY;OUTSIDE_SPEEX;RANDOM_PREFIX=wf;__WINDOWS_WASAPI__;GITSHORT=\"24ce16b\";HOST=\"wfview.org\";UNAME=\"build\";NDEBUG;QT_NO_DEBUG;QT_MULTIMEDIA_LIB;QT_PRINTSUPPORT_LIB;QT_WIDGETS_LIB;QT_GUI_LIB;QT_SERIALPORT_LIB;QT_NETWORK_LIB;QT_CORE_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ResourceCompile>
|
||||
<QtMoc><CompilerFlavor>msvc</CompilerFlavor><Include>./$(Configuration)/moc_predefs.h</Include><ExecutionDescription>Moc'ing %(Identity)...</ExecutionDescription><DynamicSource>output</DynamicSource><QtMocDir>$(Configuration)</QtMocDir><QtMocFileName>moc_%(Filename).cpp</QtMocFileName></QtMoc><QtRcc><Compression>default</Compression><ExecutionDescription>Rcc'ing %(Identity)...</ExecutionDescription><QtRccDir>$(Configuration)</QtRccDir><QtRccFileName>qrc_%(Filename).cpp</QtRccFileName></QtRcc><QtUic><ExecutionDescription>Uic'ing %(Identity)...</ExecutionDescription><QtUicDir>$(ProjectDir)</QtUicDir><QtUicFileName>ui_%(Filename).h</QtUicFileName></QtUic></ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>.;..\hidapi\hidapi;..\qcustomplot;opus-tools\src;rtaudio;debug;/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>.;..\qcustomplot;opus-tools\src;rtaudio;debug;/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalOptions>-Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 %(AdditionalOptions)</AdditionalOptions>
|
||||
<AssemblerListingLocation>debug\</AssemblerListingLocation>
|
||||
<BrowseInformation>false</BrowseInformation>
|
||||
|
@ -99,7 +99,7 @@
|
|||
<ExceptionHandling>Sync</ExceptionHandling>
|
||||
<ObjectFileName>debug\</ObjectFileName>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;QT_DEPRECATED_WARNINGS;QCUSTOMPLOT_COMPILE_LIBRARY;OUTSIDE_SPEEX;RANDOM_PREFIX=wf;__WINDOWS_WASAPI__;GITSHORT="84a4e7c";HOST="wfview.org";UNAME="build";QT_USB_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;QT_DEPRECATED_WARNINGS;QCUSTOMPLOT_COMPILE_LIBRARY;OUTSIDE_SPEEX;RANDOM_PREFIX=wf;__WINDOWS_WASAPI__;GITSHORT="24ce16b";HOST="wfview.org";UNAME="build";%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessToFile>false</PreprocessToFile>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
|
@ -107,8 +107,8 @@
|
|||
<WarningLevel>Level3</WarningLevel>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation></ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>..\hidapi\windows\release\hidapi.lib;$(QTDIR)\lib\Qt5Usbd.lib;shell32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>..\hidapi\windows\release;C:\opensslx86\lib;C:\Utils\my_sql\mysql-5.7.25-win32\lib;C:\Utils\postgresqlx86\pgsql\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>shell32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>C:\opensslx86\lib;C:\Utils\my_sql\mysql-5.7.25-win32\lib;C:\Utils\postgresqlx86\pgsql\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalOptions>"/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" %(AdditionalOptions)</AdditionalOptions>
|
||||
<DataExecutionPrevention>true</DataExecutionPrevention>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
|
@ -124,11 +124,11 @@
|
|||
<WarningLevel>0</WarningLevel>
|
||||
</Midl>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;QT_DEPRECATED_WARNINGS;QCUSTOMPLOT_COMPILE_LIBRARY;OUTSIDE_SPEEX;RANDOM_PREFIX=wf;__WINDOWS_WASAPI__;GITSHORT=\"84a4e7c\";HOST=\"wfview.org\";UNAME=\"build\";QT_MULTIMEDIA_LIB;QT_PRINTSUPPORT_LIB;QT_WIDGETS_LIB;QT_GUI_LIB;QT_SERIALPORT_LIB;QT_NETWORK_LIB;QT_USB_LIB;QT_CORE_LIB;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;QT_DEPRECATED_WARNINGS;QCUSTOMPLOT_COMPILE_LIBRARY;OUTSIDE_SPEEX;RANDOM_PREFIX=wf;__WINDOWS_WASAPI__;GITSHORT=\"24ce16b\";HOST=\"wfview.org\";UNAME=\"build\";QT_MULTIMEDIA_LIB;QT_PRINTSUPPORT_LIB;QT_WIDGETS_LIB;QT_GUI_LIB;QT_SERIALPORT_LIB;QT_NETWORK_LIB;QT_CORE_LIB;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ResourceCompile>
|
||||
<QtMoc><CompilerFlavor>msvc</CompilerFlavor><Include>./$(Configuration)/moc_predefs.h</Include><ExecutionDescription>Moc'ing %(Identity)...</ExecutionDescription><DynamicSource>output</DynamicSource><QtMocDir>$(Configuration)</QtMocDir><QtMocFileName>moc_%(Filename).cpp</QtMocFileName></QtMoc><QtRcc><Compression>default</Compression><ExecutionDescription>Rcc'ing %(Identity)...</ExecutionDescription><QtRccDir>$(Configuration)</QtRccDir><QtRccFileName>qrc_%(Filename).cpp</QtRccFileName></QtRcc><QtUic><ExecutionDescription>Uic'ing %(Identity)...</ExecutionDescription><QtUicDir>$(ProjectDir)</QtUicDir><QtUicFileName>ui_%(Filename).h</QtUicFileName></QtUic></ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="rtaudio\RtAudio.cpp" />
|
||||
<ClCompile Include="rtaudio\RTAudio.cpp" />
|
||||
<ClCompile Include="audiohandler.cpp" />
|
||||
<ClCompile Include="calibrationwindow.cpp" />
|
||||
<ClCompile Include="commhandler.cpp" />
|
||||
|
@ -146,14 +146,13 @@
|
|||
<ClCompile Include="rigidentities.cpp" />
|
||||
<ClCompile Include="ring\ring.cpp" />
|
||||
<ClCompile Include="satellitesetup.cpp" />
|
||||
<ClCompile Include="shuttle.cpp" />
|
||||
<ClCompile Include="udphandler.cpp" />
|
||||
<ClCompile Include="udpserver.cpp" />
|
||||
<ClCompile Include="udpserversetup.cpp" />
|
||||
<ClCompile Include="wfmain.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="rtaudio\RtAudio.h" />
|
||||
<ClInclude Include="rtaudio\RTAUdio.h" />
|
||||
<ClInclude Include="opus-tools\src\arch.h" />
|
||||
<QtMoc Include="audiohandler.h">
|
||||
|
||||
|
@ -271,16 +270,6 @@
|
|||
|
||||
|
||||
|
||||
</QtMoc>
|
||||
<QtMoc Include="shuttle.h">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</QtMoc>
|
||||
<ClInclude Include="opus-tools\src\speex_resampler.h" />
|
||||
<QtMoc Include="udphandler.h">
|
||||
|
@ -338,14 +327,14 @@
|
|||
<FileType>Document</FileType>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(QTDIR)\mkspecs\features\data\dummy.cpp;%(AdditionalInputs)</AdditionalInputs>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">cl -Bx"$(QTDIR)\bin\qmake.exe" -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -Zi -MDd -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -E $(QTDIR)\mkspecs\features\data\dummy.cpp 2>NUL >debug\moc_predefs.h</Command>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">cl -Bx"$(QTDIR)\bin\qmake.exe" -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -faligned-new -Zi -MDd -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -E $(QTDIR)\mkspecs\features\data\dummy.cpp 2>NUL >debug\moc_predefs.h</Command>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Generate moc_predefs.h</Message>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">debug\moc_predefs.h;%(Outputs)</Outputs>
|
||||
</CustomBuild>
|
||||
<CustomBuild Include="release\moc_predefs.h.cbt">
|
||||
<FileType>Document</FileType>
|
||||
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(QTDIR)\mkspecs\features\data\dummy.cpp;%(AdditionalInputs)</AdditionalInputs>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">cl -Bx"$(QTDIR)\bin\qmake.exe" -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -fvisibility=hidden -fvisibility-inlines-hidden -O2 -MD -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -E $(QTDIR)\mkspecs\features\data\dummy.cpp 2>NUL >release\moc_predefs.h</Command>
|
||||
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">cl -Bx"$(QTDIR)\bin\qmake.exe" -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -fvisibility=hidden -fvisibility-inlines-hidden -faligned-new -O2 -MD -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -E $(QTDIR)\mkspecs\features\data\dummy.cpp 2>NUL >release\moc_predefs.h</Command>
|
||||
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Generate moc_predefs.h</Message>
|
||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">release\moc_predefs.h;%(Outputs)</Outputs>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||
|
@ -378,8 +367,6 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="rtaudio\RtAudio.cpp">
|
||||
<ClCompile Include="rtaudio\RTAudio.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="audiohandler.cpp">
|
||||
|
@ -111,9 +111,6 @@
|
|||
<ClCompile Include="satellitesetup.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="shuttle.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="udphandler.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
|
@ -128,7 +125,7 @@
|
|||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="rtaudio\RtAudio.h">
|
||||
<ClInclude Include="rtaudio\RTAUdio.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="opus-tools\src\arch.h">
|
||||
|
@ -188,9 +185,6 @@
|
|||
<QtMoc Include="satellitesetup.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</QtMoc>
|
||||
<QtMoc Include="shuttle.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</QtMoc>
|
||||
<ClInclude Include="opus-tools\src\speex_resampler.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
|
@ -253,8 +247,6 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue