mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
Utils: Add GetSceneCount()
This commit is contained in:
parent
fb0656c31e
commit
8a45560297
@ -153,6 +153,24 @@ uint64_t Utils::Obs::NumberHelper::GetOutputDuration(obs_output_t *output)
|
||||
return util_mul_div64(totalFrames, frameTimeNs, 1000000ULL);
|
||||
}
|
||||
|
||||
size_t Utils::Obs::NumberHelper::GetSceneCount()
|
||||
{
|
||||
size_t ret;
|
||||
auto sceneEnumProc = [](void *param, obs_source_t *scene) {
|
||||
auto ret = reinterpret_cast<size_t*>(param);
|
||||
|
||||
if (obs_source_is_group(scene))
|
||||
return true;
|
||||
|
||||
(*ret)++;
|
||||
return true;
|
||||
};
|
||||
|
||||
obs_enum_scenes(sceneEnumProc, &ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::vector<std::string> Utils::Obs::ListHelper::GetSceneCollectionList()
|
||||
{
|
||||
char** sceneCollections = obs_frontend_get_scene_collections();
|
||||
|
@ -40,6 +40,7 @@ namespace Utils {
|
||||
|
||||
namespace NumberHelper {
|
||||
uint64_t GetOutputDuration(obs_output_t *output);
|
||||
size_t GetSceneCount();
|
||||
}
|
||||
|
||||
namespace ListHelper {
|
||||
|
Loading…
Reference in New Issue
Block a user