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

REST API: implemented play toggle for Local source and sink plugins

This commit is contained in:
f4exb 2019-12-09 10:23:42 +01:00
parent 282267dc38
commit 6ea3356371
9 changed files with 71 additions and 1 deletions

View File

@ -12,6 +12,9 @@ LocalSinkSettings:
type: integer
filterChainHash:
type: integer
play:
description: boolean (1 to play, 0 to stop)
type: integer
streamIndex:
description: MIMO channel. Not relevant when connected to SI (single Rx).
type: integer

View File

@ -12,6 +12,9 @@ LocalSourceSettings:
type: integer
filterChainHash:
type: integer
play:
description: boolean (1 to play, 0 to stop)
type: integer
streamIndex:
description: MIMO channel. Not relevant when connected to SI (single Rx).
type: integer

View File

@ -12,6 +12,9 @@ LocalSinkSettings:
type: integer
filterChainHash:
type: integer
play:
description: boolean (1 to play, 0 to stop)
type: integer
streamIndex:
description: MIMO channel. Not relevant when connected to SI (single Rx).
type: integer

View File

@ -12,6 +12,9 @@ LocalSourceSettings:
type: integer
filterChainHash:
type: integer
play:
description: boolean (1 to play, 0 to stop)
type: integer
streamIndex:
description: MIMO channel. Not relevant when connected to SI (single Rx).
type: integer

View File

@ -38,6 +38,8 @@ SWGLocalSinkSettings::SWGLocalSinkSettings() {
m_log2_decim_isSet = false;
filter_chain_hash = 0;
m_filter_chain_hash_isSet = false;
play = 0;
m_play_isSet = false;
stream_index = 0;
m_stream_index_isSet = false;
use_reverse_api = 0;
@ -68,6 +70,8 @@ SWGLocalSinkSettings::init() {
m_log2_decim_isSet = false;
filter_chain_hash = 0;
m_filter_chain_hash_isSet = false;
play = 0;
m_play_isSet = false;
stream_index = 0;
m_stream_index_isSet = false;
use_reverse_api = 0;
@ -93,6 +97,7 @@ SWGLocalSinkSettings::cleanup() {
if(reverse_api_address != nullptr) {
delete reverse_api_address;
}
@ -122,6 +127,8 @@ SWGLocalSinkSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&filter_chain_hash, pJson["filterChainHash"], "qint32", "");
::SWGSDRangel::setValue(&play, pJson["play"], "qint32", "");
::SWGSDRangel::setValue(&stream_index, pJson["streamIndex"], "qint32", "");
::SWGSDRangel::setValue(&use_reverse_api, pJson["useReverseAPI"], "qint32", "");
@ -165,6 +172,9 @@ SWGLocalSinkSettings::asJsonObject() {
if(m_filter_chain_hash_isSet){
obj->insert("filterChainHash", QJsonValue(filter_chain_hash));
}
if(m_play_isSet){
obj->insert("play", QJsonValue(play));
}
if(m_stream_index_isSet){
obj->insert("streamIndex", QJsonValue(stream_index));
}
@ -237,6 +247,16 @@ SWGLocalSinkSettings::setFilterChainHash(qint32 filter_chain_hash) {
this->m_filter_chain_hash_isSet = true;
}
qint32
SWGLocalSinkSettings::getPlay() {
return play;
}
void
SWGLocalSinkSettings::setPlay(qint32 play) {
this->play = play;
this->m_play_isSet = true;
}
qint32
SWGLocalSinkSettings::getStreamIndex() {
return stream_index;
@ -317,6 +337,9 @@ SWGLocalSinkSettings::isSet(){
if(m_filter_chain_hash_isSet){
isObjectUpdated = true; break;
}
if(m_play_isSet){
isObjectUpdated = true; break;
}
if(m_stream_index_isSet){
isObjectUpdated = true; break;
}

View File

@ -57,6 +57,9 @@ public:
qint32 getFilterChainHash();
void setFilterChainHash(qint32 filter_chain_hash);
qint32 getPlay();
void setPlay(qint32 play);
qint32 getStreamIndex();
void setStreamIndex(qint32 stream_index);
@ -94,6 +97,9 @@ private:
qint32 filter_chain_hash;
bool m_filter_chain_hash_isSet;
qint32 play;
bool m_play_isSet;
qint32 stream_index;
bool m_stream_index_isSet;

View File

@ -38,6 +38,8 @@ SWGLocalSourceSettings::SWGLocalSourceSettings() {
m_log2_interp_isSet = false;
filter_chain_hash = 0;
m_filter_chain_hash_isSet = false;
play = 0;
m_play_isSet = false;
stream_index = 0;
m_stream_index_isSet = false;
use_reverse_api = 0;
@ -68,6 +70,8 @@ SWGLocalSourceSettings::init() {
m_log2_interp_isSet = false;
filter_chain_hash = 0;
m_filter_chain_hash_isSet = false;
play = 0;
m_play_isSet = false;
stream_index = 0;
m_stream_index_isSet = false;
use_reverse_api = 0;
@ -93,6 +97,7 @@ SWGLocalSourceSettings::cleanup() {
if(reverse_api_address != nullptr) {
delete reverse_api_address;
}
@ -122,6 +127,8 @@ SWGLocalSourceSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&filter_chain_hash, pJson["filterChainHash"], "qint32", "");
::SWGSDRangel::setValue(&play, pJson["play"], "qint32", "");
::SWGSDRangel::setValue(&stream_index, pJson["streamIndex"], "qint32", "");
::SWGSDRangel::setValue(&use_reverse_api, pJson["useReverseAPI"], "qint32", "");
@ -165,6 +172,9 @@ SWGLocalSourceSettings::asJsonObject() {
if(m_filter_chain_hash_isSet){
obj->insert("filterChainHash", QJsonValue(filter_chain_hash));
}
if(m_play_isSet){
obj->insert("play", QJsonValue(play));
}
if(m_stream_index_isSet){
obj->insert("streamIndex", QJsonValue(stream_index));
}
@ -237,6 +247,16 @@ SWGLocalSourceSettings::setFilterChainHash(qint32 filter_chain_hash) {
this->m_filter_chain_hash_isSet = true;
}
qint32
SWGLocalSourceSettings::getPlay() {
return play;
}
void
SWGLocalSourceSettings::setPlay(qint32 play) {
this->play = play;
this->m_play_isSet = true;
}
qint32
SWGLocalSourceSettings::getStreamIndex() {
return stream_index;
@ -317,6 +337,9 @@ SWGLocalSourceSettings::isSet(){
if(m_filter_chain_hash_isSet){
isObjectUpdated = true; break;
}
if(m_play_isSet){
isObjectUpdated = true; break;
}
if(m_stream_index_isSet){
isObjectUpdated = true; break;
}

View File

@ -57,6 +57,9 @@ public:
qint32 getFilterChainHash();
void setFilterChainHash(qint32 filter_chain_hash);
qint32 getPlay();
void setPlay(qint32 play);
qint32 getStreamIndex();
void setStreamIndex(qint32 stream_index);
@ -94,6 +97,9 @@ private:
qint32 filter_chain_hash;
bool m_filter_chain_hash_isSet;
qint32 play;
bool m_play_isSet;
qint32 stream_index;
bool m_stream_index_isSet;