1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-15 12:51:49 -05:00

REST API device and channel actions: FileSource: added seek millis

This commit is contained in:
f4exb 2020-03-09 21:38:30 +01:00
parent 897d13d0b0
commit 4020f66315
3 changed files with 28 additions and 0 deletions

View File

@ -400,6 +400,21 @@ int FileSource::webapiActionsPost(
}
}
if (channelActionsKeys.contains("seekMillis"))
{
int seekMillis = swgFileSourceActions->getSeekMillis();
seekMillis = seekMillis < 0 ? 0 : seekMillis > 1000 ? 1000 : seekMillis;
FileSourceBaseband::MsgConfigureFileSourceSeek *msg
= FileSourceBaseband::MsgConfigureFileSourceSeek::create(seekMillis);
m_basebandSource->getInputMessageQueue()->push(msg);
if (getMessageQueueToGUI())
{
MsgConfigureFileSourceSeek *msgToGUI = MsgConfigureFileSourceSeek::create(seekMillis);
getMessageQueueToGUI()->push(msgToGUI);
}
}
return 202;
}
else

View File

@ -163,6 +163,16 @@ bool FileSourceGUI::handleMessage(const Message& message)
return true;
}
else if (FileSource::MsgConfigureFileSourceSeek::match(message)) // API action "seekms" feedback
{
const FileSource::MsgConfigureFileSourceSeek& notif = (FileSource::MsgConfigureFileSourceSeek&) message;
int seekMillis = notif.getMillis();
ui->navTime->blockSignals(true);
ui->navTime->setValue(seekMillis);
ui->navTime->blockSignals(false);
return true;
}
else
{
return false;

View File

@ -69,3 +69,6 @@ FileSourceActions:
Play or Pause stream
* 0 - Pause
* 1 - Play
seekMillis:
description: Move play cursor to this thousands of total time from the start
type: integer