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:
parent
897d13d0b0
commit
4020f66315
@ -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;
|
return 202;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -163,6 +163,16 @@ bool FileSourceGUI::handleMessage(const Message& message)
|
|||||||
|
|
||||||
return true;
|
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
|
else
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
@ -69,3 +69,6 @@ FileSourceActions:
|
|||||||
Play or Pause stream
|
Play or Pause stream
|
||||||
* 0 - Pause
|
* 0 - Pause
|
||||||
* 1 - Play
|
* 1 - Play
|
||||||
|
seekMillis:
|
||||||
|
description: Move play cursor to this thousands of total time from the start
|
||||||
|
type: integer
|
||||||
|
Loading…
Reference in New Issue
Block a user