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

pull/489/head
f4exb 2020-03-09 21:38:30 +01:00
rodzic 897d13d0b0
commit 4020f66315
3 zmienionych plików z 28 dodań i 0 usunięć

Wyświetl plik

@ -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

Wyświetl plik

@ -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;

Wyświetl plik

@ -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