SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
Public Slots | Public Member Functions | Static Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
SSBModGUI Class Reference

#include <ssbmodgui.h>

+ Inheritance diagram for SSBModGUI:
+ Collaboration diagram for SSBModGUI:

Public Slots

void channelMarkerChangedByCursor ()
 

Public Member Functions

virtual void destroy ()
 
void setName (const QString &name)
 
QString getName () const
 
virtual qint64 getCenterFrequency () const
 
virtual void setCenterFrequency (qint64 centerFrequency)
 
void resetToDefaults ()
 
QByteArray serialize () const
 
bool deserialize (const QByteArray &data)
 
virtual MessageQueuegetInputMessageQueue ()
 
virtual bool handleMessage (const Message &message)
 
- Public Member Functions inherited from RollupWidget
 RollupWidget (QWidget *parent=NULL)
 
void setTitleColor (const QColor &c)
 
void setHighlighted (bool highlighted)
 
- Public Member Functions inherited from PluginInstanceGUI
 PluginInstanceGUI ()
 
virtual ~PluginInstanceGUI ()
 

Static Public Member Functions

static SSBModGUIcreate (PluginAPI *pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSource *channelTx)
 

Private Slots

void handleSourceMessages ()
 
void on_deltaFrequency_changed (qint64 value)
 
void on_flipSidebands_clicked (bool checked)
 
void on_dsb_toggled (bool checked)
 
void on_audioBinaural_toggled (bool checked)
 
void on_audioFlipChannels_toggled (bool checked)
 
void on_spanLog2_valueChanged (int value)
 
void on_BW_valueChanged (int value)
 
void on_lowCut_valueChanged (int value)
 
void on_volume_valueChanged (int value)
 
void on_audioMute_toggled (bool checked)
 
void on_tone_toggled (bool checked)
 
void on_toneFrequency_valueChanged (int value)
 
void on_mic_toggled (bool checked)
 
void on_agc_toggled (bool checked)
 
void on_play_toggled (bool checked)
 
void on_playLoop_toggled (bool checked)
 
void on_morseKeyer_toggled (bool checked)
 
void on_navTimeSlider_valueChanged (int value)
 
void on_showFileDialog_clicked (bool checked)
 
void on_feedbackEnable_toggled (bool checked)
 
void on_feedbackVolume_valueChanged (int value)
 
void onWidgetRolled (QWidget *widget, bool rollDown)
 
void onMenuDialogCalled (const QPoint &p)
 
void configureFileName ()
 
void audioSelect ()
 
void audioFeedbackSelect ()
 
void tick ()
 

Private Member Functions

 SSBModGUI (PluginAPI *pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSource *channelTx, QWidget *parent=0)
 
virtual ~SSBModGUI ()
 
bool blockApplySettings (bool block)
 
void applySettings (bool force=false)
 
void applyBandwidths (int spanLog2, bool force=false)
 
void displaySettings ()
 
void updateWithStreamData ()
 
void updateWithStreamTime ()
 
void channelMarkerUpdate ()
 
void leaveEvent (QEvent *)
 
void enterEvent (QEvent *)
 

Private Attributes

Ui::SSBModGUI * ui
 
PluginAPIm_pluginAPI
 
DeviceUISetm_deviceUISet
 
ChannelMarker m_channelMarker
 
SSBModSettings m_settings
 
bool m_doApplySettings
 
int m_spectrumRate
 
SpectrumVism_spectrumVis
 
SSBModm_ssbMod
 
MovingAverageUtil< double, double, 20 > m_channelPowerDbAvg
 
QString m_fileName
 
quint32 m_recordLength
 
int m_recordSampleRate
 
int m_samplesCount
 
std::size_t m_tickCount
 
bool m_enableNavTime
 
MessageQueue m_inputMessageQueue
 
QIcon m_iconDSBUSB
 
QIcon m_iconDSBLSB
 

Additional Inherited Members

- Signals inherited from RollupWidget
void widgetRolled (QWidget *widget, bool rollDown)
 
- Protected Types inherited from RollupWidget
enum  { VersionMarker = 0xff }
 
enum  ContextMenuType { ContextMenuNone, ContextMenuChannelSettings, ContextMenuStreamSettings }
 
- Protected Member Functions inherited from RollupWidget
int arrangeRollups ()
 
QByteArray saveState (int version=0) const
 
bool restoreState (const QByteArray &state, int version=0)
 
void paintEvent (QPaintEvent *)
 
int paintRollup (QWidget *rollup, int pos, QPainter *p, bool last, const QColor &frame)
 
void resizeEvent (QResizeEvent *size)
 
void mousePressEvent (QMouseEvent *event)
 
bool event (QEvent *event)
 
bool eventFilter (QObject *object, QEvent *event)
 
void resetContextMenuType ()
 
void setStreamIndicator (const QString &indicator)
 
- Protected Attributes inherited from RollupWidget
QColor m_titleColor
 
QColor m_titleTextColor
 
bool m_highlighted
 
ContextMenuType m_contextMenuType
 
QString m_streamIndicator
 

Detailed Description

Definition at line 41 of file ssbmodgui.h.

Constructor & Destructor Documentation

◆ SSBModGUI()

SSBModGUI::SSBModGUI ( PluginAPI pluginAPI,
DeviceUISet deviceUISet,
BasebandSampleSource channelTx,
QWidget *  parent = 0 
)
explicitprivate

Definition at line 387 of file ssbmodgui.cpp.

References DeviceUISet::addChannelMarker(), DeviceUISet::addRollupWidget(), applyBandwidths(), arg(), audioFeedbackSelect(), audioSelect(), channelMarkerChangedByCursor(), displaySettings(), ChannelMarker::getColor(), SSBMod::getCWKeyer(), getInputMessageQueue(), BasebandSampleSink::getInputMessageQueue(), MainWindow::getInstance(), ColorMapper::GrayGold, handleSourceMessages(), SSBMod::m_channelIdURI, m_channelMarker, m_deviceUISet, m_iconDSBLSB, m_iconDSBUSB, m_settings, m_spectrumRate, m_spectrumVis, m_ssbMod, onMenuDialogCalled(), onWidgetRolled(), DeviceUISet::registerTxChannelInstance(), resetToDefaults(), SDR_TX_SCALEF, ChannelMarker::setBandwidth(), ChannelMarker::setCenterFrequency(), SSBModSettings::setChannelMarker(), ChannelMarker::setColor(), SSBModSettings::setCWKeyerGUI(), BasebandSampleSource::setMessageQueueToGUI(), ChannelMarker::setSidebands(), ChannelMarker::setSourceOrSinkStream(), SSBModSettings::setSpectrumGUI(), SSBMod::setSpectrumSampleSink(), ChannelMarker::setTitle(), RollupWidget::setTitleColor(), ChannelMarker::setVisible(), tick(), ui, ChannelMarker::usb, and RollupWidget::widgetRolled().

Referenced by create().

