MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / ResetLayout

Method ResetLayout

Source/ModularSynth.cpp:2356–2455  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2354}
2355
2356void ModularSynth::ResetLayout()
2357{
2358 mMainComponent->getTopLevelComponent()->setName("bespoke synth");
2359 mCurrentSaveStatePath = "";
2360
2361 mModuleContainer.Clear();
2362 mUILayerModuleContainer.Clear();
2363
2364 for (int i = 0; i < mDeletedModules.size(); ++i)
2365 delete mDeletedModules[i];
2366
2367 mDeletedModules.clear();
2368 mSources.clear();
2369 mLissajousDrawers.clear();
2370 mMoveModule = nullptr;
2371 TheTransport->ClearListenersAndPollers();
2372 TheScale->ClearListeners();
2373 LFOPool::Shutdown();
2374 IKeyboardFocusListener::ClearActiveKeyboardFocus(!K(notifyListeners));
2375 ScriptModule::sBackgroundTextString = "";
2376 ScriptModule::sHasLoadedUntrustedScript = false; //reset
2377 ScriptModule::sScriptsRequestingInitExecution.clear();
2378
2379 mErrors.clear();
2380
2381 std::vector<PatchCable*> cablesToDelete = mPatchCables;
2382 for (auto cable : cablesToDelete)
2383 delete cable;
2384 assert(mPatchCables.size() == 0); //everything should have been cleared out by that
2385
2386 gBindToUIControl = nullptr;
2387 mModalFocusItemStack.clear();
2388 gHoveredUIControl = nullptr;
2389 mLastClickedModule = nullptr;
2390
2391 LFOPool::Init();
2392 mZoomer.Init();
2393
2394 delete TheTitleBar;
2395 delete TheSaveDataPanel;
2396 delete mQuickSpawn;
2397 delete mUserPrefsEditor;
2398 delete mNoteOutputQueue;
2399
2400 TitleBar* titleBar = new TitleBar();
2401 titleBar->SetPosition(0, 0);
2402 titleBar->SetName("titlebar");
2403 titleBar->SetTypeName("titlebar", kModuleCategory_Other);
2404 titleBar->CreateUIControls();
2405 titleBar->SetModuleFactory(&mModuleFactory);
2406 titleBar->Init();
2407 mUILayerModuleContainer.AddModule(titleBar);
2408
2409 if (UserPrefs.show_minimap.Get())
2410 {
2411 mMinimap = std::make_unique<Minimap>();
2412 mMinimap->SetName("minimap");
2413 mMinimap->SetTypeName("minimap", kModuleCategory_Other);

Callers

nothing calls this directly

Calls 15

sizeMethod · 0.80
ClearListenersMethod · 0.80
SetTypeNameMethod · 0.80
AddModuleMethod · 0.80
GetMethod · 0.80
SetShouldDrawOutlineMethod · 0.80
ClearMethod · 0.45
InitMethod · 0.45
SetPositionMethod · 0.45
SetNameMethod · 0.45

Tested by

no test coverage detected