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

#include <freedvmodgui.h>

+ Inheritance diagram for FreeDVModGUI:
+ Collaboration diagram for FreeDVModGUI:

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

Private Slots

void handleSourceMessages ()
 
void on_deltaFrequency_changed (qint64 value)
 
void on_spanLog2_valueChanged (int value)
 
void on_gaugeInput_toggled (bool checked)
 
void on_volume_valueChanged (int value)
 
void on_audioMute_toggled (bool checked)
 
void on_freeDVMode_currentIndexChanged (int index)
 
void on_tone_toggled (bool checked)
 
void on_toneFrequency_valueChanged (int value)
 
void on_mic_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 onWidgetRolled (QWidget *widget, bool rollDown)
 
void onMenuDialogCalled (const QPoint &p)
 
void configureFileName ()
 
void audioSelect ()
 
void tick ()
 

Private Member Functions

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

Private Attributes

Ui::FreeDVModGUI * ui
 
PluginAPIm_pluginAPI
 
DeviceUISetm_deviceUISet
 
ChannelMarker m_channelMarker
 
FreeDVModSettings m_settings
 
bool m_doApplySettings
 
int m_spectrumRate
 
SpectrumVism_spectrumVis
 
FreeDVModm_freeDVMod
 
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
 

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 freedvmodgui.h.

Constructor & Destructor Documentation

◆ FreeDVModGUI()

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

Definition at line 337 of file freedvmodgui.cpp.

References DeviceUISet::addChannelMarker(), DeviceUISet::addRollupWidget(), applyBandwidths(), arg(), audioSelect(), channelMarkerChangedByCursor(), displaySettings(), FreeDVMod::getCWKeyer(), getInputMessageQueue(), BasebandSampleSink::getInputMessageQueue(), MainWindow::getInstance(), ColorMapper::GrayGold, handleSourceMessages(), FreeDVMod::m_channelIdURI, m_channelMarker, m_deviceUISet, m_freeDVMod, m_settings, m_spectrumRate, m_spectrumVis, onMenuDialogCalled(), onWidgetRolled(), DeviceUISet::registerTxChannelInstance(), resetToDefaults(), SDR_TX_SCALEF, FreeDVModSettings::setChannelMarker(), FreeDVModSettings::setCWKeyerGUI(), BasebandSampleSource::setMessageQueueToGUI(), ChannelMarker::setSourceOrSinkStream(), FreeDVModSettings::setSpectrumGUI(), FreeDVMod::setSpectrumSampleSink(), ChannelMarker::setVisible(), tick(), ui, and RollupWidget::widgetRolled().

Referenced by create().

337  :
338  RollupWidget(parent),
339  ui(new Ui::FreeDVModGUI),
340  m_pluginAPI(pluginAPI),
341  m_deviceUISet(deviceUISet),
342  m_channelMarker(this),
343  m_doApplySettings(true),
344  m_spectrumRate(6000),
345  m_recordLength(0),
346  m_recordSampleRate(48000),
347  m_samplesCount(0),
348  m_tickCount(0),
349  m_enableNavTime(false)
350 {
351  ui->setupUi(this);
352  setAttribute(Qt::WA_DeleteOnClose, true);
353  connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
354  connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
355 
356  m_spectrumVis = new SpectrumVis(SDR_TX_SCALEF, ui->glSpectrum);
357  m_freeDVMod = (FreeDVMod*) channelTx;
360 
361  resetToDefaults();
362 
363  ui->glSpectrum->setCenterFrequency(m_spectrumRate/2);
364  ui->glSpectrum->setSampleRate(m_spectrumRate);
365  ui->glSpectrum->setDisplayWaterfall(true);
366  ui->glSpectrum->setDisplayMaxHold(true);
367  ui->glSpectrum->setSsbSpectrum(true);
368  ui->glSpectrum->connectTimer(MainWindow::getInstance()->getMasterTimer());
369 
370  connect(&MainWindow::getInstance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick()));
371 
372  CRightClickEnabler *audioMuteRightClickEnabler = new CRightClickEnabler(ui->mic);
373  connect(audioMuteRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(audioSelect()));
374 
375  ui->deltaFrequencyLabel->setText(QString("%1f").arg(QChar(0x94, 0x03)));
376  ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
377  ui->deltaFrequency->setValueRange(false, 7, -9999999, 9999999);
378 
381 
385 
386  connect(&m_channelMarker, SIGNAL(changedByCursor()), this, SLOT(channelMarkerChangedByCursor()));
387 
388  ui->cwKeyerGUI->setCWKeyer(m_freeDVMod->getCWKeyer());
389  ui->spectrumGUI->setBuddies(m_spectrumVis->getInputMessageQueue(), m_spectrumVis, ui->glSpectrum);
390 
392  m_settings.setSpectrumGUI(ui->spectrumGUI);
393  m_settings.setCWKeyerGUI(ui->cwKeyerGUI);
394 
395  connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleSourceMessages()));
396  connect(m_freeDVMod, SIGNAL(levelChanged(qreal, qreal, int)), ui->volumeMeter, SLOT(levelChanged(qreal, qreal, int)));
397 
398  displaySettings();
399  applyBandwidths(5 - ui->spanLog2->value(), true); // does applySettings(true)
400 }
std::size_t m_tickCount
Definition: freedvmodgui.h:79
void setSpectrumGUI(Serializable *spectrumGUI)
static MainWindow * getInstance()
Definition: mainwindow.h:73
CWKeyer * getCWKeyer()
Definition: freedvmod.h:257
void registerTxChannelInstance(const QString &channelName, PluginInstanceGUI *pluginGUI)
Definition: deviceuiset.cpp:88
void applyBandwidths(int spanLog2, bool force=false)
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
int m_samplesCount
Definition: freedvmodgui.h:78
void onMenuDialogCalled(const QPoint &p)
void setSpectrumSampleSink(BasebandSampleSink *sampleSink)
Definition: freedvmod.h:212
void audioSelect()
void addChannelMarker(ChannelMarker *channelMarker)
Add channel marker to spectrum.
Definition: deviceuiset.cpp:72
void setChannelMarker(Serializable *channelMarker)
void handleSourceMessages()
int m_spectrumRate
Definition: freedvmodgui.h:69
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
void resetToDefaults()
RollupWidget(QWidget *parent=NULL)
Definition: rollupwidget.cpp:7
bool m_doApplySettings
Definition: freedvmodgui.h:68
#define SDR_TX_SCALEF
Definition: dsptypes.h:39
quint32 m_recordLength
Definition: freedvmodgui.h:76
void setSourceOrSinkStream(bool sourceOrSinkStream)
Definition: channelmarker.h:75
void onWidgetRolled(QWidget *widget, bool rollDown)
void setCWKeyerGUI(Serializable *cwKeyerGUI)
FreeDVModSettings m_settings
Definition: freedvmodgui.h:67
void addRollupWidget(QWidget *widget)
Add rollup widget to channel window.
Definition: deviceuiset.cpp:77
virtual void setMessageQueueToGUI(MessageQueue *queue)
DeviceUISet * m_deviceUISet
Definition: freedvmodgui.h:65
void displaySettings()
SpectrumVis * m_spectrumVis
Definition: freedvmodgui.h:71
int m_recordSampleRate
Definition: freedvmodgui.h:77
FreeDVMod * m_freeDVMod
Definition: freedvmodgui.h:72
Ui::FreeDVModGUI * ui
Definition: freedvmodgui.h:63
void setVisible(bool visible)
static const QString m_channelIdURI
Definition: freedvmod.h:259
bool m_enableNavTime
Definition: freedvmodgui.h:80
ChannelMarker m_channelMarker
Definition: freedvmodgui.h:66
virtual MessageQueue * getInputMessageQueue()
Definition: freedvmodgui.h:56
PluginAPI * m_pluginAPI
Definition: freedvmodgui.h:64
void widgetRolled(QWidget *widget, bool rollDown)
void channelMarkerChangedByCursor()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ~FreeDVModGUI()

