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
NFMModGUI Class Reference

#include <nfmmodgui.h>

+ Inheritance diagram for NFMModGUI:
+ Collaboration diagram for NFMModGUI:

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 NFMModGUIcreate (PluginAPI *pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSource *channelTx)
 

Private Slots

void handleSourceMessages ()
 
void on_deltaFrequency_changed (qint64 value)
 
void on_rfBW_currentIndexChanged (int index)
 
void on_afBW_valueChanged (int value)
 
void on_fmDev_valueChanged (int value)
 
void on_toneFrequency_valueChanged (int value)
 
void on_volume_valueChanged (int value)
 
void on_channelMute_toggled (bool checked)
 
void on_tone_toggled (bool checked)
 
void on_morseKeyer_toggled (bool checked)
 
void on_mic_toggled (bool checked)
 
void on_play_toggled (bool checked)
 
void on_playLoop_toggled (bool checked)
 
void on_navTimeSlider_valueChanged (int value)
 
void on_showFileDialog_clicked (bool checked)
 
void on_ctcss_currentIndexChanged (int index)
 
void on_ctcssOn_toggled (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

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

Private Attributes

Ui::NFMModGUI * ui
 
PluginAPIm_pluginAPI
 
DeviceUISetm_deviceUISet
 
ChannelMarker m_channelMarker
 
NFMModSettings m_settings
 
bool m_doApplySettings
 
NFMModm_nfmMod
 
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
 
NFMModSettings::NFMModInputAF m_modAFInput
 
MessageQueue m_inputMessageQueue
 

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 38 of file nfmmodgui.h.

Constructor & Destructor Documentation

◆ NFMModGUI()

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

Definition at line 341 of file nfmmodgui.cpp.

References DeviceUISet::addChannelMarker(), DeviceUISet::addRollupWidget(), applySettings(), arg(), audioFeedbackSelect(), audioSelect(), blockApplySettings(), channelMarkerChangedByCursor(), displaySettings(), NFMModSettings::getCTCSSFreq(), NFMMod::getCWKeyer(), getInputMessageQueue(), MainWindow::getInstance(), NFMModSettings::getRFBW(), ColorMapper::GrayGold, handleSourceMessages(), i, NFMMod::m_channelIdURI, m_channelMarker, m_deviceUISet, NFMModSettings::m_nbCTCSSFreqs, NFMModSettings::m_nbRfBW, m_nfmMod, m_settings, onMenuDialogCalled(), onWidgetRolled(), DeviceUISet::registerTxChannelInstance(), ChannelMarker::setBandwidth(), ChannelMarker::setCenterFrequency(), NFMModSettings::setChannelMarker(), ChannelMarker::setColor(), NFMModSettings::setCWKeyerGUI(), BasebandSampleSource::setMessageQueueToGUI(), ChannelMarker::setSourceOrSinkStream(), ChannelMarker::setTitle(), ChannelMarker::setVisible(), tick(), ui, and RollupWidget::widgetRolled().

Referenced by create().

341  :
342  RollupWidget(parent),
343  ui(new Ui::NFMModGUI),
344  m_pluginAPI(pluginAPI),
345  m_deviceUISet(deviceUISet),
346  m_channelMarker(this),
347  m_doApplySettings(true),
348  m_recordLength(0),
349  m_recordSampleRate(48000),
350  m_samplesCount(0),
351  m_tickCount(0),
352  m_enableNavTime(false)
353 {
354  ui->setupUi(this);
355  setAttribute(Qt::WA_DeleteOnClose, true);
356 
357  blockApplySettings(true);
358 
359  ui->rfBW->clear();
360  for (int i = 0; i < NFMModSettings::m_nbRfBW; i++) {
361  ui->rfBW->addItem(QString("%1").arg(NFMModSettings::getRFBW(i) / 1000.0, 0, 'f', 2));
362  }
363  ui->rfBW->setCurrentIndex(6);
364 
365  blockApplySettings(false);
366 
367  connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
368  connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
369 
370  m_nfmMod = (NFMMod*) channelTx; //new NFMMod(m_deviceUISet->m_deviceSinkAPI);
372 
373  connect(&MainWindow::getInstance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick()));
374 
375  CRightClickEnabler *audioMuteRightClickEnabler = new CRightClickEnabler(ui->mic);
376  connect(audioMuteRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(audioSelect()));
377 
378  CRightClickEnabler *feedbackRightClickEnabler = new CRightClickEnabler(ui->feedbackEnable);
379  connect(feedbackRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(audioFeedbackSelect()));
380 
381  ui->deltaFrequencyLabel->setText(QString("%1f").arg(QChar(0x94, 0x03)));
382  ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
383  ui->deltaFrequency->setValueRange(false, 7, -9999999, 9999999);
384 
385  m_channelMarker.blockSignals(true);
386  m_channelMarker.setColor(Qt::red);
389  m_channelMarker.setTitle("NFM Modulator");
391  m_channelMarker.blockSignals(false);
392  m_channelMarker.setVisible(true); // activate signal on the last setting only
393 
397 
398  connect(&m_channelMarker, SIGNAL(changedByCursor()), this, SLOT(channelMarkerChangedByCursor()));
399 
400  ui->play->setEnabled(false);
401  ui->play->setChecked(false);
402  ui->tone->setChecked(false);
403  ui->mic->setChecked(false);
404 
405  for (int i=0; i< NFMModSettings::m_nbCTCSSFreqs; i++)
406  {
407  ui->ctcss->addItem(QString("%1").arg((double) NFMModSettings::getCTCSSFreq(i), 0, 'f', 1));
408  }
409 
410  ui->cwKeyerGUI->setCWKeyer(m_nfmMod->getCWKeyer());
411 
412  connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages()));
413  connect(m_nfmMod, SIGNAL(levelChanged(qreal, qreal, int)), ui->volumeMeter, SLOT(levelChanged(qreal, qreal, int)));
414 
416  m_settings.setCWKeyerGUI(ui->cwKeyerGUI);
417 
418  displaySettings();
419  applySettings();
420 }
static MainWindow * getInstance()
Definition: mainwindow.h:73
static const QString m_channelIdURI
Definition: nfmmod.h:251
int m_recordSampleRate
Definition: nfmmodgui.h:72
void registerTxChannelInstance(const QString &channelName, PluginInstanceGUI *pluginGUI)
Definition: deviceuiset.cpp:88
static const int m_nbRfBW
void handleSourceMessages()
Definition: nfmmodgui.cpp:138
int m_samplesCount
Definition: nfmmodgui.h:73
static const int m_nbCTCSSFreqs
ChannelMarker m_channelMarker
Definition: nfmmodgui.h:63
void audioFeedbackSelect()
Definition: nfmmodgui.cpp:524
static float getCTCSSFreq(int index)
void setChannelMarker(Serializable *channelMarker)
void addChannelMarker(ChannelMarker *channelMarker)
Add channel marker to spectrum.
Definition: deviceuiset.cpp:72
NFMMod * m_nfmMod
Definition: nfmmodgui.h:67
void displaySettings()
Definition: nfmmodgui.cpp:447
void tick()
Definition: nfmmodgui.cpp:537
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
std::size_t m_tickCount
Definition: nfmmodgui.h:74
RollupWidget(QWidget *parent=NULL)
Definition: rollupwidget.cpp:7
void setSourceOrSinkStream(bool sourceOrSinkStream)
Definition: channelmarker.h:75
Definition: nfmmod.h:49
void applySettings(bool force=false)
Definition: nfmmodgui.cpp:434
void channelMarkerChangedByCursor()
Definition: nfmmodgui.cpp:131
int32_t i
Definition: decimators.h:244
void addRollupWidget(QWidget *widget)
Add rollup widget to channel window.
Definition: deviceuiset.cpp:77
virtual void setMessageQueueToGUI(MessageQueue *queue)
Ui::NFMModGUI * ui
Definition: nfmmodgui.h:60
void setCWKeyerGUI(Serializable *cwKeyerGUI)
PluginAPI * m_pluginAPI
Definition: nfmmodgui.h:61
bool m_doApplySettings
Definition: nfmmodgui.h:65
bool m_enableNavTime
Definition: nfmmodgui.h:75
void setColor(const QColor &color)
void onMenuDialogCalled(const QPoint &p)
Definition: nfmmodgui.cpp:310
NFMModSettings m_settings
Definition: nfmmodgui.h:64
virtual MessageQueue * getInputMessageQueue()
Definition: nfmmodgui.h:53
quint32 m_recordLength
Definition: nfmmodgui.h:71
void setVisible(bool visible)
void blockApplySettings(bool block)
Definition: nfmmodgui.cpp:429
void audioSelect()
Definition: nfmmodgui.cpp:511
void setBandwidth(int bandwidth)
static int getRFBW(int index)
void setTitle(const QString &title)
void setCenterFrequency(int centerFrequency)
void widgetRolled(QWidget *widget, bool rollDown)
CWKeyer * getCWKeyer()
Definition: nfmmod.h:249
DeviceUISet * m_deviceUISet
Definition: nfmmodgui.h:62
void onWidgetRolled(QWidget *widget, bool rollDown)
Definition: nfmmodgui.cpp:304
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ~NFMModGUI()