387  :
388  RollupWidget(parent),
389  ui(new Ui::SSBModGUI),
390  m_pluginAPI(pluginAPI),
391  m_deviceUISet(deviceUISet),
392  m_channelMarker(this),
393  m_doApplySettings(true),
394  m_spectrumRate(6000),
395  m_recordLength(0),
396  m_recordSampleRate(48000),
397  m_samplesCount(0),
398  m_tickCount(0),
399  m_enableNavTime(false)
400 {
401  ui->setupUi(this);
402  setAttribute(Qt::WA_DeleteOnClose, true);
403  connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
404  connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
405 
406  m_spectrumVis = new SpectrumVis(SDR_TX_SCALEF, ui->glSpectrum);
407  m_ssbMod = (SSBMod*) channelTx; //new SSBMod(m_deviceUISet->m_deviceSinkAPI);
410 
411  resetToDefaults();
412 
413  ui->glSpectrum->setCenterFrequency(m_spectrumRate/2);
414  ui->glSpectrum->setSampleRate(m_spectrumRate);
415  ui->glSpectrum->setDisplayWaterfall(true);
416  ui->glSpectrum->setDisplayMaxHold(true);
417  ui->glSpectrum->setSsbSpectrum(true);
418  ui->glSpectrum->connectTimer(MainWindow::getInstance()->getMasterTimer());
419 
420  connect(&MainWindow::getInstance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick()));
421 
422  CRightClickEnabler *audioMuteRightClickEnabler = new CRightClickEnabler(ui->mic);
423  connect(audioMuteRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(audioSelect()));
424 
425  CRightClickEnabler *feedbackRightClickEnabler = new CRightClickEnabler(ui->feedbackEnable);
426  connect(feedbackRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(audioFeedbackSelect()));
427 
428  ui->deltaFrequencyLabel->setText(QString("%1f").arg(QChar(0x94, 0x03)));
429  ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
430  ui->deltaFrequency->setValueRange(false, 7, -9999999, 9999999);
431 
432  m_channelMarker.blockSignals(true);
433  m_channelMarker.setColor(Qt::green);
437  m_channelMarker.setTitle("SSB Modulator");
439  m_channelMarker.blockSignals(false);
441 
443 
447 
448  connect(&m_channelMarker, SIGNAL(changedByCursor()), this, SLOT(channelMarkerChangedByCursor()));
449 
450  ui->cwKeyerGUI->setCWKeyer(m_ssbMod->getCWKeyer());
451  ui->spectrumGUI->setBuddies(m_spectrumVis->getInputMessageQueue(), m_spectrumVis, ui->glSpectrum);
452 
454  m_settings.setSpectrumGUI(ui->spectrumGUI);
455  m_settings.setCWKeyerGUI(ui->cwKeyerGUI);
456 
457  connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages()));
458  connect(m_ssbMod, SIGNAL(levelChanged(qreal, qreal, int)), ui->volumeMeter, SLOT(levelChanged(qreal, qreal, int)));
459 
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);
464 
465  displaySettings();
466  applyBandwidths(5 - ui->spanLog2->value(), true); // does applySettings(true)
467 }
SSBModSettings m_settings
Definition: ssbmodgui.h:67
static MainWindow * getInstance()
Definition: mainwindow.h:73
void handleSourceMessages()
Definition: ssbmodgui.cpp:163
void registerTxChannelInstance(const QString &channelName, PluginInstanceGUI *pluginGUI)
Definition: deviceuiset.cpp:88
Definition: ssbmod.h:49
void audioFeedbackSelect()
Definition: ssbmodgui.cpp:728
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
PluginAPI * m_pluginAPI
Definition: ssbmodgui.h:64
void onMenuDialogCalled(const QPoint &p)
Definition: ssbmodgui.cpp:355
void tick()
Definition: ssbmodgui.cpp:741
void setCWKeyerGUI(Serializable *cwKeyerGUI)
int m_samplesCount
Definition: ssbmodgui.h:78
QIcon m_iconDSBUSB
Definition: ssbmodgui.h:83
void addChannelMarker(ChannelMarker *channelMarker)
Add channel marker to spectrum.
Definition: deviceuiset.cpp:72
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
int m_recordSampleRate
Definition: ssbmodgui.h:77
RollupWidget(QWidget *parent=NULL)
Definition: rollupwidget.cpp:7
DeviceUISet * m_deviceUISet
Definition: ssbmodgui.h:65
#define SDR_TX_SCALEF
Definition: dsptypes.h:39
quint32 m_recordLength
Definition: ssbmodgui.h:76
void setSourceOrSinkStream(bool sourceOrSinkStream)
Definition: channelmarker.h:75
void setTitleColor(const QColor &c)
void onWidgetRolled(QWidget *widget, bool rollDown)
Definition: ssbmodgui.cpp:349
void addRollupWidget(QWidget *widget)
Add rollup widget to channel window.
Definition: deviceuiset.cpp:77
virtual void setMessageQueueToGUI(MessageQueue *queue)
int m_spectrumRate
Definition: ssbmodgui.h:69
virtual MessageQueue * getInputMessageQueue()
Definition: ssbmodgui.h:56
Ui::SSBModGUI * ui
Definition: ssbmodgui.h:63
void setSpectrumGUI(Serializable *spectrumGUI)
void resetToDefaults()
Definition: ssbmodgui.cpp:71
CWKeyer * getCWKeyer()
Definition: ssbmod.h:252
void setColor(const QColor &color)
bool m_enableNavTime
Definition: ssbmodgui.h:80
void setChannelMarker(Serializable *channelMarker)
void setVisible(bool visible)
SSBMod * m_ssbMod
Definition: ssbmodgui.h:72
std::size_t m_tickCount
Definition: ssbmodgui.h:79
bool m_doApplySettings
Definition: ssbmodgui.h:68
QIcon m_iconDSBLSB
Definition: ssbmodgui.h:84
void setBandwidth(int bandwidth)
const QColor & getColor() const
Definition: channelmarker.h:64
void channelMarkerChangedByCursor()
Definition: ssbmodgui.cpp:149
void setTitle(const QString &title)
void displaySettings()
Definition: ssbmodgui.cpp:611
ChannelMarker m_channelMarker
Definition: ssbmodgui.h:66
SpectrumVis * m_spectrumVis
Definition: ssbmodgui.h:71
void setCenterFrequency(int centerFrequency)
void setSidebands(sidebands_t sidebands)
void applyBandwidths(int spanLog2, bool force=false)
Definition: ssbmodgui.cpp:507
void widgetRolled(QWidget *widget, bool rollDown)
void audioSelect()
Definition: ssbmodgui.cpp:715
static const QString m_channelIdURI
Definition: ssbmod.h:254
void setSpectrumSampleSink(BasebandSampleSink *sampleSink)
Definition: ssbmod.h:210
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ~SSBModGUI()

SSBModGUI::~SSBModGUI ( )
privatevirtual

Definition at line 469 of file ssbmodgui.cpp.

References m_deviceUISet, m_spectrumVis, m_ssbMod, DeviceUISet::removeTxChannelInstance(), and ui.

470 {
472  delete m_ssbMod; // TODO: check this: when the GUI closes it has to delete the modulator
473  delete m_spectrumVis;
474  delete ui;
475 }
void removeTxChannelInstance(PluginInstanceGUI *pluginGUI)
DeviceUISet * m_deviceUISet
Definition: ssbmodgui.h:65
Ui::SSBModGUI * ui
Definition: ssbmodgui.h:63
SSBMod * m_ssbMod
Definition: ssbmodgui.h:72
SpectrumVis * m_spectrumVis
Definition: ssbmodgui.h:71
+ Here is the call graph for this function:

Member Function Documentation

◆ applyBandwidths()

void SSBModGUI::applyBandwidths ( int  spanLog2,
bool  force = false 
)
private

Definition at line 507 of file ssbmodgui.cpp.

References applySettings(), arg(), blockApplySettings(), ChannelMarker::dsb, SSBMod::getAudioSampleRate(), ChannelMarker::lsb, SSBModSettings::m_bandwidth, m_channelMarker, SSBModSettings::m_dsb, m_iconDSBLSB, m_iconDSBUSB, SSBModSettings::m_lowCutoff, m_settings, SSBModSettings::m_spanLog2, m_spectrumRate, m_ssbMod, ChannelMarker::setBandwidth(), ChannelMarker::setLowCutoff(), ChannelMarker::setSidebands(), ui, and ChannelMarker::usb.

Referenced by deserialize(), handleMessage(), on_BW_valueChanged(), on_dsb_toggled(), on_lowCut_valueChanged(), on_spanLog2_valueChanged(), and SSBModGUI().

