1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-01 21:54:55 -04:00

Multiple audio support: SSB modulator

This commit is contained in:
f4exb
2018-03-29 16:57:42 +02:00
parent eb57c1aca6
commit 0d7f73f595
7 changed files with 154 additions and 34 deletions
+27 -2
View File
@@ -30,6 +30,9 @@
#include "util/simpleserializer.h"
#include "util/db.h"
#include "dsp/dspengine.h"
#include "dsp/dspcommands.h"
#include "gui/crightclickenabler.h"
#include "gui/audioselectdialog.h"
#include "mainwindow.h"
SSBModGUI* SSBModGUI::create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSource *channelTx)
@@ -108,6 +111,12 @@ bool SSBModGUI::handleMessage(const Message& message)
updateWithStreamTime();
return true;
}
else if (DSPConfigureAudio::match(message))
{
qDebug("SSBModGUI::handleMessage: DSPConfigureAudio: %d", m_ssbMod->getAudioSampleRate());
applyBandwidths(); // will update spectrum details with new sample rate
return true;
}
else
{
return false;
@@ -379,6 +388,9 @@ SSBModGUI::SSBModGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSam
connect(&MainWindow::getInstance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick()));
CRightClickEnabler *audioMuteRightClickEnabler = new CRightClickEnabler(ui->mic);
connect(audioMuteRightClickEnabler, SIGNAL(rightClick()), this, SLOT(audioSelect()));
ui->deltaFrequencyLabel->setText(QString("%1f").arg(QChar(0x94, 0x03)));
ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
ui->deltaFrequency->setValueRange(false, 7, -9999999, 9999999);
@@ -453,10 +465,10 @@ void SSBModGUI::applyBandwidths(bool force)
{
bool dsb = ui->dsb->isChecked();
int spanLog2 = ui->spanLog2->value();
m_spectrumRate = 48000 / (1<<spanLog2);
m_spectrumRate = m_ssbMod->getAudioSampleRate() / (1<<spanLog2);
int bw = ui->BW->value();
int lw = ui->lowCut->value();
int bwMax = 480/(1<<spanLog2);
int bwMax = m_ssbMod->getAudioSampleRate() / (100*(1<<spanLog2));
int tickInterval = m_spectrumRate / 1200;
tickInterval = tickInterval == 0 ? 1 : tickInterval;
@@ -668,6 +680,19 @@ void SSBModGUI::enterEvent(QEvent*)
m_channelMarker.setHighlighted(true);
}
void SSBModGUI::audioSelect()
{
qDebug("SSBModGUI::audioSelect");
AudioSelectDialog audioSelect(DSPEngine::instance()->getAudioDeviceManager(), m_settings.m_audioDeviceName, true); // true for input
audioSelect.exec();
if (audioSelect.m_selected)
{
m_settings.m_audioDeviceName = audioSelect.m_audioDeviceName;
applySettings();
}
}
void SSBModGUI::tick()
{
double powDb = CalcDb::dbPower(m_ssbMod->getMagSq());