NFMModGUI::~NFMModGUI ( )
privatevirtual

Definition at line 422 of file nfmmodgui.cpp.

References m_deviceUISet, m_nfmMod, DeviceUISet::removeTxChannelInstance(), and ui.

423 {
425  delete m_nfmMod; // TODO: check this: when the GUI closes it has to delete the modulator
426  delete ui;
427 }
void removeTxChannelInstance(PluginInstanceGUI *pluginGUI)
NFMMod * m_nfmMod
Definition: nfmmodgui.h:67
Ui::NFMModGUI * ui
Definition: nfmmodgui.h:60
DeviceUISet * m_deviceUISet
Definition: nfmmodgui.h:62
+ Here is the call graph for this function:

Member Function Documentation

◆ applySettings()

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

Definition at line 434 of file nfmmodgui.cpp.

References NFMMod::MsgConfigureNFMMod::create(), NFMMod::MsgConfigureChannelizer::create(), ChannelMarker::getCenterFrequency(), BasebandSampleSource::getInputMessageQueue(), m_channelMarker, m_doApplySettings, m_nfmMod, m_settings, and MessageQueue::push().

Referenced by audioFeedbackSelect(), audioSelect(), channelMarkerChangedByCursor(), deserialize(), NFMModGUI(), on_afBW_valueChanged(), on_channelMute_toggled(), on_ctcss_currentIndexChanged(), on_ctcssOn_toggled(), on_deltaFrequency_changed(), on_feedbackEnable_toggled(), on_feedbackVolume_valueChanged(), on_fmDev_valueChanged(), on_mic_toggled(), on_morseKeyer_toggled(), on_play_toggled(), on_playLoop_toggled(), on_rfBW_currentIndexChanged(), on_tone_toggled(), on_toneFrequency_valueChanged(), on_volume_valueChanged(), onMenuDialogCalled(), resetToDefaults(), and setCenterFrequency().

435 {
436  if (m_doApplySettings)
437  {
440  m_nfmMod->getInputMessageQueue()->push(msgChan);
441 
444  }
445 }
int getCenterFrequency() const
Definition: channelmarker.h:42
void push(Message *message, bool emitSignal=true)
Push message onto queue.
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
ChannelMarker m_channelMarker
Definition: nfmmodgui.h:63
NFMMod * m_nfmMod
Definition: nfmmodgui.h:67
static MsgConfigureChannelizer * create(int sampleRate, int centerFrequency)
Definition: nfmmod.h:83
static MsgConfigureNFMMod * create(const NFMModSettings &settings, bool force)
Definition: nfmmod.h:60
bool m_doApplySettings
Definition: nfmmodgui.h:65
NFMModSettings m_settings
Definition: nfmmodgui.h:64
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ audioFeedbackSelect

void NFMModGUI::audioFeedbackSelect ( )
privateslot

Definition at line 524 of file nfmmodgui.cpp.

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

Referenced by NFMModGUI().

525 {
526  qDebug("NFMModGUI::audioFeedbackSelect");
527  AudioSelectDialog audioSelect(DSPEngine::instance()->getAudioDeviceManager(), m_settings.m_audioDeviceName, false); // false for output
528  audioSelect.exec();
529 
530  if (audioSelect.m_selected)
531  {
533  applySettings();
534  }
535 }
static DSPEngine * instance()
Definition: dspengine.cpp:51
void applySettings(bool force=false)
Definition: nfmmodgui.cpp:434
NFMModSettings m_settings
Definition: nfmmodgui.h:64
void audioSelect()
Definition: nfmmodgui.cpp:511
QString m_audioDeviceName
This is the audio device you get the audio samples from.
QString m_feedbackAudioDeviceName
This is the audio device you send the audio samples to for audio feedback.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ audioSelect

void NFMModGUI::audioSelect ( )
privateslot

Definition at line 511 of file nfmmodgui.cpp.

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

Referenced by audioFeedbackSelect(), and NFMModGUI().

512 {
513  qDebug("NFMModGUI::audioSelect");
514  AudioSelectDialog audioSelect(DSPEngine::instance()->getAudioDeviceManager(), m_settings.m_audioDeviceName, true); // true for input
515  audioSelect.exec();
516 
517  if (audioSelect.m_selected)
518  {
519  m_settings.m_audioDeviceName = audioSelect.m_audioDeviceName;
520  applySettings();
521  }
522 }
static DSPEngine * instance()
Definition: dspengine.cpp:51
void applySettings(bool force=false)
Definition: nfmmodgui.cpp:434
NFMModSettings m_settings
Definition: nfmmodgui.h:64
void audioSelect()
Definition: nfmmodgui.cpp:511
QString m_audioDeviceName
This is the audio device you get the audio samples from.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ blockApplySettings()

void NFMModGUI::blockApplySettings ( bool  block)
private

Definition at line 429 of file nfmmodgui.cpp.

References m_doApplySettings.

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

430 {
431  m_doApplySettings = !block;
432 }
bool m_doApplySettings
Definition: nfmmodgui.h:65
+ Here is the caller graph for this function:

◆ channelMarkerChangedByCursor

void NFMModGUI::channelMarkerChangedByCursor ( )
slot

Definition at line 131 of file nfmmodgui.cpp.

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

Referenced by NFMModGUI().

132 {
133  ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency());
135  applySettings();
136 }
int getCenterFrequency() const
Definition: channelmarker.h:42
ChannelMarker m_channelMarker
Definition: nfmmodgui.h:63
qint64 m_inputFrequencyOffset
void applySettings(bool force=false)
Definition: nfmmodgui.cpp:434
Ui::NFMModGUI * ui
Definition: nfmmodgui.h:60
NFMModSettings m_settings
Definition: nfmmodgui.h:64
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ configureFileName

void NFMModGUI::configureFileName ( )
privateslot

Definition at line 297 of file nfmmodgui.cpp.

References NFMMod::MsgConfigureFileSourceName::create(), BasebandSampleSource::getInputMessageQueue(), m_fileName, m_nfmMod, and MessageQueue::push().

Referenced by on_showFileDialog_clicked().

