MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / CopyMacro

Method CopyMacro

lib/macro/macro-tab.cpp:779–804  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

777}
778
779void AdvSceneSwitcher::CopyMacro()
780{
781 const auto macro = GetSelectedMacro();
782 if (!macro) {
783 return;
784 }
785
786 std::string format = macro->Name() + " %1";
787 std::string name;
788 std::shared_ptr<Macro> newMacro;
789 if (!AddNewMacro(newMacro, name, format)) {
790 return;
791 }
792
793 OBSDataAutoRelease data = obs_data_create();
794 macro->Save(data, true);
795 newMacro->Load(data);
796 newMacro->PostLoad();
797 newMacro->SetName(name);
798 RunAndClearPostLoadSteps();
799 Macro::PrepareMoveToGroup(macro->Parent(), newMacro);
800
801 ui->macros->Add(newMacro, macro);
802 disableAddButtonHighlight();
803 MacroSignalManager::Instance()->Add(QString::fromStdString(name));
804}
805
806bool MacroTabIsInFocus()
807{

Callers

nothing calls this directly

Calls 9

ParentMethod · 0.80
RunAndClearPostLoadStepsFunction · 0.50
NameMethod · 0.45
SaveMethod · 0.45
LoadMethod · 0.45
PostLoadMethod · 0.45
SetNameMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected