mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-09-07 17:16:00 -05:00
Move getSourceSettings() to utility
This commit is contained in:
@@ -21,6 +21,7 @@ OBSWeakSource GetWeakTransitionByQString(const QString &name);
|
||||
OBSWeakSource GetWeakFilterByName(OBSWeakSource source, const char *name);
|
||||
OBSWeakSource GetWeakFilterByQString(OBSWeakSource source, const QString &name);
|
||||
bool compareIgnoringLineEnding(QString &s1, QString &s2);
|
||||
std::string getSourceSettings(OBSWeakSource ws);
|
||||
|
||||
/**
|
||||
* Populate layout with labels and widgets based on provided text
|
||||
|
||||
@@ -21,17 +21,6 @@ static std::map<SourceCondition, std::string> sourceConditionTypes = {
|
||||
"AdvSceneSwitcher.condition.source.type.settings"},
|
||||
};
|
||||
|
||||
std::string getSourceSettings(OBSWeakSource ws)
|
||||
{
|
||||
auto s = obs_weak_source_get_source(ws);
|
||||
obs_data_t *data = obs_source_get_settings(s);
|
||||
std::string settings = obs_data_get_json(data);
|
||||
obs_data_release(data);
|
||||
obs_source_release(s);
|
||||
|
||||
return settings;
|
||||
}
|
||||
|
||||
bool checkSettings(const OBSWeakSource &source, const std::string &settings,
|
||||
bool useRegex)
|
||||
{
|
||||
|
||||
@@ -207,6 +207,17 @@ bool compareIgnoringLineEnding(QString &s1, QString &s2)
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string getSourceSettings(OBSWeakSource ws)
|
||||
{
|
||||
auto s = obs_weak_source_get_source(ws);
|
||||
obs_data_t *data = obs_source_get_settings(s);
|
||||
std::string settings = obs_data_get_json(data);
|
||||
obs_data_release(data);
|
||||
obs_source_release(s);
|
||||
|
||||
return settings;
|
||||
}
|
||||
|
||||
bool DisplayMessage(const QString &msg, bool question)
|
||||
{
|
||||
if (question) {
|
||||
|
||||
Reference in New Issue
Block a user