298 {
299  qDebug() << "FileSourceGui::configureFileName: " << m_fileName.toStdString().c_str();
301  m_nfmMod->getInputMessageQueue()->push(message);
302 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
NFMMod * m_nfmMod
Definition: nfmmodgui.h:67
QString m_fileName
Definition: nfmmodgui.h:70
static MsgConfigureFileSourceName * create(const QString &fileName)
Definition: nfmmod.h:106
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create()

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

Definition at line 38 of file nfmmodgui.cpp.

References NFMModGUI().

Referenced by NFMModPlugin::createTxChannelGUI().

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

◆ deserialize()

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

Implements PluginInstanceGUI.

Definition at line 81 of file nfmmodgui.cpp.

References applySettings(), NFMModSettings::deserialize(), displaySettings(), m_settings, and resetToDefaults().

82 {
83  if(m_settings.deserialize(data)) {
85  applySettings(true);
86  return true;
87  } else {
89  return false;
90  }
91 }
bool deserialize(const QByteArray &data)
void displaySettings()
Definition: nfmmodgui.cpp:447
void applySettings(bool force=false)
Definition: nfmmodgui.cpp:434
void resetToDefaults()
Definition: nfmmodgui.cpp:69
NFMModSettings m_settings
Definition: nfmmodgui.h:64
+ Here is the call graph for this function:

◆ destroy()

void NFMModGUI::destroy ( )
virtual

Implements PluginInstanceGUI.

Definition at line 44 of file nfmmodgui.cpp.

45 {
46  delete this;
47 }

◆ displaySettings()

void NFMModGUI::displaySettings ( )
private

Definition at line 447 of file nfmmodgui.cpp.

References arg(), blockApplySettings(), ChannelMarker::getCenterFrequency(), NFMModSettings::getRFBWIndex(), ChannelMarker::getTitle(), NFMModSettings::m_afBandwidth, m_channelMarker, NFMModSettings::m_channelMute, NFMModSettings::m_ctcssIndex, NFMModSettings::m_ctcssOn, NFMModSettings::m_feedbackAudioEnable, NFMModSettings::m_feedbackVolumeFactor, NFMModSettings::m_fmDeviation, NFMModSettings::m_inputFrequencyOffset, NFMModSettings::m_modAFInput, NFMModSettings::m_playLoop, NFMModSettings::m_rfBandwidth, NFMModSettings::m_rgbColor, m_settings, NFMModSettings::m_title, NFMModSettings::m_toneFrequency, NFMModSettings::m_volumeFactor, ChannelMarker::setBandwidth(), ChannelMarker::setCenterFrequency(), ChannelMarker::setColor(), ChannelMarker::setTitle(), RollupWidget::setTitleColor(), and ui.

Referenced by deserialize(), handleMessage(), NFMModGUI(), and resetToDefaults().

448 {
449  m_channelMarker.blockSignals(true);
453  m_channelMarker.blockSignals(false);
454  m_channelMarker.setColor(m_settings.m_rgbColor); // activate signal on the last setting only
455 
457  setWindowTitle(m_channelMarker.getTitle());
458 
459  blockApplySettings(true);
460 
461  ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency());
462 
463  ui->rfBW->setCurrentIndex(NFMModSettings::getRFBWIndex(m_settings.m_rfBandwidth));
464 
465  ui->afBWText->setText(QString("%1k").arg(m_settings.m_afBandwidth / 1000.0));
466  ui->afBW->setValue(m_settings.m_afBandwidth / 1000.0);
467 
468  ui->fmDevText->setText(QString("%1k").arg(m_settings.m_fmDeviation / 1000.0, 0, 'f', 1));
469  ui->fmDev->setValue(m_settings.m_fmDeviation / 100.0);
470 
471  ui->volumeText->setText(QString("%1").arg(m_settings.m_volumeFactor, 0, 'f', 1));
472  ui->volume->setValue(m_settings.m_volumeFactor * 10.0);
473 
474  ui->toneFrequencyText->setText(QString("%1k").arg(m_settings.m_toneFrequency / 1000.0, 0, 'f', 2));
475  ui->toneFrequency->setValue(m_settings.m_toneFrequency / 10.0);
476 
477  ui->ctcssOn->setChecked(m_settings.m_ctcssOn);
478  ui->ctcss->setCurrentIndex(m_settings.m_ctcssIndex);
479 
480  ui->channelMute->setChecked(m_settings.m_channelMute);
481  ui->playLoop->setChecked(m_settings.m_playLoop);
482 
483  ui->tone->setEnabled((m_settings.m_modAFInput == NFMModSettings::NFMModInputAF::NFMModInputTone) || (m_settings.m_modAFInput == NFMModSettings::NFMModInputAF::NFMModInputNone));
484  ui->mic->setEnabled((m_settings.m_modAFInput == NFMModSettings::NFMModInputAF::NFMModInputAudio) || (m_settings.m_modAFInput == NFMModSettings::NFMModInputAF::NFMModInputNone));
485  ui->play->setEnabled((m_settings.m_modAFInput == NFMModSettings::NFMModInputAF::NFMModInputFile) || (m_settings.m_modAFInput == NFMModSettings::NFMModInputAF::NFMModInputNone));
486  ui->morseKeyer->setEnabled((m_settings.m_modAFInput == NFMModSettings::NFMModInputAF::NFMModInputCWTone) || (m_settings.m_modAFInput == NFMModSettings::NFMModInputAF::NFMModInputNone));
487 
488  ui->tone->setChecked(m_settings.m_modAFInput == NFMModSettings::NFMModInputAF::NFMModInputTone);
489  ui->mic->setChecked(m_settings.m_modAFInput == NFMModSettings::NFMModInputAF::NFMModInputAudio);
490  ui->play->setChecked(m_settings.m_modAFInput == NFMModSettings::NFMModInputAF::NFMModInputFile);
491  ui->morseKeyer->setChecked(m_settings.m_modAFInput == NFMModSettings::NFMModInputAF::NFMModInputCWTone);
492 
493  ui->feedbackEnable->setChecked(m_settings.m_feedbackAudioEnable);
494  ui->feedbackVolume->setValue(roundf(m_settings.m_feedbackVolumeFactor * 100.0));
495  ui->feedbackVolumeText->setText(QString("%1").arg(m_settings.m_feedbackVolumeFactor, 0, 'f', 2));
496 
497  blockApplySettings(false);
498 }
int getCenterFrequency() const
Definition: channelmarker.h:42
bool m_feedbackAudioEnable
ChannelMarker m_channelMarker
Definition: nfmmodgui.h:63
quint32 m_rgbColor
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
qint64 m_inputFrequencyOffset
void setTitleColor(const QColor &c)
const QString & getTitle() const
Definition: channelmarker.h:38
Ui::NFMModGUI * ui
Definition: nfmmodgui.h:60
float m_feedbackVolumeFactor
void setColor(const QColor &color)
NFMModSettings m_settings
Definition: nfmmodgui.h:64
NFMModInputAF m_modAFInput
void blockApplySettings(bool block)
Definition: nfmmodgui.cpp:429
void setBandwidth(int bandwidth)
void setTitle(const QString &title)
void setCenterFrequency(int centerFrequency)
static int getRFBWIndex(int rfbw)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ enterEvent()

void NFMModGUI::enterEvent ( QEvent *  )
private

Definition at line 506 of file nfmmodgui.cpp.

References m_channelMarker, and ChannelMarker::setHighlighted().

507 {
509 }
ChannelMarker m_channelMarker
Definition: nfmmodgui.h:63
void setHighlighted(bool highlighted)
+ Here is the call graph for this function:

◆ getCenterFrequency()

qint64 NFMModGUI::getCenterFrequency ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 59 of file nfmmodgui.cpp.

References ChannelMarker::getCenterFrequency(), and m_channelMarker.

59  {
61 }
int getCenterFrequency() const
Definition: channelmarker.h:42
ChannelMarker m_channelMarker
Definition: nfmmodgui.h:63
+ Here is the call graph for this function:

◆ getInputMessageQueue()

virtual MessageQueue* NFMModGUI::getInputMessageQueue ( )
inlinevirtual

Implements PluginInstanceGUI.

Definition at line 53 of file nfmmodgui.h.

Referenced by handleSourceMessages(), and NFMModGUI().

53 { return &m_inputMessageQueue; }
MessageQueue m_inputMessageQueue
Definition: nfmmodgui.h:77
+ Here is the caller graph for this function:

◆ getName()

QString NFMModGUI::getName ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 54 of file nfmmodgui.cpp.

55 {
56  return objectName();
57 }

◆ handleMessage()

bool NFMModGUI::handleMessage ( const Message message)
virtual

Implements PluginInstanceGUI.

Definition at line 93 of file nfmmodgui.cpp.

References blockApplySettings(), displaySettings(), NFMMod::MsgConfigureNFMMod::getSettings(), CWKeyer::MsgConfigureCWKeyer::getSettings(), m_recordLength, m_recordSampleRate, m_samplesCount, m_settings, Message::match(), ui, updateWithStreamData(), and updateWithStreamTime().

Referenced by handleSourceMessages().

94 {
96  {
97  m_recordSampleRate = ((NFMMod::MsgReportFileSourceStreamData&)message).getSampleRate();
98  m_recordLength = ((NFMMod::MsgReportFileSourceStreamData&)message).getRecordLength();
99  m_samplesCount = 0;
101  return true;
102  }
104  {
105  m_samplesCount = ((NFMMod::MsgReportFileSourceStreamTiming&)message).getSamplesCount();
107  return true;
108  }
109  else if (NFMMod::MsgConfigureNFMMod::match(message))
110  {
112  m_settings = cfg.getSettings();
113  blockApplySettings(true);
114  displaySettings();
115  blockApplySettings(false);
116  return true;
117  }
118  else if (CWKeyer::MsgConfigureCWKeyer::match(message))
119  {
121  ui->cwKeyerGUI->setSettings(cfg.getSettings());
122  ui->cwKeyerGUI->displaySettings();
123  return true;
124  }
125  else
126  {
127  return false;
128  }
129 }
int m_recordSampleRate
Definition: nfmmodgui.h:72
void updateWithStreamTime()
Definition: nfmmodgui.cpp:559
int m_samplesCount
Definition: nfmmodgui.h:73
void displaySettings()
Definition: nfmmodgui.cpp:447
void updateWithStreamData()
Definition: nfmmodgui.cpp:550
Ui::NFMModGUI * ui
Definition: nfmmodgui.h:60
static bool match(const Message *message)
Definition: message.cpp:45
NFMModSettings m_settings
Definition: nfmmodgui.h:64
quint32 m_recordLength
Definition: nfmmodgui.h:71
void blockApplySettings(bool block)
Definition: nfmmodgui.cpp:429
const NFMModSettings & getSettings() const
Definition: nfmmod.h:57
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 NFMModGUI::handleSourceMessages ( )
privateslot

Definition at line 138 of file nfmmodgui.cpp.

References getInputMessageQueue(), and handleMessage().

Referenced by NFMModGUI().

139 {
140  Message* message;
141 
142  while ((message = getInputMessageQueue()->pop()) != 0)
143  {
144  if (handleMessage(*message))
145  {
146  delete message;
147  }
148  }
149 }
virtual bool handleMessage(const Message &message)
Definition: nfmmodgui.cpp:93
virtual MessageQueue * getInputMessageQueue()
Definition: nfmmodgui.h:53
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ leaveEvent()

void NFMModGUI::leaveEvent ( QEvent *  )
private

Definition at line 501 of file nfmmodgui.cpp.

References m_channelMarker, and ChannelMarker::setHighlighted().

502 {
504 }
ChannelMarker m_channelMarker
Definition: nfmmodgui.h:63
void setHighlighted(bool highlighted)
+ Here is the call graph for this function:

◆ on_afBW_valueChanged

void NFMModGUI::on_afBW_valueChanged ( int  value)
privateslot

Definition at line 165 of file nfmmodgui.cpp.

References applySettings(), arg(), NFMModSettings::m_afBandwidth, m_settings, and ui.

166 {
167  ui->afBWText->setText(QString("%1k").arg(value));
168  m_settings.m_afBandwidth = value * 1000.0;
169  applySettings();
170 }
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
void applySettings(bool force=false)
Definition: nfmmodgui.cpp:434
Ui::NFMModGUI * ui
Definition: nfmmodgui.h:60
NFMModSettings m_settings
Definition: nfmmodgui.h:64
+ Here is the call graph for this function:

◆ on_channelMute_toggled

void NFMModGUI::on_channelMute_toggled ( bool  checked)
privateslot

Definition at line 193 of file nfmmodgui.cpp.

References applySettings(), NFMModSettings::m_channelMute, and m_settings.

194 {
195  m_settings.m_channelMute = checked;
196  applySettings();
197 }
void applySettings(bool force=false)
Definition: nfmmodgui.cpp:434
NFMModSettings m_settings
Definition: nfmmodgui.h:64
+ Here is the call graph for this function:

◆ on_ctcss_currentIndexChanged

void NFMModGUI::on_ctcss_currentIndexChanged ( int  index)
privateslot

Definition at line 284 of file nfmmodgui.cpp.

References applySettings(), NFMModSettings::m_ctcssIndex, and m_settings.

285 {
286  m_settings.m_ctcssIndex = index;
287  applySettings();
288 }
void applySettings(bool force=false)
Definition: nfmmodgui.cpp:434
NFMModSettings m_settings
Definition: nfmmodgui.h:64
+ Here is the call graph for this function:

◆ on_ctcssOn_toggled

void NFMModGUI::on_ctcssOn_toggled ( bool  checked)
privateslot

Definition at line 290 of file nfmmodgui.cpp.

References applySettings(), NFMModSettings::m_ctcssOn, and m_settings.

291 {
292  m_settings.m_ctcssOn = checked;
293  applySettings();
294 }
void applySettings(bool force=false)
Definition: nfmmodgui.cpp:434
NFMModSettings m_settings
Definition: nfmmodgui.h:64
+ Here is the call graph for this function:

◆ on_deltaFrequency_changed

void NFMModGUI::on_deltaFrequency_changed ( qint64  value)
privateslot

Definition at line 151 of file nfmmodgui.cpp.

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

152 {
155  applySettings();
156 }
int getCenterFrequency() const
Definition: channelmarker.h:42
ChannelMarker m_channelMarker
Definition: nfmmodgui.h:63
qint64 m_inputFrequencyOffset
void applySettings(bool force=false)
Definition: nfmmodgui.cpp:434
NFMModSettings m_settings
Definition: nfmmodgui.h:64
void setCenterFrequency(int centerFrequency)
+ Here is the call graph for this function:

◆ on_feedbackEnable_toggled

void NFMModGUI::on_feedbackEnable_toggled ( bool  checked)
privateslot

Definition at line 243 of file nfmmodgui.cpp.

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

244 {
246  applySettings();
247 }
bool m_feedbackAudioEnable
void applySettings(bool force=false)
Definition: nfmmodgui.cpp:434
NFMModSettings m_settings
Definition: nfmmodgui.h:64
+ Here is the call graph for this function:

◆ on_feedbackVolume_valueChanged

void NFMModGUI::on_feedbackVolume_valueChanged ( int  value)
privateslot

Definition at line 249 of file nfmmodgui.cpp.

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

