mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-09-24 18:23:39 -05:00
Add the option to execute another macro's actions
This commit is contained in:
@@ -305,6 +305,7 @@ AdvSceneSwitcher.action.macro="Macro"
|
||||
AdvSceneSwitcher.action.macro.type.pause="Pause"
|
||||
AdvSceneSwitcher.action.macro.type.unpause="Unpause"
|
||||
AdvSceneSwitcher.action.macro.type.resetCounter="Reset counter"
|
||||
AdvSceneSwitcher.action.macro.type.run="Run"
|
||||
AdvSceneSwitcher.action.macro.entry="{{actions}} {{macros}}"
|
||||
AdvSceneSwitcher.action.pluginState="Plugin state"
|
||||
AdvSceneSwitcher.action.pluginState.type.stop="Stop the Advanced Scene Switcher plugin"
|
||||
|
||||
@@ -8,6 +8,7 @@ enum class PerformMacroAction {
|
||||
PAUSE,
|
||||
UNPAUSE,
|
||||
RESET_COUNTER,
|
||||
RUN,
|
||||
};
|
||||
|
||||
class MacroActionMacro : public MacroRefAction {
|
||||
|
||||
@@ -15,6 +15,7 @@ const static std::map<PerformMacroAction, std::string> actionTypes = {
|
||||
"AdvSceneSwitcher.action.macro.type.unpause"},
|
||||
{PerformMacroAction::RESET_COUNTER,
|
||||
"AdvSceneSwitcher.action.macro.type.resetCounter"},
|
||||
{PerformMacroAction::RUN, "AdvSceneSwitcher.action.macro.type.run"},
|
||||
};
|
||||
|
||||
bool MacroActionMacro::PerformAction()
|
||||
@@ -33,6 +34,9 @@ bool MacroActionMacro::PerformAction()
|
||||
case PerformMacroAction::RESET_COUNTER:
|
||||
_macro->ResetCount();
|
||||
break;
|
||||
case PerformMacroAction::RUN:
|
||||
_macro->PerformAction();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -55,6 +59,10 @@ void MacroActionMacro::LogAction()
|
||||
vblog(LOG_INFO, "reset counter for \"%s\"",
|
||||
_macro->Name().c_str());
|
||||
break;
|
||||
case PerformMacroAction::RUN:
|
||||
vblog(LOG_INFO, "run nested macro \"%s\"",
|
||||
_macro->Name().c_str());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user