1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-26 09:48:45 -05:00

Tx ph.1: Fixed sample rate and center frequency handling in File Sink

This commit is contained in:
f4exb 2016-10-23 10:38:44 +02:00
parent 119127fdab
commit e42a717c69
4 changed files with 18 additions and 16 deletions

View File

@ -246,14 +246,17 @@ void FileSinkGui::on_startStop_toggled(bool checked)
{
if (m_deviceAPI->initGeneration())
{
m_deviceAPI->startGeneration();
DSPEngine::instance()->startAudio();
if (!m_deviceAPI->startGeneration())
{
qDebug("FileSinkGui::on_startStop_toggled: device start failed");
}
// DSPEngine::instance()->startAudio(); // TODO: activate when audio input is available
}
}
else
{
m_deviceAPI->stopGeneration();
DSPEngine::instance()->stopAudio();
// DSPEngine::instance()->stopAudio(); // TODO: activate when audio input is available
}
}

View File

@ -40,10 +40,8 @@ FileSinkOutput::FileSinkOutput(DeviceSinkAPI *deviceAPI, const QTimer& masterTim
m_deviceAPI(deviceAPI),
m_settings(),
m_fileSinkThread(0),
m_deviceDescription(),
m_fileName("..."),
m_sampleRate(0),
m_centerFrequency(0),
m_deviceDescription("FileSink"),
m_fileName("./test.sdriq"),
m_startingTimeStamp(0),
m_masterTimer(masterTimer)
{
@ -90,10 +88,9 @@ bool FileSinkOutput::start(int device)
return false;
}
m_fileSinkThread->setSamplerate(m_sampleRate);
m_fileSinkThread->setSamplerate(m_settings.m_sampleRate);
m_fileSinkThread->connectTimer(m_masterTimer);
m_fileSinkThread->startWork();
m_deviceDescription = "FileSink";
mutexLocker.unlock();
//applySettings(m_generalSettings, m_settings, true);
@ -117,8 +114,6 @@ void FileSinkOutput::stop()
m_fileSinkThread = 0;
}
m_deviceDescription.clear();
MsgReportFileSinkGeneration *report = MsgReportFileSinkGeneration::create(false); // acquisition off
getOutputMessageQueueToGUI()->push(report);
}
@ -130,12 +125,12 @@ const QString& FileSinkOutput::getDeviceDescription() const
int FileSinkOutput::getSampleRate() const
{
return m_sampleRate;
return m_settings.m_sampleRate;
}
quint64 FileSinkOutput::getCenterFrequency() const
{
return m_centerFrequency;
return m_settings.m_centerFrequency;
}
std::time_t FileSinkOutput::getStartingTimeStamp() const
@ -210,6 +205,12 @@ void FileSinkOutput::applySettings(const FileSinkSettings& settings, bool force)
if (force || (m_settings.m_sampleRate != settings.m_sampleRate))
{
m_settings.m_sampleRate = settings.m_sampleRate;
if (m_fileSinkThread != 0)
{
m_fileSinkThread->setSamplerate(m_settings.m_sampleRate);
}
forwardChange = true;
}

View File

@ -170,8 +170,6 @@ private:
FileSinkThread* m_fileSinkThread;
QString m_deviceDescription;
QString m_fileName;
int m_sampleRate;
quint64 m_centerFrequency;
std::time_t m_startingTimeStamp;
const QTimer& m_masterTimer;

View File

@ -337,7 +337,7 @@ DSPDeviceSinkEngine::State DSPDeviceSinkEngine::gotoRunning()
break;
}
if(m_deviceSampleSink == NULL) {
if(m_deviceSampleSink == 0) {
return gotoError("DSPDeviceSinkEngine::gotoRunning: No sample source configured");
}