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 Slots | Private Member Functions | Private Attributes | List of all members
LocalSource Class Reference

#include <localsource.h>

+ Inheritance diagram for LocalSource:
+ Collaboration diagram for LocalSource:

Classes

class  MsgConfigureChannelizer
 
class  MsgConfigureLocalSource
 
class  MsgSampleRateNotification
 

Signals

void pullSamples (unsigned int count)
 

Public Member Functions

 LocalSource (DeviceAPI *deviceAPI)
 
virtual ~LocalSource ()
 
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)
 
void setCenterFrequency (uint64_t centerFrequency)
 
void setSampleRate (uint32_t sampleRate)
 
void setChannelizer (unsigned int log2Interp, unsigned int filterChainHash)
 
void getLocalDevices (std::vector< uint32_t > &indexes)
 
- 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
 
virtual int webapiReportGet (SWGSDRangel::SWGChannelReport &response, QString &errorMessage)
 
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.channel.localsource"
 
static const QString m_channelId = "LocalSource"
 

Private Slots

void networkManagerFinished (QNetworkReply *reply)
 
void processSamples (int offset)
 

Private Member Functions

void applySettings (const LocalSourceSettings &settings, bool force=false)
 
DeviceSampleSinkgetLocalDevice (uint32_t index)
 
void propagateSampleRateAndFrequency (uint32_t index)
 
void validateFilterChainHash (LocalSourceSettings &settings)
 
void calculateFrequencyOffset ()
 
void webapiFormatChannelSettings (SWGSDRangel::SWGChannelSettings &response, const LocalSourceSettings &settings)
 
void webapiReverseSendSettings (QList< QString > &channelSettingsKeys, const LocalSourceSettings &settings, bool force)
 

Private Attributes

DeviceAPIm_deviceAPI
 
ThreadedBasebandSampleSourcem_threadedChannelizer
 
UpChannelizerm_channelizer
 
bool m_running
 
LocalSourceSettings m_settings
 
LocalSourceThreadm_sinkThread
 
SampleSourceFifom_localSampleSourceFifo
 
int m_chunkSize
 
SampleVector m_localSamples
 
int m_localSamplesIndex
 
int m_localSamplesIndexOffset
 
uint64_t m_centerFrequency
 
int64_t m_frequencyOffset
 
uint32_t m_sampleRate
 
uint32_t m_deviceSampleRate
 
QNetworkAccessManager * m_networkManager
 
QNetworkRequest m_networkRequest
 
QMutex m_settingsMutex
 

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

Constructor & Destructor Documentation

◆ LocalSource()

LocalSource::LocalSource ( DeviceAPI deviceAPI)

Definition at line 48 of file localsource.cpp.

References DeviceAPI::addChannelSource(), DeviceAPI::addChannelSourceAPI(), m_channelId, m_channelizer, m_deviceAPI, m_networkManager, m_threadedChannelizer, and networkManagerFinished().

Referenced by LocalSource::MsgConfigureChannelizer::MsgConfigureChannelizer().

48  :
50  m_deviceAPI(deviceAPI),
51  m_running(false),
52  m_sinkThread(nullptr),
53  m_localSampleSourceFifo(nullptr),
54  m_chunkSize(0),
59  m_sampleRate(48000),
60  m_deviceSampleRate(48000),
61  m_settingsMutex(QMutex::Recursive)
62 {
63  setObjectName(m_channelId);
64 
65  m_channelizer = new UpChannelizer(this);
69 
70  m_networkManager = new QNetworkAccessManager();
71  connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
72 }
static const QString m_channelId
Definition: localsource.h:153
ThreadedBasebandSampleSource * m_threadedChannelizer
Definition: localsource.h:160
SampleSourceFifo * m_localSampleSourceFifo
Definition: localsource.h:166
uint64_t m_centerFrequency
Definition: localsource.h:172
void networkManagerFinished(QNetworkReply *reply)
QNetworkAccessManager * m_networkManager
Definition: localsource.h:177
static const QString m_channelIdURI
Definition: localsource.h:152
Exposes a single source stream (output, Tx)
Definition: channelapi.h:42
int m_localSamplesIndex
Definition: localsource.h:169
void addChannelSource(ThreadedBasebandSampleSource *sink, int streamIndex=0)
Add a channel source (Tx)
Definition: deviceapi.cpp:138
int64_t m_frequencyOffset
Definition: localsource.h:173
uint32_t m_deviceSampleRate
Definition: localsource.h:175
ChannelAPI(const QString &name, StreamType streamType)
Definition: channelapi.cpp:23
UpChannelizer * m_channelizer
Definition: localsource.h:161
DeviceAPI * m_deviceAPI
Definition: localsource.h:159
QMutex m_settingsMutex
Definition: localsource.h:180
bool m_running
Definition: localsource.h:162
LocalSourceThread * m_sinkThread
Definition: localsource.h:165
int m_localSamplesIndexOffset
Definition: localsource.h:170
void addChannelSourceAPI(ChannelAPI *channelAPI, int streamIndex=0)
Definition: deviceapi.cpp:174
uint32_t m_sampleRate
Definition: localsource.h:174
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ~LocalSource()

LocalSource::~LocalSource ( )
virtual

Definition at line 74 of file localsource.cpp.

References m_channelizer, m_deviceAPI, m_networkManager, m_threadedChannelizer, networkManagerFinished(), DeviceAPI::removeChannelSource(), and DeviceAPI::removeChannelSourceAPI().

Referenced by LocalSource::MsgConfigureChannelizer::MsgConfigureChannelizer().

