1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-23 01:55:48 -05:00

File Input: extended acceleration up to x1000

This commit is contained in:
f4exb 2018-10-14 02:58:14 +02:00
parent db4ba51360
commit 85f7e69da5
3 changed files with 21 additions and 2 deletions

View File

@ -475,6 +475,21 @@
<string>100</string> <string>100</string>
</property> </property>
</item> </item>
<item>
<property name="text">
<string>200</string>
</property>
</item>
<item>
<property name="text">
<string>500</string>
</property>
</item>
<item>
<property name="text">
<string>1k</string>
</property>
</item>
</widget> </widget>
</item> </item>
<item> <item>

View File

@ -174,7 +174,7 @@ bool FileSourceInput::start()
m_ifstream.seekg(sizeof(FileRecord::Header), std::ios::beg); m_ifstream.seekg(sizeof(FileRecord::Header), std::ios::beg);
} }
if(!m_sampleFifo.setSize(m_sampleRate * sizeof(Sample))) { if(!m_sampleFifo.setSize(m_settings.m_accelerationFactor * m_sampleRate * sizeof(Sample))) {
qCritical("Could not allocate SampleFifo"); qCritical("Could not allocate SampleFifo");
return false; return false;
} }
@ -405,6 +405,10 @@ bool FileSourceInput::applySettings(const FileSourceSettings& settings, bool for
if (m_fileSourceThread) if (m_fileSourceThread)
{ {
QMutexLocker mutexLocker(&m_mutex); QMutexLocker mutexLocker(&m_mutex);
if (!m_sampleFifo.setSize(m_settings.m_accelerationFactor * m_sampleRate * sizeof(Sample))) {
qCritical("FileSourceInput::applySettings: could not reallocate sample FIFO size to %lu",
m_settings.m_accelerationFactor * m_sampleRate * sizeof(Sample));
}
m_fileSourceThread->setSampleRateAndSize(settings.m_accelerationFactor * m_sampleRate, m_sampleSize); // Fast Forward: 1 corresponds to live. 1/2 is half speed, 2 is double speed m_fileSourceThread->setSampleRateAndSize(settings.m_accelerationFactor * m_sampleRate, m_sampleSize); // Fast Forward: 1 corresponds to live. 1/2 is half speed, 2 is double speed
} }
} }

View File

@ -18,7 +18,7 @@
#include "filesourcesettings.h" #include "filesourcesettings.h"
const unsigned int FileSourceSettings::m_accelerationMaxScale = 1; const unsigned int FileSourceSettings::m_accelerationMaxScale = 2;
FileSourceSettings::FileSourceSettings() FileSourceSettings::FileSourceSettings()
{ {