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.
Classes | Signals | Public Member Functions | Static Public Attributes | Private Types | Private Slots | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
AMMod Class Reference

#include <ammod.h>

+ Inheritance diagram for AMMod:
+ Collaboration diagram for AMMod:

Classes

class  MsgConfigureAMMod
 
class  MsgConfigureChannelizer
 
class  MsgConfigureFileSourceName
 
class  MsgConfigureFileSourceSeek
 
class  MsgConfigureFileSourceStreamTiming
 
class  MsgReportFileSourceStreamData
 
class  MsgReportFileSourceStreamTiming
 

Signals

void levelChanged (qreal rmsLevel, qreal peakLevel, int numSamples)
 

Public Member Functions

 AMMod (DeviceAPI *deviceAPI)
 
 ~AMMod ()
 
virtual void destroy ()
 
virtual void pull (Sample &sample)
 
virtual void pullAudio (int nbSamples)
 
virtual void start ()
 
virtual void stop ()
 
virtual bool handleMessage (const Message &cmd)
 Processing of a message. Returns true if message has actually been processed. More...
 
virtual void getIdentifier (QString &id)
 
virtual void getTitle (QString &title)
 
virtual qint64 getCenterFrequency () const
 Applies to a default stream. More...
 
virtual QByteArray serialize () const
 
virtual bool deserialize (const QByteArray &data)
 
virtual int getNbSinkStreams () const
 
virtual int getNbSourceStreams () const
 
virtual qint64 getStreamCenterFrequency (int streamIndex, bool sinkElseSource) const
 
virtual int webapiSettingsGet (SWGSDRangel::SWGChannelSettings &response, QString &errorMessage)
 
virtual int webapiSettingsPutPatch (bool force, const QStringList &channelSettingsKeys, SWGSDRangel::SWGChannelSettings &response, QString &errorMessage)
 
virtual int webapiReportGet (SWGSDRangel::SWGChannelReport &response, QString &errorMessage)
 
double getMagSq () const
 
CWKeyergetCWKeyer ()
 
- Public Member Functions inherited from BasebandSampleSource
 BasebandSampleSource ()
 
virtual ~BasebandSampleSource ()
 
void feed (SampleSourceFifo *sampleFifo, int nbSamples)
 
SampleSourceFifogetSampleSourceFifo ()
 
MessageQueuegetInputMessageQueue ()
 Get the queue for asynchronous inbound communication. More...
 
virtual void setMessageQueueToGUI (MessageQueue *queue)
 
MessageQueuegetMessageQueueToGUI ()
 
void setDeviceSampleSourceFifo (SampleSourceFifo *deviceSampleFifo)
 
- Public Member Functions inherited from ChannelAPI
 ChannelAPI (const QString &name, StreamType streamType)
 
virtual ~ChannelAPI ()
 
virtual void setName (const QString &name)
 
virtual const QString & getName () const
 
int getIndexInDeviceSet () const
 
void setIndexInDeviceSet (int indexInDeviceSet)
 
int getDeviceSetIndex () const
 
void setDeviceSetIndex (int deviceSetIndex)
 
DeviceAPIgetDeviceAPI ()
 
void setDeviceAPI (DeviceAPI *deviceAPI)
 
uint64_t getUID () const
 
StreamType getStreamType () const
 

Static Public Attributes

static const QString m_channelIdURI = "sdrangel.channeltx.modam"
 
static const QString m_channelId ="AMMod"
 

Private Types

enum  RateState { RSInitialFill, RSRunning }
 

Private Slots

void networkManagerFinished (QNetworkReply *reply)
 

Private Member Functions

void applyAudioSampleRate (int sampleRate)
 
void applyFeedbackAudioSampleRate (unsigned int sampleRate)
 
void processOneSample (Complex &ci)
 
void applyChannelSettings (int basebandSampleRate, int outputSampleRate, int inputFrequencyOffset, bool force=false)
 
void applySettings (const AMModSettings &settings, bool force=false)
 
void pullAF (Real &sample)
 
void pushFeedback (Real sample)
 
void calculateLevel (Real &sample)
 
void modulateSample ()
 
void openFileStream ()
 
void seekFileStream (int seekPercentage)
 
void webapiFormatChannelSettings (SWGSDRangel::SWGChannelSettings &response, const AMModSettings &settings)
 
void webapiFormatChannelReport (SWGSDRangel::SWGChannelReport &response)
 
void webapiReverseSendSettings (QList< QString > &channelSettingsKeys, const AMModSettings &settings, bool force)
 
void webapiReverseSendCWSettings (const CWKeyerSettings &settings)
 

Private Attributes

DeviceAPIm_deviceAPI
 
ThreadedBasebandSampleSourcem_threadedChannelizer
 
UpChannelizerm_channelizer
 
int m_basebandSampleRate
 
int m_outputSampleRate
 
int m_inputFrequencyOffset
 
AMModSettings m_settings
 
NCO m_carrierNco
 
NCOF m_toneNco
 
Complex m_modSample
 
Interpolator m_interpolator
 
Real m_interpolatorDistance
 
Real m_interpolatorDistanceRemain
 
bool m_interpolatorConsumed
 
Interpolator m_feedbackInterpolator
 
Real m_feedbackInterpolatorDistance
 
Real m_feedbackInterpolatorDistanceRemain
 
bool m_feedbackInterpolatorConsumed
 
double m_magsq
 
MovingAverageUtil< double, double, 16 > m_movingAverage
 
quint32 m_audioSampleRate
 
AudioVector m_audioBuffer
 
uint m_audioBufferFill
 
AudioFifo m_audioFifo
 
quint32 m_feedbackAudioSampleRate
 
AudioVector m_feedbackAudioBuffer
 
uint m_feedbackAudioBufferFill
 
AudioFifo m_feedbackAudioFifo
 
SampleVector m_sampleBuffer
 
QMutex m_settingsMutex
 
std::ifstream m_ifstream
 
QString m_fileName
 
quint64 m_fileSize
 raw file size (bytes) More...
 
quint32 m_recordLength
 record length in seconds computed from file size More...
 
int m_sampleRate
 
quint32 m_levelCalcCount
 
Real m_peakLevel
 
Real m_levelSum
 
CWKeyer m_cwKeyer
 
QNetworkAccessManager * m_networkManager
 
QNetworkRequest m_networkRequest
 

Static Private Attributes

static const int m_levelNbSamples = 480
 

Additional Inherited Members

- Public Types inherited from ChannelAPI
enum  StreamType { StreamSingleSink, StreamSingleSource, StreamMIMO }
 < This is the same enum as in PluginInterface More...
 
- Protected Slots inherited from BasebandSampleSource
void handleInputMessages ()
 
void handleWriteToFifo (int nbSamples)
 
void handleWriteToDeviceFifo (int nbSamples)
 
- Protected Member Functions inherited from BasebandSampleSource
void handleWriteToFifo (SampleSourceFifo *sampleFifo, int nbSamples)
 
- Protected Attributes inherited from BasebandSampleSource
MessageQueue m_inputMessageQueue
 Queue for asynchronous inbound communication. More...
 
MessageQueuem_guiMessageQueue
 Input message queue to the GUI. More...
 
SampleSourceFifo m_sampleFifo
 Internal FIFO for multi-channel processing. More...
 
SampleSourceFifom_deviceSampleFifo
 Reference to the device FIFO for single channel processing. More...
 

Detailed Description

Definition at line 47 of file ammod.h.

Member Enumeration Documentation

◆ RateState

enum AMMod::RateState
private
Enumerator
RSInitialFill 
RSRunning 

Definition at line 263 of file ammod.h.

263  {
265  RSRunning
266  };

Constructor & Destructor Documentation

◆ AMMod()

AMMod::AMMod ( DeviceAPI deviceAPI)

Definition at line 53 of file ammod.cpp.

References AudioDeviceManager::addAudioSink(), AudioDeviceManager::addAudioSource(), DeviceAPI::addChannelSource(), DeviceAPI::addChannelSourceAPI(), applyChannelSettings(), applyFeedbackAudioSampleRate(), applySettings(), DSPEngine::getAudioDeviceManager(), BasebandSampleSource::getInputMessageQueue(), AudioDeviceManager::getInputSampleRate(), AudioDeviceManager::getOutputSampleRate(), DSPEngine::instance(), m_audioBuffer, m_audioBufferFill, m_audioFifo, m_audioSampleRate, m_basebandSampleRate, m_channelId, m_channelizer, m_cwKeyer, m_deviceAPI, m_feedbackAudioBuffer, m_feedbackAudioBufferFill, m_feedbackAudioFifo, m_feedbackAudioSampleRate, m_inputFrequencyOffset, m_magsq, m_networkManager, m_outputSampleRate, m_settings, m_threadedChannelizer, m_toneNco, networkManagerFinished(), CWKeyer::reset(), NCOF::setFreq(), and CWKeyer::setSampleRate().

Referenced by AMMod::MsgReportFileSourceStreamData::MsgReportFileSourceStreamData().

53  :
55  m_deviceAPI(deviceAPI),
56  m_basebandSampleRate(48000),
57  m_outputSampleRate(48000),
59  m_audioFifo(4800),
60  m_feedbackAudioFifo(48000),
61  m_settingsMutex(QMutex::Recursive),
62  m_fileSize(0),
63  m_recordLength(0),
64  m_sampleRate(48000),
66  m_peakLevel(0.0f),
67  m_levelSum(0.0f)
68 {
69  setObjectName(m_channelId);
70 
71  m_audioBuffer.resize(1<<14);
73 
74  m_feedbackAudioBuffer.resize(1<<14);
76 
77  m_magsq = 0.0;
78 
81 
85 
88  m_cwKeyer.reset();
89 
92 
93  m_channelizer = new UpChannelizer(this);
97 
98  m_networkManager = new QNetworkAccessManager();
99  connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
100 }
void applySettings(const AMModSettings &settings, bool force=false)
Definition: ammod.cpp:550
void addAudioSink(AudioFifo *audioFifo, MessageQueue *sampleSinkMessageQueue, int outputDeviceIndex=-1)
Add the audio sink.
int getOutputSampleRate(int outputDeviceIndex=-1)
static const QString m_channelIdURI
Definition: ammod.h:249
void applyChannelSettings(int basebandSampleRate, int outputSampleRate, int inputFrequencyOffset, bool force=false)
Definition: ammod.cpp:520
int m_sampleRate
Definition: ammod.h:311
AudioVector m_feedbackAudioBuffer
Definition: ammod.h:300
int getInputSampleRate(int inputDeviceIndex=-1)
int m_outputSampleRate
Definition: ammod.h:273
double m_magsq
Definition: ammod.h:291
quint32 m_audioSampleRate
Definition: ammod.h:294
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
Exposes a single source stream (output, Tx)
Definition: channelapi.h:42
AudioFifo m_audioFifo
Definition: ammod.h:297
Real m_levelSum
Definition: ammod.h:315
void addChannelSource(ThreadedBasebandSampleSource *sink, int streamIndex=0)
Add a channel source (Tx)
Definition: deviceapi.cpp:138
uint m_feedbackAudioBufferFill
Definition: ammod.h:301
void addAudioSource(AudioFifo *audioFifo, MessageQueue *sampleSourceMessageQueue, int inputDeviceIndex=-1)
Add an audio source.
uint m_audioBufferFill
Definition: ammod.h:296
Real m_peakLevel
Definition: ammod.h:314
static DSPEngine * instance()
Definition: dspengine.cpp:51
int m_inputFrequencyOffset
Definition: ammod.h:274
quint64 m_fileSize
raw file size (bytes)
Definition: ammod.h:309
QMutex m_settingsMutex
Definition: ammod.h:305
AudioVector m_audioBuffer
Definition: ammod.h:295
ChannelAPI(const QString &name, StreamType streamType)
Definition: channelapi.cpp:23
CWKeyer m_cwKeyer
Definition: ammod.h:316
QNetworkAccessManager * m_networkManager
Definition: ammod.h:320
void applyFeedbackAudioSampleRate(unsigned int sampleRate)
Definition: ammod.cpp:503
quint32 m_levelCalcCount
Definition: ammod.h:313
static const QString m_channelId
Definition: ammod.h:250
ThreadedBasebandSampleSource * m_threadedChannelizer
Definition: ammod.h:269
AudioDeviceManager * getAudioDeviceManager()
Definition: dspengine.h:55
void networkManagerFinished(QNetworkReply *reply)
Definition: ammod.cpp:954
DeviceAPI * m_deviceAPI
Definition: ammod.h:268
quint32 m_recordLength
record length in seconds computed from file size
Definition: ammod.h:310
NCOF m_toneNco
Definition: ammod.h:278
AMModSettings m_settings
Definition: ammod.h:275
void setFreq(Real freq, Real sampleRate)
Definition: ncof.cpp:51
UpChannelizer * m_channelizer
Definition: ammod.h:270
void addChannelSourceAPI(ChannelAPI *channelAPI, int streamIndex=0)
Definition: deviceapi.cpp:174
quint32 m_feedbackAudioSampleRate
Definition: ammod.h:299
int m_basebandSampleRate
Definition: ammod.h:272
void reset()
Definition: cwkeyer.h:109
AudioFifo m_feedbackAudioFifo
Definition: ammod.h:302
void setSampleRate(int sampleRate)
Definition: cwkeyer.cpp:186
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ~AMMod()

AMMod::~AMMod ( )

Definition at line 102 of file ammod.cpp.

References DSPEngine::getAudioDeviceManager(), DSPEngine::instance(), m_audioFifo, m_channelizer, m_deviceAPI, m_feedbackAudioFifo, m_networkManager, m_threadedChannelizer, networkManagerFinished(), AudioDeviceManager::removeAudioSink(), AudioDeviceManager::removeAudioSource(), DeviceAPI::removeChannelSource(), and DeviceAPI::removeChannelSourceAPI().

Referenced by AMMod::MsgReportFileSourceStreamData::MsgReportFileSourceStreamData().

103 {
104  disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
105  delete m_networkManager;
108  delete m_threadedChannelizer;
109  delete m_channelizer;
112 }
void removeChannelSourceAPI(ChannelAPI *channelAPI, int streamIndex=0)
Definition: deviceapi.cpp:181
void removeChannelSource(ThreadedBasebandSampleSource *sink, int streamIndex=0)
Remove a channel source (Tx)
Definition: deviceapi.cpp:147
void removeAudioSink(AudioFifo *audioFifo)
Remove the audio sink.
AudioFifo m_audioFifo
Definition: ammod.h:297
static DSPEngine * instance()
Definition: dspengine.cpp:51
QNetworkAccessManager * m_networkManager
Definition: ammod.h:320
ThreadedBasebandSampleSource * m_threadedChannelizer
Definition: ammod.h:269
AudioDeviceManager * getAudioDeviceManager()
Definition: dspengine.h:55
void networkManagerFinished(QNetworkReply *reply)
Definition: ammod.cpp:954
DeviceAPI * m_deviceAPI
Definition: ammod.h:268
UpChannelizer * m_channelizer
Definition: ammod.h:270
AudioFifo m_feedbackAudioFifo
Definition: ammod.h:302
void removeAudioSource(AudioFifo *audioFifo)
Remove an audio source.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Function Documentation

◆ applyAudioSampleRate()

void AMMod::applyAudioSampleRate ( int  sampleRate)
private

Definition at line 480 of file ammod.cpp.

References applyFeedbackAudioSampleRate(), Interpolator::create(), AMMod::MsgConfigureChannelizer::create(), m_audioSampleRate, m_cwKeyer, m_feedbackAudioSampleRate, AMModSettings::m_inputFrequencyOffset, BasebandSampleSource::m_inputMessageQueue, m_interpolator, m_interpolatorConsumed, m_interpolatorDistance, m_interpolatorDistanceRemain, m_outputSampleRate, AMModSettings::m_rfBandwidth, m_settings, m_settingsMutex, AMModSettings::m_toneFrequency, m_toneNco, MessageQueue::push(), NCOF::setFreq(), and CWKeyer::setSampleRate().

Referenced by applySettings(), and handleMessage().

481 {
482  qDebug("AMMod::applyAudioSampleRate: %d", sampleRate);
483 
484  MsgConfigureChannelizer* channelConfigMsg = MsgConfigureChannelizer::create(
485  sampleRate, m_settings.m_inputFrequencyOffset);
486  m_inputMessageQueue.push(channelConfigMsg);
487 
488  m_settingsMutex.lock();
489 
491  m_interpolatorConsumed = false;
493  m_interpolator.create(48, sampleRate, m_settings.m_rfBandwidth / 2.2, 3.0);
495  m_cwKeyer.setSampleRate(sampleRate);
496 
497  m_settingsMutex.unlock();
498 
499  m_audioSampleRate = sampleRate;
501 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
Real m_interpolatorDistanceRemain
Definition: ammod.h:283
int m_outputSampleRate
Definition: ammod.h:273
void create(int phaseSteps, double sampleRate, double cutoff, double nbTapsPerPhase=4.5)
Interpolator m_interpolator
Definition: ammod.h:281
quint32 m_audioSampleRate
Definition: ammod.h:294
QMutex m_settingsMutex
Definition: ammod.h:305
CWKeyer m_cwKeyer
Definition: ammod.h:316
Real m_interpolatorDistance
Definition: ammod.h:282
void applyFeedbackAudioSampleRate(unsigned int sampleRate)
Definition: ammod.cpp:503
qint64 m_inputFrequencyOffset
Definition: ammodsettings.h:36
static MsgConfigureChannelizer * create(int sampleRate, int centerFrequency)
Definition: ammod.h:81
NCOF m_toneNco
Definition: ammod.h:278
MessageQueue m_inputMessageQueue
Queue for asynchronous inbound communication.
AMModSettings m_settings
Definition: ammod.h:275
void setFreq(Real freq, Real sampleRate)
Definition: ncof.cpp:51
float m_toneFrequency
Definition: ammodsettings.h:39
quint32 m_feedbackAudioSampleRate
Definition: ammod.h:299
bool m_interpolatorConsumed
Definition: ammod.h:284
float Real
Definition: dsptypes.h:42
void setSampleRate(int sampleRate)
Definition: cwkeyer.cpp:186
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ applyChannelSettings()

void AMMod::applyChannelSettings ( int  basebandSampleRate,
int  outputSampleRate,
int  inputFrequencyOffset,
bool  force = false 
)
private

Definition at line 520 of file ammod.cpp.

References Interpolator::create(), m_audioSampleRate, m_basebandSampleRate, m_carrierNco, m_inputFrequencyOffset, m_interpolator, m_interpolatorConsumed, m_interpolatorDistance, m_interpolatorDistanceRemain, m_outputSampleRate, AMModSettings::m_rfBandwidth, m_settings, m_settingsMutex, and NCO::setFreq().

Referenced by AMMod(), handleMessage(), and start().

521 {
522  qDebug() << "AMMod::applyChannelSettings:"
523  << " basebandSampleRate: " << basebandSampleRate
524  << " outputSampleRate: " << outputSampleRate
525  << " inputFrequencyOffset: " << inputFrequencyOffset;
526 
527  if ((inputFrequencyOffset != m_inputFrequencyOffset) ||
528  (outputSampleRate != m_outputSampleRate) || force)
529  {
530  m_settingsMutex.lock();
531  m_carrierNco.setFreq(inputFrequencyOffset, outputSampleRate);
532  m_settingsMutex.unlock();
533  }
534 
535  if ((outputSampleRate != m_outputSampleRate) || force)
536  {
537  m_settingsMutex.lock();
539  m_interpolatorConsumed = false;
540  m_interpolatorDistance = (Real) m_audioSampleRate / (Real) outputSampleRate;
542  m_settingsMutex.unlock();
543  }
544 
545  m_basebandSampleRate = basebandSampleRate;
546  m_outputSampleRate = outputSampleRate;
547  m_inputFrequencyOffset = inputFrequencyOffset;
548 }
Real m_interpolatorDistanceRemain
Definition: ammod.h:283
int m_outputSampleRate
Definition: ammod.h:273
void create(int phaseSteps, double sampleRate, double cutoff, double nbTapsPerPhase=4.5)
Interpolator m_interpolator
Definition: ammod.h:281
quint32 m_audioSampleRate
Definition: ammod.h:294
int m_inputFrequencyOffset
Definition: ammod.h:274
QMutex m_settingsMutex
Definition: ammod.h:305
Real m_interpolatorDistance
Definition: ammod.h:282
NCO m_carrierNco
Definition: ammod.h:277
void setFreq(Real freq, Real sampleRate)
Definition: nco.cpp:49
AMModSettings m_settings
Definition: ammod.h:275
int m_basebandSampleRate
Definition: ammod.h:272
bool m_interpolatorConsumed
Definition: ammod.h:284
float Real
Definition: dsptypes.h:42
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ applyFeedbackAudioSampleRate()

void AMMod::applyFeedbackAudioSampleRate ( unsigned int  sampleRate)
private

Definition at line 503 of file ammod.cpp.

References Interpolator::create(), m_audioSampleRate, m_feedbackAudioSampleRate, m_feedbackInterpolator, m_feedbackInterpolatorConsumed, m_feedbackInterpolatorDistance, m_feedbackInterpolatorDistanceRemain, m_settingsMutex, and leansdr::min().

Referenced by AMMod(), applyAudioSampleRate(), applySettings(), and handleMessage().

504 {
505  qDebug("AMMod::applyFeedbackAudioSampleRate: %u", sampleRate);
506 
507  m_settingsMutex.lock();
508 
512  Real cutoff = std::min(sampleRate, m_audioSampleRate) / 2.2f;
513  m_feedbackInterpolator.create(48, sampleRate, cutoff, 3.0);
514 
515  m_settingsMutex.unlock();
516 
517  m_feedbackAudioSampleRate = sampleRate;
518 }
Real m_feedbackInterpolatorDistanceRemain
Definition: ammod.h:288
void create(int phaseSteps, double sampleRate, double cutoff, double nbTapsPerPhase=4.5)
quint32 m_audioSampleRate
Definition: ammod.h:294
bool m_feedbackInterpolatorConsumed
Definition: ammod.h:289
QMutex m_settingsMutex
Definition: ammod.h:305
Interpolator m_feedbackInterpolator
Definition: ammod.h:286
quint32 m_feedbackAudioSampleRate
Definition: ammod.h:299
float Real
Definition: dsptypes.h:42
Real m_feedbackInterpolatorDistance
Definition: ammod.h:287
T min(const T &x, const T &y)
Definition: framework.h:440
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ applySettings()

void AMMod::applySettings ( const AMModSettings settings,
bool  force = false 
)
private

Definition at line 550 of file ammod.cpp.

References AudioDeviceManager::addAudioSink(), AudioDeviceManager::addAudioSource(), applyAudioSampleRate(), applyFeedbackAudioSampleRate(), Interpolator::create(), DSPEngine::getAudioDeviceManager(), AudioDeviceManager::getInputDeviceIndex(), BasebandSampleSource::getInputMessageQueue(), AudioDeviceManager::getInputSampleRate(), AudioDeviceManager::getOutputDeviceIndex(), AudioDeviceManager::getOutputSampleRate(), DSPEngine::instance(), AMModSettings::m_audioDeviceName, m_audioFifo, m_audioSampleRate, AMModSettings::m_channelMute, AMModSettings::m_feedbackAudioDeviceName, m_feedbackAudioFifo, m_feedbackAudioSampleRate, AMModSettings::m_inputFrequencyOffset, m_interpolator, m_interpolatorConsumed, m_interpolatorDistance, m_interpolatorDistanceRemain, AMModSettings::m_modAFInput, AMModSettings::m_modFactor, m_outputSampleRate, AMModSettings::m_playLoop, AMModSettings::m_reverseAPIAddress, AMModSettings::m_reverseAPIChannelIndex, AMModSettings::m_reverseAPIDeviceIndex, AMModSettings::m_reverseAPIPort, AMModSettings::m_rfBandwidth, m_settings, m_settingsMutex, AMModSettings::m_toneFrequency, m_toneNco, AMModSettings::m_useReverseAPI, AMModSettings::m_volumeFactor, NCOF::setFreq(), and webapiReverseSendSettings().

Referenced by AMMod(), and handleMessage().

551 {
552  qDebug() << "AMMod::applySettings:"
553  << " m_inputFrequencyOffset: " << settings.m_inputFrequencyOffset
554  << " m_rfBandwidth: " << settings.m_rfBandwidth
555  << " m_modFactor: " << settings.m_modFactor
556  << " m_toneFrequency: " << settings.m_toneFrequency
557  << " m_volumeFactor: " << settings.m_volumeFactor
558  << " m_channelMute: " << settings.m_channelMute
559  << " m_playLoop: " << settings.m_playLoop
560  << " m_modAFInput " << settings.m_modAFInput
561  << " m_audioDeviceName: " << settings.m_audioDeviceName
562  << " m_useReverseAPI: " << settings.m_useReverseAPI
563  << " m_reverseAPIAddress: " << settings.m_reverseAPIAddress
564  << " m_reverseAPIAddress: " << settings.m_reverseAPIPort
565  << " m_reverseAPIDeviceIndex: " << settings.m_reverseAPIDeviceIndex
566  << " m_reverseAPIChannelIndex: " << settings.m_reverseAPIChannelIndex
567  << " force: " << force;
568 
569  QList<QString> reverseAPIKeys;
570 
571  if ((settings.m_inputFrequencyOffset != m_settings.m_inputFrequencyOffset) || force) {
572  reverseAPIKeys.append("inputFrequencyOffset");
573  }
574 
575  if ((settings.m_modFactor != m_settings.m_modFactor) || force) {
576  reverseAPIKeys.append("modFactor");
577  }
578 
579  if ((settings.m_volumeFactor != m_settings.m_volumeFactor) || force) {
580  reverseAPIKeys.append("volumeFactor");
581  }
582 
583  if ((settings.m_channelMute != m_settings.m_channelMute) || force) {
584  reverseAPIKeys.append("channelMute");
585  }
586 
587  if ((settings.m_playLoop != m_settings.m_playLoop) || force) {
588  reverseAPIKeys.append("playLoop");
589  }
590 
591  if ((settings.m_modAFInput != m_settings.m_modAFInput) || force) {
592  reverseAPIKeys.append("modAFInput");
593  }
594 
595  if ((settings.m_rfBandwidth != m_settings.m_rfBandwidth) || force)
596  {
597  reverseAPIKeys.append("rfBandwidth");
598  m_settingsMutex.lock();
600  m_interpolatorConsumed = false;
602  m_interpolator.create(48, m_audioSampleRate, settings.m_rfBandwidth / 2.2, 3.0);
603  m_settingsMutex.unlock();
604  }
605 
606  if ((settings.m_toneFrequency != m_settings.m_toneFrequency) || force)
607  {
608  reverseAPIKeys.append("toneFrequency");
609  m_settingsMutex.lock();
611  m_settingsMutex.unlock();
612  }
613 
614  if ((settings.m_audioDeviceName != m_settings.m_audioDeviceName) || force)
615  {
616  reverseAPIKeys.append("audioDeviceName");
618  int audioDeviceIndex = audioDeviceManager->getInputDeviceIndex(settings.m_audioDeviceName);
619  audioDeviceManager->addAudioSource(&m_audioFifo, getInputMessageQueue(), audioDeviceIndex);
620  uint32_t audioSampleRate = audioDeviceManager->getInputSampleRate(audioDeviceIndex);
621 
622  if (m_audioSampleRate != audioSampleRate) {
623  reverseAPIKeys.append("audioSampleRate");
624  applyAudioSampleRate(audioSampleRate);
625  }
626  }
627 
629  {
630  reverseAPIKeys.append("feedbackAudioDeviceName");
632  int audioDeviceIndex = audioDeviceManager->getOutputDeviceIndex(settings.m_feedbackAudioDeviceName);
633  audioDeviceManager->addAudioSink(&m_feedbackAudioFifo, getInputMessageQueue(), audioDeviceIndex);
634  uint32_t audioSampleRate = audioDeviceManager->getOutputSampleRate(audioDeviceIndex);
635 
636  if (m_feedbackAudioSampleRate != audioSampleRate) {
637  reverseAPIKeys.append("feedbackAudioSampleRate");
638  applyFeedbackAudioSampleRate(audioSampleRate);
639  }
640  }
641 
642  if (settings.m_useReverseAPI)
643  {
644  bool fullUpdate = ((m_settings.m_useReverseAPI != settings.m_useReverseAPI) && settings.m_useReverseAPI) ||
649  webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force);
650  }
651 
652  m_settings = settings;
653 }
void addAudioSink(AudioFifo *audioFifo, MessageQueue *sampleSinkMessageQueue, int outputDeviceIndex=-1)
Add the audio sink.
int getOutputSampleRate(int outputDeviceIndex=-1)
Real m_interpolatorDistanceRemain
Definition: ammod.h:283
uint16_t m_reverseAPIDeviceIndex
Definition: ammodsettings.h:53
int getInputSampleRate(int inputDeviceIndex=-1)
int m_outputSampleRate
Definition: ammod.h:273
void create(int phaseSteps, double sampleRate, double cutoff, double nbTapsPerPhase=4.5)
int getOutputDeviceIndex(const QString &deviceName) const
Interpolator m_interpolator
Definition: ammod.h:281
quint32 m_audioSampleRate
Definition: ammod.h:294
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
QString m_reverseAPIAddress
Definition: ammodsettings.h:51
AudioFifo m_audioFifo
Definition: ammod.h:297
unsigned int uint32_t
Definition: rtptypes_win.h:46
void addAudioSource(AudioFifo *audioFifo, MessageQueue *sampleSourceMessageQueue, int inputDeviceIndex=-1)
Add an audio source.
float m_volumeFactor
Definition: ammodsettings.h:40
static DSPEngine * instance()
Definition: dspengine.cpp:51
QMutex m_settingsMutex
Definition: ammod.h:305
void webapiReverseSendSettings(QList< QString > &channelSettingsKeys, const AMModSettings &settings, bool force)
Definition: ammod.cpp:850
Real m_interpolatorDistance
Definition: ammod.h:282
void applyFeedbackAudioSampleRate(unsigned int sampleRate)
Definition: ammod.cpp:503
QString m_feedbackAudioDeviceName
This is the audio device you send the audio samples to for audio feedback.
Definition: ammodsettings.h:47
uint16_t m_reverseAPIChannelIndex
Definition: ammodsettings.h:54
qint64 m_inputFrequencyOffset
Definition: ammodsettings.h:36
AudioDeviceManager * getAudioDeviceManager()
Definition: dspengine.h:55
QString m_audioDeviceName
This is the audio device you get the audio samples from.
Definition: ammodsettings.h:46
NCOF m_toneNco
Definition: ammod.h:278
AMModSettings m_settings
Definition: ammod.h:275
void setFreq(Real freq, Real sampleRate)
Definition: ncof.cpp:51
void applyAudioSampleRate(int sampleRate)
Definition: ammod.cpp:480
int getInputDeviceIndex(const QString &deviceName) const
bool m_useReverseAPI
Definition: ammodsettings.h:50
float m_toneFrequency
Definition: ammodsettings.h:39
quint32 m_feedbackAudioSampleRate
Definition: ammod.h:299
bool m_interpolatorConsumed
Definition: ammod.h:284
AMModInputAF m_modAFInput
Definition: ammodsettings.h:45
float Real
Definition: dsptypes.h:42
AudioFifo m_feedbackAudioFifo
Definition: ammod.h:302
uint16_t m_reverseAPIPort
Definition: ammodsettings.h:52
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ calculateLevel()