75 {
76  disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*)));
77  delete m_networkManager;
80  delete m_threadedChannelizer;
81  delete m_channelizer;
82 }
ThreadedBasebandSampleSource * m_threadedChannelizer
Definition: localsource.h:160
void removeChannelSourceAPI(ChannelAPI *channelAPI, int streamIndex=0)
Definition: deviceapi.cpp:181
void networkManagerFinished(QNetworkReply *reply)
void removeChannelSource(ThreadedBasebandSampleSource *sink, int streamIndex=0)
Remove a channel source (Tx)
Definition: deviceapi.cpp:147
QNetworkAccessManager * m_networkManager
Definition: localsource.h:177
UpChannelizer * m_channelizer
Definition: localsource.h:161
DeviceAPI * m_deviceAPI
Definition: localsource.h:159
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Function Documentation

◆ applySettings()

void LocalSource::applySettings ( const LocalSourceSettings settings,
bool  force = false 
)
private

Definition at line 354 of file localsource.cpp.

References getLocalDevice(), DeviceSampleSink::getSampleFifo(), LocalSourceSettings::m_localDeviceIndex, LocalSourceSettings::m_reverseAPIAddress, LocalSourceSettings::m_reverseAPIChannelIndex, LocalSourceSettings::m_reverseAPIDeviceIndex, LocalSourceSettings::m_reverseAPIPort, m_settings, m_sinkThread, LocalSourceSettings::m_useReverseAPI, propagateSampleRateAndFrequency(), LocalSourceThread::setSampleFifo(), and webapiReverseSendSettings().

Referenced by handleMessage().

355 {
356  qDebug() << "LocalSource::applySettings:"
357  << " m_localDeviceIndex: " << settings.m_localDeviceIndex
358  << " force: " << force;
359 
360  QList<QString> reverseAPIKeys;
361 
362  if ((settings.m_localDeviceIndex != m_settings.m_localDeviceIndex) || force)
363  {
364  reverseAPIKeys.append("localDeviceIndex");
365  DeviceSampleSink *deviceSink = getLocalDevice(settings.m_localDeviceIndex);
366 
367  if (deviceSink)
368  {
369  if (m_sinkThread) {
370  m_sinkThread->setSampleFifo(deviceSink->getSampleFifo());
371  }
372 
374  }
375  else
376  {
377  qWarning("LocalSource::applySettings: invalid local device for index %u", settings.m_localDeviceIndex);
378  }
379  }
380 
381  if ((settings.m_useReverseAPI) && (reverseAPIKeys.size() != 0))
382  {
383  bool fullUpdate = ((m_settings.m_useReverseAPI != settings.m_useReverseAPI) && settings.m_useReverseAPI) ||
388  webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force);
389  }
390 
391  m_settings = settings;
392 }
void setSampleFifo(SampleSourceFifo *sampleFifo)
SampleSourceFifo * getSampleFifo()
DeviceSampleSink * getLocalDevice(uint32_t index)
void propagateSampleRateAndFrequency(uint32_t index)
LocalSourceThread * m_sinkThread
Definition: localsource.h:165
void webapiReverseSendSettings(QList< QString > &channelSettingsKeys, const LocalSourceSettings &settings, bool force)
LocalSourceSettings m_settings
Definition: localsource.h:164
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ calculateFrequencyOffset()

void LocalSource::calculateFrequencyOffset ( )
private

Definition at line 405 of file localsource.cpp.

References HBFilterChainConverter::getShiftFactor(), m_deviceSampleRate, LocalSourceSettings::m_filterChainHash, m_frequencyOffset, LocalSourceSettings::m_log2Interp, and m_settings.

Referenced by handleMessage().

406 {
408  m_frequencyOffset = m_deviceSampleRate * shiftFactor;
409 }
int64_t m_frequencyOffset
Definition: localsource.h:173
uint32_t m_deviceSampleRate
Definition: localsource.h:175
static double getShiftFactor(unsigned int log2, unsigned int chainHash)
LocalSourceSettings m_settings
Definition: localsource.h:164
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deserialize()

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

Implements ChannelAPI.

Definition at line 277 of file localsource.cpp.

References LocalSource::MsgConfigureLocalSource::create(), LocalSourceSettings::deserialize(), BasebandSampleSource::m_inputMessageQueue, m_settings, MessageQueue::push(), and LocalSourceSettings::resetToDefaults().

Referenced by getCenterFrequency().

