1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-10 01:49:27 -04:00

File Input: loop handling phase 2

This commit is contained in:
f4exb
2018-10-14 01:52:40 +02:00
parent bb1e3f3933
commit 2c87e67057
3 changed files with 58 additions and 6 deletions
@@ -40,6 +40,7 @@ MESSAGE_CLASS_DEFINITION(FileSourceInput::MsgConfigureFileSourceWork, Message)
MESSAGE_CLASS_DEFINITION(FileSourceInput::MsgConfigureFileSourceSeek, Message)
MESSAGE_CLASS_DEFINITION(FileSourceInput::MsgConfigureFileSourceStreamTiming, Message)
MESSAGE_CLASS_DEFINITION(FileSourceInput::MsgStartStop, Message)
MESSAGE_CLASS_DEFINITION(FileSourceInput::MsgPlayPause, Message)
MESSAGE_CLASS_DEFINITION(FileSourceInput::MsgReportFileSourceAcquisition, Message)
MESSAGE_CLASS_DEFINITION(FileSourceInput::MsgReportFileSourceStreamData, Message)
MESSAGE_CLASS_DEFINITION(FileSourceInput::MsgReportFileSourceStreamTiming, Message)
@@ -332,7 +333,8 @@ bool FileSourceInput::handleMessage(const Message& message)
if (m_fileSourceThread != 0)
{
if (getMessageQueueToGUI()) {
if (getMessageQueueToGUI())
{
report = MsgReportFileSourceStreamTiming::create(m_fileSourceThread->getSamplesCount());
getMessageQueueToGUI()->push(report);
}
@@ -364,11 +366,25 @@ bool FileSourceInput::handleMessage(const Message& message)
qDebug() << "FileSourceInput::handleMessage: MsgReportEOF";
m_fileSourceThread->stopWork();
if (getMessageQueueToGUI())
{
MsgReportFileSourceStreamTiming *report = MsgReportFileSourceStreamTiming::create(m_fileSourceThread->getSamplesCount());
getMessageQueueToGUI()->push(report);
}
if (m_settings.m_loop)
{
seekFileStream(0);
m_fileSourceThread->startWork();
}
else
{
if (getMessageQueueToGUI())
{
MsgPlayPause *report = MsgPlayPause::create(false);
getMessageQueueToGUI()->push(report);
}
}
return true;
}