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.
|
#include <localsource.h>
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) |
SampleSourceFifo & | getSampleSourceFifo () |
MessageQueue * | getInputMessageQueue () |
Get the queue for asynchronous inbound communication. More... | |
virtual void | setMessageQueueToGUI (MessageQueue *queue) |
MessageQueue * | getMessageQueueToGUI () |
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) |
DeviceAPI * | getDeviceAPI () |
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) |
DeviceSampleSink * | getLocalDevice (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 | |
DeviceAPI * | m_deviceAPI |
ThreadedBasebandSampleSource * | m_threadedChannelizer |
UpChannelizer * | m_channelizer |
bool | m_running |
LocalSourceSettings | m_settings |
LocalSourceThread * | m_sinkThread |
SampleSourceFifo * | m_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... | |
MessageQueue * | m_guiMessageQueue |
Input message queue to the GUI. More... | |
SampleSourceFifo | m_sampleFifo |
Internal FIFO for multi-channel processing. More... | |
SampleSourceFifo * | m_deviceSampleFifo |
Reference to the device FIFO for single channel processing. More... | |
Definition at line 38 of file localsource.h.
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().
|
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().
|
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().
|
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().
|
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().
|
inlinevirtual |
Implements ChannelAPI.
Definition at line 108 of file localsource.h.
References handleMessage(), pull(), pullAudio(), start(), and stop().
|
inlinevirtual |
Applies to a default stream.
Implements ChannelAPI.
Definition at line 118 of file localsource.h.
References deserialize(), m_frequencyOffset, and serialize().
|
inlinevirtual |
|
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().
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().
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
Implements ChannelAPI.
Definition at line 126 of file localsource.h.
References m_frequencyOffset, webapiSettingsGet(), and webapiSettingsPutPatch().
|
inlinevirtual |
|
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().
|
privateslot |
Definition at line 560 of file localsource.cpp.
Referenced by LocalSource(), and ~LocalSource().
|
privateslot |
Definition at line 114 of file localsource.cpp.
References m_chunkSize, m_localSamples, m_localSamplesIndexOffset, m_localSampleSourceFifo, and SampleSourceFifo::setIteratorFromOffset().
Referenced by start().
|
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().
|
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().
|
virtual |
Reimplemented from BasebandSampleSource.
Definition at line 126 of file localsource.cpp.
Referenced by destroy().
|
signal |
|
virtual |
Implements ChannelAPI.
Definition at line 272 of file localsource.cpp.
References m_settings, and LocalSourceSettings::serialize().
Referenced by getCenterFrequency().
|
inline |
Set center frequency given in Hz
Definition at line 144 of file localsource.h.
References m_centerFrequency.
Referenced by handleMessage().
void LocalSource::setChannelizer | ( | unsigned int | log2Interp, |
unsigned int | filterChainHash | ||
) |
|
inline |
Set sample rate given in Hz
Definition at line 147 of file localsource.h.
References getLocalDevices(), m_sampleRate, and setChannelizer().
Referenced by handleMessage().
|
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().
|
virtual |
Implements BasebandSampleSource.
Definition at line 171 of file localsource.cpp.
References m_running, m_sinkThread, and LocalSourceThread::startStop().
Referenced by destroy(), and start().
|
private |
Definition at line 394 of file localsource.cpp.
References i, LocalSourceSettings::m_filterChainHash, and LocalSourceSettings::m_log2Interp.
Referenced by webapiSettingsPutPatch().
|
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().
|
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().
|
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().
|
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().
|
private |
Definition at line 172 of file localsource.h.
Referenced by propagateSampleRateAndFrequency(), and setCenterFrequency().
|
static |
Definition at line 153 of file localsource.h.
Referenced by LocalSourcePlugin::initPlugin(), and LocalSource().
|
static |
Definition at line 152 of file localsource.h.
Referenced by LocalSourcePlugin::initPlugin(), and LocalSourceGUI::LocalSourceGUI().
|
private |
Definition at line 161 of file localsource.h.
Referenced by handleMessage(), LocalSource(), and ~LocalSource().
|
private |
Definition at line 167 of file localsource.h.
Referenced by handleMessage(), processSamples(), pull(), and start().
|
private |
Definition at line 159 of file localsource.h.
Referenced by LocalSource(), and ~LocalSource().
|
private |
Definition at line 175 of file localsource.h.
Referenced by calculateFrequencyOffset(), handleMessage(), and propagateSampleRateAndFrequency().
|
private |
Definition at line 173 of file localsource.h.
Referenced by calculateFrequencyOffset(), getCenterFrequency(), getStreamCenterFrequency(), and propagateSampleRateAndFrequency().
|
private |
Definition at line 168 of file localsource.h.
Referenced by handleMessage(), processSamples(), pull(), and start().
|
private |
Definition at line 169 of file localsource.h.
Referenced by handleMessage(), pull(), and start().
|
private |
Definition at line 170 of file localsource.h.
Referenced by handleMessage(), processSamples(), and pull().
|
private |
Definition at line 166 of file localsource.h.
Referenced by handleMessage(), processSamples(), pull(), and start().
|
private |
Definition at line 177 of file localsource.h.
Referenced by LocalSource(), webapiReverseSendSettings(), and ~LocalSource().
|
private |
Definition at line 178 of file localsource.h.
Referenced by webapiReverseSendSettings().
|
private |
Definition at line 162 of file localsource.h.
|
private |
Definition at line 174 of file localsource.h.
Referenced by LocalSource::MsgSampleRateNotification::getSampleRate(), and setSampleRate().
|
private |
Definition at line 164 of file localsource.h.
Referenced by applySettings(), calculateFrequencyOffset(), deserialize(), handleMessage(), propagateSampleRateAndFrequency(), serialize(), start(), webapiSettingsGet(), and webapiSettingsPutPatch().
|
private |
Definition at line 180 of file localsource.h.
Referenced by handleMessage(), and pull().
|
private |
Definition at line 165 of file localsource.h.
Referenced by applySettings(), start(), and stop().
|
private |
Definition at line 160 of file localsource.h.
Referenced by LocalSource(), and ~LocalSource().