278 {
279  (void) data;
280  if (m_settings.deserialize(data))
281  {
282  MsgConfigureLocalSource *msg = MsgConfigureLocalSource::create(m_settings, true);
284  return true;
285  }
286  else
287  {
289  MsgConfigureLocalSource *msg = MsgConfigureLocalSource::create(m_settings, true);
291  return false;
292  }
293 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
static MsgConfigureLocalSource * create(const LocalSourceSettings &settings, bool force)
Definition: localsource.h:48
bool deserialize(const QByteArray &data)
MessageQueue m_inputMessageQueue
Queue for asynchronous inbound communication.
LocalSourceSettings m_settings
Definition: localsource.h:164
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ destroy()

virtual void LocalSource::destroy ( )
inlinevirtual

Implements ChannelAPI.

Definition at line 108 of file localsource.h.

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

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

◆ getCenterFrequency()

virtual qint64 LocalSource::getCenterFrequency ( ) const
inlinevirtual

Applies to a default stream.

Implements ChannelAPI.

Definition at line 118 of file localsource.h.

References deserialize(), m_frequencyOffset, and serialize().

118 { return m_frequencyOffset; }
int64_t m_frequencyOffset
Definition: localsource.h:173
+ Here is the call graph for this function:

◆ getIdentifier()

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

Implements ChannelAPI.

Definition at line 116 of file localsource.h.

116 { id = objectName(); }

◆ getLocalDevice()

DeviceSampleSink * LocalSource::getLocalDevice ( uint32_t  index)
private

Definition at line 311 of file localsource.cpp.

References ChannelAPI::getDeviceAPI(), DeviceSampleSink::getDeviceDescription(), DSPEngine::getDeviceSinkEngineByIndex(), DSPDeviceSinkEngine::getSink(), DSPDeviceSinkEngine::getUID(), and DSPEngine::instance().

Referenced by applySettings(), propagateSampleRateAndFrequency(), and start().

312 {
313  DSPEngine *dspEngine = DSPEngine::instance();
314 
315  if (index < dspEngine->getDeviceSinkEnginesNumber())
316  {
317  DSPDeviceSinkEngine *deviceSinkEngine = dspEngine->getDeviceSinkEngineByIndex(index);
318  DeviceSampleSink *deviceSink = deviceSinkEngine->getSink();
319 
320  if (deviceSink->getDeviceDescription() == "LocalOutput")
321  {
322  if (!getDeviceAPI()) {
323  qDebug("LocalSource::getLocalDevice: the parent device is unset");
324  } else if (getDeviceAPI()->getDeviceUID() == deviceSinkEngine->getUID()) {
325  qDebug("LocalSource::getLocalDevice: sink device at index %u is the parent device", index);
326  } else {
327  return deviceSink;
328  }
329  }
330  else
331  {
332  qDebug("LocalSource::getLocalDevice: sink device at index %u is not a Local Output source", index);
333  }
334  }
335  else
336  {
337  qDebug("LocalSource::getLocalDevice: non existent sink device index: %u", index);
338  }
339 
340  return nullptr;
341 }
DeviceSampleSink * getSink()
static DSPEngine * instance()
Definition: dspengine.cpp:51
uint32_t getUID() const
DeviceAPI * getDeviceAPI()
Definition: channelapi.h:91
DSPDeviceSinkEngine * getDeviceSinkEngineByIndex(uint deviceIndex)
Definition: dspengine.h:63
virtual const QString & getDeviceDescription() const =0
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLocalDevices()

void LocalSource::getLocalDevices ( std::vector< uint32_t > &  indexes)

Definition at line 295 of file localsource.cpp.

References DeviceSampleSink::getDeviceDescription(), DSPEngine::getDeviceSinkEngineByIndex(), DSPEngine::getDeviceSinkEnginesNumber(), DSPDeviceSinkEngine::getSink(), i, and DSPEngine::instance().

Referenced by setSampleRate(), and LocalSourceGUI::updateLocalDevices().

296 {
297  indexes.clear();
298  DSPEngine *dspEngine = DSPEngine::instance();
299 
300  for (uint32_t i = 0; i < dspEngine->getDeviceSinkEnginesNumber(); i++)
301  {
302  DSPDeviceSinkEngine *deviceSinkEngine = dspEngine->getDeviceSinkEngineByIndex(i);
303  DeviceSampleSink *deviceSink = deviceSinkEngine->getSink();
304 
305  if (deviceSink->getDeviceDescription() == "LocalOutput") {
306  indexes.push_back(i);
307  }
308  }
309 }
DeviceSampleSink * getSink()
unsigned int uint32_t
Definition: rtptypes_win.h:46
static DSPEngine * instance()
Definition: dspengine.cpp:51
uint32_t getDeviceSinkEnginesNumber() const
Definition: dspengine.h:62
int32_t i
Definition: decimators.h:244
DSPDeviceSinkEngine * getDeviceSinkEngineByIndex(uint deviceIndex)
Definition: dspengine.h:63
virtual const QString & getDeviceDescription() const =0
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNbSinkStreams()

virtual int LocalSource::getNbSinkStreams ( ) const
inlinevirtual

Implements ChannelAPI.

Definition at line 123 of file localsource.h.

123 { return 0; }

◆ getNbSourceStreams()

virtual int LocalSource::getNbSourceStreams ( ) const
inlinevirtual

Implements ChannelAPI.

Definition at line 124 of file localsource.h.

124 { return 1; }

◆ getStreamCenterFrequency()

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

Implements ChannelAPI.

Definition at line 126 of file localsource.h.

References m_frequencyOffset, webapiSettingsGet(), and webapiSettingsPutPatch().

127  {
128  (void) streamIndex;
129  (void) sinkElseSource;
130  return m_frequencyOffset;
131  }
int64_t m_frequencyOffset
Definition: localsource.h:173
+ Here is the call graph for this function:

◆ getTitle()

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

Implements ChannelAPI.

Definition at line 117 of file localsource.h.

117 { title = "Local Sink"; }

◆ handleMessage()

bool LocalSource::handleMessage ( const Message cmd)
virtual

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

Implements BasebandSampleSource.

Definition at line 185 of file localsource.cpp.

References applySettings(), calculateFrequencyOffset(), LocalSource::MsgSampleRateNotification::create(), DSPSignalNotification::getCenterFrequency(), LocalSource::MsgConfigureChannelizer::getFilterChainHash(), LocalSource::MsgConfigureLocalSource::getForce(), UpChannelizer::MsgChannelizerNotification::getFrequencyOffset(), BasebandSampleSource::getInputMessageQueue(), LocalSource::MsgConfigureChannelizer::getLog2Interp(), UpChannelizer::MsgChannelizerNotification::getSampleRate(), DSPSignalNotification::getSampleRate(), LocalSource::MsgConfigureLocalSource::getSettings(), m_channelizer, m_chunkSize, m_deviceSampleRate, LocalSourceSettings::m_filterChainHash, BasebandSampleSource::m_guiMessageQueue, LocalSourceSettings::m_localDeviceIndex, m_localSamples, m_localSamplesIndex, m_localSamplesIndexOffset, m_localSampleSourceFifo, LocalSourceSettings::m_log2Interp, m_settings, m_settingsMutex, Message::match(), propagateSampleRateAndFrequency(), MessageQueue::push(), SampleSourceFifo::resize(), UpChannelizer::set(), setCenterFrequency(), and setSampleRate().

Referenced by destroy().

186 {
188  {
190  int sampleRate = notif.getSampleRate();
191 
192  qDebug() << "LocalSource::handleMessage: MsgChannelizerNotification:"
193  << " channelSampleRate: " << sampleRate
194  << " offsetFrequency: " << notif.getFrequencyOffset();
195 
196  if (sampleRate > 0)
197  {
199  {
200  QMutexLocker mutexLocker(&m_settingsMutex);
201  m_localSampleSourceFifo->resize(sampleRate);
202  m_chunkSize = sampleRate / 8;
205  m_localSamples.resize(2*m_chunkSize);
206  }
207 
208  setSampleRate(sampleRate);
209  }
210 
211  return true;
212  }
213  else if (DSPSignalNotification::match(cmd))
214  {
216 
217  qDebug() << "LocalSource::handleMessage: DSPSignalNotification:"
218  << " inputSampleRate: " << notif.getSampleRate()
219  << " centerFrequency: " << notif.getCenterFrequency();
220 
223  calculateFrequencyOffset(); // This is when device sample rate changes
225 
226  // Redo the channelizer stuff with the new sample rate to re-synchronize everything
230 
231  if (m_guiMessageQueue)
232  {
233  MsgSampleRateNotification *msg = MsgSampleRateNotification::create(notif.getSampleRate());
234  m_guiMessageQueue->push(msg);
235  }
236 
237  return true;
238  }
239  else if (MsgConfigureLocalSource::match(cmd))
240  {
241  MsgConfigureLocalSource& cfg = (MsgConfigureLocalSource&) cmd;
242  qDebug() << "LocalSource::handleMessage: MsgConfigureLocalSink";
243  applySettings(cfg.getSettings(), cfg.getForce());
244 
245  return true;
246  }
247  else if (MsgConfigureChannelizer::match(cmd))
248  {
249  MsgConfigureChannelizer& cfg = (MsgConfigureChannelizer&) cmd;
250  m_settings.m_log2Interp = cfg.getLog2Interp();
251  m_settings.m_filterChainHash = cfg.getFilterChainHash();
252 
253  qDebug() << "LocalSource::handleMessage: MsgConfigureChannelizer:"
254  << " log2Interp: " << m_settings.m_log2Interp
255  << " filterChainHash: " << m_settings.m_filterChainHash;
256 
260 
261  calculateFrequencyOffset(); // This is when decimation or filter chain changes
263 
264  return true;
265  }
266  else
267  {
268  return false;
269  }
270 }
void push(Message *message, bool emitSignal=true)
Push message onto queue.
SampleSourceFifo * m_localSampleSourceFifo
Definition: localsource.h:166
void setSampleRate(uint32_t sampleRate)
Definition: localsource.h:147
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
int m_localSamplesIndex
Definition: localsource.h:169
void calculateFrequencyOffset()
static MsgSampleRateNotification * create(int sampleRate)
Definition: localsource.h:68
void set(MessageQueue *messageQueue, unsigned int log2Interp, unsigned int filterChainHash)
qint64 getCenterFrequency() const
Definition: dspcommands.h:329
uint32_t m_deviceSampleRate
Definition: localsource.h:175
static bool match(const Message *message)
Definition: message.cpp:45
UpChannelizer * m_channelizer
Definition: localsource.h:161
QMutex m_settingsMutex
Definition: localsource.h:180
void resize(uint32_t size)
void propagateSampleRateAndFrequency(uint32_t index)
void setCenterFrequency(uint64_t centerFrequency)
Definition: localsource.h:144
void applySettings(const LocalSourceSettings &settings, bool force=false)
MessageQueue * m_guiMessageQueue
Input message queue to the GUI.
int getSampleRate() const
Definition: dspcommands.h:328
int m_localSamplesIndexOffset
Definition: localsource.h:170
SampleVector m_localSamples
Definition: localsource.h:168
LocalSourceSettings m_settings
Definition: localsource.h:164
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ networkManagerFinished

void LocalSource::networkManagerFinished ( QNetworkReply *  reply)
privateslot

Definition at line 560 of file localsource.cpp.

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

561 {
562  QNetworkReply::NetworkError replyError = reply->error();
563 
564  if (replyError)
565  {
566  qWarning() << "LocalSource::networkManagerFinished:"
567  << " error(" << (int) replyError
568  << "): " << replyError
569  << ": " << reply->errorString();
570  return;
571  }
572 
573  QString answer = reply->readAll();
574  answer.chop(1); // remove last \n
575  qDebug("LocalSource::networkManagerFinished: reply:\n%s", answer.toStdString().c_str());
576 }
+ Here is the caller graph for this function:

◆ processSamples

void LocalSource::processSamples ( int  offset)
privateslot

Definition at line 114 of file localsource.cpp.

References m_chunkSize, m_localSamples, m_localSamplesIndexOffset, m_localSampleSourceFifo, and SampleSourceFifo::setIteratorFromOffset().

Referenced by start().

115 {
117  {
118  int destOffset = (m_localSamplesIndexOffset == 0 ? m_chunkSize : 0);
119  SampleVector::iterator beginSource;
120  SampleVector::iterator beginDestination = m_localSamples.begin() + destOffset;
121  m_localSampleSourceFifo->setIteratorFromOffset(beginSource, offset);
122  std::copy(beginSource, beginSource + m_chunkSize, beginDestination);
123  }
124 }
SampleSourceFifo * m_localSampleSourceFifo
Definition: localsource.h:166
void setIteratorFromOffset(SampleVector::iterator &iterator, int offset)
int m_localSamplesIndexOffset
Definition: localsource.h:170
SampleVector m_localSamples
Definition: localsource.h:168
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ propagateSampleRateAndFrequency()

void LocalSource::propagateSampleRateAndFrequency ( uint32_t  index)
private

Definition at line 343 of file localsource.cpp.

References getLocalDevice(), m_centerFrequency, m_deviceSampleRate, m_frequencyOffset, LocalSourceSettings::m_log2Interp, m_settings, DeviceSampleSink::setCenterFrequency(), and DeviceSampleSink::setSampleRate().

Referenced by applySettings(), and handleMessage().

344 {
345  DeviceSampleSink *deviceSink = getLocalDevice(index);
346 
347  if (deviceSink)
348  {
351  }
352 }
uint64_t m_centerFrequency
Definition: localsource.h:172
virtual void setCenterFrequency(qint64 centerFrequency)=0
int64_t m_frequencyOffset
Definition: localsource.h:173
uint32_t m_deviceSampleRate
Definition: localsource.h:175
DeviceSampleSink * getLocalDevice(uint32_t index)
virtual void setSampleRate(int sampleRate)=0
For when the sink sample rate is set externally.
LocalSourceSettings m_settings
Definition: localsource.h:164
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pull()

void LocalSource::pull ( Sample sample)
virtual

Implements BasebandSampleSource.

Definition at line 84 of file localsource.cpp.

References m_chunkSize, m_localSamples, m_localSamplesIndex, m_localSamplesIndexOffset, m_localSampleSourceFifo, m_settingsMutex, and pullSamples().

Referenced by destroy().

85 {
87  {
88  QMutexLocker mutexLocker(&m_settingsMutex);
90 
92  {
94  }
95  else
96  {
98 
99  if (m_localSamplesIndexOffset == 0) {
101  } else {
103  }
104 
105  emit pullSamples(m_chunkSize);
106  }
107  }
108  else
109  {
110  sample = Sample{0, 0};
111  }
112 }
void pullSamples(unsigned int count)
SampleSourceFifo * m_localSampleSourceFifo
Definition: localsource.h:166
int m_localSamplesIndex
Definition: localsource.h:169
QMutex m_settingsMutex
Definition: localsource.h:180
int m_localSamplesIndexOffset
Definition: localsource.h:170
SampleVector m_localSamples
Definition: localsource.h:168
+ Here is the caller graph for this function:

◆ pullAudio()

void LocalSource::pullAudio ( int  nbSamples)
virtual

Reimplemented from BasebandSampleSource.

Definition at line 126 of file localsource.cpp.

Referenced by destroy().

127 {
128  (void) nbSamples;
129 }
+ Here is the caller graph for this function:

◆ pullSamples

void LocalSource::pullSamples ( unsigned int  count)
signal

Referenced by pull(), and start().

+ Here is the caller graph for this function:

◆ serialize()

QByteArray LocalSource::serialize ( ) const
virtual

Implements ChannelAPI.

Definition at line 272 of file localsource.cpp.

References m_settings, and LocalSourceSettings::serialize().

Referenced by getCenterFrequency().

273 {
274  return m_settings.serialize();
275 }
QByteArray serialize() const
LocalSourceSettings m_settings
Definition: localsource.h:164
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setCenterFrequency()

void LocalSource::setCenterFrequency ( uint64_t  centerFrequency)
inline

Set center frequency given in Hz

Definition at line 144 of file localsource.h.

References m_centerFrequency.

Referenced by handleMessage().

144 { m_centerFrequency = centerFrequency; }
uint64_t m_centerFrequency
Definition: localsource.h:172
+ Here is the caller graph for this function:

◆ setChannelizer()

void LocalSource::setChannelizer ( unsigned int  log2Interp,
unsigned int  filterChainHash 
)

Referenced by setSampleRate().

+ Here is the caller graph for this function:

◆ setSampleRate()

void LocalSource::setSampleRate ( uint32_t  sampleRate)
inline

Set sample rate given in Hz

Definition at line 147 of file localsource.h.

References getLocalDevices(), m_sampleRate, and setChannelizer().

Referenced by handleMessage().

147 { m_sampleRate = sampleRate; }
uint32_t m_sampleRate
Definition: localsource.h:174
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ start()

void LocalSource::start ( )
virtual

Implements BasebandSampleSource.

Definition at line 131 of file localsource.cpp.

References getLocalDevice(), DeviceSampleSink::getSampleFifo(), m_chunkSize, LocalSourceSettings::m_localDeviceIndex, m_localSamples, m_localSamplesIndex, m_localSampleSourceFifo, m_running, m_settings, m_sinkThread, processSamples(), pullSamples(), LocalSourceThread::setSampleFifo(), SampleSourceFifo::size(), LocalSourceThread::startStop(), and stop().

Referenced by destroy().

132 {
133  qDebug("LocalSource::start");
134 
135  if (m_running) {
136  stop();
137  }
138 
141 
142  if (deviceSink)
143  {
144  m_localSampleSourceFifo = deviceSink->getSampleFifo();
146  m_localSamples.resize(2*m_chunkSize);
149  }
150  else
151  {
152  m_localSampleSourceFifo = nullptr;
153  }
154 
155  connect(this,
156  SIGNAL(pullSamples(unsigned int)),
157  m_sinkThread,
158  SLOT(pullSamples(unsigned int)),
159  Qt::QueuedConnection);
160 
161  connect(m_sinkThread,
162  SIGNAL(samplesAvailable(int)),
163  this,
164  SLOT(processSamples(int)),
165  Qt::QueuedConnection);
166 
167  m_sinkThread->startStop(true);
168  m_running = true;
169 }
uint32_t size() const
void pullSamples(unsigned int count)
void processSamples(int offset)
SampleSourceFifo * m_localSampleSourceFifo
Definition: localsource.h:166
int m_localSamplesIndex
Definition: localsource.h:169
void startStop(bool start)
void setSampleFifo(SampleSourceFifo *sampleFifo)
SampleSourceFifo * getSampleFifo()
DeviceSampleSink * getLocalDevice(uint32_t index)
bool m_running
Definition: localsource.h:162
LocalSourceThread * m_sinkThread
Definition: localsource.h:165
virtual void stop()
SampleVector m_localSamples
Definition: localsource.h:168
LocalSourceSettings m_settings
Definition: localsource.h:164
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ stop()

void LocalSource::stop ( )
virtual

Implements BasebandSampleSource.

Definition at line 171 of file localsource.cpp.

References m_running, m_sinkThread, and LocalSourceThread::startStop().

Referenced by destroy(), and start().

172 {
173  qDebug("LocalSource::stop");
174 
175  if (m_sinkThread != 0)
176  {
177  m_sinkThread->startStop(false);
178  m_sinkThread->deleteLater();
179  m_sinkThread = 0;
180  }
181 
182  m_running = false;
183 }
void startStop(bool start)
bool m_running
Definition: localsource.h:162
LocalSourceThread * m_sinkThread
Definition: localsource.h:165
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ validateFilterChainHash()

void LocalSource::validateFilterChainHash ( LocalSourceSettings settings)
private

Definition at line 394 of file localsource.cpp.

References i, LocalSourceSettings::m_filterChainHash, and LocalSourceSettings::m_log2Interp.

Referenced by webapiSettingsPutPatch().

395 {
396  unsigned int s = 1;
397 
398  for (unsigned int i = 0; i < settings.m_log2Interp; i++) {
399  s *= 3;
400  }
401 
402  settings.m_filterChainHash = settings.m_filterChainHash >= s ? s-1 : settings.m_filterChainHash;
403 }
int32_t i
Definition: decimators.h:244
+ Here is the caller graph for this function:

◆ webapiFormatChannelSettings()

void LocalSource::webapiFormatChannelSettings ( SWGSDRangel::SWGChannelSettings response,
const LocalSourceSettings settings 
)
private

Definition at line 487 of file localsource.cpp.

References SWGSDRangel::SWGChannelSettings::getLocalSourceSettings(), SWGSDRangel::SWGLocalSourceSettings::getReverseApiAddress(), SWGSDRangel::SWGLocalSourceSettings::getTitle(), LocalSourceSettings::m_filterChainHash, LocalSourceSettings::m_localDeviceIndex, LocalSourceSettings::m_log2Interp, LocalSourceSettings::m_reverseAPIAddress, LocalSourceSettings::m_reverseAPIChannelIndex, LocalSourceSettings::m_reverseAPIDeviceIndex, LocalSourceSettings::m_reverseAPIPort, LocalSourceSettings::m_rgbColor, LocalSourceSettings::m_title, LocalSourceSettings::m_useReverseAPI, SWGSDRangel::SWGLocalSourceSettings::setFilterChainHash(), SWGSDRangel::SWGLocalSourceSettings::setLocalDeviceIndex(), SWGSDRangel::SWGLocalSourceSettings::setLog2Interp(), SWGSDRangel::SWGLocalSourceSettings::setReverseApiAddress(), SWGSDRangel::SWGLocalSourceSettings::setReverseApiChannelIndex(), SWGSDRangel::SWGLocalSourceSettings::setReverseApiDeviceIndex(), SWGSDRangel::SWGLocalSourceSettings::setReverseApiPort(), SWGSDRangel::SWGLocalSourceSettings::setRgbColor(), SWGSDRangel::SWGLocalSourceSettings::setTitle(), and SWGSDRangel::SWGLocalSourceSettings::setUseReverseApi().

Referenced by webapiSettingsGet(), and webapiSettingsPutPatch().

488 {
490  response.getLocalSourceSettings()->setRgbColor(settings.m_rgbColor);
491 
492  if (response.getLocalSourceSettings()->getTitle()) {
493  *response.getLocalSourceSettings()->getTitle() = settings.m_title;
494  } else {
495  response.getLocalSourceSettings()->setTitle(new QString(settings.m_title));
496  }
497 
498  response.getLocalSourceSettings()->setLog2Interp(settings.m_log2Interp);
500  response.getLocalSourceSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0);
501 
502  if (response.getLocalSourceSettings()->getReverseApiAddress()) {
504  } else {
505  response.getLocalSourceSettings()->setReverseApiAddress(new QString(settings.m_reverseAPIAddress));
506  }
507 
511 }
SWGLocalSourceSettings * getLocalSourceSettings()
void setReverseApiChannelIndex(qint32 reverse_api_channel_index)
void setLocalDeviceIndex(qint32 local_device_index)
void setUseReverseApi(qint32 use_reverse_api)
void setReverseApiDeviceIndex(qint32 reverse_api_device_index)
void setReverseApiPort(qint32 reverse_api_port)
void setReverseApiAddress(QString *reverse_api_address)
void setFilterChainHash(qint32 filter_chain_hash)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ webapiReverseSendSettings()

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

