kopia lustrzana https://gitlab.com/eliggett/wfview
Start removal of unused variables
rodzic
7603201886
commit
4704b0dc4d
|
@ -701,7 +701,7 @@ udpAudio::udpAudio(QHostAddress local, QHostAddress ip, quint16 audioPort, audio
|
|||
this->port = audioPort;
|
||||
this->radioIP = ip;
|
||||
|
||||
if (txSampleRate == 0) {
|
||||
if (txSetup.samplerate == 0) {
|
||||
enableTx = false;
|
||||
}
|
||||
|
||||
|
|
26
udphandler.h
26
udphandler.h
|
@ -40,18 +40,6 @@ struct udpPreferences {
|
|||
quint16 audioLANPort;
|
||||
QString username;
|
||||
QString password;
|
||||
int audioOutput;
|
||||
int audioInput;
|
||||
QString audioOutputName;
|
||||
QString audioInputName;
|
||||
|
||||
quint16 audioRXLatency;
|
||||
quint16 audioTXLatency;
|
||||
quint16 audioRXSampleRate;
|
||||
quint8 audioRXCodec;
|
||||
quint16 audioTXSampleRate;
|
||||
quint8 audioTXCodec;
|
||||
quint8 resampleQuality;
|
||||
QString clientName;
|
||||
};
|
||||
|
||||
|
@ -198,20 +186,6 @@ private:
|
|||
void dataReceived();
|
||||
void watchdog();
|
||||
|
||||
quint16 rxLatency;
|
||||
quint16 txLatency;
|
||||
quint16 rxSampleRate;
|
||||
quint16 txSampleRate;
|
||||
quint8 rxCodec;
|
||||
quint8 txCodec;
|
||||
quint8 rxChannelCount = 1;
|
||||
bool rxIsUlawCodec = false;
|
||||
quint8 rxNumSamples = 8;
|
||||
quint8 txChannelCount = 1;
|
||||
bool txIsUlawCodec = false;
|
||||
quint8 txNumSamples = 8;
|
||||
|
||||
bool sentPacketConnect2 = false;
|
||||
uint16_t sendAudioSeq = 0;
|
||||
|
||||
audioHandler* rxaudio = Q_NULLPTR;
|
||||
|
|
55
wfmain.cpp
55
wfmain.cpp
|
@ -535,6 +535,7 @@ void wfmain::setupPlots()
|
|||
// Line 290--
|
||||
spectrumDrawLock = true;
|
||||
plot = ui->plot; // rename it waterfall.
|
||||
|
||||
wf = ui->waterfall;
|
||||
|
||||
freqIndicatorLine = new QCPItemLine(plot);
|
||||
|
@ -872,10 +873,14 @@ void wfmain::setAudioDevicesUI()
|
|||
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));
|
||||
}
|
||||
// Set these to default audio devices initially.
|
||||
rxSetup.port = QAudioDeviceInfo::defaultOutputDevice();
|
||||
txSetup.port = QAudioDeviceInfo::defaultInputDevice();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -1060,6 +1065,8 @@ void wfmain::setupShuttleDevice()
|
|||
connect(shuttleThread, SIGNAL(finished()), shuttleDev, SLOT(deleteLater()));
|
||||
connect(shuttleDev, SIGNAL(jogPlus()), this, SLOT(shortcutStepPlus()));
|
||||
connect(shuttleDev, SIGNAL(jogMinus()), this, SLOT(shortcutStepMinus()));
|
||||
connect(shuttleDev, SIGNAL(doShuttle(bool,quint8)), this, SLOT(doShuttle(bool,quint8)));
|
||||
connect(shuttleDev, SIGNAL(shuttleMinus()), this, SLOT(shortcutShiftMinus()));
|
||||
connect(shuttleDev, SIGNAL(button5(bool)), this, SLOT(stepDown()));
|
||||
connect(shuttleDev, SIGNAL(button6(bool)), this, SLOT(pttToggle(bool)));
|
||||
connect(shuttleDev, SIGNAL(button7(bool)), this, SLOT(stepUp()));
|
||||
|
@ -1084,6 +1091,26 @@ void wfmain::pttToggle(bool status)
|
|||
issueDelayedCommand(cmdGetPTT);
|
||||
}
|
||||
|
||||
void wfmain::doShuttle(bool up, quint8 level)
|
||||
{
|
||||
if (level == 1 && up)
|
||||
shortcutShiftPlus();
|
||||
else if (level == 1 && !up)
|
||||
shortcutShiftMinus();
|
||||
else if (level > 1 && level < 5 && up)
|
||||
for (int i = 1; i < level; i++)
|
||||
shortcutPlus();
|
||||
else if (level > 1 && level < 5 && !up)
|
||||
for (int i = 1; i < level; i++)
|
||||
shortcutMinus();
|
||||
else if (level > 4 && up)
|
||||
for (int i = 4; i < level; i++)
|
||||
shortcutControlPlus();
|
||||
else if (level > 4 && !up)
|
||||
for (int i = 4; i < level; i++)
|
||||
shortcutControlMinus();
|
||||
}
|
||||
|
||||
void wfmain::stepUp()
|
||||
{
|
||||
if (ui->tuningStepCombo->currentIndex() < ui->tuningStepCombo->count() - 1)
|
||||
|
@ -1118,15 +1145,15 @@ void wfmain::setDefPrefs()
|
|||
udpDefPrefs.audioLANPort = 50003;
|
||||
udpDefPrefs.username = QString("");
|
||||
udpDefPrefs.password = QString("");
|
||||
udpDefPrefs.audioOutput = 0;
|
||||
udpDefPrefs.audioInput = 0;
|
||||
udpDefPrefs.audioRXLatency = 150;
|
||||
udpDefPrefs.audioTXLatency = 150;
|
||||
udpDefPrefs.audioRXSampleRate = 48000;
|
||||
udpDefPrefs.audioRXCodec = 4;
|
||||
udpDefPrefs.audioTXSampleRate = 48000;
|
||||
udpDefPrefs.audioTXCodec = 4;
|
||||
udpDefPrefs.resampleQuality = 4;
|
||||
//udpDefPrefs.audioOutput = 0;
|
||||
//udpDefPrefs.audioInput = 0;
|
||||
//udpDefPrefs.audioRXLatency = 150;
|
||||
//udpDefPrefs.audioTXLatency = 150;
|
||||
//udpDefPrefs.audioRXSampleRate = 48000;
|
||||
//udpDefPrefs.audioRXCodec = 4;
|
||||
//udpDefPrefs.audioTXSampleRate = 48000;
|
||||
//udpDefPrefs.audioTXCodec = 4;
|
||||
//udpDefPrefs.resampleQuality = 4;
|
||||
udpDefPrefs.clientName = QHostInfo::localHostName();
|
||||
}
|
||||
|
||||
|
@ -1318,7 +1345,7 @@ void wfmain::loadSettings()
|
|||
ui->audioRXCodecCombo->blockSignals(false);
|
||||
|
||||
ui->audioOutputCombo->blockSignals(true);
|
||||
rxSetup.name = settings->value("AudioOutput", udpDefPrefs.audioOutputName).toString();
|
||||
rxSetup.name = settings->value("AudioOutput", "").toString();
|
||||
qInfo(logGui()) << "Got Audio Output: " << rxSetup.name;
|
||||
int audioOutputIndex = ui->audioOutputCombo->findText(rxSetup.name);
|
||||
if (audioOutputIndex != -1) {
|
||||
|
@ -1334,7 +1361,7 @@ void wfmain::loadSettings()
|
|||
ui->audioOutputCombo->blockSignals(false);
|
||||
|
||||
ui->audioInputCombo->blockSignals(true);
|
||||
txSetup.name = settings->value("AudioInput", udpDefPrefs.audioInputName).toString();
|
||||
txSetup.name = settings->value("AudioInput", "").toString();
|
||||
qInfo(logGui()) << "Got Audio Input: " << txSetup.name;
|
||||
int audioInputIndex = ui->audioInputCombo->findText(txSetup.name);
|
||||
if (audioInputIndex != -1) {
|
||||
|
@ -1349,7 +1376,7 @@ void wfmain::loadSettings()
|
|||
}
|
||||
ui->audioInputCombo->blockSignals(false);
|
||||
|
||||
rxSetup.resampleQuality = settings->value("ResampleQuality", udpDefPrefs.resampleQuality).toInt();
|
||||
rxSetup.resampleQuality = settings->value("ResampleQuality", "4").toInt();
|
||||
txSetup.resampleQuality = rxSetup.resampleQuality;
|
||||
|
||||
udpPrefs.clientName = settings->value("ClientName", udpDefPrefs.clientName).toString();
|
||||
|
@ -3822,8 +3849,8 @@ void wfmain::on_audioInputCombo_currentIndexChanged(int value)
|
|||
|
||||
void wfmain::on_audioSampleRateCombo_currentIndexChanged(QString text)
|
||||
{
|
||||
udpPrefs.audioRXSampleRate = text.toInt();
|
||||
udpPrefs.audioTXSampleRate = text.toInt();
|
||||
//udpPrefs.audioRXSampleRate = text.toInt();
|
||||
//udpPrefs.audioTXSampleRate = text.toInt();
|
||||
rxSetup.samplerate = text.toInt();
|
||||
txSetup.samplerate = text.toInt();
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue