mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-09-02 13:17:48 -04:00
SDRdaemonSink: apply settings
This commit is contained in:
parent
e14d0179c5
commit
3d691ab416
@ -156,9 +156,26 @@ void SDRdaemonSinkOutput::applySettings(const SDRdaemonSinkSettings& settings, b
|
|||||||
QMutexLocker mutexLocker(&m_mutex);
|
QMutexLocker mutexLocker(&m_mutex);
|
||||||
bool forwardChange = false;
|
bool forwardChange = false;
|
||||||
|
|
||||||
|
if (force || (m_settings.m_address != settings.m_address) || (m_settings.m_dataPort != settings.m_dataPort))
|
||||||
|
{
|
||||||
|
m_settings.m_address = settings.m_address;
|
||||||
|
m_settings.m_dataPort = settings.m_dataPort;
|
||||||
|
|
||||||
|
if (m_sdrDaemonSinkThread != 0)
|
||||||
|
{
|
||||||
|
m_sdrDaemonSinkThread->setRemoteAddress(m_settings.m_address, m_settings.m_dataPort);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (force || (m_settings.m_centerFrequency != settings.m_centerFrequency))
|
if (force || (m_settings.m_centerFrequency != settings.m_centerFrequency))
|
||||||
{
|
{
|
||||||
m_settings.m_centerFrequency = settings.m_centerFrequency;
|
m_settings.m_centerFrequency = settings.m_centerFrequency;
|
||||||
|
|
||||||
|
if (m_sdrDaemonSinkThread != 0)
|
||||||
|
{
|
||||||
|
m_sdrDaemonSinkThread->setCenterFrequency(m_settings.m_centerFrequency);
|
||||||
|
}
|
||||||
|
|
||||||
forwardChange = true;
|
forwardChange = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -177,23 +194,41 @@ void SDRdaemonSinkOutput::applySettings(const SDRdaemonSinkSettings& settings, b
|
|||||||
if (force || (m_settings.m_log2Interp != settings.m_log2Interp))
|
if (force || (m_settings.m_log2Interp != settings.m_log2Interp))
|
||||||
{
|
{
|
||||||
m_settings.m_log2Interp = settings.m_log2Interp;
|
m_settings.m_log2Interp = settings.m_log2Interp;
|
||||||
|
|
||||||
if (m_sdrDaemonSinkThread != 0)
|
|
||||||
{
|
|
||||||
m_sdrDaemonSinkThread->setSamplerate(m_settings.m_sampleRate);
|
|
||||||
}
|
|
||||||
|
|
||||||
forwardChange = true;
|
forwardChange = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: manage sending to control port
|
if (force || (m_settings.m_txDelay != settings.m_txDelay))
|
||||||
|
{
|
||||||
|
m_settings.m_txDelay = settings.m_txDelay;
|
||||||
|
|
||||||
|
if (m_sdrDaemonSinkThread != 0)
|
||||||
|
{
|
||||||
|
m_sdrDaemonSinkThread->setTxDelay(m_settings.m_txDelay);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (force || (m_settings.m_nbFECBlocks != settings.m_nbFECBlocks))
|
||||||
|
{
|
||||||
|
m_settings.m_nbFECBlocks = settings.m_nbFECBlocks;
|
||||||
|
|
||||||
|
if (m_sdrDaemonSinkThread != 0)
|
||||||
|
{
|
||||||
|
m_sdrDaemonSinkThread->setNbBlocksFEC(m_settings.m_nbFECBlocks);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mutexLocker.unlock();
|
||||||
|
|
||||||
|
qDebug("FileSinkOutput::applySettings: %s m_centerFrequency: %llu m_sampleRate: %llu m_log2Interp: %d m_txDelay: %d m_nbFECBlocks: %d",
|
||||||
|
forwardChange ? "forward change" : "",
|
||||||
|
m_settings.m_centerFrequency,
|
||||||
|
m_settings.m_sampleRate,
|
||||||
|
m_settings.m_log2Interp,
|
||||||
|
m_settings.m_txDelay,
|
||||||
|
m_settings.m_nbFECBlocks);
|
||||||
|
|
||||||
if (forwardChange)
|
if (forwardChange)
|
||||||
{
|
{
|
||||||
qDebug("FileSinkOutput::applySettings: forward: m_centerFrequency: %llu m_sampleRate: %llu m_log2Interp: %d",
|
|
||||||
m_settings.m_centerFrequency,
|
|
||||||
m_settings.m_sampleRate,
|
|
||||||
m_settings.m_log2Interp);
|
|
||||||
DSPSignalNotification *notif = new DSPSignalNotification(m_settings.m_sampleRate, m_settings.m_centerFrequency);
|
DSPSignalNotification *notif = new DSPSignalNotification(m_settings.m_sampleRate, m_settings.m_centerFrequency);
|
||||||
m_deviceAPI->getDeviceInputMessageQueue()->push(notif);
|
m_deviceAPI->getDeviceInputMessageQueue()->push(notif);
|
||||||
}
|
}
|
||||||
|
@ -45,12 +45,15 @@ public:
|
|||||||
|
|
||||||
void startWork();
|
void startWork();
|
||||||
void stopWork();
|
void stopWork();
|
||||||
|
|
||||||
|
void setCenterFrequency(uint64_t centerFrequency) { m_udpSinkFEC.setCenterFrequency(centerFrequency); }
|
||||||
void setSamplerate(int samplerate);
|
void setSamplerate(int samplerate);
|
||||||
void setBuffer(std::size_t chunksize);
|
|
||||||
void setNbBlocksFEC(uint32_t nbBlocksFEC) { m_udpSinkFEC.setNbBlocksFEC(nbBlocksFEC); };
|
void setNbBlocksFEC(uint32_t nbBlocksFEC) { m_udpSinkFEC.setNbBlocksFEC(nbBlocksFEC); };
|
||||||
void setTxDelay(uint32_t txDelay) { m_udpSinkFEC.setTxDelay(txDelay); };
|
void setTxDelay(uint32_t txDelay) { m_udpSinkFEC.setTxDelay(txDelay); };
|
||||||
void setRemoteAddress(const QString& address, uint16_t port) { m_udpSinkFEC.setRemoteAddress(address, port); }
|
void setRemoteAddress(const QString& address, uint16_t port) { m_udpSinkFEC.setRemoteAddress(address, port); }
|
||||||
bool isRunning() const { return m_running; }
|
|
||||||
|
bool isRunning() const { return m_running; }
|
||||||
|
|
||||||
std::size_t getSamplesCount() const { return m_samplesCount; }
|
std::size_t getSamplesCount() const { return m_samplesCount; }
|
||||||
void setSamplesCount(int samplesCount) { m_samplesCount = samplesCount; }
|
void setSamplesCount(int samplesCount) { m_samplesCount = samplesCount; }
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user