Add StopAllMacros() helper

This commit is contained in:
WarmUpTill
2024-01-26 23:42:02 +01:00
committed by WarmUpTill
parent d237e3fe4e
commit 462c3445e3
3 changed files with 9 additions and 0 deletions

View File

@@ -57,6 +57,7 @@ EXPORT bool CheckMacros();
EXPORT bool RunMacroActions(Macro *);
EXPORT bool RunMacros();
void StopAllMacros();
EXPORT void LoadMacros(obs_data_t *obj);
EXPORT void SaveMacros(obs_data_t *obj);

View File

@@ -1303,6 +1303,13 @@ bool RunMacros()
return true;
}
void StopAllMacros()
{
for (const auto &m : macros) {
m->Stop();
}
}
Macro *GetMacroByName(const char *name)
{
for (const auto &m : macros) {

View File

@@ -209,6 +209,7 @@ void SaveMacros(obs_data_t *obj);
std::deque<std::shared_ptr<Macro>> &GetMacros();
bool CheckMacros();
bool RunMacros();
void StopAllMacros();
Macro *GetMacroByName(const char *name);
Macro *GetMacroByQString(const QString &name);
std::weak_ptr<Macro> GetWeakMacroByName(const char *name);