508 {
509  bool dsb = ui->dsb->isChecked();
510  m_spectrumRate = m_ssbMod->getAudioSampleRate() / (1<<spanLog2);
511  int bw = ui->BW->value();
512  int lw = ui->lowCut->value();
513  int bwMax = m_ssbMod->getAudioSampleRate() / (100*(1<<spanLog2));
514  int tickInterval = m_spectrumRate / 1200;
515  tickInterval = tickInterval == 0 ? 1 : tickInterval;
516 
517  qDebug() << "SSBModGUI::applyBandwidths:"
518  << " dsb: " << dsb
519  << " spanLog2: " << spanLog2
520  << " m_spectrumRate: " << m_spectrumRate
521  << " bw: " << bw
522  << " lw: " << lw
523  << " bwMax: " << bwMax
524  << " tickInterval: " << tickInterval;
525 
526  ui->BW->setTickInterval(tickInterval);
527  ui->lowCut->setTickInterval(tickInterval);
528 
529  bw = bw < -bwMax ? -bwMax : bw > bwMax ? bwMax : bw;
530 
531  if (bw < 0) {
532  lw = lw < bw+1 ? bw+1 : lw < 0 ? lw : 0;
533  } else if (bw > 0) {
534  lw = lw > bw-1 ? bw-1 : lw < 0 ? 0 : lw;
535  } else {
536  lw = 0;
537  }
538 
539  if (dsb)
540  {
541  bw = bw < 0 ? -bw : bw;
542  lw = 0;
543  }
544 
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);
548 
549  if (dsb)
550  {
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);
559  ui->glSpectrum->setSampleRate(2*m_spectrumRate);
560  ui->glSpectrum->setSsbSpectrum(false);
561  ui->glSpectrum->setLsbDisplay(false);
562  }
563  else
564  {
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");
572  ui->glSpectrum->setCenterFrequency(m_spectrumRate/2);
573  ui->glSpectrum->setSampleRate(m_spectrumRate);
574  ui->glSpectrum->setSsbSpectrum(true);
575  ui->glSpectrum->setLsbDisplay(bw < 0);
576  }
577 
578  ui->lowCutText->setText(tr("%1k").arg(lwStr));
579 
580 
581  ui->BW->blockSignals(true);
582  ui->lowCut->blockSignals(true);
583 
584  ui->BW->setMaximum(bwMax);
585  ui->BW->setMinimum(dsb ? 0 : -bwMax);
586  ui->BW->setValue(bw);
587 
588  ui->lowCut->setMaximum(dsb ? 0 : bwMax);
589  ui->lowCut->setMinimum(dsb ? 0 : -bwMax);
590  ui->lowCut->setValue(lw);
591 
592  ui->lowCut->blockSignals(false);
593  ui->BW->blockSignals(false);
594 
595 
596  m_settings.m_dsb = dsb;
597  m_settings.m_spanLog2 = spanLog2;
598  m_settings.m_bandwidth = bw * 100;
599  m_settings.m_lowCutoff = lw * 100;
600 
601  applySettings(force);
602 
603  bool applySettingsWereBlocked = blockApplySettings(true);
604  m_channelMarker.setBandwidth(bw * 200);
606  ui->dsb->setIcon(bw < 0 ? m_iconDSBLSB : m_iconDSBUSB);
607  if (!dsb) { m_channelMarker.setLowCutoff(lw * 100); }
608  blockApplySettings(applySettingsWereBlocked);
609 }
void applySettings(bool force=false)
Definition: ssbmodgui.cpp:484
SSBModSettings m_settings
Definition: ssbmodgui.h:67
bool blockApplySettings(bool block)
Definition: ssbmodgui.cpp:477
void setLowCutoff(int lowCutoff)
QIcon m_iconDSBUSB
Definition: ssbmodgui.h:83
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
int m_spectrumRate
Definition: ssbmodgui.h:69
Ui::SSBModGUI * ui
Definition: ssbmodgui.h:63
SSBMod * m_ssbMod
Definition: ssbmodgui.h:72
QIcon m_iconDSBLSB
Definition: ssbmodgui.h:84
void setBandwidth(int bandwidth)
uint32_t getAudioSampleRate() const
Definition: ssbmod.h:249
ChannelMarker m_channelMarker
Definition: ssbmodgui.h:66
void setSidebands(sidebands_t sidebands)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ applySettings()

void SSBModGUI::applySettings ( bool  force = false)
private

Definition at line 484 of file ssbmodgui.cpp.

References SSBMod::MsgConfigureSSBMod::create(), SSBMod::MsgConfigureChannelizer::create(), BasebandSampleSource::getInputMessageQueue(), SSBModSettings::m_bandwidth, m_doApplySettings, SSBModSettings::m_inputFrequencyOffset, SSBModSettings::m_lowCutoff, m_settings, m_ssbMod, SSBModSettings::m_usb, and MessageQueue::push().

Referenced by applyBandwidths(), audioFeedbackSelect(), audioSelect(), channelMarkerChangedByCursor(), channelMarkerUpdate(), on_agc_toggled(), on_audioBinaural_toggled(), on_audioFlipChannels_toggled(), on_audioMute_toggled(), on_deltaFrequency_changed(), on_feedbackEnable_toggled(), on_feedbackVolume_valueChanged(), on_mic_toggled(), on_morseKeyer_toggled(), on_play_toggled(), on_playLoop_toggled(), on_tone_toggled(), on_toneFrequency_valueChanged(), on_volume_valueChanged(), onMenuDialogCalled(), and setCenterFrequency().

485 {
486  if (m_doApplySettings)
487  {
490  m_ssbMod->getInputMessageQueue()->push(msgChan);
491 
492  SSBModSettings mod_settings; // different USB/LSB convention between modulator and GUI
493  mod_settings = m_settings;
494  if (mod_settings.m_bandwidth > 0) {
495  mod_settings.m_usb = true;
496  } else {
497  mod_settings.m_bandwidth = -mod_settings.m_bandwidth;
498  mod_settings.m_lowCutoff = -mod_settings.m_lowCutoff;
499  mod_settings.m_usb = false;
500  }
501 
504  }
505 }
SSBModSettings m_settings
Definition: ssbmodgui.h:67
static MsgConfigureSSBMod * create(const SSBModSettings &settings, bool force)
Definition: ssbmod.h:60
void push(Message *message, bool emitSignal=true)
Push message onto queue.
qint64 m_inputFrequencyOffset
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
static MsgConfigureChannelizer * create(int sampleRate, int centerFrequency)
Definition: ssbmod.h:83
SSBMod * m_ssbMod
Definition: ssbmodgui.h:72
bool m_doApplySettings
Definition: ssbmodgui.h:68
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ audioFeedbackSelect

void SSBModGUI::audioFeedbackSelect ( )
privateslot

Definition at line 728 of file ssbmodgui.cpp.

References applySettings(), audioSelect(), DSPEngine::instance(), AudioSelectDialog::m_audioDeviceName, SSBModSettings::m_audioDeviceName, SSBModSettings::m_feedbackAudioDeviceName, AudioSelectDialog::m_selected, and m_settings.

Referenced by SSBModGUI().

729 {
730  qDebug("SSBModGUI::audioFeedbackSelect");
731  AudioSelectDialog audioSelect(DSPEngine::instance()->getAudioDeviceManager(), m_settings.m_audioDeviceName, false); // false for output
732  audioSelect.exec();
733 
734  if (audioSelect.m_selected)
735  {
737  applySettings();
738  }
739 }
void applySettings(bool force=false)
Definition: ssbmodgui.cpp:484
SSBModSettings m_settings
Definition: ssbmodgui.h:67
QString m_feedbackAudioDeviceName
This is the audio device you send the audio samples to for audio feedback.
static DSPEngine * instance()
Definition: dspengine.cpp:51
QString m_audioDeviceName
This is the audio device you get the audio samples from.
void audioSelect()
Definition: ssbmodgui.cpp:715
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ audioSelect

void SSBModGUI::audioSelect ( )
privateslot

Definition at line 715 of file ssbmodgui.cpp.

References applySettings(), DSPEngine::instance(), AudioSelectDialog::m_audioDeviceName, SSBModSettings::m_audioDeviceName, AudioSelectDialog::m_selected, and m_settings.

Referenced by audioFeedbackSelect(), and SSBModGUI().

716 {
717  qDebug("SSBModGUI::audioSelect");
718  AudioSelectDialog audioSelect(DSPEngine::instance()->getAudioDeviceManager(), m_settings.m_audioDeviceName, true); // true for input
719  audioSelect.exec();
720 
721  if (audioSelect.m_selected)
722  {
723  m_settings.m_audioDeviceName = audioSelect.m_audioDeviceName;
724  applySettings();
725  }
726 }
void applySettings(bool force=false)
Definition: ssbmodgui.cpp:484
SSBModSettings m_settings
Definition: ssbmodgui.h:67
static DSPEngine * instance()
Definition: dspengine.cpp:51
QString m_audioDeviceName
This is the audio device you get the audio samples from.
void audioSelect()
Definition: ssbmodgui.cpp:715
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ blockApplySettings()

bool SSBModGUI::blockApplySettings ( bool  block)
private

Definition at line 477 of file ssbmodgui.cpp.

References m_doApplySettings.

Referenced by applyBandwidths(), displaySettings(), and handleMessage().

478 {
479  bool ret = !m_doApplySettings;
480  m_doApplySettings = !block;
481  return ret;
482 }
bool m_doApplySettings
Definition: ssbmodgui.h:68
+ Here is the caller graph for this function:

◆ channelMarkerChangedByCursor

void SSBModGUI::channelMarkerChangedByCursor ( )
slot

Definition at line 149 of file ssbmodgui.cpp.

References applySettings(), ChannelMarker::getCenterFrequency(), m_channelMarker, SSBModSettings::m_inputFrequencyOffset, m_settings, and ui.

Referenced by SSBModGUI().

150 {
151  ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency());
153  applySettings();
154 }
void applySettings(bool force=false)
Definition: ssbmodgui.cpp:484
SSBModSettings m_settings
Definition: ssbmodgui.h:67
int getCenterFrequency() const
Definition: channelmarker.h:42
qint64 m_inputFrequencyOffset
Ui::SSBModGUI * ui
Definition: ssbmodgui.h:63
ChannelMarker m_channelMarker
Definition: ssbmodgui.h:66
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ channelMarkerUpdate()