Definition at line 513 of file localsource.cpp.

References SWGSDRangel::SWGChannelSettings::asJson(), ChannelAPI::getDeviceSetIndex(), ChannelAPI::getIndexInDeviceSet(), SWGSDRangel::SWGChannelSettings::getLocalSourceSettings(), LocalSourceSettings::m_filterChainHash, LocalSourceSettings::m_localDeviceIndex, LocalSourceSettings::m_log2Interp, m_networkManager, m_networkRequest, LocalSourceSettings::m_reverseAPIAddress, LocalSourceSettings::m_reverseAPIChannelIndex, LocalSourceSettings::m_reverseAPIDeviceIndex, LocalSourceSettings::m_reverseAPIPort, LocalSourceSettings::m_rgbColor, LocalSourceSettings::m_title, SWGSDRangel::SWGChannelSettings::setChannelType(), SWGSDRangel::SWGChannelSettings::setDirection(), SWGSDRangel::SWGLocalSourceSettings::setFilterChainHash(), SWGSDRangel::SWGLocalSourceSettings::setLocalDeviceIndex(), SWGSDRangel::SWGChannelSettings::setLocalSourceSettings(), SWGSDRangel::SWGLocalSourceSettings::setLog2Interp(), SWGSDRangel::SWGChannelSettings::setOriginatorChannelIndex(), SWGSDRangel::SWGChannelSettings::setOriginatorDeviceSetIndex(), SWGSDRangel::SWGLocalSourceSettings::setRgbColor(), and SWGSDRangel::SWGLocalSourceSettings::setTitle().