void AMMod::calculateLevel ( Real sample)
private

Definition at line 301 of file ammod.cpp.

References levelChanged(), m_levelCalcCount, m_levelNbSamples, m_levelSum, m_peakLevel, leansdr::max(), and sqrt().

Referenced by modulateSample().

302 {
304  {
305  m_peakLevel = std::max(std::fabs(m_peakLevel), sample);
306  m_levelSum += sample * sample;
308  }
309  else
310  {
311  qreal rmsLevel = sqrt(m_levelSum / m_levelNbSamples);
312  //qDebug("NFMMod::calculateLevel: %f %f", rmsLevel, m_peakLevel);
313  emit levelChanged(rmsLevel, m_peakLevel, m_levelNbSamples);
314  m_peakLevel = 0.0f;
315  m_levelSum = 0.0f;
316  m_levelCalcCount = 0;
317  }
318 }
static const int m_levelNbSamples
Definition: ammod.h:318
void levelChanged(qreal rmsLevel, qreal peakLevel, int numSamples)
Real m_levelSum
Definition: ammod.h:315
Real m_peakLevel
Definition: ammod.h:314
quint32 m_levelCalcCount
Definition: ammod.h:313
Fixed< IntType, IntBits > sqrt(Fixed< IntType, IntBits > const &x)
Definition: fixed.h:2283
T max(const T &x, const T &y)
Definition: framework.h:446
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deserialize()

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

Implements ChannelAPI.

Definition at line 660 of file ammod.cpp.

References AMMod::MsgConfigureAMMod::create(), AMModSettings::deserialize(), BasebandSampleSource::m_inputMessageQueue, m_settings, MessageQueue::push(), and AMModSettings::resetToDefaults().

Referenced by getCenterFrequency().

