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

Method ButtonClicked

Source/TitleBar.cpp:576–618  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

574}
575
576void TitleBar::ButtonClicked(ClickButton* button, double time)
577{
578 if (button == mSaveLayoutButton)
579 {
580 if (GetKeyModifiers() == kModifier_Shift)
581 TheSynth->SaveLayoutAsPopup();
582 else
583 TheSynth->SaveLayout();
584 }
585 if (button == mSaveStateButton)
586 TheSynth->SaveCurrentState();
587 if (button == mSaveStateAsButton)
588 TheSynth->SaveStatePopup();
589 if (button == mLoadStateButton)
590 TheSynth->LoadStatePopup();
591 if (button == mWriteAudioButton)
592 TheSynth->SaveOutput();
593 if (button == mDisplayHelpButton)
594 {
595 float x, y, w, h, butW, butH;
596 mDisplayHelpButton->GetPosition(x, y);
597 mDisplayHelpButton->GetDimensions(butW, butH);
598 mHelpDisplay->GetDimensions(w, h);
599 mHelpDisplay->SetPosition(x - w + butW, y + butH);
600 mHelpDisplay->SetOwningContainer(GetOwningContainer());
601 mHelpDisplay->Show();
602 TheSynth->PushModalFocusItem(mHelpDisplay);
603 sShowInitialHelpOverlay = false;
604 }
605 if (button == mDisplayUserPrefsEditorButton)
606 TheSynth->GetUserPrefsEditor()->Show();
607 if (button == mHomeButton)
608 TheSynth->GetLocationZoomer()->GoHome();
609 if (button == mResetLayoutButton)
610 {
611 auto buttonRect = mResetLayoutButton->GetRect();
612 mNewPatchConfirmPopup.SetOwningContainer(GetOwningContainer());
613 mNewPatchConfirmPopup.SetPosition(buttonRect.x, buttonRect.y + buttonRect.height + 2);
614 TheSynth->PushModalFocusItem(&mNewPatchConfirmPopup);
615 }
616 if (button == mPlayPauseButton)
617 TheSynth->SetAudioPaused(!TheSynth->IsAudioPaused());
618}
619
620void NewPatchConfirmPopup::CreateUIControls()
621{

Callers

nothing calls this directly

Calls 15

GetKeyModifiersFunction · 0.85
SaveLayoutAsPopupMethod · 0.80
SaveCurrentStateMethod · 0.80
SaveStatePopupMethod · 0.80
LoadStatePopupMethod · 0.80
SaveOutputMethod · 0.80
SetOwningContainerMethod · 0.80
PushModalFocusItemMethod · 0.80
GetUserPrefsEditorMethod · 0.80
GoHomeMethod · 0.80
GetLocationZoomerMethod · 0.80
SetAudioPausedMethod · 0.80

Tested by

no test coverage detected