void SSBModGUI::channelMarkerUpdate ( )
private

Definition at line 156 of file ssbmodgui.cpp.

References applySettings(), displaySettings(), ChannelMarker::getColor(), m_channelMarker, SSBModSettings::m_rgbColor, and m_settings.

157 {
159  displaySettings();
160  applySettings();
161 }
void applySettings(bool force=false)
Definition: ssbmodgui.cpp:484
SSBModSettings m_settings
Definition: ssbmodgui.h:67
const QColor & getColor() const
Definition: channelmarker.h:64
void displaySettings()
Definition: ssbmodgui.cpp:611
ChannelMarker m_channelMarker
Definition: ssbmodgui.h:66
quint32 m_rgbColor
+ Here is the call graph for this function:

◆ configureFileName

void SSBModGUI::configureFileName ( )
privateslot

Definition at line 342 of file ssbmodgui.cpp.

References SSBMod::MsgConfigureFileSourceName::create(), BasebandSampleSource::getInputMessageQueue(), m_fileName, m_ssbMod, and MessageQueue::push().

Referenced by on_showFileDialog_clicked().

343 {
344  qDebug() << "FileSourceGui::configureFileName: " << m_fileName.toStdString().c_str();
346  m_ssbMod->getInputMessageQueue()->push(message);
347 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
QString m_fileName
Definition: ssbmodgui.h:75
static MsgConfigureFileSourceName * create(const QString &fileName)
Definition: ssbmod.h:106
SSBMod * m_ssbMod
Definition: ssbmodgui.h:72
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create()

SSBModGUI * SSBModGUI::create ( PluginAPI pluginAPI,
DeviceUISet deviceUISet,
BasebandSampleSource channelTx 
)
static

Definition at line 39 of file ssbmodgui.cpp.

References SSBModGUI().

Referenced by SSBModPlugin::createTxChannelGUI().

40 {
41  SSBModGUI* gui = new SSBModGUI(pluginAPI, deviceUISet, channelTx);
42  return gui;
43 }
SSBModGUI(PluginAPI *pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSource *channelTx, QWidget *parent=0)
Definition: ssbmodgui.cpp:387
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deserialize()

bool SSBModGUI::deserialize ( const QByteArray &  data)
virtual

Implements PluginInstanceGUI.

Definition at line 81 of file ssbmodgui.cpp.

References applyBandwidths(), SSBModSettings::deserialize(), displaySettings(), m_settings, SSBModSettings::resetToDefaults(), and ui.

82 {
83  if(m_settings.deserialize(data))
84  {
85  qDebug("SSBModGUI::deserialize");
87  applyBandwidths(5 - ui->spanLog2->value(), true); // does applySettings(true)
88  return true;
89  }
90  else
91  {
94  applyBandwidths(5 - ui->spanLog2->value(), true); // does applySettings(true)
95  return false;
96  }
97 }
SSBModSettings m_settings
Definition: ssbmodgui.h:67
Ui::SSBModGUI * ui
Definition: ssbmodgui.h:63
void displaySettings()
Definition: ssbmodgui.cpp:611
bool deserialize(const QByteArray &data)
void applyBandwidths(int spanLog2, bool force=false)
Definition: ssbmodgui.cpp:507
+ Here is the call graph for this function:

◆ destroy()

void SSBModGUI::destroy ( )
virtual

Implements PluginInstanceGUI.

Definition at line 45 of file ssbmodgui.cpp.

46 {
47  delete this;
48 }

◆ displaySettings()

void SSBModGUI::displaySettings ( )
private

Definition at line 611 of file ssbmodgui.cpp.

References arg(), blockApplySettings(), ChannelMarker::dsb, ChannelMarker::getTitle(), ChannelMarker::lsb, SSBModSettings::m_agc, SSBModSettings::m_audioBinaural, SSBModSettings::m_audioFlipChannels, SSBModSettings::m_audioMute, SSBModSettings::m_bandwidth, m_channelMarker, SSBModSettings::m_dsb, SSBModSettings::m_feedbackAudioEnable, SSBModSettings::m_feedbackVolumeFactor, m_iconDSBLSB, m_iconDSBUSB, SSBModSettings::m_inputFrequencyOffset, SSBModSettings::m_lowCutoff, SSBModSettings::m_modAFInput, SSBModSettings::m_playLoop, SSBModSettings::m_rgbColor, m_settings, SSBModSettings::m_spanLog2, SSBModSettings::m_title, SSBModSettings::m_toneFrequency, SSBModSettings::m_volumeFactor, ChannelMarker::setBandwidth(), ChannelMarker::setCenterFrequency(), ChannelMarker::setColor(), ChannelMarker::setLowCutoff(), ChannelMarker::setSidebands(), ChannelMarker::setTitle(), RollupWidget::setTitleColor(), ui, and ChannelMarker::usb.

Referenced by channelMarkerUpdate(), deserialize(), handleMessage(), and SSBModGUI().

612 {
613  m_channelMarker.blockSignals(true);
618 
619  ui->flipSidebands->setEnabled(!m_settings.m_dsb);
620 
621  if (m_settings.m_dsb) {
623  } else {
624  if (m_settings.m_bandwidth < 0) {
626  ui->dsb->setIcon(m_iconDSBLSB);
627  } else {
629  ui->dsb->setIcon(m_iconDSBUSB);
630  }
631  }
632 
633  m_channelMarker.blockSignals(false);
635 
637  setWindowTitle(m_channelMarker.getTitle());
638 
639  blockApplySettings(true);
640 
641  ui->agc->setChecked(m_settings.m_agc);
642  ui->audioBinaural->setChecked(m_settings.m_audioBinaural);
643  ui->audioFlipChannels->setChecked(m_settings.m_audioFlipChannels);
644  ui->audioMute->setChecked(m_settings.m_audioMute);
645  ui->playLoop->setChecked(m_settings.m_playLoop);
646 
647  // Prevent uncontrolled triggering of applyBandwidths
648  ui->spanLog2->blockSignals(true);
649  ui->dsb->blockSignals(true);
650  ui->BW->blockSignals(true);
651 
652  ui->dsb->setChecked(m_settings.m_dsb);
653  ui->spanLog2->setValue(5 - m_settings.m_spanLog2);
654 
655  ui->BW->setValue(roundf(m_settings.m_bandwidth/100.0));
656  QString s = QString::number(m_settings.m_bandwidth/1000.0, 'f', 1);
657 
658  if (m_settings.m_dsb)
659  {
660  ui->BWText->setText(tr("%1%2k").arg(QChar(0xB1, 0x00)).arg(s));
661  }
662  else
663  {
664  ui->BWText->setText(tr("%1k").arg(s));
665  }
666 
667  ui->spanLog2->blockSignals(false);
668  ui->dsb->blockSignals(false);
669  ui->BW->blockSignals(false);
670 
671  // The only one of the four signals triggering applyBandwidths will trigger it once only with all other values
672  // set correctly and therefore validate the settings and apply them to dependent widgets
673  ui->lowCut->setValue(m_settings.m_lowCutoff / 100.0);
674  ui->lowCutText->setText(tr("%1k").arg(m_settings.m_lowCutoff / 1000.0));
675 
676  ui->deltaFrequency->setValue(m_settings.m_inputFrequencyOffset);
677 
678  ui->toneFrequency->setValue(roundf(m_settings.m_toneFrequency / 10.0));
679  ui->toneFrequencyText->setText(QString("%1k").arg(m_settings.m_toneFrequency / 1000.0, 0, 'f', 2));
680 
681  ui->volume->setValue(m_settings.m_volumeFactor * 10.0);
682  ui->volumeText->setText(QString("%1").arg(m_settings.m_volumeFactor, 0, 'f', 1));
683 
684  ui->tone->setEnabled((m_settings.m_modAFInput == SSBModSettings::SSBModInputAF::SSBModInputTone)
685  || (m_settings.m_modAFInput == SSBModSettings::SSBModInputAF::SSBModInputNone));
686  ui->mic->setEnabled((m_settings.m_modAFInput == SSBModSettings::SSBModInputAF::SSBModInputAudio)
687  || (m_settings.m_modAFInput == SSBModSettings::SSBModInputAF::SSBModInputNone));
688  ui->play->setEnabled((m_settings.m_modAFInput == SSBModSettings::SSBModInputAF::SSBModInputFile)
689  || (m_settings.m_modAFInput == SSBModSettings::SSBModInputAF::SSBModInputNone));
690  ui->morseKeyer->setEnabled((m_settings.m_modAFInput == SSBModSettings::SSBModInputAF::SSBModInputCWTone)
691  || (m_settings.m_modAFInput == SSBModSettings::SSBModInputAF::SSBModInputNone));
692 
693  ui->tone->setChecked(m_settings.m_modAFInput == SSBModSettings::SSBModInputAF::SSBModInputTone);
694  ui->mic->setChecked(m_settings.m_modAFInput == SSBModSettings::SSBModInputAF::SSBModInputAudio);
695  ui->play->setChecked(m_settings.m_modAFInput == SSBModSettings::SSBModInputAF::SSBModInputFile);
696  ui->morseKeyer->setChecked(m_settings.m_modAFInput == SSBModSettings::SSBModInputAF::SSBModInputCWTone);
697 
698  ui->feedbackEnable->setChecked(m_settings.m_feedbackAudioEnable);
699  ui->feedbackVolume->setValue(roundf(m_settings.m_feedbackVolumeFactor * 100.0));
700  ui->feedbackVolumeText->setText(QString("%1").arg(m_settings.m_feedbackVolumeFactor, 0, 'f', 2));
701 
702  blockApplySettings(false);
703 }
SSBModSettings m_settings
Definition: ssbmodgui.h:67
bool blockApplySettings(bool block)
Definition: ssbmodgui.cpp:477
void setLowCutoff(int lowCutoff)
qint64 m_inputFrequencyOffset
QIcon m_iconDSBUSB
Definition: ssbmodgui.h:83
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
float m_feedbackVolumeFactor
SSBModInputAF m_modAFInput
void setTitleColor(const QColor &c)
bool m_audioFlipChannels
const QString & getTitle() const
Definition: channelmarker.h:38
Ui::SSBModGUI * ui
Definition: ssbmodgui.h:63
void setColor(const QColor &color)
QIcon m_iconDSBLSB
Definition: ssbmodgui.h:84
void setBandwidth(int bandwidth)
void setTitle(const QString &title)
ChannelMarker m_channelMarker
Definition: ssbmodgui.h:66
void setCenterFrequency(int centerFrequency)
void setSidebands(sidebands_t sidebands)
quint32 m_rgbColor
bool m_feedbackAudioEnable
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ enterEvent()

void SSBModGUI::enterEvent ( QEvent *  )
private

Definition at line 710 of file ssbmodgui.cpp.

References m_channelMarker, and ChannelMarker::setHighlighted().

711 {
713 }
void setHighlighted(bool highlighted)
ChannelMarker m_channelMarker
Definition: ssbmodgui.h:66
+ Here is the call graph for this function:

◆ getCenterFrequency()

qint64 SSBModGUI::getCenterFrequency ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 60 of file ssbmodgui.cpp.

References ChannelMarker::getCenterFrequency(), and m_channelMarker.

60  {
62 }
int getCenterFrequency() const
Definition: channelmarker.h:42
ChannelMarker m_channelMarker
Definition: ssbmodgui.h:66
+ Here is the call graph for this function:

◆ getInputMessageQueue()

virtual MessageQueue* SSBModGUI::getInputMessageQueue ( )
inlinevirtual

Implements PluginInstanceGUI.

Definition at line 56 of file ssbmodgui.h.

Referenced by handleSourceMessages(), and SSBModGUI().

56 { return &m_inputMessageQueue; }
MessageQueue m_inputMessageQueue
Definition: ssbmodgui.h:81
+ Here is the caller graph for this function:

◆ getName()

QString SSBModGUI::getName ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 55 of file ssbmodgui.cpp.

56 {
57  return objectName();
58 }

◆ handleMessage()

bool SSBModGUI::handleMessage ( const Message message)
virtual

Implements PluginInstanceGUI.

Definition at line 99 of file ssbmodgui.cpp.

References applyBandwidths(), blockApplySettings(), displaySettings(), SSBMod::getAudioSampleRate(), SSBMod::MsgConfigureSSBMod::getSettings(), CWKeyer::MsgConfigureCWKeyer::getSettings(), SSBModSettings::m_bandwidth, SSBModSettings::m_lowCutoff, m_recordLength, m_recordSampleRate, m_samplesCount, m_settings, m_ssbMod, SSBModSettings::m_usb, Message::match(), ui, updateWithStreamData(), and updateWithStreamTime().

Referenced by handleSourceMessages().

100 {
102  {
103  m_recordSampleRate = ((SSBMod::MsgReportFileSourceStreamData&)message).getSampleRate();
104  m_recordLength = ((SSBMod::MsgReportFileSourceStreamData&)message).getRecordLength();
105  m_samplesCount = 0;
107  return true;
108  }
110  {
111  m_samplesCount = ((SSBMod::MsgReportFileSourceStreamTiming&)message).getSamplesCount();
113  return true;
114  }
115  else if (DSPConfigureAudio::match(message))
116  {
117  qDebug("SSBModGUI::handleMessage: DSPConfigureAudio: %d", m_ssbMod->getAudioSampleRate());
118  applyBandwidths(5 - ui->spanLog2->value()); // will update spectrum details with new sample rate
119  return true;
120  }
121  else if (SSBMod::MsgConfigureSSBMod::match(message))
122  {
123  SSBModSettings mod_settings; // different USB/LSB convention between modulator and GUI
125  mod_settings = cfg.getSettings();
126  if (mod_settings.m_usb == false) {
127  mod_settings.m_bandwidth = -mod_settings.m_bandwidth;
128  mod_settings.m_lowCutoff = -mod_settings.m_lowCutoff;
129  }
130  m_settings = mod_settings;
131  blockApplySettings(true);
132  displaySettings();
133  blockApplySettings(false);
134  return true;
135  }
136  else if (CWKeyer::MsgConfigureCWKeyer::match(message))
137  {
139  ui->cwKeyerGUI->setSettings(cfg.getSettings());
140  ui->cwKeyerGUI->displaySettings();
141  return true;
142  }
143  else
144  {
145  return false;
146  }
147 }
SSBModSettings m_settings
Definition: ssbmodgui.h:67
bool blockApplySettings(bool block)
Definition: ssbmodgui.cpp:477
void updateWithStreamData()
Definition: ssbmodgui.cpp:754
int m_samplesCount
Definition: ssbmodgui.h:78
const SSBModSettings & getSettings() const
Definition: ssbmod.h:57
int m_recordSampleRate
Definition: ssbmodgui.h:77
void updateWithStreamTime()
Definition: ssbmodgui.cpp:763
quint32 m_recordLength
Definition: ssbmodgui.h:76
static bool match(const Message *message)
Definition: message.cpp:45
Ui::SSBModGUI * ui
Definition: ssbmodgui.h:63
SSBMod * m_ssbMod
Definition: ssbmodgui.h:72
void displaySettings()
Definition: ssbmodgui.cpp:611
uint32_t getAudioSampleRate() const
Definition: ssbmod.h:249
void applyBandwidths(int spanLog2, bool force=false)
Definition: ssbmodgui.cpp:507
const CWKeyerSettings & getSettings() const
Definition: cwkeyer.h:60
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleSourceMessages

void SSBModGUI::handleSourceMessages ( )
privateslot

Definition at line 163 of file ssbmodgui.cpp.

References getInputMessageQueue(), and handleMessage().

Referenced by SSBModGUI().

164 {
165  Message* message;
166 
167  while ((message = getInputMessageQueue()->pop()) != 0)
168  {
169  if (handleMessage(*message))
170  {
171  delete message;
172  }
173  }
174 }
virtual bool handleMessage(const Message &message)
Definition: ssbmodgui.cpp:99
virtual MessageQueue * getInputMessageQueue()
Definition: ssbmodgui.h:56
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ leaveEvent()

void SSBModGUI::leaveEvent ( QEvent *  )
private

Definition at line 705 of file ssbmodgui.cpp.

References m_channelMarker, and ChannelMarker::setHighlighted().

706 {
708 }
void setHighlighted(bool highlighted)
ChannelMarker m_channelMarker
Definition: ssbmodgui.h:66
+ Here is the call graph for this function:

◆ on_agc_toggled

void SSBModGUI::on_agc_toggled ( bool  checked)
privateslot

Definition at line 308 of file ssbmodgui.cpp.

References applySettings(), SSBModSettings::m_agc, and m_settings.

309 {
310  m_settings.m_agc = checked;
311  applySettings();
312 }
void applySettings(bool force=false)
Definition: ssbmodgui.cpp:484
SSBModSettings m_settings
Definition: ssbmodgui.h:67
+ Here is the call graph for this function:

◆ on_audioBinaural_toggled

void SSBModGUI::on_audioBinaural_toggled ( bool  checked)
privateslot

Definition at line 198 of file ssbmodgui.cpp.

References applySettings(), SSBModSettings::m_audioBinaural, and m_settings.

199 {
200  m_settings.m_audioBinaural = checked;
201  applySettings();
202 }
void applySettings(bool force=false)
Definition: ssbmodgui.cpp:484
SSBModSettings m_settings
Definition: ssbmodgui.h:67
+ Here is the call graph for this function:

◆ on_audioFlipChannels_toggled

void SSBModGUI::on_audioFlipChannels_toggled ( bool  checked)
privateslot

Definition at line 204 of file ssbmodgui.cpp.

References applySettings(), SSBModSettings::m_audioFlipChannels, and m_settings.

205 {
207  applySettings();
208 }
void applySettings(bool force=false)
Definition: ssbmodgui.cpp:484
SSBModSettings m_settings
Definition: ssbmodgui.h:67
bool m_audioFlipChannels
+ Here is the call graph for this function:

◆ on_audioMute_toggled

void SSBModGUI::on_audioMute_toggled ( bool  checked)
privateslot

Definition at line 245 of file ssbmodgui.cpp.

References applySettings(), SSBModSettings::m_audioMute, and m_settings.

246 {
247  m_settings.m_audioMute = checked;
248  applySettings();
249 }
void applySettings(bool force=false)
Definition: ssbmodgui.cpp:484
SSBModSettings m_settings
Definition: ssbmodgui.h:67
+ Here is the call graph for this function:

◆ on_BW_valueChanged

void SSBModGUI::on_BW_valueChanged ( int  value)
privateslot

Definition at line 219 of file ssbmodgui.cpp.

References applyBandwidths(), and ui.

220 {
221  (void) value;
222  applyBandwidths(5 - ui->spanLog2->value());
223 }
Ui::SSBModGUI * ui
Definition: ssbmodgui.h:63
void applyBandwidths(int spanLog2, bool force=false)
Definition: ssbmodgui.cpp:507
+ Here is the call graph for this function:

◆ on_deltaFrequency_changed

void SSBModGUI::on_deltaFrequency_changed ( qint64  value)
privateslot

Definition at line 176 of file ssbmodgui.cpp.

References applySettings(), ChannelMarker::getCenterFrequency(), m_channelMarker, SSBModSettings::m_inputFrequencyOffset, m_settings, and ChannelMarker::setCenterFrequency().

177 {
180  applySettings();
181 }
void applySettings(bool force=false)
Definition: ssbmodgui.cpp:484
SSBModSettings m_settings
Definition: ssbmodgui.h:67
int getCenterFrequency() const
Definition: channelmarker.h:42
qint64 m_inputFrequencyOffset
ChannelMarker m_channelMarker
Definition: ssbmodgui.h:66
void setCenterFrequency(int centerFrequency)
+ Here is the call graph for this function:

◆ on_dsb_toggled

void SSBModGUI::on_dsb_toggled ( bool  checked)
privateslot

Definition at line 192 of file ssbmodgui.cpp.

References applyBandwidths(), and ui.

193 {
194  ui->flipSidebands->setEnabled(!dsb);
195  applyBandwidths(5 - ui->spanLog2->value());
196 }
Ui::SSBModGUI * ui
Definition: ssbmodgui.h:63
void applyBandwidths(int spanLog2, bool force=false)
Definition: ssbmodgui.cpp:507
+ Here is the call graph for this function:

◆ on_feedbackEnable_toggled

void SSBModGUI::on_feedbackEnable_toggled ( bool  checked)
privateslot

Definition at line 295 of file ssbmodgui.cpp.

References applySettings(), SSBModSettings::m_feedbackAudioEnable, and m_settings.

296 {
298  applySettings();
299 }
void applySettings(bool force=false)
Definition: ssbmodgui.cpp:484
SSBModSettings m_settings
Definition: ssbmodgui.h:67
bool m_feedbackAudioEnable
+ Here is the call graph for this function:

◆ on_feedbackVolume_valueChanged

void SSBModGUI::on_feedbackVolume_valueChanged ( int  value)
privateslot

Definition at line 301 of file ssbmodgui.cpp.

References applySettings(), arg(), SSBModSettings::m_feedbackVolumeFactor, m_settings, and ui.

302 {
303  ui->feedbackVolumeText->setText(QString("%1").arg(value / 100.0, 0, 'f', 2));
304  m_settings.m_feedbackVolumeFactor = value / 100.0;
305  applySettings();
306 }
void applySettings(bool force=false)
Definition: ssbmodgui.cpp:484
SSBModSettings m_settings
Definition: ssbmodgui.h:67
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
float m_feedbackVolumeFactor
Ui::SSBModGUI * ui
Definition: ssbmodgui.h:63
+ Here is the call graph for this function:

◆ on_flipSidebands_clicked

void SSBModGUI::on_flipSidebands_clicked ( bool  checked)
privateslot

Definition at line 183 of file ssbmodgui.cpp.

References ui.

184 {
185  (void) checked;
186  int bwValue = ui->BW->value();
187  int lcValue = ui->lowCut->value();
188  ui->BW->setValue(-bwValue);
189  ui->lowCut->setValue(-lcValue);
190 }
Ui::SSBModGUI * ui
Definition: ssbmodgui.h:63

◆ on_lowCut_valueChanged

void SSBModGUI::on_lowCut_valueChanged ( int  value)
privateslot

Definition at line 225 of file ssbmodgui.cpp.

References applyBandwidths(), and ui.

226 {
227  (void) value;
228  applyBandwidths(5 - ui->spanLog2->value());
229 }
Ui::SSBModGUI * ui
Definition: ssbmodgui.h:63
void applyBandwidths(int spanLog2, bool force=false)
Definition: ssbmodgui.cpp:507
+ Here is the call graph for this function:

◆ on_mic_toggled

void SSBModGUI::on_mic_toggled ( bool  checked)
privateslot

Definition at line 286 of file ssbmodgui.cpp.

References applySettings(), SSBModSettings::m_modAFInput, m_settings, SSBModSettings::SSBModInputAudio, SSBModSettings::SSBModInputNone, and ui.

287 {
288  ui->play->setEnabled(!checked); // release other source inputs
289  ui->morseKeyer->setEnabled(!checked);
290  ui->tone->setEnabled(!checked); // release other source inputs
292  applySettings();
293 }
void applySettings(bool force=false)
Definition: ssbmodgui.cpp:484
SSBModSettings m_settings
Definition: ssbmodgui.h:67
SSBModInputAF m_modAFInput
Ui::SSBModGUI * ui
Definition: ssbmodgui.h:63
+ Here is the call graph for this function:

◆ on_morseKeyer_toggled

void SSBModGUI::on_morseKeyer_toggled ( bool  checked)
privateslot

Definition at line 277 of file ssbmodgui.cpp.

References applySettings(), SSBModSettings::m_modAFInput, m_settings, SSBModSettings::SSBModInputCWTone, SSBModSettings::SSBModInputNone, and ui.

278 {
279  ui->play->setEnabled(!checked); // release other source inputs
280  ui->tone->setEnabled(!checked); // release other source inputs
281  ui->mic->setEnabled(!checked);
283  applySettings();
284 }
void applySettings(bool force=false)
Definition: ssbmodgui.cpp:484
SSBModSettings m_settings
Definition: ssbmodgui.h:67
SSBModInputAF m_modAFInput
Ui::SSBModGUI * ui
Definition: ssbmodgui.h:63
+ Here is the call graph for this function:

◆ on_navTimeSlider_valueChanged

void SSBModGUI::on_navTimeSlider_valueChanged ( int  value)
privateslot

Definition at line 314 of file ssbmodgui.cpp.

References SSBMod::MsgConfigureFileSourceSeek::create(), BasebandSampleSource::getInputMessageQueue(), m_enableNavTime, m_recordLength, m_ssbMod, and MessageQueue::push().

315 {
316  if (m_enableNavTime && ((value >= 0) && (value <= 100)))
317  {
318  int t_sec = (m_recordLength * value) / 100;
319  QTime t(0, 0, 0, 0);
320  t = t.addSecs(t_sec);
321 
323  m_ssbMod->getInputMessageQueue()->push(message);
324  }
325 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
static MsgConfigureFileSourceSeek * create(int seekPercentage)
Definition: ssbmod.h:127
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
quint32 m_recordLength
Definition: ssbmodgui.h:76
bool m_enableNavTime
Definition: ssbmodgui.h:80
SSBMod * m_ssbMod
Definition: ssbmodgui.h:72
+ Here is the call graph for this function:

◆ on_play_toggled

void SSBModGUI::on_play_toggled ( bool  checked)
privateslot

Definition at line 257 of file ssbmodgui.cpp.

References applySettings(), m_enableNavTime, SSBModSettings::m_modAFInput, m_settings, SSBModSettings::SSBModInputFile, SSBModSettings::SSBModInputNone, and ui.

258 {
259  ui->tone->setEnabled(!checked); // release other source inputs
260  ui->morseKeyer->setEnabled(!checked);
261  ui->mic->setEnabled(!checked);
263  applySettings();
264  ui->navTimeSlider->setEnabled(!checked);
265  m_enableNavTime = !checked;
266 }
void applySettings(bool force=false)
Definition: ssbmodgui.cpp:484
SSBModSettings m_settings
Definition: ssbmodgui.h:67
SSBModInputAF m_modAFInput
Ui::SSBModGUI * ui
Definition: ssbmodgui.h:63
bool m_enableNavTime
Definition: ssbmodgui.h:80
+ Here is the call graph for this function:

◆ on_playLoop_toggled

void SSBModGUI::on_playLoop_toggled ( bool  checked)
privateslot

Definition at line 251 of file ssbmodgui.cpp.

References applySettings(), SSBModSettings::m_playLoop, and m_settings.

252 {
253  m_settings.m_playLoop = checked;
254  applySettings();
255 }
void applySettings(bool force=false)
Definition: ssbmodgui.cpp:484
SSBModSettings m_settings
Definition: ssbmodgui.h:67
+ Here is the call graph for this function:

◆ on_showFileDialog_clicked

void SSBModGUI::on_showFileDialog_clicked ( bool  checked)
privateslot

Definition at line 327 of file ssbmodgui.cpp.

References configureFileName(), m_fileName, and ui.

328 {
329  (void) checked;
330  QString fileName = QFileDialog::getOpenFileName(this,
331  tr("Open raw audio file"), ".", tr("Raw audio Files (*.raw)"), 0, QFileDialog::DontUseNativeDialog);
332 
333  if (fileName != "")
334  {
335  m_fileName = fileName;
336  ui->recordFileText->setText(m_fileName);
337  ui->play->setEnabled(true);
339  }
340 }
QString m_fileName
Definition: ssbmodgui.h:75
Ui::SSBModGUI * ui
Definition: ssbmodgui.h:63
void configureFileName()
Definition: ssbmodgui.cpp:342
+ Here is the call graph for this function:

◆ on_spanLog2_valueChanged

void SSBModGUI::on_spanLog2_valueChanged ( int  value)
privateslot

Definition at line 210 of file ssbmodgui.cpp.

References applyBandwidths().

211 {
212  if ((value < 0) || (value > 4)) {
213  return;
214  }
215 
216  applyBandwidths(5 - value);
217 }
void applyBandwidths(int spanLog2, bool force=false)
Definition: ssbmodgui.cpp:507
+ Here is the call graph for this function:

◆ on_tone_toggled

void SSBModGUI::on_tone_toggled ( bool  checked)
privateslot

Definition at line 268 of file ssbmodgui.cpp.

References applySettings(), SSBModSettings::m_modAFInput, m_settings, SSBModSettings::SSBModInputNone, SSBModSettings::SSBModInputTone, and ui.

269 {
270  ui->play->setEnabled(!checked); // release other source inputs
271  ui->morseKeyer->setEnabled(!checked);
272  ui->mic->setEnabled(!checked);
274  applySettings();
275 }
void applySettings(bool force=false)
Definition: ssbmodgui.cpp:484
SSBModSettings m_settings
Definition: ssbmodgui.h:67
SSBModInputAF m_modAFInput
Ui::SSBModGUI * ui
Definition: ssbmodgui.h:63
+ Here is the call graph for this function:

◆ on_toneFrequency_valueChanged

void SSBModGUI::on_toneFrequency_valueChanged ( int  value)
privateslot

Definition at line 231 of file ssbmodgui.cpp.

References applySettings(), arg(), m_settings, SSBModSettings::m_toneFrequency, and ui.

232 {
233  ui->toneFrequencyText->setText(QString("%1k").arg(value / 100.0, 0, 'f', 2));
234  m_settings.m_toneFrequency = value * 10.0;
235  applySettings();
236 }
void applySettings(bool force=false)
Definition: ssbmodgui.cpp:484
SSBModSettings m_settings
Definition: ssbmodgui.h:67
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
Ui::SSBModGUI * ui
Definition: ssbmodgui.h:63
+ Here is the call graph for this function:

◆ on_volume_valueChanged

void SSBModGUI::on_volume_valueChanged ( int  value)
privateslot

Definition at line 238 of file ssbmodgui.cpp.

References applySettings(), arg(), m_settings, SSBModSettings::m_volumeFactor, and ui.

239 {
240  ui->volumeText->setText(QString("%1").arg(value / 10.0, 0, 'f', 1));
241  m_settings.m_volumeFactor = value / 10.0;
242  applySettings();
243 }
void applySettings(bool force=false)
Definition: ssbmodgui.cpp:484
SSBModSettings m_settings
Definition: ssbmodgui.h:67
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
Ui::SSBModGUI * ui
Definition: ssbmodgui.h:63
+ Here is the call graph for this function:

◆ onMenuDialogCalled

void SSBModGUI::onMenuDialogCalled ( const QPoint &  p)
privateslot

Definition at line 355 of file ssbmodgui.cpp.

References applySettings(), RollupWidget::ContextMenuChannelSettings, ChannelMarker::getCenterFrequency(), ChannelMarker::getColor(), BasicChannelSettingsDialog::getReverseAPIAddress(), BasicChannelSettingsDialog::getReverseAPIChannelIndex(), BasicChannelSettingsDialog::getReverseAPIDeviceIndex(), BasicChannelSettingsDialog::getReverseAPIPort(), ChannelMarker::getTitle(), m_channelMarker, RollupWidget::m_contextMenuType, SSBModSettings::m_inputFrequencyOffset, SSBModSettings::m_reverseAPIAddress, SSBModSettings::m_reverseAPIChannelIndex, SSBModSettings::m_reverseAPIDeviceIndex, SSBModSettings::m_reverseAPIPort, SSBModSettings::m_rgbColor, m_settings, SSBModSettings::m_title, SSBModSettings::m_useReverseAPI, RollupWidget::resetContextMenuType(), BasicChannelSettingsDialog::setReverseAPIAddress(), BasicChannelSettingsDialog::setReverseAPIChannelIndex(), BasicChannelSettingsDialog::setReverseAPIDeviceIndex(), BasicChannelSettingsDialog::setReverseAPIPort(), RollupWidget::setTitleColor(), BasicChannelSettingsDialog::setUseReverseAPI(), and BasicChannelSettingsDialog::useReverseAPI().

Referenced by SSBModGUI().

356 {
358  {
360  dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
361  dialog.setReverseAPIAddress(m_settings.m_reverseAPIAddress);
362  dialog.setReverseAPIPort(m_settings.m_reverseAPIPort);
363  dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex);
364  dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex);
365 
366  dialog.move(p);
367  dialog.exec();
368 
372  m_settings.m_useReverseAPI = dialog.useReverseAPI();
373  m_settings.m_reverseAPIAddress = dialog.getReverseAPIAddress();
374  m_settings.m_reverseAPIPort = dialog.getReverseAPIPort();
375  m_settings.m_reverseAPIDeviceIndex = dialog.getReverseAPIDeviceIndex();
376  m_settings.m_reverseAPIChannelIndex = dialog.getReverseAPIChannelIndex();
377 
378  setWindowTitle(m_settings.m_title);
380 
381  applySettings();
382  }
383 
385 }
void applySettings(bool force=false)
Definition: ssbmodgui.cpp:484
SSBModSettings m_settings
Definition: ssbmodgui.h:67
int getCenterFrequency() const
Definition: channelmarker.h:42
qint64 m_inputFrequencyOffset
uint16_t m_reverseAPIChannelIndex
void resetContextMenuType()
Definition: rollupwidget.h:50
ContextMenuType m_contextMenuType
Definition: rollupwidget.h:33
uint16_t m_reverseAPIDeviceIndex
void setTitleColor(const QColor &c)
const QString & getTitle() const
Definition: channelmarker.h:38
uint16_t m_reverseAPIPort
QString m_reverseAPIAddress
const QColor & getColor() const
Definition: channelmarker.h:64
ChannelMarker m_channelMarker
Definition: ssbmodgui.h:66
quint32 m_rgbColor
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ onWidgetRolled