250 {
251  ui->feedbackVolumeText->setText(QString("%1").arg(value / 100.0, 0, 'f', 2));
252  m_settings.m_feedbackVolumeFactor = value / 100.0;
253  applySettings();
254 }
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
void applySettings(bool force=false)
Definition: nfmmodgui.cpp:434
Ui::NFMModGUI * ui
Definition: nfmmodgui.h:60
float m_feedbackVolumeFactor
NFMModSettings m_settings
Definition: nfmmodgui.h:64
+ Here is the call graph for this function:

◆ on_fmDev_valueChanged

void NFMModGUI::on_fmDev_valueChanged ( int  value)
privateslot

Definition at line 172 of file nfmmodgui.cpp.

References applySettings(), arg(), NFMModSettings::m_fmDeviation, m_settings, and ui.

173 {
174  ui->fmDevText->setText(QString("%1k").arg(value / 10.0, 0, 'f', 1));
175  m_settings.m_fmDeviation = value * 100.0;
176  applySettings();
177 }
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
void applySettings(bool force=false)
Definition: nfmmodgui.cpp:434
Ui::NFMModGUI * ui
Definition: nfmmodgui.h:60
NFMModSettings m_settings
Definition: nfmmodgui.h:64
+ Here is the call graph for this function:

◆ on_mic_toggled

void NFMModGUI::on_mic_toggled ( bool  checked)
privateslot

Definition at line 234 of file nfmmodgui.cpp.

References applySettings(), NFMModSettings::m_modAFInput, m_settings, NFMModSettings::NFMModInputAudio, NFMModSettings::NFMModInputNone, and ui.

235 {
236  ui->play->setEnabled(!checked); // release other source inputs
237  ui->tone->setEnabled(!checked); // release other source inputs
238  ui->morseKeyer->setEnabled(!checked);
240  applySettings();
241 }
void applySettings(bool force=false)
Definition: nfmmodgui.cpp:434
Ui::NFMModGUI * ui
Definition: nfmmodgui.h:60
NFMModSettings m_settings
Definition: nfmmodgui.h:64
NFMModInputAF m_modAFInput
+ Here is the call graph for this function:

◆ on_morseKeyer_toggled

void NFMModGUI::on_morseKeyer_toggled ( bool  checked)
privateslot

Definition at line 225 of file nfmmodgui.cpp.

References applySettings(), NFMModSettings::m_modAFInput, m_settings, NFMModSettings::NFMModInputCWTone, NFMModSettings::NFMModInputNone, and ui.

226 {
227  ui->tone->setEnabled(!checked); // release other source inputs
228  ui->mic->setEnabled(!checked);
229  ui->play->setEnabled(!checked);
231  applySettings();
232 }
void applySettings(bool force=false)
Definition: nfmmodgui.cpp:434
Ui::NFMModGUI * ui
Definition: nfmmodgui.h:60
NFMModSettings m_settings
Definition: nfmmodgui.h:64
NFMModInputAF m_modAFInput
+ Here is the call graph for this function:

◆ on_navTimeSlider_valueChanged

void NFMModGUI::on_navTimeSlider_valueChanged ( int  value)
privateslot

Definition at line 256 of file nfmmodgui.cpp.

References NFMMod::MsgConfigureFileSourceSeek::create(), BasebandSampleSource::getInputMessageQueue(), m_enableNavTime, m_nfmMod, m_recordLength, and MessageQueue::push().

