kopia lustrzana https://github.com/f4exb/sdrangel
all source and sink plugins except FileSource and SDRdaemonSource: apply settings with force on construction
rodzic
351651c3e5
commit
8e07820e8e
|
@ -47,6 +47,8 @@ BladerfOutput::BladerfOutput(DeviceSinkAPI *deviceAPI) :
|
|||
m_sampleSourceFifo.resize(16*BLADERFOUTPUT_BLOCKSIZE);
|
||||
openDevice();
|
||||
m_deviceAPI->setBuddySharedPtr(&m_sharedParams);
|
||||
|
||||
applySettings(m_settings, true);
|
||||
}
|
||||
|
||||
BladerfOutput::~BladerfOutput()
|
||||
|
|
|
@ -49,6 +49,7 @@ FileSinkOutput::FileSinkOutput(DeviceSinkAPI *deviceAPI) :
|
|||
m_startingTimeStamp(0),
|
||||
m_masterTimer(deviceAPI->getMasterTimer())
|
||||
{
|
||||
applySettings(m_settings, true);
|
||||
}
|
||||
|
||||
FileSinkOutput::~FileSinkOutput()
|
||||
|
|
|
@ -47,6 +47,8 @@ HackRFOutput::HackRFOutput(DeviceSinkAPI *deviceAPI) :
|
|||
{
|
||||
openDevice();
|
||||
m_deviceAPI->setBuddySharedPtr(&m_sharedParams);
|
||||
|
||||
applySettings(m_settings, true);
|
||||
}
|
||||
|
||||
HackRFOutput::~HackRFOutput()
|
||||
|
|
|
@ -45,6 +45,8 @@ PlutoSDROutput::PlutoSDROutput(DeviceSinkAPI *deviceAPI) :
|
|||
suspendBuddies();
|
||||
openDevice();
|
||||
resumeBuddies();
|
||||
|
||||
applySettings(m_settings, true);
|
||||
}
|
||||
|
||||
PlutoSDROutput::~PlutoSDROutput()
|
||||
|
@ -346,7 +348,7 @@ bool PlutoSDROutput::applySettings(const PlutoSDROutputSettings& settings, bool
|
|||
<< " <-FIR- " << m_deviceSampleRates.m_firRate;
|
||||
|
||||
forwardChangeOtherDSP = true;
|
||||
forwardChangeOwnDSP = (m_settings.m_devSampleRate != settings.m_devSampleRate);
|
||||
forwardChangeOwnDSP = (m_settings.m_devSampleRate != settings.m_devSampleRate) || force;
|
||||
}
|
||||
|
||||
if ((m_settings.m_log2Interp != settings.m_log2Interp) || force)
|
||||
|
|
|
@ -47,6 +47,7 @@ SDRdaemonSinkOutput::SDRdaemonSinkOutput(DeviceSinkAPI *deviceAPI) :
|
|||
m_startingTimeStamp(0),
|
||||
m_masterTimer(deviceAPI->getMasterTimer())
|
||||
{
|
||||
applySettings(m_settings, true);
|
||||
}
|
||||
|
||||
SDRdaemonSinkOutput::~SDRdaemonSinkOutput()
|
||||
|
|
|
@ -52,6 +52,8 @@ AirspyInput::AirspyInput(DeviceSourceAPI *deviceAPI) :
|
|||
sprintf(recFileNameCStr, "test_%d.sdriq", m_deviceAPI->getDeviceUID());
|
||||
m_fileSink = new FileRecord(std::string(recFileNameCStr));
|
||||
m_deviceAPI->addSink(m_fileSink);
|
||||
|
||||
applySettings(m_settings, true);
|
||||
}
|
||||
|
||||
AirspyInput::~AirspyInput()
|
||||
|
|
|
@ -53,6 +53,8 @@ BladerfInput::BladerfInput(DeviceSourceAPI *deviceAPI) :
|
|||
m_deviceAPI->addSink(m_fileSink);
|
||||
|
||||
m_deviceAPI->setBuddySharedPtr(&m_sharedParams);
|
||||
|
||||
applySettings(m_settings, false);
|
||||
}
|
||||
|
||||
BladerfInput::~BladerfInput()
|
||||
|
|
|
@ -54,6 +54,8 @@ FCDProInput::FCDProInput(DeviceSourceAPI *deviceAPI) :
|
|||
sprintf(recFileNameCStr, "test_%d.sdriq", m_deviceAPI->getDeviceUID());
|
||||
m_fileSink = new FileRecord(std::string(recFileNameCStr));
|
||||
m_deviceAPI->addSink(m_fileSink);
|
||||
|
||||
applySettings(m_settings, true);
|
||||
}
|
||||
|
||||
FCDProInput::~FCDProInput()
|
||||
|
@ -224,7 +226,7 @@ bool FCDProInput::handleMessage(const Message& message)
|
|||
|
||||
void FCDProInput::applySettings(const FCDProSettings& settings, bool force)
|
||||
{
|
||||
bool signalChange = false;
|
||||
bool forwardChange = false;
|
||||
|
||||
if (force || (m_settings.m_centerFrequency != settings.m_centerFrequency)
|
||||
|| (m_settings.m_transverterMode != settings.m_transverterMode)
|
||||
|
@ -242,8 +244,9 @@ void FCDProInput::applySettings(const FCDProSettings& settings, bool force)
|
|||
qDebug() << "FCDProInput::applySettings: center freq: " << settings.m_centerFrequency << " Hz"
|
||||
<< " device center freq: " << deviceCenterFrequency << " Hz";
|
||||
|
||||
forwardChange = (m_settings.m_centerFrequency != settings.m_centerFrequency) || force;
|
||||
|
||||
m_settings.m_centerFrequency = settings.m_centerFrequency;
|
||||
signalChange = true;
|
||||
}
|
||||
|
||||
if ((m_settings.m_lnaGainIndex != settings.m_lnaGainIndex) || force)
|
||||
|
@ -428,7 +431,7 @@ void FCDProInput::applySettings(const FCDProSettings& settings, bool force)
|
|||
m_deviceAPI->configureCorrections(m_settings.m_dcBlock, m_settings.m_iqCorrection);
|
||||
}
|
||||
|
||||
if (signalChange)
|
||||
if (forwardChange)
|
||||
{
|
||||
DSPSignalNotification *notif = new DSPSignalNotification(fcd_traits<Pro>::sampleRate, m_settings.m_centerFrequency);
|
||||
m_fileSink->handleMessage(*notif); // forward to file sink
|
||||
|
|
|
@ -53,6 +53,8 @@ FCDProPlusInput::FCDProPlusInput(DeviceSourceAPI *deviceAPI) :
|
|||
sprintf(recFileNameCStr, "test_%d.sdriq", m_deviceAPI->getDeviceUID());
|
||||
m_fileSink = new FileRecord(std::string(recFileNameCStr));
|
||||
m_deviceAPI->addSink(m_fileSink);
|
||||
|
||||
applySettings(m_settings, true);
|
||||
}
|
||||
|
||||
FCDProPlusInput::~FCDProPlusInput()
|
||||
|
@ -218,7 +220,7 @@ bool FCDProPlusInput::handleMessage(const Message& message)
|
|||
|
||||
void FCDProPlusInput::applySettings(const FCDProPlusSettings& settings, bool force)
|
||||
{
|
||||
bool signalChange = false;
|
||||
bool forwardChange = false;
|
||||
|
||||
if (force || (m_settings.m_centerFrequency != settings.m_centerFrequency)
|
||||
|| (m_settings.m_transverterMode != settings.m_transverterMode)
|
||||
|
@ -236,8 +238,9 @@ void FCDProPlusInput::applySettings(const FCDProPlusSettings& settings, bool for
|
|||
qDebug() << "FCDProPlusInput::applySettings: center freq: " << settings.m_centerFrequency << " Hz"
|
||||
<< " device center freq: " << deviceCenterFrequency << " Hz";
|
||||
|
||||
forwardChange = (m_settings.m_centerFrequency != settings.m_centerFrequency) || force;
|
||||
|
||||
m_settings.m_centerFrequency = settings.m_centerFrequency;
|
||||
signalChange = true;
|
||||
}
|
||||
|
||||
if ((m_settings.m_lnaGain != settings.m_lnaGain) || force)
|
||||
|
@ -322,7 +325,7 @@ void FCDProPlusInput::applySettings(const FCDProPlusSettings& settings, bool for
|
|||
m_deviceAPI->configureCorrections(m_settings.m_dcBlock, m_settings.m_iqImbalance);
|
||||
}
|
||||
|
||||
if (signalChange)
|
||||
if (forwardChange)
|
||||
{
|
||||
DSPSignalNotification *notif = new DSPSignalNotification(fcd_traits<ProPlus>::sampleRate, m_settings.m_centerFrequency);
|
||||
m_fileSink->handleMessage(*notif); // forward to file sink
|
||||
|
|
|
@ -56,6 +56,8 @@ HackRFInput::HackRFInput(DeviceSourceAPI *deviceAPI) :
|
|||
m_deviceAPI->addSink(m_fileSink);
|
||||
|
||||
m_deviceAPI->setBuddySharedPtr(&m_sharedParams);
|
||||
|
||||
applySettings(m_settings, true);
|
||||
}
|
||||
|
||||
HackRFInput::~HackRFInput()
|
||||
|
|
|
@ -52,6 +52,8 @@ PlutoSDRInput::PlutoSDRInput(DeviceSourceAPI *deviceAPI) :
|
|||
sprintf(recFileNameCStr, "test_%d.sdriq", m_deviceAPI->getDeviceUID());
|
||||
m_fileSink = new FileRecord(std::string(recFileNameCStr));
|
||||
m_deviceAPI->addSink(m_fileSink);
|
||||
|
||||
applySettings(m_settings, true);
|
||||
}
|
||||
|
||||
PlutoSDRInput::~PlutoSDRInput()
|
||||
|
@ -381,7 +383,7 @@ bool PlutoSDRInput::applySettings(const PlutoSDRInputSettings& settings, bool fo
|
|||
<< " -FIR-> " << m_deviceSampleRates.m_firRate;
|
||||
|
||||
forwardChangeOtherDSP = true;
|
||||
forwardChangeOwnDSP = (m_settings.m_devSampleRate != settings.m_devSampleRate);
|
||||
forwardChangeOwnDSP = (m_settings.m_devSampleRate != settings.m_devSampleRate) || force;
|
||||
}
|
||||
|
||||
if ((m_settings.m_log2Decim != settings.m_log2Decim) || force)
|
||||
|
|
|
@ -59,6 +59,8 @@ RTLSDRInput::RTLSDRInput(DeviceSourceAPI *deviceAPI) :
|
|||
sprintf(recFileNameCStr, "test_%d.sdriq", m_deviceAPI->getDeviceUID());
|
||||
m_fileSink = new FileRecord(std::string(recFileNameCStr));
|
||||
m_deviceAPI->addSink(m_fileSink);
|
||||
|
||||
applySettings(m_settings, true);
|
||||
}
|
||||
|
||||
RTLSDRInput::~RTLSDRInput()
|
||||
|
|
|
@ -53,6 +53,8 @@ SDRPlayInput::SDRPlayInput(DeviceSourceAPI *deviceAPI) :
|
|||
sprintf(recFileNameCStr, "test_%d.sdriq", m_deviceAPI->getDeviceUID());
|
||||
m_fileSink = new FileRecord(std::string(recFileNameCStr));
|
||||
m_deviceAPI->addSink(m_fileSink);
|
||||
|
||||
applySettings(m_settings, true, true);
|
||||
}
|
||||
|
||||
SDRPlayInput::~SDRPlayInput()
|
||||
|
|
Ładowanie…
Reference in New Issue