661 {
662  if (m_settings.deserialize(data))
663  {
664  MsgConfigureAMMod *msg = MsgConfigureAMMod::create(m_settings, true);
666  return true;
667  }
668  else
669  {
671  MsgConfigureAMMod *msg = MsgConfigureAMMod::create(m_settings, true);
673  return false;
674  }
675 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
bool deserialize(const QByteArray &data)
void resetToDefaults()
MessageQueue m_inputMessageQueue
Queue for asynchronous inbound communication.
AMModSettings m_settings
Definition: ammod.h:275
static MsgConfigureAMMod * create(const AMModSettings &settings, bool force)
Definition: ammod.h:58
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ destroy()

virtual void AMMod::destroy ( )
inlinevirtual

Implements ChannelAPI.

Definition at line 206 of file ammod.h.

References handleMessage(), pull(), pullAudio(), start(), and stop().

206 { delete this; }
+ Here is the call graph for this function:

◆ getCenterFrequency()

virtual qint64 AMMod::getCenterFrequency ( ) const
inlinevirtual

Applies to a default stream.

Implements ChannelAPI.

Definition at line 216 of file ammod.h.

References deserialize(), AMModSettings::m_inputFrequencyOffset, AMMod::MsgConfigureAMMod::m_settings, and serialize().

qint64 m_inputFrequencyOffset
Definition: ammodsettings.h:36
AMModSettings m_settings
Definition: ammod.h:275
+ Here is the call graph for this function:

◆ getCWKeyer()

CWKeyer* AMMod::getCWKeyer ( )
inline

Definition at line 247 of file ammod.h.

References m_cwKeyer.

Referenced by AMModGUI::AMModGUI().

247 { return &m_cwKeyer; }
CWKeyer m_cwKeyer
Definition: ammod.h:316
+ Here is the caller graph for this function:

◆ getIdentifier()

virtual void AMMod::getIdentifier ( QString &  id)
inlinevirtual

Implements ChannelAPI.

Definition at line 214 of file ammod.h.

214 { id = objectName(); }

◆ getMagSq()

double AMMod::getMagSq ( ) const
inline

Definition at line 245 of file ammod.h.

References m_magsq.

Referenced by AMModGUI::tick(), and webapiFormatChannelReport().

245 { return m_magsq; }
double m_magsq
Definition: ammod.h:291
+ Here is the caller graph for this function:

◆ getNbSinkStreams()

virtual int AMMod::getNbSinkStreams ( ) const
inlinevirtual

Implements ChannelAPI.

Definition at line 221 of file ammod.h.

221 { return 1; }

◆ getNbSourceStreams()

virtual int AMMod::getNbSourceStreams ( ) const
inlinevirtual

Implements ChannelAPI.

Definition at line 222 of file ammod.h.

222 { return 0; }

◆ getStreamCenterFrequency()

virtual qint64 AMMod::getStreamCenterFrequency ( int  streamIndex,
bool  sinkElseSource 
) const
inlinevirtual

Implements ChannelAPI.

Definition at line 224 of file ammod.h.

References AMModSettings::m_inputFrequencyOffset, AMMod::MsgConfigureAMMod::m_settings, webapiReportGet(), webapiSettingsGet(), and webapiSettingsPutPatch().

225  {
226  (void) streamIndex;
227  (void) sinkElseSource;
229  }
qint64 m_inputFrequencyOffset
Definition: ammodsettings.h:36
AMModSettings m_settings
Definition: ammod.h:275
+ Here is the call graph for this function:

◆ getTitle()

virtual void AMMod::getTitle ( QString &  title)
inlinevirtual

Implements ChannelAPI.

Definition at line 215 of file ammod.h.

References AMMod::MsgConfigureAMMod::m_settings, and AMModSettings::m_title.

215 { title = m_settings.m_title; }
QString m_title
Definition: ammodsettings.h:44
AMModSettings m_settings
Definition: ammod.h:275

◆ handleMessage()

bool AMMod::handleMessage ( const Message cmd)
virtual

Processing of a message. Returns true if message has actually been processed.

Implements BasebandSampleSource.

Definition at line 333 of file ammod.cpp.

References applyAudioSampleRate(), applyChannelSettings(), applyFeedbackAudioSampleRate(), applySettings(), DSPConfigureAudio::AudioInput, DSPConfigureAudio::AudioOutput, UpChannelizer::configure(), AMMod::MsgReportFileSourceStreamTiming::create(), DSPConfigureAudio::getAudioType(), UpChannelizer::MsgChannelizerNotification::getBasebandSampleRate(), AMMod::MsgConfigureChannelizer::getCenterFrequency(), AMMod::MsgConfigureFileSourceName::getFileName(), AMMod::MsgConfigureAMMod::getForce(), UpChannelizer::MsgChannelizerNotification::getFrequencyOffset(), BasebandSampleSource::getInputMessageQueue(), BasebandSampleSource::getMessageQueueToGUI(), AMMod::MsgConfigureFileSourceSeek::getPercentage(), UpChannelizer::MsgChannelizerNotification::getSampleRate(), AMMod::MsgConfigureChannelizer::getSampleRate(), DSPConfigureAudio::getSampleRate(), AMMod::MsgConfigureAMMod::getSettings(), CWKeyer::MsgConfigureCWKeyer::getSettings(), m_audioSampleRate, m_channelizer, m_fileName, m_fileSize, m_ifstream, m_settings, AMModSettings::m_useReverseAPI, Message::match(), openFileStream(), MessageQueue::push(), seekFileStream(), and webapiReverseSendCWSettings().

Referenced by destroy().

334 {
336  {
338  qDebug() << "AMMod::handleMessage: MsgChannelizerNotification:"
339  << " basebandSampleRate: " << notif.getBasebandSampleRate()
340  << " outputSampleRate: " << notif.getSampleRate()
341  << " inputFrequencyOffset: " << notif.getFrequencyOffset();
342 
344 
345  return true;
346  }
347  else if (MsgConfigureChannelizer::match(cmd))
348  {
349  MsgConfigureChannelizer& cfg = (MsgConfigureChannelizer&) cmd;
350  qDebug() << "AMMod::handleMessage: MsgConfigureChannelizer:"
351  << " getSampleRate: " << cfg.getSampleRate()
352  << " getCenterFrequency: " << cfg.getCenterFrequency();
353 
355  cfg.getSampleRate(),
356  cfg.getCenterFrequency());
357 
358  return true;
359  }
360  else if (MsgConfigureAMMod::match(cmd))
361  {
362  MsgConfigureAMMod& cfg = (MsgConfigureAMMod&) cmd;
363  qDebug() << "AMMod::handleMessage: MsgConfigureAMMod";
364 
365  applySettings(cfg.getSettings(), cfg.getForce());
366 
367  return true;
368  }
369  else if (MsgConfigureFileSourceName::match(cmd))
370  {
371  MsgConfigureFileSourceName& conf = (MsgConfigureFileSourceName&) cmd;
372  m_fileName = conf.getFileName();
373  openFileStream();
374  return true;
375  }
376  else if (MsgConfigureFileSourceSeek::match(cmd))
377  {
378  MsgConfigureFileSourceSeek& conf = (MsgConfigureFileSourceSeek&) cmd;
379  int seekPercentage = conf.getPercentage();
380  seekFileStream(seekPercentage);
381 
382  return true;
383  }
385  {
386  std::size_t samplesCount;
387 
388  if (m_ifstream.eof()) {
389  samplesCount = m_fileSize / sizeof(Real);
390  } else {
391  samplesCount = m_ifstream.tellg() / sizeof(Real);
392  }
393 
394  MsgReportFileSourceStreamTiming *report;
395  report = MsgReportFileSourceStreamTiming::create(samplesCount);
396  getMessageQueueToGUI()->push(report);
397 
398  return true;
399  }
401  {
403 
406  }
407 
408  return true;
409  }
410  else if (DSPConfigureAudio::match(cmd))
411  {
412  DSPConfigureAudio& cfg = (DSPConfigureAudio&) cmd;
413  uint32_t sampleRate = cfg.getSampleRate();
414  DSPConfigureAudio::AudioType audioType = cfg.getAudioType();
415 
416  qDebug() << "AMMod::handleMessage: DSPConfigureAudio:"
417  << " sampleRate: " << sampleRate
418  << " audioType: " << audioType;
419 
420  if (audioType == DSPConfigureAudio::AudioInput)
421  {
422  if (sampleRate != m_audioSampleRate) {
423  applyAudioSampleRate(sampleRate);
424  }
425  }
426  else if (audioType == DSPConfigureAudio::AudioOutput)
427  {
428  if (sampleRate != m_audioSampleRate) {
429  applyFeedbackAudioSampleRate(sampleRate);
430  }
431  }
432 
433  return true;
434  }
435  else if (DSPSignalNotification::match(cmd))
436  {
437  return true;
438  }
439  else
440  {
441  return false;
442  }
443 }
void applySettings(const AMModSettings &settings, bool force=false)
Definition: ammod.cpp:550
void applyChannelSettings(int basebandSampleRate, int outputSampleRate, int inputFrequencyOffset, bool force=false)
Definition: ammod.cpp:520
void push(Message *message, bool emitSignal=true)
Push message onto queue.
void seekFileStream(int seekPercentage)
Definition: ammod.cpp:467
quint32 m_audioSampleRate
Definition: ammod.h:294
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
static MsgReportFileSourceStreamTiming * create(std::size_t samplesCount)
Definition: ammod.h:163
unsigned int uint32_t
Definition: rtptypes_win.h:46
AudioType getAudioType() const
Definition: dspcommands.h:391
std::ifstream m_ifstream
Definition: ammod.h:307
int getSampleRate() const
Definition: dspcommands.h:390
void openFileStream()
Definition: ammod.cpp:445
quint64 m_fileSize
raw file size (bytes)
Definition: ammod.h:309
QString m_fileName
Definition: ammod.h:308
static bool match(const Message *message)
Definition: message.cpp:45
void applyFeedbackAudioSampleRate(unsigned int sampleRate)
Definition: ammod.cpp:503
void webapiReverseSendCWSettings(const CWKeyerSettings &settings)
Definition: ammod.cpp:923
MessageQueue * getMessageQueueToGUI()
AMModSettings m_settings
Definition: ammod.h:275
void applyAudioSampleRate(int sampleRate)
Definition: ammod.cpp:480
bool m_useReverseAPI
Definition: ammodsettings.h:50
UpChannelizer * m_channelizer
Definition: ammod.h:270
float Real
Definition: dsptypes.h:42
const CWKeyerSettings & getSettings() const
Definition: cwkeyer.h:60
void configure(MessageQueue *messageQueue, int sampleRate, int centerFrequency)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ levelChanged

void AMMod::levelChanged ( qreal  rmsLevel,
qreal  peakLevel,
int  numSamples 
)
signal

Level changed

Parameters
rmsLevelRMS level in range 0.0 - 1.0
peakLevelPeak level in range 0.0 - 1.0
numSamplesNumber of audio samples analyzed

Referenced by calculateLevel().

+ Here is the caller graph for this function:

◆ modulateSample()

void AMMod::modulateSample ( )
private

Definition at line 173 of file ammod.cpp.

References calculateLevel(), m_audioBufferFill, AMModSettings::m_feedbackAudioEnable, AMModSettings::m_feedbackVolumeFactor, AMModSettings::m_modFactor, m_modSample, m_settings, pullAF(), and pushFeedback().

Referenced by pull().

174 {
175  Real t;
176 
177  pullAF(t);
178 
181  }
182 
183  calculateLevel(t);
185 
186  m_modSample.real((t*m_settings.m_modFactor + 1.0f) * 16384.0f); // modulate and scale zero frequency carrier
187  m_modSample.imag(0.0f);
188 }
float m_feedbackVolumeFactor
Definition: ammodsettings.h:48
bool m_feedbackAudioEnable
Definition: ammodsettings.h:49
void pushFeedback(Real sample)
Definition: ammod.cpp:257
Complex m_modSample
Definition: ammod.h:279
uint m_audioBufferFill
Definition: ammod.h:296
void pullAF(Real &sample)
Definition: ammod.cpp:190
void calculateLevel(Real &sample)
Definition: ammod.cpp:301
AMModSettings m_settings
Definition: ammod.h:275
float Real
Definition: dsptypes.h:42
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ networkManagerFinished

void AMMod::networkManagerFinished ( QNetworkReply *  reply)
privateslot

Definition at line 954 of file ammod.cpp.

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

955 {
956  QNetworkReply::NetworkError replyError = reply->error();
957 
958  if (replyError)
959  {
960  qWarning() << "AMMod::networkManagerFinished:"
961  << " error(" << (int) replyError
962  << "): " << replyError
963  << ": " << reply->errorString();
964  return;
965  }
966 
967  QString answer = reply->readAll();
968  answer.chop(1); // remove last \n
969  qDebug("AMMod::networkManagerFinished: reply:\n%s", answer.toStdString().c_str());
970 }
+ Here is the caller graph for this function:

◆ openFileStream()

void AMMod::openFileStream ( )
private

Definition at line 445 of file ammod.cpp.

References AMMod::MsgReportFileSourceStreamData::create(), BasebandSampleSource::getMessageQueueToGUI(), m_fileName, m_fileSize, m_ifstream, m_recordLength, m_sampleRate, and MessageQueue::push().

Referenced by handleMessage().

446 {
447  if (m_ifstream.is_open()) {
448  m_ifstream.close();
449  }
450 
451  m_ifstream.open(m_fileName.toStdString().c_str(), std::ios::binary | std::ios::ate);
452  m_fileSize = m_ifstream.tellg();
453  m_ifstream.seekg(0,std::ios_base::beg);
454 
455  m_sampleRate = 48000; // fixed rate
456  m_recordLength = m_fileSize / (sizeof(Real) * m_sampleRate);
457 
458  qDebug() << "AMMod::openFileStream: " << m_fileName.toStdString().c_str()
459  << " fileSize: " << m_fileSize << "bytes"
460  << " length: " << m_recordLength << " seconds";
461 
462  MsgReportFileSourceStreamData *report;
463  report = MsgReportFileSourceStreamData::create(m_sampleRate, m_recordLength);
464  getMessageQueueToGUI()->push(report);
465 }
int m_sampleRate
Definition: ammod.h:311
void push(Message *message, bool emitSignal=true)
Push message onto queue.
std::ifstream m_ifstream
Definition: ammod.h:307
static MsgReportFileSourceStreamData * create(int sampleRate, quint32 recordLength)
Definition: ammod.h:184
quint64 m_fileSize
raw file size (bytes)
Definition: ammod.h:309
QString m_fileName
Definition: ammod.h:308
quint32 m_recordLength
record length in seconds computed from file size
Definition: ammod.h:310
MessageQueue * getMessageQueueToGUI()
float Real
Definition: dsptypes.h:42
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ processOneSample()

void AMMod::processOneSample ( Complex ci)
private

Definition at line 280 of file ammod.cpp.

References AudioFifo::clear(), m_feedbackAudioBuffer, m_feedbackAudioBufferFill, m_feedbackAudioFifo, m_feedbackInterpolatorDistance, and AudioFifo::write().

Referenced by pushFeedback().

