Qt6 fixes

main
Doug McLain 1 year ago
parent b858d3e207
commit 1723b764d5

@ -5,7 +5,7 @@ equals(QT_MAJOR_VERSION, 5){
}
unix:!ios:QT += serialport
CONFIG += c++11
CONFIG += c++17
LFLAGS +=
android:INCLUDEPATH += $$(HOME)/Android/local/include
LIBS += -limbe_vocoder -lvocoder

@ -176,20 +176,15 @@ QStringList AudioEngine::discover_audio_devices(uint8_t d)
void AudioEngine::init()
{
QAudioFormat format;
QAudioFormat tempformat;
format.setSampleRate(8000);
format.setChannelCount(1);
format.setSampleFormat(QAudioFormat::Int16);
//format.setSampleSize(16);
//format.setCodec("audio/pcm");
//format.setByteOrder(QAudioFormat::LittleEndian);
//format.setSampleType(QAudioFormat::SignedInt);
m_agc = true;
QList<QAudioDevice> devices = QMediaDevices::audioOutputs();
if(devices.size() == 0){
fprintf(stderr, "No audio playback hardware found\n");fflush(stderr);
qDebug() << "No audio playback hardware found";
}
else{
QAudioDevice device(QMediaDevices::defaultAudioOutput());
@ -204,25 +199,20 @@ void AudioEngine::init()
}
}
if (!device.isFormatSupported(format)) {
qWarning() << "Raw audio format not supported by backend, trying nearest format.";
//tempformat = device.nearestFormat(format);
//qWarning() << "Format now set to " << format.sampleRate() << ":" << format.sampleSize();
qWarning() << "Raw audio format not supported by playback device";
}
else{
tempformat = format;
}
fprintf(stderr, "Using playback device %s\n", device.description().toStdString().c_str());fflush(stderr);
m_out = new QAudioSink(device, tempformat, this);
qDebug() << "Playback device: " << device.description() << "SR: " << format.sampleRate();
m_out = new QAudioSink(device, format, this);
m_out->setBufferSize(1280);
connect(m_out, SIGNAL(stateChanged(QAudio::State)), this, SLOT(handleStateChanged(QAudio::State)));
//m_outdev = m_out->start();
}
devices = QMediaDevices::audioInputs();
if(devices.size() == 0){
fprintf(stderr, "No audio recording hardware found\n");fflush(stderr);
qDebug() << "No audio capture hardware found";
}
else{
QAudioDevice device(QMediaDevices::defaultAudioInput());
@ -237,12 +227,7 @@ void AudioEngine::init()
}
}
if (!device.isFormatSupported(format)) {
qWarning() << "Raw audio format not supported by backend, trying nearest format.";
//tempformat = device.nearestFormat(format);
//qWarning() << "Format now set to " << format.sampleRate() << ":" << format.sampleSize();
}
else{
tempformat = format;
qWarning() << "Raw audio format not supported by capture device";
}
int sr = 8000;
@ -252,10 +237,8 @@ void AudioEngine::init()
}
format.setSampleRate(sr);
m_in = new QAudioSource(device, format, this);
fprintf(stderr, "Capture device: %s SR: %d resample factor: %f\n", device.description().toStdString().c_str(), sr, m_srm);fflush(stderr);
qDebug() << "Capture device: " << device.description() << " SR: " << sr << " resample factor: " << m_srm;
}
//start_playback();
}
#endif

@ -188,7 +188,7 @@ void DMR::process_udp()
(m_modeinfo.status == CONNECTED_RW))
{
m_rxwatchdog = 0;
uint8_t t;
uint8_t t = 0;
if((uint8_t)buf.data()[15] & 0x02){
qDebug() << "DMR RX EOT";
m_modeinfo.stream_state = STREAM_END;

@ -417,7 +417,7 @@ void DroidStar::process_connect()
m_modethread->start();
}
/*
qDebug() << "process_connect called m_callsign == " << m_callsign;
qDebug() << "process_connect called m_dmrid == " << m_dmrid;
qDebug() << "process_connect called m_bm_password == " << m_bm_password;
@ -428,6 +428,7 @@ void DroidStar::process_connect()
qDebug() << "process_connect called m_module == " << m_module;
qDebug() << "process_connect called m_protocol == " << m_protocol;
qDebug() << "process_connect called m_port == " << m_port;
*/
}
void DroidStar::process_host_change(const QString &h)
@ -720,7 +721,7 @@ void DroidStar::process_dstar_hosts(QString m)
}
m_customhosts = m_localhosts.split('\n');
for (const auto& i : qAsConst(m_customhosts)){
for (const auto& i : std::as_const(m_customhosts)){
QStringList line = i.simplified().split(' ');
if(line.at(0) == m){
@ -761,7 +762,7 @@ void DroidStar::process_ysf_hosts()
}
m_customhosts = m_localhosts.split('\n');
for (const auto& i : qAsConst(m_customhosts)){
for (const auto& i : std::as_const(m_customhosts)){
QStringList line = i.simplified().split(' ');
if(line.at(0) == "YSF"){
@ -804,7 +805,7 @@ void DroidStar::process_fcs_rooms()
}
m_customhosts = m_localhosts.split('\n');
for (const auto& i : qAsConst(m_customhosts)){
for (const auto& i : std::as_const(m_customhosts)){
QStringList line = i.simplified().split(' ');
if(line.at(0) == "FCS"){
@ -850,7 +851,7 @@ void DroidStar::process_dmr_hosts()
}
m_customhosts = m_localhosts.split('\n');
for (const auto& i : qAsConst(m_customhosts)){
for (const auto& i : std::as_const(m_customhosts)){
QStringList line = i.simplified().split(' ');
if(line.at(0) == "DMR"){
@ -891,7 +892,7 @@ void DroidStar::process_p25_hosts()
}
m_customhosts = m_localhosts.split('\n');
for (const auto& i : qAsConst(m_customhosts)){
for (const auto& i : std::as_const(m_customhosts)){
QStringList line = i.simplified().split(' ');
if(line.at(0) == "P25"){
@ -935,7 +936,7 @@ void DroidStar::process_nxdn_hosts()
}
m_customhosts = m_localhosts.split('\n');
for (const auto& i : qAsConst(m_customhosts)){
for (const auto& i : std::as_const(m_customhosts)){
QStringList line = i.simplified().split(' ');
if(line.at(0) == "NXDN"){
@ -980,7 +981,7 @@ void DroidStar::process_m17_hosts()
}
m_customhosts = m_localhosts.split('\n');
for (const auto& i : qAsConst(m_customhosts)){
for (const auto& i : std::as_const(m_customhosts)){
QStringList line = i.simplified().split(' ');
if(line.at(0) == "M17"){

Loading…
Cancel
Save