1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-04 16:01:14 -05:00

FileSource: GUI: use file source name from settings directly

This commit is contained in:
f4exb 2021-05-18 11:10:49 +02:00
parent 5b291d3182
commit fc035ad8d5
2 changed files with 4 additions and 8 deletions

View File

@ -81,7 +81,6 @@ bool FileSourceGUI::handleMessage(const Message& message)
{ {
const FileSource::MsgConfigureFileSource& cfg = (FileSource::MsgConfigureFileSource&) message; const FileSource::MsgConfigureFileSource& cfg = (FileSource::MsgConfigureFileSource&) message;
m_settings = cfg.getSettings(); m_settings = cfg.getSettings();
m_fileName = m_settings.m_fileName;
blockApplySettings(true); blockApplySettings(true);
displaySettings(); displaySettings();
blockApplySettings(false); blockApplySettings(false);
@ -188,7 +187,6 @@ FileSourceGUI::FileSourceGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Bas
m_fileSource = (FileSource*) channelTx; m_fileSource = (FileSource*) channelTx;
m_fileSource->setMessageQueueToGUI(getInputMessageQueue()); m_fileSource->setMessageQueueToGUI(getInputMessageQueue());
m_fileName = m_settings.m_fileName;
connect(&(m_deviceUISet->m_deviceAPI->getMasterTimer()), SIGNAL(timeout()), this, SLOT(tick())); connect(&(m_deviceUISet->m_deviceAPI->getMasterTimer()), SIGNAL(timeout()), this, SLOT(tick()));
@ -236,8 +234,7 @@ void FileSourceGUI::applySettings(bool force)
void FileSourceGUI::configureFileName() void FileSourceGUI::configureFileName()
{ {
qDebug() << "FileSourceGui::configureFileName: " << m_fileName.toStdString().c_str(); qDebug() << "FileSourceGui::configureFileName: " << m_settings.m_fileName.toStdString().c_str();
m_settings.m_fileName = m_fileName;
applySettings(); applySettings();
} }
@ -305,7 +302,7 @@ void FileSourceGUI::displaySettings()
displayStreamIndex(); displayStreamIndex();
blockApplySettings(true); blockApplySettings(true);
ui->fileNameText->setText(m_fileName); ui->fileNameText->setText(m_settings.m_fileName);
ui->gain->setValue(m_settings.m_gainDB); ui->gain->setValue(m_settings.m_gainDB);
ui->gainText->setText(tr("%1 dB").arg(m_settings.m_gainDB)); ui->gainText->setText(tr("%1 dB").arg(m_settings.m_gainDB));
ui->interpolationFactor->setCurrentIndex(m_settings.m_log2Interp); ui->interpolationFactor->setCurrentIndex(m_settings.m_log2Interp);
@ -434,8 +431,8 @@ void FileSourceGUI::on_showFileDialog_clicked(bool checked)
if (fileName != "") if (fileName != "")
{ {
m_fileName = fileName; m_settings.m_fileName = fileName;
ui->fileNameText->setText(m_fileName); ui->fileNameText->setText(m_settings.m_fileName);
ui->crcLabel->setStyleSheet("QLabel { background:rgb(79,79,79); }"); ui->crcLabel->setStyleSheet("QLabel { background:rgb(79,79,79); }");
configureFileName(); configureFileName();
} }

View File

@ -56,7 +56,6 @@ private:
FileSourceSettings m_settings; FileSourceSettings m_settings;
int m_sampleRate; int m_sampleRate;
double m_shiftFrequencyFactor; //!< Channel frequency shift factor double m_shiftFrequencyFactor; //!< Channel frequency shift factor
QString m_fileName;
int m_fileSampleRate; int m_fileSampleRate;
quint32 m_fileSampleSize; quint32 m_fileSampleSize;
quint64 m_recordLengthMuSec; quint64 m_recordLengthMuSec;