void SSBModGUI::onWidgetRolled ( QWidget *  widget,
bool  rollDown 
)
privateslot

Definition at line 349 of file ssbmodgui.cpp.

Referenced by SSBModGUI().

350 {
351  (void) widget;
352  (void) rollDown;
353 }
+ Here is the caller graph for this function:

◆ resetToDefaults()

void SSBModGUI::resetToDefaults ( )
virtual

Implements PluginInstanceGUI.

Definition at line 71 of file ssbmodgui.cpp.

References m_settings, and SSBModSettings::resetToDefaults().

Referenced by SSBModGUI().

72 {
74 }
SSBModSettings m_settings
Definition: ssbmodgui.h:67
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ serialize()

QByteArray SSBModGUI::serialize ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 76 of file ssbmodgui.cpp.

References m_settings, and SSBModSettings::serialize().

77 {
78  return m_settings.serialize();
79 }
SSBModSettings m_settings
Definition: ssbmodgui.h:67
QByteArray serialize() const
+ Here is the call graph for this function:

◆ setCenterFrequency()

void SSBModGUI::setCenterFrequency ( qint64  centerFrequency)
virtual

Implements PluginInstanceGUI.

Definition at line 64 of file ssbmodgui.cpp.

References applySettings(), ChannelMarker::getCenterFrequency(), m_channelMarker, SSBModSettings::m_inputFrequencyOffset, m_settings, and ChannelMarker::setCenterFrequency().