Referenced by applySettings().

514 {
516  swgChannelSettings->setDirection(1); // single source (Tx)
517  swgChannelSettings->setOriginatorChannelIndex(getIndexInDeviceSet());
518  swgChannelSettings->setOriginatorDeviceSetIndex(getDeviceSetIndex());
519  swgChannelSettings->setChannelType(new QString("LocalSource"));
521  SWGSDRangel::SWGLocalSourceSettings *swgLocalSourceSettings = swgChannelSettings->getLocalSourceSettings();
522 
523  // transfer data that has been modified. When force is on transfer all data except reverse API data
524 
525  if (channelSettingsKeys.contains("localDeviceIndex") || force) {
526  swgLocalSourceSettings->setLocalDeviceIndex(settings.m_localDeviceIndex);
527  }
528  if (channelSettingsKeys.contains("rgbColor") || force) {
529  swgLocalSourceSettings->setRgbColor(settings.m_rgbColor);
530  }
531  if (channelSettingsKeys.contains("title") || force) {
532  swgLocalSourceSettings->setTitle(new QString(settings.m_title));
533  }
534  if (channelSettingsKeys.contains("log2Interp") || force) {
535  swgLocalSourceSettings->setLog2Interp(settings.m_log2Interp);
536  }
537  if (channelSettingsKeys.contains("filterChainHash") || force) {
538  swgLocalSourceSettings->setFilterChainHash(settings.m_filterChainHash);
539  }
540 
541  QString channelSettingsURL = QString("http://%1:%2/sdrangel/deviceset/%3/channel/%4/settings")
542  .arg(settings.m_reverseAPIAddress)
543  .arg(settings.m_reverseAPIPort)
544  .arg(settings.m_reverseAPIDeviceIndex)
545  .arg(settings.m_reverseAPIChannelIndex);
546  m_networkRequest.setUrl(QUrl(channelSettingsURL));
547  m_networkRequest.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
548 
549  QBuffer *buffer=new QBuffer();
550  buffer->open((QBuffer::ReadWrite));
551  buffer->write(swgChannelSettings->asJson().toUtf8());
552  buffer->seek(0);
553 
554  // Always use PATCH to avoid passing reverse API settings
555  m_networkManager->sendCustomRequest(m_networkRequest, "PATCH", buffer);
556 
557  delete swgChannelSettings;
558 }
void setOriginatorChannelIndex(qint32 originator_channel_index)
SWGLocalSourceSettings * getLocalSourceSettings()
int getDeviceSetIndex() const
Definition: channelapi.h:89
QNetworkAccessManager * m_networkManager
Definition: localsource.h:177
void setLocalDeviceIndex(qint32 local_device_index)
QNetworkRequest m_networkRequest
Definition: localsource.h:178
void setChannelType(QString *channel_type)
void setOriginatorDeviceSetIndex(qint32 originator_device_set_index)
virtual QString asJson() override
void setFilterChainHash(qint32 filter_chain_hash)
int getIndexInDeviceSet() const
Definition: channelapi.h:87
void setLocalSourceSettings(SWGLocalSourceSettings *local_source_settings)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ webapiSettingsGet()

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