281 {
285 
287  {
289 
290  if (res != m_feedbackAudioBufferFill)
291  {
292  qDebug("AMDemod::pushFeedback: %u/%u audio samples written m_feedbackInterpolatorDistance: %f",
295  }
296 
298  }
299 }
AudioVector m_feedbackAudioBuffer
Definition: ammod.h:300
void clear()
Definition: audiofifo.cpp:156
uint m_feedbackAudioBufferFill
Definition: ammod.h:301
AudioFifo m_feedbackAudioFifo
Definition: ammod.h:302
uint32_t write(const quint8 *data, uint32_t numSamples)
Definition: audiofifo.cpp:66
Real m_feedbackInterpolatorDistance
Definition: ammod.h:287
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pull()

void AMMod::pull ( Sample sample)
virtual

Implements BasebandSampleSource.

Definition at line 114 of file ammod.cpp.

References MovingAverageUtil< T, Total, N >::asDouble(), Interpolator::decimate(), Interpolator::interpolate(), m_carrierNco, AMModSettings::m_channelMute, Sample::m_imag, m_interpolator, m_interpolatorDistance, m_interpolatorDistanceRemain, m_magsq, m_modSample, m_movingAverage, Sample::m_real, m_settings, m_settingsMutex, modulateSample(), NCO::nextIQ(), and SDR_TX_SCALED.

Referenced by destroy().

115 {
117  {
118  sample.m_real = 0.0f;
119  sample.m_imag = 0.0f;
120  return;
121  }
122 
123  Complex ci;
124 
125  m_settingsMutex.lock();
126 
127  if (m_interpolatorDistance > 1.0f) // decimate
128  {
129  modulateSample();
130 
132  {
133  modulateSample();
134  }
135  }
136  else
137  {
139  {
140  modulateSample();
141  }
142  }
143 
145 
146  ci *= m_carrierNco.nextIQ(); // shift to carrier frequency
147 
148  m_settingsMutex.unlock();
149 
150  double magsq = ci.real() * ci.real() + ci.imag() * ci.imag();
151  magsq /= (SDR_TX_SCALED*SDR_TX_SCALED);
152  m_movingAverage(magsq);
154 
155  sample.m_real = (FixReal) ci.real();
156  sample.m_imag = (FixReal) ci.imag();
157 }
Complex nextIQ()
Return next complex sample.
Definition: nco.cpp:61
bool decimate(Real *distance, const Complex &next, Complex *result)
Definition: interpolator.h:38
Real m_interpolatorDistanceRemain
Definition: ammod.h:283
bool interpolate(Real *distance, const Complex &next, Complex *result)
Definition: interpolator.h:53
double m_magsq
Definition: ammod.h:291
Interpolator m_interpolator
Definition: ammod.h:281
Complex m_modSample
Definition: ammod.h:279
QMutex m_settingsMutex
Definition: ammod.h:305
FixReal m_real
Definition: dsptypes.h:64
Real m_interpolatorDistance
Definition: ammod.h:282
NCO m_carrierNco
Definition: ammod.h:277
MovingAverageUtil< double, double, 16 > m_movingAverage
Definition: ammod.h:292
void modulateSample()
Definition: ammod.cpp:173
AMModSettings m_settings
Definition: ammod.h:275
FixReal m_imag
Definition: dsptypes.h:65
std::complex< Real > Complex
Definition: dsptypes.h:43
double asDouble() const
Definition: movingaverage.h:57
#define SDR_TX_SCALED
Definition: dsptypes.h:40
qint16 FixReal
Definition: dsptypes.h:35
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pullAF()

void AMMod::pullAF ( Real sample)
private

Definition at line 190 of file ammod.cpp.

References AMModSettings::AMModInputAudio, AMModSettings::AMModInputCWTone, AMModSettings::AMModInputFile, AMModSettings::AMModInputNone, AMModSettings::AMModInputTone, CWKeyer::getCWSmoother(), CWSmoother::getFadeSample(), CWKeyer::getSample(), m_audioBuffer, m_audioBufferFill, m_cwKeyer, m_ifstream, AMModSettings::m_modAFInput, AMModSettings::m_playLoop, m_settings, m_toneNco, AMModSettings::m_volumeFactor, NCOF::next(), and NCOF::setPhase().

Referenced by modulateSample().

191 {
192  switch (m_settings.m_modAFInput)
193  {
195  sample = m_toneNco.next();
196  break;
198  // sox f4exb_call.wav --encoding float --endian little f4exb_call.raw
199  // ffplay -f f32le -ar 48k -ac 1 f4exb_call.raw
200  if (m_ifstream.is_open())
201  {
202  if (m_ifstream.eof())
203  {
205  {
206  m_ifstream.clear();
207  m_ifstream.seekg(0, std::ios::beg);
208  }
209  }
210 
211  if (m_ifstream.eof())
212  {
213  sample = 0.0f;
214  }
215  else
216  {
217  m_ifstream.read(reinterpret_cast<char*>(&sample), sizeof(Real));
218  sample *= m_settings.m_volumeFactor;
219  }
220  }
221  else
222  {
223  sample = 0.0f;
224  }
225  break;
228  break;
230  Real fadeFactor;
231 
232  if (m_cwKeyer.getSample())
233  {
234  m_cwKeyer.getCWSmoother().getFadeSample(true, fadeFactor);
235  sample = m_toneNco.next() * fadeFactor;
236  }
237  else
238  {
239  if (m_cwKeyer.getCWSmoother().getFadeSample(false, fadeFactor))
240  {
241  sample = m_toneNco.next() * fadeFactor;
242  }
243  else
244  {
245  sample = 0.0f;
246  m_toneNco.setPhase(0);
247  }
248  }
249  break;
251  default:
252  sample = 0.0f;
253  break;
254  }
255 }
void setPhase(Real phase)
Definition: ncof.h:42
uint m_audioBufferFill
Definition: ammod.h:296
float m_volumeFactor
Definition: ammodsettings.h:40
bool getFadeSample(bool on, float &sample)
Definition: cwkeyer.cpp:487
std::ifstream m_ifstream
Definition: ammod.h:307
CWSmoother & getCWSmoother()
Definition: cwkeyer.h:111
AudioVector m_audioBuffer
Definition: ammod.h:295
CWKeyer m_cwKeyer
Definition: ammod.h:316
int getSample()
Definition: cwkeyer.cpp:194
NCOF m_toneNco
Definition: ammod.h:278
AMModSettings m_settings
Definition: ammod.h:275
Real next()
Return next real sample.
Definition: ncof.cpp:57
AMModInputAF m_modAFInput
Definition: ammodsettings.h:45
float Real
Definition: dsptypes.h:42
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pullAudio()

void AMMod::pullAudio ( int  nbSamples)
virtual

Reimplemented from BasebandSampleSource.

Definition at line 159 of file ammod.cpp.

References m_audioBuffer, m_audioBufferFill, m_audioFifo, m_audioSampleRate, m_basebandSampleRate, and AudioFifo::read().

Referenced by destroy().

160 {
161 // qDebug("AMMod::pullAudio: %d", nbSamples);
162  unsigned int nbAudioSamples = nbSamples * ((Real) m_audioSampleRate / (Real) m_basebandSampleRate);
163 
164  if (nbAudioSamples > m_audioBuffer.size())
165  {
166  m_audioBuffer.resize(nbAudioSamples);
167  }
168 
169  m_audioFifo.read(reinterpret_cast<quint8*>(&m_audioBuffer[0]), nbAudioSamples);
170  m_audioBufferFill = 0;
171 }
quint32 m_audioSampleRate
Definition: ammod.h:294
AudioFifo m_audioFifo
Definition: ammod.h:297
uint m_audioBufferFill
Definition: ammod.h:296
AudioVector m_audioBuffer
Definition: ammod.h:295
uint32_t read(quint8 *data, uint32_t numSamples)
Definition: audiofifo.cpp:103
int m_basebandSampleRate
Definition: ammod.h:272
float Real
Definition: dsptypes.h:42
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pushFeedback()

void AMMod::pushFeedback ( Real  sample)
private

Definition at line 257 of file ammod.cpp.

References Interpolator::decimate(), Interpolator::interpolate(), m_feedbackInterpolator, m_feedbackInterpolatorDistance, m_feedbackInterpolatorDistanceRemain, and processOneSample().

Referenced by modulateSample().

258 {
259  Complex c(sample, sample);
260  Complex ci;
261 
262  if (m_feedbackInterpolatorDistance < 1.0f) // interpolate
263  {
265  {
266  processOneSample(ci);
268  }
269  }
270  else // decimate
271  {
273  {
274  processOneSample(ci);
276  }
277  }
278 }
bool decimate(Real *distance, const Complex &next, Complex *result)
Definition: interpolator.h:38
Real m_feedbackInterpolatorDistanceRemain
Definition: ammod.h:288
bool interpolate(Real *distance, const Complex &next, Complex *result)
Definition: interpolator.h:53
void processOneSample(Complex &ci)
Definition: ammod.cpp:280
Interpolator m_feedbackInterpolator
Definition: ammod.h:286
std::complex< Real > Complex
Definition: dsptypes.h:43
Real m_feedbackInterpolatorDistance
Definition: ammod.h:287
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ seekFileStream()

void AMMod::seekFileStream ( int  seekPercentage)
private

Definition at line 467 of file ammod.cpp.

References m_ifstream, m_recordLength, m_sampleRate, and m_settingsMutex.

Referenced by handleMessage().

468 {
469  QMutexLocker mutexLocker(&m_settingsMutex);
470 
471  if (m_ifstream.is_open())
472  {
473  int seekPoint = ((m_recordLength * seekPercentage) / 100) * m_sampleRate;
474  seekPoint *= sizeof(Real);
475  m_ifstream.clear();
476  m_ifstream.seekg(seekPoint, std::ios::beg);
477  }
478 }
int m_sampleRate
Definition: ammod.h:311
std::ifstream m_ifstream
Definition: ammod.h:307
QMutex m_settingsMutex
Definition: ammod.h:305
quint32 m_recordLength
record length in seconds computed from file size
Definition: ammod.h:310
float Real
Definition: dsptypes.h:42
+ Here is the caller graph for this function:

◆ serialize()

QByteArray AMMod::serialize ( ) const
virtual

Implements ChannelAPI.

Definition at line 655 of file ammod.cpp.

References m_settings, and AMModSettings::serialize().

Referenced by getCenterFrequency().

656 {
657  return m_settings.serialize();
658 }
QByteArray serialize() const
AMModSettings m_settings
Definition: ammod.h:275
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ start()

void AMMod::start ( )
virtual

Implements BasebandSampleSource.

Definition at line 320 of file ammod.cpp.

References applyChannelSettings(), AudioFifo::clear(), m_audioFifo, m_basebandSampleRate, AMModSettings::m_inputFrequencyOffset, m_inputFrequencyOffset, m_outputSampleRate, and m_settings.

Referenced by destroy().

321 {
322  qDebug() << "AMMod::start: m_outputSampleRate: " << m_outputSampleRate
323  << " m_inputFrequencyOffset: " << m_settings.m_inputFrequencyOffset;
324 
325  m_audioFifo.clear();
327 }
void applyChannelSettings(int basebandSampleRate, int outputSampleRate, int inputFrequencyOffset, bool force=false)
Definition: ammod.cpp:520
int m_outputSampleRate
Definition: ammod.h:273
void clear()
Definition: audiofifo.cpp:156
AudioFifo m_audioFifo
Definition: ammod.h:297
int m_inputFrequencyOffset
Definition: ammod.h:274
qint64 m_inputFrequencyOffset
Definition: ammodsettings.h:36
AMModSettings m_settings
Definition: ammod.h:275
int m_basebandSampleRate
Definition: ammod.h:272
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ stop()

void AMMod::stop ( )
virtual

Implements BasebandSampleSource.

Definition at line 329 of file ammod.cpp.

Referenced by destroy().

330 {
331 }
+ Here is the caller graph for this function:

◆ webapiFormatChannelReport()

void AMMod::webapiFormatChannelReport ( SWGSDRangel::SWGChannelReport response)
private

Definition at line 843 of file ammod.cpp.

References CalcDb::dbPower(), SWGSDRangel::SWGChannelReport::getAmModReport(), getMagSq(), m_audioSampleRate, m_outputSampleRate, SWGSDRangel::SWGAMModReport::setAudioSampleRate(), SWGSDRangel::SWGAMModReport::setChannelPowerDb(), and SWGSDRangel::SWGAMModReport::setChannelSampleRate().

Referenced by webapiReportGet().

844 {
848 }
void setAudioSampleRate(qint32 audio_sample_rate)
static double dbPower(double magsq, double floor=1e-12)
Definition: db.cpp:22
int m_outputSampleRate
Definition: ammod.h:273
void setChannelPowerDb(float channel_power_db)
quint32 m_audioSampleRate
Definition: ammod.h:294
double getMagSq() const
Definition: ammod.h:245
void setChannelSampleRate(qint32 channel_sample_rate)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ webapiFormatChannelSettings()

void AMMod::webapiFormatChannelSettings ( SWGSDRangel::SWGChannelSettings response,
const AMModSettings settings 
)
private

Definition at line 797 of file ammod.cpp.

References SWGSDRangel::SWGChannelSettings::getAmModSettings(), SWGSDRangel::SWGAMModSettings::getAudioDeviceName(), SWGSDRangel::SWGAMModSettings::getCwKeyer(), SWGSDRangel::SWGAMModSettings::getReverseApiAddress(), CWKeyer::getSettings(), SWGSDRangel::SWGAMModSettings::getTitle(), AMModSettings::m_audioDeviceName, AMModSettings::m_channelMute, m_cwKeyer, AMModSettings::m_inputFrequencyOffset, AMModSettings::m_modAFInput, AMModSettings::m_modFactor, AMModSettings::m_playLoop, AMModSettings::m_reverseAPIAddress, AMModSettings::m_reverseAPIChannelIndex, AMModSettings::m_reverseAPIDeviceIndex, AMModSettings::m_reverseAPIPort, AMModSettings::m_rfBandwidth, AMModSettings::m_rgbColor, AMModSettings::m_title, AMModSettings::m_toneFrequency, AMModSettings::m_useReverseAPI, AMModSettings::m_volumeFactor, SWGSDRangel::SWGAMModSettings::setAudioDeviceName(), SWGSDRangel::SWGAMModSettings::setChannelMute(), SWGSDRangel::SWGAMModSettings::setCwKeyer(), SWGSDRangel::SWGAMModSettings::setInputFrequencyOffset(), SWGSDRangel::SWGAMModSettings::setModAfInput(), SWGSDRangel::SWGAMModSettings::setModFactor(), SWGSDRangel::SWGAMModSettings::setPlayLoop(), SWGSDRangel::SWGAMModSettings::setReverseApiAddress(), SWGSDRangel::SWGAMModSettings::setReverseApiChannelIndex(), SWGSDRangel::SWGAMModSettings::setReverseApiDeviceIndex(), SWGSDRangel::SWGAMModSettings::setReverseApiPort(), SWGSDRangel::SWGAMModSettings::setRfBandwidth(), SWGSDRangel::SWGAMModSettings::setRgbColor(), SWGSDRangel::SWGAMModSettings::setTitle(), SWGSDRangel::SWGAMModSettings::setToneFrequency(), SWGSDRangel::SWGAMModSettings::setUseReverseApi(), SWGSDRangel::SWGAMModSettings::setVolumeFactor(), and CWKeyer::webapiFormatChannelSettings().

Referenced by webapiSettingsGet(), and webapiSettingsPutPatch().

798 {
799  response.getAmModSettings()->setChannelMute(settings.m_channelMute ? 1 : 0);
801  response.getAmModSettings()->setModAfInput((int) settings.m_modAFInput);
802  response.getAmModSettings()->setPlayLoop(settings.m_playLoop ? 1 : 0);
803  response.getAmModSettings()->setRfBandwidth(settings.m_rfBandwidth);
804  response.getAmModSettings()->setModFactor(settings.m_modFactor);
805  response.getAmModSettings()->setRgbColor(settings.m_rgbColor);
806 
807  if (response.getAmModSettings()->getTitle()) {
808  *response.getAmModSettings()->getTitle() = settings.m_title;
809  } else {
810  response.getAmModSettings()->setTitle(new QString(settings.m_title));
811  }
812 
813  response.getAmModSettings()->setToneFrequency(settings.m_toneFrequency);
814  response.getAmModSettings()->setVolumeFactor(settings.m_volumeFactor);
815 
816  if (!response.getAmModSettings()->getCwKeyer()) {
818  }
819 
820  SWGSDRangel::SWGCWKeyerSettings *apiCwKeyerSettings = response.getAmModSettings()->getCwKeyer();
821  const CWKeyerSettings& cwKeyerSettings = m_cwKeyer.getSettings();
822  m_cwKeyer.webapiFormatChannelSettings(apiCwKeyerSettings, cwKeyerSettings);
823 
824  if (response.getAmModSettings()->getAudioDeviceName()) {
825  *response.getAmModSettings()->getAudioDeviceName() = settings.m_audioDeviceName;
826  } else {
827  response.getAmModSettings()->setAudioDeviceName(new QString(settings.m_audioDeviceName));
828  }
829 
830  response.getAmModSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0);
831 
832  if (response.getAmModSettings()->getReverseApiAddress()) {
834  } else {
835  response.getAmModSettings()->setReverseApiAddress(new QString(settings.m_reverseAPIAddress));
836  }
837 
841 }
void setModFactor(float mod_factor)
void setAudioDeviceName(QString *audio_device_name)
void setToneFrequency(float tone_frequency)
uint16_t m_reverseAPIDeviceIndex
Definition: ammodsettings.h:53
void setVolumeFactor(float volume_factor)
void setModAfInput(qint32 mod_af_input)
void setReverseApiAddress(QString *reverse_api_address)
QString m_reverseAPIAddress
Definition: ammodsettings.h:51
SWGCWKeyerSettings * getCwKeyer()
void setUseReverseApi(qint32 use_reverse_api)
void setReverseApiDeviceIndex(qint32 reverse_api_device_index)
float m_volumeFactor
Definition: ammodsettings.h:40
void setChannelMute(qint32 channel_mute)
CWKeyer m_cwKeyer
Definition: ammod.h:316
void setRgbColor(qint32 rgb_color)
quint32 m_rgbColor
Definition: ammodsettings.h:43
uint16_t m_reverseAPIChannelIndex
Definition: ammodsettings.h:54
static void webapiFormatChannelSettings(SWGSDRangel::SWGCWKeyerSettings *apiCwKeyerSettings, const CWKeyerSettings &cwKeyerSettings)
Definition: cwkeyer.cpp:637
QString m_title
Definition: ammodsettings.h:44
qint64 m_inputFrequencyOffset
Definition: ammodsettings.h:36
void setRfBandwidth(float rf_bandwidth)
QString m_audioDeviceName
This is the audio device you get the audio samples from.
Definition: ammodsettings.h:46
void setInputFrequencyOffset(qint64 input_frequency_offset)
bool m_useReverseAPI
Definition: ammodsettings.h:50
void setCwKeyer(SWGCWKeyerSettings *cw_keyer)
void setPlayLoop(qint32 play_loop)
float m_toneFrequency
Definition: ammodsettings.h:39
const CWKeyerSettings & getSettings() const
Definition: cwkeyer.h:107
AMModInputAF m_modAFInput
Definition: ammodsettings.h:45
void setReverseApiPort(qint32 reverse_api_port)
void setReverseApiChannelIndex(qint32 reverse_api_channel_index)
uint16_t m_reverseAPIPort
Definition: ammodsettings.h:52
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ webapiReportGet()