65 {
66  m_channelMarker.setCenterFrequency(centerFrequency);
68  applySettings();
69 }
void applySettings(bool force=false)
Definition: ssbmodgui.cpp:484
SSBModSettings m_settings
Definition: ssbmodgui.h:67
int getCenterFrequency() const
Definition: channelmarker.h:42
qint64 m_inputFrequencyOffset
ChannelMarker m_channelMarker
Definition: ssbmodgui.h:66
void setCenterFrequency(int centerFrequency)
+ Here is the call graph for this function:

◆ setName()

void SSBModGUI::setName ( const QString &  name)
virtual

Implements PluginInstanceGUI.

Definition at line 50 of file ssbmodgui.cpp.

51 {
52  setObjectName(name);
53 }

◆ tick

void SSBModGUI::tick ( )
privateslot

Definition at line 741 of file ssbmodgui.cpp.

References arg(), SSBMod::MsgConfigureFileSourceStreamTiming::create(), CalcDb::dbPower(), BasebandSampleSource::getInputMessageQueue(), SSBMod::getMagSq(), m_channelPowerDbAvg, SSBModSettings::m_modAFInput, m_settings, m_ssbMod, m_tickCount, MessageQueue::push(), SSBModSettings::SSBModInputFile, and ui.

Referenced by SSBModGUI().

