requesthandler: Add GetSourceFilterKindList

Closes #1198
This commit is contained in:
tt2468 2024-01-16 00:03:53 -08:00
parent f03e82c3f8
commit 444caeb1d7
3 changed files with 23 additions and 0 deletions

View File

@ -111,6 +111,7 @@ const std::unordered_map<std::string, RequestMethodHandler> RequestHandler::_han
{"SetTBarPosition", &RequestHandler::SetTBarPosition},
// Filters
{"GetSourceFilterKindList", &RequestHandler::GetSourceFilterKindList},
{"GetSourceFilterList", &RequestHandler::GetSourceFilterList},
{"GetSourceFilterDefaultSettings", &RequestHandler::GetSourceFilterDefaultSettings},
{"CreateSourceFilter", &RequestHandler::CreateSourceFilter},

View File

@ -130,6 +130,7 @@ private:
RequestResult SetTBarPosition(const Request &);
// Filters
RequestResult GetSourceFilterKindList(const Request &);
RequestResult GetSourceFilterList(const Request &);
RequestResult GetSourceFilterDefaultSettings(const Request &);
RequestResult CreateSourceFilter(const Request &);

View File

@ -19,6 +19,27 @@ with this program. If not, see <https://www.gnu.org/licenses/>
#include "RequestHandler.h"
/**
* Gets an array of all available source filter kinds.
*
* Similar to `GetInputKindList`
*
* @responseField sourceFilterKinds | Array<String> | Array of source filter kinds
*
* @requestType GetSourceFilterKindList
* @complexity 2
* @rpcVersion -1
* @initialVersion 5.4.0
* @api requests
* @category filters
*/
RequestResult RequestHandler::GetSourceFilterKindList(const Request &)
{
json responseData;
responseData["sourceFilterKinds"] = Utils::Obs::ArrayHelper::GetFilterKindList();
return RequestResult::Success(responseData);
}
/**
* Gets an array of all of a source's filters.
*