From fd30b978971c8b18c566fdc3f906333890e187f8 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sat, 31 Oct 2026 21:39:35 +0700 Subject: [PATCH 1/3] perf(gui): isolate live LCD canvas and coalesce idle repaint without DSP changes --- docs/GUI-PERFORMANCE.md | 18 +++++++++++++ plugin/Editor.cpp | 58 ++++++++++++++++++++++++++++++++++------- plugin/Editor.h | 15 +++++++++++ tests/PluginSmoke.cpp | 11 ++++++++ 4 files changed, 92 insertions(+), 10 deletions(-) create mode 100644 docs/GUI-PERFORMANCE.md diff --git a/docs/GUI-PERFORMANCE.md b/docs/GUI-PERFORMANCE.md new file mode 100644 index 0000000..f7c5a43 --- /dev/null +++ b/docs/GUI-PERFORMANCE.md @@ -0,0 +1,18 @@ +# ArSonComp GUI Performance — isolated LCD (2026-10-31) + +## User observation +Task Manager screenshot: 0.4% CPU, 46.4 MB process memory and 2.7% GPU at one instant. These are not host callback duration, continuous memory growth, nor proof of a memory leak. Audio stutter cannot be diagnosed from one Task Manager sample. + +## Change +- Split live graph/IN/GR/OUT into an **opaque child canvas**. Parent GUI paints the cached brushed chassis, toolbar and fixed hardware controls. Only the graph canvas receives continuous timer invalidation, preventing re-execution of the parent's text, material and header drawing every meter tick. +- Full canvas draws pre-rendered black LCD/grid plus actual signals/meters. MINI repaints only the 47px meter well. All image decoding and path generation remain on JUCE message thread. +- Preserve native threshold drag by forwarding graph canvas mouse coordinates to parent editor. APVTS automation and host callbacks remain untouched. +- Coalesce idle repaint requests when no new SPSC telemetry, no stopped-transport history ageing, and no perceptible meter decay. Keep the 30 Hz live visualization while active. +- Restore the intended 740×585 minimum / 780×640 default resize limits. No new audio worker, mutex, audio allocation, latency, DSP modification, or file I/O from processBlock. + +## Test gate +- Actual Windows VST3 + Standalone, JUCE GUI render screenshots at minimum/default/SIDECHAIN/MINI; engine-safety test on Linux. +- Editor smoke asserts the opaque child bounds at 740×585, 780×640 and MINI, plus restored FULL layout. +- Physical Windows interface/DAW comparison is still required for GUI on/off, same driver/buffer and 30–60-minute run; measure actual xrun counters and sustained CPU/GPU and memory, not Task Manager snapshot alone. + +Technical reference: JUCE developer ADC 2025 session on component hierarchy, opaque components, cached painting and avoiding repeated work in paint: https://conference.audio.dev/session/2025/understanding-juce-drawing/ diff --git a/plugin/Editor.cpp b/plugin/Editor.cpp index fbd6f9a..e92015c 100644 --- a/plugin/Editor.cpp +++ b/plugin/Editor.cpp @@ -321,6 +321,9 @@ Editor::Editor(Processor& p):AudioProcessorEditor(p),processor(p),alternate(p.sn k.setComponentID("param."+juce::String(spec.id)); k.onValueChange=[this,i] { if(hoveredParameter==i)updateHoverReadout(i); + if(i==arson::Threshold || i==arson::Ratio || + i==arson::Knee || i==arson::Range) + graphCanvas.repaint(); }; juce::String shortLabel=juce::String(spec.name).toUpperCase(); if(i==arson::Highpass) shortLabel="HP"; @@ -461,6 +464,7 @@ Editor::Editor(Processor& p):AudioProcessorEditor(p),processor(p),alternate(p.sn } }; addAndMakeVisible(compact); + addAndMakeVisible(graphCanvas); hoverReadout.setComponentID("view.value.readout"); hoverReadout.setFont(juce::FontOptions(11.0f)); hoverReadout.setColour(juce::Label::textColourId,accentBright); @@ -473,7 +477,7 @@ Editor::Editor(Processor& p):AudioProcessorEditor(p),processor(p),alternate(p.sn presets.setSelectedId(0,juce::dontSendNotification); presets.setText("Custom / restored",juce::dontSendNotification); setResizable(true,true); - setResizeLimits(860,700,1200,965); + setResizeLimits(740,585,1200,965); setSize(780,640); syncPanelVisibility(); startTimerHz(30); @@ -486,6 +490,33 @@ Editor::~Editor() { parameter->endChangeGesture(); setLookAndFeel(nullptr); } +void Editor::GraphCanvas::paint(juce::Graphics& g) { + if(owner.compactMode) { + if(owner.metalSurface.isValid()) + g.drawImageAt(owner.metalSurface,-getX(),-getY()); + else g.fillAll(juce::Colour{0xff0b1014}); + juce::Graphics::ScopedSaveState saved(g); + g.setOrigin(-getX(),-getY()); + owner.paintCompactMeters(g); + } else { + if(owner.grid.isValid())g.drawImageAt(owner.grid,0,0); + else g.fillAll(juce::Colour{0xff070b0d}); + owner.drawDisplay(g); + } +} +void Editor::GraphCanvas::mouseDown(const juce::MouseEvent& e) { + owner.mouseDown(e.getEventRelativeTo(&owner)); +} +void Editor::GraphCanvas::mouseDrag(const juce::MouseEvent& e) { + owner.mouseDrag(e.getEventRelativeTo(&owner)); +} +void Editor::GraphCanvas::mouseUp(const juce::MouseEvent& e) { + owner.mouseUp(e.getEventRelativeTo(&owner)); +} +void Editor::GraphCanvas::mouseMove(const juce::MouseEvent& e) { + owner.mouseMove(e.getEventRelativeTo(&owner)); + setMouseCursor(owner.getMouseCursor()); +} void Editor::setValue(std::size_t i,float value) { if(auto* parameter=processor.state.getParameter(arson::specs[i].id)) { parameter->beginChangeGesture(); @@ -601,6 +632,8 @@ void Editor::resized() { external.setBounds(detX+detW+8,bottomY+42,extW,30); listen.setBounds(detX+detW+extW+16,bottomY+42,listenW,30); const int readoutW=juce::jmin(254,w-40); + graphCanvas.setBounds(compactMode + ? juce::Rectangle{13,258,w-26,47} : display); hoverReadout.setBounds(compactMode?w-readoutW-14: display.getCentreX()-readoutW/2, compactMode?h-21:display.getBottom()-27,readoutW,18); @@ -703,6 +736,8 @@ void Editor::timerCallback() { outPeaks[i]=std::max(outPeaks[i],frame.outputChannel[i]); } } + const auto previousInput=inputDb,previousOutput=outputDb,previousGr=gr; + const auto previousInChannels=inChannelDb,previousOutChannels=outChannelDb; // Time-based visual smoothing: attack remains responsive (~18 ms) while // falloff is calm (~210 ms). No change to real detector or DSP latency. const double now=juce::Time::getMillisecondCounterHiRes(); @@ -730,8 +765,14 @@ void Editor::timerCallback() { std::max(1,static_cast(std::round(elapsed*100.0)))); } if(!compactMode && (received>0 || aged>0))rebuildHistoryPaths(); - if(compactMode)repaint(14,298,getWidth()-28,57); - else repaint(display); + bool meterChanged=std::abs(inputDb-previousInput)>0.03f || + std::abs(outputDb-previousOutput)>0.03f || + std::abs(gr-previousGr)>0.015f; + for(std::size_t i=0;i<2;++i) + meterChanged=meterChanged || + std::abs(inChannelDb[i]-previousInChannels[i])>0.03f || + std::abs(outChannelDb[i]-previousOutChannels[i])>0.03f; + if(received>0 || aged>0 || meterChanged)graphCanvas.repaint(); } void Editor::rebuildHistoryPaths() { @@ -831,10 +872,7 @@ void Editor::paint(juce::Graphics& g) { g.setColour(accent.withAlpha(0.68f)); g.fillRoundedRectangle(sidechainPanel?115.0f:17.0f, static_cast(bottomY+22),sidechainPanel?91.0f:88.0f,1.8f,1.0f); - if(!compactMode) { - if(grid.isValid())g.drawImageAt(grid,display.getX(),display.getY()); - drawDisplay(g); - } else paintCompactMeters(g); + // Cached chassis/header are static; the live LCD is an opaque child. g.setColour(text.withAlpha(0.66f)); g.setFont(juce::FontOptions(9.0f)); g.drawText("0 SAMPLES ADDED / REALTIME DSP", @@ -901,8 +939,8 @@ void Editor::drawMeter(juce::Graphics& g,juce::Rectangle bounds, } void Editor::drawDisplay(juce::Graphics& g) { juce::Graphics::ScopedSaveState save(g); - g.reduceClipRegion(display); - g.setOrigin(display.getPosition()); + g.reduceClipRegion(juce::Rectangle{0,0, + display.getWidth(),display.getHeight()}); const auto plot=plotBounds().translated(-static_cast(display.getX()), -static_cast(display.getY())); if(plot.isEmpty())return; @@ -1044,7 +1082,7 @@ void Editor::mouseDrag(const juce::MouseEvent& event) { parameter->setValueNotifyingHost(parameter->convertTo0to1(threshold)); hoveredParameter=arson::Threshold; updateHoverReadout(hoveredParameter); - repaint(display); + graphCanvas.repaint(); } void Editor::mouseUp(const juce::MouseEvent&) { if(!thresholdDragging)return; diff --git a/plugin/Editor.h b/plugin/Editor.h index fbb92fb..973fc0f 100644 --- a/plugin/Editor.h +++ b/plugin/Editor.h @@ -35,6 +35,20 @@ class Editor final : public juce::AudioProcessorEditor, private juce::Timer { void mouseMove(const juce::MouseEvent&) override; void mouseEnter(const juce::MouseEvent&) override; private: + class GraphCanvas final : public juce::Component { + public: + explicit GraphCanvas(Editor& p) : owner(p) { + setComponentID("view.graph.canvas"); + setOpaque(true); + } + void paint(juce::Graphics&) override; + void mouseDown(const juce::MouseEvent&) override; + void mouseDrag(const juce::MouseEvent&) override; + void mouseUp(const juce::MouseEvent&) override; + void mouseMove(const juce::MouseEvent&) override; + private: + Editor& owner; + }; void timerCallback() override; void applyPreset(int); void setValue(std::size_t,float); @@ -52,6 +66,7 @@ class Editor final : public juce::AudioProcessorEditor, private juce::Timer { CompLook look; std::array knobs; std::array labels; + GraphCanvas graphCanvas{*this}; juce::Label hoverReadout; std::size_t hoveredParameter=arson::Threshold; using SliderAttachment=juce::AudioProcessorValueTreeState::SliderAttachment; diff --git a/tests/PluginSmoke.cpp b/tests/PluginSmoke.cpp index 757f723..8bf8ed8 100644 --- a/tests/PluginSmoke.cpp +++ b/tests/PluginSmoke.cpp @@ -423,6 +423,12 @@ int main(int argc,char** argv) { // No floating tooltip obscures the hardware control strip. if(!slider->getTooltip().isEmpty())return 49; } + // Opaque live meter canvas isolates timer repaints from chassis. + auto* canvas=editor->findChildWithID("view.graph.canvas"); + const auto expectedCanvas=juce::Rectangle{ + 8,70,editor->getWidth()-16,editor->getHeight()-268}; + if(!canvas || !canvas->isVisible() || !canvas->isOpaque() || + canvas->getBounds()!=expectedCanvas)return 70; auto* readout=dynamic_cast( editor->findChildWithID("view.value.readout")); if(!readout || !readout->isVisible() || @@ -562,6 +568,8 @@ int main(int argc,char** argv) { if(!mini || !mini->onClick)return 10; mini->onClick(); if(editor->getHeight()!=330)return 11; + if(canvas->getBounds()!=juce::Rectangle{ + 13,258,editor->getWidth()-26,47})return 71; auto compactImage=editor->createComponentSnapshot(editor->getLocalBounds()); if(compactImage.isNull() || compactImage.getHeight()!=330)return 12; if(argc>1) { @@ -572,6 +580,9 @@ int main(int argc,char** argv) { } mini->onClick(); if(editor->getHeight()!=640)return 14; + if(canvas->getBounds()!=juce::Rectangle{ + 8,70,editor->getWidth()-16,editor->getHeight()-268}) + return 72; } auto image=editor->createComponentSnapshot(editor->getLocalBounds()); if(image.isNull())return 3; From 2879375373aecae08f599b2924995fe2b0fde15a Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sat, 31 Oct 2026 21:42:54 +0700 Subject: [PATCH 2/3] M4: compact 704x520 chassis, remove noisy header rules, enforce readable captions --- AGENTS.md | 5 +++ docs/WINDOWS-QUICKSTART.md | 8 +++- plugin/Editor.cpp | 90 ++++++++++++++++++-------------------- plugin/Editor.h | 2 +- plugin/HeaderLayout.h | 34 +++++++++----- tests/PluginSmoke.cpp | 45 ++++++++++++++----- 6 files changed, 111 insertions(+), 73 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 8b32b94..75f63e7 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -14,3 +14,8 @@ - Always reconcile the GUI development branch and M2 realtime-performance branch before producing a Windows test binary. An artifact from one branch alone is not a combined release. - Host bypass must pass the first block bit-exactly and must not latch the parameter bypass state. User bypass remains a smoothed, separately attached parameter. - Build M3 in one PR with both Windows JUCE editor smoke and Linux sanitizer, inspect four actual Windows screenshots and benchmark/stress files before declaring ready-to-test. Do not call CI throughput a hardware xrun proof. + +## M4 compact GUI gate +- Default FULL 704x520, minimum 660x490; MINI remains 330 high. Do not increase default GUI size without measuring element collision and user workflow. +- Header has no decorative separator rules. Only MODEL and PRESET need small captions; buttons self-label. Maintain >=4.5:1 contrast between static captions and their dark metal background, using the shared palette contract. +- Inspect screenshots from compiled JUCE at default/minimum, MINI and SIDECHAIN; preserve readable controls, meters, telemetry, preset and APVTS bindings. GUI changes must never modify engine DSP or latency. diff --git a/docs/WINDOWS-QUICKSTART.md b/docs/WINDOWS-QUICKSTART.md index 00f3584..2267147 100644 --- a/docs/WINDOWS-QUICKSTART.md +++ b/docs/WINDOWS-QUICKSTART.md @@ -19,7 +19,7 @@ Run `Standalone/ArSonComp.exe`. Select the input/output device in the standalone - Vocal: listen for pumping, sibilance, level consistency and dry/wet behavior. - Bass: use low frequencies and aggressive attack to check distortion and filter interactions. - Transients: check drums with attack/hold/release; zero lookahead is not a true-peak limiter. -- UI: switch MINI/FULL; resize to 740x585 and 780x640, then try a larger window. Confirm bottom LCD value readout, labels, metering, and HP/LP controls. +- UI: switch MINI/FULL; resize to 660x490 and 704x520, then try a larger window. Confirm bottom LCD value readout, labels, metering, and HP/LP controls. - Project: save, close, reload; confirm host parameters, style, bypass and input/output routing. - For performance, use multiple instances in your host and compare CPU with plugin editors hidden/visible. @@ -35,7 +35,7 @@ Check upper central transfer graph, red fading curve and live gain reduction lin ### Compact responsive GUI and bottom-of-LCD value display -The editor now defaults to **780×640**, with **740×585** minimum full size and **330px** high MINI. FULL restores the preceding expanded dimensions. The primary rotary row is shorter, Sidechain positions adapt to the editor width, and the actual meter/graph canvas retains useful space. +The editor now defaults to **704×520**, with **660×490** minimum full size and **330px** high MINI. FULL restores the preceding expanded dimensions. The primary rotary row is shorter, Sidechain positions adapt to the editor width, and the actual meter/graph canvas retains useful space. Hover or drag **any** rotary knob or horizontal slider to show its name, exact value and unit in the **bottom centre of the black LCD**. The last focused value remains visible rather than flashing away. MINI uses the right-hand footer for the readout. There are **no overlay value bubbles or TooltipWindow**, so nothing obscures the controls. Double-click a knob or slider to restore its factory value. The JUCE APVTS host-automation attachments and audio DSP remain unchanged. @@ -58,3 +58,7 @@ All rotary knobs retain their coral sector behind the black brushed-metal face a ### Premium brushed-metal and glass UI The updated full editor should now have a horizontally brushed grey metal background and a recessed jet-black LCD for the dynamics history/transfer graph and segmented IN/GR/OUT meters. The knob area is shorter, leaving more room for the screen. Range/Hold/Mix/Link/HP/LP rails have a deep shadowed well sized to the original metallic thumb; all toggle captions appear on the left of their switches, including ACTIVE/BYPASS in the header. Both DYNAMICS and SIDECHAIN pages, MINI, old presets/automation and all audio routes continue working. No plugin audio processing or added algorithmic sample delay has changed. + +### M4 compact, readable chassis + +The editor now defaults to **704×520**, with **660×490** as the minimum FULL layout and an unchanged 330px-high MINI view. Compared with the old 780×640 default, the window consumes approximately 27% less screen area without indiscriminately shrinking knobs. All header separators and unnecessary overline captions are removed; the only header captions are MODEL and PRESET. Brushed panel label contrast is checked by automated WCAG-style tests (>=4.5:1 against dark metal reference). The preset remains width-bounded. The footer technical slogan has been removed to prioritize the live value readout. Test at both minimum/default size and with the SIDECHAIN tab selected. diff --git a/plugin/Editor.cpp b/plugin/Editor.cpp index fbd6f9a..00f724c 100644 --- a/plugin/Editor.cpp +++ b/plugin/Editor.cpp @@ -79,7 +79,10 @@ CompLook::CompLook() { setColour(juce::TextButton::textColourOffId,text); setColour(juce::ToggleButton::textColourId,text); setColour(juce::ToggleButton::tickColourId,accent); - setColour(juce::Label::textColourId,muted); + // Metal panel text uses a high-contrast neutral; muted gray on metal + // was unreadable in real 780px screenshots. + setColour(juce::Label::textColourId, + juce::Colour{arson::ui::EditorMetrics::controlCaptionRgb}); } // Satin-finished combo surfaces: recessed but legible on a brushed chassis. void CompLook::drawComboBox(juce::Graphics& g,int width,int height,bool down, @@ -327,7 +330,9 @@ Editor::Editor(Processor& p):AudioProcessorEditor(p),processor(p),alternate(p.sn if(i==arson::Lowpass) shortLabel="LP"; if(i==arson::Link) shortLabel="LINK"; labels[i].setText(shortLabel,juce::dontSendNotification); - labels[i].setFont(juce::FontOptions(11.0f)); + labels[i].setFont(juce::FontOptions(11.3f)); + labels[i].setColour(juce::Label::textColourId, + juce::Colour{arson::ui::EditorMetrics::controlCaptionRgb}); labels[i].setJustificationType(juce::Justification::centred); addAndMakeVisible(labels[i]); addAndMakeVisible(k); @@ -451,11 +456,17 @@ Editor::Editor(Processor& p):AudioProcessorEditor(p),processor(p),alternate(p.sn compactMode=!compactMode; if(compactMode) { expandedWidth=getWidth();expandedHeight=getHeight(); - setResizeLimits(740,330,1200,330); + setResizeLimits(arson::ui::EditorMetrics::minWidth, + arson::ui::EditorMetrics::miniHeight, + arson::ui::EditorMetrics::maxWidth, + arson::ui::EditorMetrics::miniHeight); compact.setButtonText("FULL"); - setSize(expandedWidth,330); + setSize(expandedWidth,arson::ui::EditorMetrics::miniHeight); } else { - setResizeLimits(740,585,1200,965); + setResizeLimits(arson::ui::EditorMetrics::minWidth, + arson::ui::EditorMetrics::minHeight, + arson::ui::EditorMetrics::maxWidth, + arson::ui::EditorMetrics::maxHeight); compact.setButtonText("MINI"); setSize(expandedWidth,expandedHeight); } @@ -473,8 +484,12 @@ Editor::Editor(Processor& p):AudioProcessorEditor(p),processor(p),alternate(p.sn presets.setSelectedId(0,juce::dontSendNotification); presets.setText("Custom / restored",juce::dontSendNotification); setResizable(true,true); - setResizeLimits(860,700,1200,965); - setSize(780,640); + setResizeLimits(arson::ui::EditorMetrics::minWidth, + arson::ui::EditorMetrics::minHeight, + arson::ui::EditorMetrics::maxWidth, + arson::ui::EditorMetrics::maxHeight); + setSize(arson::ui::EditorMetrics::defaultWidth, + arson::ui::EditorMetrics::defaultHeight); syncPanelVisibility(); startTimerHz(30); } @@ -546,8 +561,7 @@ void Editor::syncPanelVisibility() { } void Editor::resized() { const int w=getWidth(),h=getHeight(); - // A shared compact header grid: every control has the same baseline. - // Preset is constrained to 144..176px rather than consuming all free space. + // Compact header grid (124..154px preset); same baseline at 660..1040px. const auto header=arson::ui::HeaderLayout::calculate(w); compact.setBounds(header.mini); style.setBounds(header.model); @@ -557,8 +571,9 @@ void Editor::resized() { bypass.setBounds(header.bypass); // Compact responsive hardware chassis; LCD still has its own display. display=compactMode?juce::Rectangle{}: - juce::Rectangle{8,70,w-16,h-268}; - const int mainY=compactMode?68:display.getBottom()+5; + juce::Rectangle{8,arson::ui::EditorMetrics::displayTop, + w-16,h-arson::ui::EditorMetrics::displayBottomReserve}; + const int mainY=compactMode?66:display.getBottom()+5; const int cell=(w-28)/7; constexpr std::array main{arson::Input,arson::Attack, arson::Release,arson::Threshold,arson::Ratio,arson::Knee,arson::Makeup}; @@ -568,7 +583,8 @@ void Editor::resized() { knobs[i].setBounds(x+3,mainY+20,cell-6,70); } - const int bottomY=compactMode?166:h-92; + const int bottomY=compactMode?166: + h-arson::ui::EditorMetrics::bottomControlsReserve; dynamicsTab.setBounds(16,bottomY+1,92,23); sidechainTab.setBounds(114,bottomY+1,94,23); // Main tab: four comfortable controls, plus a dedicated AUTO control. @@ -776,13 +792,9 @@ void Editor::rebuildHistoryPaths() { void Editor::paint(juce::Graphics& g) { if(metalSurface.isValid())g.drawImageAt(metalSurface,0,0); else g.fillAll(juce::Colour{0xff454a4d}); - // Soft satin chassis divisions remain visible over fine brushed grain. - g.setColour(juce::Colours::black.withAlpha(0.22f)); - g.fillRect(0,0,getWidth(),68); - g.setColour(juce::Colours::white.withAlpha(0.12f)); - g.drawHorizontalLine(1,0.0f,static_cast(getWidth())); - g.setColour(juce::Colours::black.withAlpha(0.58f)); - g.drawHorizontalLine(67,0.0f,static_cast(getWidth())); + // Quiet header group: contrast by surface tone, not divider strokes. + g.setColour(juce::Colours::black.withAlpha(0.23f)); + g.fillRect(0,0,getWidth(),arson::ui::EditorMetrics::headerHeight); // Single-line embossed brand and a quiet, consistent overline hierarchy. const auto header=arson::ui::HeaderLayout::calculate(getWidth()); if(headerLogo.isValid()) { @@ -795,39 +807,23 @@ void Editor::paint(juce::Graphics& g) { g.setFont(juce::FontOptions(17.0f)); g.drawText("ArSonComp",header.logo,juce::Justification::centredLeft); } - // Subtle division between branding and functional toolbar; no visual noise. - g.setColour(juce::Colours::white.withAlpha(0.10f)); - g.drawVerticalLine(header.logo.getRight()+5,18.0f,52.0f); - g.setColour(muted.withAlpha(0.85f)); - g.setFont(juce::FontOptions(8.7f)); + // Labels only for dropdowns; the other buttons identify themselves. + g.setColour(juce::Colour{arson::ui::EditorMetrics::captionRgb}); + g.setFont(juce::FontOptions(9.5f)); const auto caption=[&g](const char* title,const juce::Rectangle& r) { - g.drawText(title,r.getX()+1,9,r.getWidth()-2,12, + g.drawText(title,r.getX()+1,7,r.getWidth()-2,12, juce::Justification::centredLeft,false); }; - caption("VIEW",header.mini); caption("MODEL",header.model); caption("PRESET",header.preset); - caption("COMPARE",header.compare); - caption("FILES",header.file); - caption("ENGINE",header.bypass); - const int mainY=compactMode?68:display.getBottom()+5; - const int bottomY=compactMode?166:getHeight()-92; + const int mainY=compactMode?66:display.getBottom()+5; + const int bottomY=compactMode?166: + getHeight()-arson::ui::EditorMetrics::bottomControlsReserve; g.setColour(juce::Colours::black.withAlpha(0.105f)); g.fillRect(8,mainY,getWidth()-16,bottomY-mainY); - g.setColour(juce::Colours::black.withAlpha(0.40f)); - g.drawHorizontalLine(mainY,12.0f,static_cast(getWidth()-12)); - g.drawHorizontalLine(bottomY,12.0f,static_cast(getWidth()-12)); - g.setColour(juce::Colours::white.withAlpha(0.09f)); - g.drawHorizontalLine(mainY+1,12.0f,static_cast(getWidth()-12)); - g.drawHorizontalLine(bottomY+1,12.0f,static_cast(getWidth()-12)); - const int cell=(getWidth()-28)/7; - for(int i=1;i<7;++i) { - g.setColour(juce::Colours::black.withAlpha(0.15f)); - const float x=14.0f+static_cast(i*cell); - g.drawVerticalLine(static_cast(x),static_cast(mainY+17), - static_cast(mainY+90)); - } + // Remove six knob-cell fences and doubled chrome rules: whitespace + // and dark surfaces provide grouping with less visual interference. g.setColour(accent.withAlpha(0.68f)); g.fillRoundedRectangle(sidechainPanel?115.0f:17.0f, static_cast(bottomY+22),sidechainPanel?91.0f:88.0f,1.8f,1.0f); @@ -835,10 +831,8 @@ void Editor::paint(juce::Graphics& g) { if(grid.isValid())g.drawImageAt(grid,display.getX(),display.getY()); drawDisplay(g); } else paintCompactMeters(g); - g.setColour(text.withAlpha(0.66f)); - g.setFont(juce::FontOptions(9.0f)); - g.drawText("0 SAMPLES ADDED / REALTIME DSP", - 14,getHeight()-18,232,14,juce::Justification::left); + // The footer is intentionally clear: the LCD already shows exact values. + // Eliminating the tiny technical slogan avoids visual competition. } void Editor::refreshTransfer(const arson::Parameters& p,juce::Rectangle plot) { const std::array key{{p[arson::Threshold],p[arson::Ratio], diff --git a/plugin/Editor.h b/plugin/Editor.h index fbb92fb..9c42c3c 100644 --- a/plugin/Editor.h +++ b/plugin/Editor.h @@ -67,7 +67,7 @@ class Editor final : public juce::AudioProcessorEditor, private juce::Timer { arson::Parameters alternate, presetSnapshot; bool alternateActive=false; bool compactMode=false,thresholdDragging=false,sidechainPanel=false; - int expandedWidth=780,expandedHeight=640; + int expandedWidth=704,expandedHeight=520; std::array history{}; std::size_t head=0; float inputDb=-120,outputDb=-120,gr=0; diff --git a/plugin/HeaderLayout.h b/plugin/HeaderLayout.h index 0d9288e..92b3b9f 100644 --- a/plugin/HeaderLayout.h +++ b/plugin/HeaderLayout.h @@ -3,26 +3,40 @@ namespace arson::ui { -// Single geometry source for JUCE resized(), brand painting and smoke tests. -// Compact presets never displace the model, A/B, file menu or main bypass. +// One canonical geometry/contrast contract for the compact live compressor. +// Keep actual controls comfortably sized; remove blank canvas before scaling +// text/knobs down. Reused by the editor renderer and the Windows smoke tests. +struct EditorMetrics { + static constexpr int minWidth=660, minHeight=490; + static constexpr int defaultWidth=704, defaultHeight=520; + static constexpr int maxWidth=1040, maxHeight=780; + static constexpr int miniHeight=330; // preserve MINI meter readability + static constexpr int headerHeight=62, displayTop=64; + static constexpr int displayBottomReserve=260; + static constexpr int bottomControlsReserve=92; + static constexpr juce::uint32 captionRgb=0xffd9e0e3; + static constexpr juce::uint32 controlCaptionRgb=0xffe4e9ec; + static constexpr juce::uint32 headerBackgroundRgb=0xff292d30; + static constexpr juce::uint32 metalBackgroundRgb=0xff454a4d; +}; + struct HeaderLayout { juce::Rectangle logo,mini,model,preset,compare,file,bypass; static HeaderLayout calculate(int width) noexcept { - constexpr int inset=14,gap=10; - constexpr int logoW=137,miniW=46,modelW=112,compareW=48,fileW=50,bypassW=114; + constexpr int inset=12,gap=8; + constexpr int logoW=126,miniW=42,modelW=96,compareW=40,fileW=44,bypassW=110; constexpr int fixed=logoW+miniW+modelW+compareW+fileW+bypassW; - const int presetW=juce::jlimit(144,176,width-2*inset-6*gap-fixed); - constexpr int top=24,height=28; + const int available=width-2*inset-6*gap-fixed; + const int presetW=juce::jlimit(124,154,available); + constexpr int top=22,height=27; HeaderLayout h; int x=inset; - h.logo={x,17,logoW,32};x+=logoW+gap; + h.logo={x,17,logoW,29};x+=logoW+gap; h.mini={x,top,miniW,height};x+=miniW+gap; h.model={x,top,modelW,height};x+=modelW+gap; h.preset={x,top,presetW,height}; - - // The right-side actions remain right-aligned when the editor grows. - // Any additional width becomes intentional whitespace, not a huge preset. + // Reserve the right actions; extra width becomes breathing room. h.bypass={width-inset-bypassW,top,bypassW,height}; h.file={h.bypass.getX()-gap-fileW,top,fileW,height}; h.compare={h.file.getX()-gap-compareW,top,compareW,height}; diff --git a/tests/PluginSmoke.cpp b/tests/PluginSmoke.cpp index 757f723..fe299fc 100644 --- a/tests/PluginSmoke.cpp +++ b/tests/PluginSmoke.cpp @@ -387,28 +387,49 @@ int main(int argc,char** argv) { file.deleteFile(); juce::AudioBuffer buffer(2,128);juce::MidiBuffer midi; for(int j=0;j<1000;++j) {buffer.clear();buffer.setSample(0,0,0.5f);processor.processBlock(buffer,midi);} - // Full toolbar geometry across minimum/default/wide editor widths: - // consistent 10px gaps, uniform baseline and bounded preset dropdown. - for(const int width : {740,780,900,1200}) { + // WCAG contrast checks for both caption layers at their real materials. + // These deliberately fail if captions regress to faint gray on gray. + { + const auto luminance=[](juce::Colour c) { + const auto channel=[](float v) { + return v<=0.04045f ? v/12.92f: + std::pow((v+0.055f)/1.055f,2.4f); + }; + return 0.2126f*channel(c.getFloatRed())+ + 0.7152f*channel(c.getFloatGreen())+ + 0.0722f*channel(c.getFloatBlue()); + }; + const auto contrast=[&](juce::Colour fg,juce::Colour bg) { + const auto a=luminance(fg),b=luminance(bg); + return (std::max(a,b)+0.05f)/(std::min(a,b)+0.05f); + }; + if(contrast(juce::Colour{arson::ui::EditorMetrics::controlCaptionRgb}, + juce::Colour{arson::ui::EditorMetrics::metalBackgroundRgb})<4.5f || + contrast(juce::Colour{arson::ui::EditorMetrics::captionRgb}, + juce::Colour{arson::ui::EditorMetrics::headerBackgroundRgb})<4.5f) + return 66; + } + // Header invariants for minimum, default, legacy and maximum widths. + for(const int width : {660,704,780,1040}) { const auto h=arson::ui::HeaderLayout::calculate(width); const std::array,7> fields{ h.logo,h.mini,h.model,h.preset,h.compare,h.file,h.bypass}; - if(h.preset.getWidth()<144||h.preset.getWidth()>176|| - h.bypass.getRight()!=width-14||h.logo.getX()!=14)return 62; + if(h.preset.getWidth()<124||h.preset.getWidth()>154|| + h.bypass.getRight()!=width-12||h.logo.getX()!=12)return 62; for(std::size_t i=1;iwidth-14 || + if(fields[i].getX()-fields[i-1].getRight()<8 || + fields[i].getRight()>width-12 || fields[i].getWidth()<=0)return 63; - if(fields[i].getY()!=24||fields[i].getHeight()!=28)return 64; + if(fields[i].getY()!=22||fields[i].getHeight()!=27)return 64; } } for(int iteration=0;iteration<8;++iteration) { std::unique_ptr editor(processor.createEditor()); if(!editor->findChildWithID("preset.save") || !editor->findChildWithID("preset.load")) return 18; - editor->setSize(iteration%2 ? 740 : 780,iteration%2 ? 585 : 640); - if(editor->getWidth()!=(iteration%2 ? 740 : 780) || - editor->getHeight()!=(iteration%2 ? 585 : 640))return 9; + editor->setSize(iteration%2 ? 660 : 704,iteration%2 ? 490 : 520); + if(editor->getWidth()!=(iteration%2 ? 660 : 704) || + editor->getHeight()!=(iteration%2 ? 490 : 520))return 9; auto* threshold=editor->findChildWithID("param.threshold"); auto* input=editor->findChildWithID("param.input"); auto* ratio=editor->findChildWithID("param.ratio"); @@ -571,7 +592,7 @@ int main(int argc,char** argv) { if(!stream || !juce::PNGImageFormat{}.writeImageToStream(compactImage,*stream))return 13; } mini->onClick(); - if(editor->getHeight()!=640)return 14; + if(editor->getHeight()!=520)return 14; } auto image=editor->createComponentSnapshot(editor->getLocalBounds()); if(image.isNull())return 3; From 209b069439fea10818488517ddc65ba418ac81fc Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sat, 31 Oct 2026 21:44:15 +0700 Subject: [PATCH 3/3] Guard compact startup size, knob/footer clearance and caption contrast --- tests/PluginSmoke.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/PluginSmoke.cpp b/tests/PluginSmoke.cpp index fe299fc..3f9b8b7 100644 --- a/tests/PluginSmoke.cpp +++ b/tests/PluginSmoke.cpp @@ -8,6 +8,8 @@ #include #include #include +#include +#include int main(int argc,char** argv) { juce::ScopedJuceInitialiser_GUI gui; // Quantitative edge-dissolve contract: endpoints transparent, the @@ -425,6 +427,10 @@ int main(int argc,char** argv) { } for(int iteration=0;iteration<8;++iteration) { std::unique_ptr editor(processor.createEditor()); + if(iteration==0 && + (editor->getWidth()!=arson::ui::EditorMetrics::defaultWidth || + editor->getHeight()!=arson::ui::EditorMetrics::defaultHeight)) + return 68; if(!editor->findChildWithID("preset.save") || !editor->findChildWithID("preset.load")) return 18; editor->setSize(iteration%2 ? 660 : 704,iteration%2 ? 490 : 520); @@ -485,6 +491,12 @@ int main(int argc,char** argv) { if(!hp||!lp||!detector||!autoMode||!external||!listen|| !style||!presets||!save||!load||!file||!compare||!bypass|| !dynTab||!scTab||!range||!mix)return 21; + // Footer controls and the 7 primary rotary knobs must never collide + // at the new compact minimum height. + if(input->getBottom()+5>dynTab->getY() || + threshold->getBottom()+5>dynTab->getY() || + dynTab->getBottom()>range->getY()+1 || + scTab->getBottom()>mix->getY()+1)return 67; // Actual JUCE component positions must match the shared header grid; // this catches collisions and regressions in MINI/FULL resizing. const auto header=arson::ui::HeaderLayout::calculate(editor->getWidth());