742 {
743  double powDb = CalcDb::dbPower(m_ssbMod->getMagSq());
744  m_channelPowerDbAvg(powDb);
745  ui->channelPower->setText(tr("%1 dB").arg(m_channelPowerDbAvg.asDouble(), 0, 'f', 1));
746 
748  {
750  m_ssbMod->getInputMessageQueue()->push(message);
751  }
752 }
SSBModSettings m_settings
Definition: ssbmodgui.h:67
MovingAverageUtil< double, double, 20 > m_channelPowerDbAvg
Definition: ssbmodgui.h:73
void push(Message *message, bool emitSignal=true)
Push message onto queue.
static double dbPower(double magsq, double floor=1e-12)
Definition: db.cpp:22
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
SSBModInputAF m_modAFInput
static MsgConfigureFileSourceStreamTiming * create()
Definition: ssbmod.h:146
double getMagSq() const
Definition: ssbmod.h:250
Ui::SSBModGUI * ui
Definition: ssbmodgui.h:63
SSBMod * m_ssbMod
Definition: ssbmodgui.h:72
std::size_t m_tickCount
Definition: ssbmodgui.h:79
double asDouble() const
Definition: movingaverage.h:57
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateWithStreamData()

void SSBModGUI::updateWithStreamData ( )
private

