19 #ifndef INCLUDE_UDPSRC_H 20 #define INCLUDE_UDPSRC_H 23 #include <QHostAddress> 24 #include <QNetworkRequest> 41 class QNetworkAccessManager;
94 m_sampleRate(sampleRate),
95 m_centerFrequency(centerFrequency)
109 virtual void feed(
const SampleVector::const_iterator& begin,
const SampleVector::const_iterator& end,
bool positiveOnly);
110 virtual void start();
127 (void) sinkElseSource;
133 QString& errorMessage);
137 const QStringList& channelSettingsKeys,
139 QString& errorMessage);
143 QString& errorMessage);
263 if (m_squelchGate == 0)
265 m_squelchOpen =
true;
269 if (m_squelchOpenCount < m_squelchGate)
271 m_squelchOpenCount++;
276 m_squelchOpen =
true;
282 if (m_squelchGate == 0)
284 m_squelchOpen =
false;
288 if (m_squelchCloseCount > 0)
290 m_squelchCloseCount--;
294 m_squelchOpenCount = 0;
295 m_squelchOpen =
false;
305 m_squelchOpen =
true;
311 m_squelchOpen =
false;
312 m_squelchOpenCount = 0;
313 m_squelchCloseCount = 0;
345 m_udpBufferMono16->
write(sample);
349 m_udpBufferMono16->
write(sample>>8);
360 m_udpBufferMono16->
write(sample*32768.0);
365 #endif // INCLUDE_UDPSRC_H
static const QString m_channelId
std::vector< Sample > SampleVector
std::vector< AudioSample > AudioVector
MsgUDPSinkSpectrum(bool enabled)
DownChannelizer * m_channelizer
bool getSquelchOpen() const
virtual void getIdentifier(QString &id)
virtual bool deserialize(const QByteArray &data)
void udpWriteNorm(Real real, Real imag)
virtual int webapiSettingsPutPatch(bool force, const QStringList &channelSettingsKeys, SWGSDRangel::SWGChannelSettings &response, QString &errorMessage)
void udpWrite(FixReal real, FixReal imag)
virtual bool handleMessage(const Message &cmd)
Processing of a message. Returns true if message has actually been processed.
void calculateSquelch(double value)
UDPSinkSettings m_settings
MovingAverage< double > m_amMovingAverage
SampleVector m_sampleBuffer
void setSpectrum(BasebandSampleSink *spectrum)
double getInMagSq() const
virtual int getNbSinkStreams() const
static const int m_udpAudioPayloadSize
UDP audio samples buffer. No UDP block on Earth is larger than this.
static const Real m_agcTarget
AudioVector m_audioBuffer
void applyChannelSettings(int inputSampleRate, int inputFrequencyOffset, bool force=true)
BasebandSampleSink * m_spectrum
virtual int webapiReportGet(SWGSDRangel::SWGChannelReport &response, QString &errorMessage)
MovingAverage< double > m_outMovingAverage
void webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings &response, const UDPSinkSettings &settings)
void networkManagerFinished(QNetworkReply *reply)
void udpWriteMono(FixReal sample)
virtual QByteArray serialize() const
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport &response)
QNetworkAccessManager * m_networkManager
Sample16(int16_t r, int16_t i)
UDPSinkUtil< int16_t > * m_udpBufferMono16
#define MESSAGE_CLASS_DECLARATION
virtual void getTitle(QString &title)
ThreadedBasebandSampleSink * m_threadedChannelizer
Bandpass< double > m_bandpass
QUdpSocket * m_audioSocket
virtual qint64 getStreamCenterFrequency(int streamIndex, bool sinkElseSource) const
virtual void feed(const SampleVector::const_iterator &begin, const SampleVector::const_iterator &end, bool positiveOnly)
int m_inputFrequencyOffset
Interpolator m_interpolator
int m_squelchGate
number of samples computed from given gate
void udpWriteNormMono(Real sample)
virtual int getNbSourceStreams() const
virtual int webapiSettingsGet(SWGSDRangel::SWGChannelSettings &response, QString &errorMessage)
static const int udpBlockSize
UDPSinkUtil< Sample16 > * m_udpBuffer16
SampleFormat m_sampleFormat
UDPSink(DeviceAPI *deviceAPI)
void webapiReverseSendSettings(QList< QString > &channelSettingsKeys, const UDPSinkSettings &settings, bool force)
QNetworkRequest m_networkRequest
Real m_sampleDistanceRemain
UDPSinkUtil< Sample24 > * m_udpBuffer24
PhaseDiscriminators m_phaseDiscri
void applySettings(const UDPSinkSettings &settings, bool force=false)
int64_t m_inputFrequencyOffset
MovingAverage< double > m_inMovingAverage
static MsgUDPSinkSpectrum * create(bool enabled)
static const QString m_channelIdURI
std::complex< Real > Complex
void initSquelch(bool open)
Sample24(int32_t r, int32_t i)
virtual qint64 getCenterFrequency() const
Applies to a default stream.