From 7081824bbe5274b7d955af616e2ba2eddb36d4bb Mon Sep 17 00:00:00 2001 From: tt2468 Date: Thu, 22 Jul 2021 17:38:32 -0700 Subject: [PATCH] Utils: Add includeDisabled in GetInputKindList --- src/requesthandler/RequestHandler_Config.cpp | 1 + src/utils/Obs.cpp | 4 ++-- src/utils/Utils.h | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/requesthandler/RequestHandler_Config.cpp b/src/requesthandler/RequestHandler_Config.cpp index 37dd7ef4..75ee4c2b 100644 --- a/src/requesthandler/RequestHandler_Config.cpp +++ b/src/requesthandler/RequestHandler_Config.cpp @@ -208,6 +208,7 @@ RequestResult RequestHandler::SetStreamServiceSettings(const Request& request) if (streamServiceType == requestedStreamServiceType) { OBSDataAutoRelease currentStreamServiceSettings = obs_service_get_settings(currentStreamService); + // TODO: Add `overlay` field OBSDataAutoRelease newStreamServiceSettings = obs_data_create(); obs_data_apply(newStreamServiceSettings, currentStreamServiceSettings); obs_data_apply(newStreamServiceSettings, requestedStreamServiceSettings); diff --git a/src/utils/Obs.cpp b/src/utils/Obs.cpp index de5f7fdc..97f6d682 100644 --- a/src/utils/Obs.cpp +++ b/src/utils/Obs.cpp @@ -316,7 +316,7 @@ std::vector Utils::Obs::ListHelper::GetInputList(std::string inputKind) return inputInfo.inputs; } -std::vector Utils::Obs::ListHelper::GetInputKindList(bool unversioned) +std::vector Utils::Obs::ListHelper::GetInputKindList(bool unversioned, bool includeDisabled) { std::vector ret; @@ -326,7 +326,7 @@ std::vector Utils::Obs::ListHelper::GetInputKindList(bool unversion while (obs_enum_input_types2(idx++, &kind, &unversioned_kind)) { uint32_t caps = obs_get_source_output_flags(kind); - if ((caps & OBS_SOURCE_CAP_DISABLED) != 0) + if (!includeDisabled && (caps & OBS_SOURCE_CAP_DISABLED) != 0) continue; if (unversioned) diff --git a/src/utils/Utils.h b/src/utils/Utils.h index b3925d29..b1c0906e 100644 --- a/src/utils/Utils.h +++ b/src/utils/Utils.h @@ -54,7 +54,7 @@ namespace Utils { std::vector GetSceneItemList(obs_scene_t *scene, bool basic = false); std::vector GetTransitionList(); std::vector GetInputList(std::string inputKind = ""); - std::vector GetInputKindList(bool unversioned = false); + std::vector GetInputKindList(bool unversioned = false, bool includeDisabled = false); } namespace SearchHelper {