limit);
+ el.setAttribute('aria-label',valid?('Simulated '+id+' '+next):(id+' unavailable'));
+ }
}
// v0.3: demo-only FX catalog. Items represent mock plugins, not installed VST3 binaries.
const pluginCatalog=[
diff --git a/src/Main.cpp b/src/Main.cpp
index 7174f6f59..67733814e 100644
--- a/src/Main.cpp
+++ b/src/Main.cpp
@@ -92,6 +92,24 @@ class Browser final : public juce::WebBrowserComponent
public:
explicit Browser (Options options) : WebBrowserComponent (std::move (options)) {}
bool loaded = false;
+ // Paint a lightweight native first-frame while WebView2 spins up. This is
+ // entirely static JUCE graphics, not an overlay CSS compositor or timer.
+ // The embedded browser owns the content as soon as its authenticated
+ // arMixGuiReady event arrives.
+ void paint (juce::Graphics& g) override
+ {
+ if (loaded) return;
+ g.fillAll (juce::Colour (0xff111b23));
+ g.setColour (juce::Colour (0xff58cdeb));
+ g.setFont (juce::FontOptions (22.0f, juce::Font::plain));
+ g.drawText ("ArSonMix", getLocalBounds().withTrimmedTop (getHeight() / 2 - 36)
+ .removeFromTop (30), juce::Justification::centred);
+ g.setColour (juce::Colour (0xff94adbb));
+ g.setFont (juce::FontOptions (12.0f));
+ g.drawText ("Loading mixer interface", getLocalBounds().withTrimmedTop (
+ getHeight() / 2 + 4).removeFromTop (24),
+ juce::Justification::centred);
+ }
// An Internet Explorer error page can trigger this callback too.
// Only arMixGuiReady from our final JS script authenticates readiness.
void pageFinishedLoading (const juce::String&) override {}
@@ -159,7 +177,12 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr
presets_ (settingsDirectory().getChildFile ("presets"), settingsDirectory()),
browser_ (webViewOptions()
.withNativeIntegrationEnabled()
- .withEventListener ("arMixGuiReady", [this] (juce::var) { browser_.loaded = true; })
+ .withEventListener ("arMixGuiReady", [this] (juce::var)
+ {
+ browser_.loaded = true;
+ guiReadyTick_ = juce::Time::getMillisecondCounter();
+ browser_.repaint();
+ })
.withEventListener ("arMixParameter", [this] (juce::var args) { onParameter (args); })
.withEventListener ("arMixAction", [this] (juce::var args) { onAction (args); })
.withResourceProvider (assetFor))
@@ -173,13 +196,13 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr
centreWithSize (1650, 930);
setVisible (true);
- auto saved = juce::XmlDocument::parse (machineSettingsDirectory().getChildFile ("audio-devices.xml"));
- startupError_ = engine_.start (saved.get());
- engine_.devices().addChangeListener (this);
- diagnostics_.record ("STARTUP", startupError_.isEmpty() ? "Audio device initialized" : startupError_);
+ // Begin WebView navigation BEFORE any synchronous JUCE driver setup.
+ // Device startup on cold PCs otherwise blocks the very first GUI.
webViewStartupTick_ = juce::Time::getMillisecondCounter();
browser_.goToURL (juce::WebBrowserComponent::getResourceProviderRoot());
startTimerHz (12);
+ // The existing 12Hz message-thread tick starts the audio engine after
+ // an authenticated GUI handshake and initial compositor paint.
// Defer initial scan until explicitly requested in Plugin Manager.
// Startup must not spend seconds enumerating third-party VST3 modules.
}
@@ -215,6 +238,8 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr
bool initialStateSent_ = false;
bool webViewStartupNoticeSent_ = false;
juce::uint32 webViewStartupTick_ = 0;
+ juce::uint32 guiReadyTick_ = 0;
+ bool audioEngineStarted_ = false;
bool setupLaunching_ = false;
unsigned int timerTicks_ = 0;
bool deviceSettingsDirty_ = false;
@@ -1436,6 +1461,21 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr
" Check the WebView2 Runtime and browser-cache folder permissions.");
return;
}
+ // First visible GUI frame must precede device discovery. Reuse the
+ // existing timer; never add a worker or poll the audio callback.
+ if (!audioEngineStarted_)
+ {
+ if (!browser_.loaded ||
+ juce::Time::getMillisecondCounter() - guiReadyTick_ < 150u)
+ return;
+ audioEngineStarted_ = true;
+ auto saved = juce::XmlDocument::parse (
+ machineSettingsDirectory().getChildFile ("audio-devices.xml"));
+ startupError_ = engine_.start (saved.get());
+ engine_.devices().addChangeListener (this);
+ diagnostics_.record ("STARTUP",
+ startupError_.isEmpty() ? "Audio device initialized" : startupError_);
+ }
// ONE actionable notice per unexpected DIRECT reroute. The audio
// callback has already zero-filled output atomically; status, log and
// WebView notifications belong only on this JUCE control timer.
diff --git a/tests/main_v08_native_integration_test.mjs b/tests/main_v08_native_integration_test.mjs
index 87485d986..051d4673c 100644
--- a/tests/main_v08_native_integration_test.mjs
+++ b/tests/main_v08_native_integration_test.mjs
@@ -9,7 +9,7 @@ test('GUI v0.8 remains the canonical host, not an older v0.5 reset',()=>{
assert.match(app,/function openChannelIdentity\(/);
assert.match(app,/function masterFxRows\(/);
assert.match(app,/class="master-analysis"/);
- assert.match(app,/LUFS-I/);
+ assert.ok(app.includes('
LUFS'));
assert.match(app,/dBTP/);
assert.match(html,/id="channelIdentity"/);
assert.match(css,/rail-input-footer/);
@@ -68,3 +68,23 @@ test('native plugin state and graph preserved',()=>{
assert.match(bridge,/Master PAN DSP not yet implemented/);
assert.match(bridge,/data-fxpower/);
});
+
+test('startup never opens an audio device before the WebView2 GUI handshake',()=>{
+ const constructor=main.slice(main.indexOf('ConsoleWindow()'),main.indexOf('~ConsoleWindow()'));
+ const ready=constructor.indexOf('browser_.goToURL');
+ assert.ok(ready>=0,'GUI navigation must be started from constructor');
+ assert.ok(!constructor.includes('engine_.start ('),'synchronous audio startup must not block the first WebView frame');
+ const timer=main.slice(main.indexOf('void timerCallback() override'));
+ const readyGate=timer.indexOf('if (!audioEngineStarted_)');
+ const startup=timer.indexOf('engine_.start (saved.get())');
+ assert.ok(readyGate>=0&&startup>readyGate);
+ assert.ok(timer.includes('browser_.loaded')&&timer.includes('guiReadyTick_ < 150u'));
+});
+test('master readout remains native-unavailable until measured BS.1770/true peak exists',()=>{
+ assert.match(app,/updateMasterAnalysisPreview\(-31\+/);
+ assert.match(app,/\['masterLufs',lufs,-12\]/);
+ assert.match(app,/\['masterDbtp',dbtp,-1\]/);
+ assert.match(bridge,/lufs\.textContent="—"/);
+ assert.match(bridge,/tp\.textContent="—"/);
+ assert.doesNotMatch(app, /STREAM LEVELS
SIM<\/span>/);
+});
diff --git a/tests/ui_smoke.py b/tests/ui_smoke.py
index 454d19266..66fc615bd 100644
--- a/tests/ui_smoke.py
+++ b/tests/ui_smoke.py
@@ -18,6 +18,44 @@ def shared_shadow_shape(shadow):
assert await page.locator(".strip").count()==11
assert await page.locator("#channelList [data-choose]").count()==10
assert await page.locator("[data-strip=\"10\"], [data-strip=\"11\"]").count()==0
+
+ # P0 visual fix: mono gets ONE recessed LED slot, stereo gets TWO.
+ # Existing 7px segment rendering and physical meter semantics are untouched.
+ lcd=await page.evaluate("""()=>{
+ const mono=document.querySelector('#mixer .strip:not(.master-strip) .vu-bank.is-mono');
+ const stereo=document.querySelector('#mixer .strip:not(.master-strip) .vu-bank.is-stereo');
+ const master=document.querySelector('#masterLeft .vu-bank');
+ const bars=e=>e.querySelector('.vu-bars');
+ const style=e=>getComputedStyle(e);
+ const read=document.querySelector('#masterLeft .master-analysis');
+ const labels=[...read.querySelectorAll('.master-info-row span')].map(x=>x.textContent);
+ updateMasterAnalysisPreview(-11.5,-.5);
+ const hot=[document.querySelector('#masterLufs').classList.contains('over-limit'),
+ document.querySelector('#masterDbtp').classList.contains('over-limit')];
+ updateMasterAnalysisPreview(-12,-1);
+ const edge=[document.querySelector('#masterLufs').classList.contains('over-limit'),
+ document.querySelector('#masterDbtp').classList.contains('over-limit')];
+ return {monoBars:bars(mono).getBoundingClientRect().width,
+ stereoBars:bars(stereo).getBoundingClientRect().width,
+ monoBank:mono.getBoundingClientRect().width,
+ stereoBank:stereo.getBoundingClientRect().width,
+ masterBars:bars(master).getBoundingClientRect().width,
+ physicalMono:mono.querySelectorAll('.meter').length,
+ physicalStereo:stereo.querySelectorAll('.meter').length,
+ innerShadow:style(bars(mono)).boxShadow,
+ border:style(bars(mono)).borderTopWidth,
+ lcdBackground:style(read).backgroundImage, lcdBorder:style(read).borderTopWidth,
+ labels,kicker:!!read.querySelector('.master-info-kicker'),
+ hot,edge};
+ }""")
+ assert lcd['monoBars']==14 and lcd['stereoBars']==30 and lcd['masterBars']==30,lcd
+ assert lcd['monoBank']==35 and lcd['stereoBank']==51,lcd
+ assert lcd['physicalMono']==1 and lcd['physicalStereo']==2,lcd
+ assert 'inset' in lcd['innerShadow'] and lcd['border']=='0px',lcd
+ assert lcd['labels']==['LUFS','dBTP'] and not lcd['kicker'],lcd
+ assert lcd['hot']==[True,True] and lcd['edge']==[False,False],lcd
+ assert 'gradient' in lcd['lcdBackground'] and lcd['lcdBorder']=='0px',lcd
+
# Issue #56: defaults preserve geometry; mode CSS isolates hover/layers.
assert await page.evaluate("""()=>document.documentElement.dataset.mixperf==='optimized'
&& !window.__arMixPerfProbe""")
@@ -292,8 +330,9 @@ def shared_shadow_shape(shadow):
assert await page.locator('#masterPeakDb').count()==0
assert await page.locator('#masterLufs').count()==1
assert await page.locator('#masterDbtp').count()==1
- assert 'SIM' in await page.locator('#masterLeft .master-analysis').inner_text()
- assert 'LUFS-I' in await page.locator('#masterLeft .master-analysis').inner_text()
+ assert 'SIM' not in await page.locator('#masterLeft .master-analysis').inner_text()
+ assert 'LUFS' in await page.locator('#masterLeft .master-analysis').inner_text()
+ assert 'simulated' in (await page.locator('#masterLeft .master-analysis').get_attribute('title')).lower()
# Buttons must describe and perform actual distinct actions: no "..." blank cap.
assert await page.locator('.left-rail #addScene').inner_text()=='+ SAVE SNAPSHOT'
assert await page.locator('.left-rail #saveFxPreset').inner_text()=='SAVE FX'
@@ -878,14 +917,17 @@ def same_rect(a,b):
assert [s['count'] for s in module_layout]==[1]*6+[2]*5,module_layout
for s in module_layout:
assert s['dom']==['VU','FADER','SCALE'],s
- assert abs(s['bank']['w']-51)<.3 and abs(s['ruler']['w']-26)<.3,s
+ assert abs(s['bank']['w']-(35 if s['count']==1 else 51))<.3 and abs(s['ruler']['w']-26)<.3,s
assert s['bank']['r']+2=s['zone']['l']-1 and s['ruler']['r']<=s['zone']['r']+1,s
assert all(abs(m['w']-14)<.3 for m in s['meters']),s
assert s['rail']['w']>=36 and s['rail']['h']>150,s
- # Mono and stereo strips share an identically located central rail.
- rail_x=[s['rail']['l']-s['zone']['l'] for s in module_layout[:10]]
- assert max(rail_x)-min(rail_x)<1,rail_x
+ # Mono's narrower well intentionally releases 16px to its fader.
+ # Same-format strips retain precisely aligned central rail offsets.
+ mono_x=[s['rail']['l']-s['zone']['l'] for s in module_layout[:10] if s['count']==1]
+ stereo_x=[s['rail']['l']-s['zone']['l'] for s in module_layout[:10] if s['count']==2]
+ assert max(mono_x)-min(mono_x)<1 and max(stereo_x)-min(stereo_x)<1,(mono_x,stereo_x)
+ assert abs((stereo_x[0]-mono_x[0])-16)<1,(mono_x,stereo_x)
assert all(abs(v['unit']-14)<.3 and abs(v['meter']-14)<.3 and abs(v['fill']-10)<.6 and v['clip'] for v in vu_geometry),vu_geometry
assert len(set(v['gradient'] for v in vu_geometry))==1, 'VU palette must match across all L/R/mono bars'
diff --git a/web/app.js b/web/app.js
index 834deeb6e..714869dd7 100644
--- a/web/app.js
+++ b/web/app.js
@@ -270,7 +270,7 @@ function makeStrip(ch,i){let inserts=ch.inserts.slice(0,6);while(inserts.length<
${i+1}
${inserts.map((n,j)=>`
${n?``:''}
`).join('')}
${knobMarkup('trim',i,ch.trim,'Trim')}
${panMarkup(ch,i)}
L${panText(ch.pan)}R
- ${fmt(ch.fader)}
${ch.stereo?meterUnit(String(i)+'L','L')+meterUnit(String(i)+'R','R'):meterUnit(String(i),'')}
${meterScaleMarkup()}
${faderScaleMarkup()}