Utils: Add Obs::ListHelper::GetInputKindList()

This commit is contained in:
tt2468 2021-06-16 01:31:36 -07:00
parent 428e437429
commit 4d77927ceb
2 changed files with 23 additions and 0 deletions

View File

@ -231,6 +231,28 @@ std::vector<json> Utils::Obs::ListHelper::GetTransitionList()
return ret;
}
std::vector<std::string> Utils::Obs::ListHelper::GetInputKindList(bool unversioned)
{
std::vector<std::string> ret;
size_t idx = 0;
const char *kind;
const char *unversioned_kind;
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)
continue;
if (unversioned)
ret.push_back(unversioned_kind);
else
ret.push_back(kind);
}
return ret;
}
obs_hotkey_t *Utils::Obs::SearchHelper::GetHotkeyByName(std::string name)
{
auto hotkeys = ListHelper::GetHotkeyList();

View File

@ -48,6 +48,7 @@ namespace Utils {
std::vector<json> GetSceneList();
std::vector<json> GetSceneItemList(obs_scene_t *scene, bool basic = false);
std::vector<json> GetTransitionList();
std::vector<std::string> GetInputKindList(bool unversioned = false);
}
namespace SearchHelper {