SceneSwitcher/plugins/base/utils/profile-helpers.cpp
2024-01-27 14:10:34 +01:00

34 lines
712 B
C++

#include "profile-helpers.hpp"
#include "obs-module-helper.hpp"
#include "selection-helpers.hpp"
#include <obs-frontend-api.h>
namespace advss {
void PopulateProfileSelection(QComboBox *box)
{
auto profiles = obs_frontend_get_profiles();
char **temp = profiles;
while (*temp) {
const char *name = *temp;
box->addItem(name);
temp++;
}
bfree(profiles);
box->model()->sort(0);
AddSelectionEntry(
box, obs_module_text("AdvSceneSwitcher.selectProfile"), false);
box->setCurrentIndex(0);
}
std::string GetPathInProfileDir(const char *filePath)
{
auto path = obs_frontend_get_current_profile_path();
std::string result(path);
bfree(path);
return result + "/" + filePath;
}
} // namespace advss