Fix for ic7610 wf length and partial sound device selection

audioplugins
Phil Taylor 2021-02-04 10:27:30 +00:00
rodzic c9fdda4f93
commit 73d99023d7
3 zmienionych plików z 24 dodań i 5 usunięć

Wyświetl plik

@ -149,6 +149,7 @@ void rigCommander::findRigs()
QByteArray data;
QByteArray data2;
//data.setRawData("\xFE\xFE\xa2", 3);
data.setRawData("\xFE\xFE\x00", 3);
data.append(compCivAddr); // wfview's address, 0xE1
data2.setRawData("\x19\x00", 2); // get rig ID
@ -635,9 +636,7 @@ void rigCommander::parseCommand()
case '\x19':
// qDebug() << "Have rig ID: " << (unsigned int)payloadIn[2];
// printHex(payloadIn, false, true);
model = determineRadioModel(payloadIn[2]); // verify this is the model not the CIV
//model = determineRadioModel(0xa2); //testing by forcing model to 9700.
determineRigCaps();
qDebug() << "Have rig ID: decimal: " << (unsigned int)model;
@ -1136,7 +1135,8 @@ void rigCommander::parseSpectrum()
if (payloadIn.length() > 400) // Must be a LAN packet.
{
payloadIn.chop(1);
spectrumLine.append(payloadIn.mid(17,475)); // write over the FD, last one doesn't, oh well.
//spectrumLine.append(payloadIn.mid(17,475)); // write over the FD, last one doesn't, oh well.
spectrumLine.append(payloadIn.right(payloadIn.length()-17)); // write over the FD, last one doesn't, oh well.
emit haveSpectrumData(spectrumLine, spectrumStartFreq, spectrumEndFreq);
}
} else if ((sequence > 1) && (sequence < rigCaps.spectSeqMax))

Wyświetl plik

@ -146,7 +146,11 @@ wfmain::wfmain(const QString serialPortCL, const QString hostCL, QWidget *parent
keyM->setKey(Qt::Key_M);
connect(keyM, SIGNAL(activated()), this, SLOT(shortcutM()));
// Enumerate audio devices, need to do before settings are loaded.
const auto deviceInfos = QAudioDeviceInfo::availableDevices(QAudio::AudioOutput);
for (const QAudioDeviceInfo& deviceInfo : deviceInfos) {
ui->audioOutputCombo->addItem(deviceInfo.deviceName());
}
setDefaultColors(); // set of UI colors with defaults populated
setDefPrefs(); // other default options
loadSettings(); // Look for saved preferences
@ -571,6 +575,13 @@ void wfmain::loadSettings()
prefs.password = settings.value("Password", defPrefs.password).toString();
ui->passwordTxt->setEnabled(ui->lanEnableChk->isChecked());
ui->passwordTxt->setText(QString("%1").arg(prefs.password));
prefs.audioOutput = settings.value("AudioOutput", defPrefs.audioOutput).toString();
ui->audioOutputCombo->setEnabled(ui->lanEnableChk->isChecked());
int audioIndex = ui->audioOutputCombo->findText("prefs.audioOutput");
if (audioIndex -1)
ui->audioOutputCombo->setCurrentIndex(audioIndex);
settings.endGroup();
// Memory channels
@ -646,6 +657,7 @@ void wfmain::saveSettings()
settings.setValue("AudioLANPort", prefs.audioLANPort);
settings.setValue("Username", prefs.username);
settings.setValue("Password", prefs.password);
settings.setValue("AudioOutput", prefs.audioOutput);
settings.endGroup();
// Memory channels
@ -2144,6 +2156,11 @@ void wfmain::on_passwordTxt_textChanged(QString text)
prefs.password = text;
}
void wfmain::on_audioOutputCombo_currentIndexChanged(QString text)
{
prefs.audioOutput = text;
}
// --- DEBUG FUNCTION ---
void wfmain::on_debugBtn_clicked()
{

Wyświetl plik

@ -251,6 +251,8 @@ private slots:
void on_passwordTxt_textChanged(QString text);
void on_audioOutputCombo_currentIndexChanged(QString text);
private:
Ui::wfmain *ui;
QSettings settings;
@ -385,7 +387,7 @@ private:
quint32 audioLANPort;
QString username;
QString password;
QString audioOutput;
} prefs;
preferences defPrefs;