Utils: Add includeDisabled in GetInputKindList

This commit is contained in:
tt2468 2021-07-22 17:38:32 -07:00
parent d0e05ae45c
commit 7081824bbe
3 changed files with 4 additions and 3 deletions

View File

@ -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);

View File

@ -316,7 +316,7 @@ std::vector<json> Utils::Obs::ListHelper::GetInputList(std::string inputKind)
return inputInfo.inputs;
}
std::vector<std::string> Utils::Obs::ListHelper::GetInputKindList(bool unversioned)
std::vector<std::string> Utils::Obs::ListHelper::GetInputKindList(bool unversioned, bool includeDisabled)
{
std::vector<std::string> ret;
@ -326,7 +326,7 @@ std::vector<std::string> 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)

View File

@ -54,7 +54,7 @@ namespace Utils {
std::vector<json> GetSceneItemList(obs_scene_t *scene, bool basic = false);
std::vector<json> GetTransitionList();
std::vector<json> GetInputList(std::string inputKind = "");
std::vector<std::string> GetInputKindList(bool unversioned = false);
std::vector<std::string> GetInputKindList(bool unversioned = false, bool includeDisabled = false);
}
namespace SearchHelper {