mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-03-21 17:34:57 -05:00
The "core" macro conditions and actions have been extracted out to the "base" plugin. The library now mostly contains functionality which is required across all plugins and (e.g. definitions for macro segments). The goal is to reduce the complexity and cross-dependencies and group the source files in a better way. This should relsove the "library limit of 65535 objects exceeded" build issue occuring in some Windows build environments.
71 lines
1.2 KiB
C++
71 lines
1.2 KiB
C++
#include "macro-action.hpp"
|
|
|
|
namespace advss {
|
|
|
|
MacroAction::MacroAction(Macro *m, bool supportsVariableValue)
|
|
: MacroSegment(m, supportsVariableValue)
|
|
{
|
|
}
|
|
|
|
bool MacroAction::Save(obs_data_t *obj) const
|
|
{
|
|
MacroSegment::Save(obj);
|
|
obs_data_set_string(obj, "id", GetId().c_str());
|
|
obs_data_set_bool(obj, "enabled", _enabled);
|
|
return true;
|
|
}
|
|
|
|
bool MacroAction::Load(obs_data_t *obj)
|
|
{
|
|
MacroSegment::Load(obj);
|
|
obs_data_set_default_bool(obj, "enabled", true);
|
|
_enabled = obs_data_get_bool(obj, "enabled");
|
|
return true;
|
|
}
|
|
|
|
void MacroAction::LogAction() const
|
|
{
|
|
vblog(LOG_INFO, "performed action %s", GetId().c_str());
|
|
}
|
|
|
|
void MacroAction::SetEnabled(bool value)
|
|
{
|
|
_enabled = value;
|
|
}
|
|
|
|
bool MacroAction::Enabled() const
|
|
{
|
|
return _enabled;
|
|
}
|
|
|
|
std::string_view MacroAction::GetDefaultID()
|
|
{
|
|
return "scene_switch";
|
|
}
|
|
|
|
MacroRefAction::MacroRefAction(Macro *m, bool supportsVariableValue)
|
|
: MacroAction(m, supportsVariableValue)
|
|
{
|
|
}
|
|
|
|
bool MacroRefAction::PostLoad()
|
|
{
|
|
_macro.PostLoad();
|
|
return true;
|
|
}
|
|
|
|
MultiMacroRefAction::MultiMacroRefAction(Macro *m, bool supportsVariableValue)
|
|
: MacroAction(m, supportsVariableValue)
|
|
{
|
|
}
|
|
|
|
bool MultiMacroRefAction::PostLoad()
|
|
{
|
|
for (auto ¯o : _macros) {
|
|
macro.PostLoad();
|
|
}
|
|
return true;
|
|
}
|
|
|
|
} // namespace advss
|