FreeDVModGUI::~FreeDVModGUI ( )
privatevirtual

Definition at line 402 of file freedvmodgui.cpp.

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

403 {
405  delete m_freeDVMod; // TODO: check this: when the GUI closes it has to delete the modulator
406  delete m_spectrumVis;
407  delete ui;
408 }
void removeTxChannelInstance(PluginInstanceGUI *pluginGUI)
DeviceUISet * m_deviceUISet
Definition: freedvmodgui.h:65
SpectrumVis * m_spectrumVis
Definition: freedvmodgui.h:71
FreeDVMod * m_freeDVMod
Definition: freedvmodgui.h:72
Ui::FreeDVModGUI * ui
Definition: freedvmodgui.h:63
+ Here is the call graph for this function:

Member Function Documentation

◆ applyBandwidths()

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

Definition at line 430 of file freedvmodgui.cpp.

References applySettings(), displayBandwidths(), m_settings, and FreeDVModSettings::m_spanLog2.

Referenced by deserialize(), FreeDVModGUI(), handleMessage(), and on_spanLog2_valueChanged().

431 {
432  displayBandwidths(spanLog2);
433  m_settings.m_spanLog2 = spanLog2;
434  applySettings(force);
435 }
void displayBandwidths(int spanLog2)
FreeDVModSettings m_settings
Definition: freedvmodgui.h:67
void applySettings(bool force=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ applySettings()

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

Definition at line 417 of file freedvmodgui.cpp.

References FreeDVMod::MsgConfigureFreeDVMod::create(), FreeDVMod::MsgConfigureChannelizer::create(), BasebandSampleSource::getInputMessageQueue(), m_doApplySettings, m_freeDVMod, FreeDVModSettings::m_inputFrequencyOffset, m_settings, and MessageQueue::push().

Referenced by applyBandwidths(), audioSelect(), channelMarkerChangedByCursor(), channelMarkerUpdate(), on_audioMute_toggled(), on_deltaFrequency_changed(), on_freeDVMode_currentIndexChanged(), on_gaugeInput_toggled(), on_mic_toggled(), on_morseKeyer_toggled(), on_play_toggled(), on_playLoop_toggled(), on_tone_toggled(), on_toneFrequency_valueChanged(), on_volume_valueChanged(), onMenuDialogCalled(), and setCenterFrequency().

418 {
419  if (m_doApplySettings)
420  {
424 
427  }
428 }
static MsgConfigureFreeDVMod * create(const FreeDVModSettings &settings, bool force)
Definition: freedvmod.h:62
void push(Message *message, bool emitSignal=true)
Push message onto queue.
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
bool m_doApplySettings
Definition: freedvmodgui.h:68
FreeDVModSettings m_settings
Definition: freedvmodgui.h:67
FreeDVMod * m_freeDVMod
Definition: freedvmodgui.h:72
static MsgConfigureChannelizer * create(int sampleRate, int centerFrequency)
Definition: freedvmod.h:85
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ audioSelect

void FreeDVModGUI::audioSelect ( )
privateslot

Definition at line 522 of file freedvmodgui.cpp.

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

Referenced by FreeDVModGUI().

523 {
524  qDebug("FreeDVModGUI::audioSelect");
525  AudioSelectDialog audioSelect(DSPEngine::instance()->getAudioDeviceManager(), m_settings.m_audioDeviceName, true); // true for input
526  audioSelect.exec();
527 
528  if (audioSelect.m_selected)
529  {
530  m_settings.m_audioDeviceName = audioSelect.m_audioDeviceName;
531  applySettings();
532  }
533 }
void audioSelect()
static DSPEngine * instance()
Definition: dspengine.cpp:51
FreeDVModSettings m_settings
Definition: freedvmodgui.h:67
void applySettings(bool force=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ blockApplySettings()

bool FreeDVModGUI::blockApplySettings ( bool  block)
private

Definition at line 410 of file freedvmodgui.cpp.

References m_doApplySettings.

Referenced by displaySettings(), and handleMessage().

411 {
412  bool ret = !m_doApplySettings;
413  m_doApplySettings = !block;
414  return ret;
415 }
bool m_doApplySettings
Definition: freedvmodgui.h:68
+ Here is the caller graph for this function:

◆ channelMarkerChangedByCursor

void FreeDVModGUI::channelMarkerChangedByCursor ( )
slot

Definition at line 143 of file freedvmodgui.cpp.

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

Referenced by FreeDVModGUI().

144 {
145  ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency());
147  applySettings();
148 }
int getCenterFrequency() const
Definition: channelmarker.h:42
FreeDVModSettings m_settings
Definition: freedvmodgui.h:67
Ui::FreeDVModGUI * ui
Definition: freedvmodgui.h:63
void applySettings(bool force=false)
ChannelMarker m_channelMarker
Definition: freedvmodgui.h:66
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ channelMarkerUpdate()

void FreeDVModGUI::channelMarkerUpdate ( )
private

Definition at line 150 of file freedvmodgui.cpp.

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

151 {
153  displaySettings();
154  applySettings();
155 }
FreeDVModSettings m_settings
Definition: freedvmodgui.h:67
void displaySettings()
void applySettings(bool force=false)
const QColor & getColor() const
Definition: channelmarker.h:64
ChannelMarker m_channelMarker
Definition: freedvmodgui.h:66
+ Here is the call graph for this function:

◆ configureFileName

void FreeDVModGUI::configureFileName ( )
privateslot

Definition at line 292 of file freedvmodgui.cpp.

References FreeDVMod::MsgConfigureFileSourceName::create(), BasebandSampleSource::getInputMessageQueue(), m_fileName, m_freeDVMod, and MessageQueue::push().

Referenced by on_showFileDialog_clicked().

293 {
294  qDebug() << "FileSourceGui::configureFileName: " << m_fileName.toStdString().c_str();
297 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
QString m_fileName
Definition: freedvmodgui.h:75
FreeDVMod * m_freeDVMod
Definition: freedvmodgui.h:72
static MsgConfigureFileSourceName * create(const QString &fileName)
Definition: freedvmod.h:108
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create()

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

Definition at line 39 of file freedvmodgui.cpp.

References FreeDVModGUI().

Referenced by FreeDVModPlugin::createTxChannelGUI().

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

◆ deserialize()

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

Implements PluginInstanceGUI.

Definition at line 81 of file freedvmodgui.cpp.

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

82 {
83  if(m_settings.deserialize(data))
84  {
85  qDebug("FreeDVModGUI::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 }
void applyBandwidths(int spanLog2, bool force=false)
FreeDVModSettings m_settings
Definition: freedvmodgui.h:67
void displaySettings()
bool deserialize(const QByteArray &data)
Ui::FreeDVModGUI * ui
Definition: freedvmodgui.h:63
+ Here is the call graph for this function:

◆ destroy()

void FreeDVModGUI::destroy ( )
virtual

Implements PluginInstanceGUI.

Definition at line 45 of file freedvmodgui.cpp.

46 {
47  delete this;
48 }

◆ displayBandwidths()

void FreeDVModGUI::displayBandwidths ( int  spanLog2)
private

Definition at line 437 of file freedvmodgui.cpp.

References arg(), FreeDVMod::getModemSampleRate(), m_freeDVMod, m_spectrumRate, and ui.

Referenced by applyBandwidths(), and displaySettings().

438 {
439  m_spectrumRate = m_freeDVMod->getModemSampleRate() / (1<<spanLog2);
440  int bwMax = m_freeDVMod->getModemSampleRate() / (100*(1<<spanLog2));
441 
442  qDebug() << "FreeDVModGUI::displayBandwidths:"
443  << " spanLog2: " << spanLog2
444  << " m_spectrumRate: " << m_spectrumRate
445  << " bwMax: " << bwMax;
446 
447  QString spanStr = QString::number(bwMax/10.0, 'f', 1);
448 
449  ui->spanText->setText(tr("%1k").arg(spanStr));
450  ui->glSpectrum->setCenterFrequency(m_spectrumRate/2);
451  ui->glSpectrum->setSampleRate(m_spectrumRate);
452  ui->glSpectrum->setSsbSpectrum(true);
453  ui->glSpectrum->setLsbDisplay(false);
454 }
int m_spectrumRate
Definition: freedvmodgui.h:69
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
FreeDVMod * m_freeDVMod
Definition: freedvmodgui.h:72
Ui::FreeDVModGUI * ui
Definition: freedvmodgui.h:63
uint32_t getModemSampleRate() const
Definition: freedvmod.h:252
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ displaySettings()

void FreeDVModGUI::displaySettings ( )
private

Definition at line 456 of file freedvmodgui.cpp.

References arg(), blockApplySettings(), displayBandwidths(), FreeDVModSettings::getHiCutoff(), FreeDVModSettings::getLowCutoff(), ChannelMarker::getTitle(), FreeDVModSettings::m_audioMute, m_channelMarker, FreeDVModSettings::m_freeDVMode, FreeDVModSettings::m_gaugeInputElseModem, FreeDVModSettings::m_inputFrequencyOffset, FreeDVModSettings::m_modAFInput, FreeDVModSettings::m_playLoop, FreeDVModSettings::m_rgbColor, m_settings, FreeDVModSettings::m_spanLog2, FreeDVModSettings::m_title, FreeDVModSettings::m_toneFrequency, FreeDVModSettings::m_volumeFactor, ChannelMarker::setBandwidth(), ChannelMarker::setCenterFrequency(), ChannelMarker::setColor(), ChannelMarker::setLowCutoff(), ChannelMarker::setSidebands(), ChannelMarker::setTitle(), RollupWidget::setTitleColor(), ui, and ChannelMarker::usb.

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

457 {
458  m_channelMarker.blockSignals(true);
464  m_channelMarker.blockSignals(false);
466 
468  setWindowTitle(m_channelMarker.getTitle());
469 
470  blockApplySettings(true);
471 
472  ui->freeDVMode->setCurrentIndex((int) m_settings.m_freeDVMode);
473  ui->audioMute->setChecked(m_settings.m_audioMute);
474  ui->playLoop->setChecked(m_settings.m_playLoop);
475 
476  // Prevent uncontrolled triggering of applyBandwidths
477  ui->spanLog2->blockSignals(true);
478  ui->spanLog2->setValue(5 - m_settings.m_spanLog2);
480  ui->spanLog2->blockSignals(false);
481 
482  ui->gaugeInput->setChecked(m_settings.m_gaugeInputElseModem);
483 
484  // The only one of the four signals triggering applyBandwidths will trigger it once only with all other values
485  // set correctly and therefore validate the settings and apply them to dependent widgets
486 
487  ui->deltaFrequency->setValue(m_settings.m_inputFrequencyOffset);
488 
489  ui->toneFrequency->setValue(roundf(m_settings.m_toneFrequency / 10.0));
490  ui->toneFrequencyText->setText(QString("%1k").arg(m_settings.m_toneFrequency / 1000.0, 0, 'f', 2));
491 
492  ui->volume->setValue(m_settings.m_volumeFactor * 10.0);
493  ui->volumeText->setText(QString("%1").arg(m_settings.m_volumeFactor, 0, 'f', 1));
494 
495  ui->tone->setEnabled((m_settings.m_modAFInput == FreeDVModSettings::FreeDVModInputAF::FreeDVModInputTone)
496  || (m_settings.m_modAFInput == FreeDVModSettings::FreeDVModInputAF::FreeDVModInputNone));
497  ui->mic->setEnabled((m_settings.m_modAFInput == FreeDVModSettings::FreeDVModInputAF::FreeDVModInputAudio)
498  || (m_settings.m_modAFInput == FreeDVModSettings::FreeDVModInputAF::FreeDVModInputNone));
499  ui->play->setEnabled((m_settings.m_modAFInput == FreeDVModSettings::FreeDVModInputAF::FreeDVModInputFile)
500  || (m_settings.m_modAFInput == FreeDVModSettings::FreeDVModInputAF::FreeDVModInputNone));
501  ui->morseKeyer->setEnabled((m_settings.m_modAFInput == FreeDVModSettings::FreeDVModInputAF::FreeDVModInputCWTone)
502  || (m_settings.m_modAFInput == FreeDVModSettings::FreeDVModInputAF::FreeDVModInputNone));
503 
504  ui->tone->setChecked(m_settings.m_modAFInput == FreeDVModSettings::FreeDVModInputAF::FreeDVModInputTone);
505  ui->mic->setChecked(m_settings.m_modAFInput == FreeDVModSettings::FreeDVModInputAF::FreeDVModInputAudio);
506  ui->play->setChecked(m_settings.m_modAFInput == FreeDVModSettings::FreeDVModInputAF::FreeDVModInputFile);
507  ui->morseKeyer->setChecked(m_settings.m_modAFInput == FreeDVModSettings::FreeDVModInputAF::FreeDVModInputCWTone);
508 
509  blockApplySettings(false);
510 }
void setLowCutoff(int lowCutoff)
bool blockApplySettings(bool block)
void displayBandwidths(int spanLog2)
static int getLowCutoff(FreeDVMode freeDVMode)
bool m_gaugeInputElseModem
Volume gauge shows speech input level else modem level.
static int getHiCutoff(FreeDVMode freeDVMode)
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
void setTitleColor(const QColor &c)
FreeDVModSettings m_settings
Definition: freedvmodgui.h:67
const QString & getTitle() const
Definition: channelmarker.h:38
FreeDVModInputAF m_modAFInput
void setColor(const QColor &color)
Ui::FreeDVModGUI * ui
Definition: freedvmodgui.h:63
void setBandwidth(int bandwidth)
void setTitle(const QString &title)
ChannelMarker m_channelMarker
Definition: freedvmodgui.h:66
void setCenterFrequency(int centerFrequency)
void setSidebands(sidebands_t sidebands)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ enterEvent()

void FreeDVModGUI::enterEvent ( QEvent *  )
private

Definition at line 517 of file freedvmodgui.cpp.

References m_channelMarker, and ChannelMarker::setHighlighted().

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

◆ getCenterFrequency()

qint64 FreeDVModGUI::getCenterFrequency ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 60 of file freedvmodgui.cpp.

References ChannelMarker::getCenterFrequency(), and m_channelMarker.

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

◆ getInputMessageQueue()

virtual MessageQueue* FreeDVModGUI::getInputMessageQueue ( )
inlinevirtual

Implements PluginInstanceGUI.

Definition at line 56 of file freedvmodgui.h.

Referenced by FreeDVModGUI(), and handleSourceMessages().

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

◆ getName()

QString FreeDVModGUI::getName ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 55 of file freedvmodgui.cpp.

56 {
57  return objectName();
58 }

◆ handleMessage()

bool FreeDVModGUI::handleMessage ( const Message message)
virtual

Implements PluginInstanceGUI.

Definition at line 99 of file freedvmodgui.cpp.

References applyBandwidths(), blockApplySettings(), displaySettings(), FreeDVMod::getModemSampleRate(), FreeDVMod::MsgConfigureFreeDVMod::getSettings(), CWKeyer::MsgConfigureCWKeyer::getSettings(), m_freeDVMod, m_recordLength, m_recordSampleRate, m_samplesCount, m_settings, Message::match(), ui, updateWithStreamData(), and updateWithStreamTime().

Referenced by handleSourceMessages().

100 {
102  {
103  m_recordSampleRate = ((FreeDVMod::MsgReportFileSourceStreamData&)message).getSampleRate();
104  m_recordLength = ((FreeDVMod::MsgReportFileSourceStreamData&)message).getRecordLength();
105  m_samplesCount = 0;
107  return true;
108  }
110  {
111  m_samplesCount = ((FreeDVMod::MsgReportFileSourceStreamTiming&)message).getSamplesCount();
113  return true;
114  }
115  else if (DSPConfigureAudio::match(message))
116  {
117  qDebug("FreeDVModGUI::handleMessage: DSPConfigureAudio: %d", m_freeDVMod->getModemSampleRate());
118  applyBandwidths(5 - ui->spanLog2->value()); // will update spectrum details with new sample rate
119  return true;
120  }
121  else if (FreeDVMod::MsgConfigureFreeDVMod::match(message))
122  {
124  m_settings = cfg.getSettings();
125  blockApplySettings(true);
126  displaySettings();
127  blockApplySettings(false);
128  return true;
129  }
130  else if (CWKeyer::MsgConfigureCWKeyer::match(message))
131  {
133  ui->cwKeyerGUI->setSettings(cfg.getSettings());
134  ui->cwKeyerGUI->displaySettings();
135  return true;
136  }
137  else
138  {
139  return false;
140  }
141 }
void updateWithStreamTime()
void applyBandwidths(int spanLog2, bool force=false)
bool blockApplySettings(bool block)
int m_samplesCount
Definition: freedvmodgui.h:78
const FreeDVModSettings & getSettings() const
Definition: freedvmod.h:59
quint32 m_recordLength
Definition: freedvmodgui.h:76
void updateWithStreamData()
FreeDVModSettings m_settings
Definition: freedvmodgui.h:67
static bool match(const Message *message)
Definition: message.cpp:45
void displaySettings()
int m_recordSampleRate
Definition: freedvmodgui.h:77
FreeDVMod * m_freeDVMod
Definition: freedvmodgui.h:72
Ui::FreeDVModGUI * ui
Definition: freedvmodgui.h:63
uint32_t getModemSampleRate() const
Definition: freedvmod.h:252
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 FreeDVModGUI::handleSourceMessages ( )
privateslot

Definition at line 157 of file freedvmodgui.cpp.

References getInputMessageQueue(), and handleMessage().

Referenced by FreeDVModGUI().

158 {
159  Message* message;
160 
161  while ((message = getInputMessageQueue()->pop()) != 0)
162  {
163  if (handleMessage(*message))
164  {
165  delete message;
166  }
167  }
168 }
virtual bool handleMessage(const Message &message)
virtual MessageQueue * getInputMessageQueue()
Definition: freedvmodgui.h:56
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ leaveEvent()

void FreeDVModGUI::leaveEvent ( QEvent *  )
private

Definition at line 512 of file freedvmodgui.cpp.

References m_channelMarker, and ChannelMarker::setHighlighted().

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

◆ on_audioMute_toggled

void FreeDVModGUI::on_audioMute_toggled ( bool  checked)
privateslot

Definition at line 206 of file freedvmodgui.cpp.

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

207 {
208  m_settings.m_audioMute = checked;
209  applySettings();
210 }
FreeDVModSettings m_settings
Definition: freedvmodgui.h:67
void applySettings(bool force=false)
+ Here is the call graph for this function:

◆ on_deltaFrequency_changed

void FreeDVModGUI::on_deltaFrequency_changed ( qint64  value)
privateslot

Definition at line 170 of file freedvmodgui.cpp.

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

171 {
174  applySettings();
175 }
int getCenterFrequency() const
Definition: channelmarker.h:42
FreeDVModSettings m_settings
Definition: freedvmodgui.h:67
void applySettings(bool force=false)
ChannelMarker m_channelMarker
Definition: freedvmodgui.h:66
void setCenterFrequency(int centerFrequency)
+ Here is the call graph for this function:

◆ on_freeDVMode_currentIndexChanged

void FreeDVModGUI::on_freeDVMode_currentIndexChanged ( int  index)
privateslot

◆ on_gaugeInput_toggled

void FreeDVModGUI::on_gaugeInput_toggled ( bool  checked)
privateslot

Definition at line 186 of file freedvmodgui.cpp.

References applySettings(), FreeDVModSettings::m_gaugeInputElseModem, and m_settings.

187 {
189  applySettings();
190 }
bool m_gaugeInputElseModem
Volume gauge shows speech input level else modem level.
FreeDVModSettings m_settings
Definition: freedvmodgui.h:67
void applySettings(bool force=false)
+ Here is the call graph for this function:

◆ on_mic_toggled

void FreeDVModGUI::on_mic_toggled ( bool  checked)
privateslot

Definition at line 255 of file freedvmodgui.cpp.

References applySettings(), FreeDVModSettings::FreeDVModInputAudio, FreeDVModSettings::FreeDVModInputNone, FreeDVModSettings::m_modAFInput, m_settings, and ui.

256 {
257  ui->play->setEnabled(!checked); // release other source inputs
258  ui->morseKeyer->setEnabled(!checked);
259  ui->tone->setEnabled(!checked); // release other source inputs
261  applySettings();
262 }
FreeDVModSettings m_settings
Definition: freedvmodgui.h:67
FreeDVModInputAF m_modAFInput
Ui::FreeDVModGUI * ui
Definition: freedvmodgui.h:63
void applySettings(bool force=false)
+ Here is the call graph for this function:

◆ on_morseKeyer_toggled

void FreeDVModGUI::on_morseKeyer_toggled ( bool  checked)
privateslot

Definition at line 246 of file freedvmodgui.cpp.

References applySettings(), FreeDVModSettings::FreeDVModInputCWTone, FreeDVModSettings::FreeDVModInputNone, FreeDVModSettings::m_modAFInput, m_settings, and ui.

247 {
248  ui->play->setEnabled(!checked); // release other source inputs
249  ui->tone->setEnabled(!checked); // release other source inputs
250  ui->mic->setEnabled(!checked);
252  applySettings();
253 }
FreeDVModSettings m_settings
Definition: freedvmodgui.h:67
FreeDVModInputAF m_modAFInput
Ui::FreeDVModGUI * ui
Definition: freedvmodgui.h:63
void applySettings(bool force=false)
+ Here is the call graph for this function:

◆ on_navTimeSlider_valueChanged

void FreeDVModGUI::on_navTimeSlider_valueChanged ( int  value)
privateslot

Definition at line 264 of file freedvmodgui.cpp.

References FreeDVMod::MsgConfigureFileSourceSeek::create(), BasebandSampleSource::getInputMessageQueue(), m_enableNavTime, m_freeDVMod, m_recordLength, and MessageQueue::push().

265 {
266  if (m_enableNavTime && ((value >= 0) && (value <= 100)))
267  {
268  int t_sec = (m_recordLength * value) / 100;
269  QTime t(0, 0, 0, 0);
270  t = t.addSecs(t_sec);
271 
274  }
275 }
static MsgConfigureFileSourceSeek * create(int seekPercentage)
Definition: freedvmod.h:129
void push(Message *message, bool emitSignal=true)
Push message onto queue.
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
quint32 m_recordLength
Definition: freedvmodgui.h:76
FreeDVMod * m_freeDVMod
Definition: freedvmodgui.h:72
bool m_enableNavTime
Definition: freedvmodgui.h:80
+ Here is the call graph for this function:

◆ on_play_toggled

void FreeDVModGUI::on_play_toggled ( bool  checked)
privateslot

Definition at line 226 of file freedvmodgui.cpp.

References applySettings(), FreeDVModSettings::FreeDVModInputFile, FreeDVModSettings::FreeDVModInputNone, m_enableNavTime, FreeDVModSettings::m_modAFInput, m_settings, and ui.

227 {
228  ui->tone->setEnabled(!checked); // release other source inputs
229  ui->morseKeyer->setEnabled(!checked);
230  ui->mic->setEnabled(!checked);
232  applySettings();
233  ui->navTimeSlider->setEnabled(!checked);
234  m_enableNavTime = !checked;
235 }
FreeDVModSettings m_settings
Definition: freedvmodgui.h:67
FreeDVModInputAF m_modAFInput
Ui::FreeDVModGUI * ui
Definition: freedvmodgui.h:63
void applySettings(bool force=false)
bool m_enableNavTime
Definition: freedvmodgui.h:80
+ Here is the call graph for this function:

◆ on_playLoop_toggled

void FreeDVModGUI::on_playLoop_toggled ( bool  checked)
privateslot

Definition at line 220 of file freedvmodgui.cpp.

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

221 {
222  m_settings.m_playLoop = checked;
223  applySettings();
224 }
FreeDVModSettings m_settings
Definition: freedvmodgui.h:67
void applySettings(bool force=false)
+ Here is the call graph for this function:

◆ on_showFileDialog_clicked

void FreeDVModGUI::on_showFileDialog_clicked ( bool  checked)
privateslot

Definition at line 277 of file freedvmodgui.cpp.

References configureFileName(), m_fileName, and ui.

278 {
279  (void) checked;
280  QString fileName = QFileDialog::getOpenFileName(this,
281  tr("Open raw audio file"), ".", tr("Raw audio Files (*.raw)"), 0, QFileDialog::DontUseNativeDialog);
282 
283  if (fileName != "")
284  {
285  m_fileName = fileName;
286  ui->recordFileText->setText(m_fileName);
287  ui->play->setEnabled(true);
289  }
290 }
void configureFileName()
QString m_fileName
Definition: freedvmodgui.h:75
Ui::FreeDVModGUI * ui
Definition: freedvmodgui.h:63
+ Here is the call graph for this function:

◆ on_spanLog2_valueChanged

void FreeDVModGUI::on_spanLog2_valueChanged ( int  value)
privateslot

Definition at line 177 of file freedvmodgui.cpp.

References applyBandwidths().

178 {
179  if ((value < 0) || (value > 4)) {
180  return;
181  }
182 
183  applyBandwidths(5 - value);
184 }
void applyBandwidths(int spanLog2, bool force=false)
+ Here is the call graph for this function:

◆ on_tone_toggled

void FreeDVModGUI::on_tone_toggled ( bool  checked)
privateslot

Definition at line 237 of file freedvmodgui.cpp.

References applySettings(), FreeDVModSettings::FreeDVModInputNone, FreeDVModSettings::FreeDVModInputTone, FreeDVModSettings::m_modAFInput, m_settings, and ui.

238 {
239  ui->play->setEnabled(!checked); // release other source inputs
240  ui->morseKeyer->setEnabled(!checked);
241  ui->mic->setEnabled(!checked);
243  applySettings();
244 }
FreeDVModSettings m_settings
Definition: freedvmodgui.h:67
FreeDVModInputAF m_modAFInput
Ui::FreeDVModGUI * ui
Definition: freedvmodgui.h:63
void applySettings(bool force=false)
+ Here is the call graph for this function:

◆ on_toneFrequency_valueChanged

void FreeDVModGUI::on_toneFrequency_valueChanged ( int  value)
privateslot

Definition at line 192 of file freedvmodgui.cpp.

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

193 {
194  ui->toneFrequencyText->setText(QString("%1k").arg(value / 100.0, 0, 'f', 2));
195  m_settings.m_toneFrequency = value * 10.0;
196  applySettings();
197 }
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
FreeDVModSettings m_settings
Definition: freedvmodgui.h:67
Ui::FreeDVModGUI * ui
Definition: freedvmodgui.h:63
void applySettings(bool force=false)
+ Here is the call graph for this function:

◆ on_volume_valueChanged

void FreeDVModGUI::on_volume_valueChanged ( int  value)
privateslot

Definition at line 199 of file freedvmodgui.cpp.

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

200 {
201  ui->volumeText->setText(QString("%1").arg(value / 10.0, 0, 'f', 1));
202  m_settings.m_volumeFactor = value / 10.0;
203  applySettings();
204 }
Fixed< IntType, IntBits > arg(const std::complex< Fixed< IntType, IntBits > > &val)
Definition: fixed.h:2401
FreeDVModSettings m_settings
Definition: freedvmodgui.h:67
Ui::FreeDVModGUI * ui
Definition: freedvmodgui.h:63
void applySettings(bool force=false)
+ Here is the call graph for this function:

◆ onMenuDialogCalled

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

Definition at line 305 of file freedvmodgui.cpp.

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

Referenced by FreeDVModGUI().

306 {
308  {
310  dialog.setUseReverseAPI(m_settings.m_useReverseAPI);
311  dialog.setReverseAPIAddress(m_settings.m_reverseAPIAddress);
312  dialog.setReverseAPIPort(m_settings.m_reverseAPIPort);
313  dialog.setReverseAPIDeviceIndex(m_settings.m_reverseAPIDeviceIndex);
314  dialog.setReverseAPIChannelIndex(m_settings.m_reverseAPIChannelIndex);
315 
316  dialog.move(p);
317  dialog.exec();
318 
322  m_settings.m_useReverseAPI = dialog.useReverseAPI();
323  m_settings.m_reverseAPIAddress = dialog.getReverseAPIAddress();
324  m_settings.m_reverseAPIPort = dialog.getReverseAPIPort();
325  m_settings.m_reverseAPIDeviceIndex = dialog.getReverseAPIDeviceIndex();
326  m_settings.m_reverseAPIChannelIndex = dialog.getReverseAPIChannelIndex();
327 
328  setWindowTitle(m_settings.m_title);
330 
331  applySettings();
332  }
333 
335 }
int getCenterFrequency() const
Definition: channelmarker.h:42
uint16_t m_reverseAPIDeviceIndex
void resetContextMenuType()
Definition: rollupwidget.h:50
ContextMenuType m_contextMenuType
Definition: rollupwidget.h:33
void setTitleColor(const QColor &c)
FreeDVModSettings m_settings
Definition: freedvmodgui.h:67
const QString & getTitle() const
Definition: channelmarker.h:38
void applySettings(bool force=false)
const QColor & getColor() const
Definition: channelmarker.h:64
ChannelMarker m_channelMarker
Definition: freedvmodgui.h:66
uint16_t m_reverseAPIChannelIndex
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ onWidgetRolled

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

Definition at line 299 of file freedvmodgui.cpp.

Referenced by FreeDVModGUI().

300 {
301  (void) widget;
302  (void) rollDown;
303 }
+ Here is the caller graph for this function:

◆ resetToDefaults()

void FreeDVModGUI::resetToDefaults ( )
virtual

Implements PluginInstanceGUI.

Definition at line 71 of file freedvmodgui.cpp.

References m_settings, and FreeDVModSettings::resetToDefaults().

Referenced by FreeDVModGUI().

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

◆ serialize()

QByteArray FreeDVModGUI::serialize ( ) const
virtual

Implements PluginInstanceGUI.

Definition at line 76 of file freedvmodgui.cpp.

References m_settings, and FreeDVModSettings::serialize().

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

◆ setCenterFrequency()

void FreeDVModGUI::setCenterFrequency ( qint64  centerFrequency)
virtual

Implements PluginInstanceGUI.

Definition at line 64 of file freedvmodgui.cpp.

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

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

◆ setName()

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

Implements PluginInstanceGUI.

Definition at line 50 of file freedvmodgui.cpp.

51 {
52  setObjectName(name);
53 }

◆ tick

void FreeDVModGUI::tick ( )
privateslot

Definition at line 535 of file freedvmodgui.cpp.

References arg(), FreeDVMod::MsgConfigureFileSourceStreamTiming::create(), CalcDb::dbPower(), FreeDVModSettings::FreeDVModInputFile, BasebandSampleSource::getInputMessageQueue(), FreeDVMod::getMagSq(), m_channelPowerDbAvg, m_freeDVMod, FreeDVModSettings::m_modAFInput, m_settings, m_tickCount, MessageQueue::push(), and ui.

Referenced by FreeDVModGUI().

536 {
537  double powDb = CalcDb::dbPower(m_freeDVMod->getMagSq());
538  m_channelPowerDbAvg(powDb);
539  ui->channelPower->setText(tr("%1 dB").arg(m_channelPowerDbAvg.asDouble(), 0, 'f', 1));
540 
542  {
545  }
546 }
MovingAverageUtil< double, double, 20 > m_channelPowerDbAvg
Definition: freedvmodgui.h:73
std::size_t m_tickCount
Definition: freedvmodgui.h:79
void push(Message *message, bool emitSignal=true)
Push message onto queue.
static MsgConfigureFileSourceStreamTiming * create()
Definition: freedvmod.h:148
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
double getMagSq() const
Definition: freedvmod.h:253
FreeDVModSettings m_settings
Definition: freedvmodgui.h:67
FreeDVModInputAF m_modAFInput
FreeDVMod * m_freeDVMod
Definition: freedvmodgui.h:72
Ui::FreeDVModGUI * ui
Definition: freedvmodgui.h:63
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 FreeDVModGUI::updateWithStreamData ( )
private

Definition at line 548 of file freedvmodgui.cpp.

References m_recordLength, ui, and updateWithStreamTime().

Referenced by handleMessage().

549 {
550  QTime recordLength(0, 0, 0, 0);
551  recordLength = recordLength.addSecs(m_recordLength);
552  QString s_time = recordLength.toString("HH:mm:ss");
553  ui->recordLengthText->setText(s_time);
555 }
void updateWithStreamTime()
quint32 m_recordLength
Definition: freedvmodgui.h:76
Ui::FreeDVModGUI * ui
Definition: freedvmodgui.h:63
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateWithStreamTime()

void FreeDVModGUI::updateWithStreamTime ( )
private

Definition at line 557 of file freedvmodgui.cpp.

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

Referenced by handleMessage(), and updateWithStreamData().

558 {
559  int t_sec = 0;
560  int t_msec = 0;
561 
562  if (m_recordSampleRate > 0)
563  {
564  t_msec = ((m_samplesCount * 1000) / m_recordSampleRate) % 1000;
566  }
567 
568  QTime t(0, 0, 0, 0);
569  t = t.addSecs(t_sec);
570  t = t.addMSecs(t_msec);
571  QString s_timems = t.toString("HH:mm:ss.zzz");
572  QString s_time = t.toString("HH:mm:ss");
573  ui->relTimeText->setText(s_timems);
574 
575  if (!m_enableNavTime)
576  {
577  float posRatio = (float) t_sec / (float) m_recordLength;
578  ui->navTimeSlider->setValue((int) (posRatio * 100.0));
579  }
580 }
int m_samplesCount
Definition: freedvmodgui.h:78
quint32 m_recordLength
Definition: freedvmodgui.h:76
int m_recordSampleRate
Definition: freedvmodgui.h:77
Ui::FreeDVModGUI * ui
Definition: freedvmodgui.h:63
bool m_enableNavTime
Definition: freedvmodgui.h:80
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_channelMarker

ChannelMarker FreeDVModGUI::m_channelMarker
private

◆ m_channelPowerDbAvg

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

Definition at line 73 of file freedvmodgui.h.

Referenced by tick().

◆ m_deviceUISet

DeviceUISet* FreeDVModGUI::m_deviceUISet
private

Definition at line 65 of file freedvmodgui.h.

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

◆ m_doApplySettings

bool FreeDVModGUI::m_doApplySettings
private

Definition at line 68 of file freedvmodgui.h.

Referenced by applySettings(), and blockApplySettings().

◆ m_enableNavTime

bool FreeDVModGUI::m_enableNavTime
private

◆ m_fileName

QString FreeDVModGUI::m_fileName
private

Definition at line 75 of file freedvmodgui.h.

Referenced by configureFileName(), and on_showFileDialog_clicked().

◆ m_freeDVMod

FreeDVMod* FreeDVModGUI::m_freeDVMod
private

◆ m_inputMessageQueue

MessageQueue FreeDVModGUI::m_inputMessageQueue
private

Definition at line 81 of file freedvmodgui.h.

◆ m_pluginAPI

PluginAPI* FreeDVModGUI::m_pluginAPI
private

Definition at line 64 of file freedvmodgui.h.

◆ m_recordLength

quint32 FreeDVModGUI::m_recordLength
private

◆ m_recordSampleRate

int FreeDVModGUI::m_recordSampleRate
private

Definition at line 77 of file freedvmodgui.h.

Referenced by handleMessage(), and updateWithStreamTime().

◆ m_samplesCount

int FreeDVModGUI::m_samplesCount
private

Definition at line 78 of file freedvmodgui.h.

Referenced by handleMessage(), and updateWithStreamTime().

◆ m_settings

FreeDVModSettings FreeDVModGUI::m_settings
private

◆ m_spectrumRate

int FreeDVModGUI::m_spectrumRate
private

Definition at line 69 of file freedvmodgui.h.

Referenced by displayBandwidths(), and FreeDVModGUI().

◆ m_spectrumVis

SpectrumVis* FreeDVModGUI::m_spectrumVis
private

Definition at line 71 of file freedvmodgui.h.

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

◆ m_tickCount

std::size_t FreeDVModGUI::m_tickCount
private

Definition at line 79 of file freedvmodgui.h.

Referenced by tick().

◆ ui

Ui::FreeDVModGUI* FreeDVModGUI::ui
private

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