Reimplemented from ChannelAPI.

Definition at line 411 of file localsource.cpp.

References SWGSDRangel::SWGChannelSettings::getLocalSourceSettings(), SWGSDRangel::SWGLocalSourceSettings::init(), m_settings, SWGSDRangel::SWGChannelSettings::setLocalSourceSettings(), and webapiFormatChannelSettings().

Referenced by getStreamCenterFrequency().

414 {
415  (void) errorMessage;
417  response.getLocalSourceSettings()->init();
419  return 200;
420 }
SWGLocalSourceSettings * getLocalSourceSettings()
void webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings &response, const LocalSourceSettings &settings)
LocalSourceSettings m_settings
Definition: localsource.h:164
void setLocalSourceSettings(SWGLocalSourceSettings *local_source_settings)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ webapiSettingsPutPatch()

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

Reimplemented from ChannelAPI.

Definition at line 422 of file localsource.cpp.

References LocalSource::MsgConfigureLocalSource::create(), LocalSource::MsgConfigureChannelizer::create(), SWGSDRangel::SWGLocalSourceSettings::getFilterChainHash(), SWGSDRangel::SWGLocalSourceSettings::getLocalDeviceIndex(), SWGSDRangel::SWGChannelSettings::getLocalSourceSettings(), SWGSDRangel::SWGLocalSourceSettings::getLog2Interp(), SWGSDRangel::SWGLocalSourceSettings::getReverseApiAddress(), SWGSDRangel::SWGLocalSourceSettings::getReverseApiChannelIndex(), SWGSDRangel::SWGLocalSourceSettings::getReverseApiDeviceIndex(), SWGSDRangel::SWGLocalSourceSettings::getReverseApiPort(), SWGSDRangel::SWGLocalSourceSettings::getRgbColor(), SWGSDRangel::SWGLocalSourceSettings::getTitle(), SWGSDRangel::SWGLocalSourceSettings::getUseReverseApi(), LocalSourceSettings::m_filterChainHash, BasebandSampleSource::m_guiMessageQueue, BasebandSampleSource::m_inputMessageQueue, LocalSourceSettings::m_localDeviceIndex, LocalSourceSettings::m_log2Interp, LocalSourceSettings::m_reverseAPIAddress, LocalSourceSettings::m_reverseAPIChannelIndex, LocalSourceSettings::m_reverseAPIDeviceIndex, LocalSourceSettings::m_reverseAPIPort, LocalSourceSettings::m_rgbColor, m_settings, LocalSourceSettings::m_title, LocalSourceSettings::m_useReverseAPI, MessageQueue::push(), validateFilterChainHash(), and webapiFormatChannelSettings().

