Skip to content

Commit

Permalink
requesthandler: Add GetSourceFilterKindList
Browse files Browse the repository at this point in the history
Closes #1198
  • Loading branch information
tt2468 committed Jan 16, 2024
1 parent f03e82c commit 444caeb
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/requesthandler/RequestHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
1 change: 1 addition & 0 deletions src/requesthandler/RequestHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ class RequestHandler {
RequestResult SetTBarPosition(const Request &);

// Filters
RequestResult GetSourceFilterKindList(const Request &);
RequestResult GetSourceFilterList(const Request &);
RequestResult GetSourceFilterDefaultSettings(const Request &);
RequestResult CreateSourceFilter(const Request &);
Expand Down
21 changes: 21 additions & 0 deletions src/requesthandler/RequestHandler_Filters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down

0 comments on commit 444caeb

Please sign in to comment.