257 {
258  if (m_enableNavTime && ((value >= 0) && (value <= 100)))
259  {
260  int t_sec = (m_recordLength * value) / 100;
261  QTime t(0, 0, 0, 0);
262  t = t.addSecs(t_sec);
263 
265  m_nfmMod->getInputMessageQueue()->push(message);
266  }
267 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
NFMMod * m_nfmMod
Definition: nfmmodgui.h:67
static MsgConfigureFileSourceSeek * create(int seekPercentage)
Definition: nfmmod.h:127
bool m_enableNavTime
Definition: nfmmodgui.h:75
quint32 m_recordLength
Definition: nfmmodgui.h:71
+ Here is the call graph for this function:

◆ on_play_toggled

void NFMModGUI::on_play_toggled ( bool  checked)
privateslot

Definition at line 205 of file nfmmodgui.cpp.

References applySettings(), m_enableNavTime, NFMModSettings::m_modAFInput, m_settings, NFMModSettings::NFMModInputFile, NFMModSettings::NFMModInputNone, and ui.

206 {
207  ui->tone->setEnabled(!checked); // release other source inputs
208  ui->mic->setEnabled(!checked);
209  ui->morseKeyer->setEnabled(!checked);
211  applySettings();
212  ui->navTimeSlider->setEnabled(!checked);
213  m_enableNavTime = !checked;
214 }
void applySettings(bool force=false)
Definition: nfmmodgui.cpp:434
Ui::NFMModGUI * ui
Definition: nfmmodgui.h:60
bool m_enableNavTime
Definition: nfmmodgui.h:75
NFMModSettings m_settings
Definition: nfmmodgui.h:64
NFMModInputAF m_modAFInput
+ Here is the call graph for this function:

◆ on_playLoop_toggled

void NFMModGUI::on_playLoop_toggled ( bool  checked)
privateslot

Definition at line 199 of file nfmmodgui.cpp.

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

200 {
201  m_settings.m_playLoop = checked;
202  applySettings();
203 }
void applySettings(bool force=false)
Definition: nfmmodgui.cpp:434
NFMModSettings m_settings
Definition: nfmmodgui.h:64
+ Here is the call graph for this function:

◆ on_rfBW_currentIndexChanged

void NFMModGUI::on_rfBW_currentIndexChanged ( int  index)
privateslot

Definition at line 158 of file nfmmodgui.cpp.

References applySettings(), NFMModSettings::getRFBW(), m_channelMarker, NFMModSettings::m_rfBandwidth, m_settings, and ChannelMarker::setBandwidth().

159 {
162  applySettings();
163 }
ChannelMarker m_channelMarker
Definition: nfmmodgui.h:63
void applySettings(bool force=false)
Definition: nfmmodgui.cpp:434
NFMModSettings m_settings
Definition: nfmmodgui.h:64
void setBandwidth(int bandwidth)
static int getRFBW(int index)
+ Here is the call graph for this function:

◆ on_showFileDialog_clicked

void NFMModGUI::on_showFileDialog_clicked ( bool  checked)
privateslot

Definition at line 269 of file nfmmodgui.cpp.

References configureFileName(), m_fileName, and ui.

270 {
271  (void) checked;
272  QString fileName = QFileDialog::getOpenFileName(this,
273  tr("Open raw audio file"), ".", tr("Raw audio Files (*.raw)"), 0, QFileDialog::DontUseNativeDialog);
274 
275  if (fileName != "")
276  {
277  m_fileName = fileName;
278  ui->recordFileText->setText(m_fileName);
279  ui->play->setEnabled(true);
281  }
282 }
void configureFileName()
Definition: nfmmodgui.cpp:297
QString m_fileName
Definition: nfmmodgui.h:70
Ui::NFMModGUI * ui
Definition: nfmmodgui.h:60
+ Here is the call graph for this function:

◆ on_tone_toggled

void NFMModGUI::on_tone_toggled ( bool  checked)
privateslot

Definition at line 216 of file nfmmodgui.cpp.

References applySettings(), NFMModSettings::m_modAFInput, m_settings, NFMModSettings::NFMModInputNone, NFMModSettings::NFMModInputTone, and ui.

217 {
218  ui->play->setEnabled(!checked); // release other source inputs
219  ui->mic->setEnabled(!checked);
220  ui->morseKeyer->setEnabled(!checked);
222  applySettings();
223 }
void applySettings(bool force=false)
Definition: nfmmodgui.cpp:434
Ui::NFMModGUI * ui
Definition: nfmmodgui.h:60
NFMModSettings m_settings
Definition: nfmmodgui.h:64
NFMModInputAF m_modAFInput
+ Here is the call graph for this function:

◆ on_toneFrequency_valueChanged

void NFMModGUI::on_toneFrequency_valueChanged ( int  value)
privateslot

Definition at line 186 of file nfmmodgui.cpp.

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

187 {
188  ui->toneFrequencyText->setText(QString("%1k").arg(value / 100.0, 0, 'f', 2));
189  m_settings.m_toneFrequency = value * 10.0;
190  applySettings();
191 }
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
void applySettings(bool force=false)
Definition: nfmmodgui.cpp:434
Ui::NFMModGUI * ui
Definition: nfmmodgui.h:60
NFMModSettings m_settings
Definition: nfmmodgui.h:64
+ Here is the call graph for this function:

◆ on_volume_valueChanged

void NFMModGUI::on_volume_valueChanged ( int  value)
privateslot

Definition at line 179 of file nfmmodgui.cpp.

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

180 {
181  ui->volumeText->setText(QString("%1").arg(value / 10.0, 0, 'f', 1));
182  m_settings.m_volumeFactor = value / 10.0;
183  applySettings();
184 }
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
void applySettings(bool force=false)
Definition: nfmmodgui.cpp:434
Ui::NFMModGUI * ui
Definition: nfmmodgui.h:60
NFMModSettings m_settings
Definition: nfmmodgui.h:64
+ Here is the call graph for this function:

◆ onMenuDialogCalled

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

Definition at line 310 of file nfmmodgui.cpp.

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

Referenced by NFMModGUI().

311 {
313  {
315  dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
316  dialog.setReverseAPIAddress(m_settings.m_reverseAPIAddress);
317  dialog.setReverseAPIPort(m_settings.m_reverseAPIPort);
318  dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex);
319  dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex);
320  dialog.move(p);
321  dialog.exec();
322 
326  m_settings.m_useReverseAPI = dialog.useReverseAPI();
327  m_settings.m_reverseAPIAddress = dialog.getReverseAPIAddress();
328  m_settings.m_reverseAPIPort = dialog.getReverseAPIPort();
329  m_settings.m_reverseAPIDeviceIndex = dialog.getReverseAPIDeviceIndex();
330  m_settings.m_reverseAPIChannelIndex = dialog.getReverseAPIChannelIndex();
331 
332  setWindowTitle(m_settings.m_title);
334 
335  applySettings();
336  }
337 
339 }
int getCenterFrequency() const
Definition: channelmarker.h:42
ChannelMarker m_channelMarker
Definition: nfmmodgui.h:63
void resetContextMenuType()
Definition: rollupwidget.h:50
quint32 m_rgbColor
ContextMenuType m_contextMenuType
Definition: rollupwidget.h:33
qint64 m_inputFrequencyOffset
void setTitleColor(const QColor &c)
void applySettings(bool force=false)
Definition: nfmmodgui.cpp:434
const QString & getTitle() const
Definition: channelmarker.h:38
uint16_t m_reverseAPIDeviceIndex
NFMModSettings m_settings
Definition: nfmmodgui.h:64
const QColor & getColor() const
Definition: channelmarker.h:64
QString m_reverseAPIAddress
uint16_t m_reverseAPIPort
uint16_t m_reverseAPIChannelIndex
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ onWidgetRolled

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

Definition at line 304 of file nfmmodgui.cpp.

Referenced by NFMModGUI().

305 {
306  (void) widget;
307  (void) rollDown;
308 }
+ Here is the caller graph for this function:

◆ resetToDefaults()

void NFMModGUI::resetToDefaults ( )
virtual

Implements PluginInstanceGUI.

Definition at line 69 of file nfmmodgui.cpp.

References applySettings(), displaySettings(), m_settings, and NFMModSettings::resetToDefaults().

Referenced by deserialize().

70 {
73  applySettings(true);
74 }
void displaySettings()
Definition: nfmmodgui.cpp:447
void applySettings(bool force=false)
Definition: nfmmodgui.cpp:434
NFMModSettings m_settings
Definition: nfmmodgui.h:64
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ serialize()

QByteArray NFMModGUI::serialize ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 76 of file nfmmodgui.cpp.

References m_settings, and NFMModSettings::serialize().

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

◆ setCenterFrequency()

void NFMModGUI::setCenterFrequency ( qint64  centerFrequency)
virtual

Implements PluginInstanceGUI.

Definition at line 63 of file nfmmodgui.cpp.

References applySettings(), m_channelMarker, and ChannelMarker::setCenterFrequency().