int AMMod::webapiReportGet ( SWGSDRangel::SWGChannelReport response,
QString &  errorMessage 
)
virtual

Reimplemented from ChannelAPI.

Definition at line 786 of file ammod.cpp.

References SWGSDRangel::SWGChannelReport::getAmModReport(), SWGSDRangel::SWGAMModReport::init(), SWGSDRangel::SWGChannelReport::setAmModReport(), and webapiFormatChannelReport().

Referenced by getStreamCenterFrequency().

789 {
790  (void) errorMessage;
792  response.getAmModReport()->init();
793  webapiFormatChannelReport(response);
794  return 200;
795 }
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport &response)
Definition: ammod.cpp:843
void setAmModReport(SWGAMModReport *am_mod_report)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ webapiReverseSendCWSettings()

void AMMod::webapiReverseSendCWSettings ( const CWKeyerSettings settings)
private

Definition at line 923 of file ammod.cpp.

References SWGSDRangel::SWGChannelSettings::asJson(), SWGSDRangel::SWGChannelSettings::getAmModSettings(), SWGSDRangel::SWGAMModSettings::getCwKeyer(), m_cwKeyer, m_networkManager, m_networkRequest, AMModSettings::m_reverseAPIAddress, AMModSettings::m_reverseAPIChannelIndex, AMModSettings::m_reverseAPIDeviceIndex, AMModSettings::m_reverseAPIPort, m_settings, SWGSDRangel::SWGChannelSettings::setAmModSettings(), SWGSDRangel::SWGChannelSettings::setChannelType(), SWGSDRangel::SWGAMModSettings::setCwKeyer(), SWGSDRangel::SWGChannelSettings::setDirection(), and CWKeyer::webapiFormatChannelSettings().

Referenced by handleMessage().

924 {
926  swgChannelSettings->setDirection(1); // single source (Tx)
927  swgChannelSettings->setChannelType(new QString("AMMod"));
928  swgChannelSettings->setAmModSettings(new SWGSDRangel::SWGAMModSettings());
929  SWGSDRangel::SWGAMModSettings *swgAMModSettings = swgChannelSettings->getAmModSettings();
930 
931  swgAMModSettings->setCwKeyer(new SWGSDRangel::SWGCWKeyerSettings());
932  SWGSDRangel::SWGCWKeyerSettings *apiCwKeyerSettings = swgAMModSettings->getCwKeyer();
933  m_cwKeyer.webapiFormatChannelSettings(apiCwKeyerSettings, cwKeyerSettings);
934 
935  QString channelSettingsURL = QString("http://%1:%2/sdrangel/deviceset/%3/channel/%4/settings")
940  m_networkRequest.setUrl(QUrl(channelSettingsURL));
941  m_networkRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
942 
943  QBuffer *buffer=new QBuffer();
944  buffer->open((QBuffer::ReadWrite));
945  buffer->write(swgChannelSettings->asJson().toUtf8());
946  buffer->seek(0);
947 
948  // Always use PATCH to avoid passing reverse API settings
949  m_networkManager->sendCustomRequest(m_networkRequest, "PATCH", buffer);
950 
951  delete swgChannelSettings;
952 }
uint16_t m_reverseAPIDeviceIndex
Definition: ammodsettings.h:53
QString m_reverseAPIAddress
Definition: ammodsettings.h:51
QNetworkRequest m_networkRequest
Definition: ammod.h:321
void setChannelType(QString *channel_type)
SWGCWKeyerSettings * getCwKeyer()
CWKeyer m_cwKeyer
Definition: ammod.h:316
QNetworkAccessManager * m_networkManager
Definition: ammod.h:320
virtual QString asJson() override
uint16_t m_reverseAPIChannelIndex
Definition: ammodsettings.h:54
static void webapiFormatChannelSettings(SWGSDRangel::SWGCWKeyerSettings *apiCwKeyerSettings, const CWKeyerSettings &cwKeyerSettings)
Definition: cwkeyer.cpp:637
void setAmModSettings(SWGAMModSettings *am_mod_settings)
AMModSettings m_settings
Definition: ammod.h:275
void setCwKeyer(SWGCWKeyerSettings *cw_keyer)
uint16_t m_reverseAPIPort
Definition: ammodsettings.h:52
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ webapiReverseSendSettings()

void AMMod::webapiReverseSendSettings ( QList< QString > &  channelSettingsKeys,
const AMModSettings settings,
bool  force 
)
private

Definition at line 850 of file ammod.cpp.

References SWGSDRangel::SWGChannelSettings::asJson(), SWGSDRangel::SWGChannelSettings::getAmModSettings(), SWGSDRangel::SWGAMModSettings::getCwKeyer(), ChannelAPI::getDeviceSetIndex(), ChannelAPI::getIndexInDeviceSet(), CWKeyer::getSettings(), AMModSettings::m_audioDeviceName, AMModSettings::m_channelMute, m_cwKeyer, AMModSettings::m_inputFrequencyOffset, AMModSettings::m_modAFInput, AMModSettings::m_modFactor, m_networkManager, m_networkRequest, AMModSettings::m_playLoop, AMModSettings::m_reverseAPIAddress, AMModSettings::m_reverseAPIChannelIndex, AMModSettings::m_reverseAPIDeviceIndex, AMModSettings::m_reverseAPIPort, AMModSettings::m_rfBandwidth, AMModSettings::m_rgbColor, AMModSettings::m_title, AMModSettings::m_toneFrequency, AMModSettings::m_volumeFactor, SWGSDRangel::SWGChannelSettings::setAmModSettings(), SWGSDRangel::SWGAMModSettings::setAudioDeviceName(), SWGSDRangel::SWGAMModSettings::setChannelMute(), SWGSDRangel::SWGChannelSettings::setChannelType(), SWGSDRangel::SWGAMModSettings::setCwKeyer(), SWGSDRangel::SWGChannelSettings::setDirection(), SWGSDRangel::SWGAMModSettings::setInputFrequencyOffset(), SWGSDRangel::SWGAMModSettings::setModAfInput(), SWGSDRangel::SWGAMModSettings::setModFactor(), SWGSDRangel::SWGChannelSettings::setOriginatorChannelIndex(), SWGSDRangel::SWGChannelSettings::setOriginatorDeviceSetIndex(), SWGSDRangel::SWGAMModSettings::setPlayLoop(), SWGSDRangel::SWGAMModSettings::setRfBandwidth(), SWGSDRangel::SWGAMModSettings::setRgbColor(), SWGSDRangel::SWGAMModSettings::setTitle(), SWGSDRangel::SWGAMModSettings::setToneFrequency(), SWGSDRangel::SWGAMModSettings::setVolumeFactor(), and CWKeyer::webapiFormatChannelSettings().