Referenced by getStreamCenterFrequency().

427 {
428  (void) errorMessage;
429  LocalSourceSettings settings = m_settings;
430 
431  if (channelSettingsKeys.contains("localDeviceIndex")) {
433  }
434  if (channelSettingsKeys.contains("rgbColor")) {
435  settings.m_rgbColor = response.getLocalSourceSettings()->getRgbColor();
436  }
437  if (channelSettingsKeys.contains("title")) {
438  settings.m_title = *response.getLocalSourceSettings()->getTitle();
439  }
440  if (channelSettingsKeys.contains("log2Interp")) {
441  settings.m_log2Interp = response.getLocalSourceSettings()->getLog2Interp();
442  }
443 
444  if (channelSettingsKeys.contains("filterChainHash"))
445  {
447  validateFilterChainHash(settings);
448  }
449 
450  if (channelSettingsKeys.contains("useReverseAPI")) {
451  settings.m_useReverseAPI = response.getLocalSourceSettings()->getUseReverseApi() != 0;
452  }
453  if (channelSettingsKeys.contains("reverseAPIAddress")) {
455  }
456  if (channelSettingsKeys.contains("reverseAPIPort")) {
458  }
459  if (channelSettingsKeys.contains("reverseAPIDeviceIndex")) {
461  }
462  if (channelSettingsKeys.contains("reverseAPIChannelIndex")) {
464  }
465 
466  MsgConfigureLocalSource *msg = MsgConfigureLocalSource::create(settings, force);
468 
469  if ((settings.m_log2Interp != m_settings.m_log2Interp) || (settings.m_filterChainHash != m_settings.m_filterChainHash) || force)
470  {
471  MsgConfigureChannelizer *msg = MsgConfigureChannelizer::create(settings.m_log2Interp, settings.m_filterChainHash);
473  }
474 
475  qDebug("LocalSource::webapiSettingsPutPatch: forward to GUI: %p", m_guiMessageQueue);
476  if (m_guiMessageQueue) // forward to GUI if any
477  {
478  MsgConfigureLocalSource *msgToGUI = MsgConfigureLocalSource::create(settings, force);
479  m_guiMessageQueue->push(msgToGUI);
480  }
481 
482  webapiFormatChannelSettings(response, settings);
483 
484  return 200;
485 }
SWGLocalSourceSettings * getLocalSourceSettings()
static MsgConfigureChannelizer * create(unsigned int m_log2Interp, unsigned int m_filterChainHash)
Definition: localsource.h:91
void push(Message *message, bool emitSignal=true)
Push message onto queue.
static MsgConfigureLocalSource * create(const LocalSourceSettings &settings, bool force)
Definition: localsource.h:48
void validateFilterChainHash(LocalSourceSettings &settings)
MessageQueue * m_guiMessageQueue
Input message queue to the GUI.
MessageQueue m_inputMessageQueue
Queue for asynchronous inbound communication.
void webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings &response, const LocalSourceSettings &settings)
LocalSourceSettings m_settings
Definition: localsource.h:164
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_centerFrequency