64 {
65  m_channelMarker.setCenterFrequency(centerFrequency);
66  applySettings();
67 }
ChannelMarker m_channelMarker
Definition: nfmmodgui.h:63
void applySettings(bool force=false)
Definition: nfmmodgui.cpp:434
void setCenterFrequency(int centerFrequency)
+ Here is the call graph for this function:

◆ setName()

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

Implements PluginInstanceGUI.

Definition at line 49 of file nfmmodgui.cpp.

50 {
51  setObjectName(name);
52 }

◆ tick

void NFMModGUI::tick ( )
privateslot

Definition at line 537 of file nfmmodgui.cpp.

References arg(), NFMMod::MsgConfigureFileSourceStreamTiming::create(), CalcDb::dbPower(), BasebandSampleSource::getInputMessageQueue(), NFMMod::getMagSq(), m_channelPowerDbAvg, NFMModSettings::m_modAFInput, m_nfmMod, m_settings, m_tickCount, NFMModSettings::NFMModInputFile, MessageQueue::push(), and ui.

Referenced by NFMModGUI().

538 {
539  double powDb = CalcDb::dbPower(m_nfmMod->getMagSq());
540  m_channelPowerDbAvg(powDb);
541  ui->channelPower->setText(tr("%1 dB").arg(m_channelPowerDbAvg.asDouble(), 0, 'f', 1));
542 
544  {
546  m_nfmMod->getInputMessageQueue()->push(message);
547  }
548 }
MovingAverageUtil< double, double, 20 > m_channelPowerDbAvg
Definition: nfmmodgui.h:68
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.
NFMMod * m_nfmMod
Definition: nfmmodgui.h:67
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
std::size_t m_tickCount
Definition: nfmmodgui.h:74
Ui::NFMModGUI * ui
Definition: nfmmodgui.h:60
static MsgConfigureFileSourceStreamTiming * create()
Definition: nfmmod.h:146
NFMModSettings m_settings
Definition: nfmmodgui.h:64
NFMModInputAF m_modAFInput
double getMagSq() const
Definition: nfmmod.h:247
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 NFMModGUI::updateWithStreamData ( )
private

Definition at line 550 of file nfmmodgui.cpp.

References m_recordLength, ui, and updateWithStreamTime().

Referenced by handleMessage().

551 {
552  QTime recordLength(0, 0, 0, 0);
553  recordLength = recordLength.addSecs(m_recordLength);
554  QString s_time = recordLength.toString("HH:mm:ss");
555  ui->recordLengthText->setText(s_time);
557 }
void updateWithStreamTime()
Definition: nfmmodgui.cpp:559
Ui::NFMModGUI * ui
Definition: nfmmodgui.h:60
quint32 m_recordLength
Definition: nfmmodgui.h:71
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateWithStreamTime()

void NFMModGUI::updateWithStreamTime ( )
private

Definition at line 559 of file nfmmodgui.cpp.

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

Referenced by handleMessage(), and updateWithStreamData().

560 {
561  int t_sec = 0;
562  int t_msec = 0;
563 
564  if (m_recordSampleRate > 0)
565  {
566  t_msec = ((m_samplesCount * 1000) / m_recordSampleRate) % 1000;
568  }
569 
570  QTime t(0, 0, 0, 0);
571  t = t.addSecs(t_sec);
572  t = t.addMSecs(t_msec);
573  QString s_timems = t.toString("HH:mm:ss.zzz");
574  QString s_time = t.toString("HH:mm:ss");
575  ui->relTimeText->setText(s_timems);
576 
577  if (!m_enableNavTime)
578  {
579  float posRatio = (float) t_sec / (float) m_recordLength;
580  ui->navTimeSlider->setValue((int) (posRatio * 100.0));
581  }
582 }
int m_recordSampleRate
Definition: nfmmodgui.h:72
int m_samplesCount
Definition: nfmmodgui.h:73
Ui::NFMModGUI * ui
Definition: nfmmodgui.h:60
bool m_enableNavTime
Definition: nfmmodgui.h:75
quint32 m_recordLength
Definition: nfmmodgui.h:71
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_channelMarker

ChannelMarker NFMModGUI::m_channelMarker
private

◆ m_channelPowerDbAvg

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

Definition at line 68 of file nfmmodgui.h.

Referenced by tick().

◆ m_deviceUISet

DeviceUISet* NFMModGUI::m_deviceUISet
private

Definition at line 62 of file nfmmodgui.h.

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

◆ m_doApplySettings

bool NFMModGUI::m_doApplySettings
private

Definition at line 65 of file nfmmodgui.h.

Referenced by applySettings(), and blockApplySettings().

◆ m_enableNavTime

bool NFMModGUI::m_enableNavTime
private

◆ m_fileName

QString NFMModGUI::m_fileName
private

Definition at line 70 of file nfmmodgui.h.

Referenced by configureFileName(), and on_showFileDialog_clicked().

◆ m_inputMessageQueue

MessageQueue NFMModGUI::m_inputMessageQueue
private

Definition at line 77 of file nfmmodgui.h.

◆ m_modAFInput

NFMModSettings::NFMModInputAF NFMModGUI::m_modAFInput
private

Definition at line 76 of file nfmmodgui.h.

◆ m_nfmMod

NFMMod* NFMModGUI::m_nfmMod
private

◆ m_pluginAPI

PluginAPI* NFMModGUI::m_pluginAPI
private

Definition at line 61 of file nfmmodgui.h.

◆ m_recordLength

quint32 NFMModGUI::m_recordLength
private

◆ m_recordSampleRate

int NFMModGUI::m_recordSampleRate
private

Definition at line 72 of file nfmmodgui.h.

Referenced by handleMessage(), and updateWithStreamTime().

◆ m_samplesCount

int NFMModGUI::m_samplesCount
private

Definition at line 73 of file nfmmodgui.h.

Referenced by handleMessage(), and updateWithStreamTime().

◆ m_settings

NFMModSettings NFMModGUI::m_settings
private

◆ m_tickCount

std::size_t NFMModGUI::m_tickCount
private

Definition at line 74 of file nfmmodgui.h.

Referenced by tick().

◆ ui

Ui::NFMModGUI* NFMModGUI::ui
private

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