SceneSwitcher/lib/macro/macro-action.hpp
WarmUpTill 7d0332dd0e Restructure library and plugins
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.
2024-01-27 14:10:34 +01:00

41 lines
926 B
C++

#pragma once
#include "macro-segment.hpp"
#include "macro-ref.hpp"
namespace advss {
class EXPORT MacroAction : public MacroSegment {
public:
MacroAction(Macro *m, bool supportsVariableValue = false);
virtual ~MacroAction() = default;
virtual bool PerformAction() = 0;
virtual bool Save(obs_data_t *obj) const = 0;
virtual bool Load(obs_data_t *obj) = 0;
virtual void LogAction() const;
void SetEnabled(bool);
bool Enabled() const;
static std::string_view GetDefaultID();
private:
bool _enabled = true;
};
class EXPORT MacroRefAction : virtual public MacroAction {
public:
MacroRefAction(Macro *m, bool supportsVariableValue = false);
bool PostLoad() override;
MacroRef _macro;
};
class EXPORT MultiMacroRefAction : virtual public MacroAction {
public:
MultiMacroRefAction(Macro *m, bool supportsVariableValue = false);
bool PostLoad() override;
std::vector<MacroRef> _macros;
};
} // namespace advss