1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-09-27 15:26:33 -04: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

@ -1,6 +1,6 @@
/**
* SDRangel
* This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time ---
* This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time ---
*
* OpenAPI spec version: 4.11.6
* Contact: f4exb06@gmail.com

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;