mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-02-03 09:44:01 -05:00
FileSink: give .sdriq extension to provided file name automatically. Fixes #780
This commit is contained in:
parent
ecc27467c1
commit
b865d995a4
@ -264,10 +264,28 @@ void FileSinkSink::applySettings(const FileSinkSettings& settings, bool force)
|
||||
<< "m_fileRecordName: " << settings.m_fileRecordName
|
||||
<< "force: " << force;
|
||||
|
||||
QString fileRecordName = settings.m_fileRecordName;
|
||||
|
||||
if ((settings.m_fileRecordName != m_settings.m_fileRecordName) || force)
|
||||
{
|
||||
QStringList dotBreakout = settings.m_fileRecordName.split(QLatin1Char('.'));
|
||||
|
||||
if (dotBreakout.size() > 1) {
|
||||
QString extension = dotBreakout.last();
|
||||
|
||||
if (extension != "sdriq") {
|
||||
dotBreakout.last() = "sdriq";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dotBreakout.append("sdriq");
|
||||
}
|
||||
|
||||
fileRecordName = dotBreakout.join(QLatin1Char('.'));
|
||||
|
||||
QString fileBase;
|
||||
FileRecordInterface::RecordType recordType = FileRecordInterface::guessTypeFromFileName(settings.m_fileRecordName, fileBase);
|
||||
FileRecordInterface::RecordType recordType = FileRecordInterface::guessTypeFromFileName(fileRecordName, fileBase);
|
||||
|
||||
if (recordType == FileRecordInterface::RecordTypeSdrIQ)
|
||||
{
|
||||
@ -293,6 +311,7 @@ void FileSinkSink::applySettings(const FileSinkSettings& settings, bool force)
|
||||
}
|
||||
|
||||
m_settings = settings;
|
||||
m_settings.m_fileRecordName = fileRecordName;
|
||||
}
|
||||
|
||||
void FileSinkSink::squelchRecording(bool squelchOpen)
|
||||
|
@ -13,6 +13,9 @@ Each recording is written in a new file with the starting timestamp before the `
|
||||
- Given file name: `test.first.sdriq` then a recording file will be like: `test.2020-08-05T22_00_07_974.sdriq`
|
||||
- Given file name: `record.test.first.sdriq` then a recording file will be like: `reocrd.test.2020-08-05T21_39_52_974.sdriq`
|
||||
|
||||
If a filename is given without `.sdriq` extension then the `.sdriq` extension is appended automatically before the above algorithm is applied.
|
||||
If a filename is given with an extension different of `.sdriq` then the extension is replaced by `.sdriq` automatically before the above algorithm is applied.
|
||||
|
||||
<h2>Interface</h2>
|
||||
|
||||
![File Sink plugin GUI](../../../doc/img/FileSink_plugin.png)
|
||||
|
Loading…
Reference in New Issue
Block a user