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 <localsink.h>
Classes | |
class | MsgConfigureChannelizer |
class | MsgConfigureLocalSink |
class | MsgSampleRateNotification |
Signals | |
void | samplesAvailable (const quint8 *data, uint count) |
Public Member Functions | |
LocalSink (DeviceAPI *deviceAPI) | |
virtual | ~LocalSink () |
virtual void | destroy () |
virtual void | feed (const SampleVector::const_iterator &begin, const SampleVector::const_iterator &end, bool po) |
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 log2Decim, unsigned int filterChainHash) |
void | getLocalDevices (std::vector< uint32_t > &indexes) |
Public Member Functions inherited from BasebandSampleSink | |
BasebandSampleSink () | |
virtual | ~BasebandSampleSink () |
MessageQueue * | getInputMessageQueue () |
Get the queue for asynchronous inbound communication. More... | |
virtual void | setMessageQueueToGUI (MessageQueue *queue) |
MessageQueue * | getMessageQueueToGUI () |
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.localsink" |
static const QString | m_channelId = "LocalSink" |
Private Slots | |
void | networkManagerFinished (QNetworkReply *reply) |
Private Member Functions | |
void | applySettings (const LocalSinkSettings &settings, bool force=false) |
DeviceSampleSource * | getLocalDevice (uint32_t index) |
void | propagateSampleRateAndFrequency (uint32_t index) |
void | validateFilterChainHash (LocalSinkSettings &settings) |
void | calculateFrequencyOffset () |
void | webapiFormatChannelSettings (SWGSDRangel::SWGChannelSettings &response, const LocalSinkSettings &settings) |
void | webapiReverseSendSettings (QList< QString > &channelSettingsKeys, const LocalSinkSettings &settings, bool force) |
Private Attributes | |
DeviceAPI * | m_deviceAPI |
ThreadedBasebandSampleSink * | m_threadedChannelizer |
DownChannelizer * | m_channelizer |
bool | m_running |
LocalSinkSettings | m_settings |
LocalSinkThread * | m_sinkThread |
uint64_t | m_centerFrequency |
int64_t | m_frequencyOffset |
uint32_t | m_sampleRate |
uint32_t | m_deviceSampleRate |
QNetworkAccessManager * | m_networkManager |
QNetworkRequest | m_networkRequest |
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 BasebandSampleSink | |
void | handleInputMessages () |
Protected Attributes inherited from BasebandSampleSink | |
MessageQueue | m_inputMessageQueue |
Queue for asynchronous inbound communication. More... | |
MessageQueue * | m_guiMessageQueue |
Input message queue to the GUI. More... | |
Definition at line 37 of file localsink.h.
LocalSink::LocalSink | ( | DeviceAPI * | deviceAPI | ) |
Definition at line 48 of file localsink.cpp.
References DeviceAPI::addChannelSink(), DeviceAPI::addChannelSinkAPI(), m_channelId, m_channelizer, m_deviceAPI, m_networkManager, m_threadedChannelizer, and networkManagerFinished().
Referenced by LocalSink::MsgConfigureChannelizer::MsgConfigureChannelizer().
|
virtual |
Definition at line 69 of file localsink.cpp.
References m_channelizer, m_deviceAPI, m_networkManager, m_threadedChannelizer, networkManagerFinished(), DeviceAPI::removeChannelSink(), and DeviceAPI::removeChannelSinkAPI().
Referenced by LocalSink::MsgConfigureChannelizer::MsgConfigureChannelizer().
|
private |
Definition at line 282 of file localsink.cpp.
References getLocalDevice(), DeviceSampleSource::getSampleFifo(), LocalSinkSettings::m_localDeviceIndex, LocalSinkSettings::m_reverseAPIAddress, LocalSinkSettings::m_reverseAPIChannelIndex, LocalSinkSettings::m_reverseAPIDeviceIndex, LocalSinkSettings::m_reverseAPIPort, m_settings, m_sinkThread, LocalSinkSettings::m_useReverseAPI, propagateSampleRateAndFrequency(), LocalSinkThread::setSampleFifo(), and webapiReverseSendSettings().
Referenced by handleMessage().
|
private |
Definition at line 333 of file localsink.cpp.
References HBFilterChainConverter::getShiftFactor(), m_deviceSampleRate, LocalSinkSettings::m_filterChainHash, m_frequencyOffset, LocalSinkSettings::m_log2Decim, and m_settings.
Referenced by handleMessage().
|
virtual |
Implements ChannelAPI.
Definition at line 205 of file localsink.cpp.
References LocalSink::MsgConfigureLocalSink::create(), LocalSinkSettings::deserialize(), BasebandSampleSink::m_inputMessageQueue, m_settings, MessageQueue::push(), and LocalSinkSettings::resetToDefaults().
Referenced by getCenterFrequency().
|
inlinevirtual |
Implements ChannelAPI.
Definition at line 107 of file localsink.h.
References feed(), handleMessage(), start(), and stop().
|
virtual |
Implements BasebandSampleSink.
Definition at line 79 of file localsink.cpp.
References samplesAvailable().
Referenced by destroy().
|
inlinevirtual |
Applies to a default stream.
Implements ChannelAPI.
Definition at line 116 of file localsink.h.
References deserialize(), m_frequencyOffset, and serialize().
|
inlinevirtual |
|
private |
Definition at line 239 of file localsink.cpp.
References ChannelAPI::getDeviceAPI(), DeviceSampleSource::getDeviceDescription(), DSPEngine::getDeviceSourceEngineByIndex(), DSPDeviceSourceEngine::getSource(), DSPDeviceSourceEngine::getUID(), and DSPEngine::instance().
Referenced by applySettings(), propagateSampleRateAndFrequency(), and start().
void LocalSink::getLocalDevices | ( | std::vector< uint32_t > & | indexes | ) |
Definition at line 223 of file localsink.cpp.
References DeviceSampleSource::getDeviceDescription(), DSPEngine::getDeviceSourceEngineByIndex(), DSPEngine::getDeviceSourceEnginesNumber(), DSPDeviceSourceEngine::getSource(), i, and DSPEngine::instance().
Referenced by setSampleRate(), and LocalSinkGUI::updateLocalDevices().
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
Implements ChannelAPI.
Definition at line 124 of file localsink.h.
References m_frequencyOffset, webapiSettingsGet(), and webapiSettingsPutPatch().
|
inlinevirtual |
|
virtual |
Processing of a message. Returns true if message has actually been processed.
Implements BasebandSampleSink.
Definition at line 124 of file localsink.cpp.
References applySettings(), calculateFrequencyOffset(), LocalSink::MsgSampleRateNotification::create(), DSPSignalNotification::getCenterFrequency(), LocalSink::MsgConfigureChannelizer::getFilterChainHash(), LocalSink::MsgConfigureLocalSink::getForce(), DownChannelizer::MsgChannelizerNotification::getFrequencyOffset(), BasebandSampleSink::getInputMessageQueue(), LocalSink::MsgConfigureChannelizer::getLog2Decim(), DownChannelizer::MsgChannelizerNotification::getSampleRate(), DSPSignalNotification::getSampleRate(), LocalSink::MsgConfigureLocalSink::getSettings(), m_channelizer, m_deviceSampleRate, LocalSinkSettings::m_filterChainHash, BasebandSampleSink::m_guiMessageQueue, LocalSinkSettings::m_localDeviceIndex, LocalSinkSettings::m_log2Decim, m_settings, Message::match(), propagateSampleRateAndFrequency(), MessageQueue::push(), DownChannelizer::set(), setCenterFrequency(), and setSampleRate().
Referenced by destroy().
|
privateslot |
Definition at line 488 of file localsink.cpp.
Referenced by LocalSink(), and ~LocalSink().
|
private |
Definition at line 271 of file localsink.cpp.
References getLocalDevice(), m_centerFrequency, m_deviceSampleRate, m_frequencyOffset, LocalSinkSettings::m_log2Decim, m_settings, DeviceSampleSource::setCenterFrequency(), and DeviceSampleSource::setSampleRate().
Referenced by applySettings(), and handleMessage().
|
signal |
|
virtual |
Implements ChannelAPI.
Definition at line 200 of file localsink.cpp.
References m_settings, and LocalSinkSettings::serialize().
Referenced by getCenterFrequency().
|
inline |
Set center frequency given in Hz
Definition at line 142 of file localsink.h.
References m_centerFrequency.
Referenced by handleMessage().
void LocalSink::setChannelizer | ( | unsigned int | log2Decim, |
unsigned int | filterChainHash | ||
) |
|
inline |
Set sample rate given in Hz
Definition at line 145 of file localsink.h.
References getLocalDevices(), m_sampleRate, and setChannelizer().
Referenced by handleMessage().
|
virtual |
Implements BasebandSampleSink.
Definition at line 85 of file localsink.cpp.
References getLocalDevice(), DeviceSampleSource::getSampleFifo(), LocalSinkSettings::m_localDeviceIndex, m_running, m_settings, m_sinkThread, samplesAvailable(), LocalSinkThread::setSampleFifo(), LocalSinkThread::startStop(), and stop().
Referenced by destroy().
|
virtual |
Implements BasebandSampleSink.
Definition at line 110 of file localsink.cpp.
References m_running, m_sinkThread, and LocalSinkThread::startStop().
Referenced by destroy(), and start().
|
private |
Definition at line 322 of file localsink.cpp.
References i, LocalSinkSettings::m_filterChainHash, and LocalSinkSettings::m_log2Decim.
Referenced by webapiSettingsPutPatch().
|
private |
Definition at line 415 of file localsink.cpp.
References SWGSDRangel::SWGChannelSettings::getLocalSinkSettings(), SWGSDRangel::SWGLocalSinkSettings::getReverseApiAddress(), SWGSDRangel::SWGLocalSinkSettings::getTitle(), LocalSinkSettings::m_filterChainHash, LocalSinkSettings::m_localDeviceIndex, LocalSinkSettings::m_log2Decim, LocalSinkSettings::m_reverseAPIAddress, LocalSinkSettings::m_reverseAPIChannelIndex, LocalSinkSettings::m_reverseAPIDeviceIndex, LocalSinkSettings::m_reverseAPIPort, LocalSinkSettings::m_rgbColor, LocalSinkSettings::m_title, LocalSinkSettings::m_useReverseAPI, SWGSDRangel::SWGLocalSinkSettings::setFilterChainHash(), SWGSDRangel::SWGLocalSinkSettings::setLocalDeviceIndex(), SWGSDRangel::SWGLocalSinkSettings::setLog2Decim(), SWGSDRangel::SWGLocalSinkSettings::setReverseApiAddress(), SWGSDRangel::SWGLocalSinkSettings::setReverseApiChannelIndex(), SWGSDRangel::SWGLocalSinkSettings::setReverseApiDeviceIndex(), SWGSDRangel::SWGLocalSinkSettings::setReverseApiPort(), SWGSDRangel::SWGLocalSinkSettings::setRgbColor(), SWGSDRangel::SWGLocalSinkSettings::setTitle(), and SWGSDRangel::SWGLocalSinkSettings::setUseReverseApi().
Referenced by webapiSettingsGet(), and webapiSettingsPutPatch().
|
private |
Definition at line 441 of file localsink.cpp.
References SWGSDRangel::SWGChannelSettings::asJson(), ChannelAPI::getDeviceSetIndex(), ChannelAPI::getIndexInDeviceSet(), SWGSDRangel::SWGChannelSettings::getLocalSinkSettings(), LocalSinkSettings::m_filterChainHash, LocalSinkSettings::m_localDeviceIndex, LocalSinkSettings::m_log2Decim, m_networkManager, m_networkRequest, LocalSinkSettings::m_reverseAPIAddress, LocalSinkSettings::m_reverseAPIChannelIndex, LocalSinkSettings::m_reverseAPIDeviceIndex, LocalSinkSettings::m_reverseAPIPort, LocalSinkSettings::m_rgbColor, LocalSinkSettings::m_title, SWGSDRangel::SWGChannelSettings::setChannelType(), SWGSDRangel::SWGChannelSettings::setDirection(), SWGSDRangel::SWGLocalSinkSettings::setFilterChainHash(), SWGSDRangel::SWGLocalSinkSettings::setLocalDeviceIndex(), SWGSDRangel::SWGChannelSettings::setLocalSinkSettings(), SWGSDRangel::SWGLocalSinkSettings::setLog2Decim(), SWGSDRangel::SWGChannelSettings::setOriginatorChannelIndex(), SWGSDRangel::SWGChannelSettings::setOriginatorDeviceSetIndex(), SWGSDRangel::SWGLocalSinkSettings::setRgbColor(), and SWGSDRangel::SWGLocalSinkSettings::setTitle().
Referenced by applySettings().
|
virtual |
Reimplemented from ChannelAPI.
Definition at line 339 of file localsink.cpp.
References SWGSDRangel::SWGChannelSettings::getLocalSinkSettings(), SWGSDRangel::SWGLocalSinkSettings::init(), m_settings, SWGSDRangel::SWGChannelSettings::setLocalSinkSettings(), and webapiFormatChannelSettings().
Referenced by getStreamCenterFrequency().
|
virtual |
Reimplemented from ChannelAPI.
Definition at line 350 of file localsink.cpp.
References LocalSink::MsgConfigureLocalSink::create(), LocalSink::MsgConfigureChannelizer::create(), SWGSDRangel::SWGLocalSinkSettings::getFilterChainHash(), SWGSDRangel::SWGLocalSinkSettings::getLocalDeviceIndex(), SWGSDRangel::SWGChannelSettings::getLocalSinkSettings(), SWGSDRangel::SWGLocalSinkSettings::getLog2Decim(), SWGSDRangel::SWGLocalSinkSettings::getReverseApiAddress(), SWGSDRangel::SWGLocalSinkSettings::getReverseApiChannelIndex(), SWGSDRangel::SWGLocalSinkSettings::getReverseApiDeviceIndex(), SWGSDRangel::SWGLocalSinkSettings::getReverseApiPort(), SWGSDRangel::SWGLocalSinkSettings::getRgbColor(), SWGSDRangel::SWGLocalSinkSettings::getTitle(), SWGSDRangel::SWGLocalSinkSettings::getUseReverseApi(), LocalSinkSettings::m_filterChainHash, BasebandSampleSink::m_guiMessageQueue, BasebandSampleSink::m_inputMessageQueue, LocalSinkSettings::m_localDeviceIndex, LocalSinkSettings::m_log2Decim, LocalSinkSettings::m_reverseAPIAddress, LocalSinkSettings::m_reverseAPIChannelIndex, LocalSinkSettings::m_reverseAPIDeviceIndex, LocalSinkSettings::m_reverseAPIPort, LocalSinkSettings::m_rgbColor, m_settings, LocalSinkSettings::m_title, LocalSinkSettings::m_useReverseAPI, MessageQueue::push(), validateFilterChainHash(), and webapiFormatChannelSettings().
Referenced by getStreamCenterFrequency().
|
private |
Definition at line 165 of file localsink.h.
Referenced by propagateSampleRateAndFrequency(), and setCenterFrequency().
|
static |
Definition at line 151 of file localsink.h.
Referenced by LocalSinkPlugin::initPlugin(), and LocalSink().
|
static |
Definition at line 150 of file localsink.h.
Referenced by LocalSinkPlugin::initPlugin(), and LocalSinkGUI::LocalSinkGUI().
|
private |
Definition at line 159 of file localsink.h.
Referenced by handleMessage(), LocalSink(), and ~LocalSink().
|
private |
Definition at line 157 of file localsink.h.
Referenced by LocalSink(), and ~LocalSink().
|
private |
Definition at line 168 of file localsink.h.
Referenced by calculateFrequencyOffset(), handleMessage(), and propagateSampleRateAndFrequency().
|
private |
Definition at line 166 of file localsink.h.
Referenced by calculateFrequencyOffset(), getCenterFrequency(), getStreamCenterFrequency(), and propagateSampleRateAndFrequency().
|
private |
Definition at line 170 of file localsink.h.
Referenced by LocalSink(), webapiReverseSendSettings(), and ~LocalSink().
|
private |
Definition at line 171 of file localsink.h.
Referenced by webapiReverseSendSettings().
|
private |
Definition at line 160 of file localsink.h.
|
private |
Definition at line 167 of file localsink.h.
Referenced by LocalSink::MsgSampleRateNotification::getSampleRate(), and setSampleRate().
|
private |
Definition at line 162 of file localsink.h.
Referenced by applySettings(), calculateFrequencyOffset(), deserialize(), handleMessage(), propagateSampleRateAndFrequency(), serialize(), start(), webapiSettingsGet(), and webapiSettingsPutPatch().
|
private |
Definition at line 163 of file localsink.h.
Referenced by applySettings(), start(), and stop().
|
private |
Definition at line 158 of file localsink.h.
Referenced by LocalSink(), and ~LocalSink().