uint64_t LocalSource::m_centerFrequency
private

Definition at line 172 of file localsource.h.

Referenced by propagateSampleRateAndFrequency(), and setCenterFrequency().

◆ m_channelId

const QString LocalSource::m_channelId = "LocalSource"
static

Definition at line 153 of file localsource.h.

Referenced by LocalSourcePlugin::initPlugin(), and LocalSource().

◆ m_channelIdURI

const QString LocalSource::m_channelIdURI = "sdrangel.channel.localsource"
static

Definition at line 152 of file localsource.h.

Referenced by LocalSourcePlugin::initPlugin(), and LocalSourceGUI::LocalSourceGUI().

◆ m_channelizer

UpChannelizer* LocalSource::m_channelizer
private

Definition at line 161 of file localsource.h.

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

◆ m_chunkSize

int LocalSource::m_chunkSize
private

Definition at line 167 of file localsource.h.

Referenced by handleMessage(), processSamples(), pull(), and start().

◆ m_deviceAPI

DeviceAPI* LocalSource::m_deviceAPI
private

Definition at line 159 of file localsource.h.

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

◆ m_deviceSampleRate

uint32_t LocalSource::m_deviceSampleRate
private

◆ m_frequencyOffset

int64_t LocalSource::m_frequencyOffset
private

◆ m_localSamples

SampleVector LocalSource::m_localSamples
private

Definition at line 168 of file localsource.h.

Referenced by handleMessage(), processSamples(), pull(), and start().

◆ m_localSamplesIndex

int LocalSource::m_localSamplesIndex
private

Definition at line 169 of file localsource.h.

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

◆ m_localSamplesIndexOffset

int LocalSource::m_localSamplesIndexOffset
private

Definition at line 170 of file localsource.h.

Referenced by handleMessage(), processSamples(), and pull().

◆ m_localSampleSourceFifo

SampleSourceFifo* LocalSource::m_localSampleSourceFifo
private

Definition at line 166 of file localsource.h.

Referenced by handleMessage(), processSamples(), pull(), and start().

◆ m_networkManager

QNetworkAccessManager* LocalSource::m_networkManager
private

Definition at line 177 of file localsource.h.

Referenced by LocalSource(), webapiReverseSendSettings(), and ~LocalSource().

◆ m_networkRequest

QNetworkRequest LocalSource::m_networkRequest
private

Definition at line 178 of file localsource.h.

Referenced by webapiReverseSendSettings().

◆ m_running

bool LocalSource::m_running
private

Definition at line 162 of file localsource.h.

Referenced by start(), and stop().

◆ m_sampleRate

uint32_t LocalSource::m_sampleRate
private

◆ m_settings

LocalSourceSettings LocalSource::m_settings
private

◆ m_settingsMutex

QMutex LocalSource::m_settingsMutex
private

Definition at line 180 of file localsource.h.

Referenced by handleMessage(), and pull().

◆ m_sinkThread

LocalSourceThread* LocalSource::m_sinkThread
private

Definition at line 165 of file localsource.h.

Referenced by applySettings(), start(), and stop().

◆ m_threadedChannelizer

ThreadedBasebandSampleSource* LocalSource::m_threadedChannelizer
private

Definition at line 160 of file localsource.h.

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


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