mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-03-21 17:34:57 -05:00
Rework Macro constructors to support passing GlobalMacroSettings
This commit is contained in:
parent
232cbb06f6
commit
9e20b341d8
|
|
@ -86,9 +86,7 @@ bool AdvSceneSwitcher::AddNewMacro(std::shared_ptr<Macro> &res,
|
|||
return false;
|
||||
}
|
||||
|
||||
res = std::make_shared<Macro>(
|
||||
name, GetGlobalMacroSettings()._newMacroRegisterHotkeys,
|
||||
GetGlobalMacroSettings()._newMacroUseShortCircuitEvaluation);
|
||||
res = std::make_shared<Macro>(name, GetGlobalMacroSettings());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
#include "macro-condition-factory.hpp"
|
||||
#include "macro-dock.hpp"
|
||||
#include "macro-helpers.hpp"
|
||||
#include "macro-settings.hpp"
|
||||
#include "plugin-state-helpers.hpp"
|
||||
#include "splitter-helpers.hpp"
|
||||
#include "sync-helpers.hpp"
|
||||
|
|
@ -76,15 +77,21 @@ namespace advss {
|
|||
|
||||
static std::deque<std::shared_ptr<Macro>> macros;
|
||||
|
||||
Macro::Macro(const std::string &name, const bool addHotkey,
|
||||
const bool shortCircuitEvaluation)
|
||||
Macro::Macro(const std::string &name)
|
||||
{
|
||||
SetName(name);
|
||||
if (addHotkey) {
|
||||
}
|
||||
|
||||
Macro::Macro(const std::string &name, const GlobalMacroSettings &settings)
|
||||
: Macro(name)
|
||||
{
|
||||
if (settings._newMacroRegisterHotkeys) {
|
||||
SetupHotkeys();
|
||||
}
|
||||
_registerHotkeys = addHotkey;
|
||||
_useShortCircuitEvaluation = shortCircuitEvaluation;
|
||||
_registerHotkeys = settings._newMacroRegisterHotkeys;
|
||||
_checkInParallel = settings._newMacroCheckInParallel;
|
||||
_useShortCircuitEvaluation =
|
||||
settings._newMacroUseShortCircuitEvaluation;
|
||||
}
|
||||
|
||||
Macro::~Macro()
|
||||
|
|
@ -104,7 +111,8 @@ std::shared_ptr<Macro>
|
|||
Macro::CreateGroup(const std::string &name,
|
||||
std::vector<std::shared_ptr<Macro>> &children)
|
||||
{
|
||||
auto group = std::make_shared<Macro>(name, false);
|
||||
auto group = std::make_shared<Macro>(name);
|
||||
group->_registerHotkeys = false;
|
||||
for (auto &c : children) {
|
||||
c->SetParent(group);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
namespace advss {
|
||||
|
||||
class MacroDock;
|
||||
class GlobalMacroSettings;
|
||||
|
||||
class Macro {
|
||||
using TimePoint = std::chrono::high_resolution_clock::time_point;
|
||||
|
|
@ -27,8 +28,8 @@ class Macro {
|
|||
public:
|
||||
enum class PauseStateSaveBehavior { PERSIST, PAUSE, UNPAUSE };
|
||||
|
||||
Macro(const std::string &name = "", const bool addHotkey = false,
|
||||
const bool shortCircuitEvaluation = false);
|
||||
Macro(const std::string &name = "");
|
||||
Macro(const std::string &name, const GlobalMacroSettings &settings);
|
||||
~Macro();
|
||||
|
||||
std::string Name() const { return _name; }
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user