| 711 | } |
| 712 | |
| 713 | void FireAudioProcessorEditor::buttonClicked(juce::Button* clickedButton) |
| 714 | { |
| 715 | if (clickedButton == stateComponent.getToggleABButton()) |
| 716 | { |
| 717 | stateComponent.getProcStateAB()->toggleAB(); |
| 718 | |
| 719 | if (clickedButton->getButtonText() == "A") |
| 720 | clickedButton->setButtonText("B"); |
| 721 | else |
| 722 | clickedButton->setButtonText("A"); |
| 723 | multiband.resortAndRedrawLines(); |
| 724 | } |
| 725 | if (multiband.getStateComponent().getChangedState()) |
| 726 | { |
| 727 | multiband.setFocusIndex(0); |
| 728 | multiband.getStateComponent().setChangedState(false); |
| 729 | } |
| 730 | if (clickedButton == &zoomButton) |
| 731 | { |
| 732 | // Since setClickingTogglesState is false, we manually toggle the state. |
| 733 | // This flips the state from its previous value. |
| 734 | zoomButton.setToggleState(! zoomButton.getToggleState(), juce::dontSendNotification); |
| 735 | |
| 736 | const bool isNowZoomed = zoomButton.getToggleState(); |
| 737 | |
| 738 | // Define all components that are hidden when zoomed. |
| 739 | std::vector<juce::Component*> componentsToHideOnZoom; |
| 740 | componentsToHideOnZoom.push_back(&windowLeftButton); |
| 741 | componentsToHideOnZoom.push_back(&windowRightButton); |
| 742 | componentsToHideOnZoom.push_back(&windowLfoButton); |
| 743 | |
| 744 | // Distortion modes are now in BandPanel, so we don't hide them here. |
| 745 | // 失真模式现在在BandPanel中,所以我们不在这里隐藏它们。 |
| 746 | |
| 747 | // Set visibility for the top-level controls. |
| 748 | // If we are zoomed, these are NOT visible. If not zoomed, they ARE visible. |
| 749 | for (auto* comp : componentsToHideOnZoom) |
| 750 | comp->setVisible(! isNowZoomed); |
| 751 | |
| 752 | if (isNowZoomed) |
| 753 | { |
| 754 | // When entering zoom, hide all main panels. |
| 755 | bandPanel.setVisible(false); |
| 756 | globalPanel.setVisible(false); |
| 757 | lfoPanel.setVisible(false); |
| 758 | } |
| 759 | else |
| 760 | { |
| 761 | // When exiting zoom, restore the correct panel visibility using our helper function. |
| 762 | updateMainPanelVisibility(); |
| 763 | } |
| 764 | resized(); |
| 765 | } |
| 766 | if (clickedButton == &windowLeftButton || clickedButton == &windowRightButton || clickedButton == &windowLfoButton) |
| 767 | { |
| 768 | updateMainPanelVisibility(); |
| 769 | resized(); |
| 770 | } |
nothing calls this directly
no test coverage detected