18 #include <QDockWidget> 19 #include <QMainWindow> 20 #include <QFileDialog> 28 #include "ui_ssbmodgui.h" 85 qDebug(
"SSBModGUI::deserialize");
126 if (mod_settings.
m_usb ==
false) {
140 ui->cwKeyerGUI->displaySettings();
186 int bwValue =
ui->BW->value();
187 int lcValue =
ui->lowCut->value();
188 ui->BW->setValue(-bwValue);
189 ui->lowCut->setValue(-lcValue);
194 ui->flipSidebands->setEnabled(!dsb);
212 if ((value < 0) || (value > 4)) {
233 ui->toneFrequencyText->setText(QString(
"%1k").
arg(value / 100.0, 0,
'f', 2));
240 ui->volumeText->setText(QString(
"%1").
arg(value / 10.0, 0,
'f', 1));
259 ui->tone->setEnabled(!checked);
260 ui->morseKeyer->setEnabled(!checked);
261 ui->mic->setEnabled(!checked);
264 ui->navTimeSlider->setEnabled(!checked);
270 ui->play->setEnabled(!checked);
271 ui->morseKeyer->setEnabled(!checked);
272 ui->mic->setEnabled(!checked);
279 ui->play->setEnabled(!checked);
280 ui->tone->setEnabled(!checked);
281 ui->mic->setEnabled(!checked);
288 ui->play->setEnabled(!checked);
289 ui->morseKeyer->setEnabled(!checked);
290 ui->tone->setEnabled(!checked);
303 ui->feedbackVolumeText->setText(QString(
"%1").
arg(value / 100.0, 0,
'f', 2));
320 t = t.addSecs(t_sec);
330 QString fileName = QFileDialog::getOpenFileName(
this,
331 tr(
"Open raw audio file"),
".", tr(
"Raw audio Files (*.raw)"), 0, QFileDialog::DontUseNativeDialog);
337 ui->play->setEnabled(
true);
344 qDebug() <<
"FileSourceGui::configureFileName: " <<
m_fileName.toStdString().c_str();
402 setAttribute(Qt::WA_DeleteOnClose,
true);
404 connect(
this, SIGNAL(customContextMenuRequested(
const QPoint &)),
this, SLOT(
onMenuDialogCalled(
const QPoint &)));
415 ui->glSpectrum->setDisplayWaterfall(
true);
416 ui->glSpectrum->setDisplayMaxHold(
true);
417 ui->glSpectrum->setSsbSpectrum(
true);
423 connect(audioMuteRightClickEnabler, SIGNAL(rightClick(
const QPoint &)),
this, SLOT(
audioSelect()));
426 connect(feedbackRightClickEnabler, SIGNAL(rightClick(
const QPoint &)),
this, SLOT(
audioFeedbackSelect()));
428 ui->deltaFrequencyLabel->setText(QString(
"%1f").
arg(QChar(0x94, 0x03)));
430 ui->deltaFrequency->setValueRange(
false, 7, -9999999, 9999999);
458 connect(
m_ssbMod, SIGNAL(levelChanged(qreal, qreal,
int)),
ui->volumeMeter, SLOT(levelChanged(qreal, qreal,
int)));
460 m_iconDSBUSB.addPixmap(QPixmap(
"://dsb.png"), QIcon::Normal, QIcon::On);
461 m_iconDSBUSB.addPixmap(QPixmap(
"://usb.png"), QIcon::Normal, QIcon::Off);
462 m_iconDSBLSB.addPixmap(QPixmap(
"://dsb.png"), QIcon::Normal, QIcon::On);
463 m_iconDSBLSB.addPixmap(QPixmap(
"://lsb.png"), QIcon::Normal, QIcon::Off);
495 mod_settings.
m_usb =
true;
499 mod_settings.
m_usb =
false;
509 bool dsb =
ui->dsb->isChecked();
511 int bw =
ui->BW->value();
512 int lw =
ui->lowCut->value();
515 tickInterval = tickInterval == 0 ? 1 : tickInterval;
517 qDebug() <<
"SSBModGUI::applyBandwidths:" 519 <<
" spanLog2: " << spanLog2
523 <<
" bwMax: " << bwMax
524 <<
" tickInterval: " << tickInterval;
526 ui->BW->setTickInterval(tickInterval);
527 ui->lowCut->setTickInterval(tickInterval);
529 bw = bw < -bwMax ? -bwMax : bw > bwMax ? bwMax : bw;
532 lw = lw < bw+1 ? bw+1 : lw < 0 ? lw : 0;
534 lw = lw > bw-1 ? bw-1 : lw < 0 ? 0 : lw;
541 bw = bw < 0 ? -bw : bw;
545 QString spanStr = QString::number(bwMax/10.0,
'f', 1);
546 QString bwStr = QString::number(bw/10.0,
'f', 1);
547 QString lwStr = QString::number(lw/10.0,
'f', 1);
551 ui->BWText->setText(tr(
"%1%2k").
arg(QChar(0xB1, 0x00)).
arg(bwStr));
552 ui->spanText->setText(tr(
"%1%2k").
arg(QChar(0xB1, 0x00)).
arg(spanStr));
553 ui->scaleMinus->setText(
"0");
554 ui->scaleCenter->setText(
"");
555 ui->scalePlus->setText(tr(
"%1").
arg(QChar(0xB1, 0x00)));
556 ui->lsbLabel->setText(
"");
557 ui->usbLabel->setText(
"");
558 ui->glSpectrum->setCenterFrequency(0);
560 ui->glSpectrum->setSsbSpectrum(
false);
561 ui->glSpectrum->setLsbDisplay(
false);
565 ui->BWText->setText(tr(
"%1k").
arg(bwStr));
566 ui->spanText->setText(tr(
"%1k").
arg(spanStr));
567 ui->scaleMinus->setText(
"-");
568 ui->scaleCenter->setText(
"0");
569 ui->scalePlus->setText(
"+");
570 ui->lsbLabel->setText(
"LSB");
571 ui->usbLabel->setText(
"USB");
574 ui->glSpectrum->setSsbSpectrum(
true);
575 ui->glSpectrum->setLsbDisplay(bw < 0);
578 ui->lowCutText->setText(tr(
"%1k").
arg(lwStr));
581 ui->BW->blockSignals(
true);
582 ui->lowCut->blockSignals(
true);
584 ui->BW->setMaximum(bwMax);
585 ui->BW->setMinimum(dsb ? 0 : -bwMax);
586 ui->BW->setValue(bw);
588 ui->lowCut->setMaximum(dsb ? 0 : bwMax);
589 ui->lowCut->setMinimum(dsb ? 0 : -bwMax);
590 ui->lowCut->setValue(lw);
592 ui->lowCut->blockSignals(
false);
593 ui->BW->blockSignals(
false);
648 ui->spanLog2->blockSignals(
true);
649 ui->dsb->blockSignals(
true);
650 ui->BW->blockSignals(
true);
660 ui->BWText->setText(tr(
"%1%2k").
arg(QChar(0xB1, 0x00)).
arg(s));
664 ui->BWText->setText(tr(
"%1k").
arg(s));
667 ui->spanLog2->blockSignals(
false);
668 ui->dsb->blockSignals(
false);
669 ui->BW->blockSignals(
false);
717 qDebug(
"SSBModGUI::audioSelect");
730 qDebug(
"SSBModGUI::audioFeedbackSelect");
745 ui->channelPower->setText(tr(
"%1 dB").
arg(m_channelPowerDbAvg.asDouble(), 0,
'f', 1));
756 QTime recordLength(0, 0, 0, 0);
758 QString s_time = recordLength.toString(
"HH:mm:ss");
759 ui->recordLengthText->setText(s_time);
775 t = t.addSecs(t_sec);
776 t = t.addMSecs(t_msec);
777 QString s_timems = t.toString(
"HH:mm:ss.zzz");
778 QString s_time = t.toString(
"HH:mm:ss");
779 ui->relTimeText->setText(s_timems);
784 ui->navTimeSlider->setValue((
int) (posRatio * 100.0));
void applySettings(bool force=false)
SSBModSettings m_settings
void removeTxChannelInstance(PluginInstanceGUI *pluginGUI)
static MainWindow * getInstance()
const QString & getReverseAPIAddress() const
bool blockApplySettings(bool block)
MovingAverageUtil< double, double, 20 > m_channelPowerDbAvg
int getCenterFrequency() const
void handleSourceMessages()
void setLowCutoff(int lowCutoff)
void registerTxChannelInstance(const QString &channelName, PluginInstanceGUI *pluginGUI)
void channelMarkerUpdate()
void push(Message *message, bool emitSignal=true)
Push message onto queue.
static double dbPower(double magsq, double floor=1e-12)
void audioFeedbackSelect()
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
void on_feedbackEnable_toggled(bool checked)
static SSBModGUI * create(PluginAPI *pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSource *channelTx)
void updateWithStreamData()
void leaveEvent(QEvent *)
virtual qint64 getCenterFrequency() const
void onMenuDialogCalled(const QPoint &p)
qint64 m_inputFrequencyOffset
uint16_t m_reverseAPIChannelIndex
void setCWKeyerGUI(Serializable *cwKeyerGUI)
void on_navTimeSlider_valueChanged(int value)
virtual bool handleMessage(const Message &message)
QString m_feedbackAudioDeviceName
This is the audio device you send the audio samples to for audio feedback.
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
void on_flipSidebands_clicked(bool checked)
void setReverseAPIChannelIndex(uint16_t channelIndex)
uint16_t getReverseAPIPort() const
void addChannelMarker(ChannelMarker *channelMarker)
Add channel marker to spectrum.
virtual void setCenterFrequency(qint64 centerFrequency)
void on_lowCut_valueChanged(int value)
void on_dsb_toggled(bool checked)
void on_tone_toggled(bool checked)
QByteArray serialize() const
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
void setReverseAPIDeviceIndex(uint16_t deviceIndex)
uint16_t getReverseAPIDeviceIndex() const
void on_morseKeyer_toggled(bool checked)
float m_feedbackVolumeFactor
DeviceUISet * m_deviceUISet
void updateWithStreamTime()
void on_playLoop_toggled(bool checked)
void setSourceOrSinkStream(bool sourceOrSinkStream)
static DSPEngine * instance()
QString m_audioDeviceName
This is the audio device you get the audio samples from.
SSBModInputAF m_modAFInput
uint16_t m_reverseAPIDeviceIndex
void setHighlighted(bool highlighted)
void onWidgetRolled(QWidget *widget, bool rollDown)
bool deserialize(const QByteArray &data)
void on_deltaFrequency_changed(qint64 value)
void addRollupWidget(QWidget *widget)
Add rollup widget to channel window.
virtual void setMessageQueueToGUI(MessageQueue *queue)
void on_play_toggled(bool checked)
const QString & getTitle() const
bool useReverseAPI() const
static bool match(const Message *message)
virtual MessageQueue * getInputMessageQueue()
void on_toneFrequency_valueChanged(int value)
QByteArray serialize() const
void enterEvent(QEvent *)
SSBModGUI(PluginAPI *pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSource *channelTx, QWidget *parent=0)
uint16_t m_reverseAPIPort
QString m_audioDeviceName
void setSpectrumGUI(Serializable *spectrumGUI)
void setReverseAPIAddress(const QString &address)
void setColor(const QColor &color)
void on_spanLog2_valueChanged(int value)
void setChannelMarker(Serializable *channelMarker)
void setVisible(bool visible)
void setReverseAPIPort(uint16_t port)
void on_audioBinaural_toggled(bool checked)
QString m_reverseAPIAddress
void on_feedbackVolume_valueChanged(int value)
uint16_t getReverseAPIChannelIndex() const
void setBandwidth(int bandwidth)
const QColor & getColor() const
void channelMarkerChangedByCursor()
void setTitle(const QString &title)
void on_audioFlipChannels_toggled(bool checked)
void on_BW_valueChanged(int value)
void on_volume_valueChanged(int value)
void on_audioMute_toggled(bool checked)
uint32_t getAudioSampleRate() const
ChannelMarker m_channelMarker
bool deserialize(const QByteArray &data)
SpectrumVis * m_spectrumVis
void setCenterFrequency(int centerFrequency)
void setSidebands(sidebands_t sidebands)
void on_mic_toggled(bool checked)
void on_agc_toggled(bool checked)
void applyBandwidths(int spanLog2, bool force=false)
void setName(const QString &name)
void setUseReverseAPI(bool useReverseAPI)
bool m_feedbackAudioEnable
void on_showFileDialog_clicked(bool checked)
static const QString m_channelIdURI
void setSpectrumSampleSink(BasebandSampleSink *sampleSink)