Definition at line 754 of file ssbmodgui.cpp.

References m_recordLength, ui, and updateWithStreamTime().

Referenced by handleMessage().

755 {
756  QTime recordLength(0, 0, 0, 0);
757  recordLength = recordLength.addSecs(m_recordLength);
758  QString s_time = recordLength.toString("HH:mm:ss");
759  ui->recordLengthText->setText(s_time);
761 }
void updateWithStreamTime()
Definition: ssbmodgui.cpp:763
quint32 m_recordLength
Definition: ssbmodgui.h:76
Ui::SSBModGUI * ui
Definition: ssbmodgui.h:63
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateWithStreamTime()

void SSBModGUI::updateWithStreamTime ( )
private

Definition at line 763 of file ssbmodgui.cpp.

References m_enableNavTime, m_recordLength, m_recordSampleRate, m_samplesCount, and ui.

Referenced by handleMessage(), and updateWithStreamData().

764 {
765  int t_sec = 0;
766  int t_msec = 0;
767 
768  if (m_recordSampleRate > 0)
769  {
770  t_msec = ((m_samplesCount * 1000) / m_recordSampleRate) % 1000;
772  }
773 
774  QTime t(0, 0, 0, 0);
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);
780 
781  if (!m_enableNavTime)
782  {
783  float posRatio = (float) t_sec / (float) m_recordLength;
784  ui->navTimeSlider->setValue((int) (posRatio * 100.0));
785  }
786 }
int m_samplesCount
Definition: ssbmodgui.h:78
int m_recordSampleRate
Definition: ssbmodgui.h:77
quint32 m_recordLength
Definition: ssbmodgui.h:76
Ui::SSBModGUI * ui
Definition: ssbmodgui.h:63
bool m_enableNavTime
Definition: ssbmodgui.h:80
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_channelMarker

ChannelMarker SSBModGUI::m_channelMarker
private

◆ m_channelPowerDbAvg

MovingAverageUtil<double, double, 20> SSBModGUI::m_channelPowerDbAvg
private

Definition at line 73 of file ssbmodgui.h.

Referenced by tick().

◆ m_deviceUISet

DeviceUISet* SSBModGUI::m_deviceUISet
private

Definition at line 65 of file ssbmodgui.h.

Referenced by SSBModGUI(), and ~SSBModGUI().

◆ m_doApplySettings

bool SSBModGUI::m_doApplySettings
private

Definition at line 68 of file ssbmodgui.h.

Referenced by applySettings(), and blockApplySettings().

◆ m_enableNavTime

bool SSBModGUI::m_enableNavTime
private

◆ m_fileName

QString SSBModGUI::m_fileName
private

Definition at line 75 of file ssbmodgui.h.

Referenced by configureFileName(), and on_showFileDialog_clicked().

◆ m_iconDSBLSB

QIcon SSBModGUI::m_iconDSBLSB
private

Definition at line 84 of file ssbmodgui.h.

Referenced by applyBandwidths(), displaySettings(), and SSBModGUI().

◆ m_iconDSBUSB

QIcon SSBModGUI::m_iconDSBUSB
private

Definition at line 83 of file ssbmodgui.h.

Referenced by applyBandwidths(), displaySettings(), and SSBModGUI().

◆ m_inputMessageQueue

MessageQueue SSBModGUI::m_inputMessageQueue
private

Definition at line 81 of file ssbmodgui.h.

◆ m_pluginAPI

PluginAPI* SSBModGUI::m_pluginAPI
private

Definition at line 64 of file ssbmodgui.h.

◆ m_recordLength

quint32 SSBModGUI::m_recordLength
private

◆ m_recordSampleRate

int SSBModGUI::m_recordSampleRate
private

Definition at line 77 of file ssbmodgui.h.

Referenced by handleMessage(), and updateWithStreamTime().

◆ m_samplesCount

int SSBModGUI::m_samplesCount
private

Definition at line 78 of file ssbmodgui.h.

Referenced by handleMessage(), and updateWithStreamTime().

◆ m_settings

SSBModSettings SSBModGUI::m_settings
private

◆ m_spectrumRate

int SSBModGUI::m_spectrumRate
private

Definition at line 69 of file ssbmodgui.h.

Referenced by applyBandwidths(), and SSBModGUI().

◆ m_spectrumVis

SpectrumVis* SSBModGUI::m_spectrumVis
private

Definition at line 71 of file ssbmodgui.h.

Referenced by SSBModGUI(), and ~SSBModGUI().

◆ m_ssbMod

SSBMod* SSBModGUI::m_ssbMod
private

◆ m_tickCount

std::size_t SSBModGUI::m_tickCount
private

Definition at line 79 of file ssbmodgui.h.

Referenced by tick().

◆ ui

Ui::SSBModGUI* SSBModGUI::ui
private

The documentation for this class was generated from the following files: