mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-07-17 16:24:08 -04:00
SampleSourceFifo refactoring and Tx code reorganization
This commit is contained in:
@@ -82,11 +82,10 @@ bool LocalSourceGUI::deserialize(const QByteArray& data)
|
||||
|
||||
bool LocalSourceGUI::handleMessage(const Message& message)
|
||||
{
|
||||
if (LocalSource::MsgSampleRateNotification::match(message))
|
||||
if (LocalSource::MsgBasebandSampleRateNotification::match(message))
|
||||
{
|
||||
LocalSource::MsgSampleRateNotification& notif = (LocalSource::MsgSampleRateNotification&) message;
|
||||
//m_channelMarker.setBandwidth(notif.getSampleRate());
|
||||
m_sampleRate = notif.getSampleRate();
|
||||
LocalSource::MsgBasebandSampleRateNotification& notif = (LocalSource::MsgBasebandSampleRateNotification&) message;
|
||||
m_basebandSampleRate = notif.getBasebandSampleRate();
|
||||
displayRateAndShift();
|
||||
return true;
|
||||
}
|
||||
@@ -110,7 +109,7 @@ LocalSourceGUI::LocalSourceGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, B
|
||||
ui(new Ui::LocalSourceGUI),
|
||||
m_pluginAPI(pluginAPI),
|
||||
m_deviceUISet(deviceUISet),
|
||||
m_sampleRate(0),
|
||||
m_basebandSampleRate(0),
|
||||
m_tickCount(0)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
@@ -168,23 +167,12 @@ void LocalSourceGUI::applySettings(bool force)
|
||||
}
|
||||
}
|
||||
|
||||
void LocalSourceGUI::applyChannelSettings()
|
||||
{
|
||||
if (m_doApplySettings)
|
||||
{
|
||||
LocalSource::MsgConfigureChannelizer *msgChan = LocalSource::MsgConfigureChannelizer::create(
|
||||
m_settings.m_log2Interp,
|
||||
m_settings.m_filterChainHash);
|
||||
m_localSource->getInputMessageQueue()->push(msgChan);
|
||||
}
|
||||
}
|
||||
|
||||
void LocalSourceGUI::displaySettings()
|
||||
{
|
||||
m_channelMarker.blockSignals(true);
|
||||
m_channelMarker.setCenterFrequency(0);
|
||||
m_channelMarker.setTitle(m_settings.m_title);
|
||||
m_channelMarker.setBandwidth(m_sampleRate); // TODO
|
||||
m_channelMarker.setBandwidth(m_basebandSampleRate / (1<<m_settings.m_log2Interp)); // TODO
|
||||
m_channelMarker.setMovable(false); // do not let user move the center arbitrarily
|
||||
m_channelMarker.blockSignals(false);
|
||||
m_channelMarker.setColor(m_settings.m_rgbColor); // activate signal on the last setting only
|
||||
@@ -200,8 +188,8 @@ void LocalSourceGUI::displaySettings()
|
||||
|
||||
void LocalSourceGUI::displayRateAndShift()
|
||||
{
|
||||
int shift = m_shiftFrequencyFactor * m_sampleRate;
|
||||
double channelSampleRate = ((double) m_sampleRate) / (1<<m_settings.m_log2Interp);
|
||||
int shift = m_shiftFrequencyFactor * m_basebandSampleRate;
|
||||
double channelSampleRate = ((double) m_basebandSampleRate) / (1<<m_settings.m_log2Interp);
|
||||
QLocale loc;
|
||||
ui->offsetFrequencyText->setText(tr("%1 Hz").arg(loc.toString(shift)));
|
||||
ui->channelRateText->setText(tr("%1k").arg(QString::number(channelSampleRate / 1000.0, 'g', 5)));
|
||||
@@ -305,6 +293,12 @@ void LocalSourceGUI::on_localDevicesRefresh_clicked(bool checked)
|
||||
updateLocalDevices();
|
||||
}
|
||||
|
||||
void LocalSourceGUI::on_localDevicePlay_toggled(bool checked)
|
||||
{
|
||||
m_settings.m_play = checked;
|
||||
applySettings();
|
||||
}
|
||||
|
||||
void LocalSourceGUI::applyInterpolation()
|
||||
{
|
||||
uint32_t maxHash = 1;
|
||||
@@ -327,7 +321,7 @@ void LocalSourceGUI::applyPosition()
|
||||
ui->filterChainText->setText(s);
|
||||
|
||||
displayRateAndShift();
|
||||
applyChannelSettings();
|
||||
applySettings();
|
||||
}
|
||||
|
||||
void LocalSourceGUI::tick()
|
||||
|
||||
Reference in New Issue
Block a user