Referenced by applySettings().

851 {
853  swgChannelSettings->setDirection(1); // single source (Tx)
854  swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet());
855  swgChannelSettings->setOriginatorDeviceSetIndex(getDeviceSetIndex());
856  swgChannelSettings->setChannelType(new QString("AMMod"));
857  swgChannelSettings->setAmModSettings(new SWGSDRangel::SWGAMModSettings());
858  SWGSDRangel::SWGAMModSettings *swgAMModSettings = swgChannelSettings->getAmModSettings();
859 
860  // transfer data that has been modified. When force is on transfer all data except reverse API data
861 
862  if (channelSettingsKeys.contains("channelMute") || force) {
863  swgAMModSettings->setChannelMute(settings.m_channelMute ? 1 : 0);
864  }
865  if (channelSettingsKeys.contains("inputFrequencyOffset") || force) {
866  swgAMModSettings->setInputFrequencyOffset(settings.m_inputFrequencyOffset);
867  }
868  if (channelSettingsKeys.contains("modAFInput") || force) {
869  swgAMModSettings->setModAfInput((int) settings.m_modAFInput);
870  }
871  if (channelSettingsKeys.contains("audioDeviceName") || force) {
872  swgAMModSettings->setAudioDeviceName(new QString(settings.m_audioDeviceName));
873  }
874  if (channelSettingsKeys.contains("playLoop") || force) {
875  swgAMModSettings->setPlayLoop(settings.m_playLoop ? 1 : 0);
876  }
877  if (channelSettingsKeys.contains("rfBandwidth") || force) {
878  swgAMModSettings->setRfBandwidth(settings.m_rfBandwidth);
879  }
880  if (channelSettingsKeys.contains("rgbColor") || force) {
881  swgAMModSettings->setRgbColor(settings.m_rgbColor);
882  }
883  if (channelSettingsKeys.contains("title") || force) {
884  swgAMModSettings->setTitle(new QString(settings.m_title));
885  }
886  if (channelSettingsKeys.contains("toneFrequency") || force) {
887  swgAMModSettings->setToneFrequency(settings.m_toneFrequency);
888  }
889  if (channelSettingsKeys.contains("volumeFactor") || force) {
890  swgAMModSettings->setVolumeFactor(settings.m_volumeFactor);
891  }
892  if (channelSettingsKeys.contains("modFactor") || force) {
893  swgAMModSettings->setModFactor(settings.m_modFactor);
894  }
895 
896  if (force)
897  {
898  const CWKeyerSettings& cwKeyerSettings = m_cwKeyer.getSettings();
899  swgAMModSettings->setCwKeyer(new SWGSDRangel::SWGCWKeyerSettings());
900  SWGSDRangel::SWGCWKeyerSettings *apiCwKeyerSettings = swgAMModSettings->getCwKeyer();
901  m_cwKeyer.webapiFormatChannelSettings(apiCwKeyerSettings, cwKeyerSettings);
902  }
903 
904  QString channelSettingsURL = QString("http://%1:%2/sdrangel/deviceset/%3/channel/%4/settings")
905  .arg(settings.m_reverseAPIAddress)
906  .arg(settings.m_reverseAPIPort)
907  .arg(settings.m_reverseAPIDeviceIndex)
908  .arg(settings.m_reverseAPIChannelIndex);
909  m_networkRequest.setUrl(QUrl(channelSettingsURL));
910  m_networkRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
911 
912  QBuffer *buffer=new QBuffer();
913  buffer->open((QBuffer::ReadWrite));
914  buffer->write(swgChannelSettings->asJson().toUtf8());
915  buffer->seek(0);
916 
917  // Always use PATCH to avoid passing reverse API settings
918  m_networkManager->sendCustomRequest(m_networkRequest, "PATCH", buffer);
919 
920  delete swgChannelSettings;
921 }
void setOriginatorChannelIndex(qint32 originator_channel_index)
void setModFactor(float mod_factor)
void setAudioDeviceName(QString *audio_device_name)
void setToneFrequency(float tone_frequency)
uint16_t m_reverseAPIDeviceIndex
Definition: ammodsettings.h:53
void setVolumeFactor(float volume_factor)
int getDeviceSetIndex() const
Definition: channelapi.h:89
void setModAfInput(qint32 mod_af_input)
QString m_reverseAPIAddress
Definition: ammodsettings.h:51
QNetworkRequest m_networkRequest
Definition: ammod.h:321
void setChannelType(QString *channel_type)
void setOriginatorDeviceSetIndex(qint32 originator_device_set_index)
SWGCWKeyerSettings * getCwKeyer()
float m_volumeFactor
Definition: ammodsettings.h:40
void setChannelMute(qint32 channel_mute)
CWKeyer m_cwKeyer
Definition: ammod.h:316
QNetworkAccessManager * m_networkManager
Definition: ammod.h:320
void setRgbColor(qint32 rgb_color)
quint32 m_rgbColor
Definition: ammodsettings.h:43
virtual QString asJson() override
uint16_t m_reverseAPIChannelIndex
Definition: ammodsettings.h:54
static void webapiFormatChannelSettings(SWGSDRangel::SWGCWKeyerSettings *apiCwKeyerSettings, const CWKeyerSettings &cwKeyerSettings)
Definition: cwkeyer.cpp:637
void setAmModSettings(SWGAMModSettings *am_mod_settings)
QString m_title
Definition: ammodsettings.h:44
qint64 m_inputFrequencyOffset
Definition: ammodsettings.h:36
void setRfBandwidth(float rf_bandwidth)
QString m_audioDeviceName
This is the audio device you get the audio samples from.
Definition: ammodsettings.h:46
void setInputFrequencyOffset(qint64 input_frequency_offset)
void setCwKeyer(SWGCWKeyerSettings *cw_keyer)
void setPlayLoop(qint32 play_loop)
float m_toneFrequency
Definition: ammodsettings.h:39
const CWKeyerSettings & getSettings() const
Definition: cwkeyer.h:107
int getIndexInDeviceSet() const
Definition: channelapi.h:87
AMModInputAF m_modAFInput
Definition: ammodsettings.h:45
uint16_t m_reverseAPIPort
Definition: ammodsettings.h:52
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ webapiSettingsGet()

int AMMod::webapiSettingsGet ( SWGSDRangel::SWGChannelSettings response,
QString &  errorMessage 
)
virtual

Reimplemented from ChannelAPI.

Definition at line 677 of file ammod.cpp.

References SWGSDRangel::SWGChannelSettings::getAmModSettings(), SWGSDRangel::SWGAMModSettings::init(), m_settings, SWGSDRangel::SWGChannelSettings::setAmModSettings(), and webapiFormatChannelSettings().

Referenced by getStreamCenterFrequency().

680 {
681  (void) errorMessage;
683  response.getAmModSettings()->init();
685  return 200;
686 }
void webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings &response, const AMModSettings &settings)
Definition: ammod.cpp:797
void setAmModSettings(SWGAMModSettings *am_mod_settings)
AMModSettings m_settings
Definition: ammod.h:275
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ webapiSettingsPutPatch()

int AMMod::webapiSettingsPutPatch ( bool  force,
const QStringList &  channelSettingsKeys,
SWGSDRangel::SWGChannelSettings response,
QString &  errorMessage 
)
virtual

Reimplemented from ChannelAPI.

Definition at line 688 of file ammod.cpp.

References AMMod::MsgConfigureAMMod::create(), CWKeyer::MsgConfigureCWKeyer::create(), AMMod::MsgConfigureChannelizer::create(), SWGSDRangel::SWGChannelSettings::getAmModSettings(), SWGSDRangel::SWGAMModSettings::getAudioDeviceName(), SWGSDRangel::SWGAMModSettings::getChannelMute(), SWGSDRangel::SWGAMModSettings::getCwKeyer(), SWGSDRangel::SWGAMModSettings::getInputFrequencyOffset(), CWKeyer::getInputMessageQueue(), SWGSDRangel::SWGAMModSettings::getModAfInput(), SWGSDRangel::SWGAMModSettings::getModFactor(), SWGSDRangel::SWGAMModSettings::getPlayLoop(), SWGSDRangel::SWGAMModSettings::getReverseApiAddress(), SWGSDRangel::SWGAMModSettings::getReverseApiChannelIndex(), SWGSDRangel::SWGAMModSettings::getReverseApiDeviceIndex(), SWGSDRangel::SWGAMModSettings::getReverseApiPort(), SWGSDRangel::SWGAMModSettings::getRfBandwidth(), SWGSDRangel::SWGAMModSettings::getRgbColor(), CWKeyer::getSettings(), SWGSDRangel::SWGAMModSettings::getTitle(), SWGSDRangel::SWGAMModSettings::getToneFrequency(), SWGSDRangel::SWGAMModSettings::getUseReverseApi(), SWGSDRangel::SWGAMModSettings::getVolumeFactor(), AMModSettings::m_audioDeviceName, m_audioSampleRate, AMModSettings::m_channelMute, m_cwKeyer, BasebandSampleSource::m_guiMessageQueue, AMModSettings::m_inputFrequencyOffset, BasebandSampleSource::m_inputMessageQueue, AMModSettings::m_modAFInput, AMModSettings::m_modFactor, AMModSettings::m_playLoop, AMModSettings::m_reverseAPIAddress, AMModSettings::m_reverseAPIChannelIndex, AMModSettings::m_reverseAPIDeviceIndex, AMModSettings::m_reverseAPIPort, AMModSettings::m_rfBandwidth, AMModSettings::m_rgbColor, m_settings, AMModSettings::m_title, AMModSettings::m_toneFrequency, AMModSettings::m_useReverseAPI, AMModSettings::m_volumeFactor, MessageQueue::push(), webapiFormatChannelSettings(), and CWKeyer::webapiSettingsPutPatch().

Referenced by getStreamCenterFrequency().

