| 464 | } |
| 465 | |
| 466 | void FireAudioProcessorEditor::resized() |
| 467 | { |
| 468 | // This is generally where you'll want to lay out the positions of any |
| 469 | // subcomponents in your editor.. |
| 470 | |
| 471 | // save resized size |
| 472 | processor.setSavedHeight(getHeight()); |
| 473 | processor.setSavedWidth(getWidth()); |
| 474 | |
| 475 | // knobs |
| 476 | const float scale = juce::jmin(getHeight() / (float) INIT_HEIGHT, getWidth() / (float) INIT_WIDTH); |
| 477 | // set look and feel scale |
| 478 | fireLookAndFeel.scale = scale; |
| 479 | bandPanel.scale = scale; |
| 480 | lfoPanel.setScale(scale); |
| 481 | globalPanel.scale = scale; |
| 482 | |
| 483 | juce::Rectangle<int> bounds(getLocalBounds()); |
| 484 | |
| 485 | // ===== Top Bar Layout ===== |
| 486 | const auto topBarHeight = juce::roundToInt(50.0f * scale); |
| 487 | auto topBar = bounds.removeFromTop(topBarHeight); |
| 488 | |
| 489 | // 1. Reserve space for the right logo (which is painted manually) |
| 490 | wingsArea = topBar.removeFromRight(topBar.getHeight()); |
| 491 | |
| 492 | // 2. Reserve space for the left logo (which is painted manually) |
| 493 | logoArea = topBar.removeFromLeft(topBar.getHeight()); |
| 494 | |
| 495 | // 3. Place the HQ button immediately to the right of the logo's space |
| 496 | hqButton.setBounds(topBar.removeFromLeft(topBar.getHeight())); |
| 497 | |
| 498 | // 4. Reserve space for the right logo |
| 499 | topBar.removeFromRight(topBar.getHeight()); |
| 500 | |
| 501 | // 5. The StateComponent takes all the remaining space in the middle |
| 502 | stateComponent.setBounds(topBar); |
| 503 | |
| 504 | // spectrum and filter |
| 505 | if (zoomButton.getToggleState()) |
| 506 | { |
| 507 | specBackground.setBounds(bounds); |
| 508 | processedSpectrum.setBounds(bounds); |
| 509 | originalSpectrum.setBounds(bounds); |
| 510 | multiband.setBounds(bounds); |
| 511 | filterControl.setBounds(bounds); |
| 512 | } |
| 513 | else |
| 514 | { |
| 515 | // 1. spectrum |
| 516 | auto spectrumArea = bounds.removeFromTop(SPEC_HEIGHT); |
| 517 | specBackground.setBounds(spectrumArea); |
| 518 | processedSpectrum.setBounds(spectrumArea); |
| 519 | originalSpectrum.setBounds(spectrumArea); |
| 520 | multiband.setBounds(spectrumArea); |
| 521 | filterControl.setBounds(spectrumArea); |
| 522 | |
| 523 | // 2. Switch |
nothing calls this directly
no test coverage detected