@@ -743,6 +743,18 @@ void AdvSceneSwitcher::ShowMacroContextMenu(const QPoint &pos)
743743 obs_module_text (" AdvSceneSwitcher.macroTab.remove" ), this ,
744744 &AdvSceneSwitcher::on_macroRemove_clicked);
745745 remove->setDisabled (ui->macros ->SelectionEmpty ());
746+
747+ menu.addSeparator ();
748+
749+ auto pause = menu.addAction (
750+ obs_module_text (" AdvSceneSwitcher.macroTab.pause" ), this ,
751+ &AdvSceneSwitcher::PauseSelectedMacros);
752+ pause->setDisabled (ui->macros ->SelectionEmpty ());
753+
754+ auto unpause = menu.addAction (
755+ obs_module_text (" AdvSceneSwitcher.macroTab.unpause" ), this ,
756+ &AdvSceneSwitcher::UnpauseSelectedMacros);
757+ unpause->setDisabled (ui->macros ->SelectionEmpty ());
746758 menu.addSeparator ();
747759
748760 auto group = menu.addAction (
@@ -805,6 +817,46 @@ void AdvSceneSwitcher::CopyMacro()
805817 MacroSignalManager::Instance ()->Add (QString::fromStdString (name));
806818}
807819
820+ void AdvSceneSwitcher::PauseSelectedMacros ()
821+ {
822+ auto selectedMacros = GetSelectedMacros ();
823+ if (selectedMacros.empty ()) {
824+ return ;
825+ }
826+ auto lock = LockContext ();
827+ for (const auto ¯o : selectedMacros) {
828+ if (macro->IsGroup ()) {
829+ for (const auto &subitem :
830+ GetGroupMacroEntries (macro.get ())) {
831+ subitem->SetPaused (true );
832+ }
833+ } else {
834+ macro->SetPaused (true );
835+ }
836+ }
837+ ui->macros ->UpdateRunningStates ();
838+ }
839+
840+ void AdvSceneSwitcher::UnpauseSelectedMacros ()
841+ {
842+ auto selectedMacros = GetSelectedMacros ();
843+ if (selectedMacros.empty ()) {
844+ return ;
845+ }
846+ auto lock = LockContext ();
847+ for (const auto ¯o : selectedMacros) {
848+ if (macro->IsGroup ()) {
849+ for (const auto &subitem :
850+ GetGroupMacroEntries (macro.get ())) {
851+ subitem->SetPaused (false );
852+ }
853+ } else {
854+ macro->SetPaused (false );
855+ }
856+ }
857+ ui->macros ->UpdateRunningStates ();
858+ }
859+
808860bool MacroTabIsInFocus ()
809861{
810862 return AdvSceneSwitcher::window &&
0 commit comments