mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-03-22 01:44:49 -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.
36 lines
1.1 KiB
C++
36 lines
1.1 KiB
C++
#pragma once
|
|
#include "macro-condition.hpp"
|
|
|
|
#include <memory>
|
|
|
|
namespace advss {
|
|
|
|
struct MacroConditionInfo {
|
|
using CreateCondition = std::shared_ptr<MacroCondition> (*)(Macro *m);
|
|
using CreateConditionWidget =
|
|
QWidget *(*)(QWidget *parent, std::shared_ptr<MacroCondition>);
|
|
CreateCondition _create = nullptr;
|
|
CreateConditionWidget _createWidget = nullptr;
|
|
std::string _name;
|
|
bool _useDurationModifier = true;
|
|
};
|
|
|
|
class MacroConditionFactory {
|
|
public:
|
|
MacroConditionFactory() = delete;
|
|
EXPORT static bool Register(const std::string &, MacroConditionInfo);
|
|
static std::shared_ptr<MacroCondition> Create(const std::string &,
|
|
Macro *m);
|
|
static QWidget *CreateWidget(const std::string &id, QWidget *parent,
|
|
std::shared_ptr<MacroCondition>);
|
|
static auto GetConditionTypes() { return GetMap(); }
|
|
static std::string GetConditionName(const std::string &);
|
|
static std::string GetIdByName(const QString &name);
|
|
static bool UsesDurationModifier(const std::string &id);
|
|
|
|
private:
|
|
static std::map<std::string, MacroConditionInfo> &GetMap();
|
|
};
|
|
|
|
} // namespace advss
|