693 {
694  (void) errorMessage;
695  AMModSettings settings = m_settings;
696  bool frequencyOffsetChanged = false;
697 
698  if (channelSettingsKeys.contains("channelMute")) {
699  settings.m_channelMute = response.getAmModSettings()->getChannelMute() != 0;
700  }
701  if (channelSettingsKeys.contains("inputFrequencyOffset"))
702  {
704  frequencyOffsetChanged = true;
705  }
706  if (channelSettingsKeys.contains("modAFInput")) {
708  }
709  if (channelSettingsKeys.contains("audioDeviceName")) {
710  settings.m_audioDeviceName = *response.getAmModSettings()->getAudioDeviceName();
711  }
712  if (channelSettingsKeys.contains("playLoop")) {
713  settings.m_playLoop = response.getAmModSettings()->getPlayLoop() != 0;
714  }
715  if (channelSettingsKeys.contains("rfBandwidth")) {
716  settings.m_rfBandwidth = response.getAmModSettings()->getRfBandwidth();
717  }
718  if (channelSettingsKeys.contains("rgbColor")) {
719  settings.m_rgbColor = response.getAmModSettings()->getRgbColor();
720  }
721  if (channelSettingsKeys.contains("title")) {
722  settings.m_title = *response.getAmModSettings()->getTitle();
723  }
724  if (channelSettingsKeys.contains("toneFrequency")) {
725  settings.m_toneFrequency = response.getAmModSettings()->getToneFrequency();
726  }
727  if (channelSettingsKeys.contains("volumeFactor")) {
728  settings.m_volumeFactor = response.getAmModSettings()->getVolumeFactor();
729  }
730  if (channelSettingsKeys.contains("modFactor")) {
731  settings.m_modFactor = response.getAmModSettings()->getModFactor();
732  }
733  if (channelSettingsKeys.contains("useReverseAPI")) {
734  settings.m_useReverseAPI = response.getAmModSettings()->getUseReverseApi() != 0;
735  }
736  if (channelSettingsKeys.contains("reverseAPIAddress")) {
738  }
739  if (channelSettingsKeys.contains("reverseAPIPort")) {
740  settings.m_reverseAPIPort = response.getAmModSettings()->getReverseApiPort();
741  }
742  if (channelSettingsKeys.contains("reverseAPIDeviceIndex")) {
744  }
745  if (channelSettingsKeys.contains("reverseAPIChannelIndex")) {
747  }
748 
749  if (channelSettingsKeys.contains("cwKeyer"))
750  {
751  SWGSDRangel::SWGCWKeyerSettings *apiCwKeyerSettings = response.getAmModSettings()->getCwKeyer();
752  CWKeyerSettings cwKeyerSettings = m_cwKeyer.getSettings();
753  m_cwKeyer.webapiSettingsPutPatch(channelSettingsKeys, cwKeyerSettings, apiCwKeyerSettings);
754 
755  CWKeyer::MsgConfigureCWKeyer *msgCwKeyer = CWKeyer::MsgConfigureCWKeyer::create(cwKeyerSettings, force);
756  m_cwKeyer.getInputMessageQueue()->push(msgCwKeyer);
757 
758  if (m_guiMessageQueue) // forward to GUI if any
759  {
760  CWKeyer::MsgConfigureCWKeyer *msgCwKeyerToGUI = CWKeyer::MsgConfigureCWKeyer::create(cwKeyerSettings, force);
761  m_guiMessageQueue->push(msgCwKeyerToGUI);
762  }
763  }
764 
765  if (frequencyOffsetChanged)
766  {
769  m_inputMessageQueue.push(msgChan);
770  }
771 
772  MsgConfigureAMMod *msg = MsgConfigureAMMod::create(settings, force);
774 
775  if (m_guiMessageQueue) // forward to GUI if any
776  {
777  MsgConfigureAMMod *msgToGUI = MsgConfigureAMMod::create(settings, force);
778  m_guiMessageQueue->push(msgToGUI);
779  }
780 
781  webapiFormatChannelSettings(response, settings);
782 
783  return 200;
784 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
uint16_t m_reverseAPIDeviceIndex
Definition: ammodsettings.h:53
static MsgConfigureCWKeyer * create(const CWKeyerSettings &settings, bool force)
Definition: cwkeyer.h:63
quint32 m_audioSampleRate
Definition: ammod.h:294
QString m_reverseAPIAddress
Definition: ammodsettings.h:51
SWGCWKeyerSettings * getCwKeyer()
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
Definition: cwkeyer.h:104
float m_volumeFactor
Definition: ammodsettings.h:40
void webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings &response, const AMModSettings &settings)
Definition: ammod.cpp:797
CWKeyer m_cwKeyer
Definition: ammod.h:316
quint32 m_rgbColor
Definition: ammodsettings.h:43
uint16_t m_reverseAPIChannelIndex
Definition: ammodsettings.h:54
QString m_title
Definition: ammodsettings.h:44
qint64 m_inputFrequencyOffset
Definition: ammodsettings.h:36
QString m_audioDeviceName
This is the audio device you get the audio samples from.
Definition: ammodsettings.h:46
static MsgConfigureChannelizer * create(int sampleRate, int centerFrequency)
Definition: ammod.h:81
static void webapiSettingsPutPatch(const QStringList &channelSettingsKeys, CWKeyerSettings &cwKeyerSettings, SWGSDRangel::SWGCWKeyerSettings *apiCwKeyerSettings)
Definition: cwkeyer.cpp:599
MessageQueue * m_guiMessageQueue
Input message queue to the GUI.
MessageQueue m_inputMessageQueue
Queue for asynchronous inbound communication.
AMModSettings m_settings
Definition: ammod.h:275
bool m_useReverseAPI
Definition: ammodsettings.h:50
float m_toneFrequency
Definition: ammodsettings.h:39
const CWKeyerSettings & getSettings() const
Definition: cwkeyer.h:107
AMModInputAF m_modAFInput
Definition: ammodsettings.h:45
static MsgConfigureAMMod * create(const AMModSettings &settings, bool force)
Definition: ammod.h:58
uint16_t m_reverseAPIPort
Definition: ammodsettings.h:52
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_audioBuffer

AudioVector AMMod::m_audioBuffer
private

Definition at line 295 of file ammod.h.

Referenced by AMMod(), pullAF(), and pullAudio().

◆ m_audioBufferFill

uint AMMod::m_audioBufferFill
private

Definition at line 296 of file ammod.h.

Referenced by AMMod(), modulateSample(), pullAF(), and pullAudio().

◆ m_audioFifo

AudioFifo AMMod::m_audioFifo
private

Definition at line 297 of file ammod.h.

Referenced by AMMod(), applySettings(), pullAudio(), start(), and ~AMMod().

◆ m_audioSampleRate

quint32 AMMod::m_audioSampleRate
private

◆ m_basebandSampleRate

int AMMod::m_basebandSampleRate
private

Definition at line 272 of file ammod.h.

Referenced by AMMod(), applyChannelSettings(), pullAudio(), and start().

◆ m_carrierNco

NCO AMMod::m_carrierNco
private

Definition at line 277 of file ammod.h.

Referenced by applyChannelSettings(), and pull().

◆ m_channelId

const QString AMMod::m_channelId ="AMMod"
static

Definition at line 250 of file ammod.h.

Referenced by AMMod(), and AMModPlugin::initPlugin().

◆ m_channelIdURI

const QString AMMod::m_channelIdURI = "sdrangel.channeltx.modam"
static

Definition at line 249 of file ammod.h.

Referenced by AMModGUI::AMModGUI(), and AMModPlugin::initPlugin().

◆ m_channelizer

UpChannelizer* AMMod::m_channelizer
private

Definition at line 270 of file ammod.h.

Referenced by AMMod(), handleMessage(), and ~AMMod().

◆ m_cwKeyer

CWKeyer AMMod::m_cwKeyer
private

◆ m_deviceAPI

DeviceAPI* AMMod::m_deviceAPI
private

Definition at line 268 of file ammod.h.

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

◆ m_feedbackAudioBuffer

AudioVector AMMod::m_feedbackAudioBuffer
private

Definition at line 300 of file ammod.h.

Referenced by AMMod(), and processOneSample().

◆ m_feedbackAudioBufferFill

uint AMMod::m_feedbackAudioBufferFill
private

Definition at line 301 of file ammod.h.

Referenced by AMMod(), and processOneSample().

◆ m_feedbackAudioFifo

AudioFifo AMMod::m_feedbackAudioFifo
private

Definition at line 302 of file ammod.h.

Referenced by AMMod(), applySettings(), processOneSample(), and ~AMMod().

◆ m_feedbackAudioSampleRate

quint32 AMMod::m_feedbackAudioSampleRate
private

Definition at line 299 of file ammod.h.

Referenced by AMMod(), applyAudioSampleRate(), applyFeedbackAudioSampleRate(), and applySettings().

◆ m_feedbackInterpolator

Interpolator AMMod::m_feedbackInterpolator
private

Definition at line 286 of file ammod.h.

Referenced by applyFeedbackAudioSampleRate(), and pushFeedback().

◆ m_feedbackInterpolatorConsumed

bool AMMod::m_feedbackInterpolatorConsumed
private

Definition at line 289 of file ammod.h.

Referenced by applyFeedbackAudioSampleRate().

◆ m_feedbackInterpolatorDistance

Real AMMod::m_feedbackInterpolatorDistance
private

Definition at line 287 of file ammod.h.

Referenced by applyFeedbackAudioSampleRate(), processOneSample(), and pushFeedback().

◆ m_feedbackInterpolatorDistanceRemain

Real AMMod::m_feedbackInterpolatorDistanceRemain
private

Definition at line 288 of file ammod.h.

Referenced by applyFeedbackAudioSampleRate(), and pushFeedback().

◆ m_fileName

QString AMMod::m_fileName
private

◆ m_fileSize

quint64 AMMod::m_fileSize
private

raw file size (bytes)

Definition at line 309 of file ammod.h.

Referenced by handleMessage(), and openFileStream().

◆ m_ifstream

std::ifstream AMMod::m_ifstream
private

Definition at line 307 of file ammod.h.

Referenced by handleMessage(), openFileStream(), pullAF(), and seekFileStream().

◆ m_inputFrequencyOffset

int AMMod::m_inputFrequencyOffset
private

Definition at line 274 of file ammod.h.

Referenced by AMMod(), applyChannelSettings(), and start().

◆ m_interpolator

Interpolator AMMod::m_interpolator
private

Definition at line 281 of file ammod.h.

Referenced by applyAudioSampleRate(), applyChannelSettings(), applySettings(), and pull().

◆ m_interpolatorConsumed

bool AMMod::m_interpolatorConsumed
private

Definition at line 284 of file ammod.h.

Referenced by applyAudioSampleRate(), applyChannelSettings(), and applySettings().

◆ m_interpolatorDistance

Real AMMod::m_interpolatorDistance
private

Definition at line 282 of file ammod.h.

Referenced by applyAudioSampleRate(), applyChannelSettings(), applySettings(), and pull().

◆ m_interpolatorDistanceRemain

Real AMMod::m_interpolatorDistanceRemain
private

Definition at line 283 of file ammod.h.

Referenced by applyAudioSampleRate(), applyChannelSettings(), applySettings(), and pull().

◆ m_levelCalcCount

quint32 AMMod::m_levelCalcCount
private

Definition at line 313 of file ammod.h.

Referenced by calculateLevel().

◆ m_levelNbSamples

const int AMMod::m_levelNbSamples = 480
staticprivate

Definition at line 318 of file ammod.h.

Referenced by calculateLevel().

◆ m_levelSum

Real AMMod::m_levelSum
private

Definition at line 315 of file ammod.h.

Referenced by calculateLevel().

◆ m_magsq

double AMMod::m_magsq
private

Definition at line 291 of file ammod.h.

Referenced by AMMod(), getMagSq(), and pull().

◆ m_modSample

Complex AMMod::m_modSample
private

Definition at line 279 of file ammod.h.

Referenced by modulateSample(), and pull().

◆ m_movingAverage

MovingAverageUtil<double, double, 16> AMMod::m_movingAverage
private

Definition at line 292 of file ammod.h.

Referenced by pull().

◆ m_networkManager

QNetworkAccessManager* AMMod::m_networkManager
private

Definition at line 320 of file ammod.h.

Referenced by AMMod(), webapiReverseSendCWSettings(), webapiReverseSendSettings(), and ~AMMod().

◆ m_networkRequest

QNetworkRequest AMMod::m_networkRequest
private

Definition at line 321 of file ammod.h.

Referenced by webapiReverseSendCWSettings(), and webapiReverseSendSettings().

◆ m_outputSampleRate

int AMMod::m_outputSampleRate
private

◆ m_peakLevel

Real AMMod::m_peakLevel
private

Definition at line 314 of file ammod.h.

Referenced by calculateLevel().

◆ m_recordLength

quint32 AMMod::m_recordLength
private

record length in seconds computed from file size

Definition at line 310 of file ammod.h.

Referenced by AMMod::MsgReportFileSourceStreamData::getRecordLength(), openFileStream(), and seekFileStream().

◆ m_sampleBuffer

SampleVector AMMod::m_sampleBuffer
private

Definition at line 304 of file ammod.h.

◆ m_sampleRate

int AMMod::m_sampleRate
private

◆ m_settings

AMModSettings AMMod::m_settings
private

◆ m_settingsMutex

QMutex AMMod::m_settingsMutex
private

◆ m_threadedChannelizer

ThreadedBasebandSampleSource* AMMod::m_threadedChannelizer
private

Definition at line 269 of file ammod.h.

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

◆ m_toneNco

NCOF AMMod::m_toneNco
private

Definition at line 278 of file ammod.h.

Referenced by AMMod(), applyAudioSampleRate(), applySettings(), and pullAF().


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